@arkyn/components 3.0.5 → 3.0.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","names":[],"sources":["../src/components/alert/alertTitle/index.tsx","../src/components/alert/alertContainer/index.tsx","../src/components/alert/alertContent/index.tsx","../src/components/alert/alertDescription/index.tsx","../src/components/alert/alertIcon/index.tsx","../src/hooks/useSlider.ts","../src/components/slider/index.tsx","../src/components/audioPlayer/index.tsx","../src/providers/formProvider.tsx","../src/hooks/useForm.ts","../src/components/fieldError/index.tsx","../src/components/fieldLabel/index.tsx","../src/components/fieldWrapper/index.tsx","../src/services/iconRenderer.tsx","../src/components/button/index.tsx","../src/components/divider/index.tsx","../src/components/iconButton/index.tsx","../src/components/tooltip/index.tsx","../src/components/audioUpload/hasFileContent/index.tsx","../src/components/audioUpload/noFileContent/index.tsx","../src/components/audioUpload/index.tsx","../src/components/badge/index.tsx","../src/components/calendar/_viewService.ts","../src/components/calendar/_calendarProvider.tsx","../src/components/calendar/calendarContainer/index.tsx","../src/services/fieldTemplate.tsx","../src/components/select/selectChevron/index.tsx","../src/components/select/selectContainer/index.tsx","../src/components/select/selectContent/index.tsx","../src/components/select/selectOption/index.tsx","../src/hooks/useScrollLock.ts","../src/components/input/index.tsx","../src/components/select/selectOptionsContainer/index.tsx","../src/components/select/selectOverlay/index.tsx","../src/components/select/selectSpinner/index.tsx","../src/components/select/index.tsx","../src/components/calendar/calendarHeader/index.tsx","../src/components/calendar/calendarTableTd/index.tsx","../src/components/calendar/calendarTableBody/index.tsx","../src/components/calendar/calendarTableContainer/index.tsx","../src/components/calendar/calendarTableHeader/index.tsx","../src/components/calendar/index.tsx","../src/components/cardTab/cardTabContext.tsx","../src/components/cardTab/cardTabButton/index.tsx","../src/components/cardTab/cardTabContainer/index.tsx","../src/components/checkbox/index.tsx","../src/hooks/useHydrated.ts","../src/components/clientOnly.tsx","../src/services/maskCurrencyValues.ts","../src/components/currencyInput/index.tsx","../src/components/datePicker/datePickerCalendarContainer/index.tsx","../src/components/datePicker/datePickerChevron/index.tsx","../src/components/datePicker/datePickerContainer/index.tsx","../src/components/datePicker/datePickerContent/index.tsx","../src/components/datePicker/datePickerOverlay/index.tsx","../src/components/datePicker/datePickerSpinner/index.tsx","../src/components/datePicker/index.tsx","../src/components/drawer/drawerContext.tsx","../src/components/drawer/drawerContainer/index.tsx","../src/components/drawer/drawerHeader/index.tsx","../src/components/facebookPixel/pixel.ts","../src/components/facebookPixel/facebookPixel.client.tsx","../src/components/facebookPixel/index.tsx","../src/components/fileUpload/hasFileContent/index.tsx","../src/components/fileUpload/noFileContent/index.tsx","../src/components/fileUpload/index.tsx","../src/components/fullCalendar/_viewService.ts","../src/components/fullCalendar/_fullCalendarProvider.tsx","../src/components/fullCalendar/dayCalendar/dayCalendarContainer/index.tsx","../src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx","../src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx","../src/components/fullCalendar/dayCalendar/index.tsx","../src/components/fullCalendar/fullCalendarContainer/index.tsx","../src/components/fullCalendar/fullCalendarHeader/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.tsx","../src/components/fullCalendar/monthlyCalendar/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarEvent/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.tsx","../src/components/fullCalendar/weekCalendar/index.tsx","../src/components/fullCalendar/index.tsx","../src/components/googleAnalytics/snippets/generateGAElements.ts","../src/components/googleAnalytics/googleAnalytics.tsx","../src/components/googleAnalytics/googleAnalytics.client.tsx","../src/components/googleAnalytics/index.tsx","../src/components/googleTagManager/snippets/appendToDataLayer.ts","../src/components/googleTagManager/snippets/generateGTMElements.ts","../src/components/googleTagManager/googleTagManager.tsx","../src/components/googleTagManager/googleTagManager.client.tsx","../src/components/googleTagManager/index.tsx","../src/components/imageUpload/hasFileContent/index.tsx","../src/components/imageUpload/noFileContent/index.tsx","../src/components/imageUpload/index.tsx","../src/components/mapView/mapView.client.tsx","../src/components/mapView/index.tsx","../src/components/maskedInput/index.tsx","../src/components/modal/modalContext.tsx","../src/components/modal/modalContainer/index.tsx","../src/components/modal/modalFooter/index.tsx","../src/components/modal/modalHeader/index.tsx","../src/components/multiSelect/multiSelectChevron/index.tsx","../src/components/multiSelect/multiSelectContainer/index.tsx","../src/components/multiSelect/multiSelectContent/index.tsx","../src/components/multiSelect/multiSelectMark/index.tsx","../src/components/multiSelect/multiSelectOption/index.tsx","../src/components/multiSelect/multiSelectOptionsContainer/index.tsx","../src/components/multiSelect/multiSelectOverlay/index.tsx","../src/components/multiSelect/multiSelectSpinner/index.tsx","../src/components/multiSelect/index.tsx","../src/components/pagination/chevronButton/index.tsx","../src/components/pagination/currentButton/index.tsx","../src/components/pagination/pageButton/index.tsx","../src/components/pagination/paginationService.ts","../src/components/pagination/spread/index.tsx","../src/components/pagination/index.tsx","../src/utils/phoneInputUtilities.ts","../src/components/phoneInput/phoneInputContainer/index.tsx","../src/components/phoneInput/phoneInputCountriesOverlay/index.tsx","../src/components/phoneInput/phoneInputCountryOption/index.tsx","../src/components/phoneInput/phoneInputCountryOptionsContainer/index.tsx","../src/components/phoneInput/phoneInputCountrySelector/index.tsx","../src/components/phoneInput/phoneInputMask/index.tsx","../src/components/phoneInput/index.tsx","../src/components/popover/index.tsx","../src/components/radio/radioContext.tsx","../src/components/radio/radioBox/index.tsx","../src/components/radio/radioGroup/index.tsx","../src/services/extractTextFromNode.ts","../src/services/isMarkActive.ts","../src/services/toggleMark.ts","../src/templates/richTextTemplates.ts","../src/services/isBlockActive.ts","../src/services/toggleBlock.ts","../src/components/richText/blockButton/index.tsx","../src/components/richText/element/index.tsx","../src/components/tab/tabContext.tsx","../src/components/tab/tabButton/index.tsx","../src/components/tab/tabContainer/index.tsx","../src/components/richText/insertImage/index.tsx","../src/services/isValidHttpsUrl.ts","../src/components/richText/insertLink/index.tsx","../src/components/richText/insertVideo/index.tsx","../src/components/richText/leaf/index.tsx","../src/components/richText/markButton/index.tsx","../src/components/richText/toolbar/index.tsx","../src/components/richText/index.tsx","../src/components/searchPlaces.tsx","../src/components/switch/index.tsx","../src/components/table/tableBody/index.tsx","../src/components/table/tableCaption/index.tsx","../src/components/table/tableContainer/index.tsx","../src/components/table/tableFooter/index.tsx","../src/components/table/tableHeader/index.tsx","../src/components/textarea/index.tsx","../src/templates/badResponses.ts","../src/templates/successResponses.ts","../src/providers/modalProvider.tsx","../src/hooks/useModal.ts","../src/providers/toastProvider.tsx","../src/hooks/useToast.ts","../src/hooks/useAutomation.ts","../src/providers/drawerProvider.tsx","../src/hooks/useDrawer.ts","../src/hooks/useScopedParams.ts","../src/hooks/useSearchAutomation.ts","../src/providers/placesProvider.tsx","../src/utils/richTextUtilities.ts","../src/services/toHtml.ts","../src/services/toRichTextValue.ts"],"sourcesContent":["import type { HTMLAttributes, JSX } from \"react\";\nimport \"./styles.css\";\n\ntype AlertTitleProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * AlertTitle, bold heading for an alert. Place inside `AlertContent`.\n *\n * Its presence is detected by `AlertContainer` to switch the layout from centered to left-aligned.\n * Accepts all standard `<div>` HTML attributes.\n *\n * @returns AlertTitle JSX element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"danger\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Access denied</AlertTitle>\n * <AlertDescription>You don't have permission to view this page.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\nfunction AlertTitle(props: AlertTitleProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst className = `arkynAlertTitle ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { AlertTitle };\n","import {\n\tcreateContext,\n\ttype HTMLAttributes,\n\ttype JSX,\n\ttype ReactNode,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\nimport { AlertTitle } from \"../alertTitle\";\nimport \"./styles.css\";\n\ntype AlertContainerProps = {\n\t/**\n\t * Visual style and semantic meaning.\n\t * - `success`: green, operation completed.\n\t * - `danger`: red, error or destructive action.\n\t * - `warning`: yellow, caution required.\n\t * - `info`: blue, informational message.\n\t */\n\tscheme: \"success\" | \"danger\" | \"warning\" | \"info\";\n} & HTMLAttributes<HTMLDivElement>;\n\nconst AlertContainerContext = createContext({} as AlertContainerProps);\n\n/** @internal Accesses the schema and HTML props of the enclosing `AlertContainer`. */\nfunction useAlertContainer(): AlertContainerProps {\n\treturn useContext(AlertContainerContext);\n}\n\n/**\n * AlertContainer, root wrapper for the Alert component set. Provides schema context to child components.\n *\n * Automatically detects whether an `AlertTitle` is present among children and adjusts layout:\n * centered when no title, left-aligned when a title is present.\n *\n * @param props.scheme - Visual style variant. Required.\n * @param props.children - Alert sub-components: `AlertIcon`, `AlertContent`, `AlertTitle`, `AlertDescription`.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns AlertContainer JSX element.\n *\n * @example\n * ```tsx\n * // Inline alert, no title, centered layout\n * <AlertContainer scheme=\"success\">\n * <AlertIcon />\n * <AlertContent>Your subscription has been activated.</AlertContent>\n * </AlertContainer>\n *\n * // Full alert with title and description, left-aligned layout\n * <AlertContainer scheme=\"danger\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Payment failed</AlertTitle>\n * <AlertDescription>Please check your card details and try again.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\n\nfunction AlertContainer(props: AlertContainerProps): JSX.Element {\n\tconst { scheme, children, className: baseClassName, ...rest } = props;\n\n\tconst hasAlertTitle = (children: ReactNode): boolean => {\n\t\tlet found = false;\n\t\tconst searchForAlertTitle = (nodes: ReactNode) => {\n\t\t\tif (Array.isArray(nodes)) {\n\t\t\t\tnodes.forEach(searchForAlertTitle);\n\t\t\t} else if (nodes && typeof nodes === \"object\" && \"type\" in nodes) {\n\t\t\t\tif (nodes.type === AlertTitle) {\n\t\t\t\t\tfound = true;\n\t\t\t\t} else if (\n\t\t\t\t\tnodes.props &&\n\t\t\t\t\ttypeof nodes.props === \"object\" &&\n\t\t\t\t\tnodes.props !== null &&\n\t\t\t\t\t\"children\" in nodes.props\n\t\t\t\t) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t\t\t\tsearchForAlertTitle((nodes.props as any).children);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tsearchForAlertTitle(children);\n\t\treturn found;\n\t};\n\n\tconst shouldAlignCenter = !hasAlertTitle(children);\n\tconst finalClassName = shouldAlignCenter\n\t\t? \"nonExistsAlertTitle\"\n\t\t: \"existsAlertTitle\";\n\n\tconst className = `arkynAlertContainer ${scheme} ${finalClassName} ${baseClassName}`;\n\n\tconst value = useMemo(() => ({ scheme }), [scheme]);\n\n\treturn (\n\t\t<AlertContainerContext.Provider value={value}>\n\t\t\t<div className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</AlertContainerContext.Provider>\n\t);\n}\n\nexport { AlertContainer, useAlertContainer };\n","import type { HTMLAttributes, JSX } from \"react\";\nimport \"./styles.css\";\n\ntype AlertContentProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * AlertContent, text/content area inside an `AlertContainer`. Wraps `AlertTitle` and `AlertDescription`.\n *\n * Accepts all standard `<div>` HTML attributes.\n *\n * @returns AlertContent JSX element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"warning\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Session expiring</AlertTitle>\n * <AlertDescription>You will be logged out in 5 minutes.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\n\nfunction AlertContent(props: AlertContentProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst className = `arkynAlertContent ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { AlertContent };\n","import type { HTMLAttributes, JSX } from \"react\";\nimport \"./styles.css\";\n\ntype AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * AlertDescription, body text for an alert. Place inside `AlertContent`.\n *\n * Accepts all standard `<div>` HTML attributes.\n *\n * @returns AlertDescription JSX element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"info\">\n * <AlertContent>\n * <AlertTitle>Maintenance scheduled</AlertTitle>\n * <AlertDescription>The service will be unavailable on Sunday from 2–4 AM UTC.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\n\nfunction AlertDescription(props: AlertDescriptionProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst className = `arkynAlertDescription ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { AlertDescription };\n","import {\n\tAlertTriangle,\n\tCheckCircle2,\n\tInfo,\n\ttype LucideProps,\n\tXCircle,\n} from \"lucide-react\";\n\nimport type { JSX } from \"react\";\nimport { useAlertContainer } from \"../alertContainer\";\nimport \"./styles.css\";\n\ntype AlertIconProps = LucideProps;\n\n/**\n * AlertIcon, renders a scheme-appropriate icon from `AlertContainer` context.\n *\n * - `success` → `CheckCircle2`\n * - `danger` → `XCircle`\n * - `warning` → `AlertTriangle`\n * - `info` → `Info`\n *\n * Must be placed inside an `AlertContainer`. Accepts all Lucide icon props.\n *\n * @returns The scheme-matched Lucide icon element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"danger\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Payment failed</AlertTitle>\n * <AlertDescription>Please check your card details.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\nfunction AlertIcon(props: AlertIconProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst { scheme } = useAlertContainer();\n\n\tconst className = `arkynAlertIcon ${scheme} ${baseClassName}`;\n\n\tswitch (scheme) {\n\t\tcase \"success\":\n\t\t\treturn <CheckCircle2 className={className} {...rest} />;\n\t\tcase \"danger\":\n\t\t\treturn <XCircle className={className} {...rest} />;\n\t\tcase \"warning\":\n\t\t\treturn <AlertTriangle className={className} {...rest} />;\n\t\tcase \"info\":\n\t\t\treturn <Info className={className} {...rest} />;\n\t}\n}\n\nexport { AlertIcon };\n","import { useState } from \"react\";\n\ntype UseSliderReturnProps = [number, (number: number) => void];\n\n/**\n * useSlider, state manager for the `Slider` component. Clamps values to `[0, 100]`.\n *\n * @param defaultValue - Initial percentage value (0–100). Default: 0\n *\n * @returns `[value, setValue]`, current percentage and a setter that clamps at the boundaries.\n *\n * @example\n * ```tsx\n * const [volume, setVolume] = useSlider(50);\n * return <Slider value={volume} onChange={setVolume} />;\n * ```\n */\n\nfunction useSlider(defaultValue?: number): UseSliderReturnProps {\n\tfunction getDefaultValue() {\n\t\tif (!defaultValue) return 0;\n\t\tif (defaultValue <= 0) return 0;\n\t\tif (defaultValue >= 100) return 100;\n\t\treturn defaultValue;\n\t}\n\n\tconst [sliderValue, setSliderValue] = useState(getDefaultValue());\n\n\tfunction changeSliderValue(value: number) {\n\t\tif (value <= 0) return setSliderValue(0);\n\t\tif (value >= 100) return setSliderValue(100);\n\t\treturn setSliderValue(value);\n\t}\n\n\treturn [sliderValue, changeSliderValue];\n}\n\nexport { useSlider };\n","import {\n\ttype HTMLAttributes,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport \"./styles.css\";\n\ntype SliderProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Current slider position as a percentage (0–100). Required. */\n\tvalue: number;\n\t/** Callback fired whenever the value changes. Required. */\n\tonChange: (value: number) => void;\n\t/** Disables all drag and click interactions. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */\n\tonDragging?: (isDragging: boolean) => void;\n};\n\n/**\n * Slider, interactive track for selecting a numeric value between 0 and 100.\n *\n * Pair with `useSlider` for managed state.\n *\n * @param props.value - Current position as a percentage (0–100). Required.\n * @param props.onChange - Callback fired on value change. Required.\n * @param props.disabled - Disables interactions. Default: false\n * @param props.onDragging - Callback fired when dragging starts or stops.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Slider JSX element.\n *\n * @example\n * ```tsx\n * // Controlled slider\n * const [value, setValue] = useState(50);\n * <Slider value={value} onChange={setValue} />\n *\n * // With useSlider hook\n * const [value, setValue] = useSlider(25);\n * <Slider value={value} onChange={setValue} onDragging={setIsDragging} />\n *\n * // Disabled\n * <Slider value={75} onChange={() => {}} disabled />\n * ```\n */\n\nfunction Slider(props: SliderProps) {\n\tconst {\n\t\tonChange,\n\t\tvalue,\n\t\tdisabled = false,\n\t\tonDragging,\n\t\tclassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst sliderRef = useRef<HTMLDivElement>(null);\n\n\tconst handleMouseDown = () => setIsDragging(true);\n\tconst handleMouseUp = useCallback(() => setIsDragging(false), []);\n\n\tconst handleMouseMove = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isDragging || !sliderRef.current) return;\n\n\t\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\t\tconst offsetX = event.clientX - rect.left;\n\t\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\t\tonChange(newValue);\n\t\t},\n\t\t[disabled, isDragging, onChange],\n\t);\n\n\tconst handleSliderClick = (event: React.MouseEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\tif (!sliderRef.current) return;\n\n\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\tconst offsetX = event.clientX - rect.left;\n\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\tonChange(newValue);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isDragging) {\n\t\t\tonDragging?.(true);\n\t\t\tdocument.addEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.addEventListener(\"mouseup\", handleMouseUp);\n\t\t} else {\n\t\t\tonDragging?.(false);\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t};\n\t}, [isDragging, onDragging, handleMouseUp, handleMouseMove]);\n\n\tconst isDraggingClass = isDragging ? \"isDragging\" : \"isNotDragging\";\n\tconst disabledClass = disabled ? \"isDisabled\" : \"isEnabled\";\n\tconst sliderClassname = `arkynSliderTrack ${isDraggingClass} ${disabledClass} ${className}`;\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={sliderClassname}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t\tonClick={handleSliderClick}\n\t\t\tref={sliderRef}\n\t\t>\n\t\t\t<div className=\"arkynSliderFill\" style={{ width: `${value}%` }} />\n\t\t\t<div className=\"arkynSliderThumb\" style={{ left: `${value}%` }} />\n\t\t</div>\n\t);\n}\n\nexport { Slider };\n","import { Pause, Play } from \"lucide-react\";\nimport {\n\ttype AudioHTMLAttributes,\n\ttype JSX,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useSlider } from \"../../hooks/useSlider\";\nimport { Slider } from \"../slider\";\nimport \"./styles.css\";\n\n/** Audio state snapshot passed to play/pause callbacks. */\ntype AudioInformationProps = {\n\t/** Current playback position in seconds. */\n\tcurrentTime: number;\n\t/** Total audio duration in seconds. */\n\ttotalTime: number;\n\t/** Current position formatted as `MM:SS`. */\n\tformattedCurrentTime: string;\n\t/** Total duration formatted as `MM:SS`. */\n\tformattedTotalTime: string;\n};\n\ntype AudioPlayerProps = Omit<\n\tAudioHTMLAttributes<HTMLAudioElement>,\n\t\"onEnded\" | \"src\"\n> & {\n\t/** Audio file URL. Required. */\n\tsrc: string;\n\t/** Disables the play/pause button and the progress slider. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when playback starts. Receives the current audio state. */\n\tonPlayAudio?: (props: AudioInformationProps) => void;\n\t/** Callback fired when playback is paused. Receives the current audio state. */\n\tonPauseAudio?: (props: AudioInformationProps) => void;\n};\n\n/**\n * AudioPlayer, play/pause controls, a scrubable progress bar, and elapsed/total time display.\n *\n * @param props.src - Audio file URL. Required.\n * @param props.disabled - Disables controls. Default: false\n * @param props.onPlayAudio - Callback fired when playback starts.\n * @param props.onPauseAudio - Callback fired when playback is paused.\n *\n * **...Other valid HTML properties for `<audio>` (except `onEnded` and `src`)**\n *\n * @returns AudioPlayer JSX element.\n *\n * @example\n * ```tsx\n * // Basic\n * <AudioPlayer src=\"/audio/episode.mp3\" />\n *\n * // With play/pause callbacks\n * <AudioPlayer\n * src=\"/audio/episode.mp3\"\n * onPlayAudio={(info) => console.log(\"Playing at\", info.formattedCurrentTime)}\n * onPauseAudio={(info) => console.log(\"Paused at\", info.formattedCurrentTime)}\n * />\n * ```\n */\nfunction AudioPlayer(props: AudioPlayerProps): JSX.Element {\n\tconst { onPlayAudio, onPauseAudio, disabled, style, ...rest } = props;\n\n\tconst [sliderValue, setSliderValue] = useSlider(0);\n\tconst [isPlaying, setIsPlaying] = useState(false);\n\tconst [isDragging, setIsDragging] = useState(false);\n\n\tconst audioReference = useRef<HTMLAudioElement>(null);\n\n\tconst currentTime = audioReference.current?.currentTime || 0;\n\tconst totalTime = audioReference.current?.duration || 0;\n\n\tconst formattedCurrentTime = formatTime(currentTime);\n\tconst formattedTotalTime = formatTime(totalTime);\n\n\tconst audioInformation: AudioInformationProps = {\n\t\ttotalTime,\n\t\tcurrentTime,\n\t\tformattedCurrentTime,\n\t\tformattedTotalTime,\n\t};\n\n\tfunction formatTime(time?: number): string {\n\t\tif (!time) return \"00:00\";\n\n\t\tconst minutes = Math.floor(time / 60);\n\t\tconst seconds = Math.floor(time % 60);\n\n\t\tconst formattedMinutes = String(minutes).padStart(2, \"0\");\n\t\tconst formattedSeconds = String(seconds).padStart(2, \"0\");\n\n\t\treturn `${formattedMinutes}:${formattedSeconds}`;\n\t}\n\n\tfunction handlePlayAudio(): void {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\t\tif (props.onPlayAudio) props.onPlayAudio(audioInformation);\n\t\taudioElement.play();\n\t\tsetIsPlaying(true);\n\t}\n\n\tfunction handlePauseAudio(): void {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\t\tif (props.onPauseAudio) props.onPauseAudio(audioInformation);\n\t\taudioElement.pause();\n\t\tsetIsPlaying(false);\n\t}\n\n\tfunction handleToggleAudio(): void {\n\t\tif (isPlaying) handlePauseAudio();\n\t\telse handlePlayAudio();\n\t}\n\n\tfunction handleSliderChange(value: number): void {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\n\t\tconst totalTime = audioElement.duration;\n\t\tconst currentTime = (value / 100) * totalTime;\n\n\t\taudioElement.currentTime = currentTime;\n\t}\n\n\tif (isDragging || !isPlaying) {\n\t\taudioReference.current?.pause();\n\t} else if (isPlaying) {\n\t\taudioReference.current?.play();\n\t}\n\n\tuseEffect(() => {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\n\t\tconst handleTimeUpdate = () => {\n\t\t\tconst totalTime = audioElement.duration;\n\t\t\tconst currentTime = audioElement.currentTime;\n\n\t\t\tconst value = (currentTime / totalTime) * 100;\n\t\t\tsetSliderValue(value);\n\t\t};\n\n\t\taudioElement.addEventListener(\"timeupdate\", handleTimeUpdate);\n\n\t\treturn () => {\n\t\t\taudioElement.removeEventListener(\"timeupdate\", handleTimeUpdate);\n\t\t};\n\t}, [setSliderValue]);\n\n\treturn (\n\t\t<div className=\"arkynAudioPlayer\" style={style}>\n\t\t\t<audio\n\t\t\t\t{...rest}\n\t\t\t\tref={audioReference}\n\t\t\t\tsrc={props.src || undefined}\n\t\t\t\tonEnded={handlePauseAudio}\n\t\t\t/>\n\n\t\t\t<button type=\"button\" disabled={disabled} onClick={handleToggleAudio}>\n\t\t\t\t{isPlaying && <Pause />}\n\t\t\t\t{!isPlaying && <Play />}\n\t\t\t</button>\n\n\t\t\t<p>{formattedCurrentTime}</p>\n\n\t\t\t<Slider\n\t\t\t\tvalue={sliderValue}\n\t\t\t\tonChange={handleSliderChange}\n\t\t\t\tonDragging={setIsDragging}\n\t\t\t\tdisabled={disabled}\n\t\t\t/>\n\n\t\t\t<p>{formattedTotalTime}</p>\n\t\t</div>\n\t);\n}\n\nexport { AudioPlayer };\n","import { cloneElement, createContext, type ReactNode, useMemo } from \"react\";\n\ntype FormContextProps = {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors: { [x: string]: any };\n};\n\ntype FormProviderProps = {\n\tchildren: ReactNode;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors?: any;\n\tform?: React.ReactElement;\n};\n\nconst formContext = createContext({} as FormContextProps);\n\n/**\n * FormProvider, distributes field-level validation errors to all form input components in its subtree.\n *\n * All inputs (`Input`, `Select`, `Checkbox`, etc.) read `fieldErrors[name]` automatically,\n * so you don't need to pass errors manually to each field. Use the `form` prop to also wrap\n * children in a `<form>` element (e.g. for Remix `<Form />`).\n *\n * @param props.children - Form fields and other components.\n * @param props.fieldErrors - Map of field name → error message (e.g. from Zod / server validation).\n * @param props.form - Optional `<form>` element to wrap children in (cloned with `children`).\n *\n * @returns FormProvider JSX element.\n *\n * @example\n * ```tsx\n * // With Remix action errors\n * const actionData = useActionData<typeof action>();\n *\n * <FormProvider fieldErrors={actionData?.fieldErrors}>\n * <Input name=\"email\" label=\"Email\" />\n * <Input name=\"password\" label=\"Password\" type=\"password\" />\n * <Button type=\"submit\">Login</Button>\n * </FormProvider>\n * ```\n */\n\nfunction FormProvider(props: FormProviderProps) {\n\tconst { children, fieldErrors, form } = props;\n\n\tconst value = useMemo(() => ({ fieldErrors }), [fieldErrors]);\n\n\treturn (\n\t\t<formContext.Provider value={value}>\n\t\t\t{!form && children}\n\t\t\t{form &&\n\t\t\t\tcloneElement(\n\t\t\t\t\tform as React.ReactElement,\n\t\t\t\t\tform.props as React.ReactElement,\n\t\t\t\t\tchildren,\n\t\t\t\t)}\n\t\t</formContext.Provider>\n\t);\n}\n\nexport { FormProvider, formContext };\n","import { useContext } from \"react\";\nimport { formContext } from \"../providers/formProvider\";\n\n/**\n * useForm, reads the nearest `FormProvider` context to access field-level validation errors.\n *\n * All form inputs (`Input`, `Select`, `Checkbox`, etc.) call this hook internally,\n * so you rarely need it directly. Use it when you want to read errors outside of\n * an input component, or build a custom input.\n *\n * @returns Form context containing:\n * - `fieldErrors`, `Record<string, string>` mapping field names to error messages.\n *\n * @example\n * ```tsx\n * // Wrapping a form with FormProvider\n * function App() {\n * return (\n * <FormProvider fieldErrors={{ email: \"Invalid email\" }}>\n * <MyForm />\n * </FormProvider>\n * );\n * }\n *\n * // Reading errors manually\n * function CustomField() {\n * const { fieldErrors } = useForm();\n * return <span>{fieldErrors?.username}</span>;\n * }\n * ```\n */\n\nfunction useForm() {\n\tconst context = useContext(formContext);\n\treturn context;\n}\n\nexport { useForm };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype FieldErrorProps = HTMLAttributes<HTMLElement>;\n\n/**\n * FieldError, displays a validation error message below a form field.\n *\n * Renders nothing when `children` is empty or falsy.\n *\n * **...Other valid HTML properties for `<strong>`**\n *\n * @returns FieldError `<strong>` element, or an empty fragment when there is no message.\n *\n * @example\n * ```tsx\n * <FieldError>This field is required</FieldError>\n *\n * {error && <FieldError>{error}</FieldError>}\n * ```\n */\n\nfunction FieldError(props: FieldErrorProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynFieldError ${baseClassName}`;\n\n\tif (!children) return null;\n\n\treturn (\n\t\t<strong className={className.trim()} {...rest}>\n\t\t\t{children}\n\t\t</strong>\n\t);\n}\n\nexport { FieldError };\n","import type { LabelHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype FieldLabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n\t/** When true, appends an asterisk (*) to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n};\n\n/**\n * FieldLabel, label for form fields, with an optional required-field asterisk.\n *\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n *\n * **...Other valid HTML properties for `<label>`**\n *\n * @returns FieldLabel JSX element.\n *\n * @example\n * ```tsx\n * <FieldLabel htmlFor=\"email\" showAsterisk>Email Address</FieldLabel>\n * ```\n */\n\nfunction FieldLabel(props: FieldLabelProps) {\n\tconst {\n\t\tshowAsterisk = false,\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst show = showAsterisk ? \"asteriskTrue\" : \"asteriskFalse\";\n\tconst className = `arkynFieldLabel ${show} ${baseClassName}`;\n\n\t// biome-ignore lint/a11y/noLabelWithoutControl: htmlFor is passed via ...rest\n\treturn <label className={className.trim()} {...rest} />;\n}\n\nexport { FieldLabel };\n","import type { HTMLAttributes, ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype FieldWrapperProps = HTMLAttributes<HTMLElement> & {\n\t/** Field elements to render inside the wrapper (label, input, error, etc.). Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Layout orientation of the wrapper.\n\t * @default \"vertical\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n};\n\n/**\n * FieldWrapper, `<section>` container that groups a form field with its label and error message.\n *\n * @param props.children - Field elements (label, input, error, etc.).\n * @param props.orientation - Layout direction. Default: \"vertical\"\n *\n * **...Other valid HTML properties for `<section>`**\n *\n * @returns FieldWrapper JSX element.\n *\n * @example\n * ```tsx\n * <FieldWrapper>\n * <FieldLabel showAsterisk>Email</FieldLabel>\n * <Input name=\"email\" type=\"email\" />\n * <FieldError>Invalid email address</FieldError>\n * </FieldWrapper>\n * ```\n */\n\nfunction FieldWrapper(props: FieldWrapperProps) {\n\tconst {\n\t\tchildren,\n\t\tclassName: baseClassName,\n\t\torientation = \"vertical\",\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynFieldWrapper ${baseClassName} ${orientation}`;\n\n\treturn (\n\t\t<section className={className.trim()} {...rest}>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { FieldWrapper };\n","import type { LucideIcon } from \"lucide-react\";\n\ntype IconRendererProps = {\n\ticonSize: number;\n\tclassName?: string;\n\ticon?: LucideIcon | string;\n\tshow?: boolean;\n};\n\nfunction IconRenderer(props: IconRendererProps) {\n\tconst { iconSize, icon: Icon, className, show = true } = props;\n\n\tif (!show) return null;\n\tif (!Icon) return null;\n\n\tif (typeof Icon === \"string\") {\n\t\treturn <p className={className}>{Icon}</p>;\n\t}\n\n\treturn <Icon size={iconSize} strokeWidth={2.5} className={className} />;\n}\n\nexport { IconRenderer };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport type { ButtonHTMLAttributes } from \"react\";\n\nimport { IconRenderer } from \"../../services/iconRenderer\";\nimport \"./styles.css\";\n\ntype ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/** Shows a spinner and disables the button during async operations. @default false */\n\tisLoading?: boolean;\n\t/** Text displayed beside the spinner when `isLoading` is true. */\n\tloadingText?: string;\n\t/**\n\t * Button size.\n\t * @default \"md\"\n\t */\n\tsize?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `ghost`: no border, subtle hover.\n\t * - `invisible`: no visual styling.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"ghost\" | \"invisible\";\n\t/**\n\t * Color scheme applied to the button.\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t/** Lucide icon rendered to the left of the label. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered to the right of the label. */\n\trightIcon?: LucideIcon;\n};\n\n/**\n * Button, used for user interactions and form submissions.\n *\n * @param props.isLoading - Shows a spinner and disables the button. Default: false\n * @param props.loadingText - Text displayed beside the spinner when loading.\n * @param props.size - Button size (`xs` | `sm` | `md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.scheme - Color scheme. Default: \"primary\"\n * @param props.leftIcon - Lucide icon rendered to the left of the label.\n * @param props.rightIcon - Lucide icon rendered to the right of the label.\n *\n * **...Other valid HTML properties for `<button>`**\n *\n * @returns Button JSX element.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // With color scheme\n * <Button scheme=\"success\">Save</Button>\n *\n * // With loading state\n * <Button isLoading loadingText=\"Saving...\">Save</Button>\n *\n * // With icons\n * <Button leftIcon={SaveIcon} scheme=\"success\">Save</Button>\n *\n * // Custom size, variant and scheme\n * <Button size=\"lg\" variant=\"outline\" scheme=\"danger\" rightIcon={TrashIcon}>\n * Delete\n * </Button>\n * ```\n */\n\nfunction Button(props: ButtonProps) {\n\tconst {\n\t\tisLoading = false,\n\t\tscheme = \"primary\",\n\t\tvariant = \"solid\",\n\t\tloadingText,\n\t\tsize = \"md\",\n\t\tleftIcon,\n\t\trightIcon,\n\t\tdisabled,\n\t\tclassName: baseClassName = \"\",\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst iconSizes = { xs: 12, sm: 16, md: 20, lg: 24 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingClass = isLoading ? \"loadingTrue\" : \"loadingFalse\";\n\tconst loadingTextClass = loadingText ? \"loadingTextTrue\" : \"loadingTextFalse\";\n\n\tconst className = `arkynButton ${loadingClass} ${variant} ${scheme} ${size} ${loadingTextClass} ${baseClassName}`;\n\n\treturn (\n\t\t<button className={className} disabled={disabled || isLoading} {...rest}>\n\t\t\t<div className=\"arkynButtonSpinner\">\n\t\t\t\t<Loader2 size={iconSize} strokeWidth={2.5} />\n\t\t\t\t{loadingText && loadingText}\n\t\t\t</div>\n\n\t\t\t<div className=\"arkynButtonContent\">\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={leftIcon} />\n\t\t\t\t{children}\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={rightIcon} />\n\t\t\t</div>\n\t\t</button>\n\t);\n}\n\nexport { Button };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype DividerProps = HTMLAttributes<HTMLDivElement> & {\n\t/**\n\t * Divider orientation.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\";\n};\n\n/**\n * Divider, visually separates content sections.\n *\n * @param props.orientation - Line direction (`horizontal` | `vertical`). Default: \"horizontal\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Divider JSX element.\n *\n * @example\n * ```tsx\n * // Between sections\n * <h2>Section 1</h2>\n * <Divider />\n * <h2>Section 2</h2>\n *\n * // Vertical (e.g. between sidebar and content)\n * <Divider orientation=\"vertical\" />\n * ```\n */\n\nfunction Divider(props: DividerProps) {\n\tconst {\n\t\tclassName: baseClassName,\n\t\torientation = \"horizontal\",\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynDivider ${orientation} ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { Divider };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport type { ButtonHTMLAttributes } from \"react\";\n\nimport \"./styles.css\";\n\ntype IconButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"aria-label\"\n> & {\n\t/** Lucide icon component rendered inside the button. Required. */\n\ticon: LucideIcon;\n\t/** Accessible label for screen readers. Required. */\n\t\"aria-label\": string;\n\t/** Shows a spinner and disables the button during async operations. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Button size.\n\t * @default \"md\"\n\t */\n\tsize?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `ghost`: no border, subtle hover.\n\t * - `invisible`: no visual styling.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"ghost\" | \"invisible\";\n\t/**\n\t * Color scheme applied to the button.\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n};\n\n/**\n * IconButton, compact button that renders a single icon without a text label.\n *\n * Always requires `aria-label` for accessibility.\n *\n * @param props.icon - Lucide icon component to render. Required.\n * @param props[\"aria-label\"] - Accessible label for screen readers. Required.\n * @param props.isLoading - Shows a spinner and disables the button. Default: false\n * @param props.size - Button size (`xs` | `sm` | `md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.scheme - Color scheme. Default: \"primary\"\n *\n * **...Other valid HTML properties for `<button>` (children not supported)**\n *\n * @returns IconButton JSX element.\n *\n * @example\n * ```tsx\n * <IconButton icon={Plus} aria-label=\"Add item\" />\n *\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" variant=\"outline\" />\n *\n * <IconButton icon={Save} aria-label=\"Saving\" isLoading />\n *\n * <IconButton icon={MoreVertical} aria-label=\"More options\" size=\"sm\" />\n * ```\n */\n\nfunction IconButton(props: IconButtonProps) {\n\tconst {\n\t\tisLoading = false,\n\t\tscheme = \"primary\",\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\ticon: Icon,\n\t\tdisabled,\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst iconSize = { xs: 12, sm: 16, md: 20, lg: 24 };\n\tconst loading = isLoading ? \"loadingTrue\" : \"loadingFalse\";\n\tconst className = `arkynIconButton ${variant} ${scheme} ${size} ${loading} ${baseClassName}`;\n\n\treturn (\n\t\t<button\n\t\t\tdisabled={disabled || isLoading}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<div className=\"arkynIconButtonSpinner\">\n\t\t\t\t<Loader2 size={iconSize[size]} strokeWidth={2.5} />\n\t\t\t</div>\n\n\t\t\t<div className=\"arkynIconButtonContent\">\n\t\t\t\t<Icon size={iconSize[size]} strokeWidth={2.5} />\n\t\t\t</div>\n\t\t</button>\n\t);\n}\n\nexport { IconButton };\n","import {\n\ttype HTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport \"./styles.css\";\n\ntype TooltipProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\t/** Text rendered inside the tooltip bubble. Supports inline HTML. Required. */\n\ttext: string;\n\t/** Element that triggers the tooltip on hover. Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Preferred position of the tooltip relative to the trigger element.\n\t * Automatically flips to the opposite side if the tooltip would overflow the viewport.\n\t * @default \"top\"\n\t */\n\torientation?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\t/**\n\t * Tooltip size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n};\n\n/**\n * Tooltip, shows a contextual text bubble on hover with smart viewport-aware positioning.\n *\n * The tooltip automatically flips to the opposite side when it would overflow the viewport.\n *\n * @param props.text - Text (or HTML) to display in the tooltip. Required.\n * @param props.children - Trigger element. Required.\n * @param props.orientation - Preferred position relative to the trigger. Default: \"top\"\n * @param props.size - Tooltip size. Default: \"lg\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Tooltip JSX element.\n *\n * @example\n * ```tsx\n * <Tooltip text=\"Save changes before leaving\">\n * <IconButton icon={SaveIcon} aria-label=\"Save\" />\n * </Tooltip>\n *\n * // Toolbar with bottom-oriented tooltips\n * <Tooltip text=\"Add item\" orientation=\"bottom\">\n * <IconButton icon={Plus} aria-label=\"Add\" />\n * </Tooltip>\n *\n * <Tooltip text=\"Delete\" orientation=\"bottom\" size=\"md\">\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" />\n * </Tooltip>\n * ```\n */\n\nfunction Tooltip(props: TooltipProps) {\n\tconst {\n\t\ttext,\n\t\tsize = \"lg\",\n\t\tchildren,\n\t\torientation = \"top\",\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst tooltipId = useId();\n\tconst tooltipRef = useRef<HTMLDivElement>(null);\n\tconst [adjustedOrientation, setAdjustedOrientation] = useState(orientation);\n\n\tuseEffect(() => {\n\t\tconst checkTooltipPosition = () => {\n\t\t\tif (!tooltipRef.current) return;\n\t\t\tconst tooltipText = document.getElementById(tooltipId) as HTMLElement;\n\t\t\tif (!tooltipText) return;\n\n\t\t\tsetAdjustedOrientation(orientation);\n\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tconst rect = tooltipText.getBoundingClientRect();\n\t\t\t\tconst viewportWidth = window.innerWidth;\n\t\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\t\tlet newOrientation = orientation;\n\n\t\t\t\tif (orientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (orientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (orientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t} else if (orientation === \"bottom\" && rect.bottom > viewportHeight) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t}\n\n\t\t\t\tif (newOrientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (newOrientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (\n\t\t\t\t\tnewOrientation === \"bottom\" &&\n\t\t\t\t\trect.bottom > viewportHeight\n\t\t\t\t) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t} else if (newOrientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t}\n\n\t\t\t\tsetAdjustedOrientation(newOrientation);\n\t\t\t});\n\t\t};\n\n\t\tconst tooltip = tooltipRef.current;\n\t\tif (!tooltip) return;\n\n\t\tconst handleMouseEnter = () => {\n\t\t\tsetTimeout(checkTooltipPosition, 1);\n\t\t};\n\n\t\ttooltip.addEventListener(\"mouseenter\", handleMouseEnter);\n\t\twindow.addEventListener(\"resize\", checkTooltipPosition);\n\n\t\treturn () => {\n\t\t\ttooltip.removeEventListener(\"mouseenter\", handleMouseEnter);\n\t\t\twindow.removeEventListener(\"resize\", checkTooltipPosition);\n\t\t};\n\t}, [orientation, tooltipId]);\n\n\tconst className = `arkynTooltip ${size} ${adjustedOrientation} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest} ref={tooltipRef}>\n\t\t\t{children}\n\n\t\t\t<div\n\t\t\t\tclassName=\"arkynTooltipText\"\n\t\t\t\tid={tooltipId}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Tooltip };\n","import { RefreshCw } from \"lucide-react\";\n\nimport { AudioPlayer } from \"../../audioPlayer\";\nimport { Button } from \"../../button\";\nimport { Divider } from \"../../divider\";\nimport { IconButton } from \"../../iconButton\";\nimport { Tooltip } from \"../../tooltip\";\n\nimport \"./styles.css\";\n\ntype HasFileContentProps = {\n\tfilePath: string;\n\tdisabled: boolean;\n\tacceptAudio: string;\n\tisLoading: boolean;\n\thandleSelectFile: (file: File) => void;\n\treSendAudio?: () => void;\n\tchangeAudioButtonText: string;\n};\n\nfunction HasFileContent(props: HasFileContentProps) {\n\tconst {\n\t\tfilePath,\n\t\tdisabled,\n\t\tacceptAudio,\n\t\thandleSelectFile,\n\t\tisLoading,\n\t\treSendAudio,\n\t\tchangeAudioButtonText,\n\t} = props;\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptAudio;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div className=\"arkynAudioUploadHasFileContentContainer\">\n\t\t\t<AudioPlayer src={filePath} />\n\t\t\t<Divider />\n\n\t\t\t<div className=\"arkynAudioUploadButtonsContainer\">\n\t\t\t\t{!!reSendAudio && (\n\t\t\t\t\t<Tooltip orientation=\"bottom\" text=\"Reenviar áudio\">\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"resend image\"\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\tonClick={reSendAudio}\n\t\t\t\t\t\t\ticon={RefreshCw}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\n\t\t\t\t<Button\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t>\n\t\t\t\t\t{changeAudioButtonText}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { HasFileContent };\n","import type { DragEvent } from \"react\";\n\nimport { Button } from \"../../button\";\nimport \"./styles.css\";\n\ntype NoFileContentProps = {\n\tdisabled: boolean;\n\tacceptAudio: string;\n\tisLoading: boolean;\n\tselectAudioButtonText: string;\n\tdropAudioText: string;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction NoFileContent(props: NoFileContentProps) {\n\tconst {\n\t\tdropAudioText,\n\t\tisLoading,\n\t\tacceptAudio,\n\t\thandleSelectFile,\n\t\tselectAudioButtonText,\n\t\tdisabled,\n\t} = props;\n\n\tfunction handleDrop(event: DragEvent<HTMLDivElement>) {\n\t\tif (disabled) return;\n\n\t\tevent.preventDefault();\n\t\tconst file = event.dataTransfer.files[0];\n\t\tif (file) handleSelectFile(file);\n\t}\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptAudio;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div onDrop={handleDrop} className=\"arkynAudioUploadNoFileContent\">\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{selectAudioButtonText}\n\t\t\t</Button>\n\n\t\t\t<p>{dropAudioText}</p>\n\t\t</div>\n\t);\n}\n\nexport { NoFileContent };\n","import { useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\n\nimport { HasFileContent } from \"./hasFileContent\";\nimport { NoFileContent } from \"./noFileContent\";\nimport \"./styles.css\";\n\ntype AudioUploadProps = {\n\t/** Field name for form submission (stores the uploaded audio URL). Required. */\n\tname: string;\n\t/** Server endpoint URL that receives the `multipart/form-data` upload request. Required. */\n\taction: string;\n\t/** Form-data field name used for the file. @default \"file\" */\n\tfileName?: string;\n\t/** HTTP method for the upload request. @default \"POST\" */\n\tmethod?: string;\n\t/** Accepted audio MIME types or extensions (e.g. `\"audio/mp3,audio/wav\"`). @default \"audio/*\" */\n\tacceptAudio?: string;\n\t/** Text displayed in the drag-and-drop zone. @default \"Ou arraste e solte um arquivo de áudio aqui\" */\n\tdropAudioText?: string;\n\t/** Label for the file-picker button before a file is selected. @default \"Selecionar arquivo de áudio\" */\n\tselectAudioButtonText?: string;\n\t/** Label for the file-picker button after a file is selected. @default \"Trocar arquivo de áudio\" */\n\tchangeAudioButtonText?: string;\n\t/** Callback fired after a successful upload. Receives the URL returned by the server. */\n\tonChange?: (url?: string) => void;\n\t/** Property name in the server response that contains the file URL. @default \"url\" */\n\tfileResponseName?: string;\n\t/** Optional label text displayed above the upload area. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n\t/** Disables file selection and upload. @default false */\n\tdisabled?: boolean;\n\t/** Pre-populated audio URL (e.g. an existing recording). @default \"\" */\n\tdefaultValue?: string;\n};\n\n/**\n * AudioUpload, drag-and-drop audio file uploader with server upload and playback preview.\n *\n * Sends the file via `fetch` as `multipart/form-data` and stores the returned URL\n * in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.action - Upload endpoint URL. Required.\n * @param props.fileName - Form-data field name for the file. Default: \"file\"\n * @param props.method - HTTP method. Default: \"POST\"\n * @param props.acceptAudio - Accepted MIME types / extensions. Default: \"audio/*\"\n * @param props.onChange - Callback fired after a successful upload, receives the audio URL.\n * @param props.fileResponseName - Server response property containing the URL. Default: \"url\"\n * @param props.label - Label text displayed above the upload area.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.disabled - Disables file selection and upload. Default: false\n * @param props.defaultValue - Pre-populated audio URL.\n *\n * @returns AudioUpload JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <AudioUpload name=\"audio\" action=\"/api/upload\" />\n *\n * // With label and custom texts\n * <AudioUpload\n * name=\"podcast\"\n * action=\"/api/upload/podcast\"\n * label=\"Podcast Episode\"\n * showAsterisk\n * selectAudioButtonText=\"Choose audio file\"\n * onChange={(url) => setPodcastUrl(url)}\n * />\n * ```\n */\n\nfunction AudioUpload(props: AudioUploadProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tfileName = \"file\",\n\t\tmethod = \"POST\",\n\t\tonChange,\n\t\tfileResponseName = \"url\",\n\t\tselectAudioButtonText = \"Selecionar arquivo de áudio\",\n\t\tdropAudioText = \"Ou arraste e solte um arquivo de áudio aqui\",\n\t\tchangeAudioButtonText = \"Trocar arquivo de áudio\",\n\t\tacceptAudio = \"audio/*\",\n\t\taction,\n\t\tdefaultValue = \"\",\n\t\tshowAsterisk = false,\n\t\tdisabled = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst fieldError = fieldErrors?.[name];\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst [error, setError] = useState(\"\");\n\tconst [file, setFile] = useState<File | null>(null);\n\tconst [filePath, setFilePath] = useState(defaultValue);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tasync function handleUploadAudio(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetIsLoading(true);\n\t\tsetFile(file);\n\t\tsetError(\"\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(fileName, file);\n\n\t\tawait fetch(action, { method: method, body: formData })\n\t\t\t.then(async (response) => await response.json())\n\t\t\t.then((response) => {\n\t\t\t\tif (response?.error) setError(response.error);\n\t\t\t\telse setValue(response?.[fileResponseName]);\n\t\t\t\tonChange?.(response?.[fileResponseName]);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tsetError(\"Erro ao enviar audio\");\n\t\t\t})\n\t\t\t.finally(() => setIsLoading(false));\n\t}\n\n\tfunction handleSelectFile(file: File) {\n\t\tif (disabled) return;\n\n\t\tif (file.type.indexOf(\"audio\") === -1) {\n\t\t\tsetError(\"O arquivo selecionado não é um arquivo de áudio\");\n\t\t\treturn;\n\t\t}\n\n\t\tsetFilePath(URL.createObjectURL(file));\n\t\thandleUploadAudio(file);\n\t}\n\n\tconst errorMessage = fieldError || error;\n\n\tconst hasErrorClassName = errorMessage ? \"hasError\" : \"noHasError\";\n\tconst hasImageClassName = filePath ? \"hasAudio\" : \"noHasAudio\";\n\tconst className = `arkynAudioUpload ${hasErrorClassName} ${hasImageClassName}`;\n\n\treturn (\n\t\t<FieldWrapper>\n\t\t\t{label && <FieldLabel showAsterisk={showAsterisk}>{label}</FieldLabel>}\n\n\t\t\t<div className={className}>\n\t\t\t\t<input type=\"hidden\" name={name} value={value || \"\"} />\n\n\t\t\t\t{!filePath && (\n\t\t\t\t\t<NoFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptAudio={acceptAudio}\n\t\t\t\t\t\tdropAudioText={dropAudioText}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tselectAudioButtonText={selectAudioButtonText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{filePath && (\n\t\t\t\t\t<HasFileContent\n\t\t\t\t\t\tfilePath={filePath}\n\t\t\t\t\t\tacceptAudio={acceptAudio}\n\t\t\t\t\t\tchangeAudioButtonText={changeAudioButtonText}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\treSendAudio={\n\t\t\t\t\t\t\terrorMessage && file ? () => handleUploadAudio(file) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { AudioUpload };\n","import type { LucideIcon } from \"lucide-react\";\nimport type { HTMLAttributes } from \"react\";\n\nimport { IconRenderer } from \"../../services/iconRenderer\";\nimport \"./styles.css\";\n\ntype BadgeProps = HTMLAttributes<HTMLDivElement> & {\n\t/**\n\t * Badge size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `ghost`: no border, subtle background on hover.\n\t * @default \"ghost\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"ghost\";\n\t/**\n\t * Color scheme applied to the badge.\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t/** Lucide icon rendered to the left of the label. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered to the right of the label. */\n\trightIcon?: LucideIcon;\n};\n\n/**\n * Badge, displays labels, statuses, and categorization tags.\n *\n * @param props.size - Badge size (`md` | `lg`). Default: \"lg\"\n * @param props.variant - Visual style variant. Default: \"ghost\"\n * @param props.scheme - Color scheme. Default: \"primary\"\n * @param props.leftIcon - Lucide icon rendered to the left of the label.\n * @param props.rightIcon - Lucide icon rendered to the right of the label.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Badge JSX element.\n *\n * @example\n * ```tsx\n * // Basic badge\n * <Badge>New</Badge>\n *\n * // With color scheme\n * <Badge scheme=\"success\">Approved</Badge>\n *\n * // With icon\n * <Badge leftIcon={CheckIcon} scheme=\"success\">Completed</Badge>\n *\n * // Custom size, variant and scheme\n * <Badge size=\"lg\" variant=\"solid\" scheme=\"warning\" rightIcon={AlertIcon}>\n * Warning\n * </Badge>\n * ```\n */\n\nfunction Badge(props: BadgeProps) {\n\tconst {\n\t\tvariant = \"ghost\",\n\t\tscheme = \"primary\",\n\t\tsize = \"lg\",\n\t\tleftIcon,\n\t\trightIcon,\n\t\tclassName: baseClassName = \"\",\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst iconSizes = { md: 12, lg: 14 };\n\tconst iconSize = iconSizes[size];\n\n\tconst className = `arkynBadge ${variant} ${scheme} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<IconRenderer iconSize={iconSize} icon={leftIcon} />\n\t\t\t<p>{children}</p>\n\t\t\t<IconRenderer iconSize={iconSize} icon={rightIcon} />\n\t\t</div>\n\t);\n}\n\nexport { Badge };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\n\ntype CalendarCell = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayType: \"checkedDay\" | \"middleDay\" | \"uncheckedDay\";\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\ntype CalendarMatrix = CalendarCell[][];\n\nclass ViewService {\n\tcurrentDay(viewDate: Date) {\n\t\treturn String(viewDate.getDate()).padStart(2, \"0\");\n\t}\n\n\tcurrentMonth(viewDate: Date) {\n\t\treturn String(viewDate.getMonth() + 1).padStart(2, \"0\");\n\t}\n\n\tcurrentYear(viewDate: Date) {\n\t\treturn String(viewDate.getFullYear());\n\t}\n\n\tcapitalize(text: string) {\n\t\treturn formatToCapitalizeFirstWordLetter(text);\n\t}\n\n\tparseDayType(\n\t\tday: number,\n\t\tmonth: number,\n\t\tyear: number,\n\t\tvalueDate: [Date, Date],\n\t): \"checkedDay\" | \"middleDay\" | \"uncheckedDay\" {\n\t\tconst firstDateDay = valueDate[0].getDate();\n\t\tconst firstDateMonth = valueDate[0].getMonth();\n\t\tconst firstDateYear = valueDate[0].getFullYear();\n\n\t\tconst secondDateDay = valueDate[1].getDate();\n\t\tconst secondDateMonth = valueDate[1].getMonth();\n\t\tconst secondDateYear = valueDate[1].getFullYear();\n\n\t\tconst firstDate = new Date(firstDateYear, firstDateMonth, firstDateDay);\n\t\tconst secondDate = new Date(secondDateYear, secondDateMonth, secondDateDay);\n\t\tconst currentDate = new Date(year, month, day);\n\n\t\tif (firstDate.getTime() === currentDate.getTime()) return \"checkedDay\";\n\t\tif (secondDate.getTime() === currentDate.getTime()) return \"checkedDay\";\n\t\tif (currentDate > firstDate && currentDate < secondDate) return \"middleDay\";\n\t\treturn \"uncheckedDay\";\n\t}\n\n\tlistWeek(language: string) {\n\t\tconst weekDays = [];\n\t\tconst firstSundayUtc = new Date(Date.UTC(2023, 0, 1));\n\n\t\tfor (let i = 0; i < 7; i++) {\n\t\t\tconst day = new Date(firstSundayUtc);\n\t\t\tday.setUTCDate(firstSundayUtc.getUTCDate() + i);\n\t\t\tconst dayName = day.toLocaleDateString(language, {\n\t\t\t\tweekday: \"short\",\n\t\t\t\ttimeZone: \"UTC\",\n\t\t\t});\n\t\t\tweekDays.push(dayName);\n\t\t}\n\n\t\treturn weekDays;\n\t}\n\n\tlistMonths(viewDate: Date, language: string) {\n\t\tconst monthsByNavigatorLanguage = new Intl.DateTimeFormat(language, {\n\t\t\tmonth: \"long\",\n\t\t});\n\n\t\treturn Array.from({ length: 12 }, (_, i) => {\n\t\t\tconst date = new Date(viewDate.getFullYear(), i, 1);\n\t\t\tconst label = monthsByNavigatorLanguage.format(date);\n\t\t\treturn {\n\t\t\t\tlabel: this.capitalize(label),\n\t\t\t\tvalue: String(i).padStart(2, \"0\"),\n\t\t\t};\n\t\t});\n\t}\n\n\tlistYears(lastYears: number) {\n\t\tconst currentYear = new Date().getFullYear();\n\n\t\treturn Array.from({ length: lastYears + 1 }, (_, i) => {\n\t\t\tconst year = currentYear - lastYears + i;\n\t\t\treturn { label: String(year), value: String(year) };\n\t\t}).reverse();\n\t}\n\n\tlistMatrix(viewDate: Date, valueDate: [Date, Date]) {\n\t\tconst year = viewDate.getFullYear();\n\t\tconst monthIndex = viewDate.getMonth();\n\n\t\tconst firstDayOfMonth = new Date(year, monthIndex, 1);\n\t\tconst firstWeekday = firstDayOfMonth.getDay();\n\n\t\tconst daysInCurrentMonth = new Date(year, monthIndex + 1, 0).getDate();\n\t\tconst daysInPreviousMonth = new Date(year, monthIndex, 0).getDate();\n\n\t\tconst totalCells = Math.ceil((firstWeekday + daysInCurrentMonth) / 7) * 7;\n\n\t\tconst weeks: CalendarMatrix = [];\n\t\tlet currentMonthDay = 1;\n\t\tlet nextMonthDay = 1;\n\n\t\tfor (let i = 0; i < totalCells; i++) {\n\t\t\tconst weekIndex = Math.floor(i / 7);\n\t\t\tif (!weeks[weekIndex]) weeks[weekIndex] = [];\n\n\t\t\tif (i < firstWeekday) {\n\t\t\t\tconst day = daysInPreviousMonth - (firstWeekday - i - 1);\n\t\t\t\tconst month = monthIndex === 0 ? 11 : monthIndex - 1;\n\t\t\t\tconst cellYear = monthIndex === 0 ? year - 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"previous\",\n\t\t\t\t\tdayType: this.parseDayType(day, month, cellYear, valueDate),\n\t\t\t\t});\n\t\t\t} else if (currentMonthDay <= daysInCurrentMonth) {\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: currentMonthDay,\n\t\t\t\t\tmonth: monthIndex,\n\t\t\t\t\tyear: year,\n\t\t\t\t\tdayOwner: \"current\",\n\t\t\t\t\tdayType: this.parseDayType(\n\t\t\t\t\t\tcurrentMonthDay,\n\t\t\t\t\t\tmonthIndex,\n\t\t\t\t\t\tyear,\n\t\t\t\t\t\tvalueDate,\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t\tcurrentMonthDay++;\n\t\t\t} else {\n\t\t\t\tconst month = monthIndex === 11 ? 0 : monthIndex + 1;\n\t\t\t\tconst cellYear = monthIndex === 11 ? year + 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: nextMonthDay,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"next\",\n\t\t\t\t\tdayType: this.parseDayType(nextMonthDay, month, cellYear, valueDate),\n\t\t\t\t});\n\t\t\t\tnextMonthDay++;\n\t\t\t}\n\t\t}\n\n\t\treturn weeks;\n\t}\n\n\tchangeDay(\n\t\tday: number,\n\t\tmonth: number,\n\t\tyear: number,\n\t\tcalendarType: \"single\" | \"range\",\n\t\tvalueDate: [Date, Date],\n\t\tsetValueDate: (date: [Date, Date]) => void,\n\t\tsetViewDate: (date: Date) => void,\n\t) {\n\t\tconst normalizeDate = (date: Date) =>\n\t\t\tnew Date(date.getFullYear(), date.getMonth(), date.getDate());\n\n\t\tconst newDate = normalizeDate(new Date(year, month, day));\n\t\tsetViewDate(newDate);\n\n\t\tif (calendarType === \"single\") {\n\t\t\tsetValueDate([newDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst startDate = normalizeDate(valueDate[0]);\n\t\tconst endDate = normalizeDate(valueDate[1]);\n\n\t\tconst newDateTime = newDate.getTime();\n\t\tconst startDateTime = startDate.getTime();\n\t\tconst endDateTime = endDate.getTime();\n\n\t\tif (newDateTime === startDateTime) {\n\t\t\tsetValueDate([newDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (newDateTime === endDateTime) {\n\t\t\tsetValueDate([newDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (newDate < startDate) {\n\t\t\tsetValueDate([newDate, endDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (newDate > endDate) {\n\t\t\tsetValueDate([startDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst distanceToStart = Math.abs(newDateTime - startDateTime);\n\t\tconst distanceToEnd = Math.abs(endDateTime - newDateTime);\n\n\t\tif (distanceToStart <= distanceToEnd) {\n\t\t\tsetValueDate([newDate, endDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tsetValueDate([startDate, newDate]);\n\t}\n\n\tchangeMonth(\n\t\tmonth: number,\n\t\tviewDate: Date,\n\t\tsetViewDate: (date: Date) => void,\n\t) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setMonth(month);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tchangeYear(year: number, viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setFullYear(year);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tnextMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(1);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() + 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(1);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() - 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n}\n\nexport { type CalendarMatrix, ViewService };\n","import { createContext, type ReactNode, useContext, useState } from \"react\";\nimport { type CalendarMatrix, ViewService } from \"./_viewService\";\n\ntype CalendarContextProps = {\n\tvalueDate: Date[];\n\tviewDate: Date;\n\tcurrentDate: string;\n\tcurrentDay: string;\n\tcurrentMonth: string;\n\tcurrentYear: string;\n\tlistWeek: string[];\n\tlistMonths: { label: string; value: string }[];\n\tlistYears: { label: string; value: string }[];\n\tlistMatrix: CalendarMatrix;\n\tchangeDay: (day: number, month: number, year: number) => void;\n\tchangeMonth: (month: number) => void;\n\tchangeYear: (year: number) => void;\n\tnextMonth: () => void;\n\tpreviousMonth: () => void;\n};\n\ntype SingleCalendarProviderProps = {\n\tchildren: ReactNode;\n\tcalendarType: \"single\";\n\tlanguage?: string;\n\tonChangeView?: (date: Date) => void;\n\tdefaultValue?: Date;\n\tonChange?: (date: Date) => void;\n\tvalue?: Date;\n\tviewValue?: Date;\n\tdefaultViewValue?: Date;\n};\n\ntype RangeCalendarProviderProps = {\n\tchildren: ReactNode;\n\tcalendarType: \"range\";\n\tlanguage?: string;\n\tonChangeView?: (date: Date) => void;\n\tdefaultValue?: [Date, Date];\n\tonChange?: (date: [Date, Date]) => void;\n\tvalue?: [Date, Date];\n\tviewValue?: Date;\n\tdefaultViewValue?: Date;\n};\n\ntype CalendarProviderProps =\n\t| SingleCalendarProviderProps\n\t| RangeCalendarProviderProps;\n\nconst CalendarContext = createContext({} as CalendarContextProps);\n\nfunction useCalendar() {\n\treturn useContext(CalendarContext);\n}\n\nfunction CalendarProvider(props: CalendarProviderProps) {\n\tconst {\n\t\tcalendarType,\n\t\tchildren,\n\t\tdefaultValue: rawDefaultValue,\n\t\tdefaultViewValue = new Date(),\n\t\tlanguage = \"pt-BR\",\n\t\tonChange,\n\t\tonChangeView,\n\t\tvalue,\n\t\tviewValue,\n\t} = props;\n\n\tconst defaultValue: [Date, Date] =\n\t\tcalendarType === \"single\"\n\t\t\t? [rawDefaultValue || new Date(), rawDefaultValue || new Date()]\n\t\t\t: rawDefaultValue || [new Date(), new Date()];\n\n\tconst [rawViewDate, rawSetViewDate] = useState(defaultViewValue);\n\tconst [rawValueDate, rawSetValueDate] = useState<[Date, Date]>(defaultValue);\n\n\tconst viewDate = viewValue || rawViewDate;\n\tconst valueDate: [Date, Date] = value\n\t\t? calendarType === \"single\"\n\t\t\t? [value, value]\n\t\t\t: value\n\t\t: rawValueDate;\n\n\tconst viewService = new ViewService();\n\n\tfunction setValueDate(value: [Date, Date]) {\n\t\tconst normalizedValue: [Date, Date] = [\n\t\t\tnew Date(value[0]),\n\t\t\tnew Date(value[1]),\n\t\t];\n\n\t\tif (onChange && calendarType === \"range\") {\n\t\t\tonChange(normalizedValue);\n\t\t}\n\n\t\tif (onChange && calendarType === \"single\") {\n\t\t\tonChange(normalizedValue[0]);\n\t\t}\n\n\t\trawSetValueDate(normalizedValue);\n\t}\n\n\tfunction setViewDate(date: Date) {\n\t\tif (onChangeView) onChangeView(date);\n\t\trawSetViewDate(date);\n\t}\n\n\treturn (\n\t\t<CalendarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tvalueDate,\n\t\t\t\tviewDate,\n\t\t\t\tcurrentDate: viewDate.toLocaleDateString(language).slice(3),\n\t\t\t\tcurrentDay: viewService.currentDay(viewDate),\n\t\t\t\tcurrentMonth: viewService.currentMonth(viewDate),\n\t\t\t\tcurrentYear: viewService.currentYear(viewDate),\n\t\t\t\tlistWeek: viewService.listWeek(language),\n\t\t\t\tlistMonths: viewService.listMonths(viewDate, language),\n\t\t\t\tlistYears: viewService.listYears(100),\n\t\t\t\tlistMatrix: viewService.listMatrix(viewDate, valueDate),\n\t\t\t\tchangeDay: (day, month, year) =>\n\t\t\t\t\tviewService.changeDay(\n\t\t\t\t\t\tday,\n\t\t\t\t\t\tmonth,\n\t\t\t\t\t\tyear,\n\t\t\t\t\t\tcalendarType,\n\t\t\t\t\t\tvalueDate,\n\t\t\t\t\t\tsetValueDate,\n\t\t\t\t\t\tsetViewDate,\n\t\t\t\t\t),\n\t\t\t\tchangeMonth: (month) =>\n\t\t\t\t\tviewService.changeMonth(month, viewDate, setViewDate),\n\t\t\t\tchangeYear: (year) =>\n\t\t\t\t\tviewService.changeYear(year, viewDate, setViewDate),\n\t\t\t\tnextMonth: () => viewService.nextMonth(viewDate, setViewDate),\n\t\t\t\tpreviousMonth: () => viewService.previousMonth(viewDate, setViewDate),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</CalendarContext.Provider>\n\t);\n}\n\nexport { CalendarProvider, useCalendar };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype CalendarContainerProps = {\n\tchildren?: ReactNode;\n};\n\nfunction CalendarContainer({ children }: CalendarContainerProps) {\n\treturn <div className={`arkynCalendarContainer`}>{children}</div>;\n}\n\nexport { CalendarContainer };\n","import type { ReactNode } from \"react\";\n\nimport { FieldError } from \"../components/fieldError\";\nimport { FieldLabel } from \"../components/fieldLabel\";\nimport { FieldWrapper } from \"../components/fieldWrapper\";\n\ntype FormRendererProps = {\n\tname?: string;\n\tlabel?: string;\n\tclassName?: string;\n\tshowAsterisk?: boolean;\n\tunShowFieldTemplate?: boolean;\n\terrorMessage?: string;\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\tchildren: ReactNode;\n};\n\nfunction FieldTemplate(props: FormRendererProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tclassName,\n\t\tunShowFieldTemplate,\n\t\terrorMessage,\n\t\tchildren,\n\t\torientation,\n\t} = props;\n\n\tif (unShowFieldTemplate) return children;\n\n\treturn (\n\t\t<FieldWrapper id={name} className={className} orientation={orientation}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={name} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { FieldTemplate };\n","import { ChevronDown } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype SelectChevronProps = {\n\tisLoading: boolean;\n\ticonSize: number;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisFocused: boolean;\n};\n\nfunction SelectChevron(props: SelectChevronProps) {\n\tconst { iconSize, isLoading, disabled, readOnly, isFocused } = props;\n\n\tconst notAnimate = disabled || readOnly ? \"notAnimate\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynSelectChevron ${notAnimate} ${focused}`;\n\n\tif (isLoading) return null;\n\treturn (\n\t\t<ChevronDown\n\t\t\tclassName={className}\n\t\t\tstrokeWidth={2.5}\n\t\t\tstyle={{\n\t\t\t\tminWidth: iconSize,\n\t\t\t\tminHeight: iconSize,\n\t\t\t\tmaxWidth: iconSize,\n\t\t\t\tmaxHeight: iconSize,\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport { SelectChevron };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype SelectContainerProps = {\n\tchildren: ReactNode;\n\thandleContainerFocus: () => void;\n\tprefixExists: boolean;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tid: string;\n\tvariant: \"solid\" | \"outline\" | \"underline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction SelectContainer(props: SelectContainerProps) {\n\tconst {\n\t\tchildren,\n\t\thandleContainerFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName,\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t\tid,\n\t\tprefixExists,\n\t} = props;\n\n\tconst hasPrefix = prefixExists ? \"hasPrefix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\treturn (\n\t\t<section\n\t\t\tid={id}\n\t\t\tclassName={`arkynSelectContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`}\n\t\t\tonClick={handleContainerFocus}\n\t\t>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { SelectContainer };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype SelectContentProps = {\n\tchildren: ReactNode;\n\tsize: \"md\" | \"lg\";\n};\n\nfunction SelectContent(props: SelectContentProps) {\n\tconst { children, size } = props;\n\tconst className = `arkynSelectContent ${size}`;\n\treturn <div className={className}>{children}</div>;\n}\n\nexport { SelectContent };\n","import { Check } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype SelectOptionProps = {\n\tvalue: string;\n\tlabel: string;\n\tsize: \"md\" | \"lg\";\n\toptionHasSelected: (value: string) => boolean;\n\thandleChangeValue: (value: string) => void;\n};\n\nfunction SelectOption(props: SelectOptionProps) {\n\tconst { label, optionHasSelected, handleChangeValue, value, size } = props;\n\n\tconst hasActive = optionHasSelected(value) ? \"active\" : \"\";\n\tconst className = `arkynSelectOption ${size} ${hasActive}`;\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={() => handleChangeValue(value)}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{label} <Check />\n\t\t</button>\n\t);\n}\n\nexport { SelectOption };\n","import { useEffect } from \"react\";\n\nfunction getScrollbarWidth(): number {\n\tif (typeof window === \"undefined\") return 0;\n\treturn window.innerWidth - document.documentElement.clientWidth;\n}\n\n/**\n * useScrollLock, locks `document.body` scroll while an overlay is open.\n *\n * Compensates for the scrollbar width by adding equivalent `paddingRight`,\n * preventing layout shift when the scrollbar disappears.\n * Restores the original `overflow` and `paddingRight` when `isLocked` becomes `false`.\n *\n * Used internally by `Modal` and `Drawer`, you usually don't need this directly\n * unless building a custom overlay.\n *\n * @param isLocked - When `true`, body scroll is disabled.\n *\n * @example\n * ```tsx\n * function CustomOverlay({ isOpen }) {\n * useScrollLock(isOpen);\n * return isOpen ? <div className=\"overlay\">...</div> : null;\n * }\n * ```\n */\n\nfunction useScrollLock(isLocked: boolean): void {\n\tuseEffect(() => {\n\t\tif (isLocked) {\n\t\t\tconst originalOverflow = document.body.style.overflow;\n\t\t\tconst originalPaddingRight = document.body.style.paddingRight;\n\n\t\t\tconst scrollbarWidth = getScrollbarWidth();\n\n\t\t\tif (scrollbarWidth > 0) {\n\t\t\t\tconst computedStyle = window.getComputedStyle(document.body);\n\t\t\t\tconst existingPaddingRight =\n\t\t\t\t\tparseInt(computedStyle.paddingRight, 10) || 0;\n\n\t\t\t\tdocument.body.style.paddingRight = `${\n\t\t\t\t\texistingPaddingRight + scrollbarWidth\n\t\t\t\t}px`;\n\t\t\t}\n\n\t\t\tdocument.body.style.overflow = \"hidden\";\n\n\t\t\treturn () => {\n\t\t\t\tdocument.body.style.overflow = originalOverflow;\n\t\t\t\tdocument.body.style.paddingRight = originalPaddingRight;\n\t\t\t};\n\t\t}\n\t}, [isLocked]);\n}\n\nexport { useScrollLock };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport {\n\ttype FocusEvent,\n\ttype InputHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport \"./style.css\";\n\ntype InputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t\"size\" | \"prefix\" | \"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Validation error message displayed below the input. */\n\terrorMessage?: string;\n\t/** Shows a spinner and disables the input during async operations. @default false */\n\tisLoading?: boolean;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the input area (e.g. `\"https://\"`). */\n\tprefix?: string | LucideIcon;\n\t/** Text or icon rendered at the far right, outside the input area (e.g. `\".com\"`). */\n\tsuffix?: string | LucideIcon;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\t/** Lucide icon rendered inside the input on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered inside the input on the right. */\n\trightIcon?: LucideIcon;\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Input, text input field with label, validation, icons, prefix/suffix, and loading state.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the input.\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a spinner and disables the input. Default: false\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.prefix - Text or icon at the far left (outside the input).\n * @param props.suffix - Text or icon at the far right (outside the input).\n * @param props.leftIcon - Lucide icon inside the input on the left.\n * @param props.rightIcon - Lucide icon inside the input on the right.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * **...Other valid HTML properties for `<input>`**\n *\n * @returns Input JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Input name=\"username\" placeholder=\"Enter username\" />\n *\n * // With label and validation\n * <Input\n * name=\"email\"\n * label=\"Email Address\"\n * type=\"email\"\n * showAsterisk\n * errorMessage=\"Please enter a valid email\"\n * />\n *\n * // With icons and loading state\n * <Input name=\"search\" label=\"Search\" leftIcon={SearchIcon} isLoading />\n *\n * // With prefix/suffix\n * <Input name=\"website\" label=\"Website\" prefix=\"https://\" suffix=\".com\" variant=\"outline\" />\n * ```\n */\n\nfunction Input(props: InputProps) {\n\tconst {\n\t\tname,\n\t\tdisabled,\n\t\ttitle,\n\t\tstyle,\n\t\tvariant = \"solid\",\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tprefix,\n\t\tsuffix,\n\t\tisLoading = false,\n\t\tleftIcon,\n\t\treadOnly,\n\t\tonFocus,\n\t\tonBlur,\n\t\tunShowFieldTemplate = false,\n\t\terrorMessage: baseErrorMessage,\n\t\tshowAsterisk,\n\t\trightIcon,\n\t\ttype = \"text\",\n\t\tsize = \"md\",\n\t\tid,\n\t\tvalue,\n\t\tplaceholder,\n\t\torientation,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingPosition = rightIcon ? \"right\" : \"left\";\n\n\tconst showLeftSpinner = loadingPosition === \"left\" && isLoading;\n\tconst showRightSpinner = loadingPosition === \"right\" && isLoading;\n\n\tfunction handleSectionClick() {\n\t\tif (isDisabled || !inputRef?.current) return;\n\t\tsetIsFocused(true);\n\t\tinputRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\tif (type === \"hidden\") {\n\t\treturn (\n\t\t\t<input\n\t\t\t\tstyle={{ display: \"none\" }}\n\t\t\t\treadOnly\n\t\t\t\ttype=\"text\"\n\t\t\t\tref={inputRef}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst hasPrefix = prefix ? \"hasPrefix\" : \"\";\n\tconst hasSuffix = suffix ? \"hasSuffix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = isDisabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\tconst disabledClass = disabled ? \"disabled\" : \"\";\n\n\tconst className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showLeftSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />\n\n\t\t\t\t<input\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tname={name}\n\t\t\t\t\tplaceholder={isDisabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={isDisabled ? undefined : value}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showRightSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={suffix} className=\"suffix\" />\n\t\t\t</section>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Input, type InputProps };\n","import { Search } from \"lucide-react\";\nimport {\n\ttype ChangeEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { Input } from \"../../input\";\n\nimport \"./styles.css\";\n\ntype SelectOptionsContainerProps = {\n\tisFocused: boolean;\n\tisSearchable: boolean;\n\tchildren: ReactNode;\n\tsearch: string;\n\tonSearch: (value: string) => void;\n};\n\nfunction SelectOptionsContainer(props: SelectOptionsContainerProps) {\n\tconst { children, isFocused, isSearchable, search, onSearch } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tuseScrollLock(isFocused);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 300;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isFocused]);\n\n\tfunction handleSearch(e: ChangeEvent<HTMLInputElement>) {\n\t\tif (!isSearchable) return;\n\t\tonSearch(e.target.value);\n\t}\n\n\tif (!isFocused) return null;\n\n\treturn (\n\t\t<div\n\t\t\tref={containerRef}\n\t\t\tclassName={`arkynSelectOptionsContainer ${position}`}\n\t\t>\n\t\t\t{isSearchable && (\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tname=\"search-select\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tleftIcon={Search}\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonChange={handleSearch}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { SelectOptionsContainer };\n","import \"./styles.css\";\n\ntype SelectOverlayProps = {\n\tisFocused: boolean;\n\thandleBlur: () => void;\n};\n\nfunction SelectOverlay(props: SelectOverlayProps) {\n\tconst { isFocused, handleBlur } = props;\n\tif (!isFocused) return null;\n\treturn <aside className=\"arkynSelectOverlay\" onClick={handleBlur} />;\n}\n\nexport { SelectOverlay };\n","import { Loader2 } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype SelectSpinnerProps = {\n\ticonSize: number;\n\tisLoading: boolean;\n};\n\nfunction SelectSpinner(props: SelectSpinnerProps) {\n\tconst { iconSize, isLoading } = props;\n\n\tif (!isLoading) return null;\n\treturn (\n\t\t<Loader2 className=\"arkynSelectSpinner\" size={iconSize} strokeWidth={2.5} />\n\t);\n}\n\nexport { SelectSpinner };\n","import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { SelectChevron } from \"./selectChevron\";\nimport { SelectContainer } from \"./selectContainer\";\nimport { SelectContent } from \"./selectContent\";\nimport { SelectOption } from \"./selectOption\";\nimport { SelectOptionsContainer } from \"./selectOptionsContainer\";\nimport { SelectOverlay } from \"./selectOverlay\";\nimport { SelectSpinner } from \"./selectSpinner\";\n\ntype SelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Uncontrolled default selected value. @default \"\" */\n\tdefaultValue?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the select. */\n\tlabel?: string;\n\t/** Validation error message displayed below the select. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no option is selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected. @default true */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected value changes. */\n\tonChange?: (value: string) => void;\n\t/** Callback fired when the select gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the select loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * Select size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Select, single-option dropdown with optional search, label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled selected value.\n * @param props.defaultValue - Uncontrolled default value. Default: \"\"\n * @param props.label - Label text displayed above the select.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after selecting. Default: true\n * @param props.onChange - Callback fired when the selected value changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - Select size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns Select JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Select\n * name=\"category\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <Select\n * name=\"country\"\n * label=\"Country\"\n * showAsterisk\n * isSearchable\n * options={countryOptions}\n * errorMessage={errors.country}\n * notFoundText=\"No countries found\"\n * />\n *\n * // Controlled with async search\n * <Select\n * name=\"tag\"\n * label=\"Tag\"\n * value={selectedTag}\n * onChange={setSelectedTag}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction Select(props: SelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = true,\n\t\tdefaultValue = \"\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst selectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst selectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOption, setSelectedOption] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOption;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions === value;\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !selectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tselectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && selectRef.current) selectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOption(\"\");\n\t\t\tif (onChange) onChange(\"\");\n\t\t} else {\n\t\t\tsetSelectedOption(value);\n\t\t\tif (onChange) onChange(value);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<SelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={selectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={selectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceSelectedOptions}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<SelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions !== \"\" && (\n\t\t\t\t\t\t<p className=\"hasValue\">{getOptionLabel(forceSelectedOptions)}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{forceSelectedOptions === \"\" && <p>{placeholder}</p>}\n\t\t\t\t</SelectContent>\n\n\t\t\t\t<SelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<SelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</SelectOptionsContainer>\n\n\t\t\t\t<SelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<SelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<SelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</SelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Select };\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\n\nimport { Select } from \"../../select\";\nimport { useCalendar } from \"../_calendarProvider\";\nimport \"./styles.css\";\n\ntype CalendarHeaderProps = {\n\tbasicMode: boolean;\n};\n\nfunction CalendarHeader({ basicMode }: CalendarHeaderProps) {\n\tconst calendar = useCalendar();\n\n\tif (basicMode) {\n\t\treturn (\n\t\t\t<div className={`arkynCalendarHeader`}>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.previousMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronLeft />\n\t\t\t\t</button>\n\n\t\t\t\t<p>{calendar.currentDate}</p>\n\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.nextMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronRight />\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className={`arkynCalendarHeader`}>\n\t\t\t<div>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.previousMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronLeft />\n\t\t\t\t</button>\n\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.nextMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronRight />\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<Select\n\t\t\t\t\tname=\"calendarMonth\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tclassName=\"calendarMonthSelect\"\n\t\t\t\t\tvalue={calendar.currentMonth}\n\t\t\t\t\toptions={calendar.listMonths}\n\t\t\t\t\tonChange={(value) => calendar.changeMonth(+value)}\n\t\t\t\t/>\n\n\t\t\t\t<Select\n\t\t\t\t\tname=\"calendarYear\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tclassName=\"calendarYearSelect\"\n\t\t\t\t\tvalue={calendar.currentYear}\n\t\t\t\t\toptions={calendar.listYears}\n\t\t\t\t\tonChange={(value) => calendar.changeYear(+value)}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { CalendarHeader };\n","import { useCalendar } from \"../_calendarProvider\";\nimport \"./styles.css\";\n\ntype CalendarTableTdProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayType: \"checkedDay\" | \"middleDay\" | \"uncheckedDay\";\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\nfunction CalendarTableTd(props: CalendarTableTdProps) {\n\tconst { day, month, year, dayOwner, dayType } = props;\n\tconst { changeDay } = useCalendar();\n\n\tfunction isToday() {\n\t\tconst today = new Date();\n\t\treturn (\n\t\t\tday === today.getDate() &&\n\t\t\tmonth === today.getMonth() &&\n\t\t\tyear === today.getFullYear()\n\t\t);\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tonClick={() => changeDay(day, month, year)}\n\t\t\tclassName={`arkynCalendarTableTd ${dayOwner} ${dayType} ${isToday() ? \"today\" : \"\"}`}\n\t\t>\n\t\t\t<div className=\"textGroup\">\n\t\t\t\t<span />\n\t\t\t\t<p>{day}</p>\n\t\t\t</div>\n\t\t</td>\n\t);\n}\n\nexport { CalendarTableTd };\n","import { useCalendar } from \"../_calendarProvider\";\nimport { CalendarTableTd } from \"../calendarTableTd\";\nimport \"./styles.css\";\n\nfunction CalendarTableBody() {\n\tconst calendar = useCalendar();\n\n\treturn (\n\t\t<tbody className=\"arkynCalendarTableBody\">\n\t\t\t{calendar.listMatrix.map((week, weekIndex) => (\n\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: week position is stable in monthly matrix\n\t\t\t\t<tr key={`week-${weekIndex}`}>\n\t\t\t\t\t{week.map((props, dayIndex) => (\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: day position is stable in week\n\t\t\t\t\t\t<CalendarTableTd key={`day-${weekIndex}-${dayIndex}`} {...props} />\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t))}\n\t\t</tbody>\n\t);\n}\n\nexport { CalendarTableBody };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype CalendarTableContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction CalendarTableContainer({ children }: CalendarTableContainerProps) {\n\treturn <table className=\"arkynCalendarTableContainer\">{children}</table>;\n}\n\nexport { CalendarTableContainer };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\nimport { useCalendar } from \"../_calendarProvider\";\nimport \"./styles.css\";\n\nfunction CalendarTableHeader() {\n\tconst { listWeek } = useCalendar();\n\n\treturn (\n\t\t<thead className=\"arkynCalendarTableHeader\">\n\t\t\t<tr>\n\t\t\t\t{listWeek.map((day) => (\n\t\t\t\t\t<th key={day}>{formatToCapitalizeFirstWordLetter(day)}</th>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n}\n\nexport { CalendarTableHeader };\n","import { CalendarProvider } from \"./_calendarProvider\";\nimport { CalendarContainer } from \"./calendarContainer\";\nimport { CalendarHeader } from \"./calendarHeader\";\nimport { CalendarTableBody } from \"./calendarTableBody\";\nimport { CalendarTableContainer } from \"./calendarTableContainer\";\nimport { CalendarTableHeader } from \"./calendarTableHeader\";\n\n/**\n * Props for Calendar single-date selection mode.\n */\ntype SingleCalendarProps = {\n\t/** Sets single-date selection mode. */\n\ttype: \"single\";\n\t/**\n\t * Defines the visual/behavioral variant.\n\t * - `basic`: simplified header.\n\t * - `complete`: full navigation experience.\n\t *\n\t * @default \"complete\"\n\t */\n\tvariant?: \"basic\" | \"complete\";\n\t/** Currently selected date. */\n\tvalue?: Date;\n\t/** Initial selected date. */\n\tdefaultValue?: Date;\n\t/** Callback fired when the selected date changes. */\n\tonChange?: (date: Date) => void;\n\t/** Currently focused view date. */\n\tviewValue?: Date;\n\t/** Initial focused view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n};\n\n/**\n * Props for Calendar range selection mode.\n */\ntype RangeCalendarProps = {\n\t/** Sets range selection mode. */\n\ttype: \"range\";\n\t/**\n\t * Defines the visual/behavioral variant.\n\t * - `basic`: simplified header.\n\t * - `complete`: full navigation experience.\n\t *\n\t * @default \"complete\"\n\t */\n\tvariant?: \"basic\" | \"complete\";\n\t/** Currently selected range in `[start, end]` format. */\n\tvalue?: [Date, Date];\n\t/** Initial selected range in `[start, end]` format. */\n\tdefaultValue?: [Date, Date];\n\t/** Callback fired when the selected range changes. */\n\tonChange?: (date: [Date, Date]) => void;\n\t/** Currently focused view date. */\n\tviewValue?: Date;\n\t/** Initial focused view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n};\n\n/**\n * Discriminated union of Calendar props.\n */\ntype CalendarProps = SingleCalendarProps | RangeCalendarProps;\n\n/**\n * Reusable calendar component with support for two selection modes:\n * single date (`single`) and range (`range`).\n *\n * The component encapsulates calendar state and navigation rules through\n * `CalendarProvider`, exposing a simple API for forms, filters,\n * and scheduling flows.\n *\n * @param props Calendar properties (`single` or `range` mode).\n * @returns Calendar UI structure with header and date grid.\n *\n * @example\n * // Single-date selection\n * <Calendar\n * type=\"single\"\n * variant=\"complete\"\n * defaultValue={new Date()}\n * onChange={(date) => {\n * console.log(\"Selected date:\", date);\n * }}\n * onChangeView={(viewDate) => {\n * console.log(\"Current view:\", viewDate);\n * }}\n * />\n *\n * @example\n * // Range selection\n * <Calendar\n * type=\"range\"\n * variant=\"basic\"\n * defaultValue={[new Date(2026, 5, 1), new Date(2026, 5, 15)]}\n * onChange={([start, end]) => {\n * console.log(\"Range:\", start, end);\n * }}\n * onChangeView={(viewDate) => {\n * console.log(\"Focused month:\", viewDate);\n * }}\n * />\n */\nfunction Calendar(props: CalendarProps) {\n\tconst variant = props.variant || \"complete\";\n\n\tif (props.type === \"range\") {\n\t\treturn (\n\t\t\t<CalendarProvider\n\t\t\t\tvalue={props.value}\n\t\t\t\tviewValue={props.viewValue}\n\t\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\t\tdefaultValue={props.defaultValue}\n\t\t\t\tcalendarType=\"range\"\n\t\t\t\tonChange={props.onChange}\n\t\t\t\tonChangeView={props.onChangeView}\n\t\t\t>\n\t\t\t\t<CalendarContainer>\n\t\t\t\t\t<CalendarHeader basicMode={variant.includes(\"basic\")} />\n\t\t\t\t\t<CalendarTableContainer>\n\t\t\t\t\t\t<CalendarTableHeader />\n\t\t\t\t\t\t<CalendarTableBody />\n\t\t\t\t\t</CalendarTableContainer>\n\t\t\t\t</CalendarContainer>\n\t\t\t</CalendarProvider>\n\t\t);\n\t}\n\n\treturn (\n\t\t<CalendarProvider\n\t\t\tvalue={props.value}\n\t\t\tviewValue={props.viewValue}\n\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\tdefaultValue={props.defaultValue}\n\t\t\tcalendarType=\"single\"\n\t\t\tonChange={props.onChange}\n\t\t\tonChangeView={props.onChangeView}\n\t\t>\n\t\t\t<CalendarContainer>\n\t\t\t\t<CalendarHeader basicMode={variant.includes(\"basic\")} />\n\t\t\t\t<CalendarTableContainer>\n\t\t\t\t\t<CalendarTableHeader />\n\t\t\t\t\t<CalendarTableBody />\n\t\t\t\t</CalendarTableContainer>\n\t\t\t</CalendarContainer>\n\t\t</CalendarProvider>\n\t);\n}\n\nexport { Calendar };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype CardTabContextProps = {\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\ntype CardTabProviderProps = {\n\tchildren: ReactNode;\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\nconst CardTabContext = createContext({} as CardTabContextProps);\n\nfunction useCardTab() {\n\treturn useContext(CardTabContext);\n}\n\nfunction CardTabProvider(props: CardTabProviderProps) {\n\tconst { disabled, currentTab, changeCurrentTab } = props;\n\n\tconst value = useMemo(\n\t\t() => ({ disabled, currentTab, changeCurrentTab }),\n\t\t[disabled, currentTab, changeCurrentTab],\n\t);\n\n\treturn (\n\t\t<CardTabContext.Provider value={value}>\n\t\t\t{props.children}\n\t\t</CardTabContext.Provider>\n\t);\n}\n\nexport { CardTabProvider, useCardTab };\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useCardTab } from \"../cardTabContext\";\nimport \"./styles.css\";\n\ntype CardTabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * CardTabButton, individual tab button inside a `CardTabContainer`.\n *\n * Reads active state and disabled state from `CardTabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns CardTabButton JSX element.\n *\n * @example\n * ```tsx\n * <CardTabContainer defaultValue=\"details\" onChange={setTab}>\n * <CardTabButton value=\"details\">Details</CardTabButton>\n * <CardTabButton value=\"history\">History</CardTabButton>\n * <CardTabButton value=\"settings\" disabled>Settings</CardTabButton>\n * </CardTabContainer>\n * ```\n */\n\nfunction CardTabButton(props: CardTabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useCardTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynCardTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { CardTabButton };\n","import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { CardTabProvider } from \"../cardTabContext\";\nimport \"./styles.css\";\n\ntype CardTabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onClick\" | \"children\" | \"ref\" | \"onChange\"\n> & {\n\t/** `CardTabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * CardTabContainer, wrapper that manages active state for a group of `CardTabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `CardTabButton`.\n *\n * @param props.children - `CardTabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns CardTabContainer JSX element.\n *\n * @example\n * ```tsx\n * <CardTabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <CardTabButton value=\"overview\">Overview</CardTabButton>\n * <CardTabButton value=\"analytics\">Analytics</CardTabButton>\n * <CardTabButton value=\"settings\">Settings</CardTabButton>\n * </CardTabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction CardTabContainer(props: CardTabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynCardTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<CardTabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</CardTabProvider>\n\t);\n}\n\nexport { CardTabContainer };\n","import { Check } from \"lucide-react\";\nimport { type ButtonHTMLAttributes, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\n\nimport \"./styles.css\";\n\ntype CheckboxProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t| \"size\"\n\t| \"prefix\"\n\t| \"type\"\n\t| \"name\"\n\t| \"defaultValue\"\n\t| \"value\"\n\t| \"onChange\"\n\t| \"onSelect\"\n\t| \"onClick\"\n> & {\n\t/** Optional label text displayed beside the checkbox. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Validation error message displayed below the checkbox. */\n\terrorMessage?: string;\n\t/**\n\t * Checkbox size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\" | \"sm\";\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Value stored in the hidden input when checked. @default \"checked\" */\n\tvalue?: string;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Callback fired on toggle, receives the value string (or `\"\"` when unchecked). */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Checkbox, interactive checkbox input with label, validation, and form integration.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the checkbox.\n * @param props.size - Checkbox size (`sm` | `md` | `lg`). Default: \"md\"\n * @param props.value - Value stored when checked. Default: \"checked\"\n * @param props.checked - Controlled checked state.\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.onCheck - Callback fired on toggle, receives value or `\"\"` when unchecked.\n * @param props.errorMessage - Validation error message.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * **...Other valid HTML properties for `<button>` (except `type`, `name`, `defaultValue`, `value`, `onChange`, `onSelect`, `onClick`)**\n *\n * @returns Checkbox JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Checkbox name=\"terms\" label=\"I agree to the terms and conditions\" />\n *\n * // With custom value and error\n * <Checkbox\n * name=\"newsletter\"\n * label=\"Subscribe to newsletter\"\n * value=\"subscribed\"\n * errorMessage={errors.newsletter}\n * />\n *\n * // Controlled\n * <Checkbox\n * name=\"premium\"\n * label=\"Enable premium features\"\n * size=\"lg\"\n * checked={isPremium}\n * onCheck={(v) => setIsPremium(!!v)}\n * />\n * ```\n */\n\nfunction Checkbox(props: CheckboxProps) {\n\tconst {\n\t\tid,\n\t\tname,\n\t\tclassName: wrapperClassName = \"\",\n\t\tsize = \"md\",\n\t\terrorMessage: baseErrorMessage,\n\t\tdefaultChecked = false,\n\t\tlabel,\n\t\tchecked: baseChecked = null,\n\t\tonCheck,\n\t\torientation = \"horizontalReverse\",\n\t\tshowAsterisk,\n\t\tunShowFieldTemplate,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst checkboxRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst checkboxId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked || false);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst currentCheckedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\n\tconst className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass}`;\n\n\tfunction handleCheck() {\n\t\tconst defaultChecked = isChecked;\n\t\tsetIsChecked(!defaultChecked);\n\t\tonCheck?.(!defaultChecked ? value || \"checked\" : \"\");\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\tid={checkboxId}\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={className}\n\t\t\t\tonClick={handleCheck}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={checkboxRef}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : \"\"}\n\t\t\t\t/>\n\n\t\t\t\t<Check />\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Checkbox };\n","import { useSyncExternalStore } from \"react\";\n\nfunction subscribe() {\n\treturn () => {};\n}\n\n/**\n * useHydrated, returns `true` once the component has hydrated on the client, `false` during SSR.\n *\n * Built on `useSyncExternalStore` so it is safe with React 18 concurrent rendering.\n * Use this when you need to defer client-only rendering (e.g. browser APIs, `window`, `navigator`)\n * without causing a hydration mismatch. For most cases, prefer the `ClientOnly` component.\n *\n * @returns `true` on the client after hydration; `false` on the server.\n *\n * @example\n * ```tsx\n * function Map() {\n * const isHydrated = useHydrated();\n * if (!isHydrated) return <Skeleton />;\n * return <MapView accessToken={token} coordinates={coords} />;\n * }\n * ```\n */\n\nfunction useHydrated() {\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => true,\n\t\t() => false,\n\t);\n}\n\nexport { useHydrated };\n","import { useHydrated } from \"../hooks/useHydrated\";\n\ntype ClientOnlyProps = {\n\t/** Render function, called after hydration on the client. Required. */\n\tchildren(): React.ReactNode;\n\t/** Content rendered during SSR or before hydration. @default null */\n\tfallback?: React.ReactNode;\n};\n\n/**\n * ClientOnly, renders its children only after client-side hydration.\n *\n * Prevents React hydration mismatches for components that rely on browser-only APIs\n * (e.g. `window`, `navigator`, `document`). Uses `useHydrated` internally.\n *\n * @param props.children - Render function executed after hydration. Required.\n * @param props.fallback - Content shown during SSR / before hydration. Default: null\n *\n * @returns `children()` after hydration, otherwise `fallback`.\n *\n * @example\n * ```tsx\n * // With a skeleton fallback\n * <ClientOnly fallback={<Skeleton />}>\n * {() => <InteractiveWidget />}\n * </ClientOnly>\n *\n * // Using browser APIs safely\n * <ClientOnly fallback={<p>Loading...</p>}>\n * {() => <p>Current time: {new Date().toLocaleString()}</p>}\n * </ClientOnly>\n * ```\n */\n\nfunction ClientOnly(props: ClientOnlyProps) {\n\tconst { children, fallback = null } = props;\n\treturn useHydrated() ? children() : fallback;\n}\n\nexport { ClientOnly };\n","import { formatToCurrency, removeNonNumeric } from \"@arkyn/shared\";\n\ntype Locale =\n\t| \"USD\"\n\t| \"EUR\"\n\t| \"JPY\"\n\t| \"GBP\"\n\t| \"AUD\"\n\t| \"CAD\"\n\t| \"CHF\"\n\t| \"CNY\"\n\t| \"SEK\"\n\t| \"NZD\"\n\t| \"BRL\"\n\t| \"INR\"\n\t| \"RUB\"\n\t| \"ZAR\"\n\t| \"MXN\"\n\t| \"SGD\"\n\t| \"HKD\"\n\t| \"NOK\"\n\t| \"KRW\"\n\t| \"TRY\"\n\t| \"IDR\"\n\t| \"THB\";\n\nfunction normalizeValue(number: string | number) {\n\tlet safeNumber = number;\n\n\tif (typeof number === \"string\") {\n\t\tsafeNumber = +removeNonNumeric(number);\n\t\tif (safeNumber % 1 !== 0) safeNumber = safeNumber.toFixed(2);\n\t} else {\n\t\tsafeNumber = Number.isInteger(number)\n\t\t\t? Number(number) * 10 ** 2\n\t\t\t: number.toFixed(2);\n\t}\n\n\treturn +removeNonNumeric(String(safeNumber)) / 10 ** 2;\n}\n\nfunction maskCurrencyValues(\n\tinputFieldValue: string | number | undefined,\n\tlocale: Locale,\n): [number, string] {\n\tif (!inputFieldValue) return [0, formatToCurrency(0, locale)];\n\n\tconst value = normalizeValue(inputFieldValue);\n\tconst maskedValue = formatToCurrency(value, locale);\n\n\treturn [value, maskedValue];\n}\n\nexport { maskCurrencyValues, normalizeValue };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport {\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype InputHTMLAttributes,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\nimport {\n\tmaskCurrencyValues,\n\tnormalizeValue,\n} from \"../../services/maskCurrencyValues\";\n\nimport \"./style.css\";\n\ntype Locale =\n\t| \"USD\"\n\t| \"EUR\"\n\t| \"JPY\"\n\t| \"GBP\"\n\t| \"AUD\"\n\t| \"CAD\"\n\t| \"CHF\"\n\t| \"CNY\"\n\t| \"SEK\"\n\t| \"NZD\"\n\t| \"BRL\"\n\t| \"INR\"\n\t| \"RUB\"\n\t| \"ZAR\"\n\t| \"MXN\"\n\t| \"SGD\"\n\t| \"HKD\"\n\t| \"NOK\"\n\t| \"KRW\"\n\t| \"TRY\"\n\t| \"IDR\"\n\t| \"THB\";\n\ntype CurrencyInputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t| \"size\"\n\t| \"prefix\"\n\t| \"name\"\n\t| \"type\"\n\t| \"max\"\n\t| \"defaultValue\"\n\t| \"value\"\n\t| \"onChange\"\n\t| \"placeholder\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/**\n\t * Currency locale used to format the displayed value.\n\t * Supported: `\"USD\"` | `\"EUR\"` | `\"BRL\"` | `\"JPY\"` | `\"GBP\"` | … (22 locales).\n\t * Required.\n\t */\n\tlocale: Locale;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Validation error message displayed below the input. */\n\terrorMessage?: string;\n\t/** Shows a spinner and disables the input during async operations. @default false */\n\tisLoading?: boolean;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\t/** Text or icon rendered at the far left, outside the input area. */\n\tprefix?: string | LucideIcon;\n\t/** Text or icon rendered at the far right, outside the input area. */\n\tsuffix?: string | LucideIcon;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Lucide icon rendered inside the input on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered inside the input on the right. */\n\trightIcon?: LucideIcon;\n\t/** Maximum numeric value allowed. @default 1_000_000_000 */\n\tmax?: number;\n\t/** Controlled numeric value. */\n\tvalue?: number;\n\t/** Uncontrolled default numeric value. */\n\tdefaultValue?: number;\n\t/**\n\t * Callback fired on value change.\n\t * @param event - Native change event.\n\t * @param originalValue - Raw numeric string (e.g. `\"1234.56\"`).\n\t * @param maskedValue - Formatted display string (e.g. `\"$ 1,234.56\"`).\n\t */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement>,\n\t\toriginalValue: string,\n\t\tmaskedValue: string,\n\t) => void;\n};\n\n/**\n * CurrencyInput, numeric input that automatically formats the displayed value according to a currency locale.\n *\n * The raw numeric value is stored in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.locale - Currency locale (e.g. `\"USD\"`, `\"BRL\"`, `\"EUR\"`). Required.\n * @param props.label - Label text displayed above the input.\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a spinner and disables the input. Default: false\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.max - Maximum numeric value allowed. Default: 1_000_000_000\n * @param props.value - Controlled numeric value.\n * @param props.defaultValue - Uncontrolled default numeric value.\n * @param props.onChange - Callback fired on change, receives the event, the raw numeric string, and the formatted string.\n * @param props.prefix - Text or icon at the far left.\n * @param props.suffix - Text or icon at the far right.\n * @param props.leftIcon - Lucide icon inside the input on the left.\n * @param props.rightIcon - Lucide icon inside the input on the right.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * **...Other valid HTML properties for `<input>` (except `type`, `max`, `value`, `defaultValue`, `onChange`, `placeholder`)**\n *\n * @returns CurrencyInput JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <CurrencyInput name=\"price\" locale=\"USD\" />\n *\n * // With label and validation\n * <CurrencyInput\n * name=\"salary\"\n * locale=\"BRL\"\n * label=\"Monthly Salary\"\n * showAsterisk\n * errorMessage=\"Please enter a valid amount\"\n * />\n *\n * // With max value and controlled state\n * <CurrencyInput\n * name=\"limit\"\n * locale=\"USD\"\n * label=\"Credit Limit\"\n * max={10000}\n * value={creditLimit}\n * onChange={(e, original) => setCreditLimit(Number(original))}\n * />\n * ```\n */\n\nfunction CurrencyInput(props: CurrencyInputProps) {\n\tconst {\n\t\tname,\n\t\tdisabled,\n\t\ttitle,\n\t\tstyle,\n\t\tvariant = \"solid\",\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tvalue,\n\t\tdefaultValue,\n\t\tmax = 1000000000,\n\t\tlocale,\n\t\tonChange,\n\t\tprefix,\n\t\tsuffix,\n\t\tisLoading = false,\n\t\tleftIcon,\n\t\treadOnly,\n\t\tonFocus,\n\t\tonBlur,\n\t\terrorMessage: baseErrorMessage,\n\t\tunShowFieldTemplate,\n\t\torientation,\n\t\tshowAsterisk,\n\t\trightIcon,\n\t\tsize = \"md\",\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [maskedValue, setMaskedValue] = useState(\"0\");\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingPosition = rightIcon ? \"right\" : \"left\";\n\n\tconst showLeftSpinner = loadingPosition === \"left\" && isLoading;\n\tconst showRightSpinner = loadingPosition === \"right\" && isLoading;\n\n\tfunction handleSectionClick() {\n\t\tif (isDisabled || !inputRef?.current) return;\n\t\tsetIsFocused(true);\n\t\tinputRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\tconst updateValues = (originalValue: string | number) => {\n\t\tconst [calculatedValue, calculatedMaskedValue] = maskCurrencyValues(\n\t\t\toriginalValue,\n\t\t\tlocale,\n\t\t);\n\n\t\tif (!max || calculatedValue <= max) {\n\t\t\tsetMaskedValue(calculatedMaskedValue);\n\t\t\treturn [calculatedValue, calculatedMaskedValue];\n\t\t}\n\n\t\treturn maskCurrencyValues(originalValue, locale);\n\t};\n\n\tconst handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n\t\tevent.preventDefault();\n\t\tconst [originalValue, maskedValue] = updateValues(event.target.value);\n\n\t\tonChange?.(event, String(originalValue), String(maskedValue));\n\t};\n\n\tuseEffect(() => {\n\t\tfunction currentValue() {\n\t\t\tif (typeof value === \"number\") return value;\n\t\t\tif (typeof defaultValue === \"number\") return defaultValue;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst [, maskedValue] = maskCurrencyValues(currentValue(), locale);\n\n\t\tsetMaskedValue(maskedValue);\n\t}, [locale, defaultValue, value]);\n\n\tconst hasPrefix = prefix ? \"hasPrefix\" : \"\";\n\tconst hasSuffix = suffix ? \"hasSuffix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = isDisabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tclassName={className}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t>\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showLeftSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />\n\n\t\t\t\t<input\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tplaceholder={isDisabled ? maskedValue : undefined}\n\t\t\t\t\tvalue={isDisabled ? undefined : maskedValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={normalizeValue(maskedValue)}\n\t\t\t\t\treadOnly\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showRightSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={suffix} className=\"suffix\" />\n\t\t\t</section>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { CurrencyInput };\n","import { type ReactNode, useEffect, useRef, useState } from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\n\nimport \"./styles.css\";\n\ntype DatePickerCalendarContainerProps = {\n\tisFocused: boolean;\n\tchildren: ReactNode;\n};\n\nfunction DatePickerCalendarContainer(props: DatePickerCalendarContainerProps) {\n\tconst { children, isFocused } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tuseScrollLock(isFocused);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 420;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isFocused]);\n\n\tif (!isFocused) return null;\n\n\treturn (\n\t\t<div\n\t\t\tref={containerRef}\n\t\t\tclassName={`arkynDatePickerCalendarContainer ${position}`}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { DatePickerCalendarContainer };\n","import { ChevronDown } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype DatePickerChevronProps = {\n\tisLoading: boolean;\n\ticonSize: number;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisFocused: boolean;\n};\n\nfunction DatePickerChevron(props: DatePickerChevronProps) {\n\tconst { iconSize, isLoading, disabled, readOnly, isFocused } = props;\n\n\tconst notAnimate = disabled || readOnly ? \"notAnimate\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynDatePickerChevron ${notAnimate} ${focused}`;\n\n\tif (isLoading) return null;\n\treturn (\n\t\t<ChevronDown\n\t\t\tclassName={className}\n\t\t\tstrokeWidth={2.5}\n\t\t\tstyle={{\n\t\t\t\tminWidth: iconSize,\n\t\t\t\tminHeight: iconSize,\n\t\t\t\tmaxWidth: iconSize,\n\t\t\t\tmaxHeight: iconSize,\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport { DatePickerChevron };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype DatePickerContainerProps = {\n\tchildren: ReactNode;\n\thandleContainerFocus: () => void;\n\tprefixExists: boolean;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tid: string;\n\tvariant: \"solid\" | \"outline\" | \"underline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction DatePickerContainer(props: DatePickerContainerProps) {\n\tconst {\n\t\tchildren,\n\t\thandleContainerFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName,\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t\tid,\n\t\tprefixExists,\n\t} = props;\n\n\tconst hasPrefix = prefixExists ? \"hasPrefix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\treturn (\n\t\t<section\n\t\t\tid={id}\n\t\t\tclassName={`arkynDatePickerContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`}\n\t\t\tonClick={handleContainerFocus}\n\t\t>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { DatePickerContainer };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype DatePickerContentProps = {\n\tchildren: ReactNode;\n\tsize: \"md\" | \"lg\";\n};\n\nfunction DatePickerContent(props: DatePickerContentProps) {\n\tconst { children, size } = props;\n\tconst className = `arkynDatePickerContent ${size}`;\n\treturn <div className={className}>{children}</div>;\n}\n\nexport { DatePickerContent };\n","import \"./styles.css\";\n\ntype DatePickerOverlayProps = {\n\tisFocused: boolean;\n\thandleBlur: () => void;\n};\n\nfunction DatePickerOverlay(props: DatePickerOverlayProps) {\n\tconst { isFocused, handleBlur } = props;\n\tif (!isFocused) return null;\n\treturn <aside className=\"arkynDatePickerOverlay\" onClick={handleBlur} />;\n}\n\nexport { DatePickerOverlay };\n","import { Loader2 } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype DatePickerSpinnerProps = {\n\ticonSize: number;\n\tisLoading: boolean;\n};\n\nfunction DatePickerSpinner(props: DatePickerSpinnerProps) {\n\tconst { iconSize, isLoading } = props;\n\n\tif (!isLoading) return null;\n\treturn (\n\t\t<Loader2\n\t\t\tclassName=\"arkynDatePickerSpinner\"\n\t\t\tsize={iconSize}\n\t\t\tstrokeWidth={2.5}\n\t\t/>\n\t);\n}\n\nexport { DatePickerSpinner };\n","import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { Calendar } from \"../calendar\";\n\nimport { DatePickerCalendarContainer } from \"./datePickerCalendarContainer\";\nimport { DatePickerChevron } from \"./datePickerChevron\";\nimport { DatePickerContainer } from \"./datePickerContainer\";\nimport { DatePickerContent } from \"./datePickerContent\";\nimport { DatePickerOverlay } from \"./datePickerOverlay\";\nimport { DatePickerSpinner } from \"./datePickerSpinner\";\n\nfunction toInputDateValue(date: Date) {\n\tconst pad = (value: number) => String(value).padStart(2, \"0\");\n\treturn `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n}\n\nfunction toDisplayDateValue(date: Date) {\n\treturn date.toLocaleDateString(\"pt-BR\");\n}\n\ntype BaseDatePickerProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the date picker. */\n\tlabel?: string;\n\t/** Validation error message displayed below the date picker. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no date is selected. @default \"Selecione uma data...\" */\n\tplaceholder?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Closes the calendar after a date is picked.\n\t * @default true for `single`, `false` for `range`.\n\t */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the date picker gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the date picker loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * DatePicker size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the date picker area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the date picker on the left. */\n\tleftIcon?: LucideIcon;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"vertical\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\t/**\n\t * Visual/behavioral variant forwarded to the internal `Calendar`.\n\t * @default \"complete\"\n\t */\n\tcalendarVariant?: \"basic\" | \"complete\";\n};\n\n/**\n * Props for DatePicker single-date selection mode.\n */\ntype SingleDatePickerProps = BaseDatePickerProps & {\n\t/** Sets single-date selection mode. */\n\ttype: \"single\";\n\t/** Controlled selected date. */\n\tvalue?: Date;\n\t/** Uncontrolled default selected date. */\n\tdefaultValue?: Date;\n\t/** Callback fired when the selected date changes. */\n\tonChange?: (date: Date) => void;\n\t/** Currently focused calendar view date. */\n\tviewValue?: Date;\n\t/** Initial focused calendar view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the calendar view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n};\n\n/**\n * Props for DatePicker range selection mode.\n */\ntype RangeDatePickerProps = BaseDatePickerProps & {\n\t/** Sets range selection mode. */\n\ttype: \"range\";\n\t/** Controlled selected range in `[start, end]` format. */\n\tvalue?: [Date, Date];\n\t/** Uncontrolled default range in `[start, end]` format. */\n\tdefaultValue?: [Date, Date];\n\t/** Callback fired when the selected range changes. */\n\tonChange?: (date: [Date, Date]) => void;\n\t/** Currently focused calendar view date. */\n\tviewValue?: Date;\n\t/** Initial focused calendar view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the calendar view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n\t/** Text placed between the start and end dates. @default \" até \" */\n\trangeSeparator?: string;\n};\n\n/**\n * Discriminated union of DatePicker props.\n */\ntype DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;\n\n/**\n * DatePicker, date input field with a popover `Calendar`, supporting single-date\n * (`single`) and range (`range`) selection modes.\n *\n * Opens the calendar on click, the same way `Select` opens its options list, flipping\n * upward or downward depending on the available viewport space so it never renders\n * off-screen. Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.type - Selection mode (`single` | `range`). Required.\n * @param props.value - Controlled selected date (`single`) or range (`range`).\n * @param props.defaultValue - Uncontrolled default date or range.\n * @param props.label - Label text displayed above the date picker.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione uma data...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the calendar after picking. Default: `true` for `single`, `false` for `range`.\n * @param props.onChange - Callback fired when the selected date/range changes.\n * @param props.calendarVariant - Visual/behavioral variant of the internal `Calendar`. Default: \"complete\"\n * @param props.size - DatePicker size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"vertical\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns DatePicker JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Single date\n * <DatePicker\n * type=\"single\"\n * name=\"birthDate\"\n * label=\"Data de nascimento\"\n * onChange={(date) => console.log(\"Selected date:\", date)}\n * />\n *\n * // Range\n * <DatePicker\n * type=\"range\"\n * name=\"stay\"\n * label=\"Período da estadia\"\n * calendarVariant=\"basic\"\n * onChange={([start, end]) => console.log(\"Range:\", start, end)}\n * />\n * ```\n */\nfunction DatePicker(props: DatePickerProps) {\n\tconst {\n\t\tname,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione uma data...\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonFocus,\n\t\tonBlur,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t\tcalendarVariant = \"complete\",\n\t} = props;\n\n\tconst closeOnSelect = props.closeOnSelect ?? props.type === \"single\";\n\n\tconst { fieldErrors } = useForm();\n\n\tconst datePickerRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst datePickerId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [internalSingleValue, setInternalSingleValue] = useState<\n\t\tDate | undefined\n\t>(props.type === \"single\" ? props.defaultValue : undefined);\n\tconst [internalRangeValue, setInternalRangeValue] = useState<\n\t\t[Date, Date] | undefined\n\t>(props.type === \"range\" ? props.defaultValue : undefined);\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !datePickerRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tdatePickerRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && datePickerRef.current) datePickerRef.current.blur();\n\t}\n\n\tfunction handleChangeSingleDate(date: Date) {\n\t\tif (value === undefined) setInternalSingleValue(date);\n\t\tif (props.type === \"single\") props.onChange?.(date);\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tfunction handleChangeRangeDate(range: [Date, Date]) {\n\t\tif (value === undefined) setInternalRangeValue(range);\n\t\tif (props.type === \"range\") props.onChange?.(range);\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tif (props.type === \"range\") {\n\t\tconst rangeSeparator = props.rangeSeparator ?? \" até \";\n\t\tconst forceValue =\n\t\t\tvalue !== undefined ? (value as [Date, Date]) : internalRangeValue;\n\n\t\tconst hiddenInputValue = forceValue\n\t\t\t? JSON.stringify([\n\t\t\t\t\ttoInputDateValue(forceValue[0]),\n\t\t\t\t\ttoInputDateValue(forceValue[1]),\n\t\t\t\t])\n\t\t\t: \"\";\n\n\t\treturn (\n\t\t\t<FieldTemplate\n\t\t\t\tname={name}\n\t\t\t\tlabel={label}\n\t\t\t\tshowAsterisk={showAsterisk}\n\t\t\t\tclassName={wrapperClassName}\n\t\t\t\terrorMessage={errorMessage}\n\t\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\t\torientation={orientation}\n\t\t\t>\n\t\t\t\t<DatePickerContainer\n\t\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisError={isError}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tprefixExists={!!prefix}\n\t\t\t\t\tid={datePickerId}\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\tref={datePickerRef}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tvalue={hiddenInputValue}\n\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t\t<DatePickerContent size={size}>\n\t\t\t\t\t\t{forceValue ? (\n\t\t\t\t\t\t\t<p className=\"hasValue\">\n\t\t\t\t\t\t\t\t{toDisplayDateValue(forceValue[0])}\n\t\t\t\t\t\t\t\t{rangeSeparator}\n\t\t\t\t\t\t\t\t{toDisplayDateValue(forceValue[1])}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<p>{placeholder}</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DatePickerContent>\n\n\t\t\t\t\t<DatePickerCalendarContainer isFocused={isFocused}>\n\t\t\t\t\t\t<Calendar\n\t\t\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t\t\tvariant={calendarVariant}\n\t\t\t\t\t\t\tvalue={forceValue}\n\t\t\t\t\t\t\tonChange={handleChangeRangeDate}\n\t\t\t\t\t\t\tviewValue={props.viewValue}\n\t\t\t\t\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\t\t\t\t\tonChangeView={props.onChangeView}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</DatePickerCalendarContainer>\n\n\t\t\t\t\t<DatePickerChevron\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<DatePickerSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t\t<DatePickerOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t\t</DatePickerContainer>\n\t\t\t</FieldTemplate>\n\t\t);\n\t}\n\n\tconst forceValue =\n\t\tvalue !== undefined ? (value as Date) : internalSingleValue;\n\n\tconst hiddenInputValue = forceValue ? toInputDateValue(forceValue) : \"\";\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<DatePickerContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={datePickerId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={datePickerRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={hiddenInputValue}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<DatePickerContent size={size}>\n\t\t\t\t\t{forceValue ? (\n\t\t\t\t\t\t<p className=\"hasValue\">{toDisplayDateValue(forceValue)}</p>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<p>{placeholder}</p>\n\t\t\t\t\t)}\n\t\t\t\t</DatePickerContent>\n\n\t\t\t\t<DatePickerCalendarContainer isFocused={isFocused}>\n\t\t\t\t\t<Calendar\n\t\t\t\t\t\ttype=\"single\"\n\t\t\t\t\t\tvariant={calendarVariant}\n\t\t\t\t\t\tvalue={forceValue}\n\t\t\t\t\t\tonChange={handleChangeSingleDate}\n\t\t\t\t\t\tviewValue={props.viewValue}\n\t\t\t\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\t\t\t\tonChangeView={props.onChangeView}\n\t\t\t\t\t/>\n\t\t\t\t</DatePickerCalendarContainer>\n\n\t\t\t\t<DatePickerChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<DatePickerSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<DatePickerOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</DatePickerContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { DatePicker };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype DrawerContextProps = {\n\tmakeInvisible: () => void;\n};\n\ntype DrawerProviderProps = {\n\tchildren: ReactNode;\n\tmakeInvisible: () => void;\n};\n\nconst drawerContext = createContext({} as DrawerContextProps);\n\nfunction DrawerProvider(props: DrawerProviderProps) {\n\tconst value = useMemo(\n\t\t() => ({ makeInvisible: props.makeInvisible }),\n\t\t[props.makeInvisible],\n\t);\n\n\treturn (\n\t\t<drawerContext.Provider value={value}>\n\t\t\t{props.children}\n\t\t</drawerContext.Provider>\n\t);\n}\n\nfunction useDrawer() {\n\treturn useContext(drawerContext);\n}\n\nexport { DrawerProvider, useDrawer };\n","import {\n\ttype AnimationEvent,\n\ttype HTMLAttributes,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { DrawerProvider } from \"../drawerContext\";\nimport \"./styles.css\";\n\ntype DrawerContainerProps = HTMLAttributes<HTMLElement> & {\n\t/** Controls whether the drawer is visible. */\n\tisVisible: boolean;\n\t/** Callback invoked when the overlay is clicked to close the drawer. */\n\tmakeInvisible: () => void;\n\t/** Side from which the drawer slides in. @default \"left\" */\n\torientation?: \"left\" | \"right\";\n};\n\n/**\n * DrawerContainer, animated slide-in panel rendered over an overlay backdrop.\n *\n * Locks body scroll while open. Closes when the overlay is clicked.\n * Provides context consumed by `DrawerHeader` (close button).\n *\n * @param props.isVisible - Whether the drawer is open. Required.\n * @param props.makeInvisible - Called when the overlay or close button is clicked. Required.\n * @param props.orientation - Slide direction. Default: `\"left\"`\n *\n * **...Other valid HTML `<aside>` properties**\n *\n * @returns DrawerContainer JSX element.\n *\n * @example\n * ```tsx\n * const [isOpen, setIsOpen] = useState(false);\n *\n * <DrawerContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)} orientation=\"right\">\n * <DrawerHeader><h2>Navigation</h2></DrawerHeader>\n * <nav>...</nav>\n * </DrawerContainer>\n * ```\n */\n\nfunction DrawerContainer(props: DrawerContainerProps) {\n\tconst {\n\t\tisVisible,\n\t\tmakeInvisible,\n\t\torientation = \"left\",\n\t\tchildren,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [mounted, setMounted] = useState(isVisible);\n\tconst [isExiting, setIsExiting] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (isVisible) {\n\t\t\tsetMounted(true);\n\t\t\tsetIsExiting(false);\n\t\t} else if (mounted) {\n\t\t\tsetIsExiting(true);\n\t\t}\n\t}, [isVisible, mounted]);\n\n\tuseScrollLock(isVisible);\n\n\tfunction handleOverlayAnimationEnd(e: AnimationEvent<HTMLDivElement>) {\n\t\tif (e.target === e.currentTarget && isExiting) {\n\t\t\tsetIsExiting(false);\n\t\t\tsetMounted(false);\n\t\t\tmakeInvisible();\n\t\t}\n\t}\n\n\tif (!mounted) return null;\n\n\tconst className = [\n\t\t\"arkynDrawerContainer\",\n\t\torientation,\n\t\tisExiting ? \"exiting\" : \"\",\n\t\tbaseClassName,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\n\treturn (\n\t\t<DrawerProvider makeInvisible={() => setIsExiting(true)}>\n\t\t\t<aside className={className} {...rest}>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"arkynDrawerContainerOverlay\"\n\t\t\t\t\tonClick={() => setIsExiting(true)}\n\t\t\t\t\tonAnimationEnd={handleOverlayAnimationEnd}\n\t\t\t\t/>\n\t\t\t\t<div className=\"arkynDrawerContainerContent\">{children}</div>\n\t\t\t</aside>\n\t\t</DrawerProvider>\n\t);\n}\n\nexport { DrawerContainer };\n","import { X } from \"lucide-react\";\nimport type { HTMLAttributes } from \"react\";\n\nimport { useDrawer } from \"../drawerContext\";\nimport \"./styles.css\";\n\ntype DrawerHeaderProps = HTMLAttributes<HTMLElement> & {\n\t/** Whether to render the X close button. @default true */\n\tshowCloseButton?: boolean;\n};\n\n/**\n * DrawerHeader, header section for a `DrawerContainer`, with an optional close button.\n *\n * The close button calls `makeInvisible` from the nearest `DrawerContainer` context.\n * Must be rendered inside a `DrawerContainer`.\n *\n * @param props.showCloseButton - Renders the X close button. Default: true\n *\n * **...Other valid HTML `<header>` properties**\n *\n * @returns DrawerHeader JSX element.\n *\n * @example\n * ```tsx\n * <DrawerContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>\n * <DrawerHeader>\n * <h2>Navigation</h2>\n * </DrawerHeader>\n * <nav>...</nav>\n * </DrawerContainer>\n * ```\n */\n\nfunction DrawerHeader(props: DrawerHeaderProps) {\n\tconst {\n\t\tshowCloseButton = true,\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst { makeInvisible } = useDrawer();\n\tconst className = `arkynDrawerHeader ${baseClassName}`;\n\n\treturn (\n\t\t<header className={className.trim()} {...rest}>\n\t\t\t{children}\n\n\t\t\t{showCloseButton && (\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"arkynDrawerHeaderCloseButton\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={makeInvisible}\n\t\t\t\t\taria-label=\"Close drawer\"\n\t\t\t\t>\n\t\t\t\t\t<X size={24} />\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</header>\n\t);\n}\n\nexport { DrawerHeader };\n","import type { Fbq } from \"../../types/defineType\";\n\ntype Options = {\n\tautoConfig?: boolean;\n\tdebug?: boolean;\n};\n\nclass FacebookPixel {\n\tpixelId: string;\n\tautoConfig: boolean;\n\tinitialized: boolean;\n\n\tconstructor(pixelId: string, options?: Options) {\n\t\tthis.pixelId = pixelId;\n\t\tthis.autoConfig = options?.autoConfig || true;\n\t\tthis.initialized = false;\n\t}\n\n\tprivate loadFacebookPixel() {\n\t\t// Verifica se o objeto fbq já está definido no objeto window\n\t\tif (window.fbq) return;\n\n\t\t// Define a função fbq que será usada para enviar eventos ao Facebook Pixel\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tconst fbq: Fbq = ((...args: any[]) => {\n\t\t\t// Se fbq.callMethod estiver definido, chama o método com os argumentos fornecidos\n\t\t\t// Caso contrário, adiciona os argumentos à fila de eventos\n\t\t\tfbq.callMethod ? fbq.callMethod.apply(fbq, args) : fbq.queue.push(args);\n\t\t}) as Fbq;\n\n\t\t// Se o objeto _fbq não estiver definido no objeto window, define-o como fbq\n\t\tif (!window._fbq) window._fbq = fbq;\n\n\t\t// Define propriedades e métodos adicionais para fbq\n\t\tfbq.push = fbq;\n\t\tfbq.loaded = true;\n\t\tfbq.version = \"2.0\";\n\t\tfbq.queue = [];\n\n\t\t// Cria um elemento script e define o atributo src como o URL do script do Facebook Pixel\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.async = true;\n\t\tscript.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n\n\t\t// Busca o primeiro elemento script no documento\n\t\tconst firstScript = document.getElementsByTagName(\"script\")[0];\n\n\t\t// Estoura uma exceção se não houver nenhum elemento script no documento\n\t\tif (!firstScript.parentNode) {\n\t\t\tthrow new Error(\"No script tag found in the document\");\n\t\t}\n\n\t\t// Insere o elemento script no início do documento\n\t\tfirstScript.parentNode.insertBefore(script, firstScript);\n\t\twindow.fbq = fbq;\n\t}\n\n\tinit(advancedMatching: object = {}) {\n\t\t// Verifica se o pixel já foi inicializado\n\t\tthis.initialized = typeof window !== \"undefined\" && !!window.fbq;\n\n\t\t// Carrega o Facebook Pixel\n\t\tthis.loadFacebookPixel();\n\n\t\t// Estoura uma exceção se o fbq não estiver definido\n\t\tif (!window.fbq) {\n\t\t\tthrow new Error(\"window.fbq is not defined\");\n\t\t}\n\n\t\t// Inicializa o pixel com o ID fornecido\n\t\tif (this.autoConfig === false) {\n\t\t\twindow.fbq(\"set\", \"autoConfig\", false, this.pixelId);\n\t\t} else {\n\t\t\twindow.fbq(\"init\", this.pixelId, advancedMatching);\n\t\t}\n\n\t\t// Marca o pixel como inicializado\n\t\tthis.initialized = true;\n\t}\n\n\tpageView() {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"track\", \"PageView\");\n\t}\n\n\ttrack(title: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"track\", title, data);\n\t}\n\n\ttrackSingle(pixel: string, title: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"trackSingle\", pixel, title, data);\n\t}\n\n\ttrackCustom(event: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"trackCustom\", event, data);\n\t}\n\n\ttrackSingleCustom(pixel: string, event: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"trackSingle\", pixel, event, data);\n\t}\n\n\tgrantConsent() {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"consent\", \"grant\");\n\t}\n\n\trevokeConsent() {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"consent\", \"revoke\");\n\t}\n}\n\nexport { FacebookPixel };\n","import type { FacebookPixelProps } from \".\";\nimport { FacebookPixel } from \"./pixel\";\n\nfunction FacebookPixelClient(props: FacebookPixelProps) {\n\tconst {\n\t\tpixelId,\n\t\toptions,\n\t\tpageView,\n\t\ttrack,\n\t\ttrackCustom,\n\t\ttrackSingle,\n\t\ttrackSingleCustom,\n\t\tgrantConsent,\n\t\trevokeConsent,\n\t} = props;\n\n\tconst pixel = new FacebookPixel(pixelId, options);\n\n\tpixel.init();\n\n\tif (pageView) pixel.pageView();\n\tif (grantConsent) pixel.grantConsent();\n\tif (revokeConsent) pixel.revokeConsent();\n\n\tif (track) pixel.track(...track);\n\tif (trackCustom) pixel.trackCustom(...trackCustom);\n\tif (trackSingle) pixel.trackSingle(pixelId, ...trackSingle);\n\tif (trackSingleCustom) pixel.trackSingleCustom(pixelId, ...trackSingleCustom);\n\n\treturn null;\n}\n\nexport { FacebookPixelClient };\n","import { ClientOnly } from \"../clientOnly\";\nimport { FacebookPixelClient } from \"./facebookPixel.client\";\n\ntype FacebookPixelProps = {\n\t/** Facebook Pixel ID from your Ads Manager account. Required. */\n\tpixelId: string;\n\t/** When true, renders the pixel in development mode (bypasses the production check). @default false */\n\tshowInDevMode?: boolean;\n\t/** Pixel initialization options. */\n\toptions?: {\n\t\t/** Enables automatic configuration. @default true */\n\t\tautoConfig?: boolean;\n\t\t/** Enables debug logging in the browser console. @default false */\n\t\tdebug?: boolean;\n\t};\n\t/** When true, fires a standard `PageView` event on mount. */\n\tpageView?: boolean;\n\t/** When true, grants cookie/tracking consent via `fbq(\"consent\", \"grant\")`. */\n\tgrantConsent?: boolean;\n\t/** When true, revokes cookie/tracking consent via `fbq(\"consent\", \"revoke\")`. */\n\trevokeConsent?: boolean;\n\t/** Standard event to track: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrack?: [string, any?];\n\t/** Custom event to track: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrackCustom?: [string, any?];\n\t/** Single-pixel standard event: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrackSingle?: [string, any?];\n\t/** Single-pixel custom event: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrackSingleCustom?: [string, any?];\n};\n\n/**\n * FacebookPixel, injects the Facebook Pixel tracking script client-side.\n *\n * Renders nothing in development mode unless `showInDevMode` is `true`.\n * Wrapped in `ClientOnly` to avoid SSR errors.\n *\n * @param props.pixelId - Facebook Pixel ID. Required.\n * @param props.showInDevMode - Renders in development mode. Default: false\n * @param props.pageView - Fires a `PageView` event on mount.\n * @param props.grantConsent - Grants tracking consent.\n * @param props.revokeConsent - Revokes tracking consent.\n * @param props.track - Standard event to fire: `[eventName, params?]`.\n * @param props.trackCustom - Custom event to fire: `[eventName, params?]`.\n *\n * @returns Empty fragment in dev mode; otherwise the pixel script component.\n *\n * @example\n * ```tsx\n * // Basic page view tracking in root layout\n * <FacebookPixel pixelId=\"123456789012345\" pageView />\n *\n * // With LGPD consent handling\n * <FacebookPixel\n * pixelId=\"123456789012345\"\n * pageView\n * grantConsent={userAcceptedCookies}\n * />\n *\n * // Track a purchase event\n * <FacebookPixel\n * pixelId=\"123456789012345\"\n * track={[\"Purchase\", { value: 99.90, currency: \"BRL\" }]}\n * />\n * ```\n */\nfunction FacebookPixel(props: FacebookPixelProps) {\n\tif (process.env.NODE_ENV !== \"production\" && !props.showInDevMode) {\n\t\treturn null;\n\t}\n\n\treturn <ClientOnly>{() => <FacebookPixelClient {...props} />}</ClientOnly>;\n}\n\nexport { FacebookPixel, type FacebookPixelProps };\n","import {\n\tFile,\n\tFileArchive,\n\tFileAudio,\n\tFileImage,\n\tRefreshCw,\n} from \"lucide-react\";\n\nimport { Button } from \"../../button\";\nimport { Divider } from \"../../divider\";\nimport { IconButton } from \"../../iconButton\";\nimport { Tooltip } from \"../../tooltip\";\n\nimport \"./styles.css\";\n\ntype HasFileContentProps = {\n\tdisabled: boolean;\n\tacceptFile: string;\n\tisLoading: boolean;\n\tchangeFileButtonText: string;\n\tfile: File;\n\treSendFile?: () => void;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction HasFileContent(props: HasFileContentProps) {\n\tconst {\n\t\tdisabled,\n\t\tfile,\n\t\tisLoading,\n\t\tacceptFile,\n\t\tchangeFileButtonText,\n\t\thandleSelectFile,\n\t\treSendFile,\n\t} = props;\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptFile;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\tfunction FileIcon() {\n\t\tif (file.type.startsWith(\"image/\")) return <FileImage />;\n\t\tif (file.type.startsWith(\"audio/\")) return <FileAudio />;\n\t\tif (file.type.startsWith(\"application/zip\")) return <FileArchive />;\n\t\treturn <File />;\n\t}\n\n\treturn (\n\t\t<div className=\"arkynFileUploadHasFileContent\">\n\t\t\t<section className=\"arkynFileUploadFileContainer\">\n\t\t\t\t<FileIcon />\n\t\t\t\t<p>{file.name}</p>\n\t\t\t</section>\n\n\t\t\t<Divider />\n\n\t\t\t<div className=\"arkynFileUploadButtonsContainer\">\n\t\t\t\t{!!reSendFile && (\n\t\t\t\t\t<Tooltip orientation=\"bottom\" text=\"Reenviar arquivo\">\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"resend file\"\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\tonClick={reSendFile}\n\t\t\t\t\t\t\ticon={RefreshCw}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\n\t\t\t\t<Button\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t>\n\t\t\t\t\t{changeFileButtonText}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { HasFileContent };\n","import type { DragEvent } from \"react\";\n\nimport { Button } from \"../../button\";\nimport \"./styles.css\";\n\ntype NoFileContentProps = {\n\tdisabled: boolean;\n\tacceptFile: string;\n\tisLoading: boolean;\n\tselectFileButtonText: string;\n\tdropFileText: string;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction NoFileContent(props: NoFileContentProps) {\n\tconst {\n\t\tdropFileText,\n\t\tisLoading,\n\t\tacceptFile,\n\t\thandleSelectFile,\n\t\tselectFileButtonText,\n\t\tdisabled,\n\t} = props;\n\n\tfunction handleDrop(event: DragEvent<HTMLDivElement>) {\n\t\tif (disabled) return;\n\n\t\tevent.preventDefault();\n\t\tconst file = event.dataTransfer.files[0];\n\t\tif (file) handleSelectFile(file);\n\t}\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptFile;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div onDrop={handleDrop} className=\"arkynFileUploadNoFileContent\">\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{selectFileButtonText}\n\t\t\t</Button>\n\n\t\t\t<p>{dropFileText}</p>\n\t\t</div>\n\t);\n}\n\nexport { NoFileContent };\n","import { useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\n\nimport { HasFileContent } from \"./hasFileContent\";\nimport { NoFileContent } from \"./noFileContent\";\nimport \"./styles.css\";\n\ntype FileUploadProps = {\n\t/** Field name for form submission (stores the uploaded file URL). Required. */\n\tname: string;\n\t/** Server endpoint URL that receives the `multipart/form-data` upload request. Required. */\n\taction: string;\n\t/** Disables file selection and upload. @default false */\n\tdisabled?: boolean;\n\t/** Optional label text displayed above the upload area. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n\t/** Label for the file-picker button after a file is selected. @default \"Alterar arquivo\" */\n\tchangeFileButtonText?: string;\n\t/** Label for the file-picker button before a file is selected. @default \"Selecionar arquivo\" */\n\tselectFileButtonText?: string;\n\t/** Text displayed in the drag-and-drop zone. @default \"Ou arraste e solte o arquivo aqui\" */\n\tdropFileText?: string;\n\t/** HTTP method for the upload request. @default \"POST\" */\n\tmethod?: string;\n\t/** Form-data field name used for the file. @default \"file\" */\n\tfileName?: string;\n\t/** Property name in the server response that contains the file URL. @default \"url\" */\n\tfileResponseName?: string;\n\t/** Accepted file MIME types or extensions (e.g. `\".pdf\"`, `\"image/*\"`). @default \"*\" */\n\tacceptFile?: string;\n\t/** Callback fired after a successful upload. Receives the URL returned by the server. */\n\tonChange?: (url?: string) => void;\n};\n\n/**\n * FileUpload, drag-and-drop file uploader with server upload and file-name preview.\n *\n * Sends the file via `fetch` as `multipart/form-data` and stores the returned URL\n * in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.action - Upload endpoint URL. Required.\n * @param props.disabled - Disables file selection and upload. Default: false\n * @param props.label - Label text displayed above the upload area.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.acceptFile - Accepted MIME types or extensions. Default: \"*\"\n * @param props.method - HTTP method. Default: \"POST\"\n * @param props.fileName - Form-data field name for the file. Default: \"file\"\n * @param props.fileResponseName - Server response property containing the URL. Default: \"url\"\n * @param props.onChange - Callback fired after a successful upload, receives the file URL.\n *\n * @returns FileUpload JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <FileUpload name=\"document\" action=\"/api/upload\" />\n *\n * // PDF only with label and callback\n * <FileUpload\n * name=\"contract\"\n * action=\"/api/upload/docs\"\n * label=\"Contract (PDF)\"\n * showAsterisk\n * acceptFile=\".pdf\"\n * fileResponseName=\"documentUrl\"\n * onChange={(url) => setContractUrl(url)}\n * />\n * ```\n */\n\nfunction FileUpload(props: FileUploadProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk = false,\n\t\taction,\n\t\tfileName = \"file\",\n\t\tmethod = \"POST\",\n\t\tacceptFile = \"*\",\n\t\tfileResponseName = \"url\",\n\t\tchangeFileButtonText = \"Alterar arquivo\",\n\t\tselectFileButtonText = \"Selecionar arquivo\",\n\t\tdropFileText = \"Ou arraste e solte o arquivo aqui\",\n\t\tonChange,\n\t\tdisabled = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst fieldError = fieldErrors?.[name];\n\n\tconst [value, setValue] = useState(\"\");\n\tconst [error, setError] = useState(\"\");\n\tconst [file, setFile] = useState<File | null>(null);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tasync function handleUploadFile(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetIsLoading(true);\n\t\tsetFile(file);\n\t\tsetError(\"\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(fileName, file);\n\n\t\tawait fetch(action, { method: method, body: formData })\n\t\t\t.then(async (response) => await response.json())\n\t\t\t.then((response) => {\n\t\t\t\tif (response?.error) setError(response.error);\n\t\t\t\telse setValue(response?.[fileResponseName]);\n\t\t\t\tonChange?.(response?.[fileResponseName]);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tsetError(\"Erro ao enviar o arquivo\");\n\t\t\t})\n\t\t\t.finally(() => setIsLoading(false));\n\t}\n\n\tfunction handleSelectFile(file: File) {\n\t\tif (disabled) return;\n\t\thandleUploadFile(file);\n\t}\n\n\tconst errorMessage = fieldError || error;\n\n\tconst hasErrorClassName = errorMessage ? \"hasError\" : \"noHasError\";\n\tconst hasFileClassName = file ? \"hasFile\" : \"noHasFile\";\n\tconst className = `arkynFileUpload ${hasErrorClassName} ${hasFileClassName}`;\n\n\treturn (\n\t\t<FieldWrapper>\n\t\t\t{label && <FieldLabel showAsterisk={showAsterisk}>{label}</FieldLabel>}\n\n\t\t\t<div className={className}>\n\t\t\t\t<input type=\"hidden\" name={name} value={value || \"\"} />\n\n\t\t\t\t{!file && (\n\t\t\t\t\t<NoFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptFile={acceptFile}\n\t\t\t\t\t\tdropFileText={dropFileText}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tselectFileButtonText={selectFileButtonText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{file && (\n\t\t\t\t\t<HasFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptFile={acceptFile}\n\t\t\t\t\t\tfile={file}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tchangeFileButtonText={changeFileButtonText}\n\t\t\t\t\t\treSendFile={\n\t\t\t\t\t\t\terrorMessage && file ? () => handleUploadFile(file) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { FileUpload };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\n\ntype FullCalendarCell = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\ntype FullCalendarMatrix = FullCalendarCell[][];\ntype FullCalendarWeekCell = FullCalendarCell & {\n\ttimeInMinutes: number;\n};\n\ntype FullCalendarWeekMatrix = FullCalendarWeekCell[][];\n\nclass ViewService {\n\tcapitalize(text: string) {\n\t\treturn formatToCapitalizeFirstWordLetter(text);\n\t}\n\n\tlistHours(range: [number, number]) {\n\t\tconst [startHour, endHour] = range;\n\t\tconst hours = [];\n\n\t\tfor (\n\t\t\tlet timeInMinutes = startHour * 60;\n\t\t\ttimeInMinutes <= endHour * 60;\n\t\t\ttimeInMinutes += 30\n\t\t) {\n\t\t\thours.push(timeInMinutes);\n\t\t}\n\n\t\treturn hours;\n\t}\n\n\tformatHourLabel(timeInMinutes: number) {\n\t\tconst hour = Math.floor(timeInMinutes / 60);\n\t\tconst minutes = timeInMinutes % 60;\n\n\t\treturn `${String(hour).padStart(2, \"0\")}:${String(minutes).padStart(2, \"0\")}`;\n\t}\n\n\tgetStartOfWeek(viewDate: Date) {\n\t\tconst firstDayOfWeek = new Date(viewDate);\n\t\tfirstDayOfWeek.setHours(0, 0, 0, 0);\n\t\tfirstDayOfWeek.setDate(firstDayOfWeek.getDate() - firstDayOfWeek.getDay());\n\n\t\treturn firstDayOfWeek;\n\t}\n\n\tlistWeek(viewDate: Date, language: string) {\n\t\tconst weekDays = [];\n\t\tconst firstDayOfWeek = this.getStartOfWeek(viewDate);\n\n\t\tfor (let i = 0; i < 7; i++) {\n\t\t\tconst day = new Date(firstDayOfWeek);\n\t\t\tday.setDate(firstDayOfWeek.getDate() + i);\n\t\t\tconst dayName = day.toLocaleDateString(language, {\n\t\t\t\tweekday: \"short\",\n\t\t\t});\n\t\t\tweekDays.push(dayName);\n\t\t}\n\n\t\treturn weekDays;\n\t}\n\n\tlistWeeklyMatrix(viewDate: Date, hours: number[]): FullCalendarWeekMatrix {\n\t\tconst firstDayOfWeek = this.getStartOfWeek(viewDate);\n\t\tconst viewMonth = viewDate.getMonth();\n\n\t\treturn hours.map((hour) => {\n\t\t\treturn Array.from({ length: 7 }, (_, index) => {\n\t\t\t\tconst cellDate = new Date(firstDayOfWeek);\n\t\t\t\tcellDate.setDate(firstDayOfWeek.getDate() + index);\n\n\t\t\t\tlet dayOwner: FullCalendarCell[\"dayOwner\"] = \"current\";\n\n\t\t\t\tif (\n\t\t\t\t\tcellDate.getMonth() < viewMonth ||\n\t\t\t\t\tcellDate.getFullYear() < viewDate.getFullYear()\n\t\t\t\t) {\n\t\t\t\t\tdayOwner = \"previous\";\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcellDate.getMonth() > viewMonth ||\n\t\t\t\t\tcellDate.getFullYear() > viewDate.getFullYear()\n\t\t\t\t) {\n\t\t\t\t\tdayOwner = \"next\";\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tday: cellDate.getDate(),\n\t\t\t\t\tmonth: cellDate.getMonth(),\n\t\t\t\t\tyear: cellDate.getFullYear(),\n\t\t\t\t\tdayOwner,\n\t\t\t\t\ttimeInMinutes: hour,\n\t\t\t\t};\n\t\t\t});\n\t\t});\n\t}\n\n\tlistMonthlyMatrix(viewDate: Date) {\n\t\tconst year = viewDate.getFullYear();\n\t\tconst monthIndex = viewDate.getMonth();\n\n\t\tconst firstDayOfMonth = new Date(year, monthIndex, 1);\n\t\tconst firstWeekday = firstDayOfMonth.getDay();\n\n\t\tconst daysInCurrentMonth = new Date(year, monthIndex + 1, 0).getDate();\n\t\tconst daysInPreviousMonth = new Date(year, monthIndex, 0).getDate();\n\n\t\tconst totalCells = Math.ceil((firstWeekday + daysInCurrentMonth) / 7) * 7;\n\n\t\tconst weeks: FullCalendarMatrix = [];\n\t\tlet currentMonthDay = 1;\n\t\tlet nextMonthDay = 1;\n\n\t\tfor (let i = 0; i < totalCells; i++) {\n\t\t\tconst weekIndex = Math.floor(i / 7);\n\t\t\tif (!weeks[weekIndex]) weeks[weekIndex] = [];\n\n\t\t\tif (i < firstWeekday) {\n\t\t\t\tconst day = daysInPreviousMonth - (firstWeekday - i - 1);\n\t\t\t\tconst month = monthIndex === 0 ? 11 : monthIndex - 1;\n\t\t\t\tconst cellYear = monthIndex === 0 ? year - 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"previous\",\n\t\t\t\t});\n\t\t\t} else if (currentMonthDay <= daysInCurrentMonth) {\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: currentMonthDay,\n\t\t\t\t\tmonth: monthIndex,\n\t\t\t\t\tyear: year,\n\t\t\t\t\tdayOwner: \"current\",\n\t\t\t\t});\n\t\t\t\tcurrentMonthDay++;\n\t\t\t} else {\n\t\t\t\tconst month = monthIndex === 11 ? 0 : monthIndex + 1;\n\t\t\t\tconst cellYear = monthIndex === 11 ? year + 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: nextMonthDay,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"next\",\n\t\t\t\t});\n\t\t\t\tnextMonthDay++;\n\t\t\t}\n\t\t}\n\n\t\treturn weeks;\n\t}\n\n\tnextMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() + 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tnextWeek(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() + 7);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tnextDay(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() + 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() - 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousWeek(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() - 7);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousDay(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() - 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n}\n\nexport { type FullCalendarMatrix, type FullCalendarWeekMatrix, ViewService };\n","import { createContext, type ReactNode, useContext, useState } from \"react\";\nimport {\n\ttype FullCalendarMatrix,\n\ttype FullCalendarWeekMatrix,\n\tViewService,\n} from \"./_viewService\";\n\ntype FullCalendarEvent = {\n\tinitialDate: Date;\n\tendDate?: Date;\n\ttitle: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\tscheme?: \"primary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tonClick?: (data: any) => void;\n};\n\ntype BlockTimestamp = {\n\tinitialDate: Date;\n\tendDate: Date;\n};\n\ntype FullCalendarContextProps = {\n\tevents: FullCalendarEvent[];\n\tblockedTimestamps: BlockTimestamp[];\n\tviewDate: Date;\n\tlistHours: number[];\n\tlistWeek: string[];\n\tlistMonthlyMatrix: FullCalendarMatrix;\n\tlistWeeklyMatrix: FullCalendarWeekMatrix;\n\tnextMonth: () => void;\n\tnextWeek: () => void;\n\tnextDay: () => void;\n\tpreviousMonth: () => void;\n\tpreviousWeek: () => void;\n\tpreviousDay: () => void;\n\tonClickDate?: (date: Date) => void;\n};\n\ntype FullCalendarProviderProps = {\n\tevents: FullCalendarEvent[];\n\tblockedTimestamps: BlockTimestamp[];\n\tchildren: ReactNode;\n\tlanguage?: string;\n\tviewValue?: Date;\n\tdefaultViewValue?: Date;\n\tonChangeView?: (date: Date) => void;\n\tonClickDate?: (date: Date) => void;\n};\n\nconst FullCalendarContext = createContext({} as FullCalendarContextProps);\n\nfunction useFullCalendar() {\n\treturn useContext(FullCalendarContext);\n}\n\nfunction FullCalendarProvider(props: FullCalendarProviderProps) {\n\tconst {\n\t\tblockedTimestamps,\n\t\tchildren,\n\t\tevents,\n\t\tdefaultViewValue = new Date(),\n\t\tlanguage = \"pt-BR\",\n\t\tonChangeView,\n\t\tonClickDate,\n\t\tviewValue,\n\t} = props;\n\n\tconst viewService = new ViewService();\n\tconst listHours = viewService.listHours([8, 18]);\n\n\tconst [rawViewDate, rawSetViewDate] = useState(defaultViewValue);\n\tconst viewDate = viewValue || rawViewDate;\n\n\tfunction setViewDate(date: Date) {\n\t\tif (onChangeView) onChangeView(date);\n\t\trawSetViewDate(date);\n\t}\n\n\treturn (\n\t\t<FullCalendarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tevents,\n\t\t\t\tblockedTimestamps,\n\t\t\t\tviewDate,\n\t\t\t\tlistHours,\n\t\t\t\tlistWeek: viewService.listWeek(viewDate, language),\n\t\t\t\tlistMonthlyMatrix: viewService.listMonthlyMatrix(viewDate),\n\t\t\t\tlistWeeklyMatrix: viewService.listWeeklyMatrix(viewDate, listHours),\n\t\t\t\tnextMonth: () => viewService.nextMonth(viewDate, setViewDate),\n\t\t\t\tnextWeek: () => viewService.nextWeek(viewDate, setViewDate),\n\t\t\t\tnextDay: () => viewService.nextDay(viewDate, setViewDate),\n\t\t\t\tpreviousMonth: () => viewService.previousMonth(viewDate, setViewDate),\n\t\t\t\tpreviousWeek: () => viewService.previousWeek(viewDate, setViewDate),\n\t\t\t\tpreviousDay: () => viewService.previousDay(viewDate, setViewDate),\n\t\t\t\tonClickDate,\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</FullCalendarContext.Provider>\n\t);\n}\n\nexport { FullCalendarProvider, useFullCalendar };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype DayCalendarContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction DayCalendarContainer({ children }: DayCalendarContainerProps) {\n\treturn <div className=\"arkynDayCalendarContainer\">{children}</div>;\n}\n\nexport { DayCalendarContainer };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype DayCalendarEventProps = {\n\ttimeInMinutes: number;\n};\n\nconst SLOT_DURATION_MINUTES = 30;\nconst OVERLAP_OFFSET_PX = 205;\n\nfunction DayCalendarEvent(props: DayCalendarEventProps) {\n\tconst { events, viewDate } = useFullCalendar();\n\n\tconst day = viewDate.getDate();\n\tconst month = viewDate.getMonth();\n\tconst year = viewDate.getFullYear();\n\n\tconst dayEvents = events\n\t\t.map((event, sourceIndex) => ({ event, sourceIndex }))\n\t\t.filter(({ event }) => {\n\t\t\treturn (\n\t\t\t\tevent.initialDate.getDate() === day &&\n\t\t\t\tevent.initialDate.getMonth() === month &&\n\t\t\t\tevent.initialDate.getFullYear() === year\n\t\t\t);\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\tconst startA = a.event.initialDate.getTime();\n\t\t\tconst startB = b.event.initialDate.getTime();\n\n\t\t\tif (startA !== startB) return startA - startB;\n\n\t\t\tconst endA =\n\t\t\t\ta.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;\n\t\t\tconst endB =\n\t\t\t\tb.event.endDate?.getTime() ?? startB + SLOT_DURATION_MINUTES * 60_000;\n\n\t\t\tif (endA !== endB) return endA - endB;\n\t\t\treturn a.sourceIndex - b.sourceIndex;\n\t\t});\n\n\tconst dayEventOrderBySourceIndex = new Map(\n\t\tdayEvents.map((item, orderIndex) => [item.sourceIndex, orderIndex]),\n\t);\n\n\tconst filteredEvents = dayEvents.filter(({ event }) => {\n\t\tconst dayHour = Math.floor(props.timeInMinutes / 60);\n\t\tconst dayMinute = props.timeInMinutes % 60;\n\n\t\tfunction isEventInInterval() {\n\t\t\tconst eventHour = event.initialDate.getHours();\n\t\t\tconst eventMinute = event.initialDate.getMinutes();\n\n\t\t\tif (eventHour !== dayHour) return false;\n\t\t\tif (dayMinute === 0) return eventMinute < 30 && eventMinute >= 0;\n\t\t\tif (dayMinute === 30) return eventMinute >= 30 && eventMinute < 60;\n\t\t}\n\n\t\treturn (\n\t\t\tisEventInInterval() &&\n\t\t\tevent.initialDate.getDate() === day &&\n\t\t\tevent.initialDate.getMonth() === month &&\n\t\t\tevent.initialDate.getFullYear() === year\n\t\t);\n\t});\n\n\tif (filteredEvents.length === 0) return null;\n\n\tfunction makeEventKey(index: number, sourceIndex: number) {\n\t\treturn `${day}-${month}-${year}-${sourceIndex}-${index}`;\n\t}\n\n\tfunction makeHour(date: Date) {\n\t\tconst hours = date.getHours();\n\t\tconst minutes = date.getMinutes();\n\n\t\tif (minutes === 0) return `${hours}h`;\n\t\treturn `${hours}h${minutes}`;\n\t}\n\n\tfunction getEventRangeInMinutes(event: {\n\t\tinitialDate: Date;\n\t\tendDate?: Date;\n\t}) {\n\t\tconst startMinutes =\n\t\t\tevent.initialDate.getHours() * 60 + event.initialDate.getMinutes();\n\n\t\tconst endMinutes = event.endDate\n\t\t\t? event.endDate.getHours() * 60 + event.endDate.getMinutes()\n\t\t\t: startMinutes + SLOT_DURATION_MINUTES;\n\n\t\treturn {\n\t\t\tstartMinutes,\n\t\t\tendMinutes: Math.max(endMinutes, startMinutes + 1),\n\t\t};\n\t}\n\n\tfunction countOverlappingPreviousEvents(\n\t\tcurrentEvent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst current = getEventRangeInMinutes(currentEvent);\n\t\tconst currentOrderIndex = dayEventOrderBySourceIndex.get(sourceIndex);\n\n\t\tif (currentOrderIndex == null) return 0;\n\n\t\treturn dayEvents.reduce((count, item, orderIndex) => {\n\t\t\tif (orderIndex >= currentOrderIndex) return count;\n\n\t\t\tconst candidate = getEventRangeInMinutes(item.event);\n\t\t\tconst intersects =\n\t\t\t\tcandidate.startMinutes < current.endMinutes &&\n\t\t\t\tcandidate.endMinutes > current.startMinutes;\n\n\t\t\tif (!intersects) return count;\n\t\t\treturn count + 1;\n\t\t}, 0);\n\t}\n\n\tfunction getEventStyle(\n\t\tevent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst { startMinutes, endMinutes } = getEventRangeInMinutes(event);\n\t\tconst startOffsetInCell = startMinutes - props.timeInMinutes;\n\n\t\tconst durationInMinutes = Math.max(endMinutes - startMinutes, 1);\n\t\tconst top = (startOffsetInCell / SLOT_DURATION_MINUTES) * 100;\n\t\tconst height = (durationInMinutes / SLOT_DURATION_MINUTES) * 100;\n\t\tconst overlapOffset =\n\t\t\tcountOverlappingPreviousEvents(event, sourceIndex) * OVERLAP_OFFSET_PX;\n\n\t\treturn {\n\t\t\ttop: `${top}%`,\n\t\t\theight: `${height}%`,\n\t\t\tleft: `${overlapOffset}px`,\n\t\t};\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction handleEventClick(event: React.MouseEvent, eventData: any) {\n\t\tevent.stopPropagation();\n\t\teventData.onClick?.(eventData.data);\n\t}\n\n\treturn filteredEvents.map(({ event, sourceIndex }, index) => (\n\t\t<div\n\t\t\tkey={makeEventKey(index, sourceIndex)}\n\t\t\tclassName={`arkynDayCalendarEvent ${event?.scheme || \"primary\"}`}\n\t\t\tstyle={getEventStyle(event, sourceIndex)}\n\t\t\tonClick={(e) => handleEventClick(e, event)}\n\t\t>\n\t\t\t<strong>\n\t\t\t\t{makeHour(event.initialDate)}{\" \"}\n\t\t\t\t{event?.endDate && `- ${makeHour(event.endDate)}`}\n\t\t\t</strong>\n\t\t\t<p>{event.title}</p>\n\t\t</div>\n\t));\n}\n\nexport { DayCalendarEvent };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { ViewService } from \"../../_viewService\";\nimport { DayCalendarEvent } from \"../dayCalendarEvent\";\nimport \"./styles.css\";\n\ntype DayCalendarRowProps = {\n\thour: number;\n\ttimeInMinutes: number;\n};\n\nfunction DayCalendarRow({ hour, timeInMinutes }: DayCalendarRowProps) {\n\tconst viewService = new ViewService();\n\tconst { blockedTimestamps, viewDate, onClickDate } = useFullCalendar();\n\n\tfunction isBlocked() {\n\t\treturn blockedTimestamps.some(\n\t\t\t(timestamp) =>\n\t\t\t\tviewDate >= timestamp.initialDate && viewDate <= timestamp.endDate,\n\t\t);\n\t}\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tevent.stopPropagation();\n\t\tif (isBlocked()) return;\n\n\t\tif (onClickDate) {\n\t\t\tconst date = new Date(viewDate);\n\t\t\tdate.setHours(0, timeInMinutes, 0, 0);\n\t\t\tonClickDate(date);\n\t\t}\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`arkynDayCalendarRow ${isBlocked() ? \"blocked\" : \"\"}`}\n\t\t\tdata-time={timeInMinutes}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t<p>{viewService.formatHourLabel(hour)}</p>\n\n\t\t\t<div className=\"arkynDayCalendarRowContent\">\n\t\t\t\t<DayCalendarEvent timeInMinutes={timeInMinutes} />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { DayCalendarRow, type DayCalendarRowProps };\n","import { useFullCalendar } from \"../_fullCalendarProvider\";\nimport { DayCalendarContainer } from \"./dayCalendarContainer\";\nimport { DayCalendarRow } from \"./dayCalendarRow\";\n\nfunction DayCalendar() {\n\tconst { listHours } = useFullCalendar();\n\treturn (\n\t\t<DayCalendarContainer>\n\t\t\t{listHours.map((hour) => (\n\t\t\t\t<DayCalendarRow key={hour} hour={hour} timeInMinutes={hour} />\n\t\t\t))}\n\t\t</DayCalendarContainer>\n\t);\n}\n\nexport { DayCalendar };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype FullCalendarContainerProps = {\n\tchildren?: ReactNode;\n};\n\nfunction FullCalendarContainer({ children }: FullCalendarContainerProps) {\n\treturn <div className=\"arkynFullCalendarContainer\">{children}</div>;\n}\n\nexport { FullCalendarContainer };\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\n\nimport { CardTabButton } from \"../../cardTab/cardTabButton\";\nimport { CardTabContainer } from \"../../cardTab/cardTabContainer\";\nimport { IconButton } from \"../../iconButton\";\n\nimport { useFullCalendar } from \"../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype FullCalendarHeaderProps = {\n\tviewType: \"day\" | \"week\" | \"month\";\n\tsetViewType: (viewType: \"day\" | \"week\" | \"month\") => void;\n};\n\nfunction FullCalendarHeader(props: FullCalendarHeaderProps) {\n\tconst { setViewType, viewType } = props;\n\tconst fullCalendar = useFullCalendar();\n\n\tfunction handlePrevious() {\n\t\tswitch (viewType) {\n\t\t\tcase \"day\":\n\t\t\t\treturn fullCalendar.previousDay();\n\t\t\tcase \"week\":\n\t\t\t\treturn fullCalendar.previousWeek();\n\t\t\tcase \"month\":\n\t\t\t\treturn fullCalendar.previousMonth();\n\t\t}\n\t}\n\n\tfunction handleNext() {\n\t\tswitch (viewType) {\n\t\t\tcase \"day\":\n\t\t\t\treturn fullCalendar.nextDay();\n\t\t\tcase \"week\":\n\t\t\t\treturn fullCalendar.nextWeek();\n\t\t\tcase \"month\":\n\t\t\t\treturn fullCalendar.nextMonth();\n\t\t}\n\t}\n\n\treturn (\n\t\t<div className=\"arkynFullCalendarHeader\">\n\t\t\t<CardTabContainer\n\t\t\t\tdefaultValue={viewType}\n\t\t\t\tonChange={(value) => setViewType(value as \"day\" | \"week\" | \"month\")}\n\t\t\t>\n\t\t\t\t<CardTabButton value=\"day\">Dia</CardTabButton>\n\t\t\t\t<CardTabButton value=\"week\">Semana</CardTabButton>\n\t\t\t\t<CardTabButton value=\"month\">Mês</CardTabButton>\n\t\t\t</CardTabContainer>\n\n\t\t\t<div className=\"arkynFullCalendarHeaderActions\">\n\t\t\t\t<IconButton\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\ticon={ChevronLeft}\n\t\t\t\t\taria-label=\"Handle previous\"\n\t\t\t\t\tonClick={() => handlePrevious()}\n\t\t\t\t/>\n\n\t\t\t\t<p>\n\t\t\t\t\t{fullCalendar.viewDate.toLocaleDateString(\"pt-BR\", {\n\t\t\t\t\t\tday: \"2-digit\",\n\t\t\t\t\t\tmonth: \"long\",\n\t\t\t\t\t\tyear: \"numeric\",\n\t\t\t\t\t})}\n\t\t\t\t</p>\n\n\t\t\t\t<IconButton\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\ticon={ChevronRight}\n\t\t\t\t\taria-label=\"Handle next\"\n\t\t\t\t\tonClick={() => handleNext()}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { FullCalendarHeader };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype MonthlyCalendarEventProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n};\n\nfunction MonthlyCalendarEvent(props: MonthlyCalendarEventProps) {\n\tconst { events } = useFullCalendar();\n\n\tconst filteredEvents = events.filter((event) => {\n\t\treturn (\n\t\t\tevent.initialDate.getDate() === props.day &&\n\t\t\tevent.initialDate.getMonth() === props.month &&\n\t\t\tevent.initialDate.getFullYear() === props.year\n\t\t);\n\t});\n\n\tif (filteredEvents.length === 0) return null;\n\n\tfunction makeEventKey(index: number) {\n\t\treturn `${props.day}-${props.month}-${props.year}-${index}`;\n\t}\n\n\tfunction makeHour(date: Date) {\n\t\tconst hours = date.getHours();\n\t\tconst minutes = date.getMinutes();\n\n\t\tif (minutes === 0) return `${hours}h`;\n\t\treturn `${hours}h${minutes}`;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction handleEventClick(event: React.MouseEvent, eventData: any) {\n\t\tevent.stopPropagation();\n\t\teventData.onClick?.(eventData.data);\n\t}\n\n\treturn filteredEvents.map((event, index) => (\n\t\t<div\n\t\t\tkey={makeEventKey(index)}\n\t\t\tclassName={`arkynMonthlyCalendarEvent ${event?.scheme || \"primary\"}`}\n\t\t\tonClick={(e) => handleEventClick(e, event)}\n\t\t>\n\t\t\t<strong>\n\t\t\t\t{makeHour(event.initialDate)}{\" \"}\n\t\t\t\t{event?.endDate && `- ${makeHour(event.endDate)}`}\n\t\t\t</strong>\n\t\t\t<p>{event.title}</p>\n\t\t</div>\n\t));\n}\n\nexport { MonthlyCalendarEvent };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { MonthlyCalendarEvent } from \"../monthlyCalendarEvent\";\nimport \"./styles.css\";\n\ntype MonthlyCalendarTableTdProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\nfunction MonthlyCalendarTableTd(props: MonthlyCalendarTableTdProps) {\n\tconst { day, month, year, dayOwner } = props;\n\tconst { blockedTimestamps, onClickDate } = useFullCalendar();\n\n\tfunction isToday() {\n\t\tconst today = new Date();\n\t\treturn (\n\t\t\tday === today.getDate() &&\n\t\t\tmonth === today.getMonth() &&\n\t\t\tyear === today.getFullYear()\n\t\t);\n\t}\n\n\tfunction isBlocked() {\n\t\tconst currentDate = new Date(year, month, day);\n\n\t\treturn blockedTimestamps.some(\n\t\t\t(timestamp) =>\n\t\t\t\tcurrentDate >= timestamp.initialDate &&\n\t\t\t\tcurrentDate <= timestamp.endDate,\n\t\t);\n\t}\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tevent.stopPropagation();\n\t\tif (isBlocked()) return;\n\n\t\tif (onClickDate) {\n\t\t\tconst date = new Date(year, month, day);\n\t\t\tonClickDate(date);\n\t\t}\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tclassName={`arkynMonthlyCalendarTableTd ${dayOwner} ${isBlocked() ? \"blocked\" : \"\"}`}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t<p className={isToday() ? \"today\" : \"\"}>{day}</p>\n\t\t\t<div className=\"arkynMonthlyCalendarEventContainer\">\n\t\t\t\t<MonthlyCalendarEvent day={day} month={month} year={year} />\n\t\t\t</div>\n\t\t</td>\n\t);\n}\n\nexport { MonthlyCalendarTableTd };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { MonthlyCalendarTableTd } from \"../monthlyCalendarTableTd\";\nimport \"./styles.css\";\n\nfunction MonthlyCalendarTableBody() {\n\tconst fullCalendar = useFullCalendar();\n\n\treturn (\n\t\t<tbody className=\"arkynMonthlyCalendarTableBody\">\n\t\t\t{fullCalendar.listMonthlyMatrix.map((week, weekIndex) => (\n\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: week position is stable in monthly matrix\n\t\t\t\t<tr key={weekIndex}>\n\t\t\t\t\t{week.map((props, dayIndex) => (\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: day position is stable in week\n\t\t\t\t\t\t<MonthlyCalendarTableTd key={dayIndex} {...props} />\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t))}\n\t\t</tbody>\n\t);\n}\n\nexport { MonthlyCalendarTableBody };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype MonthlyCalendarTableContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction MonthlyCalendarTableContainer({\n\tchildren,\n}: MonthlyCalendarTableContainerProps) {\n\treturn (\n\t\t<div className=\"arkynMonthlyCalendarTableContainer\">\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { MonthlyCalendarTableContainer };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\nimport { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\nfunction MonthlyCalendarTableHeader() {\n\tconst { listWeek } = useFullCalendar();\n\n\treturn (\n\t\t<thead className=\"arkynMonthlyCalendarTableHeader\">\n\t\t\t<tr>\n\t\t\t\t{listWeek.map((day) => (\n\t\t\t\t\t<th key={day}>{formatToCapitalizeFirstWordLetter(day)}</th>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n}\n\nexport { MonthlyCalendarTableHeader };\n","import { MonthlyCalendarTableBody } from \"./monthlyCalendarTableBody\";\nimport { MonthlyCalendarTableContainer } from \"./monthlyCalendarTableContainer\";\nimport { MonthlyCalendarTableHeader } from \"./monthlyCalendarTableHeader\";\n\nfunction MonthlyCalendar() {\n\treturn (\n\t\t<MonthlyCalendarTableContainer>\n\t\t\t<MonthlyCalendarTableHeader />\n\t\t\t<MonthlyCalendarTableBody />\n\t\t</MonthlyCalendarTableContainer>\n\t);\n}\n\nexport { MonthlyCalendar };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype WeekCalendarEventProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\ttimeInMinutes: number;\n};\n\nconst SLOT_DURATION_MINUTES = 30;\nconst OVERLAP_OFFSET_PX = 40;\n\nfunction WeekCalendarEvent(props: WeekCalendarEventProps) {\n\tconst { events } = useFullCalendar();\n\n\tconst dayEvents = events\n\t\t.map((event, sourceIndex) => ({ event, sourceIndex }))\n\t\t.filter(({ event }) => {\n\t\t\treturn (\n\t\t\t\tevent.initialDate.getDate() === props.day &&\n\t\t\t\tevent.initialDate.getMonth() === props.month &&\n\t\t\t\tevent.initialDate.getFullYear() === props.year\n\t\t\t);\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\tconst startA = a.event.initialDate.getTime();\n\t\t\tconst startB = b.event.initialDate.getTime();\n\n\t\t\tif (startA !== startB) return startA - startB;\n\n\t\t\tconst endA =\n\t\t\t\ta.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;\n\t\t\tconst endB =\n\t\t\t\tb.event.endDate?.getTime() ?? startB + SLOT_DURATION_MINUTES * 60_000;\n\n\t\t\tif (endA !== endB) return endA - endB;\n\t\t\treturn a.sourceIndex - b.sourceIndex;\n\t\t});\n\n\tconst dayEventOrderBySourceIndex = new Map(\n\t\tdayEvents.map((item, orderIndex) => [item.sourceIndex, orderIndex]),\n\t);\n\n\tconst filteredEvents = dayEvents.filter(({ event }) => {\n\t\tconst dayHour = Math.floor(props.timeInMinutes / 60);\n\t\tconst dayMinute = props.timeInMinutes % 60;\n\n\t\tfunction isEventInInterval() {\n\t\t\tconst eventHour = event.initialDate.getHours();\n\t\t\tconst eventMinute = event.initialDate.getMinutes();\n\n\t\t\tif (eventHour !== dayHour) return false;\n\t\t\tif (dayMinute === 0) return eventMinute < 30 && eventMinute >= 0;\n\t\t\tif (dayMinute === 30) return eventMinute >= 30 && eventMinute < 60;\n\t\t}\n\n\t\treturn (\n\t\t\tisEventInInterval() &&\n\t\t\tevent.initialDate.getDate() === props.day &&\n\t\t\tevent.initialDate.getMonth() === props.month &&\n\t\t\tevent.initialDate.getFullYear() === props.year\n\t\t);\n\t});\n\n\tif (filteredEvents.length === 0) return null;\n\n\tfunction makeEventKey(index: number, sourceIndex: number) {\n\t\treturn `${props.day}-${props.month}-${props.year}-${sourceIndex}-${index}`;\n\t}\n\n\tfunction makeHour(date: Date) {\n\t\tconst hours = date.getHours();\n\t\tconst minutes = date.getMinutes();\n\n\t\tif (minutes === 0) return `${hours}h`;\n\t\treturn `${hours}h${minutes}`;\n\t}\n\n\tfunction getEventRangeInMinutes(event: {\n\t\tinitialDate: Date;\n\t\tendDate?: Date;\n\t}) {\n\t\tconst startMinutes =\n\t\t\tevent.initialDate.getHours() * 60 + event.initialDate.getMinutes();\n\n\t\tconst endMinutes = event.endDate\n\t\t\t? event.endDate.getHours() * 60 + event.endDate.getMinutes()\n\t\t\t: startMinutes + SLOT_DURATION_MINUTES;\n\n\t\treturn {\n\t\t\tstartMinutes,\n\t\t\tendMinutes: Math.max(endMinutes, startMinutes + 1),\n\t\t};\n\t}\n\n\tfunction countOverlappingPreviousEvents(\n\t\tcurrentEvent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst current = getEventRangeInMinutes(currentEvent);\n\t\tconst currentOrderIndex = dayEventOrderBySourceIndex.get(sourceIndex);\n\n\t\tif (currentOrderIndex == null) return 0;\n\n\t\treturn dayEvents.reduce((count, item, orderIndex) => {\n\t\t\tif (orderIndex >= currentOrderIndex) return count;\n\n\t\t\tconst candidate = getEventRangeInMinutes(item.event);\n\t\t\tconst intersects =\n\t\t\t\tcandidate.startMinutes < current.endMinutes &&\n\t\t\t\tcandidate.endMinutes > current.startMinutes;\n\n\t\t\tif (!intersects) return count;\n\t\t\treturn count + 1;\n\t\t}, 0);\n\t}\n\n\tfunction getEventStyle(\n\t\tevent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst { startMinutes, endMinutes } = getEventRangeInMinutes(event);\n\t\tconst startOffsetInCell = startMinutes - props.timeInMinutes;\n\n\t\tconst durationInMinutes = Math.max(endMinutes - startMinutes, 1);\n\t\tconst top = (startOffsetInCell / SLOT_DURATION_MINUTES) * 100;\n\t\tconst height = (durationInMinutes / SLOT_DURATION_MINUTES) * 100;\n\t\tconst overlapOffset =\n\t\t\tcountOverlappingPreviousEvents(event, sourceIndex) * OVERLAP_OFFSET_PX;\n\n\t\treturn {\n\t\t\ttop: `${top}%`,\n\t\t\theight: `${height}%`,\n\t\t\tleft: `${overlapOffset}px`,\n\t\t};\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction handleEventClick(event: React.MouseEvent, eventData: any) {\n\t\tevent.stopPropagation();\n\t\teventData.onClick?.(eventData.data);\n\t}\n\n\treturn filteredEvents.map(({ event, sourceIndex }, index) => (\n\t\t<div\n\t\t\tkey={makeEventKey(index, sourceIndex)}\n\t\t\tclassName={`arkynWeekCalendarEvent ${event?.scheme || \"primary\"}`}\n\t\t\tstyle={getEventStyle(event, sourceIndex)}\n\t\t\tonClick={(e) => handleEventClick(e, event)}\n\t\t>\n\t\t\t<strong>\n\t\t\t\t{makeHour(event.initialDate)}{\" \"}\n\t\t\t\t{event?.endDate && `- ${makeHour(event.endDate)}`}\n\t\t\t</strong>\n\t\t\t<p>{event.title}</p>\n\t\t</div>\n\t));\n}\n\nexport { WeekCalendarEvent };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { WeekCalendarEvent } from \"../weekCalendarEvent\";\nimport \"./styles.css\";\n\ntype WeekCalendarTableTdProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n\ttimeInMinutes: number;\n};\n\nfunction WeekCalendarTableTd(props: WeekCalendarTableTdProps) {\n\tconst { day, month, year, dayOwner, timeInMinutes } = props;\n\tconst { blockedTimestamps, onClickDate } = useFullCalendar();\n\n\tfunction isBlocked() {\n\t\tconst currentDate = new Date(year, month, day);\n\n\t\treturn blockedTimestamps.some(\n\t\t\t(timestamp) =>\n\t\t\t\tcurrentDate >= timestamp.initialDate &&\n\t\t\t\tcurrentDate <= timestamp.endDate,\n\t\t);\n\t}\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tevent.stopPropagation();\n\t\tif (isBlocked()) return;\n\n\t\tif (onClickDate) {\n\t\t\tconst date = new Date(year, month, day);\n\t\t\tdate.setHours(0, timeInMinutes, 0, 0);\n\t\t\tonClickDate(date);\n\t\t}\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tclassName={`arkynWeekCalendarTableTd ${dayOwner} ${isBlocked() ? \"blocked\" : \"\"}`}\n\t\t\tdata-day={day}\n\t\t\tdata-time={timeInMinutes}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t<div className=\"arkynWeekCalendarTableTdContent\">\n\t\t\t\t<WeekCalendarEvent\n\t\t\t\t\tday={day}\n\t\t\t\t\tmonth={month}\n\t\t\t\t\tyear={year}\n\t\t\t\t\ttimeInMinutes={timeInMinutes}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</td>\n\t);\n}\n\nexport { WeekCalendarTableTd };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { ViewService } from \"../../_viewService\";\nimport { WeekCalendarTableTd } from \"../weekCalendarTableTd\";\nimport \"./styles.css\";\n\nfunction WeekCalendarTableBody() {\n\tconst fullCalendar = useFullCalendar();\n\tconst viewService = new ViewService();\n\n\treturn (\n\t\t<tbody className=\"arkynWeekCalendarTableBody\">\n\t\t\t{fullCalendar.listWeeklyMatrix.map((hourRow) => (\n\t\t\t\t<tr key={hourRow[0].timeInMinutes}>\n\t\t\t\t\t<td className=\"hourTd\">\n\t\t\t\t\t\t<p>{viewService.formatHourLabel(hourRow[0].timeInMinutes)}</p>\n\t\t\t\t\t</td>\n\n\t\t\t\t\t{hourRow.map((cell) => (\n\t\t\t\t\t\t<WeekCalendarTableTd\n\t\t\t\t\t\t\tkey={`${cell.year}-${cell.month}-${cell.day}-${cell.timeInMinutes}`}\n\t\t\t\t\t\t\t{...cell}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t))}\n\t\t</tbody>\n\t);\n}\n\nexport { WeekCalendarTableBody };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype WeekCalendarTableContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction WeekCalendarTableContainer({\n\tchildren,\n}: WeekCalendarTableContainerProps) {\n\treturn (\n\t\t<div className=\"arkynWeekCalendarTableContainer\">\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { WeekCalendarTableContainer };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\nimport { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\nfunction WeekCalendarTableHeader() {\n\tconst { listWeek, listWeeklyMatrix } = useFullCalendar();\n\tconst firstHourRow = listWeeklyMatrix[0] || [];\n\n\treturn (\n\t\t<thead className=\"arkynWeekCalendarTableHeader\">\n\t\t\t<tr>\n\t\t\t\t<th />\n\t\t\t\t{listWeek.map((day, index) => (\n\t\t\t\t\t<th key={day}>\n\t\t\t\t\t\t<div className=\"arkynWeekCalendarTableHeaderContent\">\n\t\t\t\t\t\t\t<span>{formatToCapitalizeFirstWordLetter(day)}</span>\n\t\t\t\t\t\t\t<strong>{firstHourRow[index]?.day}</strong>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</th>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n}\n\nexport { WeekCalendarTableHeader };\n","import { WeekCalendarTableBody } from \"./weekCalendarTableBody\";\nimport { WeekCalendarTableContainer } from \"./weekCalendarTableContainer\";\nimport { WeekCalendarTableHeader } from \"./weekCalendarTableHeader\";\n\nfunction WeekCalendar() {\n\treturn (\n\t\t<WeekCalendarTableContainer>\n\t\t\t<WeekCalendarTableHeader />\n\t\t\t<WeekCalendarTableBody />\n\t\t</WeekCalendarTableContainer>\n\t);\n}\n\nexport { WeekCalendar };\n","import { useState } from \"react\";\nimport { FullCalendarProvider } from \"./_fullCalendarProvider\";\nimport { DayCalendar } from \"./dayCalendar\";\nimport { FullCalendarContainer } from \"./fullCalendarContainer\";\nimport { FullCalendarHeader } from \"./fullCalendarHeader\";\nimport { MonthlyCalendar } from \"./monthlyCalendar\";\nimport { WeekCalendar } from \"./weekCalendar\";\n\n/**\n * Represents a single event rendered on the calendar.\n */\ntype FullCalendarEvent = {\n\t/** Display label shown on the event block. */\n\ttitle: string;\n\t/** Start date and time of the event. */\n\tinitialDate: Date;\n\t/** End date and time of the event. */\n\tendDate?: Date;\n\t/** Arbitrary payload forwarded to the `onClick` callback. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\t/**\n\t * Color scheme applied to the event block.\n\t * - `primary`: default blue.\n\t * - `success`: green.\n\t * - `warning`: yellow.\n\t * - `danger`: red.\n\t * - `info`: light blue.\n\t *\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t/** Callback fired when the user clicks the event. Receives `data` as argument. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tonClick?: (data: any) => void;\n};\n\n/**\n * Represents a blocked (unavailable) time range on the calendar.\n */\ntype BlockTimestamp = {\n\t/** Start of the blocked range. */\n\tinitialDate: Date;\n\t/** End of the blocked range. */\n\tendDate: Date;\n};\n\n/**\n * Props for the FullCalendar component.\n */\ntype FullCalendarProps = {\n\t/** Controlled value for the currently focused date. */\n\tviewValue?: Date;\n\t/** Initial focused date when the calendar mounts. */\n\tdefaultViewValue?: Date;\n\t/** List of events to display across day, week, and month views. */\n\tevents?: FullCalendarEvent[];\n\t/** Time ranges that should be visually marked as unavailable. */\n\tblockedTimestamps?: BlockTimestamp[];\n\t/** Callback fired when the user navigates to a different period. */\n\tonChangeView?: (date: Date) => void;\n\t/** Callback fired when the user clicks a date cell. */\n\tonClickDate?: (date: Date) => void;\n};\n\n/**\n * Full-featured calendar component with day, week, and month views.\n *\n * Renders a switchable calendar that supports event display, blocked time\n * ranges, and date navigation. Internal state and business logic are managed\n * by `FullCalendarProvider`, keeping the public API minimal.\n *\n * @param props FullCalendar properties.\n * @returns Calendar UI with a view switcher header and the active view grid.\n *\n * @example\n * // Basic usage with events\n * <FullCalendar\n * defaultValue={new Date()}\n * events={[\n * {\n * title: \"Team standup\",\n * initialDate: new Date(2026, 5, 22, 9, 0),\n * endDate: new Date(2026, 5, 22, 9, 30),\n * scheme: \"primary\",\n * onClick: (data) => console.log(\"Event clicked:\", data),\n * },\n * ]}\n * onChangeView={(date) => console.log(\"Viewing:\", date)}\n * onClickDate={(date) => console.log(\"Date clicked:\", date)}\n * />\n *\n * @example\n * // With blocked timestamps\n * <FullCalendar\n * defaultValue={new Date()}\n * blockedTimestamps={[\n * {\n * initialDate: new Date(2026, 5, 22, 12, 0),\n * endDate: new Date(2026, 5, 22, 13, 0),\n * },\n * ]}\n * />\n */\nfunction FullCalendar(props: FullCalendarProps) {\n\tconst [viewType, setViewType] = useState<\"day\" | \"week\" | \"month\">(\"month\");\n\n\treturn (\n\t\t<FullCalendarProvider\n\t\t\tevents={props.events || []}\n\t\t\tviewValue={props.viewValue}\n\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\tonChangeView={props.onChangeView}\n\t\t\tblockedTimestamps={props.blockedTimestamps || []}\n\t\t\tonClickDate={props.onClickDate}\n\t\t>\n\t\t\t<FullCalendarContainer>\n\t\t\t\t<FullCalendarHeader viewType={viewType} setViewType={setViewType} />\n\t\t\t\t{viewType === \"day\" && <DayCalendar />}\n\t\t\t\t{viewType === \"month\" && <MonthlyCalendar />}\n\t\t\t\t{viewType === \"week\" && <WeekCalendar />}\n\t\t\t</FullCalendarContainer>\n\t\t</FullCalendarProvider>\n\t);\n}\n\nexport { FullCalendar };\n","type GenerateGAElementsProps = {\n\tmeasurementId: string;\n};\n\nfunction generateGAElements(props: GenerateGAElementsProps) {\n\tconst { measurementId } = props;\n\n\tif (!measurementId)\n\t\tconsole.warn(\"Google Analytics Measurement ID is required\");\n\n\tconst src = `https://www.googletagmanager.com/gtag/js?id=${measurementId}`;\n\n\tconst script = `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${measurementId}');`;\n\n\treturn {\n\t\tsrc,\n\t\tscript,\n\t};\n}\n\nexport { generateGAElements };\n","import { generateGAElements } from \"./snippets/generateGAElements\";\n\ntype InitializeProps = {\n\tmeasurementId: string;\n};\n\nclass GoogleAnalytics {\n\tprivate initializeAsyncScript(src: string) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.async = true;\n\t\tscript.src = src;\n\t\treturn script;\n\t}\n\n\tprivate initializeInlineScript(content: string) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.innerHTML = content;\n\t\treturn script;\n\t}\n\n\tinitialize(props: InitializeProps) {\n\t\tconst { measurementId } = props;\n\n\t\tconst elements = generateGAElements({ measurementId });\n\n\t\tconst asyncScript = this.initializeAsyncScript(elements.src);\n\t\tconst inlineScript = this.initializeInlineScript(elements.script);\n\n\t\tdocument.head.appendChild(asyncScript);\n\t\tdocument.head.appendChild(inlineScript);\n\t}\n}\n\nexport { GoogleAnalytics };\n","import { GoogleAnalytics } from \"./googleAnalytics\";\n\ntype GoogleAnalyticsClientProps = {\n\tmeasurementId: string;\n};\n\nfunction GoogleAnalyticsClient(props: GoogleAnalyticsClientProps) {\n\tconst googleAnalytics = new GoogleAnalytics();\n\tgoogleAnalytics.initialize(props);\n\n\treturn null;\n}\n\nexport { GoogleAnalyticsClient };\n","import type { JSX } from \"react\";\nimport { ClientOnly } from \"../clientOnly\";\nimport { GoogleAnalyticsClient } from \"./googleAnalytics.client\";\n\ntype GoogleAnalyticsProps = {\n\t/** Google Analytics 4 Measurement ID (e.g. `\"G-XXXXXXXXXX\"`). Required. */\n\tmeasurementId: string;\n\t/** When true, renders the GA4 snippet in development mode (bypasses the production check). @default false */\n\tshowInDevMode?: boolean;\n};\n\n/**\n * GoogleAnalytics, injects the Google Analytics 4 script into the page client-side.\n *\n * Renders nothing in development mode unless `showInDevMode` is `true`.\n * Wrapped in `ClientOnly` to avoid SSR errors.\n *\n * @param props.measurementId - GA4 Measurement ID (e.g. `\"G-XXXXXXXXXX\"`). Required.\n * @param props.showInDevMode - Renders in development mode. Default: false\n *\n * @returns GoogleAnalytics JSX element, or an empty fragment in dev mode.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <GoogleAnalytics measurementId=\"G-XXXXXXXXXX\" />\n *\n * // Enable in development for testing\n * <GoogleAnalytics measurementId=\"G-XXXXXXXXXX\" showInDevMode />\n * ```\n */\n\nfunction GoogleAnalytics(props: GoogleAnalyticsProps): JSX.Element | null {\n\tconst { measurementId, showInDevMode = false } = props;\n\n\tif (process.env.NODE_ENV !== \"production\" && !showInDevMode) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ClientOnly>\n\t\t\t{() => <GoogleAnalyticsClient measurementId={measurementId} />}\n\t\t</ClientOnly>\n\t);\n}\n\nexport { GoogleAnalytics };\n","type AppendToDataLayer = {\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n};\n\nfunction appendToDataLayer(props: AppendToDataLayer) {\n\tconst { dataLayer, dataLayerName } = props;\n\n\treturn `\n window.${dataLayerName} = window.${dataLayerName} || [];\n window.${dataLayerName}.push(${JSON.stringify(dataLayer)})`;\n}\n\nexport { appendToDataLayer };\n","import { appendToDataLayer } from \"./appendToDataLayer\";\n\ntype GenerateGTMElementsProps = {\n\tid: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tpreview: string;\n\tauth: string;\n};\n\nfunction generateGTMElements(props: GenerateGTMElementsProps) {\n\tconst { id, events, dataLayer, dataLayerName, preview, auth } = props;\n\n\tconst gtmAuth = `&gtm_auth=${auth}`;\n\tconst gtmPreview = `&gtm_preview=${preview}`;\n\n\tif (!id) console.warn(\"GTM Id is required\");\n\n\tconst iframe = `\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=${id}${gtmAuth}${gtmPreview}&gtm_cookies_win=x\"\n height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\" id=\"tag-manager\"></iframe>`;\n\n\tconst script = `\n (function(w,d,s,l,i){w[l]=w[l]||[];\n w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', ${JSON.stringify(\n\t\t\t\tevents,\n\t\t\t).slice(1, -1)}});\n var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';\n j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'${gtmAuth}${gtmPreview}&gtm_cookies_win=x';\n f.parentNode.insertBefore(j,f);\n })(window,document,'script','${dataLayerName}','${id}');`;\n\n\tconst dataLayerVar = appendToDataLayer({ dataLayer, dataLayerName });\n\n\treturn {\n\t\tiframe,\n\t\tscript,\n\t\tdataLayerVar,\n\t};\n}\n\nexport { generateGTMElements };\n","import { appendToDataLayer } from \"./snippets/appendToDataLayer\";\nimport { generateGTMElements } from \"./snippets/generateGTMElements\";\n\ntype InitializeDataLayerProps = {\n\tdataLayerName: string;\n\tdataLayer: Record<string, string>;\n};\n\ntype InitializeGTMProps = {\n\tid: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tpreview: string;\n\tauth: string;\n};\n\ntype InitializeProps = {\n\tgtmId: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tauth: string;\n\tpreview: string;\n};\n\ninterface Window {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t[key: string]: any;\n}\n\ndeclare var window: Window;\n\nclass GoogleTagManager {\n\tprivate initializeDataScript(dataLayer: string) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.innerHTML = dataLayer;\n\t\treturn script;\n\t}\n\n\tprivate initializeGTMElements(props: InitializeGTMProps) {\n\t\tconst snippets = generateGTMElements(props);\n\n\t\tconst noScript = () => {\n\t\t\tconst noscript = document.createElement(\"noscript\");\n\t\t\tnoscript.innerHTML = snippets.iframe;\n\t\t\treturn noscript;\n\t\t};\n\n\t\tconst script = () => {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.innerHTML = snippets.script;\n\t\t\treturn script;\n\t\t};\n\n\t\tconst dataScript = this.initializeDataScript(snippets.dataLayerVar);\n\n\t\treturn {\n\t\t\tnoScript,\n\t\t\tscript,\n\t\t\tdataScript,\n\t\t};\n\t}\n\n\tinitializeDataLayer(props: InitializeDataLayerProps) {\n\t\tconst { dataLayer, dataLayerName } = props;\n\n\t\tif (window[dataLayerName]) return window[dataLayerName].push(dataLayer);\n\n\t\tconst snippets = appendToDataLayer({ dataLayer, dataLayerName });\n\t\tconst dataScript = this.initializeDataScript(snippets);\n\n\t\tdocument.head.insertBefore(dataScript, document.head.childNodes[0]);\n\t}\n\n\tinitialize(props: InitializeProps) {\n\t\tconst {\n\t\t\tevents,\n\t\t\tgtmId,\n\t\t\tdataLayer,\n\t\t\tauth = \"\",\n\t\t\tpreview = \"\",\n\t\t\tdataLayerName = \"dataLayer\",\n\t\t} = props;\n\n\t\tconst gtm = this.initializeGTMElements({\n\t\t\tid: gtmId,\n\t\t\tevents: events,\n\t\t\tdataLayer: dataLayer || undefined,\n\t\t\tdataLayerName: dataLayerName,\n\t\t\tauth,\n\t\t\tpreview,\n\t\t});\n\n\t\tif (dataLayer) document.head.appendChild(gtm.dataScript);\n\t\tdocument.head.insertBefore(gtm.script(), document.head.childNodes[0]);\n\t\tdocument.body.insertBefore(gtm.noScript(), document.body.childNodes[0]);\n\t}\n}\n\nexport { GoogleTagManager };\n","import { GoogleTagManager } from \"./googleTagManager\";\n\ntype GoogleTagManagerClientProps = {\n\tgtmId: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tauth: string;\n\tpreview: string;\n};\n\nfunction GoogleTagManagerClient(props: GoogleTagManagerClientProps) {\n\tconst googleTagManager = new GoogleTagManager();\n\tgoogleTagManager.initialize(props);\n\n\treturn null;\n}\n\nexport { GoogleTagManagerClient };\n","import { ClientOnly } from \"../clientOnly\";\nimport { GoogleTagManagerClient } from \"./googleTagManager.client\";\n\ntype GoogleTagManagerProps = {\n\t/** Google Tag Manager container ID (e.g. `\"GTM-XXXXXXX\"`). Required. */\n\tgtmId: string;\n\t/** Additional key-value pairs pushed to the dataLayer on initialization. */\n\tevents?: Record<string, string>;\n\t/** Initial key-value pairs added to the dataLayer before GTM loads. */\n\tdataLayer?: Record<string, string>;\n\t/** Global variable name for the dataLayer array. @default \"dataLayer\" */\n\tdataLayerName?: string;\n\t/** GTM environment auth token (for staging/testing environments). */\n\tauth?: string;\n\t/** GTM environment preview token (e.g. `\"env-3\"`). */\n\tpreview?: string;\n\t/** When true, renders the GTM snippet in development mode (bypasses the production check). @default false */\n\tshowInDevMode?: boolean;\n};\n\n/**\n * GoogleTagManager, injects the GTM `<script>` and `<noscript>` snippets into the page client-side.\n *\n * Renders nothing in development mode unless `showInDevMode` is `true`.\n * Wrapped in `ClientOnly` to avoid SSR errors.\n *\n * @param props.gtmId - GTM container ID (e.g. `\"GTM-XXXXXXX\"`). Required.\n * @param props.dataLayer - Initial key-value pairs for the dataLayer.\n * @param props.dataLayerName - Global dataLayer variable name. Default: \"dataLayer\"\n * @param props.events - Additional key-value pairs pushed on initialization.\n * @param props.auth - GTM environment auth token.\n * @param props.preview - GTM environment preview token (e.g. `\"env-3\"`).\n * @param props.showInDevMode - Renders in development mode. Default: false\n *\n * @returns GoogleTagManager JSX element, or an empty fragment in dev mode.\n *\n * @example\n * ```tsx\n * // Basic setup in your root layout\n * <GoogleTagManager gtmId=\"GTM-XXXXXXX\" />\n *\n * // With initial dataLayer values\n * <GoogleTagManager\n * gtmId=\"GTM-XXXXXXX\"\n * dataLayer={{ pageType: \"home\", userType: \"anonymous\" }}\n * />\n *\n * // Staging/preview environment\n * <GoogleTagManager\n * gtmId=\"GTM-XXXXXXX\"\n * auth=\"your-auth-token\"\n * preview=\"env-3\"\n * showInDevMode\n * />\n * ```\n */\n\nfunction GoogleTagManager(props: GoogleTagManagerProps) {\n\tconst {\n\t\tgtmId,\n\t\tauth = \"\",\n\t\tpreview = \"\",\n\t\tdataLayerName = \"dataLayer\",\n\t\tevents = {},\n\t\tdataLayer = {},\n\t\tshowInDevMode = false,\n\t} = props;\n\n\tif (process.env.NODE_ENV !== \"production\" && !showInDevMode) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ClientOnly>\n\t\t\t{() => (\n\t\t\t\t<GoogleTagManagerClient\n\t\t\t\t\tauth={auth}\n\t\t\t\t\tdataLayer={dataLayer}\n\t\t\t\t\tdataLayerName={dataLayerName}\n\t\t\t\t\tevents={events}\n\t\t\t\t\tgtmId={gtmId}\n\t\t\t\t\tpreview={preview}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ClientOnly>\n\t);\n}\n\nexport { GoogleTagManager };\n","import { RefreshCw } from \"lucide-react\";\n\nimport { Button } from \"../../button\";\nimport { IconButton } from \"../../iconButton\";\nimport { Tooltip } from \"../../tooltip\";\n\nimport \"./styles.css\";\n\ntype HasFileContentProps = {\n\tdisabled: boolean;\n\tacceptImage: string;\n\tisLoading: boolean;\n\tchangeImageButtonText: string;\n\tfilePath: string;\n\treSendImage?: () => void;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction HasFileContent(props: HasFileContentProps) {\n\tconst {\n\t\tdisabled,\n\t\tfilePath,\n\t\tisLoading,\n\t\tacceptImage,\n\t\tchangeImageButtonText,\n\t\thandleSelectFile,\n\t\treSendImage,\n\t} = props;\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptImage;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"arkynImageUploadHasFileContent\"\n\t\t\tstyle={{ backgroundImage: `url(\"${filePath}\")` }}\n\t\t>\n\t\t\t{reSendImage && (\n\t\t\t\t<Tooltip orientation=\"bottom\" text=\"Reenviar imagem\">\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-label=\"resend image\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tonClick={reSendImage}\n\t\t\t\t\t\ticon={RefreshCw}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{changeImageButtonText}\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nexport { HasFileContent };\n","import type { DragEvent } from \"react\";\n\nimport { Button } from \"../../button\";\nimport \"./styles.css\";\n\ntype NoFileContentProps = {\n\tdisabled: boolean;\n\tacceptImage: string;\n\tisLoading: boolean;\n\tselectImageButtonText: string;\n\tdropImageText: string;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction NoFileContent(props: NoFileContentProps) {\n\tconst {\n\t\tdropImageText,\n\t\tisLoading,\n\t\tacceptImage,\n\t\thandleSelectFile,\n\t\tselectImageButtonText,\n\t\tdisabled,\n\t} = props;\n\n\tfunction handleDrop(event: DragEvent<HTMLDivElement>) {\n\t\tif (disabled) return;\n\n\t\tevent.preventDefault();\n\t\tconst file = event.dataTransfer.files[0];\n\t\tif (file) handleSelectFile(file);\n\t}\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptImage;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div onDrop={handleDrop} className=\"arkynImageUploadNoFileContent\">\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{selectImageButtonText}\n\t\t\t</Button>\n\n\t\t\t<p>{dropImageText}</p>\n\t\t</div>\n\t);\n}\n\nexport { NoFileContent };\n","import { useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\n\nimport { HasFileContent } from \"./hasFileContent\";\nimport { NoFileContent } from \"./noFileContent\";\nimport \"./styles.css\";\n\ntype ImageUploadProps = {\n\t/** Field name for form submission (stores the uploaded image URL). Required. */\n\tname: string;\n\t/** Server endpoint URL that receives the `multipart/form-data` upload request. Required. */\n\taction: string;\n\t/** Pre-populated image URL displayed as a preview (e.g. an existing avatar). @default \"\" */\n\tdefaultValue?: string | null;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables file selection and upload. @default false */\n\tdisabled?: boolean;\n\t/** Optional label text displayed above the upload area. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n\t/** Label for the file-picker button after an image is selected. @default \"Alterar imagem\" */\n\tchangeImageButtonText?: string;\n\t/** Label for the file-picker button before an image is selected. @default \"Selecionar imagem\" */\n\tselectImageButtonText?: string;\n\t/** Text displayed in the drag-and-drop zone. @default \"Ou arraste e solte a imagem aqui\" */\n\tdropImageText?: string;\n\t/** HTTP method for the upload request. @default \"POST\" */\n\tmethod?: string;\n\t/** Form-data field name used for the file. @default \"file\" */\n\tfileName?: string;\n\t/** Property name in the server response that contains the image URL. @default \"url\" */\n\tfileResponseName?: string;\n\t/** Accepted image MIME types or extensions (e.g. `\"image/jpeg,image/png\"`). @default \"image/*\" */\n\tacceptImage?: string;\n\t/** Callback fired after a successful upload. Receives the image URL returned by the server. */\n\tonChange?: (url: string) => void;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * ImageUpload, drag-and-drop image uploader with server upload and image preview.\n *\n * Sends the file via `fetch` as `multipart/form-data` and stores the returned URL\n * in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.action - Upload endpoint URL. Required.\n * @param props.defaultValue - Pre-populated image URL displayed as preview.\n * @param props.disabled - Disables file selection and upload. Default: false\n * @param props.label - Label text displayed above the upload area.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.acceptImage - Accepted MIME types or extensions. Default: \"image/*\"\n * @param props.method - HTTP method. Default: \"POST\"\n * @param props.fileName - Form-data field name for the file. Default: \"file\"\n * @param props.fileResponseName - Server response property containing the URL. Default: \"url\"\n * @param props.onChange - Callback fired after a successful upload, receives the image URL.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns ImageUpload JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <ImageUpload name=\"avatar\" action=\"/api/upload/image\" />\n *\n * // Profile picture with existing image and label\n * <ImageUpload\n * name=\"profilePicture\"\n * action=\"/api/upload/avatar\"\n * label=\"Profile Picture\"\n * showAsterisk\n * defaultValue={user.avatarUrl}\n * selectImageButtonText=\"Choose photo\"\n * onChange={(url) => updateProfile({ avatarUrl: url })}\n * />\n *\n * // Restricted to JPEG/PNG\n * <ImageUpload\n * name=\"productImage\"\n * action=\"/api/upload/product\"\n * label=\"Product Image\"\n * acceptImage=\"image/jpeg,image/png\"\n * fileResponseName=\"imageUrl\"\n * />\n * ```\n */\n\nfunction ImageUpload(props: ImageUploadProps) {\n\tconst {\n\t\tname,\n\t\tdefaultValue = \"\",\n\t\tlabel,\n\t\tshowAsterisk = false,\n\t\taction,\n\t\tfileName = \"file\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tmethod = \"POST\",\n\t\tacceptImage = \"image/*\",\n\t\tfileResponseName = \"url\",\n\t\tchangeImageButtonText = \"Alterar imagem\",\n\t\tselectImageButtonText = \"Selecionar imagem\",\n\t\tdropImageText = \"Ou arraste e solte a imagem aqui\",\n\t\tonChange,\n\t\tdisabled = false,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst fieldError = fieldErrors?.[name];\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst [error, setError] = useState(\"\");\n\tconst [file, setFile] = useState<File | null>(null);\n\tconst [filePath, setFilePath] = useState(defaultValue);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tasync function handleUploadImage(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetIsLoading(true);\n\t\tsetFile(file);\n\t\tsetError(\"\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(fileName, file);\n\n\t\tawait fetch(action, { method: method, body: formData })\n\t\t\t.then(async (response) => await response.json())\n\t\t\t.then((response) => {\n\t\t\t\tif (response?.error) setError(response.error);\n\t\t\t\telse setValue(response?.[fileResponseName]);\n\t\t\t\tonChange?.(response?.[fileResponseName]);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tsetError(\"Erro ao enviar imagem\");\n\t\t\t})\n\t\t\t.finally(() => setIsLoading(false));\n\t}\n\n\tfunction handleSelectFile(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetFilePath(URL.createObjectURL(file));\n\t\thandleUploadImage(file);\n\t}\n\n\tconst errorMessage = fieldError || error;\n\n\tconst hasErrorClassName = errorMessage ? \"hasError\" : \"noHasError\";\n\tconst hasImageClassName = filePath ? \"hasImage\" : \"noHasImage\";\n\tconst className = `arkynImageUpload ${hasErrorClassName} ${hasImageClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<div className={className}>\n\t\t\t\t<input type=\"hidden\" name={name} value={value || \"\"} />\n\n\t\t\t\t{!filePath && (\n\t\t\t\t\t<NoFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptImage={acceptImage}\n\t\t\t\t\t\tdropImageText={dropImageText}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tselectImageButtonText={selectImageButtonText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{filePath && (\n\t\t\t\t\t<HasFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptImage={acceptImage}\n\t\t\t\t\t\tfilePath={filePath}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tchangeImageButtonText={changeImageButtonText}\n\t\t\t\t\t\treSendImage={\n\t\t\t\t\t\t\terrorMessage && file ? () => handleUploadImage(file) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { ImageUpload };\n","import mapBoxGl, { type Map as MapboxMap } from \"mapbox-gl\";\nimport { createRoot } from \"react-dom/client\";\nimport \"./mapbox.css\";\nimport {\n\ttype HtmlHTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n} from \"react\";\n\ntype Coordinate = {\n\tlat: number;\n\tlng: number;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\tpopUp?: ReactNode;\n};\n\ntype ClientMapViewProps = {\n\tcenter?: Coordinate;\n\tcoordinates: Coordinate[];\n\tonMarkerClick?: (coordinate: Coordinate) => void;\n\taccessToken: string;\n} & HtmlHTMLAttributes<HTMLDivElement>;\n\nfunction ClientMapView({\n\tcenter: rawCenter,\n\tcoordinates,\n\tonMarkerClick,\n\taccessToken,\n\t...rest\n}: ClientMapViewProps) {\n\tconst mapRef = useRef<MapboxMap | null>(null);\n\tconst mapContainerRef = useRef<HTMLDivElement>(null);\n\n\tconst center = rawCenter ? rawCenter : coordinates[0];\n\n\tuseEffect(() => {\n\t\tmapBoxGl.accessToken = accessToken;\n\n\t\tmapRef.current = new mapBoxGl.Map({\n\t\t\tcontainer: mapContainerRef.current as HTMLDivElement,\n\t\t\tstyle: \"mapbox://styles/mapbox/light-v11\",\n\t\t\tcenter: [center.lng, center.lat],\n\t\t\tzoom: 13,\n\t\t\tlanguage: \"pt-BR\",\n\t\t});\n\n\t\tcoordinates.forEach((props) => {\n\t\t\tconst { lat, lng, popUp } = props;\n\t\t\tconst el = document.createElement(\"img\");\n\n\t\t\tel.className = \"arkynMarker\";\n\t\t\tel.src = \"https://i.postimg.cc/mgKggjk7/Pin.png\";\n\n\t\t\tconst marker = new mapBoxGl.Marker(el)\n\t\t\t\t.setLngLat([lng, lat])\n\t\t\t\t.addTo(mapRef.current as MapboxMap);\n\n\t\t\tif (popUp) {\n\t\t\t\tconst popupNode = document.createElement(\"div\");\n\t\t\t\tconst root = createRoot(popupNode);\n\t\t\t\troot.render(popUp);\n\n\t\t\t\tconst popup = new mapBoxGl.Popup({\n\t\t\t\t\toffset: 25,\n\t\t\t\t\tcloseButton: false,\n\t\t\t\t\tclassName: \"arkynMapViewPopup\",\n\t\t\t\t}).setDOMContent(popupNode);\n\n\t\t\t\tmarker.setPopup(popup);\n\t\t\t}\n\n\t\t\tel.addEventListener(\"click\", () => {\n\t\t\t\tif (onMarkerClick) onMarkerClick(props);\n\t\t\t\tmapRef.current?.flyTo({ center: [lng, lat], zoom: 15, duration: 1200 });\n\t\t\t\tmarker.togglePopup();\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\tmapRef.current?.remove();\n\t\t};\n\t}, [center.lat, onMarkerClick, coordinates.forEach, center.lng, accessToken]);\n\n\treturn (\n\t\t<div\n\t\t\tid=\"map-container\"\n\t\t\tref={mapContainerRef}\n\t\t\tstyle={{ height: \"100%\", width: \"100%\", borderRadius: \"8px\" }}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nexport { ClientMapView };\n","import { MapPinned } from \"lucide-react\";\nimport type { HtmlHTMLAttributes, ReactNode } from \"react\";\n\nimport { ClientMapView } from \"./mapView.client\";\nimport \"./styles.css\";\nimport { ClientOnly } from \"../clientOnly\";\n\n/** Data for a single map marker. */\ntype Coordinate = {\n\t/** Latitude of the marker position. */\n\tlat: number;\n\t/** Longitude of the marker position. */\n\tlng: number;\n\t/** Arbitrary data attached to the marker, available in `onMarkerClick`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\t/** Custom React node rendered inside the marker popup on click. */\n\tpopUp?: ReactNode;\n};\n\ntype MapViewProps = {\n\t/** Mapbox GL public access token from your Mapbox account. Required. */\n\taccessToken: string;\n\t/** Initial zoom level. @default 18 */\n\tzoom?: number;\n\t/** Single coordinate or array of coordinates to display as markers. */\n\tcoordinates?: Coordinate | Coordinate[];\n\t/** Callback fired when the user clicks a marker. Receives the coordinate's data. */\n\tonMarkerClick?: (coordinate: Coordinate) => void;\n} & HtmlHTMLAttributes<HTMLDivElement>;\n\ntype EmptyMapProps = {\n\tclassName?: string;\n};\n\nfunction EmptyMap({ className }: EmptyMapProps) {\n\treturn (\n\t\t<div className={`arkynMapViewPinnedEmpty ${className}`}>\n\t\t\t<MapPinned />\n\t\t</div>\n\t);\n}\n\n/**\n * MapView, interactive Mapbox map with optional click-able markers.\n *\n * Renders client-side only (via `ClientOnly`). Displays a placeholder icon\n * when `coordinates` is absent or empty, or before the component hydrates.\n *\n * @param props.accessToken - Mapbox GL public access token. Required.\n * @param props.zoom - Initial zoom level. Default: 18\n * @param props.coordinates - Marker(s) to display on the map.\n * @param props.onMarkerClick - Callback fired when a marker is clicked.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns MapView JSX element, or a placeholder icon when no coordinates are provided.\n *\n * @example\n * ```tsx\n * // Single marker\n * <MapView\n * accessToken=\"pk.your-mapbox-token\"\n * coordinates={{ lat: -23.5505, lng: -46.6333 }}\n * />\n *\n * // Multiple markers with popup and click handler\n * <MapView\n * accessToken=\"pk.your-mapbox-token\"\n * zoom={12}\n * coordinates={[\n * { lat: -23.55, lng: -46.63, data: { id: 1 }, popUp: <p>Store A</p> },\n * { lat: -23.56, lng: -46.64, data: { id: 2 }, popUp: <p>Store B</p> },\n * ]}\n * onMarkerClick={(coord) => selectStore(coord.data.id)}\n * />\n * ```\n */\nfunction MapView(props: MapViewProps) {\n\tconst {\n\t\tcoordinates,\n\t\tzoom = 18,\n\t\taccessToken,\n\t\tclassName,\n\t\tonMarkerClick,\n\t\t...rest\n\t} = props;\n\n\tif (!coordinates) return <EmptyMap className={className} />;\n\n\tconst coordArray = Array.isArray(coordinates) ? coordinates : [coordinates];\n\tif (coordArray.length === 0) return <EmptyMap className={className} />;\n\n\treturn (\n\t\t<ClientOnly fallback={<EmptyMap className={className} />}>\n\t\t\t{() => (\n\t\t\t\t<ClientMapView\n\t\t\t\t\taccessToken={accessToken}\n\t\t\t\t\tcoordinates={coordArray}\n\t\t\t\t\tcenter={coordArray[0]}\n\t\t\t\t\tonMarkerClick={onMarkerClick}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ClientOnly>\n\t);\n}\n\nexport { MapView };\n","import { InputMask, type Replacement } from \"@react-input/mask\";\nimport { Loader2, type LucideIcon } from \"lucide-react\";\nimport {\n\ttype FocusEvent,\n\tforwardRef,\n\ttype InputHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\n\nimport \"./style.css\";\n\ntype MaskedInputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t\"size\" | \"prefix\" | \"name\" | \"type\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/**\n\t * Mask pattern string. Use the replacement character as an editable placeholder.\n\t * Example: `\"(__) _____-____\"` for a Brazilian mobile phone number.\n\t * Required.\n\t */\n\tmask: string;\n\t/**\n\t * Character or replacement map that marks editable positions in the mask.\n\t * - String: `\"_\"`, every `_` in the mask becomes editable.\n\t * - Object: `{ _: /\\d/ }`, only accepts digits in those positions.\n\t * Required.\n\t */\n\treplacement: string | Replacement;\n\t/**\n\t * When true, strips mask characters from the underlying value,\n\t * keeping only the user-typed characters.\n\t */\n\tseparate?: boolean;\n\t/** When true, shows the full mask pattern in the input before the user types. */\n\tshowMask?: boolean;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Validation error message displayed below the input. */\n\terrorMessage?: string;\n\t/** Shows a spinner and disables the input during async operations. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the input area. */\n\tprefix?: string | LucideIcon;\n\t/** Text or icon rendered at the far right, outside the input area. */\n\tsuffix?: string | LucideIcon;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Lucide icon rendered inside the input on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered inside the input on the right. */\n\trightIcon?: LucideIcon;\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\nconst BaseInput = forwardRef<\n\tHTMLInputElement,\n\tInputHTMLAttributes<HTMLInputElement>\n>((props, ref) => {\n\treturn <input ref={ref} {...props} />;\n});\n\n/**\n * MaskedInput, text input with a configurable mask for structured values (phones, CPF, credit cards, etc.).\n *\n * Built on `@react-input/mask`. Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.mask - Mask pattern string. Required.\n * @param props.replacement - Character or map that marks editable positions. Required.\n * @param props.separate - Strips mask chars from the value, keeping only typed characters.\n * @param props.showMask - Shows the full mask pattern before the user types.\n * @param props.label - Label text displayed above the input.\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a spinner and disables the input. Default: false\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.prefix - Text or icon at the far left.\n * @param props.suffix - Text or icon at the far right.\n * @param props.leftIcon - Lucide icon inside the input on the left.\n * @param props.rightIcon - Lucide icon inside the input on the right.\n * @param props.showAsterisk - Appends `*` to the label.\n *\n * **...Other valid HTML properties for `<input>` (except `type`)**\n *\n * @returns MaskedInput JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Brazilian mobile phone\n * <MaskedInput\n * name=\"phone\"\n * mask=\"(__) _____-____\"\n * replacement={{ _: /\\d/ }}\n * label=\"Phone\"\n * />\n *\n * // CPF with mask visible and validation\n * <MaskedInput\n * name=\"cpf\"\n * label=\"CPF\"\n * mask=\"___.___.___-__\"\n * replacement=\"_\"\n * showMask\n * showAsterisk\n * errorMessage=\"Invalid CPF\"\n * />\n *\n * // Credit card\n * <MaskedInput\n * name=\"card\"\n * label=\"Credit Card\"\n * mask=\"____ ____ ____ ____\"\n * replacement={{ _: /\\d/ }}\n * leftIcon={CreditCard}\n * />\n * ```\n */\n\nfunction MaskedInput(props: MaskedInputProps) {\n\tconst {\n\t\tname,\n\t\tdisabled,\n\t\ttitle,\n\t\tstyle,\n\t\tvariant = \"solid\",\n\t\tseparate,\n\t\tmask,\n\t\tshowMask,\n\t\treplacement,\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tprefix,\n\t\tsuffix,\n\t\tisLoading = false,\n\t\tleftIcon,\n\t\treadOnly,\n\t\tonFocus,\n\t\tonBlur,\n\t\terrorMessage: baseErrorMessage,\n\t\tdefaultValue,\n\t\tshowAsterisk,\n\t\trightIcon,\n\t\tsize = \"md\",\n\t\tid,\n\t\tvalue,\n\t\tplaceholder,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingPosition = rightIcon ? \"right\" : \"left\";\n\n\tconst showLeftSpinner = loadingPosition === \"left\" && isLoading;\n\tconst showRightSpinner = loadingPosition === \"right\" && isLoading;\n\n\tfunction handleSectionClick() {\n\t\tif (isDisabled || !inputRef?.current) return;\n\t\tsetIsFocused(true);\n\t\tinputRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\tconst hasPrefix = prefix ? \"hasPrefix\" : \"\";\n\tconst hasSuffix = suffix ? \"hasSuffix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = isDisabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynMaskedInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel showAsterisk={showAsterisk} htmlFor={inputId}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showLeftSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />\n\n\t\t\t\t<InputMask\n\t\t\t\t\tcomponent={BaseInput}\n\t\t\t\t\tmask={mask}\n\t\t\t\t\treplacement={replacement}\n\t\t\t\t\tseparate={separate}\n\t\t\t\t\tshowMask={showMask}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tname={name}\n\t\t\t\t\tdefaultValue={defaultValue || undefined}\n\t\t\t\t\tplaceholder={isDisabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={isDisabled ? undefined : value}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showRightSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={suffix} className=\"suffix\" />\n\t\t\t</section>\n\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { MaskedInput };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype ModalContextProps = {\n\tmakeInvisible: () => void;\n};\n\ntype ModalProviderProps = {\n\tchildren: ReactNode;\n\tmakeInvisible: () => void;\n};\n\nconst modalContext = createContext({} as ModalContextProps);\n\nfunction ModalProvider(props: ModalProviderProps) {\n\tconst value = useMemo(\n\t\t() => ({ makeInvisible: props.makeInvisible }),\n\t\t[props.makeInvisible],\n\t);\n\n\treturn (\n\t\t<modalContext.Provider value={value}>\n\t\t\t{props.children}\n\t\t</modalContext.Provider>\n\t);\n}\n\nfunction useModal() {\n\treturn useContext(modalContext);\n}\n\nexport { ModalProvider, useModal };\n","import {\n\ttype AnimationEvent,\n\ttype HTMLAttributes,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { ModalProvider } from \"../modalContext\";\nimport \"./styles.css\";\n\ntype ModalContainerProps = HTMLAttributes<HTMLElement> & {\n\t/** Controls whether the modal is visible. */\n\tisVisible: boolean;\n\t/** Callback invoked when the backdrop overlay is clicked. */\n\tmakeInvisible: () => void;\n};\n\n/**\n * ModalContainer, animated centered modal rendered over a backdrop overlay.\n *\n * Locks body scroll while open. Closes when the overlay is clicked.\n * Provides context consumed by `ModalHeader` (close button).\n *\n * @param props.isVisible - Whether the modal is open. Required.\n * @param props.makeInvisible - Called when the overlay is clicked. Required.\n *\n * **...Other valid HTML `<aside>` properties**\n *\n * @returns ModalContainer JSX element.\n *\n * @example\n * ```tsx\n * const [isOpen, setIsOpen] = useState(false);\n *\n * <ModalContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>\n * <ModalHeader><h2>Confirm deletion</h2></ModalHeader>\n * <main><p>This action cannot be undone.</p></main>\n * <ModalFooter>\n * <Button onClick={() => setIsOpen(false)}>Cancel</Button>\n * <Button scheme=\"danger\" onClick={handleDelete}>Delete</Button>\n * </ModalFooter>\n * </ModalContainer>\n * ```\n */\n\nfunction ModalContainer(args: ModalContainerProps) {\n\tconst {\n\t\tisVisible,\n\t\tmakeInvisible,\n\t\tchildren,\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = args;\n\n\tconst [mounted, setMounted] = useState(isVisible);\n\tconst [isExiting, setIsExiting] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (isVisible) {\n\t\t\tsetMounted(true);\n\t\t\tsetIsExiting(false);\n\t\t} else if (mounted) {\n\t\t\tsetIsExiting(true);\n\t\t}\n\t}, [isVisible, mounted]);\n\n\tuseScrollLock(isVisible);\n\n\tfunction handleOverlayAnimationEnd(e: AnimationEvent<HTMLDivElement>) {\n\t\tif (e.target === e.currentTarget && isExiting) {\n\t\t\tsetIsExiting(false);\n\t\t\tsetMounted(false);\n\t\t\tmakeInvisible();\n\t\t}\n\t}\n\n\tif (!mounted) return null;\n\n\tconst className = [\n\t\t\"arkynModalContainer\",\n\t\tisExiting ? \"exiting\" : \"\",\n\t\tbaseClassName,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\n\treturn (\n\t\t<ModalProvider makeInvisible={() => setIsExiting(true)}>\n\t\t\t<aside className={className.trim()} {...rest}>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"arkynModalContainerOverlay\"\n\t\t\t\t\tonClick={() => setIsExiting(true)}\n\t\t\t\t\tonAnimationEnd={handleOverlayAnimationEnd}\n\t\t\t\t/>\n\t\t\t\t<div className=\"arkynModalContainerContent\">{children}</div>\n\t\t\t</aside>\n\t\t</ModalProvider>\n\t);\n}\n\nexport { ModalContainer };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype ModalFooterProps = HTMLAttributes<HTMLElement> & {\n\t/**\n\t * Horizontal alignment of footer content.\n\t * - `left` / `center` / `right`: flex-start, center, flex-end.\n\t * - `between`: space-between.\n\t * - `around`: space-around.\n\t * @default \"right\"\n\t */\n\talignment?: \"left\" | \"center\" | \"right\" | \"between\" | \"around\";\n};\n\n/**\n * ModalFooter, action bar at the bottom of a modal dialog.\n *\n * @param props.alignment - Horizontal alignment of children. Default: `\"right\"`\n *\n * **...Other valid HTML `<footer>` properties**\n *\n * @returns ModalFooter JSX element.\n *\n * @example\n * ```tsx\n * // Confirm / cancel pattern (right-aligned by default)\n * <ModalFooter>\n * <Button variant=\"ghost\" onClick={onClose}>Cancel</Button>\n * <Button scheme=\"danger\" onClick={onConfirm}>Delete</Button>\n * </ModalFooter>\n *\n * // Space-between layout (e.g. back / next in a wizard)\n * <ModalFooter alignment=\"between\">\n * <Button variant=\"outline\" onClick={onBack}>Back</Button>\n * <Button onClick={onNext}>Next</Button>\n * </ModalFooter>\n * ```\n */\n\nfunction ModalFooter(args: ModalFooterProps) {\n\tconst { alignment = \"right\", className: baseClassName, ...rest } = args;\n\tconst className = `arkynModalFooter ${alignment} ${baseClassName}`;\n\n\treturn <footer className={className.trim()} {...rest} />;\n}\n\nexport { ModalFooter };\n","import { X } from \"lucide-react\";\nimport type { HTMLAttributes } from \"react\";\n\nimport { useModal } from \"../modalContext\";\nimport \"./styles.css\";\n\ntype ModalHeaderProps = HTMLAttributes<HTMLElement> & {\n\t/** Whether to render the X close button. @default true */\n\tshowCloseButton?: boolean;\n};\n\n/**\n * ModalHeader, header section for a `ModalContainer`, with an optional close button.\n *\n * The close button calls `makeInvisible` from the nearest `ModalContainer` context.\n * Must be rendered inside a `ModalContainer`.\n *\n * @param props.showCloseButton - Renders the X close button. Default: true\n *\n * **...Other valid HTML `<header>` properties**\n *\n * @returns ModalHeader JSX element.\n *\n * @example\n * ```tsx\n * <ModalContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>\n * <ModalHeader>\n * <h2>Edit profile</h2>\n * </ModalHeader>\n * <main>...</main>\n * <ModalFooter><Button onClick={onSave}>Save</Button></ModalFooter>\n * </ModalContainer>\n * ```\n */\n\nfunction ModalHeader(args: ModalHeaderProps) {\n\tconst {\n\t\tshowCloseButton = true,\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = args;\n\n\tconst { makeInvisible } = useModal();\n\tconst className = `arkynModalHeader ${baseClassName}`;\n\n\treturn (\n\t\t<header className={className.trim()} {...rest}>\n\t\t\t{children}\n\n\t\t\t{showCloseButton && (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={makeInvisible}\n\t\t\t\t\taria-label=\"Close modal button\"\n\t\t\t\t\tclassName=\"arkynModalHeaderCloseButton\"\n\t\t\t\t>\n\t\t\t\t\t<X size={24} />\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</header>\n\t);\n}\n\nexport { ModalHeader };\n","import { ChevronDown } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectChevronProps = {\n\tisLoading: boolean;\n\ticonSize: number;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisFocused: boolean;\n};\n\nfunction MultiSelectChevron(props: MultiSelectChevronProps) {\n\tconst { iconSize, isLoading, disabled, readOnly, isFocused } = props;\n\n\tconst notAnimate = disabled || readOnly ? \"notAnimate\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynMultiSelectChevron ${notAnimate} ${focused}`;\n\n\tif (isLoading) return null;\n\treturn (\n\t\t<ChevronDown\n\t\t\tclassName={className}\n\t\t\tstrokeWidth={2.5}\n\t\t\tstyle={{\n\t\t\t\tminWidth: iconSize,\n\t\t\t\tminHeight: iconSize,\n\t\t\t\tmaxWidth: iconSize,\n\t\t\t\tmaxHeight: iconSize,\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport { MultiSelectChevron };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype MultiSelectContainerProps = {\n\tchildren: ReactNode;\n\thandleContainerFocus: () => void;\n\tprefixExists: boolean;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tid: string;\n\tvariant: \"solid\" | \"outline\" | \"underline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction MultiSelectContainer(props: MultiSelectContainerProps) {\n\tconst {\n\t\tchildren,\n\t\thandleContainerFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName,\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t\tid,\n\t\tprefixExists,\n\t} = props;\n\n\tconst hasPrefix = prefixExists ? \"hasPrefix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\treturn (\n\t\t<section\n\t\t\tid={id}\n\t\t\tclassName={`arkynMultiSelectContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`}\n\t\t\tonClick={handleContainerFocus}\n\t\t>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { MultiSelectContainer };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype MultiSelectContentProps = {\n\tchildren: ReactNode;\n\tsize: \"md\" | \"lg\";\n};\n\nfunction MultiSelectContent(props: MultiSelectContentProps) {\n\tconst { children, size } = props;\n\tconst className = `arkynMultiSelectContent ${size}`;\n\treturn <div className={className}>{children}</div>;\n}\n\nexport { MultiSelectContent };\n","import { X } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectMarkProps = {\n\tlabel: string;\n\tdisabled: boolean;\n\tvalue: string;\n\thandleChangeValue: (value: string) => void;\n};\n\nfunction MultiSelectMark(props: MultiSelectMarkProps) {\n\tconst { label, value, disabled, handleChangeValue } = props;\n\n\treturn (\n\t\t<div className=\"arkynMultiSelectMark\">\n\t\t\t{label}\n\n\t\t\t<button\n\t\t\t\tdisabled={disabled}\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={(e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleChangeValue(value);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<X />\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n\nexport { MultiSelectMark };\n","import { Check } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectOptionProps = {\n\tvalue: string;\n\tlabel: string;\n\tsize: \"md\" | \"lg\";\n\toptionHasSelected: (value: string) => boolean;\n\thandleChangeValue: (value: string) => void;\n};\n\nfunction MultiSelectOption(props: MultiSelectOptionProps) {\n\tconst { label, optionHasSelected, handleChangeValue, value, size } = props;\n\n\tconst hasActive = optionHasSelected(value) ? \"active\" : \"\";\n\tconst className = `arkynMultiSelectOption ${size} ${hasActive}`;\n\n\treturn (\n\t\t<div onClick={() => handleChangeValue(value)} className={className}>\n\t\t\t{label} <Check />\n\t\t</div>\n\t);\n}\n\nexport { MultiSelectOption };\n","import { Search } from \"lucide-react\";\nimport {\n\ttype ChangeEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { Input } from \"../../input\";\n\nimport \"./styles.css\";\n\ntype MultiSelectOptionsContainerProps = {\n\tisFocused: boolean;\n\tisSearchable: boolean;\n\tchildren: ReactNode;\n\tsearch: string;\n\tonSearch: (value: string) => void;\n};\n\nfunction MultiSelectOptionsContainer(props: MultiSelectOptionsContainerProps) {\n\tconst { children, isFocused, isSearchable, search, onSearch } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tuseScrollLock(isFocused);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 300;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isFocused]);\n\n\tfunction handleSearch(e: ChangeEvent<HTMLInputElement>) {\n\t\tif (!isSearchable) return;\n\t\tonSearch(e.target.value);\n\t}\n\n\tif (!isFocused) return null;\n\n\treturn (\n\t\t<div\n\t\t\tref={containerRef}\n\t\t\tclassName={`arkynMultiSelectOptionsContainer ${position}`}\n\t\t>\n\t\t\t{isSearchable && (\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tname=\"search-select\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tleftIcon={Search}\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonChange={handleSearch}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { MultiSelectOptionsContainer };\n","import \"./styles.css\";\n\ntype MultiSelectOverlayProps = {\n\tisFocused: boolean;\n\thandleBlur: () => void;\n};\n\nfunction MultiSelectOverlay(props: MultiSelectOverlayProps) {\n\tconst { isFocused, handleBlur } = props;\n\tif (!isFocused) return null;\n\treturn <aside className=\"arkynMultiSelectOverlay\" onClick={handleBlur} />;\n}\n\nexport { MultiSelectOverlay };\n","import { Loader2 } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectSpinnerProps = {\n\ticonSize: number;\n\tisLoading: boolean;\n};\n\nfunction MultiSelectSpinner(props: MultiSelectSpinnerProps) {\n\tconst { iconSize, isLoading } = props;\n\n\tif (!isLoading) return null;\n\treturn (\n\t\t<Loader2\n\t\t\tclassName=\"arkynMultiSelectSpinner\"\n\t\t\tsize={iconSize}\n\t\t\tstrokeWidth={2.5}\n\t\t/>\n\t);\n}\n\nexport { MultiSelectSpinner };\n","import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { MultiSelectChevron } from \"./multiSelectChevron\";\nimport { MultiSelectContainer } from \"./multiSelectContainer\";\nimport { MultiSelectContent } from \"./multiSelectContent\";\nimport { MultiSelectMark } from \"./multiSelectMark\";\nimport { MultiSelectOption } from \"./multiSelectOption\";\nimport { MultiSelectOptionsContainer } from \"./multiSelectOptionsContainer\";\nimport { MultiSelectOverlay } from \"./multiSelectOverlay\";\nimport { MultiSelectSpinner } from \"./multiSelectSpinner\";\n\ntype MultiSelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled array of selected values. */\n\tvalue?: string[];\n\t/** Uncontrolled default array of selected values. @default [] */\n\tdefaultValue?: string[];\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the multiselect. */\n\tlabel?: string;\n\t/** Validation error message displayed below the multiselect. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no options are selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current selection visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected or deselected. @default false */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected values array changes. */\n\tonChange?: (value: string[]) => void;\n\t/** Callback fired when the multiselect gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the multiselect loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * MultiSelect size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * MultiSelect, multi-option dropdown with optional search, label, validation, and form integration.\n *\n * Selected values are stored as a JSON array in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled array of selected values.\n * @param props.defaultValue - Uncontrolled default selection. Default: []\n * @param props.label - Label text displayed above the multiselect.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after toggling an option. Default: false\n * @param props.onChange - Callback fired when the selection changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - MultiSelect size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns MultiSelect JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <MultiSelect\n * name=\"categories\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <MultiSelect\n * name=\"skills\"\n * label=\"Skills\"\n * showAsterisk\n * isSearchable\n * options={skillOptions}\n * errorMessage={errors.skills}\n * />\n *\n * // Controlled with async search\n * <MultiSelect\n * name=\"tags\"\n * label=\"Tags\"\n * value={selectedTags}\n * onChange={setSelectedTags}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction MultiSelect(props: MultiSelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = false,\n\t\tdefaultValue = [],\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst multiSelectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst multiSelectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOptions, setSelectedOptions] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOptions;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions.includes(value);\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !multiSelectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tmultiSelectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && multiSelectRef.current) multiSelectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOptions(selectedOptions.filter((v) => v !== value));\n\t\t\tif (onChange) onChange(selectedOptions.filter((v) => v !== value));\n\t\t} else {\n\t\t\tsetSelectedOptions([...selectedOptions, value]);\n\t\t\tif (onChange) onChange([...selectedOptions, value]);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<MultiSelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={multiSelectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={multiSelectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={JSON.stringify(forceSelectedOptions)}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<MultiSelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions.map((value) => (\n\t\t\t\t\t\t<MultiSelectMark\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={getOptionLabel(value)}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{forceSelectedOptions.length <= 0 && <p>{placeholder}</p>}\n\t\t\t\t</MultiSelectContent>\n\n\t\t\t\t<MultiSelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<MultiSelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</MultiSelectOptionsContainer>\n\n\t\t\t\t<MultiSelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<MultiSelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<MultiSelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</MultiSelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { MultiSelect };\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype ChevronButtonProps = {\n\torientation: \"left\" | \"right\";\n\tdisabled: boolean;\n\thandlePageChange: () => void;\n};\n\nfunction ChevronButton(props: ChevronButtonProps) {\n\tconst { orientation, handlePageChange, disabled } = props;\n\tconst icon = { left: <ChevronLeft />, right: <ChevronRight /> };\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName=\"arkynChevronPageButton\"\n\t\t\tdisabled={disabled}\n\t\t\tonClick={handlePageChange}\n\t\t>\n\t\t\t{icon[orientation]}\n\t\t</button>\n\t);\n}\n\nexport { ChevronButton };\n","import \"./styles.css\";\n\ntype CurrentButtonProps = {\n\tcurrentPage: number;\n};\n\nfunction CurrentButton({ currentPage }: CurrentButtonProps) {\n\treturn (\n\t\t<button type=\"button\" className=\"arkynPaginationCurrentButton\" disabled>\n\t\t\t{currentPage}\n\t\t</button>\n\t);\n}\n\nexport { CurrentButton };\n","import \"./styles.css\";\n\ntype PageButtonProps = {\n\tpage: number;\n\thandlePageChange: () => void;\n};\n\nfunction PageButton(props: PageButtonProps) {\n\tconst { page, handlePageChange } = props;\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName=\"arkynPaginationPageButton\"\n\t\t\tonClick={handlePageChange}\n\t\t>\n\t\t\t{page}\n\t\t</button>\n\t);\n}\n\nexport { PageButton };\n","type PaginationServiceConstructor = {\n\tcurrentPage: number;\n\ttotalCountRegisters: number;\n\tregisterPerPage?: number;\n\tsiblingsCount?: number;\n\tonChange?: (page: number) => void;\n};\n\nclass PaginationService {\n\tcurrentPage: number;\n\ttotalCountRegisters: number;\n\tregisterPerPage: number;\n\tsiblingsCount: number;\n\tlastPage: number;\n\tonChange?: (page: number) => void;\n\tpreviousPages: number[];\n\tnextPages: number[];\n\n\tprivate generatePagesArray(from: number, to: number) {\n\t\treturn [...new Array(to - from)]\n\t\t\t.map((_, index) => from + index + 1)\n\t\t\t.filter((page) => page > 0);\n\t}\n\n\tprivate generatePreviousPages(currentPage: number, siblingsCount: number) {\n\t\tif (!(currentPage > 1)) return [];\n\t\treturn this.generatePagesArray(\n\t\t\tcurrentPage - 1 - siblingsCount,\n\t\t\tcurrentPage - 1,\n\t\t);\n\t}\n\n\tprivate generateNextPages(currentPage: number, siblingsCount: number) {\n\t\tif (!(currentPage < this.lastPage)) return [];\n\t\treturn this.generatePagesArray(\n\t\t\tcurrentPage,\n\t\t\tMath.min(currentPage + siblingsCount, this.lastPage),\n\t\t);\n\t}\n\n\tconstructor(props: PaginationServiceConstructor) {\n\t\tthis.totalCountRegisters = props.totalCountRegisters;\n\t\tthis.currentPage = props.currentPage;\n\t\tthis.registerPerPage = props?.registerPerPage || 20;\n\t\tthis.siblingsCount = props?.siblingsCount || 2;\n\t\tthis.lastPage = Math.ceil(this.totalCountRegisters / this.registerPerPage);\n\t\tthis.onChange = props?.onChange;\n\t\tthis.previousPages = this.generatePreviousPages(\n\t\t\tthis.currentPage,\n\t\t\tthis.siblingsCount,\n\t\t);\n\t\tthis.nextPages = this.generateNextPages(\n\t\t\tthis.currentPage,\n\t\t\tthis.siblingsCount,\n\t\t);\n\t}\n\n\thandlePageChange = (page: number) => {\n\t\tif (page < 1) return;\n\t\tif (page > this.lastPage) return;\n\t\tif (this.onChange) {\n\t\t\tthis.currentPage = page;\n\t\t\tthis.onChange(this.currentPage);\n\t\t}\n\t};\n\n\thandlePlusChange = () => {\n\t\tif (this.currentPage >= this.lastPage) return;\n\t\tif (this.onChange) {\n\t\t\tthis.currentPage += 1;\n\t\t\tthis.onChange(this.currentPage);\n\t\t}\n\t};\n\n\thandleMinusChange = () => {\n\t\tif (this.currentPage <= 1) return;\n\t\tif (this.onChange) {\n\t\t\tthis.currentPage -= 1;\n\t\t\tthis.onChange(this.currentPage);\n\t\t}\n\t};\n}\n\nexport { PaginationService };\n","import { Ellipsis } from \"lucide-react\";\nimport \"./styles.css\";\n\nfunction Spread() {\n\treturn (\n\t\t<p className=\"arkynPaginationSpread\">\n\t\t\t<Ellipsis />\n\t\t</p>\n\t);\n}\n\nexport { Spread };\n","import type { HTMLAttributes } from \"react\";\n\nimport { ChevronButton } from \"./chevronButton\";\nimport { CurrentButton } from \"./currentButton\";\nimport { PageButton } from \"./pageButton\";\nimport { PaginationService } from \"./paginationService\";\nimport { Spread } from \"./spread\";\n\nimport \"./styles.css\";\n\n/**\n * Props for the Pagination component.\n */\ntype PaginationProps = {\n\t/**\n\t * Number of sibling pages to show on each side of the current page.\n\t * @default 1\n\t */\n\tsiblingsCount?: number;\n\t/**\n\t * Total number of records/items to paginate.\n\t */\n\ttotalCountRegisters: number;\n\t/**\n\t * The currently active page number (1-indexed).\n\t */\n\tcurrentPage: number;\n\t/**\n\t * Number of records to display per page.\n\t * @default 10\n\t */\n\tregisterPerPage?: number;\n\t/**\n\t * Callback function triggered when the page changes.\n\t * @param page - The new page number\n\t */\n\tonChange?: (page: number) => void;\n} & Omit<HTMLAttributes<HTMLDivElement>, \"onChange\">;\n\n/**\n * Pagination, navigation control for paginated data sets.\n *\n * Renders page number buttons, prev/next arrows, and spread indicators (…)\n * when the page count exceeds the visible range.\n *\n * @param props.totalCountRegisters - Total number of records. Required.\n * @param props.currentPage - The currently active page (1-indexed). Required.\n * @param props.registerPerPage - Records per page. Default: 10\n * @param props.siblingsCount - Number of sibling pages visible on each side of the current page. Default: 1\n * @param props.onChange - Callback fired when the user selects a different page.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Pagination JSX element.\n *\n * @example\n * ```tsx\n * <Pagination\n * totalCountRegisters={250}\n * currentPage={page}\n * registerPerPage={20}\n * siblingsCount={1}\n * onChange={(p) => setPage(p)}\n * />\n * ```\n */\n\nfunction Pagination(props: PaginationProps) {\n\tconst {\n\t\ttotalCountRegisters: baseTotalCountRegisters,\n\t\tsiblingsCount: baseSiblingsCount,\n\t\tcurrentPage: baseCurrentPage,\n\t\tregisterPerPage: baseRegisterPerPage,\n\t\tonChange: baseOnChange,\n\t\t...rest\n\t} = props;\n\n\tconst {\n\t\tcurrentPage,\n\t\tsiblingsCount,\n\t\tpreviousPages,\n\t\tnextPages,\n\t\tlastPage,\n\t\thandlePageChange,\n\t\thandleMinusChange,\n\t\thandlePlusChange,\n\t} = new PaginationService({\n\t\ttotalCountRegisters: baseTotalCountRegisters,\n\t\tcurrentPage: baseCurrentPage,\n\t\tregisterPerPage: baseRegisterPerPage,\n\t\tsiblingsCount: baseSiblingsCount,\n\t\tonChange: baseOnChange,\n\t});\n\n\treturn (\n\t\t<div className=\"arkynPagination\" {...rest}>\n\t\t\t<ChevronButton\n\t\t\t\torientation=\"left\"\n\t\t\t\thandlePageChange={handleMinusChange}\n\t\t\t\tdisabled={currentPage <= 1}\n\t\t\t/>\n\n\t\t\t{currentPage > 1 + siblingsCount && (\n\t\t\t\t<>\n\t\t\t\t\t<PageButton page={1} handlePageChange={() => handlePageChange(1)} />\n\t\t\t\t\t{currentPage > 2 + siblingsCount && <Spread />}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{previousPages.map((page) => (\n\t\t\t\t<PageButton\n\t\t\t\t\tkey={page}\n\t\t\t\t\tpage={page}\n\t\t\t\t\thandlePageChange={handleMinusChange}\n\t\t\t\t/>\n\t\t\t))}\n\n\t\t\t<CurrentButton currentPage={currentPage} />\n\n\t\t\t{nextPages.map((page) => (\n\t\t\t\t<PageButton\n\t\t\t\t\tkey={page}\n\t\t\t\t\tpage={page}\n\t\t\t\t\thandlePageChange={handlePlusChange}\n\t\t\t\t/>\n\t\t\t))}\n\n\t\t\t{currentPage + siblingsCount < lastPage && (\n\t\t\t\t<>\n\t\t\t\t\t{currentPage + 1 + siblingsCount < lastPage && <Spread />}\n\t\t\t\t\t<PageButton\n\t\t\t\t\t\tpage={lastPage}\n\t\t\t\t\t\thandlePageChange={() => handlePageChange(lastPage)}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<ChevronButton\n\t\t\t\torientation=\"right\"\n\t\t\t\thandlePageChange={handlePlusChange}\n\t\t\t\tdisabled={currentPage >= lastPage}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Pagination };\n","function clear(value: string) {\n\treturn value?.replace(/[^0-9]/g, \"\");\n}\n\nconst TYPES = {\n\tEIGHT: \"(99) 9999-9999\",\n\tNINE: \"(99) 99999-9999\",\n};\n\nfunction applyMask(value: string, maskPattern: string, placeholder = \"9\") {\n\tlet result = \"\";\n\tlet digitIndex = 0;\n\n\tfor (let i = 0; i < maskPattern.length; i++) {\n\t\tif (maskPattern[i] === placeholder) {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += value[digitIndex];\n\t\t\t\tdigitIndex++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += maskPattern[i];\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction getMask(value: string): \"NINE\" | \"EIGHT\" {\n\tconst mask = value.length > 10 ? \"NINE\" : \"EIGHT\";\n\treturn mask;\n}\n\nconst MAX_LENGTH = clear(TYPES.NINE).length;\n\nexport { applyMask, clear, getMask, MAX_LENGTH, TYPES };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype PhoneInputContainerProps = {\n\tchildren: ReactNode;\n\tonFocus: () => void;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tvariant: \"solid\" | \"outline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction PhoneInputContainer(props: PhoneInputContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName: baseClassName = \"\",\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t} = props;\n\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynPhoneInputContainer ${variant} ${size} ${opacity} ${errored} ${focused} ${baseClassName}`;\n\n\treturn (\n\t\t<section className={className.trim()} onClick={onFocus}>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { PhoneInputContainer };\n","import \"./styles.css\";\n\ntype PhoneInputCountriesOverlayProps = {\n\tisOpen: boolean;\n\tonClick: () => void;\n};\n\nfunction PhoneInputCountriesOverlay(props: PhoneInputCountriesOverlayProps) {\n\tconst { isOpen, onClick } = props;\n\tif (!isOpen) return null;\n\treturn (\n\t\t<aside className=\"arkynPhoneInputCountriesOverlay\" onClick={onClick} />\n\t);\n}\n\nexport { PhoneInputCountriesOverlay };\n","import { Check } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputCountryOptionProps = {\n\tcountry: CountryType;\n\tsize: \"md\" | \"lg\";\n\tisActive: boolean;\n\thandleChangeValue: (country: CountryType) => void;\n};\n\nfunction PhoneInputCountryOption(props: PhoneInputCountryOptionProps) {\n\tconst { country, isActive, handleChangeValue, size } = props;\n\n\tconst hasActive = isActive ? \"active\" : \"\";\n\tconst className = `arkynPhoneInputCountryOption ${size} ${hasActive}`;\n\n\treturn (\n\t\t<div onClick={() => handleChangeValue(country)} className={className}>\n\t\t\t<img src={country.flag} alt={country.name} className=\"flag\" />\n\t\t\t{country.name} <span>{country.code}</span>\n\t\t\t<Check className=\"check\" />\n\t\t</div>\n\t);\n}\n\nexport { PhoneInputCountryOption };\n","import {\n\ttype ChangeEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport \"./styles.css\";\n\ntype PhoneInputCountryOptionsContainerProps = {\n\tisOpen: boolean;\n\tchildren: ReactNode;\n\tsearch: string;\n\tplaceholder: string;\n\tonSearch: (value: string) => void;\n};\n\nfunction PhoneInputCountryOptionsContainer(\n\tprops: PhoneInputCountryOptionsContainerProps,\n) {\n\tconst { children, isOpen, onSearch, search, placeholder } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tfunction handleSearch(e: ChangeEvent<HTMLInputElement>) {\n\t\tonSearch(e.target.value);\n\t}\n\n\tuseScrollLock(isOpen);\n\n\tuseEffect(() => {\n\t\tif (!isOpen) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 300;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isOpen]);\n\n\tif (!isOpen) return null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`arkynPhoneInputCountryOptionsContainer ${position}`}\n\t\t\tref={containerRef}\n\t\t>\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tname=\"search-select\"\n\t\t\t\tclassName=\"arkynPhoneInputCountryOptionsContainerSearchSelect\"\n\t\t\t\tvalue={search}\n\t\t\t\tid=\"input-search\"\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleSearch}\n\t\t\t/>\n\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { PhoneInputCountryOptionsContainer };\n","import { ChevronDown } from \"lucide-react\";\n\nimport { Divider } from \"../../divider\";\nimport \"./styles.css\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputCountrySelectorProps = {\n\tsize: \"md\" | \"lg\";\n\tcurrentCountry: CountryType;\n\tonClick: () => void;\n};\n\nfunction PhoneInputCountrySelector(props: PhoneInputCountrySelectorProps) {\n\tconst { currentCountry, onClick } = props;\n\n\treturn (\n\t\t<div className=\"phoneInputSelectCountry\" onClick={onClick}>\n\t\t\t<img\n\t\t\t\tclassName=\"flag\"\n\t\t\t\tsrc={currentCountry.flag}\n\t\t\t\talt={currentCountry.name}\n\t\t\t/>\n\t\t\t<ChevronDown className=\"chevronDown\" strokeWidth={2.5} />\n\t\t\t<Divider orientation=\"vertical\" />\n\t\t</div>\n\t);\n}\n\nexport { PhoneInputCountrySelector };\n","import { InputMask } from \"@react-input/mask\";\nimport {\n\ttype ChangeEvent,\n\tforwardRef,\n\ttype InputHTMLAttributes,\n\tuseEffect,\n\tuseRef,\n} from \"react\";\n\nimport {\n\tapplyMask,\n\tclear,\n\tgetMask,\n\tMAX_LENGTH,\n\tTYPES,\n} from \"../../../utils/phoneInputUtilities\";\n\nimport \"./style.css\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputMaskProps = {\n\tonFocus: () => void;\n\tonBlur: () => void;\n\tdisabled: boolean;\n\treadonly: boolean;\n\tsize: \"md\" | \"lg\";\n\tcurrentCountry: CountryType;\n\tvalue: string;\n\tonChange: (e: string) => void;\n\tid: string;\n};\n\nconst BaseInput = forwardRef<\n\tHTMLInputElement,\n\tInputHTMLAttributes<HTMLInputElement>\n>((props, ref) => {\n\treturn <input ref={ref} {...props} />;\n});\n\nconst PhoneInputMask = forwardRef<HTMLInputElement, PhoneInputMaskProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tonFocus,\n\t\t\treadonly,\n\t\t\tonBlur,\n\t\t\tsize,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tcurrentCountry,\n\t\t\tdisabled,\n\t\t\tid,\n\t\t} = props;\n\n\t\tconst isFirstRender = useRef(true);\n\t\tconst onChangeRef = useRef(onChange);\n\t\tonChangeRef.current = onChange;\n\n\t\tconst mask =\n\t\t\ttypeof currentCountry.mask === \"string\"\n\t\t\t\t? currentCountry.mask\n\t\t\t\t: currentCountry.mask[0];\n\n\t\tuseEffect(() => {\n\t\t\tif (isFirstRender.current) {\n\t\t\t\tisFirstRender.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonChangeRef.current(mask);\n\t\t}, [mask]);\n\n\t\tconst className = `phoneInputMask ${size}`;\n\n\t\tfunction handleChange(event: ChangeEvent<HTMLInputElement>) {\n\t\t\tlet value = clear(event.target.value);\n\t\t\tconst mask = getMask(value);\n\n\t\t\tconst nextLength = value.length;\n\t\t\tif (nextLength > MAX_LENGTH) return;\n\n\t\t\tvalue = applyMask(value, TYPES[mask] as \"EIGHT\" | \"NINE\");\n\t\t\tevent.target.value = value;\n\n\t\t\tonChange(value);\n\t\t}\n\n\t\tif (currentCountry.code === \"+55\") {\n\t\t\treturn (\n\t\t\t\t<input\n\t\t\t\t\tid={id}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readonly}\n\t\t\t\t\tref={ref}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InputMask\n\t\t\t\tid={id}\n\t\t\t\tvalue={value}\n\t\t\t\treadOnly={readonly}\n\t\t\t\tonChange={(e) => onChange(e.target.value)}\n\t\t\t\tclassName={className}\n\t\t\t\tcomponent={BaseInput}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmask={mask}\n\t\t\t\tshowMask\n\t\t\t\treplacement={{ _: /\\d/ }}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport { PhoneInputMask };\n","import {\n\tfindCountryMask,\n\tformatToPhone,\n\tremoveNonNumeric,\n} from \"@arkyn/shared\";\nimport { countries } from \"@arkyn/templates\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { applyMask, getMask, TYPES } from \"../../utils/phoneInputUtilities\";\n\nimport { PhoneInputContainer } from \"./phoneInputContainer\";\nimport { PhoneInputCountriesOverlay } from \"./phoneInputCountriesOverlay\";\nimport { PhoneInputCountryOption } from \"./phoneInputCountryOption\";\nimport { PhoneInputCountryOptionsContainer } from \"./phoneInputCountryOptionsContainer\";\nimport { PhoneInputCountrySelector } from \"./phoneInputCountrySelector\";\nimport { PhoneInputMask } from \"./phoneInputMask\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputProps = {\n\t/** Optional HTML id for the visible phone text input. */\n\tid?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Validation error message (overrides the `useForm` context error for this field). */\n\terrorMessage?: string;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Shows a loading state and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Additional CSS class applied to the field wrapper. */\n\tclassName?: string;\n\t/** Uncontrolled default phone value (numeric string with or without country code). @default \"\" */\n\tdefaultValue?: string;\n\t/** Text displayed when no country matches the search query. @default \"Nenhum país encontrado\" */\n\tnotFoundCountryText?: string;\n\t/** Field name for form submission (stored as numeric string with country code). Required. */\n\tname: string;\n\t/** Placeholder for the country search input. @default \"Pesquisar país\" */\n\tsearchCountryPlaceholder?: string;\n\t/** ISO 3166-1 alpha-2 code of the initially selected country. @default \"BR\" */\n\tdefaultCountryIso?: (typeof countries)[number][\"iso\"];\n\t/** Callback fired on value change. Receives a numeric string prefixed with the country dial code. */\n\tonChange?: (e: string) => void;\n\t/** Controlled phone value (without country code). */\n\tvalue?: string;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"vertical\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\nfunction formatLocalValue(rawValue: string, country: CountryType) {\n\tconst digits = removeNonNumeric(rawValue);\n\tconst codeDigits = removeNonNumeric(country.code);\n\tconst hasCountryCode = rawValue.trim().startsWith(\"+\");\n\tconst localDigits =\n\t\thasCountryCode && digits.startsWith(codeDigits)\n\t\t\t? digits.slice(codeDigits.length)\n\t\t\t: digits;\n\n\tif (country.code === \"+55\") {\n\t\treturn applyMask(localDigits, TYPES[getMask(localDigits)]);\n\t}\n\n\tconst mask =\n\t\ttypeof country.mask === \"string\" ? country.mask : country.mask[0];\n\treturn applyMask(localDigits, mask, \"_\");\n}\n\n/**\n * PhoneInput, phone number field with an integrated country selector and automatic mask formatting.\n *\n * The visible input is masked according to the selected country's phone format.\n * The hidden `<input>` stores a numeric string prefixed with the country dial code for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the input.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.disabled - Disables all interactions. Default: false\n * @param props.readOnly - Prevents editing. Default: false\n * @param props.isLoading - Shows loading state and disables interactions. Default: false\n * @param props.defaultValue - Uncontrolled default phone value.\n * @param props.value - Controlled phone value (without country code).\n * @param props.onChange - Callback fired on change, receives numeric string with country code.\n * @param props.defaultCountryIso - ISO code of the initially selected country. Default: \"BR\"\n * @param props.searchCountryPlaceholder - Placeholder for country search. Default: \"Pesquisar país\"\n * @param props.notFoundCountryText - Text shown when no country matches. Default: \"Nenhum país encontrado\"\n * @param props.orientation - Layout direction. Default: \"vertical\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns PhoneInput JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <PhoneInput name=\"phone\" label=\"Phone\" />\n *\n * // Controlled with outline variant\n * <PhoneInput\n * name=\"contactPhone\"\n * label=\"Contact Phone\"\n * value={phone}\n * onChange={(v) => setPhone(v)}\n * variant=\"outline\"\n * size=\"lg\"\n * />\n *\n * // Pre-selected country (US)\n * <PhoneInput\n * name=\"phone\"\n * label=\"Phone\"\n * defaultCountryIso=\"US\"\n * showAsterisk\n * />\n * ```\n */\nfunction PhoneInput(props: PhoneInputProps) {\n\tconst {\n\t\tvalue: rawValue,\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tdisabled = false,\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tsize = \"md\",\n\t\tdefaultValue = \"\",\n\t\tvariant = \"solid\",\n\t\tshowAsterisk,\n\t\tname,\n\t\tonChange,\n\t\tsearchCountryPlaceholder = \"Pesquisar país\",\n\t\tnotFoundCountryText = \"Nenhum país encontrado\",\n\t\tid,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t} = props;\n\n\t// biome-ignore lint/style/noNonNullAssertion: \"BR\" is always present in the countries list\n\tconst brasilCountry = countries.find((country) => country.iso === \"BR\")!;\n\n\tconst defaultData = defaultValue ? formatToPhone(defaultValue) : \"\";\n\tconst defaultCountry: CountryType = defaultValue\n\t\t? findCountryMask(defaultValue)[1]\n\t\t: brasilCountry;\n\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [search, setSearch] = useState(\"\");\n\tconst [showCountryOptions, setShowCountryOptions] = useState(false);\n\tconst [internalValue, setValue] = useState(defaultData);\n\n\tconst [currentCountry, setCurrentCountry] = useState(defaultCountry);\n\n\tconst value =\n\t\trawValue !== undefined\n\t\t\t? formatLocalValue(rawValue, currentCountry)\n\t\t\t: internalValue;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst phoneInputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst phoneInputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst inputPhoneMaskRef = useRef<HTMLInputElement>(null);\n\n\tfunction handleContainerFocus() {\n\t\tif (isDisabled) return;\n\t\tif (isFocused || showCountryOptions) return;\n\n\t\tsetIsFocused(true);\n\t\tif (inputPhoneMaskRef.current) inputPhoneMaskRef.current.focus();\n\t}\n\n\tfunction handleOpenCountryOptions() {\n\t\tsetShowCountryOptions(true);\n\t\tsetIsFocused(true);\n\t}\n\n\tfunction handleCloseCountryOptions() {\n\t\tsetShowCountryOptions(false);\n\t\tsetIsFocused(false);\n\t}\n\n\tfunction handleInputFocus() {\n\t\tsetIsFocused(true);\n\t}\n\n\tfunction handleInputBlur() {\n\t\tsetIsFocused(false);\n\t}\n\n\tfunction filterCountryFunction(country: CountryType) {\n\t\treturn country.name.toLowerCase().includes(search.toLowerCase());\n\t}\n\n\tfunction inputValue(props?: string) {\n\t\tlet returnValue = currentCountry.code;\n\t\treturnValue += removeNonNumeric(props || value);\n\t\treturn returnValue;\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<PhoneInputContainer\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tonFocus={handleContainerFocus}\n\t\t\t>\n\t\t\t\t<PhoneInputCountrySelector\n\t\t\t\t\tcurrentCountry={currentCountry}\n\t\t\t\t\tonClick={handleOpenCountryOptions}\n\t\t\t\t\tsize={size}\n\t\t\t\t/>\n\n\t\t\t\t<PhoneInputCountryOptionsContainer\n\t\t\t\t\tisOpen={isDisabled ? false : readOnly ? false : showCountryOptions}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tplaceholder={searchCountryPlaceholder}\n\t\t\t\t\tonSearch={setSearch}\n\t\t\t\t>\n\t\t\t\t\t{countries\n\t\t\t\t\t\t.filter((country) => filterCountryFunction(country))\n\t\t\t\t\t\t.map((country) => (\n\t\t\t\t\t\t\t<PhoneInputCountryOption\n\t\t\t\t\t\t\t\tkey={country.iso}\n\t\t\t\t\t\t\t\tcountry={country}\n\t\t\t\t\t\t\t\thandleChangeValue={() => {\n\t\t\t\t\t\t\t\t\tsetCurrentCountry(country);\n\t\t\t\t\t\t\t\t\tsetShowCountryOptions(false);\n\t\t\t\t\t\t\t\t\tsetValue(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tisActive={country.iso === currentCountry.iso}\n\t\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\n\t\t\t\t\t{countries.filter((country) => filterCountryFunction(country))\n\t\t\t\t\t\t.length === 0 && <p>{notFoundCountryText}</p>}\n\t\t\t\t</PhoneInputCountryOptionsContainer>\n\n\t\t\t\t<PhoneInputCountriesOverlay\n\t\t\t\t\tisOpen={isDisabled ? false : readOnly ? false : showCountryOptions}\n\t\t\t\t\tonClick={handleCloseCountryOptions}\n\t\t\t\t/>\n\n\t\t\t\t<PhoneInputMask\n\t\t\t\t\tid={phoneInputId}\n\t\t\t\t\tref={inputPhoneMaskRef}\n\t\t\t\t\treadonly={readOnly}\n\t\t\t\t\tcurrentCountry={currentCountry}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\tsetValue(e);\n\t\t\t\t\t\tonChange?.(inputValue(e));\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<input\n\t\t\t\t\tref={phoneInputRef}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={inputValue()}\n\t\t\t\t/>\n\t\t\t</PhoneInputContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { PhoneInput };\n","import { type ReactNode, useState } from \"react\";\n\nimport { useScrollLock } from \"../../hooks/useScrollLock\";\nimport \"./styles.css\";\n\ntype OrientationProps =\n\t| \"bottomLeft\"\n\t| \"bottomRight\"\n\t| \"topLeft\"\n\t| \"topRight\"\n\t| \"top\"\n\t| \"left\"\n\t| \"bottom\"\n\t| \"right\";\n\ntype PopoverProps = {\n\t/** Content rendered inside the floating panel. Required. */\n\tchildren: ReactNode;\n\t/** Trigger element, clicking it opens the popover. Required. */\n\tbutton: ReactNode;\n\t/** When true, clicking the popover content also closes it. @default false */\n\tcloseOnClick?: boolean;\n\t/**\n\t * Position of the floating panel relative to the trigger.\n\t * Options: `\"bottomLeft\"` | `\"bottomRight\"` | `\"topLeft\"` | `\"topRight\"` | `\"top\"` | `\"bottom\"` | `\"left\"` | `\"right\"`.\n\t * @default \"bottomLeft\"\n\t */\n\torientation?: OrientationProps;\n\t/** Additional CSS class applied to the popover root element. */\n\tclassName?: string;\n};\n\n/**\n * Popover, floating panel that appears relative to a trigger element.\n *\n * Clicking outside the popover (or clicking the content when `closeOnClick` is set)\n * dismisses it. Locks body scroll while open.\n *\n * @param props.children - Content to display inside the panel. Required.\n * @param props.button - Trigger element that opens the popover. Required.\n * @param props.closeOnClick - Clicking the content also closes the popover. Default: false\n * @param props.orientation - Panel position relative to the trigger. Default: \"bottomLeft\"\n * @param props.className - Additional CSS class for the root element.\n *\n * @returns Popover JSX element with trigger, animated panel, and outside-click overlay.\n *\n * @example\n * ```tsx\n * // Basic dropdown menu\n * <Popover button={<Button>Options</Button>} closeOnClick>\n * <ul>\n * <li onClick={handleEdit}>Edit</li>\n * <li onClick={handleDelete}>Delete</li>\n * </ul>\n * </Popover>\n *\n * // User profile menu (bottom-right)\n * <Popover\n * button={<IconButton icon={User} aria-label=\"Account\" />}\n * orientation=\"bottomRight\"\n * closeOnClick\n * >\n * <nav>\n * <a href=\"/profile\">Profile</a>\n * <a href=\"/settings\">Settings</a>\n * <a href=\"/logout\">Sign out</a>\n * </nav>\n * </Popover>\n *\n * // Filter panel (top-left)\n * <Popover button={<Badge>Filters</Badge>} orientation=\"topLeft\">\n * <Input name=\"search\" placeholder=\"Search...\" />\n * <Select name=\"status\" options={statusOptions} />\n * </Popover>\n * ```\n */\n\nfunction Popover(props: PopoverProps) {\n\tconst {\n\t\tchildren,\n\t\tbutton,\n\t\tcloseOnClick,\n\t\tclassName: baseClassName = \"\",\n\t\torientation = \"bottomLeft\",\n\t} = props;\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tconst visible = isOpen ? \"visibleTrue\" : \"visibleFalse\";\n\tconst className = `arkynPopover ${orientation} ${visible} ${baseClassName}`;\n\n\tfunction handleOpenPopover() {\n\t\tif (!isOpen) setIsOpen(true);\n\t}\n\n\tuseScrollLock(isOpen);\n\n\treturn (\n\t\t<div className={className} onClick={handleOpenPopover}>\n\t\t\t{button}\n\n\t\t\t<div\n\t\t\t\tstyle={{ visibility: isOpen ? \"visible\" : \"hidden\" }}\n\t\t\t\tonClick={() => closeOnClick && setIsOpen(false)}\n\t\t\t\tclassName=\"arkynPopoverContent\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\n\t\t\t{isOpen && (\n\t\t\t\t<div onClick={() => setIsOpen(false)} className=\"arkynPopoverOverlay\" />\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport { Popover };\n","import { createContext, type ReactNode, useContext } from \"react\";\n\ntype RadioGroupContextType = {\n\tvalue: string;\n\tisError: boolean;\n\tsize: \"sm\" | \"md\" | \"lg\";\n\thandleChange: (value: string) => void;\n\tdisabled: boolean;\n};\n\ntype RadioProviderProps = {\n\tchildren: ReactNode;\n\tisError: boolean;\n\tsize: \"sm\" | \"md\" | \"lg\";\n\tvalue: string;\n\thandleChange: (value: string) => void;\n\tdisabled: boolean;\n};\n\nconst radioContext = createContext({} as RadioGroupContextType);\n\nfunction RadioProvider(props: RadioProviderProps) {\n\tconst { children, size, isError, handleChange, value, disabled } = props;\n\n\treturn (\n\t\t<radioContext.Provider\n\t\t\tvalue={{ handleChange, value, size, isError, disabled }}\n\t\t>\n\t\t\t{children}\n\t\t</radioContext.Provider>\n\t);\n}\n\nfunction useRadioGroup() {\n\treturn useContext(radioContext);\n}\n\nexport { RadioProvider, useRadioGroup };\n","import type { ButtonHTMLAttributes } from \"react\";\n\nimport { useRadioGroup } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioBoxProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/** Value submitted to the form when this option is selected. Required. */\n\tvalue: string;\n\t/** Applies error styling. Inherited from `RadioGroup` when not set. */\n\tisError?: boolean;\n\t/** Size variant. Inherits from `RadioGroup` when not set. */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n};\n\n/**\n * RadioBox, individual option inside a `RadioGroup`. Renders as a `<label>` + hidden `<button>` pair.\n *\n * Reads active value, size, error state, and disabled state from `RadioGroup` context.\n * Must be used as a direct child of `RadioGroup`.\n *\n * @param props.value - Option value. Required.\n * @param props.children - Option label content (text, icons, or rich markup).\n * @param props.disabled - Disables this option (group can also disable all options).\n * @param props.size - Size override. Inherits from group by default.\n *\n * **...Other valid HTML `<button>` properties**\n *\n * @returns RadioBox JSX element.\n *\n * @example\n * ```tsx\n * <RadioGroup name=\"plan\" label=\"Choose a plan\" onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic, $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro, $29/mo</RadioBox>\n * <RadioBox value=\"enterprise\" disabled>Enterprise, contact us</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioBox(props: RadioBoxProps) {\n\tconst {\n\t\tvalue: componentValue,\n\t\tsize: componentSize,\n\t\tdisabled,\n\t\tchildren,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tonFocus,\n\t\t...rest\n\t} = props;\n\n\tconst {\n\t\thandleChange,\n\t\tsize: groupSize,\n\t\tvalue,\n\t\tisError,\n\t\tdisabled: groupDisabled,\n\t} = useRadioGroup();\n\n\tconst isChecked = value === componentValue;\n\tconst size = componentSize || groupSize;\n\n\tconst isDisabled = disabled || groupDisabled;\n\n\tconst checkedClass = isChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst disabledClass = isDisabled ? \"disabledTrue\" : \"disabledFalse\";\n\tconst className = `arkynRadioBox ${size} ${checkedClass} ${errorClass} ${disabledClass} ${baseClassName}`;\n\n\tfunction handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n\t\tonClick?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\tfunction handleFocus(event: React.FocusEvent<HTMLButtonElement>) {\n\t\tonFocus?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\treturn (\n\t\t<label className={className.trim()}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\t{...rest}\n\t\t\t/>\n\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport { RadioBox };\n","import { type HTMLAttributes, useState } from \"react\";\n\nimport { useForm } from \"../../../hooks/useForm\";\nimport { FieldTemplate } from \"../../../services/fieldTemplate\";\n\nimport { RadioProvider } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Field name used for form submission. Required. */\n\tname: string;\n\t/** Label displayed above the group. */\n\tlabel?: string;\n\t/** Appends an asterisk to the label. @default false */\n\tshowAsterisk?: boolean;\n\t/** Error message shown below the group. Overrides `fieldErrors[name]` from `FormProvider`. */\n\terrorMessage?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Initial selected value (uncontrolled). @default \"\" */\n\tdefaultValue?: string;\n\t/** Callback fired when the selected option changes. */\n\tonChange?: (value: string) => void;\n\t/** Size variant applied to all `RadioBox` children. @default \"md\" */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Disables all `RadioBox` children. @default false */\n\tdisabled?: boolean;\n\t/** When `true`, skips the `FieldTemplate` wrapper (label, error message). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Layout direction of the `FieldWrapper`. @default \"horizontal\" */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * RadioGroup, managed group of `RadioBox` options with form integration.\n *\n * Renders a hidden `<input>` for native form submission. Reads `fieldErrors[name]` from\n * the nearest `FormProvider` when no `errorMessage` is explicitly provided.\n *\n * @param props.name - Form field name. Required.\n * @param props.label - Label displayed above the group.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.value - Controlled selection.\n * @param props.defaultValue - Initial selection (uncontrolled). Default: `\"\"`\n * @param props.onChange - Called with the newly selected value.\n * @param props.size - Size for all child `RadioBox` elements. Default: `\"md\"`\n * @param props.disabled - Disables all options. Default: false\n * @param props.errorMessage - Validation error message.\n * @param props.unShowFieldTemplate - Omit label/error wrapper. Default: false\n *\n * **...Other valid HTML `<div>` properties**\n *\n * @returns RadioGroup JSX element.\n *\n * @example\n * ```tsx\n * // Uncontrolled with label\n * <RadioGroup name=\"gender\" label=\"Gender\" showAsterisk defaultValue=\"male\">\n * <RadioBox value=\"male\">Male</RadioBox>\n * <RadioBox value=\"female\">Female</RadioBox>\n * <RadioBox value=\"other\">Other</RadioBox>\n * </RadioGroup>\n *\n * // Controlled with change handler\n * <RadioGroup name=\"plan\" label=\"Subscription plan\" value={plan} onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic, $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro, $29/mo</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioGroup(props: RadioGroupProps) {\n\tconst {\n\t\tdefaultValue = \"\",\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\terrorMessage: baseErrorMessage,\n\t\tvalue: forceValue,\n\t\tonChange,\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tdisabled = false,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t\t...rest\n\t} = props;\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst { fieldErrors } = useForm();\n\n\tfunction handleChange(value: string) {\n\t\tsetValue(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst className = `arkynRadioGroup ${size}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<RadioProvider\n\t\t\t\tisError={isError}\n\t\t\t\tsize={size}\n\t\t\t\tvalue={forceValue || value}\n\t\t\t\thandleChange={handleChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tstyle={{ display: \"none\" }}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\treadOnly\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceValue || value}\n\t\t\t\t/>\n\n\t\t\t\t<div className={className.trim()} {...rest} />\n\t\t\t</RadioProvider>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RadioGroup };\n","import { type Descendant, Node } from \"slate\";\n\nfunction extractTextFromNode(nodes: Descendant[]) {\n\treturn nodes.map((n) => Node.string(n)).join(\"\");\n}\n\nexport { extractTextFromNode };\n","import { Editor } from \"slate\";\n\nimport type { RichTextMarkFormatType } from \"../types/richTextTypes\";\n\nfunction isMarkActive(editor: Editor, format: RichTextMarkFormatType) {\n\tconst marks = Editor.marks(editor);\n\treturn marks ? marks[format] === true : false;\n}\n\nexport { isMarkActive };\n","import { Editor } from \"slate\";\n\nimport type { RichTextMarkFormatType } from \"../types/richTextTypes\";\nimport { isMarkActive } from \"./isMarkActive\";\n\nfunction toggleMark(editor: Editor, format: RichTextMarkFormatType) {\n\tconst isActive = isMarkActive(editor, format);\n\n\tif (isActive) Editor.removeMark(editor, format);\n\telse Editor.addMark(editor, format, true);\n}\n\nexport { toggleMark };\n","import type {\n\tDescendant,\n\tRichTextMarkFormatType,\n} from \"../types/richTextTypes\";\n\ntype HotKeys = {\n\t[key: string]: RichTextMarkFormatType;\n};\n\nconst hotKeys: HotKeys = {\n\t\"mod+b\": \"bold\",\n\t\"mod+i\": \"italic\",\n\t\"mod+u\": \"underline\",\n\t\"mod+`\": \"code\",\n};\n\nconst initialValue: Descendant[] = [\n\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n];\n\nconst listTypes = [\"listItem\", \"numberedList\"];\n\nconst textAlignTypes = [\"left\", \"center\", \"right\", \"justify\"];\n\nexport { hotKeys, initialValue, listTypes, textAlignTypes };\n","import { Editor, Element as SlateElement } from \"slate\";\n\nimport type {\n\tRichTextAlignFormatType,\n\tRichTextElementFormatType,\n} from \"../types/richTextTypes\";\n\nfunction isBlockActive(\n\teditor: Editor,\n\tformat: RichTextElementFormatType | RichTextAlignFormatType,\n\tblockType: \"type\" | \"align\" = \"type\",\n) {\n\tconst { selection } = editor;\n\tif (!selection) return false;\n\n\tconst [match] = Array.from(\n\t\tEditor.nodes(editor, {\n\t\t\tat: Editor.unhangRange(editor, selection),\n\t\t\tmatch: (n) =>\n\t\t\t\t!Editor.isEditor(n) &&\n\t\t\t\tSlateElement.isElement(n) &&\n\t\t\t\tn[blockType] === format,\n\t\t}),\n\t);\n\n\treturn !!match;\n}\n\nexport { isBlockActive };\n","import { Editor, Element as SlateElement, Transforms } from \"slate\";\n\nimport { listTypes, textAlignTypes } from \"../templates/richTextTemplates\";\nimport type {\n\tRichTextAlignFormatType,\n\tRichTextElementFormatType,\n} from \"../types/richTextTypes\";\nimport { isBlockActive } from \"./isBlockActive\";\n\nfunction toggleBlock(\n\teditor: Editor,\n\tformat: RichTextElementFormatType | RichTextAlignFormatType,\n) {\n\tconst blockType = textAlignTypes.includes(format) ? \"align\" : \"type\";\n\tconst isActive = isBlockActive(editor, format, blockType);\n\n\tconst isList = listTypes.includes(format);\n\n\tTransforms.unwrapNodes(editor, {\n\t\tmatch: (n) =>\n\t\t\t!Editor.isEditor(n) &&\n\t\t\tSlateElement.isElement(n) &&\n\t\t\tlistTypes.includes(n.type) &&\n\t\t\t!textAlignTypes.includes(format),\n\t\tsplit: true,\n\t});\n\n\tlet newProperties: Partial<SlateElement>;\n\n\tif (textAlignTypes.includes(format)) {\n\t\tconst formatType = format as RichTextAlignFormatType;\n\t\tnewProperties = { align: isActive ? undefined : formatType };\n\t} else {\n\t\tconst formatType = format as RichTextElementFormatType;\n\t\tnewProperties = {\n\t\t\ttype: isActive ? \"paragraph\" : isList ? \"listItem\" : formatType,\n\t\t};\n\t}\n\n\tTransforms.setNodes<SlateElement>(editor, newProperties);\n\n\tif (!isActive && isList) {\n\t\tconst block = { type: format as RichTextElementFormatType, children: [] };\n\t\tTransforms.wrapNodes(editor, block);\n\t}\n}\n\nexport { toggleBlock };\n","import type { LucideIcon } from \"lucide-react\";\nimport type { MouseEvent } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isBlockActive } from \"../../../services/isBlockActive\";\nimport { toggleBlock } from \"../../../services/toggleBlock\";\nimport { textAlignTypes } from \"../../../templates/richTextTemplates\";\nimport type {\n\tRichTextAlignFormatType,\n\tRichTextElementFormatType,\n} from \"../../../types/richTextTypes\";\n\nimport \"./styles.css\";\n\ntype BlockButtonProps = {\n\tformat: RichTextElementFormatType | RichTextAlignFormatType;\n\ticon: LucideIcon;\n};\n\nfunction BlockButton({ format, icon: Icon }: BlockButtonProps) {\n\tconst editor = useSlate();\n\n\tconst blockType = textAlignTypes.includes(format) ? \"align\" : \"type\";\n\tconst isActive = isBlockActive(editor, format, blockType);\n\n\tconst activeClass = isActive ? \"activeTrue\" : \"activeFalse\";\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\ttoggleBlock(editor, format);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={`arkynRichTextBlockButton ${activeClass}`}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t>\n\t\t\t<Icon />\n\t\t</button>\n\t);\n}\n\nexport { BlockButton };\n","import type { RenderElementProps } from \"slate-react\";\nimport \"./styles.css\";\n\nfunction Element({ attributes, children, element }: RenderElementProps) {\n\tconst style = { textAlign: element.align };\n\n\tswitch (element.type) {\n\t\tcase \"blockQuote\":\n\t\t\treturn (\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName=\"arkynElementBlockquote\"\n\t\t\t\t\tstyle={style}\n\t\t\t\t\t{...attributes}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</blockquote>\n\t\t\t);\n\t\tcase \"bulletedList\":\n\t\t\treturn (\n\t\t\t\t<ul className=\"arkynElementBulletList\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</ul>\n\t\t\t);\n\t\tcase \"headingOne\":\n\t\t\treturn (\n\t\t\t\t<h1 className=\"arkynElementHeadingOne\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</h1>\n\t\t\t);\n\t\tcase \"headingTwo\":\n\t\t\treturn (\n\t\t\t\t<h2 className=\"arkynElementHeadingTwo\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</h2>\n\t\t\t);\n\t\tcase \"listItem\":\n\t\t\treturn (\n\t\t\t\t<li className=\"arkynElementListItem\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</li>\n\t\t\t);\n\t\tcase \"numberedList\":\n\t\t\treturn (\n\t\t\t\t<ol className=\"arkynElementNumberedList\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</ol>\n\t\t\t);\n\t\tcase \"image\":\n\t\t\treturn (\n\t\t\t\t<div style={style} {...attributes}>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName=\"arkynElementImage\"\n\t\t\t\t\t\talt=\"arkynElementImage\"\n\t\t\t\t\t\tsrc={element?.src || \"\"}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t);\n\t\tcase \"video\":\n\t\t\treturn (\n\t\t\t\t<div style={style} {...attributes}>\n\t\t\t\t\t<iframe\n\t\t\t\t\t\tclassName=\"arkynElementVideo\"\n\t\t\t\t\t\tsrc={element?.src || \"\"}\n\t\t\t\t\t\ttitle=\"YouTube video player\"\n\t\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\t\t\t\treferrerPolicy=\"strict-origin-when-cross-origin\"\n\t\t\t\t\t\tallowFullScreen\n\t\t\t\t\t/>\n\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<p className=\"arkynElementParagraph\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</p>\n\t\t\t);\n\t}\n}\n\nexport { Element };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype TabContextProps = {\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\ntype TabProviderProps = {\n\tchildren: ReactNode;\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\nconst TabContext = createContext({} as TabContextProps);\n\nfunction useTab() {\n\treturn useContext(TabContext);\n}\n\nfunction TabProvider(props: TabProviderProps) {\n\tconst { disabled, currentTab, changeCurrentTab } = props;\n\n\tconst value = useMemo(\n\t\t() => ({ disabled, currentTab, changeCurrentTab }),\n\t\t[disabled, currentTab, changeCurrentTab],\n\t);\n\n\treturn (\n\t\t<TabContext.Provider value={value}>{props.children}</TabContext.Provider>\n\t);\n}\n\nexport { TabProvider, useTab };\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useTab } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * TabButton, individual tab button inside a `TabContainer`.\n *\n * Reads active state and disabled state from `TabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns TabButton JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"activity\">Activity</TabButton>\n * <TabButton value=\"settings\" disabled>Settings</TabButton>\n * </TabContainer>\n * ```\n */\n\nfunction TabButton(props: TabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { TabButton };\n","import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { TabProvider } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onChange\" | \"children\" | \"ref\" | \"onClick\"\n> & {\n\t/** `TabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * TabContainer, wrapper that manages active state for a group of `TabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `TabButton`.\n *\n * @param props.children - `TabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns TabContainer JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"analytics\">Analytics</TabButton>\n * <TabButton value=\"settings\">Settings</TabButton>\n * </TabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction TabContainer(props: TabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<TabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</TabProvider>\n\t);\n}\n\nexport { TabContainer };\n","import { Image } from \"lucide-react\";\nimport { type MouseEvent, useState } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport type { RichTextInsertImageProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { ImageUpload } from \"../../imageUpload\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\nimport { TabButton } from \"../../tab/tabButton\";\nimport { TabContainer } from \"../../tab/tabContainer\";\n\nimport \"./styles.css\";\n\nfunction InsertImage(props: RichTextInsertImageProps) {\n\tconst {\n\t\taction,\n\t\ttabLabels = [\"Adicionar URL\", \"Upload de arquivo\"],\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputImageLabel = \"Imagem:\",\n\t\tmodalInputUrlLabel = \"URL da imagem:\",\n\t\tmodalTitle = \"Inserir imagem\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [imageURL, setImageURL] = useState(\"\");\n\tconst [uploadType, setUploadType] = useState(\"url\");\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tif (!imageURL || imageURL === \"\") return;\n\n\t\teditor.insertNodes([\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t\t{ type: \"image\", src: imageURL, children: [{ text: \"\" }] },\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t]);\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertImage\"\n\t\t\t\tonMouseDown={() => setModalIsVisible(true)}\n\t\t\t>\n\t\t\t\t<Image />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertImageModalContent\">\n\t\t\t\t\t<TabContainer defaultValue={uploadType} onChange={setUploadType}>\n\t\t\t\t\t\t<TabButton value=\"url\">{tabLabels[0]}</TabButton>\n\t\t\t\t\t\t<TabButton value=\"file\">{tabLabels[1]}</TabButton>\n\t\t\t\t\t</TabContainer>\n\n\t\t\t\t\t{uploadType === \"url\" && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tname=\"richTextImageURL\"\n\t\t\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\t\t\tdefaultValue={imageURL}\n\t\t\t\t\t\t\t\tonChange={(e) => setImageURL(e.target.value)}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{imageURL && (\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tclassName=\"arkynRichTextInsertImageModalPreviewImage\"\n\t\t\t\t\t\t\t\t\tsrc={imageURL}\n\t\t\t\t\t\t\t\t\talt=\"preview\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{uploadType === \"file\" && (\n\t\t\t\t\t\t<ImageUpload\n\t\t\t\t\t\t\tname=\"richTextImageURL\"\n\t\t\t\t\t\t\taction={action}\n\t\t\t\t\t\t\tlabel={modalInputImageLabel}\n\t\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\t\tdefaultValue={imageURL}\n\t\t\t\t\t\t\tonChange={(url) => setImageURL(url)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button type=\"button\" onClick={handleMouseDown}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertImage };\n","function isValidHttpsUrl(url: string): boolean {\n\ttry {\n\t\treturn new URL(url).protocol === \"https:\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport { isValidHttpsUrl };\n","import { Link } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { Editor, Range, Transforms } from \"slate\";\nimport { useSlate } from \"slate-react\";\n\nimport { isValidHttpsUrl } from \"../../../services/isValidHttpsUrl\";\nimport type { RichTextInsertLinkProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertLink(props: RichTextInsertLinkProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do link:\",\n\t\tmodalTitle = \"Inserir link\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [linkURL, setLinkURL] = useState(\"\");\n\tconst [selection, setSelection] = useState(editor.selection);\n\n\tconst isValidUrl = isValidHttpsUrl(linkURL);\n\tconst errorMessage = linkURL && !isValidUrl ? invalidUrlMessage : \"\";\n\n\tfunction handleOpenModal(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tsetSelection(editor.selection);\n\t\tsetModalIsVisible(true);\n\t}\n\n\tfunction handleConfirm(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tif (!isValidUrl || !selection) return;\n\n\t\tTransforms.select(editor, selection);\n\n\t\tif (Range.isCollapsed(selection)) {\n\t\t\tTransforms.insertNodes(editor, {\n\t\t\t\ttext: linkURL,\n\t\t\t\tlink: true,\n\t\t\t\thref: linkURL,\n\t\t\t});\n\t\t} else {\n\t\t\tEditor.addMark(editor, \"link\", true);\n\t\t\tEditor.addMark(editor, \"href\", linkURL);\n\t\t}\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetLinkURL(\"\");\n\t\t\tsetSelection(null);\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertLink\"\n\t\t\t\tonMouseDown={handleOpenModal}\n\t\t\t>\n\t\t\t\t<Link />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertLinkModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextLinkURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={linkURL}\n\t\t\t\t\t\tonChange={(e) => setLinkURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!isValidUrl} type=\"button\" onClick={handleConfirm}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertLink };\n","import { Video } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isValidHttpsUrl } from \"../../../services/isValidHttpsUrl\";\nimport type { RichTextInsertVideoProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertVideo(props: RichTextInsertVideoProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do vídeo:\",\n\t\tmodalTitle = \"Inserir vídeo\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [videoId, setVideoId] = useState(\"\");\n\tconst [videoRawURL, setVideoRawURL] = useState(\"\");\n\tconst [errorMessage, setErrorMessage] = useState(\"\");\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\n\t\tif (!videoId || videoId === \"\") return;\n\t\tconst videoUrl = `https://www.youtube.com/embed/${videoId}`;\n\n\t\teditor.insertNodes([\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t\t{ type: \"video\", src: videoUrl, children: [{ text: \"\" }] },\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t]);\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!videoRawURL || videoRawURL === \"\") return;\n\n\t\tsetVideoId(\"\");\n\t\tsetErrorMessage(\"\");\n\n\t\tif (!isValidHttpsUrl(videoRawURL)) {\n\t\t\tsetErrorMessage(invalidUrlMessage);\n\t\t\treturn;\n\t\t}\n\n\t\tconst searchParams = new URLSearchParams(videoRawURL.split(\"?\")[1]);\n\t\tconst vParam = searchParams.get(\"v\");\n\t\tif (vParam) setVideoId(vParam);\n\t\telse setErrorMessage(invalidUrlMessage);\n\t}, [videoRawURL, invalidUrlMessage]);\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetVideoId(\"\");\n\t\t\tsetVideoRawURL(\"\");\n\t\t\tsetErrorMessage(\"\");\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertVideo\"\n\t\t\t\tonMouseDown={() => setModalIsVisible(true)}\n\t\t\t>\n\t\t\t\t<Video />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertVideoModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextVideoURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={videoRawURL}\n\t\t\t\t\t\tonChange={(e) => setVideoRawURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{videoId && (\n\t\t\t\t\t\t<iframe\n\t\t\t\t\t\t\twidth=\"auto\"\n\t\t\t\t\t\t\theight=\"315\"\n\t\t\t\t\t\t\tsrc={`https://www.youtube.com/embed/${videoId}`}\n\t\t\t\t\t\t\ttitle=\"YouTube video player\"\n\t\t\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\t\t\t\t\treferrerPolicy=\"strict-origin-when-cross-origin\"\n\t\t\t\t\t\t\tallowFullScreen\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!videoId} type=\"button\" onClick={handleMouseDown}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertVideo };\n","import type { RenderLeafProps } from \"slate-react\";\nimport \"./styles.css\";\n\nfunction Leaf({ attributes, children, leaf }: RenderLeafProps) {\n\tif (leaf.bold) children = <strong>{children}</strong>;\n\tif (leaf.code) children = <code>{children}</code>;\n\tif (leaf.italic) children = <em>{children}</em>;\n\tif (leaf.underline) children = <u>{children}</u>;\n\tif (leaf.link) {\n\t\tchildren = (\n\t\t\t<a className=\"arkynLeafLink\" href={leaf.href}>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn <span {...attributes}>{children}</span>;\n}\n\nexport { Leaf };\n","import type { LucideIcon } from \"lucide-react\";\nimport type { MouseEvent } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isMarkActive } from \"../../../services/isMarkActive\";\nimport { toggleMark } from \"../../../services/toggleMark\";\nimport type { RichTextMarkFormatType } from \"../../../types/richTextTypes\";\n\nimport \"./styles.css\";\n\ntype MarkButtonProps = {\n\tformat: RichTextMarkFormatType;\n\ticon: LucideIcon;\n};\n\nfunction MarkButton({ format, icon: Icon }: MarkButtonProps) {\n\tconst editor = useSlate();\n\n\tconst isActive = isMarkActive(editor, format);\n\tconst activeClass = isActive ? \"activeTrue\" : \"activeFalse\";\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\ttoggleMark(editor, format);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={`arkynRichTextMarkButton ${activeClass}`}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t>\n\t\t\t<Icon />\n\t\t</button>\n\t);\n}\n\nexport { MarkButton };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype ToolbarProps = {\n\tchildren: ReactNode;\n};\n\nfunction Toolbar({ children }: ToolbarProps) {\n\treturn <div className=\"arkynRichTextToolbar\">{children}</div>;\n}\n\nexport { Toolbar };\n","import isHotkey from \"is-hotkey\";\nimport {\n\tAlignCenter,\n\tAlignJustify,\n\tAlignLeft,\n\tAlignRight,\n\tBold,\n\tCode,\n\tHeading1,\n\tHeading2,\n\tItalic,\n\tQuote,\n\tUnderline,\n} from \"lucide-react\";\nimport { useCallback, useId, useMemo, useRef, useState } from \"react\";\nimport { createEditor, type Descendant } from \"slate\";\nimport { withHistory } from \"slate-history\";\nimport { Editable, Slate, withReact } from \"slate-react\";\nimport { useForm } from \"../../hooks/useForm\";\nimport { extractTextFromNode } from \"../../services/extractTextFromNode\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { toggleMark } from \"../../services/toggleMark\";\nimport { hotKeys, initialValue } from \"../../templates/richTextTemplates\";\nimport type {\n\tRichTextHiddenButtonKey,\n\tRichTextProps,\n} from \"../../types/richTextTypes\";\nimport { BlockButton } from \"./blockButton\";\nimport { Element } from \"./element\";\nimport { InsertImage } from \"./insertImage\";\nimport { InsertLink } from \"./insertLink\";\nimport { InsertVideo } from \"./insertVideo\";\nimport { Leaf } from \"./leaf\";\nimport { MarkButton } from \"./markButton\";\nimport { Toolbar } from \"./toolbar\";\nimport \"./styles.css\";\n\n/**\n * RichText, WYSIWYG rich-text editor built on Slate.js with a configurable toolbar.\n *\n * **Toolbar features:** bold, italic, underline, code, H1/H2, block quote, alignment (left/center/right/justify), image, video, and link insertion.\n *\n * Editor content is stored as a Slate JSON string in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the editor.\n * @param props.hiddenButtons - Toolbar button keys to hide (e.g. `[\"image\", \"code\"]`).\n * @param props.imageConfig - Enables image insertion; contains the upload endpoint and modal labels.\n * @param props.videoConfig - Customizes the video insertion modal labels.\n * @param props.linkConfig - Customizes the link insertion modal labels.\n * @param props.defaultValue - Initial editor content as a Slate JSON string. Default: \"[]\"\n * @param props.maxLimit - Maximum character count. Default: 10000\n * @param props.enforceCharacterLimit - Prevents typing past `maxLimit`. Default: false\n * @param props.onChangeCharactersCount - Callback fired on every keystroke, receives the current character count.\n * @param props.onChange - Callback fired when editor content changes, receives the Slate `Descendant[]`.\n * @param props.baseErrorMessage - Custom error message (overrides `useForm` context error).\n * @param props.isError - Forces the error visual state.\n * @param props.id - Custom id for the editable area element.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns RichText JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <RichText name=\"content\" />\n *\n * // With character limit and hidden toolbar buttons\n * <RichText\n * name=\"description\"\n * label=\"Description\"\n * maxLimit={500}\n * enforceCharacterLimit\n * hiddenButtons={[\"image\", \"video\", \"code\"]}\n * onChangeCharactersCount={(n) => setCharCount(n)}\n * />\n *\n * // With image upload support\n * <RichText\n * name=\"article\"\n * label=\"Article Body\"\n * imageConfig={{ action: \"/api/upload\" }}\n * />\n *\n * // With custom link insertion modal labels\n * <RichText\n * name=\"article\"\n * label=\"Article Body\"\n * linkConfig={{ modalTitle: \"Add a link\" }}\n * />\n * ```\n */\n\nfunction RichText(props: RichTextProps) {\n\tconst {\n\t\tname,\n\t\thiddenButtons,\n\t\timageConfig,\n\t\tvideoConfig,\n\t\tlinkConfig,\n\t\tclassName: wrapperClassName = \"\",\n\t\tdefaultValue = \"[]\",\n\t\tenforceCharacterLimit = false,\n\t\tonChangeCharactersCount,\n\t\tbaseErrorMessage,\n\t\tmaxLimit = 10000,\n\t\tonChange,\n\t\tisError: baseIsError,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tid,\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst editor = useMemo(() => withHistory(withReact(createEditor())), []);\n\n\tconst { fieldErrors } = useForm();\n\n\tconst defaultNodes = useMemo((): Descendant[] => {\n\t\ttry {\n\t\t\tconst parsedNodes = JSON.parse(defaultValue);\n\t\t\tif (!Array.isArray(parsedNodes) || parsedNodes.length === 0) {\n\t\t\t\treturn structuredClone(initialValue);\n\t\t\t}\n\n\t\t\tconst isValidNodes = parsedNodes.every(\n\t\t\t\t(node) =>\n\t\t\t\t\ttypeof node === \"object\" &&\n\t\t\t\t\tnode !== null &&\n\t\t\t\t\t\"type\" in node &&\n\t\t\t\t\t\"children\" in node,\n\t\t\t);\n\n\t\t\treturn isValidNodes ? parsedNodes : structuredClone(initialValue);\n\t\t} catch (_error) {\n\t\t\treturn structuredClone(initialValue);\n\t\t}\n\t}, [defaultValue]);\n\n\tconst textFromNodes = extractTextFromNode(defaultNodes);\n\n\tconst [charactersCount, setCharactersCount] = useState(textFromNodes.length);\n\tconst [inputValue, setInputValue] = useState(\n\t\tJSON.stringify(defaultNodes) || \"[]\",\n\t);\n\n\tconst [onFocus, setOnFocus] = useState(false);\n\n\tconst ref = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = baseIsError || !!errorMessage;\n\n\tconst renderLeaf = useCallback(Leaf, []);\n\tconst renderElement = useCallback(Element, []);\n\n\tfunction handleChange(value: Descendant[]) {\n\t\tconst text = extractTextFromNode(value);\n\n\t\tsetCharactersCount(text.length);\n\t\tonChangeCharactersCount?.(text.length);\n\n\t\tif (enforceCharacterLimit && text.length >= maxLimit) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetInputValue(JSON.stringify(value));\n\t\tonChange?.(value);\n\t}\n\n\tconst focusClass = onFocus ? \"focusTrue\" : \"focusFalse\";\n\tconst errorClass = isError\n\t\t? \"errorTrue\"\n\t\t: maxLimit < charactersCount\n\t\t\t? \"errorTrue\"\n\t\t\t: \"errorFalse\";\n\n\tconst className = `arkynRichText ${errorClass} ${focusClass}`;\n\n\tconst restatesCharacters = maxLimit - charactersCount;\n\n\tfunction buttonIsNotHidden(format: RichTextHiddenButtonKey) {\n\t\treturn !hiddenButtons?.includes(format);\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<Slate\n\t\t\t\teditor={editor}\n\t\t\t\tinitialValue={defaultNodes}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t>\n\t\t\t\t<div className={className}>\n\t\t\t\t\t<Toolbar>\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingOne\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingOne\" icon={Heading1} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingTwo\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingTwo\" icon={Heading2} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"blockQuote\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"blockQuote\" icon={Quote} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"bold\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"bold\" icon={Bold} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"italic\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"italic\" icon={Italic} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"underline\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"underline\" icon={Underline} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"code\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"code\" icon={Code} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"left\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"left\" icon={AlignLeft} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"right\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"right\" icon={AlignRight} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"center\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"center\" icon={AlignCenter} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"justify\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"justify\" icon={AlignJustify} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{imageConfig && buttonIsNotHidden(\"image\") && (\n\t\t\t\t\t\t\t<InsertImage {...imageConfig} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"video\") && <InsertVideo {...videoConfig} />}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"link\") && <InsertLink {...linkConfig} />}\n\t\t\t\t\t</Toolbar>\n\n\t\t\t\t\t<Editable\n\t\t\t\t\t\tclassName=\"editorContainer\"\n\t\t\t\t\t\trenderElement={renderElement}\n\t\t\t\t\t\trenderLeaf={renderLeaf}\n\t\t\t\t\t\tspellCheck\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\tonFocus={() => setOnFocus(true)}\n\t\t\t\t\t\tonBlur={() => setOnFocus(false)}\n\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\tfor (const hotkey in hotKeys) {\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t\t\t\t\t\t\tif (isHotkey(hotkey, event as any)) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tconst mark = hotKeys[hotkey as keyof typeof hotKeys];\n\t\t\t\t\t\t\t\t\ttoggleMark(editor, mark);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{restatesCharacters < 0 && (\n\t\t\t\t\t\t<div className=\"restatesCharacters\">{restatesCharacters}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={inputValue.slice(0, maxLimit)}\n\t\t\t\t/>\n\n\t\t\t\t<input type=\"hidden\" name={`${name}Count`} value={charactersCount} />\n\t\t\t</Slate>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RichText };\n","import type { StandaloneSearchBoxProps } from \"@react-google-maps/api\";\nimport { StandaloneSearchBox } from \"@react-google-maps/api\";\nimport { type JSX, useState } from \"react\";\nimport { Input, type InputProps } from \"./input\";\n\ntype AddressComponentsType = {\n\tlong_name: string;\n\tshort_name: string;\n\ttypes: string[];\n}[];\n\n/** Structured address data extracted from a Google Places result. */\ntype PlaceData = {\n\t/** Street name (e.g. `\"Rua Exemplo\"`). */\n\tstreet: string;\n\t/** City name (e.g. `\"São Paulo\"`). */\n\tcity: string;\n\t/** Full state name (e.g. `\"São Paulo\"`). */\n\tstate: string;\n\t/** Neighborhood / district name. */\n\tneighborhood: string;\n\t/** Postal / ZIP code. */\n\tpostalCode: string;\n\t/** State abbreviation (e.g. `\"SP\"`). */\n\tstateShortName: string;\n\t/** Street number (e.g. `\"123\"`). */\n\tstreetNumber: string;\n\t/** Geographic coordinates of the place. */\n\tcoordinates: { lat: number; lng: number };\n};\n\ntype SearchPlacesProps = {\n\t/** Google Maps `StandaloneSearchBox` options (e.g. `componentRestrictions`, `bounds`). */\n\toptions?: StandaloneSearchBoxProps[\"options\"];\n\t/** Callback fired every time the input text changes. Receives the current string value. */\n\tonChange?: (e: string) => void;\n\t/**\n\t * Callback fired when the user selects a place from the autocomplete suggestions.\n\t * Receives a structured {@link PlaceData} object.\n\t */\n\tonPlaceChanged?: (e: PlaceData) => void;\n} & Omit<InputProps, \"onLoad\" | \"onChange\" | \"type\">;\n\n/**\n * SearchPlaces, text input with Google Places autocomplete that returns structured address data.\n *\n * Requires the Google Maps JavaScript API with the Places library to be loaded.\n * Built on `@react-google-maps/api`'s `StandaloneSearchBox`.\n *\n * @param props.options - Google Maps search box options (e.g. restrict by country).\n * @param props.onChange - Fires on every keystroke, receives the current text value.\n * @param props.onPlaceChanged - Fires when the user selects a suggestion, receives structured address data.\n *\n * **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**\n *\n * @returns SearchPlaces JSX element (an `Input` wrapped in `StandaloneSearchBox`).\n *\n * @example\n * ```tsx\n * <SearchPlaces\n * name=\"address\"\n * label=\"Address\"\n * placeholder=\"Start typing an address…\"\n * options={{ componentRestrictions: { country: \"br\" } }}\n * onChange={(v) => setRawAddress(v)}\n * onPlaceChanged={(place) => {\n * setAddress({\n * street: place.street,\n * city: place.city,\n * state: place.state,\n * postalCode: place.postalCode,\n * coordinates: place.coordinates,\n * });\n * }}\n * />\n * ```\n */\n\nfunction SearchPlaces(props: SearchPlacesProps): JSX.Element {\n\tconst { onChange, onPlaceChanged, options, ...rest } = props;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst [searchBox, setSearchBox] = useState<any>(null);\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst handleLoad = (ref: any) => setSearchBox(ref);\n\n\tconst handlePlacesChanged = () => {\n\t\tconst places = searchBox?.getPlaces();\n\t\tconst place = places ? places[0] : null;\n\n\t\tconst address_components =\n\t\t\tplace?.address_components as AddressComponentsType;\n\n\t\tfunction findData(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.long_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataShort(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.short_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataByMultipleTypes(keys: string[]) {\n\t\t\tfor (const key of keys) {\n\t\t\t\tconst data = address_components.find((item) =>\n\t\t\t\t\titem.types.includes(key),\n\t\t\t\t);\n\t\t\t\tif (data) return data.long_name;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (place) {\n\t\t\tconst street = findData(\"route\");\n\t\t\tconst streetNumber = findData(\"street_number\");\n\t\t\tconst neighborhood = findDataByMultipleTypes([\n\t\t\t\t\"sublocality_level_1\",\n\t\t\t\t\"sublocality\",\n\t\t\t\t\"neighborhood\",\n\t\t\t]);\n\t\t\tconst city = findData(\"administrative_area_level_2\");\n\t\t\tconst state = findData(\"administrative_area_level_1\");\n\t\t\tconst stateShortName = findDataShort(\"administrative_area_level_1\");\n\t\t\tconst postalCode = findDataByMultipleTypes([\n\t\t\t\t\"postal_code\",\n\t\t\t\t\"postal_code_prefix\",\n\t\t\t]);\n\n\t\t\tconst lat = place.geometry?.location?.lat();\n\t\t\tconst lng = place.geometry?.location?.lng();\n\n\t\t\tconst sendPlace = {\n\t\t\t\tstreet,\n\t\t\t\tcity,\n\t\t\t\tstate,\n\t\t\t\tneighborhood,\n\t\t\t\tpostalCode,\n\t\t\t\tstreetNumber,\n\t\t\t\tstateShortName,\n\t\t\t\tcoordinates: { lat, lng },\n\t\t\t};\n\n\t\t\tonPlaceChanged?.(sendPlace);\n\t\t}\n\t};\n\n\treturn (\n\t\t<StandaloneSearchBox\n\t\t\tonLoad={handleLoad}\n\t\t\tonPlacesChanged={handlePlacesChanged}\n\t\t\toptions={options}\n\t\t>\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonChange={(e) => onChange?.(e.target.value)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</StandaloneSearchBox>\n\t);\n}\n\nexport { SearchPlaces };\n","import type { ButtonHTMLAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport \"./styles.css\";\n\ntype SwitchProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"onChange\" | \"defaultValue\" | \"onCheck\" | \"value\"\n> & {\n\t/** Optional label text displayed beside the switch. */\n\tlabel?: string;\n\t/**\n\t * Switch size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Value emitted when the switch is on. @default \"checked\" */\n\tvalue?: string;\n\t/** Value emitted when the switch is off. @default \"\" */\n\tunCheckedValue?: string;\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Callback fired on toggle, receives the current value string. */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the switch. */\n\terrorMessage?: string;\n};\n\n/**\n * Switch, toggle input for binary on/off states.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the switch.\n * @param props.size - Switch size (`sm` | `md` | `lg`). Default: \"lg\"\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.checked - Controlled checked state.\n * @param props.value - Value emitted when on. Default: \"checked\"\n * @param props.unCheckedValue - Value emitted when off. Default: \"\"\n * @param props.onCheck - Callback fired on toggle, receives the current value string.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n *\n * **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**\n *\n * @returns Switch JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Switch name=\"notifications\" label=\"Enable notifications\" />\n *\n * // Custom on/off values\n * <Switch\n * name=\"theme\"\n * label=\"Dark mode\"\n * value=\"dark\"\n * unCheckedValue=\"light\"\n * onCheck={(v) => setTheme(v)}\n * />\n *\n * // Controlled\n * <Switch\n * name=\"autoSave\"\n * label=\"Auto-save\"\n * checked={isAutoSaveEnabled}\n * onCheck={(v) => setAutoSave(!!v)}\n * size=\"md\"\n * />\n * ```\n */\n\nfunction Switch(props: SwitchProps) {\n\tconst {\n\t\tlabel,\n\t\tsize = \"lg\",\n\t\tdefaultChecked = false,\n\t\tchecked: baseChecked = null,\n\t\tvalue,\n\t\tunCheckedValue = \"\",\n\t\tname,\n\t\tclassName: baseClassName = \"\",\n\t\tonCheck,\n\t\tid,\n\t\torientation = \"horizontalReverse\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tshowAsterisk,\n\t\terrorMessage,\n\t\tunShowFieldTemplate = false,\n\t\t...rest\n\t} = props;\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tfunction handleCheck() {\n\t\tsetIsChecked(!isChecked);\n\t\tonCheck?.(!currentChecked ? value || \"checked\" : unCheckedValue);\n\t}\n\n\tconst checkedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst className = `arkynSwitch ${checkedClass} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleCheck}\n\t\t\t\tclassName={className}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tid={inputId}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonClick={handleCheck}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : unCheckedValue}\n\t\t\t\t/>\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Switch };\n","import { Children, type HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {\n\t/** Text displayed in a full-width row when no children are present. @default \"Nenhum dado adicionado.\" */\n\temptyMessage?: string;\n};\n\n/**\n * TableBody, `<tbody>` section with built-in empty state handling.\n *\n * When `children` is empty, renders a full-width row with `emptyMessage`.\n * Accepts all standard HTML `<tbody>` attributes.\n *\n * @param props.emptyMessage - Empty state text. Default: `\"Nenhum dado adicionado.\"`\n *\n * **...Other valid HTML `<tbody>` properties**\n *\n * @returns TableBody JSX element.\n *\n * @example\n * ```tsx\n * <TableBody emptyMessage=\"No orders found\">\n * {orders.map(o => (\n * <tr key={o.id}>\n * <td>{o.number}</td>\n * <td>{o.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * ```\n */\n\nfunction TableBody(props: TableBodyProps) {\n\tconst {\n\t\temptyMessage = \"Nenhum dado adicionado.\",\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynTableBody ${baseClassName}`;\n\tconst childArray = Children.toArray(children).filter(Boolean);\n\tconst isEmpty = childArray.length === 0;\n\n\treturn (\n\t\t<tbody className={className.trim()} {...rest}>\n\t\t\t{isEmpty ? (\n\t\t\t\t<tr className=\"arkynTableBodyEmptyLine\">\n\t\t\t\t\t<td colSpan={100}>\n\t\t\t\t\t\t<div>{emptyMessage}</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t) : (\n\t\t\t\tchildArray\n\t\t\t)}\n\t\t</tbody>\n\t);\n}\n\nexport { TableBody };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableCaptionProps = HTMLAttributes<HTMLElement>;\n\n/**\n * TableCaption, title / description placed above a table. Renders as a `<caption>` element.\n *\n * Accepts all standard HTML element attributes.\n *\n * @returns TableCaption JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Orders, Q2 2025</TableCaption>\n * <TableHeader>...</TableHeader>\n * <TableBody>...</TableBody>\n * </TableContainer>\n * ```\n */\n\nfunction TableCaption(props: TableCaptionProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableCaption ${baseClassName}`;\n\n\treturn (\n\t\t<caption className={className.trim()} {...rest}>\n\t\t\t<div className=\"arkynTableCaptionContent\">{children}</div>\n\t\t</caption>\n\t);\n}\n\nexport { TableCaption };\n","import type { TableHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableContainerProps = TableHTMLAttributes<HTMLTableElement>;\n\n/**\n * TableContainer, root wrapper for the Table component set. Renders a responsive scrollable container around a `<table>`.\n *\n * Accepts all standard HTML `<table>` attributes.\n *\n * @returns TableContainer JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Users</TableCaption>\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Status</th>\n * </TableHeader>\n * <TableBody emptyMessage=\"No users found\">\n * {users.map(u => (\n * <tr key={u.id}>\n * <td>{u.name}</td>\n * <td>{u.email}</td>\n * <td>{u.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * <TableFooter><Pagination /></TableFooter>\n * </TableContainer>\n * ```\n */\n\nfunction TableContainer(props: TableContainerProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynTableContainer ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { TableContainer };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableFooter, `<tfoot>` section with an automatic spacing row above the content.\n *\n * Children span all columns via `colSpan={100}`. Commonly used for `Pagination`.\n * Accepts all standard HTML `<tfoot>` attributes.\n *\n * @returns TableFooter JSX element.\n *\n * @example\n * ```tsx\n * <TableFooter>\n * <Pagination currentPage={page} totalPages={totalPages} onChange={setPage} />\n * </TableFooter>\n * ```\n */\n\nfunction TableFooter(props: TableFooterProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableFooter ${baseClassName}`;\n\n\treturn (\n\t\t<tfoot className={className.trim()} {...rest}>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t\t<tr>\n\t\t\t\t<th colSpan={100}>\n\t\t\t\t\t<div className=\"arkynTableFooterContent\">{children}</div>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t</tfoot>\n\t);\n}\n\nexport { TableFooter };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableHeader, `<thead>` section with an automatic spacing row below the header row.\n *\n * Pass `<th>` elements as children, they are wrapped in a `<tr>` automatically.\n * Accepts all standard HTML `<thead>` attributes.\n *\n * @returns TableHeader JSX element.\n *\n * @example\n * ```tsx\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Actions</th>\n * </TableHeader>\n * ```\n */\n\nfunction TableHeader(props: TableHeaderProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableHeader ${baseClassName}`;\n\n\treturn (\n\t\t<thead className={className.trim()} {...rest}>\n\t\t\t<tr>{children}</tr>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t</thead>\n\t);\n}\n\nexport { TableHeader };\n","import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea, multi-line text input with label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the textarea.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Textarea size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n *\n * **...Other valid HTML properties for `<textarea>`**\n *\n * @returns Textarea JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Textarea name=\"description\" placeholder=\"Enter description...\" />\n *\n * // With label and validation\n * <Textarea\n * name=\"bio\"\n * label=\"Biography\"\n * showAsterisk\n * placeholder=\"Tell us about yourself\"\n * errorMessage=\"Biography is required\"\n * />\n *\n * // Controlled with custom rows\n * <Textarea\n * name=\"message\"\n * label=\"Message\"\n * value={message}\n * onChange={(e) => setMessage(e.target.value)}\n * rows={5}\n * size=\"lg\"\n * variant=\"outline\"\n * />\n * ```\n */\n\nfunction Textarea(props: TextareaProps) {\n\tconst {\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName,\n\t\terrorMessage: baseErrorMessage,\n\t\tdisabled = false,\n\t\treadOnly = false,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tname,\n\t\tonFocus,\n\t\tonBlur,\n\t\ttitle,\n\t\tstyle,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tplaceholder,\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst generatedId = useId();\n\tconst textareaId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst opacityClass = disabled || readOnly ? \"opacityTrue\" : \"opacityFalse\";\n\tconst focusedClass = isFocused ? \"focusedTrue\" : \"focusedFalse\";\n\n\tconst className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;\n\tconst domValue = disabled ? undefined : value;\n\n\tfunction handleSectionClick() {\n\t\tif (disabled || !textareaRef?.current) return;\n\t\tsetIsFocused(true);\n\t\ttextareaRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={textareaId} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<textarea\n\t\t\t\t\tid={textareaId}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={textareaRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdefaultValue={domValue === undefined ? defaultValue || \"\" : undefined}\n\t\t\t\t\tplaceholder={disabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={domValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { Textarea };\n","const badResponses = [\n\t\"BadGateway\",\n\t\"BadRequest\",\n\t\"Conflict\",\n\t\"Forbidden\",\n\t\"NotFound\",\n\t\"NotImplemented\",\n\t\"ServerError\",\n\t\"Unauthorized\",\n\t\"UnprocessableEntity\",\n];\n\nexport { badResponses };\n","const successResponses = [\"Created\", \"Found\", \"Success\", \"Updated\"];\n\nexport { successResponses };\n","import {\n\tcreateContext,\n\ttype ReactNode,\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n} from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype ModalContextProps<T = any> = {\n\tmodalIsOpen(key: string): boolean;\n\tmodalData(key: string): T;\n\topenModal(key: string, data?: T): void;\n\tcloseModal(key: string): void;\n\tcloseAll(): void;\n};\n\ntype OpenedModals = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype ModalProviderProps = {\n\tchildren: ReactNode;\n\tenableModalAutomation?: boolean;\n};\n\nconst modalContext = createContext({} as ModalContextProps);\n\n/**\n * ModalProvider, context provider that manages open/close state and data for named modals.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useModal(key)` to open, close, or read data for a specific modal. `closeAll()` is also\n * available (used by `useAutomation` to close all modals after a successful form action).\n *\n * @param props.children - Components that will have access to modal context.\n *\n * @returns ModalProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ModalProvider>\n * <App />\n * </ModalProvider>\n *\n * // Opening a modal from anywhere in the tree\n * const { openModal } = useModal();\n * openModal('confirm-delete', { id: user.id });\n *\n * // Consuming in the modal component\n * const { modalIsOpen, modalData, closeModal } = useModal<{ id: number }>('confirm-delete');\n * ```\n */\n\nfunction ModalProvider(args: ModalProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedModals, setOpenedModals] = useState<OpenedModals>([]);\n\n\tconst modalIsOpen = useCallback(\n\t\t(key: string) => openedModals.some((modal) => modal.key === key),\n\t\t[openedModals],\n\t);\n\n\tconst modalData = useCallback(\n\t\t(key: string) => openedModals.find((modal) => modal.key === key)?.data,\n\t\t[openedModals],\n\t);\n\n\tconst openModal = useCallback(\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t(key: string, data?: any) => {\n\t\t\tsetOpenedModals((old) => {\n\t\t\t\tconst filtered = old.filter((modal) => modal.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst closeModal = useCallback((key: string) => {\n\t\tsetOpenedModals((old) => old.filter((modal) => modal.key !== key));\n\t}, []);\n\n\tconst closeAll = useCallback(() => {\n\t\tsetOpenedModals([]);\n\t}, []);\n\n\tconst value = useMemo(\n\t\t() => ({ modalIsOpen, modalData, openModal, closeModal, closeAll }),\n\t\t[modalIsOpen, modalData, openModal, closeModal, closeAll],\n\t);\n\n\treturn (\n\t\t<modalContext.Provider value={value}>{children}</modalContext.Provider>\n\t);\n}\n\nexport { type ModalContextProps, ModalProvider, modalContext };\n","import { useContext } from \"react\";\nimport {\n\ttype ModalContextProps,\n\tmodalContext,\n} from \"../providers/modalProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenModalProps<T = any> = (data?: T) => void;\n\n/**\n * useModal, accesses the nearest `ModalProvider` context.\n *\n * Two call signatures:\n * - **Without `key`**, returns the raw context object (manage any modal by name).\n * - **With `key`**, returns a scoped object bound to one named modal.\n *\n * @param key - Modal identifier registered in `ModalProvider`.\n *\n * @returns Without key: full `ModalContextProps`. With key: `{ modalIsOpen, modalData, openModal, closeModal }`.\n *\n * @throws If called outside a `ModalProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one modal, the most common pattern\n * const { modalIsOpen, modalData, openModal, closeModal } = useModal<{ id: number }>('confirm-delete');\n *\n * openModal({ id: user.id });\n * ```\n *\n * @example\n * ```tsx\n * // Full context, useful when triggering multiple different modals from one place\n * const { openModal } = useModal();\n *\n * openModal('confirm-delete', { id: user.id });\n * openModal('user-details', { id: user.id });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(): ModalContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(\n\tkey: string,\n): {\n\tmodalIsOpen: boolean;\n\tmodalData: T;\n\topenModal: OpenModalProps<T>;\n\tcloseModal: () => void;\n};\n\nfunction useModal(key?: string) {\n\tconst contextData = useContext(modalContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useModal must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tmodalData: contextModalData,\n\t\t\tmodalIsOpen: contextModalIsOpen,\n\t\t\topenModal: contextOpenModal,\n\t\t\tcloseModal: contextCloseModal,\n\t\t} = contextData;\n\n\t\tconst modalIsOpen = contextModalIsOpen(key);\n\t\tconst modalData = contextModalData(key);\n\n\t\tconst openModal: OpenModalProps = (data) => contextOpenModal(key, data);\n\t\tconst closeModal = () => contextCloseModal(key);\n\n\t\treturn { modalIsOpen, modalData, openModal, closeModal };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useModal };\n","import { createContext, type ReactNode, useMemo } from \"react\";\nimport toast, { Toaster } from \"react-hot-toast\";\n\ntype ToastProps = {\n\tmessage: string;\n\ttype: \"success\" | \"danger\";\n};\n\ntype ToastContextProps = {\n\tshowToast(toast: ToastProps): void;\n};\n\ntype ToastProviderProps = {\n\tchildren: ReactNode;\n};\n\nconst toastContext = createContext({} as ToastContextProps);\n\nfunction showToast(props: ToastProps) {\n\tswitch (props.type) {\n\t\tcase \"success\":\n\t\t\treturn toast.success(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#10B981\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#059669\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t\tcase \"danger\":\n\t\t\treturn toast.error(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#E11D48\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#BE123C\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n\n/**\n * ToastProvider, mounts a `react-hot-toast` `<Toaster>` and exposes `showToast` via context.\n *\n * Wrap your app once. Then call `useToast()` anywhere in the tree to show notifications.\n * Supports two types: `\"success\"` (green) and `\"danger\"` (red).\n *\n * @param props.children - App subtree that will have access to `useToast`.\n *\n * @returns ToastProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n *\n * // Anywhere in the tree\n * const { showToast } = useToast();\n * showToast({ message: \"Order placed!\", type: \"success\" });\n * ```\n */\n\nfunction ToastProvider({ children }: ToastProviderProps) {\n\tconst value = useMemo(() => ({ showToast }), []);\n\n\treturn (\n\t\t<toastContext.Provider value={value}>\n\t\t\t<Toaster\n\t\t\t\tposition=\"top-right\"\n\t\t\t\tcontainerStyle={{ zIndex: 999999999999999 }}\n\t\t\t/>\n\t\t\t{children}\n\t\t</toastContext.Provider>\n\t);\n}\n\nexport { ToastProvider, toastContext };\n","import { useContext } from \"react\";\nimport { toastContext } from \"../providers/toastProvider\";\n\n/**\n * useToast, reads `ToastProvider` context to display toast notifications.\n *\n * @returns Context containing `showToast(options)`.\n *\n * @throws If called outside a `ToastProvider`.\n *\n * @example\n * ```tsx\n * const { showToast } = useToast();\n *\n * // After a successful save\n * showToast({ message: \"Changes saved!\", type: \"success\" });\n *\n * // After a failed request\n * showToast({ message: \"Failed to save changes.\", type: \"danger\" });\n * ```\n */\n\nfunction useToast() {\n\tconst contextData = useContext(toastContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useToast must be used within a Provider\");\n\t}\n\n\treturn contextData;\n}\n\nexport { useToast };\n","import { useCallback, useEffect } from \"react\";\nimport { scroller } from \"react-scroll\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useAutomation, runs UI side-effects (close modals, scroll, toast) in response to a server action payload.\n *\n * Pass the raw response from a form submission. On every change the hook:\n * 1. Closes all open modals if `closeModal` is `true`.\n * 2. Smooth-scrolls to a named element if `cause.data.scrollTo` is set.\n * 3. Shows a toast based on `name` (matched against `successResponses`/`badResponses`) and `message`.\n * When `cause.fieldErrors` is present, the first field error takes priority in the toast.\n * The message `\"Unprocessable entity\"` is intentionally suppressed.\n *\n * @param formResponseData - Raw server response payload.\n * @param formResponseData.closeModal - Closes all open modals when `true`.\n * @param formResponseData.name - Response identifier matched against success/bad response lists.\n * @param formResponseData.message - Text shown in the toast notification.\n * @param formResponseData.cause.data.scrollTo - Element name to scroll to via `react-scroll`.\n * @param formResponseData.cause.fieldErrors - Field-level errors; the first value is shown in the toast.\n *\n * @example\n * ```tsx\n * // After a successful create action\n * useAutomation({ closeModal: true, name: \"created\", message: \"Saved successfully\" });\n * ```\n *\n * @example\n * ```tsx\n * // Validation error with field-level feedback and scroll\n * useAutomation({\n * name: \"validation_error\",\n * message: \"Invalid payload\",\n * cause: {\n * data: { scrollTo: \"email\" },\n * fieldErrors: { email: \"E-mail is required\" },\n * },\n * });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useAutomation(formResponseData: any) {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst closeModal = formResponseData?.closeModal;\n\tconst message = formResponseData?.message;\n\tconst name = formResponseData?.name;\n\tconst scrollTo = formResponseData?.cause?.data?.scrollTo;\n\tconst firstErrorField = formResponseData?.cause?.fieldErrors\n\t\t? (Object.values(formResponseData?.cause?.fieldErrors)[0] as string)\n\t\t: null;\n\n\tconst fireToast = useCallback(() => {\n\t\tif (!message && !firstErrorField) return;\n\n\t\tif (successResponses.includes(name))\n\t\t\treturn showToast({ message, type: \"success\" });\n\n\t\tif (!badResponses.includes(name)) return;\n\t\tif (firstErrorField)\n\t\t\treturn showToast({ message: firstErrorField, type: \"danger\" });\n\n\t\tif (message === \"Unprocessable entity\") return;\n\t\treturn showToast({ message, type: \"danger\" });\n\t}, [message, firstErrorField, name, showToast]);\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (scrollTo) scroller.scrollTo(scrollTo, { smooth: true, offset: 20 });\n\t\tfireToast();\n\t}, [closeModal, scrollTo, fireToast, closeAll]);\n}\n\nexport { useAutomation };\n","import { createContext, type ReactNode, useState } from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype DrawerContextProps<T = any> = {\n\tdrawerIsOpen(key: string): boolean;\n\tdrawerData(key: string): T;\n\topenDrawer(key: string, data?: T): void;\n\tcloseDrawer(key: string): void;\n};\n\ntype OpenedDrawers = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype DrawerProviderProps = {\n\tchildren: ReactNode;\n\tenableDrawerAutomation?: boolean;\n};\n\nconst drawerContext = createContext({} as DrawerContextProps);\n\n/**\n * DrawerProvider, context provider that manages open/close state and data for named drawers.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useDrawer(key)` to open, close, or read data for a specific drawer.\n *\n * @param props.children - Components that will have access to drawer context.\n *\n * @returns DrawerProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <DrawerProvider>\n * <App />\n * </DrawerProvider>\n *\n * // Opening a drawer from anywhere in the tree\n * const { openDrawer } = useDrawer();\n * openDrawer('filters', { category: 'electronics' });\n *\n * // Consuming in the drawer component\n * const { drawerIsOpen, drawerData, closeDrawer } = useDrawer<{ category: string }>('filters');\n * ```\n */\n\nfunction DrawerProvider(args: DrawerProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedDrawers, setOpenedDrawers] = useState<OpenedDrawers>([]);\n\n\tfunction drawerIsOpen(key: string) {\n\t\treturn !!openedDrawers.some((drawer) => drawer.key === key);\n\t}\n\n\tfunction drawerData(key: string) {\n\t\treturn openedDrawers.find((drawer) => drawer.key === key)?.data;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction openDrawer(key: string, data?: any) {\n\t\tconst alreadyExist = drawerIsOpen(key);\n\t\tif (alreadyExist) {\n\t\t\tsetOpenedDrawers((old) => {\n\t\t\t\tconst filtered = old.filter((drawer) => drawer.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t} else setOpenedDrawers([...openedDrawers, { key, data }]);\n\t}\n\n\tfunction closeDrawer(key: string) {\n\t\tsetOpenedDrawers(openedDrawers.filter((drawer) => drawer.key !== key));\n\t}\n\n\treturn (\n\t\t<drawerContext.Provider\n\t\t\tvalue={{ drawerIsOpen, drawerData, openDrawer, closeDrawer }}\n\t\t>\n\t\t\t{children}\n\t\t</drawerContext.Provider>\n\t);\n}\n\nexport { type DrawerContextProps, DrawerProvider, drawerContext };\n","import { useContext } from \"react\";\nimport {\n\ttype DrawerContextProps,\n\tdrawerContext,\n} from \"../providers/drawerProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenDrawerProps<T = any> = (data?: T) => void;\n\n/**\n * useDrawer, accesses the nearest `DrawerProvider` context.\n *\n * Two call signatures:\n * - **Without `key`**, returns the raw context object (manage any drawer by name).\n * - **With `key`**, returns a scoped object bound to one named drawer.\n *\n * @param key - Drawer identifier registered in `DrawerProvider`.\n *\n * @returns Without key: full `DrawerContextProps`. With key: `{ drawerIsOpen, drawerData, openDrawer, closeDrawer }`.\n *\n * @throws If called outside a `DrawerProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one drawer, the most common pattern\n * const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer<{ section: string }>('navigation');\n *\n * openDrawer({ section: 'products' });\n * ```\n *\n * @example\n * ```tsx\n * // Full context, useful when triggering multiple different drawers from one place\n * const { openDrawer } = useDrawer();\n *\n * openDrawer('navigation', { section: 'main' });\n * openDrawer('filters', { category: 'electronics' });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(): DrawerContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(\n\tkey: string,\n): {\n\tdrawerIsOpen: boolean;\n\tdrawerData: T;\n\topenDrawer: OpenDrawerProps<T>;\n\tcloseDrawer: () => void;\n};\n\nfunction useDrawer(key?: string) {\n\tconst contextData = useContext(drawerContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useDrawer must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tdrawerData: contextDrawerData,\n\t\t\tdrawerIsOpen: contextDrawerIsOpen,\n\t\t\topenDrawer: contextOpenDrawer,\n\t\t\tcloseDrawer: contextCloseDrawer,\n\t\t} = contextData;\n\n\t\tconst drawerIsOpen = contextDrawerIsOpen(key);\n\t\tconst drawerData = contextDrawerData(key);\n\n\t\tconst openDrawer: OpenDrawerProps = (data) => contextOpenDrawer(key, data);\n\t\tconst closeDrawer = () => contextCloseDrawer(key);\n\n\t\treturn { drawerIsOpen, drawerData, openDrawer, closeDrawer };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useDrawer };\n","type ParamsType = Record<string, string | number | boolean | undefined>;\n\n/**\n * useScopedParams, reads and writes URL search parameters with an optional namespace prefix.\n *\n * When `scope` is provided, every key is namespaced as `scope:key`, so multiple features\n * can share the same URL without collisions (e.g. `filters:status` and `table:page`).\n *\n * @param searchString - Current URL search string (e.g. `location.search`).\n * @param scope - Namespace prefix. Default: `\"\"` (no prefix).\n *\n * @returns\n * - `getParam(key)`, returns the (scoped) param value, or `null` if absent.\n * - `getScopedSearch(params)`, merges `params` into the existing search string and returns the result.\n * Pass `undefined` as a value to delete that param.\n *\n * @example\n * ```tsx\n * // Without scope, plain key/value params\n * const { getParam, getScopedSearch } = useScopedParams(location.search);\n * getParam('page'); // \"1\"\n * getScopedSearch({ page: 2, sort: 'name' }); // \"?page=2&sort=name\"\n * ```\n *\n * @example\n * ```tsx\n * // With scope, all keys prefixed as \"filters:key\"\n * const { getParam, getScopedSearch } = useScopedParams(location.search, 'filters');\n * getParam('status'); // reads \"filters:status\"\n * getScopedSearch({ status: 'active', category: undefined }); // removes \"filters:category\"\n * ```\n */\n\nfunction useScopedParams(searchString: string, scope: string = \"\") {\n\tconst searchParams = new URLSearchParams(searchString);\n\tconst prefix = scope ? `${scope}:` : \"\";\n\n\tconst updateSearchParams = (params: ParamsType) => {\n\t\tObject.entries(params).forEach(([key, value]) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsearchParams.delete(`${prefix}${key}`);\n\t\t\t} else {\n\t\t\t\tsearchParams.set(`${prefix}${key}`, String(value));\n\t\t\t}\n\t\t});\n\t};\n\n\treturn {\n\t\tgetParam: (key: string) => searchParams.get(`${prefix}${key}`),\n\t\tgetScopedSearch: (params: ParamsType) => {\n\t\t\tupdateSearchParams(params);\n\t\t\tlet search = searchParams.toString();\n\t\t\tif (search) search = `?${search}`;\n\t\t\treturn search;\n\t\t},\n\t};\n}\n\nexport { useScopedParams };\n","import { useEffect } from \"react\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useScopedParams } from \"./useScopedParams\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useSearchAutomation, URL-driven version of `useAutomation`. Reads automation params from a\n * URL search string and executes the same side-effects (close modals, toast) on every change.\n *\n * Reads the following params (optionally prefixed by `scope:`):\n * - `closeModal=true`, closes all open modals.\n * - `message`, text for the toast notification.\n * - `type`, `\"success\"` or `\"danger\"` toast style.\n * - `name`, response identifier matched against `successResponses`/`badResponses` lists.\n *\n * @param searchString - Raw URL search string (e.g. `location.search`).\n * @param scope - Optional prefix for all params. Default: `\"\"` (no prefix).\n *\n * @example\n * ```tsx\n * // Remix / Next.js Server Action that redirects with search params\n * // redirect(\"?closeModal=true&message=Saved!&type=success\")\n * const [searchParams] = useSearchParams();\n * useSearchAutomation(searchParams.toString());\n * ```\n *\n * @example\n * ```tsx\n * // Scoped params, avoids collisions when multiple features share the URL\n * // redirect(\"?filters:closeModal=true&filters:message=Applied!&filters:type=success\")\n * useSearchAutomation(location.search, \"filters\");\n * ```\n */\n\nfunction useSearchAutomation(searchString: string, scope: string = \"\") {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst { getParam } = useScopedParams(searchString, scope);\n\n\tconst closeModal = getParam(\"closeModal\") === \"true\";\n\tconst message = getParam(\"message\");\n\tconst name = getParam(\"name\");\n\tconst type = getParam(\"type\") as \"success\" | \"danger\" | null;\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (message) {\n\t\t\tif (type === \"success\") showToast({ message, type: \"success\" });\n\t\t\tif (type === \"danger\") showToast({ message, type: \"danger\" });\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tbadResponses.includes(name) &&\n\t\t\t\t!badResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"danger\" });\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tsuccessResponses.includes(name) &&\n\t\t\t\t!successResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"success\" });\n\t\t\t}\n\t\t}\n\t}, [closeModal, message, name, type, showToast, closeAll]);\n}\n\nexport { useSearchAutomation };\n","import { useLoadScript } from \"@react-google-maps/api\";\nimport type { ReactNode } from \"react\";\n\nconst libraries: (\"places\" | \"marker\" | \"maps\")[] = [\n\t\"places\",\n\t\"marker\",\n\t\"maps\",\n];\n\ntype PlacesProviderProps = {\n\tapiKey: string;\n\tchildren: (isLoaded: boolean) => ReactNode;\n\tpreventFontsLoading?: boolean;\n};\n\n/**\n * PlacesProvider, loads the Google Maps JS API with `places`, `marker`, and `maps` libraries.\n *\n * Uses a render-prop pattern: `children` receives `isLoaded` so you can defer rendering\n * `SearchPlaces` or `MapView` until the script is ready.\n *\n * @param props.apiKey - Google Maps API key. Required.\n * @param props.children - Render function: `(isLoaded: boolean) => ReactNode`.\n * @param props.preventFontsLoading - Prevents Google Fonts from being injected by the Maps SDK. @default true\n *\n * @returns The result of calling `children(isLoaded)`.\n *\n * @example\n * ```tsx\n * <PlacesProvider apiKey={env.GOOGLE_MAPS_KEY}>\n * {(isLoaded) => (\n * isLoaded\n * ? <SearchPlaces apiKey={env.GOOGLE_MAPS_KEY} onSelect={setAddress} />\n * : <Skeleton />\n * )}\n * </PlacesProvider>\n * ```\n */\n\nfunction PlacesProvider(props: PlacesProviderProps) {\n\tconst { apiKey, children, preventFontsLoading = true } = props;\n\n\tconst { isLoaded } = useLoadScript({\n\t\tgoogleMapsApiKey: apiKey,\n\t\tlibraries,\n\t\tpreventGoogleFontsLoading: preventFontsLoading,\n\t});\n\n\treturn <>{children(isLoaded)}</>;\n}\n\nexport { PlacesProvider };\n","import { Element, Text } from \"slate\";\nimport type { ParseElement } from \"../types/richTextTypes\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction serialize(node: any): string {\n\tif (Text.isText(node)) {\n\t\tlet text = node?.text;\n\t\tif (node?.bold) {\n\t\t\ttext = `<strong>${text}</strong>`;\n\t\t}\n\t\tif (node?.code) {\n\t\t\ttext = `<code>${text}</code>`;\n\t\t}\n\t\tif (node?.italic) {\n\t\t\ttext = `<em>${text}</em>`;\n\t\t}\n\t\tif (node?.underline) {\n\t\t\ttext = `<u>${text}</u>`;\n\t\t}\n\t\tif (node?.link) {\n\t\t\ttext = `<a href=\"${node.href}\">${text}</a>`;\n\t\t}\n\t\treturn text;\n\t}\n\n\tif (Element.isElement(node)) {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tconst children = node.children?.map((n: any) => serialize(n)).join(\"\");\n\t\tconst alignStyle = node.align || \"left\";\n\n\t\tswitch (node.type) {\n\t\t\tcase \"video\":\n\t\t\t\treturn `<iframe src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"image\":\n\t\t\t\treturn `<img src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"paragraph\":\n\t\t\t\treturn `<p class=\"align_${alignStyle}\">${children}</p>`;\n\t\t\tcase \"blockQuote\":\n\t\t\t\treturn `<blockquote class=\"align_${alignStyle}\">${children}</blockquote>`;\n\t\t\tcase \"bulletedList\":\n\t\t\t\treturn `<ul class=\"align_${alignStyle}\">${children}</ul>`;\n\t\t\tcase \"headingOne\":\n\t\t\t\treturn `<h1 class=\"align_${alignStyle}\">${children}</h1>`;\n\t\t\tcase \"headingTwo\":\n\t\t\t\treturn `<h2 class=\"align_${alignStyle}\">${children}</h2>`;\n\t\t\tcase \"listItem\":\n\t\t\t\treturn `<li class=\"align_${alignStyle}\">${children}</li>`;\n\t\t\tcase \"numberedList\":\n\t\t\t\treturn `<ol class=\"align_${alignStyle}\">${children}</ol>`;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t}\n\n\treturn \"\";\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction deserialize(el: ParseElement): any {\n\tif (typeof el === \"string\") {\n\t\treturn { text: el };\n\t}\n\n\tconst rawChildren = el.props.children;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tlet children: any[];\n\tif (Array.isArray(rawChildren)) {\n\t\tchildren = rawChildren.map((child) => deserialize(child));\n\t} else if (typeof rawChildren === \"string\" || !rawChildren) {\n\t\tchildren = [{ text: rawChildren || \"\" }];\n\t} else {\n\t\tchildren = [deserialize(rawChildren)];\n\t}\n\n\tconst align = el.props.className?.replace(\"align_\", \"\") as\n\t\t| \"left\"\n\t\t| \"center\"\n\t\t| \"right\"\n\t\t| \"justify\";\n\n\tswitch (el.type) {\n\t\tcase \"img\":\n\t\t\treturn {\n\t\t\t\ttype: \"image\",\n\t\t\t\talign,\n\t\t\t\tsrc: el.props.src,\n\t\t\t\tchildren: [{ text: \"\" }],\n\t\t\t};\n\t\tcase \"p\":\n\t\t\treturn { type: \"paragraph\", align, children };\n\t\tcase \"blockquote\":\n\t\t\treturn { type: \"blockQuote\", align, children };\n\t\tcase \"ul\":\n\t\t\treturn { type: \"bulletedList\", align, children };\n\t\tcase \"ol\":\n\t\t\treturn { type: \"numberedList\", align, children };\n\t\tcase \"li\":\n\t\t\treturn { type: \"listItem\", align, children };\n\t\tcase \"h1\":\n\t\t\treturn { type: \"headingOne\", align, children };\n\t\tcase \"h2\":\n\t\t\treturn { type: \"headingTwo\", align, children };\n\t\tcase \"strong\":\n\t\t\treturn { text: el.props.children, bold: true };\n\t\tcase \"code\":\n\t\t\treturn { text: el.props.children, code: true };\n\t\tcase \"em\":\n\t\t\treturn { text: el.props.children, italic: true };\n\t\tcase \"u\":\n\t\t\treturn { text: el.props.children, underline: true };\n\t\tcase \"a\":\n\t\t\treturn { text: el.props.children, link: true, href: el.props.href };\n\t\tdefault:\n\t\t\treturn { text: el.props.children || \"\" };\n\t}\n}\n\nexport { deserialize, serialize };\n","import type { RichTextValue } from \"../types/richTextTypes\";\nimport { serialize } from \"../utils/richTextUtilities\";\n\n/**\n * toHtml, converts a `RichTextValue` (Slate.js Descendant array) to an HTML string.\n *\n * Use this to persist or display the editor's content as plain HTML.\n *\n * @param richTextValue - The value from a `RichText` component's `onChange` callback.\n * @returns HTML string representation of the rich text content.\n *\n * @example\n * ```tsx\n * const [content, setContent] = useState<RichTextValue>([]);\n *\n * // On form submit, convert to HTML for storage\n * const html = toHtml(content);\n * // e.g. \"<p><strong>Hello world</strong></p>\"\n * ```\n */\n\nfunction toHtml(richTextValue: RichTextValue): string {\n\treturn richTextValue.map((node) => serialize(node)).join(\"\");\n}\n\nexport { toHtml };\n","import parse from \"html-react-parser\";\n\nimport type { ParseElement, RichTextValue } from \"../types/richTextTypes\";\nimport { deserialize } from \"../utils/richTextUtilities\";\n\n/**\n * toRichTextValue, converts an HTML string to a `RichTextValue` (Slate.js Descendant array).\n *\n * Use this to populate a `RichText` editor with content previously stored as HTML\n * (e.g. loaded from a database).\n *\n * @param html - HTML string to convert.\n * @returns Slate.js Descendant array ready to pass to `RichText`'s `defaultValue` prop.\n *\n * @example\n * ```tsx\n * // Load stored HTML into the editor\n * const defaultValue = toRichTextValue(product.description);\n * // e.g. [{ type: 'paragraph', children: [{ text: 'Hello', bold: true }] }]\n *\n * <RichText name=\"description\" defaultValue={defaultValue} />\n * ```\n */\n\nfunction toRichTextValue(html: string): RichTextValue {\n\tconst parsed = parse(html);\n\n\tif (Array.isArray(parsed)) {\n\t\treturn parsed.map((node) => {\n\t\t\tif (typeof node === \"string\") return { text: node };\n\t\t\treturn deserialize(node as ParseElement);\n\t\t});\n\t}\n\n\tif (typeof parsed === \"string\") return [{ text: parsed }];\n\treturn [deserialize(parsed as ParseElement)];\n}\n\nexport { toRichTextValue };\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,SAAS,GAAW,GAAqC;CACxD,IAAM,EAAE,WAAW,GAAe,GAAG,MAAS;CAG9C,OAAO,kBAAC,OAAD;EAAK,WAAW,mBAFc,IAEJ,KAAK;EAAG,GAAI;CAAO,CAAA;AACrD;;;ACPA,IAAM,KAAwB,EAAc,CAAC,CAAwB;AAGrE,SAAS,KAAyC;CACjD,OAAO,EAAW,EAAqB;AACxC;AAkCA,SAAS,GAAe,GAAyC;CAChE,IAAM,EAAE,WAAQ,aAAU,WAAW,GAAe,GAAG,MAAS,GA8B1D,IAAY,uBAAuB,EAAO,KA5BzB,MAAiC;EACvD,IAAI,IAAQ,IACN,KAAuB,MAAqB;GACjD,AAAI,MAAM,QAAQ,CAAK,IACtB,EAAM,QAAQ,CAAmB,IACvB,KAAS,OAAO,KAAU,YAAY,UAAU,MACtD,EAAM,SAAS,KAClB,IAAQ,KAER,EAAM,SACN,OAAO,EAAM,SAAU,YACvB,EAAM,UAAU,QAChB,cAAc,EAAM,SAGpB,EAAqB,EAAM,MAAc,QAAQ;EAGpD;EAEA,OADA,EAAoB,C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5D;;;ACCA,SAAS,GAAgB,GAA6B;CACrD,IAAM,IAAS,GAAM,CAAI;CAUzB,OARI,MAAM,QAAQ,CAAM,IAChB,EAAO,KAAK,MACd,OAAO,KAAS,WAAiB,EAAE,MAAM,EAAK,IAC3C,GAAY,CAAoB,CACvC,IAGE,OAAO,KAAW,WAAiB,CAAC,EAAE,MAAM,EAAO,CAAC,IACjD,CAAC,GAAY,CAAsB,CAAC;AAC5C"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/components/alert/alertTitle/index.tsx","../src/components/alert/alertContainer/index.tsx","../src/components/alert/alertContent/index.tsx","../src/components/alert/alertDescription/index.tsx","../src/components/alert/alertIcon/index.tsx","../src/hooks/useSlider.ts","../src/components/slider/index.tsx","../src/components/audioPlayer/index.tsx","../src/providers/formProvider.tsx","../src/hooks/useForm.ts","../src/components/fieldError/index.tsx","../src/components/fieldLabel/index.tsx","../src/components/fieldWrapper/index.tsx","../src/services/iconRenderer.tsx","../src/components/button/index.tsx","../src/components/divider/index.tsx","../src/components/iconButton/index.tsx","../src/components/tooltip/index.tsx","../src/components/audioUpload/hasFileContent/index.tsx","../src/components/audioUpload/noFileContent/index.tsx","../src/components/audioUpload/index.tsx","../src/components/badge/index.tsx","../src/components/calendar/_viewService.ts","../src/components/calendar/_calendarProvider.tsx","../src/components/calendar/calendarContainer/index.tsx","../src/services/fieldTemplate.tsx","../src/components/select/selectChevron/index.tsx","../src/components/select/selectContainer/index.tsx","../src/components/select/selectContent/index.tsx","../src/components/select/selectOption/index.tsx","../src/hooks/useScrollLock.ts","../src/components/input/index.tsx","../src/components/select/selectOptionsContainer/index.tsx","../src/components/select/selectOverlay/index.tsx","../src/components/select/selectSpinner/index.tsx","../src/components/select/index.tsx","../src/components/calendar/calendarHeader/index.tsx","../src/components/calendar/calendarTableTd/index.tsx","../src/components/calendar/calendarTableBody/index.tsx","../src/components/calendar/calendarTableContainer/index.tsx","../src/components/calendar/calendarTableHeader/index.tsx","../src/components/calendar/index.tsx","../src/components/cardTab/cardTabContext.tsx","../src/components/cardTab/cardTabButton/index.tsx","../src/components/cardTab/cardTabContainer/index.tsx","../src/components/checkbox/index.tsx","../src/hooks/useHydrated.ts","../src/components/clientOnly.tsx","../src/services/maskCurrencyValues.ts","../src/components/currencyInput/index.tsx","../src/components/datePicker/datePickerCalendarContainer/index.tsx","../src/components/datePicker/datePickerChevron/index.tsx","../src/components/datePicker/datePickerContainer/index.tsx","../src/components/datePicker/datePickerContent/index.tsx","../src/components/datePicker/datePickerOverlay/index.tsx","../src/components/datePicker/datePickerSpinner/index.tsx","../src/components/datePicker/index.tsx","../src/components/drawer/drawerContext.tsx","../src/components/drawer/drawerContainer/index.tsx","../src/components/drawer/drawerHeader/index.tsx","../src/components/facebookPixel/pixel.ts","../src/components/facebookPixel/facebookPixel.client.tsx","../src/components/facebookPixel/index.tsx","../src/components/fileUpload/hasFileContent/index.tsx","../src/components/fileUpload/noFileContent/index.tsx","../src/components/fileUpload/index.tsx","../src/components/fullCalendar/_viewService.ts","../src/components/fullCalendar/_fullCalendarProvider.tsx","../src/components/fullCalendar/dayCalendar/dayCalendarContainer/index.tsx","../src/components/fullCalendar/dayCalendar/dayCalendarEvent/index.tsx","../src/components/fullCalendar/dayCalendar/dayCalendarRow/index.tsx","../src/components/fullCalendar/dayCalendar/index.tsx","../src/components/fullCalendar/fullCalendarContainer/index.tsx","../src/components/fullCalendar/fullCalendarHeader/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarEvent/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableTd/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableBody/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableContainer/index.tsx","../src/components/fullCalendar/monthlyCalendar/monthlyCalendarTableHeader/index.tsx","../src/components/fullCalendar/monthlyCalendar/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarEvent/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableTd/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableBody/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableContainer/index.tsx","../src/components/fullCalendar/weekCalendar/weekCalendarTableHeader/index.tsx","../src/components/fullCalendar/weekCalendar/index.tsx","../src/components/fullCalendar/index.tsx","../src/components/googleAnalytics/snippets/generateGAElements.ts","../src/components/googleAnalytics/googleAnalytics.tsx","../src/components/googleAnalytics/googleAnalytics.client.tsx","../src/components/googleAnalytics/index.tsx","../src/components/googleTagManager/snippets/appendToDataLayer.ts","../src/components/googleTagManager/snippets/generateGTMElements.ts","../src/components/googleTagManager/googleTagManager.tsx","../src/components/googleTagManager/googleTagManager.client.tsx","../src/components/googleTagManager/index.tsx","../src/components/imageUpload/hasFileContent/index.tsx","../src/components/imageUpload/noFileContent/index.tsx","../src/components/imageUpload/index.tsx","../src/components/mapView/mapView.client.tsx","../src/components/mapView/index.tsx","../src/components/maskedInput/index.tsx","../src/components/modal/modalContext.tsx","../src/components/modal/modalContainer/index.tsx","../src/components/modal/modalFooter/index.tsx","../src/components/modal/modalHeader/index.tsx","../src/components/multiSelect/multiSelectChevron/index.tsx","../src/components/multiSelect/multiSelectContainer/index.tsx","../src/components/multiSelect/multiSelectContent/index.tsx","../src/components/multiSelect/multiSelectMark/index.tsx","../src/components/multiSelect/multiSelectOption/index.tsx","../src/components/multiSelect/multiSelectOptionsContainer/index.tsx","../src/components/multiSelect/multiSelectOverlay/index.tsx","../src/components/multiSelect/multiSelectSpinner/index.tsx","../src/components/multiSelect/index.tsx","../src/components/pagination/chevronButton/index.tsx","../src/components/pagination/currentButton/index.tsx","../src/components/pagination/pageButton/index.tsx","../src/components/pagination/paginationService.ts","../src/components/pagination/spread/index.tsx","../src/components/pagination/index.tsx","../src/utils/phoneInputUtilities.ts","../src/components/phoneInput/phoneInputContainer/index.tsx","../src/components/phoneInput/phoneInputCountriesOverlay/index.tsx","../src/components/phoneInput/phoneInputCountryOption/index.tsx","../src/components/phoneInput/phoneInputCountryOptionsContainer/index.tsx","../src/components/phoneInput/phoneInputCountrySelector/index.tsx","../src/components/phoneInput/phoneInputMask/index.tsx","../src/components/phoneInput/index.tsx","../src/components/popover/index.tsx","../src/components/radio/radioContext.tsx","../src/components/radio/radioBox/index.tsx","../src/components/radio/radioGroup/index.tsx","../src/services/clearLinkMarkAtBoundary.ts","../src/services/extractTextFromNode.ts","../src/services/isMarkActive.ts","../src/services/toggleMark.ts","../src/templates/richTextTemplates.ts","../src/services/isBlockActive.ts","../src/services/toggleBlock.ts","../src/components/richText/blockButton/index.tsx","../src/components/richText/element/index.tsx","../src/components/tab/tabContext.tsx","../src/components/tab/tabButton/index.tsx","../src/components/tab/tabContainer/index.tsx","../src/components/richText/insertImage/index.tsx","../src/services/isValidHttpsUrl.ts","../src/components/richText/insertLink/index.tsx","../src/components/richText/insertVideo/index.tsx","../src/components/richText/leaf/index.tsx","../src/components/richText/markButton/index.tsx","../src/components/richText/toolbar/index.tsx","../src/components/richText/index.tsx","../src/components/searchPlaces.tsx","../src/components/switch/index.tsx","../src/components/table/tableBody/index.tsx","../src/components/table/tableCaption/index.tsx","../src/components/table/tableContainer/index.tsx","../src/components/table/tableFooter/index.tsx","../src/components/table/tableHeader/index.tsx","../src/components/textarea/index.tsx","../src/templates/badResponses.ts","../src/templates/successResponses.ts","../src/providers/modalProvider.tsx","../src/hooks/useModal.ts","../src/providers/toastProvider.tsx","../src/hooks/useToast.ts","../src/hooks/useAutomation.ts","../src/hooks/useCopyToClipboard.ts","../src/providers/drawerProvider.tsx","../src/hooks/useDrawer.ts","../src/hooks/useScopedParams.ts","../src/hooks/useSearchAutomation.ts","../src/providers/placesProvider.tsx","../src/utils/richTextUtilities.ts","../src/services/toHtml.ts","../src/services/toRichTextValue.ts"],"sourcesContent":["import type { HTMLAttributes, JSX } from \"react\";\nimport \"./styles.css\";\n\ntype AlertTitleProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * AlertTitle, bold heading for an alert. Place inside `AlertContent`.\n *\n * Its presence is detected by `AlertContainer` to switch the layout from centered to left-aligned.\n * Accepts all standard `<div>` HTML attributes.\n *\n * @returns AlertTitle JSX element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"danger\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Access denied</AlertTitle>\n * <AlertDescription>You don't have permission to view this page.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\nfunction AlertTitle(props: AlertTitleProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst className = `arkynAlertTitle ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { AlertTitle };\n","import {\n\tcreateContext,\n\ttype HTMLAttributes,\n\ttype JSX,\n\ttype ReactNode,\n\tuseContext,\n\tuseMemo,\n} from \"react\";\nimport { AlertTitle } from \"../alertTitle\";\nimport \"./styles.css\";\n\ntype AlertContainerProps = {\n\t/**\n\t * Visual style and semantic meaning.\n\t * - `success`: green, operation completed.\n\t * - `danger`: red, error or destructive action.\n\t * - `warning`: yellow, caution required.\n\t * - `info`: blue, informational message.\n\t */\n\tscheme: \"success\" | \"danger\" | \"warning\" | \"info\";\n} & HTMLAttributes<HTMLDivElement>;\n\nconst AlertContainerContext = createContext({} as AlertContainerProps);\n\n/** @internal Accesses the schema and HTML props of the enclosing `AlertContainer`. */\nfunction useAlertContainer(): AlertContainerProps {\n\treturn useContext(AlertContainerContext);\n}\n\n/**\n * AlertContainer, root wrapper for the Alert component set. Provides schema context to child components.\n *\n * Automatically detects whether an `AlertTitle` is present among children and adjusts layout:\n * centered when no title, left-aligned when a title is present.\n *\n * @param props.scheme - Visual style variant. Required.\n * @param props.children - Alert sub-components: `AlertIcon`, `AlertContent`, `AlertTitle`, `AlertDescription`.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns AlertContainer JSX element.\n *\n * @example\n * ```tsx\n * // Inline alert, no title, centered layout\n * <AlertContainer scheme=\"success\">\n * <AlertIcon />\n * <AlertContent>Your subscription has been activated.</AlertContent>\n * </AlertContainer>\n *\n * // Full alert with title and description, left-aligned layout\n * <AlertContainer scheme=\"danger\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Payment failed</AlertTitle>\n * <AlertDescription>Please check your card details and try again.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\n\nfunction AlertContainer(props: AlertContainerProps): JSX.Element {\n\tconst { scheme, children, className: baseClassName, ...rest } = props;\n\n\tconst hasAlertTitle = (children: ReactNode): boolean => {\n\t\tlet found = false;\n\t\tconst searchForAlertTitle = (nodes: ReactNode) => {\n\t\t\tif (Array.isArray(nodes)) {\n\t\t\t\tnodes.forEach(searchForAlertTitle);\n\t\t\t} else if (nodes && typeof nodes === \"object\" && \"type\" in nodes) {\n\t\t\t\tif (nodes.type === AlertTitle) {\n\t\t\t\t\tfound = true;\n\t\t\t\t} else if (\n\t\t\t\t\tnodes.props &&\n\t\t\t\t\ttypeof nodes.props === \"object\" &&\n\t\t\t\t\tnodes.props !== null &&\n\t\t\t\t\t\"children\" in nodes.props\n\t\t\t\t) {\n\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t\t\t\tsearchForAlertTitle((nodes.props as any).children);\n\t\t\t\t}\n\t\t\t}\n\t\t};\n\t\tsearchForAlertTitle(children);\n\t\treturn found;\n\t};\n\n\tconst shouldAlignCenter = !hasAlertTitle(children);\n\tconst finalClassName = shouldAlignCenter\n\t\t? \"nonExistsAlertTitle\"\n\t\t: \"existsAlertTitle\";\n\n\tconst className = `arkynAlertContainer ${scheme} ${finalClassName} ${baseClassName}`;\n\n\tconst value = useMemo(() => ({ scheme }), [scheme]);\n\n\treturn (\n\t\t<AlertContainerContext.Provider value={value}>\n\t\t\t<div className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</div>\n\t\t</AlertContainerContext.Provider>\n\t);\n}\n\nexport { AlertContainer, useAlertContainer };\n","import type { HTMLAttributes, JSX } from \"react\";\nimport \"./styles.css\";\n\ntype AlertContentProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * AlertContent, text/content area inside an `AlertContainer`. Wraps `AlertTitle` and `AlertDescription`.\n *\n * Accepts all standard `<div>` HTML attributes.\n *\n * @returns AlertContent JSX element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"warning\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Session expiring</AlertTitle>\n * <AlertDescription>You will be logged out in 5 minutes.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\n\nfunction AlertContent(props: AlertContentProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst className = `arkynAlertContent ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { AlertContent };\n","import type { HTMLAttributes, JSX } from \"react\";\nimport \"./styles.css\";\n\ntype AlertDescriptionProps = HTMLAttributes<HTMLDivElement>;\n\n/**\n * AlertDescription, body text for an alert. Place inside `AlertContent`.\n *\n * Accepts all standard `<div>` HTML attributes.\n *\n * @returns AlertDescription JSX element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"info\">\n * <AlertContent>\n * <AlertTitle>Maintenance scheduled</AlertTitle>\n * <AlertDescription>The service will be unavailable on Sunday from 2–4 AM UTC.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\n\nfunction AlertDescription(props: AlertDescriptionProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst className = `arkynAlertDescription ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { AlertDescription };\n","import {\n\tAlertTriangle,\n\tCheckCircle2,\n\tInfo,\n\ttype LucideProps,\n\tXCircle,\n} from \"lucide-react\";\n\nimport type { JSX } from \"react\";\nimport { useAlertContainer } from \"../alertContainer\";\nimport \"./styles.css\";\n\ntype AlertIconProps = LucideProps;\n\n/**\n * AlertIcon, renders a scheme-appropriate icon from `AlertContainer` context.\n *\n * - `success` → `CheckCircle2`\n * - `danger` → `XCircle`\n * - `warning` → `AlertTriangle`\n * - `info` → `Info`\n *\n * Must be placed inside an `AlertContainer`. Accepts all Lucide icon props.\n *\n * @returns The scheme-matched Lucide icon element.\n *\n * @example\n * ```tsx\n * <AlertContainer scheme=\"danger\">\n * <AlertIcon />\n * <AlertContent>\n * <AlertTitle>Payment failed</AlertTitle>\n * <AlertDescription>Please check your card details.</AlertDescription>\n * </AlertContent>\n * </AlertContainer>\n * ```\n */\nfunction AlertIcon(props: AlertIconProps): JSX.Element {\n\tconst { className: baseClassName, ...rest } = props;\n\tconst { scheme } = useAlertContainer();\n\n\tconst className = `arkynAlertIcon ${scheme} ${baseClassName}`;\n\n\tswitch (scheme) {\n\t\tcase \"success\":\n\t\t\treturn <CheckCircle2 className={className} {...rest} />;\n\t\tcase \"danger\":\n\t\t\treturn <XCircle className={className} {...rest} />;\n\t\tcase \"warning\":\n\t\t\treturn <AlertTriangle className={className} {...rest} />;\n\t\tcase \"info\":\n\t\t\treturn <Info className={className} {...rest} />;\n\t}\n}\n\nexport { AlertIcon };\n","import { useState } from \"react\";\n\ntype UseSliderReturnProps = [number, (number: number) => void];\n\n/**\n * useSlider, state manager for the `Slider` component. Clamps values to `[0, 100]`.\n *\n * @param defaultValue - Initial percentage value (0–100). Default: 0\n *\n * @returns `[value, setValue]`, current percentage and a setter that clamps at the boundaries.\n *\n * @example\n * ```tsx\n * const [volume, setVolume] = useSlider(50);\n * return <Slider value={volume} onChange={setVolume} />;\n * ```\n */\n\nfunction useSlider(defaultValue?: number): UseSliderReturnProps {\n\tfunction getDefaultValue() {\n\t\tif (!defaultValue) return 0;\n\t\tif (defaultValue <= 0) return 0;\n\t\tif (defaultValue >= 100) return 100;\n\t\treturn defaultValue;\n\t}\n\n\tconst [sliderValue, setSliderValue] = useState(getDefaultValue());\n\n\tfunction changeSliderValue(value: number) {\n\t\tif (value <= 0) return setSliderValue(0);\n\t\tif (value >= 100) return setSliderValue(100);\n\t\treturn setSliderValue(value);\n\t}\n\n\treturn [sliderValue, changeSliderValue];\n}\n\nexport { useSlider };\n","import {\n\ttype HTMLAttributes,\n\tuseCallback,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport \"./styles.css\";\n\ntype SliderProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Current slider position as a percentage (0–100). Required. */\n\tvalue: number;\n\t/** Callback fired whenever the value changes. Required. */\n\tonChange: (value: number) => void;\n\t/** Disables all drag and click interactions. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when the dragging state changes (`true` = drag started, `false` = drag ended). */\n\tonDragging?: (isDragging: boolean) => void;\n};\n\n/**\n * Slider, interactive track for selecting a numeric value between 0 and 100.\n *\n * Pair with `useSlider` for managed state.\n *\n * @param props.value - Current position as a percentage (0–100). Required.\n * @param props.onChange - Callback fired on value change. Required.\n * @param props.disabled - Disables interactions. Default: false\n * @param props.onDragging - Callback fired when dragging starts or stops.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Slider JSX element.\n *\n * @example\n * ```tsx\n * // Controlled slider\n * const [value, setValue] = useState(50);\n * <Slider value={value} onChange={setValue} />\n *\n * // With useSlider hook\n * const [value, setValue] = useSlider(25);\n * <Slider value={value} onChange={setValue} onDragging={setIsDragging} />\n *\n * // Disabled\n * <Slider value={75} onChange={() => {}} disabled />\n * ```\n */\n\nfunction Slider(props: SliderProps) {\n\tconst {\n\t\tonChange,\n\t\tvalue,\n\t\tdisabled = false,\n\t\tonDragging,\n\t\tclassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst [isDragging, setIsDragging] = useState(false);\n\tconst sliderRef = useRef<HTMLDivElement>(null);\n\n\tconst handleMouseDown = () => setIsDragging(true);\n\tconst handleMouseUp = useCallback(() => setIsDragging(false), []);\n\n\tconst handleMouseMove = useCallback(\n\t\t(event: MouseEvent) => {\n\t\t\tif (disabled) return;\n\t\t\tif (!isDragging || !sliderRef.current) return;\n\n\t\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\t\tconst offsetX = event.clientX - rect.left;\n\t\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\t\tonChange(newValue);\n\t\t},\n\t\t[disabled, isDragging, onChange],\n\t);\n\n\tconst handleSliderClick = (event: React.MouseEvent<HTMLDivElement>) => {\n\t\tif (disabled) return;\n\t\tif (!sliderRef.current) return;\n\n\t\tconst rect = sliderRef.current.getBoundingClientRect();\n\t\tconst offsetX = event.clientX - rect.left;\n\t\tconst newValue = Math.min(Math.max((offsetX / rect.width) * 100, 0), 100);\n\n\t\tonChange(newValue);\n\t};\n\n\tuseEffect(() => {\n\t\tif (isDragging) {\n\t\t\tonDragging?.(true);\n\t\t\tdocument.addEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.addEventListener(\"mouseup\", handleMouseUp);\n\t\t} else {\n\t\t\tonDragging?.(false);\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t}\n\n\t\treturn () => {\n\t\t\tdocument.removeEventListener(\"mousemove\", handleMouseMove);\n\t\t\tdocument.removeEventListener(\"mouseup\", handleMouseUp);\n\t\t};\n\t}, [isDragging, onDragging, handleMouseUp, handleMouseMove]);\n\n\tconst isDraggingClass = isDragging ? \"isDragging\" : \"isNotDragging\";\n\tconst disabledClass = disabled ? \"isDisabled\" : \"isEnabled\";\n\tconst sliderClassname = `arkynSliderTrack ${isDraggingClass} ${disabledClass} ${className}`;\n\n\treturn (\n\t\t<div\n\t\t\t{...rest}\n\t\t\tclassName={sliderClassname}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t\tonClick={handleSliderClick}\n\t\t\tref={sliderRef}\n\t\t>\n\t\t\t<div className=\"arkynSliderFill\" style={{ width: `${value}%` }} />\n\t\t\t<div className=\"arkynSliderThumb\" style={{ left: `${value}%` }} />\n\t\t</div>\n\t);\n}\n\nexport { Slider };\n","import { Pause, Play } from \"lucide-react\";\nimport {\n\ttype AudioHTMLAttributes,\n\ttype JSX,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useSlider } from \"../../hooks/useSlider\";\nimport { Slider } from \"../slider\";\nimport \"./styles.css\";\n\n/** Audio state snapshot passed to play/pause callbacks. */\ntype AudioInformationProps = {\n\t/** Current playback position in seconds. */\n\tcurrentTime: number;\n\t/** Total audio duration in seconds. */\n\ttotalTime: number;\n\t/** Current position formatted as `MM:SS`. */\n\tformattedCurrentTime: string;\n\t/** Total duration formatted as `MM:SS`. */\n\tformattedTotalTime: string;\n};\n\ntype AudioPlayerProps = Omit<\n\tAudioHTMLAttributes<HTMLAudioElement>,\n\t\"onEnded\" | \"src\"\n> & {\n\t/** Audio file URL. Required. */\n\tsrc: string;\n\t/** Disables the play/pause button and the progress slider. @default false */\n\tdisabled?: boolean;\n\t/** Callback fired when playback starts. Receives the current audio state. */\n\tonPlayAudio?: (props: AudioInformationProps) => void;\n\t/** Callback fired when playback is paused. Receives the current audio state. */\n\tonPauseAudio?: (props: AudioInformationProps) => void;\n};\n\n/**\n * AudioPlayer, play/pause controls, a scrubable progress bar, and elapsed/total time display.\n *\n * @param props.src - Audio file URL. Required.\n * @param props.disabled - Disables controls. Default: false\n * @param props.onPlayAudio - Callback fired when playback starts.\n * @param props.onPauseAudio - Callback fired when playback is paused.\n *\n * **...Other valid HTML properties for `<audio>` (except `onEnded` and `src`)**\n *\n * @returns AudioPlayer JSX element.\n *\n * @example\n * ```tsx\n * // Basic\n * <AudioPlayer src=\"/audio/episode.mp3\" />\n *\n * // With play/pause callbacks\n * <AudioPlayer\n * src=\"/audio/episode.mp3\"\n * onPlayAudio={(info) => console.log(\"Playing at\", info.formattedCurrentTime)}\n * onPauseAudio={(info) => console.log(\"Paused at\", info.formattedCurrentTime)}\n * />\n * ```\n */\nfunction AudioPlayer(props: AudioPlayerProps): JSX.Element {\n\tconst { onPlayAudio, onPauseAudio, disabled, style, ...rest } = props;\n\n\tconst [sliderValue, setSliderValue] = useSlider(0);\n\tconst [isPlaying, setIsPlaying] = useState(false);\n\tconst [isDragging, setIsDragging] = useState(false);\n\n\tconst audioReference = useRef<HTMLAudioElement>(null);\n\n\tconst currentTime = audioReference.current?.currentTime || 0;\n\tconst totalTime = audioReference.current?.duration || 0;\n\n\tconst formattedCurrentTime = formatTime(currentTime);\n\tconst formattedTotalTime = formatTime(totalTime);\n\n\tconst audioInformation: AudioInformationProps = {\n\t\ttotalTime,\n\t\tcurrentTime,\n\t\tformattedCurrentTime,\n\t\tformattedTotalTime,\n\t};\n\n\tfunction formatTime(time?: number): string {\n\t\tif (!time) return \"00:00\";\n\n\t\tconst minutes = Math.floor(time / 60);\n\t\tconst seconds = Math.floor(time % 60);\n\n\t\tconst formattedMinutes = String(minutes).padStart(2, \"0\");\n\t\tconst formattedSeconds = String(seconds).padStart(2, \"0\");\n\n\t\treturn `${formattedMinutes}:${formattedSeconds}`;\n\t}\n\n\tfunction handlePlayAudio(): void {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\t\tif (props.onPlayAudio) props.onPlayAudio(audioInformation);\n\t\taudioElement.play();\n\t\tsetIsPlaying(true);\n\t}\n\n\tfunction handlePauseAudio(): void {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\t\tif (props.onPauseAudio) props.onPauseAudio(audioInformation);\n\t\taudioElement.pause();\n\t\tsetIsPlaying(false);\n\t}\n\n\tfunction handleToggleAudio(): void {\n\t\tif (isPlaying) handlePauseAudio();\n\t\telse handlePlayAudio();\n\t}\n\n\tfunction handleSliderChange(value: number): void {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\n\t\tconst totalTime = audioElement.duration;\n\t\tconst currentTime = (value / 100) * totalTime;\n\n\t\taudioElement.currentTime = currentTime;\n\t}\n\n\tif (isDragging || !isPlaying) {\n\t\taudioReference.current?.pause();\n\t} else if (isPlaying) {\n\t\taudioReference.current?.play();\n\t}\n\n\tuseEffect(() => {\n\t\tconst audioElement = audioReference.current;\n\t\tif (!audioElement) return;\n\n\t\tconst handleTimeUpdate = () => {\n\t\t\tconst totalTime = audioElement.duration;\n\t\t\tconst currentTime = audioElement.currentTime;\n\n\t\t\tconst value = (currentTime / totalTime) * 100;\n\t\t\tsetSliderValue(value);\n\t\t};\n\n\t\taudioElement.addEventListener(\"timeupdate\", handleTimeUpdate);\n\n\t\treturn () => {\n\t\t\taudioElement.removeEventListener(\"timeupdate\", handleTimeUpdate);\n\t\t};\n\t}, [setSliderValue]);\n\n\treturn (\n\t\t<div className=\"arkynAudioPlayer\" style={style}>\n\t\t\t<audio\n\t\t\t\t{...rest}\n\t\t\t\tref={audioReference}\n\t\t\t\tsrc={props.src || undefined}\n\t\t\t\tonEnded={handlePauseAudio}\n\t\t\t/>\n\n\t\t\t<button type=\"button\" disabled={disabled} onClick={handleToggleAudio}>\n\t\t\t\t{isPlaying && <Pause />}\n\t\t\t\t{!isPlaying && <Play />}\n\t\t\t</button>\n\n\t\t\t<p>{formattedCurrentTime}</p>\n\n\t\t\t<Slider\n\t\t\t\tvalue={sliderValue}\n\t\t\t\tonChange={handleSliderChange}\n\t\t\t\tonDragging={setIsDragging}\n\t\t\t\tdisabled={disabled}\n\t\t\t/>\n\n\t\t\t<p>{formattedTotalTime}</p>\n\t\t</div>\n\t);\n}\n\nexport { AudioPlayer };\n","import { cloneElement, createContext, type ReactNode, useMemo } from \"react\";\n\ntype FormContextProps = {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors: { [x: string]: any };\n};\n\ntype FormProviderProps = {\n\tchildren: ReactNode;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfieldErrors?: any;\n\tform?: React.ReactElement;\n};\n\nconst formContext = createContext({} as FormContextProps);\n\n/**\n * FormProvider, distributes field-level validation errors to all form input components in its subtree.\n *\n * All inputs (`Input`, `Select`, `Checkbox`, etc.) read `fieldErrors[name]` automatically,\n * so you don't need to pass errors manually to each field. Use the `form` prop to also wrap\n * children in a `<form>` element (e.g. for Remix `<Form />`).\n *\n * @param props.children - Form fields and other components.\n * @param props.fieldErrors - Map of field name → error message (e.g. from Zod / server validation).\n * @param props.form - Optional `<form>` element to wrap children in (cloned with `children`).\n *\n * @returns FormProvider JSX element.\n *\n * @example\n * ```tsx\n * // With Remix action errors\n * const actionData = useActionData<typeof action>();\n *\n * <FormProvider fieldErrors={actionData?.fieldErrors}>\n * <Input name=\"email\" label=\"Email\" />\n * <Input name=\"password\" label=\"Password\" type=\"password\" />\n * <Button type=\"submit\">Login</Button>\n * </FormProvider>\n * ```\n */\n\nfunction FormProvider(props: FormProviderProps) {\n\tconst { children, fieldErrors, form } = props;\n\n\tconst value = useMemo(() => ({ fieldErrors }), [fieldErrors]);\n\n\treturn (\n\t\t<formContext.Provider value={value}>\n\t\t\t{!form && children}\n\t\t\t{form &&\n\t\t\t\tcloneElement(\n\t\t\t\t\tform as React.ReactElement,\n\t\t\t\t\tform.props as React.ReactElement,\n\t\t\t\t\tchildren,\n\t\t\t\t)}\n\t\t</formContext.Provider>\n\t);\n}\n\nexport { FormProvider, formContext };\n","import { useContext } from \"react\";\nimport { formContext } from \"../providers/formProvider\";\n\n/**\n * useForm, reads the nearest `FormProvider` context to access field-level validation errors.\n *\n * All form inputs (`Input`, `Select`, `Checkbox`, etc.) call this hook internally,\n * so you rarely need it directly. Use it when you want to read errors outside of\n * an input component, or build a custom input.\n *\n * @returns Form context containing:\n * - `fieldErrors`, `Record<string, string>` mapping field names to error messages.\n *\n * @example\n * ```tsx\n * // Wrapping a form with FormProvider\n * function App() {\n * return (\n * <FormProvider fieldErrors={{ email: \"Invalid email\" }}>\n * <MyForm />\n * </FormProvider>\n * );\n * }\n *\n * // Reading errors manually\n * function CustomField() {\n * const { fieldErrors } = useForm();\n * return <span>{fieldErrors?.username}</span>;\n * }\n * ```\n */\n\nfunction useForm() {\n\tconst context = useContext(formContext);\n\treturn context;\n}\n\nexport { useForm };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype FieldErrorProps = HTMLAttributes<HTMLElement>;\n\n/**\n * FieldError, displays a validation error message below a form field.\n *\n * Renders nothing when `children` is empty or falsy.\n *\n * **...Other valid HTML properties for `<strong>`**\n *\n * @returns FieldError `<strong>` element, or an empty fragment when there is no message.\n *\n * @example\n * ```tsx\n * <FieldError>This field is required</FieldError>\n *\n * {error && <FieldError>{error}</FieldError>}\n * ```\n */\n\nfunction FieldError(props: FieldErrorProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynFieldError ${baseClassName}`;\n\n\tif (!children) return null;\n\n\treturn (\n\t\t<strong className={className.trim()} {...rest}>\n\t\t\t{children}\n\t\t</strong>\n\t);\n}\n\nexport { FieldError };\n","import type { LabelHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype FieldLabelProps = LabelHTMLAttributes<HTMLLabelElement> & {\n\t/** When true, appends an asterisk (*) to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n};\n\n/**\n * FieldLabel, label for form fields, with an optional required-field asterisk.\n *\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n *\n * **...Other valid HTML properties for `<label>`**\n *\n * @returns FieldLabel JSX element.\n *\n * @example\n * ```tsx\n * <FieldLabel htmlFor=\"email\" showAsterisk>Email Address</FieldLabel>\n * ```\n */\n\nfunction FieldLabel(props: FieldLabelProps) {\n\tconst {\n\t\tshowAsterisk = false,\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst show = showAsterisk ? \"asteriskTrue\" : \"asteriskFalse\";\n\tconst className = `arkynFieldLabel ${show} ${baseClassName}`;\n\n\t// biome-ignore lint/a11y/noLabelWithoutControl: htmlFor is passed via ...rest\n\treturn <label className={className.trim()} {...rest} />;\n}\n\nexport { FieldLabel };\n","import type { HTMLAttributes, ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype FieldWrapperProps = HTMLAttributes<HTMLElement> & {\n\t/** Field elements to render inside the wrapper (label, input, error, etc.). Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Layout orientation of the wrapper.\n\t * @default \"vertical\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n};\n\n/**\n * FieldWrapper, `<section>` container that groups a form field with its label and error message.\n *\n * @param props.children - Field elements (label, input, error, etc.).\n * @param props.orientation - Layout direction. Default: \"vertical\"\n *\n * **...Other valid HTML properties for `<section>`**\n *\n * @returns FieldWrapper JSX element.\n *\n * @example\n * ```tsx\n * <FieldWrapper>\n * <FieldLabel showAsterisk>Email</FieldLabel>\n * <Input name=\"email\" type=\"email\" />\n * <FieldError>Invalid email address</FieldError>\n * </FieldWrapper>\n * ```\n */\n\nfunction FieldWrapper(props: FieldWrapperProps) {\n\tconst {\n\t\tchildren,\n\t\tclassName: baseClassName,\n\t\torientation = \"vertical\",\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynFieldWrapper ${baseClassName} ${orientation}`;\n\n\treturn (\n\t\t<section className={className.trim()} {...rest}>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { FieldWrapper };\n","import type { LucideIcon } from \"lucide-react\";\n\ntype IconRendererProps = {\n\ticonSize: number;\n\tclassName?: string;\n\ticon?: LucideIcon | string;\n\tshow?: boolean;\n};\n\nfunction IconRenderer(props: IconRendererProps) {\n\tconst { iconSize, icon: Icon, className, show = true } = props;\n\n\tif (!show) return null;\n\tif (!Icon) return null;\n\n\tif (typeof Icon === \"string\") {\n\t\treturn <p className={className}>{Icon}</p>;\n\t}\n\n\treturn <Icon size={iconSize} strokeWidth={2.5} className={className} />;\n}\n\nexport { IconRenderer };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport type { ButtonHTMLAttributes } from \"react\";\n\nimport { IconRenderer } from \"../../services/iconRenderer\";\nimport \"./styles.css\";\n\ntype ButtonProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/** Shows a spinner and disables the button during async operations. @default false */\n\tisLoading?: boolean;\n\t/** Text displayed beside the spinner when `isLoading` is true. */\n\tloadingText?: string;\n\t/**\n\t * Button size.\n\t * @default \"md\"\n\t */\n\tsize?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `ghost`: no border, subtle hover.\n\t * - `invisible`: no visual styling.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"ghost\" | \"invisible\";\n\t/**\n\t * Color scheme applied to the button.\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t/** Lucide icon rendered to the left of the label. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered to the right of the label. */\n\trightIcon?: LucideIcon;\n};\n\n/**\n * Button, used for user interactions and form submissions.\n *\n * @param props.isLoading - Shows a spinner and disables the button. Default: false\n * @param props.loadingText - Text displayed beside the spinner when loading.\n * @param props.size - Button size (`xs` | `sm` | `md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.scheme - Color scheme. Default: \"primary\"\n * @param props.leftIcon - Lucide icon rendered to the left of the label.\n * @param props.rightIcon - Lucide icon rendered to the right of the label.\n *\n * **...Other valid HTML properties for `<button>`**\n *\n * @returns Button JSX element.\n *\n * @example\n * ```tsx\n * // Basic button\n * <Button>Click me</Button>\n *\n * // With color scheme\n * <Button scheme=\"success\">Save</Button>\n *\n * // With loading state\n * <Button isLoading loadingText=\"Saving...\">Save</Button>\n *\n * // With icons\n * <Button leftIcon={SaveIcon} scheme=\"success\">Save</Button>\n *\n * // Custom size, variant and scheme\n * <Button size=\"lg\" variant=\"outline\" scheme=\"danger\" rightIcon={TrashIcon}>\n * Delete\n * </Button>\n * ```\n */\n\nfunction Button(props: ButtonProps) {\n\tconst {\n\t\tisLoading = false,\n\t\tscheme = \"primary\",\n\t\tvariant = \"solid\",\n\t\tloadingText,\n\t\tsize = \"md\",\n\t\tleftIcon,\n\t\trightIcon,\n\t\tdisabled,\n\t\tclassName: baseClassName = \"\",\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst iconSizes = { xs: 12, sm: 16, md: 20, lg: 24 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingClass = isLoading ? \"loadingTrue\" : \"loadingFalse\";\n\tconst loadingTextClass = loadingText ? \"loadingTextTrue\" : \"loadingTextFalse\";\n\n\tconst className = `arkynButton ${loadingClass} ${variant} ${scheme} ${size} ${loadingTextClass} ${baseClassName}`;\n\n\treturn (\n\t\t<button className={className} disabled={disabled || isLoading} {...rest}>\n\t\t\t<div className=\"arkynButtonSpinner\">\n\t\t\t\t<Loader2 size={iconSize} strokeWidth={2.5} />\n\t\t\t\t{loadingText && loadingText}\n\t\t\t</div>\n\n\t\t\t<div className=\"arkynButtonContent\">\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={leftIcon} />\n\t\t\t\t{children}\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={rightIcon} />\n\t\t\t</div>\n\t\t</button>\n\t);\n}\n\nexport { Button };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype DividerProps = HTMLAttributes<HTMLDivElement> & {\n\t/**\n\t * Divider orientation.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\";\n};\n\n/**\n * Divider, visually separates content sections.\n *\n * @param props.orientation - Line direction (`horizontal` | `vertical`). Default: \"horizontal\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Divider JSX element.\n *\n * @example\n * ```tsx\n * // Between sections\n * <h2>Section 1</h2>\n * <Divider />\n * <h2>Section 2</h2>\n *\n * // Vertical (e.g. between sidebar and content)\n * <Divider orientation=\"vertical\" />\n * ```\n */\n\nfunction Divider(props: DividerProps) {\n\tconst {\n\t\tclassName: baseClassName,\n\t\torientation = \"horizontal\",\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynDivider ${orientation} ${baseClassName}`;\n\n\treturn <div className={className.trim()} {...rest} />;\n}\n\nexport { Divider };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport type { ButtonHTMLAttributes } from \"react\";\n\nimport \"./styles.css\";\n\ntype IconButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"aria-label\"\n> & {\n\t/** Lucide icon component rendered inside the button. Required. */\n\ticon: LucideIcon;\n\t/** Accessible label for screen readers. Required. */\n\t\"aria-label\": string;\n\t/** Shows a spinner and disables the button during async operations. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Button size.\n\t * @default \"md\"\n\t */\n\tsize?: \"xs\" | \"sm\" | \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `ghost`: no border, subtle hover.\n\t * - `invisible`: no visual styling.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"ghost\" | \"invisible\";\n\t/**\n\t * Color scheme applied to the button.\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n};\n\n/**\n * IconButton, compact button that renders a single icon without a text label.\n *\n * Always requires `aria-label` for accessibility.\n *\n * @param props.icon - Lucide icon component to render. Required.\n * @param props[\"aria-label\"] - Accessible label for screen readers. Required.\n * @param props.isLoading - Shows a spinner and disables the button. Default: false\n * @param props.size - Button size (`xs` | `sm` | `md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.scheme - Color scheme. Default: \"primary\"\n *\n * **...Other valid HTML properties for `<button>` (children not supported)**\n *\n * @returns IconButton JSX element.\n *\n * @example\n * ```tsx\n * <IconButton icon={Plus} aria-label=\"Add item\" />\n *\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" variant=\"outline\" />\n *\n * <IconButton icon={Save} aria-label=\"Saving\" isLoading />\n *\n * <IconButton icon={MoreVertical} aria-label=\"More options\" size=\"sm\" />\n * ```\n */\n\nfunction IconButton(props: IconButtonProps) {\n\tconst {\n\t\tisLoading = false,\n\t\tscheme = \"primary\",\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\ticon: Icon,\n\t\tdisabled,\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst iconSize = { xs: 12, sm: 16, md: 20, lg: 24 };\n\tconst loading = isLoading ? \"loadingTrue\" : \"loadingFalse\";\n\tconst className = `arkynIconButton ${variant} ${scheme} ${size} ${loading} ${baseClassName}`;\n\n\treturn (\n\t\t<button\n\t\t\tdisabled={disabled || isLoading}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t>\n\t\t\t<div className=\"arkynIconButtonSpinner\">\n\t\t\t\t<Loader2 size={iconSize[size]} strokeWidth={2.5} />\n\t\t\t</div>\n\n\t\t\t<div className=\"arkynIconButtonContent\">\n\t\t\t\t<Icon size={iconSize[size]} strokeWidth={2.5} />\n\t\t\t</div>\n\t\t</button>\n\t);\n}\n\nexport { IconButton };\n","import {\n\ttype HTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport \"./styles.css\";\n\ntype TooltipProps = Omit<HTMLAttributes<HTMLDivElement>, \"children\"> & {\n\t/** Text rendered inside the tooltip bubble. Supports inline HTML. Required. */\n\ttext: string;\n\t/** Element that triggers the tooltip on hover. Required. */\n\tchildren: ReactNode;\n\t/**\n\t * Preferred position of the tooltip relative to the trigger element.\n\t * Automatically flips to the opposite side if the tooltip would overflow the viewport.\n\t * @default \"top\"\n\t */\n\torientation?: \"top\" | \"right\" | \"bottom\" | \"left\";\n\t/**\n\t * Tooltip size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n};\n\n/**\n * Tooltip, shows a contextual text bubble on hover with smart viewport-aware positioning.\n *\n * The tooltip automatically flips to the opposite side when it would overflow the viewport.\n *\n * @param props.text - Text (or HTML) to display in the tooltip. Required.\n * @param props.children - Trigger element. Required.\n * @param props.orientation - Preferred position relative to the trigger. Default: \"top\"\n * @param props.size - Tooltip size. Default: \"lg\"\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Tooltip JSX element.\n *\n * @example\n * ```tsx\n * <Tooltip text=\"Save changes before leaving\">\n * <IconButton icon={SaveIcon} aria-label=\"Save\" />\n * </Tooltip>\n *\n * // Toolbar with bottom-oriented tooltips\n * <Tooltip text=\"Add item\" orientation=\"bottom\">\n * <IconButton icon={Plus} aria-label=\"Add\" />\n * </Tooltip>\n *\n * <Tooltip text=\"Delete\" orientation=\"bottom\" size=\"md\">\n * <IconButton icon={Trash2} aria-label=\"Delete\" scheme=\"danger\" />\n * </Tooltip>\n * ```\n */\n\nfunction Tooltip(props: TooltipProps) {\n\tconst {\n\t\ttext,\n\t\tsize = \"lg\",\n\t\tchildren,\n\t\torientation = \"top\",\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = props;\n\n\tconst tooltipId = useId();\n\tconst tooltipRef = useRef<HTMLDivElement>(null);\n\tconst [adjustedOrientation, setAdjustedOrientation] = useState(orientation);\n\n\tuseEffect(() => {\n\t\tconst checkTooltipPosition = () => {\n\t\t\tif (!tooltipRef.current) return;\n\t\t\tconst tooltipText = document.getElementById(tooltipId) as HTMLElement;\n\t\t\tif (!tooltipText) return;\n\n\t\t\tsetAdjustedOrientation(orientation);\n\n\t\t\trequestAnimationFrame(() => {\n\t\t\t\tconst rect = tooltipText.getBoundingClientRect();\n\t\t\t\tconst viewportWidth = window.innerWidth;\n\t\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\t\tlet newOrientation = orientation;\n\n\t\t\t\tif (orientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (orientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (orientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t} else if (orientation === \"bottom\" && rect.bottom > viewportHeight) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t}\n\n\t\t\t\tif (newOrientation === \"right\" && rect.right > viewportWidth) {\n\t\t\t\t\tnewOrientation = \"left\";\n\t\t\t\t} else if (newOrientation === \"left\" && rect.left < 0) {\n\t\t\t\t\tnewOrientation = \"right\";\n\t\t\t\t} else if (\n\t\t\t\t\tnewOrientation === \"bottom\" &&\n\t\t\t\t\trect.bottom > viewportHeight\n\t\t\t\t) {\n\t\t\t\t\tnewOrientation = \"top\";\n\t\t\t\t} else if (newOrientation === \"top\" && rect.top < 0) {\n\t\t\t\t\tnewOrientation = \"bottom\";\n\t\t\t\t}\n\n\t\t\t\tsetAdjustedOrientation(newOrientation);\n\t\t\t});\n\t\t};\n\n\t\tconst tooltip = tooltipRef.current;\n\t\tif (!tooltip) return;\n\n\t\tconst handleMouseEnter = () => {\n\t\t\tsetTimeout(checkTooltipPosition, 1);\n\t\t};\n\n\t\ttooltip.addEventListener(\"mouseenter\", handleMouseEnter);\n\t\twindow.addEventListener(\"resize\", checkTooltipPosition);\n\n\t\treturn () => {\n\t\t\ttooltip.removeEventListener(\"mouseenter\", handleMouseEnter);\n\t\t\twindow.removeEventListener(\"resize\", checkTooltipPosition);\n\t\t};\n\t}, [orientation, tooltipId]);\n\n\tconst className = `arkynTooltip ${size} ${adjustedOrientation} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest} ref={tooltipRef}>\n\t\t\t{children}\n\n\t\t\t<div\n\t\t\t\tclassName=\"arkynTooltipText\"\n\t\t\t\tid={tooltipId}\n\t\t\t\tdangerouslySetInnerHTML={{ __html: text }}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Tooltip };\n","import { RefreshCw } from \"lucide-react\";\n\nimport { AudioPlayer } from \"../../audioPlayer\";\nimport { Button } from \"../../button\";\nimport { Divider } from \"../../divider\";\nimport { IconButton } from \"../../iconButton\";\nimport { Tooltip } from \"../../tooltip\";\n\nimport \"./styles.css\";\n\ntype HasFileContentProps = {\n\tfilePath: string;\n\tdisabled: boolean;\n\tacceptAudio: string;\n\tisLoading: boolean;\n\thandleSelectFile: (file: File) => void;\n\treSendAudio?: () => void;\n\tchangeAudioButtonText: string;\n};\n\nfunction HasFileContent(props: HasFileContentProps) {\n\tconst {\n\t\tfilePath,\n\t\tdisabled,\n\t\tacceptAudio,\n\t\thandleSelectFile,\n\t\tisLoading,\n\t\treSendAudio,\n\t\tchangeAudioButtonText,\n\t} = props;\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptAudio;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div className=\"arkynAudioUploadHasFileContentContainer\">\n\t\t\t<AudioPlayer src={filePath} />\n\t\t\t<Divider />\n\n\t\t\t<div className=\"arkynAudioUploadButtonsContainer\">\n\t\t\t\t{!!reSendAudio && (\n\t\t\t\t\t<Tooltip orientation=\"bottom\" text=\"Reenviar áudio\">\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"resend image\"\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\tonClick={reSendAudio}\n\t\t\t\t\t\t\ticon={RefreshCw}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\n\t\t\t\t<Button\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t>\n\t\t\t\t\t{changeAudioButtonText}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { HasFileContent };\n","import type { DragEvent } from \"react\";\n\nimport { Button } from \"../../button\";\nimport \"./styles.css\";\n\ntype NoFileContentProps = {\n\tdisabled: boolean;\n\tacceptAudio: string;\n\tisLoading: boolean;\n\tselectAudioButtonText: string;\n\tdropAudioText: string;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction NoFileContent(props: NoFileContentProps) {\n\tconst {\n\t\tdropAudioText,\n\t\tisLoading,\n\t\tacceptAudio,\n\t\thandleSelectFile,\n\t\tselectAudioButtonText,\n\t\tdisabled,\n\t} = props;\n\n\tfunction handleDrop(event: DragEvent<HTMLDivElement>) {\n\t\tif (disabled) return;\n\n\t\tevent.preventDefault();\n\t\tconst file = event.dataTransfer.files[0];\n\t\tif (file) handleSelectFile(file);\n\t}\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptAudio;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div onDrop={handleDrop} className=\"arkynAudioUploadNoFileContent\">\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{selectAudioButtonText}\n\t\t\t</Button>\n\n\t\t\t<p>{dropAudioText}</p>\n\t\t</div>\n\t);\n}\n\nexport { NoFileContent };\n","import { useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\n\nimport { HasFileContent } from \"./hasFileContent\";\nimport { NoFileContent } from \"./noFileContent\";\nimport \"./styles.css\";\n\ntype AudioUploadProps = {\n\t/** Field name for form submission (stores the uploaded audio URL). Required. */\n\tname: string;\n\t/** Server endpoint URL that receives the `multipart/form-data` upload request. Required. */\n\taction: string;\n\t/** Form-data field name used for the file. @default \"file\" */\n\tfileName?: string;\n\t/** HTTP method for the upload request. @default \"POST\" */\n\tmethod?: string;\n\t/** Accepted audio MIME types or extensions (e.g. `\"audio/mp3,audio/wav\"`). @default \"audio/*\" */\n\tacceptAudio?: string;\n\t/** Text displayed in the drag-and-drop zone. @default \"Ou arraste e solte um arquivo de áudio aqui\" */\n\tdropAudioText?: string;\n\t/** Label for the file-picker button before a file is selected. @default \"Selecionar arquivo de áudio\" */\n\tselectAudioButtonText?: string;\n\t/** Label for the file-picker button after a file is selected. @default \"Trocar arquivo de áudio\" */\n\tchangeAudioButtonText?: string;\n\t/** Callback fired after a successful upload. Receives the URL returned by the server. */\n\tonChange?: (url?: string) => void;\n\t/** Property name in the server response that contains the file URL. @default \"url\" */\n\tfileResponseName?: string;\n\t/** Optional label text displayed above the upload area. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n\t/** Disables file selection and upload. @default false */\n\tdisabled?: boolean;\n\t/** Pre-populated audio URL (e.g. an existing recording). @default \"\" */\n\tdefaultValue?: string;\n};\n\n/**\n * AudioUpload, drag-and-drop audio file uploader with server upload and playback preview.\n *\n * Sends the file via `fetch` as `multipart/form-data` and stores the returned URL\n * in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.action - Upload endpoint URL. Required.\n * @param props.fileName - Form-data field name for the file. Default: \"file\"\n * @param props.method - HTTP method. Default: \"POST\"\n * @param props.acceptAudio - Accepted MIME types / extensions. Default: \"audio/*\"\n * @param props.onChange - Callback fired after a successful upload, receives the audio URL.\n * @param props.fileResponseName - Server response property containing the URL. Default: \"url\"\n * @param props.label - Label text displayed above the upload area.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.disabled - Disables file selection and upload. Default: false\n * @param props.defaultValue - Pre-populated audio URL.\n *\n * @returns AudioUpload JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <AudioUpload name=\"audio\" action=\"/api/upload\" />\n *\n * // With label and custom texts\n * <AudioUpload\n * name=\"podcast\"\n * action=\"/api/upload/podcast\"\n * label=\"Podcast Episode\"\n * showAsterisk\n * selectAudioButtonText=\"Choose audio file\"\n * onChange={(url) => setPodcastUrl(url)}\n * />\n * ```\n */\n\nfunction AudioUpload(props: AudioUploadProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tfileName = \"file\",\n\t\tmethod = \"POST\",\n\t\tonChange,\n\t\tfileResponseName = \"url\",\n\t\tselectAudioButtonText = \"Selecionar arquivo de áudio\",\n\t\tdropAudioText = \"Ou arraste e solte um arquivo de áudio aqui\",\n\t\tchangeAudioButtonText = \"Trocar arquivo de áudio\",\n\t\tacceptAudio = \"audio/*\",\n\t\taction,\n\t\tdefaultValue = \"\",\n\t\tshowAsterisk = false,\n\t\tdisabled = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst fieldError = fieldErrors?.[name];\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst [error, setError] = useState(\"\");\n\tconst [file, setFile] = useState<File | null>(null);\n\tconst [filePath, setFilePath] = useState(defaultValue);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tasync function handleUploadAudio(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetIsLoading(true);\n\t\tsetFile(file);\n\t\tsetError(\"\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(fileName, file);\n\n\t\tawait fetch(action, { method: method, body: formData })\n\t\t\t.then(async (response) => await response.json())\n\t\t\t.then((response) => {\n\t\t\t\tif (response?.error) setError(response.error);\n\t\t\t\telse setValue(response?.[fileResponseName]);\n\t\t\t\tonChange?.(response?.[fileResponseName]);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tsetError(\"Erro ao enviar audio\");\n\t\t\t})\n\t\t\t.finally(() => setIsLoading(false));\n\t}\n\n\tfunction handleSelectFile(file: File) {\n\t\tif (disabled) return;\n\n\t\tif (file.type.indexOf(\"audio\") === -1) {\n\t\t\tsetError(\"O arquivo selecionado não é um arquivo de áudio\");\n\t\t\treturn;\n\t\t}\n\n\t\tsetFilePath(URL.createObjectURL(file));\n\t\thandleUploadAudio(file);\n\t}\n\n\tconst errorMessage = fieldError || error;\n\n\tconst hasErrorClassName = errorMessage ? \"hasError\" : \"noHasError\";\n\tconst hasImageClassName = filePath ? \"hasAudio\" : \"noHasAudio\";\n\tconst className = `arkynAudioUpload ${hasErrorClassName} ${hasImageClassName}`;\n\n\treturn (\n\t\t<FieldWrapper>\n\t\t\t{label && <FieldLabel showAsterisk={showAsterisk}>{label}</FieldLabel>}\n\n\t\t\t<div className={className}>\n\t\t\t\t<input type=\"hidden\" name={name} value={value || \"\"} />\n\n\t\t\t\t{!filePath && (\n\t\t\t\t\t<NoFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptAudio={acceptAudio}\n\t\t\t\t\t\tdropAudioText={dropAudioText}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tselectAudioButtonText={selectAudioButtonText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{filePath && (\n\t\t\t\t\t<HasFileContent\n\t\t\t\t\t\tfilePath={filePath}\n\t\t\t\t\t\tacceptAudio={acceptAudio}\n\t\t\t\t\t\tchangeAudioButtonText={changeAudioButtonText}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\treSendAudio={\n\t\t\t\t\t\t\terrorMessage && file ? () => handleUploadAudio(file) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { AudioUpload };\n","import type { LucideIcon } from \"lucide-react\";\nimport type { HTMLAttributes } from \"react\";\n\nimport { IconRenderer } from \"../../services/iconRenderer\";\nimport \"./styles.css\";\n\ntype BadgeProps = HTMLAttributes<HTMLDivElement> & {\n\t/**\n\t * Badge size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `ghost`: no border, subtle background on hover.\n\t * @default \"ghost\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"ghost\";\n\t/**\n\t * Color scheme applied to the badge.\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"secondary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t/** Lucide icon rendered to the left of the label. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered to the right of the label. */\n\trightIcon?: LucideIcon;\n};\n\n/**\n * Badge, displays labels, statuses, and categorization tags.\n *\n * @param props.size - Badge size (`md` | `lg`). Default: \"lg\"\n * @param props.variant - Visual style variant. Default: \"ghost\"\n * @param props.scheme - Color scheme. Default: \"primary\"\n * @param props.leftIcon - Lucide icon rendered to the left of the label.\n * @param props.rightIcon - Lucide icon rendered to the right of the label.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Badge JSX element.\n *\n * @example\n * ```tsx\n * // Basic badge\n * <Badge>New</Badge>\n *\n * // With color scheme\n * <Badge scheme=\"success\">Approved</Badge>\n *\n * // With icon\n * <Badge leftIcon={CheckIcon} scheme=\"success\">Completed</Badge>\n *\n * // Custom size, variant and scheme\n * <Badge size=\"lg\" variant=\"solid\" scheme=\"warning\" rightIcon={AlertIcon}>\n * Warning\n * </Badge>\n * ```\n */\n\nfunction Badge(props: BadgeProps) {\n\tconst {\n\t\tvariant = \"ghost\",\n\t\tscheme = \"primary\",\n\t\tsize = \"lg\",\n\t\tleftIcon,\n\t\trightIcon,\n\t\tclassName: baseClassName = \"\",\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst iconSizes = { md: 12, lg: 14 };\n\tconst iconSize = iconSizes[size];\n\n\tconst className = `arkynBadge ${variant} ${scheme} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<IconRenderer iconSize={iconSize} icon={leftIcon} />\n\t\t\t<p>{children}</p>\n\t\t\t<IconRenderer iconSize={iconSize} icon={rightIcon} />\n\t\t</div>\n\t);\n}\n\nexport { Badge };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\n\ntype CalendarCell = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayType: \"checkedDay\" | \"middleDay\" | \"uncheckedDay\";\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\ntype CalendarMatrix = CalendarCell[][];\n\nclass ViewService {\n\tcurrentDay(viewDate: Date) {\n\t\treturn String(viewDate.getDate()).padStart(2, \"0\");\n\t}\n\n\tcurrentMonth(viewDate: Date) {\n\t\treturn String(viewDate.getMonth() + 1).padStart(2, \"0\");\n\t}\n\n\tcurrentYear(viewDate: Date) {\n\t\treturn String(viewDate.getFullYear());\n\t}\n\n\tcapitalize(text: string) {\n\t\treturn formatToCapitalizeFirstWordLetter(text);\n\t}\n\n\tparseDayType(\n\t\tday: number,\n\t\tmonth: number,\n\t\tyear: number,\n\t\tvalueDate: [Date, Date],\n\t): \"checkedDay\" | \"middleDay\" | \"uncheckedDay\" {\n\t\tconst firstDateDay = valueDate[0].getDate();\n\t\tconst firstDateMonth = valueDate[0].getMonth();\n\t\tconst firstDateYear = valueDate[0].getFullYear();\n\n\t\tconst secondDateDay = valueDate[1].getDate();\n\t\tconst secondDateMonth = valueDate[1].getMonth();\n\t\tconst secondDateYear = valueDate[1].getFullYear();\n\n\t\tconst firstDate = new Date(firstDateYear, firstDateMonth, firstDateDay);\n\t\tconst secondDate = new Date(secondDateYear, secondDateMonth, secondDateDay);\n\t\tconst currentDate = new Date(year, month, day);\n\n\t\tif (firstDate.getTime() === currentDate.getTime()) return \"checkedDay\";\n\t\tif (secondDate.getTime() === currentDate.getTime()) return \"checkedDay\";\n\t\tif (currentDate > firstDate && currentDate < secondDate) return \"middleDay\";\n\t\treturn \"uncheckedDay\";\n\t}\n\n\tlistWeek(language: string) {\n\t\tconst weekDays = [];\n\t\tconst firstSundayUtc = new Date(Date.UTC(2023, 0, 1));\n\n\t\tfor (let i = 0; i < 7; i++) {\n\t\t\tconst day = new Date(firstSundayUtc);\n\t\t\tday.setUTCDate(firstSundayUtc.getUTCDate() + i);\n\t\t\tconst dayName = day.toLocaleDateString(language, {\n\t\t\t\tweekday: \"short\",\n\t\t\t\ttimeZone: \"UTC\",\n\t\t\t});\n\t\t\tweekDays.push(dayName);\n\t\t}\n\n\t\treturn weekDays;\n\t}\n\n\tlistMonths(viewDate: Date, language: string) {\n\t\tconst monthsByNavigatorLanguage = new Intl.DateTimeFormat(language, {\n\t\t\tmonth: \"long\",\n\t\t});\n\n\t\treturn Array.from({ length: 12 }, (_, i) => {\n\t\t\tconst date = new Date(viewDate.getFullYear(), i, 1);\n\t\t\tconst label = monthsByNavigatorLanguage.format(date);\n\t\t\treturn {\n\t\t\t\tlabel: this.capitalize(label),\n\t\t\t\tvalue: String(i).padStart(2, \"0\"),\n\t\t\t};\n\t\t});\n\t}\n\n\tlistYears(lastYears: number) {\n\t\tconst currentYear = new Date().getFullYear();\n\n\t\treturn Array.from({ length: lastYears + 1 }, (_, i) => {\n\t\t\tconst year = currentYear - lastYears + i;\n\t\t\treturn { label: String(year), value: String(year) };\n\t\t}).reverse();\n\t}\n\n\tlistMatrix(viewDate: Date, valueDate: [Date, Date]) {\n\t\tconst year = viewDate.getFullYear();\n\t\tconst monthIndex = viewDate.getMonth();\n\n\t\tconst firstDayOfMonth = new Date(year, monthIndex, 1);\n\t\tconst firstWeekday = firstDayOfMonth.getDay();\n\n\t\tconst daysInCurrentMonth = new Date(year, monthIndex + 1, 0).getDate();\n\t\tconst daysInPreviousMonth = new Date(year, monthIndex, 0).getDate();\n\n\t\tconst totalCells = Math.ceil((firstWeekday + daysInCurrentMonth) / 7) * 7;\n\n\t\tconst weeks: CalendarMatrix = [];\n\t\tlet currentMonthDay = 1;\n\t\tlet nextMonthDay = 1;\n\n\t\tfor (let i = 0; i < totalCells; i++) {\n\t\t\tconst weekIndex = Math.floor(i / 7);\n\t\t\tif (!weeks[weekIndex]) weeks[weekIndex] = [];\n\n\t\t\tif (i < firstWeekday) {\n\t\t\t\tconst day = daysInPreviousMonth - (firstWeekday - i - 1);\n\t\t\t\tconst month = monthIndex === 0 ? 11 : monthIndex - 1;\n\t\t\t\tconst cellYear = monthIndex === 0 ? year - 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"previous\",\n\t\t\t\t\tdayType: this.parseDayType(day, month, cellYear, valueDate),\n\t\t\t\t});\n\t\t\t} else if (currentMonthDay <= daysInCurrentMonth) {\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: currentMonthDay,\n\t\t\t\t\tmonth: monthIndex,\n\t\t\t\t\tyear: year,\n\t\t\t\t\tdayOwner: \"current\",\n\t\t\t\t\tdayType: this.parseDayType(\n\t\t\t\t\t\tcurrentMonthDay,\n\t\t\t\t\t\tmonthIndex,\n\t\t\t\t\t\tyear,\n\t\t\t\t\t\tvalueDate,\n\t\t\t\t\t),\n\t\t\t\t});\n\t\t\t\tcurrentMonthDay++;\n\t\t\t} else {\n\t\t\t\tconst month = monthIndex === 11 ? 0 : monthIndex + 1;\n\t\t\t\tconst cellYear = monthIndex === 11 ? year + 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: nextMonthDay,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"next\",\n\t\t\t\t\tdayType: this.parseDayType(nextMonthDay, month, cellYear, valueDate),\n\t\t\t\t});\n\t\t\t\tnextMonthDay++;\n\t\t\t}\n\t\t}\n\n\t\treturn weeks;\n\t}\n\n\tchangeDay(\n\t\tday: number,\n\t\tmonth: number,\n\t\tyear: number,\n\t\tcalendarType: \"single\" | \"range\",\n\t\tvalueDate: [Date, Date],\n\t\tsetValueDate: (date: [Date, Date]) => void,\n\t\tsetViewDate: (date: Date) => void,\n\t) {\n\t\tconst normalizeDate = (date: Date) =>\n\t\t\tnew Date(date.getFullYear(), date.getMonth(), date.getDate());\n\n\t\tconst newDate = normalizeDate(new Date(year, month, day));\n\t\tsetViewDate(newDate);\n\n\t\tif (calendarType === \"single\") {\n\t\t\tsetValueDate([newDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst startDate = normalizeDate(valueDate[0]);\n\t\tconst endDate = normalizeDate(valueDate[1]);\n\n\t\tconst newDateTime = newDate.getTime();\n\t\tconst startDateTime = startDate.getTime();\n\t\tconst endDateTime = endDate.getTime();\n\n\t\tif (newDateTime === startDateTime) {\n\t\t\tsetValueDate([newDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (newDateTime === endDateTime) {\n\t\t\tsetValueDate([newDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (newDate < startDate) {\n\t\t\tsetValueDate([newDate, endDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tif (newDate > endDate) {\n\t\t\tsetValueDate([startDate, newDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tconst distanceToStart = Math.abs(newDateTime - startDateTime);\n\t\tconst distanceToEnd = Math.abs(endDateTime - newDateTime);\n\n\t\tif (distanceToStart <= distanceToEnd) {\n\t\t\tsetValueDate([newDate, endDate]);\n\t\t\treturn;\n\t\t}\n\n\t\tsetValueDate([startDate, newDate]);\n\t}\n\n\tchangeMonth(\n\t\tmonth: number,\n\t\tviewDate: Date,\n\t\tsetViewDate: (date: Date) => void,\n\t) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setMonth(month);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tchangeYear(year: number, viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setFullYear(year);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tnextMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(1);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() + 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(1);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() - 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n}\n\nexport { type CalendarMatrix, ViewService };\n","import { createContext, type ReactNode, useContext, useState } from \"react\";\nimport { type CalendarMatrix, ViewService } from \"./_viewService\";\n\ntype CalendarContextProps = {\n\tvalueDate: Date[];\n\tviewDate: Date;\n\tcurrentDate: string;\n\tcurrentDay: string;\n\tcurrentMonth: string;\n\tcurrentYear: string;\n\tlistWeek: string[];\n\tlistMonths: { label: string; value: string }[];\n\tlistYears: { label: string; value: string }[];\n\tlistMatrix: CalendarMatrix;\n\tchangeDay: (day: number, month: number, year: number) => void;\n\tchangeMonth: (month: number) => void;\n\tchangeYear: (year: number) => void;\n\tnextMonth: () => void;\n\tpreviousMonth: () => void;\n};\n\ntype SingleCalendarProviderProps = {\n\tchildren: ReactNode;\n\tcalendarType: \"single\";\n\tlanguage?: string;\n\tonChangeView?: (date: Date) => void;\n\tdefaultValue?: Date;\n\tonChange?: (date: Date) => void;\n\tvalue?: Date;\n\tviewValue?: Date;\n\tdefaultViewValue?: Date;\n};\n\ntype RangeCalendarProviderProps = {\n\tchildren: ReactNode;\n\tcalendarType: \"range\";\n\tlanguage?: string;\n\tonChangeView?: (date: Date) => void;\n\tdefaultValue?: [Date, Date];\n\tonChange?: (date: [Date, Date]) => void;\n\tvalue?: [Date, Date];\n\tviewValue?: Date;\n\tdefaultViewValue?: Date;\n};\n\ntype CalendarProviderProps =\n\t| SingleCalendarProviderProps\n\t| RangeCalendarProviderProps;\n\nconst CalendarContext = createContext({} as CalendarContextProps);\n\nfunction useCalendar() {\n\treturn useContext(CalendarContext);\n}\n\nfunction CalendarProvider(props: CalendarProviderProps) {\n\tconst {\n\t\tcalendarType,\n\t\tchildren,\n\t\tdefaultValue: rawDefaultValue,\n\t\tdefaultViewValue = new Date(),\n\t\tlanguage = \"pt-BR\",\n\t\tonChange,\n\t\tonChangeView,\n\t\tvalue,\n\t\tviewValue,\n\t} = props;\n\n\tconst defaultValue: [Date, Date] =\n\t\tcalendarType === \"single\"\n\t\t\t? [rawDefaultValue || new Date(), rawDefaultValue || new Date()]\n\t\t\t: rawDefaultValue || [new Date(), new Date()];\n\n\tconst [rawViewDate, rawSetViewDate] = useState(defaultViewValue);\n\tconst [rawValueDate, rawSetValueDate] = useState<[Date, Date]>(defaultValue);\n\n\tconst viewDate = viewValue || rawViewDate;\n\tconst valueDate: [Date, Date] = value\n\t\t? calendarType === \"single\"\n\t\t\t? [value, value]\n\t\t\t: value\n\t\t: rawValueDate;\n\n\tconst viewService = new ViewService();\n\n\tfunction setValueDate(value: [Date, Date]) {\n\t\tconst normalizedValue: [Date, Date] = [\n\t\t\tnew Date(value[0]),\n\t\t\tnew Date(value[1]),\n\t\t];\n\n\t\tif (onChange && calendarType === \"range\") {\n\t\t\tonChange(normalizedValue);\n\t\t}\n\n\t\tif (onChange && calendarType === \"single\") {\n\t\t\tonChange(normalizedValue[0]);\n\t\t}\n\n\t\trawSetValueDate(normalizedValue);\n\t}\n\n\tfunction setViewDate(date: Date) {\n\t\tif (onChangeView) onChangeView(date);\n\t\trawSetViewDate(date);\n\t}\n\n\treturn (\n\t\t<CalendarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tvalueDate,\n\t\t\t\tviewDate,\n\t\t\t\tcurrentDate: viewDate.toLocaleDateString(language).slice(3),\n\t\t\t\tcurrentDay: viewService.currentDay(viewDate),\n\t\t\t\tcurrentMonth: viewService.currentMonth(viewDate),\n\t\t\t\tcurrentYear: viewService.currentYear(viewDate),\n\t\t\t\tlistWeek: viewService.listWeek(language),\n\t\t\t\tlistMonths: viewService.listMonths(viewDate, language),\n\t\t\t\tlistYears: viewService.listYears(100),\n\t\t\t\tlistMatrix: viewService.listMatrix(viewDate, valueDate),\n\t\t\t\tchangeDay: (day, month, year) =>\n\t\t\t\t\tviewService.changeDay(\n\t\t\t\t\t\tday,\n\t\t\t\t\t\tmonth,\n\t\t\t\t\t\tyear,\n\t\t\t\t\t\tcalendarType,\n\t\t\t\t\t\tvalueDate,\n\t\t\t\t\t\tsetValueDate,\n\t\t\t\t\t\tsetViewDate,\n\t\t\t\t\t),\n\t\t\t\tchangeMonth: (month) =>\n\t\t\t\t\tviewService.changeMonth(month, viewDate, setViewDate),\n\t\t\t\tchangeYear: (year) =>\n\t\t\t\t\tviewService.changeYear(year, viewDate, setViewDate),\n\t\t\t\tnextMonth: () => viewService.nextMonth(viewDate, setViewDate),\n\t\t\t\tpreviousMonth: () => viewService.previousMonth(viewDate, setViewDate),\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</CalendarContext.Provider>\n\t);\n}\n\nexport { CalendarProvider, useCalendar };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype CalendarContainerProps = {\n\tchildren?: ReactNode;\n};\n\nfunction CalendarContainer({ children }: CalendarContainerProps) {\n\treturn <div className={`arkynCalendarContainer`}>{children}</div>;\n}\n\nexport { CalendarContainer };\n","import type { ReactNode } from \"react\";\n\nimport { FieldError } from \"../components/fieldError\";\nimport { FieldLabel } from \"../components/fieldLabel\";\nimport { FieldWrapper } from \"../components/fieldWrapper\";\n\ntype FormRendererProps = {\n\tname?: string;\n\tlabel?: string;\n\tclassName?: string;\n\tshowAsterisk?: boolean;\n\tunShowFieldTemplate?: boolean;\n\terrorMessage?: string;\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\tchildren: ReactNode;\n};\n\nfunction FieldTemplate(props: FormRendererProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tclassName,\n\t\tunShowFieldTemplate,\n\t\terrorMessage,\n\t\tchildren,\n\t\torientation,\n\t} = props;\n\n\tif (unShowFieldTemplate) return children;\n\n\treturn (\n\t\t<FieldWrapper id={name} className={className} orientation={orientation}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={name} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { FieldTemplate };\n","import { ChevronDown } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype SelectChevronProps = {\n\tisLoading: boolean;\n\ticonSize: number;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisFocused: boolean;\n};\n\nfunction SelectChevron(props: SelectChevronProps) {\n\tconst { iconSize, isLoading, disabled, readOnly, isFocused } = props;\n\n\tconst notAnimate = disabled || readOnly ? \"notAnimate\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynSelectChevron ${notAnimate} ${focused}`;\n\n\tif (isLoading) return null;\n\treturn (\n\t\t<ChevronDown\n\t\t\tclassName={className}\n\t\t\tstrokeWidth={2.5}\n\t\t\tstyle={{\n\t\t\t\tminWidth: iconSize,\n\t\t\t\tminHeight: iconSize,\n\t\t\t\tmaxWidth: iconSize,\n\t\t\t\tmaxHeight: iconSize,\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport { SelectChevron };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype SelectContainerProps = {\n\tchildren: ReactNode;\n\thandleContainerFocus: () => void;\n\tprefixExists: boolean;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tid: string;\n\tvariant: \"solid\" | \"outline\" | \"underline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction SelectContainer(props: SelectContainerProps) {\n\tconst {\n\t\tchildren,\n\t\thandleContainerFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName,\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t\tid,\n\t\tprefixExists,\n\t} = props;\n\n\tconst hasPrefix = prefixExists ? \"hasPrefix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\treturn (\n\t\t<section\n\t\t\tid={id}\n\t\t\tclassName={`arkynSelectContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`}\n\t\t\tonClick={handleContainerFocus}\n\t\t>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { SelectContainer };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype SelectContentProps = {\n\tchildren: ReactNode;\n\tsize: \"md\" | \"lg\";\n};\n\nfunction SelectContent(props: SelectContentProps) {\n\tconst { children, size } = props;\n\tconst className = `arkynSelectContent ${size}`;\n\treturn <div className={className}>{children}</div>;\n}\n\nexport { SelectContent };\n","import { Check } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype SelectOptionProps = {\n\tvalue: string;\n\tlabel: string;\n\tsize: \"md\" | \"lg\";\n\toptionHasSelected: (value: string) => boolean;\n\thandleChangeValue: (value: string) => void;\n};\n\nfunction SelectOption(props: SelectOptionProps) {\n\tconst { label, optionHasSelected, handleChangeValue, value, size } = props;\n\n\tconst hasActive = optionHasSelected(value) ? \"active\" : \"\";\n\tconst className = `arkynSelectOption ${size} ${hasActive}`;\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tonClick={() => handleChangeValue(value)}\n\t\t\tclassName={className}\n\t\t>\n\t\t\t{label} <Check />\n\t\t</button>\n\t);\n}\n\nexport { SelectOption };\n","import { useEffect } from \"react\";\n\nfunction getScrollbarWidth(): number {\n\tif (typeof window === \"undefined\") return 0;\n\treturn window.innerWidth - document.documentElement.clientWidth;\n}\n\n/**\n * useScrollLock, locks `document.body` scroll while an overlay is open.\n *\n * Compensates for the scrollbar width by adding equivalent `paddingRight`,\n * preventing layout shift when the scrollbar disappears.\n * Restores the original `overflow` and `paddingRight` when `isLocked` becomes `false`.\n *\n * Used internally by `Modal` and `Drawer`, you usually don't need this directly\n * unless building a custom overlay.\n *\n * @param isLocked - When `true`, body scroll is disabled.\n *\n * @example\n * ```tsx\n * function CustomOverlay({ isOpen }) {\n * useScrollLock(isOpen);\n * return isOpen ? <div className=\"overlay\">...</div> : null;\n * }\n * ```\n */\n\nfunction useScrollLock(isLocked: boolean): void {\n\tuseEffect(() => {\n\t\tif (isLocked) {\n\t\t\tconst originalOverflow = document.body.style.overflow;\n\t\t\tconst originalPaddingRight = document.body.style.paddingRight;\n\n\t\t\tconst scrollbarWidth = getScrollbarWidth();\n\n\t\t\tif (scrollbarWidth > 0) {\n\t\t\t\tconst computedStyle = window.getComputedStyle(document.body);\n\t\t\t\tconst existingPaddingRight =\n\t\t\t\t\tparseInt(computedStyle.paddingRight, 10) || 0;\n\n\t\t\t\tdocument.body.style.paddingRight = `${\n\t\t\t\t\texistingPaddingRight + scrollbarWidth\n\t\t\t\t}px`;\n\t\t\t}\n\n\t\t\tdocument.body.style.overflow = \"hidden\";\n\n\t\t\treturn () => {\n\t\t\t\tdocument.body.style.overflow = originalOverflow;\n\t\t\t\tdocument.body.style.paddingRight = originalPaddingRight;\n\t\t\t};\n\t\t}\n\t}, [isLocked]);\n}\n\nexport { useScrollLock };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport {\n\ttype FocusEvent,\n\ttype InputHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport \"./style.css\";\n\ntype InputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t\"size\" | \"prefix\" | \"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Validation error message displayed below the input. */\n\terrorMessage?: string;\n\t/** Shows a spinner and disables the input during async operations. @default false */\n\tisLoading?: boolean;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the input area (e.g. `\"https://\"`). */\n\tprefix?: string | LucideIcon;\n\t/** Text or icon rendered at the far right, outside the input area (e.g. `\".com\"`). */\n\tsuffix?: string | LucideIcon;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\t/** Lucide icon rendered inside the input on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered inside the input on the right. */\n\trightIcon?: LucideIcon;\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Input, text input field with label, validation, icons, prefix/suffix, and loading state.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the input.\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a spinner and disables the input. Default: false\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.prefix - Text or icon at the far left (outside the input).\n * @param props.suffix - Text or icon at the far right (outside the input).\n * @param props.leftIcon - Lucide icon inside the input on the left.\n * @param props.rightIcon - Lucide icon inside the input on the right.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * **...Other valid HTML properties for `<input>`**\n *\n * @returns Input JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Input name=\"username\" placeholder=\"Enter username\" />\n *\n * // With label and validation\n * <Input\n * name=\"email\"\n * label=\"Email Address\"\n * type=\"email\"\n * showAsterisk\n * errorMessage=\"Please enter a valid email\"\n * />\n *\n * // With icons and loading state\n * <Input name=\"search\" label=\"Search\" leftIcon={SearchIcon} isLoading />\n *\n * // With prefix/suffix\n * <Input name=\"website\" label=\"Website\" prefix=\"https://\" suffix=\".com\" variant=\"outline\" />\n * ```\n */\n\nfunction Input(props: InputProps) {\n\tconst {\n\t\tname,\n\t\tdisabled,\n\t\ttitle,\n\t\tstyle,\n\t\tvariant = \"solid\",\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tprefix,\n\t\tsuffix,\n\t\tisLoading = false,\n\t\tleftIcon,\n\t\treadOnly,\n\t\tonFocus,\n\t\tonBlur,\n\t\tunShowFieldTemplate = false,\n\t\terrorMessage: baseErrorMessage,\n\t\tshowAsterisk,\n\t\trightIcon,\n\t\ttype = \"text\",\n\t\tsize = \"md\",\n\t\tid,\n\t\tvalue,\n\t\tplaceholder,\n\t\torientation,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingPosition = rightIcon ? \"right\" : \"left\";\n\n\tconst showLeftSpinner = loadingPosition === \"left\" && isLoading;\n\tconst showRightSpinner = loadingPosition === \"right\" && isLoading;\n\n\tfunction handleSectionClick() {\n\t\tif (isDisabled || !inputRef?.current) return;\n\t\tsetIsFocused(true);\n\t\tinputRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\tif (type === \"hidden\") {\n\t\treturn (\n\t\t\t<input\n\t\t\t\tstyle={{ display: \"none\" }}\n\t\t\t\treadOnly\n\t\t\t\ttype=\"text\"\n\t\t\t\tref={inputRef}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst hasPrefix = prefix ? \"hasPrefix\" : \"\";\n\tconst hasSuffix = suffix ? \"hasSuffix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = isDisabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\tconst disabledClass = disabled ? \"disabled\" : \"\";\n\n\tconst className = `arkynInput ${hasPrefix} ${disabledClass} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showLeftSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />\n\n\t\t\t\t<input\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\ttype={type}\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tname={name}\n\t\t\t\t\tplaceholder={isDisabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={isDisabled ? undefined : value}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showRightSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={suffix} className=\"suffix\" />\n\t\t\t</section>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Input, type InputProps };\n","import { Search } from \"lucide-react\";\nimport {\n\ttype ChangeEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { Input } from \"../../input\";\n\nimport \"./styles.css\";\n\ntype SelectOptionsContainerProps = {\n\tisFocused: boolean;\n\tisSearchable: boolean;\n\tchildren: ReactNode;\n\tsearch: string;\n\tonSearch: (value: string) => void;\n};\n\nfunction SelectOptionsContainer(props: SelectOptionsContainerProps) {\n\tconst { children, isFocused, isSearchable, search, onSearch } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tuseScrollLock(isFocused);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 300;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isFocused]);\n\n\tfunction handleSearch(e: ChangeEvent<HTMLInputElement>) {\n\t\tif (!isSearchable) return;\n\t\tonSearch(e.target.value);\n\t}\n\n\tif (!isFocused) return null;\n\n\treturn (\n\t\t<div\n\t\t\tref={containerRef}\n\t\t\tclassName={`arkynSelectOptionsContainer ${position}`}\n\t\t>\n\t\t\t{isSearchable && (\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tname=\"search-select\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tleftIcon={Search}\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonChange={handleSearch}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { SelectOptionsContainer };\n","import \"./styles.css\";\n\ntype SelectOverlayProps = {\n\tisFocused: boolean;\n\thandleBlur: () => void;\n};\n\nfunction SelectOverlay(props: SelectOverlayProps) {\n\tconst { isFocused, handleBlur } = props;\n\tif (!isFocused) return null;\n\treturn <aside className=\"arkynSelectOverlay\" onClick={handleBlur} />;\n}\n\nexport { SelectOverlay };\n","import { Loader2 } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype SelectSpinnerProps = {\n\ticonSize: number;\n\tisLoading: boolean;\n};\n\nfunction SelectSpinner(props: SelectSpinnerProps) {\n\tconst { iconSize, isLoading } = props;\n\n\tif (!isLoading) return null;\n\treturn (\n\t\t<Loader2 className=\"arkynSelectSpinner\" size={iconSize} strokeWidth={2.5} />\n\t);\n}\n\nexport { SelectSpinner };\n","import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { SelectChevron } from \"./selectChevron\";\nimport { SelectContainer } from \"./selectContainer\";\nimport { SelectContent } from \"./selectContent\";\nimport { SelectOption } from \"./selectOption\";\nimport { SelectOptionsContainer } from \"./selectOptionsContainer\";\nimport { SelectOverlay } from \"./selectOverlay\";\nimport { SelectSpinner } from \"./selectSpinner\";\n\ntype SelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Uncontrolled default selected value. @default \"\" */\n\tdefaultValue?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the select. */\n\tlabel?: string;\n\t/** Validation error message displayed below the select. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no option is selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected. @default true */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected value changes. */\n\tonChange?: (value: string) => void;\n\t/** Callback fired when the select gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the select loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * Select size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Select, single-option dropdown with optional search, label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled selected value.\n * @param props.defaultValue - Uncontrolled default value. Default: \"\"\n * @param props.label - Label text displayed above the select.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after selecting. Default: true\n * @param props.onChange - Callback fired when the selected value changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - Select size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns Select JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Select\n * name=\"category\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <Select\n * name=\"country\"\n * label=\"Country\"\n * showAsterisk\n * isSearchable\n * options={countryOptions}\n * errorMessage={errors.country}\n * notFoundText=\"No countries found\"\n * />\n *\n * // Controlled with async search\n * <Select\n * name=\"tag\"\n * label=\"Tag\"\n * value={selectedTag}\n * onChange={setSelectedTag}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction Select(props: SelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = true,\n\t\tdefaultValue = \"\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst selectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst selectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOption, setSelectedOption] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOption;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions === value;\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !selectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tselectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && selectRef.current) selectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOption(\"\");\n\t\t\tif (onChange) onChange(\"\");\n\t\t} else {\n\t\t\tsetSelectedOption(value);\n\t\t\tif (onChange) onChange(value);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<SelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={selectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={selectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceSelectedOptions}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<SelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions !== \"\" && (\n\t\t\t\t\t\t<p className=\"hasValue\">{getOptionLabel(forceSelectedOptions)}</p>\n\t\t\t\t\t)}\n\t\t\t\t\t{forceSelectedOptions === \"\" && <p>{placeholder}</p>}\n\t\t\t\t</SelectContent>\n\n\t\t\t\t<SelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<SelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</SelectOptionsContainer>\n\n\t\t\t\t<SelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<SelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<SelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</SelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Select };\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\n\nimport { Select } from \"../../select\";\nimport { useCalendar } from \"../_calendarProvider\";\nimport \"./styles.css\";\n\ntype CalendarHeaderProps = {\n\tbasicMode: boolean;\n};\n\nfunction CalendarHeader({ basicMode }: CalendarHeaderProps) {\n\tconst calendar = useCalendar();\n\n\tif (basicMode) {\n\t\treturn (\n\t\t\t<div className={`arkynCalendarHeader`}>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.previousMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronLeft />\n\t\t\t\t</button>\n\n\t\t\t\t<p>{calendar.currentDate}</p>\n\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.nextMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronRight />\n\t\t\t\t</button>\n\t\t\t</div>\n\t\t);\n\t}\n\n\treturn (\n\t\t<div className={`arkynCalendarHeader`}>\n\t\t\t<div>\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.previousMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronLeft />\n\t\t\t\t</button>\n\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tclassName=\"arkynCalendarButton\"\n\t\t\t\t\tonClick={() => calendar.nextMonth()}\n\t\t\t\t>\n\t\t\t\t\t<ChevronRight />\n\t\t\t\t</button>\n\t\t\t</div>\n\n\t\t\t<div>\n\t\t\t\t<Select\n\t\t\t\t\tname=\"calendarMonth\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tclassName=\"calendarMonthSelect\"\n\t\t\t\t\tvalue={calendar.currentMonth}\n\t\t\t\t\toptions={calendar.listMonths}\n\t\t\t\t\tonChange={(value) => calendar.changeMonth(+value)}\n\t\t\t\t/>\n\n\t\t\t\t<Select\n\t\t\t\t\tname=\"calendarYear\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tclassName=\"calendarYearSelect\"\n\t\t\t\t\tvalue={calendar.currentYear}\n\t\t\t\t\toptions={calendar.listYears}\n\t\t\t\t\tonChange={(value) => calendar.changeYear(+value)}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { CalendarHeader };\n","import { useCalendar } from \"../_calendarProvider\";\nimport \"./styles.css\";\n\ntype CalendarTableTdProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayType: \"checkedDay\" | \"middleDay\" | \"uncheckedDay\";\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\nfunction CalendarTableTd(props: CalendarTableTdProps) {\n\tconst { day, month, year, dayOwner, dayType } = props;\n\tconst { changeDay } = useCalendar();\n\n\tfunction isToday() {\n\t\tconst today = new Date();\n\t\treturn (\n\t\t\tday === today.getDate() &&\n\t\t\tmonth === today.getMonth() &&\n\t\t\tyear === today.getFullYear()\n\t\t);\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tonClick={() => changeDay(day, month, year)}\n\t\t\tclassName={`arkynCalendarTableTd ${dayOwner} ${dayType} ${isToday() ? \"today\" : \"\"}`}\n\t\t>\n\t\t\t<div className=\"textGroup\">\n\t\t\t\t<span />\n\t\t\t\t<p>{day}</p>\n\t\t\t</div>\n\t\t</td>\n\t);\n}\n\nexport { CalendarTableTd };\n","import { useCalendar } from \"../_calendarProvider\";\nimport { CalendarTableTd } from \"../calendarTableTd\";\nimport \"./styles.css\";\n\nfunction CalendarTableBody() {\n\tconst calendar = useCalendar();\n\n\treturn (\n\t\t<tbody className=\"arkynCalendarTableBody\">\n\t\t\t{calendar.listMatrix.map((week, weekIndex) => (\n\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: week position is stable in monthly matrix\n\t\t\t\t<tr key={`week-${weekIndex}`}>\n\t\t\t\t\t{week.map((props, dayIndex) => (\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: day position is stable in week\n\t\t\t\t\t\t<CalendarTableTd key={`day-${weekIndex}-${dayIndex}`} {...props} />\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t))}\n\t\t</tbody>\n\t);\n}\n\nexport { CalendarTableBody };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype CalendarTableContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction CalendarTableContainer({ children }: CalendarTableContainerProps) {\n\treturn <table className=\"arkynCalendarTableContainer\">{children}</table>;\n}\n\nexport { CalendarTableContainer };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\nimport { useCalendar } from \"../_calendarProvider\";\nimport \"./styles.css\";\n\nfunction CalendarTableHeader() {\n\tconst { listWeek } = useCalendar();\n\n\treturn (\n\t\t<thead className=\"arkynCalendarTableHeader\">\n\t\t\t<tr>\n\t\t\t\t{listWeek.map((day) => (\n\t\t\t\t\t<th key={day}>{formatToCapitalizeFirstWordLetter(day)}</th>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n}\n\nexport { CalendarTableHeader };\n","import { CalendarProvider } from \"./_calendarProvider\";\nimport { CalendarContainer } from \"./calendarContainer\";\nimport { CalendarHeader } from \"./calendarHeader\";\nimport { CalendarTableBody } from \"./calendarTableBody\";\nimport { CalendarTableContainer } from \"./calendarTableContainer\";\nimport { CalendarTableHeader } from \"./calendarTableHeader\";\n\n/**\n * Props for Calendar single-date selection mode.\n */\ntype SingleCalendarProps = {\n\t/** Sets single-date selection mode. */\n\ttype: \"single\";\n\t/**\n\t * Defines the visual/behavioral variant.\n\t * - `basic`: simplified header.\n\t * - `complete`: full navigation experience.\n\t *\n\t * @default \"complete\"\n\t */\n\tvariant?: \"basic\" | \"complete\";\n\t/** Currently selected date. */\n\tvalue?: Date;\n\t/** Initial selected date. */\n\tdefaultValue?: Date;\n\t/** Callback fired when the selected date changes. */\n\tonChange?: (date: Date) => void;\n\t/** Currently focused view date. */\n\tviewValue?: Date;\n\t/** Initial focused view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n};\n\n/**\n * Props for Calendar range selection mode.\n */\ntype RangeCalendarProps = {\n\t/** Sets range selection mode. */\n\ttype: \"range\";\n\t/**\n\t * Defines the visual/behavioral variant.\n\t * - `basic`: simplified header.\n\t * - `complete`: full navigation experience.\n\t *\n\t * @default \"complete\"\n\t */\n\tvariant?: \"basic\" | \"complete\";\n\t/** Currently selected range in `[start, end]` format. */\n\tvalue?: [Date, Date];\n\t/** Initial selected range in `[start, end]` format. */\n\tdefaultValue?: [Date, Date];\n\t/** Callback fired when the selected range changes. */\n\tonChange?: (date: [Date, Date]) => void;\n\t/** Currently focused view date. */\n\tviewValue?: Date;\n\t/** Initial focused view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n};\n\n/**\n * Discriminated union of Calendar props.\n */\ntype CalendarProps = SingleCalendarProps | RangeCalendarProps;\n\n/**\n * Reusable calendar component with support for two selection modes:\n * single date (`single`) and range (`range`).\n *\n * The component encapsulates calendar state and navigation rules through\n * `CalendarProvider`, exposing a simple API for forms, filters,\n * and scheduling flows.\n *\n * @param props Calendar properties (`single` or `range` mode).\n * @returns Calendar UI structure with header and date grid.\n *\n * @example\n * // Single-date selection\n * <Calendar\n * type=\"single\"\n * variant=\"complete\"\n * defaultValue={new Date()}\n * onChange={(date) => {\n * console.log(\"Selected date:\", date);\n * }}\n * onChangeView={(viewDate) => {\n * console.log(\"Current view:\", viewDate);\n * }}\n * />\n *\n * @example\n * // Range selection\n * <Calendar\n * type=\"range\"\n * variant=\"basic\"\n * defaultValue={[new Date(2026, 5, 1), new Date(2026, 5, 15)]}\n * onChange={([start, end]) => {\n * console.log(\"Range:\", start, end);\n * }}\n * onChangeView={(viewDate) => {\n * console.log(\"Focused month:\", viewDate);\n * }}\n * />\n */\nfunction Calendar(props: CalendarProps) {\n\tconst variant = props.variant || \"complete\";\n\n\tif (props.type === \"range\") {\n\t\treturn (\n\t\t\t<CalendarProvider\n\t\t\t\tvalue={props.value}\n\t\t\t\tviewValue={props.viewValue}\n\t\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\t\tdefaultValue={props.defaultValue}\n\t\t\t\tcalendarType=\"range\"\n\t\t\t\tonChange={props.onChange}\n\t\t\t\tonChangeView={props.onChangeView}\n\t\t\t>\n\t\t\t\t<CalendarContainer>\n\t\t\t\t\t<CalendarHeader basicMode={variant.includes(\"basic\")} />\n\t\t\t\t\t<CalendarTableContainer>\n\t\t\t\t\t\t<CalendarTableHeader />\n\t\t\t\t\t\t<CalendarTableBody />\n\t\t\t\t\t</CalendarTableContainer>\n\t\t\t\t</CalendarContainer>\n\t\t\t</CalendarProvider>\n\t\t);\n\t}\n\n\treturn (\n\t\t<CalendarProvider\n\t\t\tvalue={props.value}\n\t\t\tviewValue={props.viewValue}\n\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\tdefaultValue={props.defaultValue}\n\t\t\tcalendarType=\"single\"\n\t\t\tonChange={props.onChange}\n\t\t\tonChangeView={props.onChangeView}\n\t\t>\n\t\t\t<CalendarContainer>\n\t\t\t\t<CalendarHeader basicMode={variant.includes(\"basic\")} />\n\t\t\t\t<CalendarTableContainer>\n\t\t\t\t\t<CalendarTableHeader />\n\t\t\t\t\t<CalendarTableBody />\n\t\t\t\t</CalendarTableContainer>\n\t\t\t</CalendarContainer>\n\t\t</CalendarProvider>\n\t);\n}\n\nexport { Calendar };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype CardTabContextProps = {\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\ntype CardTabProviderProps = {\n\tchildren: ReactNode;\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\nconst CardTabContext = createContext({} as CardTabContextProps);\n\nfunction useCardTab() {\n\treturn useContext(CardTabContext);\n}\n\nfunction CardTabProvider(props: CardTabProviderProps) {\n\tconst { disabled, currentTab, changeCurrentTab } = props;\n\n\tconst value = useMemo(\n\t\t() => ({ disabled, currentTab, changeCurrentTab }),\n\t\t[disabled, currentTab, changeCurrentTab],\n\t);\n\n\treturn (\n\t\t<CardTabContext.Provider value={value}>\n\t\t\t{props.children}\n\t\t</CardTabContext.Provider>\n\t);\n}\n\nexport { CardTabProvider, useCardTab };\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useCardTab } from \"../cardTabContext\";\nimport \"./styles.css\";\n\ntype CardTabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * CardTabButton, individual tab button inside a `CardTabContainer`.\n *\n * Reads active state and disabled state from `CardTabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns CardTabButton JSX element.\n *\n * @example\n * ```tsx\n * <CardTabContainer defaultValue=\"details\" onChange={setTab}>\n * <CardTabButton value=\"details\">Details</CardTabButton>\n * <CardTabButton value=\"history\">History</CardTabButton>\n * <CardTabButton value=\"settings\" disabled>Settings</CardTabButton>\n * </CardTabContainer>\n * ```\n */\n\nfunction CardTabButton(props: CardTabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useCardTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynCardTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { CardTabButton };\n","import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { CardTabProvider } from \"../cardTabContext\";\nimport \"./styles.css\";\n\ntype CardTabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onClick\" | \"children\" | \"ref\" | \"onChange\"\n> & {\n\t/** `CardTabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * CardTabContainer, wrapper that manages active state for a group of `CardTabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `CardTabButton`.\n *\n * @param props.children - `CardTabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns CardTabContainer JSX element.\n *\n * @example\n * ```tsx\n * <CardTabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <CardTabButton value=\"overview\">Overview</CardTabButton>\n * <CardTabButton value=\"analytics\">Analytics</CardTabButton>\n * <CardTabButton value=\"settings\">Settings</CardTabButton>\n * </CardTabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction CardTabContainer(props: CardTabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynCardTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<CardTabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</CardTabProvider>\n\t);\n}\n\nexport { CardTabContainer };\n","import { Check } from \"lucide-react\";\nimport { type ButtonHTMLAttributes, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\n\nimport \"./styles.css\";\n\ntype CheckboxProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t| \"size\"\n\t| \"prefix\"\n\t| \"type\"\n\t| \"name\"\n\t| \"defaultValue\"\n\t| \"value\"\n\t| \"onChange\"\n\t| \"onSelect\"\n\t| \"onClick\"\n> & {\n\t/** Optional label text displayed beside the checkbox. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Validation error message displayed below the checkbox. */\n\terrorMessage?: string;\n\t/**\n\t * Checkbox size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\" | \"sm\";\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Value stored in the hidden input when checked. @default \"checked\" */\n\tvalue?: string;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Callback fired on toggle, receives the value string (or `\"\"` when unchecked). */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * Checkbox, interactive checkbox input with label, validation, and form integration.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the checkbox.\n * @param props.size - Checkbox size (`sm` | `md` | `lg`). Default: \"md\"\n * @param props.value - Value stored when checked. Default: \"checked\"\n * @param props.checked - Controlled checked state.\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.onCheck - Callback fired on toggle, receives value or `\"\"` when unchecked.\n * @param props.errorMessage - Validation error message.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * **...Other valid HTML properties for `<button>` (except `type`, `name`, `defaultValue`, `value`, `onChange`, `onSelect`, `onClick`)**\n *\n * @returns Checkbox JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Checkbox name=\"terms\" label=\"I agree to the terms and conditions\" />\n *\n * // With custom value and error\n * <Checkbox\n * name=\"newsletter\"\n * label=\"Subscribe to newsletter\"\n * value=\"subscribed\"\n * errorMessage={errors.newsletter}\n * />\n *\n * // Controlled\n * <Checkbox\n * name=\"premium\"\n * label=\"Enable premium features\"\n * size=\"lg\"\n * checked={isPremium}\n * onCheck={(v) => setIsPremium(!!v)}\n * />\n * ```\n */\n\nfunction Checkbox(props: CheckboxProps) {\n\tconst {\n\t\tid,\n\t\tname,\n\t\tclassName: wrapperClassName = \"\",\n\t\tsize = \"md\",\n\t\terrorMessage: baseErrorMessage,\n\t\tdefaultChecked = false,\n\t\tlabel,\n\t\tchecked: baseChecked = null,\n\t\tonCheck,\n\t\torientation = \"horizontalReverse\",\n\t\tshowAsterisk,\n\t\tunShowFieldTemplate,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst checkboxRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst checkboxId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked || false);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst currentCheckedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\n\tconst className = `arkynCheckbox ${size} ${errorClass} ${currentCheckedClass}`;\n\n\tfunction handleCheck() {\n\t\tconst defaultChecked = isChecked;\n\t\tsetIsChecked(!defaultChecked);\n\t\tonCheck?.(!defaultChecked ? value || \"checked\" : \"\");\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\tid={checkboxId}\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName={className}\n\t\t\t\tonClick={handleCheck}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={checkboxRef}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : \"\"}\n\t\t\t\t/>\n\n\t\t\t\t<Check />\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Checkbox };\n","import { useSyncExternalStore } from \"react\";\n\nfunction subscribe() {\n\treturn () => {};\n}\n\n/**\n * useHydrated, returns `true` once the component has hydrated on the client, `false` during SSR.\n *\n * Built on `useSyncExternalStore` so it is safe with React 18 concurrent rendering.\n * Use this when you need to defer client-only rendering (e.g. browser APIs, `window`, `navigator`)\n * without causing a hydration mismatch. For most cases, prefer the `ClientOnly` component.\n *\n * @returns `true` on the client after hydration; `false` on the server.\n *\n * @example\n * ```tsx\n * function Map() {\n * const isHydrated = useHydrated();\n * if (!isHydrated) return <Skeleton />;\n * return <MapView accessToken={token} coordinates={coords} />;\n * }\n * ```\n */\n\nfunction useHydrated() {\n\treturn useSyncExternalStore(\n\t\tsubscribe,\n\t\t() => true,\n\t\t() => false,\n\t);\n}\n\nexport { useHydrated };\n","import { useHydrated } from \"../hooks/useHydrated\";\n\ntype ClientOnlyProps = {\n\t/** Render function, called after hydration on the client. Required. */\n\tchildren(): React.ReactNode;\n\t/** Content rendered during SSR or before hydration. @default null */\n\tfallback?: React.ReactNode;\n};\n\n/**\n * ClientOnly, renders its children only after client-side hydration.\n *\n * Prevents React hydration mismatches for components that rely on browser-only APIs\n * (e.g. `window`, `navigator`, `document`). Uses `useHydrated` internally.\n *\n * @param props.children - Render function executed after hydration. Required.\n * @param props.fallback - Content shown during SSR / before hydration. Default: null\n *\n * @returns `children()` after hydration, otherwise `fallback`.\n *\n * @example\n * ```tsx\n * // With a skeleton fallback\n * <ClientOnly fallback={<Skeleton />}>\n * {() => <InteractiveWidget />}\n * </ClientOnly>\n *\n * // Using browser APIs safely\n * <ClientOnly fallback={<p>Loading...</p>}>\n * {() => <p>Current time: {new Date().toLocaleString()}</p>}\n * </ClientOnly>\n * ```\n */\n\nfunction ClientOnly(props: ClientOnlyProps) {\n\tconst { children, fallback = null } = props;\n\treturn useHydrated() ? children() : fallback;\n}\n\nexport { ClientOnly };\n","import { formatToCurrency, removeNonNumeric } from \"@arkyn/shared\";\n\ntype Locale =\n\t| \"USD\"\n\t| \"EUR\"\n\t| \"JPY\"\n\t| \"GBP\"\n\t| \"AUD\"\n\t| \"CAD\"\n\t| \"CHF\"\n\t| \"CNY\"\n\t| \"SEK\"\n\t| \"NZD\"\n\t| \"BRL\"\n\t| \"INR\"\n\t| \"RUB\"\n\t| \"ZAR\"\n\t| \"MXN\"\n\t| \"SGD\"\n\t| \"HKD\"\n\t| \"NOK\"\n\t| \"KRW\"\n\t| \"TRY\"\n\t| \"IDR\"\n\t| \"THB\";\n\nfunction normalizeValue(number: string | number) {\n\tlet safeNumber = number;\n\n\tif (typeof number === \"string\") {\n\t\tsafeNumber = +removeNonNumeric(number);\n\t\tif (safeNumber % 1 !== 0) safeNumber = safeNumber.toFixed(2);\n\t} else {\n\t\tsafeNumber = Number.isInteger(number)\n\t\t\t? Number(number) * 10 ** 2\n\t\t\t: number.toFixed(2);\n\t}\n\n\treturn +removeNonNumeric(String(safeNumber)) / 10 ** 2;\n}\n\nfunction maskCurrencyValues(\n\tinputFieldValue: string | number | undefined,\n\tlocale: Locale,\n): [number, string] {\n\tif (!inputFieldValue) return [0, formatToCurrency(0, locale)];\n\n\tconst value = normalizeValue(inputFieldValue);\n\tconst maskedValue = formatToCurrency(value, locale);\n\n\treturn [value, maskedValue];\n}\n\nexport { maskCurrencyValues, normalizeValue };\n","import { Loader2, type LucideIcon } from \"lucide-react\";\nimport {\n\ttype ChangeEvent,\n\ttype FocusEvent,\n\ttype InputHTMLAttributes,\n\tuseEffect,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\nimport {\n\tmaskCurrencyValues,\n\tnormalizeValue,\n} from \"../../services/maskCurrencyValues\";\n\nimport \"./style.css\";\n\ntype Locale =\n\t| \"USD\"\n\t| \"EUR\"\n\t| \"JPY\"\n\t| \"GBP\"\n\t| \"AUD\"\n\t| \"CAD\"\n\t| \"CHF\"\n\t| \"CNY\"\n\t| \"SEK\"\n\t| \"NZD\"\n\t| \"BRL\"\n\t| \"INR\"\n\t| \"RUB\"\n\t| \"ZAR\"\n\t| \"MXN\"\n\t| \"SGD\"\n\t| \"HKD\"\n\t| \"NOK\"\n\t| \"KRW\"\n\t| \"TRY\"\n\t| \"IDR\"\n\t| \"THB\";\n\ntype CurrencyInputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t| \"size\"\n\t| \"prefix\"\n\t| \"name\"\n\t| \"type\"\n\t| \"max\"\n\t| \"defaultValue\"\n\t| \"value\"\n\t| \"onChange\"\n\t| \"placeholder\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/**\n\t * Currency locale used to format the displayed value.\n\t * Supported: `\"USD\"` | `\"EUR\"` | `\"BRL\"` | `\"JPY\"` | `\"GBP\"` | … (22 locales).\n\t * Required.\n\t */\n\tlocale: Locale;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Validation error message displayed below the input. */\n\terrorMessage?: string;\n\t/** Shows a spinner and disables the input during async operations. @default false */\n\tisLoading?: boolean;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\t/** Text or icon rendered at the far left, outside the input area. */\n\tprefix?: string | LucideIcon;\n\t/** Text or icon rendered at the far right, outside the input area. */\n\tsuffix?: string | LucideIcon;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Lucide icon rendered inside the input on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered inside the input on the right. */\n\trightIcon?: LucideIcon;\n\t/** Maximum numeric value allowed. @default 1_000_000_000 */\n\tmax?: number;\n\t/** Controlled numeric value. */\n\tvalue?: number;\n\t/** Uncontrolled default numeric value. */\n\tdefaultValue?: number;\n\t/**\n\t * Callback fired on value change.\n\t * @param event - Native change event.\n\t * @param originalValue - Raw numeric string (e.g. `\"1234.56\"`).\n\t * @param maskedValue - Formatted display string (e.g. `\"$ 1,234.56\"`).\n\t */\n\tonChange?: (\n\t\tevent: ChangeEvent<HTMLInputElement>,\n\t\toriginalValue: string,\n\t\tmaskedValue: string,\n\t) => void;\n};\n\n/**\n * CurrencyInput, numeric input that automatically formats the displayed value according to a currency locale.\n *\n * The raw numeric value is stored in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.locale - Currency locale (e.g. `\"USD\"`, `\"BRL\"`, `\"EUR\"`). Required.\n * @param props.label - Label text displayed above the input.\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a spinner and disables the input. Default: false\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.max - Maximum numeric value allowed. Default: 1_000_000_000\n * @param props.value - Controlled numeric value.\n * @param props.defaultValue - Uncontrolled default numeric value.\n * @param props.onChange - Callback fired on change, receives the event, the raw numeric string, and the formatted string.\n * @param props.prefix - Text or icon at the far left.\n * @param props.suffix - Text or icon at the far right.\n * @param props.leftIcon - Lucide icon inside the input on the left.\n * @param props.rightIcon - Lucide icon inside the input on the right.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * **...Other valid HTML properties for `<input>` (except `type`, `max`, `value`, `defaultValue`, `onChange`, `placeholder`)**\n *\n * @returns CurrencyInput JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <CurrencyInput name=\"price\" locale=\"USD\" />\n *\n * // With label and validation\n * <CurrencyInput\n * name=\"salary\"\n * locale=\"BRL\"\n * label=\"Monthly Salary\"\n * showAsterisk\n * errorMessage=\"Please enter a valid amount\"\n * />\n *\n * // With max value and controlled state\n * <CurrencyInput\n * name=\"limit\"\n * locale=\"USD\"\n * label=\"Credit Limit\"\n * max={10000}\n * value={creditLimit}\n * onChange={(e, original) => setCreditLimit(Number(original))}\n * />\n * ```\n */\n\nfunction CurrencyInput(props: CurrencyInputProps) {\n\tconst {\n\t\tname,\n\t\tdisabled,\n\t\ttitle,\n\t\tstyle,\n\t\tvariant = \"solid\",\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tvalue,\n\t\tdefaultValue,\n\t\tmax = 1000000000,\n\t\tlocale,\n\t\tonChange,\n\t\tprefix,\n\t\tsuffix,\n\t\tisLoading = false,\n\t\tleftIcon,\n\t\treadOnly,\n\t\tonFocus,\n\t\tonBlur,\n\t\terrorMessage: baseErrorMessage,\n\t\tunShowFieldTemplate,\n\t\torientation,\n\t\tshowAsterisk,\n\t\trightIcon,\n\t\tsize = \"md\",\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [maskedValue, setMaskedValue] = useState(\"0\");\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingPosition = rightIcon ? \"right\" : \"left\";\n\n\tconst showLeftSpinner = loadingPosition === \"left\" && isLoading;\n\tconst showRightSpinner = loadingPosition === \"right\" && isLoading;\n\n\tfunction handleSectionClick() {\n\t\tif (isDisabled || !inputRef?.current) return;\n\t\tsetIsFocused(true);\n\t\tinputRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\tconst updateValues = (originalValue: string | number) => {\n\t\tconst [calculatedValue, calculatedMaskedValue] = maskCurrencyValues(\n\t\t\toriginalValue,\n\t\t\tlocale,\n\t\t);\n\n\t\tif (!max || calculatedValue <= max) {\n\t\t\tsetMaskedValue(calculatedMaskedValue);\n\t\t\treturn [calculatedValue, calculatedMaskedValue];\n\t\t}\n\n\t\treturn maskCurrencyValues(originalValue, locale);\n\t};\n\n\tconst handleChange = (event: ChangeEvent<HTMLInputElement>) => {\n\t\tevent.preventDefault();\n\t\tconst [originalValue, maskedValue] = updateValues(event.target.value);\n\n\t\tonChange?.(event, String(originalValue), String(maskedValue));\n\t};\n\n\tuseEffect(() => {\n\t\tfunction currentValue() {\n\t\t\tif (typeof value === \"number\") return value;\n\t\t\tif (typeof defaultValue === \"number\") return defaultValue;\n\t\t\treturn undefined;\n\t\t}\n\n\t\tconst [, maskedValue] = maskCurrencyValues(currentValue(), locale);\n\n\t\tsetMaskedValue(maskedValue);\n\t}, [locale, defaultValue, value]);\n\n\tconst hasPrefix = prefix ? \"hasPrefix\" : \"\";\n\tconst hasSuffix = suffix ? \"hasSuffix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = isDisabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynCurrencyInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tclassName={className}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t>\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showLeftSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />\n\n\t\t\t\t<input\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tplaceholder={isDisabled ? maskedValue : undefined}\n\t\t\t\t\tvalue={isDisabled ? undefined : maskedValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={normalizeValue(maskedValue)}\n\t\t\t\t\treadOnly\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showRightSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={suffix} className=\"suffix\" />\n\t\t\t</section>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { CurrencyInput };\n","import { type ReactNode, useEffect, useRef, useState } from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\n\nimport \"./styles.css\";\n\ntype DatePickerCalendarContainerProps = {\n\tisFocused: boolean;\n\tchildren: ReactNode;\n};\n\nfunction DatePickerCalendarContainer(props: DatePickerCalendarContainerProps) {\n\tconst { children, isFocused } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tuseScrollLock(isFocused);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 420;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isFocused]);\n\n\tif (!isFocused) return null;\n\n\treturn (\n\t\t<div\n\t\t\tref={containerRef}\n\t\t\tclassName={`arkynDatePickerCalendarContainer ${position}`}\n\t\t>\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { DatePickerCalendarContainer };\n","import { ChevronDown } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype DatePickerChevronProps = {\n\tisLoading: boolean;\n\ticonSize: number;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisFocused: boolean;\n};\n\nfunction DatePickerChevron(props: DatePickerChevronProps) {\n\tconst { iconSize, isLoading, disabled, readOnly, isFocused } = props;\n\n\tconst notAnimate = disabled || readOnly ? \"notAnimate\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynDatePickerChevron ${notAnimate} ${focused}`;\n\n\tif (isLoading) return null;\n\treturn (\n\t\t<ChevronDown\n\t\t\tclassName={className}\n\t\t\tstrokeWidth={2.5}\n\t\t\tstyle={{\n\t\t\t\tminWidth: iconSize,\n\t\t\t\tminHeight: iconSize,\n\t\t\t\tmaxWidth: iconSize,\n\t\t\t\tmaxHeight: iconSize,\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport { DatePickerChevron };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype DatePickerContainerProps = {\n\tchildren: ReactNode;\n\thandleContainerFocus: () => void;\n\tprefixExists: boolean;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tid: string;\n\tvariant: \"solid\" | \"outline\" | \"underline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction DatePickerContainer(props: DatePickerContainerProps) {\n\tconst {\n\t\tchildren,\n\t\thandleContainerFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName,\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t\tid,\n\t\tprefixExists,\n\t} = props;\n\n\tconst hasPrefix = prefixExists ? \"hasPrefix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\treturn (\n\t\t<section\n\t\t\tid={id}\n\t\t\tclassName={`arkynDatePickerContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`}\n\t\t\tonClick={handleContainerFocus}\n\t\t>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { DatePickerContainer };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype DatePickerContentProps = {\n\tchildren: ReactNode;\n\tsize: \"md\" | \"lg\";\n};\n\nfunction DatePickerContent(props: DatePickerContentProps) {\n\tconst { children, size } = props;\n\tconst className = `arkynDatePickerContent ${size}`;\n\treturn <div className={className}>{children}</div>;\n}\n\nexport { DatePickerContent };\n","import \"./styles.css\";\n\ntype DatePickerOverlayProps = {\n\tisFocused: boolean;\n\thandleBlur: () => void;\n};\n\nfunction DatePickerOverlay(props: DatePickerOverlayProps) {\n\tconst { isFocused, handleBlur } = props;\n\tif (!isFocused) return null;\n\treturn <aside className=\"arkynDatePickerOverlay\" onClick={handleBlur} />;\n}\n\nexport { DatePickerOverlay };\n","import { Loader2 } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype DatePickerSpinnerProps = {\n\ticonSize: number;\n\tisLoading: boolean;\n};\n\nfunction DatePickerSpinner(props: DatePickerSpinnerProps) {\n\tconst { iconSize, isLoading } = props;\n\n\tif (!isLoading) return null;\n\treturn (\n\t\t<Loader2\n\t\t\tclassName=\"arkynDatePickerSpinner\"\n\t\t\tsize={iconSize}\n\t\t\tstrokeWidth={2.5}\n\t\t/>\n\t);\n}\n\nexport { DatePickerSpinner };\n","import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { Calendar } from \"../calendar\";\n\nimport { DatePickerCalendarContainer } from \"./datePickerCalendarContainer\";\nimport { DatePickerChevron } from \"./datePickerChevron\";\nimport { DatePickerContainer } from \"./datePickerContainer\";\nimport { DatePickerContent } from \"./datePickerContent\";\nimport { DatePickerOverlay } from \"./datePickerOverlay\";\nimport { DatePickerSpinner } from \"./datePickerSpinner\";\n\nfunction toInputDateValue(date: Date) {\n\tconst pad = (value: number) => String(value).padStart(2, \"0\");\n\treturn `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())}`;\n}\n\nfunction toDisplayDateValue(date: Date) {\n\treturn date.toLocaleDateString(\"pt-BR\");\n}\n\ntype BaseDatePickerProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the date picker. */\n\tlabel?: string;\n\t/** Validation error message displayed below the date picker. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no date is selected. @default \"Selecione uma data...\" */\n\tplaceholder?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Closes the calendar after a date is picked.\n\t * @default true for `single`, `false` for `range`.\n\t */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the date picker gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the date picker loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * DatePicker size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the date picker area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the date picker on the left. */\n\tleftIcon?: LucideIcon;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"vertical\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n\t/**\n\t * Visual/behavioral variant forwarded to the internal `Calendar`.\n\t * @default \"complete\"\n\t */\n\tcalendarVariant?: \"basic\" | \"complete\";\n};\n\n/**\n * Props for DatePicker single-date selection mode.\n */\ntype SingleDatePickerProps = BaseDatePickerProps & {\n\t/** Sets single-date selection mode. */\n\ttype: \"single\";\n\t/** Controlled selected date. */\n\tvalue?: Date;\n\t/** Uncontrolled default selected date. */\n\tdefaultValue?: Date;\n\t/** Callback fired when the selected date changes. */\n\tonChange?: (date: Date) => void;\n\t/** Currently focused calendar view date. */\n\tviewValue?: Date;\n\t/** Initial focused calendar view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the calendar view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n};\n\n/**\n * Props for DatePicker range selection mode.\n */\ntype RangeDatePickerProps = BaseDatePickerProps & {\n\t/** Sets range selection mode. */\n\ttype: \"range\";\n\t/** Controlled selected range in `[start, end]` format. */\n\tvalue?: [Date, Date];\n\t/** Uncontrolled default range in `[start, end]` format. */\n\tdefaultValue?: [Date, Date];\n\t/** Callback fired when the selected range changes. */\n\tonChange?: (date: [Date, Date]) => void;\n\t/** Currently focused calendar view date. */\n\tviewValue?: Date;\n\t/** Initial focused calendar view date. */\n\tdefaultViewValue?: Date;\n\t/** Callback fired when the calendar view (month/year) changes. */\n\tonChangeView?: (date: Date) => void;\n\t/** Text placed between the start and end dates. @default \" até \" */\n\trangeSeparator?: string;\n};\n\n/**\n * Discriminated union of DatePicker props.\n */\ntype DatePickerProps = SingleDatePickerProps | RangeDatePickerProps;\n\n/**\n * DatePicker, date input field with a popover `Calendar`, supporting single-date\n * (`single`) and range (`range`) selection modes.\n *\n * Opens the calendar on click, the same way `Select` opens its options list, flipping\n * upward or downward depending on the available viewport space so it never renders\n * off-screen. Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.type - Selection mode (`single` | `range`). Required.\n * @param props.value - Controlled selected date (`single`) or range (`range`).\n * @param props.defaultValue - Uncontrolled default date or range.\n * @param props.label - Label text displayed above the date picker.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione uma data...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the calendar after picking. Default: `true` for `single`, `false` for `range`.\n * @param props.onChange - Callback fired when the selected date/range changes.\n * @param props.calendarVariant - Visual/behavioral variant of the internal `Calendar`. Default: \"complete\"\n * @param props.size - DatePicker size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"vertical\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns DatePicker JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Single date\n * <DatePicker\n * type=\"single\"\n * name=\"birthDate\"\n * label=\"Data de nascimento\"\n * onChange={(date) => console.log(\"Selected date:\", date)}\n * />\n *\n * // Range\n * <DatePicker\n * type=\"range\"\n * name=\"stay\"\n * label=\"Período da estadia\"\n * calendarVariant=\"basic\"\n * onChange={([start, end]) => console.log(\"Range:\", start, end)}\n * />\n * ```\n */\nfunction DatePicker(props: DatePickerProps) {\n\tconst {\n\t\tname,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione uma data...\",\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonFocus,\n\t\tonBlur,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t\tcalendarVariant = \"complete\",\n\t} = props;\n\n\tconst closeOnSelect = props.closeOnSelect ?? props.type === \"single\";\n\n\tconst { fieldErrors } = useForm();\n\n\tconst datePickerRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst datePickerId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [internalSingleValue, setInternalSingleValue] = useState<\n\t\tDate | undefined\n\t>(props.type === \"single\" ? props.defaultValue : undefined);\n\tconst [internalRangeValue, setInternalRangeValue] = useState<\n\t\t[Date, Date] | undefined\n\t>(props.type === \"range\" ? props.defaultValue : undefined);\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !datePickerRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tdatePickerRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && datePickerRef.current) datePickerRef.current.blur();\n\t}\n\n\tfunction handleChangeSingleDate(date: Date) {\n\t\tif (value === undefined) setInternalSingleValue(date);\n\t\tif (props.type === \"single\") props.onChange?.(date);\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tfunction handleChangeRangeDate(range: [Date, Date]) {\n\t\tif (value === undefined) setInternalRangeValue(range);\n\t\tif (props.type === \"range\") props.onChange?.(range);\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tif (props.type === \"range\") {\n\t\tconst rangeSeparator = props.rangeSeparator ?? \" até \";\n\t\tconst forceValue =\n\t\t\tvalue !== undefined ? (value as [Date, Date]) : internalRangeValue;\n\n\t\tconst hiddenInputValue = forceValue\n\t\t\t? JSON.stringify([\n\t\t\t\t\ttoInputDateValue(forceValue[0]),\n\t\t\t\t\ttoInputDateValue(forceValue[1]),\n\t\t\t\t])\n\t\t\t: \"\";\n\n\t\treturn (\n\t\t\t<FieldTemplate\n\t\t\t\tname={name}\n\t\t\t\tlabel={label}\n\t\t\t\tshowAsterisk={showAsterisk}\n\t\t\t\tclassName={wrapperClassName}\n\t\t\t\terrorMessage={errorMessage}\n\t\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\t\torientation={orientation}\n\t\t\t>\n\t\t\t\t<DatePickerContainer\n\t\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisError={isError}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tvariant={variant}\n\t\t\t\t\tprefixExists={!!prefix}\n\t\t\t\t\tid={datePickerId}\n\t\t\t\t>\n\t\t\t\t\t<input\n\t\t\t\t\t\tref={datePickerRef}\n\t\t\t\t\t\tname={name}\n\t\t\t\t\t\tvalue={hiddenInputValue}\n\t\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t\t<DatePickerContent size={size}>\n\t\t\t\t\t\t{forceValue ? (\n\t\t\t\t\t\t\t<p className=\"hasValue\">\n\t\t\t\t\t\t\t\t{toDisplayDateValue(forceValue[0])}\n\t\t\t\t\t\t\t\t{rangeSeparator}\n\t\t\t\t\t\t\t\t{toDisplayDateValue(forceValue[1])}\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t<p>{placeholder}</p>\n\t\t\t\t\t\t)}\n\t\t\t\t\t</DatePickerContent>\n\n\t\t\t\t\t<DatePickerCalendarContainer isFocused={isFocused}>\n\t\t\t\t\t\t<Calendar\n\t\t\t\t\t\t\ttype=\"range\"\n\t\t\t\t\t\t\tvariant={calendarVariant}\n\t\t\t\t\t\t\tvalue={forceValue}\n\t\t\t\t\t\t\tonChange={handleChangeRangeDate}\n\t\t\t\t\t\t\tviewValue={props.viewValue}\n\t\t\t\t\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\t\t\t\t\tonChangeView={props.onChangeView}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</DatePickerCalendarContainer>\n\n\t\t\t\t\t<DatePickerChevron\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t/>\n\n\t\t\t\t\t<DatePickerSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t\t<DatePickerOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t\t</DatePickerContainer>\n\t\t\t</FieldTemplate>\n\t\t);\n\t}\n\n\tconst forceValue =\n\t\tvalue !== undefined ? (value as Date) : internalSingleValue;\n\n\tconst hiddenInputValue = forceValue ? toInputDateValue(forceValue) : \"\";\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<DatePickerContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={datePickerId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={datePickerRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={hiddenInputValue}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<DatePickerContent size={size}>\n\t\t\t\t\t{forceValue ? (\n\t\t\t\t\t\t<p className=\"hasValue\">{toDisplayDateValue(forceValue)}</p>\n\t\t\t\t\t) : (\n\t\t\t\t\t\t<p>{placeholder}</p>\n\t\t\t\t\t)}\n\t\t\t\t</DatePickerContent>\n\n\t\t\t\t<DatePickerCalendarContainer isFocused={isFocused}>\n\t\t\t\t\t<Calendar\n\t\t\t\t\t\ttype=\"single\"\n\t\t\t\t\t\tvariant={calendarVariant}\n\t\t\t\t\t\tvalue={forceValue}\n\t\t\t\t\t\tonChange={handleChangeSingleDate}\n\t\t\t\t\t\tviewValue={props.viewValue}\n\t\t\t\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\t\t\t\tonChangeView={props.onChangeView}\n\t\t\t\t\t/>\n\t\t\t\t</DatePickerCalendarContainer>\n\n\t\t\t\t<DatePickerChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<DatePickerSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<DatePickerOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</DatePickerContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { DatePicker };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype DrawerContextProps = {\n\tmakeInvisible: () => void;\n};\n\ntype DrawerProviderProps = {\n\tchildren: ReactNode;\n\tmakeInvisible: () => void;\n};\n\nconst drawerContext = createContext({} as DrawerContextProps);\n\nfunction DrawerProvider(props: DrawerProviderProps) {\n\tconst value = useMemo(\n\t\t() => ({ makeInvisible: props.makeInvisible }),\n\t\t[props.makeInvisible],\n\t);\n\n\treturn (\n\t\t<drawerContext.Provider value={value}>\n\t\t\t{props.children}\n\t\t</drawerContext.Provider>\n\t);\n}\n\nfunction useDrawer() {\n\treturn useContext(drawerContext);\n}\n\nexport { DrawerProvider, useDrawer };\n","import {\n\ttype AnimationEvent,\n\ttype HTMLAttributes,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { DrawerProvider } from \"../drawerContext\";\nimport \"./styles.css\";\n\ntype DrawerContainerProps = HTMLAttributes<HTMLElement> & {\n\t/** Controls whether the drawer is visible. */\n\tisVisible: boolean;\n\t/** Callback invoked when the overlay is clicked to close the drawer. */\n\tmakeInvisible: () => void;\n\t/** Side from which the drawer slides in. @default \"left\" */\n\torientation?: \"left\" | \"right\";\n};\n\n/**\n * DrawerContainer, animated slide-in panel rendered over an overlay backdrop.\n *\n * Locks body scroll while open. Closes when the overlay is clicked.\n * Provides context consumed by `DrawerHeader` (close button).\n *\n * @param props.isVisible - Whether the drawer is open. Required.\n * @param props.makeInvisible - Called when the overlay or close button is clicked. Required.\n * @param props.orientation - Slide direction. Default: `\"left\"`\n *\n * **...Other valid HTML `<aside>` properties**\n *\n * @returns DrawerContainer JSX element.\n *\n * @example\n * ```tsx\n * const [isOpen, setIsOpen] = useState(false);\n *\n * <DrawerContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)} orientation=\"right\">\n * <DrawerHeader><h2>Navigation</h2></DrawerHeader>\n * <nav>...</nav>\n * </DrawerContainer>\n * ```\n */\n\nfunction DrawerContainer(props: DrawerContainerProps) {\n\tconst {\n\t\tisVisible,\n\t\tmakeInvisible,\n\t\torientation = \"left\",\n\t\tchildren,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [mounted, setMounted] = useState(isVisible);\n\tconst [isExiting, setIsExiting] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (isVisible) {\n\t\t\tsetMounted(true);\n\t\t\tsetIsExiting(false);\n\t\t} else if (mounted) {\n\t\t\tsetIsExiting(true);\n\t\t}\n\t}, [isVisible, mounted]);\n\n\tuseScrollLock(isVisible);\n\n\tfunction handleOverlayAnimationEnd(e: AnimationEvent<HTMLDivElement>) {\n\t\tif (e.target === e.currentTarget && isExiting) {\n\t\t\tsetIsExiting(false);\n\t\t\tsetMounted(false);\n\t\t\tmakeInvisible();\n\t\t}\n\t}\n\n\tif (!mounted) return null;\n\n\tconst className = [\n\t\t\"arkynDrawerContainer\",\n\t\torientation,\n\t\tisExiting ? \"exiting\" : \"\",\n\t\tbaseClassName,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\n\treturn (\n\t\t<DrawerProvider makeInvisible={() => setIsExiting(true)}>\n\t\t\t<aside className={className} {...rest}>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"arkynDrawerContainerOverlay\"\n\t\t\t\t\tonClick={() => setIsExiting(true)}\n\t\t\t\t\tonAnimationEnd={handleOverlayAnimationEnd}\n\t\t\t\t/>\n\t\t\t\t<div className=\"arkynDrawerContainerContent\">{children}</div>\n\t\t\t</aside>\n\t\t</DrawerProvider>\n\t);\n}\n\nexport { DrawerContainer };\n","import { X } from \"lucide-react\";\nimport type { HTMLAttributes } from \"react\";\n\nimport { useDrawer } from \"../drawerContext\";\nimport \"./styles.css\";\n\ntype DrawerHeaderProps = HTMLAttributes<HTMLElement> & {\n\t/** Whether to render the X close button. @default true */\n\tshowCloseButton?: boolean;\n};\n\n/**\n * DrawerHeader, header section for a `DrawerContainer`, with an optional close button.\n *\n * The close button calls `makeInvisible` from the nearest `DrawerContainer` context.\n * Must be rendered inside a `DrawerContainer`.\n *\n * @param props.showCloseButton - Renders the X close button. Default: true\n *\n * **...Other valid HTML `<header>` properties**\n *\n * @returns DrawerHeader JSX element.\n *\n * @example\n * ```tsx\n * <DrawerContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>\n * <DrawerHeader>\n * <h2>Navigation</h2>\n * </DrawerHeader>\n * <nav>...</nav>\n * </DrawerContainer>\n * ```\n */\n\nfunction DrawerHeader(props: DrawerHeaderProps) {\n\tconst {\n\t\tshowCloseButton = true,\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst { makeInvisible } = useDrawer();\n\tconst className = `arkynDrawerHeader ${baseClassName}`;\n\n\treturn (\n\t\t<header className={className.trim()} {...rest}>\n\t\t\t{children}\n\n\t\t\t{showCloseButton && (\n\t\t\t\t<button\n\t\t\t\t\tclassName=\"arkynDrawerHeaderCloseButton\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={makeInvisible}\n\t\t\t\t\taria-label=\"Close drawer\"\n\t\t\t\t>\n\t\t\t\t\t<X size={24} />\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</header>\n\t);\n}\n\nexport { DrawerHeader };\n","import type { Fbq } from \"../../types/defineType\";\n\ntype Options = {\n\tautoConfig?: boolean;\n\tdebug?: boolean;\n};\n\nclass FacebookPixel {\n\tpixelId: string;\n\tautoConfig: boolean;\n\tinitialized: boolean;\n\n\tconstructor(pixelId: string, options?: Options) {\n\t\tthis.pixelId = pixelId;\n\t\tthis.autoConfig = options?.autoConfig || true;\n\t\tthis.initialized = false;\n\t}\n\n\tprivate loadFacebookPixel() {\n\t\t// Verifica se o objeto fbq já está definido no objeto window\n\t\tif (window.fbq) return;\n\n\t\t// Define a função fbq que será usada para enviar eventos ao Facebook Pixel\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tconst fbq: Fbq = ((...args: any[]) => {\n\t\t\t// Se fbq.callMethod estiver definido, chama o método com os argumentos fornecidos\n\t\t\t// Caso contrário, adiciona os argumentos à fila de eventos\n\t\t\tfbq.callMethod ? fbq.callMethod.apply(fbq, args) : fbq.queue.push(args);\n\t\t}) as Fbq;\n\n\t\t// Se o objeto _fbq não estiver definido no objeto window, define-o como fbq\n\t\tif (!window._fbq) window._fbq = fbq;\n\n\t\t// Define propriedades e métodos adicionais para fbq\n\t\tfbq.push = fbq;\n\t\tfbq.loaded = true;\n\t\tfbq.version = \"2.0\";\n\t\tfbq.queue = [];\n\n\t\t// Cria um elemento script e define o atributo src como o URL do script do Facebook Pixel\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.async = true;\n\t\tscript.src = \"https://connect.facebook.net/en_US/fbevents.js\";\n\n\t\t// Busca o primeiro elemento script no documento\n\t\tconst firstScript = document.getElementsByTagName(\"script\")[0];\n\n\t\t// Estoura uma exceção se não houver nenhum elemento script no documento\n\t\tif (!firstScript.parentNode) {\n\t\t\tthrow new Error(\"No script tag found in the document\");\n\t\t}\n\n\t\t// Insere o elemento script no início do documento\n\t\tfirstScript.parentNode.insertBefore(script, firstScript);\n\t\twindow.fbq = fbq;\n\t}\n\n\tinit(advancedMatching: object = {}) {\n\t\t// Verifica se o pixel já foi inicializado\n\t\tthis.initialized = typeof window !== \"undefined\" && !!window.fbq;\n\n\t\t// Carrega o Facebook Pixel\n\t\tthis.loadFacebookPixel();\n\n\t\t// Estoura uma exceção se o fbq não estiver definido\n\t\tif (!window.fbq) {\n\t\t\tthrow new Error(\"window.fbq is not defined\");\n\t\t}\n\n\t\t// Inicializa o pixel com o ID fornecido\n\t\tif (this.autoConfig === false) {\n\t\t\twindow.fbq(\"set\", \"autoConfig\", false, this.pixelId);\n\t\t} else {\n\t\t\twindow.fbq(\"init\", this.pixelId, advancedMatching);\n\t\t}\n\n\t\t// Marca o pixel como inicializado\n\t\tthis.initialized = true;\n\t}\n\n\tpageView() {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"track\", \"PageView\");\n\t}\n\n\ttrack(title: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"track\", title, data);\n\t}\n\n\ttrackSingle(pixel: string, title: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"trackSingle\", pixel, title, data);\n\t}\n\n\ttrackCustom(event: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"trackCustom\", event, data);\n\t}\n\n\ttrackSingleCustom(pixel: string, event: string, data?: object) {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"trackSingle\", pixel, event, data);\n\t}\n\n\tgrantConsent() {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"consent\", \"grant\");\n\t}\n\n\trevokeConsent() {\n\t\tif (!this.initialized) return;\n\t\tif (!window.fbq) return;\n\n\t\twindow.fbq(\"consent\", \"revoke\");\n\t}\n}\n\nexport { FacebookPixel };\n","import type { FacebookPixelProps } from \".\";\nimport { FacebookPixel } from \"./pixel\";\n\nfunction FacebookPixelClient(props: FacebookPixelProps) {\n\tconst {\n\t\tpixelId,\n\t\toptions,\n\t\tpageView,\n\t\ttrack,\n\t\ttrackCustom,\n\t\ttrackSingle,\n\t\ttrackSingleCustom,\n\t\tgrantConsent,\n\t\trevokeConsent,\n\t} = props;\n\n\tconst pixel = new FacebookPixel(pixelId, options);\n\n\tpixel.init();\n\n\tif (pageView) pixel.pageView();\n\tif (grantConsent) pixel.grantConsent();\n\tif (revokeConsent) pixel.revokeConsent();\n\n\tif (track) pixel.track(...track);\n\tif (trackCustom) pixel.trackCustom(...trackCustom);\n\tif (trackSingle) pixel.trackSingle(pixelId, ...trackSingle);\n\tif (trackSingleCustom) pixel.trackSingleCustom(pixelId, ...trackSingleCustom);\n\n\treturn null;\n}\n\nexport { FacebookPixelClient };\n","import { ClientOnly } from \"../clientOnly\";\nimport { FacebookPixelClient } from \"./facebookPixel.client\";\n\ntype FacebookPixelProps = {\n\t/** Facebook Pixel ID from your Ads Manager account. Required. */\n\tpixelId: string;\n\t/** When true, renders the pixel in development mode (bypasses the production check). @default false */\n\tshowInDevMode?: boolean;\n\t/** Pixel initialization options. */\n\toptions?: {\n\t\t/** Enables automatic configuration. @default true */\n\t\tautoConfig?: boolean;\n\t\t/** Enables debug logging in the browser console. @default false */\n\t\tdebug?: boolean;\n\t};\n\t/** When true, fires a standard `PageView` event on mount. */\n\tpageView?: boolean;\n\t/** When true, grants cookie/tracking consent via `fbq(\"consent\", \"grant\")`. */\n\tgrantConsent?: boolean;\n\t/** When true, revokes cookie/tracking consent via `fbq(\"consent\", \"revoke\")`. */\n\trevokeConsent?: boolean;\n\t/** Standard event to track: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrack?: [string, any?];\n\t/** Custom event to track: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrackCustom?: [string, any?];\n\t/** Single-pixel standard event: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrackSingle?: [string, any?];\n\t/** Single-pixel custom event: `[eventName, eventData?]`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\ttrackSingleCustom?: [string, any?];\n};\n\n/**\n * FacebookPixel, injects the Facebook Pixel tracking script client-side.\n *\n * Renders nothing in development mode unless `showInDevMode` is `true`.\n * Wrapped in `ClientOnly` to avoid SSR errors.\n *\n * @param props.pixelId - Facebook Pixel ID. Required.\n * @param props.showInDevMode - Renders in development mode. Default: false\n * @param props.pageView - Fires a `PageView` event on mount.\n * @param props.grantConsent - Grants tracking consent.\n * @param props.revokeConsent - Revokes tracking consent.\n * @param props.track - Standard event to fire: `[eventName, params?]`.\n * @param props.trackCustom - Custom event to fire: `[eventName, params?]`.\n *\n * @returns Empty fragment in dev mode; otherwise the pixel script component.\n *\n * @example\n * ```tsx\n * // Basic page view tracking in root layout\n * <FacebookPixel pixelId=\"123456789012345\" pageView />\n *\n * // With LGPD consent handling\n * <FacebookPixel\n * pixelId=\"123456789012345\"\n * pageView\n * grantConsent={userAcceptedCookies}\n * />\n *\n * // Track a purchase event\n * <FacebookPixel\n * pixelId=\"123456789012345\"\n * track={[\"Purchase\", { value: 99.90, currency: \"BRL\" }]}\n * />\n * ```\n */\nfunction FacebookPixel(props: FacebookPixelProps) {\n\tif (process.env.NODE_ENV !== \"production\" && !props.showInDevMode) {\n\t\treturn null;\n\t}\n\n\treturn <ClientOnly>{() => <FacebookPixelClient {...props} />}</ClientOnly>;\n}\n\nexport { FacebookPixel, type FacebookPixelProps };\n","import {\n\tFile,\n\tFileArchive,\n\tFileAudio,\n\tFileImage,\n\tRefreshCw,\n} from \"lucide-react\";\n\nimport { Button } from \"../../button\";\nimport { Divider } from \"../../divider\";\nimport { IconButton } from \"../../iconButton\";\nimport { Tooltip } from \"../../tooltip\";\n\nimport \"./styles.css\";\n\ntype HasFileContentProps = {\n\tdisabled: boolean;\n\tacceptFile: string;\n\tisLoading: boolean;\n\tchangeFileButtonText: string;\n\tfile: File;\n\treSendFile?: () => void;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction HasFileContent(props: HasFileContentProps) {\n\tconst {\n\t\tdisabled,\n\t\tfile,\n\t\tisLoading,\n\t\tacceptFile,\n\t\tchangeFileButtonText,\n\t\thandleSelectFile,\n\t\treSendFile,\n\t} = props;\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptFile;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\tfunction FileIcon() {\n\t\tif (file.type.startsWith(\"image/\")) return <FileImage />;\n\t\tif (file.type.startsWith(\"audio/\")) return <FileAudio />;\n\t\tif (file.type.startsWith(\"application/zip\")) return <FileArchive />;\n\t\treturn <File />;\n\t}\n\n\treturn (\n\t\t<div className=\"arkynFileUploadHasFileContent\">\n\t\t\t<section className=\"arkynFileUploadFileContainer\">\n\t\t\t\t<FileIcon />\n\t\t\t\t<p>{file.name}</p>\n\t\t\t</section>\n\n\t\t\t<Divider />\n\n\t\t\t<div className=\"arkynFileUploadButtonsContainer\">\n\t\t\t\t{!!reSendFile && (\n\t\t\t\t\t<Tooltip orientation=\"bottom\" text=\"Reenviar arquivo\">\n\t\t\t\t\t\t<IconButton\n\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\taria-label=\"resend file\"\n\t\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\t\tonClick={reSendFile}\n\t\t\t\t\t\t\ticon={RefreshCw}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t)}\n\n\t\t\t\t<Button\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\tonClick={handleClick}\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t>\n\t\t\t\t\t{changeFileButtonText}\n\t\t\t\t</Button>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { HasFileContent };\n","import type { DragEvent } from \"react\";\n\nimport { Button } from \"../../button\";\nimport \"./styles.css\";\n\ntype NoFileContentProps = {\n\tdisabled: boolean;\n\tacceptFile: string;\n\tisLoading: boolean;\n\tselectFileButtonText: string;\n\tdropFileText: string;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction NoFileContent(props: NoFileContentProps) {\n\tconst {\n\t\tdropFileText,\n\t\tisLoading,\n\t\tacceptFile,\n\t\thandleSelectFile,\n\t\tselectFileButtonText,\n\t\tdisabled,\n\t} = props;\n\n\tfunction handleDrop(event: DragEvent<HTMLDivElement>) {\n\t\tif (disabled) return;\n\n\t\tevent.preventDefault();\n\t\tconst file = event.dataTransfer.files[0];\n\t\tif (file) handleSelectFile(file);\n\t}\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptFile;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div onDrop={handleDrop} className=\"arkynFileUploadNoFileContent\">\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{selectFileButtonText}\n\t\t\t</Button>\n\n\t\t\t<p>{dropFileText}</p>\n\t\t</div>\n\t);\n}\n\nexport { NoFileContent };\n","import { useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\n\nimport { HasFileContent } from \"./hasFileContent\";\nimport { NoFileContent } from \"./noFileContent\";\nimport \"./styles.css\";\n\ntype FileUploadProps = {\n\t/** Field name for form submission (stores the uploaded file URL). Required. */\n\tname: string;\n\t/** Server endpoint URL that receives the `multipart/form-data` upload request. Required. */\n\taction: string;\n\t/** Disables file selection and upload. @default false */\n\tdisabled?: boolean;\n\t/** Optional label text displayed above the upload area. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n\t/** Label for the file-picker button after a file is selected. @default \"Alterar arquivo\" */\n\tchangeFileButtonText?: string;\n\t/** Label for the file-picker button before a file is selected. @default \"Selecionar arquivo\" */\n\tselectFileButtonText?: string;\n\t/** Text displayed in the drag-and-drop zone. @default \"Ou arraste e solte o arquivo aqui\" */\n\tdropFileText?: string;\n\t/** HTTP method for the upload request. @default \"POST\" */\n\tmethod?: string;\n\t/** Form-data field name used for the file. @default \"file\" */\n\tfileName?: string;\n\t/** Property name in the server response that contains the file URL. @default \"url\" */\n\tfileResponseName?: string;\n\t/** Accepted file MIME types or extensions (e.g. `\".pdf\"`, `\"image/*\"`). @default \"*\" */\n\tacceptFile?: string;\n\t/** Callback fired after a successful upload. Receives the URL returned by the server. */\n\tonChange?: (url?: string) => void;\n};\n\n/**\n * FileUpload, drag-and-drop file uploader with server upload and file-name preview.\n *\n * Sends the file via `fetch` as `multipart/form-data` and stores the returned URL\n * in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.action - Upload endpoint URL. Required.\n * @param props.disabled - Disables file selection and upload. Default: false\n * @param props.label - Label text displayed above the upload area.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.acceptFile - Accepted MIME types or extensions. Default: \"*\"\n * @param props.method - HTTP method. Default: \"POST\"\n * @param props.fileName - Form-data field name for the file. Default: \"file\"\n * @param props.fileResponseName - Server response property containing the URL. Default: \"url\"\n * @param props.onChange - Callback fired after a successful upload, receives the file URL.\n *\n * @returns FileUpload JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <FileUpload name=\"document\" action=\"/api/upload\" />\n *\n * // PDF only with label and callback\n * <FileUpload\n * name=\"contract\"\n * action=\"/api/upload/docs\"\n * label=\"Contract (PDF)\"\n * showAsterisk\n * acceptFile=\".pdf\"\n * fileResponseName=\"documentUrl\"\n * onChange={(url) => setContractUrl(url)}\n * />\n * ```\n */\n\nfunction FileUpload(props: FileUploadProps) {\n\tconst {\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk = false,\n\t\taction,\n\t\tfileName = \"file\",\n\t\tmethod = \"POST\",\n\t\tacceptFile = \"*\",\n\t\tfileResponseName = \"url\",\n\t\tchangeFileButtonText = \"Alterar arquivo\",\n\t\tselectFileButtonText = \"Selecionar arquivo\",\n\t\tdropFileText = \"Ou arraste e solte o arquivo aqui\",\n\t\tonChange,\n\t\tdisabled = false,\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst fieldError = fieldErrors?.[name];\n\n\tconst [value, setValue] = useState(\"\");\n\tconst [error, setError] = useState(\"\");\n\tconst [file, setFile] = useState<File | null>(null);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tasync function handleUploadFile(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetIsLoading(true);\n\t\tsetFile(file);\n\t\tsetError(\"\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(fileName, file);\n\n\t\tawait fetch(action, { method: method, body: formData })\n\t\t\t.then(async (response) => await response.json())\n\t\t\t.then((response) => {\n\t\t\t\tif (response?.error) setError(response.error);\n\t\t\t\telse setValue(response?.[fileResponseName]);\n\t\t\t\tonChange?.(response?.[fileResponseName]);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tsetError(\"Erro ao enviar o arquivo\");\n\t\t\t})\n\t\t\t.finally(() => setIsLoading(false));\n\t}\n\n\tfunction handleSelectFile(file: File) {\n\t\tif (disabled) return;\n\t\thandleUploadFile(file);\n\t}\n\n\tconst errorMessage = fieldError || error;\n\n\tconst hasErrorClassName = errorMessage ? \"hasError\" : \"noHasError\";\n\tconst hasFileClassName = file ? \"hasFile\" : \"noHasFile\";\n\tconst className = `arkynFileUpload ${hasErrorClassName} ${hasFileClassName}`;\n\n\treturn (\n\t\t<FieldWrapper>\n\t\t\t{label && <FieldLabel showAsterisk={showAsterisk}>{label}</FieldLabel>}\n\n\t\t\t<div className={className}>\n\t\t\t\t<input type=\"hidden\" name={name} value={value || \"\"} />\n\n\t\t\t\t{!file && (\n\t\t\t\t\t<NoFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptFile={acceptFile}\n\t\t\t\t\t\tdropFileText={dropFileText}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tselectFileButtonText={selectFileButtonText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{file && (\n\t\t\t\t\t<HasFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptFile={acceptFile}\n\t\t\t\t\t\tfile={file}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tchangeFileButtonText={changeFileButtonText}\n\t\t\t\t\t\treSendFile={\n\t\t\t\t\t\t\terrorMessage && file ? () => handleUploadFile(file) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { FileUpload };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\n\ntype FullCalendarCell = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\ntype FullCalendarMatrix = FullCalendarCell[][];\ntype FullCalendarWeekCell = FullCalendarCell & {\n\ttimeInMinutes: number;\n};\n\ntype FullCalendarWeekMatrix = FullCalendarWeekCell[][];\n\nclass ViewService {\n\tcapitalize(text: string) {\n\t\treturn formatToCapitalizeFirstWordLetter(text);\n\t}\n\n\tlistHours(range: [number, number]) {\n\t\tconst [startHour, endHour] = range;\n\t\tconst hours = [];\n\n\t\tfor (\n\t\t\tlet timeInMinutes = startHour * 60;\n\t\t\ttimeInMinutes <= endHour * 60;\n\t\t\ttimeInMinutes += 30\n\t\t) {\n\t\t\thours.push(timeInMinutes);\n\t\t}\n\n\t\treturn hours;\n\t}\n\n\tformatHourLabel(timeInMinutes: number) {\n\t\tconst hour = Math.floor(timeInMinutes / 60);\n\t\tconst minutes = timeInMinutes % 60;\n\n\t\treturn `${String(hour).padStart(2, \"0\")}:${String(minutes).padStart(2, \"0\")}`;\n\t}\n\n\tgetStartOfWeek(viewDate: Date) {\n\t\tconst firstDayOfWeek = new Date(viewDate);\n\t\tfirstDayOfWeek.setHours(0, 0, 0, 0);\n\t\tfirstDayOfWeek.setDate(firstDayOfWeek.getDate() - firstDayOfWeek.getDay());\n\n\t\treturn firstDayOfWeek;\n\t}\n\n\tlistWeek(viewDate: Date, language: string) {\n\t\tconst weekDays = [];\n\t\tconst firstDayOfWeek = this.getStartOfWeek(viewDate);\n\n\t\tfor (let i = 0; i < 7; i++) {\n\t\t\tconst day = new Date(firstDayOfWeek);\n\t\t\tday.setDate(firstDayOfWeek.getDate() + i);\n\t\t\tconst dayName = day.toLocaleDateString(language, {\n\t\t\t\tweekday: \"short\",\n\t\t\t});\n\t\t\tweekDays.push(dayName);\n\t\t}\n\n\t\treturn weekDays;\n\t}\n\n\tlistWeeklyMatrix(viewDate: Date, hours: number[]): FullCalendarWeekMatrix {\n\t\tconst firstDayOfWeek = this.getStartOfWeek(viewDate);\n\t\tconst viewMonth = viewDate.getMonth();\n\n\t\treturn hours.map((hour) => {\n\t\t\treturn Array.from({ length: 7 }, (_, index) => {\n\t\t\t\tconst cellDate = new Date(firstDayOfWeek);\n\t\t\t\tcellDate.setDate(firstDayOfWeek.getDate() + index);\n\n\t\t\t\tlet dayOwner: FullCalendarCell[\"dayOwner\"] = \"current\";\n\n\t\t\t\tif (\n\t\t\t\t\tcellDate.getMonth() < viewMonth ||\n\t\t\t\t\tcellDate.getFullYear() < viewDate.getFullYear()\n\t\t\t\t) {\n\t\t\t\t\tdayOwner = \"previous\";\n\t\t\t\t}\n\n\t\t\t\tif (\n\t\t\t\t\tcellDate.getMonth() > viewMonth ||\n\t\t\t\t\tcellDate.getFullYear() > viewDate.getFullYear()\n\t\t\t\t) {\n\t\t\t\t\tdayOwner = \"next\";\n\t\t\t\t}\n\n\t\t\t\treturn {\n\t\t\t\t\tday: cellDate.getDate(),\n\t\t\t\t\tmonth: cellDate.getMonth(),\n\t\t\t\t\tyear: cellDate.getFullYear(),\n\t\t\t\t\tdayOwner,\n\t\t\t\t\ttimeInMinutes: hour,\n\t\t\t\t};\n\t\t\t});\n\t\t});\n\t}\n\n\tlistMonthlyMatrix(viewDate: Date) {\n\t\tconst year = viewDate.getFullYear();\n\t\tconst monthIndex = viewDate.getMonth();\n\n\t\tconst firstDayOfMonth = new Date(year, monthIndex, 1);\n\t\tconst firstWeekday = firstDayOfMonth.getDay();\n\n\t\tconst daysInCurrentMonth = new Date(year, monthIndex + 1, 0).getDate();\n\t\tconst daysInPreviousMonth = new Date(year, monthIndex, 0).getDate();\n\n\t\tconst totalCells = Math.ceil((firstWeekday + daysInCurrentMonth) / 7) * 7;\n\n\t\tconst weeks: FullCalendarMatrix = [];\n\t\tlet currentMonthDay = 1;\n\t\tlet nextMonthDay = 1;\n\n\t\tfor (let i = 0; i < totalCells; i++) {\n\t\t\tconst weekIndex = Math.floor(i / 7);\n\t\t\tif (!weeks[weekIndex]) weeks[weekIndex] = [];\n\n\t\t\tif (i < firstWeekday) {\n\t\t\t\tconst day = daysInPreviousMonth - (firstWeekday - i - 1);\n\t\t\t\tconst month = monthIndex === 0 ? 11 : monthIndex - 1;\n\t\t\t\tconst cellYear = monthIndex === 0 ? year - 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"previous\",\n\t\t\t\t});\n\t\t\t} else if (currentMonthDay <= daysInCurrentMonth) {\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: currentMonthDay,\n\t\t\t\t\tmonth: monthIndex,\n\t\t\t\t\tyear: year,\n\t\t\t\t\tdayOwner: \"current\",\n\t\t\t\t});\n\t\t\t\tcurrentMonthDay++;\n\t\t\t} else {\n\t\t\t\tconst month = monthIndex === 11 ? 0 : monthIndex + 1;\n\t\t\t\tconst cellYear = monthIndex === 11 ? year + 1 : year;\n\n\t\t\t\tweeks[weekIndex].push({\n\t\t\t\t\tday: nextMonthDay,\n\t\t\t\t\tmonth,\n\t\t\t\t\tyear: cellYear,\n\t\t\t\t\tdayOwner: \"next\",\n\t\t\t\t});\n\t\t\t\tnextMonthDay++;\n\t\t\t}\n\t\t}\n\n\t\treturn weeks;\n\t}\n\n\tnextMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() + 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tnextWeek(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() + 7);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tnextDay(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() + 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousMonth(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setMonth(nextViewDate.getMonth() - 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousWeek(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() - 7);\n\t\tsetViewDate(nextViewDate);\n\t}\n\n\tpreviousDay(viewDate: Date, setViewDate: (date: Date) => void) {\n\t\tconst nextViewDate = new Date(viewDate);\n\t\tnextViewDate.setDate(nextViewDate.getDate() - 1);\n\t\tsetViewDate(nextViewDate);\n\t}\n}\n\nexport { type FullCalendarMatrix, type FullCalendarWeekMatrix, ViewService };\n","import { createContext, type ReactNode, useContext, useState } from \"react\";\nimport {\n\ttype FullCalendarMatrix,\n\ttype FullCalendarWeekMatrix,\n\tViewService,\n} from \"./_viewService\";\n\ntype FullCalendarEvent = {\n\tinitialDate: Date;\n\tendDate?: Date;\n\ttitle: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\tscheme?: \"primary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tonClick?: (data: any) => void;\n};\n\ntype BlockTimestamp = {\n\tinitialDate: Date;\n\tendDate: Date;\n};\n\ntype FullCalendarContextProps = {\n\tevents: FullCalendarEvent[];\n\tblockedTimestamps: BlockTimestamp[];\n\tviewDate: Date;\n\tlistHours: number[];\n\tlistWeek: string[];\n\tlistMonthlyMatrix: FullCalendarMatrix;\n\tlistWeeklyMatrix: FullCalendarWeekMatrix;\n\tnextMonth: () => void;\n\tnextWeek: () => void;\n\tnextDay: () => void;\n\tpreviousMonth: () => void;\n\tpreviousWeek: () => void;\n\tpreviousDay: () => void;\n\tonClickDate?: (date: Date) => void;\n};\n\ntype FullCalendarProviderProps = {\n\tevents: FullCalendarEvent[];\n\tblockedTimestamps: BlockTimestamp[];\n\tchildren: ReactNode;\n\tlanguage?: string;\n\tviewValue?: Date;\n\tdefaultViewValue?: Date;\n\tonChangeView?: (date: Date) => void;\n\tonClickDate?: (date: Date) => void;\n};\n\nconst FullCalendarContext = createContext({} as FullCalendarContextProps);\n\nfunction useFullCalendar() {\n\treturn useContext(FullCalendarContext);\n}\n\nfunction FullCalendarProvider(props: FullCalendarProviderProps) {\n\tconst {\n\t\tblockedTimestamps,\n\t\tchildren,\n\t\tevents,\n\t\tdefaultViewValue = new Date(),\n\t\tlanguage = \"pt-BR\",\n\t\tonChangeView,\n\t\tonClickDate,\n\t\tviewValue,\n\t} = props;\n\n\tconst viewService = new ViewService();\n\tconst listHours = viewService.listHours([8, 18]);\n\n\tconst [rawViewDate, rawSetViewDate] = useState(defaultViewValue);\n\tconst viewDate = viewValue || rawViewDate;\n\n\tfunction setViewDate(date: Date) {\n\t\tif (onChangeView) onChangeView(date);\n\t\trawSetViewDate(date);\n\t}\n\n\treturn (\n\t\t<FullCalendarContext.Provider\n\t\t\tvalue={{\n\t\t\t\tevents,\n\t\t\t\tblockedTimestamps,\n\t\t\t\tviewDate,\n\t\t\t\tlistHours,\n\t\t\t\tlistWeek: viewService.listWeek(viewDate, language),\n\t\t\t\tlistMonthlyMatrix: viewService.listMonthlyMatrix(viewDate),\n\t\t\t\tlistWeeklyMatrix: viewService.listWeeklyMatrix(viewDate, listHours),\n\t\t\t\tnextMonth: () => viewService.nextMonth(viewDate, setViewDate),\n\t\t\t\tnextWeek: () => viewService.nextWeek(viewDate, setViewDate),\n\t\t\t\tnextDay: () => viewService.nextDay(viewDate, setViewDate),\n\t\t\t\tpreviousMonth: () => viewService.previousMonth(viewDate, setViewDate),\n\t\t\t\tpreviousWeek: () => viewService.previousWeek(viewDate, setViewDate),\n\t\t\t\tpreviousDay: () => viewService.previousDay(viewDate, setViewDate),\n\t\t\t\tonClickDate,\n\t\t\t}}\n\t\t>\n\t\t\t{children}\n\t\t</FullCalendarContext.Provider>\n\t);\n}\n\nexport { FullCalendarProvider, useFullCalendar };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype DayCalendarContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction DayCalendarContainer({ children }: DayCalendarContainerProps) {\n\treturn <div className=\"arkynDayCalendarContainer\">{children}</div>;\n}\n\nexport { DayCalendarContainer };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype DayCalendarEventProps = {\n\ttimeInMinutes: number;\n};\n\nconst SLOT_DURATION_MINUTES = 30;\nconst OVERLAP_OFFSET_PX = 205;\n\nfunction DayCalendarEvent(props: DayCalendarEventProps) {\n\tconst { events, viewDate } = useFullCalendar();\n\n\tconst day = viewDate.getDate();\n\tconst month = viewDate.getMonth();\n\tconst year = viewDate.getFullYear();\n\n\tconst dayEvents = events\n\t\t.map((event, sourceIndex) => ({ event, sourceIndex }))\n\t\t.filter(({ event }) => {\n\t\t\treturn (\n\t\t\t\tevent.initialDate.getDate() === day &&\n\t\t\t\tevent.initialDate.getMonth() === month &&\n\t\t\t\tevent.initialDate.getFullYear() === year\n\t\t\t);\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\tconst startA = a.event.initialDate.getTime();\n\t\t\tconst startB = b.event.initialDate.getTime();\n\n\t\t\tif (startA !== startB) return startA - startB;\n\n\t\t\tconst endA =\n\t\t\t\ta.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;\n\t\t\tconst endB =\n\t\t\t\tb.event.endDate?.getTime() ?? startB + SLOT_DURATION_MINUTES * 60_000;\n\n\t\t\tif (endA !== endB) return endA - endB;\n\t\t\treturn a.sourceIndex - b.sourceIndex;\n\t\t});\n\n\tconst dayEventOrderBySourceIndex = new Map(\n\t\tdayEvents.map((item, orderIndex) => [item.sourceIndex, orderIndex]),\n\t);\n\n\tconst filteredEvents = dayEvents.filter(({ event }) => {\n\t\tconst dayHour = Math.floor(props.timeInMinutes / 60);\n\t\tconst dayMinute = props.timeInMinutes % 60;\n\n\t\tfunction isEventInInterval() {\n\t\t\tconst eventHour = event.initialDate.getHours();\n\t\t\tconst eventMinute = event.initialDate.getMinutes();\n\n\t\t\tif (eventHour !== dayHour) return false;\n\t\t\tif (dayMinute === 0) return eventMinute < 30 && eventMinute >= 0;\n\t\t\tif (dayMinute === 30) return eventMinute >= 30 && eventMinute < 60;\n\t\t}\n\n\t\treturn (\n\t\t\tisEventInInterval() &&\n\t\t\tevent.initialDate.getDate() === day &&\n\t\t\tevent.initialDate.getMonth() === month &&\n\t\t\tevent.initialDate.getFullYear() === year\n\t\t);\n\t});\n\n\tif (filteredEvents.length === 0) return null;\n\n\tfunction makeEventKey(index: number, sourceIndex: number) {\n\t\treturn `${day}-${month}-${year}-${sourceIndex}-${index}`;\n\t}\n\n\tfunction makeHour(date: Date) {\n\t\tconst hours = date.getHours();\n\t\tconst minutes = date.getMinutes();\n\n\t\tif (minutes === 0) return `${hours}h`;\n\t\treturn `${hours}h${minutes}`;\n\t}\n\n\tfunction getEventRangeInMinutes(event: {\n\t\tinitialDate: Date;\n\t\tendDate?: Date;\n\t}) {\n\t\tconst startMinutes =\n\t\t\tevent.initialDate.getHours() * 60 + event.initialDate.getMinutes();\n\n\t\tconst endMinutes = event.endDate\n\t\t\t? event.endDate.getHours() * 60 + event.endDate.getMinutes()\n\t\t\t: startMinutes + SLOT_DURATION_MINUTES;\n\n\t\treturn {\n\t\t\tstartMinutes,\n\t\t\tendMinutes: Math.max(endMinutes, startMinutes + 1),\n\t\t};\n\t}\n\n\tfunction countOverlappingPreviousEvents(\n\t\tcurrentEvent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst current = getEventRangeInMinutes(currentEvent);\n\t\tconst currentOrderIndex = dayEventOrderBySourceIndex.get(sourceIndex);\n\n\t\tif (currentOrderIndex == null) return 0;\n\n\t\treturn dayEvents.reduce((count, item, orderIndex) => {\n\t\t\tif (orderIndex >= currentOrderIndex) return count;\n\n\t\t\tconst candidate = getEventRangeInMinutes(item.event);\n\t\t\tconst intersects =\n\t\t\t\tcandidate.startMinutes < current.endMinutes &&\n\t\t\t\tcandidate.endMinutes > current.startMinutes;\n\n\t\t\tif (!intersects) return count;\n\t\t\treturn count + 1;\n\t\t}, 0);\n\t}\n\n\tfunction getEventStyle(\n\t\tevent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst { startMinutes, endMinutes } = getEventRangeInMinutes(event);\n\t\tconst startOffsetInCell = startMinutes - props.timeInMinutes;\n\n\t\tconst durationInMinutes = Math.max(endMinutes - startMinutes, 1);\n\t\tconst top = (startOffsetInCell / SLOT_DURATION_MINUTES) * 100;\n\t\tconst height = (durationInMinutes / SLOT_DURATION_MINUTES) * 100;\n\t\tconst overlapOffset =\n\t\t\tcountOverlappingPreviousEvents(event, sourceIndex) * OVERLAP_OFFSET_PX;\n\n\t\treturn {\n\t\t\ttop: `${top}%`,\n\t\t\theight: `${height}%`,\n\t\t\tleft: `${overlapOffset}px`,\n\t\t};\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction handleEventClick(event: React.MouseEvent, eventData: any) {\n\t\tevent.stopPropagation();\n\t\teventData.onClick?.(eventData.data);\n\t}\n\n\treturn filteredEvents.map(({ event, sourceIndex }, index) => (\n\t\t<div\n\t\t\tkey={makeEventKey(index, sourceIndex)}\n\t\t\tclassName={`arkynDayCalendarEvent ${event?.scheme || \"primary\"}`}\n\t\t\tstyle={getEventStyle(event, sourceIndex)}\n\t\t\tonClick={(e) => handleEventClick(e, event)}\n\t\t>\n\t\t\t<strong>\n\t\t\t\t{makeHour(event.initialDate)}{\" \"}\n\t\t\t\t{event?.endDate && `- ${makeHour(event.endDate)}`}\n\t\t\t</strong>\n\t\t\t<p>{event.title}</p>\n\t\t</div>\n\t));\n}\n\nexport { DayCalendarEvent };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { ViewService } from \"../../_viewService\";\nimport { DayCalendarEvent } from \"../dayCalendarEvent\";\nimport \"./styles.css\";\n\ntype DayCalendarRowProps = {\n\thour: number;\n\ttimeInMinutes: number;\n};\n\nfunction DayCalendarRow({ hour, timeInMinutes }: DayCalendarRowProps) {\n\tconst viewService = new ViewService();\n\tconst { blockedTimestamps, viewDate, onClickDate } = useFullCalendar();\n\n\tfunction isBlocked() {\n\t\treturn blockedTimestamps.some(\n\t\t\t(timestamp) =>\n\t\t\t\tviewDate >= timestamp.initialDate && viewDate <= timestamp.endDate,\n\t\t);\n\t}\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tevent.stopPropagation();\n\t\tif (isBlocked()) return;\n\n\t\tif (onClickDate) {\n\t\t\tconst date = new Date(viewDate);\n\t\t\tdate.setHours(0, timeInMinutes, 0, 0);\n\t\t\tonClickDate(date);\n\t\t}\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`arkynDayCalendarRow ${isBlocked() ? \"blocked\" : \"\"}`}\n\t\t\tdata-time={timeInMinutes}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t<p>{viewService.formatHourLabel(hour)}</p>\n\n\t\t\t<div className=\"arkynDayCalendarRowContent\">\n\t\t\t\t<DayCalendarEvent timeInMinutes={timeInMinutes} />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { DayCalendarRow, type DayCalendarRowProps };\n","import { useFullCalendar } from \"../_fullCalendarProvider\";\nimport { DayCalendarContainer } from \"./dayCalendarContainer\";\nimport { DayCalendarRow } from \"./dayCalendarRow\";\n\nfunction DayCalendar() {\n\tconst { listHours } = useFullCalendar();\n\treturn (\n\t\t<DayCalendarContainer>\n\t\t\t{listHours.map((hour) => (\n\t\t\t\t<DayCalendarRow key={hour} hour={hour} timeInMinutes={hour} />\n\t\t\t))}\n\t\t</DayCalendarContainer>\n\t);\n}\n\nexport { DayCalendar };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype FullCalendarContainerProps = {\n\tchildren?: ReactNode;\n};\n\nfunction FullCalendarContainer({ children }: FullCalendarContainerProps) {\n\treturn <div className=\"arkynFullCalendarContainer\">{children}</div>;\n}\n\nexport { FullCalendarContainer };\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\n\nimport { CardTabButton } from \"../../cardTab/cardTabButton\";\nimport { CardTabContainer } from \"../../cardTab/cardTabContainer\";\nimport { IconButton } from \"../../iconButton\";\n\nimport { useFullCalendar } from \"../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype FullCalendarHeaderProps = {\n\tviewType: \"day\" | \"week\" | \"month\";\n\tsetViewType: (viewType: \"day\" | \"week\" | \"month\") => void;\n};\n\nfunction FullCalendarHeader(props: FullCalendarHeaderProps) {\n\tconst { setViewType, viewType } = props;\n\tconst fullCalendar = useFullCalendar();\n\n\tfunction handlePrevious() {\n\t\tswitch (viewType) {\n\t\t\tcase \"day\":\n\t\t\t\treturn fullCalendar.previousDay();\n\t\t\tcase \"week\":\n\t\t\t\treturn fullCalendar.previousWeek();\n\t\t\tcase \"month\":\n\t\t\t\treturn fullCalendar.previousMonth();\n\t\t}\n\t}\n\n\tfunction handleNext() {\n\t\tswitch (viewType) {\n\t\t\tcase \"day\":\n\t\t\t\treturn fullCalendar.nextDay();\n\t\t\tcase \"week\":\n\t\t\t\treturn fullCalendar.nextWeek();\n\t\t\tcase \"month\":\n\t\t\t\treturn fullCalendar.nextMonth();\n\t\t}\n\t}\n\n\treturn (\n\t\t<div className=\"arkynFullCalendarHeader\">\n\t\t\t<CardTabContainer\n\t\t\t\tdefaultValue={viewType}\n\t\t\t\tonChange={(value) => setViewType(value as \"day\" | \"week\" | \"month\")}\n\t\t\t>\n\t\t\t\t<CardTabButton value=\"day\">Dia</CardTabButton>\n\t\t\t\t<CardTabButton value=\"week\">Semana</CardTabButton>\n\t\t\t\t<CardTabButton value=\"month\">Mês</CardTabButton>\n\t\t\t</CardTabContainer>\n\n\t\t\t<div className=\"arkynFullCalendarHeaderActions\">\n\t\t\t\t<IconButton\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\ticon={ChevronLeft}\n\t\t\t\t\taria-label=\"Handle previous\"\n\t\t\t\t\tonClick={() => handlePrevious()}\n\t\t\t\t/>\n\n\t\t\t\t<p>\n\t\t\t\t\t{fullCalendar.viewDate.toLocaleDateString(\"pt-BR\", {\n\t\t\t\t\t\tday: \"2-digit\",\n\t\t\t\t\t\tmonth: \"long\",\n\t\t\t\t\t\tyear: \"numeric\",\n\t\t\t\t\t})}\n\t\t\t\t</p>\n\n\t\t\t\t<IconButton\n\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\ticon={ChevronRight}\n\t\t\t\t\taria-label=\"Handle next\"\n\t\t\t\t\tonClick={() => handleNext()}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport { FullCalendarHeader };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype MonthlyCalendarEventProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n};\n\nfunction MonthlyCalendarEvent(props: MonthlyCalendarEventProps) {\n\tconst { events } = useFullCalendar();\n\n\tconst filteredEvents = events.filter((event) => {\n\t\treturn (\n\t\t\tevent.initialDate.getDate() === props.day &&\n\t\t\tevent.initialDate.getMonth() === props.month &&\n\t\t\tevent.initialDate.getFullYear() === props.year\n\t\t);\n\t});\n\n\tif (filteredEvents.length === 0) return null;\n\n\tfunction makeEventKey(index: number) {\n\t\treturn `${props.day}-${props.month}-${props.year}-${index}`;\n\t}\n\n\tfunction makeHour(date: Date) {\n\t\tconst hours = date.getHours();\n\t\tconst minutes = date.getMinutes();\n\n\t\tif (minutes === 0) return `${hours}h`;\n\t\treturn `${hours}h${minutes}`;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction handleEventClick(event: React.MouseEvent, eventData: any) {\n\t\tevent.stopPropagation();\n\t\teventData.onClick?.(eventData.data);\n\t}\n\n\treturn filteredEvents.map((event, index) => (\n\t\t<div\n\t\t\tkey={makeEventKey(index)}\n\t\t\tclassName={`arkynMonthlyCalendarEvent ${event?.scheme || \"primary\"}`}\n\t\t\tonClick={(e) => handleEventClick(e, event)}\n\t\t>\n\t\t\t<strong>\n\t\t\t\t{makeHour(event.initialDate)}{\" \"}\n\t\t\t\t{event?.endDate && `- ${makeHour(event.endDate)}`}\n\t\t\t</strong>\n\t\t\t<p>{event.title}</p>\n\t\t</div>\n\t));\n}\n\nexport { MonthlyCalendarEvent };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { MonthlyCalendarEvent } from \"../monthlyCalendarEvent\";\nimport \"./styles.css\";\n\ntype MonthlyCalendarTableTdProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n};\n\nfunction MonthlyCalendarTableTd(props: MonthlyCalendarTableTdProps) {\n\tconst { day, month, year, dayOwner } = props;\n\tconst { blockedTimestamps, onClickDate } = useFullCalendar();\n\n\tfunction isToday() {\n\t\tconst today = new Date();\n\t\treturn (\n\t\t\tday === today.getDate() &&\n\t\t\tmonth === today.getMonth() &&\n\t\t\tyear === today.getFullYear()\n\t\t);\n\t}\n\n\tfunction isBlocked() {\n\t\tconst currentDate = new Date(year, month, day);\n\n\t\treturn blockedTimestamps.some(\n\t\t\t(timestamp) =>\n\t\t\t\tcurrentDate >= timestamp.initialDate &&\n\t\t\t\tcurrentDate <= timestamp.endDate,\n\t\t);\n\t}\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tevent.stopPropagation();\n\t\tif (isBlocked()) return;\n\n\t\tif (onClickDate) {\n\t\t\tconst date = new Date(year, month, day);\n\t\t\tonClickDate(date);\n\t\t}\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tclassName={`arkynMonthlyCalendarTableTd ${dayOwner} ${isBlocked() ? \"blocked\" : \"\"}`}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t<p className={isToday() ? \"today\" : \"\"}>{day}</p>\n\t\t\t<div className=\"arkynMonthlyCalendarEventContainer\">\n\t\t\t\t<MonthlyCalendarEvent day={day} month={month} year={year} />\n\t\t\t</div>\n\t\t</td>\n\t);\n}\n\nexport { MonthlyCalendarTableTd };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { MonthlyCalendarTableTd } from \"../monthlyCalendarTableTd\";\nimport \"./styles.css\";\n\nfunction MonthlyCalendarTableBody() {\n\tconst fullCalendar = useFullCalendar();\n\n\treturn (\n\t\t<tbody className=\"arkynMonthlyCalendarTableBody\">\n\t\t\t{fullCalendar.listMonthlyMatrix.map((week, weekIndex) => (\n\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: week position is stable in monthly matrix\n\t\t\t\t<tr key={weekIndex}>\n\t\t\t\t\t{week.map((props, dayIndex) => (\n\t\t\t\t\t\t// biome-ignore lint/suspicious/noArrayIndexKey: day position is stable in week\n\t\t\t\t\t\t<MonthlyCalendarTableTd key={dayIndex} {...props} />\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t))}\n\t\t</tbody>\n\t);\n}\n\nexport { MonthlyCalendarTableBody };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype MonthlyCalendarTableContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction MonthlyCalendarTableContainer({\n\tchildren,\n}: MonthlyCalendarTableContainerProps) {\n\treturn (\n\t\t<div className=\"arkynMonthlyCalendarTableContainer\">\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { MonthlyCalendarTableContainer };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\nimport { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\nfunction MonthlyCalendarTableHeader() {\n\tconst { listWeek } = useFullCalendar();\n\n\treturn (\n\t\t<thead className=\"arkynMonthlyCalendarTableHeader\">\n\t\t\t<tr>\n\t\t\t\t{listWeek.map((day) => (\n\t\t\t\t\t<th key={day}>{formatToCapitalizeFirstWordLetter(day)}</th>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n}\n\nexport { MonthlyCalendarTableHeader };\n","import { MonthlyCalendarTableBody } from \"./monthlyCalendarTableBody\";\nimport { MonthlyCalendarTableContainer } from \"./monthlyCalendarTableContainer\";\nimport { MonthlyCalendarTableHeader } from \"./monthlyCalendarTableHeader\";\n\nfunction MonthlyCalendar() {\n\treturn (\n\t\t<MonthlyCalendarTableContainer>\n\t\t\t<MonthlyCalendarTableHeader />\n\t\t\t<MonthlyCalendarTableBody />\n\t\t</MonthlyCalendarTableContainer>\n\t);\n}\n\nexport { MonthlyCalendar };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\ntype WeekCalendarEventProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\ttimeInMinutes: number;\n};\n\nconst SLOT_DURATION_MINUTES = 30;\nconst OVERLAP_OFFSET_PX = 40;\n\nfunction WeekCalendarEvent(props: WeekCalendarEventProps) {\n\tconst { events } = useFullCalendar();\n\n\tconst dayEvents = events\n\t\t.map((event, sourceIndex) => ({ event, sourceIndex }))\n\t\t.filter(({ event }) => {\n\t\t\treturn (\n\t\t\t\tevent.initialDate.getDate() === props.day &&\n\t\t\t\tevent.initialDate.getMonth() === props.month &&\n\t\t\t\tevent.initialDate.getFullYear() === props.year\n\t\t\t);\n\t\t})\n\t\t.sort((a, b) => {\n\t\t\tconst startA = a.event.initialDate.getTime();\n\t\t\tconst startB = b.event.initialDate.getTime();\n\n\t\t\tif (startA !== startB) return startA - startB;\n\n\t\t\tconst endA =\n\t\t\t\ta.event.endDate?.getTime() ?? startA + SLOT_DURATION_MINUTES * 60_000;\n\t\t\tconst endB =\n\t\t\t\tb.event.endDate?.getTime() ?? startB + SLOT_DURATION_MINUTES * 60_000;\n\n\t\t\tif (endA !== endB) return endA - endB;\n\t\t\treturn a.sourceIndex - b.sourceIndex;\n\t\t});\n\n\tconst dayEventOrderBySourceIndex = new Map(\n\t\tdayEvents.map((item, orderIndex) => [item.sourceIndex, orderIndex]),\n\t);\n\n\tconst filteredEvents = dayEvents.filter(({ event }) => {\n\t\tconst dayHour = Math.floor(props.timeInMinutes / 60);\n\t\tconst dayMinute = props.timeInMinutes % 60;\n\n\t\tfunction isEventInInterval() {\n\t\t\tconst eventHour = event.initialDate.getHours();\n\t\t\tconst eventMinute = event.initialDate.getMinutes();\n\n\t\t\tif (eventHour !== dayHour) return false;\n\t\t\tif (dayMinute === 0) return eventMinute < 30 && eventMinute >= 0;\n\t\t\tif (dayMinute === 30) return eventMinute >= 30 && eventMinute < 60;\n\t\t}\n\n\t\treturn (\n\t\t\tisEventInInterval() &&\n\t\t\tevent.initialDate.getDate() === props.day &&\n\t\t\tevent.initialDate.getMonth() === props.month &&\n\t\t\tevent.initialDate.getFullYear() === props.year\n\t\t);\n\t});\n\n\tif (filteredEvents.length === 0) return null;\n\n\tfunction makeEventKey(index: number, sourceIndex: number) {\n\t\treturn `${props.day}-${props.month}-${props.year}-${sourceIndex}-${index}`;\n\t}\n\n\tfunction makeHour(date: Date) {\n\t\tconst hours = date.getHours();\n\t\tconst minutes = date.getMinutes();\n\n\t\tif (minutes === 0) return `${hours}h`;\n\t\treturn `${hours}h${minutes}`;\n\t}\n\n\tfunction getEventRangeInMinutes(event: {\n\t\tinitialDate: Date;\n\t\tendDate?: Date;\n\t}) {\n\t\tconst startMinutes =\n\t\t\tevent.initialDate.getHours() * 60 + event.initialDate.getMinutes();\n\n\t\tconst endMinutes = event.endDate\n\t\t\t? event.endDate.getHours() * 60 + event.endDate.getMinutes()\n\t\t\t: startMinutes + SLOT_DURATION_MINUTES;\n\n\t\treturn {\n\t\t\tstartMinutes,\n\t\t\tendMinutes: Math.max(endMinutes, startMinutes + 1),\n\t\t};\n\t}\n\n\tfunction countOverlappingPreviousEvents(\n\t\tcurrentEvent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst current = getEventRangeInMinutes(currentEvent);\n\t\tconst currentOrderIndex = dayEventOrderBySourceIndex.get(sourceIndex);\n\n\t\tif (currentOrderIndex == null) return 0;\n\n\t\treturn dayEvents.reduce((count, item, orderIndex) => {\n\t\t\tif (orderIndex >= currentOrderIndex) return count;\n\n\t\t\tconst candidate = getEventRangeInMinutes(item.event);\n\t\t\tconst intersects =\n\t\t\t\tcandidate.startMinutes < current.endMinutes &&\n\t\t\t\tcandidate.endMinutes > current.startMinutes;\n\n\t\t\tif (!intersects) return count;\n\t\t\treturn count + 1;\n\t\t}, 0);\n\t}\n\n\tfunction getEventStyle(\n\t\tevent: { initialDate: Date; endDate?: Date },\n\t\tsourceIndex: number,\n\t) {\n\t\tconst { startMinutes, endMinutes } = getEventRangeInMinutes(event);\n\t\tconst startOffsetInCell = startMinutes - props.timeInMinutes;\n\n\t\tconst durationInMinutes = Math.max(endMinutes - startMinutes, 1);\n\t\tconst top = (startOffsetInCell / SLOT_DURATION_MINUTES) * 100;\n\t\tconst height = (durationInMinutes / SLOT_DURATION_MINUTES) * 100;\n\t\tconst overlapOffset =\n\t\t\tcountOverlappingPreviousEvents(event, sourceIndex) * OVERLAP_OFFSET_PX;\n\n\t\treturn {\n\t\t\ttop: `${top}%`,\n\t\t\theight: `${height}%`,\n\t\t\tleft: `${overlapOffset}px`,\n\t\t};\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction handleEventClick(event: React.MouseEvent, eventData: any) {\n\t\tevent.stopPropagation();\n\t\teventData.onClick?.(eventData.data);\n\t}\n\n\treturn filteredEvents.map(({ event, sourceIndex }, index) => (\n\t\t<div\n\t\t\tkey={makeEventKey(index, sourceIndex)}\n\t\t\tclassName={`arkynWeekCalendarEvent ${event?.scheme || \"primary\"}`}\n\t\t\tstyle={getEventStyle(event, sourceIndex)}\n\t\t\tonClick={(e) => handleEventClick(e, event)}\n\t\t>\n\t\t\t<strong>\n\t\t\t\t{makeHour(event.initialDate)}{\" \"}\n\t\t\t\t{event?.endDate && `- ${makeHour(event.endDate)}`}\n\t\t\t</strong>\n\t\t\t<p>{event.title}</p>\n\t\t</div>\n\t));\n}\n\nexport { WeekCalendarEvent };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { WeekCalendarEvent } from \"../weekCalendarEvent\";\nimport \"./styles.css\";\n\ntype WeekCalendarTableTdProps = {\n\tday: number;\n\tmonth: number;\n\tyear: number;\n\tdayOwner: \"previous\" | \"current\" | \"next\";\n\ttimeInMinutes: number;\n};\n\nfunction WeekCalendarTableTd(props: WeekCalendarTableTdProps) {\n\tconst { day, month, year, dayOwner, timeInMinutes } = props;\n\tconst { blockedTimestamps, onClickDate } = useFullCalendar();\n\n\tfunction isBlocked() {\n\t\tconst currentDate = new Date(year, month, day);\n\n\t\treturn blockedTimestamps.some(\n\t\t\t(timestamp) =>\n\t\t\t\tcurrentDate >= timestamp.initialDate &&\n\t\t\t\tcurrentDate <= timestamp.endDate,\n\t\t);\n\t}\n\n\tfunction handleClick(event: React.MouseEvent) {\n\t\tevent.stopPropagation();\n\t\tif (isBlocked()) return;\n\n\t\tif (onClickDate) {\n\t\t\tconst date = new Date(year, month, day);\n\t\t\tdate.setHours(0, timeInMinutes, 0, 0);\n\t\t\tonClickDate(date);\n\t\t}\n\t}\n\n\treturn (\n\t\t<td\n\t\t\tclassName={`arkynWeekCalendarTableTd ${dayOwner} ${isBlocked() ? \"blocked\" : \"\"}`}\n\t\t\tdata-day={day}\n\t\t\tdata-time={timeInMinutes}\n\t\t\tonClick={handleClick}\n\t\t>\n\t\t\t<div className=\"arkynWeekCalendarTableTdContent\">\n\t\t\t\t<WeekCalendarEvent\n\t\t\t\t\tday={day}\n\t\t\t\t\tmonth={month}\n\t\t\t\t\tyear={year}\n\t\t\t\t\ttimeInMinutes={timeInMinutes}\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</td>\n\t);\n}\n\nexport { WeekCalendarTableTd };\n","import { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport { ViewService } from \"../../_viewService\";\nimport { WeekCalendarTableTd } from \"../weekCalendarTableTd\";\nimport \"./styles.css\";\n\nfunction WeekCalendarTableBody() {\n\tconst fullCalendar = useFullCalendar();\n\tconst viewService = new ViewService();\n\n\treturn (\n\t\t<tbody className=\"arkynWeekCalendarTableBody\">\n\t\t\t{fullCalendar.listWeeklyMatrix.map((hourRow) => (\n\t\t\t\t<tr key={hourRow[0].timeInMinutes}>\n\t\t\t\t\t<td className=\"hourTd\">\n\t\t\t\t\t\t<p>{viewService.formatHourLabel(hourRow[0].timeInMinutes)}</p>\n\t\t\t\t\t</td>\n\n\t\t\t\t\t{hourRow.map((cell) => (\n\t\t\t\t\t\t<WeekCalendarTableTd\n\t\t\t\t\t\t\tkey={`${cell.year}-${cell.month}-${cell.day}-${cell.timeInMinutes}`}\n\t\t\t\t\t\t\t{...cell}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\t\t\t\t</tr>\n\t\t\t))}\n\t\t</tbody>\n\t);\n}\n\nexport { WeekCalendarTableBody };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype WeekCalendarTableContainerProps = {\n\tchildren: ReactNode;\n};\n\nfunction WeekCalendarTableContainer({\n\tchildren,\n}: WeekCalendarTableContainerProps) {\n\treturn (\n\t\t<div className=\"arkynWeekCalendarTableContainer\">\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { WeekCalendarTableContainer };\n","import { formatToCapitalizeFirstWordLetter } from \"@arkyn/shared\";\nimport { useFullCalendar } from \"../../_fullCalendarProvider\";\nimport \"./styles.css\";\n\nfunction WeekCalendarTableHeader() {\n\tconst { listWeek, listWeeklyMatrix } = useFullCalendar();\n\tconst firstHourRow = listWeeklyMatrix[0] || [];\n\n\treturn (\n\t\t<thead className=\"arkynWeekCalendarTableHeader\">\n\t\t\t<tr>\n\t\t\t\t<th />\n\t\t\t\t{listWeek.map((day, index) => (\n\t\t\t\t\t<th key={day}>\n\t\t\t\t\t\t<div className=\"arkynWeekCalendarTableHeaderContent\">\n\t\t\t\t\t\t\t<span>{formatToCapitalizeFirstWordLetter(day)}</span>\n\t\t\t\t\t\t\t<strong>{firstHourRow[index]?.day}</strong>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</th>\n\t\t\t\t))}\n\t\t\t</tr>\n\t\t</thead>\n\t);\n}\n\nexport { WeekCalendarTableHeader };\n","import { WeekCalendarTableBody } from \"./weekCalendarTableBody\";\nimport { WeekCalendarTableContainer } from \"./weekCalendarTableContainer\";\nimport { WeekCalendarTableHeader } from \"./weekCalendarTableHeader\";\n\nfunction WeekCalendar() {\n\treturn (\n\t\t<WeekCalendarTableContainer>\n\t\t\t<WeekCalendarTableHeader />\n\t\t\t<WeekCalendarTableBody />\n\t\t</WeekCalendarTableContainer>\n\t);\n}\n\nexport { WeekCalendar };\n","import { useState } from \"react\";\nimport { FullCalendarProvider } from \"./_fullCalendarProvider\";\nimport { DayCalendar } from \"./dayCalendar\";\nimport { FullCalendarContainer } from \"./fullCalendarContainer\";\nimport { FullCalendarHeader } from \"./fullCalendarHeader\";\nimport { MonthlyCalendar } from \"./monthlyCalendar\";\nimport { WeekCalendar } from \"./weekCalendar\";\n\n/**\n * Represents a single event rendered on the calendar.\n */\ntype FullCalendarEvent = {\n\t/** Display label shown on the event block. */\n\ttitle: string;\n\t/** Start date and time of the event. */\n\tinitialDate: Date;\n\t/** End date and time of the event. */\n\tendDate?: Date;\n\t/** Arbitrary payload forwarded to the `onClick` callback. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\t/**\n\t * Color scheme applied to the event block.\n\t * - `primary`: default blue.\n\t * - `success`: green.\n\t * - `warning`: yellow.\n\t * - `danger`: red.\n\t * - `info`: light blue.\n\t *\n\t * @default \"primary\"\n\t */\n\tscheme?: \"primary\" | \"success\" | \"warning\" | \"danger\" | \"info\";\n\t/** Callback fired when the user clicks the event. Receives `data` as argument. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tonClick?: (data: any) => void;\n};\n\n/**\n * Represents a blocked (unavailable) time range on the calendar.\n */\ntype BlockTimestamp = {\n\t/** Start of the blocked range. */\n\tinitialDate: Date;\n\t/** End of the blocked range. */\n\tendDate: Date;\n};\n\n/**\n * Props for the FullCalendar component.\n */\ntype FullCalendarProps = {\n\t/** Controlled value for the currently focused date. */\n\tviewValue?: Date;\n\t/** Initial focused date when the calendar mounts. */\n\tdefaultViewValue?: Date;\n\t/** List of events to display across day, week, and month views. */\n\tevents?: FullCalendarEvent[];\n\t/** Time ranges that should be visually marked as unavailable. */\n\tblockedTimestamps?: BlockTimestamp[];\n\t/** Callback fired when the user navigates to a different period. */\n\tonChangeView?: (date: Date) => void;\n\t/** Callback fired when the user clicks a date cell. */\n\tonClickDate?: (date: Date) => void;\n};\n\n/**\n * Full-featured calendar component with day, week, and month views.\n *\n * Renders a switchable calendar that supports event display, blocked time\n * ranges, and date navigation. Internal state and business logic are managed\n * by `FullCalendarProvider`, keeping the public API minimal.\n *\n * @param props FullCalendar properties.\n * @returns Calendar UI with a view switcher header and the active view grid.\n *\n * @example\n * // Basic usage with events\n * <FullCalendar\n * defaultValue={new Date()}\n * events={[\n * {\n * title: \"Team standup\",\n * initialDate: new Date(2026, 5, 22, 9, 0),\n * endDate: new Date(2026, 5, 22, 9, 30),\n * scheme: \"primary\",\n * onClick: (data) => console.log(\"Event clicked:\", data),\n * },\n * ]}\n * onChangeView={(date) => console.log(\"Viewing:\", date)}\n * onClickDate={(date) => console.log(\"Date clicked:\", date)}\n * />\n *\n * @example\n * // With blocked timestamps\n * <FullCalendar\n * defaultValue={new Date()}\n * blockedTimestamps={[\n * {\n * initialDate: new Date(2026, 5, 22, 12, 0),\n * endDate: new Date(2026, 5, 22, 13, 0),\n * },\n * ]}\n * />\n */\nfunction FullCalendar(props: FullCalendarProps) {\n\tconst [viewType, setViewType] = useState<\"day\" | \"week\" | \"month\">(\"month\");\n\n\treturn (\n\t\t<FullCalendarProvider\n\t\t\tevents={props.events || []}\n\t\t\tviewValue={props.viewValue}\n\t\t\tdefaultViewValue={props.defaultViewValue}\n\t\t\tonChangeView={props.onChangeView}\n\t\t\tblockedTimestamps={props.blockedTimestamps || []}\n\t\t\tonClickDate={props.onClickDate}\n\t\t>\n\t\t\t<FullCalendarContainer>\n\t\t\t\t<FullCalendarHeader viewType={viewType} setViewType={setViewType} />\n\t\t\t\t{viewType === \"day\" && <DayCalendar />}\n\t\t\t\t{viewType === \"month\" && <MonthlyCalendar />}\n\t\t\t\t{viewType === \"week\" && <WeekCalendar />}\n\t\t\t</FullCalendarContainer>\n\t\t</FullCalendarProvider>\n\t);\n}\n\nexport { FullCalendar };\n","type GenerateGAElementsProps = {\n\tmeasurementId: string;\n};\n\nfunction generateGAElements(props: GenerateGAElementsProps) {\n\tconst { measurementId } = props;\n\n\tif (!measurementId)\n\t\tconsole.warn(\"Google Analytics Measurement ID is required\");\n\n\tconst src = `https://www.googletagmanager.com/gtag/js?id=${measurementId}`;\n\n\tconst script = `\n window.dataLayer = window.dataLayer || [];\n function gtag(){dataLayer.push(arguments);}\n gtag('js', new Date());\n gtag('config', '${measurementId}');`;\n\n\treturn {\n\t\tsrc,\n\t\tscript,\n\t};\n}\n\nexport { generateGAElements };\n","import { generateGAElements } from \"./snippets/generateGAElements\";\n\ntype InitializeProps = {\n\tmeasurementId: string;\n};\n\nclass GoogleAnalytics {\n\tprivate initializeAsyncScript(src: string) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.async = true;\n\t\tscript.src = src;\n\t\treturn script;\n\t}\n\n\tprivate initializeInlineScript(content: string) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.innerHTML = content;\n\t\treturn script;\n\t}\n\n\tinitialize(props: InitializeProps) {\n\t\tconst { measurementId } = props;\n\n\t\tconst elements = generateGAElements({ measurementId });\n\n\t\tconst asyncScript = this.initializeAsyncScript(elements.src);\n\t\tconst inlineScript = this.initializeInlineScript(elements.script);\n\n\t\tdocument.head.appendChild(asyncScript);\n\t\tdocument.head.appendChild(inlineScript);\n\t}\n}\n\nexport { GoogleAnalytics };\n","import { GoogleAnalytics } from \"./googleAnalytics\";\n\ntype GoogleAnalyticsClientProps = {\n\tmeasurementId: string;\n};\n\nfunction GoogleAnalyticsClient(props: GoogleAnalyticsClientProps) {\n\tconst googleAnalytics = new GoogleAnalytics();\n\tgoogleAnalytics.initialize(props);\n\n\treturn null;\n}\n\nexport { GoogleAnalyticsClient };\n","import type { JSX } from \"react\";\nimport { ClientOnly } from \"../clientOnly\";\nimport { GoogleAnalyticsClient } from \"./googleAnalytics.client\";\n\ntype GoogleAnalyticsProps = {\n\t/** Google Analytics 4 Measurement ID (e.g. `\"G-XXXXXXXXXX\"`). Required. */\n\tmeasurementId: string;\n\t/** When true, renders the GA4 snippet in development mode (bypasses the production check). @default false */\n\tshowInDevMode?: boolean;\n};\n\n/**\n * GoogleAnalytics, injects the Google Analytics 4 script into the page client-side.\n *\n * Renders nothing in development mode unless `showInDevMode` is `true`.\n * Wrapped in `ClientOnly` to avoid SSR errors.\n *\n * @param props.measurementId - GA4 Measurement ID (e.g. `\"G-XXXXXXXXXX\"`). Required.\n * @param props.showInDevMode - Renders in development mode. Default: false\n *\n * @returns GoogleAnalytics JSX element, or an empty fragment in dev mode.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <GoogleAnalytics measurementId=\"G-XXXXXXXXXX\" />\n *\n * // Enable in development for testing\n * <GoogleAnalytics measurementId=\"G-XXXXXXXXXX\" showInDevMode />\n * ```\n */\n\nfunction GoogleAnalytics(props: GoogleAnalyticsProps): JSX.Element | null {\n\tconst { measurementId, showInDevMode = false } = props;\n\n\tif (process.env.NODE_ENV !== \"production\" && !showInDevMode) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ClientOnly>\n\t\t\t{() => <GoogleAnalyticsClient measurementId={measurementId} />}\n\t\t</ClientOnly>\n\t);\n}\n\nexport { GoogleAnalytics };\n","type AppendToDataLayer = {\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n};\n\nfunction appendToDataLayer(props: AppendToDataLayer) {\n\tconst { dataLayer, dataLayerName } = props;\n\n\treturn `\n window.${dataLayerName} = window.${dataLayerName} || [];\n window.${dataLayerName}.push(${JSON.stringify(dataLayer)})`;\n}\n\nexport { appendToDataLayer };\n","import { appendToDataLayer } from \"./appendToDataLayer\";\n\ntype GenerateGTMElementsProps = {\n\tid: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tpreview: string;\n\tauth: string;\n};\n\nfunction generateGTMElements(props: GenerateGTMElementsProps) {\n\tconst { id, events, dataLayer, dataLayerName, preview, auth } = props;\n\n\tconst gtmAuth = `&gtm_auth=${auth}`;\n\tconst gtmPreview = `&gtm_preview=${preview}`;\n\n\tif (!id) console.warn(\"GTM Id is required\");\n\n\tconst iframe = `\n <iframe src=\"https://www.googletagmanager.com/ns.html?id=${id}${gtmAuth}${gtmPreview}&gtm_cookies_win=x\"\n height=\"0\" width=\"0\" style=\"display:none;visibility:hidden\" id=\"tag-manager\"></iframe>`;\n\n\tconst script = `\n (function(w,d,s,l,i){w[l]=w[l]||[];\n w[l].push({'gtm.start': new Date().getTime(),event:'gtm.js', ${JSON.stringify(\n\t\t\t\tevents,\n\t\t\t).slice(1, -1)}});\n var f=d.getElementsByTagName(s)[0],j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';\n j.async=true;j.src='https://www.googletagmanager.com/gtm.js?id='+i+dl+'${gtmAuth}${gtmPreview}&gtm_cookies_win=x';\n f.parentNode.insertBefore(j,f);\n })(window,document,'script','${dataLayerName}','${id}');`;\n\n\tconst dataLayerVar = appendToDataLayer({ dataLayer, dataLayerName });\n\n\treturn {\n\t\tiframe,\n\t\tscript,\n\t\tdataLayerVar,\n\t};\n}\n\nexport { generateGTMElements };\n","import { appendToDataLayer } from \"./snippets/appendToDataLayer\";\nimport { generateGTMElements } from \"./snippets/generateGTMElements\";\n\ntype InitializeDataLayerProps = {\n\tdataLayerName: string;\n\tdataLayer: Record<string, string>;\n};\n\ntype InitializeGTMProps = {\n\tid: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tpreview: string;\n\tauth: string;\n};\n\ntype InitializeProps = {\n\tgtmId: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tauth: string;\n\tpreview: string;\n};\n\ninterface Window {\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t[key: string]: any;\n}\n\ndeclare var window: Window;\n\nclass GoogleTagManager {\n\tprivate initializeDataScript(dataLayer: string) {\n\t\tconst script = document.createElement(\"script\");\n\t\tscript.innerHTML = dataLayer;\n\t\treturn script;\n\t}\n\n\tprivate initializeGTMElements(props: InitializeGTMProps) {\n\t\tconst snippets = generateGTMElements(props);\n\n\t\tconst noScript = () => {\n\t\t\tconst noscript = document.createElement(\"noscript\");\n\t\t\tnoscript.innerHTML = snippets.iframe;\n\t\t\treturn noscript;\n\t\t};\n\n\t\tconst script = () => {\n\t\t\tconst script = document.createElement(\"script\");\n\t\t\tscript.innerHTML = snippets.script;\n\t\t\treturn script;\n\t\t};\n\n\t\tconst dataScript = this.initializeDataScript(snippets.dataLayerVar);\n\n\t\treturn {\n\t\t\tnoScript,\n\t\t\tscript,\n\t\t\tdataScript,\n\t\t};\n\t}\n\n\tinitializeDataLayer(props: InitializeDataLayerProps) {\n\t\tconst { dataLayer, dataLayerName } = props;\n\n\t\tif (window[dataLayerName]) return window[dataLayerName].push(dataLayer);\n\n\t\tconst snippets = appendToDataLayer({ dataLayer, dataLayerName });\n\t\tconst dataScript = this.initializeDataScript(snippets);\n\n\t\tdocument.head.insertBefore(dataScript, document.head.childNodes[0]);\n\t}\n\n\tinitialize(props: InitializeProps) {\n\t\tconst {\n\t\t\tevents,\n\t\t\tgtmId,\n\t\t\tdataLayer,\n\t\t\tauth = \"\",\n\t\t\tpreview = \"\",\n\t\t\tdataLayerName = \"dataLayer\",\n\t\t} = props;\n\n\t\tconst gtm = this.initializeGTMElements({\n\t\t\tid: gtmId,\n\t\t\tevents: events,\n\t\t\tdataLayer: dataLayer || undefined,\n\t\t\tdataLayerName: dataLayerName,\n\t\t\tauth,\n\t\t\tpreview,\n\t\t});\n\n\t\tif (dataLayer) document.head.appendChild(gtm.dataScript);\n\t\tdocument.head.insertBefore(gtm.script(), document.head.childNodes[0]);\n\t\tdocument.body.insertBefore(gtm.noScript(), document.body.childNodes[0]);\n\t}\n}\n\nexport { GoogleTagManager };\n","import { GoogleTagManager } from \"./googleTagManager\";\n\ntype GoogleTagManagerClientProps = {\n\tgtmId: string;\n\tevents: Record<string, string>;\n\tdataLayer: Record<string, string>;\n\tdataLayerName: string;\n\tauth: string;\n\tpreview: string;\n};\n\nfunction GoogleTagManagerClient(props: GoogleTagManagerClientProps) {\n\tconst googleTagManager = new GoogleTagManager();\n\tgoogleTagManager.initialize(props);\n\n\treturn null;\n}\n\nexport { GoogleTagManagerClient };\n","import { ClientOnly } from \"../clientOnly\";\nimport { GoogleTagManagerClient } from \"./googleTagManager.client\";\n\ntype GoogleTagManagerProps = {\n\t/** Google Tag Manager container ID (e.g. `\"GTM-XXXXXXX\"`). Required. */\n\tgtmId: string;\n\t/** Additional key-value pairs pushed to the dataLayer on initialization. */\n\tevents?: Record<string, string>;\n\t/** Initial key-value pairs added to the dataLayer before GTM loads. */\n\tdataLayer?: Record<string, string>;\n\t/** Global variable name for the dataLayer array. @default \"dataLayer\" */\n\tdataLayerName?: string;\n\t/** GTM environment auth token (for staging/testing environments). */\n\tauth?: string;\n\t/** GTM environment preview token (e.g. `\"env-3\"`). */\n\tpreview?: string;\n\t/** When true, renders the GTM snippet in development mode (bypasses the production check). @default false */\n\tshowInDevMode?: boolean;\n};\n\n/**\n * GoogleTagManager, injects the GTM `<script>` and `<noscript>` snippets into the page client-side.\n *\n * Renders nothing in development mode unless `showInDevMode` is `true`.\n * Wrapped in `ClientOnly` to avoid SSR errors.\n *\n * @param props.gtmId - GTM container ID (e.g. `\"GTM-XXXXXXX\"`). Required.\n * @param props.dataLayer - Initial key-value pairs for the dataLayer.\n * @param props.dataLayerName - Global dataLayer variable name. Default: \"dataLayer\"\n * @param props.events - Additional key-value pairs pushed on initialization.\n * @param props.auth - GTM environment auth token.\n * @param props.preview - GTM environment preview token (e.g. `\"env-3\"`).\n * @param props.showInDevMode - Renders in development mode. Default: false\n *\n * @returns GoogleTagManager JSX element, or an empty fragment in dev mode.\n *\n * @example\n * ```tsx\n * // Basic setup in your root layout\n * <GoogleTagManager gtmId=\"GTM-XXXXXXX\" />\n *\n * // With initial dataLayer values\n * <GoogleTagManager\n * gtmId=\"GTM-XXXXXXX\"\n * dataLayer={{ pageType: \"home\", userType: \"anonymous\" }}\n * />\n *\n * // Staging/preview environment\n * <GoogleTagManager\n * gtmId=\"GTM-XXXXXXX\"\n * auth=\"your-auth-token\"\n * preview=\"env-3\"\n * showInDevMode\n * />\n * ```\n */\n\nfunction GoogleTagManager(props: GoogleTagManagerProps) {\n\tconst {\n\t\tgtmId,\n\t\tauth = \"\",\n\t\tpreview = \"\",\n\t\tdataLayerName = \"dataLayer\",\n\t\tevents = {},\n\t\tdataLayer = {},\n\t\tshowInDevMode = false,\n\t} = props;\n\n\tif (process.env.NODE_ENV !== \"production\" && !showInDevMode) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ClientOnly>\n\t\t\t{() => (\n\t\t\t\t<GoogleTagManagerClient\n\t\t\t\t\tauth={auth}\n\t\t\t\t\tdataLayer={dataLayer}\n\t\t\t\t\tdataLayerName={dataLayerName}\n\t\t\t\t\tevents={events}\n\t\t\t\t\tgtmId={gtmId}\n\t\t\t\t\tpreview={preview}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ClientOnly>\n\t);\n}\n\nexport { GoogleTagManager };\n","import { RefreshCw } from \"lucide-react\";\n\nimport { Button } from \"../../button\";\nimport { IconButton } from \"../../iconButton\";\nimport { Tooltip } from \"../../tooltip\";\n\nimport \"./styles.css\";\n\ntype HasFileContentProps = {\n\tdisabled: boolean;\n\tacceptImage: string;\n\tisLoading: boolean;\n\tchangeImageButtonText: string;\n\tfilePath: string;\n\treSendImage?: () => void;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction HasFileContent(props: HasFileContentProps) {\n\tconst {\n\t\tdisabled,\n\t\tfilePath,\n\t\tisLoading,\n\t\tacceptImage,\n\t\tchangeImageButtonText,\n\t\thandleSelectFile,\n\t\treSendImage,\n\t} = props;\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptImage;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div\n\t\t\tclassName=\"arkynImageUploadHasFileContent\"\n\t\t\tstyle={{ backgroundImage: `url(\"${filePath}\")` }}\n\t\t>\n\t\t\t{reSendImage && (\n\t\t\t\t<Tooltip orientation=\"bottom\" text=\"Reenviar imagem\">\n\t\t\t\t\t<IconButton\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\taria-label=\"resend image\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tsize=\"sm\"\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tonClick={reSendImage}\n\t\t\t\t\t\ticon={RefreshCw}\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t/>\n\t\t\t\t</Tooltip>\n\t\t\t)}\n\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"outline\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{changeImageButtonText}\n\t\t\t</Button>\n\t\t</div>\n\t);\n}\n\nexport { HasFileContent };\n","import type { DragEvent } from \"react\";\n\nimport { Button } from \"../../button\";\nimport \"./styles.css\";\n\ntype NoFileContentProps = {\n\tdisabled: boolean;\n\tacceptImage: string;\n\tisLoading: boolean;\n\tselectImageButtonText: string;\n\tdropImageText: string;\n\thandleSelectFile: (file: File) => void;\n};\n\nfunction NoFileContent(props: NoFileContentProps) {\n\tconst {\n\t\tdropImageText,\n\t\tisLoading,\n\t\tacceptImage,\n\t\thandleSelectFile,\n\t\tselectImageButtonText,\n\t\tdisabled,\n\t} = props;\n\n\tfunction handleDrop(event: DragEvent<HTMLDivElement>) {\n\t\tif (disabled) return;\n\n\t\tevent.preventDefault();\n\t\tconst file = event.dataTransfer.files[0];\n\t\tif (file) handleSelectFile(file);\n\t}\n\n\tfunction handleClick() {\n\t\tif (disabled) return;\n\n\t\tconst input = document.createElement(\"input\");\n\n\t\tinput.type = \"file\";\n\t\tinput.accept = acceptImage;\n\n\t\tinput.onchange = (event) => {\n\t\t\tconst file = (event.target as HTMLInputElement).files?.[0];\n\t\t\tif (file) handleSelectFile(file);\n\t\t};\n\n\t\tinput.click();\n\t}\n\n\treturn (\n\t\t<div onDrop={handleDrop} className=\"arkynImageUploadNoFileContent\">\n\t\t\t<Button\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tvariant=\"ghost\"\n\t\t\t\tsize=\"sm\"\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t{selectImageButtonText}\n\t\t\t</Button>\n\n\t\t\t<p>{dropImageText}</p>\n\t\t</div>\n\t);\n}\n\nexport { NoFileContent };\n","import { useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\n\nimport { HasFileContent } from \"./hasFileContent\";\nimport { NoFileContent } from \"./noFileContent\";\nimport \"./styles.css\";\n\ntype ImageUploadProps = {\n\t/** Field name for form submission (stores the uploaded image URL). Required. */\n\tname: string;\n\t/** Server endpoint URL that receives the `multipart/form-data` upload request. Required. */\n\taction: string;\n\t/** Pre-populated image URL displayed as a preview (e.g. an existing avatar). @default \"\" */\n\tdefaultValue?: string | null;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables file selection and upload. @default false */\n\tdisabled?: boolean;\n\t/** Optional label text displayed above the upload area. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. @default false */\n\tshowAsterisk?: boolean;\n\t/** Label for the file-picker button after an image is selected. @default \"Alterar imagem\" */\n\tchangeImageButtonText?: string;\n\t/** Label for the file-picker button before an image is selected. @default \"Selecionar imagem\" */\n\tselectImageButtonText?: string;\n\t/** Text displayed in the drag-and-drop zone. @default \"Ou arraste e solte a imagem aqui\" */\n\tdropImageText?: string;\n\t/** HTTP method for the upload request. @default \"POST\" */\n\tmethod?: string;\n\t/** Form-data field name used for the file. @default \"file\" */\n\tfileName?: string;\n\t/** Property name in the server response that contains the image URL. @default \"url\" */\n\tfileResponseName?: string;\n\t/** Accepted image MIME types or extensions (e.g. `\"image/jpeg,image/png\"`). @default \"image/*\" */\n\tacceptImage?: string;\n\t/** Callback fired after a successful upload. Receives the image URL returned by the server. */\n\tonChange?: (url: string) => void;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * ImageUpload, drag-and-drop image uploader with server upload and image preview.\n *\n * Sends the file via `fetch` as `multipart/form-data` and stores the returned URL\n * in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.action - Upload endpoint URL. Required.\n * @param props.defaultValue - Pre-populated image URL displayed as preview.\n * @param props.disabled - Disables file selection and upload. Default: false\n * @param props.label - Label text displayed above the upload area.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.acceptImage - Accepted MIME types or extensions. Default: \"image/*\"\n * @param props.method - HTTP method. Default: \"POST\"\n * @param props.fileName - Form-data field name for the file. Default: \"file\"\n * @param props.fileResponseName - Server response property containing the URL. Default: \"url\"\n * @param props.onChange - Callback fired after a successful upload, receives the image URL.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns ImageUpload JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <ImageUpload name=\"avatar\" action=\"/api/upload/image\" />\n *\n * // Profile picture with existing image and label\n * <ImageUpload\n * name=\"profilePicture\"\n * action=\"/api/upload/avatar\"\n * label=\"Profile Picture\"\n * showAsterisk\n * defaultValue={user.avatarUrl}\n * selectImageButtonText=\"Choose photo\"\n * onChange={(url) => updateProfile({ avatarUrl: url })}\n * />\n *\n * // Restricted to JPEG/PNG\n * <ImageUpload\n * name=\"productImage\"\n * action=\"/api/upload/product\"\n * label=\"Product Image\"\n * acceptImage=\"image/jpeg,image/png\"\n * fileResponseName=\"imageUrl\"\n * />\n * ```\n */\n\nfunction ImageUpload(props: ImageUploadProps) {\n\tconst {\n\t\tname,\n\t\tdefaultValue = \"\",\n\t\tlabel,\n\t\tshowAsterisk = false,\n\t\taction,\n\t\tfileName = \"file\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tmethod = \"POST\",\n\t\tacceptImage = \"image/*\",\n\t\tfileResponseName = \"url\",\n\t\tchangeImageButtonText = \"Alterar imagem\",\n\t\tselectImageButtonText = \"Selecionar imagem\",\n\t\tdropImageText = \"Ou arraste e solte a imagem aqui\",\n\t\tonChange,\n\t\tdisabled = false,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst fieldError = fieldErrors?.[name];\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst [error, setError] = useState(\"\");\n\tconst [file, setFile] = useState<File | null>(null);\n\tconst [filePath, setFilePath] = useState(defaultValue);\n\tconst [isLoading, setIsLoading] = useState(false);\n\n\tasync function handleUploadImage(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetIsLoading(true);\n\t\tsetFile(file);\n\t\tsetError(\"\");\n\n\t\tconst formData = new FormData();\n\t\tformData.append(fileName, file);\n\n\t\tawait fetch(action, { method: method, body: formData })\n\t\t\t.then(async (response) => await response.json())\n\t\t\t.then((response) => {\n\t\t\t\tif (response?.error) setError(response.error);\n\t\t\t\telse setValue(response?.[fileResponseName]);\n\t\t\t\tonChange?.(response?.[fileResponseName]);\n\t\t\t})\n\t\t\t.catch((error) => {\n\t\t\t\tconsole.error(error);\n\t\t\t\tsetError(\"Erro ao enviar imagem\");\n\t\t\t})\n\t\t\t.finally(() => setIsLoading(false));\n\t}\n\n\tfunction handleSelectFile(file: File) {\n\t\tif (disabled) return;\n\n\t\tsetFilePath(URL.createObjectURL(file));\n\t\thandleUploadImage(file);\n\t}\n\n\tconst errorMessage = fieldError || error;\n\n\tconst hasErrorClassName = errorMessage ? \"hasError\" : \"noHasError\";\n\tconst hasImageClassName = filePath ? \"hasImage\" : \"noHasImage\";\n\tconst className = `arkynImageUpload ${hasErrorClassName} ${hasImageClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<div className={className}>\n\t\t\t\t<input type=\"hidden\" name={name} value={value || \"\"} />\n\n\t\t\t\t{!filePath && (\n\t\t\t\t\t<NoFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptImage={acceptImage}\n\t\t\t\t\t\tdropImageText={dropImageText}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tselectImageButtonText={selectImageButtonText}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\n\t\t\t\t{filePath && (\n\t\t\t\t\t<HasFileContent\n\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t\t\tacceptImage={acceptImage}\n\t\t\t\t\t\tfilePath={filePath}\n\t\t\t\t\t\thandleSelectFile={handleSelectFile}\n\t\t\t\t\t\tchangeImageButtonText={changeImageButtonText}\n\t\t\t\t\t\treSendImage={\n\t\t\t\t\t\t\terrorMessage && file ? () => handleUploadImage(file) : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t)}\n\t\t\t</div>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { ImageUpload };\n","import mapBoxGl, { type Map as MapboxMap } from \"mapbox-gl\";\nimport { createRoot } from \"react-dom/client\";\nimport \"./mapbox.css\";\nimport {\n\ttype HtmlHTMLAttributes,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n} from \"react\";\n\ntype Coordinate = {\n\tlat: number;\n\tlng: number;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\tpopUp?: ReactNode;\n};\n\ntype ClientMapViewProps = {\n\tcenter?: Coordinate;\n\tcoordinates: Coordinate[];\n\tonMarkerClick?: (coordinate: Coordinate) => void;\n\taccessToken: string;\n} & HtmlHTMLAttributes<HTMLDivElement>;\n\nfunction ClientMapView({\n\tcenter: rawCenter,\n\tcoordinates,\n\tonMarkerClick,\n\taccessToken,\n\t...rest\n}: ClientMapViewProps) {\n\tconst mapRef = useRef<MapboxMap | null>(null);\n\tconst mapContainerRef = useRef<HTMLDivElement>(null);\n\n\tconst center = rawCenter ? rawCenter : coordinates[0];\n\n\tuseEffect(() => {\n\t\tmapBoxGl.accessToken = accessToken;\n\n\t\tmapRef.current = new mapBoxGl.Map({\n\t\t\tcontainer: mapContainerRef.current as HTMLDivElement,\n\t\t\tstyle: \"mapbox://styles/mapbox/light-v11\",\n\t\t\tcenter: [center.lng, center.lat],\n\t\t\tzoom: 13,\n\t\t\tlanguage: \"pt-BR\",\n\t\t});\n\n\t\tcoordinates.forEach((props) => {\n\t\t\tconst { lat, lng, popUp } = props;\n\t\t\tconst el = document.createElement(\"img\");\n\n\t\t\tel.className = \"arkynMarker\";\n\t\t\tel.src = \"https://i.postimg.cc/mgKggjk7/Pin.png\";\n\n\t\t\tconst marker = new mapBoxGl.Marker(el)\n\t\t\t\t.setLngLat([lng, lat])\n\t\t\t\t.addTo(mapRef.current as MapboxMap);\n\n\t\t\tif (popUp) {\n\t\t\t\tconst popupNode = document.createElement(\"div\");\n\t\t\t\tconst root = createRoot(popupNode);\n\t\t\t\troot.render(popUp);\n\n\t\t\t\tconst popup = new mapBoxGl.Popup({\n\t\t\t\t\toffset: 25,\n\t\t\t\t\tcloseButton: false,\n\t\t\t\t\tclassName: \"arkynMapViewPopup\",\n\t\t\t\t}).setDOMContent(popupNode);\n\n\t\t\t\tmarker.setPopup(popup);\n\t\t\t}\n\n\t\t\tel.addEventListener(\"click\", () => {\n\t\t\t\tif (onMarkerClick) onMarkerClick(props);\n\t\t\t\tmapRef.current?.flyTo({ center: [lng, lat], zoom: 15, duration: 1200 });\n\t\t\t\tmarker.togglePopup();\n\t\t\t});\n\t\t});\n\n\t\treturn () => {\n\t\t\tmapRef.current?.remove();\n\t\t};\n\t}, [center.lat, onMarkerClick, coordinates.forEach, center.lng, accessToken]);\n\n\treturn (\n\t\t<div\n\t\t\tid=\"map-container\"\n\t\t\tref={mapContainerRef}\n\t\t\tstyle={{ height: \"100%\", width: \"100%\", borderRadius: \"8px\" }}\n\t\t\t{...rest}\n\t\t/>\n\t);\n}\n\nexport { ClientMapView };\n","import { MapPinned } from \"lucide-react\";\nimport type { HtmlHTMLAttributes, ReactNode } from \"react\";\n\nimport { ClientMapView } from \"./mapView.client\";\nimport \"./styles.css\";\nimport { ClientOnly } from \"../clientOnly\";\n\n/** Data for a single map marker. */\ntype Coordinate = {\n\t/** Latitude of the marker position. */\n\tlat: number;\n\t/** Longitude of the marker position. */\n\tlng: number;\n\t/** Arbitrary data attached to the marker, available in `onMarkerClick`. */\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n\t/** Custom React node rendered inside the marker popup on click. */\n\tpopUp?: ReactNode;\n};\n\ntype MapViewProps = {\n\t/** Mapbox GL public access token from your Mapbox account. Required. */\n\taccessToken: string;\n\t/** Initial zoom level. @default 18 */\n\tzoom?: number;\n\t/** Single coordinate or array of coordinates to display as markers. */\n\tcoordinates?: Coordinate | Coordinate[];\n\t/** Callback fired when the user clicks a marker. Receives the coordinate's data. */\n\tonMarkerClick?: (coordinate: Coordinate) => void;\n} & HtmlHTMLAttributes<HTMLDivElement>;\n\ntype EmptyMapProps = {\n\tclassName?: string;\n};\n\nfunction EmptyMap({ className }: EmptyMapProps) {\n\treturn (\n\t\t<div className={`arkynMapViewPinnedEmpty ${className}`}>\n\t\t\t<MapPinned />\n\t\t</div>\n\t);\n}\n\n/**\n * MapView, interactive Mapbox map with optional click-able markers.\n *\n * Renders client-side only (via `ClientOnly`). Displays a placeholder icon\n * when `coordinates` is absent or empty, or before the component hydrates.\n *\n * @param props.accessToken - Mapbox GL public access token. Required.\n * @param props.zoom - Initial zoom level. Default: 18\n * @param props.coordinates - Marker(s) to display on the map.\n * @param props.onMarkerClick - Callback fired when a marker is clicked.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns MapView JSX element, or a placeholder icon when no coordinates are provided.\n *\n * @example\n * ```tsx\n * // Single marker\n * <MapView\n * accessToken=\"pk.your-mapbox-token\"\n * coordinates={{ lat: -23.5505, lng: -46.6333 }}\n * />\n *\n * // Multiple markers with popup and click handler\n * <MapView\n * accessToken=\"pk.your-mapbox-token\"\n * zoom={12}\n * coordinates={[\n * { lat: -23.55, lng: -46.63, data: { id: 1 }, popUp: <p>Store A</p> },\n * { lat: -23.56, lng: -46.64, data: { id: 2 }, popUp: <p>Store B</p> },\n * ]}\n * onMarkerClick={(coord) => selectStore(coord.data.id)}\n * />\n * ```\n */\nfunction MapView(props: MapViewProps) {\n\tconst {\n\t\tcoordinates,\n\t\tzoom = 18,\n\t\taccessToken,\n\t\tclassName,\n\t\tonMarkerClick,\n\t\t...rest\n\t} = props;\n\n\tif (!coordinates) return <EmptyMap className={className} />;\n\n\tconst coordArray = Array.isArray(coordinates) ? coordinates : [coordinates];\n\tif (coordArray.length === 0) return <EmptyMap className={className} />;\n\n\treturn (\n\t\t<ClientOnly fallback={<EmptyMap className={className} />}>\n\t\t\t{() => (\n\t\t\t\t<ClientMapView\n\t\t\t\t\taccessToken={accessToken}\n\t\t\t\t\tcoordinates={coordArray}\n\t\t\t\t\tcenter={coordArray[0]}\n\t\t\t\t\tonMarkerClick={onMarkerClick}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t)}\n\t\t</ClientOnly>\n\t);\n}\n\nexport { MapView };\n","import { InputMask, type Replacement } from \"@react-input/mask\";\nimport { Loader2, type LucideIcon } from \"lucide-react\";\nimport {\n\ttype FocusEvent,\n\tforwardRef,\n\ttype InputHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\n\nimport \"./style.css\";\n\ntype MaskedInputProps = Omit<\n\tInputHTMLAttributes<HTMLInputElement>,\n\t\"size\" | \"prefix\" | \"name\" | \"type\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/**\n\t * Mask pattern string. Use the replacement character as an editable placeholder.\n\t * Example: `\"(__) _____-____\"` for a Brazilian mobile phone number.\n\t * Required.\n\t */\n\tmask: string;\n\t/**\n\t * Character or replacement map that marks editable positions in the mask.\n\t * - String: `\"_\"`, every `_` in the mask becomes editable.\n\t * - Object: `{ _: /\\d/ }`, only accepts digits in those positions.\n\t * Required.\n\t */\n\treplacement: string | Replacement;\n\t/**\n\t * When true, strips mask characters from the underlying value,\n\t * keeping only the user-typed characters.\n\t */\n\tseparate?: boolean;\n\t/** When true, shows the full mask pattern in the input before the user types. */\n\tshowMask?: boolean;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Validation error message displayed below the input. */\n\terrorMessage?: string;\n\t/** Shows a spinner and disables the input during async operations. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the input area. */\n\tprefix?: string | LucideIcon;\n\t/** Text or icon rendered at the far right, outside the input area. */\n\tsuffix?: string | LucideIcon;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Lucide icon rendered inside the input on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Lucide icon rendered inside the input on the right. */\n\trightIcon?: LucideIcon;\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\nconst BaseInput = forwardRef<\n\tHTMLInputElement,\n\tInputHTMLAttributes<HTMLInputElement>\n>((props, ref) => {\n\treturn <input ref={ref} {...props} />;\n});\n\n/**\n * MaskedInput, text input with a configurable mask for structured values (phones, CPF, credit cards, etc.).\n *\n * Built on `@react-input/mask`. Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.mask - Mask pattern string. Required.\n * @param props.replacement - Character or map that marks editable positions. Required.\n * @param props.separate - Strips mask chars from the value, keeping only typed characters.\n * @param props.showMask - Shows the full mask pattern before the user types.\n * @param props.label - Label text displayed above the input.\n * @param props.errorMessage - Validation error message.\n * @param props.isLoading - Shows a spinner and disables the input. Default: false\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.prefix - Text or icon at the far left.\n * @param props.suffix - Text or icon at the far right.\n * @param props.leftIcon - Lucide icon inside the input on the left.\n * @param props.rightIcon - Lucide icon inside the input on the right.\n * @param props.showAsterisk - Appends `*` to the label.\n *\n * **...Other valid HTML properties for `<input>` (except `type`)**\n *\n * @returns MaskedInput JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Brazilian mobile phone\n * <MaskedInput\n * name=\"phone\"\n * mask=\"(__) _____-____\"\n * replacement={{ _: /\\d/ }}\n * label=\"Phone\"\n * />\n *\n * // CPF with mask visible and validation\n * <MaskedInput\n * name=\"cpf\"\n * label=\"CPF\"\n * mask=\"___.___.___-__\"\n * replacement=\"_\"\n * showMask\n * showAsterisk\n * errorMessage=\"Invalid CPF\"\n * />\n *\n * // Credit card\n * <MaskedInput\n * name=\"card\"\n * label=\"Credit Card\"\n * mask=\"____ ____ ____ ____\"\n * replacement={{ _: /\\d/ }}\n * leftIcon={CreditCard}\n * />\n * ```\n */\n\nfunction MaskedInput(props: MaskedInputProps) {\n\tconst {\n\t\tname,\n\t\tdisabled,\n\t\ttitle,\n\t\tstyle,\n\t\tvariant = \"solid\",\n\t\tseparate,\n\t\tmask,\n\t\tshowMask,\n\t\treplacement,\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tprefix,\n\t\tsuffix,\n\t\tisLoading = false,\n\t\tleftIcon,\n\t\treadOnly,\n\t\tonFocus,\n\t\tonBlur,\n\t\terrorMessage: baseErrorMessage,\n\t\tdefaultValue,\n\t\tshowAsterisk,\n\t\trightIcon,\n\t\tsize = \"md\",\n\t\tid,\n\t\tvalue,\n\t\tplaceholder,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst loadingPosition = rightIcon ? \"right\" : \"left\";\n\n\tconst showLeftSpinner = loadingPosition === \"left\" && isLoading;\n\tconst showRightSpinner = loadingPosition === \"right\" && isLoading;\n\n\tfunction handleSectionClick() {\n\t\tif (isDisabled || !inputRef?.current) return;\n\t\tsetIsFocused(true);\n\t\tinputRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLInputElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\tconst hasPrefix = prefix ? \"hasPrefix\" : \"\";\n\tconst hasSuffix = suffix ? \"hasSuffix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = isDisabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynMaskedInput ${hasPrefix} ${hasSuffix} ${variant} ${size} ${opacity} ${errored} ${focused}`;\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel showAsterisk={showAsterisk} htmlFor={inputId}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showLeftSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={leftIcon} iconSize={iconSize} />\n\n\t\t\t\t<InputMask\n\t\t\t\t\tcomponent={BaseInput}\n\t\t\t\t\tmask={mask}\n\t\t\t\t\treplacement={replacement}\n\t\t\t\t\tseparate={separate}\n\t\t\t\t\tshowMask={showMask}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tid={inputId}\n\t\t\t\t\tname={name}\n\t\t\t\t\tdefaultValue={defaultValue || undefined}\n\t\t\t\t\tplaceholder={isDisabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={isDisabled ? undefined : value}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer show={!isLoading} icon={rightIcon} iconSize={iconSize} />\n\n\t\t\t\t<IconRenderer\n\t\t\t\t\tshow={showRightSpinner}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tclassName=\"spinner\"\n\t\t\t\t\ticon={Loader2}\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={suffix} className=\"suffix\" />\n\t\t\t</section>\n\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { MaskedInput };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype ModalContextProps = {\n\tmakeInvisible: () => void;\n};\n\ntype ModalProviderProps = {\n\tchildren: ReactNode;\n\tmakeInvisible: () => void;\n};\n\nconst modalContext = createContext({} as ModalContextProps);\n\nfunction ModalProvider(props: ModalProviderProps) {\n\tconst value = useMemo(\n\t\t() => ({ makeInvisible: props.makeInvisible }),\n\t\t[props.makeInvisible],\n\t);\n\n\treturn (\n\t\t<modalContext.Provider value={value}>\n\t\t\t{props.children}\n\t\t</modalContext.Provider>\n\t);\n}\n\nfunction useModal() {\n\treturn useContext(modalContext);\n}\n\nexport { ModalProvider, useModal };\n","import {\n\ttype AnimationEvent,\n\ttype HTMLAttributes,\n\tuseEffect,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { ModalProvider } from \"../modalContext\";\nimport \"./styles.css\";\n\ntype ModalContainerProps = HTMLAttributes<HTMLElement> & {\n\t/** Controls whether the modal is visible. */\n\tisVisible: boolean;\n\t/** Callback invoked when the backdrop overlay is clicked. */\n\tmakeInvisible: () => void;\n};\n\n/**\n * ModalContainer, animated centered modal rendered over a backdrop overlay.\n *\n * Locks body scroll while open. Closes when the overlay is clicked.\n * Provides context consumed by `ModalHeader` (close button).\n *\n * @param props.isVisible - Whether the modal is open. Required.\n * @param props.makeInvisible - Called when the overlay is clicked. Required.\n *\n * **...Other valid HTML `<aside>` properties**\n *\n * @returns ModalContainer JSX element.\n *\n * @example\n * ```tsx\n * const [isOpen, setIsOpen] = useState(false);\n *\n * <ModalContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>\n * <ModalHeader><h2>Confirm deletion</h2></ModalHeader>\n * <main><p>This action cannot be undone.</p></main>\n * <ModalFooter>\n * <Button onClick={() => setIsOpen(false)}>Cancel</Button>\n * <Button scheme=\"danger\" onClick={handleDelete}>Delete</Button>\n * </ModalFooter>\n * </ModalContainer>\n * ```\n */\n\nfunction ModalContainer(args: ModalContainerProps) {\n\tconst {\n\t\tisVisible,\n\t\tmakeInvisible,\n\t\tchildren,\n\t\tclassName: baseClassName = \"\",\n\t\t...rest\n\t} = args;\n\n\tconst [mounted, setMounted] = useState(isVisible);\n\tconst [isExiting, setIsExiting] = useState(false);\n\n\tuseEffect(() => {\n\t\tif (isVisible) {\n\t\t\tsetMounted(true);\n\t\t\tsetIsExiting(false);\n\t\t} else if (mounted) {\n\t\t\tsetIsExiting(true);\n\t\t}\n\t}, [isVisible, mounted]);\n\n\tuseScrollLock(isVisible);\n\n\tfunction handleOverlayAnimationEnd(e: AnimationEvent<HTMLDivElement>) {\n\t\tif (e.target === e.currentTarget && isExiting) {\n\t\t\tsetIsExiting(false);\n\t\t\tsetMounted(false);\n\t\t\tmakeInvisible();\n\t\t}\n\t}\n\n\tif (!mounted) return null;\n\n\tconst className = [\n\t\t\"arkynModalContainer\",\n\t\tisExiting ? \"exiting\" : \"\",\n\t\tbaseClassName,\n\t]\n\t\t.filter(Boolean)\n\t\t.join(\" \");\n\n\treturn (\n\t\t<ModalProvider makeInvisible={() => setIsExiting(true)}>\n\t\t\t<aside className={className.trim()} {...rest}>\n\t\t\t\t<div\n\t\t\t\t\tclassName=\"arkynModalContainerOverlay\"\n\t\t\t\t\tonClick={() => setIsExiting(true)}\n\t\t\t\t\tonAnimationEnd={handleOverlayAnimationEnd}\n\t\t\t\t/>\n\t\t\t\t<div className=\"arkynModalContainerContent\">{children}</div>\n\t\t\t</aside>\n\t\t</ModalProvider>\n\t);\n}\n\nexport { ModalContainer };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype ModalFooterProps = HTMLAttributes<HTMLElement> & {\n\t/**\n\t * Horizontal alignment of footer content.\n\t * - `left` / `center` / `right`: flex-start, center, flex-end.\n\t * - `between`: space-between.\n\t * - `around`: space-around.\n\t * @default \"right\"\n\t */\n\talignment?: \"left\" | \"center\" | \"right\" | \"between\" | \"around\";\n};\n\n/**\n * ModalFooter, action bar at the bottom of a modal dialog.\n *\n * @param props.alignment - Horizontal alignment of children. Default: `\"right\"`\n *\n * **...Other valid HTML `<footer>` properties**\n *\n * @returns ModalFooter JSX element.\n *\n * @example\n * ```tsx\n * // Confirm / cancel pattern (right-aligned by default)\n * <ModalFooter>\n * <Button variant=\"ghost\" onClick={onClose}>Cancel</Button>\n * <Button scheme=\"danger\" onClick={onConfirm}>Delete</Button>\n * </ModalFooter>\n *\n * // Space-between layout (e.g. back / next in a wizard)\n * <ModalFooter alignment=\"between\">\n * <Button variant=\"outline\" onClick={onBack}>Back</Button>\n * <Button onClick={onNext}>Next</Button>\n * </ModalFooter>\n * ```\n */\n\nfunction ModalFooter(args: ModalFooterProps) {\n\tconst { alignment = \"right\", className: baseClassName, ...rest } = args;\n\tconst className = `arkynModalFooter ${alignment} ${baseClassName}`;\n\n\treturn <footer className={className.trim()} {...rest} />;\n}\n\nexport { ModalFooter };\n","import { X } from \"lucide-react\";\nimport type { HTMLAttributes } from \"react\";\n\nimport { useModal } from \"../modalContext\";\nimport \"./styles.css\";\n\ntype ModalHeaderProps = HTMLAttributes<HTMLElement> & {\n\t/** Whether to render the X close button. @default true */\n\tshowCloseButton?: boolean;\n};\n\n/**\n * ModalHeader, header section for a `ModalContainer`, with an optional close button.\n *\n * The close button calls `makeInvisible` from the nearest `ModalContainer` context.\n * Must be rendered inside a `ModalContainer`.\n *\n * @param props.showCloseButton - Renders the X close button. Default: true\n *\n * **...Other valid HTML `<header>` properties**\n *\n * @returns ModalHeader JSX element.\n *\n * @example\n * ```tsx\n * <ModalContainer isVisible={isOpen} makeInvisible={() => setIsOpen(false)}>\n * <ModalHeader>\n * <h2>Edit profile</h2>\n * </ModalHeader>\n * <main>...</main>\n * <ModalFooter><Button onClick={onSave}>Save</Button></ModalFooter>\n * </ModalContainer>\n * ```\n */\n\nfunction ModalHeader(args: ModalHeaderProps) {\n\tconst {\n\t\tshowCloseButton = true,\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = args;\n\n\tconst { makeInvisible } = useModal();\n\tconst className = `arkynModalHeader ${baseClassName}`;\n\n\treturn (\n\t\t<header className={className.trim()} {...rest}>\n\t\t\t{children}\n\n\t\t\t{showCloseButton && (\n\t\t\t\t<button\n\t\t\t\t\ttype=\"button\"\n\t\t\t\t\tonClick={makeInvisible}\n\t\t\t\t\taria-label=\"Close modal button\"\n\t\t\t\t\tclassName=\"arkynModalHeaderCloseButton\"\n\t\t\t\t>\n\t\t\t\t\t<X size={24} />\n\t\t\t\t</button>\n\t\t\t)}\n\t\t</header>\n\t);\n}\n\nexport { ModalHeader };\n","import { ChevronDown } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectChevronProps = {\n\tisLoading: boolean;\n\ticonSize: number;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisFocused: boolean;\n};\n\nfunction MultiSelectChevron(props: MultiSelectChevronProps) {\n\tconst { iconSize, isLoading, disabled, readOnly, isFocused } = props;\n\n\tconst notAnimate = disabled || readOnly ? \"notAnimate\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynMultiSelectChevron ${notAnimate} ${focused}`;\n\n\tif (isLoading) return null;\n\treturn (\n\t\t<ChevronDown\n\t\t\tclassName={className}\n\t\t\tstrokeWidth={2.5}\n\t\t\tstyle={{\n\t\t\t\tminWidth: iconSize,\n\t\t\t\tminHeight: iconSize,\n\t\t\t\tmaxWidth: iconSize,\n\t\t\t\tmaxHeight: iconSize,\n\t\t\t}}\n\t\t/>\n\t);\n}\n\nexport { MultiSelectChevron };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype MultiSelectContainerProps = {\n\tchildren: ReactNode;\n\thandleContainerFocus: () => void;\n\tprefixExists: boolean;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tid: string;\n\tvariant: \"solid\" | \"outline\" | \"underline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction MultiSelectContainer(props: MultiSelectContainerProps) {\n\tconst {\n\t\tchildren,\n\t\thandleContainerFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName,\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t\tid,\n\t\tprefixExists,\n\t} = props;\n\n\tconst hasPrefix = prefixExists ? \"hasPrefix\" : \"\";\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\treturn (\n\t\t<section\n\t\t\tid={id}\n\t\t\tclassName={`arkynMultiSelectContainer ${hasPrefix} ${variant} ${size} ${opacity} ${errored} ${focused} ${className}`}\n\t\t\tonClick={handleContainerFocus}\n\t\t>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { MultiSelectContainer };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype MultiSelectContentProps = {\n\tchildren: ReactNode;\n\tsize: \"md\" | \"lg\";\n};\n\nfunction MultiSelectContent(props: MultiSelectContentProps) {\n\tconst { children, size } = props;\n\tconst className = `arkynMultiSelectContent ${size}`;\n\treturn <div className={className}>{children}</div>;\n}\n\nexport { MultiSelectContent };\n","import { X } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectMarkProps = {\n\tlabel: string;\n\tdisabled: boolean;\n\tvalue: string;\n\thandleChangeValue: (value: string) => void;\n};\n\nfunction MultiSelectMark(props: MultiSelectMarkProps) {\n\tconst { label, value, disabled, handleChangeValue } = props;\n\n\treturn (\n\t\t<div className=\"arkynMultiSelectMark\">\n\t\t\t{label}\n\n\t\t\t<button\n\t\t\t\tdisabled={disabled}\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={(e) => {\n\t\t\t\t\te.stopPropagation();\n\t\t\t\t\thandleChangeValue(value);\n\t\t\t\t}}\n\t\t\t>\n\t\t\t\t<X />\n\t\t\t</button>\n\t\t</div>\n\t);\n}\n\nexport { MultiSelectMark };\n","import { Check } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectOptionProps = {\n\tvalue: string;\n\tlabel: string;\n\tsize: \"md\" | \"lg\";\n\toptionHasSelected: (value: string) => boolean;\n\thandleChangeValue: (value: string) => void;\n};\n\nfunction MultiSelectOption(props: MultiSelectOptionProps) {\n\tconst { label, optionHasSelected, handleChangeValue, value, size } = props;\n\n\tconst hasActive = optionHasSelected(value) ? \"active\" : \"\";\n\tconst className = `arkynMultiSelectOption ${size} ${hasActive}`;\n\n\treturn (\n\t\t<div onClick={() => handleChangeValue(value)} className={className}>\n\t\t\t{label} <Check />\n\t\t</div>\n\t);\n}\n\nexport { MultiSelectOption };\n","import { Search } from \"lucide-react\";\nimport {\n\ttype ChangeEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport { Input } from \"../../input\";\n\nimport \"./styles.css\";\n\ntype MultiSelectOptionsContainerProps = {\n\tisFocused: boolean;\n\tisSearchable: boolean;\n\tchildren: ReactNode;\n\tsearch: string;\n\tonSearch: (value: string) => void;\n};\n\nfunction MultiSelectOptionsContainer(props: MultiSelectOptionsContainerProps) {\n\tconst { children, isFocused, isSearchable, search, onSearch } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tuseScrollLock(isFocused);\n\n\tuseEffect(() => {\n\t\tif (!isFocused) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 300;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isFocused]);\n\n\tfunction handleSearch(e: ChangeEvent<HTMLInputElement>) {\n\t\tif (!isSearchable) return;\n\t\tonSearch(e.target.value);\n\t}\n\n\tif (!isFocused) return null;\n\n\treturn (\n\t\t<div\n\t\t\tref={containerRef}\n\t\t\tclassName={`arkynMultiSelectOptionsContainer ${position}`}\n\t\t>\n\t\t\t{isSearchable && (\n\t\t\t\t<Input\n\t\t\t\t\ttype=\"search\"\n\t\t\t\t\tname=\"search-select\"\n\t\t\t\t\tvariant=\"underline\"\n\t\t\t\t\tleftIcon={Search}\n\t\t\t\t\tvalue={search}\n\t\t\t\t\tonChange={handleSearch}\n\t\t\t\t/>\n\t\t\t)}\n\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { MultiSelectOptionsContainer };\n","import \"./styles.css\";\n\ntype MultiSelectOverlayProps = {\n\tisFocused: boolean;\n\thandleBlur: () => void;\n};\n\nfunction MultiSelectOverlay(props: MultiSelectOverlayProps) {\n\tconst { isFocused, handleBlur } = props;\n\tif (!isFocused) return null;\n\treturn <aside className=\"arkynMultiSelectOverlay\" onClick={handleBlur} />;\n}\n\nexport { MultiSelectOverlay };\n","import { Loader2 } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype MultiSelectSpinnerProps = {\n\ticonSize: number;\n\tisLoading: boolean;\n};\n\nfunction MultiSelectSpinner(props: MultiSelectSpinnerProps) {\n\tconst { iconSize, isLoading } = props;\n\n\tif (!isLoading) return null;\n\treturn (\n\t\t<Loader2\n\t\t\tclassName=\"arkynMultiSelectSpinner\"\n\t\t\tsize={iconSize}\n\t\t\tstrokeWidth={2.5}\n\t\t/>\n\t);\n}\n\nexport { MultiSelectSpinner };\n","import type { LucideIcon } from \"lucide-react\";\nimport { type FocusEvent, useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { IconRenderer } from \"../../services/iconRenderer\";\n\nimport { MultiSelectChevron } from \"./multiSelectChevron\";\nimport { MultiSelectContainer } from \"./multiSelectContainer\";\nimport { MultiSelectContent } from \"./multiSelectContent\";\nimport { MultiSelectMark } from \"./multiSelectMark\";\nimport { MultiSelectOption } from \"./multiSelectOption\";\nimport { MultiSelectOptionsContainer } from \"./multiSelectOptionsContainer\";\nimport { MultiSelectOverlay } from \"./multiSelectOverlay\";\nimport { MultiSelectSpinner } from \"./multiSelectSpinner\";\n\ntype MultiSelectProps = {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Array of selectable options. Required. */\n\toptions: { label: string; value: string }[];\n\t/** Optional HTML id for the underlying hidden input. */\n\tid?: string;\n\t/** Controlled array of selected values. */\n\tvalue?: string[];\n\t/** Uncontrolled default array of selected values. @default [] */\n\tdefaultValue?: string[];\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Optional label text displayed above the multiselect. */\n\tlabel?: string;\n\t/** Validation error message displayed below the multiselect. */\n\terrorMessage?: string;\n\t/** Placeholder text shown when no options are selected. @default \"Selecione...\" */\n\tplaceholder?: string;\n\t/** Text shown when no options match the search query. @default \"Sem opções disponíveis\" */\n\tnotFoundText?: string;\n\t/** Additional CSS class applied to the wrapper element. */\n\tclassName?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current selection visible. @default false */\n\treadOnly?: boolean;\n\t/** Shows a loading spinner and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/** Enables search/filter within the dropdown. @default false */\n\tisSearchable?: boolean;\n\t/** Closes the dropdown after an option is selected or deselected. @default false */\n\tcloseOnSelect?: boolean;\n\t/** Callback fired when the search query changes. Use for async option loading. */\n\tonSearch?: (value: string) => void;\n\t/** Callback fired when the selected values array changes. */\n\tonChange?: (value: string[]) => void;\n\t/** Callback fired when the multiselect gains focus. */\n\tonFocus?: () => void;\n\t/** Callback fired when the multiselect loses focus. */\n\tonBlur?: (e: FocusEvent<HTMLDivElement>) => void;\n\t/**\n\t * MultiSelect size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * - `underline`: bottom border only.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\" | \"underline\";\n\t/** Text or icon rendered at the far left, outside the select area. */\n\tprefix?: string | LucideIcon;\n\t/** Lucide icon rendered inside the select on the left. */\n\tleftIcon?: LucideIcon;\n\t/** Maximum height (in px) of the options dropdown. */\n\toptionMaxHeight?: number;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontal\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * MultiSelect, multi-option dropdown with optional search, label, validation, and form integration.\n *\n * Selected values are stored as a JSON array in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.options - Array of selectable options (`{ label, value }`). Required.\n * @param props.value - Controlled array of selected values.\n * @param props.defaultValue - Uncontrolled default selection. Default: []\n * @param props.label - Label text displayed above the multiselect.\n * @param props.placeholder - Placeholder shown when nothing is selected. Default: \"Selecione...\"\n * @param props.errorMessage - Validation error message.\n * @param props.isSearchable - Enables search/filter within the dropdown. Default: false\n * @param props.isLoading - Shows a loading spinner and disables interactions. Default: false\n * @param props.closeOnSelect - Closes the dropdown after toggling an option. Default: false\n * @param props.onChange - Callback fired when the selection changes.\n * @param props.onSearch - Callback fired when the search query changes.\n * @param props.size - MultiSelect size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns MultiSelect JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <MultiSelect\n * name=\"categories\"\n * options={[\n * { label: \"Technology\", value: \"tech\" },\n * { label: \"Design\", value: \"design\" },\n * ]}\n * />\n *\n * // With label, validation, and searchable\n * <MultiSelect\n * name=\"skills\"\n * label=\"Skills\"\n * showAsterisk\n * isSearchable\n * options={skillOptions}\n * errorMessage={errors.skills}\n * />\n *\n * // Controlled with async search\n * <MultiSelect\n * name=\"tags\"\n * label=\"Tags\"\n * value={selectedTags}\n * onChange={setSelectedTags}\n * onSearch={fetchTagOptions}\n * isLoading={isLoadingTags}\n * options={tagOptions}\n * />\n * ```\n */\n\nfunction MultiSelect(props: MultiSelectProps) {\n\tconst {\n\t\tname,\n\t\toptions,\n\t\tclassName: wrapperClassName = \"\",\n\t\tplaceholder = \"Selecione...\",\n\t\tcloseOnSelect = false,\n\t\tdefaultValue = [],\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tisSearchable = false,\n\t\tid,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tleftIcon: LeftIcon,\n\t\tonSearch,\n\t\tonChange,\n\t\tonBlur,\n\t\tnotFoundText = \"Sem opções disponíveis\",\n\t\tonFocus,\n\t\tdisabled: baseDisabled = false,\n\t\tprefix,\n\t\tsize = \"md\",\n\t\tvalue,\n\t\tvariant = \"solid\",\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst multiSelectRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst multiSelectId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst disabled = baseDisabled || isLoading || readOnly;\n\n\tconst iconSizes = { md: 20, lg: 20 };\n\tconst iconSize = iconSizes[size];\n\n\tconst [search, setSearch] = useState(\"\");\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [selectedOptions, setSelectedOptions] = useState(defaultValue);\n\n\tconst forceSelectedOptions = value || selectedOptions;\n\n\tfunction optionHasSelected(value: string) {\n\t\treturn forceSelectedOptions.includes(value);\n\t}\n\n\tfunction getOptionLabel(value: string) {\n\t\tconst option = options.find((option) => option.value === value);\n\t\treturn option?.label || \"\";\n\t}\n\n\tfunction handleContainerFocus() {\n\t\tif (disabled || !multiSelectRef?.current || isFocused) return;\n\t\tsetIsFocused(true);\n\t\tmultiSelectRef.current.focus();\n\t\tonFocus?.();\n\t}\n\n\tfunction handleBlur() {\n\t\tsetIsFocused(false);\n\t\tif (onBlur && multiSelectRef.current) multiSelectRef.current.blur();\n\t}\n\n\tfunction handleSearch(value: string) {\n\t\tsetSearch(value);\n\t\tif (onSearch) onSearch(value);\n\t}\n\n\tfunction handleChangeValue(value: string) {\n\t\tif (optionHasSelected(value)) {\n\t\t\tsetSelectedOptions(selectedOptions.filter((v) => v !== value));\n\t\t\tif (onChange) onChange(selectedOptions.filter((v) => v !== value));\n\t\t} else {\n\t\t\tsetSelectedOptions([...selectedOptions, value]);\n\t\t\tif (onChange) onChange([...selectedOptions, value]);\n\t\t}\n\n\t\tif (closeOnSelect) handleBlur();\n\t}\n\n\tconst mappedOptions = options.filter((option) => {\n\t\tif (props.onSearch) return true;\n\t\tif (!props.isSearchable) return true;\n\t\tif (option.label.toLowerCase().includes(search.toLowerCase())) return true;\n\t\treturn false;\n\t});\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<MultiSelectContainer\n\t\t\t\thandleContainerFocus={handleContainerFocus}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tprefixExists={!!prefix}\n\t\t\t\tid={multiSelectId}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tref={multiSelectRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={JSON.stringify(forceSelectedOptions)}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t/>\n\n\t\t\t\t<IconRenderer iconSize={iconSize} icon={prefix} className=\"prefix\" />\n\n\t\t\t\t{LeftIcon && <LeftIcon size={iconSize} strokeWidth={2.5} />}\n\n\t\t\t\t<MultiSelectContent size={size}>\n\t\t\t\t\t{forceSelectedOptions.map((value) => (\n\t\t\t\t\t\t<MultiSelectMark\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={getOptionLabel(value)}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{forceSelectedOptions.length <= 0 && <p>{placeholder}</p>}\n\t\t\t\t</MultiSelectContent>\n\n\t\t\t\t<MultiSelectOptionsContainer\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\tisSearchable={isSearchable}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tonSearch={handleSearch}\n\t\t\t\t>\n\t\t\t\t\t{mappedOptions.map(({ label, value }) => (\n\t\t\t\t\t\t<MultiSelectOption\n\t\t\t\t\t\t\tkey={value}\n\t\t\t\t\t\t\tlabel={label}\n\t\t\t\t\t\t\tvalue={value}\n\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\thandleChangeValue={handleChangeValue}\n\t\t\t\t\t\t\toptionHasSelected={optionHasSelected}\n\t\t\t\t\t\t/>\n\t\t\t\t\t))}\n\n\t\t\t\t\t{mappedOptions.length <= 0 && <p>{notFoundText}</p>}\n\t\t\t\t</MultiSelectOptionsContainer>\n\n\t\t\t\t<MultiSelectChevron\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\tisFocused={isFocused}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\ticonSize={iconSize}\n\t\t\t\t\tisLoading={isLoading}\n\t\t\t\t/>\n\n\t\t\t\t<MultiSelectSpinner iconSize={iconSize} isLoading={isLoading} />\n\t\t\t\t<MultiSelectOverlay handleBlur={handleBlur} isFocused={isFocused} />\n\t\t\t</MultiSelectContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { MultiSelect };\n","import { ChevronLeft, ChevronRight } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype ChevronButtonProps = {\n\torientation: \"left\" | \"right\";\n\tdisabled: boolean;\n\thandlePageChange: () => void;\n};\n\nfunction ChevronButton(props: ChevronButtonProps) {\n\tconst { orientation, handlePageChange, disabled } = props;\n\tconst icon = { left: <ChevronLeft />, right: <ChevronRight /> };\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName=\"arkynChevronPageButton\"\n\t\t\tdisabled={disabled}\n\t\t\tonClick={handlePageChange}\n\t\t>\n\t\t\t{icon[orientation]}\n\t\t</button>\n\t);\n}\n\nexport { ChevronButton };\n","import \"./styles.css\";\n\ntype CurrentButtonProps = {\n\tcurrentPage: number;\n};\n\nfunction CurrentButton({ currentPage }: CurrentButtonProps) {\n\treturn (\n\t\t<button type=\"button\" className=\"arkynPaginationCurrentButton\" disabled>\n\t\t\t{currentPage}\n\t\t</button>\n\t);\n}\n\nexport { CurrentButton };\n","import \"./styles.css\";\n\ntype PageButtonProps = {\n\tpage: number;\n\thandlePageChange: () => void;\n};\n\nfunction PageButton(props: PageButtonProps) {\n\tconst { page, handlePageChange } = props;\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName=\"arkynPaginationPageButton\"\n\t\t\tonClick={handlePageChange}\n\t\t>\n\t\t\t{page}\n\t\t</button>\n\t);\n}\n\nexport { PageButton };\n","type PaginationServiceConstructor = {\n\tcurrentPage: number;\n\ttotalCountRegisters: number;\n\tregisterPerPage?: number;\n\tsiblingsCount?: number;\n\tonChange?: (page: number) => void;\n};\n\nclass PaginationService {\n\tcurrentPage: number;\n\ttotalCountRegisters: number;\n\tregisterPerPage: number;\n\tsiblingsCount: number;\n\tlastPage: number;\n\tonChange?: (page: number) => void;\n\tpreviousPages: number[];\n\tnextPages: number[];\n\n\tprivate generatePagesArray(from: number, to: number) {\n\t\treturn [...new Array(to - from)]\n\t\t\t.map((_, index) => from + index + 1)\n\t\t\t.filter((page) => page > 0);\n\t}\n\n\tprivate generatePreviousPages(currentPage: number, siblingsCount: number) {\n\t\tif (!(currentPage > 1)) return [];\n\t\treturn this.generatePagesArray(\n\t\t\tcurrentPage - 1 - siblingsCount,\n\t\t\tcurrentPage - 1,\n\t\t);\n\t}\n\n\tprivate generateNextPages(currentPage: number, siblingsCount: number) {\n\t\tif (!(currentPage < this.lastPage)) return [];\n\t\treturn this.generatePagesArray(\n\t\t\tcurrentPage,\n\t\t\tMath.min(currentPage + siblingsCount, this.lastPage),\n\t\t);\n\t}\n\n\tconstructor(props: PaginationServiceConstructor) {\n\t\tthis.totalCountRegisters = props.totalCountRegisters;\n\t\tthis.currentPage = props.currentPage;\n\t\tthis.registerPerPage = props?.registerPerPage || 20;\n\t\tthis.siblingsCount = props?.siblingsCount || 2;\n\t\tthis.lastPage = Math.ceil(this.totalCountRegisters / this.registerPerPage);\n\t\tthis.onChange = props?.onChange;\n\t\tthis.previousPages = this.generatePreviousPages(\n\t\t\tthis.currentPage,\n\t\t\tthis.siblingsCount,\n\t\t);\n\t\tthis.nextPages = this.generateNextPages(\n\t\t\tthis.currentPage,\n\t\t\tthis.siblingsCount,\n\t\t);\n\t}\n\n\thandlePageChange = (page: number) => {\n\t\tif (page < 1) return;\n\t\tif (page > this.lastPage) return;\n\t\tif (this.onChange) {\n\t\t\tthis.currentPage = page;\n\t\t\tthis.onChange(this.currentPage);\n\t\t}\n\t};\n\n\thandlePlusChange = () => {\n\t\tif (this.currentPage >= this.lastPage) return;\n\t\tif (this.onChange) {\n\t\t\tthis.currentPage += 1;\n\t\t\tthis.onChange(this.currentPage);\n\t\t}\n\t};\n\n\thandleMinusChange = () => {\n\t\tif (this.currentPage <= 1) return;\n\t\tif (this.onChange) {\n\t\t\tthis.currentPage -= 1;\n\t\t\tthis.onChange(this.currentPage);\n\t\t}\n\t};\n}\n\nexport { PaginationService };\n","import { Ellipsis } from \"lucide-react\";\nimport \"./styles.css\";\n\nfunction Spread() {\n\treturn (\n\t\t<p className=\"arkynPaginationSpread\">\n\t\t\t<Ellipsis />\n\t\t</p>\n\t);\n}\n\nexport { Spread };\n","import type { HTMLAttributes } from \"react\";\n\nimport { ChevronButton } from \"./chevronButton\";\nimport { CurrentButton } from \"./currentButton\";\nimport { PageButton } from \"./pageButton\";\nimport { PaginationService } from \"./paginationService\";\nimport { Spread } from \"./spread\";\n\nimport \"./styles.css\";\n\n/**\n * Props for the Pagination component.\n */\ntype PaginationProps = {\n\t/**\n\t * Number of sibling pages to show on each side of the current page.\n\t * @default 1\n\t */\n\tsiblingsCount?: number;\n\t/**\n\t * Total number of records/items to paginate.\n\t */\n\ttotalCountRegisters: number;\n\t/**\n\t * The currently active page number (1-indexed).\n\t */\n\tcurrentPage: number;\n\t/**\n\t * Number of records to display per page.\n\t * @default 10\n\t */\n\tregisterPerPage?: number;\n\t/**\n\t * Callback function triggered when the page changes.\n\t * @param page - The new page number\n\t */\n\tonChange?: (page: number) => void;\n} & Omit<HTMLAttributes<HTMLDivElement>, \"onChange\">;\n\n/**\n * Pagination, navigation control for paginated data sets.\n *\n * Renders page number buttons, prev/next arrows, and spread indicators (…)\n * when the page count exceeds the visible range.\n *\n * @param props.totalCountRegisters - Total number of records. Required.\n * @param props.currentPage - The currently active page (1-indexed). Required.\n * @param props.registerPerPage - Records per page. Default: 10\n * @param props.siblingsCount - Number of sibling pages visible on each side of the current page. Default: 1\n * @param props.onChange - Callback fired when the user selects a different page.\n *\n * **...Other valid HTML properties for `<div>`**\n *\n * @returns Pagination JSX element.\n *\n * @example\n * ```tsx\n * <Pagination\n * totalCountRegisters={250}\n * currentPage={page}\n * registerPerPage={20}\n * siblingsCount={1}\n * onChange={(p) => setPage(p)}\n * />\n * ```\n */\n\nfunction Pagination(props: PaginationProps) {\n\tconst {\n\t\ttotalCountRegisters: baseTotalCountRegisters,\n\t\tsiblingsCount: baseSiblingsCount,\n\t\tcurrentPage: baseCurrentPage,\n\t\tregisterPerPage: baseRegisterPerPage,\n\t\tonChange: baseOnChange,\n\t\t...rest\n\t} = props;\n\n\tconst {\n\t\tcurrentPage,\n\t\tsiblingsCount,\n\t\tpreviousPages,\n\t\tnextPages,\n\t\tlastPage,\n\t\thandlePageChange,\n\t\thandleMinusChange,\n\t\thandlePlusChange,\n\t} = new PaginationService({\n\t\ttotalCountRegisters: baseTotalCountRegisters,\n\t\tcurrentPage: baseCurrentPage,\n\t\tregisterPerPage: baseRegisterPerPage,\n\t\tsiblingsCount: baseSiblingsCount,\n\t\tonChange: baseOnChange,\n\t});\n\n\treturn (\n\t\t<div className=\"arkynPagination\" {...rest}>\n\t\t\t<ChevronButton\n\t\t\t\torientation=\"left\"\n\t\t\t\thandlePageChange={handleMinusChange}\n\t\t\t\tdisabled={currentPage <= 1}\n\t\t\t/>\n\n\t\t\t{currentPage > 1 + siblingsCount && (\n\t\t\t\t<>\n\t\t\t\t\t<PageButton page={1} handlePageChange={() => handlePageChange(1)} />\n\t\t\t\t\t{currentPage > 2 + siblingsCount && <Spread />}\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t{previousPages.map((page) => (\n\t\t\t\t<PageButton\n\t\t\t\t\tkey={page}\n\t\t\t\t\tpage={page}\n\t\t\t\t\thandlePageChange={handleMinusChange}\n\t\t\t\t/>\n\t\t\t))}\n\n\t\t\t<CurrentButton currentPage={currentPage} />\n\n\t\t\t{nextPages.map((page) => (\n\t\t\t\t<PageButton\n\t\t\t\t\tkey={page}\n\t\t\t\t\tpage={page}\n\t\t\t\t\thandlePageChange={handlePlusChange}\n\t\t\t\t/>\n\t\t\t))}\n\n\t\t\t{currentPage + siblingsCount < lastPage && (\n\t\t\t\t<>\n\t\t\t\t\t{currentPage + 1 + siblingsCount < lastPage && <Spread />}\n\t\t\t\t\t<PageButton\n\t\t\t\t\t\tpage={lastPage}\n\t\t\t\t\t\thandlePageChange={() => handlePageChange(lastPage)}\n\t\t\t\t\t/>\n\t\t\t\t</>\n\t\t\t)}\n\n\t\t\t<ChevronButton\n\t\t\t\torientation=\"right\"\n\t\t\t\thandlePageChange={handlePlusChange}\n\t\t\t\tdisabled={currentPage >= lastPage}\n\t\t\t/>\n\t\t</div>\n\t);\n}\n\nexport { Pagination };\n","function clear(value: string) {\n\treturn value?.replace(/[^0-9]/g, \"\");\n}\n\nconst TYPES = {\n\tEIGHT: \"(99) 9999-9999\",\n\tNINE: \"(99) 99999-9999\",\n};\n\nfunction applyMask(value: string, maskPattern: string, placeholder = \"9\") {\n\tlet result = \"\";\n\tlet digitIndex = 0;\n\n\tfor (let i = 0; i < maskPattern.length; i++) {\n\t\tif (maskPattern[i] === placeholder) {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += value[digitIndex];\n\t\t\t\tdigitIndex++;\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t} else {\n\t\t\tif (digitIndex < value.length) {\n\t\t\t\tresult += maskPattern[i];\n\t\t\t} else {\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn result;\n}\n\nfunction getMask(value: string): \"NINE\" | \"EIGHT\" {\n\tconst mask = value.length > 10 ? \"NINE\" : \"EIGHT\";\n\treturn mask;\n}\n\nconst MAX_LENGTH = clear(TYPES.NINE).length;\n\nexport { applyMask, clear, getMask, MAX_LENGTH, TYPES };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype PhoneInputContainerProps = {\n\tchildren: ReactNode;\n\tonFocus: () => void;\n\tisError: boolean;\n\tdisabled: boolean;\n\treadOnly: boolean;\n\tisLoading: boolean;\n\tisFocused: boolean;\n\tclassName?: string;\n\tvariant: \"solid\" | \"outline\";\n\tsize: \"md\" | \"lg\";\n};\n\nfunction PhoneInputContainer(props: PhoneInputContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonFocus,\n\t\tdisabled,\n\t\tisError,\n\t\tisLoading,\n\t\tisFocused,\n\t\tclassName: baseClassName = \"\",\n\t\treadOnly,\n\t\tvariant,\n\t\tsize,\n\t} = props;\n\n\tconst errored = isError ? \"errored\" : \"\";\n\tconst opacity = disabled || readOnly || isLoading ? \"opacity\" : \"\";\n\tconst focused = isFocused ? \"focused\" : \"\";\n\n\tconst className = `arkynPhoneInputContainer ${variant} ${size} ${opacity} ${errored} ${focused} ${baseClassName}`;\n\n\treturn (\n\t\t<section className={className.trim()} onClick={onFocus}>\n\t\t\t{children}\n\t\t</section>\n\t);\n}\n\nexport { PhoneInputContainer };\n","import \"./styles.css\";\n\ntype PhoneInputCountriesOverlayProps = {\n\tisOpen: boolean;\n\tonClick: () => void;\n};\n\nfunction PhoneInputCountriesOverlay(props: PhoneInputCountriesOverlayProps) {\n\tconst { isOpen, onClick } = props;\n\tif (!isOpen) return null;\n\treturn (\n\t\t<aside className=\"arkynPhoneInputCountriesOverlay\" onClick={onClick} />\n\t);\n}\n\nexport { PhoneInputCountriesOverlay };\n","import { Check } from \"lucide-react\";\nimport \"./styles.css\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputCountryOptionProps = {\n\tcountry: CountryType;\n\tsize: \"md\" | \"lg\";\n\tisActive: boolean;\n\thandleChangeValue: (country: CountryType) => void;\n};\n\nfunction PhoneInputCountryOption(props: PhoneInputCountryOptionProps) {\n\tconst { country, isActive, handleChangeValue, size } = props;\n\n\tconst hasActive = isActive ? \"active\" : \"\";\n\tconst className = `arkynPhoneInputCountryOption ${size} ${hasActive}`;\n\n\treturn (\n\t\t<div onClick={() => handleChangeValue(country)} className={className}>\n\t\t\t<img src={country.flag} alt={country.name} className=\"flag\" />\n\t\t\t{country.name} <span>{country.code}</span>\n\t\t\t<Check className=\"check\" />\n\t\t</div>\n\t);\n}\n\nexport { PhoneInputCountryOption };\n","import {\n\ttype ChangeEvent,\n\ttype ReactNode,\n\tuseEffect,\n\tuseRef,\n\tuseState,\n} from \"react\";\nimport { useScrollLock } from \"../../../hooks/useScrollLock\";\nimport \"./styles.css\";\n\ntype PhoneInputCountryOptionsContainerProps = {\n\tisOpen: boolean;\n\tchildren: ReactNode;\n\tsearch: string;\n\tplaceholder: string;\n\tonSearch: (value: string) => void;\n};\n\nfunction PhoneInputCountryOptionsContainer(\n\tprops: PhoneInputCountryOptionsContainerProps,\n) {\n\tconst { children, isOpen, onSearch, search, placeholder } = props;\n\n\tconst containerRef = useRef<HTMLDivElement>(null);\n\tconst [position, setPosition] = useState<\"bottom\" | \"top\">(\"bottom\");\n\n\tfunction handleSearch(e: ChangeEvent<HTMLInputElement>) {\n\t\tonSearch(e.target.value);\n\t}\n\n\tuseScrollLock(isOpen);\n\n\tuseEffect(() => {\n\t\tif (!isOpen) return;\n\n\t\tconst checkContainerPosition = () => {\n\t\t\tif (!containerRef.current) return;\n\n\t\t\tconst parentElement = containerRef.current.parentElement;\n\t\t\tif (!parentElement) return;\n\n\t\t\tconst parentRect = parentElement.getBoundingClientRect();\n\t\t\tconst viewportHeight = window.innerHeight;\n\n\t\t\tconst estimatedContainerHeight = 300;\n\t\t\tconst spaceBelow = viewportHeight - parentRect.bottom;\n\n\t\t\tif (\n\t\t\t\tspaceBelow < estimatedContainerHeight &&\n\t\t\t\tparentRect.top > estimatedContainerHeight\n\t\t\t) {\n\t\t\t\tsetPosition(\"top\");\n\t\t\t} else {\n\t\t\t\tsetPosition(\"bottom\");\n\t\t\t}\n\t\t};\n\n\t\tcheckContainerPosition();\n\t}, [isOpen]);\n\n\tif (!isOpen) return null;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={`arkynPhoneInputCountryOptionsContainer ${position}`}\n\t\t\tref={containerRef}\n\t\t>\n\t\t\t<input\n\t\t\t\ttype=\"search\"\n\t\t\t\tname=\"search-select\"\n\t\t\t\tclassName=\"arkynPhoneInputCountryOptionsContainerSearchSelect\"\n\t\t\t\tvalue={search}\n\t\t\t\tid=\"input-search\"\n\t\t\t\tplaceholder={placeholder}\n\t\t\t\tonChange={handleSearch}\n\t\t\t/>\n\n\t\t\t{children}\n\t\t</div>\n\t);\n}\n\nexport { PhoneInputCountryOptionsContainer };\n","import { ChevronDown } from \"lucide-react\";\n\nimport { Divider } from \"../../divider\";\nimport \"./styles.css\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputCountrySelectorProps = {\n\tsize: \"md\" | \"lg\";\n\tcurrentCountry: CountryType;\n\tonClick: () => void;\n};\n\nfunction PhoneInputCountrySelector(props: PhoneInputCountrySelectorProps) {\n\tconst { currentCountry, onClick } = props;\n\n\treturn (\n\t\t<div className=\"phoneInputSelectCountry\" onClick={onClick}>\n\t\t\t<img\n\t\t\t\tclassName=\"flag\"\n\t\t\t\tsrc={currentCountry.flag}\n\t\t\t\talt={currentCountry.name}\n\t\t\t/>\n\t\t\t<ChevronDown className=\"chevronDown\" strokeWidth={2.5} />\n\t\t\t<Divider orientation=\"vertical\" />\n\t\t</div>\n\t);\n}\n\nexport { PhoneInputCountrySelector };\n","import { InputMask } from \"@react-input/mask\";\nimport {\n\ttype ChangeEvent,\n\tforwardRef,\n\ttype InputHTMLAttributes,\n\tuseEffect,\n\tuseRef,\n} from \"react\";\n\nimport {\n\tapplyMask,\n\tclear,\n\tgetMask,\n\tMAX_LENGTH,\n\tTYPES,\n} from \"../../../utils/phoneInputUtilities\";\n\nimport \"./style.css\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputMaskProps = {\n\tonFocus: () => void;\n\tonBlur: () => void;\n\tdisabled: boolean;\n\treadonly: boolean;\n\tsize: \"md\" | \"lg\";\n\tcurrentCountry: CountryType;\n\tvalue: string;\n\tonChange: (e: string) => void;\n\tid: string;\n};\n\nconst BaseInput = forwardRef<\n\tHTMLInputElement,\n\tInputHTMLAttributes<HTMLInputElement>\n>((props, ref) => {\n\treturn <input ref={ref} {...props} />;\n});\n\nconst PhoneInputMask = forwardRef<HTMLInputElement, PhoneInputMaskProps>(\n\t(props, ref) => {\n\t\tconst {\n\t\t\tonFocus,\n\t\t\treadonly,\n\t\t\tonBlur,\n\t\t\tsize,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tcurrentCountry,\n\t\t\tdisabled,\n\t\t\tid,\n\t\t} = props;\n\n\t\tconst isFirstRender = useRef(true);\n\t\tconst onChangeRef = useRef(onChange);\n\t\tonChangeRef.current = onChange;\n\n\t\tconst mask =\n\t\t\ttypeof currentCountry.mask === \"string\"\n\t\t\t\t? currentCountry.mask\n\t\t\t\t: currentCountry.mask[0];\n\n\t\tuseEffect(() => {\n\t\t\tif (isFirstRender.current) {\n\t\t\t\tisFirstRender.current = false;\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tonChangeRef.current(mask);\n\t\t}, [mask]);\n\n\t\tconst className = `phoneInputMask ${size}`;\n\n\t\tfunction handleChange(event: ChangeEvent<HTMLInputElement>) {\n\t\t\tlet value = clear(event.target.value);\n\t\t\tconst mask = getMask(value);\n\n\t\t\tconst nextLength = value.length;\n\t\t\tif (nextLength > MAX_LENGTH) return;\n\n\t\t\tvalue = applyMask(value, TYPES[mask] as \"EIGHT\" | \"NINE\");\n\t\t\tevent.target.value = value;\n\n\t\t\tonChange(value);\n\t\t}\n\n\t\tif (currentCountry.code === \"+55\") {\n\t\t\treturn (\n\t\t\t\t<input\n\t\t\t\t\tid={id}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tonChange={handleChange}\n\t\t\t\t\tclassName={className}\n\t\t\t\t\tonFocus={onFocus}\n\t\t\t\t\tonBlur={onBlur}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readonly}\n\t\t\t\t\tref={ref}\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\n\t\treturn (\n\t\t\t<InputMask\n\t\t\t\tid={id}\n\t\t\t\tvalue={value}\n\t\t\t\treadOnly={readonly}\n\t\t\t\tonChange={(e) => onChange(e.target.value)}\n\t\t\t\tclassName={className}\n\t\t\t\tcomponent={BaseInput}\n\t\t\t\tonFocus={onFocus}\n\t\t\t\tonBlur={onBlur}\n\t\t\t\tdisabled={disabled}\n\t\t\t\tmask={mask}\n\t\t\t\tshowMask\n\t\t\t\treplacement={{ _: /\\d/ }}\n\t\t\t\tref={ref}\n\t\t\t/>\n\t\t);\n\t},\n);\n\nexport { PhoneInputMask };\n","import {\n\tfindCountryMask,\n\tformatToPhone,\n\tremoveNonNumeric,\n} from \"@arkyn/shared\";\nimport { countries } from \"@arkyn/templates\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { applyMask, getMask, TYPES } from \"../../utils/phoneInputUtilities\";\n\nimport { PhoneInputContainer } from \"./phoneInputContainer\";\nimport { PhoneInputCountriesOverlay } from \"./phoneInputCountriesOverlay\";\nimport { PhoneInputCountryOption } from \"./phoneInputCountryOption\";\nimport { PhoneInputCountryOptionsContainer } from \"./phoneInputCountryOptionsContainer\";\nimport { PhoneInputCountrySelector } from \"./phoneInputCountrySelector\";\nimport { PhoneInputMask } from \"./phoneInputMask\";\n\ntype CountryType = {\n\tname: string;\n\tcode: string;\n\tiso: string;\n\tflag: string;\n\tmask: string | string[];\n};\n\ntype PhoneInputProps = {\n\t/** Optional HTML id for the visible phone text input. */\n\tid?: string;\n\t/** Disables all interactions. @default false */\n\tdisabled?: boolean;\n\t/** Prevents value changes while keeping the current value visible. @default false */\n\treadOnly?: boolean;\n\t/** Validation error message (overrides the `useForm` context error for this field). */\n\terrorMessage?: string;\n\t/** Optional label text displayed above the input. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Shows a loading state and disables interactions. @default false */\n\tisLoading?: boolean;\n\t/**\n\t * Input size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Additional CSS class applied to the field wrapper. */\n\tclassName?: string;\n\t/** Uncontrolled default phone value (numeric string with or without country code). @default \"\" */\n\tdefaultValue?: string;\n\t/** Text displayed when no country matches the search query. @default \"Nenhum país encontrado\" */\n\tnotFoundCountryText?: string;\n\t/** Field name for form submission (stored as numeric string with country code). Required. */\n\tname: string;\n\t/** Placeholder for the country search input. @default \"Pesquisar país\" */\n\tsearchCountryPlaceholder?: string;\n\t/** ISO 3166-1 alpha-2 code of the initially selected country. @default \"BR\" */\n\tdefaultCountryIso?: (typeof countries)[number][\"iso\"];\n\t/** Callback fired on value change. Receives a numeric string prefixed with the country dial code. */\n\tonChange?: (e: string) => void;\n\t/** Controlled phone value (without country code). */\n\tvalue?: string;\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"vertical\"\n\t */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\nfunction formatLocalValue(rawValue: string, country: CountryType) {\n\tconst digits = removeNonNumeric(rawValue);\n\tconst codeDigits = removeNonNumeric(country.code);\n\tconst hasCountryCode = rawValue.trim().startsWith(\"+\");\n\tconst localDigits =\n\t\thasCountryCode && digits.startsWith(codeDigits)\n\t\t\t? digits.slice(codeDigits.length)\n\t\t\t: digits;\n\n\tif (country.code === \"+55\") {\n\t\treturn applyMask(localDigits, TYPES[getMask(localDigits)]);\n\t}\n\n\tconst mask =\n\t\ttypeof country.mask === \"string\" ? country.mask : country.mask[0];\n\treturn applyMask(localDigits, mask, \"_\");\n}\n\n/**\n * PhoneInput, phone number field with an integrated country selector and automatic mask formatting.\n *\n * The visible input is masked according to the selected country's phone format.\n * The hidden `<input>` stores a numeric string prefixed with the country dial code for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the input.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Input size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n * @param props.disabled - Disables all interactions. Default: false\n * @param props.readOnly - Prevents editing. Default: false\n * @param props.isLoading - Shows loading state and disables interactions. Default: false\n * @param props.defaultValue - Uncontrolled default phone value.\n * @param props.value - Controlled phone value (without country code).\n * @param props.onChange - Callback fired on change, receives numeric string with country code.\n * @param props.defaultCountryIso - ISO code of the initially selected country. Default: \"BR\"\n * @param props.searchCountryPlaceholder - Placeholder for country search. Default: \"Pesquisar país\"\n * @param props.notFoundCountryText - Text shown when no country matches. Default: \"Nenhum país encontrado\"\n * @param props.orientation - Layout direction. Default: \"vertical\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns PhoneInput JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <PhoneInput name=\"phone\" label=\"Phone\" />\n *\n * // Controlled with outline variant\n * <PhoneInput\n * name=\"contactPhone\"\n * label=\"Contact Phone\"\n * value={phone}\n * onChange={(v) => setPhone(v)}\n * variant=\"outline\"\n * size=\"lg\"\n * />\n *\n * // Pre-selected country (US)\n * <PhoneInput\n * name=\"phone\"\n * label=\"Phone\"\n * defaultCountryIso=\"US\"\n * showAsterisk\n * />\n * ```\n */\nfunction PhoneInput(props: PhoneInputProps) {\n\tconst {\n\t\tvalue: rawValue,\n\t\tlabel,\n\t\tclassName: wrapperClassName = \"\",\n\t\tdisabled = false,\n\t\terrorMessage: baseErrorMessage,\n\t\tisLoading = false,\n\t\treadOnly = false,\n\t\tsize = \"md\",\n\t\tdefaultValue = \"\",\n\t\tvariant = \"solid\",\n\t\tshowAsterisk,\n\t\tname,\n\t\tonChange,\n\t\tsearchCountryPlaceholder = \"Pesquisar país\",\n\t\tnotFoundCountryText = \"Nenhum país encontrado\",\n\t\tid,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t} = props;\n\n\t// biome-ignore lint/style/noNonNullAssertion: \"BR\" is always present in the countries list\n\tconst brasilCountry = countries.find((country) => country.iso === \"BR\")!;\n\n\tconst defaultData = defaultValue ? formatToPhone(defaultValue) : \"\";\n\tconst defaultCountry: CountryType = defaultValue\n\t\t? findCountryMask(defaultValue)[1]\n\t\t: brasilCountry;\n\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst [search, setSearch] = useState(\"\");\n\tconst [showCountryOptions, setShowCountryOptions] = useState(false);\n\tconst [internalValue, setValue] = useState(defaultData);\n\n\tconst [currentCountry, setCurrentCountry] = useState(defaultCountry);\n\n\tconst value =\n\t\trawValue !== undefined\n\t\t\t? formatLocalValue(rawValue, currentCountry)\n\t\t\t: internalValue;\n\n\tconst { fieldErrors } = useForm();\n\n\tconst phoneInputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst phoneInputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst isDisabled = disabled || isLoading;\n\n\tconst inputPhoneMaskRef = useRef<HTMLInputElement>(null);\n\n\tfunction handleContainerFocus() {\n\t\tif (isDisabled) return;\n\t\tif (isFocused || showCountryOptions) return;\n\n\t\tsetIsFocused(true);\n\t\tif (inputPhoneMaskRef.current) inputPhoneMaskRef.current.focus();\n\t}\n\n\tfunction handleOpenCountryOptions() {\n\t\tsetShowCountryOptions(true);\n\t\tsetIsFocused(true);\n\t}\n\n\tfunction handleCloseCountryOptions() {\n\t\tsetShowCountryOptions(false);\n\t\tsetIsFocused(false);\n\t}\n\n\tfunction handleInputFocus() {\n\t\tsetIsFocused(true);\n\t}\n\n\tfunction handleInputBlur() {\n\t\tsetIsFocused(false);\n\t}\n\n\tfunction filterCountryFunction(country: CountryType) {\n\t\treturn country.name.toLowerCase().includes(search.toLowerCase());\n\t}\n\n\tfunction inputValue(props?: string) {\n\t\tlet returnValue = currentCountry.code;\n\t\treturnValue += removeNonNumeric(props || value);\n\t\treturn returnValue;\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<PhoneInputContainer\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\tisError={isError}\n\t\t\t\tisLoading={isLoading}\n\t\t\t\tisFocused={isFocused}\n\t\t\t\treadOnly={readOnly}\n\t\t\t\tsize={size}\n\t\t\t\tvariant={variant}\n\t\t\t\tonFocus={handleContainerFocus}\n\t\t\t>\n\t\t\t\t<PhoneInputCountrySelector\n\t\t\t\t\tcurrentCountry={currentCountry}\n\t\t\t\t\tonClick={handleOpenCountryOptions}\n\t\t\t\t\tsize={size}\n\t\t\t\t/>\n\n\t\t\t\t<PhoneInputCountryOptionsContainer\n\t\t\t\t\tisOpen={isDisabled ? false : readOnly ? false : showCountryOptions}\n\t\t\t\t\tsearch={search}\n\t\t\t\t\tplaceholder={searchCountryPlaceholder}\n\t\t\t\t\tonSearch={setSearch}\n\t\t\t\t>\n\t\t\t\t\t{countries\n\t\t\t\t\t\t.filter((country) => filterCountryFunction(country))\n\t\t\t\t\t\t.map((country) => (\n\t\t\t\t\t\t\t<PhoneInputCountryOption\n\t\t\t\t\t\t\t\tkey={country.iso}\n\t\t\t\t\t\t\t\tcountry={country}\n\t\t\t\t\t\t\t\thandleChangeValue={() => {\n\t\t\t\t\t\t\t\t\tsetCurrentCountry(country);\n\t\t\t\t\t\t\t\t\tsetShowCountryOptions(false);\n\t\t\t\t\t\t\t\t\tsetValue(\"\");\n\t\t\t\t\t\t\t\t}}\n\t\t\t\t\t\t\t\tisActive={country.iso === currentCountry.iso}\n\t\t\t\t\t\t\t\tsize={size}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t))}\n\n\t\t\t\t\t{countries.filter((country) => filterCountryFunction(country))\n\t\t\t\t\t\t.length === 0 && <p>{notFoundCountryText}</p>}\n\t\t\t\t</PhoneInputCountryOptionsContainer>\n\n\t\t\t\t<PhoneInputCountriesOverlay\n\t\t\t\t\tisOpen={isDisabled ? false : readOnly ? false : showCountryOptions}\n\t\t\t\t\tonClick={handleCloseCountryOptions}\n\t\t\t\t/>\n\n\t\t\t\t<PhoneInputMask\n\t\t\t\t\tid={phoneInputId}\n\t\t\t\t\tref={inputPhoneMaskRef}\n\t\t\t\t\treadonly={readOnly}\n\t\t\t\t\tcurrentCountry={currentCountry}\n\t\t\t\t\tvalue={value}\n\t\t\t\t\tdisabled={isDisabled}\n\t\t\t\t\tonBlur={handleInputBlur}\n\t\t\t\t\tonFocus={handleInputFocus}\n\t\t\t\t\tsize={size}\n\t\t\t\t\tonChange={(e) => {\n\t\t\t\t\t\tsetValue(e);\n\t\t\t\t\t\tonChange?.(inputValue(e));\n\t\t\t\t\t}}\n\t\t\t\t/>\n\n\t\t\t\t<input\n\t\t\t\t\tref={phoneInputRef}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={inputValue()}\n\t\t\t\t/>\n\t\t\t</PhoneInputContainer>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { PhoneInput };\n","import { type ReactNode, useState } from \"react\";\n\nimport { useScrollLock } from \"../../hooks/useScrollLock\";\nimport \"./styles.css\";\n\ntype OrientationProps =\n\t| \"bottomLeft\"\n\t| \"bottomRight\"\n\t| \"topLeft\"\n\t| \"topRight\"\n\t| \"top\"\n\t| \"left\"\n\t| \"bottom\"\n\t| \"right\";\n\ntype PopoverProps = {\n\t/** Content rendered inside the floating panel. Required. */\n\tchildren: ReactNode;\n\t/** Trigger element, clicking it opens the popover. Required. */\n\tbutton: ReactNode;\n\t/** When true, clicking the popover content also closes it. @default false */\n\tcloseOnClick?: boolean;\n\t/**\n\t * Position of the floating panel relative to the trigger.\n\t * Options: `\"bottomLeft\"` | `\"bottomRight\"` | `\"topLeft\"` | `\"topRight\"` | `\"top\"` | `\"bottom\"` | `\"left\"` | `\"right\"`.\n\t * @default \"bottomLeft\"\n\t */\n\torientation?: OrientationProps;\n\t/** Additional CSS class applied to the popover root element. */\n\tclassName?: string;\n};\n\n/**\n * Popover, floating panel that appears relative to a trigger element.\n *\n * Clicking outside the popover (or clicking the content when `closeOnClick` is set)\n * dismisses it. Locks body scroll while open.\n *\n * @param props.children - Content to display inside the panel. Required.\n * @param props.button - Trigger element that opens the popover. Required.\n * @param props.closeOnClick - Clicking the content also closes the popover. Default: false\n * @param props.orientation - Panel position relative to the trigger. Default: \"bottomLeft\"\n * @param props.className - Additional CSS class for the root element.\n *\n * @returns Popover JSX element with trigger, animated panel, and outside-click overlay.\n *\n * @example\n * ```tsx\n * // Basic dropdown menu\n * <Popover button={<Button>Options</Button>} closeOnClick>\n * <ul>\n * <li onClick={handleEdit}>Edit</li>\n * <li onClick={handleDelete}>Delete</li>\n * </ul>\n * </Popover>\n *\n * // User profile menu (bottom-right)\n * <Popover\n * button={<IconButton icon={User} aria-label=\"Account\" />}\n * orientation=\"bottomRight\"\n * closeOnClick\n * >\n * <nav>\n * <a href=\"/profile\">Profile</a>\n * <a href=\"/settings\">Settings</a>\n * <a href=\"/logout\">Sign out</a>\n * </nav>\n * </Popover>\n *\n * // Filter panel (top-left)\n * <Popover button={<Badge>Filters</Badge>} orientation=\"topLeft\">\n * <Input name=\"search\" placeholder=\"Search...\" />\n * <Select name=\"status\" options={statusOptions} />\n * </Popover>\n * ```\n */\n\nfunction Popover(props: PopoverProps) {\n\tconst {\n\t\tchildren,\n\t\tbutton,\n\t\tcloseOnClick,\n\t\tclassName: baseClassName = \"\",\n\t\torientation = \"bottomLeft\",\n\t} = props;\n\tconst [isOpen, setIsOpen] = useState(false);\n\n\tconst visible = isOpen ? \"visibleTrue\" : \"visibleFalse\";\n\tconst className = `arkynPopover ${orientation} ${visible} ${baseClassName}`;\n\n\tfunction handleOpenPopover() {\n\t\tif (!isOpen) setIsOpen(true);\n\t}\n\n\tuseScrollLock(isOpen);\n\n\treturn (\n\t\t<div className={className} onClick={handleOpenPopover}>\n\t\t\t{button}\n\n\t\t\t<div\n\t\t\t\tstyle={{ visibility: isOpen ? \"visible\" : \"hidden\" }}\n\t\t\t\tonClick={() => closeOnClick && setIsOpen(false)}\n\t\t\t\tclassName=\"arkynPopoverContent\"\n\t\t\t>\n\t\t\t\t{children}\n\t\t\t</div>\n\n\t\t\t{isOpen && (\n\t\t\t\t<div onClick={() => setIsOpen(false)} className=\"arkynPopoverOverlay\" />\n\t\t\t)}\n\t\t</div>\n\t);\n}\n\nexport { Popover };\n","import { createContext, type ReactNode, useContext } from \"react\";\n\ntype RadioGroupContextType = {\n\tvalue: string;\n\tisError: boolean;\n\tsize: \"sm\" | \"md\" | \"lg\";\n\thandleChange: (value: string) => void;\n\tdisabled: boolean;\n};\n\ntype RadioProviderProps = {\n\tchildren: ReactNode;\n\tisError: boolean;\n\tsize: \"sm\" | \"md\" | \"lg\";\n\tvalue: string;\n\thandleChange: (value: string) => void;\n\tdisabled: boolean;\n};\n\nconst radioContext = createContext({} as RadioGroupContextType);\n\nfunction RadioProvider(props: RadioProviderProps) {\n\tconst { children, size, isError, handleChange, value, disabled } = props;\n\n\treturn (\n\t\t<radioContext.Provider\n\t\t\tvalue={{ handleChange, value, size, isError, disabled }}\n\t\t>\n\t\t\t{children}\n\t\t</radioContext.Provider>\n\t);\n}\n\nfunction useRadioGroup() {\n\treturn useContext(radioContext);\n}\n\nexport { RadioProvider, useRadioGroup };\n","import type { ButtonHTMLAttributes } from \"react\";\n\nimport { useRadioGroup } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioBoxProps = ButtonHTMLAttributes<HTMLButtonElement> & {\n\t/** Value submitted to the form when this option is selected. Required. */\n\tvalue: string;\n\t/** Applies error styling. Inherited from `RadioGroup` when not set. */\n\tisError?: boolean;\n\t/** Size variant. Inherits from `RadioGroup` when not set. */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n};\n\n/**\n * RadioBox, individual option inside a `RadioGroup`. Renders as a `<label>` + hidden `<button>` pair.\n *\n * Reads active value, size, error state, and disabled state from `RadioGroup` context.\n * Must be used as a direct child of `RadioGroup`.\n *\n * @param props.value - Option value. Required.\n * @param props.children - Option label content (text, icons, or rich markup).\n * @param props.disabled - Disables this option (group can also disable all options).\n * @param props.size - Size override. Inherits from group by default.\n *\n * **...Other valid HTML `<button>` properties**\n *\n * @returns RadioBox JSX element.\n *\n * @example\n * ```tsx\n * <RadioGroup name=\"plan\" label=\"Choose a plan\" onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic, $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro, $29/mo</RadioBox>\n * <RadioBox value=\"enterprise\" disabled>Enterprise, contact us</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioBox(props: RadioBoxProps) {\n\tconst {\n\t\tvalue: componentValue,\n\t\tsize: componentSize,\n\t\tdisabled,\n\t\tchildren,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tonFocus,\n\t\t...rest\n\t} = props;\n\n\tconst {\n\t\thandleChange,\n\t\tsize: groupSize,\n\t\tvalue,\n\t\tisError,\n\t\tdisabled: groupDisabled,\n\t} = useRadioGroup();\n\n\tconst isChecked = value === componentValue;\n\tconst size = componentSize || groupSize;\n\n\tconst isDisabled = disabled || groupDisabled;\n\n\tconst checkedClass = isChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst disabledClass = isDisabled ? \"disabledTrue\" : \"disabledFalse\";\n\tconst className = `arkynRadioBox ${size} ${checkedClass} ${errorClass} ${disabledClass} ${baseClassName}`;\n\n\tfunction handleClick(event: React.MouseEvent<HTMLButtonElement>) {\n\t\tonClick?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\tfunction handleFocus(event: React.FocusEvent<HTMLButtonElement>) {\n\t\tonFocus?.(event);\n\t\thandleChange(componentValue);\n\t}\n\n\treturn (\n\t\t<label className={className.trim()}>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tdisabled={isDisabled}\n\t\t\t\tonClick={handleClick}\n\t\t\t\tonFocus={handleFocus}\n\t\t\t\t{...rest}\n\t\t\t/>\n\n\t\t\t{children}\n\t\t</label>\n\t);\n}\n\nexport { RadioBox };\n","import { type HTMLAttributes, useState } from \"react\";\n\nimport { useForm } from \"../../../hooks/useForm\";\nimport { FieldTemplate } from \"../../../services/fieldTemplate\";\n\nimport { RadioProvider } from \"../radioContext\";\nimport \"./styles.css\";\n\ntype RadioGroupProps = Omit<HTMLAttributes<HTMLDivElement>, \"onChange\"> & {\n\t/** Field name used for form submission. Required. */\n\tname: string;\n\t/** Label displayed above the group. */\n\tlabel?: string;\n\t/** Appends an asterisk to the label. @default false */\n\tshowAsterisk?: boolean;\n\t/** Error message shown below the group. Overrides `fieldErrors[name]` from `FormProvider`. */\n\terrorMessage?: string;\n\t/** Controlled selected value. */\n\tvalue?: string;\n\t/** Initial selected value (uncontrolled). @default \"\" */\n\tdefaultValue?: string;\n\t/** Callback fired when the selected option changes. */\n\tonChange?: (value: string) => void;\n\t/** Size variant applied to all `RadioBox` children. @default \"md\" */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Disables all `RadioBox` children. @default false */\n\tdisabled?: boolean;\n\t/** When `true`, skips the `FieldTemplate` wrapper (label, error message). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Layout direction of the `FieldWrapper`. @default \"horizontal\" */\n\torientation?: \"horizontal\" | \"vertical\" | \"horizontalReverse\";\n};\n\n/**\n * RadioGroup, managed group of `RadioBox` options with form integration.\n *\n * Renders a hidden `<input>` for native form submission. Reads `fieldErrors[name]` from\n * the nearest `FormProvider` when no `errorMessage` is explicitly provided.\n *\n * @param props.name - Form field name. Required.\n * @param props.label - Label displayed above the group.\n * @param props.showAsterisk - Appends `*` to the label. Default: false\n * @param props.value - Controlled selection.\n * @param props.defaultValue - Initial selection (uncontrolled). Default: `\"\"`\n * @param props.onChange - Called with the newly selected value.\n * @param props.size - Size for all child `RadioBox` elements. Default: `\"md\"`\n * @param props.disabled - Disables all options. Default: false\n * @param props.errorMessage - Validation error message.\n * @param props.unShowFieldTemplate - Omit label/error wrapper. Default: false\n *\n * **...Other valid HTML `<div>` properties**\n *\n * @returns RadioGroup JSX element.\n *\n * @example\n * ```tsx\n * // Uncontrolled with label\n * <RadioGroup name=\"gender\" label=\"Gender\" showAsterisk defaultValue=\"male\">\n * <RadioBox value=\"male\">Male</RadioBox>\n * <RadioBox value=\"female\">Female</RadioBox>\n * <RadioBox value=\"other\">Other</RadioBox>\n * </RadioGroup>\n *\n * // Controlled with change handler\n * <RadioGroup name=\"plan\" label=\"Subscription plan\" value={plan} onChange={setPlan}>\n * <RadioBox value=\"basic\">Basic, $9/mo</RadioBox>\n * <RadioBox value=\"pro\">Pro, $29/mo</RadioBox>\n * </RadioGroup>\n * ```\n */\n\nfunction RadioGroup(props: RadioGroupProps) {\n\tconst {\n\t\tdefaultValue = \"\",\n\t\tname,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\terrorMessage: baseErrorMessage,\n\t\tvalue: forceValue,\n\t\tonChange,\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tdisabled = false,\n\t\tunShowFieldTemplate = false,\n\t\torientation = \"vertical\",\n\t\t...rest\n\t} = props;\n\n\tconst [value, setValue] = useState(defaultValue);\n\tconst { fieldErrors } = useForm();\n\n\tfunction handleChange(value: string) {\n\t\tsetValue(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\tconst className = `arkynRadioGroup ${size}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<RadioProvider\n\t\t\t\tisError={isError}\n\t\t\t\tsize={size}\n\t\t\t\tvalue={forceValue || value}\n\t\t\t\thandleChange={handleChange}\n\t\t\t\tdisabled={disabled}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tstyle={{ display: \"none\" }}\n\t\t\t\t\ttype=\"text\"\n\t\t\t\t\treadOnly\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={forceValue || value}\n\t\t\t\t/>\n\n\t\t\t\t<div className={className.trim()} {...rest} />\n\t\t\t</RadioProvider>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RadioGroup };\n","import { Editor, Range } from \"slate\";\n\nfunction clearLinkMarkAtBoundary(editor: Editor) {\n\tconst { selection } = editor;\n\tif (!selection || !Range.isCollapsed(selection)) return;\n\n\tconst [node, path] = Editor.leaf(editor, selection.anchor);\n\tif (!node.link) return;\n\tif (!Editor.isEnd(editor, selection.anchor, path)) return;\n\n\tEditor.removeMark(editor, \"link\");\n\tEditor.removeMark(editor, \"href\");\n}\n\nexport { clearLinkMarkAtBoundary };\n","import { type Descendant, Node } from \"slate\";\n\nfunction extractTextFromNode(nodes: Descendant[]) {\n\treturn nodes.map((n) => Node.string(n)).join(\"\");\n}\n\nexport { extractTextFromNode };\n","import { Editor } from \"slate\";\n\nimport type { RichTextMarkFormatType } from \"../types/richTextTypes\";\n\nfunction isMarkActive(editor: Editor, format: RichTextMarkFormatType) {\n\tconst marks = Editor.marks(editor);\n\treturn marks ? marks[format] === true : false;\n}\n\nexport { isMarkActive };\n","import { Editor } from \"slate\";\n\nimport type { RichTextMarkFormatType } from \"../types/richTextTypes\";\nimport { isMarkActive } from \"./isMarkActive\";\n\nfunction toggleMark(editor: Editor, format: RichTextMarkFormatType) {\n\tconst isActive = isMarkActive(editor, format);\n\n\tif (isActive) Editor.removeMark(editor, format);\n\telse Editor.addMark(editor, format, true);\n}\n\nexport { toggleMark };\n","import type {\n\tDescendant,\n\tRichTextMarkFormatType,\n} from \"../types/richTextTypes\";\n\ntype HotKeys = {\n\t[key: string]: RichTextMarkFormatType;\n};\n\nconst hotKeys: HotKeys = {\n\t\"mod+b\": \"bold\",\n\t\"mod+i\": \"italic\",\n\t\"mod+u\": \"underline\",\n\t\"mod+`\": \"code\",\n};\n\nconst initialValue: Descendant[] = [\n\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n];\n\nconst listTypes = [\"listItem\", \"numberedList\"];\n\nconst textAlignTypes = [\"left\", \"center\", \"right\", \"justify\"];\n\nexport { hotKeys, initialValue, listTypes, textAlignTypes };\n","import { Editor, Element as SlateElement } from \"slate\";\n\nimport type {\n\tRichTextAlignFormatType,\n\tRichTextElementFormatType,\n} from \"../types/richTextTypes\";\n\nfunction isBlockActive(\n\teditor: Editor,\n\tformat: RichTextElementFormatType | RichTextAlignFormatType,\n\tblockType: \"type\" | \"align\" = \"type\",\n) {\n\tconst { selection } = editor;\n\tif (!selection) return false;\n\n\tconst [match] = Array.from(\n\t\tEditor.nodes(editor, {\n\t\t\tat: Editor.unhangRange(editor, selection),\n\t\t\tmatch: (n) =>\n\t\t\t\t!Editor.isEditor(n) &&\n\t\t\t\tSlateElement.isElement(n) &&\n\t\t\t\tn[blockType] === format,\n\t\t}),\n\t);\n\n\treturn !!match;\n}\n\nexport { isBlockActive };\n","import { Editor, Element as SlateElement, Transforms } from \"slate\";\n\nimport { listTypes, textAlignTypes } from \"../templates/richTextTemplates\";\nimport type {\n\tRichTextAlignFormatType,\n\tRichTextElementFormatType,\n} from \"../types/richTextTypes\";\nimport { isBlockActive } from \"./isBlockActive\";\n\nfunction toggleBlock(\n\teditor: Editor,\n\tformat: RichTextElementFormatType | RichTextAlignFormatType,\n) {\n\tconst blockType = textAlignTypes.includes(format) ? \"align\" : \"type\";\n\tconst isActive = isBlockActive(editor, format, blockType);\n\n\tconst isList = listTypes.includes(format);\n\n\tTransforms.unwrapNodes(editor, {\n\t\tmatch: (n) =>\n\t\t\t!Editor.isEditor(n) &&\n\t\t\tSlateElement.isElement(n) &&\n\t\t\tlistTypes.includes(n.type) &&\n\t\t\t!textAlignTypes.includes(format),\n\t\tsplit: true,\n\t});\n\n\tlet newProperties: Partial<SlateElement>;\n\n\tif (textAlignTypes.includes(format)) {\n\t\tconst formatType = format as RichTextAlignFormatType;\n\t\tnewProperties = { align: isActive ? undefined : formatType };\n\t} else {\n\t\tconst formatType = format as RichTextElementFormatType;\n\t\tnewProperties = {\n\t\t\ttype: isActive ? \"paragraph\" : isList ? \"listItem\" : formatType,\n\t\t};\n\t}\n\n\tTransforms.setNodes<SlateElement>(editor, newProperties);\n\n\tif (!isActive && isList) {\n\t\tconst block = { type: format as RichTextElementFormatType, children: [] };\n\t\tTransforms.wrapNodes(editor, block);\n\t}\n}\n\nexport { toggleBlock };\n","import type { LucideIcon } from \"lucide-react\";\nimport type { MouseEvent } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isBlockActive } from \"../../../services/isBlockActive\";\nimport { toggleBlock } from \"../../../services/toggleBlock\";\nimport { textAlignTypes } from \"../../../templates/richTextTemplates\";\nimport type {\n\tRichTextAlignFormatType,\n\tRichTextElementFormatType,\n} from \"../../../types/richTextTypes\";\n\nimport \"./styles.css\";\n\ntype BlockButtonProps = {\n\tformat: RichTextElementFormatType | RichTextAlignFormatType;\n\ticon: LucideIcon;\n};\n\nfunction BlockButton({ format, icon: Icon }: BlockButtonProps) {\n\tconst editor = useSlate();\n\n\tconst blockType = textAlignTypes.includes(format) ? \"align\" : \"type\";\n\tconst isActive = isBlockActive(editor, format, blockType);\n\n\tconst activeClass = isActive ? \"activeTrue\" : \"activeFalse\";\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\ttoggleBlock(editor, format);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={`arkynRichTextBlockButton ${activeClass}`}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t>\n\t\t\t<Icon />\n\t\t</button>\n\t);\n}\n\nexport { BlockButton };\n","import type { RenderElementProps } from \"slate-react\";\nimport \"./styles.css\";\n\nfunction Element({ attributes, children, element }: RenderElementProps) {\n\tconst style = { textAlign: element.align };\n\n\tswitch (element.type) {\n\t\tcase \"blockQuote\":\n\t\t\treturn (\n\t\t\t\t<blockquote\n\t\t\t\t\tclassName=\"arkynElementBlockquote\"\n\t\t\t\t\tstyle={style}\n\t\t\t\t\t{...attributes}\n\t\t\t\t>\n\t\t\t\t\t{children}\n\t\t\t\t</blockquote>\n\t\t\t);\n\t\tcase \"bulletedList\":\n\t\t\treturn (\n\t\t\t\t<ul className=\"arkynElementBulletList\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</ul>\n\t\t\t);\n\t\tcase \"headingOne\":\n\t\t\treturn (\n\t\t\t\t<h1 className=\"arkynElementHeadingOne\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</h1>\n\t\t\t);\n\t\tcase \"headingTwo\":\n\t\t\treturn (\n\t\t\t\t<h2 className=\"arkynElementHeadingTwo\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</h2>\n\t\t\t);\n\t\tcase \"listItem\":\n\t\t\treturn (\n\t\t\t\t<li className=\"arkynElementListItem\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</li>\n\t\t\t);\n\t\tcase \"numberedList\":\n\t\t\treturn (\n\t\t\t\t<ol className=\"arkynElementNumberedList\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</ol>\n\t\t\t);\n\t\tcase \"image\":\n\t\t\treturn (\n\t\t\t\t<div style={style} {...attributes}>\n\t\t\t\t\t<img\n\t\t\t\t\t\tclassName=\"arkynElementImage\"\n\t\t\t\t\t\talt=\"arkynElementImage\"\n\t\t\t\t\t\tsrc={element?.src || \"\"}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t);\n\t\tcase \"video\":\n\t\t\treturn (\n\t\t\t\t<div style={style} {...attributes}>\n\t\t\t\t\t<iframe\n\t\t\t\t\t\tclassName=\"arkynElementVideo\"\n\t\t\t\t\t\tsrc={element?.src || \"\"}\n\t\t\t\t\t\ttitle=\"YouTube video player\"\n\t\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\t\t\t\treferrerPolicy=\"strict-origin-when-cross-origin\"\n\t\t\t\t\t\tallowFullScreen\n\t\t\t\t\t/>\n\n\t\t\t\t\t{children}\n\t\t\t\t</div>\n\t\t\t);\n\n\t\tdefault:\n\t\t\treturn (\n\t\t\t\t<p className=\"arkynElementParagraph\" style={style} {...attributes}>\n\t\t\t\t\t{children}\n\t\t\t\t</p>\n\t\t\t);\n\t}\n}\n\nexport { Element };\n","import { createContext, type ReactNode, useContext, useMemo } from \"react\";\n\ntype TabContextProps = {\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\ntype TabProviderProps = {\n\tchildren: ReactNode;\n\tdisabled: boolean;\n\tcurrentTab: string;\n\tchangeCurrentTab: (tab: string) => void;\n};\n\nconst TabContext = createContext({} as TabContextProps);\n\nfunction useTab() {\n\treturn useContext(TabContext);\n}\n\nfunction TabProvider(props: TabProviderProps) {\n\tconst { disabled, currentTab, changeCurrentTab } = props;\n\n\tconst value = useMemo(\n\t\t() => ({ disabled, currentTab, changeCurrentTab }),\n\t\t[disabled, currentTab, changeCurrentTab],\n\t);\n\n\treturn (\n\t\t<TabContext.Provider value={value}>{props.children}</TabContext.Provider>\n\t);\n}\n\nexport { TabProvider, useTab };\n","import type { ButtonHTMLAttributes, MouseEvent, ReactNode } from \"react\";\n\nimport { useTab } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabButtonProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"value\" | \"type\"\n> & {\n\t/** Content displayed inside the tab button. */\n\tchildren: ReactNode;\n\t/** Unique identifier for this tab; matched against the container's active value. */\n\tvalue: string;\n};\n\n/**\n * TabButton, individual tab button inside a `TabContainer`.\n *\n * Reads active state and disabled state from `TabContainer` context.\n * The button's own `disabled` prop is ORed with the container's `disabled`.\n *\n * @param props.children - Tab label content. Required.\n * @param props.value - Tab identifier. Required.\n * @param props.disabled - Disables this tab individually (container can also disable all tabs).\n *\n * **...Other valid HTML `<button>` properties except `type`**\n *\n * @returns TabButton JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"activity\">Activity</TabButton>\n * <TabButton value=\"settings\" disabled>Settings</TabButton>\n * </TabContainer>\n * ```\n */\n\nfunction TabButton(props: TabButtonProps) {\n\tconst {\n\t\tchildren,\n\t\tdisabled: rawDisabled = false,\n\t\tclassName: baseClassName = \"\",\n\t\tonClick,\n\t\tvalue,\n\t\t...rest\n\t} = props;\n\n\tconst { disabled, currentTab, changeCurrentTab } = useTab();\n\n\tconst isDisabled = disabled || rawDisabled;\n\n\tconst disabledClass = isDisabled ? \"isDisabled\" : \"\";\n\tconst activeClass = currentTab === value && value ? \"isActive\" : \"\";\n\tconst className = `arkynTabButton ${disabledClass} ${activeClass} ${baseClassName}`;\n\n\tfunction handleClick(event: MouseEvent<HTMLButtonElement>) {\n\t\tchangeCurrentTab(value);\n\t\tonClick?.(event);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\tonClick={handleClick}\n\t\t\tclassName={className.trim()}\n\t\t\t{...rest}\n\t\t\tdisabled={isDisabled}\n\t\t\ttype=\"button\"\n\t\t>\n\t\t\t{children}\n\t\t</button>\n\t);\n}\n\nexport { TabButton };\n","import { type HTMLAttributes, type ReactNode, useState } from \"react\";\n\nimport { TabProvider } from \"../tabContext\";\nimport \"./styles.css\";\n\ntype TabContainerProps = Omit<\n\tHTMLAttributes<HTMLElement>,\n\t\"onChange\" | \"children\" | \"ref\" | \"onClick\"\n> & {\n\t/** `TabButton` components to render as tabs. Required. */\n\tchildren: ReactNode;\n\t/** Disables all tab buttons at once. @default false */\n\tdisabled?: boolean;\n\t/** Initially selected tab value. */\n\tdefaultValue?: string;\n\t/** Callback fired when the active tab changes, receiving the new value. */\n\tonChange?: (index: string) => void;\n};\n\n/**\n * TabContainer, wrapper that manages active state for a group of `TabButton` components.\n *\n * Renders as a `<nav>` element. Provides context consumed by each `TabButton`.\n *\n * @param props.children - `TabButton` elements. Required.\n * @param props.defaultValue - Initially selected tab value.\n * @param props.disabled - Disables all buttons. Default: false\n * @param props.onChange - Called with the new value whenever the active tab changes.\n *\n * **...Other valid HTML `<nav>` properties**\n *\n * @returns TabContainer JSX element.\n *\n * @example\n * ```tsx\n * <TabContainer defaultValue=\"overview\" onChange={setActiveTab}>\n * <TabButton value=\"overview\">Overview</TabButton>\n * <TabButton value=\"analytics\">Analytics</TabButton>\n * <TabButton value=\"settings\">Settings</TabButton>\n * </TabContainer>\n *\n * {activeTab === 'overview' && <OverviewPanel />}\n * {activeTab === 'analytics' && <AnalyticsPanel />}\n * ```\n */\n\nfunction TabContainer(props: TabContainerProps) {\n\tconst {\n\t\tchildren,\n\t\tonChange,\n\t\tdefaultValue,\n\t\tdisabled = false,\n\t\tclassName: baseClassName,\n\t\t...rest\n\t} = props;\n\n\tconst [currentTab, setCurrentTab] = useState(defaultValue || \"\");\n\n\tconst className = `arkynTabContainer ${baseClassName || \"\"}`;\n\n\tfunction changeCurrentTab(value: string) {\n\t\tsetCurrentTab(value);\n\t\tif (onChange) onChange(value);\n\t}\n\n\treturn (\n\t\t<TabProvider\n\t\t\tdisabled={disabled}\n\t\t\tcurrentTab={currentTab}\n\t\t\tchangeCurrentTab={changeCurrentTab}\n\t\t>\n\t\t\t<nav className={className.trim()} {...rest}>\n\t\t\t\t{children}\n\t\t\t</nav>\n\t\t</TabProvider>\n\t);\n}\n\nexport { TabContainer };\n","import { Image } from \"lucide-react\";\nimport { type MouseEvent, useState } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport type { RichTextInsertImageProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { ImageUpload } from \"../../imageUpload\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\nimport { TabButton } from \"../../tab/tabButton\";\nimport { TabContainer } from \"../../tab/tabContainer\";\n\nimport \"./styles.css\";\n\nfunction InsertImage(props: RichTextInsertImageProps) {\n\tconst {\n\t\taction,\n\t\ttabLabels = [\"Adicionar URL\", \"Upload de arquivo\"],\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputImageLabel = \"Imagem:\",\n\t\tmodalInputUrlLabel = \"URL da imagem:\",\n\t\tmodalTitle = \"Inserir imagem\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [imageURL, setImageURL] = useState(\"\");\n\tconst [uploadType, setUploadType] = useState(\"url\");\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tif (!imageURL || imageURL === \"\") return;\n\n\t\teditor.insertNodes([\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t\t{ type: \"image\", src: imageURL, children: [{ text: \"\" }] },\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t]);\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertImage\"\n\t\t\t\tonMouseDown={() => setModalIsVisible(true)}\n\t\t\t>\n\t\t\t\t<Image />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertImageModalContent\">\n\t\t\t\t\t<TabContainer defaultValue={uploadType} onChange={setUploadType}>\n\t\t\t\t\t\t<TabButton value=\"url\">{tabLabels[0]}</TabButton>\n\t\t\t\t\t\t<TabButton value=\"file\">{tabLabels[1]}</TabButton>\n\t\t\t\t\t</TabContainer>\n\n\t\t\t\t\t{uploadType === \"url\" && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<Input\n\t\t\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\t\t\tname=\"richTextImageURL\"\n\t\t\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\t\t\tdefaultValue={imageURL}\n\t\t\t\t\t\t\t\tonChange={(e) => setImageURL(e.target.value)}\n\t\t\t\t\t\t\t/>\n\n\t\t\t\t\t\t\t{imageURL && (\n\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\tclassName=\"arkynRichTextInsertImageModalPreviewImage\"\n\t\t\t\t\t\t\t\t\tsrc={imageURL}\n\t\t\t\t\t\t\t\t\talt=\"preview\"\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t)}\n\t\t\t\t\t\t</>\n\t\t\t\t\t)}\n\n\t\t\t\t\t{uploadType === \"file\" && (\n\t\t\t\t\t\t<ImageUpload\n\t\t\t\t\t\t\tname=\"richTextImageURL\"\n\t\t\t\t\t\t\taction={action}\n\t\t\t\t\t\t\tlabel={modalInputImageLabel}\n\t\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\t\tdefaultValue={imageURL}\n\t\t\t\t\t\t\tonChange={(url) => setImageURL(url)}\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button type=\"button\" onClick={handleMouseDown}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertImage };\n","function isValidHttpsUrl(url: string): boolean {\n\ttry {\n\t\treturn new URL(url).protocol === \"https:\";\n\t} catch {\n\t\treturn false;\n\t}\n}\n\nexport { isValidHttpsUrl };\n","import { Link } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { Editor, Range, Transforms } from \"slate\";\nimport { useSlate } from \"slate-react\";\n\nimport { isValidHttpsUrl } from \"../../../services/isValidHttpsUrl\";\nimport type { RichTextInsertLinkProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertLink(props: RichTextInsertLinkProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do link:\",\n\t\tmodalTitle = \"Inserir link\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [linkURL, setLinkURL] = useState(\"\");\n\tconst [selection, setSelection] = useState(editor.selection);\n\n\tconst isValidUrl = isValidHttpsUrl(linkURL);\n\tconst errorMessage = linkURL && !isValidUrl ? invalidUrlMessage : \"\";\n\n\tfunction handleOpenModal(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tsetSelection(editor.selection);\n\t\tsetModalIsVisible(true);\n\t}\n\n\tfunction handleConfirm(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\tif (!isValidUrl || !selection) return;\n\n\t\tTransforms.select(editor, selection);\n\n\t\tif (Range.isCollapsed(selection)) {\n\t\t\tTransforms.insertNodes(editor, {\n\t\t\t\ttext: linkURL,\n\t\t\t\tlink: true,\n\t\t\t\thref: linkURL,\n\t\t\t});\n\t\t} else {\n\t\t\tEditor.addMark(editor, \"link\", true);\n\t\t\tEditor.addMark(editor, \"href\", linkURL);\n\t\t}\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetLinkURL(\"\");\n\t\t\tsetSelection(null);\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertLink\"\n\t\t\t\tonMouseDown={handleOpenModal}\n\t\t\t>\n\t\t\t\t<Link />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertLinkModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextLinkURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={linkURL}\n\t\t\t\t\t\tonChange={(e) => setLinkURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!isValidUrl} type=\"button\" onClick={handleConfirm}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertLink };\n","import { Video } from \"lucide-react\";\nimport { type MouseEvent, useEffect, useState } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isValidHttpsUrl } from \"../../../services/isValidHttpsUrl\";\nimport type { RichTextInsertVideoProps } from \"../../../types/richTextTypes\";\n\nimport { Button } from \"../../button\";\nimport { Input } from \"../../input\";\nimport { ModalContainer } from \"../../modal/modalContainer\";\nimport { ModalFooter } from \"../../modal/modalFooter\";\nimport { ModalHeader } from \"../../modal/modalHeader\";\n\nimport \"./styles.css\";\n\nfunction InsertVideo(props: RichTextInsertVideoProps) {\n\tconst {\n\t\tmodalCancelButton = \"Cancelar\",\n\t\tmodalConfirmButton = \"Confirmar\",\n\t\tmodalInputUrlLabel = \"URL do vídeo:\",\n\t\tmodalTitle = \"Inserir vídeo\",\n\t\tinvalidUrlMessage = \"URL inválida\",\n\t} = props;\n\n\tconst editor = useSlate();\n\n\tconst [modalIsVisible, setModalIsVisible] = useState(false);\n\tconst [videoId, setVideoId] = useState(\"\");\n\tconst [videoRawURL, setVideoRawURL] = useState(\"\");\n\tconst [errorMessage, setErrorMessage] = useState(\"\");\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\n\t\tif (!videoId || videoId === \"\") return;\n\t\tconst videoUrl = `https://www.youtube.com/embed/${videoId}`;\n\n\t\teditor.insertNodes([\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t\t{ type: \"video\", src: videoUrl, children: [{ text: \"\" }] },\n\t\t\t{ type: \"paragraph\", children: [{ text: \"\" }] },\n\t\t]);\n\n\t\tsetModalIsVisible(false);\n\t}\n\n\tuseEffect(() => {\n\t\tif (!videoRawURL || videoRawURL === \"\") return;\n\n\t\tsetVideoId(\"\");\n\t\tsetErrorMessage(\"\");\n\n\t\tif (!isValidHttpsUrl(videoRawURL)) {\n\t\t\tsetErrorMessage(invalidUrlMessage);\n\t\t\treturn;\n\t\t}\n\n\t\tconst searchParams = new URLSearchParams(videoRawURL.split(\"?\")[1]);\n\t\tconst vParam = searchParams.get(\"v\");\n\t\tif (vParam) setVideoId(vParam);\n\t\telse setErrorMessage(invalidUrlMessage);\n\t}, [videoRawURL, invalidUrlMessage]);\n\n\tuseEffect(() => {\n\t\tif (!modalIsVisible) {\n\t\t\tsetVideoId(\"\");\n\t\t\tsetVideoRawURL(\"\");\n\t\t\tsetErrorMessage(\"\");\n\t\t}\n\t}, [modalIsVisible]);\n\n\treturn (\n\t\t<>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tclassName=\"arkynRichTextInsertVideo\"\n\t\t\t\tonMouseDown={() => setModalIsVisible(true)}\n\t\t\t>\n\t\t\t\t<Video />\n\t\t\t</button>\n\n\t\t\t<ModalContainer\n\t\t\t\tisVisible={modalIsVisible}\n\t\t\t\tmakeInvisible={() => setModalIsVisible(false)}\n\t\t\t>\n\t\t\t\t<ModalHeader>{modalTitle}</ModalHeader>\n\n\t\t\t\t<div className=\"arkynRichTextInsertVideoModalContent\">\n\t\t\t\t\t<Input\n\t\t\t\t\t\ttype=\"text\"\n\t\t\t\t\t\tname=\"richTextVideoURL\"\n\t\t\t\t\t\tlabel={modalInputUrlLabel}\n\t\t\t\t\t\tshowAsterisk\n\t\t\t\t\t\tdefaultValue={videoRawURL}\n\t\t\t\t\t\tonChange={(e) => setVideoRawURL(e.target.value)}\n\t\t\t\t\t\terrorMessage={errorMessage}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{videoId && (\n\t\t\t\t\t\t<iframe\n\t\t\t\t\t\t\twidth=\"auto\"\n\t\t\t\t\t\t\theight=\"315\"\n\t\t\t\t\t\t\tsrc={`https://www.youtube.com/embed/${videoId}`}\n\t\t\t\t\t\t\ttitle=\"YouTube video player\"\n\t\t\t\t\t\t\tallow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\"\n\t\t\t\t\t\t\treferrerPolicy=\"strict-origin-when-cross-origin\"\n\t\t\t\t\t\t\tallowFullScreen\n\t\t\t\t\t\t/>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<ModalFooter>\n\t\t\t\t\t<Button\n\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\tscheme=\"danger\"\n\t\t\t\t\t\tvariant=\"outline\"\n\t\t\t\t\t\tonClick={() => setModalIsVisible(false)}\n\t\t\t\t\t>\n\t\t\t\t\t\t{modalCancelButton}\n\t\t\t\t\t</Button>\n\n\t\t\t\t\t<Button disabled={!videoId} type=\"button\" onClick={handleMouseDown}>\n\t\t\t\t\t\t{modalConfirmButton}\n\t\t\t\t\t</Button>\n\t\t\t\t</ModalFooter>\n\t\t\t</ModalContainer>\n\t\t</>\n\t);\n}\n\nexport { InsertVideo };\n","import type { RenderLeafProps } from \"slate-react\";\nimport \"./styles.css\";\n\nfunction Leaf({ attributes, children, leaf }: RenderLeafProps) {\n\tif (leaf.bold) children = <strong>{children}</strong>;\n\tif (leaf.code) children = <code>{children}</code>;\n\tif (leaf.italic) children = <em>{children}</em>;\n\tif (leaf.underline) children = <u>{children}</u>;\n\tif (leaf.link) {\n\t\tchildren = (\n\t\t\t<a className=\"arkynLeafLink\" href={leaf.href}>\n\t\t\t\t{children}\n\t\t\t</a>\n\t\t);\n\t}\n\n\treturn <span {...attributes}>{children}</span>;\n}\n\nexport { Leaf };\n","import type { LucideIcon } from \"lucide-react\";\nimport type { MouseEvent } from \"react\";\nimport { useSlate } from \"slate-react\";\n\nimport { isMarkActive } from \"../../../services/isMarkActive\";\nimport { toggleMark } from \"../../../services/toggleMark\";\nimport type { RichTextMarkFormatType } from \"../../../types/richTextTypes\";\n\nimport \"./styles.css\";\n\ntype MarkButtonProps = {\n\tformat: RichTextMarkFormatType;\n\ticon: LucideIcon;\n};\n\nfunction MarkButton({ format, icon: Icon }: MarkButtonProps) {\n\tconst editor = useSlate();\n\n\tconst isActive = isMarkActive(editor, format);\n\tconst activeClass = isActive ? \"activeTrue\" : \"activeFalse\";\n\n\tfunction handleMouseDown(event: MouseEvent<HTMLButtonElement>) {\n\t\tevent.preventDefault();\n\t\ttoggleMark(editor, format);\n\t}\n\n\treturn (\n\t\t<button\n\t\t\ttype=\"button\"\n\t\t\tclassName={`arkynRichTextMarkButton ${activeClass}`}\n\t\t\tonMouseDown={handleMouseDown}\n\t\t>\n\t\t\t<Icon />\n\t\t</button>\n\t);\n}\n\nexport { MarkButton };\n","import type { ReactNode } from \"react\";\nimport \"./styles.css\";\n\ntype ToolbarProps = {\n\tchildren: ReactNode;\n};\n\nfunction Toolbar({ children }: ToolbarProps) {\n\treturn <div className=\"arkynRichTextToolbar\">{children}</div>;\n}\n\nexport { Toolbar };\n","import { isHotkey } from \"is-hotkey\";\nimport {\n\tAlignCenter,\n\tAlignJustify,\n\tAlignLeft,\n\tAlignRight,\n\tBold,\n\tCode,\n\tHeading1,\n\tHeading2,\n\tItalic,\n\tQuote,\n\tUnderline,\n} from \"lucide-react\";\nimport { useCallback, useId, useMemo, useRef, useState } from \"react\";\nimport { createEditor, type Descendant } from \"slate\";\nimport { withHistory } from \"slate-history\";\nimport { Editable, Slate, withReact } from \"slate-react\";\nimport { useForm } from \"../../hooks/useForm\";\nimport { clearLinkMarkAtBoundary } from \"../../services/clearLinkMarkAtBoundary\";\nimport { extractTextFromNode } from \"../../services/extractTextFromNode\";\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport { toggleMark } from \"../../services/toggleMark\";\nimport { hotKeys, initialValue } from \"../../templates/richTextTemplates\";\nimport type {\n\tRichTextHiddenButtonKey,\n\tRichTextProps,\n} from \"../../types/richTextTypes\";\nimport { BlockButton } from \"./blockButton\";\nimport { Element } from \"./element\";\nimport { InsertImage } from \"./insertImage\";\nimport { InsertLink } from \"./insertLink\";\nimport { InsertVideo } from \"./insertVideo\";\nimport { Leaf } from \"./leaf\";\nimport { MarkButton } from \"./markButton\";\nimport { Toolbar } from \"./toolbar\";\nimport \"./styles.css\";\n\n/**\n * RichText, WYSIWYG rich-text editor built on Slate.js with a configurable toolbar.\n *\n * **Toolbar features:** bold, italic, underline, code, H1/H2, block quote, alignment (left/center/right/justify), image, video, and link insertion.\n * Pressing Space or Enter right after a link automatically stops new text from continuing to be part of that link.\n *\n * Editor content is stored as a Slate JSON string in a hidden `<input>` for form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the editor.\n * @param props.hiddenButtons - Toolbar button keys to hide (e.g. `[\"image\", \"code\"]`).\n * @param props.imageConfig - Enables image insertion; contains the upload endpoint and modal labels.\n * @param props.videoConfig - Customizes the video insertion modal labels.\n * @param props.linkConfig - Customizes the link insertion modal labels.\n * @param props.defaultValue - Initial editor content as a Slate JSON string. Default: \"[]\"\n * @param props.maxLimit - Maximum character count. Default: 10000\n * @param props.enforceCharacterLimit - Prevents typing past `maxLimit`. Default: false\n * @param props.onChangeCharactersCount - Callback fired on every keystroke, receives the current character count.\n * @param props.onChange - Callback fired when editor content changes, receives the Slate `Descendant[]`.\n * @param props.baseErrorMessage - Custom error message (overrides `useForm` context error).\n * @param props.isError - Forces the error visual state.\n * @param props.id - Custom id for the editable area element.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.orientation - Layout direction. Default: \"horizontal\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n *\n * @returns RichText JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <RichText name=\"content\" />\n *\n * // With character limit and hidden toolbar buttons\n * <RichText\n * name=\"description\"\n * label=\"Description\"\n * maxLimit={500}\n * enforceCharacterLimit\n * hiddenButtons={[\"image\", \"video\", \"code\"]}\n * onChangeCharactersCount={(n) => setCharCount(n)}\n * />\n *\n * // With image upload support\n * <RichText\n * name=\"article\"\n * label=\"Article Body\"\n * imageConfig={{ action: \"/api/upload\" }}\n * />\n *\n * // With custom link insertion modal labels\n * <RichText\n * name=\"article\"\n * label=\"Article Body\"\n * linkConfig={{ modalTitle: \"Add a link\" }}\n * />\n * ```\n */\n\nfunction RichText(props: RichTextProps) {\n\tconst {\n\t\tname,\n\t\thiddenButtons,\n\t\timageConfig,\n\t\tvideoConfig,\n\t\tlinkConfig,\n\t\tclassName: wrapperClassName = \"\",\n\t\tdefaultValue = \"[]\",\n\t\tenforceCharacterLimit = false,\n\t\tonChangeCharactersCount,\n\t\tbaseErrorMessage,\n\t\tmaxLimit = 10000,\n\t\tonChange,\n\t\tisError: baseIsError,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tid,\n\t\torientation = \"vertical\",\n\t\tunShowFieldTemplate = false,\n\t} = props;\n\n\tconst editor = useMemo(() => withHistory(withReact(createEditor())), []);\n\n\tconst { fieldErrors } = useForm();\n\n\tconst defaultNodes = useMemo((): Descendant[] => {\n\t\ttry {\n\t\t\tconst parsedNodes = JSON.parse(defaultValue);\n\t\t\tif (!Array.isArray(parsedNodes) || parsedNodes.length === 0) {\n\t\t\t\treturn structuredClone(initialValue);\n\t\t\t}\n\n\t\t\tconst isValidNodes = parsedNodes.every(\n\t\t\t\t(node) =>\n\t\t\t\t\ttypeof node === \"object\" &&\n\t\t\t\t\tnode !== null &&\n\t\t\t\t\t\"type\" in node &&\n\t\t\t\t\t\"children\" in node,\n\t\t\t);\n\n\t\t\treturn isValidNodes ? parsedNodes : structuredClone(initialValue);\n\t\t} catch (_error) {\n\t\t\treturn structuredClone(initialValue);\n\t\t}\n\t}, [defaultValue]);\n\n\tconst textFromNodes = extractTextFromNode(defaultNodes);\n\n\tconst [charactersCount, setCharactersCount] = useState(textFromNodes.length);\n\tconst [inputValue, setInputValue] = useState(\n\t\tJSON.stringify(defaultNodes) || \"[]\",\n\t);\n\n\tconst [onFocus, setOnFocus] = useState(false);\n\n\tconst ref = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = baseIsError || !!errorMessage;\n\n\tconst renderLeaf = useCallback(Leaf, []);\n\tconst renderElement = useCallback(Element, []);\n\n\tfunction handleChange(value: Descendant[]) {\n\t\tconst text = extractTextFromNode(value);\n\n\t\tsetCharactersCount(text.length);\n\t\tonChangeCharactersCount?.(text.length);\n\n\t\tif (enforceCharacterLimit && text.length >= maxLimit) {\n\t\t\treturn;\n\t\t}\n\n\t\tsetInputValue(JSON.stringify(value));\n\t\tonChange?.(value);\n\t}\n\n\tconst focusClass = onFocus ? \"focusTrue\" : \"focusFalse\";\n\tconst errorClass = isError\n\t\t? \"errorTrue\"\n\t\t: maxLimit < charactersCount\n\t\t\t? \"errorTrue\"\n\t\t\t: \"errorFalse\";\n\n\tconst className = `arkynRichText ${errorClass} ${focusClass}`;\n\n\tconst restatesCharacters = maxLimit - charactersCount;\n\n\tfunction buttonIsNotHidden(format: RichTextHiddenButtonKey) {\n\t\treturn !hiddenButtons?.includes(format);\n\t}\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<Slate\n\t\t\t\teditor={editor}\n\t\t\t\tinitialValue={defaultNodes}\n\t\t\t\tonChange={handleChange}\n\t\t\t\tonValueChange={handleChange}\n\t\t\t>\n\t\t\t\t<div className={className}>\n\t\t\t\t\t<Toolbar>\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingOne\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingOne\" icon={Heading1} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"headingTwo\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"headingTwo\" icon={Heading2} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"blockQuote\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"blockQuote\" icon={Quote} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"bold\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"bold\" icon={Bold} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"italic\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"italic\" icon={Italic} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"underline\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"underline\" icon={Underline} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"code\") && (\n\t\t\t\t\t\t\t<MarkButton format=\"code\" icon={Code} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"left\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"left\" icon={AlignLeft} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"right\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"right\" icon={AlignRight} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"center\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"center\" icon={AlignCenter} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"justify\") && (\n\t\t\t\t\t\t\t<BlockButton format=\"justify\" icon={AlignJustify} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{imageConfig && buttonIsNotHidden(\"image\") && (\n\t\t\t\t\t\t\t<InsertImage {...imageConfig} />\n\t\t\t\t\t\t)}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"video\") && <InsertVideo {...videoConfig} />}\n\n\t\t\t\t\t\t{buttonIsNotHidden(\"link\") && <InsertLink {...linkConfig} />}\n\t\t\t\t\t</Toolbar>\n\n\t\t\t\t\t<Editable\n\t\t\t\t\t\tclassName=\"editorContainer\"\n\t\t\t\t\t\trenderElement={renderElement}\n\t\t\t\t\t\trenderLeaf={renderLeaf}\n\t\t\t\t\t\tspellCheck\n\t\t\t\t\t\tref={ref}\n\t\t\t\t\t\tid={inputId}\n\t\t\t\t\t\tonFocus={() => setOnFocus(true)}\n\t\t\t\t\t\tonBlur={() => setOnFocus(false)}\n\t\t\t\t\t\tonKeyDown={(event) => {\n\t\t\t\t\t\t\tif (event.key === \" \" || event.key === \"Enter\") {\n\t\t\t\t\t\t\t\tclearLinkMarkAtBoundary(editor);\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\tfor (const hotkey in hotKeys) {\n\t\t\t\t\t\t\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t\t\t\t\t\t\tif (isHotkey(hotkey, event as any)) {\n\t\t\t\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\t\t\t\tconst mark = hotKeys[hotkey as keyof typeof hotKeys];\n\t\t\t\t\t\t\t\t\ttoggleMark(editor, mark);\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}}\n\t\t\t\t\t/>\n\n\t\t\t\t\t{restatesCharacters < 0 && (\n\t\t\t\t\t\t<div className=\"restatesCharacters\">{restatesCharacters}</div>\n\t\t\t\t\t)}\n\t\t\t\t</div>\n\n\t\t\t\t<input\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tvalue={inputValue.slice(0, maxLimit)}\n\t\t\t\t/>\n\n\t\t\t\t<input type=\"hidden\" name={`${name}Count`} value={charactersCount} />\n\t\t\t</Slate>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { RichText };\n","import type { StandaloneSearchBoxProps } from \"@react-google-maps/api\";\nimport { StandaloneSearchBox } from \"@react-google-maps/api\";\nimport { type JSX, useState } from \"react\";\nimport { Input, type InputProps } from \"./input\";\n\ntype AddressComponentsType = {\n\tlong_name: string;\n\tshort_name: string;\n\ttypes: string[];\n}[];\n\n/** Structured address data extracted from a Google Places result. */\ntype PlaceData = {\n\t/** Street name (e.g. `\"Rua Exemplo\"`). */\n\tstreet: string;\n\t/** City name (e.g. `\"São Paulo\"`). */\n\tcity: string;\n\t/** Full state name (e.g. `\"São Paulo\"`). */\n\tstate: string;\n\t/** Neighborhood / district name. */\n\tneighborhood: string;\n\t/** Postal / ZIP code. */\n\tpostalCode: string;\n\t/** State abbreviation (e.g. `\"SP\"`). */\n\tstateShortName: string;\n\t/** Street number (e.g. `\"123\"`). */\n\tstreetNumber: string;\n\t/** Geographic coordinates of the place. */\n\tcoordinates: { lat: number; lng: number };\n};\n\ntype SearchPlacesProps = {\n\t/** Google Maps `StandaloneSearchBox` options (e.g. `componentRestrictions`, `bounds`). */\n\toptions?: StandaloneSearchBoxProps[\"options\"];\n\t/** Callback fired every time the input text changes. Receives the current string value. */\n\tonChange?: (e: string) => void;\n\t/**\n\t * Callback fired when the user selects a place from the autocomplete suggestions.\n\t * Receives a structured {@link PlaceData} object.\n\t */\n\tonPlaceChanged?: (e: PlaceData) => void;\n} & Omit<InputProps, \"onLoad\" | \"onChange\" | \"type\">;\n\n/**\n * SearchPlaces, text input with Google Places autocomplete that returns structured address data.\n *\n * Requires the Google Maps JavaScript API with the Places library to be loaded.\n * Built on `@react-google-maps/api`'s `StandaloneSearchBox`.\n *\n * @param props.options - Google Maps search box options (e.g. restrict by country).\n * @param props.onChange - Fires on every keystroke, receives the current text value.\n * @param props.onPlaceChanged - Fires when the user selects a suggestion, receives structured address data.\n *\n * **...Other valid `Input` properties (except `onLoad`, `onChange`, `type`)**\n *\n * @returns SearchPlaces JSX element (an `Input` wrapped in `StandaloneSearchBox`).\n *\n * @example\n * ```tsx\n * <SearchPlaces\n * name=\"address\"\n * label=\"Address\"\n * placeholder=\"Start typing an address…\"\n * options={{ componentRestrictions: { country: \"br\" } }}\n * onChange={(v) => setRawAddress(v)}\n * onPlaceChanged={(place) => {\n * setAddress({\n * street: place.street,\n * city: place.city,\n * state: place.state,\n * postalCode: place.postalCode,\n * coordinates: place.coordinates,\n * });\n * }}\n * />\n * ```\n */\n\nfunction SearchPlaces(props: SearchPlacesProps): JSX.Element {\n\tconst { onChange, onPlaceChanged, options, ...rest } = props;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst [searchBox, setSearchBox] = useState<any>(null);\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tconst handleLoad = (ref: any) => setSearchBox(ref);\n\n\tconst handlePlacesChanged = () => {\n\t\tconst places = searchBox?.getPlaces();\n\t\tconst place = places ? places[0] : null;\n\n\t\tconst address_components =\n\t\t\tplace?.address_components as AddressComponentsType;\n\n\t\tfunction findData(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.long_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataShort(key: string) {\n\t\t\tconst data = address_components.find((item) => item.types[0] === key);\n\t\t\tif (data) return data.short_name;\n\t\t\treturn \"\";\n\t\t}\n\n\t\tfunction findDataByMultipleTypes(keys: string[]) {\n\t\t\tfor (const key of keys) {\n\t\t\t\tconst data = address_components.find((item) =>\n\t\t\t\t\titem.types.includes(key),\n\t\t\t\t);\n\t\t\t\tif (data) return data.long_name;\n\t\t\t}\n\t\t\treturn \"\";\n\t\t}\n\n\t\tif (place) {\n\t\t\tconst street = findData(\"route\");\n\t\t\tconst streetNumber = findData(\"street_number\");\n\t\t\tconst neighborhood = findDataByMultipleTypes([\n\t\t\t\t\"sublocality_level_1\",\n\t\t\t\t\"sublocality\",\n\t\t\t\t\"neighborhood\",\n\t\t\t]);\n\t\t\tconst city = findData(\"administrative_area_level_2\");\n\t\t\tconst state = findData(\"administrative_area_level_1\");\n\t\t\tconst stateShortName = findDataShort(\"administrative_area_level_1\");\n\t\t\tconst postalCode = findDataByMultipleTypes([\n\t\t\t\t\"postal_code\",\n\t\t\t\t\"postal_code_prefix\",\n\t\t\t]);\n\n\t\t\tconst lat = place.geometry?.location?.lat();\n\t\t\tconst lng = place.geometry?.location?.lng();\n\n\t\t\tconst sendPlace = {\n\t\t\t\tstreet,\n\t\t\t\tcity,\n\t\t\t\tstate,\n\t\t\t\tneighborhood,\n\t\t\t\tpostalCode,\n\t\t\t\tstreetNumber,\n\t\t\t\tstateShortName,\n\t\t\t\tcoordinates: { lat, lng },\n\t\t\t};\n\n\t\t\tonPlaceChanged?.(sendPlace);\n\t\t}\n\t};\n\n\treturn (\n\t\t<StandaloneSearchBox\n\t\t\tonLoad={handleLoad}\n\t\t\tonPlacesChanged={handlePlacesChanged}\n\t\t\toptions={options}\n\t\t>\n\t\t\t<Input\n\t\t\t\ttype=\"text\"\n\t\t\t\tautoComplete=\"off\"\n\t\t\t\tonChange={(e) => onChange?.(e.target.value)}\n\t\t\t\t{...rest}\n\t\t\t/>\n\t\t</StandaloneSearchBox>\n\t);\n}\n\nexport { SearchPlaces };\n","import type { ButtonHTMLAttributes } from \"react\";\nimport { useId, useRef, useState } from \"react\";\n\nimport { FieldTemplate } from \"../../services/fieldTemplate\";\nimport \"./styles.css\";\n\ntype SwitchProps = Omit<\n\tButtonHTMLAttributes<HTMLButtonElement>,\n\t\"children\" | \"onChange\" | \"defaultValue\" | \"onCheck\" | \"value\"\n> & {\n\t/** Optional label text displayed beside the switch. */\n\tlabel?: string;\n\t/**\n\t * Switch size.\n\t * @default \"lg\"\n\t */\n\tsize?: \"sm\" | \"md\" | \"lg\";\n\t/** Uncontrolled initial checked state. @default false */\n\tdefaultChecked?: boolean;\n\t/** Controlled checked state. */\n\tchecked?: boolean;\n\t/** Value emitted when the switch is on. @default \"checked\" */\n\tvalue?: string;\n\t/** Value emitted when the switch is off. @default \"\" */\n\tunCheckedValue?: string;\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Callback fired on toggle, receives the current value string. */\n\tonCheck?: (value: string) => void;\n\t/**\n\t * Layout direction forwarded to `FieldTemplate`.\n\t * @default \"horizontalReverse\"\n\t */\n\torientation?: \"vertical\" | \"horizontal\" | \"horizontalReverse\";\n\t/** When true, skips `FieldTemplate` wrapper (label and error text). @default false */\n\tunShowFieldTemplate?: boolean;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the switch. */\n\terrorMessage?: string;\n};\n\n/**\n * Switch, toggle input for binary on/off states.\n *\n * Stores value in a hidden `<input>` for native form submission.\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed beside the switch.\n * @param props.size - Switch size (`sm` | `md` | `lg`). Default: \"lg\"\n * @param props.defaultChecked - Uncontrolled initial checked state. Default: false\n * @param props.checked - Controlled checked state.\n * @param props.value - Value emitted when on. Default: \"checked\"\n * @param props.unCheckedValue - Value emitted when off. Default: \"\"\n * @param props.onCheck - Callback fired on toggle, receives the current value string.\n * @param props.orientation - Layout direction (`horizontal` | `vertical` | `horizontalReverse`). Default: \"horizontalReverse\"\n * @param props.unShowFieldTemplate - Skips wrapper, label, and error rendering. Default: false\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n *\n * **...Other valid HTML properties for `<button>` (except `children`, `onChange`, `defaultValue`)**\n *\n * @returns Switch JSX element wrapped in `FieldTemplate`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Switch name=\"notifications\" label=\"Enable notifications\" />\n *\n * // Custom on/off values\n * <Switch\n * name=\"theme\"\n * label=\"Dark mode\"\n * value=\"dark\"\n * unCheckedValue=\"light\"\n * onCheck={(v) => setTheme(v)}\n * />\n *\n * // Controlled\n * <Switch\n * name=\"autoSave\"\n * label=\"Auto-save\"\n * checked={isAutoSaveEnabled}\n * onCheck={(v) => setAutoSave(!!v)}\n * size=\"md\"\n * />\n * ```\n */\n\nfunction Switch(props: SwitchProps) {\n\tconst {\n\t\tlabel,\n\t\tsize = \"lg\",\n\t\tdefaultChecked = false,\n\t\tchecked: baseChecked = null,\n\t\tvalue,\n\t\tunCheckedValue = \"\",\n\t\tname,\n\t\tclassName: baseClassName = \"\",\n\t\tonCheck,\n\t\tid,\n\t\torientation = \"horizontalReverse\",\n\t\tclassName: wrapperClassName = \"\",\n\t\tshowAsterisk,\n\t\terrorMessage,\n\t\tunShowFieldTemplate = false,\n\t\t...rest\n\t} = props;\n\n\tconst inputRef = useRef<HTMLInputElement>(null);\n\tconst generatedId = useId();\n\tconst inputId = id || generatedId;\n\n\tconst [isChecked, setIsChecked] = useState(defaultChecked);\n\n\tconst currentChecked =\n\t\ttypeof baseChecked === \"boolean\" ? baseChecked : isChecked;\n\n\tfunction handleCheck() {\n\t\tsetIsChecked(!isChecked);\n\t\tonCheck?.(!currentChecked ? value || \"checked\" : unCheckedValue);\n\t}\n\n\tconst checkedClass = currentChecked ? \"checkedTrue\" : \"checkedFalse\";\n\tconst className = `arkynSwitch ${checkedClass} ${size} ${baseClassName}`;\n\n\treturn (\n\t\t<FieldTemplate\n\t\t\tname={name}\n\t\t\tlabel={label}\n\t\t\tshowAsterisk={showAsterisk}\n\t\t\tclassName={wrapperClassName}\n\t\t\terrorMessage={errorMessage}\n\t\t\tunShowFieldTemplate={unShowFieldTemplate}\n\t\t\torientation={orientation}\n\t\t>\n\t\t\t<button\n\t\t\t\ttype=\"button\"\n\t\t\t\tonClick={handleCheck}\n\t\t\t\tclassName={className}\n\t\t\t\t{...rest}\n\t\t\t>\n\t\t\t\t<input\n\t\t\t\t\tid={inputId}\n\t\t\t\t\ttype=\"hidden\"\n\t\t\t\t\tname={name}\n\t\t\t\t\tref={inputRef}\n\t\t\t\t\tonClick={handleCheck}\n\t\t\t\t\tvalue={currentChecked ? value || \"checked\" : unCheckedValue}\n\t\t\t\t/>\n\t\t\t</button>\n\t\t</FieldTemplate>\n\t);\n}\n\nexport { Switch };\n","import { Children, type HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableBodyProps = HTMLAttributes<HTMLTableSectionElement> & {\n\t/** Text displayed in a full-width row when no children are present. @default \"Nenhum dado adicionado.\" */\n\temptyMessage?: string;\n};\n\n/**\n * TableBody, `<tbody>` section with built-in empty state handling.\n *\n * When `children` is empty, renders a full-width row with `emptyMessage`.\n * Accepts all standard HTML `<tbody>` attributes.\n *\n * @param props.emptyMessage - Empty state text. Default: `\"Nenhum dado adicionado.\"`\n *\n * **...Other valid HTML `<tbody>` properties**\n *\n * @returns TableBody JSX element.\n *\n * @example\n * ```tsx\n * <TableBody emptyMessage=\"No orders found\">\n * {orders.map(o => (\n * <tr key={o.id}>\n * <td>{o.number}</td>\n * <td>{o.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * ```\n */\n\nfunction TableBody(props: TableBodyProps) {\n\tconst {\n\t\temptyMessage = \"Nenhum dado adicionado.\",\n\t\tclassName: baseClassName,\n\t\tchildren,\n\t\t...rest\n\t} = props;\n\n\tconst className = `arkynTableBody ${baseClassName}`;\n\tconst childArray = Children.toArray(children).filter(Boolean);\n\tconst isEmpty = childArray.length === 0;\n\n\treturn (\n\t\t<tbody className={className.trim()} {...rest}>\n\t\t\t{isEmpty ? (\n\t\t\t\t<tr className=\"arkynTableBodyEmptyLine\">\n\t\t\t\t\t<td colSpan={100}>\n\t\t\t\t\t\t<div>{emptyMessage}</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t) : (\n\t\t\t\tchildArray\n\t\t\t)}\n\t\t</tbody>\n\t);\n}\n\nexport { TableBody };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableCaptionProps = HTMLAttributes<HTMLElement>;\n\n/**\n * TableCaption, title / description placed above a table. Renders as a `<caption>` element.\n *\n * Accepts all standard HTML element attributes.\n *\n * @returns TableCaption JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Orders, Q2 2025</TableCaption>\n * <TableHeader>...</TableHeader>\n * <TableBody>...</TableBody>\n * </TableContainer>\n * ```\n */\n\nfunction TableCaption(props: TableCaptionProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableCaption ${baseClassName}`;\n\n\treturn (\n\t\t<caption className={className.trim()} {...rest}>\n\t\t\t<div className=\"arkynTableCaptionContent\">{children}</div>\n\t\t</caption>\n\t);\n}\n\nexport { TableCaption };\n","import type { TableHTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableContainerProps = TableHTMLAttributes<HTMLTableElement>;\n\n/**\n * TableContainer, root wrapper for the Table component set. Renders a responsive scrollable container around a `<table>`.\n *\n * Accepts all standard HTML `<table>` attributes.\n *\n * @returns TableContainer JSX element.\n *\n * @example\n * ```tsx\n * <TableContainer>\n * <TableCaption>Users</TableCaption>\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Status</th>\n * </TableHeader>\n * <TableBody emptyMessage=\"No users found\">\n * {users.map(u => (\n * <tr key={u.id}>\n * <td>{u.name}</td>\n * <td>{u.email}</td>\n * <td>{u.status}</td>\n * </tr>\n * ))}\n * </TableBody>\n * <TableFooter><Pagination /></TableFooter>\n * </TableContainer>\n * ```\n */\n\nfunction TableContainer(props: TableContainerProps) {\n\tconst { children, className: baseClassName, ...rest } = props;\n\tconst className = `arkynTableContainer ${baseClassName}`;\n\n\treturn (\n\t\t<div className={className.trim()} {...rest}>\n\t\t\t<table>{children}</table>\n\t\t</div>\n\t);\n}\n\nexport { TableContainer };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableFooterProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableFooter, `<tfoot>` section with an automatic spacing row above the content.\n *\n * Children span all columns via `colSpan={100}`. Commonly used for `Pagination`.\n * Accepts all standard HTML `<tfoot>` attributes.\n *\n * @returns TableFooter JSX element.\n *\n * @example\n * ```tsx\n * <TableFooter>\n * <Pagination currentPage={page} totalPages={totalPages} onChange={setPage} />\n * </TableFooter>\n * ```\n */\n\nfunction TableFooter(props: TableFooterProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableFooter ${baseClassName}`;\n\n\treturn (\n\t\t<tfoot className={className.trim()} {...rest}>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t\t<tr>\n\t\t\t\t<th colSpan={100}>\n\t\t\t\t\t<div className=\"arkynTableFooterContent\">{children}</div>\n\t\t\t\t</th>\n\t\t\t</tr>\n\t\t</tfoot>\n\t);\n}\n\nexport { TableFooter };\n","import type { HTMLAttributes } from \"react\";\nimport \"./styles.css\";\n\ntype TableHeaderProps = HTMLAttributes<HTMLTableSectionElement>;\n\n/**\n * TableHeader, `<thead>` section with an automatic spacing row below the header row.\n *\n * Pass `<th>` elements as children, they are wrapped in a `<tr>` automatically.\n * Accepts all standard HTML `<thead>` attributes.\n *\n * @returns TableHeader JSX element.\n *\n * @example\n * ```tsx\n * <TableHeader>\n * <th>Name</th>\n * <th>Email</th>\n * <th>Actions</th>\n * </TableHeader>\n * ```\n */\n\nfunction TableHeader(props: TableHeaderProps) {\n\tconst { className: baseClassName, children, ...rest } = props;\n\tconst className = `arkynTableHeader ${baseClassName}`;\n\n\treturn (\n\t\t<thead className={className.trim()} {...rest}>\n\t\t\t<tr>{children}</tr>\n\t\t\t<tr className=\"spacingRow\" />\n\t\t</thead>\n\t);\n}\n\nexport { TableHeader };\n","import {\n\ttype FocusEvent,\n\ttype TextareaHTMLAttributes,\n\tuseId,\n\tuseRef,\n\tuseState,\n} from \"react\";\n\nimport { useForm } from \"../../hooks/useForm\";\nimport { FieldError } from \"../fieldError\";\nimport { FieldLabel } from \"../fieldLabel\";\nimport { FieldWrapper } from \"../fieldWrapper\";\nimport \"./styles.css\";\n\ntype TextareaProps = Omit<\n\tTextareaHTMLAttributes<HTMLTextAreaElement>,\n\t\"name\" | \"value\" | \"defaultValue\"\n> & {\n\t/** Field name for form submission. Required. */\n\tname: string;\n\t/** Optional label text displayed above the textarea. */\n\tlabel?: string;\n\t/** Displays an asterisk on the label to signal a required field. */\n\tshowAsterisk?: boolean;\n\t/** Validation error message displayed below the textarea. */\n\terrorMessage?: string;\n\t/**\n\t * Textarea size.\n\t * @default \"md\"\n\t */\n\tsize?: \"md\" | \"lg\";\n\t/**\n\t * Visual style variant.\n\t * - `solid`: filled background.\n\t * - `outline`: bordered, transparent background.\n\t * @default \"solid\"\n\t */\n\tvariant?: \"solid\" | \"outline\";\n\t/** Controlled value. */\n\tvalue?: string;\n\t/** Uncontrolled default value. */\n\tdefaultValue?: string;\n};\n\n/**\n * Textarea, multi-line text input with label, validation, and form integration.\n *\n * Integrates with `useForm` to display validation errors by field name.\n *\n * @param props.name - Field name for form submission. Required.\n * @param props.label - Label text displayed above the textarea.\n * @param props.showAsterisk - Appends `*` to the label.\n * @param props.errorMessage - Validation error message.\n * @param props.size - Textarea size (`md` | `lg`). Default: \"md\"\n * @param props.variant - Visual style variant. Default: \"solid\"\n *\n * **...Other valid HTML properties for `<textarea>`**\n *\n * @returns Textarea JSX element wrapped in `FieldWrapper`.\n *\n * @example\n * ```tsx\n * // Basic\n * <Textarea name=\"description\" placeholder=\"Enter description...\" />\n *\n * // With label and validation\n * <Textarea\n * name=\"bio\"\n * label=\"Biography\"\n * showAsterisk\n * placeholder=\"Tell us about yourself\"\n * errorMessage=\"Biography is required\"\n * />\n *\n * // Controlled with custom rows\n * <Textarea\n * name=\"message\"\n * label=\"Message\"\n * value={message}\n * onChange={(e) => setMessage(e.target.value)}\n * rows={5}\n * size=\"lg\"\n * variant=\"outline\"\n * />\n * ```\n */\n\nfunction Textarea(props: TextareaProps) {\n\tconst {\n\t\tvariant = \"solid\",\n\t\tsize = \"md\",\n\t\tclassName: wrapperClassName,\n\t\terrorMessage: baseErrorMessage,\n\t\tdisabled = false,\n\t\treadOnly = false,\n\t\tlabel,\n\t\tshowAsterisk,\n\t\tname,\n\t\tonFocus,\n\t\tonBlur,\n\t\ttitle,\n\t\tstyle,\n\t\tvalue,\n\t\tdefaultValue,\n\t\tplaceholder,\n\t\tid,\n\t\t...rest\n\t} = props;\n\n\tconst { fieldErrors } = useForm();\n\tconst [isFocused, setIsFocused] = useState(false);\n\tconst textareaRef = useRef<HTMLTextAreaElement>(null);\n\tconst generatedId = useId();\n\tconst textareaId = id || generatedId;\n\n\tconst errorMessage = baseErrorMessage || fieldErrors?.[name];\n\tconst isError = !!errorMessage;\n\n\tconst errorClass = isError ? \"errorTrue\" : \"errorFalse\";\n\tconst opacityClass = disabled || readOnly ? \"opacityTrue\" : \"opacityFalse\";\n\tconst focusedClass = isFocused ? \"focusedTrue\" : \"focusedFalse\";\n\n\tconst className = `arkynTextarea ${variant} ${size} ${opacityClass} ${errorClass} ${focusedClass}`;\n\tconst domValue = disabled ? undefined : value;\n\n\tfunction handleSectionClick() {\n\t\tif (disabled || !textareaRef?.current) return;\n\t\tsetIsFocused(true);\n\t\ttextareaRef.current.focus();\n\t}\n\n\tfunction handleFocus(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(true);\n\t\tif (onFocus) onFocus(e);\n\t}\n\n\tfunction handleBlur(e: FocusEvent<HTMLTextAreaElement>) {\n\t\tsetIsFocused(false);\n\t\tif (onBlur) onBlur(e);\n\t}\n\n\treturn (\n\t\t<FieldWrapper className={wrapperClassName}>\n\t\t\t{label && (\n\t\t\t\t<FieldLabel htmlFor={textareaId} showAsterisk={showAsterisk}>\n\t\t\t\t\t{label}\n\t\t\t\t</FieldLabel>\n\t\t\t)}\n\n\t\t\t<section\n\t\t\t\ttitle={title}\n\t\t\t\tstyle={style}\n\t\t\t\tonClick={handleSectionClick}\n\t\t\t\tclassName={className}\n\t\t\t>\n\t\t\t\t<textarea\n\t\t\t\t\tid={textareaId}\n\t\t\t\t\tdisabled={disabled}\n\t\t\t\t\treadOnly={readOnly}\n\t\t\t\t\tref={textareaRef}\n\t\t\t\t\tname={name}\n\t\t\t\t\tonFocus={handleFocus}\n\t\t\t\t\tonBlur={handleBlur}\n\t\t\t\t\tdefaultValue={domValue === undefined ? defaultValue || \"\" : undefined}\n\t\t\t\t\tplaceholder={disabled ? value || placeholder : placeholder}\n\t\t\t\t\tvalue={domValue}\n\t\t\t\t\t{...rest}\n\t\t\t\t/>\n\t\t\t</section>\n\t\t\t{errorMessage && <FieldError>{errorMessage}</FieldError>}\n\t\t</FieldWrapper>\n\t);\n}\n\nexport { Textarea };\n","const badResponses = [\n\t\"BadGateway\",\n\t\"BadRequest\",\n\t\"Conflict\",\n\t\"Forbidden\",\n\t\"NotFound\",\n\t\"NotImplemented\",\n\t\"ServerError\",\n\t\"Unauthorized\",\n\t\"UnprocessableEntity\",\n];\n\nexport { badResponses };\n","const successResponses = [\"Created\", \"Found\", \"Success\", \"Updated\"];\n\nexport { successResponses };\n","import {\n\tcreateContext,\n\ttype ReactNode,\n\tuseCallback,\n\tuseMemo,\n\tuseState,\n} from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype ModalContextProps<T = any> = {\n\tmodalIsOpen(key: string): boolean;\n\tmodalData(key: string): T;\n\topenModal(key: string, data?: T): void;\n\tcloseModal(key: string): void;\n\tcloseAll(): void;\n};\n\ntype OpenedModals = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype ModalProviderProps = {\n\tchildren: ReactNode;\n\tenableModalAutomation?: boolean;\n};\n\nconst modalContext = createContext({} as ModalContextProps);\n\n/**\n * ModalProvider, context provider that manages open/close state and data for named modals.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useModal(key)` to open, close, or read data for a specific modal. `closeAll()` is also\n * available (used by `useAutomation` to close all modals after a successful form action).\n *\n * @param props.children - Components that will have access to modal context.\n *\n * @returns ModalProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ModalProvider>\n * <App />\n * </ModalProvider>\n *\n * // Opening a modal from anywhere in the tree\n * const { openModal } = useModal();\n * openModal('confirm-delete', { id: user.id });\n *\n * // Consuming in the modal component\n * const { modalIsOpen, modalData, closeModal } = useModal<{ id: number }>('confirm-delete');\n * ```\n */\n\nfunction ModalProvider(args: ModalProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedModals, setOpenedModals] = useState<OpenedModals>([]);\n\n\tconst modalIsOpen = useCallback(\n\t\t(key: string) => openedModals.some((modal) => modal.key === key),\n\t\t[openedModals],\n\t);\n\n\tconst modalData = useCallback(\n\t\t(key: string) => openedModals.find((modal) => modal.key === key)?.data,\n\t\t[openedModals],\n\t);\n\n\tconst openModal = useCallback(\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\t(key: string, data?: any) => {\n\t\t\tsetOpenedModals((old) => {\n\t\t\t\tconst filtered = old.filter((modal) => modal.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t},\n\t\t[],\n\t);\n\n\tconst closeModal = useCallback((key: string) => {\n\t\tsetOpenedModals((old) => old.filter((modal) => modal.key !== key));\n\t}, []);\n\n\tconst closeAll = useCallback(() => {\n\t\tsetOpenedModals([]);\n\t}, []);\n\n\tconst value = useMemo(\n\t\t() => ({ modalIsOpen, modalData, openModal, closeModal, closeAll }),\n\t\t[modalIsOpen, modalData, openModal, closeModal, closeAll],\n\t);\n\n\treturn (\n\t\t<modalContext.Provider value={value}>{children}</modalContext.Provider>\n\t);\n}\n\nexport { type ModalContextProps, ModalProvider, modalContext };\n","import { useContext } from \"react\";\nimport {\n\ttype ModalContextProps,\n\tmodalContext,\n} from \"../providers/modalProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenModalProps<T = any> = (data?: T) => void;\n\n/**\n * useModal, accesses the nearest `ModalProvider` context.\n *\n * Two call signatures:\n * - **Without `key`**, returns the raw context object (manage any modal by name).\n * - **With `key`**, returns a scoped object bound to one named modal.\n *\n * @param key - Modal identifier registered in `ModalProvider`.\n *\n * @returns Without key: full `ModalContextProps`. With key: `{ modalIsOpen, modalData, openModal, closeModal }`.\n *\n * @throws If called outside a `ModalProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one modal, the most common pattern\n * const { modalIsOpen, modalData, openModal, closeModal } = useModal<{ id: number }>('confirm-delete');\n *\n * openModal({ id: user.id });\n * ```\n *\n * @example\n * ```tsx\n * // Full context, useful when triggering multiple different modals from one place\n * const { openModal } = useModal();\n *\n * openModal('confirm-delete', { id: user.id });\n * openModal('user-details', { id: user.id });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(): ModalContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useModal<T = any>(\n\tkey: string,\n): {\n\tmodalIsOpen: boolean;\n\tmodalData: T;\n\topenModal: OpenModalProps<T>;\n\tcloseModal: () => void;\n};\n\nfunction useModal(key?: string) {\n\tconst contextData = useContext(modalContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useModal must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tmodalData: contextModalData,\n\t\t\tmodalIsOpen: contextModalIsOpen,\n\t\t\topenModal: contextOpenModal,\n\t\t\tcloseModal: contextCloseModal,\n\t\t} = contextData;\n\n\t\tconst modalIsOpen = contextModalIsOpen(key);\n\t\tconst modalData = contextModalData(key);\n\n\t\tconst openModal: OpenModalProps = (data) => contextOpenModal(key, data);\n\t\tconst closeModal = () => contextCloseModal(key);\n\n\t\treturn { modalIsOpen, modalData, openModal, closeModal };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useModal };\n","import { createContext, type ReactNode, useMemo } from \"react\";\nimport toast, { Toaster } from \"react-hot-toast\";\n\ntype ToastProps = {\n\tmessage: string;\n\ttype: \"success\" | \"danger\";\n};\n\ntype ToastContextProps = {\n\tshowToast(toast: ToastProps): void;\n};\n\ntype ToastProviderProps = {\n\tchildren: ReactNode;\n};\n\nconst toastContext = createContext({} as ToastContextProps);\n\nfunction showToast(props: ToastProps) {\n\tswitch (props.type) {\n\t\tcase \"success\":\n\t\t\treturn toast.success(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#10B981\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#059669\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t\tcase \"danger\":\n\t\t\treturn toast.error(props.message, {\n\t\t\t\tstyle: {\n\t\t\t\t\tbackground: \"#E11D48\",\n\t\t\t\t\tcolor: \"#ffffff\",\n\t\t\t\t\tpadding: \"12px 16px\",\n\t\t\t\t\tfontSize: \"14px\",\n\t\t\t\t\tfontWeight: 600,\n\t\t\t\t},\n\t\t\t\ticonTheme: {\n\t\t\t\t\tprimary: \"#BE123C\",\n\t\t\t\t\tsecondary: \"#ffffff\",\n\t\t\t\t},\n\t\t\t});\n\t}\n}\n\n/**\n * ToastProvider, mounts a `react-hot-toast` `<Toaster>` and exposes `showToast` via context.\n *\n * Wrap your app once. Then call `useToast()` anywhere in the tree to show notifications.\n * Supports two types: `\"success\"` (green) and `\"danger\"` (red).\n *\n * @param props.children - App subtree that will have access to `useToast`.\n *\n * @returns ToastProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <ToastProvider>\n * <App />\n * </ToastProvider>\n *\n * // Anywhere in the tree\n * const { showToast } = useToast();\n * showToast({ message: \"Order placed!\", type: \"success\" });\n * ```\n */\n\nfunction ToastProvider({ children }: ToastProviderProps) {\n\tconst value = useMemo(() => ({ showToast }), []);\n\n\treturn (\n\t\t<toastContext.Provider value={value}>\n\t\t\t<Toaster\n\t\t\t\tposition=\"top-right\"\n\t\t\t\tcontainerStyle={{ zIndex: 999999999999999 }}\n\t\t\t/>\n\t\t\t{children}\n\t\t</toastContext.Provider>\n\t);\n}\n\nexport { ToastProvider, toastContext };\n","import { useContext } from \"react\";\nimport { toastContext } from \"../providers/toastProvider\";\n\n/**\n * useToast, reads `ToastProvider` context to display toast notifications.\n *\n * @returns Context containing `showToast(options)`.\n *\n * @throws If called outside a `ToastProvider`.\n *\n * @example\n * ```tsx\n * const { showToast } = useToast();\n *\n * // After a successful save\n * showToast({ message: \"Changes saved!\", type: \"success\" });\n *\n * // After a failed request\n * showToast({ message: \"Failed to save changes.\", type: \"danger\" });\n * ```\n */\n\nfunction useToast() {\n\tconst contextData = useContext(toastContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useToast must be used within a Provider\");\n\t}\n\n\treturn contextData;\n}\n\nexport { useToast };\n","import { useCallback, useEffect } from \"react\";\nimport { scroller } from \"react-scroll\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useAutomation, runs UI side-effects (close modals, scroll, toast) in response to a server action payload.\n *\n * Pass the raw response from a form submission. On every change the hook:\n * 1. Closes all open modals if `closeModal` is `true`.\n * 2. Smooth-scrolls to a named element if `cause.data.scrollTo` is set.\n * 3. Shows a toast based on `name` (matched against `successResponses`/`badResponses`) and `message`.\n * When `cause.fieldErrors` is present, the first field error takes priority in the toast.\n * The message `\"Unprocessable entity\"` is intentionally suppressed.\n *\n * @param formResponseData - Raw server response payload.\n * @param formResponseData.closeModal - Closes all open modals when `true`.\n * @param formResponseData.name - Response identifier matched against success/bad response lists.\n * @param formResponseData.message - Text shown in the toast notification.\n * @param formResponseData.cause.data.scrollTo - Element name to scroll to via `react-scroll`.\n * @param formResponseData.cause.fieldErrors - Field-level errors; the first value is shown in the toast.\n *\n * @example\n * ```tsx\n * // After a successful create action\n * useAutomation({ closeModal: true, name: \"created\", message: \"Saved successfully\" });\n * ```\n *\n * @example\n * ```tsx\n * // Validation error with field-level feedback and scroll\n * useAutomation({\n * name: \"validation_error\",\n * message: \"Invalid payload\",\n * cause: {\n * data: { scrollTo: \"email\" },\n * fieldErrors: { email: \"E-mail is required\" },\n * },\n * });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useAutomation(formResponseData: any) {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst closeModal = formResponseData?.closeModal;\n\tconst message = formResponseData?.message;\n\tconst name = formResponseData?.name;\n\tconst scrollTo = formResponseData?.cause?.data?.scrollTo;\n\tconst firstErrorField = formResponseData?.cause?.fieldErrors\n\t\t? (Object.values(formResponseData?.cause?.fieldErrors)[0] as string)\n\t\t: null;\n\n\tconst fireToast = useCallback(() => {\n\t\tif (!message && !firstErrorField) return;\n\n\t\tif (successResponses.includes(name))\n\t\t\treturn showToast({ message, type: \"success\" });\n\n\t\tif (!badResponses.includes(name)) return;\n\t\tif (firstErrorField)\n\t\t\treturn showToast({ message: firstErrorField, type: \"danger\" });\n\n\t\tif (message === \"Unprocessable entity\") return;\n\t\treturn showToast({ message, type: \"danger\" });\n\t}, [message, firstErrorField, name, showToast]);\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (scrollTo) scroller.scrollTo(scrollTo, { smooth: true, offset: 20 });\n\t\tfireToast();\n\t}, [closeModal, scrollTo, fireToast, closeAll]);\n}\n\nexport { useAutomation };\n","/**\n * copyWithFallback, copies `text` using a hidden `<textarea>` + `document.execCommand(\"copy\")`.\n *\n * Used internally by `useCopyToClipboard` when `navigator.clipboard` is unavailable or rejects,\n * e.g. insecure contexts (non-HTTPS) or older browsers.\n *\n * @param text - Text to copy.\n * @returns `true` if the copy command succeeded, `false` otherwise.\n */\n\nfunction copyWithFallback(text: string) {\n\tconst textarea = document.createElement(\"textarea\");\n\ttextarea.value = text;\n\ttextarea.style.position = \"fixed\";\n\ttextarea.style.opacity = \"0\";\n\tdocument.body.appendChild(textarea);\n\ttextarea.select();\n\n\ttry {\n\t\treturn document.execCommand(\"copy\");\n\t} finally {\n\t\tdocument.body.removeChild(textarea);\n\t}\n}\n\n/**\n * useCopyToClipboard, copies text to the clipboard and reports whether it succeeded.\n *\n * Tries `navigator.clipboard.writeText` first. If it's unavailable or rejects, falls back\n * to a hidden `<textarea>` with `document.execCommand(\"copy\")`. Never throws; any failure\n * simply resolves to `false`.\n *\n * @returns An object with `copyToClipboard`, an async function that copies `text` and resolves\n * to `true` on success, `false` on failure.\n *\n * @example\n * ```tsx\n * function CopyButton({ value }) {\n * const { copyToClipboard } = useCopyToClipboard();\n *\n * async function handleClick() {\n * const success = await copyToClipboard(value);\n * if (success) console.log(\"Copied!\");\n * }\n *\n * return <button onClick={handleClick}>Copy</button>;\n * }\n * ```\n */\n\nfunction useCopyToClipboard() {\n\tasync function copyToClipboard(text: string) {\n\t\ttry {\n\t\t\tawait navigator.clipboard.writeText(text);\n\t\t\treturn true;\n\t\t} catch {\n\t\t\ttry {\n\t\t\t\treturn copyWithFallback(text);\n\t\t\t} catch {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn { copyToClipboard };\n}\n\nexport { useCopyToClipboard };\n","import { createContext, type ReactNode, useState } from \"react\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype DrawerContextProps<T = any> = {\n\tdrawerIsOpen(key: string): boolean;\n\tdrawerData(key: string): T;\n\topenDrawer(key: string, data?: T): void;\n\tcloseDrawer(key: string): void;\n};\n\ntype OpenedDrawers = {\n\tkey: string;\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tdata?: any;\n}[];\n\ntype DrawerProviderProps = {\n\tchildren: ReactNode;\n\tenableDrawerAutomation?: boolean;\n};\n\nconst drawerContext = createContext({} as DrawerContextProps);\n\n/**\n * DrawerProvider, context provider that manages open/close state and data for named drawers.\n *\n * Wrap your app (or a subtree) with this once. Any component in the tree can then call\n * `useDrawer(key)` to open, close, or read data for a specific drawer.\n *\n * @param props.children - Components that will have access to drawer context.\n *\n * @returns DrawerProvider JSX element.\n *\n * @example\n * ```tsx\n * // In your root layout\n * <DrawerProvider>\n * <App />\n * </DrawerProvider>\n *\n * // Opening a drawer from anywhere in the tree\n * const { openDrawer } = useDrawer();\n * openDrawer('filters', { category: 'electronics' });\n *\n * // Consuming in the drawer component\n * const { drawerIsOpen, drawerData, closeDrawer } = useDrawer<{ category: string }>('filters');\n * ```\n */\n\nfunction DrawerProvider(args: DrawerProviderProps) {\n\tconst { children = false } = args;\n\tconst [openedDrawers, setOpenedDrawers] = useState<OpenedDrawers>([]);\n\n\tfunction drawerIsOpen(key: string) {\n\t\treturn !!openedDrawers.some((drawer) => drawer.key === key);\n\t}\n\n\tfunction drawerData(key: string) {\n\t\treturn openedDrawers.find((drawer) => drawer.key === key)?.data;\n\t}\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tfunction openDrawer(key: string, data?: any) {\n\t\tconst alreadyExist = drawerIsOpen(key);\n\t\tif (alreadyExist) {\n\t\t\tsetOpenedDrawers((old) => {\n\t\t\t\tconst filtered = old.filter((drawer) => drawer.key !== key);\n\t\t\t\treturn [...filtered, { key, data }];\n\t\t\t});\n\t\t} else setOpenedDrawers([...openedDrawers, { key, data }]);\n\t}\n\n\tfunction closeDrawer(key: string) {\n\t\tsetOpenedDrawers(openedDrawers.filter((drawer) => drawer.key !== key));\n\t}\n\n\treturn (\n\t\t<drawerContext.Provider\n\t\t\tvalue={{ drawerIsOpen, drawerData, openDrawer, closeDrawer }}\n\t\t>\n\t\t\t{children}\n\t\t</drawerContext.Provider>\n\t);\n}\n\nexport { type DrawerContextProps, DrawerProvider, drawerContext };\n","import { useContext } from \"react\";\nimport {\n\ttype DrawerContextProps,\n\tdrawerContext,\n} from \"../providers/drawerProvider\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\ntype OpenDrawerProps<T = any> = (data?: T) => void;\n\n/**\n * useDrawer, accesses the nearest `DrawerProvider` context.\n *\n * Two call signatures:\n * - **Without `key`**, returns the raw context object (manage any drawer by name).\n * - **With `key`**, returns a scoped object bound to one named drawer.\n *\n * @param key - Drawer identifier registered in `DrawerProvider`.\n *\n * @returns Without key: full `DrawerContextProps`. With key: `{ drawerIsOpen, drawerData, openDrawer, closeDrawer }`.\n *\n * @throws If called outside a `DrawerProvider`.\n *\n * @example\n * ```tsx\n * // Scoped to one drawer, the most common pattern\n * const { drawerIsOpen, drawerData, openDrawer, closeDrawer } = useDrawer<{ section: string }>('navigation');\n *\n * openDrawer({ section: 'products' });\n * ```\n *\n * @example\n * ```tsx\n * // Full context, useful when triggering multiple different drawers from one place\n * const { openDrawer } = useDrawer();\n *\n * openDrawer('navigation', { section: 'main' });\n * openDrawer('filters', { category: 'electronics' });\n * ```\n */\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(): DrawerContextProps<T>;\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction useDrawer<T = any>(\n\tkey: string,\n): {\n\tdrawerIsOpen: boolean;\n\tdrawerData: T;\n\topenDrawer: OpenDrawerProps<T>;\n\tcloseDrawer: () => void;\n};\n\nfunction useDrawer(key?: string) {\n\tconst contextData = useContext(drawerContext);\n\n\tif (Object.entries(contextData).length === 0) {\n\t\tthrow new Error(\"useDrawer must be used within a Provider\");\n\t}\n\n\tif (key) {\n\t\tconst {\n\t\t\tdrawerData: contextDrawerData,\n\t\t\tdrawerIsOpen: contextDrawerIsOpen,\n\t\t\topenDrawer: contextOpenDrawer,\n\t\t\tcloseDrawer: contextCloseDrawer,\n\t\t} = contextData;\n\n\t\tconst drawerIsOpen = contextDrawerIsOpen(key);\n\t\tconst drawerData = contextDrawerData(key);\n\n\t\tconst openDrawer: OpenDrawerProps = (data) => contextOpenDrawer(key, data);\n\t\tconst closeDrawer = () => contextCloseDrawer(key);\n\n\t\treturn { drawerIsOpen, drawerData, openDrawer, closeDrawer };\n\t} else {\n\t\treturn contextData;\n\t}\n}\n\nexport { useDrawer };\n","type ParamsType = Record<string, string | number | boolean | undefined>;\n\n/**\n * useScopedParams, reads and writes URL search parameters with an optional namespace prefix.\n *\n * When `scope` is provided, every key is namespaced as `scope:key`, so multiple features\n * can share the same URL without collisions (e.g. `filters:status` and `table:page`).\n *\n * @param searchString - Current URL search string (e.g. `location.search`).\n * @param scope - Namespace prefix. Default: `\"\"` (no prefix).\n *\n * @returns\n * - `getParam(key)`, returns the (scoped) param value, or `null` if absent.\n * - `getScopedSearch(params)`, merges `params` into the existing search string and returns the result.\n * Pass `undefined` as a value to delete that param.\n *\n * @example\n * ```tsx\n * // Without scope, plain key/value params\n * const { getParam, getScopedSearch } = useScopedParams(location.search);\n * getParam('page'); // \"1\"\n * getScopedSearch({ page: 2, sort: 'name' }); // \"?page=2&sort=name\"\n * ```\n *\n * @example\n * ```tsx\n * // With scope, all keys prefixed as \"filters:key\"\n * const { getParam, getScopedSearch } = useScopedParams(location.search, 'filters');\n * getParam('status'); // reads \"filters:status\"\n * getScopedSearch({ status: 'active', category: undefined }); // removes \"filters:category\"\n * ```\n */\n\nfunction useScopedParams(searchString: string, scope: string = \"\") {\n\tconst searchParams = new URLSearchParams(searchString);\n\tconst prefix = scope ? `${scope}:` : \"\";\n\n\tconst updateSearchParams = (params: ParamsType) => {\n\t\tObject.entries(params).forEach(([key, value]) => {\n\t\t\tif (value === undefined) {\n\t\t\t\tsearchParams.delete(`${prefix}${key}`);\n\t\t\t} else {\n\t\t\t\tsearchParams.set(`${prefix}${key}`, String(value));\n\t\t\t}\n\t\t});\n\t};\n\n\treturn {\n\t\tgetParam: (key: string) => searchParams.get(`${prefix}${key}`),\n\t\tgetScopedSearch: (params: ParamsType) => {\n\t\t\tupdateSearchParams(params);\n\t\t\tlet search = searchParams.toString();\n\t\t\tif (search) search = `?${search}`;\n\t\t\treturn search;\n\t\t},\n\t};\n}\n\nexport { useScopedParams };\n","import { useEffect } from \"react\";\nimport { badResponses } from \"../templates/badResponses\";\nimport { successResponses } from \"../templates/successResponses\";\nimport { useModal } from \"./useModal\";\nimport { useScopedParams } from \"./useScopedParams\";\nimport { useToast } from \"./useToast\";\n\n/**\n * useSearchAutomation, URL-driven version of `useAutomation`. Reads automation params from a\n * URL search string and executes the same side-effects (close modals, toast) on every change.\n *\n * Reads the following params (optionally prefixed by `scope:`):\n * - `closeModal=true`, closes all open modals.\n * - `message`, text for the toast notification.\n * - `type`, `\"success\"` or `\"danger\"` toast style.\n * - `name`, response identifier matched against `successResponses`/`badResponses` lists.\n *\n * @param searchString - Raw URL search string (e.g. `location.search`).\n * @param scope - Optional prefix for all params. Default: `\"\"` (no prefix).\n *\n * @example\n * ```tsx\n * // Remix / Next.js Server Action that redirects with search params\n * // redirect(\"?closeModal=true&message=Saved!&type=success\")\n * const [searchParams] = useSearchParams();\n * useSearchAutomation(searchParams.toString());\n * ```\n *\n * @example\n * ```tsx\n * // Scoped params, avoids collisions when multiple features share the URL\n * // redirect(\"?filters:closeModal=true&filters:message=Applied!&filters:type=success\")\n * useSearchAutomation(location.search, \"filters\");\n * ```\n */\n\nfunction useSearchAutomation(searchString: string, scope: string = \"\") {\n\tconst { closeAll } = useModal();\n\tconst { showToast } = useToast();\n\n\tconst { getParam } = useScopedParams(searchString, scope);\n\n\tconst closeModal = getParam(\"closeModal\") === \"true\";\n\tconst message = getParam(\"message\");\n\tconst name = getParam(\"name\");\n\tconst type = getParam(\"type\") as \"success\" | \"danger\" | null;\n\n\tuseEffect(() => {\n\t\tif (closeModal) closeAll();\n\t\tif (message) {\n\t\t\tif (type === \"success\") showToast({ message, type: \"success\" });\n\t\t\tif (type === \"danger\") showToast({ message, type: \"danger\" });\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tbadResponses.includes(name) &&\n\t\t\t\t!badResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"danger\" });\n\t\t\t}\n\n\t\t\tif (\n\t\t\t\tname &&\n\t\t\t\tsuccessResponses.includes(name) &&\n\t\t\t\t!successResponses.includes(message)\n\t\t\t) {\n\t\t\t\tshowToast({ message, type: \"success\" });\n\t\t\t}\n\t\t}\n\t}, [closeModal, message, name, type, showToast, closeAll]);\n}\n\nexport { useSearchAutomation };\n","import { useLoadScript } from \"@react-google-maps/api\";\nimport type { ReactNode } from \"react\";\n\nconst libraries: (\"places\" | \"marker\" | \"maps\")[] = [\n\t\"places\",\n\t\"marker\",\n\t\"maps\",\n];\n\ntype PlacesProviderProps = {\n\tapiKey: string;\n\tchildren: (isLoaded: boolean) => ReactNode;\n\tpreventFontsLoading?: boolean;\n};\n\n/**\n * PlacesProvider, loads the Google Maps JS API with `places`, `marker`, and `maps` libraries.\n *\n * Uses a render-prop pattern: `children` receives `isLoaded` so you can defer rendering\n * `SearchPlaces` or `MapView` until the script is ready.\n *\n * @param props.apiKey - Google Maps API key. Required.\n * @param props.children - Render function: `(isLoaded: boolean) => ReactNode`.\n * @param props.preventFontsLoading - Prevents Google Fonts from being injected by the Maps SDK. @default true\n *\n * @returns The result of calling `children(isLoaded)`.\n *\n * @example\n * ```tsx\n * <PlacesProvider apiKey={env.GOOGLE_MAPS_KEY}>\n * {(isLoaded) => (\n * isLoaded\n * ? <SearchPlaces apiKey={env.GOOGLE_MAPS_KEY} onSelect={setAddress} />\n * : <Skeleton />\n * )}\n * </PlacesProvider>\n * ```\n */\n\nfunction PlacesProvider(props: PlacesProviderProps) {\n\tconst { apiKey, children, preventFontsLoading = true } = props;\n\n\tconst { isLoaded } = useLoadScript({\n\t\tgoogleMapsApiKey: apiKey,\n\t\tlibraries,\n\t\tpreventGoogleFontsLoading: preventFontsLoading,\n\t});\n\n\treturn <>{children(isLoaded)}</>;\n}\n\nexport { PlacesProvider };\n","import { Element, Text } from \"slate\";\nimport type { ParseElement } from \"../types/richTextTypes\";\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction serialize(node: any): string {\n\tif (Text.isText(node)) {\n\t\tlet text = node?.text;\n\t\tif (node?.bold) {\n\t\t\ttext = `<strong>${text}</strong>`;\n\t\t}\n\t\tif (node?.code) {\n\t\t\ttext = `<code>${text}</code>`;\n\t\t}\n\t\tif (node?.italic) {\n\t\t\ttext = `<em>${text}</em>`;\n\t\t}\n\t\tif (node?.underline) {\n\t\t\ttext = `<u>${text}</u>`;\n\t\t}\n\t\tif (node?.link) {\n\t\t\ttext = `<a href=\"${node.href}\">${text}</a>`;\n\t\t}\n\t\treturn text;\n\t}\n\n\tif (Element.isElement(node)) {\n\t\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\t\tconst children = node.children?.map((n: any) => serialize(n)).join(\"\");\n\t\tconst alignStyle = node.align || \"left\";\n\n\t\tswitch (node.type) {\n\t\t\tcase \"video\":\n\t\t\t\treturn `<iframe src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"image\":\n\t\t\t\treturn `<img src=\"${node.src}\" class=\"align_${alignStyle}\" />`;\n\t\t\tcase \"paragraph\":\n\t\t\t\treturn `<p class=\"align_${alignStyle}\">${children}</p>`;\n\t\t\tcase \"blockQuote\":\n\t\t\t\treturn `<blockquote class=\"align_${alignStyle}\">${children}</blockquote>`;\n\t\t\tcase \"bulletedList\":\n\t\t\t\treturn `<ul class=\"align_${alignStyle}\">${children}</ul>`;\n\t\t\tcase \"headingOne\":\n\t\t\t\treturn `<h1 class=\"align_${alignStyle}\">${children}</h1>`;\n\t\t\tcase \"headingTwo\":\n\t\t\t\treturn `<h2 class=\"align_${alignStyle}\">${children}</h2>`;\n\t\t\tcase \"listItem\":\n\t\t\t\treturn `<li class=\"align_${alignStyle}\">${children}</li>`;\n\t\t\tcase \"numberedList\":\n\t\t\t\treturn `<ol class=\"align_${alignStyle}\">${children}</ol>`;\n\t\t\tdefault:\n\t\t\t\treturn \"\";\n\t\t}\n\t}\n\n\treturn \"\";\n}\n\n// biome-ignore lint/suspicious/noExplicitAny: intentional\nfunction deserialize(el: ParseElement): any {\n\tif (typeof el === \"string\") {\n\t\treturn { text: el };\n\t}\n\n\tconst rawChildren = el.props.children;\n\n\t// biome-ignore lint/suspicious/noExplicitAny: intentional\n\tlet children: any[];\n\tif (Array.isArray(rawChildren)) {\n\t\tchildren = rawChildren.map((child) => deserialize(child));\n\t} else if (typeof rawChildren === \"string\" || !rawChildren) {\n\t\tchildren = [{ text: rawChildren || \"\" }];\n\t} else {\n\t\tchildren = [deserialize(rawChildren)];\n\t}\n\n\tconst align = el.props.className?.replace(\"align_\", \"\") as\n\t\t| \"left\"\n\t\t| \"center\"\n\t\t| \"right\"\n\t\t| \"justify\";\n\n\tswitch (el.type) {\n\t\tcase \"img\":\n\t\t\treturn {\n\t\t\t\ttype: \"image\",\n\t\t\t\talign,\n\t\t\t\tsrc: el.props.src,\n\t\t\t\tchildren: [{ text: \"\" }],\n\t\t\t};\n\t\tcase \"p\":\n\t\t\treturn { type: \"paragraph\", align, children };\n\t\tcase \"blockquote\":\n\t\t\treturn { type: \"blockQuote\", align, children };\n\t\tcase \"ul\":\n\t\t\treturn { type: \"bulletedList\", align, children };\n\t\tcase \"ol\":\n\t\t\treturn { type: \"numberedList\", align, children };\n\t\tcase \"li\":\n\t\t\treturn { type: \"listItem\", align, children };\n\t\tcase \"h1\":\n\t\t\treturn { type: \"headingOne\", align, children };\n\t\tcase \"h2\":\n\t\t\treturn { type: \"headingTwo\", align, children };\n\t\tcase \"strong\":\n\t\t\treturn { text: el.props.children, bold: true };\n\t\tcase \"code\":\n\t\t\treturn { text: el.props.children, code: true };\n\t\tcase \"em\":\n\t\t\treturn { text: el.props.children, italic: true };\n\t\tcase \"u\":\n\t\t\treturn { text: el.props.children, underline: true };\n\t\tcase \"a\":\n\t\t\treturn { text: el.props.children, link: true, href: el.props.href };\n\t\tdefault:\n\t\t\treturn { text: el.props.children || \"\" };\n\t}\n}\n\nexport { deserialize, serialize };\n","import type { RichTextValue } from \"../types/richTextTypes\";\nimport { serialize } from \"../utils/richTextUtilities\";\n\n/**\n * toHtml, converts a `RichTextValue` (Slate.js Descendant array) to an HTML string.\n *\n * Use this to persist or display the editor's content as plain HTML.\n *\n * @param richTextValue - The value from a `RichText` component's `onChange` callback.\n * @returns HTML string representation of the rich text content.\n *\n * @example\n * ```tsx\n * const [content, setContent] = useState<RichTextValue>([]);\n *\n * // On form submit, convert to HTML for storage\n * const html = toHtml(content);\n * // e.g. \"<p><strong>Hello world</strong></p>\"\n * ```\n */\n\nfunction toHtml(richTextValue: RichTextValue): string {\n\treturn richTextValue.map((node) => serialize(node)).join(\"\");\n}\n\nexport { toHtml };\n","import parse from \"html-react-parser\";\n\nimport type { ParseElement, RichTextValue } from \"../types/richTextTypes\";\nimport { deserialize } from \"../utils/richTextUtilities\";\n\n/**\n * toRichTextValue, converts an HTML string to a `RichTextValue` (Slate.js Descendant array).\n *\n * Use this to populate a `RichText` editor with content previously stored as HTML\n * (e.g. loaded from a database).\n *\n * @param html - HTML string to convert.\n * @returns Slate.js Descendant array ready to pass to `RichText`'s `defaultValue` prop.\n *\n * @example\n * ```tsx\n * // Load stored HTML into the editor\n * const defaultValue = toRichTextValue(product.description);\n * // e.g. [{ type: 'paragraph', children: [{ text: 'Hello', bold: true }] }]\n *\n * <RichText name=\"description\" defaultValue={defaultValue} />\n * ```\n */\n\nfunction toRichTextValue(html: string): RichTextValue {\n\tconst parsed = parse(html);\n\n\tif (Array.isArray(parsed)) {\n\t\treturn parsed.map((node) => {\n\t\t\tif (typeof node === \"string\") return { text: node };\n\t\t\treturn deserialize(node as ParseElement);\n\t\t});\n\t}\n\n\tif (typeof parsed === \"string\") return [{ text: parsed }];\n\treturn [deserialize(parsed as ParseElement)];\n}\n\nexport { toRichTextValue };\n"],"mappings":";;;;;;;;;;;;;;;;;AAwBA,SAAS,GAAW,GAAqC;CACxD,IAAM,EAAE,WAAW,GAAe,GAAG,MAAS;CAG9C,OAAO,kBAAC,OAAD;EAAK,WAAW,mBAFc,IAEJ,KAAK;EAAG,GAAI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