realtimex-crm 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"DealList-SBRy_lx8.js","sources":["../../node_modules/ra-core/dist/controller/input/useReferenceArrayInputController.js","../../node_modules/lucide-react/dist/esm/icons/archive-restore.js","../../node_modules/lucide-react/dist/esm/icons/archive.js","../../src/components/admin/autocomplete-array-input.tsx","../../src/components/admin/reference-array-input.tsx","../../src/components/admin/number-input.tsx","../../node_modules/redux/dist/redux.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js","../../node_modules/use-sync-external-store/with-selector.js","../../node_modules/react-redux/dist/react-redux.mjs","../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../node_modules/css-box-model/dist/css-box-model.esm.js","../../node_modules/raf-schd/dist/raf-schd.esm.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@hello-pangea/dnd/dist/dnd.esm.js","../../src/components/atomic-crm/deals/DealCard.tsx","../../src/components/atomic-crm/deals/DealArchivedList.tsx","../../src/components/ui/visually-hidden.tsx","../../src/components/atomic-crm/deals/DealInputs.tsx","../../src/components/atomic-crm/deals/DealCreate.tsx","../../src/components/atomic-crm/deals/DealEdit.tsx","../../src/components/atomic-crm/deals/DealEmpty.tsx","../../src/components/atomic-crm/deals/DealColumn.tsx","../../src/components/atomic-crm/deals/stages.ts","../../src/components/atomic-crm/deals/DealListContent.tsx","../../src/components/atomic-crm/deals/ContactList.tsx","../../src/components/atomic-crm/deals/DealShow.tsx","../../src/components/atomic-crm/deals/OnlyMineInput.tsx","../../src/components/atomic-crm/deals/DealList.tsx"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { useCallback, useMemo } from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\nimport { useGetList, useGetManyAggregate } from \"../../dataProvider/index.js\";\nimport { useReferenceParams } from \"./useReferenceParams.js\";\nimport { useWrappedSource } from \"../../core/index.js\";\n/**\n * Prepare data for the ReferenceArrayInput components\n *\n * @example\n *\n * const { allChoices, availableChoices, selectedChoices, error, isFetching, isLoading, isPending } = useReferenceArrayInputController({\n * record: { referenceIds: ['id1', 'id2']};\n * reference: 'reference';\n * resource: 'resource';\n * source: 'referenceIds';\n * });\n *\n * @param {Object} props\n * @param {Object} props.record The current resource record\n * @param {string} props.reference The linked resource name\n * @param {string} props.resource The current resource name\n * @param {string} props.source The key of the linked resource identifier\n *\n * @param {Props} props\n *\n * @return {Object} controllerProps Fetched data and callbacks for the ReferenceArrayInput components\n */\nexport var useReferenceArrayInputController = function (props) {\n var _a;\n var debounce = props.debounce, enableGetChoices = props.enableGetChoices, filter = props.filter, _b = props.page, initialPage = _b === void 0 ? 1 : _b, _c = props.perPage, initialPerPage = _c === void 0 ? 25 : _c, _d = props.sort, initialSort = _d === void 0 ? { field: 'id', order: 'DESC' } : _d, _e = props.queryOptions, queryOptions = _e === void 0 ? {} : _e, reference = props.reference, source = props.source;\n var getValues = useFormContext().getValues;\n var finalSource = useWrappedSource(source);\n // When we change the defaultValue of the child input using react-hook-form resetField function,\n // useWatch does not seem to get the new value. We fallback to getValues to get it.\n var value = (_a = useWatch({ name: finalSource })) !== null && _a !== void 0 ? _a : getValues(finalSource);\n var meta = queryOptions.meta, otherQueryOptions = __rest(queryOptions, [\"meta\"]);\n /**\n * Get the records related to the current value (with getMany)\n */\n var _f = useGetManyAggregate(reference, {\n ids: value || EmptyArray,\n meta: meta,\n }, {\n enabled: value != null && value.length > 0,\n }), referenceRecords = _f.data, errorGetMany = _f.error, isLoadingGetMany = _f.isLoading, isFetchingGetMany = _f.isFetching, isPausedGetMany = _f.isPaused, isPendingGetMany = _f.isPending, isPlaceholderDataGetMany = _f.isPlaceholderData, refetchGetMany = _f.refetch;\n var _g = useReferenceParams({\n resource: reference,\n page: initialPage,\n perPage: initialPerPage,\n sort: initialSort,\n debounce: debounce,\n filter: filter,\n }), params = _g[0], paramsModifiers = _g[1];\n // filter out not found references - happens when the dataProvider doesn't guarantee referential integrity\n var finalReferenceRecords = referenceRecords\n ? referenceRecords.filter(Boolean)\n : [];\n var isGetMatchingEnabled = enableGetChoices\n ? enableGetChoices(params.filterValues)\n : true;\n var _h = useGetList(reference, {\n pagination: {\n page: params.page,\n perPage: params.perPage,\n },\n sort: { field: params.sort, order: params.order },\n filter: __assign(__assign({}, params.filter), filter),\n meta: meta,\n }, __assign({ retry: false, enabled: isGetMatchingEnabled, placeholderData: function (previousData) { return previousData; } }, otherQueryOptions)), matchingReferences = _h.data, total = _h.total, pageInfo = _h.pageInfo, errorGetList = _h.error, isLoadingGetList = _h.isLoading, isFetchingGetList = _h.isFetching, isPausedGetList = _h.isPaused, isPendingGetList = _h.isPending, isPlaceholderDataGetList = _h.isPlaceholderData, refetchGetMatching = _h.refetch;\n // We merge the currently selected records with the matching ones, otherwise\n // the component displaying the currently selected records may fail\n var finalMatchingReferences = matchingReferences && matchingReferences.length > 0\n ? mergeReferences(matchingReferences, finalReferenceRecords)\n : finalReferenceRecords.length > 0\n ? finalReferenceRecords\n : matchingReferences;\n var refetch = useCallback(function () {\n refetchGetMany();\n refetchGetMatching();\n }, [refetchGetMany, refetchGetMatching]);\n var currentSort = useMemo(function () { return ({\n field: params.sort,\n order: params.order,\n }); }, [params.sort, params.order]);\n return {\n sort: currentSort,\n allChoices: finalMatchingReferences,\n availableChoices: matchingReferences,\n selectedChoices: finalReferenceRecords,\n displayedFilters: params.displayedFilters,\n error: errorGetMany || errorGetList,\n filter: filter,\n filterValues: params.filterValues,\n hideFilter: paramsModifiers.hideFilter,\n isFetching: isFetchingGetMany || isFetchingGetList,\n isLoading: isLoadingGetMany || isLoadingGetList,\n isPaused: isPausedGetMany || isPausedGetList,\n isPending: isPendingGetMany || isPendingGetList,\n isPlaceholderData: isPlaceholderDataGetMany || isPlaceholderDataGetList,\n page: params.page,\n perPage: params.perPage,\n refetch: refetch,\n resource: reference,\n setFilters: paramsModifiers.setFilters,\n setPage: paramsModifiers.setPage,\n setPerPage: paramsModifiers.setPerPage,\n setSort: paramsModifiers.setSort,\n showFilter: paramsModifiers.showFilter,\n // we return source and not finalSource because child inputs (e.g. AutocompleteArrayInput) already call useInput and compute the final source\n source: source,\n total: total,\n hasNextPage: pageInfo\n ? pageInfo.hasNextPage\n : total != null\n ? params.page * params.perPage < total\n : undefined,\n hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1,\n isFromReference: true,\n };\n};\nvar EmptyArray = [];\n// concatenate and deduplicate two lists of records\nvar mergeReferences = function (ref1, ref2) {\n var res = __spreadArray([], ref1, true);\n var ids = ref1.map(function (ref) { return ref.id; });\n ref2.forEach(function (ref) {\n if (!ids.includes(ref.id)) {\n ids.push(ref.id);\n res.push(ref);\n }\n });\n return res;\n};\n//# sourceMappingURL=useReferenceArrayInputController.js.map","/**\n * @license lucide-react v0.542.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"5\", x: \"2\", y: \"3\", rx: \"1\", key: \"1wp1u1\" }],\n [\"path\", { d: \"M4 8v11a2 2 0 0 0 2 2h2\", key: \"tvwodi\" }],\n [\"path\", { d: \"M20 8v11a2 2 0 0 1-2 2h-2\", key: \"1gkqxj\" }],\n [\"path\", { d: \"m9 15 3-3 3 3\", key: \"1pd0qc\" }],\n [\"path\", { d: \"M12 12v9\", key: \"192myk\" }]\n];\nconst ArchiveRestore = createLucideIcon(\"archive-restore\", __iconNode);\n\nexport { __iconNode, ArchiveRestore as default };\n//# sourceMappingURL=archive-restore.js.map\n","/**\n * @license lucide-react v0.542.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"5\", x: \"2\", y: \"3\", rx: \"1\", key: \"1wp1u1\" }],\n [\"path\", { d: \"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\", key: \"1s80jp\" }],\n [\"path\", { d: \"M10 12h4\", key: \"a56b0p\" }]\n];\nconst Archive = createLucideIcon(\"archive\", __iconNode);\n\nexport { __iconNode, Archive as default };\n//# sourceMappingURL=archive.js.map\n","import * as React from \"react\";\nimport { X } from \"lucide-react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n Command,\n CommandGroup,\n CommandItem,\n CommandList,\n} from \"@/components/ui/command\";\nimport {\n FormControl,\n FormError,\n FormField,\n FormLabel,\n} from \"@/components/admin/form\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport type { ChoicesProps, InputProps } from \"ra-core\";\nimport {\n useChoices,\n useChoicesContext,\n useGetRecordRepresentation,\n useInput,\n useTranslate,\n FieldTitle,\n useEvent,\n} from \"ra-core\";\nimport { InputHelperText } from \"./input-helper-text\";\nimport { useCallback } from \"react\";\n\n/**\n * Form control that lets users choose multiple values from a list using a dropdown with autocompletion.\n *\n * This input allows editing array values with a searchable dropdown interface and displays selected items as removable badges.\n * Works seamlessly inside ReferenceArrayInput for editing many-to-many relationships.\n *\n * @see {@link https://marmelab.com/shadcn-admin-kit/docs/autocompletearrayinput/ AutocompleteArrayInput documentation}\n *\n * @example\n * import {\n * Create,\n * SimpleForm,\n * AutocompleteArrayInput,\n * ReferenceArrayInput,\n * } from '@/components/admin';\n *\n * const PostCreate = () => (\n * <Create>\n * <SimpleForm>\n * <AutocompleteArrayInput\n * source=\"tags\"\n * choices={[\n * { id: 'tech', name: 'Tech' },\n * { id: 'news', name: 'News' },\n * { id: 'lifestyle', name: 'Lifestyle' },\n * ]}\n * />\n * <ReferenceArrayInput source=\"tag_ids\" reference=\"tags\">\n * <AutocompleteArrayInput />\n * </ReferenceArrayInput>\n * </SimpleForm>\n * </Create>\n * );\n */\nexport const AutocompleteArrayInput = (\n props: Omit<InputProps, \"source\"> &\n Partial<Pick<InputProps, \"source\">> &\n ChoicesProps & {\n className?: string;\n disableValue?: string;\n filterToQuery?: (searchText: string) => any;\n translateChoice?: boolean;\n placeholder?: string;\n inputText?:\n | React.ReactNode\n | ((option: any | undefined) => React.ReactNode);\n },\n) => {\n const { filterToQuery = DefaultFilterToQuery, inputText } = props;\n const {\n allChoices = [],\n source,\n resource,\n isFromReference,\n setFilters,\n } = useChoicesContext(props);\n const { id, field, isRequired } = useInput({ ...props, source });\n const translate = useTranslate();\n const { placeholder = translate(\"ra.action.search\", { _: \"Search...\" }) } =\n props;\n\n const getRecordRepresentation = useGetRecordRepresentation(resource);\n const { getChoiceText, getChoiceValue } = useChoices({\n optionText:\n props.optionText ?? (isFromReference ? getRecordRepresentation : \"name\"),\n optionValue: props.optionValue ?? \"id\",\n disableValue: props.disableValue,\n translateChoice: props.translateChoice ?? !isFromReference,\n });\n\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [open, setOpen] = React.useState(false);\n\n const handleUnselect = useEvent((choice: any) => {\n field.onChange(\n field.value.filter((v: any) => v !== getChoiceValue(choice)),\n );\n });\n\n const handleKeyDown = useEvent((e: React.KeyboardEvent<HTMLDivElement>) => {\n const input = inputRef.current;\n if (input) {\n if (e.key === \"Delete\" || e.key === \"Backspace\") {\n if (input.value === \"\") {\n field.onChange(field.value.slice(0, -1));\n }\n }\n // This is not a default behavior of the <input /> field\n if (e.key === \"Escape\") {\n input.blur();\n }\n }\n });\n\n const availableChoices = allChoices.filter(\n (choice) => !field.value.includes(getChoiceValue(choice)),\n );\n const selectedChoices = allChoices.filter((choice) =>\n field.value.includes(getChoiceValue(choice)),\n );\n const [filterValue, setFilterValue] = React.useState(\"\");\n\n const getInputText = useCallback(\n (selectedChoice: any) => {\n if (typeof inputText === \"function\") {\n return inputText(selectedChoice);\n }\n if (inputText !== undefined) {\n return inputText;\n }\n return getChoiceText(selectedChoice);\n },\n [inputText, getChoiceText],\n );\n\n return (\n <FormField className={props.className} id={id} name={field.name}>\n {props.label !== false && (\n <FormLabel>\n <FieldTitle\n label={props.label}\n source={props.source ?? source}\n resource={resource}\n isRequired={isRequired}\n />\n </FormLabel>\n )}\n <FormControl>\n <Command\n onKeyDown={handleKeyDown}\n shouldFilter={!isFromReference}\n className=\"overflow-visible bg-transparent\"\n >\n <div className=\"group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]\">\n <div className=\"flex flex-wrap gap-1\">\n {selectedChoices.map((choice) => (\n <Badge key={getChoiceValue(choice)} variant=\"outline\">\n {getInputText(choice)}\n <button\n className=\"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2\"\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n handleUnselect(choice);\n }\n }}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onClick={(e) => {\n e.preventDefault();\n handleUnselect(choice);\n }}\n >\n <span className=\"sr-only\">\n {translate(\"ra.action.remove\", {\n _: \"Remove\",\n })}\n </span>\n <X className=\"h-3 w-3\" />\n </button>\n </Badge>\n ))}\n {/* Avoid having the \"Search\" Icon by not using CommandInput */}\n <CommandPrimitive.Input\n ref={inputRef}\n value={filterValue}\n onValueChange={(filter) => {\n setFilterValue(filter);\n // We don't want the ChoicesContext to filter the choices if the input\n // is not from a reference as it would also filter out the selected values\n if (isFromReference) {\n setFilters(filterToQuery(filter), undefined, true);\n }\n }}\n onBlur={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n placeholder={placeholder}\n className=\"ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground\"\n />\n </div>\n </div>\n <div className=\"relative\">\n <CommandList>\n {open && availableChoices.length > 0 ? (\n <div className=\"absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in\">\n <CommandGroup className=\"h-full overflow-auto\">\n {availableChoices.map((choice) => {\n return (\n <CommandItem\n key={getChoiceValue(choice)}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onSelect={() => {\n setFilterValue(\"\");\n if (isFromReference) {\n setFilters(filterToQuery(\"\"));\n }\n field.onChange([\n ...field.value,\n getChoiceValue(choice),\n ]);\n }}\n className=\"cursor-pointer\"\n >\n {getChoiceText(choice)}\n </CommandItem>\n );\n })}\n </CommandGroup>\n </div>\n ) : null}\n </CommandList>\n </div>\n </Command>\n </FormControl>\n <InputHelperText helperText={props.helperText} />\n <FormError />\n </FormField>\n );\n};\n\nconst DefaultFilterToQuery = (searchText: string) => ({ q: searchText });\n","import * as React from \"react\";\nimport type { ReactElement } from \"react\";\nimport type { InputProps, UseReferenceArrayInputParams } from \"ra-core\";\nimport {\n useReferenceArrayInputController,\n ResourceContextProvider,\n ChoicesContextProvider,\n} from \"ra-core\";\nimport { AutocompleteArrayInput } from \"@/components/admin/autocomplete-array-input\";\n\n/**\n * Form input for editing arrays of foreign key relationships with autocompletion.\n *\n * This component fetches related records from a reference resource and displays them\n * in a searchable multi-select interface using AutocompleteArrayInput.\n * Use it to edit one-to-many or many-to-many relationships, where the current record\n * has an array of foreign keys to another resource.\n *\n * @see {@link https://marmelab.com/shadcn-admin-kit/docs/referencearrayinput/ ReferenceArrayInput documentation}\n *\n * @example\n * import { Edit, SimpleForm, TextInput, ReferenceArrayInput } from '@/components/admin';\n *\n * const PostEdit = () => (\n * <Edit>\n * <SimpleForm>\n * <TextInput source=\"title\" />\n * <ReferenceArrayInput source=\"tag_ids\" reference=\"tags\" />\n * </SimpleForm>\n * </Edit>\n * );\n */\nexport const ReferenceArrayInput = (props: ReferenceArrayInputProps) => {\n const {\n children = defaultChildren,\n reference,\n sort,\n filter = defaultFilter,\n } = props;\n if (React.Children.count(children) !== 1) {\n throw new Error(\n \"<ReferenceArrayInput> only accepts a single child (like <AutocompleteArrayInput>)\",\n );\n }\n\n const controllerProps = useReferenceArrayInputController({\n ...props,\n sort,\n filter,\n });\n\n return (\n <ResourceContextProvider value={reference}>\n <ChoicesContextProvider value={controllerProps}>\n {children}\n </ChoicesContextProvider>\n </ResourceContextProvider>\n );\n};\n\nconst defaultChildren = <AutocompleteArrayInput />;\nconst defaultFilter = {};\n\nexport interface ReferenceArrayInputProps\n extends InputProps,\n UseReferenceArrayInputParams {\n children?: ReactElement;\n}\n","import * as React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport type { InputProps } from \"ra-core\";\nimport { FieldTitle, useInput, useResourceContext } from \"ra-core\";\nimport { FormControl, FormField, FormLabel } from \"@/components/admin/form\";\nimport { Input } from \"@/components/ui/input\";\nimport { FormError } from \"@/components/admin/form\";\nimport { InputHelperText } from \"@/components/admin/input-helper-text\";\n\n/**\n * Input component for numeric values (integers and floats) with parsing and formatting support.\n *\n * Use `<NumberInput>` for prices, quantities, counts, or any numeric field. Manages a local string\n * state internally so users can type incomplete numbers (e.g. '-' or '0.') before the value is parsed.\n * Supports min/max constraints and step increments.\n *\n * @see {@link https://marmelab.com/shadcn-admin-kit/docs/numberinput/ NumberInput documentation}\n *\n * @example\n * import { Edit, SimpleForm, NumberInput, TextInput } from '@/components/admin';\n *\n * const ProductEdit = () => (\n * <Edit>\n * <SimpleForm>\n * <TextInput source=\"name\" />\n * <NumberInput source=\"price\" step={0.01} min={0} />\n * <NumberInput source=\"quantity\" min={0} />\n * </SimpleForm>\n * </Edit>\n * );\n */\nexport const NumberInput = (props: NumberInputProps) => {\n const {\n label,\n source,\n className,\n resource: resourceProp,\n validate: _validateProp,\n format: _formatProp,\n parse = convertStringToNumber,\n onFocus,\n ...rest\n } = props;\n const resource = useResourceContext({ resource: resourceProp });\n\n const { id, field, isRequired } = useInput(props);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n const numberValue = parse(value);\n\n setValue(value);\n field.onChange(numberValue ?? 0);\n };\n\n const [value, setValue] = useState<string | undefined>(\n field.value?.toString() ?? \"\",\n );\n\n const hasFocus = React.useRef(false);\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(event);\n hasFocus.current = true;\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n field.onBlur?.(event);\n hasFocus.current = false;\n setValue(field.value?.toString() ?? \"\");\n };\n\n useEffect(() => {\n if (!hasFocus.current) {\n setValue(field.value?.toString() ?? \"\");\n }\n }, [field.value]);\n\n return (\n <FormField id={id} className={className} name={field.name}>\n {label !== false && (\n <FormLabel>\n <FieldTitle\n label={label}\n source={source}\n resource={resource}\n isRequired={isRequired}\n />\n </FormLabel>\n )}\n <FormControl>\n <Input\n {...rest}\n {...field}\n type=\"number\"\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </FormControl>\n <InputHelperText helperText={props.helperText} />\n <FormError />\n </FormField>\n );\n};\n\nexport interface NumberInputProps\n extends InputProps,\n Omit<\n React.ComponentProps<\"input\">,\n \"defaultValue\" | \"onBlur\" | \"onChange\" | \"type\"\n > {\n parse?: (value: string) => number;\n}\n\nconst convertStringToNumber = (value?: string | null) => {\n if (value == null || value === \"\") {\n return null;\n }\n const float = parseFloat(value);\n\n return isNaN(float) ? 0 : float;\n};\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","// src/utils/react.ts\nimport * as React from \"react\";\n\n// src/utils/react-is.ts\nvar IS_REACT_19 = /* @__PURE__ */ React.version.startsWith(\"19\");\nvar REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(\n IS_REACT_19 ? \"react.transitional.element\" : \"react.element\"\n);\nvar REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for(\"react.portal\");\nvar REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for(\"react.fragment\");\nvar REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for(\"react.strict_mode\");\nvar REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for(\"react.profiler\");\nvar REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for(\"react.consumer\");\nvar REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for(\"react.context\");\nvar REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for(\"react.forward_ref\");\nvar REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense\");\nvar REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\n \"react.suspense_list\"\n);\nvar REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for(\"react.memo\");\nvar REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for(\"react.lazy\");\nvar REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for(\"react.offscreen\");\nvar REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\n \"react.client.reference\"\n);\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nfunction isValidElementType(type) {\n return typeof type === \"string\" || typeof type === \"function\" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || typeof type === \"object\" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) ? true : false;\n}\nfunction typeOf(object) {\n if (typeof object === \"object\" && object !== null) {\n const { $$typeof } = object;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (object = object.type, object) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return object;\n default:\n switch (object = object && object.$$typeof, object) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object;\n case REACT_CONSUMER_TYPE:\n return object;\n default:\n return $$typeof;\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n}\nfunction isContextConsumer(object) {\n return IS_REACT_19 ? typeOf(object) === REACT_CONSUMER_TYPE : typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/connect/verifySubselectors.ts\nfunction verify(selector, methodName) {\n if (!selector) {\n throw new Error(`Unexpected value for ${methodName} in connect.`);\n } else if (methodName === \"mapStateToProps\" || methodName === \"mapDispatchToProps\") {\n if (!Object.prototype.hasOwnProperty.call(selector, \"dependsOnOwnProps\")) {\n warning(\n `The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`\n );\n }\n }\n}\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {\n verify(mapStateToProps, \"mapStateToProps\");\n verify(mapDispatchToProps, \"mapDispatchToProps\");\n verify(mergeProps, \"mergeProps\");\n}\n\n// src/connect/selectorFactory.ts\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, {\n areStatesEqual,\n areOwnPropsEqual,\n areStatePropsEqual\n}) {\n let hasRunAtLeastOnce = false;\n let state;\n let ownProps;\n let stateProps;\n let dispatchProps;\n let mergedProps;\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps)\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewState() {\n const nextStateProps = mapStateToProps(state, ownProps);\n const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged)\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleSubsequentCalls(nextState, nextOwnProps) {\n const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n const stateChanged = !areStatesEqual(\n nextState,\n state,\n nextOwnProps,\n ownProps\n );\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\nfunction finalPropsSelectorFactory(dispatch, {\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n ...options\n}) {\n const mapStateToProps = initMapStateToProps(dispatch, options);\n const mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n const mergeProps = initMergeProps(dispatch, options);\n if (process.env.NODE_ENV !== \"production\") {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps);\n }\n return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n// src/utils/bindActionCreators.ts\nfunction bindActionCreators(actionCreators, dispatch) {\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));\n }\n }\n return boundActionCreators;\n}\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null) return false;\n const proto = Object.getPrototypeOf(obj);\n if (proto === null) return true;\n let baseProto = proto;\n while (Object.getPrototypeOf(baseProto) !== null) {\n baseProto = Object.getPrototypeOf(baseProto);\n }\n return proto === baseProto;\n}\n\n// src/utils/verifyPlainObject.ts\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(\n `${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`\n );\n }\n}\n\n// src/connect/wrapMapToProps.ts\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch) {\n const constant = getConstant(dispatch);\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, { displayName }) {\n const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);\n };\n proxy.dependsOnOwnProps = true;\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n let props = proxy(stateOrDispatch, ownProps);\n if (typeof props === \"function\") {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(props, displayName, methodName);\n return props;\n };\n return proxy;\n };\n}\n\n// src/connect/invalidArgFactory.ts\nfunction createInvalidArgFactory(arg, name) {\n return (dispatch, options) => {\n throw new Error(\n `Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`\n );\n };\n}\n\n// src/connect/mapDispatchToProps.ts\nfunction mapDispatchToPropsFactory(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === \"object\" ? wrapMapToPropsConstant(\n (dispatch) => (\n // @ts-ignore\n bindActionCreators(mapDispatchToProps, dispatch)\n )\n ) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({\n dispatch\n })) : typeof mapDispatchToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapDispatchToProps, \"mapDispatchToProps\")\n ) : createInvalidArgFactory(mapDispatchToProps, \"mapDispatchToProps\");\n}\n\n// src/connect/mapStateToProps.ts\nfunction mapStateToPropsFactory(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapStateToProps, \"mapStateToProps\")\n ) : createInvalidArgFactory(mapStateToProps, \"mapStateToProps\");\n}\n\n// src/connect/mergeProps.ts\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return { ...ownProps, ...stateProps, ...dispatchProps };\n}\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) {\n let hasRunOnce = false;\n let mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n if (hasRunOnce) {\n if (!areMergedPropsEqual(nextMergedProps, mergedProps))\n mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(mergedProps, displayName, \"mergeProps\");\n }\n return mergedProps;\n };\n };\n}\nfunction mergePropsFactory(mergeProps) {\n return !mergeProps ? () => defaultMergeProps : typeof mergeProps === \"function\" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, \"mergeProps\");\n}\n\n// src/utils/batch.ts\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\n// src/utils/Subscription.ts\nfunction createListenerCollection() {\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n notify() {\n defaultNoopBatch(() => {\n let listener = first;\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get() {\n const listeners = [];\n let listener = first;\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n return listeners;\n },\n subscribe(callback) {\n let isSubscribed = true;\n const listener = last = {\n callback,\n next: null,\n prev: last\n };\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\nvar nullListeners = {\n notify() {\n },\n get: () => []\n};\nfunction createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners;\n let subscriptionsAmount = 0;\n let selfSubscribed = false;\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener);\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n function notifyNestedSubs() {\n listeners.notify();\n }\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n function isSubscribed() {\n return selfSubscribed;\n }\n function trySubscribe() {\n subscriptionsAmount++;\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n function tryUnsubscribe() {\n subscriptionsAmount--;\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = void 0;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}\n\n// src/utils/useIsomorphicLayoutEffect.ts\nvar canUseDOM = () => !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nvar isDOM = /* @__PURE__ */ canUseDOM();\nvar isRunningInReactNative = () => typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nvar isReactNative = /* @__PURE__ */ isRunningInReactNative();\nvar getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React.useLayoutEffect : React.useEffect;\nvar useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();\n\n// src/utils/shallowEqual.ts\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\n// src/utils/hoistStatics.ts\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n $$typeof: true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n $$typeof: true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {\n [ForwardRef]: FORWARD_REF_STATICS,\n [Memo]: MEMO_STATICS\n};\nfunction getStatics(component) {\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n return TYPE_STATICS[component[\"$$typeof\"]] || REACT_STATICS;\n}\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent) {\n if (typeof sourceComponent !== \"string\") {\n if (objectPrototype) {\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent);\n }\n }\n let keys = getOwnPropertyNames(sourceComponent);\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {\n }\n }\n }\n }\n return targetComponent;\n}\n\n// src/components/Context.ts\nvar ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);\nvar gT = typeof globalThis !== \"undefined\" ? globalThis : (\n /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n {}\n);\nfunction getContext() {\n if (!React.createContext) return {};\n const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();\n let realContext = contextMap.get(React.createContext);\n if (!realContext) {\n realContext = React.createContext(\n null\n );\n if (process.env.NODE_ENV !== \"production\") {\n realContext.displayName = \"ReactRedux\";\n }\n contextMap.set(React.createContext, realContext);\n }\n return realContext;\n}\nvar ReactReduxContext = /* @__PURE__ */ getContext();\n\n// src/components/connect.tsx\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\nvar stringifyComponent = (Comp) => {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n}\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n lastWrapperProps.current = wrapperProps;\n renderIsScheduled.current = false;\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) {\n if (!shouldHandleStateChanges) return () => {\n };\n let didUnsubscribe = false;\n let lastThrownError = null;\n const checkForUpdates = () => {\n if (didUnsubscribe || !isMounted.current) {\n return;\n }\n const latestStoreState = store.getState();\n let newChildProps, error;\n try {\n newChildProps = childPropsSelector(\n latestStoreState,\n lastWrapperProps.current\n );\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n if (!error) {\n lastThrownError = null;\n }\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true;\n additionalSubscribeListener();\n }\n };\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n const unsubscribeWrapper = () => {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n if (lastThrownError) {\n throw lastThrownError;\n }\n };\n return unsubscribeWrapper;\n}\nfunction strictEqual(a, b) {\n return a === b;\n}\nvar hasWarnedAboutDeprecatedPureOption = false;\nfunction connect(mapStateToProps, mapDispatchToProps, mergeProps, {\n // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.\n // @ts-ignore\n pure,\n areStatesEqual = strictEqual,\n areOwnPropsEqual = shallowEqual,\n areStatePropsEqual = shallowEqual,\n areMergedPropsEqual = shallowEqual,\n // use React's forwardRef to expose a ref of the wrapped component\n forwardRef = false,\n // the context consumer to use\n context = ReactReduxContext\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) {\n hasWarnedAboutDeprecatedPureOption = true;\n warning(\n 'The `pure` option has been removed. `connect` is now always a \"pure/memoized\" component'\n );\n }\n }\n const Context = context;\n const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n const initMergeProps = mergePropsFactory(mergeProps);\n const shouldHandleStateChanges = Boolean(mapStateToProps);\n const wrapWithConnect = (WrappedComponent) => {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isValidElementType(WrappedComponent);\n if (!isValid)\n throw new Error(\n `You must pass a component to the function returned by connect. Instead received ${stringifyComponent(\n WrappedComponent\n )}`\n );\n }\n const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n const displayName = `Connect(${wrappedComponentName})`;\n const selectorFactoryOptions = {\n shouldHandleStateChanges,\n displayName,\n wrappedComponentName,\n WrappedComponent,\n // @ts-ignore\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n areStatesEqual,\n areStatePropsEqual,\n areOwnPropsEqual,\n areMergedPropsEqual\n };\n function ConnectFunction(props) {\n const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n const { reactReduxForwardedRef: reactReduxForwardedRef2, ...wrapperProps2 } = props;\n return [props.context, reactReduxForwardedRef2, wrapperProps2];\n }, [props]);\n const ContextToUse = React.useMemo(() => {\n let ResultContext = Context;\n if (propsContext?.Consumer) {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isContextConsumer(\n // @ts-ignore\n /* @__PURE__ */ React.createElement(propsContext.Consumer, null)\n );\n if (!isValid) {\n throw new Error(\n \"You must pass a valid React context consumer as `props.context`\"\n );\n }\n ResultContext = propsContext;\n }\n }\n return ResultContext;\n }, [propsContext, Context]);\n const contextValue = React.useContext(ContextToUse);\n const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n if (process.env.NODE_ENV !== \"production\" && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\n `Could not find \"store\" in the context of \"${displayName}\". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${displayName} in connect options.`\n );\n }\n const store = didStoreComeFromProps ? props.store : contextValue.store;\n const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n const childPropsSelector = React.useMemo(() => {\n return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);\n }, [store]);\n const [subscription, notifyNestedSubs] = React.useMemo(() => {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY;\n const subscription2 = createSubscription(\n store,\n didStoreComeFromProps ? void 0 : contextValue.subscription\n );\n const notifyNestedSubs2 = subscription2.notifyNestedSubs.bind(subscription2);\n return [subscription2, notifyNestedSubs2];\n }, [store, didStoreComeFromProps, contextValue]);\n const overriddenContextValue = React.useMemo(() => {\n if (didStoreComeFromProps) {\n return contextValue;\n }\n return {\n ...contextValue,\n subscription\n };\n }, [didStoreComeFromProps, contextValue, subscription]);\n const lastChildProps = React.useRef(void 0);\n const lastWrapperProps = React.useRef(wrapperProps);\n const childPropsFromStoreUpdate = React.useRef(void 0);\n const renderIsScheduled = React.useRef(false);\n const isMounted = React.useRef(false);\n const latestSubscriptionCallbackError = React.useRef(\n void 0\n );\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const actualChildPropsSelector = React.useMemo(() => {\n const selector = () => {\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n }\n return childPropsSelector(store.getState(), wrapperProps);\n };\n return selector;\n }, [store, wrapperProps]);\n const subscribeForReact = React.useMemo(() => {\n const subscribe = (reactListener) => {\n if (!subscription) {\n return () => {\n };\n }\n return subscribeUpdates(\n shouldHandleStateChanges,\n store,\n subscription,\n // @ts-ignore\n childPropsSelector,\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n isMounted,\n childPropsFromStoreUpdate,\n notifyNestedSubs,\n reactListener\n );\n };\n return subscribe;\n }, [subscription]);\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n wrapperProps,\n childPropsFromStoreUpdate,\n notifyNestedSubs\n ]);\n let actualChildProps;\n try {\n actualChildProps = React.useSyncExternalStore(\n // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing\n subscribeForReact,\n // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,\n // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.\n actualChildPropsSelector,\n getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector\n );\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n ;\n err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;\n }\n throw err;\n }\n useIsomorphicLayoutEffect(() => {\n latestSubscriptionCallbackError.current = void 0;\n childPropsFromStoreUpdate.current = void 0;\n lastChildProps.current = actualChildProps;\n });\n const renderedWrappedComponent = React.useMemo(() => {\n return (\n // @ts-ignore\n /* @__PURE__ */ React.createElement(\n WrappedComponent,\n {\n ...actualChildProps,\n ref: reactReduxForwardedRef\n }\n )\n );\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]);\n const renderedChild = React.useMemo(() => {\n if (shouldHandleStateChanges) {\n return /* @__PURE__ */ React.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);\n }\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n }\n const _Connect = React.memo(ConnectFunction);\n const Connect = _Connect;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = ConnectFunction.displayName = displayName;\n if (forwardRef) {\n const _forwarded = React.forwardRef(\n function forwardConnectRef(props, ref) {\n return /* @__PURE__ */ React.createElement(Connect, { ...props, reactReduxForwardedRef: ref });\n }\n );\n const forwarded = _forwarded;\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return /* @__PURE__ */ hoistNonReactStatics(forwarded, WrappedComponent);\n }\n return /* @__PURE__ */ hoistNonReactStatics(Connect, WrappedComponent);\n };\n return wrapWithConnect;\n}\nvar connect_default = connect;\n\n// src/components/Provider.tsx\nfunction Provider(providerProps) {\n const { children, context, serverState, store } = providerProps;\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n const baseContextValue = {\n store,\n subscription,\n getServerState: serverState ? () => serverState : void 0\n };\n if (process.env.NODE_ENV === \"production\") {\n return baseContextValue;\n } else {\n const { identityFunctionCheck = \"once\", stabilityCheck = \"once\" } = providerProps;\n return /* @__PURE__ */ Object.assign(baseContextValue, {\n stabilityCheck,\n identityFunctionCheck\n });\n }\n }, [store, serverState]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const { subscription } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = void 0;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext;\n return /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);\n}\nvar Provider_default = Provider;\n\n// src/hooks/useReduxContext.ts\nfunction createReduxContextHook(context = ReactReduxContext) {\n return function useReduxContext2() {\n const contextValue = React.useContext(context);\n if (process.env.NODE_ENV !== \"production\" && !contextValue) {\n throw new Error(\n \"could not find react-redux context value; please ensure the component is wrapped in a <Provider>\"\n );\n }\n return contextValue;\n };\n}\nvar useReduxContext = /* @__PURE__ */ createReduxContextHook();\n\n// src/hooks/useStore.ts\nfunction createStoreHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (\n // @ts-ignore\n createReduxContextHook(context)\n );\n const useStore2 = () => {\n const { store } = useReduxContext2();\n return store;\n };\n Object.assign(useStore2, {\n withTypes: () => useStore2\n });\n return useStore2;\n}\nvar useStore = /* @__PURE__ */ createStoreHook();\n\n// src/hooks/useDispatch.ts\nfunction createDispatchHook(context = ReactReduxContext) {\n const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);\n const useDispatch2 = () => {\n const store = useStore2();\n return store.dispatch;\n };\n Object.assign(useDispatch2, {\n withTypes: () => useDispatch2\n });\n return useDispatch2;\n}\nvar useDispatch = /* @__PURE__ */ createDispatchHook();\n\n// src/hooks/useSelector.ts\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/with-selector.js\";\nvar refEquality = (a, b) => a === b;\nfunction createSelectorHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n const useSelector2 = (selector, equalityFnOrOptions = {}) => {\n const { equalityFn = refEquality } = typeof equalityFnOrOptions === \"function\" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;\n if (process.env.NODE_ENV !== \"production\") {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n if (typeof selector !== \"function\") {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n if (typeof equalityFn !== \"function\") {\n throw new Error(\n `You must pass a function as an equality function to useSelector`\n );\n }\n }\n const reduxContext = useReduxContext2();\n const { store, subscription, getServerState } = reduxContext;\n const firstRun = React.useRef(true);\n const wrappedSelector = React.useCallback(\n {\n [selector.name](state) {\n const selected = selector(state);\n if (process.env.NODE_ENV !== \"production\") {\n const { devModeChecks = {} } = typeof equalityFnOrOptions === \"function\" ? {} : equalityFnOrOptions;\n const { identityFunctionCheck, stabilityCheck } = reduxContext;\n const {\n identityFunctionCheck: finalIdentityFunctionCheck,\n stabilityCheck: finalStabilityCheck\n } = {\n stabilityCheck,\n identityFunctionCheck,\n ...devModeChecks\n };\n if (finalStabilityCheck === \"always\" || finalStabilityCheck === \"once\" && firstRun.current) {\n const toCompare = selector(state);\n if (!equalityFn(selected, toCompare)) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"Selector \" + (selector.name || \"unknown\") + \" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization\",\n {\n state,\n selected,\n selected2: toCompare,\n stack\n }\n );\n }\n }\n if (finalIdentityFunctionCheck === \"always\" || finalIdentityFunctionCheck === \"once\" && firstRun.current) {\n if (selected === state) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"Selector \" + (selector.name || \"unknown\") + \" returned the root state when called. This can lead to unnecessary rerenders.\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.\",\n { stack }\n );\n }\n }\n if (firstRun.current) firstRun.current = false;\n }\n return selected;\n }\n }[selector.name],\n [selector]\n );\n const selectedState = useSyncExternalStoreWithSelector(\n subscription.addNestedSub,\n store.getState,\n getServerState || store.getState,\n wrappedSelector,\n equalityFn\n );\n React.useDebugValue(selectedState);\n return selectedState;\n };\n Object.assign(useSelector2, {\n withTypes: () => useSelector2\n });\n return useSelector2;\n}\nvar useSelector = /* @__PURE__ */ createSelectorHook();\n\n// src/exports.ts\nvar batch = defaultNoopBatch;\nexport {\n Provider_default as Provider,\n ReactReduxContext,\n batch,\n connect_default as connect,\n createDispatchHook,\n createSelectorHook,\n createStoreHook,\n shallowEqual,\n useDispatch,\n useSelector,\n useStore\n};\n//# sourceMappingURL=react-redux.mjs.map","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import invariant from 'tiny-invariant';\n\nvar getRect = function getRect(_ref) {\n var top = _ref.top,\n right = _ref.right,\n bottom = _ref.bottom,\n left = _ref.left;\n var width = right - left;\n var height = bottom - top;\n var rect = {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: width,\n height: height,\n x: left,\n y: top,\n center: {\n x: (right + left) / 2,\n y: (bottom + top) / 2\n }\n };\n return rect;\n};\nvar expand = function expand(target, expandBy) {\n return {\n top: target.top - expandBy.top,\n left: target.left - expandBy.left,\n bottom: target.bottom + expandBy.bottom,\n right: target.right + expandBy.right\n };\n};\nvar shrink = function shrink(target, shrinkBy) {\n return {\n top: target.top + shrinkBy.top,\n left: target.left + shrinkBy.left,\n bottom: target.bottom - shrinkBy.bottom,\n right: target.right - shrinkBy.right\n };\n};\n\nvar shift = function shift(target, shiftBy) {\n return {\n top: target.top + shiftBy.y,\n left: target.left + shiftBy.x,\n bottom: target.bottom + shiftBy.y,\n right: target.right + shiftBy.x\n };\n};\n\nvar noSpacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n};\nvar createBox = function createBox(_ref2) {\n var borderBox = _ref2.borderBox,\n _ref2$margin = _ref2.margin,\n margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,\n _ref2$border = _ref2.border,\n border = _ref2$border === void 0 ? noSpacing : _ref2$border,\n _ref2$padding = _ref2.padding,\n padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;\n var marginBox = getRect(expand(borderBox, margin));\n var paddingBox = getRect(shrink(borderBox, border));\n var contentBox = getRect(shrink(paddingBox, padding));\n return {\n marginBox: marginBox,\n borderBox: getRect(borderBox),\n paddingBox: paddingBox,\n contentBox: contentBox,\n margin: margin,\n border: border,\n padding: padding\n };\n};\n\nvar parse = function parse(raw) {\n var value = raw.slice(0, -2);\n var suffix = raw.slice(-2);\n\n if (suffix !== 'px') {\n return 0;\n }\n\n var result = Number(value);\n !!isNaN(result) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not parse value [raw: \" + raw + \", without suffix: \" + value + \"]\") : invariant(false) : void 0;\n return result;\n};\n\nvar getWindowScroll = function getWindowScroll() {\n return {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n};\n\nvar offset = function offset(original, change) {\n var borderBox = original.borderBox,\n border = original.border,\n margin = original.margin,\n padding = original.padding;\n var shifted = shift(borderBox, change);\n return createBox({\n borderBox: shifted,\n border: border,\n margin: margin,\n padding: padding\n });\n};\nvar withScroll = function withScroll(original, scroll) {\n if (scroll === void 0) {\n scroll = getWindowScroll();\n }\n\n return offset(original, scroll);\n};\nvar calculateBox = function calculateBox(borderBox, styles) {\n var margin = {\n top: parse(styles.marginTop),\n right: parse(styles.marginRight),\n bottom: parse(styles.marginBottom),\n left: parse(styles.marginLeft)\n };\n var padding = {\n top: parse(styles.paddingTop),\n right: parse(styles.paddingRight),\n bottom: parse(styles.paddingBottom),\n left: parse(styles.paddingLeft)\n };\n var border = {\n top: parse(styles.borderTopWidth),\n right: parse(styles.borderRightWidth),\n bottom: parse(styles.borderBottomWidth),\n left: parse(styles.borderLeftWidth)\n };\n return createBox({\n borderBox: borderBox,\n margin: margin,\n padding: padding,\n border: border\n });\n};\nvar getBox = function getBox(el) {\n var borderBox = el.getBoundingClientRect();\n var styles = window.getComputedStyle(el);\n return calculateBox(borderBox, styles);\n};\n\nexport { calculateBox, createBox, expand, getBox, getRect, offset, shrink, withScroll };\n","var rafSchd = function rafSchd(fn) {\n var lastArgs = [];\n var frameId = null;\n\n var wrapperFn = function wrapperFn() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n lastArgs = args;\n\n if (frameId) {\n return;\n }\n\n frameId = requestAnimationFrame(function () {\n frameId = null;\n fn.apply(void 0, lastArgs);\n });\n };\n\n wrapperFn.cancel = function () {\n if (!frameId) {\n return;\n }\n\n cancelAnimationFrame(frameId);\n frameId = null;\n };\n\n return wrapperFn;\n};\n\nexport default rafSchd;\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import React, { useState, useRef, useEffect, useLayoutEffect, useContext } from 'react';\nimport ReactDOM, { flushSync } from 'react-dom';\nimport { createStore as createStore$1, compose, applyMiddleware, bindActionCreators } from 'redux';\nimport { Provider, connect } from 'react-redux';\nimport { getRect, expand, offset, withScroll, calculateBox, getBox, createBox } from 'css-box-model';\nimport rafSchd from 'raf-schd';\nimport _extends from '@babel/runtime/helpers/esm/extends';\n\nconst isProduction$1 = process.env.NODE_ENV === 'production';\nconst spacesAndTabs = /[ \\t]{2,}/g;\nconst lineStartWithSpaces = /^[ \\t]*/gm;\nconst clean$2 = value => value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\nconst getDevMessage = message => clean$2(`\n %c@hello-pangea/dnd\n\n %c${clean$2(message)}\n\n %c👷‍ This is a development only message. It will be removed in production builds.\n`);\nconst getFormattedMessage = message => [getDevMessage(message), 'color: #00C584; font-size: 1.2em; font-weight: bold;', 'line-height: 1.5', 'color: #723874;'];\nconst isDisabledFlag = '__@hello-pangea/dnd-disable-dev-warnings';\nfunction log(type, message) {\n if (isProduction$1) {\n return;\n }\n if (typeof window !== 'undefined' && window[isDisabledFlag]) {\n return;\n }\n console[type](...getFormattedMessage(message));\n}\nconst warning = log.bind(null, 'warn');\nconst error = log.bind(null, 'error');\n\nfunction noop$2() {}\n\nfunction getOptions(shared, fromBinding) {\n return {\n ...shared,\n ...fromBinding\n };\n}\nfunction bindEvents(el, bindings, sharedOptions) {\n const unbindings = bindings.map(binding => {\n const options = getOptions(sharedOptions, binding.options);\n el.addEventListener(binding.eventName, binding.fn, options);\n return function unbind() {\n el.removeEventListener(binding.eventName, binding.fn, options);\n };\n });\n return function unbindAll() {\n unbindings.forEach(unbind => {\n unbind();\n });\n };\n}\n\nconst isProduction = process.env.NODE_ENV === 'production';\nconst prefix$1 = 'Invariant failed';\nclass RbdInvariant extends Error {}\nRbdInvariant.prototype.toString = function toString() {\n return this.message;\n};\nfunction invariant(condition, message) {\n if (isProduction) {\n throw new RbdInvariant(prefix$1);\n } else {\n throw new RbdInvariant(`${prefix$1}: ${message || ''}`);\n }\n}\n\nclass ErrorBoundary extends React.Component {\n constructor(...args) {\n super(...args);\n this.callbacks = null;\n this.unbind = noop$2;\n this.onWindowError = event => {\n const callbacks = this.getCallbacks();\n if (callbacks.isDragging()) {\n callbacks.tryAbort();\n process.env.NODE_ENV !== \"production\" ? warning(`\n An error was caught by our window 'error' event listener while a drag was occurring.\n The active drag has been aborted.\n `) : void 0;\n }\n const err = event.error;\n if (err instanceof RbdInvariant) {\n event.preventDefault();\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n }\n };\n this.getCallbacks = () => {\n if (!this.callbacks) {\n throw new Error('Unable to find AppCallbacks in <ErrorBoundary/>');\n }\n return this.callbacks;\n };\n this.setCallbacks = callbacks => {\n this.callbacks = callbacks;\n };\n }\n componentDidMount() {\n this.unbind = bindEvents(window, [{\n eventName: 'error',\n fn: this.onWindowError\n }]);\n }\n componentDidCatch(err) {\n if (err instanceof RbdInvariant) {\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n this.setState({});\n return;\n }\n throw err;\n }\n componentWillUnmount() {\n this.unbind();\n }\n render() {\n return this.props.children(this.setCallbacks);\n }\n}\n\nconst dragHandleUsageInstructions = `\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n`;\nconst position = index => index + 1;\nconst onDragStart = start => `\n You have lifted an item in position ${position(start.source.index)}\n`;\nconst withLocation = (source, destination) => {\n const isInHomeList = source.droppableId === destination.droppableId;\n const startPosition = position(source.index);\n const endPosition = position(destination.index);\n if (isInHomeList) {\n return `\n You have moved the item from position ${startPosition}\n to position ${endPosition}\n `;\n }\n return `\n You have moved the item from position ${startPosition}\n in list ${source.droppableId}\n to list ${destination.droppableId}\n in position ${endPosition}\n `;\n};\nconst withCombine = (id, source, combine) => {\n const inHomeList = source.droppableId === combine.droppableId;\n if (inHomeList) {\n return `\n The item ${id}\n has been combined with ${combine.draggableId}`;\n }\n return `\n The item ${id}\n in list ${source.droppableId}\n has been combined with ${combine.draggableId}\n in list ${combine.droppableId}\n `;\n};\nconst onDragUpdate = update => {\n const location = update.destination;\n if (location) {\n return withLocation(update.source, location);\n }\n const combine = update.combine;\n if (combine) {\n return withCombine(update.draggableId, update.source, combine);\n }\n return 'You are over an area that cannot be dropped on';\n};\nconst returnedToStart = source => `\n The item has returned to its starting position\n of ${position(source.index)}\n`;\nconst onDragEnd = result => {\n if (result.reason === 'CANCEL') {\n return `\n Movement cancelled.\n ${returnedToStart(result.source)}\n `;\n }\n const location = result.destination;\n const combine = result.combine;\n if (location) {\n return `\n You have dropped the item.\n ${withLocation(result.source, location)}\n `;\n }\n if (combine) {\n return `\n You have dropped the item.\n ${withCombine(result.draggableId, result.source, combine)}\n `;\n }\n return `\n The item has been dropped while not over a drop area.\n ${returnedToStart(result.source)}\n `;\n};\nconst preset = {\n dragHandleUsageInstructions,\n onDragStart,\n onDragUpdate,\n onDragEnd\n};\n\nfunction isEqual$2(first, second) {\n if (first === second) {\n return true;\n }\n if (Number.isNaN(first) && Number.isNaN(second)) {\n return true;\n }\n return false;\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (let i = 0; i < newInputs.length; i++) {\n if (!isEqual$2(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction useMemo(getResult, inputs) {\n const initial = useState(() => ({\n inputs,\n result: getResult()\n }))[0];\n const isFirstRun = useRef(true);\n const committed = useRef(initial);\n const useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));\n const cache = useCache ? committed.current : {\n inputs,\n result: getResult()\n };\n useEffect(() => {\n isFirstRun.current = false;\n committed.current = cache;\n }, [cache]);\n return cache.result;\n}\nfunction useCallback(callback, inputs) {\n return useMemo(() => callback, inputs);\n}\n\nconst origin = {\n x: 0,\n y: 0\n};\nconst add = (point1, point2) => ({\n x: point1.x + point2.x,\n y: point1.y + point2.y\n});\nconst subtract = (point1, point2) => ({\n x: point1.x - point2.x,\n y: point1.y - point2.y\n});\nconst isEqual$1 = (point1, point2) => point1.x === point2.x && point1.y === point2.y;\nconst negate = point => ({\n x: point.x !== 0 ? -point.x : 0,\n y: point.y !== 0 ? -point.y : 0\n});\nconst patch = (line, value, otherValue = 0) => {\n if (line === 'x') {\n return {\n x: value,\n y: otherValue\n };\n }\n return {\n x: otherValue,\n y: value\n };\n};\nconst distance = (point1, point2) => Math.sqrt((point2.x - point1.x) ** 2 + (point2.y - point1.y) ** 2);\nconst closest$1 = (target, points) => Math.min(...points.map(point => distance(target, point)));\nconst apply = fn => point => ({\n x: fn(point.x),\n y: fn(point.y)\n});\n\nvar executeClip = (frame, subject) => {\n const result = getRect({\n top: Math.max(subject.top, frame.top),\n right: Math.min(subject.right, frame.right),\n bottom: Math.min(subject.bottom, frame.bottom),\n left: Math.max(subject.left, frame.left)\n });\n if (result.width <= 0 || result.height <= 0) {\n return null;\n }\n return result;\n};\n\nconst offsetByPosition = (spacing, point) => ({\n top: spacing.top + point.y,\n left: spacing.left + point.x,\n bottom: spacing.bottom + point.y,\n right: spacing.right + point.x\n});\nconst getCorners = spacing => [{\n x: spacing.left,\n y: spacing.top\n}, {\n x: spacing.right,\n y: spacing.top\n}, {\n x: spacing.left,\n y: spacing.bottom\n}, {\n x: spacing.right,\n y: spacing.bottom\n}];\nconst noSpacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n};\n\nconst scroll$1 = (target, frame) => {\n if (!frame) {\n return target;\n }\n return offsetByPosition(target, frame.scroll.diff.displacement);\n};\nconst increase = (target, axis, withPlaceholder) => {\n if (withPlaceholder && withPlaceholder.increasedBy) {\n return {\n ...target,\n [axis.end]: target[axis.end] + withPlaceholder.increasedBy[axis.line]\n };\n }\n return target;\n};\nconst clip = (target, frame) => {\n if (frame && frame.shouldClipSubject) {\n return executeClip(frame.pageMarginBox, target);\n }\n return getRect(target);\n};\nvar getSubject = ({\n page,\n withPlaceholder,\n axis,\n frame\n}) => {\n const scrolled = scroll$1(page.marginBox, frame);\n const increased = increase(scrolled, axis, withPlaceholder);\n const clipped = clip(increased, frame);\n return {\n page,\n withPlaceholder,\n active: clipped\n };\n};\n\nvar scrollDroppable = (droppable, newScroll) => {\n !droppable.frame ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const scrollable = droppable.frame;\n const scrollDiff = subtract(newScroll, scrollable.scroll.initial);\n const scrollDisplacement = negate(scrollDiff);\n const frame = {\n ...scrollable,\n scroll: {\n initial: scrollable.scroll.initial,\n current: newScroll,\n diff: {\n value: scrollDiff,\n displacement: scrollDisplacement\n },\n max: scrollable.scroll.max\n }\n };\n const subject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: droppable.subject.withPlaceholder,\n axis: droppable.axis,\n frame\n });\n const result = {\n ...droppable,\n frame,\n subject\n };\n return result;\n};\n\nfunction memoizeOne(resultFn, isEqual = areInputsEqual) {\n let cache = null;\n function memoized(...newArgs) {\n if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {\n return cache.lastResult;\n }\n const lastResult = resultFn.apply(this, newArgs);\n cache = {\n lastResult,\n lastArgs: newArgs,\n lastThis: this\n };\n return lastResult;\n }\n memoized.clear = function clear() {\n cache = null;\n };\n return memoized;\n}\n\nconst toDroppableMap = memoizeOne(droppables => droppables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n}, {}));\nconst toDraggableMap = memoizeOne(draggables => draggables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n}, {}));\nconst toDroppableList = memoizeOne(droppables => Object.values(droppables));\nconst toDraggableList = memoizeOne(draggables => Object.values(draggables));\n\nvar getDraggablesInsideDroppable = memoizeOne((droppableId, draggables) => {\n const result = toDraggableList(draggables).filter(draggable => droppableId === draggable.descriptor.droppableId).sort((a, b) => a.descriptor.index - b.descriptor.index);\n return result;\n});\n\nfunction tryGetDestination(impact) {\n if (impact.at && impact.at.type === 'REORDER') {\n return impact.at.destination;\n }\n return null;\n}\nfunction tryGetCombine(impact) {\n if (impact.at && impact.at.type === 'COMBINE') {\n return impact.at.combine;\n }\n return null;\n}\n\nvar removeDraggableFromList = memoizeOne((remove, list) => list.filter(item => item.descriptor.id !== remove.descriptor.id));\n\nvar moveToNextCombine = ({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact\n}) => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const location = tryGetDestination(previousImpact);\n if (!location) {\n return null;\n }\n function getImpact(target) {\n const at = {\n type: 'COMBINE',\n combine: {\n draggableId: target,\n droppableId: destination.descriptor.id\n }\n };\n return {\n ...previousImpact,\n at\n };\n }\n const all = previousImpact.displaced.all;\n const closestId = all.length ? all[0] : null;\n if (isMovingForward) {\n return closestId ? getImpact(closestId) : null;\n }\n const withoutDraggable = removeDraggableFromList(draggable, insideDestination);\n if (!closestId) {\n if (!withoutDraggable.length) {\n return null;\n }\n const last = withoutDraggable[withoutDraggable.length - 1];\n return getImpact(last.descriptor.id);\n }\n const indexOfClosest = withoutDraggable.findIndex(d => d.descriptor.id === closestId);\n !(indexOfClosest !== -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find displaced item in set') : invariant() : void 0;\n const proposedIndex = indexOfClosest - 1;\n if (proposedIndex < 0) {\n return null;\n }\n const before = withoutDraggable[proposedIndex];\n return getImpact(before.descriptor.id);\n};\n\nvar isHomeOf = (draggable, destination) => draggable.descriptor.droppableId === destination.descriptor.id;\n\nconst noDisplacedBy = {\n point: origin,\n value: 0\n};\nconst emptyGroups = {\n invisible: {},\n visible: {},\n all: []\n};\nconst noImpact = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: null\n};\n\nvar isWithin = (lowerBound, upperBound) => value => lowerBound <= value && value <= upperBound;\n\nvar isPartiallyVisibleThroughFrame = frame => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return subject => {\n const isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);\n if (isContained) {\n return true;\n }\n const isPartiallyVisibleVertically = isWithinVertical(subject.top) || isWithinVertical(subject.bottom);\n const isPartiallyVisibleHorizontally = isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);\n const isPartiallyContained = isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;\n if (isPartiallyContained) {\n return true;\n }\n const isBiggerVertically = subject.top < frame.top && subject.bottom > frame.bottom;\n const isBiggerHorizontally = subject.left < frame.left && subject.right > frame.right;\n const isTargetBiggerThanFrame = isBiggerVertically && isBiggerHorizontally;\n if (isTargetBiggerThanFrame) {\n return true;\n }\n const isTargetBiggerOnOneAxis = isBiggerVertically && isPartiallyVisibleHorizontally || isBiggerHorizontally && isPartiallyVisibleVertically;\n return isTargetBiggerOnOneAxis;\n };\n};\n\nvar isTotallyVisibleThroughFrame = frame => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return subject => {\n const isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);\n return isContained;\n };\n};\n\nconst vertical = {\n direction: 'vertical',\n line: 'y',\n crossAxisLine: 'x',\n start: 'top',\n end: 'bottom',\n size: 'height',\n crossAxisStart: 'left',\n crossAxisEnd: 'right',\n crossAxisSize: 'width'\n};\nconst horizontal = {\n direction: 'horizontal',\n line: 'x',\n crossAxisLine: 'y',\n start: 'left',\n end: 'right',\n size: 'width',\n crossAxisStart: 'top',\n crossAxisEnd: 'bottom',\n crossAxisSize: 'height'\n};\n\nvar isTotallyVisibleThroughFrameOnAxis = axis => frame => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return subject => {\n if (axis === vertical) {\n return isWithinVertical(subject.top) && isWithinVertical(subject.bottom);\n }\n return isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);\n };\n};\n\nconst getDroppableDisplaced = (target, destination) => {\n const displacement = destination.frame ? destination.frame.scroll.diff.displacement : origin;\n return offsetByPosition(target, displacement);\n};\nconst isVisibleInDroppable = (target, destination, isVisibleThroughFrameFn) => {\n if (!destination.subject.active) {\n return false;\n }\n return isVisibleThroughFrameFn(destination.subject.active)(target);\n};\nconst isVisibleInViewport = (target, viewport, isVisibleThroughFrameFn) => isVisibleThroughFrameFn(viewport)(target);\nconst isVisible$1 = ({\n target: toBeDisplaced,\n destination,\n viewport,\n withDroppableDisplacement,\n isVisibleThroughFrameFn\n}) => {\n const displacedTarget = withDroppableDisplacement ? getDroppableDisplaced(toBeDisplaced, destination) : toBeDisplaced;\n return isVisibleInDroppable(displacedTarget, destination, isVisibleThroughFrameFn) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn);\n};\nconst isPartiallyVisible = args => isVisible$1({\n ...args,\n isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame\n});\nconst isTotallyVisible = args => isVisible$1({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrame\n});\nconst isTotallyVisibleOnAxis = args => isVisible$1({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(args.destination.axis)\n});\n\nconst getShouldAnimate = (id, last, forceShouldAnimate) => {\n if (typeof forceShouldAnimate === 'boolean') {\n return forceShouldAnimate;\n }\n if (!last) {\n return true;\n }\n const {\n invisible,\n visible\n } = last;\n if (invisible[id]) {\n return false;\n }\n const previous = visible[id];\n return previous ? previous.shouldAnimate : true;\n};\nfunction getTarget(draggable, displacedBy) {\n const marginBox = draggable.page.marginBox;\n const expandBy = {\n top: displacedBy.point.y,\n right: 0,\n bottom: 0,\n left: displacedBy.point.x\n };\n return getRect(expand(marginBox, expandBy));\n}\nfunction getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy,\n viewport,\n forceShouldAnimate,\n last\n}) {\n return afterDragging.reduce(function process(groups, draggable) {\n const target = getTarget(draggable, displacedBy);\n const id = draggable.descriptor.id;\n groups.all.push(id);\n const isVisible = isPartiallyVisible({\n target,\n destination,\n viewport,\n withDroppableDisplacement: true\n });\n if (!isVisible) {\n groups.invisible[draggable.descriptor.id] = true;\n return groups;\n }\n const shouldAnimate = getShouldAnimate(id, last, forceShouldAnimate);\n const displacement = {\n draggableId: id,\n shouldAnimate\n };\n groups.visible[id] = displacement;\n return groups;\n }, {\n all: [],\n visible: {},\n invisible: {}\n });\n}\n\nfunction getIndexOfLastItem(draggables, options) {\n if (!draggables.length) {\n return 0;\n }\n const indexOfLastItem = draggables[draggables.length - 1].descriptor.index;\n return options.inHomeList ? indexOfLastItem : indexOfLastItem + 1;\n}\nfunction goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination\n}) {\n const newIndex = getIndexOfLastItem(insideDestination, {\n inHomeList\n });\n return {\n displaced: emptyGroups,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: newIndex\n }\n }\n };\n}\nfunction calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n last,\n index,\n forceShouldAnimate\n}) {\n const inHomeList = isHomeOf(draggable, destination);\n if (index == null) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination\n });\n }\n const match = insideDestination.find(item => item.descriptor.index === index);\n if (!match) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination\n });\n }\n const withoutDragging = removeDraggableFromList(draggable, insideDestination);\n const sliceFrom = insideDestination.indexOf(match);\n const impacted = withoutDragging.slice(sliceFrom);\n const displaced = getDisplacementGroups({\n afterDragging: impacted,\n destination,\n displacedBy,\n last,\n viewport: viewport.frame,\n forceShouldAnimate\n });\n return {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index\n }\n }\n };\n}\n\nfunction didStartAfterCritical(draggableId, afterCritical) {\n return Boolean(afterCritical.effected[draggableId]);\n}\n\nvar fromCombine = ({\n isMovingForward,\n destination,\n draggables,\n combine,\n afterCritical\n}) => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const combineId = combine.draggableId;\n const combineWith = draggables[combineId];\n const combineWithIndex = combineWith.descriptor.index;\n const didCombineWithStartAfterCritical = didStartAfterCritical(combineId, afterCritical);\n if (didCombineWithStartAfterCritical) {\n if (isMovingForward) {\n return combineWithIndex;\n }\n return combineWithIndex - 1;\n }\n if (isMovingForward) {\n return combineWithIndex + 1;\n }\n return combineWithIndex;\n};\n\nvar fromReorder = ({\n isMovingForward,\n isInHomeList,\n insideDestination,\n location\n}) => {\n if (!insideDestination.length) {\n return null;\n }\n const currentIndex = location.index;\n const proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;\n const firstIndex = insideDestination[0].descriptor.index;\n const lastIndex = insideDestination[insideDestination.length - 1].descriptor.index;\n const upperBound = isInHomeList ? lastIndex : lastIndex + 1;\n if (proposedIndex < firstIndex) {\n return null;\n }\n if (proposedIndex > upperBound) {\n return null;\n }\n return proposedIndex;\n};\n\nvar moveToNextIndex = ({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical\n}) => {\n const wasAt = previousImpact.at;\n !wasAt ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot move in direction without previous impact location') : invariant() : void 0;\n if (wasAt.type === 'REORDER') {\n const newIndex = fromReorder({\n isMovingForward,\n isInHomeList,\n location: wasAt.destination,\n insideDestination\n });\n if (newIndex == null) {\n return null;\n }\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex\n });\n }\n const newIndex = fromCombine({\n isMovingForward,\n destination,\n displaced: previousImpact.displaced,\n draggables,\n combine: wasAt.combine,\n afterCritical\n });\n if (newIndex == null) {\n return null;\n }\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex\n });\n};\n\nvar getCombinedItemDisplacement = ({\n displaced,\n afterCritical,\n combineWith,\n displacedBy\n}) => {\n const isDisplaced = Boolean(displaced.visible[combineWith] || displaced.invisible[combineWith]);\n if (didStartAfterCritical(combineWith, afterCritical)) {\n return isDisplaced ? origin : negate(displacedBy.point);\n }\n return isDisplaced ? displacedBy.point : origin;\n};\n\nvar whenCombining = ({\n afterCritical,\n impact,\n draggables\n}) => {\n const combine = tryGetCombine(impact);\n !combine ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const combineWith = combine.draggableId;\n const center = draggables[combineWith].page.borderBox.center;\n const displaceBy = getCombinedItemDisplacement({\n displaced: impact.displaced,\n afterCritical,\n combineWith,\n displacedBy: impact.displacedBy\n });\n return add(center, displaceBy);\n};\n\nconst distanceFromStartToBorderBoxCenter = (axis, box) => box.margin[axis.start] + box.borderBox[axis.size] / 2;\nconst distanceFromEndToBorderBoxCenter = (axis, box) => box.margin[axis.end] + box.borderBox[axis.size] / 2;\nconst getCrossAxisBorderBoxCenter = (axis, target, isMoving) => target[axis.crossAxisStart] + isMoving.margin[axis.crossAxisStart] + isMoving.borderBox[axis.crossAxisSize] / 2;\nconst goAfter = ({\n axis,\n moveRelativeTo,\n isMoving\n}) => patch(axis.line, moveRelativeTo.marginBox[axis.end] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));\nconst goBefore = ({\n axis,\n moveRelativeTo,\n isMoving\n}) => patch(axis.line, moveRelativeTo.marginBox[axis.start] - distanceFromEndToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));\nconst goIntoStart = ({\n axis,\n moveInto,\n isMoving\n}) => patch(axis.line, moveInto.contentBox[axis.start] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving));\n\nvar whenReordering = ({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical\n}) => {\n const insideDestination = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);\n const draggablePage = draggable.page;\n const axis = droppable.axis;\n if (!insideDestination.length) {\n return goIntoStart({\n axis,\n moveInto: droppable.page,\n isMoving: draggablePage\n });\n }\n const {\n displaced,\n displacedBy\n } = impact;\n const closestAfter = displaced.all[0];\n if (closestAfter) {\n const closest = draggables[closestAfter];\n if (didStartAfterCritical(closestAfter, afterCritical)) {\n return goBefore({\n axis,\n moveRelativeTo: closest.page,\n isMoving: draggablePage\n });\n }\n const withDisplacement = offset(closest.page, displacedBy.point);\n return goBefore({\n axis,\n moveRelativeTo: withDisplacement,\n isMoving: draggablePage\n });\n }\n const last = insideDestination[insideDestination.length - 1];\n if (last.descriptor.id === draggable.descriptor.id) {\n return draggablePage.borderBox.center;\n }\n if (didStartAfterCritical(last.descriptor.id, afterCritical)) {\n const page = offset(last.page, negate(afterCritical.displacedBy.point));\n return goAfter({\n axis,\n moveRelativeTo: page,\n isMoving: draggablePage\n });\n }\n return goAfter({\n axis,\n moveRelativeTo: last.page,\n isMoving: draggablePage\n });\n};\n\nvar withDroppableDisplacement = (droppable, point) => {\n const frame = droppable.frame;\n if (!frame) {\n return point;\n }\n return add(point, frame.scroll.diff.displacement);\n};\n\nconst getResultWithoutDroppableDisplacement = ({\n impact,\n draggable,\n droppable,\n draggables,\n afterCritical\n}) => {\n const original = draggable.page.borderBox.center;\n const at = impact.at;\n if (!droppable) {\n return original;\n }\n if (!at) {\n return original;\n }\n if (at.type === 'REORDER') {\n return whenReordering({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical\n });\n }\n return whenCombining({\n impact,\n draggables,\n afterCritical\n });\n};\nvar getPageBorderBoxCenterFromImpact = args => {\n const withoutDisplacement = getResultWithoutDroppableDisplacement(args);\n const droppable = args.droppable;\n const withDisplacement = droppable ? withDroppableDisplacement(droppable, withoutDisplacement) : withoutDisplacement;\n return withDisplacement;\n};\n\nvar scrollViewport = (viewport, newScroll) => {\n const diff = subtract(newScroll, viewport.scroll.initial);\n const displacement = negate(diff);\n const frame = getRect({\n top: newScroll.y,\n bottom: newScroll.y + viewport.frame.height,\n left: newScroll.x,\n right: newScroll.x + viewport.frame.width\n });\n const updated = {\n frame,\n scroll: {\n initial: viewport.scroll.initial,\n max: viewport.scroll.max,\n current: newScroll,\n diff: {\n value: diff,\n displacement\n }\n }\n };\n return updated;\n};\n\nfunction getDraggables$1(ids, draggables) {\n return ids.map(id => draggables[id]);\n}\nfunction tryGetVisible(id, groups) {\n for (let i = 0; i < groups.length; i++) {\n const displacement = groups[i].visible[id];\n if (displacement) {\n return displacement;\n }\n }\n return null;\n}\nvar speculativelyIncrease = ({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange\n}) => {\n const scrolledViewport = scrollViewport(viewport, add(viewport.scroll.current, maxScrollChange));\n const scrolledDroppable = destination.frame ? scrollDroppable(destination, add(destination.frame.scroll.current, maxScrollChange)) : destination;\n const last = impact.displaced;\n const withViewportScroll = getDisplacementGroups({\n afterDragging: getDraggables$1(last.all, draggables),\n destination,\n displacedBy: impact.displacedBy,\n viewport: scrolledViewport.frame,\n last,\n forceShouldAnimate: false\n });\n const withDroppableScroll = getDisplacementGroups({\n afterDragging: getDraggables$1(last.all, draggables),\n destination: scrolledDroppable,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n last,\n forceShouldAnimate: false\n });\n const invisible = {};\n const visible = {};\n const groups = [last, withViewportScroll, withDroppableScroll];\n last.all.forEach(id => {\n const displacement = tryGetVisible(id, groups);\n if (displacement) {\n visible[id] = displacement;\n return;\n }\n invisible[id] = true;\n });\n const newImpact = {\n ...impact,\n displaced: {\n all: last.all,\n invisible,\n visible\n }\n };\n return newImpact;\n};\n\nvar withViewportDisplacement = (viewport, point) => add(viewport.scroll.diff.displacement, point);\n\nvar getClientFromPageBorderBoxCenter = ({\n pageBorderBoxCenter,\n draggable,\n viewport\n}) => {\n const withoutPageScrollChange = withViewportDisplacement(viewport, pageBorderBoxCenter);\n const offset = subtract(withoutPageScrollChange, draggable.page.borderBox.center);\n return add(draggable.client.borderBox.center, offset);\n};\n\nvar isTotallyVisibleInNewLocation = ({\n draggable,\n destination,\n newPageBorderBoxCenter,\n viewport,\n withDroppableDisplacement,\n onlyOnMainAxis = false\n}) => {\n const changeNeeded = subtract(newPageBorderBoxCenter, draggable.page.borderBox.center);\n const shifted = offsetByPosition(draggable.page.borderBox, changeNeeded);\n const args = {\n target: shifted,\n destination,\n withDroppableDisplacement,\n viewport\n };\n return onlyOnMainAxis ? isTotallyVisibleOnAxis(args) : isTotallyVisible(args);\n};\n\nvar moveToNextPlace = ({\n isMovingForward,\n draggable,\n destination,\n draggables,\n previousImpact,\n viewport,\n previousPageBorderBoxCenter,\n previousClientSelection,\n afterCritical\n}) => {\n if (!destination.isEnabled) {\n return null;\n }\n const insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);\n const isInHomeList = isHomeOf(draggable, destination);\n const impact = moveToNextCombine({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact\n }) || moveToNextIndex({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical\n });\n if (!impact) {\n return null;\n }\n const pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical\n });\n const isVisibleInNewLocation = isTotallyVisibleInNewLocation({\n draggable,\n destination,\n newPageBorderBoxCenter: pageBorderBoxCenter,\n viewport: viewport.frame,\n withDroppableDisplacement: false,\n onlyOnMainAxis: true\n });\n if (isVisibleInNewLocation) {\n const clientSelection = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport\n });\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null\n };\n }\n const distance = subtract(pageBorderBoxCenter, previousPageBorderBoxCenter);\n const cautious = speculativelyIncrease({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange: distance\n });\n return {\n clientSelection: previousClientSelection,\n impact: cautious,\n scrollJumpRequest: distance\n };\n};\n\nconst getKnownActive = droppable => {\n const rect = droppable.subject.active;\n !rect ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot get clipped area from droppable') : invariant() : void 0;\n return rect;\n};\nvar getBestCrossAxisDroppable = ({\n isMovingForward,\n pageBorderBoxCenter,\n source,\n droppables,\n viewport\n}) => {\n const active = source.subject.active;\n if (!active) {\n return null;\n }\n const axis = source.axis;\n const isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]);\n const candidates = toDroppableList(droppables).filter(droppable => droppable !== source).filter(droppable => droppable.isEnabled).filter(droppable => Boolean(droppable.subject.active)).filter(droppable => isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable))).filter(droppable => {\n const activeOfTarget = getKnownActive(droppable);\n if (isMovingForward) {\n return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd];\n }\n return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart];\n }).filter(droppable => {\n const activeOfTarget = getKnownActive(droppable);\n const isBetweenDestinationClipped = isWithin(activeOfTarget[axis.start], activeOfTarget[axis.end]);\n return isBetweenSourceClipped(activeOfTarget[axis.start]) || isBetweenSourceClipped(activeOfTarget[axis.end]) || isBetweenDestinationClipped(active[axis.start]) || isBetweenDestinationClipped(active[axis.end]);\n }).sort((a, b) => {\n const first = getKnownActive(a)[axis.crossAxisStart];\n const second = getKnownActive(b)[axis.crossAxisStart];\n if (isMovingForward) {\n return first - second;\n }\n return second - first;\n }).filter((droppable, index, array) => getKnownActive(droppable)[axis.crossAxisStart] === getKnownActive(array[0])[axis.crossAxisStart]);\n if (!candidates.length) {\n return null;\n }\n if (candidates.length === 1) {\n return candidates[0];\n }\n const contains = candidates.filter(droppable => {\n const isWithinDroppable = isWithin(getKnownActive(droppable)[axis.start], getKnownActive(droppable)[axis.end]);\n return isWithinDroppable(pageBorderBoxCenter[axis.line]);\n });\n if (contains.length === 1) {\n return contains[0];\n }\n if (contains.length > 1) {\n return contains.sort((a, b) => getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start])[0];\n }\n return candidates.sort((a, b) => {\n const first = closest$1(pageBorderBoxCenter, getCorners(getKnownActive(a)));\n const second = closest$1(pageBorderBoxCenter, getCorners(getKnownActive(b)));\n if (first !== second) {\n return first - second;\n }\n return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];\n })[0];\n};\n\nconst getCurrentPageBorderBoxCenter = (draggable, afterCritical) => {\n const original = draggable.page.borderBox.center;\n return didStartAfterCritical(draggable.descriptor.id, afterCritical) ? subtract(original, afterCritical.displacedBy.point) : original;\n};\nconst getCurrentPageBorderBox = (draggable, afterCritical) => {\n const original = draggable.page.borderBox;\n return didStartAfterCritical(draggable.descriptor.id, afterCritical) ? offsetByPosition(original, negate(afterCritical.displacedBy.point)) : original;\n};\n\nvar getClosestDraggable = ({\n pageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical\n}) => {\n const sorted = insideDestination.filter(draggable => isTotallyVisible({\n target: getCurrentPageBorderBox(draggable, afterCritical),\n destination,\n viewport: viewport.frame,\n withDroppableDisplacement: true\n })).sort((a, b) => {\n const distanceToA = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(a, afterCritical)));\n const distanceToB = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(b, afterCritical)));\n if (distanceToA < distanceToB) {\n return -1;\n }\n if (distanceToB < distanceToA) {\n return 1;\n }\n return a.descriptor.index - b.descriptor.index;\n });\n return sorted[0] || null;\n};\n\nvar getDisplacedBy = memoizeOne(function getDisplacedBy(axis, displaceBy) {\n const displacement = displaceBy[axis.line];\n return {\n value: displacement,\n point: patch(axis.line, displacement)\n };\n});\n\nconst getRequiredGrowthForPlaceholder = (droppable, placeholderSize, draggables) => {\n const axis = droppable.axis;\n if (droppable.descriptor.mode === 'virtual') {\n return patch(axis.line, placeholderSize[axis.line]);\n }\n const availableSpace = droppable.subject.page.contentBox[axis.size];\n const insideDroppable = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);\n const spaceUsed = insideDroppable.reduce((sum, dimension) => sum + dimension.client.marginBox[axis.size], 0);\n const requiredSpace = spaceUsed + placeholderSize[axis.line];\n const needsToGrowBy = requiredSpace - availableSpace;\n if (needsToGrowBy <= 0) {\n return null;\n }\n return patch(axis.line, needsToGrowBy);\n};\nconst withMaxScroll = (frame, max) => ({\n ...frame,\n scroll: {\n ...frame.scroll,\n max\n }\n});\nconst addPlaceholder = (droppable, draggable, draggables) => {\n const frame = droppable.frame;\n !!isHomeOf(draggable, droppable) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Should not add placeholder space to home list') : invariant() : void 0;\n !!droppable.subject.withPlaceholder ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot add placeholder size to a subject when it already has one') : invariant() : void 0;\n const placeholderSize = getDisplacedBy(droppable.axis, draggable.displaceBy).point;\n const requiredGrowth = getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables);\n const added = {\n placeholderSize,\n increasedBy: requiredGrowth,\n oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null\n };\n if (!frame) {\n const subject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: droppable.frame\n });\n return {\n ...droppable,\n subject\n };\n }\n const maxScroll = requiredGrowth ? add(frame.scroll.max, requiredGrowth) : frame.scroll.max;\n const newFrame = withMaxScroll(frame, maxScroll);\n const subject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: newFrame\n });\n return {\n ...droppable,\n subject,\n frame: newFrame\n };\n};\nconst removePlaceholder = droppable => {\n const added = droppable.subject.withPlaceholder;\n !added ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot remove placeholder form subject when there was none') : invariant() : void 0;\n const frame = droppable.frame;\n if (!frame) {\n const subject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: null,\n withPlaceholder: null\n });\n return {\n ...droppable,\n subject\n };\n }\n const oldMaxScroll = added.oldFrameMaxScroll;\n !oldMaxScroll ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected droppable with frame to have old max frame scroll when removing placeholder') : invariant() : void 0;\n const newFrame = withMaxScroll(frame, oldMaxScroll);\n const subject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: newFrame,\n withPlaceholder: null\n });\n return {\n ...droppable,\n subject,\n frame: newFrame\n };\n};\n\nvar moveToNewDroppable = ({\n previousPageBorderBoxCenter,\n moveRelativeTo,\n insideDestination,\n draggable,\n draggables,\n destination,\n viewport,\n afterCritical\n}) => {\n if (!moveRelativeTo) {\n if (insideDestination.length) {\n return null;\n }\n const proposed = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: 0\n }\n }\n };\n const proposedPageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact: proposed,\n draggable,\n droppable: destination,\n draggables,\n afterCritical\n });\n const withPlaceholder = isHomeOf(draggable, destination) ? destination : addPlaceholder(destination, draggable, draggables);\n const isVisibleInNewLocation = isTotallyVisibleInNewLocation({\n draggable,\n destination: withPlaceholder,\n newPageBorderBoxCenter: proposedPageBorderBoxCenter,\n viewport: viewport.frame,\n withDroppableDisplacement: false,\n onlyOnMainAxis: true\n });\n return isVisibleInNewLocation ? proposed : null;\n }\n const isGoingBeforeTarget = Boolean(previousPageBorderBoxCenter[destination.axis.line] <= moveRelativeTo.page.borderBox.center[destination.axis.line]);\n const proposedIndex = (() => {\n const relativeTo = moveRelativeTo.descriptor.index;\n if (moveRelativeTo.descriptor.id === draggable.descriptor.id) {\n return relativeTo;\n }\n if (isGoingBeforeTarget) {\n return relativeTo;\n }\n return relativeTo + 1;\n })();\n const displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n last: emptyGroups,\n index: proposedIndex\n });\n};\n\nvar moveCrossAxis = ({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport,\n afterCritical\n}) => {\n const destination = getBestCrossAxisDroppable({\n isMovingForward,\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n source: isOver,\n droppables,\n viewport\n });\n if (!destination) {\n return null;\n }\n const insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);\n const moveRelativeTo = getClosestDraggable({\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical\n });\n const impact = moveToNewDroppable({\n previousPageBorderBoxCenter,\n destination,\n draggable,\n draggables,\n moveRelativeTo,\n insideDestination,\n viewport,\n afterCritical\n });\n if (!impact) {\n return null;\n }\n const pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical\n });\n const clientSelection = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport\n });\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null\n };\n};\n\nvar whatIsDraggedOver = impact => {\n const at = impact.at;\n if (!at) {\n return null;\n }\n if (at.type === 'REORDER') {\n return at.destination.droppableId;\n }\n return at.combine.droppableId;\n};\n\nconst getDroppableOver$1 = (impact, droppables) => {\n const id = whatIsDraggedOver(impact);\n return id ? droppables[id] : null;\n};\nvar moveInDirection = ({\n state,\n type\n}) => {\n const isActuallyOver = getDroppableOver$1(state.impact, state.dimensions.droppables);\n const isMainAxisMovementAllowed = Boolean(isActuallyOver);\n const home = state.dimensions.droppables[state.critical.droppable.id];\n const isOver = isActuallyOver || home;\n const direction = isOver.axis.direction;\n const isMovingOnMainAxis = direction === 'vertical' && (type === 'MOVE_UP' || type === 'MOVE_DOWN') || direction === 'horizontal' && (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT');\n if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {\n return null;\n }\n const isMovingForward = type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';\n const draggable = state.dimensions.draggables[state.critical.draggable.id];\n const previousPageBorderBoxCenter = state.current.page.borderBoxCenter;\n const {\n draggables,\n droppables\n } = state.dimensions;\n return isMovingOnMainAxis ? moveToNextPlace({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n destination: isOver,\n draggables,\n viewport: state.viewport,\n previousClientSelection: state.current.client.selection,\n previousImpact: state.impact,\n afterCritical: state.afterCritical\n }) : moveCrossAxis({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport: state.viewport,\n afterCritical: state.afterCritical\n });\n};\n\nfunction isMovementAllowed(state) {\n return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';\n}\n\nfunction isPositionInFrame(frame) {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return function run(point) {\n return isWithinVertical(point.y) && isWithinHorizontal(point.x);\n };\n}\n\nfunction getHasOverlap(first, second) {\n return first.left < second.right && first.right > second.left && first.top < second.bottom && first.bottom > second.top;\n}\nfunction getFurthestAway({\n pageBorderBox,\n draggable,\n candidates\n}) {\n const startCenter = draggable.page.borderBox.center;\n const sorted = candidates.map(candidate => {\n const axis = candidate.axis;\n const target = patch(candidate.axis.line, pageBorderBox.center[axis.line], candidate.page.borderBox.center[axis.crossAxisLine]);\n return {\n id: candidate.descriptor.id,\n distance: distance(startCenter, target)\n };\n }).sort((a, b) => b.distance - a.distance);\n return sorted[0] ? sorted[0].id : null;\n}\nfunction getDroppableOver({\n pageBorderBox,\n draggable,\n droppables\n}) {\n const candidates = toDroppableList(droppables).filter(item => {\n if (!item.isEnabled) {\n return false;\n }\n const active = item.subject.active;\n if (!active) {\n return false;\n }\n if (!getHasOverlap(pageBorderBox, active)) {\n return false;\n }\n if (isPositionInFrame(active)(pageBorderBox.center)) {\n return true;\n }\n const axis = item.axis;\n const childCenter = active.center[axis.crossAxisLine];\n const crossAxisStart = pageBorderBox[axis.crossAxisStart];\n const crossAxisEnd = pageBorderBox[axis.crossAxisEnd];\n const isContained = isWithin(active[axis.crossAxisStart], active[axis.crossAxisEnd]);\n const isStartContained = isContained(crossAxisStart);\n const isEndContained = isContained(crossAxisEnd);\n if (!isStartContained && !isEndContained) {\n return true;\n }\n if (isStartContained) {\n return crossAxisStart < childCenter;\n }\n return crossAxisEnd > childCenter;\n });\n if (!candidates.length) {\n return null;\n }\n if (candidates.length === 1) {\n return candidates[0].descriptor.id;\n }\n return getFurthestAway({\n pageBorderBox,\n draggable,\n candidates\n });\n}\n\nconst offsetRectByPosition = (rect, point) => getRect(offsetByPosition(rect, point));\n\nvar withDroppableScroll = (droppable, area) => {\n const frame = droppable.frame;\n if (!frame) {\n return area;\n }\n return offsetRectByPosition(area, frame.scroll.diff.value);\n};\n\nfunction getIsDisplaced({\n displaced,\n id\n}) {\n return Boolean(displaced.visible[id] || displaced.invisible[id]);\n}\n\nfunction atIndex({\n draggable,\n closest,\n inHomeList\n}) {\n if (!closest) {\n return null;\n }\n if (!inHomeList) {\n return closest.descriptor.index;\n }\n if (closest.descriptor.index > draggable.descriptor.index) {\n return closest.descriptor.index - 1;\n }\n return closest.descriptor.index;\n}\nvar getReorderImpact = ({\n pageBorderBoxWithDroppableScroll: targetRect,\n draggable,\n destination,\n insideDestination,\n last,\n viewport,\n afterCritical\n}) => {\n const axis = destination.axis;\n const displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);\n const displacement = displacedBy.value;\n const targetStart = targetRect[axis.start];\n const targetEnd = targetRect[axis.end];\n const withoutDragging = removeDraggableFromList(draggable, insideDestination);\n const closest = withoutDragging.find(child => {\n const id = child.descriptor.id;\n const childCenter = child.page.borderBox.center[axis.line];\n const didStartAfterCritical$1 = didStartAfterCritical(id, afterCritical);\n const isDisplaced = getIsDisplaced({\n displaced: last,\n id\n });\n if (didStartAfterCritical$1) {\n if (isDisplaced) {\n return targetEnd <= childCenter;\n }\n return targetStart < childCenter - displacement;\n }\n if (isDisplaced) {\n return targetEnd <= childCenter + displacement;\n }\n return targetStart < childCenter;\n }) || null;\n const newIndex = atIndex({\n draggable,\n closest,\n inHomeList: isHomeOf(draggable, destination)\n });\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last,\n displacedBy,\n index: newIndex\n });\n};\n\nconst combineThresholdDivisor = 4;\nvar getCombineImpact = ({\n draggable,\n pageBorderBoxWithDroppableScroll: targetRect,\n previousImpact,\n destination,\n insideDestination,\n afterCritical\n}) => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const axis = destination.axis;\n const displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);\n const displacement = displacedBy.value;\n const targetStart = targetRect[axis.start];\n const targetEnd = targetRect[axis.end];\n const withoutDragging = removeDraggableFromList(draggable, insideDestination);\n const combineWith = withoutDragging.find(child => {\n const id = child.descriptor.id;\n const childRect = child.page.borderBox;\n const childSize = childRect[axis.size];\n const threshold = childSize / combineThresholdDivisor;\n const didStartAfterCritical$1 = didStartAfterCritical(id, afterCritical);\n const isDisplaced = getIsDisplaced({\n displaced: previousImpact.displaced,\n id\n });\n if (didStartAfterCritical$1) {\n if (isDisplaced) {\n return targetEnd > childRect[axis.start] + threshold && targetEnd < childRect[axis.end] - threshold;\n }\n return targetStart > childRect[axis.start] - displacement + threshold && targetStart < childRect[axis.end] - displacement - threshold;\n }\n if (isDisplaced) {\n return targetEnd > childRect[axis.start] + displacement + threshold && targetEnd < childRect[axis.end] + displacement - threshold;\n }\n return targetStart > childRect[axis.start] + threshold && targetStart < childRect[axis.end] - threshold;\n });\n if (!combineWith) {\n return null;\n }\n const impact = {\n displacedBy,\n displaced: previousImpact.displaced,\n at: {\n type: 'COMBINE',\n combine: {\n draggableId: combineWith.descriptor.id,\n droppableId: destination.descriptor.id\n }\n }\n };\n return impact;\n};\n\nvar getDragImpact = ({\n pageOffset,\n draggable,\n draggables,\n droppables,\n previousImpact,\n viewport,\n afterCritical\n}) => {\n const pageBorderBox = offsetRectByPosition(draggable.page.borderBox, pageOffset);\n const destinationId = getDroppableOver({\n pageBorderBox,\n draggable,\n droppables\n });\n if (!destinationId) {\n return noImpact;\n }\n const destination = droppables[destinationId];\n const insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);\n const pageBorderBoxWithDroppableScroll = withDroppableScroll(destination, pageBorderBox);\n return getCombineImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n previousImpact,\n destination,\n insideDestination,\n afterCritical\n }) || getReorderImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n destination,\n insideDestination,\n last: previousImpact.displaced,\n viewport,\n afterCritical\n });\n};\n\nvar patchDroppableMap = (droppables, updated) => ({\n ...droppables,\n [updated.descriptor.id]: updated\n});\n\nconst clearUnusedPlaceholder = ({\n previousImpact,\n impact,\n droppables\n}) => {\n const last = whatIsDraggedOver(previousImpact);\n const now = whatIsDraggedOver(impact);\n if (!last) {\n return droppables;\n }\n if (last === now) {\n return droppables;\n }\n const lastDroppable = droppables[last];\n if (!lastDroppable.subject.withPlaceholder) {\n return droppables;\n }\n const updated = removePlaceholder(lastDroppable);\n return patchDroppableMap(droppables, updated);\n};\nvar recomputePlaceholders = ({\n draggable,\n draggables,\n droppables,\n previousImpact,\n impact\n}) => {\n const cleaned = clearUnusedPlaceholder({\n previousImpact,\n impact,\n droppables\n });\n const isOver = whatIsDraggedOver(impact);\n if (!isOver) {\n return cleaned;\n }\n const droppable = droppables[isOver];\n if (isHomeOf(draggable, droppable)) {\n return cleaned;\n }\n if (droppable.subject.withPlaceholder) {\n return cleaned;\n }\n const patched = addPlaceholder(droppable, draggable, draggables);\n return patchDroppableMap(cleaned, patched);\n};\n\nvar update = ({\n state,\n clientSelection: forcedClientSelection,\n dimensions: forcedDimensions,\n viewport: forcedViewport,\n impact: forcedImpact,\n scrollJumpRequest\n}) => {\n const viewport = forcedViewport || state.viewport;\n const dimensions = forcedDimensions || state.dimensions;\n const clientSelection = forcedClientSelection || state.current.client.selection;\n const offset = subtract(clientSelection, state.initial.client.selection);\n const client = {\n offset,\n selection: clientSelection,\n borderBoxCenter: add(state.initial.client.borderBoxCenter, offset)\n };\n const page = {\n selection: add(client.selection, viewport.scroll.current),\n borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current),\n offset: add(client.offset, viewport.scroll.diff.value)\n };\n const current = {\n client,\n page\n };\n if (state.phase === 'COLLECTING') {\n return {\n ...state,\n dimensions,\n viewport,\n current\n };\n }\n const draggable = dimensions.draggables[state.critical.draggable.id];\n const newImpact = forcedImpact || getDragImpact({\n pageOffset: page.offset,\n draggable,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact: state.impact,\n viewport,\n afterCritical: state.afterCritical\n });\n const withUpdatedPlaceholders = recomputePlaceholders({\n draggable,\n impact: newImpact,\n previousImpact: state.impact,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables\n });\n const result = {\n ...state,\n current,\n dimensions: {\n draggables: dimensions.draggables,\n droppables: withUpdatedPlaceholders\n },\n impact: newImpact,\n viewport,\n scrollJumpRequest: scrollJumpRequest || null,\n forceShouldAnimate: scrollJumpRequest ? false : null\n };\n return result;\n};\n\nfunction getDraggables(ids, draggables) {\n return ids.map(id => draggables[id]);\n}\nvar recompute = ({\n impact,\n viewport,\n draggables,\n destination,\n forceShouldAnimate\n}) => {\n const last = impact.displaced;\n const afterDragging = getDraggables(last.all, draggables);\n const displaced = getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n forceShouldAnimate,\n last\n });\n return {\n ...impact,\n displaced\n };\n};\n\nvar getClientBorderBoxCenter = ({\n impact,\n draggable,\n droppable,\n draggables,\n viewport,\n afterCritical\n}) => {\n const pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical\n });\n return getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport\n });\n};\n\nvar refreshSnap = ({\n state,\n dimensions: forcedDimensions,\n viewport: forcedViewport\n}) => {\n !(state.movementMode === 'SNAP') ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const needsVisibilityCheck = state.impact;\n const viewport = forcedViewport || state.viewport;\n const dimensions = forcedDimensions || state.dimensions;\n const {\n draggables,\n droppables\n } = dimensions;\n const draggable = draggables[state.critical.draggable.id];\n const isOver = whatIsDraggedOver(needsVisibilityCheck);\n !isOver ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Must be over a destination in SNAP movement mode') : invariant() : void 0;\n const destination = droppables[isOver];\n const impact = recompute({\n impact: needsVisibilityCheck,\n viewport,\n destination,\n draggables\n });\n const clientSelection = getClientBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n viewport,\n afterCritical: state.afterCritical\n });\n return update({\n impact,\n clientSelection,\n state,\n dimensions,\n viewport\n });\n};\n\nvar getHomeLocation = descriptor => ({\n index: descriptor.index,\n droppableId: descriptor.droppableId\n});\n\nvar getLiftEffect = ({\n draggable,\n home,\n draggables,\n viewport\n}) => {\n const displacedBy = getDisplacedBy(home.axis, draggable.displaceBy);\n const insideHome = getDraggablesInsideDroppable(home.descriptor.id, draggables);\n const rawIndex = insideHome.indexOf(draggable);\n !(rawIndex !== -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected draggable to be inside home list') : invariant() : void 0;\n const afterDragging = insideHome.slice(rawIndex + 1);\n const effected = afterDragging.reduce((previous, item) => {\n previous[item.descriptor.id] = true;\n return previous;\n }, {});\n const afterCritical = {\n inVirtualList: home.descriptor.mode === 'virtual',\n displacedBy,\n effected\n };\n const displaced = getDisplacementGroups({\n afterDragging,\n destination: home,\n displacedBy,\n last: null,\n viewport: viewport.frame,\n forceShouldAnimate: false\n });\n const impact = {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: getHomeLocation(draggable.descriptor)\n }\n };\n return {\n impact,\n afterCritical\n };\n};\n\nvar patchDimensionMap = (dimensions, updated) => ({\n draggables: dimensions.draggables,\n droppables: patchDroppableMap(dimensions.droppables, updated)\n});\n\nconst start = key => {\n if (process.env.NODE_ENV !== 'production') {\n {\n return;\n }\n }\n};\nconst finish = key => {\n if (process.env.NODE_ENV !== 'production') {\n {\n return;\n }\n }\n};\n\nvar offsetDraggable = ({\n draggable,\n offset: offset$1,\n initialWindowScroll\n}) => {\n const client = offset(draggable.client, offset$1);\n const page = withScroll(client, initialWindowScroll);\n const moved = {\n ...draggable,\n placeholder: {\n ...draggable.placeholder,\n client\n },\n client,\n page\n };\n return moved;\n};\n\nvar getFrame = droppable => {\n const frame = droppable.frame;\n !frame ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected Droppable to have a frame') : invariant() : void 0;\n return frame;\n};\n\nvar adjustAdditionsForScrollChanges = ({\n additions,\n updatedDroppables,\n viewport\n}) => {\n const windowScrollChange = viewport.scroll.diff.value;\n return additions.map(draggable => {\n const droppableId = draggable.descriptor.droppableId;\n const modified = updatedDroppables[droppableId];\n const frame = getFrame(modified);\n const droppableScrollChange = frame.scroll.diff.value;\n const totalChange = add(windowScrollChange, droppableScrollChange);\n const moved = offsetDraggable({\n draggable,\n offset: totalChange,\n initialWindowScroll: viewport.scroll.initial\n });\n return moved;\n });\n};\n\nvar publishWhileDraggingInVirtual = ({\n state,\n published\n}) => {\n start();\n const withScrollChange = published.modified.map(update => {\n const existing = state.dimensions.droppables[update.droppableId];\n const scrolled = scrollDroppable(existing, update.scroll);\n return scrolled;\n });\n const droppables = {\n ...state.dimensions.droppables,\n ...toDroppableMap(withScrollChange)\n };\n const updatedAdditions = toDraggableMap(adjustAdditionsForScrollChanges({\n additions: published.additions,\n updatedDroppables: droppables,\n viewport: state.viewport\n }));\n const draggables = {\n ...state.dimensions.draggables,\n ...updatedAdditions\n };\n published.removals.forEach(id => {\n delete draggables[id];\n });\n const dimensions = {\n droppables,\n draggables\n };\n const wasOverId = whatIsDraggedOver(state.impact);\n const wasOver = wasOverId ? dimensions.droppables[wasOverId] : null;\n const draggable = dimensions.draggables[state.critical.draggable.id];\n const home = dimensions.droppables[state.critical.droppable.id];\n const {\n impact: onLiftImpact,\n afterCritical\n } = getLiftEffect({\n draggable,\n home,\n draggables,\n viewport: state.viewport\n });\n const previousImpact = wasOver && wasOver.isCombineEnabled ? state.impact : onLiftImpact;\n const impact = getDragImpact({\n pageOffset: state.current.page.offset,\n draggable: dimensions.draggables[state.critical.draggable.id],\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact,\n viewport: state.viewport,\n afterCritical\n });\n finish();\n const draggingState = {\n ...state,\n phase: 'DRAGGING',\n impact,\n onLiftImpact,\n dimensions,\n afterCritical,\n forceShouldAnimate: false\n };\n if (state.phase === 'COLLECTING') {\n return draggingState;\n }\n const dropPending = {\n ...draggingState,\n phase: 'DROP_PENDING',\n reason: state.reason,\n isWaiting: false\n };\n return dropPending;\n};\n\nconst isSnapping = state => state.movementMode === 'SNAP';\nconst postDroppableChange = (state, updated, isEnabledChanging) => {\n const dimensions = patchDimensionMap(state.dimensions, updated);\n if (!isSnapping(state) || isEnabledChanging) {\n return update({\n state,\n dimensions\n });\n }\n return refreshSnap({\n state,\n dimensions\n });\n};\nfunction removeScrollJumpRequest(state) {\n if (state.isDragging && state.movementMode === 'SNAP') {\n return {\n ...state,\n scrollJumpRequest: null\n };\n }\n return state;\n}\nconst idle$2 = {\n phase: 'IDLE',\n completed: null,\n shouldFlush: false\n};\nvar reducer = (state = idle$2, action) => {\n if (action.type === 'FLUSH') {\n return {\n ...idle$2,\n shouldFlush: true\n };\n }\n if (action.type === 'INITIAL_PUBLISH') {\n !(state.phase === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'INITIAL_PUBLISH must come after a IDLE phase') : invariant() : void 0;\n const {\n critical,\n clientSelection,\n viewport,\n dimensions,\n movementMode\n } = action.payload;\n const draggable = dimensions.draggables[critical.draggable.id];\n const home = dimensions.droppables[critical.droppable.id];\n const client = {\n selection: clientSelection,\n borderBoxCenter: draggable.client.borderBox.center,\n offset: origin\n };\n const initial = {\n client,\n page: {\n selection: add(client.selection, viewport.scroll.initial),\n borderBoxCenter: add(client.selection, viewport.scroll.initial),\n offset: add(client.selection, viewport.scroll.diff.value)\n }\n };\n const isWindowScrollAllowed = toDroppableList(dimensions.droppables).every(item => !item.isFixedOnPage);\n const {\n impact,\n afterCritical\n } = getLiftEffect({\n draggable,\n home,\n draggables: dimensions.draggables,\n viewport\n });\n const result = {\n phase: 'DRAGGING',\n isDragging: true,\n critical,\n movementMode,\n dimensions,\n initial,\n current: initial,\n isWindowScrollAllowed,\n impact,\n afterCritical,\n onLiftImpact: impact,\n viewport,\n scrollJumpRequest: null,\n forceShouldAnimate: null\n };\n return result;\n }\n if (action.type === 'COLLECTION_STARTING') {\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Collection cannot start from phase ${state.phase}`) : invariant() : void 0;\n const result = {\n ...state,\n phase: 'COLLECTING'\n };\n return result;\n }\n if (action.type === 'PUBLISH_WHILE_DRAGGING') {\n !(state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unexpected ${action.type} received in phase ${state.phase}`) : invariant() : void 0;\n return publishWhileDraggingInVirtual({\n state,\n published: action.payload\n });\n }\n if (action.type === 'MOVE') {\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${action.type} not permitted in phase ${state.phase}`) : invariant() : void 0;\n const {\n client: clientSelection\n } = action.payload;\n if (isEqual$1(clientSelection, state.current.client.selection)) {\n return state;\n }\n return update({\n state,\n clientSelection,\n impact: isSnapping(state) ? state.impact : null\n });\n }\n if (action.type === 'UPDATE_DROPPABLE_SCROLL') {\n if (state.phase === 'DROP_PENDING') {\n return removeScrollJumpRequest(state);\n }\n if (state.phase === 'COLLECTING') {\n return removeScrollJumpRequest(state);\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${action.type} not permitted in phase ${state.phase}`) : invariant() : void 0;\n const {\n id,\n newScroll\n } = action.payload;\n const target = state.dimensions.droppables[id];\n if (!target) {\n return state;\n }\n const scrolled = scrollDroppable(target, newScroll);\n return postDroppableChange(state, scrolled, false);\n }\n if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Attempting to move in an unsupported phase ${state.phase}`) : invariant() : void 0;\n const {\n id,\n isEnabled\n } = action.payload;\n const target = state.dimensions.droppables[id];\n !target ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find Droppable[id: ${id}] to toggle its enabled state`) : invariant() : void 0;\n !(target.isEnabled !== isEnabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Trying to set droppable isEnabled to ${String(isEnabled)}\n but it is already ${String(target.isEnabled)}`) : invariant() : void 0;\n const updated = {\n ...target,\n isEnabled\n };\n return postDroppableChange(state, updated, true);\n }\n if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Attempting to move in an unsupported phase ${state.phase}`) : invariant() : void 0;\n const {\n id,\n isCombineEnabled\n } = action.payload;\n const target = state.dimensions.droppables[id];\n !target ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find Droppable[id: ${id}] to toggle its isCombineEnabled state`) : invariant() : void 0;\n !(target.isCombineEnabled !== isCombineEnabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Trying to set droppable isCombineEnabled to ${String(isCombineEnabled)}\n but it is already ${String(target.isCombineEnabled)}`) : invariant() : void 0;\n const updated = {\n ...target,\n isCombineEnabled\n };\n return postDroppableChange(state, updated, true);\n }\n if (action.type === 'MOVE_BY_WINDOW_SCROLL') {\n if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot move by window in phase ${state.phase}`) : invariant() : void 0;\n !state.isWindowScrollAllowed ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Window scrolling is currently not supported for fixed lists') : invariant() : void 0;\n const newScroll = action.payload.newScroll;\n if (isEqual$1(state.viewport.scroll.current, newScroll)) {\n return removeScrollJumpRequest(state);\n }\n const viewport = scrollViewport(state.viewport, newScroll);\n if (isSnapping(state)) {\n return refreshSnap({\n state,\n viewport\n });\n }\n return update({\n state,\n viewport\n });\n }\n if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {\n if (!isMovementAllowed(state)) {\n return state;\n }\n const maxScroll = action.payload.maxScroll;\n if (isEqual$1(maxScroll, state.viewport.scroll.max)) {\n return state;\n }\n const withMaxScroll = {\n ...state.viewport,\n scroll: {\n ...state.viewport.scroll,\n max: maxScroll\n }\n };\n return {\n ...state,\n viewport: withMaxScroll\n };\n }\n if (action.type === 'MOVE_UP' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_RIGHT') {\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${action.type} received while not in DRAGGING phase`) : invariant() : void 0;\n const result = moveInDirection({\n state,\n type: action.type\n });\n if (!result) {\n return state;\n }\n return update({\n state,\n impact: result.impact,\n clientSelection: result.clientSelection,\n scrollJumpRequest: result.scrollJumpRequest\n });\n }\n if (action.type === 'DROP_PENDING') {\n const reason = action.payload.reason;\n !(state.phase === 'COLLECTING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only move into the DROP_PENDING phase from the COLLECTING phase') : invariant() : void 0;\n const newState = {\n ...state,\n phase: 'DROP_PENDING',\n isWaiting: true,\n reason\n };\n return newState;\n }\n if (action.type === 'DROP_ANIMATE') {\n const {\n completed,\n dropDuration,\n newHomeClientOffset\n } = action.payload;\n !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot animate drop from phase ${state.phase}`) : invariant() : void 0;\n const result = {\n phase: 'DROP_ANIMATING',\n completed,\n dropDuration,\n newHomeClientOffset,\n dimensions: state.dimensions\n };\n return result;\n }\n if (action.type === 'DROP_COMPLETE') {\n const {\n completed\n } = action.payload;\n return {\n phase: 'IDLE',\n completed,\n shouldFlush: false\n };\n }\n return state;\n};\n\nfunction guard(action, predicate) {\n return action instanceof Object && 'type' in action && action.type === predicate;\n}\nconst beforeInitialCapture = args => ({\n type: 'BEFORE_INITIAL_CAPTURE',\n payload: args\n});\nconst lift$1 = args => ({\n type: 'LIFT',\n payload: args\n});\nconst initialPublish = args => ({\n type: 'INITIAL_PUBLISH',\n payload: args\n});\nconst publishWhileDragging = args => ({\n type: 'PUBLISH_WHILE_DRAGGING',\n payload: args\n});\nconst collectionStarting = () => ({\n type: 'COLLECTION_STARTING',\n payload: null\n});\nconst updateDroppableScroll = args => ({\n type: 'UPDATE_DROPPABLE_SCROLL',\n payload: args\n});\nconst updateDroppableIsEnabled = args => ({\n type: 'UPDATE_DROPPABLE_IS_ENABLED',\n payload: args\n});\nconst updateDroppableIsCombineEnabled = args => ({\n type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',\n payload: args\n});\nconst move = args => ({\n type: 'MOVE',\n payload: args\n});\nconst moveByWindowScroll = args => ({\n type: 'MOVE_BY_WINDOW_SCROLL',\n payload: args\n});\nconst updateViewportMaxScroll = args => ({\n type: 'UPDATE_VIEWPORT_MAX_SCROLL',\n payload: args\n});\nconst moveUp = () => ({\n type: 'MOVE_UP',\n payload: null\n});\nconst moveDown = () => ({\n type: 'MOVE_DOWN',\n payload: null\n});\nconst moveRight = () => ({\n type: 'MOVE_RIGHT',\n payload: null\n});\nconst moveLeft = () => ({\n type: 'MOVE_LEFT',\n payload: null\n});\nconst flush = () => ({\n type: 'FLUSH',\n payload: null\n});\nconst animateDrop = args => ({\n type: 'DROP_ANIMATE',\n payload: args\n});\nconst completeDrop = args => ({\n type: 'DROP_COMPLETE',\n payload: args\n});\nconst drop = args => ({\n type: 'DROP',\n payload: args\n});\nconst dropPending = args => ({\n type: 'DROP_PENDING',\n payload: args\n});\nconst dropAnimationFinished = () => ({\n type: 'DROP_ANIMATION_FINISHED',\n payload: null\n});\n\nfunction checkIndexes(insideDestination) {\n if (insideDestination.length <= 1) {\n return;\n }\n const indexes = insideDestination.map(d => d.descriptor.index);\n const errors = {};\n for (let i = 1; i < indexes.length; i++) {\n const current = indexes[i];\n const previous = indexes[i - 1];\n if (current !== previous + 1) {\n errors[current] = true;\n }\n }\n if (!Object.keys(errors).length) {\n return;\n }\n const formatted = indexes.map(index => {\n const hasError = Boolean(errors[index]);\n return hasError ? `[🔥${index}]` : `${index}`;\n }).join(', ');\n process.env.NODE_ENV !== \"production\" ? warning(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${formatted}\n `) : void 0;\n}\nfunction validateDimensions(critical, dimensions) {\n if (process.env.NODE_ENV !== 'production') {\n const insideDestination = getDraggablesInsideDroppable(critical.droppable.id, dimensions.draggables);\n checkIndexes(insideDestination);\n }\n}\n\nvar lift = marshal => ({\n getState,\n dispatch\n}) => next => action => {\n if (!guard(action, 'LIFT')) {\n next(action);\n return;\n }\n const {\n id,\n clientSelection,\n movementMode\n } = action.payload;\n const initial = getState();\n if (initial.phase === 'DROP_ANIMATING') {\n dispatch(completeDrop({\n completed: initial.completed\n }));\n }\n !(getState().phase === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Unexpected phase to start a drag') : invariant() : void 0;\n dispatch(flush());\n dispatch(beforeInitialCapture({\n draggableId: id,\n movementMode\n }));\n const scrollOptions = {\n shouldPublishImmediately: movementMode === 'SNAP'\n };\n const request = {\n draggableId: id,\n scrollOptions\n };\n const {\n critical,\n dimensions,\n viewport\n } = marshal.startPublishing(request);\n validateDimensions(critical, dimensions);\n dispatch(initialPublish({\n critical,\n dimensions,\n clientSelection,\n movementMode,\n viewport\n }));\n};\n\nvar style = marshal => () => next => action => {\n if (guard(action, 'INITIAL_PUBLISH')) {\n marshal.dragging();\n }\n if (guard(action, 'DROP_ANIMATE')) {\n marshal.dropping(action.payload.completed.result.reason);\n }\n if (guard(action, 'FLUSH') || guard(action, 'DROP_COMPLETE')) {\n marshal.resting();\n }\n next(action);\n};\n\nconst curves = {\n outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)',\n drop: 'cubic-bezier(.2,1,.1,1)'\n};\nconst combine = {\n opacity: {\n drop: 0,\n combining: 0.7\n },\n scale: {\n drop: 0.75\n }\n};\nconst timings = {\n outOfTheWay: 0.2,\n minDropTime: 0.33,\n maxDropTime: 0.55\n};\nconst outOfTheWayTiming = `${timings.outOfTheWay}s ${curves.outOfTheWay}`;\nconst transitions = {\n fluid: `opacity ${outOfTheWayTiming}`,\n snap: `transform ${outOfTheWayTiming}, opacity ${outOfTheWayTiming}`,\n drop: duration => {\n const timing = `${duration}s ${curves.drop}`;\n return `transform ${timing}, opacity ${timing}`;\n },\n outOfTheWay: `transform ${outOfTheWayTiming}`,\n placeholder: `height ${outOfTheWayTiming}, width ${outOfTheWayTiming}, margin ${outOfTheWayTiming}`\n};\nconst moveTo = offset => isEqual$1(offset, origin) ? undefined : `translate(${offset.x}px, ${offset.y}px)`;\nconst transforms = {\n moveTo,\n drop: (offset, isCombining) => {\n const translate = moveTo(offset);\n if (!translate) {\n return undefined;\n }\n if (!isCombining) {\n return translate;\n }\n return `${translate} scale(${combine.scale.drop})`;\n }\n};\n\nconst {\n minDropTime,\n maxDropTime\n} = timings;\nconst dropTimeRange = maxDropTime - minDropTime;\nconst maxDropTimeAtDistance = 1500;\nconst cancelDropModifier = 0.6;\nvar getDropDuration = ({\n current,\n destination,\n reason\n}) => {\n const distance$1 = distance(current, destination);\n if (distance$1 <= 0) {\n return minDropTime;\n }\n if (distance$1 >= maxDropTimeAtDistance) {\n return maxDropTime;\n }\n const percentage = distance$1 / maxDropTimeAtDistance;\n const duration = minDropTime + dropTimeRange * percentage;\n const withDuration = reason === 'CANCEL' ? duration * cancelDropModifier : duration;\n return Number(withDuration.toFixed(2));\n};\n\nvar getNewHomeClientOffset = ({\n impact,\n draggable,\n dimensions,\n viewport,\n afterCritical\n}) => {\n const {\n draggables,\n droppables\n } = dimensions;\n const droppableId = whatIsDraggedOver(impact);\n const destination = droppableId ? droppables[droppableId] : null;\n const home = droppables[draggable.descriptor.droppableId];\n const newClientCenter = getClientBorderBoxCenter({\n impact,\n draggable,\n draggables,\n afterCritical,\n droppable: destination || home,\n viewport\n });\n const offset = subtract(newClientCenter, draggable.client.borderBox.center);\n return offset;\n};\n\nvar getDropImpact = ({\n draggables,\n reason,\n lastImpact,\n home,\n viewport,\n onLiftImpact\n}) => {\n if (!lastImpact.at || reason !== 'DROP') {\n const recomputedHomeImpact = recompute({\n draggables,\n impact: onLiftImpact,\n destination: home,\n viewport,\n forceShouldAnimate: true\n });\n return {\n impact: recomputedHomeImpact,\n didDropInsideDroppable: false\n };\n }\n if (lastImpact.at.type === 'REORDER') {\n return {\n impact: lastImpact,\n didDropInsideDroppable: true\n };\n }\n const withoutMovement = {\n ...lastImpact,\n displaced: emptyGroups\n };\n return {\n impact: withoutMovement,\n didDropInsideDroppable: true\n };\n};\n\nconst dropMiddleware = ({\n getState,\n dispatch\n}) => next => action => {\n if (!guard(action, 'DROP')) {\n next(action);\n return;\n }\n const state = getState();\n const reason = action.payload.reason;\n if (state.phase === 'COLLECTING') {\n dispatch(dropPending({\n reason\n }));\n return;\n }\n if (state.phase === 'IDLE') {\n return;\n }\n const isWaitingForDrop = state.phase === 'DROP_PENDING' && state.isWaiting;\n !!isWaitingForDrop ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'A DROP action occurred while DROP_PENDING and still waiting') : invariant() : void 0;\n !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot drop in phase: ${state.phase}`) : invariant() : void 0;\n const critical = state.critical;\n const dimensions = state.dimensions;\n const draggable = dimensions.draggables[state.critical.draggable.id];\n const {\n impact,\n didDropInsideDroppable\n } = getDropImpact({\n reason,\n lastImpact: state.impact,\n afterCritical: state.afterCritical,\n onLiftImpact: state.onLiftImpact,\n home: state.dimensions.droppables[state.critical.droppable.id],\n viewport: state.viewport,\n draggables: state.dimensions.draggables\n });\n const destination = didDropInsideDroppable ? tryGetDestination(impact) : null;\n const combine = didDropInsideDroppable ? tryGetCombine(impact) : null;\n const source = {\n index: critical.draggable.index,\n droppableId: critical.droppable.id\n };\n const result = {\n draggableId: draggable.descriptor.id,\n type: draggable.descriptor.type,\n source,\n reason,\n mode: state.movementMode,\n destination,\n combine\n };\n const newHomeClientOffset = getNewHomeClientOffset({\n impact,\n draggable,\n dimensions,\n viewport: state.viewport,\n afterCritical: state.afterCritical\n });\n const completed = {\n critical: state.critical,\n afterCritical: state.afterCritical,\n result,\n impact\n };\n const isAnimationRequired = !isEqual$1(state.current.client.offset, newHomeClientOffset) || Boolean(result.combine);\n if (!isAnimationRequired) {\n dispatch(completeDrop({\n completed\n }));\n return;\n }\n const dropDuration = getDropDuration({\n current: state.current.client.offset,\n destination: newHomeClientOffset,\n reason\n });\n const args = {\n newHomeClientOffset,\n dropDuration,\n completed\n };\n dispatch(animateDrop(args));\n};\n\nvar getWindowScroll = () => ({\n x: window.pageXOffset,\n y: window.pageYOffset\n});\n\nfunction getWindowScrollBinding(update) {\n return {\n eventName: 'scroll',\n options: {\n passive: true,\n capture: false\n },\n fn: event => {\n if (event.target !== window && event.target !== window.document) {\n return;\n }\n update();\n }\n };\n}\nfunction getScrollListener({\n onWindowScroll\n}) {\n function updateScroll() {\n onWindowScroll(getWindowScroll());\n }\n const scheduled = rafSchd(updateScroll);\n const binding = getWindowScrollBinding(scheduled);\n let unbind = noop$2;\n function isActive() {\n return unbind !== noop$2;\n }\n function start() {\n !!isActive() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot start scroll listener when already active') : invariant() : void 0;\n unbind = bindEvents(window, [binding]);\n }\n function stop() {\n !isActive() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot stop scroll listener when not active') : invariant() : void 0;\n scheduled.cancel();\n unbind();\n unbind = noop$2;\n }\n return {\n start,\n stop,\n isActive\n };\n}\n\nconst shouldStop$1 = action => guard(action, 'DROP_COMPLETE') || guard(action, 'DROP_ANIMATE') || guard(action, 'FLUSH');\nconst scrollListener = store => {\n const listener = getScrollListener({\n onWindowScroll: newScroll => {\n store.dispatch(moveByWindowScroll({\n newScroll\n }));\n }\n });\n return next => action => {\n if (!listener.isActive() && guard(action, 'INITIAL_PUBLISH')) {\n listener.start();\n }\n if (listener.isActive() && shouldStop$1(action)) {\n listener.stop();\n }\n next(action);\n };\n};\n\nvar getExpiringAnnounce = announce => {\n let wasCalled = false;\n let isExpired = false;\n const timeoutId = setTimeout(() => {\n isExpired = true;\n });\n const result = message => {\n if (wasCalled) {\n process.env.NODE_ENV !== \"production\" ? warning('Announcement already made. Not making a second announcement') : void 0;\n return;\n }\n if (isExpired) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n `) : void 0;\n return;\n }\n wasCalled = true;\n announce(message);\n clearTimeout(timeoutId);\n };\n result.wasCalled = () => wasCalled;\n return result;\n};\n\nvar getAsyncMarshal = () => {\n const entries = [];\n const execute = timerId => {\n const index = entries.findIndex(item => item.timerId === timerId);\n !(index !== -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find timer') : invariant() : void 0;\n const [entry] = entries.splice(index, 1);\n entry.callback();\n };\n const add = fn => {\n const timerId = setTimeout(() => execute(timerId));\n const entry = {\n timerId,\n callback: fn\n };\n entries.push(entry);\n };\n const flush = () => {\n if (!entries.length) {\n return;\n }\n const shallow = [...entries];\n entries.length = 0;\n shallow.forEach(entry => {\n clearTimeout(entry.timerId);\n entry.callback();\n });\n };\n return {\n add,\n flush\n };\n};\n\nconst areLocationsEqual = (first, second) => {\n if (first == null && second == null) {\n return true;\n }\n if (first == null || second == null) {\n return false;\n }\n return first.droppableId === second.droppableId && first.index === second.index;\n};\nconst isCombineEqual = (first, second) => {\n if (first == null && second == null) {\n return true;\n }\n if (first == null || second == null) {\n return false;\n }\n return first.draggableId === second.draggableId && first.droppableId === second.droppableId;\n};\nconst isCriticalEqual = (first, second) => {\n if (first === second) {\n return true;\n }\n const isDraggableEqual = first.draggable.id === second.draggable.id && first.draggable.droppableId === second.draggable.droppableId && first.draggable.type === second.draggable.type && first.draggable.index === second.draggable.index;\n const isDroppableEqual = first.droppable.id === second.droppable.id && first.droppable.type === second.droppable.type;\n return isDraggableEqual && isDroppableEqual;\n};\n\nconst withTimings = (key, fn) => {\n start();\n fn();\n finish();\n};\nconst getDragStart = (critical, mode) => ({\n draggableId: critical.draggable.id,\n type: critical.droppable.type,\n source: {\n droppableId: critical.droppable.id,\n index: critical.draggable.index\n },\n mode\n});\nfunction execute(responder, data, announce, getDefaultMessage) {\n if (!responder) {\n announce(getDefaultMessage(data));\n return;\n }\n const willExpire = getExpiringAnnounce(announce);\n const provided = {\n announce: willExpire\n };\n responder(data, provided);\n if (!willExpire.wasCalled()) {\n announce(getDefaultMessage(data));\n }\n}\nvar getPublisher = (getResponders, announce) => {\n const asyncMarshal = getAsyncMarshal();\n let dragging = null;\n const beforeCapture = (draggableId, mode) => {\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onBeforeCapture as a drag start has already been published') : invariant() : void 0;\n withTimings('onBeforeCapture', () => {\n const fn = getResponders().onBeforeCapture;\n if (fn) {\n const before = {\n draggableId,\n mode\n };\n fn(before);\n }\n });\n };\n const beforeStart = (critical, mode) => {\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : invariant() : void 0;\n withTimings('onBeforeDragStart', () => {\n const fn = getResponders().onBeforeDragStart;\n if (fn) {\n fn(getDragStart(critical, mode));\n }\n });\n };\n const start = (critical, mode) => {\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : invariant() : void 0;\n const data = getDragStart(critical, mode);\n dragging = {\n mode,\n lastCritical: critical,\n lastLocation: data.source,\n lastCombine: null\n };\n asyncMarshal.add(() => {\n withTimings('onDragStart', () => execute(getResponders().onDragStart, data, announce, preset.onDragStart));\n });\n };\n const update = (critical, impact) => {\n const location = tryGetDestination(impact);\n const combine = tryGetCombine(impact);\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onDragMove when onDragStart has not been called') : invariant() : void 0;\n const hasCriticalChanged = !isCriticalEqual(critical, dragging.lastCritical);\n if (hasCriticalChanged) {\n dragging.lastCritical = critical;\n }\n const hasLocationChanged = !areLocationsEqual(dragging.lastLocation, location);\n if (hasLocationChanged) {\n dragging.lastLocation = location;\n }\n const hasGroupingChanged = !isCombineEqual(dragging.lastCombine, combine);\n if (hasGroupingChanged) {\n dragging.lastCombine = combine;\n }\n if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) {\n return;\n }\n const data = {\n ...getDragStart(critical, dragging.mode),\n combine,\n destination: location\n };\n asyncMarshal.add(() => {\n withTimings('onDragUpdate', () => execute(getResponders().onDragUpdate, data, announce, preset.onDragUpdate));\n });\n };\n const flush = () => {\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only flush responders while dragging') : invariant() : void 0;\n asyncMarshal.flush();\n };\n const drop = result => {\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onDragEnd when there is no matching onDragStart') : invariant() : void 0;\n dragging = null;\n withTimings('onDragEnd', () => execute(getResponders().onDragEnd, result, announce, preset.onDragEnd));\n };\n const abort = () => {\n if (!dragging) {\n return;\n }\n const result = {\n ...getDragStart(dragging.lastCritical, dragging.mode),\n combine: null,\n destination: null,\n reason: 'CANCEL'\n };\n drop(result);\n };\n return {\n beforeCapture,\n beforeStart,\n start,\n update,\n flush,\n drop,\n abort\n };\n};\n\nvar responders = (getResponders, announce) => {\n const publisher = getPublisher(getResponders, announce);\n return store => next => action => {\n if (guard(action, 'BEFORE_INITIAL_CAPTURE')) {\n publisher.beforeCapture(action.payload.draggableId, action.payload.movementMode);\n return;\n }\n if (guard(action, 'INITIAL_PUBLISH')) {\n const critical = action.payload.critical;\n publisher.beforeStart(critical, action.payload.movementMode);\n next(action);\n publisher.start(critical, action.payload.movementMode);\n return;\n }\n if (guard(action, 'DROP_COMPLETE')) {\n const result = action.payload.completed.result;\n publisher.flush();\n next(action);\n publisher.drop(result);\n return;\n }\n next(action);\n if (guard(action, 'FLUSH')) {\n publisher.abort();\n return;\n }\n const state = store.getState();\n if (state.phase === 'DRAGGING') {\n publisher.update(state.critical, state.impact);\n }\n };\n};\n\nconst dropAnimationFinishMiddleware = store => next => action => {\n if (!guard(action, 'DROP_ANIMATION_FINISHED')) {\n next(action);\n return;\n }\n const state = store.getState();\n !(state.phase === 'DROP_ANIMATING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot finish a drop animating when no drop is occurring') : invariant() : void 0;\n store.dispatch(completeDrop({\n completed: state.completed\n }));\n};\n\nconst dropAnimationFlushOnScrollMiddleware = store => {\n let unbind = null;\n let frameId = null;\n function clear() {\n if (frameId) {\n cancelAnimationFrame(frameId);\n frameId = null;\n }\n if (unbind) {\n unbind();\n unbind = null;\n }\n }\n return next => action => {\n if (guard(action, 'FLUSH') || guard(action, 'DROP_COMPLETE') || guard(action, 'DROP_ANIMATION_FINISHED')) {\n clear();\n }\n next(action);\n if (!guard(action, 'DROP_ANIMATE')) {\n return;\n }\n const binding = {\n eventName: 'scroll',\n options: {\n capture: true,\n passive: false,\n once: true\n },\n fn: function flushDropAnimation() {\n const state = store.getState();\n if (state.phase === 'DROP_ANIMATING') {\n store.dispatch(dropAnimationFinished());\n }\n }\n };\n frameId = requestAnimationFrame(() => {\n frameId = null;\n unbind = bindEvents(window, [binding]);\n });\n };\n};\n\nvar dimensionMarshalStopper = marshal => () => next => action => {\n if (guard(action, 'DROP_COMPLETE') || guard(action, 'FLUSH') || guard(action, 'DROP_ANIMATE')) {\n marshal.stopPublishing();\n }\n next(action);\n};\n\nvar focus = marshal => {\n let isWatching = false;\n return () => next => action => {\n if (guard(action, 'INITIAL_PUBLISH')) {\n isWatching = true;\n marshal.tryRecordFocus(action.payload.critical.draggable.id);\n next(action);\n marshal.tryRestoreFocusRecorded();\n return;\n }\n next(action);\n if (!isWatching) {\n return;\n }\n if (guard(action, 'FLUSH')) {\n isWatching = false;\n marshal.tryRestoreFocusRecorded();\n return;\n }\n if (guard(action, 'DROP_COMPLETE')) {\n isWatching = false;\n const result = action.payload.completed.result;\n if (result.combine) {\n marshal.tryShiftRecord(result.draggableId, result.combine.draggableId);\n }\n marshal.tryRestoreFocusRecorded();\n }\n };\n};\n\nconst shouldStop = action => guard(action, 'DROP_COMPLETE') || guard(action, 'DROP_ANIMATE') || guard(action, 'FLUSH');\nvar autoScroll = autoScroller => store => next => action => {\n if (shouldStop(action)) {\n autoScroller.stop();\n next(action);\n return;\n }\n if (guard(action, 'INITIAL_PUBLISH')) {\n next(action);\n const state = store.getState();\n !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected phase to be DRAGGING after INITIAL_PUBLISH') : invariant() : void 0;\n autoScroller.start(state);\n return;\n }\n next(action);\n autoScroller.scroll(store.getState());\n};\n\nconst pendingDrop = store => next => action => {\n next(action);\n if (!guard(action, 'PUBLISH_WHILE_DRAGGING')) {\n return;\n }\n const postActionState = store.getState();\n if (postActionState.phase !== 'DROP_PENDING') {\n return;\n }\n if (postActionState.isWaiting) {\n return;\n }\n store.dispatch(drop({\n reason: postActionState.reason\n }));\n};\n\nconst composeEnhancers = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n name: '@hello-pangea/dnd'\n}) : compose;\nvar createStore = ({\n dimensionMarshal,\n focusMarshal,\n styleMarshal,\n getResponders,\n announce,\n autoScroller\n}) => createStore$1(reducer, composeEnhancers(applyMiddleware(style(styleMarshal), dimensionMarshalStopper(dimensionMarshal), lift(dimensionMarshal), dropMiddleware, dropAnimationFinishMiddleware, dropAnimationFlushOnScrollMiddleware, pendingDrop, autoScroll(autoScroller), scrollListener, focus(focusMarshal), responders(getResponders, announce))));\n\nconst clean$1 = () => ({\n additions: {},\n removals: {},\n modified: {}\n});\nfunction createPublisher({\n registry,\n callbacks\n}) {\n let staging = clean$1();\n let frameId = null;\n const collect = () => {\n if (frameId) {\n return;\n }\n callbacks.collectionStarting();\n frameId = requestAnimationFrame(() => {\n frameId = null;\n start();\n const {\n additions,\n removals,\n modified\n } = staging;\n const added = Object.keys(additions).map(id => registry.draggable.getById(id).getDimension(origin)).sort((a, b) => a.descriptor.index - b.descriptor.index);\n const updated = Object.keys(modified).map(id => {\n const entry = registry.droppable.getById(id);\n const scroll = entry.callbacks.getScrollWhileDragging();\n return {\n droppableId: id,\n scroll\n };\n });\n const result = {\n additions: added,\n removals: Object.keys(removals),\n modified: updated\n };\n staging = clean$1();\n finish();\n callbacks.publish(result);\n });\n };\n const add = entry => {\n const id = entry.descriptor.id;\n staging.additions[id] = entry;\n staging.modified[entry.descriptor.droppableId] = true;\n if (staging.removals[id]) {\n delete staging.removals[id];\n }\n collect();\n };\n const remove = entry => {\n const descriptor = entry.descriptor;\n staging.removals[descriptor.id] = true;\n staging.modified[descriptor.droppableId] = true;\n if (staging.additions[descriptor.id]) {\n delete staging.additions[descriptor.id];\n }\n collect();\n };\n const stop = () => {\n if (!frameId) {\n return;\n }\n cancelAnimationFrame(frameId);\n frameId = null;\n staging = clean$1();\n };\n return {\n add,\n remove,\n stop\n };\n}\n\nvar getMaxScroll = ({\n scrollHeight,\n scrollWidth,\n height,\n width\n}) => {\n const maxScroll = subtract({\n x: scrollWidth,\n y: scrollHeight\n }, {\n x: width,\n y: height\n });\n const adjustedMaxScroll = {\n x: Math.max(0, maxScroll.x),\n y: Math.max(0, maxScroll.y)\n };\n return adjustedMaxScroll;\n};\n\nvar getDocumentElement = () => {\n const doc = document.documentElement;\n !doc ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot find document.documentElement') : invariant() : void 0;\n return doc;\n};\n\nvar getMaxWindowScroll = () => {\n const doc = getDocumentElement();\n const maxScroll = getMaxScroll({\n scrollHeight: doc.scrollHeight,\n scrollWidth: doc.scrollWidth,\n width: doc.clientWidth,\n height: doc.clientHeight\n });\n return maxScroll;\n};\n\nvar getViewport = () => {\n const scroll = getWindowScroll();\n const maxScroll = getMaxWindowScroll();\n const top = scroll.y;\n const left = scroll.x;\n const doc = getDocumentElement();\n const width = doc.clientWidth;\n const height = doc.clientHeight;\n const right = left + width;\n const bottom = top + height;\n const frame = getRect({\n top,\n left,\n right,\n bottom\n });\n const viewport = {\n frame,\n scroll: {\n initial: scroll,\n current: scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin\n }\n }\n };\n return viewport;\n};\n\nvar getInitialPublish = ({\n critical,\n scrollOptions,\n registry\n}) => {\n start();\n const viewport = getViewport();\n const windowScroll = viewport.scroll.current;\n const home = critical.droppable;\n const droppables = registry.droppable.getAllByType(home.type).map(entry => entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions));\n const draggables = registry.draggable.getAllByType(critical.draggable.type).map(entry => entry.getDimension(windowScroll));\n const dimensions = {\n draggables: toDraggableMap(draggables),\n droppables: toDroppableMap(droppables)\n };\n finish();\n const result = {\n dimensions,\n critical,\n viewport\n };\n return result;\n};\n\nfunction shouldPublishUpdate(registry, dragging, entry) {\n if (entry.descriptor.id === dragging.id) {\n return false;\n }\n if (entry.descriptor.type !== dragging.type) {\n return false;\n }\n const home = registry.droppable.getById(entry.descriptor.droppableId);\n if (home.descriptor.mode !== 'virtual') {\n process.env.NODE_ENV !== \"production\" ? warning(`\n You are attempting to add or remove a Draggable [id: ${entry.descriptor.id}]\n while a drag is occurring. This is only supported for virtual lists.\n\n See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md\n `) : void 0;\n return false;\n }\n return true;\n}\nvar createDimensionMarshal = (registry, callbacks) => {\n let collection = null;\n const publisher = createPublisher({\n callbacks: {\n publish: callbacks.publishWhileDragging,\n collectionStarting: callbacks.collectionStarting\n },\n registry\n });\n const updateDroppableIsEnabled = (id, isEnabled) => {\n !registry.droppable.exists(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot update is enabled flag of Droppable ${id} as it is not registered`) : invariant() : void 0;\n if (!collection) {\n return;\n }\n callbacks.updateDroppableIsEnabled({\n id,\n isEnabled\n });\n };\n const updateDroppableIsCombineEnabled = (id, isCombineEnabled) => {\n if (!collection) {\n return;\n }\n !registry.droppable.exists(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot update isCombineEnabled flag of Droppable ${id} as it is not registered`) : invariant() : void 0;\n callbacks.updateDroppableIsCombineEnabled({\n id,\n isCombineEnabled\n });\n };\n const updateDroppableScroll = (id, newScroll) => {\n if (!collection) {\n return;\n }\n !registry.droppable.exists(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot update the scroll on Droppable ${id} as it is not registered`) : invariant() : void 0;\n callbacks.updateDroppableScroll({\n id,\n newScroll\n });\n };\n const scrollDroppable = (id, change) => {\n if (!collection) {\n return;\n }\n registry.droppable.getById(id).callbacks.scroll(change);\n };\n const stopPublishing = () => {\n if (!collection) {\n return;\n }\n publisher.stop();\n const home = collection.critical.droppable;\n registry.droppable.getAllByType(home.type).forEach(entry => entry.callbacks.dragStopped());\n collection.unsubscribe();\n collection = null;\n };\n const subscriber = event => {\n !collection ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Should only be subscribed when a collection is occurring') : invariant() : void 0;\n const dragging = collection.critical.draggable;\n if (event.type === 'ADDITION') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.add(event.value);\n }\n }\n if (event.type === 'REMOVAL') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.remove(event.value);\n }\n }\n };\n const startPublishing = request => {\n !!collection ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot start capturing critical dimensions as there is already a collection') : invariant() : void 0;\n const entry = registry.draggable.getById(request.draggableId);\n const home = registry.droppable.getById(entry.descriptor.droppableId);\n const critical = {\n draggable: entry.descriptor,\n droppable: home.descriptor\n };\n const unsubscribe = registry.subscribe(subscriber);\n collection = {\n critical,\n unsubscribe\n };\n return getInitialPublish({\n critical,\n registry,\n scrollOptions: request.scrollOptions\n });\n };\n const marshal = {\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n scrollDroppable,\n updateDroppableScroll,\n startPublishing,\n stopPublishing\n };\n return marshal;\n};\n\nvar canStartDrag = (state, id) => {\n if (state.phase === 'IDLE') {\n return true;\n }\n if (state.phase !== 'DROP_ANIMATING') {\n return false;\n }\n if (state.completed.result.draggableId === id) {\n return false;\n }\n return state.completed.result.reason === 'DROP';\n};\n\nvar scrollWindow = change => {\n window.scrollBy(change.x, change.y);\n};\n\nconst getScrollableDroppables = memoizeOne(droppables => toDroppableList(droppables).filter(droppable => {\n if (!droppable.isEnabled) {\n return false;\n }\n if (!droppable.frame) {\n return false;\n }\n return true;\n}));\nconst getScrollableDroppableOver = (target, droppables) => {\n const maybe = getScrollableDroppables(droppables).find(droppable => {\n !droppable.frame ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Invalid result') : invariant() : void 0;\n return isPositionInFrame(droppable.frame.pageMarginBox)(target);\n }) || null;\n return maybe;\n};\nvar getBestScrollableDroppable = ({\n center,\n destination,\n droppables\n}) => {\n if (destination) {\n const dimension = droppables[destination];\n if (!dimension.frame) {\n return null;\n }\n return dimension;\n }\n const dimension = getScrollableDroppableOver(center, droppables);\n return dimension;\n};\n\nconst defaultAutoScrollerOptions = {\n startFromPercentage: 0.25,\n maxScrollAtPercentage: 0.05,\n maxPixelScroll: 28,\n ease: percentage => percentage ** 2,\n durationDampening: {\n stopDampeningAt: 1200,\n accelerateAt: 360\n },\n disabled: false\n};\n\nvar getDistanceThresholds = (container, axis, getAutoScrollerOptions = () => defaultAutoScrollerOptions) => {\n const autoScrollerOptions = getAutoScrollerOptions();\n const startScrollingFrom = container[axis.size] * autoScrollerOptions.startFromPercentage;\n const maxScrollValueAt = container[axis.size] * autoScrollerOptions.maxScrollAtPercentage;\n const thresholds = {\n startScrollingFrom,\n maxScrollValueAt\n };\n return thresholds;\n};\n\nvar getPercentage = ({\n startOfRange,\n endOfRange,\n current\n}) => {\n const range = endOfRange - startOfRange;\n if (range === 0) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n `) : void 0;\n return 0;\n }\n const currentInRange = current - startOfRange;\n const percentage = currentInRange / range;\n return percentage;\n};\n\nvar minScroll = 1;\n\nvar getValueFromDistance = (distanceToEdge, thresholds, getAutoScrollerOptions = () => defaultAutoScrollerOptions) => {\n const autoScrollerOptions = getAutoScrollerOptions();\n if (distanceToEdge > thresholds.startScrollingFrom) {\n return 0;\n }\n if (distanceToEdge <= thresholds.maxScrollValueAt) {\n return autoScrollerOptions.maxPixelScroll;\n }\n if (distanceToEdge === thresholds.startScrollingFrom) {\n return minScroll;\n }\n const percentageFromMaxScrollValueAt = getPercentage({\n startOfRange: thresholds.maxScrollValueAt,\n endOfRange: thresholds.startScrollingFrom,\n current: distanceToEdge\n });\n const percentageFromStartScrollingFrom = 1 - percentageFromMaxScrollValueAt;\n const scroll = autoScrollerOptions.maxPixelScroll * autoScrollerOptions.ease(percentageFromStartScrollingFrom);\n return Math.ceil(scroll);\n};\n\nvar dampenValueByTime = (proposedScroll, dragStartTime, getAutoScrollerOptions) => {\n const autoScrollerOptions = getAutoScrollerOptions();\n const accelerateAt = autoScrollerOptions.durationDampening.accelerateAt;\n const stopAt = autoScrollerOptions.durationDampening.stopDampeningAt;\n const startOfRange = dragStartTime;\n const endOfRange = stopAt;\n const now = Date.now();\n const runTime = now - startOfRange;\n if (runTime >= stopAt) {\n return proposedScroll;\n }\n if (runTime < accelerateAt) {\n return minScroll;\n }\n const betweenAccelerateAtAndStopAtPercentage = getPercentage({\n startOfRange: accelerateAt,\n endOfRange,\n current: runTime\n });\n const scroll = proposedScroll * autoScrollerOptions.ease(betweenAccelerateAtAndStopAtPercentage);\n return Math.ceil(scroll);\n};\n\nvar getValue = ({\n distanceToEdge,\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const scroll = getValueFromDistance(distanceToEdge, thresholds, getAutoScrollerOptions);\n if (scroll === 0) {\n return 0;\n }\n if (!shouldUseTimeDampening) {\n return scroll;\n }\n return Math.max(dampenValueByTime(scroll, dragStartTime, getAutoScrollerOptions), minScroll);\n};\n\nvar getScrollOnAxis = ({\n container,\n distanceToEdges,\n dragStartTime,\n axis,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const thresholds = getDistanceThresholds(container, axis, getAutoScrollerOptions);\n const isCloserToEnd = distanceToEdges[axis.end] < distanceToEdges[axis.start];\n if (isCloserToEnd) {\n return getValue({\n distanceToEdge: distanceToEdges[axis.end],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n }\n return -1 * getValue({\n distanceToEdge: distanceToEdges[axis.start],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n};\n\nvar adjustForSizeLimits = ({\n container,\n subject,\n proposedScroll\n}) => {\n const isTooBigVertically = subject.height > container.height;\n const isTooBigHorizontally = subject.width > container.width;\n if (!isTooBigHorizontally && !isTooBigVertically) {\n return proposedScroll;\n }\n if (isTooBigHorizontally && isTooBigVertically) {\n return null;\n }\n return {\n x: isTooBigHorizontally ? 0 : proposedScroll.x,\n y: isTooBigVertically ? 0 : proposedScroll.y\n };\n};\n\nconst clean = apply(value => value === 0 ? 0 : value);\nvar getScroll$1 = ({\n dragStartTime,\n container,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const distanceToEdges = {\n top: center.y - container.top,\n right: container.right - center.x,\n bottom: container.bottom - center.y,\n left: center.x - container.left\n };\n const y = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: vertical,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n const x = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: horizontal,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n const required = clean({\n x,\n y\n });\n if (isEqual$1(required, origin)) {\n return null;\n }\n const limited = adjustForSizeLimits({\n container,\n subject,\n proposedScroll: required\n });\n if (!limited) {\n return null;\n }\n return isEqual$1(limited, origin) ? null : limited;\n};\n\nconst smallestSigned = apply(value => {\n if (value === 0) {\n return 0;\n }\n return value > 0 ? 1 : -1;\n});\nconst getOverlap = (() => {\n const getRemainder = (target, max) => {\n if (target < 0) {\n return target;\n }\n if (target > max) {\n return target - max;\n }\n return 0;\n };\n return ({\n current,\n max,\n change\n }) => {\n const targetScroll = add(current, change);\n const overlap = {\n x: getRemainder(targetScroll.x, max.x),\n y: getRemainder(targetScroll.y, max.y)\n };\n if (isEqual$1(overlap, origin)) {\n return null;\n }\n return overlap;\n };\n})();\nconst canPartiallyScroll = ({\n max: rawMax,\n current,\n change\n}) => {\n const max = {\n x: Math.max(current.x, rawMax.x),\n y: Math.max(current.y, rawMax.y)\n };\n const smallestChange = smallestSigned(change);\n const overlap = getOverlap({\n max,\n current,\n change: smallestChange\n });\n if (!overlap) {\n return true;\n }\n if (smallestChange.x !== 0 && overlap.x === 0) {\n return true;\n }\n if (smallestChange.y !== 0 && overlap.y === 0) {\n return true;\n }\n return false;\n};\nconst canScrollWindow = (viewport, change) => canPartiallyScroll({\n current: viewport.scroll.current,\n max: viewport.scroll.max,\n change\n});\nconst getWindowOverlap = (viewport, change) => {\n if (!canScrollWindow(viewport, change)) {\n return null;\n }\n const max = viewport.scroll.max;\n const current = viewport.scroll.current;\n return getOverlap({\n current,\n max,\n change\n });\n};\nconst canScrollDroppable = (droppable, change) => {\n const frame = droppable.frame;\n if (!frame) {\n return false;\n }\n return canPartiallyScroll({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change\n });\n};\nconst getDroppableOverlap = (droppable, change) => {\n const frame = droppable.frame;\n if (!frame) {\n return null;\n }\n if (!canScrollDroppable(droppable, change)) {\n return null;\n }\n return getOverlap({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change\n });\n};\n\nvar getWindowScrollChange = ({\n viewport,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const scroll = getScroll$1({\n dragStartTime,\n container: viewport.frame,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n return scroll && canScrollWindow(viewport, scroll) ? scroll : null;\n};\n\nvar getDroppableScrollChange = ({\n droppable,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const frame = droppable.frame;\n if (!frame) {\n return null;\n }\n const scroll = getScroll$1({\n dragStartTime,\n container: frame.pageMarginBox,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n return scroll && canScrollDroppable(droppable, scroll) ? scroll : null;\n};\n\nvar scroll = ({\n state,\n dragStartTime,\n shouldUseTimeDampening,\n scrollWindow,\n scrollDroppable,\n getAutoScrollerOptions\n}) => {\n const center = state.current.page.borderBoxCenter;\n const draggable = state.dimensions.draggables[state.critical.draggable.id];\n const subject = draggable.page.marginBox;\n if (state.isWindowScrollAllowed) {\n const viewport = state.viewport;\n const change = getWindowScrollChange({\n dragStartTime,\n viewport,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n if (change) {\n scrollWindow(change);\n return;\n }\n }\n const droppable = getBestScrollableDroppable({\n center,\n destination: whatIsDraggedOver(state.impact),\n droppables: state.dimensions.droppables\n });\n if (!droppable) {\n return;\n }\n const change = getDroppableScrollChange({\n dragStartTime,\n droppable,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n if (change) {\n scrollDroppable(droppable.descriptor.id, change);\n }\n};\n\nvar createFluidScroller = ({\n scrollWindow,\n scrollDroppable,\n getAutoScrollerOptions = () => defaultAutoScrollerOptions\n}) => {\n const scheduleWindowScroll = rafSchd(scrollWindow);\n const scheduleDroppableScroll = rafSchd(scrollDroppable);\n let dragging = null;\n const tryScroll = state => {\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fluid scroll if not dragging') : invariant() : void 0;\n const {\n shouldUseTimeDampening,\n dragStartTime\n } = dragging;\n scroll({\n state,\n scrollWindow: scheduleWindowScroll,\n scrollDroppable: scheduleDroppableScroll,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n };\n const start$1 = state => {\n start();\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot start auto scrolling when already started') : invariant() : void 0;\n const dragStartTime = Date.now();\n let wasScrollNeeded = false;\n const fakeScrollCallback = () => {\n wasScrollNeeded = true;\n };\n scroll({\n state,\n dragStartTime: 0,\n shouldUseTimeDampening: false,\n scrollWindow: fakeScrollCallback,\n scrollDroppable: fakeScrollCallback,\n getAutoScrollerOptions\n });\n dragging = {\n dragStartTime,\n shouldUseTimeDampening: wasScrollNeeded\n };\n finish();\n if (wasScrollNeeded) {\n tryScroll(state);\n }\n };\n const stop = () => {\n if (!dragging) {\n return;\n }\n scheduleWindowScroll.cancel();\n scheduleDroppableScroll.cancel();\n dragging = null;\n };\n return {\n start: start$1,\n stop,\n scroll: tryScroll\n };\n};\n\nvar createJumpScroller = ({\n move,\n scrollDroppable,\n scrollWindow\n}) => {\n const moveByOffset = (state, offset) => {\n const client = add(state.current.client.selection, offset);\n move({\n client\n });\n };\n const scrollDroppableAsMuchAsItCan = (droppable, change) => {\n if (!canScrollDroppable(droppable, change)) {\n return change;\n }\n const overlap = getDroppableOverlap(droppable, change);\n if (!overlap) {\n scrollDroppable(droppable.descriptor.id, change);\n return null;\n }\n const whatTheDroppableCanScroll = subtract(change, overlap);\n scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);\n const remainder = subtract(change, whatTheDroppableCanScroll);\n return remainder;\n };\n const scrollWindowAsMuchAsItCan = (isWindowScrollAllowed, viewport, change) => {\n if (!isWindowScrollAllowed) {\n return change;\n }\n if (!canScrollWindow(viewport, change)) {\n return change;\n }\n const overlap = getWindowOverlap(viewport, change);\n if (!overlap) {\n scrollWindow(change);\n return null;\n }\n const whatTheWindowCanScroll = subtract(change, overlap);\n scrollWindow(whatTheWindowCanScroll);\n const remainder = subtract(change, whatTheWindowCanScroll);\n return remainder;\n };\n const jumpScroller = state => {\n const request = state.scrollJumpRequest;\n if (!request) {\n return;\n }\n const destination = whatIsDraggedOver(state.impact);\n !destination ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot perform a jump scroll when there is no destination') : invariant() : void 0;\n const droppableRemainder = scrollDroppableAsMuchAsItCan(state.dimensions.droppables[destination], request);\n if (!droppableRemainder) {\n return;\n }\n const viewport = state.viewport;\n const windowRemainder = scrollWindowAsMuchAsItCan(state.isWindowScrollAllowed, viewport, droppableRemainder);\n if (!windowRemainder) {\n return;\n }\n moveByOffset(state, windowRemainder);\n };\n return jumpScroller;\n};\n\nvar createAutoScroller = ({\n scrollDroppable,\n scrollWindow,\n move,\n getAutoScrollerOptions\n}) => {\n const fluidScroller = createFluidScroller({\n scrollWindow,\n scrollDroppable,\n getAutoScrollerOptions\n });\n const jumpScroll = createJumpScroller({\n move,\n scrollWindow,\n scrollDroppable\n });\n const scroll = state => {\n const autoScrollerOptions = getAutoScrollerOptions();\n if (autoScrollerOptions.disabled || state.phase !== 'DRAGGING') {\n return;\n }\n if (state.movementMode === 'FLUID') {\n fluidScroller.scroll(state);\n return;\n }\n if (!state.scrollJumpRequest) {\n return;\n }\n jumpScroll(state);\n };\n const scroller = {\n scroll,\n start: fluidScroller.start,\n stop: fluidScroller.stop\n };\n return scroller;\n};\n\nconst prefix = 'data-rfd';\nconst dragHandle = (() => {\n const base = `${prefix}-drag-handle`;\n return {\n base,\n draggableId: `${base}-draggable-id`,\n contextId: `${base}-context-id`\n };\n})();\nconst draggable = (() => {\n const base = `${prefix}-draggable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`\n };\n})();\nconst droppable = (() => {\n const base = `${prefix}-droppable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`\n };\n})();\nconst scrollContainer = {\n contextId: `${prefix}-scroll-container-context-id`\n};\n\nconst makeGetSelector = context => attribute => `[${attribute}=\"${context}\"]`;\nconst getStyles = (rules, property) => rules.map(rule => {\n const value = rule.styles[property];\n if (!value) {\n return '';\n }\n return `${rule.selector} { ${value} }`;\n}).join(' ');\nconst noPointerEvents = 'pointer-events: none;';\nvar getStyles$1 = contextId => {\n const getSelector = makeGetSelector(contextId);\n const dragHandle$1 = (() => {\n const grabCursor = `\n cursor: -webkit-grab;\n cursor: grab;\n `;\n return {\n selector: getSelector(dragHandle.contextId),\n styles: {\n always: `\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n `,\n resting: grabCursor,\n dragging: noPointerEvents,\n dropAnimating: grabCursor\n }\n };\n })();\n const draggable$1 = (() => {\n const transition = `\n transition: ${transitions.outOfTheWay};\n `;\n return {\n selector: getSelector(draggable.contextId),\n styles: {\n dragging: transition,\n dropAnimating: transition,\n userCancel: transition\n }\n };\n })();\n const droppable$1 = {\n selector: getSelector(droppable.contextId),\n styles: {\n always: `overflow-anchor: none;`\n }\n };\n const body = {\n selector: 'body',\n styles: {\n dragging: `\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n `\n }\n };\n const rules = [draggable$1, dragHandle$1, droppable$1, body];\n return {\n always: getStyles(rules, 'always'),\n resting: getStyles(rules, 'resting'),\n dragging: getStyles(rules, 'dragging'),\n dropAnimating: getStyles(rules, 'dropAnimating'),\n userCancel: getStyles(rules, 'userCancel')\n };\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst getHead = () => {\n const head = document.querySelector('head');\n !head ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot find the head to append a style to') : invariant() : void 0;\n return head;\n};\nconst createStyleEl = nonce => {\n const el = document.createElement('style');\n if (nonce) {\n el.setAttribute('nonce', nonce);\n }\n el.type = 'text/css';\n return el;\n};\nfunction useStyleMarshal(contextId, nonce) {\n const styles = useMemo(() => getStyles$1(contextId), [contextId]);\n const alwaysRef = useRef(null);\n const dynamicRef = useRef(null);\n const setDynamicStyle = useCallback(memoizeOne(proposed => {\n const el = dynamicRef.current;\n !el ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot set dynamic style element if it is not set') : invariant() : void 0;\n el.textContent = proposed;\n }), []);\n const setAlwaysStyle = useCallback(proposed => {\n const el = alwaysRef.current;\n !el ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot set dynamic style element if it is not set') : invariant() : void 0;\n el.textContent = proposed;\n }, []);\n useIsomorphicLayoutEffect(() => {\n !(!alwaysRef.current && !dynamicRef.current) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'style elements already mounted') : invariant() : void 0;\n const always = createStyleEl(nonce);\n const dynamic = createStyleEl(nonce);\n alwaysRef.current = always;\n dynamicRef.current = dynamic;\n always.setAttribute(`${prefix}-always`, contextId);\n dynamic.setAttribute(`${prefix}-dynamic`, contextId);\n getHead().appendChild(always);\n getHead().appendChild(dynamic);\n setAlwaysStyle(styles.always);\n setDynamicStyle(styles.resting);\n return () => {\n const remove = ref => {\n const current = ref.current;\n !current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot unmount ref as it is not set') : invariant() : void 0;\n getHead().removeChild(current);\n ref.current = null;\n };\n remove(alwaysRef);\n remove(dynamicRef);\n };\n }, [nonce, setAlwaysStyle, setDynamicStyle, styles.always, styles.resting, contextId]);\n const dragging = useCallback(() => setDynamicStyle(styles.dragging), [setDynamicStyle, styles.dragging]);\n const dropping = useCallback(reason => {\n if (reason === 'DROP') {\n setDynamicStyle(styles.dropAnimating);\n return;\n }\n setDynamicStyle(styles.userCancel);\n }, [setDynamicStyle, styles.dropAnimating, styles.userCancel]);\n const resting = useCallback(() => {\n if (!dynamicRef.current) {\n return;\n }\n setDynamicStyle(styles.resting);\n }, [setDynamicStyle, styles.resting]);\n const marshal = useMemo(() => ({\n dragging,\n dropping,\n resting\n }), [dragging, dropping, resting]);\n return marshal;\n}\n\nfunction querySelectorAll(parentNode, selector) {\n return Array.from(parentNode.querySelectorAll(selector));\n}\n\nvar getWindowFromEl = el => {\n if (el && el.ownerDocument && el.ownerDocument.defaultView) {\n return el.ownerDocument.defaultView;\n }\n return window;\n};\n\nfunction isHtmlElement(el) {\n return el instanceof getWindowFromEl(el).HTMLElement;\n}\n\nfunction findDragHandle(contextId, draggableId) {\n const selector = `[${dragHandle.contextId}=\"${contextId}\"]`;\n const possible = querySelectorAll(document, selector);\n if (!possible.length) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find any drag handles in the context \"${contextId}\"`) : void 0;\n return null;\n }\n const handle = possible.find(el => {\n return el.getAttribute(dragHandle.draggableId) === draggableId;\n });\n if (!handle) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find drag handle with id \"${draggableId}\" as no handle with a matching id was found`) : void 0;\n return null;\n }\n if (!isHtmlElement(handle)) {\n process.env.NODE_ENV !== \"production\" ? warning('drag handle needs to be a HTMLElement') : void 0;\n return null;\n }\n return handle;\n}\n\nfunction useFocusMarshal(contextId) {\n const entriesRef = useRef({});\n const recordRef = useRef(null);\n const restoreFocusFrameRef = useRef(null);\n const isMountedRef = useRef(false);\n const register = useCallback(function register(id, focus) {\n const entry = {\n id,\n focus\n };\n entriesRef.current[id] = entry;\n return function unregister() {\n const entries = entriesRef.current;\n const current = entries[id];\n if (current !== entry) {\n delete entries[id];\n }\n };\n }, []);\n const tryGiveFocus = useCallback(function tryGiveFocus(tryGiveFocusTo) {\n const handle = findDragHandle(contextId, tryGiveFocusTo);\n if (handle && handle !== document.activeElement) {\n handle.focus();\n }\n }, [contextId]);\n const tryShiftRecord = useCallback(function tryShiftRecord(previous, redirectTo) {\n if (recordRef.current === previous) {\n recordRef.current = redirectTo;\n }\n }, []);\n const tryRestoreFocusRecorded = useCallback(function tryRestoreFocusRecorded() {\n if (restoreFocusFrameRef.current) {\n return;\n }\n if (!isMountedRef.current) {\n return;\n }\n restoreFocusFrameRef.current = requestAnimationFrame(() => {\n restoreFocusFrameRef.current = null;\n const record = recordRef.current;\n if (record) {\n tryGiveFocus(record);\n }\n });\n }, [tryGiveFocus]);\n const tryRecordFocus = useCallback(function tryRecordFocus(id) {\n recordRef.current = null;\n const focused = document.activeElement;\n if (!focused) {\n return;\n }\n if (focused.getAttribute(dragHandle.draggableId) !== id) {\n return;\n }\n recordRef.current = id;\n }, []);\n useIsomorphicLayoutEffect(() => {\n isMountedRef.current = true;\n return function clearFrameOnUnmount() {\n isMountedRef.current = false;\n const frameId = restoreFocusFrameRef.current;\n if (frameId) {\n cancelAnimationFrame(frameId);\n }\n };\n }, []);\n const marshal = useMemo(() => ({\n register,\n tryRecordFocus,\n tryRestoreFocusRecorded,\n tryShiftRecord\n }), [register, tryRecordFocus, tryRestoreFocusRecorded, tryShiftRecord]);\n return marshal;\n}\n\nfunction createRegistry() {\n const entries = {\n draggables: {},\n droppables: {}\n };\n const subscribers = [];\n function subscribe(cb) {\n subscribers.push(cb);\n return function unsubscribe() {\n const index = subscribers.indexOf(cb);\n if (index === -1) {\n return;\n }\n subscribers.splice(index, 1);\n };\n }\n function notify(event) {\n if (subscribers.length) {\n subscribers.forEach(cb => cb(event));\n }\n }\n function findDraggableById(id) {\n return entries.draggables[id] || null;\n }\n function getDraggableById(id) {\n const entry = findDraggableById(id);\n !entry ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find draggable entry with id [${id}]`) : invariant() : void 0;\n return entry;\n }\n const draggableAPI = {\n register: entry => {\n entries.draggables[entry.descriptor.id] = entry;\n notify({\n type: 'ADDITION',\n value: entry\n });\n },\n update: (entry, last) => {\n const current = entries.draggables[last.descriptor.id];\n if (!current) {\n return;\n }\n if (current.uniqueId !== entry.uniqueId) {\n return;\n }\n delete entries.draggables[last.descriptor.id];\n entries.draggables[entry.descriptor.id] = entry;\n },\n unregister: entry => {\n const draggableId = entry.descriptor.id;\n const current = findDraggableById(draggableId);\n if (!current) {\n return;\n }\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n delete entries.draggables[draggableId];\n if (entries.droppables[entry.descriptor.droppableId]) {\n notify({\n type: 'REMOVAL',\n value: entry\n });\n }\n },\n getById: getDraggableById,\n findById: findDraggableById,\n exists: id => Boolean(findDraggableById(id)),\n getAllByType: type => Object.values(entries.draggables).filter(entry => entry.descriptor.type === type)\n };\n function findDroppableById(id) {\n return entries.droppables[id] || null;\n }\n function getDroppableById(id) {\n const entry = findDroppableById(id);\n !entry ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find droppable entry with id [${id}]`) : invariant() : void 0;\n return entry;\n }\n const droppableAPI = {\n register: entry => {\n entries.droppables[entry.descriptor.id] = entry;\n },\n unregister: entry => {\n const current = findDroppableById(entry.descriptor.id);\n if (!current) {\n return;\n }\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n delete entries.droppables[entry.descriptor.id];\n },\n getById: getDroppableById,\n findById: findDroppableById,\n exists: id => Boolean(findDroppableById(id)),\n getAllByType: type => Object.values(entries.droppables).filter(entry => entry.descriptor.type === type)\n };\n function clean() {\n entries.draggables = {};\n entries.droppables = {};\n subscribers.length = 0;\n }\n return {\n draggable: draggableAPI,\n droppable: droppableAPI,\n subscribe,\n clean\n };\n}\n\nfunction useRegistry() {\n const registry = useMemo(createRegistry, []);\n useEffect(() => {\n return function unmount() {\n registry.clean();\n };\n }, [registry]);\n return registry;\n}\n\nvar StoreContext = React.createContext(null);\n\nvar getBodyElement = () => {\n const body = document.body;\n !body ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot find document.body') : invariant() : void 0;\n return body;\n};\n\nconst visuallyHidden = {\n position: 'absolute',\n width: '1px',\n height: '1px',\n margin: '-1px',\n border: '0',\n padding: '0',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n 'clip-path': 'inset(100%)'\n};\n\nconst getId = contextId => `rfd-announcement-${contextId}`;\nfunction useAnnouncer(contextId) {\n const id = useMemo(() => getId(contextId), [contextId]);\n const ref = useRef(null);\n useEffect(function setup() {\n const el = document.createElement('div');\n ref.current = el;\n el.id = id;\n el.setAttribute('aria-live', 'assertive');\n el.setAttribute('aria-atomic', 'true');\n _extends(el.style, visuallyHidden);\n getBodyElement().appendChild(el);\n return function cleanup() {\n setTimeout(function remove() {\n const body = getBodyElement();\n if (body.contains(el)) {\n body.removeChild(el);\n }\n if (el === ref.current) {\n ref.current = null;\n }\n });\n };\n }, [id]);\n const announce = useCallback(message => {\n const el = ref.current;\n if (el) {\n el.textContent = message;\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n \"${message}\"\n `) : void 0;\n }, []);\n return announce;\n}\n\nconst defaults = {\n separator: '::'\n};\nfunction useUniqueId(prefix, options = defaults) {\n const id = React.useId();\n return useMemo(() => `${prefix}${options.separator}${id}`, [options.separator, prefix, id]);\n}\n\nfunction getElementId({\n contextId,\n uniqueId\n}) {\n return `rfd-hidden-text-${contextId}-${uniqueId}`;\n}\nfunction useHiddenTextElement({\n contextId,\n text\n}) {\n const uniqueId = useUniqueId('hidden-text', {\n separator: '-'\n });\n const id = useMemo(() => getElementId({\n contextId,\n uniqueId\n }), [uniqueId, contextId]);\n useEffect(function mount() {\n const el = document.createElement('div');\n el.id = id;\n el.textContent = text;\n el.style.display = 'none';\n getBodyElement().appendChild(el);\n return function unmount() {\n const body = getBodyElement();\n if (body.contains(el)) {\n body.removeChild(el);\n }\n };\n }, [id, text]);\n return id;\n}\n\nvar AppContext = React.createContext(null);\n\nvar peerDependencies = {\n\treact: \"^18.0.0 || ^19.0.0\"};\n\nconst semver = /(\\d+)\\.(\\d+)\\.(\\d+)/;\nconst getVersion = value => {\n const result = semver.exec(value);\n !(result != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unable to parse React version ${value}`) : invariant() : void 0;\n const major = Number(result[1]);\n const minor = Number(result[2]);\n const patch = Number(result[3]);\n return {\n major,\n minor,\n patch,\n raw: value\n };\n};\nconst isSatisfied = (expected, actual) => {\n if (actual.major > expected.major) {\n return true;\n }\n if (actual.major < expected.major) {\n return false;\n }\n if (actual.minor > expected.minor) {\n return true;\n }\n if (actual.minor < expected.minor) {\n return false;\n }\n return actual.patch >= expected.patch;\n};\nvar checkReactVersion = (peerDepValue, actualValue) => {\n const peerDep = getVersion(peerDepValue);\n const actual = getVersion(actualValue);\n if (isSatisfied(peerDep, actual)) {\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n React version: [${actual.raw}]\n does not satisfy expected peer dependency version: [${peerDep.raw}]\n\n This can result in run time bugs, and even fatal crashes\n `) : void 0;\n};\n\nconst suffix = `\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md\n`;\nvar checkDoctype = doc => {\n const doctype = doc.doctype;\n if (!doctype) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n No <!doctype html> found.\n\n ${suffix}\n `) : void 0;\n return;\n }\n if (doctype.name.toLowerCase() !== 'html') {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Unexpected <!doctype> found: (${doctype.name})\n\n ${suffix}\n `) : void 0;\n }\n if (doctype.publicId !== '') {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Unexpected <!doctype> publicId found: (${doctype.publicId})\n A html5 doctype does not have a publicId\n\n ${suffix}\n `) : void 0;\n }\n};\n\nfunction useDev(useHook) {\n if (process.env.NODE_ENV !== 'production') {\n useHook();\n }\n}\n\nfunction useDevSetupWarning(fn, inputs) {\n useDev(() => {\n useEffect(() => {\n try {\n fn();\n } catch (e) {\n error(`\n A setup problem was encountered.\n\n > ${e.message}\n `);\n }\n }, inputs);\n });\n}\n\nfunction useStartupValidation() {\n useDevSetupWarning(() => {\n checkReactVersion(peerDependencies.react, React.version);\n checkDoctype(document);\n }, []);\n}\n\nfunction usePrevious(current) {\n const ref = useRef(current);\n useEffect(() => {\n ref.current = current;\n });\n return ref;\n}\n\nfunction create() {\n let lock = null;\n function isClaimed() {\n return Boolean(lock);\n }\n function isActive(value) {\n return value === lock;\n }\n function claim(abandon) {\n !!lock ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot claim lock as it is already claimed') : invariant() : void 0;\n const newLock = {\n abandon\n };\n lock = newLock;\n return newLock;\n }\n function release() {\n !lock ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot release lock when there is no lock') : invariant() : void 0;\n lock = null;\n }\n function tryAbandon() {\n if (lock) {\n lock.abandon();\n release();\n }\n }\n return {\n isClaimed,\n isActive,\n claim,\n release,\n tryAbandon\n };\n}\n\nfunction isDragging(state) {\n if (state.phase === 'IDLE' || state.phase === 'DROP_ANIMATING') {\n return false;\n }\n return state.isDragging;\n}\n\nconst tab = 9;\nconst enter = 13;\nconst escape = 27;\nconst space = 32;\nconst pageUp = 33;\nconst pageDown = 34;\nconst end = 35;\nconst home = 36;\nconst arrowLeft = 37;\nconst arrowUp = 38;\nconst arrowRight = 39;\nconst arrowDown = 40;\n\nconst preventedKeys = {\n [enter]: true,\n [tab]: true\n};\nvar preventStandardKeyEvents = event => {\n if (preventedKeys[event.keyCode]) {\n event.preventDefault();\n }\n};\n\nconst supportedEventName = (() => {\n const base = 'visibilitychange';\n if (typeof document === 'undefined') {\n return base;\n }\n const candidates = [base, `ms${base}`, `webkit${base}`, `moz${base}`, `o${base}`];\n const supported = candidates.find(eventName => `on${eventName}` in document);\n return supported || base;\n})();\n\nconst primaryButton = 0;\nconst sloppyClickThreshold = 5;\nfunction isSloppyClickThresholdExceeded(original, current) {\n return Math.abs(current.x - original.x) >= sloppyClickThreshold || Math.abs(current.y - original.y) >= sloppyClickThreshold;\n}\nconst idle$1 = {\n type: 'IDLE'\n};\nfunction getCaptureBindings({\n cancel,\n completed,\n getPhase,\n setPhase\n}) {\n return [{\n eventName: 'mousemove',\n fn: event => {\n const {\n button,\n clientX,\n clientY\n } = event;\n if (button !== primaryButton) {\n return;\n }\n const point = {\n x: clientX,\n y: clientY\n };\n const phase = getPhase();\n if (phase.type === 'DRAGGING') {\n event.preventDefault();\n phase.actions.move(point);\n return;\n }\n !(phase.type === 'PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot be IDLE') : invariant() : void 0;\n const pending = phase.point;\n if (!isSloppyClickThresholdExceeded(pending, point)) {\n return;\n }\n event.preventDefault();\n const actions = phase.actions.fluidLift(point);\n setPhase({\n type: 'DRAGGING',\n actions\n });\n }\n }, {\n eventName: 'mouseup',\n fn: event => {\n const phase = getPhase();\n if (phase.type !== 'DRAGGING') {\n cancel();\n return;\n }\n event.preventDefault();\n phase.actions.drop({\n shouldBlockNextClick: true\n });\n completed();\n }\n }, {\n eventName: 'mousedown',\n fn: event => {\n if (getPhase().type === 'DRAGGING') {\n event.preventDefault();\n }\n cancel();\n }\n }, {\n eventName: 'keydown',\n fn: event => {\n const phase = getPhase();\n if (phase.type === 'PENDING') {\n cancel();\n return;\n }\n if (event.keyCode === escape) {\n event.preventDefault();\n cancel();\n return;\n }\n preventStandardKeyEvents(event);\n }\n }, {\n eventName: 'resize',\n fn: cancel\n }, {\n eventName: 'scroll',\n options: {\n passive: true,\n capture: false\n },\n fn: () => {\n if (getPhase().type === 'PENDING') {\n cancel();\n }\n }\n }, {\n eventName: 'webkitmouseforcedown',\n fn: event => {\n const phase = getPhase();\n !(phase.type !== 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Unexpected phase') : invariant() : void 0;\n if (phase.actions.shouldRespectForcePress()) {\n cancel();\n return;\n }\n event.preventDefault();\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction useMouseSensor(api) {\n const phaseRef = useRef(idle$1);\n const unbindEventsRef = useRef(noop$2);\n const startCaptureBinding = useMemo(() => ({\n eventName: 'mousedown',\n fn: function onMouseDown(event) {\n if (event.defaultPrevented) {\n return;\n }\n if (event.button !== primaryButton) {\n return;\n }\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {\n return;\n }\n const draggableId = api.findClosestDraggableId(event);\n if (!draggableId) {\n return;\n }\n const actions = api.tryGetLock(draggableId, stop, {\n sourceEvent: event\n });\n if (!actions) {\n return;\n }\n event.preventDefault();\n const point = {\n x: event.clientX,\n y: event.clientY\n };\n unbindEventsRef.current();\n startPendingDrag(actions, point);\n }\n }), [api]);\n const preventForcePressBinding = useMemo(() => ({\n eventName: 'webkitmouseforcewillbegin',\n fn: event => {\n if (event.defaultPrevented) {\n return;\n }\n const id = api.findClosestDraggableId(event);\n if (!id) {\n return;\n }\n const options = api.findOptionsForDraggable(id);\n if (!options) {\n return;\n }\n if (options.shouldRespectForcePress) {\n return;\n }\n if (!api.canGetLock(id)) {\n return;\n }\n event.preventDefault();\n }\n }), [api]);\n const listenForCapture = useCallback(function listenForCapture() {\n const options = {\n passive: false,\n capture: true\n };\n unbindEventsRef.current = bindEvents(window, [preventForcePressBinding, startCaptureBinding], options);\n }, [preventForcePressBinding, startCaptureBinding]);\n const stop = useCallback(() => {\n const current = phaseRef.current;\n if (current.type === 'IDLE') {\n return;\n }\n phaseRef.current = idle$1;\n unbindEventsRef.current();\n listenForCapture();\n }, [listenForCapture]);\n const cancel = useCallback(() => {\n const phase = phaseRef.current;\n stop();\n if (phase.type === 'DRAGGING') {\n phase.actions.cancel({\n shouldBlockNextClick: true\n });\n }\n if (phase.type === 'PENDING') {\n phase.actions.abort();\n }\n }, [stop]);\n const bindCapturingEvents = useCallback(function bindCapturingEvents() {\n const options = {\n capture: true,\n passive: false\n };\n const bindings = getCaptureBindings({\n cancel,\n completed: stop,\n getPhase: () => phaseRef.current,\n setPhase: phase => {\n phaseRef.current = phase;\n }\n });\n unbindEventsRef.current = bindEvents(window, bindings, options);\n }, [cancel, stop]);\n const startPendingDrag = useCallback(function startPendingDrag(actions, point) {\n !(phaseRef.current.type === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected to move from IDLE to PENDING drag') : invariant() : void 0;\n phaseRef.current = {\n type: 'PENDING',\n point,\n actions\n };\n bindCapturingEvents();\n }, [bindCapturingEvents]);\n useIsomorphicLayoutEffect(function mount() {\n listenForCapture();\n return function unmount() {\n unbindEventsRef.current();\n };\n }, [listenForCapture]);\n}\n\nfunction noop$1() {}\nconst scrollJumpKeys = {\n [pageDown]: true,\n [pageUp]: true,\n [home]: true,\n [end]: true\n};\nfunction getDraggingBindings(actions, stop) {\n function cancel() {\n stop();\n actions.cancel();\n }\n function drop() {\n stop();\n actions.drop();\n }\n return [{\n eventName: 'keydown',\n fn: event => {\n if (event.keyCode === escape) {\n event.preventDefault();\n cancel();\n return;\n }\n if (event.keyCode === space) {\n event.preventDefault();\n drop();\n return;\n }\n if (event.keyCode === arrowDown) {\n event.preventDefault();\n actions.moveDown();\n return;\n }\n if (event.keyCode === arrowUp) {\n event.preventDefault();\n actions.moveUp();\n return;\n }\n if (event.keyCode === arrowRight) {\n event.preventDefault();\n actions.moveRight();\n return;\n }\n if (event.keyCode === arrowLeft) {\n event.preventDefault();\n actions.moveLeft();\n return;\n }\n if (scrollJumpKeys[event.keyCode]) {\n event.preventDefault();\n return;\n }\n preventStandardKeyEvents(event);\n }\n }, {\n eventName: 'mousedown',\n fn: cancel\n }, {\n eventName: 'mouseup',\n fn: cancel\n }, {\n eventName: 'click',\n fn: cancel\n }, {\n eventName: 'touchstart',\n fn: cancel\n }, {\n eventName: 'resize',\n fn: cancel\n }, {\n eventName: 'wheel',\n fn: cancel,\n options: {\n passive: true\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction useKeyboardSensor(api) {\n const unbindEventsRef = useRef(noop$1);\n const startCaptureBinding = useMemo(() => ({\n eventName: 'keydown',\n fn: function onKeyDown(event) {\n if (event.defaultPrevented) {\n return;\n }\n if (event.keyCode !== space) {\n return;\n }\n const draggableId = api.findClosestDraggableId(event);\n if (!draggableId) {\n return;\n }\n const preDrag = api.tryGetLock(draggableId, stop, {\n sourceEvent: event\n });\n if (!preDrag) {\n return;\n }\n event.preventDefault();\n let isCapturing = true;\n const actions = preDrag.snapLift();\n unbindEventsRef.current();\n function stop() {\n !isCapturing ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot stop capturing a keyboard drag when not capturing') : invariant() : void 0;\n isCapturing = false;\n unbindEventsRef.current();\n listenForCapture();\n }\n unbindEventsRef.current = bindEvents(window, getDraggingBindings(actions, stop), {\n capture: true,\n passive: false\n });\n }\n }), [api]);\n const listenForCapture = useCallback(function tryStartCapture() {\n const options = {\n passive: false,\n capture: true\n };\n unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);\n }, [startCaptureBinding]);\n useIsomorphicLayoutEffect(function mount() {\n listenForCapture();\n return function unmount() {\n unbindEventsRef.current();\n };\n }, [listenForCapture]);\n}\n\nconst idle = {\n type: 'IDLE'\n};\nconst timeForLongPress = 120;\nconst forcePressThreshold = 0.15;\nfunction getWindowBindings({\n cancel,\n getPhase\n}) {\n return [{\n eventName: 'orientationchange',\n fn: cancel\n }, {\n eventName: 'resize',\n fn: cancel\n }, {\n eventName: 'contextmenu',\n fn: event => {\n event.preventDefault();\n }\n }, {\n eventName: 'keydown',\n fn: event => {\n if (getPhase().type !== 'DRAGGING') {\n cancel();\n return;\n }\n if (event.keyCode === escape) {\n event.preventDefault();\n }\n cancel();\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction getHandleBindings({\n cancel,\n completed,\n getPhase\n}) {\n return [{\n eventName: 'touchmove',\n options: {\n capture: false\n },\n fn: event => {\n const phase = getPhase();\n if (phase.type !== 'DRAGGING') {\n cancel();\n return;\n }\n phase.hasMoved = true;\n const {\n clientX,\n clientY\n } = event.touches[0];\n const point = {\n x: clientX,\n y: clientY\n };\n event.preventDefault();\n phase.actions.move(point);\n }\n }, {\n eventName: 'touchend',\n fn: event => {\n const phase = getPhase();\n if (phase.type !== 'DRAGGING') {\n cancel();\n return;\n }\n event.preventDefault();\n phase.actions.drop({\n shouldBlockNextClick: true\n });\n completed();\n }\n }, {\n eventName: 'touchcancel',\n fn: event => {\n if (getPhase().type !== 'DRAGGING') {\n cancel();\n return;\n }\n event.preventDefault();\n cancel();\n }\n }, {\n eventName: 'touchforcechange',\n fn: event => {\n const phase = getPhase();\n !(phase.type !== 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const isForcePress = touch.force >= forcePressThreshold;\n if (!isForcePress) {\n return;\n }\n const shouldRespect = phase.actions.shouldRespectForcePress();\n if (phase.type === 'PENDING') {\n if (shouldRespect) {\n cancel();\n }\n return;\n }\n if (shouldRespect) {\n if (phase.hasMoved) {\n event.preventDefault();\n return;\n }\n cancel();\n return;\n }\n event.preventDefault();\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction useTouchSensor(api) {\n const phaseRef = useRef(idle);\n const unbindEventsRef = useRef(noop$2);\n const getPhase = useCallback(function getPhase() {\n return phaseRef.current;\n }, []);\n const setPhase = useCallback(function setPhase(phase) {\n phaseRef.current = phase;\n }, []);\n const startCaptureBinding = useMemo(() => ({\n eventName: 'touchstart',\n fn: function onTouchStart(event) {\n if (event.defaultPrevented) {\n return;\n }\n const draggableId = api.findClosestDraggableId(event);\n if (!draggableId) {\n return;\n }\n const actions = api.tryGetLock(draggableId, stop, {\n sourceEvent: event\n });\n if (!actions) {\n return;\n }\n const touch = event.touches[0];\n const {\n clientX,\n clientY\n } = touch;\n const point = {\n x: clientX,\n y: clientY\n };\n unbindEventsRef.current();\n startPendingDrag(actions, point);\n }\n }), [api]);\n const listenForCapture = useCallback(function listenForCapture() {\n const options = {\n capture: true,\n passive: false\n };\n unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);\n }, [startCaptureBinding]);\n const stop = useCallback(() => {\n const current = phaseRef.current;\n if (current.type === 'IDLE') {\n return;\n }\n if (current.type === 'PENDING') {\n clearTimeout(current.longPressTimerId);\n }\n setPhase(idle);\n unbindEventsRef.current();\n listenForCapture();\n }, [listenForCapture, setPhase]);\n const cancel = useCallback(() => {\n const phase = phaseRef.current;\n stop();\n if (phase.type === 'DRAGGING') {\n phase.actions.cancel({\n shouldBlockNextClick: true\n });\n }\n if (phase.type === 'PENDING') {\n phase.actions.abort();\n }\n }, [stop]);\n const bindCapturingEvents = useCallback(function bindCapturingEvents() {\n const options = {\n capture: true,\n passive: false\n };\n const args = {\n cancel,\n completed: stop,\n getPhase\n };\n const unbindTarget = bindEvents(window, getHandleBindings(args), options);\n const unbindWindow = bindEvents(window, getWindowBindings(args), options);\n unbindEventsRef.current = function unbindAll() {\n unbindTarget();\n unbindWindow();\n };\n }, [cancel, getPhase, stop]);\n const startDragging = useCallback(function startDragging() {\n const phase = getPhase();\n !(phase.type === 'PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot start dragging from phase ${phase.type}`) : invariant() : void 0;\n const actions = phase.actions.fluidLift(phase.point);\n setPhase({\n type: 'DRAGGING',\n actions,\n hasMoved: false\n });\n }, [getPhase, setPhase]);\n const startPendingDrag = useCallback(function startPendingDrag(actions, point) {\n !(getPhase().type === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected to move from IDLE to PENDING drag') : invariant() : void 0;\n const longPressTimerId = setTimeout(startDragging, timeForLongPress);\n setPhase({\n type: 'PENDING',\n point,\n actions,\n longPressTimerId\n });\n bindCapturingEvents();\n }, [bindCapturingEvents, getPhase, setPhase, startDragging]);\n useIsomorphicLayoutEffect(function mount() {\n listenForCapture();\n return function unmount() {\n unbindEventsRef.current();\n const phase = getPhase();\n if (phase.type === 'PENDING') {\n clearTimeout(phase.longPressTimerId);\n setPhase(idle);\n }\n };\n }, [getPhase, listenForCapture, setPhase]);\n useIsomorphicLayoutEffect(function webkitHack() {\n const unbind = bindEvents(window, [{\n eventName: 'touchmove',\n fn: () => {},\n options: {\n capture: false,\n passive: false\n }\n }]);\n return unbind;\n }, []);\n}\n\nfunction useValidateSensorHooks(sensorHooks) {\n useDev(() => {\n const previousRef = usePrevious(sensorHooks);\n useDevSetupWarning(() => {\n !(previousRef.current.length === sensorHooks.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot change the amount of sensor hooks after mounting') : invariant(false) : void 0;\n });\n });\n}\n\nconst interactiveTagNames = ['input', 'button', 'textarea', 'select', 'option', 'optgroup', 'video', 'audio'];\nfunction isAnInteractiveElement(parent, current) {\n if (current == null) {\n return false;\n }\n const hasAnInteractiveTag = interactiveTagNames.includes(current.tagName.toLowerCase());\n if (hasAnInteractiveTag) {\n return true;\n }\n const attribute = current.getAttribute('contenteditable');\n if (attribute === 'true' || attribute === '') {\n return true;\n }\n if (current === parent) {\n return false;\n }\n return isAnInteractiveElement(parent, current.parentElement);\n}\nfunction isEventInInteractiveElement(draggable, event) {\n const target = event.target;\n if (!isHtmlElement(target)) {\n return false;\n }\n return isAnInteractiveElement(draggable, target);\n}\n\nvar getBorderBoxCenterPosition = el => getRect(el.getBoundingClientRect()).center;\n\nfunction isElement(el) {\n return el instanceof getWindowFromEl(el).Element;\n}\n\nconst supportedMatchesName = (() => {\n const base = 'matches';\n if (typeof document === 'undefined') {\n return base;\n }\n const candidates = [base, 'msMatchesSelector', 'webkitMatchesSelector'];\n const value = candidates.find(name => name in Element.prototype);\n return value || base;\n})();\nfunction closestPonyfill(el, selector) {\n if (el == null) {\n return null;\n }\n if (el[supportedMatchesName](selector)) {\n return el;\n }\n return closestPonyfill(el.parentElement, selector);\n}\nfunction closest(el, selector) {\n if (el.closest) {\n return el.closest(selector);\n }\n return closestPonyfill(el, selector);\n}\n\nfunction getSelector(contextId) {\n return `[${dragHandle.contextId}=\"${contextId}\"]`;\n}\nfunction findClosestDragHandleFromEvent(contextId, event) {\n const target = event.target;\n if (!isElement(target)) {\n process.env.NODE_ENV !== \"production\" ? warning('event.target must be a Element') : void 0;\n return null;\n }\n const selector = getSelector(contextId);\n const handle = closest(target, selector);\n if (!handle) {\n return null;\n }\n if (!isHtmlElement(handle)) {\n process.env.NODE_ENV !== \"production\" ? warning('drag handle must be a HTMLElement') : void 0;\n return null;\n }\n return handle;\n}\nfunction tryGetClosestDraggableIdFromEvent(contextId, event) {\n const handle = findClosestDragHandleFromEvent(contextId, event);\n if (!handle) {\n return null;\n }\n return handle.getAttribute(dragHandle.draggableId);\n}\n\nfunction findDraggable(contextId, draggableId) {\n const selector = `[${draggable.contextId}=\"${contextId}\"]`;\n const possible = querySelectorAll(document, selector);\n const draggable$1 = possible.find(el => {\n return el.getAttribute(draggable.id) === draggableId;\n });\n if (!draggable$1) {\n return null;\n }\n if (!isHtmlElement(draggable$1)) {\n process.env.NODE_ENV !== \"production\" ? warning('Draggable element is not a HTMLElement') : void 0;\n return null;\n }\n return draggable$1;\n}\n\nfunction preventDefault(event) {\n event.preventDefault();\n}\nfunction isActive({\n expected,\n phase,\n isLockActive,\n shouldWarn\n}) {\n if (!isLockActive()) {\n if (shouldWarn) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Cannot perform action.\n The sensor no longer has an action lock.\n\n Tips:\n\n - Throw away your action handlers when forceStop() is called\n - Check actions.isActive() if you really need to\n `) : void 0;\n }\n return false;\n }\n if (expected !== phase) {\n if (shouldWarn) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Cannot perform action.\n The actions you used belong to an outdated phase\n\n Current phase: ${expected}\n You called an action from outdated phase: ${phase}\n\n Tips:\n\n - Do not use preDragActions actions after calling preDragActions.lift()\n `) : void 0;\n }\n return false;\n }\n return true;\n}\nfunction canStart({\n lockAPI,\n store,\n registry,\n draggableId\n}) {\n if (lockAPI.isClaimed()) {\n return false;\n }\n const entry = registry.draggable.findById(draggableId);\n if (!entry) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find draggable with id: ${draggableId}`) : void 0;\n return false;\n }\n if (!entry.options.isEnabled) {\n return false;\n }\n if (!canStartDrag(store.getState(), draggableId)) {\n return false;\n }\n return true;\n}\nfunction tryStart({\n lockAPI,\n contextId,\n store,\n registry,\n draggableId,\n forceSensorStop,\n sourceEvent\n}) {\n const shouldStart = canStart({\n lockAPI,\n store,\n registry,\n draggableId\n });\n if (!shouldStart) {\n return null;\n }\n const entry = registry.draggable.getById(draggableId);\n const el = findDraggable(contextId, entry.descriptor.id);\n if (!el) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find draggable element with id: ${draggableId}`) : void 0;\n return null;\n }\n if (sourceEvent && !entry.options.canDragInteractiveElements && isEventInInteractiveElement(el, sourceEvent)) {\n return null;\n }\n const lock = lockAPI.claim(forceSensorStop || noop$2);\n let phase = 'PRE_DRAG';\n function getShouldRespectForcePress() {\n return entry.options.shouldRespectForcePress;\n }\n function isLockActive() {\n return lockAPI.isActive(lock);\n }\n function tryDispatch(expected, getAction) {\n if (isActive({\n expected,\n phase,\n isLockActive,\n shouldWarn: true\n })) {\n store.dispatch(getAction());\n }\n }\n const tryDispatchWhenDragging = tryDispatch.bind(null, 'DRAGGING');\n function lift(args) {\n function completed() {\n lockAPI.release();\n phase = 'COMPLETED';\n }\n if (phase !== 'PRE_DRAG') {\n completed();\n process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot lift in phase ${phase}`) : invariant() ;\n }\n store.dispatch(lift$1(args.liftActionArgs));\n phase = 'DRAGGING';\n function finish(reason, options = {\n shouldBlockNextClick: false\n }) {\n args.cleanup();\n if (options.shouldBlockNextClick) {\n const unbind = bindEvents(window, [{\n eventName: 'click',\n fn: preventDefault,\n options: {\n once: true,\n passive: false,\n capture: true\n }\n }]);\n setTimeout(unbind);\n }\n completed();\n store.dispatch(drop({\n reason\n }));\n }\n return {\n isActive: () => isActive({\n expected: 'DRAGGING',\n phase,\n isLockActive,\n shouldWarn: false\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n drop: options => finish('DROP', options),\n cancel: options => finish('CANCEL', options),\n ...args.actions\n };\n }\n function fluidLift(clientSelection) {\n const move$1 = rafSchd(client => {\n tryDispatchWhenDragging(() => move({\n client\n }));\n });\n const api = lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection,\n movementMode: 'FLUID'\n },\n cleanup: () => move$1.cancel(),\n actions: {\n move: move$1\n }\n });\n return {\n ...api,\n move: move$1\n };\n }\n function snapLift() {\n const actions = {\n moveUp: () => tryDispatchWhenDragging(moveUp),\n moveRight: () => tryDispatchWhenDragging(moveRight),\n moveDown: () => tryDispatchWhenDragging(moveDown),\n moveLeft: () => tryDispatchWhenDragging(moveLeft)\n };\n return lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection: getBorderBoxCenterPosition(el),\n movementMode: 'SNAP'\n },\n cleanup: noop$2,\n actions\n });\n }\n function abortPreDrag() {\n const shouldRelease = isActive({\n expected: 'PRE_DRAG',\n phase,\n isLockActive,\n shouldWarn: true\n });\n if (shouldRelease) {\n lockAPI.release();\n }\n }\n const preDrag = {\n isActive: () => isActive({\n expected: 'PRE_DRAG',\n phase,\n isLockActive,\n shouldWarn: false\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n fluidLift,\n snapLift,\n abort: abortPreDrag\n };\n return preDrag;\n}\nconst defaultSensors = [useMouseSensor, useKeyboardSensor, useTouchSensor];\nfunction useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors,\n enableDefaultSensors\n}) {\n const useSensors = [...(enableDefaultSensors ? defaultSensors : []), ...(customSensors || [])];\n const lockAPI = useState(() => create())[0];\n const tryAbandonLock = useCallback(function tryAbandonLock(previous, current) {\n if (isDragging(previous) && !isDragging(current)) {\n lockAPI.tryAbandon();\n }\n }, [lockAPI]);\n useIsomorphicLayoutEffect(function listenToStore() {\n let previous = store.getState();\n const unsubscribe = store.subscribe(() => {\n const current = store.getState();\n tryAbandonLock(previous, current);\n previous = current;\n });\n return unsubscribe;\n }, [lockAPI, store, tryAbandonLock]);\n useIsomorphicLayoutEffect(() => {\n return lockAPI.tryAbandon;\n }, [lockAPI.tryAbandon]);\n const canGetLock = useCallback(draggableId => {\n return canStart({\n lockAPI,\n registry,\n store,\n draggableId\n });\n }, [lockAPI, registry, store]);\n const tryGetLock = useCallback((draggableId, forceStop, options) => tryStart({\n lockAPI,\n registry,\n contextId,\n store,\n draggableId,\n forceSensorStop: forceStop || null,\n sourceEvent: options && options.sourceEvent ? options.sourceEvent : null\n }), [contextId, lockAPI, registry, store]);\n const findClosestDraggableId = useCallback(event => tryGetClosestDraggableIdFromEvent(contextId, event), [contextId]);\n const findOptionsForDraggable = useCallback(id => {\n const entry = registry.draggable.findById(id);\n return entry ? entry.options : null;\n }, [registry.draggable]);\n const tryReleaseLock = useCallback(function tryReleaseLock() {\n if (!lockAPI.isClaimed()) {\n return;\n }\n lockAPI.tryAbandon();\n if (store.getState().phase !== 'IDLE') {\n store.dispatch(flush());\n }\n }, [lockAPI, store]);\n const isLockClaimed = useCallback(() => lockAPI.isClaimed(), [lockAPI]);\n const api = useMemo(() => ({\n canGetLock,\n tryGetLock,\n findClosestDraggableId,\n findOptionsForDraggable,\n tryReleaseLock,\n isLockClaimed\n }), [canGetLock, tryGetLock, findClosestDraggableId, findOptionsForDraggable, tryReleaseLock, isLockClaimed]);\n useValidateSensorHooks(useSensors);\n for (let i = 0; i < useSensors.length; i++) {\n useSensors[i](api);\n }\n}\n\nconst createResponders = props => ({\n onBeforeCapture: t => {\n const onBeforeCapureCallback = () => {\n if (props.onBeforeCapture) {\n props.onBeforeCapture(t);\n }\n };\n flushSync(onBeforeCapureCallback);\n },\n onBeforeDragStart: props.onBeforeDragStart,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragUpdate: props.onDragUpdate\n});\nconst createAutoScrollerOptions = props => ({\n ...defaultAutoScrollerOptions,\n ...props.autoScrollerOptions,\n durationDampening: {\n ...defaultAutoScrollerOptions.durationDampening,\n ...props.autoScrollerOptions\n }\n});\nfunction getStore(lazyRef) {\n !lazyRef.current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find store from lazy ref') : invariant() : void 0;\n return lazyRef.current;\n}\nfunction App(props) {\n const {\n contextId,\n setCallbacks,\n sensors,\n nonce,\n dragHandleUsageInstructions\n } = props;\n const lazyStoreRef = useRef(null);\n useStartupValidation();\n const lastPropsRef = usePrevious(props);\n const getResponders = useCallback(() => {\n return createResponders(lastPropsRef.current);\n }, [lastPropsRef]);\n const getAutoScrollerOptions = useCallback(() => {\n return createAutoScrollerOptions(lastPropsRef.current);\n }, [lastPropsRef]);\n const announce = useAnnouncer(contextId);\n const dragHandleUsageInstructionsId = useHiddenTextElement({\n contextId,\n text: dragHandleUsageInstructions\n });\n const styleMarshal = useStyleMarshal(contextId, nonce);\n const lazyDispatch = useCallback(action => {\n getStore(lazyStoreRef).dispatch(action);\n }, []);\n const marshalCallbacks = useMemo(() => bindActionCreators({\n publishWhileDragging,\n updateDroppableScroll,\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n collectionStarting\n }, lazyDispatch), [lazyDispatch]);\n const registry = useRegistry();\n const dimensionMarshal = useMemo(() => {\n return createDimensionMarshal(registry, marshalCallbacks);\n }, [registry, marshalCallbacks]);\n const autoScroller = useMemo(() => createAutoScroller({\n scrollWindow,\n scrollDroppable: dimensionMarshal.scrollDroppable,\n getAutoScrollerOptions,\n ...bindActionCreators({\n move\n }, lazyDispatch)\n }), [dimensionMarshal.scrollDroppable, lazyDispatch, getAutoScrollerOptions]);\n const focusMarshal = useFocusMarshal(contextId);\n const store = useMemo(() => createStore({\n announce,\n autoScroller,\n dimensionMarshal,\n focusMarshal,\n getResponders,\n styleMarshal\n }), [announce, autoScroller, dimensionMarshal, focusMarshal, getResponders, styleMarshal]);\n if (process.env.NODE_ENV !== 'production') {\n if (lazyStoreRef.current && lazyStoreRef.current !== store) {\n process.env.NODE_ENV !== \"production\" ? warning('unexpected store change') : void 0;\n }\n }\n lazyStoreRef.current = store;\n const tryResetStore = useCallback(() => {\n const current = getStore(lazyStoreRef);\n const state = current.getState();\n if (state.phase !== 'IDLE') {\n current.dispatch(flush());\n }\n }, []);\n const isDragging = useCallback(() => {\n const state = getStore(lazyStoreRef).getState();\n if (state.phase === 'DROP_ANIMATING') {\n return true;\n }\n if (state.phase === 'IDLE') {\n return false;\n }\n return state.isDragging;\n }, []);\n const appCallbacks = useMemo(() => ({\n isDragging,\n tryAbort: tryResetStore\n }), [isDragging, tryResetStore]);\n setCallbacks(appCallbacks);\n const getCanLift = useCallback(id => canStartDrag(getStore(lazyStoreRef).getState(), id), []);\n const getIsMovementAllowed = useCallback(() => isMovementAllowed(getStore(lazyStoreRef).getState()), []);\n const appContext = useMemo(() => ({\n marshal: dimensionMarshal,\n focus: focusMarshal,\n contextId,\n canLift: getCanLift,\n isMovementAllowed: getIsMovementAllowed,\n dragHandleUsageInstructionsId,\n registry\n }), [contextId, dimensionMarshal, dragHandleUsageInstructionsId, focusMarshal, getCanLift, getIsMovementAllowed, registry]);\n useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors: sensors || null,\n enableDefaultSensors: props.enableDefaultSensors !== false\n });\n useEffect(() => {\n return tryResetStore;\n }, [tryResetStore]);\n return React.createElement(AppContext.Provider, {\n value: appContext\n }, React.createElement(Provider, {\n context: StoreContext,\n store: store\n }, props.children));\n}\n\nfunction useUniqueContextId() {\n return React.useId();\n}\n\nfunction DragDropContext(props) {\n const contextId = useUniqueContextId();\n const dragHandleUsageInstructions = props.dragHandleUsageInstructions || preset.dragHandleUsageInstructions;\n return React.createElement(ErrorBoundary, null, setCallbacks => React.createElement(App, {\n nonce: props.nonce,\n contextId: contextId,\n setCallbacks: setCallbacks,\n dragHandleUsageInstructions: dragHandleUsageInstructions,\n enableDefaultSensors: props.enableDefaultSensors,\n sensors: props.sensors,\n onBeforeCapture: props.onBeforeCapture,\n onBeforeDragStart: props.onBeforeDragStart,\n onDragStart: props.onDragStart,\n onDragUpdate: props.onDragUpdate,\n onDragEnd: props.onDragEnd,\n autoScrollerOptions: props.autoScrollerOptions\n }, props.children));\n}\n\nconst zIndexOptions = {\n dragging: 5000,\n dropAnimating: 4500\n};\nconst getDraggingTransition = (shouldAnimateDragMovement, dropping) => {\n if (dropping) {\n return transitions.drop(dropping.duration);\n }\n if (shouldAnimateDragMovement) {\n return transitions.snap;\n }\n return transitions.fluid;\n};\nconst getDraggingOpacity = (isCombining, isDropAnimating) => {\n if (!isCombining) {\n return undefined;\n }\n return isDropAnimating ? combine.opacity.drop : combine.opacity.combining;\n};\nconst getShouldDraggingAnimate = dragging => {\n if (dragging.forceShouldAnimate != null) {\n return dragging.forceShouldAnimate;\n }\n return dragging.mode === 'SNAP';\n};\nfunction getDraggingStyle(dragging) {\n const dimension = dragging.dimension;\n const box = dimension.client;\n const {\n offset,\n combineWith,\n dropping\n } = dragging;\n const isCombining = Boolean(combineWith);\n const shouldAnimate = getShouldDraggingAnimate(dragging);\n const isDropAnimating = Boolean(dropping);\n const transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset);\n const style = {\n position: 'fixed',\n top: box.marginBox.top,\n left: box.marginBox.left,\n boxSizing: 'border-box',\n width: box.borderBox.width,\n height: box.borderBox.height,\n transition: getDraggingTransition(shouldAnimate, dropping),\n transform,\n opacity: getDraggingOpacity(isCombining, isDropAnimating),\n zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,\n pointerEvents: 'none'\n };\n return style;\n}\nfunction getSecondaryStyle(secondary) {\n return {\n transform: transforms.moveTo(secondary.offset),\n transition: secondary.shouldAnimateDisplacement ? undefined : 'none'\n };\n}\nfunction getStyle$1(mapped) {\n return mapped.type === 'DRAGGING' ? getDraggingStyle(mapped) : getSecondaryStyle(mapped);\n}\n\nfunction getDimension$1(descriptor, el, windowScroll = origin) {\n const computedStyles = window.getComputedStyle(el);\n const borderBox = el.getBoundingClientRect();\n const client = calculateBox(borderBox, computedStyles);\n const page = withScroll(client, windowScroll);\n const placeholder = {\n client,\n tagName: el.tagName.toLowerCase(),\n display: computedStyles.display\n };\n const displaceBy = {\n x: client.marginBox.width,\n y: client.marginBox.height\n };\n const dimension = {\n descriptor,\n placeholder,\n displaceBy,\n client,\n page\n };\n return dimension;\n}\n\nfunction useDraggablePublisher(args) {\n const uniqueId = useUniqueId('draggable');\n const {\n descriptor,\n registry,\n getDraggableRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled\n } = args;\n const options = useMemo(() => ({\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled\n }), [canDragInteractiveElements, isEnabled, shouldRespectForcePress]);\n const getDimension = useCallback(windowScroll => {\n const el = getDraggableRef();\n !el ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot get dimension when no ref is set') : invariant() : void 0;\n return getDimension$1(descriptor, el, windowScroll);\n }, [descriptor, getDraggableRef]);\n const entry = useMemo(() => ({\n uniqueId,\n descriptor,\n options,\n getDimension\n }), [descriptor, getDimension, options, uniqueId]);\n const publishedRef = useRef(entry);\n const isFirstPublishRef = useRef(true);\n useIsomorphicLayoutEffect(() => {\n registry.draggable.register(publishedRef.current);\n return () => registry.draggable.unregister(publishedRef.current);\n }, [registry.draggable]);\n useIsomorphicLayoutEffect(() => {\n if (isFirstPublishRef.current) {\n isFirstPublishRef.current = false;\n return;\n }\n const last = publishedRef.current;\n publishedRef.current = entry;\n registry.draggable.update(entry, last);\n }, [entry, registry.draggable]);\n}\n\nvar DroppableContext = React.createContext(null);\n\nfunction checkIsValidInnerRef(el) {\n !(el && isHtmlElement(el)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md\n `) : invariant() : void 0;\n}\n\nfunction useValidation$1(props, contextId, getRef) {\n useDevSetupWarning(() => {\n function prefix(id) {\n return `Draggable[id: ${id}]: `;\n }\n const id = props.draggableId;\n !id ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Draggable requires a draggableId') : invariant(false) : void 0;\n !(typeof id === 'string') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Draggable requires a [string] draggableId.\n Provided: [type: ${typeof id}] (value: ${id})`) : invariant(false) : void 0;\n !Number.isInteger(props.index) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${prefix(id)} requires an integer index prop`) : invariant(false) : void 0;\n if (props.mapped.type === 'DRAGGING') {\n return;\n }\n checkIsValidInnerRef(getRef());\n if (props.isEnabled) {\n !findDragHandle(contextId, id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${prefix(id)} Unable to find drag handle`) : invariant(false) : void 0;\n }\n });\n}\nfunction useClonePropValidation(isClone) {\n useDev(() => {\n const initialRef = useRef(isClone);\n useDevSetupWarning(() => {\n !(isClone === initialRef.current) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Draggable isClone prop value changed during component life') : invariant(false) : void 0;\n }, [isClone]);\n });\n}\n\nfunction useRequiredContext(Context) {\n const result = useContext(Context);\n !result ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find required context') : invariant() : void 0;\n return result;\n}\n\nfunction preventHtml5Dnd(event) {\n event.preventDefault();\n}\nconst Draggable = props => {\n const ref = useRef(null);\n const setRef = useCallback((el = null) => {\n ref.current = el;\n }, []);\n const getRef = useCallback(() => ref.current, []);\n const {\n contextId,\n dragHandleUsageInstructionsId,\n registry\n } = useRequiredContext(AppContext);\n const {\n type,\n droppableId\n } = useRequiredContext(DroppableContext);\n const descriptor = useMemo(() => ({\n id: props.draggableId,\n index: props.index,\n type,\n droppableId\n }), [props.draggableId, props.index, type, droppableId]);\n const {\n children,\n draggableId,\n isEnabled,\n shouldRespectForcePress,\n canDragInteractiveElements,\n isClone,\n mapped,\n dropAnimationFinished: dropAnimationFinishedAction\n } = props;\n useValidation$1(props, contextId, getRef);\n useClonePropValidation(isClone);\n if (!isClone) {\n const forPublisher = useMemo(() => ({\n descriptor,\n registry,\n getDraggableRef: getRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled\n }), [descriptor, registry, getRef, canDragInteractiveElements, shouldRespectForcePress, isEnabled]);\n useDraggablePublisher(forPublisher);\n }\n const dragHandleProps = useMemo(() => isEnabled ? {\n tabIndex: 0,\n role: 'button',\n 'aria-describedby': dragHandleUsageInstructionsId,\n 'data-rfd-drag-handle-draggable-id': draggableId,\n 'data-rfd-drag-handle-context-id': contextId,\n draggable: false,\n onDragStart: preventHtml5Dnd\n } : null, [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled]);\n const onMoveEnd = useCallback(event => {\n if (mapped.type !== 'DRAGGING') {\n return;\n }\n if (!mapped.dropping) {\n return;\n }\n if (event.propertyName !== 'transform') {\n return;\n }\n flushSync(dropAnimationFinishedAction);\n }, [dropAnimationFinishedAction, mapped]);\n const provided = useMemo(() => {\n const style = getStyle$1(mapped);\n const onTransitionEnd = mapped.type === 'DRAGGING' && mapped.dropping ? onMoveEnd : undefined;\n const result = {\n innerRef: setRef,\n draggableProps: {\n 'data-rfd-draggable-context-id': contextId,\n 'data-rfd-draggable-id': draggableId,\n style,\n onTransitionEnd\n },\n dragHandleProps\n };\n return result;\n }, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);\n const rubric = useMemo(() => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId\n }\n }), [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type]);\n return React.createElement(React.Fragment, null, children(provided, mapped.snapshot, rubric));\n};\n\nvar isStrictEqual = (a, b) => a === b;\n\nvar whatIsDraggedOverFromResult = result => {\n const {\n combine,\n destination\n } = result;\n if (destination) {\n return destination.droppableId;\n }\n if (combine) {\n return combine.droppableId;\n }\n return null;\n};\n\nconst getCombineWithFromResult = result => {\n return result.combine ? result.combine.draggableId : null;\n};\nconst getCombineWithFromImpact = impact => {\n return impact.at && impact.at.type === 'COMBINE' ? impact.at.combine.draggableId : null;\n};\nfunction getDraggableSelector() {\n const memoizedOffset = memoizeOne((x, y) => ({\n x,\n y\n }));\n const getMemoizedSnapshot = memoizeOne((mode, isClone, draggingOver = null, combineWith = null, dropping = null) => ({\n isDragging: true,\n isClone,\n isDropAnimating: Boolean(dropping),\n dropAnimation: dropping,\n mode,\n draggingOver,\n combineWith,\n combineTargetFor: null\n }));\n const getMemoizedProps = memoizeOne((offset, mode, dimension, isClone, draggingOver = null, combineWith = null, forceShouldAnimate = null) => ({\n mapped: {\n type: 'DRAGGING',\n dropping: null,\n draggingOver,\n combineWith,\n mode,\n offset,\n dimension,\n forceShouldAnimate,\n snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, null)\n }\n }));\n const selector = (state, ownProps) => {\n if (isDragging(state)) {\n if (state.critical.draggable.id !== ownProps.draggableId) {\n return null;\n }\n const offset = state.current.client.offset;\n const dimension = state.dimensions.draggables[ownProps.draggableId];\n const draggingOver = whatIsDraggedOver(state.impact);\n const combineWith = getCombineWithFromImpact(state.impact);\n const forceShouldAnimate = state.forceShouldAnimate;\n return getMemoizedProps(memoizedOffset(offset.x, offset.y), state.movementMode, dimension, ownProps.isClone, draggingOver, combineWith, forceShouldAnimate);\n }\n if (state.phase === 'DROP_ANIMATING') {\n const completed = state.completed;\n if (completed.result.draggableId !== ownProps.draggableId) {\n return null;\n }\n const isClone = ownProps.isClone;\n const dimension = state.dimensions.draggables[ownProps.draggableId];\n const result = completed.result;\n const mode = result.mode;\n const draggingOver = whatIsDraggedOverFromResult(result);\n const combineWith = getCombineWithFromResult(result);\n const duration = state.dropDuration;\n const dropping = {\n duration,\n curve: curves.drop,\n moveTo: state.newHomeClientOffset,\n opacity: combineWith ? combine.opacity.drop : null,\n scale: combineWith ? combine.scale.drop : null\n };\n return {\n mapped: {\n type: 'DRAGGING',\n offset: state.newHomeClientOffset,\n dimension,\n dropping,\n draggingOver,\n combineWith,\n mode,\n forceShouldAnimate: null,\n snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, dropping)\n }\n };\n }\n return null;\n };\n return selector;\n}\nfunction getSecondarySnapshot(combineTargetFor = null) {\n return {\n isDragging: false,\n isDropAnimating: false,\n isClone: false,\n dropAnimation: null,\n mode: null,\n draggingOver: null,\n combineTargetFor,\n combineWith: null\n };\n}\nconst atRest = {\n mapped: {\n type: 'SECONDARY',\n offset: origin,\n combineTargetFor: null,\n shouldAnimateDisplacement: true,\n snapshot: getSecondarySnapshot(null)\n }\n};\nfunction getSecondarySelector() {\n const memoizedOffset = memoizeOne((x, y) => ({\n x,\n y\n }));\n const getMemoizedSnapshot = memoizeOne(getSecondarySnapshot);\n const getMemoizedProps = memoizeOne((offset, combineTargetFor = null, shouldAnimateDisplacement) => ({\n mapped: {\n type: 'SECONDARY',\n offset,\n combineTargetFor,\n shouldAnimateDisplacement,\n snapshot: getMemoizedSnapshot(combineTargetFor)\n }\n }));\n const getFallback = combineTargetFor => {\n return combineTargetFor ? getMemoizedProps(origin, combineTargetFor, true) : null;\n };\n const getProps = (ownId, draggingId, impact, afterCritical) => {\n const visualDisplacement = impact.displaced.visible[ownId];\n const isAfterCriticalInVirtualList = Boolean(afterCritical.inVirtualList && afterCritical.effected[ownId]);\n const combine = tryGetCombine(impact);\n const combineTargetFor = combine && combine.draggableId === ownId ? draggingId : null;\n if (!visualDisplacement) {\n if (!isAfterCriticalInVirtualList) {\n return getFallback(combineTargetFor);\n }\n if (impact.displaced.invisible[ownId]) {\n return null;\n }\n const change = negate(afterCritical.displacedBy.point);\n const offset = memoizedOffset(change.x, change.y);\n return getMemoizedProps(offset, combineTargetFor, true);\n }\n if (isAfterCriticalInVirtualList) {\n return getFallback(combineTargetFor);\n }\n const displaceBy = impact.displacedBy.point;\n const offset = memoizedOffset(displaceBy.x, displaceBy.y);\n return getMemoizedProps(offset, combineTargetFor, visualDisplacement.shouldAnimate);\n };\n const selector = (state, ownProps) => {\n if (isDragging(state)) {\n if (state.critical.draggable.id === ownProps.draggableId) {\n return null;\n }\n return getProps(ownProps.draggableId, state.critical.draggable.id, state.impact, state.afterCritical);\n }\n if (state.phase === 'DROP_ANIMATING') {\n const completed = state.completed;\n if (completed.result.draggableId === ownProps.draggableId) {\n return null;\n }\n return getProps(ownProps.draggableId, completed.result.draggableId, completed.impact, completed.afterCritical);\n }\n return null;\n };\n return selector;\n}\nconst makeMapStateToProps$1 = () => {\n const draggingSelector = getDraggableSelector();\n const secondarySelector = getSecondarySelector();\n const selector = (state, ownProps) => draggingSelector(state, ownProps) || secondarySelector(state, ownProps) || atRest;\n return selector;\n};\nconst mapDispatchToProps$1 = {\n dropAnimationFinished: dropAnimationFinished\n};\nconst ConnectedDraggable = connect(makeMapStateToProps$1, mapDispatchToProps$1, null, {\n context: StoreContext,\n areStatePropsEqual: isStrictEqual\n})(Draggable);\n\nfunction PrivateDraggable(props) {\n const droppableContext = useRequiredContext(DroppableContext);\n const isUsingCloneFor = droppableContext.isUsingCloneFor;\n if (isUsingCloneFor === props.draggableId && !props.isClone) {\n return null;\n }\n return React.createElement(ConnectedDraggable, props);\n}\nfunction PublicDraggable(props) {\n const isEnabled = typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;\n const canDragInteractiveElements = Boolean(props.disableInteractiveElementBlocking);\n const shouldRespectForcePress = Boolean(props.shouldRespectForcePress);\n return React.createElement(PrivateDraggable, _extends({}, props, {\n isClone: false,\n isEnabled: isEnabled,\n canDragInteractiveElements: canDragInteractiveElements,\n shouldRespectForcePress: shouldRespectForcePress\n }));\n}\n\nconst isEqual = base => value => base === value;\nconst isScroll = isEqual('scroll');\nconst isAuto = isEqual('auto');\nconst isVisible = isEqual('visible');\nconst isEither = (overflow, fn) => fn(overflow.overflowX) || fn(overflow.overflowY);\nconst isBoth = (overflow, fn) => fn(overflow.overflowX) && fn(overflow.overflowY);\nconst isElementScrollable = el => {\n const style = window.getComputedStyle(el);\n const overflow = {\n overflowX: style.overflowX,\n overflowY: style.overflowY\n };\n return isEither(overflow, isScroll) || isEither(overflow, isAuto);\n};\nconst isBodyScrollable = () => {\n if (process.env.NODE_ENV === 'production') {\n return false;\n }\n const body = getBodyElement();\n const html = document.documentElement;\n !html ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n if (!isElementScrollable(body)) {\n return false;\n }\n const htmlStyle = window.getComputedStyle(html);\n const htmlOverflow = {\n overflowX: htmlStyle.overflowX,\n overflowY: htmlStyle.overflowY\n };\n if (isBoth(htmlOverflow, isVisible)) {\n return false;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md\n `) : void 0;\n return false;\n};\nconst getClosestScrollable = el => {\n if (el == null) {\n return null;\n }\n if (el === document.body) {\n return isBodyScrollable() ? el : null;\n }\n if (el === document.documentElement) {\n return null;\n }\n if (!isElementScrollable(el)) {\n return getClosestScrollable(el.parentElement);\n }\n return el;\n};\n\nvar checkForNestedScrollContainers = scrollable => {\n if (!scrollable) {\n return;\n }\n const anotherScrollParent = getClosestScrollable(scrollable.parentElement);\n if (!anotherScrollParent) {\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n `) : void 0;\n};\n\nvar getScroll = el => ({\n x: el.scrollLeft,\n y: el.scrollTop\n});\n\nconst getIsFixed = el => {\n if (!el) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (style.position === 'fixed') {\n return true;\n }\n return getIsFixed(el.parentElement);\n};\nvar getEnv = start => {\n const closestScrollable = getClosestScrollable(start);\n const isFixedOnPage = getIsFixed(start);\n return {\n closestScrollable,\n isFixedOnPage\n };\n};\n\nvar getDroppableDimension = ({\n descriptor,\n isEnabled,\n isCombineEnabled,\n isFixedOnPage,\n direction,\n client,\n page,\n closest\n}) => {\n const frame = (() => {\n if (!closest) {\n return null;\n }\n const {\n scrollSize,\n client: frameClient\n } = closest;\n const maxScroll = getMaxScroll({\n scrollHeight: scrollSize.scrollHeight,\n scrollWidth: scrollSize.scrollWidth,\n height: frameClient.paddingBox.height,\n width: frameClient.paddingBox.width\n });\n return {\n pageMarginBox: closest.page.marginBox,\n frameClient,\n scrollSize,\n shouldClipSubject: closest.shouldClipSubject,\n scroll: {\n initial: closest.scroll,\n current: closest.scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin\n }\n }\n };\n })();\n const axis = direction === 'vertical' ? vertical : horizontal;\n const subject = getSubject({\n page,\n withPlaceholder: null,\n axis,\n frame\n });\n const dimension = {\n descriptor,\n isCombineEnabled,\n isFixedOnPage,\n axis,\n isEnabled,\n client,\n page,\n frame,\n subject\n };\n return dimension;\n};\n\nconst getClient = (targetRef, closestScrollable) => {\n const base = getBox(targetRef);\n if (!closestScrollable) {\n return base;\n }\n if (targetRef !== closestScrollable) {\n return base;\n }\n const top = base.paddingBox.top - closestScrollable.scrollTop;\n const left = base.paddingBox.left - closestScrollable.scrollLeft;\n const bottom = top + closestScrollable.scrollHeight;\n const right = left + closestScrollable.scrollWidth;\n const paddingBox = {\n top,\n right,\n bottom,\n left\n };\n const borderBox = expand(paddingBox, base.border);\n const client = createBox({\n borderBox,\n margin: base.margin,\n border: base.border,\n padding: base.padding\n });\n return client;\n};\nvar getDimension = ({\n ref,\n descriptor,\n env,\n windowScroll,\n direction,\n isDropDisabled,\n isCombineEnabled,\n shouldClipSubject\n}) => {\n const closestScrollable = env.closestScrollable;\n const client = getClient(ref, closestScrollable);\n const page = withScroll(client, windowScroll);\n const closest = (() => {\n if (!closestScrollable) {\n return null;\n }\n const frameClient = getBox(closestScrollable);\n const scrollSize = {\n scrollHeight: closestScrollable.scrollHeight,\n scrollWidth: closestScrollable.scrollWidth\n };\n return {\n client: frameClient,\n page: withScroll(frameClient, windowScroll),\n scroll: getScroll(closestScrollable),\n scrollSize,\n shouldClipSubject\n };\n })();\n const dimension = getDroppableDimension({\n descriptor,\n isEnabled: !isDropDisabled,\n isCombineEnabled,\n isFixedOnPage: env.isFixedOnPage,\n direction,\n client,\n page,\n closest\n });\n return dimension;\n};\n\nconst immediate = {\n passive: false\n};\nconst delayed = {\n passive: true\n};\nvar getListenerOptions = options => options.shouldPublishImmediately ? immediate : delayed;\n\nconst getClosestScrollableFromDrag = dragging => dragging && dragging.env.closestScrollable || null;\nfunction useDroppablePublisher(args) {\n const whileDraggingRef = useRef(null);\n const appContext = useRequiredContext(AppContext);\n const uniqueId = useUniqueId('droppable');\n const {\n registry,\n marshal\n } = appContext;\n const previousRef = usePrevious(args);\n const descriptor = useMemo(() => ({\n id: args.droppableId,\n type: args.type,\n mode: args.mode\n }), [args.droppableId, args.mode, args.type]);\n const publishedDescriptorRef = useRef(descriptor);\n const memoizedUpdateScroll = useMemo(() => memoizeOne((x, y) => {\n !whileDraggingRef.current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only update scroll when dragging') : invariant() : void 0;\n const scroll = {\n x,\n y\n };\n marshal.updateDroppableScroll(descriptor.id, scroll);\n }), [descriptor.id, marshal]);\n const getClosestScroll = useCallback(() => {\n const dragging = whileDraggingRef.current;\n if (!dragging || !dragging.env.closestScrollable) {\n return origin;\n }\n return getScroll(dragging.env.closestScrollable);\n }, []);\n const updateScroll = useCallback(() => {\n const scroll = getClosestScroll();\n memoizedUpdateScroll(scroll.x, scroll.y);\n }, [getClosestScroll, memoizedUpdateScroll]);\n const scheduleScrollUpdate = useMemo(() => rafSchd(updateScroll), [updateScroll]);\n const onClosestScroll = useCallback(() => {\n const dragging = whileDraggingRef.current;\n const closest = getClosestScrollableFromDrag(dragging);\n !(dragging && closest) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find scroll options while scrolling') : invariant() : void 0;\n const options = dragging.scrollOptions;\n if (options.shouldPublishImmediately) {\n updateScroll();\n return;\n }\n scheduleScrollUpdate();\n }, [scheduleScrollUpdate, updateScroll]);\n const getDimensionAndWatchScroll = useCallback((windowScroll, options) => {\n !!whileDraggingRef.current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot collect a droppable while a drag is occurring') : invariant() : void 0;\n const previous = previousRef.current;\n const ref = previous.getDroppableRef();\n !ref ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot collect without a droppable ref') : invariant() : void 0;\n const env = getEnv(ref);\n const dragging = {\n ref,\n descriptor,\n env,\n scrollOptions: options\n };\n whileDraggingRef.current = dragging;\n const dimension = getDimension({\n ref,\n descriptor,\n env,\n windowScroll,\n direction: previous.direction,\n isDropDisabled: previous.isDropDisabled,\n isCombineEnabled: previous.isCombineEnabled,\n shouldClipSubject: !previous.ignoreContainerClipping\n });\n const scrollable = env.closestScrollable;\n if (scrollable) {\n scrollable.setAttribute(scrollContainer.contextId, appContext.contextId);\n scrollable.addEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));\n if (process.env.NODE_ENV !== 'production') {\n checkForNestedScrollContainers(scrollable);\n }\n }\n return dimension;\n }, [appContext.contextId, descriptor, onClosestScroll, previousRef]);\n const getScrollWhileDragging = useCallback(() => {\n const dragging = whileDraggingRef.current;\n const closest = getClosestScrollableFromDrag(dragging);\n !(dragging && closest) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only recollect Droppable client for Droppables that have a scroll container') : invariant() : void 0;\n return getScroll(closest);\n }, []);\n const dragStopped = useCallback(() => {\n const dragging = whileDraggingRef.current;\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot stop drag when no active drag') : invariant() : void 0;\n const closest = getClosestScrollableFromDrag(dragging);\n whileDraggingRef.current = null;\n if (!closest) {\n return;\n }\n scheduleScrollUpdate.cancel();\n closest.removeAttribute(scrollContainer.contextId);\n closest.removeEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));\n }, [onClosestScroll, scheduleScrollUpdate]);\n const scroll = useCallback(change => {\n const dragging = whileDraggingRef.current;\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot scroll when there is no drag') : invariant() : void 0;\n const closest = getClosestScrollableFromDrag(dragging);\n !closest ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot scroll a droppable with no closest scrollable') : invariant() : void 0;\n closest.scrollTop += change.y;\n closest.scrollLeft += change.x;\n }, []);\n const callbacks = useMemo(() => {\n return {\n getDimensionAndWatchScroll,\n getScrollWhileDragging,\n dragStopped,\n scroll\n };\n }, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);\n const entry = useMemo(() => ({\n uniqueId,\n descriptor,\n callbacks\n }), [callbacks, descriptor, uniqueId]);\n useIsomorphicLayoutEffect(() => {\n publishedDescriptorRef.current = entry.descriptor;\n registry.droppable.register(entry);\n return () => {\n if (whileDraggingRef.current) {\n process.env.NODE_ENV !== \"production\" ? warning('Unsupported: changing the droppableId or type of a Droppable during a drag') : void 0;\n dragStopped();\n }\n registry.droppable.unregister(entry);\n };\n }, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);\n useIsomorphicLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled);\n }, [args.isDropDisabled, marshal]);\n useIsomorphicLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsCombineEnabled(publishedDescriptorRef.current.id, args.isCombineEnabled);\n }, [args.isCombineEnabled, marshal]);\n}\n\nfunction noop() {}\nconst empty = {\n width: 0,\n height: 0,\n margin: noSpacing\n};\nconst getSize = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate\n}) => {\n if (isAnimatingOpenOnMount) {\n return empty;\n }\n if (animate === 'close') {\n return empty;\n }\n return {\n height: placeholder.client.borderBox.height,\n width: placeholder.client.borderBox.width,\n margin: placeholder.client.margin\n };\n};\nconst getStyle = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate\n}) => {\n const size = getSize({\n isAnimatingOpenOnMount,\n placeholder,\n animate\n });\n return {\n display: placeholder.display,\n boxSizing: 'border-box',\n width: size.width,\n height: size.height,\n marginTop: size.margin.top,\n marginRight: size.margin.right,\n marginBottom: size.margin.bottom,\n marginLeft: size.margin.left,\n flexShrink: '0',\n flexGrow: '0',\n pointerEvents: 'none',\n transition: animate !== 'none' ? transitions.placeholder : null\n };\n};\nconst Placeholder = props => {\n const animateOpenTimerRef = useRef(null);\n const tryClearAnimateOpenTimer = useCallback(() => {\n if (!animateOpenTimerRef.current) {\n return;\n }\n clearTimeout(animateOpenTimerRef.current);\n animateOpenTimerRef.current = null;\n }, []);\n const {\n animate,\n onTransitionEnd,\n onClose,\n contextId\n } = props;\n const [isAnimatingOpenOnMount, setIsAnimatingOpenOnMount] = useState(props.animate === 'open');\n useEffect(() => {\n if (!isAnimatingOpenOnMount) {\n return noop;\n }\n if (animate !== 'open') {\n tryClearAnimateOpenTimer();\n setIsAnimatingOpenOnMount(false);\n return noop;\n }\n if (animateOpenTimerRef.current) {\n return noop;\n }\n animateOpenTimerRef.current = setTimeout(() => {\n animateOpenTimerRef.current = null;\n setIsAnimatingOpenOnMount(false);\n });\n return tryClearAnimateOpenTimer;\n }, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);\n const onSizeChangeEnd = useCallback(event => {\n if (event.propertyName !== 'height') {\n return;\n }\n onTransitionEnd();\n if (animate === 'close') {\n onClose();\n }\n }, [animate, onClose, onTransitionEnd]);\n const style = getStyle({\n isAnimatingOpenOnMount,\n animate: props.animate,\n placeholder: props.placeholder\n });\n return React.createElement(props.placeholder.tagName, {\n style,\n 'data-rfd-placeholder-context-id': contextId,\n onTransitionEnd: onSizeChangeEnd,\n ref: props.innerRef\n });\n};\nvar Placeholder$1 = React.memo(Placeholder);\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\nfunction runChecks(args, checks) {\n checks.forEach(check => check(args));\n}\nconst shared = [function required({\n props\n}) {\n !props.droppableId ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'A Droppable requires a droppableId prop') : invariant() : void 0;\n !(typeof props.droppableId === 'string') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `A Droppable requires a [string] droppableId. Provided: [${typeof props.droppableId}]`) : invariant() : void 0;\n}, function boolean({\n props\n}) {\n !isBoolean(props.isDropDisabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'isDropDisabled must be a boolean') : invariant() : void 0;\n !isBoolean(props.isCombineEnabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'isCombineEnabled must be a boolean') : invariant() : void 0;\n !isBoolean(props.ignoreContainerClipping) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'ignoreContainerClipping must be a boolean') : invariant() : void 0;\n}, function ref({\n getDroppableRef\n}) {\n checkIsValidInnerRef(getDroppableRef());\n}];\nconst standard = [function placeholder({\n props,\n getPlaceholderRef\n}) {\n if (!props.placeholder) {\n return;\n }\n const ref = getPlaceholderRef();\n if (ref) {\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n Droppable setup issue [droppableId: \"${props.droppableId}\"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md\n `) : void 0;\n}];\nconst virtual = [function hasClone({\n props\n}) {\n !props.renderClone ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Must provide a clone render function (renderClone) for virtual lists') : invariant() : void 0;\n}, function hasNoPlaceholder({\n getPlaceholderRef\n}) {\n !!getPlaceholderRef() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected virtual list to not have a placeholder') : invariant() : void 0;\n}];\nfunction useValidation(args) {\n useDevSetupWarning(() => {\n runChecks(args, shared);\n if (args.props.mode === 'standard') {\n runChecks(args, standard);\n }\n if (args.props.mode === 'virtual') {\n runChecks(args, virtual);\n }\n });\n}\n\nclass AnimateInOut extends React.PureComponent {\n constructor(...args) {\n super(...args);\n this.state = {\n isVisible: Boolean(this.props.on),\n data: this.props.on,\n animate: this.props.shouldAnimate && this.props.on ? 'open' : 'none'\n };\n this.onClose = () => {\n if (this.state.animate !== 'close') {\n return;\n }\n this.setState({\n isVisible: false\n });\n };\n }\n static getDerivedStateFromProps(props, state) {\n if (!props.shouldAnimate) {\n return {\n isVisible: Boolean(props.on),\n data: props.on,\n animate: 'none'\n };\n }\n if (props.on) {\n return {\n isVisible: true,\n data: props.on,\n animate: 'open'\n };\n }\n if (state.isVisible) {\n return {\n isVisible: true,\n data: state.data,\n animate: 'close'\n };\n }\n return {\n isVisible: false,\n animate: 'close',\n data: null\n };\n }\n render() {\n if (!this.state.isVisible) {\n return null;\n }\n const provided = {\n onClose: this.onClose,\n data: this.state.data,\n animate: this.state.animate\n };\n return this.props.children(provided);\n }\n}\n\nconst Droppable = props => {\n const appContext = useContext(AppContext);\n !appContext ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find app context') : invariant() : void 0;\n const {\n contextId,\n isMovementAllowed\n } = appContext;\n const droppableRef = useRef(null);\n const placeholderRef = useRef(null);\n const {\n children,\n droppableId,\n type,\n mode,\n direction,\n ignoreContainerClipping,\n isDropDisabled,\n isCombineEnabled,\n snapshot,\n useClone,\n updateViewportMaxScroll,\n getContainerForClone\n } = props;\n const getDroppableRef = useCallback(() => droppableRef.current, []);\n const setDroppableRef = useCallback((value = null) => {\n droppableRef.current = value;\n }, []);\n const getPlaceholderRef = useCallback(() => placeholderRef.current, []);\n const setPlaceholderRef = useCallback((value = null) => {\n placeholderRef.current = value;\n }, []);\n useValidation({\n props,\n getDroppableRef,\n getPlaceholderRef\n });\n const onPlaceholderTransitionEnd = useCallback(() => {\n if (isMovementAllowed()) {\n updateViewportMaxScroll({\n maxScroll: getMaxWindowScroll()\n });\n }\n }, [isMovementAllowed, updateViewportMaxScroll]);\n useDroppablePublisher({\n droppableId,\n type,\n mode,\n direction,\n isDropDisabled,\n isCombineEnabled,\n ignoreContainerClipping,\n getDroppableRef\n });\n const placeholder = useMemo(() => React.createElement(AnimateInOut, {\n on: props.placeholder,\n shouldAnimate: props.shouldAnimatePlaceholder\n }, ({\n onClose,\n data,\n animate\n }) => React.createElement(Placeholder$1, {\n placeholder: data,\n onClose: onClose,\n innerRef: setPlaceholderRef,\n animate: animate,\n contextId: contextId,\n onTransitionEnd: onPlaceholderTransitionEnd\n })), [contextId, onPlaceholderTransitionEnd, props.placeholder, props.shouldAnimatePlaceholder, setPlaceholderRef]);\n const provided = useMemo(() => ({\n innerRef: setDroppableRef,\n placeholder,\n droppableProps: {\n 'data-rfd-droppable-id': droppableId,\n 'data-rfd-droppable-context-id': contextId\n }\n }), [contextId, droppableId, placeholder, setDroppableRef]);\n const isUsingCloneFor = useClone ? useClone.dragging.draggableId : null;\n const droppableContext = useMemo(() => ({\n droppableId,\n type,\n isUsingCloneFor\n }), [droppableId, isUsingCloneFor, type]);\n function getClone() {\n if (!useClone) {\n return null;\n }\n const {\n dragging,\n render\n } = useClone;\n const node = React.createElement(PrivateDraggable, {\n draggableId: dragging.draggableId,\n index: dragging.source.index,\n isClone: true,\n isEnabled: true,\n shouldRespectForcePress: false,\n canDragInteractiveElements: true\n }, (draggableProvided, draggableSnapshot) => render(draggableProvided, draggableSnapshot, dragging));\n return ReactDOM.createPortal(node, getContainerForClone());\n }\n return React.createElement(DroppableContext.Provider, {\n value: droppableContext\n }, children(provided, snapshot), getClone());\n};\n\nfunction getBody() {\n !document.body ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'document.body is not ready') : invariant() : void 0;\n return document.body;\n}\nconst defaultProps = {\n mode: 'standard',\n type: 'DEFAULT',\n direction: 'vertical',\n isDropDisabled: false,\n isCombineEnabled: false,\n ignoreContainerClipping: false,\n renderClone: null,\n getContainerForClone: getBody\n};\nconst attachDefaultPropsToOwnProps = ownProps => {\n let mergedProps = {\n ...ownProps\n };\n let defaultPropKey;\n for (defaultPropKey in defaultProps) {\n if (ownProps[defaultPropKey] === undefined) {\n mergedProps = {\n ...mergedProps,\n [defaultPropKey]: defaultProps[defaultPropKey]\n };\n }\n }\n return mergedProps;\n};\nconst isMatchingType = (type, critical) => type === critical.droppable.type;\nconst getDraggable = (critical, dimensions) => dimensions.draggables[critical.draggable.id];\nconst makeMapStateToProps = () => {\n const idleWithAnimation = {\n placeholder: null,\n shouldAnimatePlaceholder: true,\n snapshot: {\n isDraggingOver: false,\n draggingOverWith: null,\n draggingFromThisWith: null,\n isUsingPlaceholder: false\n },\n useClone: null\n };\n const idleWithoutAnimation = {\n ...idleWithAnimation,\n shouldAnimatePlaceholder: false\n };\n const getDraggableRubric = memoizeOne(descriptor => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId\n }\n }));\n const getMapProps = memoizeOne((id, isEnabled, isDraggingOverForConsumer, isDraggingOverForImpact, dragging, renderClone) => {\n const draggableId = dragging.descriptor.id;\n const isHome = dragging.descriptor.droppableId === id;\n if (isHome) {\n const useClone = renderClone ? {\n render: renderClone,\n dragging: getDraggableRubric(dragging.descriptor)\n } : null;\n const snapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: isDraggingOverForConsumer ? draggableId : null,\n draggingFromThisWith: draggableId,\n isUsingPlaceholder: true\n };\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: false,\n snapshot,\n useClone\n };\n }\n if (!isEnabled) {\n return idleWithoutAnimation;\n }\n if (!isDraggingOverForImpact) {\n return idleWithAnimation;\n }\n const snapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: draggableId,\n draggingFromThisWith: null,\n isUsingPlaceholder: true\n };\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: true,\n snapshot,\n useClone: null\n };\n });\n const selector = (state, ownProps) => {\n const ownPropsWithDefaultProps = attachDefaultPropsToOwnProps(ownProps);\n const id = ownPropsWithDefaultProps.droppableId;\n const type = ownPropsWithDefaultProps.type;\n const isEnabled = !ownPropsWithDefaultProps.isDropDisabled;\n const renderClone = ownPropsWithDefaultProps.renderClone;\n if (isDragging(state)) {\n const critical = state.critical;\n if (!isMatchingType(type, critical)) {\n return idleWithoutAnimation;\n }\n const dragging = getDraggable(critical, state.dimensions);\n const isDraggingOver = whatIsDraggedOver(state.impact) === id;\n return getMapProps(id, isEnabled, isDraggingOver, isDraggingOver, dragging, renderClone);\n }\n if (state.phase === 'DROP_ANIMATING') {\n const completed = state.completed;\n if (!isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n const dragging = getDraggable(completed.critical, state.dimensions);\n return getMapProps(id, isEnabled, whatIsDraggedOverFromResult(completed.result) === id, whatIsDraggedOver(completed.impact) === id, dragging, renderClone);\n }\n if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {\n const completed = state.completed;\n if (!isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n const wasOver = whatIsDraggedOver(completed.impact) === id;\n const wasCombining = Boolean(completed.impact.at && completed.impact.at.type === 'COMBINE');\n const isHome = completed.critical.droppable.id === id;\n if (wasOver) {\n return wasCombining ? idleWithAnimation : idleWithoutAnimation;\n }\n if (isHome) {\n return idleWithAnimation;\n }\n return idleWithoutAnimation;\n }\n return idleWithoutAnimation;\n };\n return selector;\n};\nconst mapDispatchToProps = {\n updateViewportMaxScroll: updateViewportMaxScroll\n};\nconst ConnectedDroppable = connect(makeMapStateToProps, mapDispatchToProps, (stateProps, dispatchProps, ownProps) => {\n return {\n ...attachDefaultPropsToOwnProps(ownProps),\n ...stateProps,\n ...dispatchProps\n };\n}, {\n context: StoreContext,\n areStatePropsEqual: isStrictEqual\n})(Droppable);\n\nexport { DragDropContext, PublicDraggable as Draggable, ConnectedDroppable as Droppable, useKeyboardSensor, useMouseSensor, useTouchSensor };\n","import { Draggable } from \"@hello-pangea/dnd\";\nimport { useRedirect } from \"ra-core\";\nimport { ReferenceField } from \"@/components/admin/reference-field\";\nimport { Card, CardContent } from \"@/components/ui/card\";\n\nimport { CompanyAvatar } from \"../companies/CompanyAvatar\";\nimport type { Deal } from \"../types\";\n\nexport const DealCard = ({ deal, index }: { deal: Deal; index: number }) => {\n if (!deal) return null;\n\n return (\n <Draggable draggableId={String(deal.id)} index={index}>\n {(provided, snapshot) => (\n <DealCardContent provided={provided} snapshot={snapshot} deal={deal} />\n )}\n </Draggable>\n );\n};\n\nexport const DealCardContent = ({\n provided,\n snapshot,\n deal,\n}: {\n provided?: any;\n snapshot?: any;\n deal: Deal;\n}) => {\n const redirect = useRedirect();\n const handleClick = () => {\n redirect(`/deals/${deal.id}/show`, undefined, undefined, undefined, {\n _scrollToTop: false,\n });\n };\n\n return (\n <div\n className=\"cursor-pointer\"\n {...provided?.draggableProps}\n {...provided?.dragHandleProps}\n ref={provided?.innerRef}\n onClick={handleClick}\n >\n <Card\n className={`py-4 transition-all duration-200 ${\n snapshot?.isDragging\n ? \"opacity-90 transform rotate-1 shadow-lg\"\n : \"shadow-sm hover:shadow-md\"\n }`}\n >\n <CardContent className=\"px-4 flex\">\n <ReferenceField\n source=\"company_id\"\n record={deal}\n reference=\"companies\"\n link={false}\n >\n <CompanyAvatar width={20} height={20} />\n </ReferenceField>\n <div className=\"ml-3\">\n <p className=\"text-sm font-medium mb-2\">{deal.name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {deal.amount.toLocaleString(\"en-US\", {\n notation: \"compact\",\n style: \"currency\",\n currency: \"USD\",\n currencyDisplay: \"narrowSymbol\",\n minimumSignificantDigits: 3,\n })}\n {deal.category ? `, ${deal.category}` : \"\"}\n </p>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport { useGetIdentity, useGetList } from \"ra-core\";\nimport { useEffect, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\n\nimport type { Deal } from \"../types\";\nimport { DealCardContent } from \"./DealCard\";\n\nexport const DealArchivedList = () => {\n const { identity } = useGetIdentity();\n const {\n data: archivedLists,\n total,\n isPending,\n } = useGetList(\"deals\", {\n pagination: { page: 1, perPage: 1000 },\n sort: { field: \"archived_at\", order: \"DESC\" },\n filter: { \"archived_at@not.is\": null },\n });\n const [openDialog, setOpenDialog] = useState(false);\n\n useEffect(() => {\n if (!isPending && total === 0) {\n setOpenDialog(false);\n }\n }, [isPending, total]);\n\n useEffect(() => {\n setOpenDialog(false);\n }, [archivedLists]);\n\n if (!identity || isPending || !total || !archivedLists) return null;\n\n // Group archived lists by date\n const archivedListsByDate: { [date: string]: Deal[] } = archivedLists.reduce(\n (acc, deal) => {\n const date = new Date(deal.archived_at).toDateString();\n if (!acc[date]) {\n acc[date] = [];\n }\n acc[date].push(deal);\n return acc;\n },\n {} as { [date: string]: Deal[] },\n );\n\n return (\n <div className=\"w-full flex flex-row items-center justify-center\">\n <Button\n variant=\"ghost\"\n onClick={() => setOpenDialog(true)}\n className=\"my-4\"\n >\n View archived deals\n </Button>\n <Dialog open={openDialog} onOpenChange={() => setOpenDialog(false)}>\n <DialogContent className=\"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n <DialogTitle>Archived Deals</DialogTitle>\n <div className=\"flex flex-col gap-8\">\n {Object.entries(archivedListsByDate).map(([date, deals]) => (\n <div key={date} className=\"flex flex-col gap-4\">\n <h4 className=\"font-bold\">{getRelativeTimeString(date)}</h4>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8\">\n {deals.map((deal: Deal) => (\n <div key={deal.id}>\n <DealCardContent deal={deal} />\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </DialogContent>\n </Dialog>\n </div>\n );\n};\n\nexport function getRelativeTimeString(dateString: string): string {\n const date = new Date(dateString);\n date.setHours(0, 0, 0, 0);\n\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n const diff = date.getTime() - today.getTime();\n const unitDiff = Math.round(diff / (1000 * 60 * 60 * 24));\n\n // Check if the date is more than one week old\n if (Math.abs(unitDiff) > 7) {\n return new Intl.DateTimeFormat(undefined, {\n day: \"numeric\",\n month: \"long\",\n }).format(date);\n }\n\n // Intl.RelativeTimeFormat for dates within the last week\n const rtf = new Intl.RelativeTimeFormat(undefined, { numeric: \"auto\" });\n return ucFirst(rtf.format(unitDiff, \"day\"));\n}\n\nfunction ucFirst(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import * as React from \"react\"\nimport * as VisuallyHiddenPrimitive from \"@radix-ui/react-visually-hidden\"\n\nfunction VisuallyHidden({\n ...props\n}: React.ComponentProps<typeof VisuallyHiddenPrimitive.Root>) {\n return <VisuallyHiddenPrimitive.Root data-slot=\"visually-hidden\" {...props} />\n}\n\nexport { VisuallyHidden }\n","import { required } from \"ra-core\";\nimport { AutocompleteArrayInput } from \"@/components/admin/autocomplete-array-input\";\nimport { ReferenceArrayInput } from \"@/components/admin/reference-array-input\";\nimport { ReferenceInput } from \"@/components/admin/reference-input\";\nimport { TextInput } from \"@/components/admin/text-input\";\nimport { NumberInput } from \"@/components/admin/number-input\";\nimport { DateInput } from \"@/components/admin/date-input\";\nimport { SelectInput } from \"@/components/admin/select-input\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { useIsMobile } from \"@/hooks/use-mobile\";\n\nimport { contactOptionText } from \"../misc/ContactOption\";\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport { AutocompleteCompanyInput } from \"../companies/AutocompleteCompanyInput.tsx\";\n\nexport const DealInputs = () => {\n const isMobile = useIsMobile();\n return (\n <div className=\"flex flex-col gap-8\">\n <DealInfoInputs />\n\n <div className={`flex gap-6 ${isMobile ? \"flex-col\" : \"flex-row\"}`}>\n <DealLinkedToInputs />\n <Separator orientation={isMobile ? \"horizontal\" : \"vertical\"} />\n <DealMiscInputs />\n </div>\n </div>\n );\n};\n\nconst DealInfoInputs = () => {\n return (\n <div className=\"flex flex-col gap-4 flex-1\">\n <TextInput\n source=\"name\"\n label=\"Deal name\"\n validate={required()}\n helperText={false}\n />\n <TextInput source=\"description\" multiline rows={3} helperText={false} />\n </div>\n );\n};\n\nconst DealLinkedToInputs = () => {\n return (\n <div className=\"flex flex-col gap-4 flex-1\">\n <h3 className=\"text-base font-medium\">Linked to</h3>\n <ReferenceInput source=\"company_id\" reference=\"companies\">\n <AutocompleteCompanyInput validate={required()} />\n </ReferenceInput>\n\n <ReferenceArrayInput source=\"contact_ids\" reference=\"contacts_summary\">\n <AutocompleteArrayInput\n label=\"Contacts\"\n optionText={contactOptionText}\n helperText={false}\n />\n </ReferenceArrayInput>\n </div>\n );\n};\n\nconst DealMiscInputs = () => {\n const { dealStages, dealCategories } = useConfigurationContext();\n return (\n <div className=\"flex flex-col gap-4 flex-1\">\n <h3 className=\"text-base font-medium\">Misc</h3>\n\n <SelectInput\n source=\"category\"\n label=\"Category\"\n choices={dealCategories.map((type) => ({\n id: type,\n name: type,\n }))}\n helperText={false}\n />\n <NumberInput\n source=\"amount\"\n defaultValue={0}\n helperText={false}\n validate={required()}\n />\n <DateInput\n validate={required()}\n source=\"expected_closing_date\"\n helperText={false}\n defaultValue={new Date().toISOString().split(\"T\")[0]}\n />\n <SelectInput\n source=\"stage\"\n choices={dealStages.map((stage) => ({\n id: stage.value,\n name: stage.label,\n }))}\n defaultValue=\"opportunity\"\n helperText={false}\n validate={required()}\n />\n </div>\n );\n};\n","import { useQueryClient } from \"@tanstack/react-query\";\nimport {\n Form,\n useDataProvider,\n useGetIdentity,\n useListContext,\n useRedirect,\n type GetListResult,\n} from \"ra-core\";\nimport { Create } from \"@/components/admin/create\";\nimport { SaveButton } from \"@/components/admin/form\";\nimport { FormToolbar } from \"@/components/admin/simple-form\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\nimport { VisuallyHidden } from \"@/components/ui/visually-hidden\";\n\nimport type { Deal } from \"../types\";\nimport { DealInputs } from \"./DealInputs\";\n\nexport const DealCreate = ({ open }: { open: boolean }) => {\n const redirect = useRedirect();\n const dataProvider = useDataProvider();\n const { data: allDeals } = useListContext<Deal>();\n\n const handleClose = () => {\n redirect(\"/deals\");\n };\n\n const queryClient = useQueryClient();\n\n const onSuccess = async (deal: Deal) => {\n if (!allDeals) {\n redirect(\"/deals\");\n return;\n }\n // increase the index of all deals in the same stage as the new deal\n // first, get the list of deals in the same stage\n const deals = allDeals.filter(\n (d: Deal) => d.stage === deal.stage && d.id !== deal.id,\n );\n // update the actual deals in the database\n await Promise.all(\n deals.map(async (oldDeal) =>\n dataProvider.update(\"deals\", {\n id: oldDeal.id,\n data: { index: oldDeal.index + 1 },\n previousData: oldDeal,\n }),\n ),\n );\n // refresh the list of deals in the cache as we used dataProvider.update(),\n // which does not update the cache\n const dealsById = deals.reduce(\n (acc, d) => ({\n ...acc,\n [d.id]: { ...d, index: d.index + 1 },\n }),\n {} as { [key: string]: Deal },\n );\n const now = Date.now();\n queryClient.setQueriesData<GetListResult | undefined>(\n { queryKey: [\"deals\", \"getList\"] },\n (res) => {\n if (!res) return res;\n return {\n ...res,\n data: res.data.map((d: Deal) => dealsById[d.id] || d),\n };\n },\n { updatedAt: now },\n );\n redirect(\"/deals\");\n };\n\n const { identity } = useGetIdentity();\n\n return (\n <Dialog open={open} onOpenChange={() => handleClose()}>\n <DialogContent className=\"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n <VisuallyHidden>\n <DialogTitle>Create Deal</DialogTitle>\n </VisuallyHidden>\n <Create resource=\"deals\" mutationOptions={{ onSuccess }}>\n <Form\n defaultValues={{\n sales_id: identity?.id,\n contact_ids: [],\n index: 0,\n }}\n >\n <DealInputs />\n <FormToolbar>\n <SaveButton />\n </FormToolbar>\n </Form>\n </Create>\n </DialogContent>\n </Dialog>\n );\n};\n","import {\n EditBase,\n Form,\n useNotify,\n useRecordContext,\n useRedirect,\n} from \"ra-core\";\nimport { Link } from \"react-router\";\nimport { DeleteButton } from \"@/components/admin/delete-button\";\nimport { ReferenceField } from \"@/components/admin/reference-field\";\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\n\nimport { FormToolbar } from \"../layout/FormToolbar\";\nimport { CompanyAvatar } from \"../companies/CompanyAvatar\";\nimport type { Deal } from \"../types\";\nimport { DealInputs } from \"./DealInputs\";\n\nexport const DealEdit = ({ open, id }: { open: boolean; id?: string }) => {\n const redirect = useRedirect();\n const notify = useNotify();\n\n const handleClose = () => {\n redirect(\"/deals\", undefined, undefined, undefined, {\n _scrollToTop: false,\n });\n };\n\n return (\n <Dialog open={open} onOpenChange={() => handleClose()}>\n <DialogContent className=\"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n {id ? (\n <EditBase\n id={id}\n mutationMode=\"pessimistic\"\n mutationOptions={{\n onSuccess: () => {\n notify(\"Deal updated\");\n redirect(`/deals/${id}/show`, undefined, undefined, undefined, {\n _scrollToTop: false,\n });\n },\n }}\n >\n <EditHeader />\n <Form>\n <DealInputs />\n <FormToolbar />\n </Form>\n </EditBase>\n ) : null}\n </DialogContent>\n </Dialog>\n );\n};\n\nfunction EditHeader() {\n const deal = useRecordContext<Deal>();\n if (!deal) {\n return null;\n }\n\n return (\n <DialogTitle className=\"pb-0\">\n <div className=\"flex justify-between items-start mb-8\">\n <div className=\"flex items-center gap-4\">\n <ReferenceField source=\"company_id\" reference=\"companies\" link=\"show\">\n <CompanyAvatar />\n </ReferenceField>\n <h2 className=\"text-2xl font-semibold\">Edit {deal.name} deal</h2>\n </div>\n <div className=\"flex gap-2 pr-12\">\n <DeleteButton />\n <Button asChild variant=\"outline\" className=\"h-9\">\n <Link to={`/deals/${deal.id}/show`}>Back to deal</Link>\n </Button>\n </div>\n </div>\n </DialogTitle>\n );\n}\n","import { useGetList } from \"ra-core\";\nimport { matchPath, useLocation, Link } from \"react-router\";\nimport type { ReactNode } from \"react\";\nimport { CreateButton } from \"@/components/admin/create-button\";\nimport { Progress } from \"@/components/ui/progress\";\n\nimport useAppBarHeight from \"../misc/useAppBarHeight\";\nimport type { Contact } from \"../types\";\nimport { DealCreate } from \"./DealCreate\";\n\nexport const DealEmpty = ({ children }: { children?: ReactNode }) => {\n const location = useLocation();\n const matchCreate = matchPath(\"/deals/create\", location.pathname);\n const appbarHeight = useAppBarHeight();\n\n // get Contact data\n const { data: contacts, isPending: contactsLoading } = useGetList<Contact>(\n \"contacts\",\n {\n pagination: { page: 1, perPage: 1 },\n },\n );\n\n if (contactsLoading) return <Progress value={50} />;\n\n return (\n <div\n className=\"flex flex-col justify-center items-center gap-12\"\n style={{\n height: `calc(100dvh - ${appbarHeight}px)`,\n }}\n >\n <img src=\"./img/empty.svg\" alt=\"No deals found\" />\n {contacts && contacts.length > 0 ? (\n <>\n <div className=\"flex flex-col items-center gap-0\">\n <h3 className=\"text-lg font-bold\">No deals found</h3>\n <p className=\"text-sm text-center text-muted-foreground mb-4\">\n It seems your deal list is empty.\n </p>\n </div>\n <div className=\"flex space-x-8\">\n <CreateButton label=\"Create deal\" />\n </div>\n <DealCreate open={!!matchCreate} />\n {children}\n </>\n ) : (\n <div className=\"flex flex-col items-center gap-0\">\n <h3 className=\"text-lg font-bold\">No deals found</h3>\n <p className=\"text-sm text-center text-muted-foreground mb-4\">\n It seems your contact list is empty.\n <br />\n <Link to=\"/contacts/create\" className=\"hover:underline\">\n Add your first contact\n </Link>{\" \"}\n before creating a deal.\n </p>\n </div>\n )}\n </div>\n );\n};\n","import { Droppable } from \"@hello-pangea/dnd\";\n\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\nimport { findDealLabel } from \"./deal\";\nimport { DealCard } from \"./DealCard\";\n\nexport const DealColumn = ({\n stage,\n deals,\n}: {\n stage: string;\n deals: Deal[];\n}) => {\n const totalAmount = deals.reduce((sum, deal) => sum + deal.amount, 0);\n\n const { dealStages } = useConfigurationContext();\n return (\n <div className=\"flex-1 pb-8\">\n <div className=\"flex flex-col items-center\">\n <h3 className=\"text-base font-medium\">\n {findDealLabel(dealStages, stage)}\n </h3>\n <p className=\"text-sm text-muted-foreground\">\n {totalAmount.toLocaleString(\"en-US\", {\n notation: \"compact\",\n style: \"currency\",\n currency: \"USD\",\n currencyDisplay: \"narrowSymbol\",\n minimumSignificantDigits: 3,\n })}\n </p>\n </div>\n <Droppable droppableId={stage}>\n {(droppableProvided, snapshot) => (\n <div\n ref={droppableProvided.innerRef}\n {...droppableProvided.droppableProps}\n className={`flex flex-col rounded-2xl mt-2 gap-2 ${\n snapshot.isDraggingOver ? \"bg-muted\" : \"\"\n }`}\n >\n {deals.map((deal, index) => (\n <DealCard key={deal.id} deal={deal} index={index} />\n ))}\n {droppableProvided.placeholder}\n </div>\n )}\n </Droppable>\n </div>\n );\n};\n","import type { ConfigurationContextValue } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\n\nexport type DealsByStage = Record<Deal[\"stage\"], Deal[]>;\n\nexport const getDealsByStage = (\n unorderedDeals: Deal[],\n dealStages: ConfigurationContextValue[\"dealStages\"],\n) => {\n if (!dealStages) return {};\n const dealsByStage: Record<Deal[\"stage\"], Deal[]> = unorderedDeals.reduce(\n (acc, deal) => {\n if (acc[deal.stage]) {\n acc[deal.stage].push(deal);\n }\n return acc;\n },\n dealStages.reduce(\n (obj, stage) => ({ ...obj, [stage.value]: [] }),\n {} as Record<Deal[\"stage\"], Deal[]>,\n ),\n );\n // order each column by index\n dealStages.forEach((stage) => {\n dealsByStage[stage.value] = dealsByStage[stage.value].sort(\n (recordA: Deal, recordB: Deal) => recordA.index - recordB.index,\n );\n });\n return dealsByStage;\n};\n","import { DragDropContext, type OnDragEndResponder } from \"@hello-pangea/dnd\";\nimport isEqual from \"lodash/isEqual\";\nimport { useDataProvider, useListContext, type DataProvider } from \"ra-core\";\nimport { useEffect, useState } from \"react\";\n\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\nimport { DealColumn } from \"./DealColumn\";\nimport type { DealsByStage } from \"./stages\";\nimport { getDealsByStage } from \"./stages\";\n\nexport const DealListContent = () => {\n const { dealStages } = useConfigurationContext();\n const { data: unorderedDeals, isPending, refetch } = useListContext<Deal>();\n const dataProvider = useDataProvider();\n\n const [dealsByStage, setDealsByStage] = useState<DealsByStage>(\n getDealsByStage([], dealStages),\n );\n\n useEffect(() => {\n if (unorderedDeals) {\n const newDealsByStage = getDealsByStage(unorderedDeals, dealStages);\n if (!isEqual(newDealsByStage, dealsByStage)) {\n setDealsByStage(newDealsByStage);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [unorderedDeals]);\n\n if (isPending) return null;\n\n const onDragEnd: OnDragEndResponder = (result) => {\n const { destination, source } = result;\n\n if (!destination) {\n return;\n }\n\n if (\n destination.droppableId === source.droppableId &&\n destination.index === source.index\n ) {\n return;\n }\n\n const sourceStage = source.droppableId;\n const destinationStage = destination.droppableId;\n const sourceDeal = dealsByStage[sourceStage][source.index]!;\n const destinationDeal = dealsByStage[destinationStage][\n destination.index\n ] ?? {\n stage: destinationStage,\n index: undefined, // undefined if dropped after the last item\n };\n\n // compute local state change synchronously\n setDealsByStage(\n updateDealStageLocal(\n sourceDeal,\n { stage: sourceStage, index: source.index },\n { stage: destinationStage, index: destination.index },\n dealsByStage,\n ),\n );\n\n // persist the changes\n updateDealStage(sourceDeal, destinationDeal, dataProvider).then(() => {\n refetch();\n });\n };\n\n return (\n <DragDropContext onDragEnd={onDragEnd}>\n <div className=\"flex gap-4\">\n {dealStages.map((stage) => (\n <DealColumn\n stage={stage.value}\n deals={dealsByStage[stage.value]}\n key={stage.value}\n />\n ))}\n </div>\n </DragDropContext>\n );\n};\n\nconst updateDealStageLocal = (\n sourceDeal: Deal,\n source: { stage: string; index: number },\n destination: {\n stage: string;\n index?: number; // undefined if dropped after the last item\n },\n dealsByStage: DealsByStage,\n) => {\n if (source.stage === destination.stage) {\n // moving deal inside the same column\n const column = dealsByStage[source.stage];\n column.splice(source.index, 1);\n column.splice(destination.index ?? column.length + 1, 0, sourceDeal);\n return {\n ...dealsByStage,\n [destination.stage]: column,\n };\n } else {\n // moving deal across columns\n const sourceColumn = dealsByStage[source.stage];\n const destinationColumn = dealsByStage[destination.stage];\n sourceColumn.splice(source.index, 1);\n destinationColumn.splice(\n destination.index ?? destinationColumn.length + 1,\n 0,\n sourceDeal,\n );\n return {\n ...dealsByStage,\n [source.stage]: sourceColumn,\n [destination.stage]: destinationColumn,\n };\n }\n};\n\nconst updateDealStage = async (\n source: Deal,\n destination: {\n stage: string;\n index?: number; // undefined if dropped after the last item\n },\n dataProvider: DataProvider,\n) => {\n if (source.stage === destination.stage) {\n // moving deal inside the same column\n // Fetch all the deals in this stage (because the list may be filtered, but we need to update even non-filtered deals)\n const { data: columnDeals } = await dataProvider.getList(\"deals\", {\n sort: { field: \"index\", order: \"ASC\" },\n pagination: { page: 1, perPage: 100 },\n filter: { stage: source.stage },\n });\n const destinationIndex = destination.index ?? columnDeals.length + 1;\n\n if (source.index > destinationIndex) {\n // deal moved up, eg\n // dest src\n // <------\n // [4, 7, 23, 5]\n await Promise.all([\n // for all deals between destinationIndex and source.index, increase the index\n ...columnDeals\n .filter(\n (deal) =>\n deal.index >= destinationIndex && deal.index < source.index,\n )\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index + 1 },\n previousData: deal,\n }),\n ),\n // for the deal that was moved, update its index\n dataProvider.update(\"deals\", {\n id: source.id,\n data: { index: destinationIndex },\n previousData: source,\n }),\n ]);\n } else {\n // deal moved down, e.g\n // src dest\n // ------>\n // [4, 7, 23, 5]\n await Promise.all([\n // for all deals between source.index and destinationIndex, decrease the index\n ...columnDeals\n .filter(\n (deal) =>\n deal.index <= destinationIndex && deal.index > source.index,\n )\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index - 1 },\n previousData: deal,\n }),\n ),\n // for the deal that was moved, update its index\n dataProvider.update(\"deals\", {\n id: source.id,\n data: { index: destinationIndex },\n previousData: source,\n }),\n ]);\n }\n } else {\n // moving deal across columns\n // Fetch all the deals in both stages (because the list may be filtered, but we need to update even non-filtered deals)\n const [{ data: sourceDeals }, { data: destinationDeals }] =\n await Promise.all([\n dataProvider.getList(\"deals\", {\n sort: { field: \"index\", order: \"ASC\" },\n pagination: { page: 1, perPage: 100 },\n filter: { stage: source.stage },\n }),\n dataProvider.getList(\"deals\", {\n sort: { field: \"index\", order: \"ASC\" },\n pagination: { page: 1, perPage: 100 },\n filter: { stage: destination.stage },\n }),\n ]);\n const destinationIndex = destination.index ?? destinationDeals.length + 1;\n\n await Promise.all([\n // decrease index on the deals after the source index in the source columns\n ...sourceDeals\n .filter((deal) => deal.index > source.index)\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index - 1 },\n previousData: deal,\n }),\n ),\n // increase index on the deals after the destination index in the destination columns\n ...destinationDeals\n .filter((deal) => deal.index >= destinationIndex)\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index + 1 },\n previousData: deal,\n }),\n ),\n // change the dragged deal to take the destination index and column\n dataProvider.update(\"deals\", {\n id: source.id,\n data: {\n index: destinationIndex,\n stage: destination.stage,\n },\n previousData: source,\n }),\n ]);\n }\n};\n","import { useListContext } from \"ra-core\";\nimport { Link as RouterLink } from \"react-router\";\n\nimport { Avatar } from \"../contacts/Avatar\";\n\nexport const ContactList = () => {\n const { data, error, isPending } = useListContext();\n if (isPending || error) return <div className=\"h-8\" />;\n return (\n <div className=\"flex flex-row flex-wrap gap-4 mt-4\">\n {data.map((contact) => (\n <div className=\"flex flex-row gap-4 items-center\" key={contact.id}>\n <Avatar record={contact} />\n <div className=\"flex flex-col\">\n <RouterLink\n to={`/contacts/${contact.id}/show`}\n className=\"text-sm hover:underline\"\n >\n {contact.first_name} {contact.last_name}\n </RouterLink>\n <span className=\"text-xs text-muted-foreground\">\n {contact.title}\n {contact.title && contact.company_name && \" at \"}\n {contact.company_name}\n </span>\n </div>\n </div>\n ))}\n </div>\n );\n};\n","import { useMutation } from \"@tanstack/react-query\";\nimport { format, isValid } from \"date-fns\";\nimport { Archive, ArchiveRestore } from \"lucide-react\";\nimport {\n ShowBase,\n useDataProvider,\n useNotify,\n useRecordContext,\n useRedirect,\n useRefresh,\n useUpdate,\n} from \"ra-core\";\nimport { DeleteButton } from \"@/components/admin/delete-button\";\nimport { EditButton } from \"@/components/admin/edit-button\";\nimport { ReferenceArrayField } from \"@/components/admin/reference-array-field\";\nimport { ReferenceField } from \"@/components/admin/reference-field\";\nimport { ReferenceManyField } from \"@/components/admin/reference-many-field\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { VisuallyHidden } from \"@/components/ui/visually-hidden\";\n\nimport { CompanyAvatar } from \"../companies/CompanyAvatar\";\nimport { NoteCreate } from \"../notes/NoteCreate\";\nimport { NotesIterator } from \"../notes/NotesIterator\";\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\nimport { ContactList } from \"./ContactList\";\nimport { findDealLabel } from \"./deal\";\n\nexport const DealShow = ({ open, id }: { open: boolean; id?: string }) => {\n const redirect = useRedirect();\n const handleClose = () => {\n redirect(\"list\", \"deals\");\n };\n\n return (\n <Dialog open={open} onOpenChange={(open) => !open && handleClose()}>\n <DialogContent className=\"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n <VisuallyHidden>\n <DialogTitle>Deal Details</DialogTitle>\n </VisuallyHidden>\n {id ? (\n <ShowBase id={id}>\n <DealShowContent />\n </ShowBase>\n ) : null}\n </DialogContent>\n </Dialog>\n );\n};\n\nconst DealShowContent = () => {\n const { dealStages } = useConfigurationContext();\n const record = useRecordContext<Deal>();\n if (!record) return null;\n\n return (\n <>\n <div className=\"space-y-2\">\n {record.archived_at ? <ArchivedTitle /> : null}\n <div className=\"flex-1\">\n <div className=\"flex justify-between items-start mb-8\">\n <div className=\"flex items-center gap-4\">\n <ReferenceField\n source=\"company_id\"\n reference=\"companies\"\n link=\"show\"\n >\n <CompanyAvatar />\n </ReferenceField>\n <h2 className=\"text-2xl font-semibold\">{record.name}</h2>\n </div>\n <div className={`flex gap-2 ${record.archived_at ? \"\" : \"pr-12\"}`}>\n {record.archived_at ? (\n <>\n <UnarchiveButton record={record} />\n <DeleteButton />\n </>\n ) : (\n <>\n <ArchiveButton record={record} />\n <EditButton />\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex gap-8 m-4\">\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Expected closing date\n </span>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm\">\n {isValid(new Date(record.expected_closing_date))\n ? format(new Date(record.expected_closing_date), \"PP\")\n : \"Invalid date\"}\n </span>\n {new Date(record.expected_closing_date) < new Date() ? (\n <Badge variant=\"destructive\">Past</Badge>\n ) : null}\n </div>\n </div>\n\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Budget\n </span>\n <span className=\"text-sm\">\n {record.amount.toLocaleString(\"en-US\", {\n notation: \"compact\",\n style: \"currency\",\n currency: \"USD\",\n currencyDisplay: \"narrowSymbol\",\n minimumSignificantDigits: 3,\n })}\n </span>\n </div>\n\n {record.category && (\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Category\n </span>\n <span className=\"text-sm\">{record.category}</span>\n </div>\n )}\n\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Stage\n </span>\n <span className=\"text-sm\">\n {findDealLabel(dealStages, record.stage)}\n </span>\n </div>\n </div>\n\n {!!record.contact_ids?.length && (\n <div className=\"m-4\">\n <div className=\"flex flex-col min-h-12 mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Contacts\n </span>\n <ReferenceArrayField\n source=\"contact_ids\"\n reference=\"contacts_summary\"\n >\n <ContactList />\n </ReferenceArrayField>\n </div>\n </div>\n )}\n\n {record.description && (\n <div className=\"m-4 whitespace-pre-line\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Description\n </span>\n <p className=\"text-sm leading-6\">{record.description}</p>\n </div>\n )}\n\n <div className=\"m-4\">\n <Separator className=\"mb-4\" />\n <ReferenceManyField\n target=\"deal_id\"\n reference=\"dealNotes\"\n sort={{ field: \"date\", order: \"DESC\" }}\n empty={<NoteCreate reference={\"deals\"} />}\n >\n <NotesIterator reference=\"deals\" />\n </ReferenceManyField>\n </div>\n </div>\n </div>\n </>\n );\n};\n\nconst ArchivedTitle = () => (\n <div className=\"bg-orange-500 px-6 py-4\">\n <h3 className=\"text-lg font-bold text-white\">Archived Deal</h3>\n </div>\n);\n\nconst ArchiveButton = ({ record }: { record: Deal }) => {\n const [update] = useUpdate();\n const redirect = useRedirect();\n const notify = useNotify();\n const refresh = useRefresh();\n const handleClick = () => {\n update(\n \"deals\",\n {\n id: record.id,\n data: { archived_at: new Date().toISOString() },\n previousData: record,\n },\n {\n onSuccess: () => {\n redirect(\"list\", \"deals\");\n notify(\"Deal archived\", { type: \"info\", undoable: false });\n refresh();\n },\n onError: () => {\n notify(\"Error: deal not archived\", { type: \"error\" });\n },\n },\n );\n };\n\n return (\n <Button\n onClick={handleClick}\n size=\"sm\"\n variant=\"outline\"\n className=\"flex items-center gap-2 h-9\"\n >\n <Archive className=\"w-4 h-4\" />\n Archive\n </Button>\n );\n};\n\nconst UnarchiveButton = ({ record }: { record: Deal }) => {\n const dataProvider = useDataProvider();\n const redirect = useRedirect();\n const notify = useNotify();\n const refresh = useRefresh();\n\n const { mutate } = useMutation({\n mutationFn: () => dataProvider.unarchiveDeal(record),\n onSuccess: () => {\n redirect(\"list\", \"deals\");\n notify(\"Deal unarchived\", {\n type: \"info\",\n undoable: false,\n });\n refresh();\n },\n onError: () => {\n notify(\"Error: deal not unarchived\", { type: \"error\" });\n },\n });\n\n const handleClick = () => {\n mutate();\n };\n\n return (\n <Button\n onClick={handleClick}\n size=\"sm\"\n variant=\"outline\"\n className=\"flex items-center gap-2 h-9\"\n >\n <ArchiveRestore className=\"w-4 h-4\" />\n Send back to the board\n </Button>\n );\n};\n","import { useGetIdentity, useListFilterContext } from \"ra-core\";\nimport { Label } from \"@/components/ui/label\";\nimport { Switch } from \"@/components/ui/switch\";\n\nexport const OnlyMineInput = (_: { alwaysOn: boolean; source: string }) => {\n const { filterValues, displayedFilters, setFilters } = useListFilterContext();\n const { identity } = useGetIdentity();\n\n const handleChange = () => {\n const newFilterValues = { ...filterValues };\n if (typeof filterValues.sales_id !== \"undefined\") {\n delete newFilterValues.sales_id;\n } else {\n newFilterValues.sales_id = identity && identity?.id;\n }\n setFilters(newFilterValues, displayedFilters);\n };\n return (\n <div className=\"mt-auto pb-2.25\">\n <div className=\"flex items-center space-x-2\">\n <Switch\n id=\"only-mine\"\n checked={typeof filterValues.sales_id !== \"undefined\"}\n onCheckedChange={handleChange}\n />\n <Label htmlFor=\"only-mine\">Only companies I manage</Label>\n </div>\n </div>\n );\n};\n","import { useGetIdentity, useListContext } from \"ra-core\";\nimport { matchPath, useLocation } from \"react-router\";\nimport { AutocompleteInput } from \"@/components/admin/autocomplete-input\";\nimport { CreateButton } from \"@/components/admin/create-button\";\nimport { ExportButton } from \"@/components/admin/export-button\";\nimport { List } from \"@/components/admin/list\";\nimport { ReferenceInput } from \"@/components/admin/reference-input\";\nimport { FilterButton } from \"@/components/admin/filter-form\";\nimport { SearchInput } from \"@/components/admin/search-input\";\nimport { SelectInput } from \"@/components/admin/select-input\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Card } from \"@/components/ui/card\";\n\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport { TopToolbar } from \"../layout/TopToolbar\";\nimport { DealArchivedList } from \"./DealArchivedList\";\nimport { DealCreate } from \"./DealCreate\";\nimport { DealEdit } from \"./DealEdit\";\nimport { DealEmpty } from \"./DealEmpty\";\nimport { DealListContent } from \"./DealListContent\";\nimport { DealShow } from \"./DealShow\";\nimport { OnlyMineInput } from \"./OnlyMineInput\";\n\nconst DealList = () => {\n const { dealCategories } = useConfigurationContext();\n\n const dealFilters = [\n <SearchInput source=\"q\" alwaysOn />,\n <ReferenceInput source=\"company_id\" reference=\"companies\">\n <AutocompleteInput label={false} placeholder=\"Company\" />\n </ReferenceInput>,\n <SelectInput\n source=\"category\"\n emptyText=\"Category\"\n choices={dealCategories.map((type) => ({ id: type, name: type }))}\n />,\n <OnlyMineInput source=\"sales_id\" alwaysOn />,\n ];\n\n return (\n <List\n perPage={100}\n filter={{ \"archived_at@is\": null }}\n title={false}\n sort={{ field: \"index\", order: \"DESC\" }}\n filters={dealFilters}\n actions={<DealActions />}\n pagination={null}\n >\n <DealLayout />\n </List>\n );\n};\n\nconst DealLayout = () => {\n const location = useLocation();\n const matchCreate = matchPath(\"/deals/create\", location.pathname);\n const matchShow = matchPath(\"/deals/:id/show\", location.pathname);\n const matchEdit = matchPath(\"/deals/:id\", location.pathname);\n\n const { data, isPending, filterValues } = useListContext();\n const { identity } = useGetIdentity();\n const hasFilters = filterValues && Object.keys(filterValues).length > 0;\n\n // Show loading skeleton while identity or data is loading\n if (!identity || isPending) {\n return (\n <div className=\"w-full\">\n <Card className=\"p-4\">\n <div className=\"flex gap-4\">\n <Skeleton className=\"h-96 w-1/4\" />\n <Skeleton className=\"h-96 w-1/4\" />\n <Skeleton className=\"h-96 w-1/4\" />\n <Skeleton className=\"h-96 w-1/4\" />\n </div>\n </Card>\n </div>\n );\n }\n\n if (!data?.length && !hasFilters)\n return (\n <>\n <DealEmpty>\n <DealShow open={!!matchShow} id={matchShow?.params.id} />\n <DealArchivedList />\n </DealEmpty>\n </>\n );\n\n return (\n <div className=\"w-full\">\n <DealListContent />\n <DealArchivedList />\n <DealCreate open={!!matchCreate} />\n <DealEdit open={!!matchEdit && !matchCreate} id={matchEdit?.params.id} />\n <DealShow open={!!matchShow} id={matchShow?.params.id} />\n </div>\n );\n};\n\nconst DealActions = () => (\n <TopToolbar>\n <FilterButton />\n <ExportButton />\n <CreateButton label=\"New Deal\" />\n </TopToolbar>\n);\n\nexport default DealList;\n"],"names":["__assign","t","s","i","n","p","__rest","e","__spreadArray","to","from","pack","l","ar","useReferenceArrayInputController","__name","props","_a","debounce","enableGetChoices","filter","_b","initialPage","_c","initialPerPage","_d","initialSort","_e","queryOptions","reference","source","getValues","useFormContext","finalSource","useWrappedSource","value","useWatch","meta","otherQueryOptions","_f","useGetManyAggregate","EmptyArray","referenceRecords","errorGetMany","isLoadingGetMany","isFetchingGetMany","isPausedGetMany","isPendingGetMany","isPlaceholderDataGetMany","refetchGetMany","_g","useReferenceParams","params","paramsModifiers","finalReferenceRecords","isGetMatchingEnabled","_h","useGetList","previousData","matchingReferences","total","pageInfo","errorGetList","isLoadingGetList","isFetchingGetList","isPausedGetList","isPendingGetList","isPlaceholderDataGetList","refetchGetMatching","finalMatchingReferences","mergeReferences","refetch","useCallback","currentSort","useMemo","ref1","ref2","res","ids","ref","__iconNode","ArchiveRestore","createLucideIcon","Archive","AutocompleteArrayInput","filterToQuery","DefaultFilterToQuery","inputText","allChoices","resource","isFromReference","setFilters","useChoicesContext","id","field","isRequired","useInput","translate","useTranslate","placeholder","getRecordRepresentation","useGetRecordRepresentation","getChoiceText","getChoiceValue","useChoices","inputRef","React.useRef","open","setOpen","React.useState","handleUnselect","useEvent","choice","v","handleKeyDown","input","availableChoices","selectedChoices","filterValue","setFilterValue","getInputText","selectedChoice","jsxs","FormField","jsx","FormLabel","FieldTitle","FormControl","Command","Badge","X","CommandPrimitive","CommandList","CommandGroup","CommandItem","InputHelperText","FormError","searchText","ReferenceArrayInput","children","defaultChildren","sort","defaultFilter","React.Children","controllerProps","ResourceContextProvider","ChoicesContextProvider","NumberInput","label","className","resourceProp","_validateProp","_formatProp","parse","convertStringToNumber","onFocus","rest","useResourceContext","handleChange","event","numberValue","setValue","useState","hasFocus","handleFocus","handleBlur","useEffect","Input","float","formatProdErrorMessage","code","$$observable","symbol_observable_default","randomString","ActionTypes","actionTypes_default","isPlainObject","obj","proto","createStore","reducer","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","listener","key","getState","subscribe","isSubscribed","listenerId","dispatch","action","replaceReducer","nextReducer","observable","outerSubscribe","observer","observeState","observerAsObserver","bindActionCreator","actionCreator","args","bindActionCreators","actionCreators","boundActionCreators","compose","funcs","arg","a","b","applyMiddleware","middlewares","createStore2","store","middlewareAPI","chain","middleware","React","require$$0","is","x","y","objectIs","useSyncExternalStore","useRef","useDebugValue","useSyncExternalStoreWithSelector_production","getSnapshot","getServerSnapshot","selector","isEqual","instRef","inst","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","withSelectorModule","IS_REACT_19","React.version","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_CONSUMER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","ForwardRef","Memo","typeOf","object","$$typeof","isMemo","pureFinalPropsSelectorFactory","mapStateToProps","mapDispatchToProps","mergeProps","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","hasRunAtLeastOnce","state","ownProps","stateProps","dispatchProps","mergedProps","handleFirstCall","firstState","firstOwnProps","handleNewPropsAndNewState","handleNewProps","handleNewState","nextStateProps","statePropsChanged","handleSubsequentCalls","nextState","nextOwnProps","propsChanged","stateChanged","finalPropsSelectorFactory","initMapStateToProps","initMapDispatchToProps","initMergeProps","options","wrapMapToPropsConstant","getConstant","constant","constantSelector","getDependsOnOwnProps","mapToProps","wrapMapToPropsFunc","methodName","displayName","proxy","stateOrDispatch","createInvalidArgFactory","name","mapDispatchToPropsFactory","mapStateToPropsFactory","defaultMergeProps","wrapMergePropsFunc","areMergedPropsEqual","hasRunOnce","nextMergedProps","mergePropsFactory","defaultNoopBatch","callback","createListenerCollection","first","last","listeners","nullListeners","createSubscription","parentSub","unsubscribe","subscriptionsAmount","selfSubscribed","addNestedSub","trySubscribe","cleanupListener","removed","tryUnsubscribe","notifyNestedSubs","handleChangeWrapper","subscription","trySubscribeSelf","tryUnsubscribeSelf","canUseDOM","isDOM","isRunningInReactNative","isReactNative","getUseIsomorphicLayoutEffect","React.useLayoutEffect","React.useEffect","useIsomorphicLayoutEffect","shallowEqual","objA","objB","keysA","keysB","REACT_STATICS","KNOWN_STATICS","FORWARD_REF_STATICS","MEMO_STATICS","TYPE_STATICS","getStatics","component","defineProperty","getOwnPropertyNames","getOwnPropertySymbols","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","inheritedComponent","keys","targetStatics","sourceStatics","descriptor","ContextKey","gT","getContext","React.createContext","contextMap","realContext","ReactReduxContext","NO_SUBSCRIPTION_ARRAY","useIsomorphicLayoutEffectWithArgs","effectFunc","effectArgs","dependencies","captureWrapperProps","lastWrapperProps","lastChildProps","renderIsScheduled","wrapperProps","childPropsFromStoreUpdate","subscribeUpdates","shouldHandleStateChanges","childPropsSelector","isMounted","additionalSubscribeListener","didUnsubscribe","lastThrownError","checkForUpdates","latestStoreState","newChildProps","error","strictEqual","connect","pure","forwardRef","context","Context","WrappedComponent","wrappedComponentName","selectorFactoryOptions","ConnectFunction","propsContext","reactReduxForwardedRef","React.useMemo","reactReduxForwardedRef2","wrapperProps2","ContextToUse","ResultContext","contextValue","React.useContext","didStoreComeFromProps","didStoreComeFromContext","getServerState","subscription2","notifyNestedSubs2","overriddenContextValue","latestSubscriptionCallbackError","actualChildPropsSelector","subscribeForReact","reactListener","actualChildProps","React.useSyncExternalStore","err","renderedWrappedComponent","React.createElement","Connect","React.memo","forwarded","React.forwardRef","connect_default","Provider","providerProps","serverState","previousState","Provider_default","prefix","invariant","condition","message","getRect","_ref","top","right","bottom","left","width","height","rect","expand","target","expandBy","shrink","shrinkBy","shift","shiftBy","noSpacing","createBox","_ref2","borderBox","_ref2$margin","margin","_ref2$border","border","_ref2$padding","padding","marginBox","paddingBox","contentBox","raw","suffix","result","getWindowScroll","offset","original","change","shifted","withScroll","scroll","calculateBox","styles","getBox","el","rafSchd","fn","lastArgs","frameId","wrapperFn","_len","_key","_extends","log","type","noop$2","getOptions","shared","fromBinding","bindEvents","bindings","sharedOptions","unbindings","binding","unbind","prefix$1","_RbdInvariant","RbdInvariant","_ErrorBoundary","callbacks","ErrorBoundary","dragHandleUsageInstructions","position","index","onDragStart","start","withLocation","destination","isInHomeList","startPosition","endPosition","withCombine","combine","onDragUpdate","update","location","returnedToStart","onDragEnd","preset","isEqual$2","second","areInputsEqual","newInputs","lastInputs","getResult","inputs","initial","isFirstRun","committed","cache","origin","add","point1","point2","subtract","isEqual$1","negate","point","patch","line","otherValue","distance","closest$1","points","apply","executeClip","frame","subject","offsetByPosition","spacing","getCorners","scroll$1","increase","axis","withPlaceholder","clip","getSubject","page","scrolled","increased","clipped","scrollDroppable","droppable","newScroll","scrollable","scrollDiff","scrollDisplacement","memoizeOne","resultFn","memoized","newArgs","lastResult","toDroppableMap","droppables","previous","current","toDraggableMap","draggables","toDroppableList","toDraggableList","getDraggablesInsideDroppable","droppableId","draggable","tryGetDestination","impact","tryGetCombine","removeDraggableFromList","remove","list","item","moveToNextCombine","isMovingForward","insideDestination","previousImpact","getImpact","at","all","closestId","withoutDraggable","indexOfClosest","d","proposedIndex","before","isHomeOf","noDisplacedBy","emptyGroups","noImpact","isWithin","lowerBound","upperBound","isPartiallyVisibleThroughFrame","isWithinVertical","isWithinHorizontal","isPartiallyVisibleVertically","isPartiallyVisibleHorizontally","isBiggerVertically","isBiggerHorizontally","isTotallyVisibleThroughFrame","vertical","horizontal","isTotallyVisibleThroughFrameOnAxis","getDroppableDisplaced","displacement","isVisibleInDroppable","isVisibleThroughFrameFn","isVisibleInViewport","viewport","isVisible$1","toBeDisplaced","withDroppableDisplacement","displacedTarget","isPartiallyVisible","isTotallyVisible","isTotallyVisibleOnAxis","getShouldAnimate","forceShouldAnimate","invisible","visible","getTarget","displacedBy","getDisplacementGroups","afterDragging","groups","shouldAnimate","getIndexOfLastItem","indexOfLastItem","goAtEnd","inHomeList","newIndex","calculateReorderImpact","match","withoutDragging","sliceFrom","impacted","didStartAfterCritical","draggableId","afterCritical","fromCombine","combineId","combineWithIndex","fromReorder","currentIndex","firstIndex","lastIndex","moveToNextIndex","wasAt","getCombinedItemDisplacement","displaced","combineWith","isDisplaced","whenCombining","center","displaceBy","distanceFromStartToBorderBoxCenter","box","distanceFromEndToBorderBoxCenter","getCrossAxisBorderBoxCenter","isMoving","goAfter","moveRelativeTo","goBefore","goIntoStart","moveInto","whenReordering","draggablePage","closestAfter","closest","withDisplacement","getResultWithoutDroppableDisplacement","getPageBorderBoxCenterFromImpact","withoutDisplacement","scrollViewport","diff","getDraggables$1","tryGetVisible","speculativelyIncrease","maxScrollChange","scrolledViewport","scrolledDroppable","withViewportScroll","withDroppableScroll","withViewportDisplacement","getClientFromPageBorderBoxCenter","pageBorderBoxCenter","withoutPageScrollChange","isTotallyVisibleInNewLocation","newPageBorderBoxCenter","onlyOnMainAxis","changeNeeded","moveToNextPlace","previousPageBorderBoxCenter","previousClientSelection","cautious","getKnownActive","getBestCrossAxisDroppable","active","isBetweenSourceClipped","candidates","activeOfTarget","isBetweenDestinationClipped","array","contains","getCurrentPageBorderBoxCenter","getCurrentPageBorderBox","getClosestDraggable","distanceToA","distanceToB","getDisplacedBy","getRequiredGrowthForPlaceholder","placeholderSize","availableSpace","needsToGrowBy","sum","dimension","withMaxScroll","max","addPlaceholder","requiredGrowth","added","maxScroll","newFrame","removePlaceholder","oldMaxScroll","moveToNewDroppable","proposed","proposedPageBorderBoxCenter","isGoingBeforeTarget","relativeTo","moveCrossAxis","isOver","whatIsDraggedOver","getDroppableOver$1","moveInDirection","isActuallyOver","isMainAxisMovementAllowed","home","direction","isMovingOnMainAxis","isMovementAllowed","isPositionInFrame","getHasOverlap","getFurthestAway","pageBorderBox","startCenter","sorted","candidate","getDroppableOver","childCenter","crossAxisStart","crossAxisEnd","isContained","isStartContained","isEndContained","offsetRectByPosition","area","getIsDisplaced","atIndex","getReorderImpact","targetRect","targetStart","targetEnd","child","didStartAfterCritical$1","combineThresholdDivisor","getCombineImpact","childRect","threshold","getDragImpact","pageOffset","destinationId","pageBorderBoxWithDroppableScroll","patchDroppableMap","updated","clearUnusedPlaceholder","now","lastDroppable","recomputePlaceholders","cleaned","patched","forcedClientSelection","forcedDimensions","forcedViewport","forcedImpact","scrollJumpRequest","dimensions","clientSelection","client","newImpact","withUpdatedPlaceholders","getDraggables","recompute","getClientBorderBoxCenter","refreshSnap","needsVisibilityCheck","getHomeLocation","getLiftEffect","insideHome","rawIndex","effected","patchDimensionMap","offsetDraggable","offset$1","initialWindowScroll","getFrame","adjustAdditionsForScrollChanges","additions","updatedDroppables","windowScrollChange","modified","droppableScrollChange","totalChange","publishWhileDraggingInVirtual","published","withScrollChange","existing","updatedAdditions","wasOverId","wasOver","onLiftImpact","draggingState","isSnapping","postDroppableChange","isEnabledChanging","removeScrollJumpRequest","idle$2","critical","movementMode","isWindowScrollAllowed","isEnabled","isCombineEnabled","reason","completed","dropDuration","newHomeClientOffset","guard","predicate","beforeInitialCapture","lift$1","initialPublish","publishWhileDragging","collectionStarting","updateDroppableScroll","updateDroppableIsEnabled","updateDroppableIsCombineEnabled","move","moveByWindowScroll","updateViewportMaxScroll","moveUp","moveDown","moveRight","moveLeft","flush","animateDrop","completeDrop","drop","dropPending","dropAnimationFinished","lift","next","request","marshal","style","curves","timings","outOfTheWayTiming","transitions","duration","timing","moveTo","transforms","isCombining","minDropTime","maxDropTime","dropTimeRange","maxDropTimeAtDistance","cancelDropModifier","getDropDuration","distance$1","percentage","withDuration","getNewHomeClientOffset","newClientCenter","getDropImpact","lastImpact","dropMiddleware","didDropInsideDroppable","getWindowScrollBinding","getScrollListener","onWindowScroll","updateScroll","scheduled","isActive","stop","shouldStop$1","scrollListener","getExpiringAnnounce","announce","wasCalled","isExpired","timeoutId","getAsyncMarshal","entries","execute","timerId","entry","shallow","areLocationsEqual","isCombineEqual","isCriticalEqual","isDraggableEqual","isDroppableEqual","withTimings","getDragStart","mode","responder","data","getDefaultMessage","willExpire","getPublisher","getResponders","asyncMarshal","dragging","beforeCapture","beforeStart","hasCriticalChanged","hasLocationChanged","hasGroupingChanged","responders","publisher","dropAnimationFinishMiddleware","dropAnimationFlushOnScrollMiddleware","clear","dimensionMarshalStopper","focus","isWatching","shouldStop","autoScroll","autoScroller","pendingDrop","postActionState","composeEnhancers","dimensionMarshal","focusMarshal","styleMarshal","createStore$1","clean$1","createPublisher","registry","staging","collect","removals","getMaxScroll","scrollHeight","scrollWidth","getDocumentElement","doc","getMaxWindowScroll","getViewport","getInitialPublish","scrollOptions","windowScroll","shouldPublishUpdate","createDimensionMarshal","collection","stopPublishing","subscriber","canStartDrag","scrollWindow","getScrollableDroppables","getScrollableDroppableOver","getBestScrollableDroppable","defaultAutoScrollerOptions","getDistanceThresholds","container","getAutoScrollerOptions","autoScrollerOptions","startScrollingFrom","maxScrollValueAt","getPercentage","startOfRange","endOfRange","range","minScroll","getValueFromDistance","distanceToEdge","thresholds","percentageFromStartScrollingFrom","dampenValueByTime","proposedScroll","dragStartTime","accelerateAt","stopAt","runTime","betweenAccelerateAtAndStopAtPercentage","getValue","shouldUseTimeDampening","getScrollOnAxis","distanceToEdges","adjustForSizeLimits","isTooBigVertically","isTooBigHorizontally","clean","getScroll$1","required","limited","smallestSigned","getOverlap","getRemainder","targetScroll","overlap","canPartiallyScroll","rawMax","smallestChange","canScrollWindow","getWindowOverlap","canScrollDroppable","getDroppableOverlap","getWindowScrollChange","getDroppableScrollChange","createFluidScroller","scheduleWindowScroll","scheduleDroppableScroll","tryScroll","wasScrollNeeded","fakeScrollCallback","createJumpScroller","moveByOffset","scrollDroppableAsMuchAsItCan","whatTheDroppableCanScroll","scrollWindowAsMuchAsItCan","whatTheWindowCanScroll","droppableRemainder","windowRemainder","createAutoScroller","fluidScroller","jumpScroll","dragHandle","base","scrollContainer","makeGetSelector","attribute","getStyles","rules","property","rule","noPointerEvents","getStyles$1","contextId","getSelector","dragHandle$1","grabCursor","draggable$1","transition","droppable$1","useLayoutEffect","getHead","head","createStyleEl","nonce","useStyleMarshal","alwaysRef","dynamicRef","setDynamicStyle","setAlwaysStyle","always","dynamic","dropping","resting","querySelectorAll","parentNode","getWindowFromEl","isHtmlElement","findDragHandle","possible","handle","useFocusMarshal","entriesRef","recordRef","restoreFocusFrameRef","isMountedRef","register","tryGiveFocus","tryGiveFocusTo","tryShiftRecord","redirectTo","tryRestoreFocusRecorded","record","tryRecordFocus","focused","createRegistry","subscribers","cb","notify","findDraggableById","getDraggableById","draggableAPI","findDroppableById","getDroppableById","droppableAPI","useRegistry","StoreContext","getBodyElement","body","visuallyHidden","getId","useAnnouncer","defaults","useUniqueId","getElementId","uniqueId","useHiddenTextElement","text","AppContext","usePrevious","create","lock","isClaimed","claim","abandon","newLock","release","tryAbandon","isDragging","tab","enter","escape","space","pageUp","pageDown","end","arrowLeft","arrowUp","arrowRight","arrowDown","preventedKeys","preventStandardKeyEvents","supportedEventName","eventName","primaryButton","sloppyClickThreshold","isSloppyClickThresholdExceeded","idle$1","getCaptureBindings","cancel","getPhase","setPhase","button","clientX","clientY","phase","pending","actions","useMouseSensor","api","phaseRef","unbindEventsRef","startCaptureBinding","startPendingDrag","preventForcePressBinding","listenForCapture","bindCapturingEvents","noop$1","scrollJumpKeys","getDraggingBindings","useKeyboardSensor","preDrag","isCapturing","idle","timeForLongPress","forcePressThreshold","getWindowBindings","getHandleBindings","touch","shouldRespect","useTouchSensor","unbindTarget","unbindWindow","startDragging","longPressTimerId","interactiveTagNames","isAnInteractiveElement","parent","isEventInInteractiveElement","getBorderBoxCenterPosition","isElement","supportedMatchesName","closestPonyfill","findClosestDragHandleFromEvent","tryGetClosestDraggableIdFromEvent","findDraggable","preventDefault","expected","isLockActive","shouldWarn","canStart","lockAPI","tryStart","forceSensorStop","sourceEvent","getShouldRespectForcePress","tryDispatch","getAction","tryDispatchWhenDragging","finish","fluidLift","move$1","snapLift","abortPreDrag","defaultSensors","useSensorMarshal","customSensors","enableDefaultSensors","useSensors","tryAbandonLock","canGetLock","tryGetLock","forceStop","findClosestDraggableId","findOptionsForDraggable","tryReleaseLock","isLockClaimed","createResponders","onBeforeCapureCallback","flushSync","createAutoScrollerOptions","getStore","lazyRef","App","setCallbacks","sensors","lazyStoreRef","lastPropsRef","dragHandleUsageInstructionsId","lazyDispatch","marshalCallbacks","tryResetStore","appCallbacks","getCanLift","getIsMovementAllowed","appContext","useUniqueContextId","DragDropContext","zIndexOptions","getDraggingTransition","shouldAnimateDragMovement","getDraggingOpacity","isDropAnimating","getShouldDraggingAnimate","getDraggingStyle","transform","getSecondaryStyle","secondary","getStyle$1","mapped","getDimension$1","computedStyles","useDraggablePublisher","getDraggableRef","canDragInteractiveElements","shouldRespectForcePress","getDimension","publishedRef","isFirstPublishRef","DroppableContext","useRequiredContext","useContext","preventHtml5Dnd","Draggable","setRef","getRef","isClone","dropAnimationFinishedAction","forPublisher","dragHandleProps","onMoveEnd","provided","onTransitionEnd","rubric","isStrictEqual","whatIsDraggedOverFromResult","getCombineWithFromResult","getCombineWithFromImpact","getDraggableSelector","memoizedOffset","getMemoizedSnapshot","draggingOver","getMemoizedProps","getSecondarySnapshot","combineTargetFor","atRest","getSecondarySelector","shouldAnimateDisplacement","getFallback","getProps","ownId","draggingId","visualDisplacement","isAfterCriticalInVirtualList","makeMapStateToProps$1","draggingSelector","secondarySelector","mapDispatchToProps$1","ConnectedDraggable","PrivateDraggable","PublicDraggable","isScroll","isAuto","isEither","overflow","isElementScrollable","isBodyScrollable","getClosestScrollable","getScroll","getIsFixed","getEnv","closestScrollable","isFixedOnPage","getDroppableDimension","scrollSize","frameClient","getClient","targetRef","env","isDropDisabled","shouldClipSubject","immediate","delayed","getListenerOptions","getClosestScrollableFromDrag","useDroppablePublisher","whileDraggingRef","previousRef","publishedDescriptorRef","memoizedUpdateScroll","getClosestScroll","scheduleScrollUpdate","onClosestScroll","getDimensionAndWatchScroll","getScrollWhileDragging","dragStopped","noop","empty","getSize","isAnimatingOpenOnMount","animate","getStyle","size","Placeholder","animateOpenTimerRef","tryClearAnimateOpenTimer","onClose","setIsAnimatingOpenOnMount","onSizeChangeEnd","Placeholder$1","_AnimateInOut","AnimateInOut","Droppable","droppableRef","placeholderRef","ignoreContainerClipping","snapshot","useClone","getContainerForClone","getDroppableRef","setDroppableRef","setPlaceholderRef","onPlaceholderTransitionEnd","isUsingCloneFor","droppableContext","getClone","render","node","draggableProvided","draggableSnapshot","ReactDOM","getBody","defaultProps","attachDefaultPropsToOwnProps","defaultPropKey","isMatchingType","getDraggable","makeMapStateToProps","idleWithAnimation","idleWithoutAnimation","getDraggableRubric","getMapProps","isDraggingOverForConsumer","isDraggingOverForImpact","renderClone","ownPropsWithDefaultProps","isDraggingOver","wasCombining","isHome","ConnectedDroppable","DealCard","deal","DealCardContent","redirect","useRedirect","handleClick","Card","CardContent","ReferenceField","CompanyAvatar","DealArchivedList","identity","useGetIdentity","archivedLists","isPending","openDialog","setOpenDialog","archivedListsByDate","acc","date","Button","Dialog","DialogContent","DialogTitle","deals","getRelativeTimeString","dateString","today","unitDiff","rtf","ucFirst","str","VisuallyHidden","VisuallyHiddenPrimitive.Root","DealInputs","isMobile","useIsMobile","DealInfoInputs","DealLinkedToInputs","Separator","DealMiscInputs","TextInput","ReferenceInput","AutocompleteCompanyInput","contactOptionText","dealStages","dealCategories","useConfigurationContext","SelectInput","DateInput","stage","DealCreate","dataProvider","useDataProvider","allDeals","useListContext","handleClose","queryClient","useQueryClient","onSuccess","oldDeal","dealsById","Create","Form","FormToolbar","SaveButton","DealEdit","useNotify","EditBase","EditHeader","useRecordContext","DeleteButton","Link","DealEmpty","useLocation","matchCreate","matchPath","appbarHeight","useAppBarHeight","contacts","contactsLoading","Progress","Fragment","CreateButton","DealColumn","totalAmount","findDealLabel","droppableProvided","getDealsByStage","unorderedDeals","dealsByStage","recordA","recordB","DealListContent","setDealsByStage","newDealsByStage","sourceStage","destinationStage","sourceDeal","destinationDeal","updateDealStageLocal","updateDealStage","column","sourceColumn","destinationColumn","columnDeals","destinationIndex","sourceDeals","destinationDeals","ContactList","contact","Avatar","RouterLink","DealShow","ShowBase","DealShowContent","ArchivedTitle","UnarchiveButton","ArchiveButton","EditButton","format","ReferenceArrayField","ReferenceManyField","NoteCreate","NotesIterator","useUpdate","refresh","useRefresh","mutate","useMutation","OnlyMineInput","_","filterValues","displayedFilters","useListFilterContext","newFilterValues","Switch","Label","DealList","dealFilters","SearchInput","AutocompleteInput","List","DealActions","DealLayout","matchShow","matchEdit","hasFilters","Skeleton","TopToolbar","FilterButton","ExportButton"],"mappings":"o7BAAA,IAAIA,GAAsC,UAAY,CAClD,OAAAA,GAAW,OAAO,QAAU,SAASC,EAAG,CACpC,QAASC,EAAGC,EAAI,EAAGC,EAAI,UAAU,OAAQD,EAAIC,EAAGD,IAAK,CACjDD,EAAI,UAAUC,CAAC,EACf,QAASE,KAAKH,EAAO,OAAO,UAAU,eAAe,KAAKA,EAAGG,CAAC,IAC1DJ,EAAEI,CAAC,EAAIH,EAAEG,CAAC,EAClB,CACA,OAAOJ,CACX,EACOD,GAAS,MAAM,KAAM,SAAS,CACzC,EACIM,GAAkC,SAAUJ,EAAGK,EAAG,CAClD,IAAIN,EAAI,CAAA,EACR,QAASI,KAAKH,EAAO,OAAO,UAAU,eAAe,KAAKA,EAAGG,CAA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,GAAW,OAAO,GAAI,QACtDvI,GAAA,CAAA,CAAiB,CAAA,CAAA,CACpB,CAAA,CACF,EAIF3yC,EAAAA,KAAC,MAAA,CAAI,UAAU,SACb,SAAA,CAAAE,EAAAA,IAAC43C,GAAA,EAAgB,QAChBnF,GAAA,EAAiB,EAClBzyC,EAAAA,IAACk1C,GAAA,CAAW,KAAM,CAAC,CAACwB,CAAA,CAAa,EACjC12C,EAAAA,IAACi2C,GAAA,CAAS,KAAM,CAAC,CAACgF,GAAa,CAACvE,EAAa,GAAIuE,GAAW,OAAO,EAAA,CAAI,EACvEj7C,MAACg5C,IAAS,KAAM,CAAC,CAACgC,EAAW,GAAIA,GAAW,OAAO,EAAA,CAAI,CAAA,EACzD,CAEJ,EA7CmB,cA+CbF,GAAc3hD,EAAA,IAClB2G,EAAAA,KAACs7C,GAAA,CACC,SAAA,CAAAp7C,EAAAA,IAACq7C,GAAA,EAAa,QACbC,GAAA,EAAa,EACdt7C,EAAAA,IAACk3C,GAAA,CAAa,MAAM,UAAA,CAAW,CAAA,EACjC,EALkB","x_google_ignoreList":[0,1,2,6,7,8,9,10,11,12,13,14]}
1
+ {"version":3,"file":"DealList-43nIr33i.js","sources":["../../node_modules/ra-core/dist/controller/input/useReferenceArrayInputController.js","../../node_modules/lucide-react/dist/esm/icons/archive-restore.js","../../node_modules/lucide-react/dist/esm/icons/archive.js","../../src/components/admin/autocomplete-array-input.tsx","../../src/components/admin/reference-array-input.tsx","../../src/components/admin/number-input.tsx","../../node_modules/redux/dist/redux.mjs","../../node_modules/use-sync-external-store/cjs/use-sync-external-store-with-selector.production.js","../../node_modules/use-sync-external-store/with-selector.js","../../node_modules/react-redux/dist/react-redux.mjs","../../node_modules/tiny-invariant/dist/esm/tiny-invariant.js","../../node_modules/css-box-model/dist/css-box-model.esm.js","../../node_modules/raf-schd/dist/raf-schd.esm.js","../../node_modules/@babel/runtime/helpers/esm/extends.js","../../node_modules/@hello-pangea/dnd/dist/dnd.esm.js","../../src/components/atomic-crm/deals/DealCard.tsx","../../src/components/atomic-crm/deals/DealArchivedList.tsx","../../src/components/ui/visually-hidden.tsx","../../src/components/atomic-crm/deals/DealInputs.tsx","../../src/components/atomic-crm/deals/DealCreate.tsx","../../src/components/atomic-crm/deals/DealEdit.tsx","../../src/components/atomic-crm/deals/DealEmpty.tsx","../../src/components/atomic-crm/deals/DealColumn.tsx","../../src/components/atomic-crm/deals/stages.ts","../../src/components/atomic-crm/deals/DealListContent.tsx","../../src/components/atomic-crm/deals/ContactList.tsx","../../src/components/atomic-crm/deals/DealShow.tsx","../../src/components/atomic-crm/deals/OnlyMineInput.tsx","../../src/components/atomic-crm/deals/DealList.tsx"],"sourcesContent":["var __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = (this && this.__rest) || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\n t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\n t[p[i]] = s[p[i]];\n }\n return t;\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nimport { useCallback, useMemo } from 'react';\nimport { useFormContext, useWatch } from 'react-hook-form';\nimport { useGetList, useGetManyAggregate } from \"../../dataProvider/index.js\";\nimport { useReferenceParams } from \"./useReferenceParams.js\";\nimport { useWrappedSource } from \"../../core/index.js\";\n/**\n * Prepare data for the ReferenceArrayInput components\n *\n * @example\n *\n * const { allChoices, availableChoices, selectedChoices, error, isFetching, isLoading, isPending } = useReferenceArrayInputController({\n * record: { referenceIds: ['id1', 'id2']};\n * reference: 'reference';\n * resource: 'resource';\n * source: 'referenceIds';\n * });\n *\n * @param {Object} props\n * @param {Object} props.record The current resource record\n * @param {string} props.reference The linked resource name\n * @param {string} props.resource The current resource name\n * @param {string} props.source The key of the linked resource identifier\n *\n * @param {Props} props\n *\n * @return {Object} controllerProps Fetched data and callbacks for the ReferenceArrayInput components\n */\nexport var useReferenceArrayInputController = function (props) {\n var _a;\n var debounce = props.debounce, enableGetChoices = props.enableGetChoices, filter = props.filter, _b = props.page, initialPage = _b === void 0 ? 1 : _b, _c = props.perPage, initialPerPage = _c === void 0 ? 25 : _c, _d = props.sort, initialSort = _d === void 0 ? { field: 'id', order: 'DESC' } : _d, _e = props.queryOptions, queryOptions = _e === void 0 ? {} : _e, reference = props.reference, source = props.source;\n var getValues = useFormContext().getValues;\n var finalSource = useWrappedSource(source);\n // When we change the defaultValue of the child input using react-hook-form resetField function,\n // useWatch does not seem to get the new value. We fallback to getValues to get it.\n var value = (_a = useWatch({ name: finalSource })) !== null && _a !== void 0 ? _a : getValues(finalSource);\n var meta = queryOptions.meta, otherQueryOptions = __rest(queryOptions, [\"meta\"]);\n /**\n * Get the records related to the current value (with getMany)\n */\n var _f = useGetManyAggregate(reference, {\n ids: value || EmptyArray,\n meta: meta,\n }, {\n enabled: value != null && value.length > 0,\n }), referenceRecords = _f.data, errorGetMany = _f.error, isLoadingGetMany = _f.isLoading, isFetchingGetMany = _f.isFetching, isPausedGetMany = _f.isPaused, isPendingGetMany = _f.isPending, isPlaceholderDataGetMany = _f.isPlaceholderData, refetchGetMany = _f.refetch;\n var _g = useReferenceParams({\n resource: reference,\n page: initialPage,\n perPage: initialPerPage,\n sort: initialSort,\n debounce: debounce,\n filter: filter,\n }), params = _g[0], paramsModifiers = _g[1];\n // filter out not found references - happens when the dataProvider doesn't guarantee referential integrity\n var finalReferenceRecords = referenceRecords\n ? referenceRecords.filter(Boolean)\n : [];\n var isGetMatchingEnabled = enableGetChoices\n ? enableGetChoices(params.filterValues)\n : true;\n var _h = useGetList(reference, {\n pagination: {\n page: params.page,\n perPage: params.perPage,\n },\n sort: { field: params.sort, order: params.order },\n filter: __assign(__assign({}, params.filter), filter),\n meta: meta,\n }, __assign({ retry: false, enabled: isGetMatchingEnabled, placeholderData: function (previousData) { return previousData; } }, otherQueryOptions)), matchingReferences = _h.data, total = _h.total, pageInfo = _h.pageInfo, errorGetList = _h.error, isLoadingGetList = _h.isLoading, isFetchingGetList = _h.isFetching, isPausedGetList = _h.isPaused, isPendingGetList = _h.isPending, isPlaceholderDataGetList = _h.isPlaceholderData, refetchGetMatching = _h.refetch;\n // We merge the currently selected records with the matching ones, otherwise\n // the component displaying the currently selected records may fail\n var finalMatchingReferences = matchingReferences && matchingReferences.length > 0\n ? mergeReferences(matchingReferences, finalReferenceRecords)\n : finalReferenceRecords.length > 0\n ? finalReferenceRecords\n : matchingReferences;\n var refetch = useCallback(function () {\n refetchGetMany();\n refetchGetMatching();\n }, [refetchGetMany, refetchGetMatching]);\n var currentSort = useMemo(function () { return ({\n field: params.sort,\n order: params.order,\n }); }, [params.sort, params.order]);\n return {\n sort: currentSort,\n allChoices: finalMatchingReferences,\n availableChoices: matchingReferences,\n selectedChoices: finalReferenceRecords,\n displayedFilters: params.displayedFilters,\n error: errorGetMany || errorGetList,\n filter: filter,\n filterValues: params.filterValues,\n hideFilter: paramsModifiers.hideFilter,\n isFetching: isFetchingGetMany || isFetchingGetList,\n isLoading: isLoadingGetMany || isLoadingGetList,\n isPaused: isPausedGetMany || isPausedGetList,\n isPending: isPendingGetMany || isPendingGetList,\n isPlaceholderData: isPlaceholderDataGetMany || isPlaceholderDataGetList,\n page: params.page,\n perPage: params.perPage,\n refetch: refetch,\n resource: reference,\n setFilters: paramsModifiers.setFilters,\n setPage: paramsModifiers.setPage,\n setPerPage: paramsModifiers.setPerPage,\n setSort: paramsModifiers.setSort,\n showFilter: paramsModifiers.showFilter,\n // we return source and not finalSource because child inputs (e.g. AutocompleteArrayInput) already call useInput and compute the final source\n source: source,\n total: total,\n hasNextPage: pageInfo\n ? pageInfo.hasNextPage\n : total != null\n ? params.page * params.perPage < total\n : undefined,\n hasPreviousPage: pageInfo ? pageInfo.hasPreviousPage : params.page > 1,\n isFromReference: true,\n };\n};\nvar EmptyArray = [];\n// concatenate and deduplicate two lists of records\nvar mergeReferences = function (ref1, ref2) {\n var res = __spreadArray([], ref1, true);\n var ids = ref1.map(function (ref) { return ref.id; });\n ref2.forEach(function (ref) {\n if (!ids.includes(ref.id)) {\n ids.push(ref.id);\n res.push(ref);\n }\n });\n return res;\n};\n//# sourceMappingURL=useReferenceArrayInputController.js.map","/**\n * @license lucide-react v0.542.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"5\", x: \"2\", y: \"3\", rx: \"1\", key: \"1wp1u1\" }],\n [\"path\", { d: \"M4 8v11a2 2 0 0 0 2 2h2\", key: \"tvwodi\" }],\n [\"path\", { d: \"M20 8v11a2 2 0 0 1-2 2h-2\", key: \"1gkqxj\" }],\n [\"path\", { d: \"m9 15 3-3 3 3\", key: \"1pd0qc\" }],\n [\"path\", { d: \"M12 12v9\", key: \"192myk\" }]\n];\nconst ArchiveRestore = createLucideIcon(\"archive-restore\", __iconNode);\n\nexport { __iconNode, ArchiveRestore as default };\n//# sourceMappingURL=archive-restore.js.map\n","/**\n * @license lucide-react v0.542.0 - ISC\n *\n * This source code is licensed under the ISC license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createLucideIcon from '../createLucideIcon.js';\n\nconst __iconNode = [\n [\"rect\", { width: \"20\", height: \"5\", x: \"2\", y: \"3\", rx: \"1\", key: \"1wp1u1\" }],\n [\"path\", { d: \"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8\", key: \"1s80jp\" }],\n [\"path\", { d: \"M10 12h4\", key: \"a56b0p\" }]\n];\nconst Archive = createLucideIcon(\"archive\", __iconNode);\n\nexport { __iconNode, Archive as default };\n//# sourceMappingURL=archive.js.map\n","import * as React from \"react\";\nimport { X } from \"lucide-react\";\nimport { Badge } from \"@/components/ui/badge\";\nimport {\n Command,\n CommandGroup,\n CommandItem,\n CommandList,\n} from \"@/components/ui/command\";\nimport {\n FormControl,\n FormError,\n FormField,\n FormLabel,\n} from \"@/components/admin/form\";\nimport { Command as CommandPrimitive } from \"cmdk\";\nimport type { ChoicesProps, InputProps } from \"ra-core\";\nimport {\n useChoices,\n useChoicesContext,\n useGetRecordRepresentation,\n useInput,\n useTranslate,\n FieldTitle,\n useEvent,\n} from \"ra-core\";\nimport { InputHelperText } from \"./input-helper-text\";\nimport { useCallback } from \"react\";\n\n/**\n * Form control that lets users choose multiple values from a list using a dropdown with autocompletion.\n *\n * This input allows editing array values with a searchable dropdown interface and displays selected items as removable badges.\n * Works seamlessly inside ReferenceArrayInput for editing many-to-many relationships.\n *\n * @see {@link https://marmelab.com/shadcn-admin-kit/docs/autocompletearrayinput/ AutocompleteArrayInput documentation}\n *\n * @example\n * import {\n * Create,\n * SimpleForm,\n * AutocompleteArrayInput,\n * ReferenceArrayInput,\n * } from '@/components/admin';\n *\n * const PostCreate = () => (\n * <Create>\n * <SimpleForm>\n * <AutocompleteArrayInput\n * source=\"tags\"\n * choices={[\n * { id: 'tech', name: 'Tech' },\n * { id: 'news', name: 'News' },\n * { id: 'lifestyle', name: 'Lifestyle' },\n * ]}\n * />\n * <ReferenceArrayInput source=\"tag_ids\" reference=\"tags\">\n * <AutocompleteArrayInput />\n * </ReferenceArrayInput>\n * </SimpleForm>\n * </Create>\n * );\n */\nexport const AutocompleteArrayInput = (\n props: Omit<InputProps, \"source\"> &\n Partial<Pick<InputProps, \"source\">> &\n ChoicesProps & {\n className?: string;\n disableValue?: string;\n filterToQuery?: (searchText: string) => any;\n translateChoice?: boolean;\n placeholder?: string;\n inputText?:\n | React.ReactNode\n | ((option: any | undefined) => React.ReactNode);\n },\n) => {\n const { filterToQuery = DefaultFilterToQuery, inputText } = props;\n const {\n allChoices = [],\n source,\n resource,\n isFromReference,\n setFilters,\n } = useChoicesContext(props);\n const { id, field, isRequired } = useInput({ ...props, source });\n const translate = useTranslate();\n const { placeholder = translate(\"ra.action.search\", { _: \"Search...\" }) } =\n props;\n\n const getRecordRepresentation = useGetRecordRepresentation(resource);\n const { getChoiceText, getChoiceValue } = useChoices({\n optionText:\n props.optionText ?? (isFromReference ? getRecordRepresentation : \"name\"),\n optionValue: props.optionValue ?? \"id\",\n disableValue: props.disableValue,\n translateChoice: props.translateChoice ?? !isFromReference,\n });\n\n const inputRef = React.useRef<HTMLInputElement>(null);\n const [open, setOpen] = React.useState(false);\n\n const handleUnselect = useEvent((choice: any) => {\n field.onChange(\n field.value.filter((v: any) => v !== getChoiceValue(choice)),\n );\n });\n\n const handleKeyDown = useEvent((e: React.KeyboardEvent<HTMLDivElement>) => {\n const input = inputRef.current;\n if (input) {\n if (e.key === \"Delete\" || e.key === \"Backspace\") {\n if (input.value === \"\") {\n field.onChange(field.value.slice(0, -1));\n }\n }\n // This is not a default behavior of the <input /> field\n if (e.key === \"Escape\") {\n input.blur();\n }\n }\n });\n\n const availableChoices = allChoices.filter(\n (choice) => !field.value.includes(getChoiceValue(choice)),\n );\n const selectedChoices = allChoices.filter((choice) =>\n field.value.includes(getChoiceValue(choice)),\n );\n const [filterValue, setFilterValue] = React.useState(\"\");\n\n const getInputText = useCallback(\n (selectedChoice: any) => {\n if (typeof inputText === \"function\") {\n return inputText(selectedChoice);\n }\n if (inputText !== undefined) {\n return inputText;\n }\n return getChoiceText(selectedChoice);\n },\n [inputText, getChoiceText],\n );\n\n return (\n <FormField className={props.className} id={id} name={field.name}>\n {props.label !== false && (\n <FormLabel>\n <FieldTitle\n label={props.label}\n source={props.source ?? source}\n resource={resource}\n isRequired={isRequired}\n />\n </FormLabel>\n )}\n <FormControl>\n <Command\n onKeyDown={handleKeyDown}\n shouldFilter={!isFromReference}\n className=\"overflow-visible bg-transparent\"\n >\n <div className=\"group rounded-md bg-transparent dark:bg-input/30 border border-input px-3 py-1.75 text-sm transition-all ring-offset-background focus-within:border-ring focus-within:ring-ring/50 focus-within:ring-[3px]\">\n <div className=\"flex flex-wrap gap-1\">\n {selectedChoices.map((choice) => (\n <Badge key={getChoiceValue(choice)} variant=\"outline\">\n {getInputText(choice)}\n <button\n className=\"ml-1 rounded-full outline-none ring-offset-background focus:ring-2 focus:ring-ring focus:ring-offset-2\"\n onKeyDown={(e) => {\n if (e.key === \"Enter\") {\n handleUnselect(choice);\n }\n }}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onClick={(e) => {\n e.preventDefault();\n handleUnselect(choice);\n }}\n >\n <span className=\"sr-only\">\n {translate(\"ra.action.remove\", {\n _: \"Remove\",\n })}\n </span>\n <X className=\"h-3 w-3\" />\n </button>\n </Badge>\n ))}\n {/* Avoid having the \"Search\" Icon by not using CommandInput */}\n <CommandPrimitive.Input\n ref={inputRef}\n value={filterValue}\n onValueChange={(filter) => {\n setFilterValue(filter);\n // We don't want the ChoicesContext to filter the choices if the input\n // is not from a reference as it would also filter out the selected values\n if (isFromReference) {\n setFilters(filterToQuery(filter), undefined, true);\n }\n }}\n onBlur={() => setOpen(false)}\n onFocus={() => setOpen(true)}\n placeholder={placeholder}\n className=\"ml-2 flex-1 bg-transparent outline-none placeholder:text-muted-foreground\"\n />\n </div>\n </div>\n <div className=\"relative\">\n <CommandList>\n {open && availableChoices.length > 0 ? (\n <div className=\"absolute top-2 z-10 w-full rounded-md border bg-popover text-popover-foreground shadow-md outline-none animate-in\">\n <CommandGroup className=\"h-full overflow-auto\">\n {availableChoices.map((choice) => {\n return (\n <CommandItem\n key={getChoiceValue(choice)}\n onMouseDown={(e) => {\n e.preventDefault();\n e.stopPropagation();\n }}\n onSelect={() => {\n setFilterValue(\"\");\n if (isFromReference) {\n setFilters(filterToQuery(\"\"));\n }\n field.onChange([\n ...field.value,\n getChoiceValue(choice),\n ]);\n }}\n className=\"cursor-pointer\"\n >\n {getChoiceText(choice)}\n </CommandItem>\n );\n })}\n </CommandGroup>\n </div>\n ) : null}\n </CommandList>\n </div>\n </Command>\n </FormControl>\n <InputHelperText helperText={props.helperText} />\n <FormError />\n </FormField>\n );\n};\n\nconst DefaultFilterToQuery = (searchText: string) => ({ q: searchText });\n","import * as React from \"react\";\nimport type { ReactElement } from \"react\";\nimport type { InputProps, UseReferenceArrayInputParams } from \"ra-core\";\nimport {\n useReferenceArrayInputController,\n ResourceContextProvider,\n ChoicesContextProvider,\n} from \"ra-core\";\nimport { AutocompleteArrayInput } from \"@/components/admin/autocomplete-array-input\";\n\n/**\n * Form input for editing arrays of foreign key relationships with autocompletion.\n *\n * This component fetches related records from a reference resource and displays them\n * in a searchable multi-select interface using AutocompleteArrayInput.\n * Use it to edit one-to-many or many-to-many relationships, where the current record\n * has an array of foreign keys to another resource.\n *\n * @see {@link https://marmelab.com/shadcn-admin-kit/docs/referencearrayinput/ ReferenceArrayInput documentation}\n *\n * @example\n * import { Edit, SimpleForm, TextInput, ReferenceArrayInput } from '@/components/admin';\n *\n * const PostEdit = () => (\n * <Edit>\n * <SimpleForm>\n * <TextInput source=\"title\" />\n * <ReferenceArrayInput source=\"tag_ids\" reference=\"tags\" />\n * </SimpleForm>\n * </Edit>\n * );\n */\nexport const ReferenceArrayInput = (props: ReferenceArrayInputProps) => {\n const {\n children = defaultChildren,\n reference,\n sort,\n filter = defaultFilter,\n } = props;\n if (React.Children.count(children) !== 1) {\n throw new Error(\n \"<ReferenceArrayInput> only accepts a single child (like <AutocompleteArrayInput>)\",\n );\n }\n\n const controllerProps = useReferenceArrayInputController({\n ...props,\n sort,\n filter,\n });\n\n return (\n <ResourceContextProvider value={reference}>\n <ChoicesContextProvider value={controllerProps}>\n {children}\n </ChoicesContextProvider>\n </ResourceContextProvider>\n );\n};\n\nconst defaultChildren = <AutocompleteArrayInput />;\nconst defaultFilter = {};\n\nexport interface ReferenceArrayInputProps\n extends InputProps,\n UseReferenceArrayInputParams {\n children?: ReactElement;\n}\n","import * as React from \"react\";\nimport { useEffect, useState } from \"react\";\nimport type { InputProps } from \"ra-core\";\nimport { FieldTitle, useInput, useResourceContext } from \"ra-core\";\nimport { FormControl, FormField, FormLabel } from \"@/components/admin/form\";\nimport { Input } from \"@/components/ui/input\";\nimport { FormError } from \"@/components/admin/form\";\nimport { InputHelperText } from \"@/components/admin/input-helper-text\";\n\n/**\n * Input component for numeric values (integers and floats) with parsing and formatting support.\n *\n * Use `<NumberInput>` for prices, quantities, counts, or any numeric field. Manages a local string\n * state internally so users can type incomplete numbers (e.g. '-' or '0.') before the value is parsed.\n * Supports min/max constraints and step increments.\n *\n * @see {@link https://marmelab.com/shadcn-admin-kit/docs/numberinput/ NumberInput documentation}\n *\n * @example\n * import { Edit, SimpleForm, NumberInput, TextInput } from '@/components/admin';\n *\n * const ProductEdit = () => (\n * <Edit>\n * <SimpleForm>\n * <TextInput source=\"name\" />\n * <NumberInput source=\"price\" step={0.01} min={0} />\n * <NumberInput source=\"quantity\" min={0} />\n * </SimpleForm>\n * </Edit>\n * );\n */\nexport const NumberInput = (props: NumberInputProps) => {\n const {\n label,\n source,\n className,\n resource: resourceProp,\n validate: _validateProp,\n format: _formatProp,\n parse = convertStringToNumber,\n onFocus,\n ...rest\n } = props;\n const resource = useResourceContext({ resource: resourceProp });\n\n const { id, field, isRequired } = useInput(props);\n\n const handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {\n const value = event.target.value;\n const numberValue = parse(value);\n\n setValue(value);\n field.onChange(numberValue ?? 0);\n };\n\n const [value, setValue] = useState<string | undefined>(\n field.value?.toString() ?? \"\",\n );\n\n const hasFocus = React.useRef(false);\n\n const handleFocus = (event: React.FocusEvent<HTMLInputElement>) => {\n onFocus?.(event);\n hasFocus.current = true;\n };\n\n const handleBlur = (event: React.FocusEvent<HTMLInputElement>) => {\n field.onBlur?.(event);\n hasFocus.current = false;\n setValue(field.value?.toString() ?? \"\");\n };\n\n useEffect(() => {\n if (!hasFocus.current) {\n setValue(field.value?.toString() ?? \"\");\n }\n }, [field.value]);\n\n return (\n <FormField id={id} className={className} name={field.name}>\n {label !== false && (\n <FormLabel>\n <FieldTitle\n label={label}\n source={source}\n resource={resource}\n isRequired={isRequired}\n />\n </FormLabel>\n )}\n <FormControl>\n <Input\n {...rest}\n {...field}\n type=\"number\"\n value={value}\n onChange={handleChange}\n onFocus={handleFocus}\n onBlur={handleBlur}\n />\n </FormControl>\n <InputHelperText helperText={props.helperText} />\n <FormError />\n </FormField>\n );\n};\n\nexport interface NumberInputProps\n extends InputProps,\n Omit<\n React.ComponentProps<\"input\">,\n \"defaultValue\" | \"onBlur\" | \"onChange\" | \"type\"\n > {\n parse?: (value: string) => number;\n}\n\nconst convertStringToNumber = (value?: string | null) => {\n if (value == null || value === \"\") {\n return null;\n }\n const float = parseFloat(value);\n\n return isNaN(float) ? 0 : float;\n};\n","// src/utils/formatProdErrorMessage.ts\nfunction formatProdErrorMessage(code) {\n return `Minified Redux error #${code}; visit https://redux.js.org/Errors?code=${code} for the full message or use the non-minified dev environment for full errors. `;\n}\n\n// src/utils/symbol-observable.ts\nvar $$observable = /* @__PURE__ */ (() => typeof Symbol === \"function\" && Symbol.observable || \"@@observable\")();\nvar symbol_observable_default = $$observable;\n\n// src/utils/actionTypes.ts\nvar randomString = () => Math.random().toString(36).substring(7).split(\"\").join(\".\");\nvar ActionTypes = {\n INIT: `@@redux/INIT${/* @__PURE__ */ randomString()}`,\n REPLACE: `@@redux/REPLACE${/* @__PURE__ */ randomString()}`,\n PROBE_UNKNOWN_ACTION: () => `@@redux/PROBE_UNKNOWN_ACTION${randomString()}`\n};\nvar actionTypes_default = ActionTypes;\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null)\n return false;\n let proto = obj;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(obj) === proto || Object.getPrototypeOf(obj) === null;\n}\n\n// src/utils/kindOf.ts\nfunction miniKindOf(val) {\n if (val === void 0)\n return \"undefined\";\n if (val === null)\n return \"null\";\n const type = typeof val;\n switch (type) {\n case \"boolean\":\n case \"string\":\n case \"number\":\n case \"symbol\":\n case \"function\": {\n return type;\n }\n }\n if (Array.isArray(val))\n return \"array\";\n if (isDate(val))\n return \"date\";\n if (isError(val))\n return \"error\";\n const constructorName = ctorName(val);\n switch (constructorName) {\n case \"Symbol\":\n case \"Promise\":\n case \"WeakMap\":\n case \"WeakSet\":\n case \"Map\":\n case \"Set\":\n return constructorName;\n }\n return Object.prototype.toString.call(val).slice(8, -1).toLowerCase().replace(/\\s/g, \"\");\n}\nfunction ctorName(val) {\n return typeof val.constructor === \"function\" ? val.constructor.name : null;\n}\nfunction isError(val) {\n return val instanceof Error || typeof val.message === \"string\" && val.constructor && typeof val.constructor.stackTraceLimit === \"number\";\n}\nfunction isDate(val) {\n if (val instanceof Date)\n return true;\n return typeof val.toDateString === \"function\" && typeof val.getDate === \"function\" && typeof val.setDate === \"function\";\n}\nfunction kindOf(val) {\n let typeOfVal = typeof val;\n if (process.env.NODE_ENV !== \"production\") {\n typeOfVal = miniKindOf(val);\n }\n return typeOfVal;\n}\n\n// src/createStore.ts\nfunction createStore(reducer, preloadedState, enhancer) {\n if (typeof reducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(2) : `Expected the root reducer to be a function. Instead, received: '${kindOf(reducer)}'`);\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"function\" || typeof enhancer === \"function\" && typeof arguments[3] === \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(0) : \"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.\");\n }\n if (typeof preloadedState === \"function\" && typeof enhancer === \"undefined\") {\n enhancer = preloadedState;\n preloadedState = void 0;\n }\n if (typeof enhancer !== \"undefined\") {\n if (typeof enhancer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(1) : `Expected the enhancer to be a function. Instead, received: '${kindOf(enhancer)}'`);\n }\n return enhancer(createStore)(reducer, preloadedState);\n }\n let currentReducer = reducer;\n let currentState = preloadedState;\n let currentListeners = /* @__PURE__ */ new Map();\n let nextListeners = currentListeners;\n let listenerIdCounter = 0;\n let isDispatching = false;\n function ensureCanMutateNextListeners() {\n if (nextListeners === currentListeners) {\n nextListeners = /* @__PURE__ */ new Map();\n currentListeners.forEach((listener, key) => {\n nextListeners.set(key, listener);\n });\n }\n }\n function getState() {\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(3) : \"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.\");\n }\n return currentState;\n }\n function subscribe(listener) {\n if (typeof listener !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(4) : `Expected the listener to be a function. Instead, received: '${kindOf(listener)}'`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(5) : \"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n let isSubscribed = true;\n ensureCanMutateNextListeners();\n const listenerId = listenerIdCounter++;\n nextListeners.set(listenerId, listener);\n return function unsubscribe() {\n if (!isSubscribed) {\n return;\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(6) : \"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.\");\n }\n isSubscribed = false;\n ensureCanMutateNextListeners();\n nextListeners.delete(listenerId);\n currentListeners = null;\n };\n }\n function dispatch(action) {\n if (!isPlainObject(action)) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(7) : `Actions must be plain objects. Instead, the actual type was: '${kindOf(action)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);\n }\n if (typeof action.type === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(8) : 'Actions may not have an undefined \"type\" property. You may have misspelled an action type string constant.');\n }\n if (typeof action.type !== \"string\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(17) : `Action \"type\" property must be a string. Instead, the actual type was: '${kindOf(action.type)}'. Value was: '${action.type}' (stringified)`);\n }\n if (isDispatching) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(9) : \"Reducers may not dispatch actions.\");\n }\n try {\n isDispatching = true;\n currentState = currentReducer(currentState, action);\n } finally {\n isDispatching = false;\n }\n const listeners = currentListeners = nextListeners;\n listeners.forEach((listener) => {\n listener();\n });\n return action;\n }\n function replaceReducer(nextReducer) {\n if (typeof nextReducer !== \"function\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(10) : `Expected the nextReducer to be a function. Instead, received: '${kindOf(nextReducer)}`);\n }\n currentReducer = nextReducer;\n dispatch({\n type: actionTypes_default.REPLACE\n });\n }\n function observable() {\n const outerSubscribe = subscribe;\n return {\n /**\n * The minimal observable subscription method.\n * @param observer Any object that can be used as an observer.\n * The observer object should have a `next` method.\n * @returns An object with an `unsubscribe` method that can\n * be used to unsubscribe the observable from the store, and prevent further\n * emission of values from the observable.\n */\n subscribe(observer) {\n if (typeof observer !== \"object\" || observer === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(11) : `Expected the observer to be an object. Instead, received: '${kindOf(observer)}'`);\n }\n function observeState() {\n const observerAsObserver = observer;\n if (observerAsObserver.next) {\n observerAsObserver.next(getState());\n }\n }\n observeState();\n const unsubscribe = outerSubscribe(observeState);\n return {\n unsubscribe\n };\n },\n [symbol_observable_default]() {\n return this;\n }\n };\n }\n dispatch({\n type: actionTypes_default.INIT\n });\n const store = {\n dispatch,\n subscribe,\n getState,\n replaceReducer,\n [symbol_observable_default]: observable\n };\n return store;\n}\nfunction legacy_createStore(reducer, preloadedState, enhancer) {\n return createStore(reducer, preloadedState, enhancer);\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/combineReducers.ts\nfunction getUnexpectedStateShapeWarningMessage(inputState, reducers, action, unexpectedKeyCache) {\n const reducerKeys = Object.keys(reducers);\n const argumentName = action && action.type === actionTypes_default.INIT ? \"preloadedState argument passed to createStore\" : \"previous state received by the reducer\";\n if (reducerKeys.length === 0) {\n return \"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.\";\n }\n if (!isPlainObject(inputState)) {\n return `The ${argumentName} has unexpected type of \"${kindOf(inputState)}\". Expected argument to be an object with the following keys: \"${reducerKeys.join('\", \"')}\"`;\n }\n const unexpectedKeys = Object.keys(inputState).filter((key) => !reducers.hasOwnProperty(key) && !unexpectedKeyCache[key]);\n unexpectedKeys.forEach((key) => {\n unexpectedKeyCache[key] = true;\n });\n if (action && action.type === actionTypes_default.REPLACE)\n return;\n if (unexpectedKeys.length > 0) {\n return `Unexpected ${unexpectedKeys.length > 1 ? \"keys\" : \"key\"} \"${unexpectedKeys.join('\", \"')}\" found in ${argumentName}. Expected to find one of the known reducer keys instead: \"${reducerKeys.join('\", \"')}\". Unexpected keys will be ignored.`;\n }\n}\nfunction assertReducerShape(reducers) {\n Object.keys(reducers).forEach((key) => {\n const reducer = reducers[key];\n const initialState = reducer(void 0, {\n type: actionTypes_default.INIT\n });\n if (typeof initialState === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(12) : `The slice reducer for key \"${key}\" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);\n }\n if (typeof reducer(void 0, {\n type: actionTypes_default.PROBE_UNKNOWN_ACTION()\n }) === \"undefined\") {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(13) : `The slice reducer for key \"${key}\" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in \"redux/*\" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`);\n }\n });\n}\nfunction combineReducers(reducers) {\n const reducerKeys = Object.keys(reducers);\n const finalReducers = {};\n for (let i = 0; i < reducerKeys.length; i++) {\n const key = reducerKeys[i];\n if (process.env.NODE_ENV !== \"production\") {\n if (typeof reducers[key] === \"undefined\") {\n warning(`No reducer provided for key \"${key}\"`);\n }\n }\n if (typeof reducers[key] === \"function\") {\n finalReducers[key] = reducers[key];\n }\n }\n const finalReducerKeys = Object.keys(finalReducers);\n let unexpectedKeyCache;\n if (process.env.NODE_ENV !== \"production\") {\n unexpectedKeyCache = {};\n }\n let shapeAssertionError;\n try {\n assertReducerShape(finalReducers);\n } catch (e) {\n shapeAssertionError = e;\n }\n return function combination(state = {}, action) {\n if (shapeAssertionError) {\n throw shapeAssertionError;\n }\n if (process.env.NODE_ENV !== \"production\") {\n const warningMessage = getUnexpectedStateShapeWarningMessage(state, finalReducers, action, unexpectedKeyCache);\n if (warningMessage) {\n warning(warningMessage);\n }\n }\n let hasChanged = false;\n const nextState = {};\n for (let i = 0; i < finalReducerKeys.length; i++) {\n const key = finalReducerKeys[i];\n const reducer = finalReducers[key];\n const previousStateForKey = state[key];\n const nextStateForKey = reducer(previousStateForKey, action);\n if (typeof nextStateForKey === \"undefined\") {\n const actionType = action && action.type;\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(14) : `When called with an action of type ${actionType ? `\"${String(actionType)}\"` : \"(unknown type)\"}, the slice reducer for key \"${key}\" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`);\n }\n nextState[key] = nextStateForKey;\n hasChanged = hasChanged || nextStateForKey !== previousStateForKey;\n }\n hasChanged = hasChanged || finalReducerKeys.length !== Object.keys(state).length;\n return hasChanged ? nextState : state;\n };\n}\n\n// src/bindActionCreators.ts\nfunction bindActionCreator(actionCreator, dispatch) {\n return function(...args) {\n return dispatch(actionCreator.apply(this, args));\n };\n}\nfunction bindActionCreators(actionCreators, dispatch) {\n if (typeof actionCreators === \"function\") {\n return bindActionCreator(actionCreators, dispatch);\n }\n if (typeof actionCreators !== \"object\" || actionCreators === null) {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(16) : `bindActionCreators expected an object or a function, but instead received: '${kindOf(actionCreators)}'. Did you write \"import ActionCreators from\" instead of \"import * as ActionCreators from\"?`);\n }\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = bindActionCreator(actionCreator, dispatch);\n }\n }\n return boundActionCreators;\n}\n\n// src/compose.ts\nfunction compose(...funcs) {\n if (funcs.length === 0) {\n return (arg) => arg;\n }\n if (funcs.length === 1) {\n return funcs[0];\n }\n return funcs.reduce((a, b) => (...args) => a(b(...args)));\n}\n\n// src/applyMiddleware.ts\nfunction applyMiddleware(...middlewares) {\n return (createStore2) => (reducer, preloadedState) => {\n const store = createStore2(reducer, preloadedState);\n let dispatch = () => {\n throw new Error(process.env.NODE_ENV === \"production\" ? formatProdErrorMessage(15) : \"Dispatching while constructing your middleware is not allowed. Other middleware would not be applied to this dispatch.\");\n };\n const middlewareAPI = {\n getState: store.getState,\n dispatch: (action, ...args) => dispatch(action, ...args)\n };\n const chain = middlewares.map((middleware) => middleware(middlewareAPI));\n dispatch = compose(...chain)(store.dispatch);\n return {\n ...store,\n dispatch\n };\n };\n}\n\n// src/utils/isAction.ts\nfunction isAction(action) {\n return isPlainObject(action) && \"type\" in action && typeof action.type === \"string\";\n}\nexport {\n actionTypes_default as __DO_NOT_USE__ActionTypes,\n applyMiddleware,\n bindActionCreators,\n combineReducers,\n compose,\n createStore,\n isAction,\n isPlainObject,\n legacy_createStore\n};\n//# sourceMappingURL=redux.mjs.map","/**\n * @license React\n * use-sync-external-store-with-selector.production.js\n *\n * Copyright (c) Meta Platforms, Inc. and affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n */\n\n\"use strict\";\nvar React = require(\"react\");\nfunction is(x, y) {\n return (x === y && (0 !== x || 1 / x === 1 / y)) || (x !== x && y !== y);\n}\nvar objectIs = \"function\" === typeof Object.is ? Object.is : is,\n useSyncExternalStore = React.useSyncExternalStore,\n useRef = React.useRef,\n useEffect = React.useEffect,\n useMemo = React.useMemo,\n useDebugValue = React.useDebugValue;\nexports.useSyncExternalStoreWithSelector = function (\n subscribe,\n getSnapshot,\n getServerSnapshot,\n selector,\n isEqual\n) {\n var instRef = useRef(null);\n if (null === instRef.current) {\n var inst = { hasValue: !1, value: null };\n instRef.current = inst;\n } else inst = instRef.current;\n instRef = useMemo(\n function () {\n function memoizedSelector(nextSnapshot) {\n if (!hasMemo) {\n hasMemo = !0;\n memoizedSnapshot = nextSnapshot;\n nextSnapshot = selector(nextSnapshot);\n if (void 0 !== isEqual && inst.hasValue) {\n var currentSelection = inst.value;\n if (isEqual(currentSelection, nextSnapshot))\n return (memoizedSelection = currentSelection);\n }\n return (memoizedSelection = nextSnapshot);\n }\n currentSelection = memoizedSelection;\n if (objectIs(memoizedSnapshot, nextSnapshot)) return currentSelection;\n var nextSelection = selector(nextSnapshot);\n if (void 0 !== isEqual && isEqual(currentSelection, nextSelection))\n return (memoizedSnapshot = nextSnapshot), currentSelection;\n memoizedSnapshot = nextSnapshot;\n return (memoizedSelection = nextSelection);\n }\n var hasMemo = !1,\n memoizedSnapshot,\n memoizedSelection,\n maybeGetServerSnapshot =\n void 0 === getServerSnapshot ? null : getServerSnapshot;\n return [\n function () {\n return memoizedSelector(getSnapshot());\n },\n null === maybeGetServerSnapshot\n ? void 0\n : function () {\n return memoizedSelector(maybeGetServerSnapshot());\n }\n ];\n },\n [getSnapshot, getServerSnapshot, selector, isEqual]\n );\n var value = useSyncExternalStore(subscribe, instRef[0], instRef[1]);\n useEffect(\n function () {\n inst.hasValue = !0;\n inst.value = value;\n },\n [value]\n );\n useDebugValue(value);\n return value;\n};\n","'use strict';\n\nif (process.env.NODE_ENV === 'production') {\n module.exports = require('./cjs/use-sync-external-store-with-selector.production.js');\n} else {\n module.exports = require('./cjs/use-sync-external-store-with-selector.development.js');\n}\n","// src/utils/react.ts\nimport * as React from \"react\";\n\n// src/utils/react-is.ts\nvar IS_REACT_19 = /* @__PURE__ */ React.version.startsWith(\"19\");\nvar REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for(\n IS_REACT_19 ? \"react.transitional.element\" : \"react.element\"\n);\nvar REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for(\"react.portal\");\nvar REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for(\"react.fragment\");\nvar REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for(\"react.strict_mode\");\nvar REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for(\"react.profiler\");\nvar REACT_CONSUMER_TYPE = /* @__PURE__ */ Symbol.for(\"react.consumer\");\nvar REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for(\"react.context\");\nvar REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for(\"react.forward_ref\");\nvar REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for(\"react.suspense\");\nvar REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for(\n \"react.suspense_list\"\n);\nvar REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for(\"react.memo\");\nvar REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for(\"react.lazy\");\nvar REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for(\"react.offscreen\");\nvar REACT_CLIENT_REFERENCE = /* @__PURE__ */ Symbol.for(\n \"react.client.reference\"\n);\nvar ForwardRef = REACT_FORWARD_REF_TYPE;\nvar Memo = REACT_MEMO_TYPE;\nfunction isValidElementType(type) {\n return typeof type === \"string\" || typeof type === \"function\" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || type === REACT_OFFSCREEN_TYPE || typeof type === \"object\" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_CONSUMER_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || type.$$typeof === REACT_CLIENT_REFERENCE || type.getModuleId !== void 0) ? true : false;\n}\nfunction typeOf(object) {\n if (typeof object === \"object\" && object !== null) {\n const { $$typeof } = object;\n switch ($$typeof) {\n case REACT_ELEMENT_TYPE:\n switch (object = object.type, object) {\n case REACT_FRAGMENT_TYPE:\n case REACT_PROFILER_TYPE:\n case REACT_STRICT_MODE_TYPE:\n case REACT_SUSPENSE_TYPE:\n case REACT_SUSPENSE_LIST_TYPE:\n return object;\n default:\n switch (object = object && object.$$typeof, object) {\n case REACT_CONTEXT_TYPE:\n case REACT_FORWARD_REF_TYPE:\n case REACT_LAZY_TYPE:\n case REACT_MEMO_TYPE:\n return object;\n case REACT_CONSUMER_TYPE:\n return object;\n default:\n return $$typeof;\n }\n }\n case REACT_PORTAL_TYPE:\n return $$typeof;\n }\n }\n}\nfunction isContextConsumer(object) {\n return IS_REACT_19 ? typeOf(object) === REACT_CONSUMER_TYPE : typeOf(object) === REACT_CONTEXT_TYPE;\n}\nfunction isMemo(object) {\n return typeOf(object) === REACT_MEMO_TYPE;\n}\n\n// src/utils/warning.ts\nfunction warning(message) {\n if (typeof console !== \"undefined\" && typeof console.error === \"function\") {\n console.error(message);\n }\n try {\n throw new Error(message);\n } catch (e) {\n }\n}\n\n// src/connect/verifySubselectors.ts\nfunction verify(selector, methodName) {\n if (!selector) {\n throw new Error(`Unexpected value for ${methodName} in connect.`);\n } else if (methodName === \"mapStateToProps\" || methodName === \"mapDispatchToProps\") {\n if (!Object.prototype.hasOwnProperty.call(selector, \"dependsOnOwnProps\")) {\n warning(\n `The selector for ${methodName} of connect did not specify a value for dependsOnOwnProps.`\n );\n }\n }\n}\nfunction verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps) {\n verify(mapStateToProps, \"mapStateToProps\");\n verify(mapDispatchToProps, \"mapDispatchToProps\");\n verify(mergeProps, \"mergeProps\");\n}\n\n// src/connect/selectorFactory.ts\nfunction pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, {\n areStatesEqual,\n areOwnPropsEqual,\n areStatePropsEqual\n}) {\n let hasRunAtLeastOnce = false;\n let state;\n let ownProps;\n let stateProps;\n let dispatchProps;\n let mergedProps;\n function handleFirstCall(firstState, firstOwnProps) {\n state = firstState;\n ownProps = firstOwnProps;\n stateProps = mapStateToProps(state, ownProps);\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n hasRunAtLeastOnce = true;\n return mergedProps;\n }\n function handleNewPropsAndNewState() {\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewProps() {\n if (mapStateToProps.dependsOnOwnProps)\n stateProps = mapStateToProps(state, ownProps);\n if (mapDispatchToProps.dependsOnOwnProps)\n dispatchProps = mapDispatchToProps(dispatch, ownProps);\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleNewState() {\n const nextStateProps = mapStateToProps(state, ownProps);\n const statePropsChanged = !areStatePropsEqual(nextStateProps, stateProps);\n stateProps = nextStateProps;\n if (statePropsChanged)\n mergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n return mergedProps;\n }\n function handleSubsequentCalls(nextState, nextOwnProps) {\n const propsChanged = !areOwnPropsEqual(nextOwnProps, ownProps);\n const stateChanged = !areStatesEqual(\n nextState,\n state,\n nextOwnProps,\n ownProps\n );\n state = nextState;\n ownProps = nextOwnProps;\n if (propsChanged && stateChanged) return handleNewPropsAndNewState();\n if (propsChanged) return handleNewProps();\n if (stateChanged) return handleNewState();\n return mergedProps;\n }\n return function pureFinalPropsSelector(nextState, nextOwnProps) {\n return hasRunAtLeastOnce ? handleSubsequentCalls(nextState, nextOwnProps) : handleFirstCall(nextState, nextOwnProps);\n };\n}\nfunction finalPropsSelectorFactory(dispatch, {\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n ...options\n}) {\n const mapStateToProps = initMapStateToProps(dispatch, options);\n const mapDispatchToProps = initMapDispatchToProps(dispatch, options);\n const mergeProps = initMergeProps(dispatch, options);\n if (process.env.NODE_ENV !== \"production\") {\n verifySubselectors(mapStateToProps, mapDispatchToProps, mergeProps);\n }\n return pureFinalPropsSelectorFactory(mapStateToProps, mapDispatchToProps, mergeProps, dispatch, options);\n}\n\n// src/utils/bindActionCreators.ts\nfunction bindActionCreators(actionCreators, dispatch) {\n const boundActionCreators = {};\n for (const key in actionCreators) {\n const actionCreator = actionCreators[key];\n if (typeof actionCreator === \"function\") {\n boundActionCreators[key] = (...args) => dispatch(actionCreator(...args));\n }\n }\n return boundActionCreators;\n}\n\n// src/utils/isPlainObject.ts\nfunction isPlainObject(obj) {\n if (typeof obj !== \"object\" || obj === null) return false;\n const proto = Object.getPrototypeOf(obj);\n if (proto === null) return true;\n let baseProto = proto;\n while (Object.getPrototypeOf(baseProto) !== null) {\n baseProto = Object.getPrototypeOf(baseProto);\n }\n return proto === baseProto;\n}\n\n// src/utils/verifyPlainObject.ts\nfunction verifyPlainObject(value, displayName, methodName) {\n if (!isPlainObject(value)) {\n warning(\n `${methodName}() in ${displayName} must return a plain object. Instead received ${value}.`\n );\n }\n}\n\n// src/connect/wrapMapToProps.ts\nfunction wrapMapToPropsConstant(getConstant) {\n return function initConstantSelector(dispatch) {\n const constant = getConstant(dispatch);\n function constantSelector() {\n return constant;\n }\n constantSelector.dependsOnOwnProps = false;\n return constantSelector;\n };\n}\nfunction getDependsOnOwnProps(mapToProps) {\n return mapToProps.dependsOnOwnProps ? Boolean(mapToProps.dependsOnOwnProps) : mapToProps.length !== 1;\n}\nfunction wrapMapToPropsFunc(mapToProps, methodName) {\n return function initProxySelector(dispatch, { displayName }) {\n const proxy = function mapToPropsProxy(stateOrDispatch, ownProps) {\n return proxy.dependsOnOwnProps ? proxy.mapToProps(stateOrDispatch, ownProps) : proxy.mapToProps(stateOrDispatch, void 0);\n };\n proxy.dependsOnOwnProps = true;\n proxy.mapToProps = function detectFactoryAndVerify(stateOrDispatch, ownProps) {\n proxy.mapToProps = mapToProps;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(mapToProps);\n let props = proxy(stateOrDispatch, ownProps);\n if (typeof props === \"function\") {\n proxy.mapToProps = props;\n proxy.dependsOnOwnProps = getDependsOnOwnProps(props);\n props = proxy(stateOrDispatch, ownProps);\n }\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(props, displayName, methodName);\n return props;\n };\n return proxy;\n };\n}\n\n// src/connect/invalidArgFactory.ts\nfunction createInvalidArgFactory(arg, name) {\n return (dispatch, options) => {\n throw new Error(\n `Invalid value of type ${typeof arg} for ${name} argument when connecting component ${options.wrappedComponentName}.`\n );\n };\n}\n\n// src/connect/mapDispatchToProps.ts\nfunction mapDispatchToPropsFactory(mapDispatchToProps) {\n return mapDispatchToProps && typeof mapDispatchToProps === \"object\" ? wrapMapToPropsConstant(\n (dispatch) => (\n // @ts-ignore\n bindActionCreators(mapDispatchToProps, dispatch)\n )\n ) : !mapDispatchToProps ? wrapMapToPropsConstant((dispatch) => ({\n dispatch\n })) : typeof mapDispatchToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapDispatchToProps, \"mapDispatchToProps\")\n ) : createInvalidArgFactory(mapDispatchToProps, \"mapDispatchToProps\");\n}\n\n// src/connect/mapStateToProps.ts\nfunction mapStateToPropsFactory(mapStateToProps) {\n return !mapStateToProps ? wrapMapToPropsConstant(() => ({})) : typeof mapStateToProps === \"function\" ? (\n // @ts-ignore\n wrapMapToPropsFunc(mapStateToProps, \"mapStateToProps\")\n ) : createInvalidArgFactory(mapStateToProps, \"mapStateToProps\");\n}\n\n// src/connect/mergeProps.ts\nfunction defaultMergeProps(stateProps, dispatchProps, ownProps) {\n return { ...ownProps, ...stateProps, ...dispatchProps };\n}\nfunction wrapMergePropsFunc(mergeProps) {\n return function initMergePropsProxy(dispatch, { displayName, areMergedPropsEqual }) {\n let hasRunOnce = false;\n let mergedProps;\n return function mergePropsProxy(stateProps, dispatchProps, ownProps) {\n const nextMergedProps = mergeProps(stateProps, dispatchProps, ownProps);\n if (hasRunOnce) {\n if (!areMergedPropsEqual(nextMergedProps, mergedProps))\n mergedProps = nextMergedProps;\n } else {\n hasRunOnce = true;\n mergedProps = nextMergedProps;\n if (process.env.NODE_ENV !== \"production\")\n verifyPlainObject(mergedProps, displayName, \"mergeProps\");\n }\n return mergedProps;\n };\n };\n}\nfunction mergePropsFactory(mergeProps) {\n return !mergeProps ? () => defaultMergeProps : typeof mergeProps === \"function\" ? wrapMergePropsFunc(mergeProps) : createInvalidArgFactory(mergeProps, \"mergeProps\");\n}\n\n// src/utils/batch.ts\nfunction defaultNoopBatch(callback) {\n callback();\n}\n\n// src/utils/Subscription.ts\nfunction createListenerCollection() {\n let first = null;\n let last = null;\n return {\n clear() {\n first = null;\n last = null;\n },\n notify() {\n defaultNoopBatch(() => {\n let listener = first;\n while (listener) {\n listener.callback();\n listener = listener.next;\n }\n });\n },\n get() {\n const listeners = [];\n let listener = first;\n while (listener) {\n listeners.push(listener);\n listener = listener.next;\n }\n return listeners;\n },\n subscribe(callback) {\n let isSubscribed = true;\n const listener = last = {\n callback,\n next: null,\n prev: last\n };\n if (listener.prev) {\n listener.prev.next = listener;\n } else {\n first = listener;\n }\n return function unsubscribe() {\n if (!isSubscribed || first === null) return;\n isSubscribed = false;\n if (listener.next) {\n listener.next.prev = listener.prev;\n } else {\n last = listener.prev;\n }\n if (listener.prev) {\n listener.prev.next = listener.next;\n } else {\n first = listener.next;\n }\n };\n }\n };\n}\nvar nullListeners = {\n notify() {\n },\n get: () => []\n};\nfunction createSubscription(store, parentSub) {\n let unsubscribe;\n let listeners = nullListeners;\n let subscriptionsAmount = 0;\n let selfSubscribed = false;\n function addNestedSub(listener) {\n trySubscribe();\n const cleanupListener = listeners.subscribe(listener);\n let removed = false;\n return () => {\n if (!removed) {\n removed = true;\n cleanupListener();\n tryUnsubscribe();\n }\n };\n }\n function notifyNestedSubs() {\n listeners.notify();\n }\n function handleChangeWrapper() {\n if (subscription.onStateChange) {\n subscription.onStateChange();\n }\n }\n function isSubscribed() {\n return selfSubscribed;\n }\n function trySubscribe() {\n subscriptionsAmount++;\n if (!unsubscribe) {\n unsubscribe = parentSub ? parentSub.addNestedSub(handleChangeWrapper) : store.subscribe(handleChangeWrapper);\n listeners = createListenerCollection();\n }\n }\n function tryUnsubscribe() {\n subscriptionsAmount--;\n if (unsubscribe && subscriptionsAmount === 0) {\n unsubscribe();\n unsubscribe = void 0;\n listeners.clear();\n listeners = nullListeners;\n }\n }\n function trySubscribeSelf() {\n if (!selfSubscribed) {\n selfSubscribed = true;\n trySubscribe();\n }\n }\n function tryUnsubscribeSelf() {\n if (selfSubscribed) {\n selfSubscribed = false;\n tryUnsubscribe();\n }\n }\n const subscription = {\n addNestedSub,\n notifyNestedSubs,\n handleChangeWrapper,\n isSubscribed,\n trySubscribe: trySubscribeSelf,\n tryUnsubscribe: tryUnsubscribeSelf,\n getListeners: () => listeners\n };\n return subscription;\n}\n\n// src/utils/useIsomorphicLayoutEffect.ts\nvar canUseDOM = () => !!(typeof window !== \"undefined\" && typeof window.document !== \"undefined\" && typeof window.document.createElement !== \"undefined\");\nvar isDOM = /* @__PURE__ */ canUseDOM();\nvar isRunningInReactNative = () => typeof navigator !== \"undefined\" && navigator.product === \"ReactNative\";\nvar isReactNative = /* @__PURE__ */ isRunningInReactNative();\nvar getUseIsomorphicLayoutEffect = () => isDOM || isReactNative ? React.useLayoutEffect : React.useEffect;\nvar useIsomorphicLayoutEffect = /* @__PURE__ */ getUseIsomorphicLayoutEffect();\n\n// src/utils/shallowEqual.ts\nfunction is(x, y) {\n if (x === y) {\n return x !== 0 || y !== 0 || 1 / x === 1 / y;\n } else {\n return x !== x && y !== y;\n }\n}\nfunction shallowEqual(objA, objB) {\n if (is(objA, objB)) return true;\n if (typeof objA !== \"object\" || objA === null || typeof objB !== \"object\" || objB === null) {\n return false;\n }\n const keysA = Object.keys(objA);\n const keysB = Object.keys(objB);\n if (keysA.length !== keysB.length) return false;\n for (let i = 0; i < keysA.length; i++) {\n if (!Object.prototype.hasOwnProperty.call(objB, keysA[i]) || !is(objA[keysA[i]], objB[keysA[i]])) {\n return false;\n }\n }\n return true;\n}\n\n// src/utils/hoistStatics.ts\nvar REACT_STATICS = {\n childContextTypes: true,\n contextType: true,\n contextTypes: true,\n defaultProps: true,\n displayName: true,\n getDefaultProps: true,\n getDerivedStateFromError: true,\n getDerivedStateFromProps: true,\n mixins: true,\n propTypes: true,\n type: true\n};\nvar KNOWN_STATICS = {\n name: true,\n length: true,\n prototype: true,\n caller: true,\n callee: true,\n arguments: true,\n arity: true\n};\nvar FORWARD_REF_STATICS = {\n $$typeof: true,\n render: true,\n defaultProps: true,\n displayName: true,\n propTypes: true\n};\nvar MEMO_STATICS = {\n $$typeof: true,\n compare: true,\n defaultProps: true,\n displayName: true,\n propTypes: true,\n type: true\n};\nvar TYPE_STATICS = {\n [ForwardRef]: FORWARD_REF_STATICS,\n [Memo]: MEMO_STATICS\n};\nfunction getStatics(component) {\n if (isMemo(component)) {\n return MEMO_STATICS;\n }\n return TYPE_STATICS[component[\"$$typeof\"]] || REACT_STATICS;\n}\nvar defineProperty = Object.defineProperty;\nvar getOwnPropertyNames = Object.getOwnPropertyNames;\nvar getOwnPropertySymbols = Object.getOwnPropertySymbols;\nvar getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;\nvar getPrototypeOf = Object.getPrototypeOf;\nvar objectPrototype = Object.prototype;\nfunction hoistNonReactStatics(targetComponent, sourceComponent) {\n if (typeof sourceComponent !== \"string\") {\n if (objectPrototype) {\n const inheritedComponent = getPrototypeOf(sourceComponent);\n if (inheritedComponent && inheritedComponent !== objectPrototype) {\n hoistNonReactStatics(targetComponent, inheritedComponent);\n }\n }\n let keys = getOwnPropertyNames(sourceComponent);\n if (getOwnPropertySymbols) {\n keys = keys.concat(getOwnPropertySymbols(sourceComponent));\n }\n const targetStatics = getStatics(targetComponent);\n const sourceStatics = getStatics(sourceComponent);\n for (let i = 0; i < keys.length; ++i) {\n const key = keys[i];\n if (!KNOWN_STATICS[key] && !(sourceStatics && sourceStatics[key]) && !(targetStatics && targetStatics[key])) {\n const descriptor = getOwnPropertyDescriptor(sourceComponent, key);\n try {\n defineProperty(targetComponent, key, descriptor);\n } catch (e) {\n }\n }\n }\n }\n return targetComponent;\n}\n\n// src/components/Context.ts\nvar ContextKey = /* @__PURE__ */ Symbol.for(`react-redux-context`);\nvar gT = typeof globalThis !== \"undefined\" ? globalThis : (\n /* fall back to a per-module scope (pre-8.1 behaviour) if `globalThis` is not available */\n {}\n);\nfunction getContext() {\n if (!React.createContext) return {};\n const contextMap = gT[ContextKey] ??= /* @__PURE__ */ new Map();\n let realContext = contextMap.get(React.createContext);\n if (!realContext) {\n realContext = React.createContext(\n null\n );\n if (process.env.NODE_ENV !== \"production\") {\n realContext.displayName = \"ReactRedux\";\n }\n contextMap.set(React.createContext, realContext);\n }\n return realContext;\n}\nvar ReactReduxContext = /* @__PURE__ */ getContext();\n\n// src/components/connect.tsx\nvar NO_SUBSCRIPTION_ARRAY = [null, null];\nvar stringifyComponent = (Comp) => {\n try {\n return JSON.stringify(Comp);\n } catch (err) {\n return String(Comp);\n }\n};\nfunction useIsomorphicLayoutEffectWithArgs(effectFunc, effectArgs, dependencies) {\n useIsomorphicLayoutEffect(() => effectFunc(...effectArgs), dependencies);\n}\nfunction captureWrapperProps(lastWrapperProps, lastChildProps, renderIsScheduled, wrapperProps, childPropsFromStoreUpdate, notifyNestedSubs) {\n lastWrapperProps.current = wrapperProps;\n renderIsScheduled.current = false;\n if (childPropsFromStoreUpdate.current) {\n childPropsFromStoreUpdate.current = null;\n notifyNestedSubs();\n }\n}\nfunction subscribeUpdates(shouldHandleStateChanges, store, subscription, childPropsSelector, lastWrapperProps, lastChildProps, renderIsScheduled, isMounted, childPropsFromStoreUpdate, notifyNestedSubs, additionalSubscribeListener) {\n if (!shouldHandleStateChanges) return () => {\n };\n let didUnsubscribe = false;\n let lastThrownError = null;\n const checkForUpdates = () => {\n if (didUnsubscribe || !isMounted.current) {\n return;\n }\n const latestStoreState = store.getState();\n let newChildProps, error;\n try {\n newChildProps = childPropsSelector(\n latestStoreState,\n lastWrapperProps.current\n );\n } catch (e) {\n error = e;\n lastThrownError = e;\n }\n if (!error) {\n lastThrownError = null;\n }\n if (newChildProps === lastChildProps.current) {\n if (!renderIsScheduled.current) {\n notifyNestedSubs();\n }\n } else {\n lastChildProps.current = newChildProps;\n childPropsFromStoreUpdate.current = newChildProps;\n renderIsScheduled.current = true;\n additionalSubscribeListener();\n }\n };\n subscription.onStateChange = checkForUpdates;\n subscription.trySubscribe();\n checkForUpdates();\n const unsubscribeWrapper = () => {\n didUnsubscribe = true;\n subscription.tryUnsubscribe();\n subscription.onStateChange = null;\n if (lastThrownError) {\n throw lastThrownError;\n }\n };\n return unsubscribeWrapper;\n}\nfunction strictEqual(a, b) {\n return a === b;\n}\nvar hasWarnedAboutDeprecatedPureOption = false;\nfunction connect(mapStateToProps, mapDispatchToProps, mergeProps, {\n // The `pure` option has been removed, so TS doesn't like us destructuring this to check its existence.\n // @ts-ignore\n pure,\n areStatesEqual = strictEqual,\n areOwnPropsEqual = shallowEqual,\n areStatePropsEqual = shallowEqual,\n areMergedPropsEqual = shallowEqual,\n // use React's forwardRef to expose a ref of the wrapped component\n forwardRef = false,\n // the context consumer to use\n context = ReactReduxContext\n} = {}) {\n if (process.env.NODE_ENV !== \"production\") {\n if (pure !== void 0 && !hasWarnedAboutDeprecatedPureOption) {\n hasWarnedAboutDeprecatedPureOption = true;\n warning(\n 'The `pure` option has been removed. `connect` is now always a \"pure/memoized\" component'\n );\n }\n }\n const Context = context;\n const initMapStateToProps = mapStateToPropsFactory(mapStateToProps);\n const initMapDispatchToProps = mapDispatchToPropsFactory(mapDispatchToProps);\n const initMergeProps = mergePropsFactory(mergeProps);\n const shouldHandleStateChanges = Boolean(mapStateToProps);\n const wrapWithConnect = (WrappedComponent) => {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isValidElementType(WrappedComponent);\n if (!isValid)\n throw new Error(\n `You must pass a component to the function returned by connect. Instead received ${stringifyComponent(\n WrappedComponent\n )}`\n );\n }\n const wrappedComponentName = WrappedComponent.displayName || WrappedComponent.name || \"Component\";\n const displayName = `Connect(${wrappedComponentName})`;\n const selectorFactoryOptions = {\n shouldHandleStateChanges,\n displayName,\n wrappedComponentName,\n WrappedComponent,\n // @ts-ignore\n initMapStateToProps,\n initMapDispatchToProps,\n initMergeProps,\n areStatesEqual,\n areStatePropsEqual,\n areOwnPropsEqual,\n areMergedPropsEqual\n };\n function ConnectFunction(props) {\n const [propsContext, reactReduxForwardedRef, wrapperProps] = React.useMemo(() => {\n const { reactReduxForwardedRef: reactReduxForwardedRef2, ...wrapperProps2 } = props;\n return [props.context, reactReduxForwardedRef2, wrapperProps2];\n }, [props]);\n const ContextToUse = React.useMemo(() => {\n let ResultContext = Context;\n if (propsContext?.Consumer) {\n if (process.env.NODE_ENV !== \"production\") {\n const isValid = /* @__PURE__ */ isContextConsumer(\n // @ts-ignore\n /* @__PURE__ */ React.createElement(propsContext.Consumer, null)\n );\n if (!isValid) {\n throw new Error(\n \"You must pass a valid React context consumer as `props.context`\"\n );\n }\n ResultContext = propsContext;\n }\n }\n return ResultContext;\n }, [propsContext, Context]);\n const contextValue = React.useContext(ContextToUse);\n const didStoreComeFromProps = Boolean(props.store) && Boolean(props.store.getState) && Boolean(props.store.dispatch);\n const didStoreComeFromContext = Boolean(contextValue) && Boolean(contextValue.store);\n if (process.env.NODE_ENV !== \"production\" && !didStoreComeFromProps && !didStoreComeFromContext) {\n throw new Error(\n `Could not find \"store\" in the context of \"${displayName}\". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to ${displayName} in connect options.`\n );\n }\n const store = didStoreComeFromProps ? props.store : contextValue.store;\n const getServerState = didStoreComeFromContext ? contextValue.getServerState : store.getState;\n const childPropsSelector = React.useMemo(() => {\n return finalPropsSelectorFactory(store.dispatch, selectorFactoryOptions);\n }, [store]);\n const [subscription, notifyNestedSubs] = React.useMemo(() => {\n if (!shouldHandleStateChanges) return NO_SUBSCRIPTION_ARRAY;\n const subscription2 = createSubscription(\n store,\n didStoreComeFromProps ? void 0 : contextValue.subscription\n );\n const notifyNestedSubs2 = subscription2.notifyNestedSubs.bind(subscription2);\n return [subscription2, notifyNestedSubs2];\n }, [store, didStoreComeFromProps, contextValue]);\n const overriddenContextValue = React.useMemo(() => {\n if (didStoreComeFromProps) {\n return contextValue;\n }\n return {\n ...contextValue,\n subscription\n };\n }, [didStoreComeFromProps, contextValue, subscription]);\n const lastChildProps = React.useRef(void 0);\n const lastWrapperProps = React.useRef(wrapperProps);\n const childPropsFromStoreUpdate = React.useRef(void 0);\n const renderIsScheduled = React.useRef(false);\n const isMounted = React.useRef(false);\n const latestSubscriptionCallbackError = React.useRef(\n void 0\n );\n useIsomorphicLayoutEffect(() => {\n isMounted.current = true;\n return () => {\n isMounted.current = false;\n };\n }, []);\n const actualChildPropsSelector = React.useMemo(() => {\n const selector = () => {\n if (childPropsFromStoreUpdate.current && wrapperProps === lastWrapperProps.current) {\n return childPropsFromStoreUpdate.current;\n }\n return childPropsSelector(store.getState(), wrapperProps);\n };\n return selector;\n }, [store, wrapperProps]);\n const subscribeForReact = React.useMemo(() => {\n const subscribe = (reactListener) => {\n if (!subscription) {\n return () => {\n };\n }\n return subscribeUpdates(\n shouldHandleStateChanges,\n store,\n subscription,\n // @ts-ignore\n childPropsSelector,\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n isMounted,\n childPropsFromStoreUpdate,\n notifyNestedSubs,\n reactListener\n );\n };\n return subscribe;\n }, [subscription]);\n useIsomorphicLayoutEffectWithArgs(captureWrapperProps, [\n lastWrapperProps,\n lastChildProps,\n renderIsScheduled,\n wrapperProps,\n childPropsFromStoreUpdate,\n notifyNestedSubs\n ]);\n let actualChildProps;\n try {\n actualChildProps = React.useSyncExternalStore(\n // TODO We're passing through a big wrapper that does a bunch of extra side effects besides subscribing\n subscribeForReact,\n // TODO This is incredibly hacky. We've already processed the store update and calculated new child props,\n // TODO and we're just passing that through so it triggers a re-render for us rather than relying on `uSES`.\n actualChildPropsSelector,\n getServerState ? () => childPropsSelector(getServerState(), wrapperProps) : actualChildPropsSelector\n );\n } catch (err) {\n if (latestSubscriptionCallbackError.current) {\n ;\n err.message += `\nThe error may be correlated with this previous error:\n${latestSubscriptionCallbackError.current.stack}\n\n`;\n }\n throw err;\n }\n useIsomorphicLayoutEffect(() => {\n latestSubscriptionCallbackError.current = void 0;\n childPropsFromStoreUpdate.current = void 0;\n lastChildProps.current = actualChildProps;\n });\n const renderedWrappedComponent = React.useMemo(() => {\n return (\n // @ts-ignore\n /* @__PURE__ */ React.createElement(\n WrappedComponent,\n {\n ...actualChildProps,\n ref: reactReduxForwardedRef\n }\n )\n );\n }, [reactReduxForwardedRef, WrappedComponent, actualChildProps]);\n const renderedChild = React.useMemo(() => {\n if (shouldHandleStateChanges) {\n return /* @__PURE__ */ React.createElement(ContextToUse.Provider, { value: overriddenContextValue }, renderedWrappedComponent);\n }\n return renderedWrappedComponent;\n }, [ContextToUse, renderedWrappedComponent, overriddenContextValue]);\n return renderedChild;\n }\n const _Connect = React.memo(ConnectFunction);\n const Connect = _Connect;\n Connect.WrappedComponent = WrappedComponent;\n Connect.displayName = ConnectFunction.displayName = displayName;\n if (forwardRef) {\n const _forwarded = React.forwardRef(\n function forwardConnectRef(props, ref) {\n return /* @__PURE__ */ React.createElement(Connect, { ...props, reactReduxForwardedRef: ref });\n }\n );\n const forwarded = _forwarded;\n forwarded.displayName = displayName;\n forwarded.WrappedComponent = WrappedComponent;\n return /* @__PURE__ */ hoistNonReactStatics(forwarded, WrappedComponent);\n }\n return /* @__PURE__ */ hoistNonReactStatics(Connect, WrappedComponent);\n };\n return wrapWithConnect;\n}\nvar connect_default = connect;\n\n// src/components/Provider.tsx\nfunction Provider(providerProps) {\n const { children, context, serverState, store } = providerProps;\n const contextValue = React.useMemo(() => {\n const subscription = createSubscription(store);\n const baseContextValue = {\n store,\n subscription,\n getServerState: serverState ? () => serverState : void 0\n };\n if (process.env.NODE_ENV === \"production\") {\n return baseContextValue;\n } else {\n const { identityFunctionCheck = \"once\", stabilityCheck = \"once\" } = providerProps;\n return /* @__PURE__ */ Object.assign(baseContextValue, {\n stabilityCheck,\n identityFunctionCheck\n });\n }\n }, [store, serverState]);\n const previousState = React.useMemo(() => store.getState(), [store]);\n useIsomorphicLayoutEffect(() => {\n const { subscription } = contextValue;\n subscription.onStateChange = subscription.notifyNestedSubs;\n subscription.trySubscribe();\n if (previousState !== store.getState()) {\n subscription.notifyNestedSubs();\n }\n return () => {\n subscription.tryUnsubscribe();\n subscription.onStateChange = void 0;\n };\n }, [contextValue, previousState]);\n const Context = context || ReactReduxContext;\n return /* @__PURE__ */ React.createElement(Context.Provider, { value: contextValue }, children);\n}\nvar Provider_default = Provider;\n\n// src/hooks/useReduxContext.ts\nfunction createReduxContextHook(context = ReactReduxContext) {\n return function useReduxContext2() {\n const contextValue = React.useContext(context);\n if (process.env.NODE_ENV !== \"production\" && !contextValue) {\n throw new Error(\n \"could not find react-redux context value; please ensure the component is wrapped in a <Provider>\"\n );\n }\n return contextValue;\n };\n}\nvar useReduxContext = /* @__PURE__ */ createReduxContextHook();\n\n// src/hooks/useStore.ts\nfunction createStoreHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : (\n // @ts-ignore\n createReduxContextHook(context)\n );\n const useStore2 = () => {\n const { store } = useReduxContext2();\n return store;\n };\n Object.assign(useStore2, {\n withTypes: () => useStore2\n });\n return useStore2;\n}\nvar useStore = /* @__PURE__ */ createStoreHook();\n\n// src/hooks/useDispatch.ts\nfunction createDispatchHook(context = ReactReduxContext) {\n const useStore2 = context === ReactReduxContext ? useStore : createStoreHook(context);\n const useDispatch2 = () => {\n const store = useStore2();\n return store.dispatch;\n };\n Object.assign(useDispatch2, {\n withTypes: () => useDispatch2\n });\n return useDispatch2;\n}\nvar useDispatch = /* @__PURE__ */ createDispatchHook();\n\n// src/hooks/useSelector.ts\nimport { useSyncExternalStoreWithSelector } from \"use-sync-external-store/with-selector.js\";\nvar refEquality = (a, b) => a === b;\nfunction createSelectorHook(context = ReactReduxContext) {\n const useReduxContext2 = context === ReactReduxContext ? useReduxContext : createReduxContextHook(context);\n const useSelector2 = (selector, equalityFnOrOptions = {}) => {\n const { equalityFn = refEquality } = typeof equalityFnOrOptions === \"function\" ? { equalityFn: equalityFnOrOptions } : equalityFnOrOptions;\n if (process.env.NODE_ENV !== \"production\") {\n if (!selector) {\n throw new Error(`You must pass a selector to useSelector`);\n }\n if (typeof selector !== \"function\") {\n throw new Error(`You must pass a function as a selector to useSelector`);\n }\n if (typeof equalityFn !== \"function\") {\n throw new Error(\n `You must pass a function as an equality function to useSelector`\n );\n }\n }\n const reduxContext = useReduxContext2();\n const { store, subscription, getServerState } = reduxContext;\n const firstRun = React.useRef(true);\n const wrappedSelector = React.useCallback(\n {\n [selector.name](state) {\n const selected = selector(state);\n if (process.env.NODE_ENV !== \"production\") {\n const { devModeChecks = {} } = typeof equalityFnOrOptions === \"function\" ? {} : equalityFnOrOptions;\n const { identityFunctionCheck, stabilityCheck } = reduxContext;\n const {\n identityFunctionCheck: finalIdentityFunctionCheck,\n stabilityCheck: finalStabilityCheck\n } = {\n stabilityCheck,\n identityFunctionCheck,\n ...devModeChecks\n };\n if (finalStabilityCheck === \"always\" || finalStabilityCheck === \"once\" && firstRun.current) {\n const toCompare = selector(state);\n if (!equalityFn(selected, toCompare)) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"Selector \" + (selector.name || \"unknown\") + \" returned a different result when called with the same parameters. This can lead to unnecessary rerenders.\\nSelectors that return a new reference (such as an object or an array) should be memoized: https://redux.js.org/usage/deriving-data-selectors#optimizing-selectors-with-memoization\",\n {\n state,\n selected,\n selected2: toCompare,\n stack\n }\n );\n }\n }\n if (finalIdentityFunctionCheck === \"always\" || finalIdentityFunctionCheck === \"once\" && firstRun.current) {\n if (selected === state) {\n let stack = void 0;\n try {\n throw new Error();\n } catch (e) {\n ;\n ({ stack } = e);\n }\n console.warn(\n \"Selector \" + (selector.name || \"unknown\") + \" returned the root state when called. This can lead to unnecessary rerenders.\\nSelectors that return the entire state are almost certainly a mistake, as they will cause a rerender whenever *anything* in state changes.\",\n { stack }\n );\n }\n }\n if (firstRun.current) firstRun.current = false;\n }\n return selected;\n }\n }[selector.name],\n [selector]\n );\n const selectedState = useSyncExternalStoreWithSelector(\n subscription.addNestedSub,\n store.getState,\n getServerState || store.getState,\n wrappedSelector,\n equalityFn\n );\n React.useDebugValue(selectedState);\n return selectedState;\n };\n Object.assign(useSelector2, {\n withTypes: () => useSelector2\n });\n return useSelector2;\n}\nvar useSelector = /* @__PURE__ */ createSelectorHook();\n\n// src/exports.ts\nvar batch = defaultNoopBatch;\nexport {\n Provider_default as Provider,\n ReactReduxContext,\n batch,\n connect_default as connect,\n createDispatchHook,\n createSelectorHook,\n createStoreHook,\n shallowEqual,\n useDispatch,\n useSelector,\n useStore\n};\n//# sourceMappingURL=react-redux.mjs.map","var isProduction = process.env.NODE_ENV === 'production';\nvar prefix = 'Invariant failed';\nfunction invariant(condition, message) {\n if (condition) {\n return;\n }\n if (isProduction) {\n throw new Error(prefix);\n }\n var provided = typeof message === 'function' ? message() : message;\n var value = provided ? \"\".concat(prefix, \": \").concat(provided) : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n","import invariant from 'tiny-invariant';\n\nvar getRect = function getRect(_ref) {\n var top = _ref.top,\n right = _ref.right,\n bottom = _ref.bottom,\n left = _ref.left;\n var width = right - left;\n var height = bottom - top;\n var rect = {\n top: top,\n right: right,\n bottom: bottom,\n left: left,\n width: width,\n height: height,\n x: left,\n y: top,\n center: {\n x: (right + left) / 2,\n y: (bottom + top) / 2\n }\n };\n return rect;\n};\nvar expand = function expand(target, expandBy) {\n return {\n top: target.top - expandBy.top,\n left: target.left - expandBy.left,\n bottom: target.bottom + expandBy.bottom,\n right: target.right + expandBy.right\n };\n};\nvar shrink = function shrink(target, shrinkBy) {\n return {\n top: target.top + shrinkBy.top,\n left: target.left + shrinkBy.left,\n bottom: target.bottom - shrinkBy.bottom,\n right: target.right - shrinkBy.right\n };\n};\n\nvar shift = function shift(target, shiftBy) {\n return {\n top: target.top + shiftBy.y,\n left: target.left + shiftBy.x,\n bottom: target.bottom + shiftBy.y,\n right: target.right + shiftBy.x\n };\n};\n\nvar noSpacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n};\nvar createBox = function createBox(_ref2) {\n var borderBox = _ref2.borderBox,\n _ref2$margin = _ref2.margin,\n margin = _ref2$margin === void 0 ? noSpacing : _ref2$margin,\n _ref2$border = _ref2.border,\n border = _ref2$border === void 0 ? noSpacing : _ref2$border,\n _ref2$padding = _ref2.padding,\n padding = _ref2$padding === void 0 ? noSpacing : _ref2$padding;\n var marginBox = getRect(expand(borderBox, margin));\n var paddingBox = getRect(shrink(borderBox, border));\n var contentBox = getRect(shrink(paddingBox, padding));\n return {\n marginBox: marginBox,\n borderBox: getRect(borderBox),\n paddingBox: paddingBox,\n contentBox: contentBox,\n margin: margin,\n border: border,\n padding: padding\n };\n};\n\nvar parse = function parse(raw) {\n var value = raw.slice(0, -2);\n var suffix = raw.slice(-2);\n\n if (suffix !== 'px') {\n return 0;\n }\n\n var result = Number(value);\n !!isNaN(result) ? process.env.NODE_ENV !== \"production\" ? invariant(false, \"Could not parse value [raw: \" + raw + \", without suffix: \" + value + \"]\") : invariant(false) : void 0;\n return result;\n};\n\nvar getWindowScroll = function getWindowScroll() {\n return {\n x: window.pageXOffset,\n y: window.pageYOffset\n };\n};\n\nvar offset = function offset(original, change) {\n var borderBox = original.borderBox,\n border = original.border,\n margin = original.margin,\n padding = original.padding;\n var shifted = shift(borderBox, change);\n return createBox({\n borderBox: shifted,\n border: border,\n margin: margin,\n padding: padding\n });\n};\nvar withScroll = function withScroll(original, scroll) {\n if (scroll === void 0) {\n scroll = getWindowScroll();\n }\n\n return offset(original, scroll);\n};\nvar calculateBox = function calculateBox(borderBox, styles) {\n var margin = {\n top: parse(styles.marginTop),\n right: parse(styles.marginRight),\n bottom: parse(styles.marginBottom),\n left: parse(styles.marginLeft)\n };\n var padding = {\n top: parse(styles.paddingTop),\n right: parse(styles.paddingRight),\n bottom: parse(styles.paddingBottom),\n left: parse(styles.paddingLeft)\n };\n var border = {\n top: parse(styles.borderTopWidth),\n right: parse(styles.borderRightWidth),\n bottom: parse(styles.borderBottomWidth),\n left: parse(styles.borderLeftWidth)\n };\n return createBox({\n borderBox: borderBox,\n margin: margin,\n padding: padding,\n border: border\n });\n};\nvar getBox = function getBox(el) {\n var borderBox = el.getBoundingClientRect();\n var styles = window.getComputedStyle(el);\n return calculateBox(borderBox, styles);\n};\n\nexport { calculateBox, createBox, expand, getBox, getRect, offset, shrink, withScroll };\n","var rafSchd = function rafSchd(fn) {\n var lastArgs = [];\n var frameId = null;\n\n var wrapperFn = function wrapperFn() {\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n lastArgs = args;\n\n if (frameId) {\n return;\n }\n\n frameId = requestAnimationFrame(function () {\n frameId = null;\n fn.apply(void 0, lastArgs);\n });\n };\n\n wrapperFn.cancel = function () {\n if (!frameId) {\n return;\n }\n\n cancelAnimationFrame(frameId);\n frameId = null;\n };\n\n return wrapperFn;\n};\n\nexport default rafSchd;\n","function _extends() {\n return _extends = Object.assign ? Object.assign.bind() : function (n) {\n for (var e = 1; e < arguments.length; e++) {\n var t = arguments[e];\n for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);\n }\n return n;\n }, _extends.apply(null, arguments);\n}\nexport { _extends as default };","import React, { useState, useRef, useEffect, useLayoutEffect, useContext } from 'react';\nimport ReactDOM, { flushSync } from 'react-dom';\nimport { createStore as createStore$1, compose, applyMiddleware, bindActionCreators } from 'redux';\nimport { Provider, connect } from 'react-redux';\nimport { getRect, expand, offset, withScroll, calculateBox, getBox, createBox } from 'css-box-model';\nimport rafSchd from 'raf-schd';\nimport _extends from '@babel/runtime/helpers/esm/extends';\n\nconst isProduction$1 = process.env.NODE_ENV === 'production';\nconst spacesAndTabs = /[ \\t]{2,}/g;\nconst lineStartWithSpaces = /^[ \\t]*/gm;\nconst clean$2 = value => value.replace(spacesAndTabs, ' ').replace(lineStartWithSpaces, '').trim();\nconst getDevMessage = message => clean$2(`\n %c@hello-pangea/dnd\n\n %c${clean$2(message)}\n\n %c👷‍ This is a development only message. It will be removed in production builds.\n`);\nconst getFormattedMessage = message => [getDevMessage(message), 'color: #00C584; font-size: 1.2em; font-weight: bold;', 'line-height: 1.5', 'color: #723874;'];\nconst isDisabledFlag = '__@hello-pangea/dnd-disable-dev-warnings';\nfunction log(type, message) {\n if (isProduction$1) {\n return;\n }\n if (typeof window !== 'undefined' && window[isDisabledFlag]) {\n return;\n }\n console[type](...getFormattedMessage(message));\n}\nconst warning = log.bind(null, 'warn');\nconst error = log.bind(null, 'error');\n\nfunction noop$2() {}\n\nfunction getOptions(shared, fromBinding) {\n return {\n ...shared,\n ...fromBinding\n };\n}\nfunction bindEvents(el, bindings, sharedOptions) {\n const unbindings = bindings.map(binding => {\n const options = getOptions(sharedOptions, binding.options);\n el.addEventListener(binding.eventName, binding.fn, options);\n return function unbind() {\n el.removeEventListener(binding.eventName, binding.fn, options);\n };\n });\n return function unbindAll() {\n unbindings.forEach(unbind => {\n unbind();\n });\n };\n}\n\nconst isProduction = process.env.NODE_ENV === 'production';\nconst prefix$1 = 'Invariant failed';\nclass RbdInvariant extends Error {}\nRbdInvariant.prototype.toString = function toString() {\n return this.message;\n};\nfunction invariant(condition, message) {\n if (isProduction) {\n throw new RbdInvariant(prefix$1);\n } else {\n throw new RbdInvariant(`${prefix$1}: ${message || ''}`);\n }\n}\n\nclass ErrorBoundary extends React.Component {\n constructor(...args) {\n super(...args);\n this.callbacks = null;\n this.unbind = noop$2;\n this.onWindowError = event => {\n const callbacks = this.getCallbacks();\n if (callbacks.isDragging()) {\n callbacks.tryAbort();\n process.env.NODE_ENV !== \"production\" ? warning(`\n An error was caught by our window 'error' event listener while a drag was occurring.\n The active drag has been aborted.\n `) : void 0;\n }\n const err = event.error;\n if (err instanceof RbdInvariant) {\n event.preventDefault();\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n }\n };\n this.getCallbacks = () => {\n if (!this.callbacks) {\n throw new Error('Unable to find AppCallbacks in <ErrorBoundary/>');\n }\n return this.callbacks;\n };\n this.setCallbacks = callbacks => {\n this.callbacks = callbacks;\n };\n }\n componentDidMount() {\n this.unbind = bindEvents(window, [{\n eventName: 'error',\n fn: this.onWindowError\n }]);\n }\n componentDidCatch(err) {\n if (err instanceof RbdInvariant) {\n if (process.env.NODE_ENV !== 'production') {\n error(err.message);\n }\n this.setState({});\n return;\n }\n throw err;\n }\n componentWillUnmount() {\n this.unbind();\n }\n render() {\n return this.props.children(this.setCallbacks);\n }\n}\n\nconst dragHandleUsageInstructions = `\n Press space bar to start a drag.\n When dragging you can use the arrow keys to move the item around and escape to cancel.\n Some screen readers may require you to be in focus mode or to use your pass through key\n`;\nconst position = index => index + 1;\nconst onDragStart = start => `\n You have lifted an item in position ${position(start.source.index)}\n`;\nconst withLocation = (source, destination) => {\n const isInHomeList = source.droppableId === destination.droppableId;\n const startPosition = position(source.index);\n const endPosition = position(destination.index);\n if (isInHomeList) {\n return `\n You have moved the item from position ${startPosition}\n to position ${endPosition}\n `;\n }\n return `\n You have moved the item from position ${startPosition}\n in list ${source.droppableId}\n to list ${destination.droppableId}\n in position ${endPosition}\n `;\n};\nconst withCombine = (id, source, combine) => {\n const inHomeList = source.droppableId === combine.droppableId;\n if (inHomeList) {\n return `\n The item ${id}\n has been combined with ${combine.draggableId}`;\n }\n return `\n The item ${id}\n in list ${source.droppableId}\n has been combined with ${combine.draggableId}\n in list ${combine.droppableId}\n `;\n};\nconst onDragUpdate = update => {\n const location = update.destination;\n if (location) {\n return withLocation(update.source, location);\n }\n const combine = update.combine;\n if (combine) {\n return withCombine(update.draggableId, update.source, combine);\n }\n return 'You are over an area that cannot be dropped on';\n};\nconst returnedToStart = source => `\n The item has returned to its starting position\n of ${position(source.index)}\n`;\nconst onDragEnd = result => {\n if (result.reason === 'CANCEL') {\n return `\n Movement cancelled.\n ${returnedToStart(result.source)}\n `;\n }\n const location = result.destination;\n const combine = result.combine;\n if (location) {\n return `\n You have dropped the item.\n ${withLocation(result.source, location)}\n `;\n }\n if (combine) {\n return `\n You have dropped the item.\n ${withCombine(result.draggableId, result.source, combine)}\n `;\n }\n return `\n The item has been dropped while not over a drop area.\n ${returnedToStart(result.source)}\n `;\n};\nconst preset = {\n dragHandleUsageInstructions,\n onDragStart,\n onDragUpdate,\n onDragEnd\n};\n\nfunction isEqual$2(first, second) {\n if (first === second) {\n return true;\n }\n if (Number.isNaN(first) && Number.isNaN(second)) {\n return true;\n }\n return false;\n}\nfunction areInputsEqual(newInputs, lastInputs) {\n if (newInputs.length !== lastInputs.length) {\n return false;\n }\n for (let i = 0; i < newInputs.length; i++) {\n if (!isEqual$2(newInputs[i], lastInputs[i])) {\n return false;\n }\n }\n return true;\n}\n\nfunction useMemo(getResult, inputs) {\n const initial = useState(() => ({\n inputs,\n result: getResult()\n }))[0];\n const isFirstRun = useRef(true);\n const committed = useRef(initial);\n const useCache = isFirstRun.current || Boolean(inputs && committed.current.inputs && areInputsEqual(inputs, committed.current.inputs));\n const cache = useCache ? committed.current : {\n inputs,\n result: getResult()\n };\n useEffect(() => {\n isFirstRun.current = false;\n committed.current = cache;\n }, [cache]);\n return cache.result;\n}\nfunction useCallback(callback, inputs) {\n return useMemo(() => callback, inputs);\n}\n\nconst origin = {\n x: 0,\n y: 0\n};\nconst add = (point1, point2) => ({\n x: point1.x + point2.x,\n y: point1.y + point2.y\n});\nconst subtract = (point1, point2) => ({\n x: point1.x - point2.x,\n y: point1.y - point2.y\n});\nconst isEqual$1 = (point1, point2) => point1.x === point2.x && point1.y === point2.y;\nconst negate = point => ({\n x: point.x !== 0 ? -point.x : 0,\n y: point.y !== 0 ? -point.y : 0\n});\nconst patch = (line, value, otherValue = 0) => {\n if (line === 'x') {\n return {\n x: value,\n y: otherValue\n };\n }\n return {\n x: otherValue,\n y: value\n };\n};\nconst distance = (point1, point2) => Math.sqrt((point2.x - point1.x) ** 2 + (point2.y - point1.y) ** 2);\nconst closest$1 = (target, points) => Math.min(...points.map(point => distance(target, point)));\nconst apply = fn => point => ({\n x: fn(point.x),\n y: fn(point.y)\n});\n\nvar executeClip = (frame, subject) => {\n const result = getRect({\n top: Math.max(subject.top, frame.top),\n right: Math.min(subject.right, frame.right),\n bottom: Math.min(subject.bottom, frame.bottom),\n left: Math.max(subject.left, frame.left)\n });\n if (result.width <= 0 || result.height <= 0) {\n return null;\n }\n return result;\n};\n\nconst offsetByPosition = (spacing, point) => ({\n top: spacing.top + point.y,\n left: spacing.left + point.x,\n bottom: spacing.bottom + point.y,\n right: spacing.right + point.x\n});\nconst getCorners = spacing => [{\n x: spacing.left,\n y: spacing.top\n}, {\n x: spacing.right,\n y: spacing.top\n}, {\n x: spacing.left,\n y: spacing.bottom\n}, {\n x: spacing.right,\n y: spacing.bottom\n}];\nconst noSpacing = {\n top: 0,\n right: 0,\n bottom: 0,\n left: 0\n};\n\nconst scroll$1 = (target, frame) => {\n if (!frame) {\n return target;\n }\n return offsetByPosition(target, frame.scroll.diff.displacement);\n};\nconst increase = (target, axis, withPlaceholder) => {\n if (withPlaceholder && withPlaceholder.increasedBy) {\n return {\n ...target,\n [axis.end]: target[axis.end] + withPlaceholder.increasedBy[axis.line]\n };\n }\n return target;\n};\nconst clip = (target, frame) => {\n if (frame && frame.shouldClipSubject) {\n return executeClip(frame.pageMarginBox, target);\n }\n return getRect(target);\n};\nvar getSubject = ({\n page,\n withPlaceholder,\n axis,\n frame\n}) => {\n const scrolled = scroll$1(page.marginBox, frame);\n const increased = increase(scrolled, axis, withPlaceholder);\n const clipped = clip(increased, frame);\n return {\n page,\n withPlaceholder,\n active: clipped\n };\n};\n\nvar scrollDroppable = (droppable, newScroll) => {\n !droppable.frame ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const scrollable = droppable.frame;\n const scrollDiff = subtract(newScroll, scrollable.scroll.initial);\n const scrollDisplacement = negate(scrollDiff);\n const frame = {\n ...scrollable,\n scroll: {\n initial: scrollable.scroll.initial,\n current: newScroll,\n diff: {\n value: scrollDiff,\n displacement: scrollDisplacement\n },\n max: scrollable.scroll.max\n }\n };\n const subject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: droppable.subject.withPlaceholder,\n axis: droppable.axis,\n frame\n });\n const result = {\n ...droppable,\n frame,\n subject\n };\n return result;\n};\n\nfunction memoizeOne(resultFn, isEqual = areInputsEqual) {\n let cache = null;\n function memoized(...newArgs) {\n if (cache && cache.lastThis === this && isEqual(newArgs, cache.lastArgs)) {\n return cache.lastResult;\n }\n const lastResult = resultFn.apply(this, newArgs);\n cache = {\n lastResult,\n lastArgs: newArgs,\n lastThis: this\n };\n return lastResult;\n }\n memoized.clear = function clear() {\n cache = null;\n };\n return memoized;\n}\n\nconst toDroppableMap = memoizeOne(droppables => droppables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n}, {}));\nconst toDraggableMap = memoizeOne(draggables => draggables.reduce((previous, current) => {\n previous[current.descriptor.id] = current;\n return previous;\n}, {}));\nconst toDroppableList = memoizeOne(droppables => Object.values(droppables));\nconst toDraggableList = memoizeOne(draggables => Object.values(draggables));\n\nvar getDraggablesInsideDroppable = memoizeOne((droppableId, draggables) => {\n const result = toDraggableList(draggables).filter(draggable => droppableId === draggable.descriptor.droppableId).sort((a, b) => a.descriptor.index - b.descriptor.index);\n return result;\n});\n\nfunction tryGetDestination(impact) {\n if (impact.at && impact.at.type === 'REORDER') {\n return impact.at.destination;\n }\n return null;\n}\nfunction tryGetCombine(impact) {\n if (impact.at && impact.at.type === 'COMBINE') {\n return impact.at.combine;\n }\n return null;\n}\n\nvar removeDraggableFromList = memoizeOne((remove, list) => list.filter(item => item.descriptor.id !== remove.descriptor.id));\n\nvar moveToNextCombine = ({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact\n}) => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const location = tryGetDestination(previousImpact);\n if (!location) {\n return null;\n }\n function getImpact(target) {\n const at = {\n type: 'COMBINE',\n combine: {\n draggableId: target,\n droppableId: destination.descriptor.id\n }\n };\n return {\n ...previousImpact,\n at\n };\n }\n const all = previousImpact.displaced.all;\n const closestId = all.length ? all[0] : null;\n if (isMovingForward) {\n return closestId ? getImpact(closestId) : null;\n }\n const withoutDraggable = removeDraggableFromList(draggable, insideDestination);\n if (!closestId) {\n if (!withoutDraggable.length) {\n return null;\n }\n const last = withoutDraggable[withoutDraggable.length - 1];\n return getImpact(last.descriptor.id);\n }\n const indexOfClosest = withoutDraggable.findIndex(d => d.descriptor.id === closestId);\n !(indexOfClosest !== -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find displaced item in set') : invariant() : void 0;\n const proposedIndex = indexOfClosest - 1;\n if (proposedIndex < 0) {\n return null;\n }\n const before = withoutDraggable[proposedIndex];\n return getImpact(before.descriptor.id);\n};\n\nvar isHomeOf = (draggable, destination) => draggable.descriptor.droppableId === destination.descriptor.id;\n\nconst noDisplacedBy = {\n point: origin,\n value: 0\n};\nconst emptyGroups = {\n invisible: {},\n visible: {},\n all: []\n};\nconst noImpact = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: null\n};\n\nvar isWithin = (lowerBound, upperBound) => value => lowerBound <= value && value <= upperBound;\n\nvar isPartiallyVisibleThroughFrame = frame => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return subject => {\n const isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);\n if (isContained) {\n return true;\n }\n const isPartiallyVisibleVertically = isWithinVertical(subject.top) || isWithinVertical(subject.bottom);\n const isPartiallyVisibleHorizontally = isWithinHorizontal(subject.left) || isWithinHorizontal(subject.right);\n const isPartiallyContained = isPartiallyVisibleVertically && isPartiallyVisibleHorizontally;\n if (isPartiallyContained) {\n return true;\n }\n const isBiggerVertically = subject.top < frame.top && subject.bottom > frame.bottom;\n const isBiggerHorizontally = subject.left < frame.left && subject.right > frame.right;\n const isTargetBiggerThanFrame = isBiggerVertically && isBiggerHorizontally;\n if (isTargetBiggerThanFrame) {\n return true;\n }\n const isTargetBiggerOnOneAxis = isBiggerVertically && isPartiallyVisibleHorizontally || isBiggerHorizontally && isPartiallyVisibleVertically;\n return isTargetBiggerOnOneAxis;\n };\n};\n\nvar isTotallyVisibleThroughFrame = frame => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return subject => {\n const isContained = isWithinVertical(subject.top) && isWithinVertical(subject.bottom) && isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);\n return isContained;\n };\n};\n\nconst vertical = {\n direction: 'vertical',\n line: 'y',\n crossAxisLine: 'x',\n start: 'top',\n end: 'bottom',\n size: 'height',\n crossAxisStart: 'left',\n crossAxisEnd: 'right',\n crossAxisSize: 'width'\n};\nconst horizontal = {\n direction: 'horizontal',\n line: 'x',\n crossAxisLine: 'y',\n start: 'left',\n end: 'right',\n size: 'width',\n crossAxisStart: 'top',\n crossAxisEnd: 'bottom',\n crossAxisSize: 'height'\n};\n\nvar isTotallyVisibleThroughFrameOnAxis = axis => frame => {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return subject => {\n if (axis === vertical) {\n return isWithinVertical(subject.top) && isWithinVertical(subject.bottom);\n }\n return isWithinHorizontal(subject.left) && isWithinHorizontal(subject.right);\n };\n};\n\nconst getDroppableDisplaced = (target, destination) => {\n const displacement = destination.frame ? destination.frame.scroll.diff.displacement : origin;\n return offsetByPosition(target, displacement);\n};\nconst isVisibleInDroppable = (target, destination, isVisibleThroughFrameFn) => {\n if (!destination.subject.active) {\n return false;\n }\n return isVisibleThroughFrameFn(destination.subject.active)(target);\n};\nconst isVisibleInViewport = (target, viewport, isVisibleThroughFrameFn) => isVisibleThroughFrameFn(viewport)(target);\nconst isVisible$1 = ({\n target: toBeDisplaced,\n destination,\n viewport,\n withDroppableDisplacement,\n isVisibleThroughFrameFn\n}) => {\n const displacedTarget = withDroppableDisplacement ? getDroppableDisplaced(toBeDisplaced, destination) : toBeDisplaced;\n return isVisibleInDroppable(displacedTarget, destination, isVisibleThroughFrameFn) && isVisibleInViewport(displacedTarget, viewport, isVisibleThroughFrameFn);\n};\nconst isPartiallyVisible = args => isVisible$1({\n ...args,\n isVisibleThroughFrameFn: isPartiallyVisibleThroughFrame\n});\nconst isTotallyVisible = args => isVisible$1({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrame\n});\nconst isTotallyVisibleOnAxis = args => isVisible$1({\n ...args,\n isVisibleThroughFrameFn: isTotallyVisibleThroughFrameOnAxis(args.destination.axis)\n});\n\nconst getShouldAnimate = (id, last, forceShouldAnimate) => {\n if (typeof forceShouldAnimate === 'boolean') {\n return forceShouldAnimate;\n }\n if (!last) {\n return true;\n }\n const {\n invisible,\n visible\n } = last;\n if (invisible[id]) {\n return false;\n }\n const previous = visible[id];\n return previous ? previous.shouldAnimate : true;\n};\nfunction getTarget(draggable, displacedBy) {\n const marginBox = draggable.page.marginBox;\n const expandBy = {\n top: displacedBy.point.y,\n right: 0,\n bottom: 0,\n left: displacedBy.point.x\n };\n return getRect(expand(marginBox, expandBy));\n}\nfunction getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy,\n viewport,\n forceShouldAnimate,\n last\n}) {\n return afterDragging.reduce(function process(groups, draggable) {\n const target = getTarget(draggable, displacedBy);\n const id = draggable.descriptor.id;\n groups.all.push(id);\n const isVisible = isPartiallyVisible({\n target,\n destination,\n viewport,\n withDroppableDisplacement: true\n });\n if (!isVisible) {\n groups.invisible[draggable.descriptor.id] = true;\n return groups;\n }\n const shouldAnimate = getShouldAnimate(id, last, forceShouldAnimate);\n const displacement = {\n draggableId: id,\n shouldAnimate\n };\n groups.visible[id] = displacement;\n return groups;\n }, {\n all: [],\n visible: {},\n invisible: {}\n });\n}\n\nfunction getIndexOfLastItem(draggables, options) {\n if (!draggables.length) {\n return 0;\n }\n const indexOfLastItem = draggables[draggables.length - 1].descriptor.index;\n return options.inHomeList ? indexOfLastItem : indexOfLastItem + 1;\n}\nfunction goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination\n}) {\n const newIndex = getIndexOfLastItem(insideDestination, {\n inHomeList\n });\n return {\n displaced: emptyGroups,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: newIndex\n }\n }\n };\n}\nfunction calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n last,\n index,\n forceShouldAnimate\n}) {\n const inHomeList = isHomeOf(draggable, destination);\n if (index == null) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination\n });\n }\n const match = insideDestination.find(item => item.descriptor.index === index);\n if (!match) {\n return goAtEnd({\n insideDestination,\n inHomeList,\n displacedBy,\n destination\n });\n }\n const withoutDragging = removeDraggableFromList(draggable, insideDestination);\n const sliceFrom = insideDestination.indexOf(match);\n const impacted = withoutDragging.slice(sliceFrom);\n const displaced = getDisplacementGroups({\n afterDragging: impacted,\n destination,\n displacedBy,\n last,\n viewport: viewport.frame,\n forceShouldAnimate\n });\n return {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index\n }\n }\n };\n}\n\nfunction didStartAfterCritical(draggableId, afterCritical) {\n return Boolean(afterCritical.effected[draggableId]);\n}\n\nvar fromCombine = ({\n isMovingForward,\n destination,\n draggables,\n combine,\n afterCritical\n}) => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const combineId = combine.draggableId;\n const combineWith = draggables[combineId];\n const combineWithIndex = combineWith.descriptor.index;\n const didCombineWithStartAfterCritical = didStartAfterCritical(combineId, afterCritical);\n if (didCombineWithStartAfterCritical) {\n if (isMovingForward) {\n return combineWithIndex;\n }\n return combineWithIndex - 1;\n }\n if (isMovingForward) {\n return combineWithIndex + 1;\n }\n return combineWithIndex;\n};\n\nvar fromReorder = ({\n isMovingForward,\n isInHomeList,\n insideDestination,\n location\n}) => {\n if (!insideDestination.length) {\n return null;\n }\n const currentIndex = location.index;\n const proposedIndex = isMovingForward ? currentIndex + 1 : currentIndex - 1;\n const firstIndex = insideDestination[0].descriptor.index;\n const lastIndex = insideDestination[insideDestination.length - 1].descriptor.index;\n const upperBound = isInHomeList ? lastIndex : lastIndex + 1;\n if (proposedIndex < firstIndex) {\n return null;\n }\n if (proposedIndex > upperBound) {\n return null;\n }\n return proposedIndex;\n};\n\nvar moveToNextIndex = ({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical\n}) => {\n const wasAt = previousImpact.at;\n !wasAt ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot move in direction without previous impact location') : invariant() : void 0;\n if (wasAt.type === 'REORDER') {\n const newIndex = fromReorder({\n isMovingForward,\n isInHomeList,\n location: wasAt.destination,\n insideDestination\n });\n if (newIndex == null) {\n return null;\n }\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex\n });\n }\n const newIndex = fromCombine({\n isMovingForward,\n destination,\n displaced: previousImpact.displaced,\n draggables,\n combine: wasAt.combine,\n afterCritical\n });\n if (newIndex == null) {\n return null;\n }\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last: previousImpact.displaced,\n displacedBy: previousImpact.displacedBy,\n index: newIndex\n });\n};\n\nvar getCombinedItemDisplacement = ({\n displaced,\n afterCritical,\n combineWith,\n displacedBy\n}) => {\n const isDisplaced = Boolean(displaced.visible[combineWith] || displaced.invisible[combineWith]);\n if (didStartAfterCritical(combineWith, afterCritical)) {\n return isDisplaced ? origin : negate(displacedBy.point);\n }\n return isDisplaced ? displacedBy.point : origin;\n};\n\nvar whenCombining = ({\n afterCritical,\n impact,\n draggables\n}) => {\n const combine = tryGetCombine(impact);\n !combine ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const combineWith = combine.draggableId;\n const center = draggables[combineWith].page.borderBox.center;\n const displaceBy = getCombinedItemDisplacement({\n displaced: impact.displaced,\n afterCritical,\n combineWith,\n displacedBy: impact.displacedBy\n });\n return add(center, displaceBy);\n};\n\nconst distanceFromStartToBorderBoxCenter = (axis, box) => box.margin[axis.start] + box.borderBox[axis.size] / 2;\nconst distanceFromEndToBorderBoxCenter = (axis, box) => box.margin[axis.end] + box.borderBox[axis.size] / 2;\nconst getCrossAxisBorderBoxCenter = (axis, target, isMoving) => target[axis.crossAxisStart] + isMoving.margin[axis.crossAxisStart] + isMoving.borderBox[axis.crossAxisSize] / 2;\nconst goAfter = ({\n axis,\n moveRelativeTo,\n isMoving\n}) => patch(axis.line, moveRelativeTo.marginBox[axis.end] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));\nconst goBefore = ({\n axis,\n moveRelativeTo,\n isMoving\n}) => patch(axis.line, moveRelativeTo.marginBox[axis.start] - distanceFromEndToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveRelativeTo.marginBox, isMoving));\nconst goIntoStart = ({\n axis,\n moveInto,\n isMoving\n}) => patch(axis.line, moveInto.contentBox[axis.start] + distanceFromStartToBorderBoxCenter(axis, isMoving), getCrossAxisBorderBoxCenter(axis, moveInto.contentBox, isMoving));\n\nvar whenReordering = ({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical\n}) => {\n const insideDestination = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);\n const draggablePage = draggable.page;\n const axis = droppable.axis;\n if (!insideDestination.length) {\n return goIntoStart({\n axis,\n moveInto: droppable.page,\n isMoving: draggablePage\n });\n }\n const {\n displaced,\n displacedBy\n } = impact;\n const closestAfter = displaced.all[0];\n if (closestAfter) {\n const closest = draggables[closestAfter];\n if (didStartAfterCritical(closestAfter, afterCritical)) {\n return goBefore({\n axis,\n moveRelativeTo: closest.page,\n isMoving: draggablePage\n });\n }\n const withDisplacement = offset(closest.page, displacedBy.point);\n return goBefore({\n axis,\n moveRelativeTo: withDisplacement,\n isMoving: draggablePage\n });\n }\n const last = insideDestination[insideDestination.length - 1];\n if (last.descriptor.id === draggable.descriptor.id) {\n return draggablePage.borderBox.center;\n }\n if (didStartAfterCritical(last.descriptor.id, afterCritical)) {\n const page = offset(last.page, negate(afterCritical.displacedBy.point));\n return goAfter({\n axis,\n moveRelativeTo: page,\n isMoving: draggablePage\n });\n }\n return goAfter({\n axis,\n moveRelativeTo: last.page,\n isMoving: draggablePage\n });\n};\n\nvar withDroppableDisplacement = (droppable, point) => {\n const frame = droppable.frame;\n if (!frame) {\n return point;\n }\n return add(point, frame.scroll.diff.displacement);\n};\n\nconst getResultWithoutDroppableDisplacement = ({\n impact,\n draggable,\n droppable,\n draggables,\n afterCritical\n}) => {\n const original = draggable.page.borderBox.center;\n const at = impact.at;\n if (!droppable) {\n return original;\n }\n if (!at) {\n return original;\n }\n if (at.type === 'REORDER') {\n return whenReordering({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical\n });\n }\n return whenCombining({\n impact,\n draggables,\n afterCritical\n });\n};\nvar getPageBorderBoxCenterFromImpact = args => {\n const withoutDisplacement = getResultWithoutDroppableDisplacement(args);\n const droppable = args.droppable;\n const withDisplacement = droppable ? withDroppableDisplacement(droppable, withoutDisplacement) : withoutDisplacement;\n return withDisplacement;\n};\n\nvar scrollViewport = (viewport, newScroll) => {\n const diff = subtract(newScroll, viewport.scroll.initial);\n const displacement = negate(diff);\n const frame = getRect({\n top: newScroll.y,\n bottom: newScroll.y + viewport.frame.height,\n left: newScroll.x,\n right: newScroll.x + viewport.frame.width\n });\n const updated = {\n frame,\n scroll: {\n initial: viewport.scroll.initial,\n max: viewport.scroll.max,\n current: newScroll,\n diff: {\n value: diff,\n displacement\n }\n }\n };\n return updated;\n};\n\nfunction getDraggables$1(ids, draggables) {\n return ids.map(id => draggables[id]);\n}\nfunction tryGetVisible(id, groups) {\n for (let i = 0; i < groups.length; i++) {\n const displacement = groups[i].visible[id];\n if (displacement) {\n return displacement;\n }\n }\n return null;\n}\nvar speculativelyIncrease = ({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange\n}) => {\n const scrolledViewport = scrollViewport(viewport, add(viewport.scroll.current, maxScrollChange));\n const scrolledDroppable = destination.frame ? scrollDroppable(destination, add(destination.frame.scroll.current, maxScrollChange)) : destination;\n const last = impact.displaced;\n const withViewportScroll = getDisplacementGroups({\n afterDragging: getDraggables$1(last.all, draggables),\n destination,\n displacedBy: impact.displacedBy,\n viewport: scrolledViewport.frame,\n last,\n forceShouldAnimate: false\n });\n const withDroppableScroll = getDisplacementGroups({\n afterDragging: getDraggables$1(last.all, draggables),\n destination: scrolledDroppable,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n last,\n forceShouldAnimate: false\n });\n const invisible = {};\n const visible = {};\n const groups = [last, withViewportScroll, withDroppableScroll];\n last.all.forEach(id => {\n const displacement = tryGetVisible(id, groups);\n if (displacement) {\n visible[id] = displacement;\n return;\n }\n invisible[id] = true;\n });\n const newImpact = {\n ...impact,\n displaced: {\n all: last.all,\n invisible,\n visible\n }\n };\n return newImpact;\n};\n\nvar withViewportDisplacement = (viewport, point) => add(viewport.scroll.diff.displacement, point);\n\nvar getClientFromPageBorderBoxCenter = ({\n pageBorderBoxCenter,\n draggable,\n viewport\n}) => {\n const withoutPageScrollChange = withViewportDisplacement(viewport, pageBorderBoxCenter);\n const offset = subtract(withoutPageScrollChange, draggable.page.borderBox.center);\n return add(draggable.client.borderBox.center, offset);\n};\n\nvar isTotallyVisibleInNewLocation = ({\n draggable,\n destination,\n newPageBorderBoxCenter,\n viewport,\n withDroppableDisplacement,\n onlyOnMainAxis = false\n}) => {\n const changeNeeded = subtract(newPageBorderBoxCenter, draggable.page.borderBox.center);\n const shifted = offsetByPosition(draggable.page.borderBox, changeNeeded);\n const args = {\n target: shifted,\n destination,\n withDroppableDisplacement,\n viewport\n };\n return onlyOnMainAxis ? isTotallyVisibleOnAxis(args) : isTotallyVisible(args);\n};\n\nvar moveToNextPlace = ({\n isMovingForward,\n draggable,\n destination,\n draggables,\n previousImpact,\n viewport,\n previousPageBorderBoxCenter,\n previousClientSelection,\n afterCritical\n}) => {\n if (!destination.isEnabled) {\n return null;\n }\n const insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);\n const isInHomeList = isHomeOf(draggable, destination);\n const impact = moveToNextCombine({\n isMovingForward,\n draggable,\n destination,\n insideDestination,\n previousImpact\n }) || moveToNextIndex({\n isMovingForward,\n isInHomeList,\n draggable,\n draggables,\n destination,\n insideDestination,\n previousImpact,\n viewport,\n afterCritical\n });\n if (!impact) {\n return null;\n }\n const pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical\n });\n const isVisibleInNewLocation = isTotallyVisibleInNewLocation({\n draggable,\n destination,\n newPageBorderBoxCenter: pageBorderBoxCenter,\n viewport: viewport.frame,\n withDroppableDisplacement: false,\n onlyOnMainAxis: true\n });\n if (isVisibleInNewLocation) {\n const clientSelection = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport\n });\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null\n };\n }\n const distance = subtract(pageBorderBoxCenter, previousPageBorderBoxCenter);\n const cautious = speculativelyIncrease({\n impact,\n viewport,\n destination,\n draggables,\n maxScrollChange: distance\n });\n return {\n clientSelection: previousClientSelection,\n impact: cautious,\n scrollJumpRequest: distance\n };\n};\n\nconst getKnownActive = droppable => {\n const rect = droppable.subject.active;\n !rect ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot get clipped area from droppable') : invariant() : void 0;\n return rect;\n};\nvar getBestCrossAxisDroppable = ({\n isMovingForward,\n pageBorderBoxCenter,\n source,\n droppables,\n viewport\n}) => {\n const active = source.subject.active;\n if (!active) {\n return null;\n }\n const axis = source.axis;\n const isBetweenSourceClipped = isWithin(active[axis.start], active[axis.end]);\n const candidates = toDroppableList(droppables).filter(droppable => droppable !== source).filter(droppable => droppable.isEnabled).filter(droppable => Boolean(droppable.subject.active)).filter(droppable => isPartiallyVisibleThroughFrame(viewport.frame)(getKnownActive(droppable))).filter(droppable => {\n const activeOfTarget = getKnownActive(droppable);\n if (isMovingForward) {\n return active[axis.crossAxisEnd] < activeOfTarget[axis.crossAxisEnd];\n }\n return activeOfTarget[axis.crossAxisStart] < active[axis.crossAxisStart];\n }).filter(droppable => {\n const activeOfTarget = getKnownActive(droppable);\n const isBetweenDestinationClipped = isWithin(activeOfTarget[axis.start], activeOfTarget[axis.end]);\n return isBetweenSourceClipped(activeOfTarget[axis.start]) || isBetweenSourceClipped(activeOfTarget[axis.end]) || isBetweenDestinationClipped(active[axis.start]) || isBetweenDestinationClipped(active[axis.end]);\n }).sort((a, b) => {\n const first = getKnownActive(a)[axis.crossAxisStart];\n const second = getKnownActive(b)[axis.crossAxisStart];\n if (isMovingForward) {\n return first - second;\n }\n return second - first;\n }).filter((droppable, index, array) => getKnownActive(droppable)[axis.crossAxisStart] === getKnownActive(array[0])[axis.crossAxisStart]);\n if (!candidates.length) {\n return null;\n }\n if (candidates.length === 1) {\n return candidates[0];\n }\n const contains = candidates.filter(droppable => {\n const isWithinDroppable = isWithin(getKnownActive(droppable)[axis.start], getKnownActive(droppable)[axis.end]);\n return isWithinDroppable(pageBorderBoxCenter[axis.line]);\n });\n if (contains.length === 1) {\n return contains[0];\n }\n if (contains.length > 1) {\n return contains.sort((a, b) => getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start])[0];\n }\n return candidates.sort((a, b) => {\n const first = closest$1(pageBorderBoxCenter, getCorners(getKnownActive(a)));\n const second = closest$1(pageBorderBoxCenter, getCorners(getKnownActive(b)));\n if (first !== second) {\n return first - second;\n }\n return getKnownActive(a)[axis.start] - getKnownActive(b)[axis.start];\n })[0];\n};\n\nconst getCurrentPageBorderBoxCenter = (draggable, afterCritical) => {\n const original = draggable.page.borderBox.center;\n return didStartAfterCritical(draggable.descriptor.id, afterCritical) ? subtract(original, afterCritical.displacedBy.point) : original;\n};\nconst getCurrentPageBorderBox = (draggable, afterCritical) => {\n const original = draggable.page.borderBox;\n return didStartAfterCritical(draggable.descriptor.id, afterCritical) ? offsetByPosition(original, negate(afterCritical.displacedBy.point)) : original;\n};\n\nvar getClosestDraggable = ({\n pageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical\n}) => {\n const sorted = insideDestination.filter(draggable => isTotallyVisible({\n target: getCurrentPageBorderBox(draggable, afterCritical),\n destination,\n viewport: viewport.frame,\n withDroppableDisplacement: true\n })).sort((a, b) => {\n const distanceToA = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(a, afterCritical)));\n const distanceToB = distance(pageBorderBoxCenter, withDroppableDisplacement(destination, getCurrentPageBorderBoxCenter(b, afterCritical)));\n if (distanceToA < distanceToB) {\n return -1;\n }\n if (distanceToB < distanceToA) {\n return 1;\n }\n return a.descriptor.index - b.descriptor.index;\n });\n return sorted[0] || null;\n};\n\nvar getDisplacedBy = memoizeOne(function getDisplacedBy(axis, displaceBy) {\n const displacement = displaceBy[axis.line];\n return {\n value: displacement,\n point: patch(axis.line, displacement)\n };\n});\n\nconst getRequiredGrowthForPlaceholder = (droppable, placeholderSize, draggables) => {\n const axis = droppable.axis;\n if (droppable.descriptor.mode === 'virtual') {\n return patch(axis.line, placeholderSize[axis.line]);\n }\n const availableSpace = droppable.subject.page.contentBox[axis.size];\n const insideDroppable = getDraggablesInsideDroppable(droppable.descriptor.id, draggables);\n const spaceUsed = insideDroppable.reduce((sum, dimension) => sum + dimension.client.marginBox[axis.size], 0);\n const requiredSpace = spaceUsed + placeholderSize[axis.line];\n const needsToGrowBy = requiredSpace - availableSpace;\n if (needsToGrowBy <= 0) {\n return null;\n }\n return patch(axis.line, needsToGrowBy);\n};\nconst withMaxScroll = (frame, max) => ({\n ...frame,\n scroll: {\n ...frame.scroll,\n max\n }\n});\nconst addPlaceholder = (droppable, draggable, draggables) => {\n const frame = droppable.frame;\n !!isHomeOf(draggable, droppable) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Should not add placeholder space to home list') : invariant() : void 0;\n !!droppable.subject.withPlaceholder ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot add placeholder size to a subject when it already has one') : invariant() : void 0;\n const placeholderSize = getDisplacedBy(droppable.axis, draggable.displaceBy).point;\n const requiredGrowth = getRequiredGrowthForPlaceholder(droppable, placeholderSize, draggables);\n const added = {\n placeholderSize,\n increasedBy: requiredGrowth,\n oldFrameMaxScroll: droppable.frame ? droppable.frame.scroll.max : null\n };\n if (!frame) {\n const subject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: droppable.frame\n });\n return {\n ...droppable,\n subject\n };\n }\n const maxScroll = requiredGrowth ? add(frame.scroll.max, requiredGrowth) : frame.scroll.max;\n const newFrame = withMaxScroll(frame, maxScroll);\n const subject = getSubject({\n page: droppable.subject.page,\n withPlaceholder: added,\n axis: droppable.axis,\n frame: newFrame\n });\n return {\n ...droppable,\n subject,\n frame: newFrame\n };\n};\nconst removePlaceholder = droppable => {\n const added = droppable.subject.withPlaceholder;\n !added ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot remove placeholder form subject when there was none') : invariant() : void 0;\n const frame = droppable.frame;\n if (!frame) {\n const subject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: null,\n withPlaceholder: null\n });\n return {\n ...droppable,\n subject\n };\n }\n const oldMaxScroll = added.oldFrameMaxScroll;\n !oldMaxScroll ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected droppable with frame to have old max frame scroll when removing placeholder') : invariant() : void 0;\n const newFrame = withMaxScroll(frame, oldMaxScroll);\n const subject = getSubject({\n page: droppable.subject.page,\n axis: droppable.axis,\n frame: newFrame,\n withPlaceholder: null\n });\n return {\n ...droppable,\n subject,\n frame: newFrame\n };\n};\n\nvar moveToNewDroppable = ({\n previousPageBorderBoxCenter,\n moveRelativeTo,\n insideDestination,\n draggable,\n draggables,\n destination,\n viewport,\n afterCritical\n}) => {\n if (!moveRelativeTo) {\n if (insideDestination.length) {\n return null;\n }\n const proposed = {\n displaced: emptyGroups,\n displacedBy: noDisplacedBy,\n at: {\n type: 'REORDER',\n destination: {\n droppableId: destination.descriptor.id,\n index: 0\n }\n }\n };\n const proposedPageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact: proposed,\n draggable,\n droppable: destination,\n draggables,\n afterCritical\n });\n const withPlaceholder = isHomeOf(draggable, destination) ? destination : addPlaceholder(destination, draggable, draggables);\n const isVisibleInNewLocation = isTotallyVisibleInNewLocation({\n draggable,\n destination: withPlaceholder,\n newPageBorderBoxCenter: proposedPageBorderBoxCenter,\n viewport: viewport.frame,\n withDroppableDisplacement: false,\n onlyOnMainAxis: true\n });\n return isVisibleInNewLocation ? proposed : null;\n }\n const isGoingBeforeTarget = Boolean(previousPageBorderBoxCenter[destination.axis.line] <= moveRelativeTo.page.borderBox.center[destination.axis.line]);\n const proposedIndex = (() => {\n const relativeTo = moveRelativeTo.descriptor.index;\n if (moveRelativeTo.descriptor.id === draggable.descriptor.id) {\n return relativeTo;\n }\n if (isGoingBeforeTarget) {\n return relativeTo;\n }\n return relativeTo + 1;\n })();\n const displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n displacedBy,\n last: emptyGroups,\n index: proposedIndex\n });\n};\n\nvar moveCrossAxis = ({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport,\n afterCritical\n}) => {\n const destination = getBestCrossAxisDroppable({\n isMovingForward,\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n source: isOver,\n droppables,\n viewport\n });\n if (!destination) {\n return null;\n }\n const insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);\n const moveRelativeTo = getClosestDraggable({\n pageBorderBoxCenter: previousPageBorderBoxCenter,\n viewport,\n destination,\n insideDestination,\n afterCritical\n });\n const impact = moveToNewDroppable({\n previousPageBorderBoxCenter,\n destination,\n draggable,\n draggables,\n moveRelativeTo,\n insideDestination,\n viewport,\n afterCritical\n });\n if (!impact) {\n return null;\n }\n const pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n droppable: destination,\n draggables,\n afterCritical\n });\n const clientSelection = getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport\n });\n return {\n clientSelection,\n impact,\n scrollJumpRequest: null\n };\n};\n\nvar whatIsDraggedOver = impact => {\n const at = impact.at;\n if (!at) {\n return null;\n }\n if (at.type === 'REORDER') {\n return at.destination.droppableId;\n }\n return at.combine.droppableId;\n};\n\nconst getDroppableOver$1 = (impact, droppables) => {\n const id = whatIsDraggedOver(impact);\n return id ? droppables[id] : null;\n};\nvar moveInDirection = ({\n state,\n type\n}) => {\n const isActuallyOver = getDroppableOver$1(state.impact, state.dimensions.droppables);\n const isMainAxisMovementAllowed = Boolean(isActuallyOver);\n const home = state.dimensions.droppables[state.critical.droppable.id];\n const isOver = isActuallyOver || home;\n const direction = isOver.axis.direction;\n const isMovingOnMainAxis = direction === 'vertical' && (type === 'MOVE_UP' || type === 'MOVE_DOWN') || direction === 'horizontal' && (type === 'MOVE_LEFT' || type === 'MOVE_RIGHT');\n if (isMovingOnMainAxis && !isMainAxisMovementAllowed) {\n return null;\n }\n const isMovingForward = type === 'MOVE_DOWN' || type === 'MOVE_RIGHT';\n const draggable = state.dimensions.draggables[state.critical.draggable.id];\n const previousPageBorderBoxCenter = state.current.page.borderBoxCenter;\n const {\n draggables,\n droppables\n } = state.dimensions;\n return isMovingOnMainAxis ? moveToNextPlace({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n destination: isOver,\n draggables,\n viewport: state.viewport,\n previousClientSelection: state.current.client.selection,\n previousImpact: state.impact,\n afterCritical: state.afterCritical\n }) : moveCrossAxis({\n isMovingForward,\n previousPageBorderBoxCenter,\n draggable,\n isOver,\n draggables,\n droppables,\n viewport: state.viewport,\n afterCritical: state.afterCritical\n });\n};\n\nfunction isMovementAllowed(state) {\n return state.phase === 'DRAGGING' || state.phase === 'COLLECTING';\n}\n\nfunction isPositionInFrame(frame) {\n const isWithinVertical = isWithin(frame.top, frame.bottom);\n const isWithinHorizontal = isWithin(frame.left, frame.right);\n return function run(point) {\n return isWithinVertical(point.y) && isWithinHorizontal(point.x);\n };\n}\n\nfunction getHasOverlap(first, second) {\n return first.left < second.right && first.right > second.left && first.top < second.bottom && first.bottom > second.top;\n}\nfunction getFurthestAway({\n pageBorderBox,\n draggable,\n candidates\n}) {\n const startCenter = draggable.page.borderBox.center;\n const sorted = candidates.map(candidate => {\n const axis = candidate.axis;\n const target = patch(candidate.axis.line, pageBorderBox.center[axis.line], candidate.page.borderBox.center[axis.crossAxisLine]);\n return {\n id: candidate.descriptor.id,\n distance: distance(startCenter, target)\n };\n }).sort((a, b) => b.distance - a.distance);\n return sorted[0] ? sorted[0].id : null;\n}\nfunction getDroppableOver({\n pageBorderBox,\n draggable,\n droppables\n}) {\n const candidates = toDroppableList(droppables).filter(item => {\n if (!item.isEnabled) {\n return false;\n }\n const active = item.subject.active;\n if (!active) {\n return false;\n }\n if (!getHasOverlap(pageBorderBox, active)) {\n return false;\n }\n if (isPositionInFrame(active)(pageBorderBox.center)) {\n return true;\n }\n const axis = item.axis;\n const childCenter = active.center[axis.crossAxisLine];\n const crossAxisStart = pageBorderBox[axis.crossAxisStart];\n const crossAxisEnd = pageBorderBox[axis.crossAxisEnd];\n const isContained = isWithin(active[axis.crossAxisStart], active[axis.crossAxisEnd]);\n const isStartContained = isContained(crossAxisStart);\n const isEndContained = isContained(crossAxisEnd);\n if (!isStartContained && !isEndContained) {\n return true;\n }\n if (isStartContained) {\n return crossAxisStart < childCenter;\n }\n return crossAxisEnd > childCenter;\n });\n if (!candidates.length) {\n return null;\n }\n if (candidates.length === 1) {\n return candidates[0].descriptor.id;\n }\n return getFurthestAway({\n pageBorderBox,\n draggable,\n candidates\n });\n}\n\nconst offsetRectByPosition = (rect, point) => getRect(offsetByPosition(rect, point));\n\nvar withDroppableScroll = (droppable, area) => {\n const frame = droppable.frame;\n if (!frame) {\n return area;\n }\n return offsetRectByPosition(area, frame.scroll.diff.value);\n};\n\nfunction getIsDisplaced({\n displaced,\n id\n}) {\n return Boolean(displaced.visible[id] || displaced.invisible[id]);\n}\n\nfunction atIndex({\n draggable,\n closest,\n inHomeList\n}) {\n if (!closest) {\n return null;\n }\n if (!inHomeList) {\n return closest.descriptor.index;\n }\n if (closest.descriptor.index > draggable.descriptor.index) {\n return closest.descriptor.index - 1;\n }\n return closest.descriptor.index;\n}\nvar getReorderImpact = ({\n pageBorderBoxWithDroppableScroll: targetRect,\n draggable,\n destination,\n insideDestination,\n last,\n viewport,\n afterCritical\n}) => {\n const axis = destination.axis;\n const displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);\n const displacement = displacedBy.value;\n const targetStart = targetRect[axis.start];\n const targetEnd = targetRect[axis.end];\n const withoutDragging = removeDraggableFromList(draggable, insideDestination);\n const closest = withoutDragging.find(child => {\n const id = child.descriptor.id;\n const childCenter = child.page.borderBox.center[axis.line];\n const didStartAfterCritical$1 = didStartAfterCritical(id, afterCritical);\n const isDisplaced = getIsDisplaced({\n displaced: last,\n id\n });\n if (didStartAfterCritical$1) {\n if (isDisplaced) {\n return targetEnd <= childCenter;\n }\n return targetStart < childCenter - displacement;\n }\n if (isDisplaced) {\n return targetEnd <= childCenter + displacement;\n }\n return targetStart < childCenter;\n }) || null;\n const newIndex = atIndex({\n draggable,\n closest,\n inHomeList: isHomeOf(draggable, destination)\n });\n return calculateReorderImpact({\n draggable,\n insideDestination,\n destination,\n viewport,\n last,\n displacedBy,\n index: newIndex\n });\n};\n\nconst combineThresholdDivisor = 4;\nvar getCombineImpact = ({\n draggable,\n pageBorderBoxWithDroppableScroll: targetRect,\n previousImpact,\n destination,\n insideDestination,\n afterCritical\n}) => {\n if (!destination.isCombineEnabled) {\n return null;\n }\n const axis = destination.axis;\n const displacedBy = getDisplacedBy(destination.axis, draggable.displaceBy);\n const displacement = displacedBy.value;\n const targetStart = targetRect[axis.start];\n const targetEnd = targetRect[axis.end];\n const withoutDragging = removeDraggableFromList(draggable, insideDestination);\n const combineWith = withoutDragging.find(child => {\n const id = child.descriptor.id;\n const childRect = child.page.borderBox;\n const childSize = childRect[axis.size];\n const threshold = childSize / combineThresholdDivisor;\n const didStartAfterCritical$1 = didStartAfterCritical(id, afterCritical);\n const isDisplaced = getIsDisplaced({\n displaced: previousImpact.displaced,\n id\n });\n if (didStartAfterCritical$1) {\n if (isDisplaced) {\n return targetEnd > childRect[axis.start] + threshold && targetEnd < childRect[axis.end] - threshold;\n }\n return targetStart > childRect[axis.start] - displacement + threshold && targetStart < childRect[axis.end] - displacement - threshold;\n }\n if (isDisplaced) {\n return targetEnd > childRect[axis.start] + displacement + threshold && targetEnd < childRect[axis.end] + displacement - threshold;\n }\n return targetStart > childRect[axis.start] + threshold && targetStart < childRect[axis.end] - threshold;\n });\n if (!combineWith) {\n return null;\n }\n const impact = {\n displacedBy,\n displaced: previousImpact.displaced,\n at: {\n type: 'COMBINE',\n combine: {\n draggableId: combineWith.descriptor.id,\n droppableId: destination.descriptor.id\n }\n }\n };\n return impact;\n};\n\nvar getDragImpact = ({\n pageOffset,\n draggable,\n draggables,\n droppables,\n previousImpact,\n viewport,\n afterCritical\n}) => {\n const pageBorderBox = offsetRectByPosition(draggable.page.borderBox, pageOffset);\n const destinationId = getDroppableOver({\n pageBorderBox,\n draggable,\n droppables\n });\n if (!destinationId) {\n return noImpact;\n }\n const destination = droppables[destinationId];\n const insideDestination = getDraggablesInsideDroppable(destination.descriptor.id, draggables);\n const pageBorderBoxWithDroppableScroll = withDroppableScroll(destination, pageBorderBox);\n return getCombineImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n previousImpact,\n destination,\n insideDestination,\n afterCritical\n }) || getReorderImpact({\n pageBorderBoxWithDroppableScroll,\n draggable,\n destination,\n insideDestination,\n last: previousImpact.displaced,\n viewport,\n afterCritical\n });\n};\n\nvar patchDroppableMap = (droppables, updated) => ({\n ...droppables,\n [updated.descriptor.id]: updated\n});\n\nconst clearUnusedPlaceholder = ({\n previousImpact,\n impact,\n droppables\n}) => {\n const last = whatIsDraggedOver(previousImpact);\n const now = whatIsDraggedOver(impact);\n if (!last) {\n return droppables;\n }\n if (last === now) {\n return droppables;\n }\n const lastDroppable = droppables[last];\n if (!lastDroppable.subject.withPlaceholder) {\n return droppables;\n }\n const updated = removePlaceholder(lastDroppable);\n return patchDroppableMap(droppables, updated);\n};\nvar recomputePlaceholders = ({\n draggable,\n draggables,\n droppables,\n previousImpact,\n impact\n}) => {\n const cleaned = clearUnusedPlaceholder({\n previousImpact,\n impact,\n droppables\n });\n const isOver = whatIsDraggedOver(impact);\n if (!isOver) {\n return cleaned;\n }\n const droppable = droppables[isOver];\n if (isHomeOf(draggable, droppable)) {\n return cleaned;\n }\n if (droppable.subject.withPlaceholder) {\n return cleaned;\n }\n const patched = addPlaceholder(droppable, draggable, draggables);\n return patchDroppableMap(cleaned, patched);\n};\n\nvar update = ({\n state,\n clientSelection: forcedClientSelection,\n dimensions: forcedDimensions,\n viewport: forcedViewport,\n impact: forcedImpact,\n scrollJumpRequest\n}) => {\n const viewport = forcedViewport || state.viewport;\n const dimensions = forcedDimensions || state.dimensions;\n const clientSelection = forcedClientSelection || state.current.client.selection;\n const offset = subtract(clientSelection, state.initial.client.selection);\n const client = {\n offset,\n selection: clientSelection,\n borderBoxCenter: add(state.initial.client.borderBoxCenter, offset)\n };\n const page = {\n selection: add(client.selection, viewport.scroll.current),\n borderBoxCenter: add(client.borderBoxCenter, viewport.scroll.current),\n offset: add(client.offset, viewport.scroll.diff.value)\n };\n const current = {\n client,\n page\n };\n if (state.phase === 'COLLECTING') {\n return {\n ...state,\n dimensions,\n viewport,\n current\n };\n }\n const draggable = dimensions.draggables[state.critical.draggable.id];\n const newImpact = forcedImpact || getDragImpact({\n pageOffset: page.offset,\n draggable,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact: state.impact,\n viewport,\n afterCritical: state.afterCritical\n });\n const withUpdatedPlaceholders = recomputePlaceholders({\n draggable,\n impact: newImpact,\n previousImpact: state.impact,\n draggables: dimensions.draggables,\n droppables: dimensions.droppables\n });\n const result = {\n ...state,\n current,\n dimensions: {\n draggables: dimensions.draggables,\n droppables: withUpdatedPlaceholders\n },\n impact: newImpact,\n viewport,\n scrollJumpRequest: scrollJumpRequest || null,\n forceShouldAnimate: scrollJumpRequest ? false : null\n };\n return result;\n};\n\nfunction getDraggables(ids, draggables) {\n return ids.map(id => draggables[id]);\n}\nvar recompute = ({\n impact,\n viewport,\n draggables,\n destination,\n forceShouldAnimate\n}) => {\n const last = impact.displaced;\n const afterDragging = getDraggables(last.all, draggables);\n const displaced = getDisplacementGroups({\n afterDragging,\n destination,\n displacedBy: impact.displacedBy,\n viewport: viewport.frame,\n forceShouldAnimate,\n last\n });\n return {\n ...impact,\n displaced\n };\n};\n\nvar getClientBorderBoxCenter = ({\n impact,\n draggable,\n droppable,\n draggables,\n viewport,\n afterCritical\n}) => {\n const pageBorderBoxCenter = getPageBorderBoxCenterFromImpact({\n impact,\n draggable,\n draggables,\n droppable,\n afterCritical\n });\n return getClientFromPageBorderBoxCenter({\n pageBorderBoxCenter,\n draggable,\n viewport\n });\n};\n\nvar refreshSnap = ({\n state,\n dimensions: forcedDimensions,\n viewport: forcedViewport\n}) => {\n !(state.movementMode === 'SNAP') ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const needsVisibilityCheck = state.impact;\n const viewport = forcedViewport || state.viewport;\n const dimensions = forcedDimensions || state.dimensions;\n const {\n draggables,\n droppables\n } = dimensions;\n const draggable = draggables[state.critical.draggable.id];\n const isOver = whatIsDraggedOver(needsVisibilityCheck);\n !isOver ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Must be over a destination in SNAP movement mode') : invariant() : void 0;\n const destination = droppables[isOver];\n const impact = recompute({\n impact: needsVisibilityCheck,\n viewport,\n destination,\n draggables\n });\n const clientSelection = getClientBorderBoxCenter({\n impact,\n draggable,\n droppable: destination,\n draggables,\n viewport,\n afterCritical: state.afterCritical\n });\n return update({\n impact,\n clientSelection,\n state,\n dimensions,\n viewport\n });\n};\n\nvar getHomeLocation = descriptor => ({\n index: descriptor.index,\n droppableId: descriptor.droppableId\n});\n\nvar getLiftEffect = ({\n draggable,\n home,\n draggables,\n viewport\n}) => {\n const displacedBy = getDisplacedBy(home.axis, draggable.displaceBy);\n const insideHome = getDraggablesInsideDroppable(home.descriptor.id, draggables);\n const rawIndex = insideHome.indexOf(draggable);\n !(rawIndex !== -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected draggable to be inside home list') : invariant() : void 0;\n const afterDragging = insideHome.slice(rawIndex + 1);\n const effected = afterDragging.reduce((previous, item) => {\n previous[item.descriptor.id] = true;\n return previous;\n }, {});\n const afterCritical = {\n inVirtualList: home.descriptor.mode === 'virtual',\n displacedBy,\n effected\n };\n const displaced = getDisplacementGroups({\n afterDragging,\n destination: home,\n displacedBy,\n last: null,\n viewport: viewport.frame,\n forceShouldAnimate: false\n });\n const impact = {\n displaced,\n displacedBy,\n at: {\n type: 'REORDER',\n destination: getHomeLocation(draggable.descriptor)\n }\n };\n return {\n impact,\n afterCritical\n };\n};\n\nvar patchDimensionMap = (dimensions, updated) => ({\n draggables: dimensions.draggables,\n droppables: patchDroppableMap(dimensions.droppables, updated)\n});\n\nconst start = key => {\n if (process.env.NODE_ENV !== 'production') {\n {\n return;\n }\n }\n};\nconst finish = key => {\n if (process.env.NODE_ENV !== 'production') {\n {\n return;\n }\n }\n};\n\nvar offsetDraggable = ({\n draggable,\n offset: offset$1,\n initialWindowScroll\n}) => {\n const client = offset(draggable.client, offset$1);\n const page = withScroll(client, initialWindowScroll);\n const moved = {\n ...draggable,\n placeholder: {\n ...draggable.placeholder,\n client\n },\n client,\n page\n };\n return moved;\n};\n\nvar getFrame = droppable => {\n const frame = droppable.frame;\n !frame ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected Droppable to have a frame') : invariant() : void 0;\n return frame;\n};\n\nvar adjustAdditionsForScrollChanges = ({\n additions,\n updatedDroppables,\n viewport\n}) => {\n const windowScrollChange = viewport.scroll.diff.value;\n return additions.map(draggable => {\n const droppableId = draggable.descriptor.droppableId;\n const modified = updatedDroppables[droppableId];\n const frame = getFrame(modified);\n const droppableScrollChange = frame.scroll.diff.value;\n const totalChange = add(windowScrollChange, droppableScrollChange);\n const moved = offsetDraggable({\n draggable,\n offset: totalChange,\n initialWindowScroll: viewport.scroll.initial\n });\n return moved;\n });\n};\n\nvar publishWhileDraggingInVirtual = ({\n state,\n published\n}) => {\n start();\n const withScrollChange = published.modified.map(update => {\n const existing = state.dimensions.droppables[update.droppableId];\n const scrolled = scrollDroppable(existing, update.scroll);\n return scrolled;\n });\n const droppables = {\n ...state.dimensions.droppables,\n ...toDroppableMap(withScrollChange)\n };\n const updatedAdditions = toDraggableMap(adjustAdditionsForScrollChanges({\n additions: published.additions,\n updatedDroppables: droppables,\n viewport: state.viewport\n }));\n const draggables = {\n ...state.dimensions.draggables,\n ...updatedAdditions\n };\n published.removals.forEach(id => {\n delete draggables[id];\n });\n const dimensions = {\n droppables,\n draggables\n };\n const wasOverId = whatIsDraggedOver(state.impact);\n const wasOver = wasOverId ? dimensions.droppables[wasOverId] : null;\n const draggable = dimensions.draggables[state.critical.draggable.id];\n const home = dimensions.droppables[state.critical.droppable.id];\n const {\n impact: onLiftImpact,\n afterCritical\n } = getLiftEffect({\n draggable,\n home,\n draggables,\n viewport: state.viewport\n });\n const previousImpact = wasOver && wasOver.isCombineEnabled ? state.impact : onLiftImpact;\n const impact = getDragImpact({\n pageOffset: state.current.page.offset,\n draggable: dimensions.draggables[state.critical.draggable.id],\n draggables: dimensions.draggables,\n droppables: dimensions.droppables,\n previousImpact,\n viewport: state.viewport,\n afterCritical\n });\n finish();\n const draggingState = {\n ...state,\n phase: 'DRAGGING',\n impact,\n onLiftImpact,\n dimensions,\n afterCritical,\n forceShouldAnimate: false\n };\n if (state.phase === 'COLLECTING') {\n return draggingState;\n }\n const dropPending = {\n ...draggingState,\n phase: 'DROP_PENDING',\n reason: state.reason,\n isWaiting: false\n };\n return dropPending;\n};\n\nconst isSnapping = state => state.movementMode === 'SNAP';\nconst postDroppableChange = (state, updated, isEnabledChanging) => {\n const dimensions = patchDimensionMap(state.dimensions, updated);\n if (!isSnapping(state) || isEnabledChanging) {\n return update({\n state,\n dimensions\n });\n }\n return refreshSnap({\n state,\n dimensions\n });\n};\nfunction removeScrollJumpRequest(state) {\n if (state.isDragging && state.movementMode === 'SNAP') {\n return {\n ...state,\n scrollJumpRequest: null\n };\n }\n return state;\n}\nconst idle$2 = {\n phase: 'IDLE',\n completed: null,\n shouldFlush: false\n};\nvar reducer = (state = idle$2, action) => {\n if (action.type === 'FLUSH') {\n return {\n ...idle$2,\n shouldFlush: true\n };\n }\n if (action.type === 'INITIAL_PUBLISH') {\n !(state.phase === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'INITIAL_PUBLISH must come after a IDLE phase') : invariant() : void 0;\n const {\n critical,\n clientSelection,\n viewport,\n dimensions,\n movementMode\n } = action.payload;\n const draggable = dimensions.draggables[critical.draggable.id];\n const home = dimensions.droppables[critical.droppable.id];\n const client = {\n selection: clientSelection,\n borderBoxCenter: draggable.client.borderBox.center,\n offset: origin\n };\n const initial = {\n client,\n page: {\n selection: add(client.selection, viewport.scroll.initial),\n borderBoxCenter: add(client.selection, viewport.scroll.initial),\n offset: add(client.selection, viewport.scroll.diff.value)\n }\n };\n const isWindowScrollAllowed = toDroppableList(dimensions.droppables).every(item => !item.isFixedOnPage);\n const {\n impact,\n afterCritical\n } = getLiftEffect({\n draggable,\n home,\n draggables: dimensions.draggables,\n viewport\n });\n const result = {\n phase: 'DRAGGING',\n isDragging: true,\n critical,\n movementMode,\n dimensions,\n initial,\n current: initial,\n isWindowScrollAllowed,\n impact,\n afterCritical,\n onLiftImpact: impact,\n viewport,\n scrollJumpRequest: null,\n forceShouldAnimate: null\n };\n return result;\n }\n if (action.type === 'COLLECTION_STARTING') {\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Collection cannot start from phase ${state.phase}`) : invariant() : void 0;\n const result = {\n ...state,\n phase: 'COLLECTING'\n };\n return result;\n }\n if (action.type === 'PUBLISH_WHILE_DRAGGING') {\n !(state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unexpected ${action.type} received in phase ${state.phase}`) : invariant() : void 0;\n return publishWhileDraggingInVirtual({\n state,\n published: action.payload\n });\n }\n if (action.type === 'MOVE') {\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${action.type} not permitted in phase ${state.phase}`) : invariant() : void 0;\n const {\n client: clientSelection\n } = action.payload;\n if (isEqual$1(clientSelection, state.current.client.selection)) {\n return state;\n }\n return update({\n state,\n clientSelection,\n impact: isSnapping(state) ? state.impact : null\n });\n }\n if (action.type === 'UPDATE_DROPPABLE_SCROLL') {\n if (state.phase === 'DROP_PENDING') {\n return removeScrollJumpRequest(state);\n }\n if (state.phase === 'COLLECTING') {\n return removeScrollJumpRequest(state);\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${action.type} not permitted in phase ${state.phase}`) : invariant() : void 0;\n const {\n id,\n newScroll\n } = action.payload;\n const target = state.dimensions.droppables[id];\n if (!target) {\n return state;\n }\n const scrolled = scrollDroppable(target, newScroll);\n return postDroppableChange(state, scrolled, false);\n }\n if (action.type === 'UPDATE_DROPPABLE_IS_ENABLED') {\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Attempting to move in an unsupported phase ${state.phase}`) : invariant() : void 0;\n const {\n id,\n isEnabled\n } = action.payload;\n const target = state.dimensions.droppables[id];\n !target ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find Droppable[id: ${id}] to toggle its enabled state`) : invariant() : void 0;\n !(target.isEnabled !== isEnabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Trying to set droppable isEnabled to ${String(isEnabled)}\n but it is already ${String(target.isEnabled)}`) : invariant() : void 0;\n const updated = {\n ...target,\n isEnabled\n };\n return postDroppableChange(state, updated, true);\n }\n if (action.type === 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED') {\n if (state.phase === 'DROP_PENDING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Attempting to move in an unsupported phase ${state.phase}`) : invariant() : void 0;\n const {\n id,\n isCombineEnabled\n } = action.payload;\n const target = state.dimensions.droppables[id];\n !target ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find Droppable[id: ${id}] to toggle its isCombineEnabled state`) : invariant() : void 0;\n !(target.isCombineEnabled !== isCombineEnabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Trying to set droppable isCombineEnabled to ${String(isCombineEnabled)}\n but it is already ${String(target.isCombineEnabled)}`) : invariant() : void 0;\n const updated = {\n ...target,\n isCombineEnabled\n };\n return postDroppableChange(state, updated, true);\n }\n if (action.type === 'MOVE_BY_WINDOW_SCROLL') {\n if (state.phase === 'DROP_PENDING' || state.phase === 'DROP_ANIMATING') {\n return state;\n }\n !isMovementAllowed(state) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot move by window in phase ${state.phase}`) : invariant() : void 0;\n !state.isWindowScrollAllowed ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Window scrolling is currently not supported for fixed lists') : invariant() : void 0;\n const newScroll = action.payload.newScroll;\n if (isEqual$1(state.viewport.scroll.current, newScroll)) {\n return removeScrollJumpRequest(state);\n }\n const viewport = scrollViewport(state.viewport, newScroll);\n if (isSnapping(state)) {\n return refreshSnap({\n state,\n viewport\n });\n }\n return update({\n state,\n viewport\n });\n }\n if (action.type === 'UPDATE_VIEWPORT_MAX_SCROLL') {\n if (!isMovementAllowed(state)) {\n return state;\n }\n const maxScroll = action.payload.maxScroll;\n if (isEqual$1(maxScroll, state.viewport.scroll.max)) {\n return state;\n }\n const withMaxScroll = {\n ...state.viewport,\n scroll: {\n ...state.viewport.scroll,\n max: maxScroll\n }\n };\n return {\n ...state,\n viewport: withMaxScroll\n };\n }\n if (action.type === 'MOVE_UP' || action.type === 'MOVE_DOWN' || action.type === 'MOVE_LEFT' || action.type === 'MOVE_RIGHT') {\n if (state.phase === 'COLLECTING' || state.phase === 'DROP_PENDING') {\n return state;\n }\n !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${action.type} received while not in DRAGGING phase`) : invariant() : void 0;\n const result = moveInDirection({\n state,\n type: action.type\n });\n if (!result) {\n return state;\n }\n return update({\n state,\n impact: result.impact,\n clientSelection: result.clientSelection,\n scrollJumpRequest: result.scrollJumpRequest\n });\n }\n if (action.type === 'DROP_PENDING') {\n const reason = action.payload.reason;\n !(state.phase === 'COLLECTING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only move into the DROP_PENDING phase from the COLLECTING phase') : invariant() : void 0;\n const newState = {\n ...state,\n phase: 'DROP_PENDING',\n isWaiting: true,\n reason\n };\n return newState;\n }\n if (action.type === 'DROP_ANIMATE') {\n const {\n completed,\n dropDuration,\n newHomeClientOffset\n } = action.payload;\n !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot animate drop from phase ${state.phase}`) : invariant() : void 0;\n const result = {\n phase: 'DROP_ANIMATING',\n completed,\n dropDuration,\n newHomeClientOffset,\n dimensions: state.dimensions\n };\n return result;\n }\n if (action.type === 'DROP_COMPLETE') {\n const {\n completed\n } = action.payload;\n return {\n phase: 'IDLE',\n completed,\n shouldFlush: false\n };\n }\n return state;\n};\n\nfunction guard(action, predicate) {\n return action instanceof Object && 'type' in action && action.type === predicate;\n}\nconst beforeInitialCapture = args => ({\n type: 'BEFORE_INITIAL_CAPTURE',\n payload: args\n});\nconst lift$1 = args => ({\n type: 'LIFT',\n payload: args\n});\nconst initialPublish = args => ({\n type: 'INITIAL_PUBLISH',\n payload: args\n});\nconst publishWhileDragging = args => ({\n type: 'PUBLISH_WHILE_DRAGGING',\n payload: args\n});\nconst collectionStarting = () => ({\n type: 'COLLECTION_STARTING',\n payload: null\n});\nconst updateDroppableScroll = args => ({\n type: 'UPDATE_DROPPABLE_SCROLL',\n payload: args\n});\nconst updateDroppableIsEnabled = args => ({\n type: 'UPDATE_DROPPABLE_IS_ENABLED',\n payload: args\n});\nconst updateDroppableIsCombineEnabled = args => ({\n type: 'UPDATE_DROPPABLE_IS_COMBINE_ENABLED',\n payload: args\n});\nconst move = args => ({\n type: 'MOVE',\n payload: args\n});\nconst moveByWindowScroll = args => ({\n type: 'MOVE_BY_WINDOW_SCROLL',\n payload: args\n});\nconst updateViewportMaxScroll = args => ({\n type: 'UPDATE_VIEWPORT_MAX_SCROLL',\n payload: args\n});\nconst moveUp = () => ({\n type: 'MOVE_UP',\n payload: null\n});\nconst moveDown = () => ({\n type: 'MOVE_DOWN',\n payload: null\n});\nconst moveRight = () => ({\n type: 'MOVE_RIGHT',\n payload: null\n});\nconst moveLeft = () => ({\n type: 'MOVE_LEFT',\n payload: null\n});\nconst flush = () => ({\n type: 'FLUSH',\n payload: null\n});\nconst animateDrop = args => ({\n type: 'DROP_ANIMATE',\n payload: args\n});\nconst completeDrop = args => ({\n type: 'DROP_COMPLETE',\n payload: args\n});\nconst drop = args => ({\n type: 'DROP',\n payload: args\n});\nconst dropPending = args => ({\n type: 'DROP_PENDING',\n payload: args\n});\nconst dropAnimationFinished = () => ({\n type: 'DROP_ANIMATION_FINISHED',\n payload: null\n});\n\nfunction checkIndexes(insideDestination) {\n if (insideDestination.length <= 1) {\n return;\n }\n const indexes = insideDestination.map(d => d.descriptor.index);\n const errors = {};\n for (let i = 1; i < indexes.length; i++) {\n const current = indexes[i];\n const previous = indexes[i - 1];\n if (current !== previous + 1) {\n errors[current] = true;\n }\n }\n if (!Object.keys(errors).length) {\n return;\n }\n const formatted = indexes.map(index => {\n const hasError = Boolean(errors[index]);\n return hasError ? `[🔥${index}]` : `${index}`;\n }).join(', ');\n process.env.NODE_ENV !== \"production\" ? warning(`\n Detected non-consecutive <Draggable /> indexes.\n\n (This can cause unexpected bugs)\n\n ${formatted}\n `) : void 0;\n}\nfunction validateDimensions(critical, dimensions) {\n if (process.env.NODE_ENV !== 'production') {\n const insideDestination = getDraggablesInsideDroppable(critical.droppable.id, dimensions.draggables);\n checkIndexes(insideDestination);\n }\n}\n\nvar lift = marshal => ({\n getState,\n dispatch\n}) => next => action => {\n if (!guard(action, 'LIFT')) {\n next(action);\n return;\n }\n const {\n id,\n clientSelection,\n movementMode\n } = action.payload;\n const initial = getState();\n if (initial.phase === 'DROP_ANIMATING') {\n dispatch(completeDrop({\n completed: initial.completed\n }));\n }\n !(getState().phase === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Unexpected phase to start a drag') : invariant() : void 0;\n dispatch(flush());\n dispatch(beforeInitialCapture({\n draggableId: id,\n movementMode\n }));\n const scrollOptions = {\n shouldPublishImmediately: movementMode === 'SNAP'\n };\n const request = {\n draggableId: id,\n scrollOptions\n };\n const {\n critical,\n dimensions,\n viewport\n } = marshal.startPublishing(request);\n validateDimensions(critical, dimensions);\n dispatch(initialPublish({\n critical,\n dimensions,\n clientSelection,\n movementMode,\n viewport\n }));\n};\n\nvar style = marshal => () => next => action => {\n if (guard(action, 'INITIAL_PUBLISH')) {\n marshal.dragging();\n }\n if (guard(action, 'DROP_ANIMATE')) {\n marshal.dropping(action.payload.completed.result.reason);\n }\n if (guard(action, 'FLUSH') || guard(action, 'DROP_COMPLETE')) {\n marshal.resting();\n }\n next(action);\n};\n\nconst curves = {\n outOfTheWay: 'cubic-bezier(0.2, 0, 0, 1)',\n drop: 'cubic-bezier(.2,1,.1,1)'\n};\nconst combine = {\n opacity: {\n drop: 0,\n combining: 0.7\n },\n scale: {\n drop: 0.75\n }\n};\nconst timings = {\n outOfTheWay: 0.2,\n minDropTime: 0.33,\n maxDropTime: 0.55\n};\nconst outOfTheWayTiming = `${timings.outOfTheWay}s ${curves.outOfTheWay}`;\nconst transitions = {\n fluid: `opacity ${outOfTheWayTiming}`,\n snap: `transform ${outOfTheWayTiming}, opacity ${outOfTheWayTiming}`,\n drop: duration => {\n const timing = `${duration}s ${curves.drop}`;\n return `transform ${timing}, opacity ${timing}`;\n },\n outOfTheWay: `transform ${outOfTheWayTiming}`,\n placeholder: `height ${outOfTheWayTiming}, width ${outOfTheWayTiming}, margin ${outOfTheWayTiming}`\n};\nconst moveTo = offset => isEqual$1(offset, origin) ? undefined : `translate(${offset.x}px, ${offset.y}px)`;\nconst transforms = {\n moveTo,\n drop: (offset, isCombining) => {\n const translate = moveTo(offset);\n if (!translate) {\n return undefined;\n }\n if (!isCombining) {\n return translate;\n }\n return `${translate} scale(${combine.scale.drop})`;\n }\n};\n\nconst {\n minDropTime,\n maxDropTime\n} = timings;\nconst dropTimeRange = maxDropTime - minDropTime;\nconst maxDropTimeAtDistance = 1500;\nconst cancelDropModifier = 0.6;\nvar getDropDuration = ({\n current,\n destination,\n reason\n}) => {\n const distance$1 = distance(current, destination);\n if (distance$1 <= 0) {\n return minDropTime;\n }\n if (distance$1 >= maxDropTimeAtDistance) {\n return maxDropTime;\n }\n const percentage = distance$1 / maxDropTimeAtDistance;\n const duration = minDropTime + dropTimeRange * percentage;\n const withDuration = reason === 'CANCEL' ? duration * cancelDropModifier : duration;\n return Number(withDuration.toFixed(2));\n};\n\nvar getNewHomeClientOffset = ({\n impact,\n draggable,\n dimensions,\n viewport,\n afterCritical\n}) => {\n const {\n draggables,\n droppables\n } = dimensions;\n const droppableId = whatIsDraggedOver(impact);\n const destination = droppableId ? droppables[droppableId] : null;\n const home = droppables[draggable.descriptor.droppableId];\n const newClientCenter = getClientBorderBoxCenter({\n impact,\n draggable,\n draggables,\n afterCritical,\n droppable: destination || home,\n viewport\n });\n const offset = subtract(newClientCenter, draggable.client.borderBox.center);\n return offset;\n};\n\nvar getDropImpact = ({\n draggables,\n reason,\n lastImpact,\n home,\n viewport,\n onLiftImpact\n}) => {\n if (!lastImpact.at || reason !== 'DROP') {\n const recomputedHomeImpact = recompute({\n draggables,\n impact: onLiftImpact,\n destination: home,\n viewport,\n forceShouldAnimate: true\n });\n return {\n impact: recomputedHomeImpact,\n didDropInsideDroppable: false\n };\n }\n if (lastImpact.at.type === 'REORDER') {\n return {\n impact: lastImpact,\n didDropInsideDroppable: true\n };\n }\n const withoutMovement = {\n ...lastImpact,\n displaced: emptyGroups\n };\n return {\n impact: withoutMovement,\n didDropInsideDroppable: true\n };\n};\n\nconst dropMiddleware = ({\n getState,\n dispatch\n}) => next => action => {\n if (!guard(action, 'DROP')) {\n next(action);\n return;\n }\n const state = getState();\n const reason = action.payload.reason;\n if (state.phase === 'COLLECTING') {\n dispatch(dropPending({\n reason\n }));\n return;\n }\n if (state.phase === 'IDLE') {\n return;\n }\n const isWaitingForDrop = state.phase === 'DROP_PENDING' && state.isWaiting;\n !!isWaitingForDrop ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'A DROP action occurred while DROP_PENDING and still waiting') : invariant() : void 0;\n !(state.phase === 'DRAGGING' || state.phase === 'DROP_PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot drop in phase: ${state.phase}`) : invariant() : void 0;\n const critical = state.critical;\n const dimensions = state.dimensions;\n const draggable = dimensions.draggables[state.critical.draggable.id];\n const {\n impact,\n didDropInsideDroppable\n } = getDropImpact({\n reason,\n lastImpact: state.impact,\n afterCritical: state.afterCritical,\n onLiftImpact: state.onLiftImpact,\n home: state.dimensions.droppables[state.critical.droppable.id],\n viewport: state.viewport,\n draggables: state.dimensions.draggables\n });\n const destination = didDropInsideDroppable ? tryGetDestination(impact) : null;\n const combine = didDropInsideDroppable ? tryGetCombine(impact) : null;\n const source = {\n index: critical.draggable.index,\n droppableId: critical.droppable.id\n };\n const result = {\n draggableId: draggable.descriptor.id,\n type: draggable.descriptor.type,\n source,\n reason,\n mode: state.movementMode,\n destination,\n combine\n };\n const newHomeClientOffset = getNewHomeClientOffset({\n impact,\n draggable,\n dimensions,\n viewport: state.viewport,\n afterCritical: state.afterCritical\n });\n const completed = {\n critical: state.critical,\n afterCritical: state.afterCritical,\n result,\n impact\n };\n const isAnimationRequired = !isEqual$1(state.current.client.offset, newHomeClientOffset) || Boolean(result.combine);\n if (!isAnimationRequired) {\n dispatch(completeDrop({\n completed\n }));\n return;\n }\n const dropDuration = getDropDuration({\n current: state.current.client.offset,\n destination: newHomeClientOffset,\n reason\n });\n const args = {\n newHomeClientOffset,\n dropDuration,\n completed\n };\n dispatch(animateDrop(args));\n};\n\nvar getWindowScroll = () => ({\n x: window.pageXOffset,\n y: window.pageYOffset\n});\n\nfunction getWindowScrollBinding(update) {\n return {\n eventName: 'scroll',\n options: {\n passive: true,\n capture: false\n },\n fn: event => {\n if (event.target !== window && event.target !== window.document) {\n return;\n }\n update();\n }\n };\n}\nfunction getScrollListener({\n onWindowScroll\n}) {\n function updateScroll() {\n onWindowScroll(getWindowScroll());\n }\n const scheduled = rafSchd(updateScroll);\n const binding = getWindowScrollBinding(scheduled);\n let unbind = noop$2;\n function isActive() {\n return unbind !== noop$2;\n }\n function start() {\n !!isActive() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot start scroll listener when already active') : invariant() : void 0;\n unbind = bindEvents(window, [binding]);\n }\n function stop() {\n !isActive() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot stop scroll listener when not active') : invariant() : void 0;\n scheduled.cancel();\n unbind();\n unbind = noop$2;\n }\n return {\n start,\n stop,\n isActive\n };\n}\n\nconst shouldStop$1 = action => guard(action, 'DROP_COMPLETE') || guard(action, 'DROP_ANIMATE') || guard(action, 'FLUSH');\nconst scrollListener = store => {\n const listener = getScrollListener({\n onWindowScroll: newScroll => {\n store.dispatch(moveByWindowScroll({\n newScroll\n }));\n }\n });\n return next => action => {\n if (!listener.isActive() && guard(action, 'INITIAL_PUBLISH')) {\n listener.start();\n }\n if (listener.isActive() && shouldStop$1(action)) {\n listener.stop();\n }\n next(action);\n };\n};\n\nvar getExpiringAnnounce = announce => {\n let wasCalled = false;\n let isExpired = false;\n const timeoutId = setTimeout(() => {\n isExpired = true;\n });\n const result = message => {\n if (wasCalled) {\n process.env.NODE_ENV !== \"production\" ? warning('Announcement already made. Not making a second announcement') : void 0;\n return;\n }\n if (isExpired) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Announcements cannot be made asynchronously.\n Default message has already been announced.\n `) : void 0;\n return;\n }\n wasCalled = true;\n announce(message);\n clearTimeout(timeoutId);\n };\n result.wasCalled = () => wasCalled;\n return result;\n};\n\nvar getAsyncMarshal = () => {\n const entries = [];\n const execute = timerId => {\n const index = entries.findIndex(item => item.timerId === timerId);\n !(index !== -1) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find timer') : invariant() : void 0;\n const [entry] = entries.splice(index, 1);\n entry.callback();\n };\n const add = fn => {\n const timerId = setTimeout(() => execute(timerId));\n const entry = {\n timerId,\n callback: fn\n };\n entries.push(entry);\n };\n const flush = () => {\n if (!entries.length) {\n return;\n }\n const shallow = [...entries];\n entries.length = 0;\n shallow.forEach(entry => {\n clearTimeout(entry.timerId);\n entry.callback();\n });\n };\n return {\n add,\n flush\n };\n};\n\nconst areLocationsEqual = (first, second) => {\n if (first == null && second == null) {\n return true;\n }\n if (first == null || second == null) {\n return false;\n }\n return first.droppableId === second.droppableId && first.index === second.index;\n};\nconst isCombineEqual = (first, second) => {\n if (first == null && second == null) {\n return true;\n }\n if (first == null || second == null) {\n return false;\n }\n return first.draggableId === second.draggableId && first.droppableId === second.droppableId;\n};\nconst isCriticalEqual = (first, second) => {\n if (first === second) {\n return true;\n }\n const isDraggableEqual = first.draggable.id === second.draggable.id && first.draggable.droppableId === second.draggable.droppableId && first.draggable.type === second.draggable.type && first.draggable.index === second.draggable.index;\n const isDroppableEqual = first.droppable.id === second.droppable.id && first.droppable.type === second.droppable.type;\n return isDraggableEqual && isDroppableEqual;\n};\n\nconst withTimings = (key, fn) => {\n start();\n fn();\n finish();\n};\nconst getDragStart = (critical, mode) => ({\n draggableId: critical.draggable.id,\n type: critical.droppable.type,\n source: {\n droppableId: critical.droppable.id,\n index: critical.draggable.index\n },\n mode\n});\nfunction execute(responder, data, announce, getDefaultMessage) {\n if (!responder) {\n announce(getDefaultMessage(data));\n return;\n }\n const willExpire = getExpiringAnnounce(announce);\n const provided = {\n announce: willExpire\n };\n responder(data, provided);\n if (!willExpire.wasCalled()) {\n announce(getDefaultMessage(data));\n }\n}\nvar getPublisher = (getResponders, announce) => {\n const asyncMarshal = getAsyncMarshal();\n let dragging = null;\n const beforeCapture = (draggableId, mode) => {\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onBeforeCapture as a drag start has already been published') : invariant() : void 0;\n withTimings('onBeforeCapture', () => {\n const fn = getResponders().onBeforeCapture;\n if (fn) {\n const before = {\n draggableId,\n mode\n };\n fn(before);\n }\n });\n };\n const beforeStart = (critical, mode) => {\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : invariant() : void 0;\n withTimings('onBeforeDragStart', () => {\n const fn = getResponders().onBeforeDragStart;\n if (fn) {\n fn(getDragStart(critical, mode));\n }\n });\n };\n const start = (critical, mode) => {\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onBeforeDragStart as a drag start has already been published') : invariant() : void 0;\n const data = getDragStart(critical, mode);\n dragging = {\n mode,\n lastCritical: critical,\n lastLocation: data.source,\n lastCombine: null\n };\n asyncMarshal.add(() => {\n withTimings('onDragStart', () => execute(getResponders().onDragStart, data, announce, preset.onDragStart));\n });\n };\n const update = (critical, impact) => {\n const location = tryGetDestination(impact);\n const combine = tryGetCombine(impact);\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onDragMove when onDragStart has not been called') : invariant() : void 0;\n const hasCriticalChanged = !isCriticalEqual(critical, dragging.lastCritical);\n if (hasCriticalChanged) {\n dragging.lastCritical = critical;\n }\n const hasLocationChanged = !areLocationsEqual(dragging.lastLocation, location);\n if (hasLocationChanged) {\n dragging.lastLocation = location;\n }\n const hasGroupingChanged = !isCombineEqual(dragging.lastCombine, combine);\n if (hasGroupingChanged) {\n dragging.lastCombine = combine;\n }\n if (!hasCriticalChanged && !hasLocationChanged && !hasGroupingChanged) {\n return;\n }\n const data = {\n ...getDragStart(critical, dragging.mode),\n combine,\n destination: location\n };\n asyncMarshal.add(() => {\n withTimings('onDragUpdate', () => execute(getResponders().onDragUpdate, data, announce, preset.onDragUpdate));\n });\n };\n const flush = () => {\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only flush responders while dragging') : invariant() : void 0;\n asyncMarshal.flush();\n };\n const drop = result => {\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fire onDragEnd when there is no matching onDragStart') : invariant() : void 0;\n dragging = null;\n withTimings('onDragEnd', () => execute(getResponders().onDragEnd, result, announce, preset.onDragEnd));\n };\n const abort = () => {\n if (!dragging) {\n return;\n }\n const result = {\n ...getDragStart(dragging.lastCritical, dragging.mode),\n combine: null,\n destination: null,\n reason: 'CANCEL'\n };\n drop(result);\n };\n return {\n beforeCapture,\n beforeStart,\n start,\n update,\n flush,\n drop,\n abort\n };\n};\n\nvar responders = (getResponders, announce) => {\n const publisher = getPublisher(getResponders, announce);\n return store => next => action => {\n if (guard(action, 'BEFORE_INITIAL_CAPTURE')) {\n publisher.beforeCapture(action.payload.draggableId, action.payload.movementMode);\n return;\n }\n if (guard(action, 'INITIAL_PUBLISH')) {\n const critical = action.payload.critical;\n publisher.beforeStart(critical, action.payload.movementMode);\n next(action);\n publisher.start(critical, action.payload.movementMode);\n return;\n }\n if (guard(action, 'DROP_COMPLETE')) {\n const result = action.payload.completed.result;\n publisher.flush();\n next(action);\n publisher.drop(result);\n return;\n }\n next(action);\n if (guard(action, 'FLUSH')) {\n publisher.abort();\n return;\n }\n const state = store.getState();\n if (state.phase === 'DRAGGING') {\n publisher.update(state.critical, state.impact);\n }\n };\n};\n\nconst dropAnimationFinishMiddleware = store => next => action => {\n if (!guard(action, 'DROP_ANIMATION_FINISHED')) {\n next(action);\n return;\n }\n const state = store.getState();\n !(state.phase === 'DROP_ANIMATING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot finish a drop animating when no drop is occurring') : invariant() : void 0;\n store.dispatch(completeDrop({\n completed: state.completed\n }));\n};\n\nconst dropAnimationFlushOnScrollMiddleware = store => {\n let unbind = null;\n let frameId = null;\n function clear() {\n if (frameId) {\n cancelAnimationFrame(frameId);\n frameId = null;\n }\n if (unbind) {\n unbind();\n unbind = null;\n }\n }\n return next => action => {\n if (guard(action, 'FLUSH') || guard(action, 'DROP_COMPLETE') || guard(action, 'DROP_ANIMATION_FINISHED')) {\n clear();\n }\n next(action);\n if (!guard(action, 'DROP_ANIMATE')) {\n return;\n }\n const binding = {\n eventName: 'scroll',\n options: {\n capture: true,\n passive: false,\n once: true\n },\n fn: function flushDropAnimation() {\n const state = store.getState();\n if (state.phase === 'DROP_ANIMATING') {\n store.dispatch(dropAnimationFinished());\n }\n }\n };\n frameId = requestAnimationFrame(() => {\n frameId = null;\n unbind = bindEvents(window, [binding]);\n });\n };\n};\n\nvar dimensionMarshalStopper = marshal => () => next => action => {\n if (guard(action, 'DROP_COMPLETE') || guard(action, 'FLUSH') || guard(action, 'DROP_ANIMATE')) {\n marshal.stopPublishing();\n }\n next(action);\n};\n\nvar focus = marshal => {\n let isWatching = false;\n return () => next => action => {\n if (guard(action, 'INITIAL_PUBLISH')) {\n isWatching = true;\n marshal.tryRecordFocus(action.payload.critical.draggable.id);\n next(action);\n marshal.tryRestoreFocusRecorded();\n return;\n }\n next(action);\n if (!isWatching) {\n return;\n }\n if (guard(action, 'FLUSH')) {\n isWatching = false;\n marshal.tryRestoreFocusRecorded();\n return;\n }\n if (guard(action, 'DROP_COMPLETE')) {\n isWatching = false;\n const result = action.payload.completed.result;\n if (result.combine) {\n marshal.tryShiftRecord(result.draggableId, result.combine.draggableId);\n }\n marshal.tryRestoreFocusRecorded();\n }\n };\n};\n\nconst shouldStop = action => guard(action, 'DROP_COMPLETE') || guard(action, 'DROP_ANIMATE') || guard(action, 'FLUSH');\nvar autoScroll = autoScroller => store => next => action => {\n if (shouldStop(action)) {\n autoScroller.stop();\n next(action);\n return;\n }\n if (guard(action, 'INITIAL_PUBLISH')) {\n next(action);\n const state = store.getState();\n !(state.phase === 'DRAGGING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected phase to be DRAGGING after INITIAL_PUBLISH') : invariant() : void 0;\n autoScroller.start(state);\n return;\n }\n next(action);\n autoScroller.scroll(store.getState());\n};\n\nconst pendingDrop = store => next => action => {\n next(action);\n if (!guard(action, 'PUBLISH_WHILE_DRAGGING')) {\n return;\n }\n const postActionState = store.getState();\n if (postActionState.phase !== 'DROP_PENDING') {\n return;\n }\n if (postActionState.isWaiting) {\n return;\n }\n store.dispatch(drop({\n reason: postActionState.reason\n }));\n};\n\nconst composeEnhancers = process.env.NODE_ENV !== 'production' && typeof window !== 'undefined' && window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__ ? window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__({\n name: '@hello-pangea/dnd'\n}) : compose;\nvar createStore = ({\n dimensionMarshal,\n focusMarshal,\n styleMarshal,\n getResponders,\n announce,\n autoScroller\n}) => createStore$1(reducer, composeEnhancers(applyMiddleware(style(styleMarshal), dimensionMarshalStopper(dimensionMarshal), lift(dimensionMarshal), dropMiddleware, dropAnimationFinishMiddleware, dropAnimationFlushOnScrollMiddleware, pendingDrop, autoScroll(autoScroller), scrollListener, focus(focusMarshal), responders(getResponders, announce))));\n\nconst clean$1 = () => ({\n additions: {},\n removals: {},\n modified: {}\n});\nfunction createPublisher({\n registry,\n callbacks\n}) {\n let staging = clean$1();\n let frameId = null;\n const collect = () => {\n if (frameId) {\n return;\n }\n callbacks.collectionStarting();\n frameId = requestAnimationFrame(() => {\n frameId = null;\n start();\n const {\n additions,\n removals,\n modified\n } = staging;\n const added = Object.keys(additions).map(id => registry.draggable.getById(id).getDimension(origin)).sort((a, b) => a.descriptor.index - b.descriptor.index);\n const updated = Object.keys(modified).map(id => {\n const entry = registry.droppable.getById(id);\n const scroll = entry.callbacks.getScrollWhileDragging();\n return {\n droppableId: id,\n scroll\n };\n });\n const result = {\n additions: added,\n removals: Object.keys(removals),\n modified: updated\n };\n staging = clean$1();\n finish();\n callbacks.publish(result);\n });\n };\n const add = entry => {\n const id = entry.descriptor.id;\n staging.additions[id] = entry;\n staging.modified[entry.descriptor.droppableId] = true;\n if (staging.removals[id]) {\n delete staging.removals[id];\n }\n collect();\n };\n const remove = entry => {\n const descriptor = entry.descriptor;\n staging.removals[descriptor.id] = true;\n staging.modified[descriptor.droppableId] = true;\n if (staging.additions[descriptor.id]) {\n delete staging.additions[descriptor.id];\n }\n collect();\n };\n const stop = () => {\n if (!frameId) {\n return;\n }\n cancelAnimationFrame(frameId);\n frameId = null;\n staging = clean$1();\n };\n return {\n add,\n remove,\n stop\n };\n}\n\nvar getMaxScroll = ({\n scrollHeight,\n scrollWidth,\n height,\n width\n}) => {\n const maxScroll = subtract({\n x: scrollWidth,\n y: scrollHeight\n }, {\n x: width,\n y: height\n });\n const adjustedMaxScroll = {\n x: Math.max(0, maxScroll.x),\n y: Math.max(0, maxScroll.y)\n };\n return adjustedMaxScroll;\n};\n\nvar getDocumentElement = () => {\n const doc = document.documentElement;\n !doc ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot find document.documentElement') : invariant() : void 0;\n return doc;\n};\n\nvar getMaxWindowScroll = () => {\n const doc = getDocumentElement();\n const maxScroll = getMaxScroll({\n scrollHeight: doc.scrollHeight,\n scrollWidth: doc.scrollWidth,\n width: doc.clientWidth,\n height: doc.clientHeight\n });\n return maxScroll;\n};\n\nvar getViewport = () => {\n const scroll = getWindowScroll();\n const maxScroll = getMaxWindowScroll();\n const top = scroll.y;\n const left = scroll.x;\n const doc = getDocumentElement();\n const width = doc.clientWidth;\n const height = doc.clientHeight;\n const right = left + width;\n const bottom = top + height;\n const frame = getRect({\n top,\n left,\n right,\n bottom\n });\n const viewport = {\n frame,\n scroll: {\n initial: scroll,\n current: scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin\n }\n }\n };\n return viewport;\n};\n\nvar getInitialPublish = ({\n critical,\n scrollOptions,\n registry\n}) => {\n start();\n const viewport = getViewport();\n const windowScroll = viewport.scroll.current;\n const home = critical.droppable;\n const droppables = registry.droppable.getAllByType(home.type).map(entry => entry.callbacks.getDimensionAndWatchScroll(windowScroll, scrollOptions));\n const draggables = registry.draggable.getAllByType(critical.draggable.type).map(entry => entry.getDimension(windowScroll));\n const dimensions = {\n draggables: toDraggableMap(draggables),\n droppables: toDroppableMap(droppables)\n };\n finish();\n const result = {\n dimensions,\n critical,\n viewport\n };\n return result;\n};\n\nfunction shouldPublishUpdate(registry, dragging, entry) {\n if (entry.descriptor.id === dragging.id) {\n return false;\n }\n if (entry.descriptor.type !== dragging.type) {\n return false;\n }\n const home = registry.droppable.getById(entry.descriptor.droppableId);\n if (home.descriptor.mode !== 'virtual') {\n process.env.NODE_ENV !== \"production\" ? warning(`\n You are attempting to add or remove a Draggable [id: ${entry.descriptor.id}]\n while a drag is occurring. This is only supported for virtual lists.\n\n See https://github.com/hello-pangea/dnd/blob/main/docs/patterns/virtual-lists.md\n `) : void 0;\n return false;\n }\n return true;\n}\nvar createDimensionMarshal = (registry, callbacks) => {\n let collection = null;\n const publisher = createPublisher({\n callbacks: {\n publish: callbacks.publishWhileDragging,\n collectionStarting: callbacks.collectionStarting\n },\n registry\n });\n const updateDroppableIsEnabled = (id, isEnabled) => {\n !registry.droppable.exists(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot update is enabled flag of Droppable ${id} as it is not registered`) : invariant() : void 0;\n if (!collection) {\n return;\n }\n callbacks.updateDroppableIsEnabled({\n id,\n isEnabled\n });\n };\n const updateDroppableIsCombineEnabled = (id, isCombineEnabled) => {\n if (!collection) {\n return;\n }\n !registry.droppable.exists(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot update isCombineEnabled flag of Droppable ${id} as it is not registered`) : invariant() : void 0;\n callbacks.updateDroppableIsCombineEnabled({\n id,\n isCombineEnabled\n });\n };\n const updateDroppableScroll = (id, newScroll) => {\n if (!collection) {\n return;\n }\n !registry.droppable.exists(id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot update the scroll on Droppable ${id} as it is not registered`) : invariant() : void 0;\n callbacks.updateDroppableScroll({\n id,\n newScroll\n });\n };\n const scrollDroppable = (id, change) => {\n if (!collection) {\n return;\n }\n registry.droppable.getById(id).callbacks.scroll(change);\n };\n const stopPublishing = () => {\n if (!collection) {\n return;\n }\n publisher.stop();\n const home = collection.critical.droppable;\n registry.droppable.getAllByType(home.type).forEach(entry => entry.callbacks.dragStopped());\n collection.unsubscribe();\n collection = null;\n };\n const subscriber = event => {\n !collection ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Should only be subscribed when a collection is occurring') : invariant() : void 0;\n const dragging = collection.critical.draggable;\n if (event.type === 'ADDITION') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.add(event.value);\n }\n }\n if (event.type === 'REMOVAL') {\n if (shouldPublishUpdate(registry, dragging, event.value)) {\n publisher.remove(event.value);\n }\n }\n };\n const startPublishing = request => {\n !!collection ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot start capturing critical dimensions as there is already a collection') : invariant() : void 0;\n const entry = registry.draggable.getById(request.draggableId);\n const home = registry.droppable.getById(entry.descriptor.droppableId);\n const critical = {\n draggable: entry.descriptor,\n droppable: home.descriptor\n };\n const unsubscribe = registry.subscribe(subscriber);\n collection = {\n critical,\n unsubscribe\n };\n return getInitialPublish({\n critical,\n registry,\n scrollOptions: request.scrollOptions\n });\n };\n const marshal = {\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n scrollDroppable,\n updateDroppableScroll,\n startPublishing,\n stopPublishing\n };\n return marshal;\n};\n\nvar canStartDrag = (state, id) => {\n if (state.phase === 'IDLE') {\n return true;\n }\n if (state.phase !== 'DROP_ANIMATING') {\n return false;\n }\n if (state.completed.result.draggableId === id) {\n return false;\n }\n return state.completed.result.reason === 'DROP';\n};\n\nvar scrollWindow = change => {\n window.scrollBy(change.x, change.y);\n};\n\nconst getScrollableDroppables = memoizeOne(droppables => toDroppableList(droppables).filter(droppable => {\n if (!droppable.isEnabled) {\n return false;\n }\n if (!droppable.frame) {\n return false;\n }\n return true;\n}));\nconst getScrollableDroppableOver = (target, droppables) => {\n const maybe = getScrollableDroppables(droppables).find(droppable => {\n !droppable.frame ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Invalid result') : invariant() : void 0;\n return isPositionInFrame(droppable.frame.pageMarginBox)(target);\n }) || null;\n return maybe;\n};\nvar getBestScrollableDroppable = ({\n center,\n destination,\n droppables\n}) => {\n if (destination) {\n const dimension = droppables[destination];\n if (!dimension.frame) {\n return null;\n }\n return dimension;\n }\n const dimension = getScrollableDroppableOver(center, droppables);\n return dimension;\n};\n\nconst defaultAutoScrollerOptions = {\n startFromPercentage: 0.25,\n maxScrollAtPercentage: 0.05,\n maxPixelScroll: 28,\n ease: percentage => percentage ** 2,\n durationDampening: {\n stopDampeningAt: 1200,\n accelerateAt: 360\n },\n disabled: false\n};\n\nvar getDistanceThresholds = (container, axis, getAutoScrollerOptions = () => defaultAutoScrollerOptions) => {\n const autoScrollerOptions = getAutoScrollerOptions();\n const startScrollingFrom = container[axis.size] * autoScrollerOptions.startFromPercentage;\n const maxScrollValueAt = container[axis.size] * autoScrollerOptions.maxScrollAtPercentage;\n const thresholds = {\n startScrollingFrom,\n maxScrollValueAt\n };\n return thresholds;\n};\n\nvar getPercentage = ({\n startOfRange,\n endOfRange,\n current\n}) => {\n const range = endOfRange - startOfRange;\n if (range === 0) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Detected distance range of 0 in the fluid auto scroller\n This is unexpected and would cause a divide by 0 issue.\n Not allowing an auto scroll\n `) : void 0;\n return 0;\n }\n const currentInRange = current - startOfRange;\n const percentage = currentInRange / range;\n return percentage;\n};\n\nvar minScroll = 1;\n\nvar getValueFromDistance = (distanceToEdge, thresholds, getAutoScrollerOptions = () => defaultAutoScrollerOptions) => {\n const autoScrollerOptions = getAutoScrollerOptions();\n if (distanceToEdge > thresholds.startScrollingFrom) {\n return 0;\n }\n if (distanceToEdge <= thresholds.maxScrollValueAt) {\n return autoScrollerOptions.maxPixelScroll;\n }\n if (distanceToEdge === thresholds.startScrollingFrom) {\n return minScroll;\n }\n const percentageFromMaxScrollValueAt = getPercentage({\n startOfRange: thresholds.maxScrollValueAt,\n endOfRange: thresholds.startScrollingFrom,\n current: distanceToEdge\n });\n const percentageFromStartScrollingFrom = 1 - percentageFromMaxScrollValueAt;\n const scroll = autoScrollerOptions.maxPixelScroll * autoScrollerOptions.ease(percentageFromStartScrollingFrom);\n return Math.ceil(scroll);\n};\n\nvar dampenValueByTime = (proposedScroll, dragStartTime, getAutoScrollerOptions) => {\n const autoScrollerOptions = getAutoScrollerOptions();\n const accelerateAt = autoScrollerOptions.durationDampening.accelerateAt;\n const stopAt = autoScrollerOptions.durationDampening.stopDampeningAt;\n const startOfRange = dragStartTime;\n const endOfRange = stopAt;\n const now = Date.now();\n const runTime = now - startOfRange;\n if (runTime >= stopAt) {\n return proposedScroll;\n }\n if (runTime < accelerateAt) {\n return minScroll;\n }\n const betweenAccelerateAtAndStopAtPercentage = getPercentage({\n startOfRange: accelerateAt,\n endOfRange,\n current: runTime\n });\n const scroll = proposedScroll * autoScrollerOptions.ease(betweenAccelerateAtAndStopAtPercentage);\n return Math.ceil(scroll);\n};\n\nvar getValue = ({\n distanceToEdge,\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const scroll = getValueFromDistance(distanceToEdge, thresholds, getAutoScrollerOptions);\n if (scroll === 0) {\n return 0;\n }\n if (!shouldUseTimeDampening) {\n return scroll;\n }\n return Math.max(dampenValueByTime(scroll, dragStartTime, getAutoScrollerOptions), minScroll);\n};\n\nvar getScrollOnAxis = ({\n container,\n distanceToEdges,\n dragStartTime,\n axis,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const thresholds = getDistanceThresholds(container, axis, getAutoScrollerOptions);\n const isCloserToEnd = distanceToEdges[axis.end] < distanceToEdges[axis.start];\n if (isCloserToEnd) {\n return getValue({\n distanceToEdge: distanceToEdges[axis.end],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n }\n return -1 * getValue({\n distanceToEdge: distanceToEdges[axis.start],\n thresholds,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n};\n\nvar adjustForSizeLimits = ({\n container,\n subject,\n proposedScroll\n}) => {\n const isTooBigVertically = subject.height > container.height;\n const isTooBigHorizontally = subject.width > container.width;\n if (!isTooBigHorizontally && !isTooBigVertically) {\n return proposedScroll;\n }\n if (isTooBigHorizontally && isTooBigVertically) {\n return null;\n }\n return {\n x: isTooBigHorizontally ? 0 : proposedScroll.x,\n y: isTooBigVertically ? 0 : proposedScroll.y\n };\n};\n\nconst clean = apply(value => value === 0 ? 0 : value);\nvar getScroll$1 = ({\n dragStartTime,\n container,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const distanceToEdges = {\n top: center.y - container.top,\n right: container.right - center.x,\n bottom: container.bottom - center.y,\n left: center.x - container.left\n };\n const y = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: vertical,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n const x = getScrollOnAxis({\n container,\n distanceToEdges,\n dragStartTime,\n axis: horizontal,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n const required = clean({\n x,\n y\n });\n if (isEqual$1(required, origin)) {\n return null;\n }\n const limited = adjustForSizeLimits({\n container,\n subject,\n proposedScroll: required\n });\n if (!limited) {\n return null;\n }\n return isEqual$1(limited, origin) ? null : limited;\n};\n\nconst smallestSigned = apply(value => {\n if (value === 0) {\n return 0;\n }\n return value > 0 ? 1 : -1;\n});\nconst getOverlap = (() => {\n const getRemainder = (target, max) => {\n if (target < 0) {\n return target;\n }\n if (target > max) {\n return target - max;\n }\n return 0;\n };\n return ({\n current,\n max,\n change\n }) => {\n const targetScroll = add(current, change);\n const overlap = {\n x: getRemainder(targetScroll.x, max.x),\n y: getRemainder(targetScroll.y, max.y)\n };\n if (isEqual$1(overlap, origin)) {\n return null;\n }\n return overlap;\n };\n})();\nconst canPartiallyScroll = ({\n max: rawMax,\n current,\n change\n}) => {\n const max = {\n x: Math.max(current.x, rawMax.x),\n y: Math.max(current.y, rawMax.y)\n };\n const smallestChange = smallestSigned(change);\n const overlap = getOverlap({\n max,\n current,\n change: smallestChange\n });\n if (!overlap) {\n return true;\n }\n if (smallestChange.x !== 0 && overlap.x === 0) {\n return true;\n }\n if (smallestChange.y !== 0 && overlap.y === 0) {\n return true;\n }\n return false;\n};\nconst canScrollWindow = (viewport, change) => canPartiallyScroll({\n current: viewport.scroll.current,\n max: viewport.scroll.max,\n change\n});\nconst getWindowOverlap = (viewport, change) => {\n if (!canScrollWindow(viewport, change)) {\n return null;\n }\n const max = viewport.scroll.max;\n const current = viewport.scroll.current;\n return getOverlap({\n current,\n max,\n change\n });\n};\nconst canScrollDroppable = (droppable, change) => {\n const frame = droppable.frame;\n if (!frame) {\n return false;\n }\n return canPartiallyScroll({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change\n });\n};\nconst getDroppableOverlap = (droppable, change) => {\n const frame = droppable.frame;\n if (!frame) {\n return null;\n }\n if (!canScrollDroppable(droppable, change)) {\n return null;\n }\n return getOverlap({\n current: frame.scroll.current,\n max: frame.scroll.max,\n change\n });\n};\n\nvar getWindowScrollChange = ({\n viewport,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const scroll = getScroll$1({\n dragStartTime,\n container: viewport.frame,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n return scroll && canScrollWindow(viewport, scroll) ? scroll : null;\n};\n\nvar getDroppableScrollChange = ({\n droppable,\n subject,\n center,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n}) => {\n const frame = droppable.frame;\n if (!frame) {\n return null;\n }\n const scroll = getScroll$1({\n dragStartTime,\n container: frame.pageMarginBox,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n return scroll && canScrollDroppable(droppable, scroll) ? scroll : null;\n};\n\nvar scroll = ({\n state,\n dragStartTime,\n shouldUseTimeDampening,\n scrollWindow,\n scrollDroppable,\n getAutoScrollerOptions\n}) => {\n const center = state.current.page.borderBoxCenter;\n const draggable = state.dimensions.draggables[state.critical.draggable.id];\n const subject = draggable.page.marginBox;\n if (state.isWindowScrollAllowed) {\n const viewport = state.viewport;\n const change = getWindowScrollChange({\n dragStartTime,\n viewport,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n if (change) {\n scrollWindow(change);\n return;\n }\n }\n const droppable = getBestScrollableDroppable({\n center,\n destination: whatIsDraggedOver(state.impact),\n droppables: state.dimensions.droppables\n });\n if (!droppable) {\n return;\n }\n const change = getDroppableScrollChange({\n dragStartTime,\n droppable,\n subject,\n center,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n if (change) {\n scrollDroppable(droppable.descriptor.id, change);\n }\n};\n\nvar createFluidScroller = ({\n scrollWindow,\n scrollDroppable,\n getAutoScrollerOptions = () => defaultAutoScrollerOptions\n}) => {\n const scheduleWindowScroll = rafSchd(scrollWindow);\n const scheduleDroppableScroll = rafSchd(scrollDroppable);\n let dragging = null;\n const tryScroll = state => {\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot fluid scroll if not dragging') : invariant() : void 0;\n const {\n shouldUseTimeDampening,\n dragStartTime\n } = dragging;\n scroll({\n state,\n scrollWindow: scheduleWindowScroll,\n scrollDroppable: scheduleDroppableScroll,\n dragStartTime,\n shouldUseTimeDampening,\n getAutoScrollerOptions\n });\n };\n const start$1 = state => {\n start();\n !!dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot start auto scrolling when already started') : invariant() : void 0;\n const dragStartTime = Date.now();\n let wasScrollNeeded = false;\n const fakeScrollCallback = () => {\n wasScrollNeeded = true;\n };\n scroll({\n state,\n dragStartTime: 0,\n shouldUseTimeDampening: false,\n scrollWindow: fakeScrollCallback,\n scrollDroppable: fakeScrollCallback,\n getAutoScrollerOptions\n });\n dragging = {\n dragStartTime,\n shouldUseTimeDampening: wasScrollNeeded\n };\n finish();\n if (wasScrollNeeded) {\n tryScroll(state);\n }\n };\n const stop = () => {\n if (!dragging) {\n return;\n }\n scheduleWindowScroll.cancel();\n scheduleDroppableScroll.cancel();\n dragging = null;\n };\n return {\n start: start$1,\n stop,\n scroll: tryScroll\n };\n};\n\nvar createJumpScroller = ({\n move,\n scrollDroppable,\n scrollWindow\n}) => {\n const moveByOffset = (state, offset) => {\n const client = add(state.current.client.selection, offset);\n move({\n client\n });\n };\n const scrollDroppableAsMuchAsItCan = (droppable, change) => {\n if (!canScrollDroppable(droppable, change)) {\n return change;\n }\n const overlap = getDroppableOverlap(droppable, change);\n if (!overlap) {\n scrollDroppable(droppable.descriptor.id, change);\n return null;\n }\n const whatTheDroppableCanScroll = subtract(change, overlap);\n scrollDroppable(droppable.descriptor.id, whatTheDroppableCanScroll);\n const remainder = subtract(change, whatTheDroppableCanScroll);\n return remainder;\n };\n const scrollWindowAsMuchAsItCan = (isWindowScrollAllowed, viewport, change) => {\n if (!isWindowScrollAllowed) {\n return change;\n }\n if (!canScrollWindow(viewport, change)) {\n return change;\n }\n const overlap = getWindowOverlap(viewport, change);\n if (!overlap) {\n scrollWindow(change);\n return null;\n }\n const whatTheWindowCanScroll = subtract(change, overlap);\n scrollWindow(whatTheWindowCanScroll);\n const remainder = subtract(change, whatTheWindowCanScroll);\n return remainder;\n };\n const jumpScroller = state => {\n const request = state.scrollJumpRequest;\n if (!request) {\n return;\n }\n const destination = whatIsDraggedOver(state.impact);\n !destination ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot perform a jump scroll when there is no destination') : invariant() : void 0;\n const droppableRemainder = scrollDroppableAsMuchAsItCan(state.dimensions.droppables[destination], request);\n if (!droppableRemainder) {\n return;\n }\n const viewport = state.viewport;\n const windowRemainder = scrollWindowAsMuchAsItCan(state.isWindowScrollAllowed, viewport, droppableRemainder);\n if (!windowRemainder) {\n return;\n }\n moveByOffset(state, windowRemainder);\n };\n return jumpScroller;\n};\n\nvar createAutoScroller = ({\n scrollDroppable,\n scrollWindow,\n move,\n getAutoScrollerOptions\n}) => {\n const fluidScroller = createFluidScroller({\n scrollWindow,\n scrollDroppable,\n getAutoScrollerOptions\n });\n const jumpScroll = createJumpScroller({\n move,\n scrollWindow,\n scrollDroppable\n });\n const scroll = state => {\n const autoScrollerOptions = getAutoScrollerOptions();\n if (autoScrollerOptions.disabled || state.phase !== 'DRAGGING') {\n return;\n }\n if (state.movementMode === 'FLUID') {\n fluidScroller.scroll(state);\n return;\n }\n if (!state.scrollJumpRequest) {\n return;\n }\n jumpScroll(state);\n };\n const scroller = {\n scroll,\n start: fluidScroller.start,\n stop: fluidScroller.stop\n };\n return scroller;\n};\n\nconst prefix = 'data-rfd';\nconst dragHandle = (() => {\n const base = `${prefix}-drag-handle`;\n return {\n base,\n draggableId: `${base}-draggable-id`,\n contextId: `${base}-context-id`\n };\n})();\nconst draggable = (() => {\n const base = `${prefix}-draggable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`\n };\n})();\nconst droppable = (() => {\n const base = `${prefix}-droppable`;\n return {\n base,\n contextId: `${base}-context-id`,\n id: `${base}-id`\n };\n})();\nconst scrollContainer = {\n contextId: `${prefix}-scroll-container-context-id`\n};\n\nconst makeGetSelector = context => attribute => `[${attribute}=\"${context}\"]`;\nconst getStyles = (rules, property) => rules.map(rule => {\n const value = rule.styles[property];\n if (!value) {\n return '';\n }\n return `${rule.selector} { ${value} }`;\n}).join(' ');\nconst noPointerEvents = 'pointer-events: none;';\nvar getStyles$1 = contextId => {\n const getSelector = makeGetSelector(contextId);\n const dragHandle$1 = (() => {\n const grabCursor = `\n cursor: -webkit-grab;\n cursor: grab;\n `;\n return {\n selector: getSelector(dragHandle.contextId),\n styles: {\n always: `\n -webkit-touch-callout: none;\n -webkit-tap-highlight-color: rgba(0,0,0,0);\n touch-action: manipulation;\n `,\n resting: grabCursor,\n dragging: noPointerEvents,\n dropAnimating: grabCursor\n }\n };\n })();\n const draggable$1 = (() => {\n const transition = `\n transition: ${transitions.outOfTheWay};\n `;\n return {\n selector: getSelector(draggable.contextId),\n styles: {\n dragging: transition,\n dropAnimating: transition,\n userCancel: transition\n }\n };\n })();\n const droppable$1 = {\n selector: getSelector(droppable.contextId),\n styles: {\n always: `overflow-anchor: none;`\n }\n };\n const body = {\n selector: 'body',\n styles: {\n dragging: `\n cursor: grabbing;\n cursor: -webkit-grabbing;\n user-select: none;\n -webkit-user-select: none;\n -moz-user-select: none;\n -ms-user-select: none;\n overflow-anchor: none;\n `\n }\n };\n const rules = [draggable$1, dragHandle$1, droppable$1, body];\n return {\n always: getStyles(rules, 'always'),\n resting: getStyles(rules, 'resting'),\n dragging: getStyles(rules, 'dragging'),\n dropAnimating: getStyles(rules, 'dropAnimating'),\n userCancel: getStyles(rules, 'userCancel')\n };\n};\n\nconst useIsomorphicLayoutEffect = typeof window !== 'undefined' && typeof window.document !== 'undefined' && typeof window.document.createElement !== 'undefined' ? useLayoutEffect : useEffect;\n\nconst getHead = () => {\n const head = document.querySelector('head');\n !head ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot find the head to append a style to') : invariant() : void 0;\n return head;\n};\nconst createStyleEl = nonce => {\n const el = document.createElement('style');\n if (nonce) {\n el.setAttribute('nonce', nonce);\n }\n el.type = 'text/css';\n return el;\n};\nfunction useStyleMarshal(contextId, nonce) {\n const styles = useMemo(() => getStyles$1(contextId), [contextId]);\n const alwaysRef = useRef(null);\n const dynamicRef = useRef(null);\n const setDynamicStyle = useCallback(memoizeOne(proposed => {\n const el = dynamicRef.current;\n !el ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot set dynamic style element if it is not set') : invariant() : void 0;\n el.textContent = proposed;\n }), []);\n const setAlwaysStyle = useCallback(proposed => {\n const el = alwaysRef.current;\n !el ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot set dynamic style element if it is not set') : invariant() : void 0;\n el.textContent = proposed;\n }, []);\n useIsomorphicLayoutEffect(() => {\n !(!alwaysRef.current && !dynamicRef.current) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'style elements already mounted') : invariant() : void 0;\n const always = createStyleEl(nonce);\n const dynamic = createStyleEl(nonce);\n alwaysRef.current = always;\n dynamicRef.current = dynamic;\n always.setAttribute(`${prefix}-always`, contextId);\n dynamic.setAttribute(`${prefix}-dynamic`, contextId);\n getHead().appendChild(always);\n getHead().appendChild(dynamic);\n setAlwaysStyle(styles.always);\n setDynamicStyle(styles.resting);\n return () => {\n const remove = ref => {\n const current = ref.current;\n !current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot unmount ref as it is not set') : invariant() : void 0;\n getHead().removeChild(current);\n ref.current = null;\n };\n remove(alwaysRef);\n remove(dynamicRef);\n };\n }, [nonce, setAlwaysStyle, setDynamicStyle, styles.always, styles.resting, contextId]);\n const dragging = useCallback(() => setDynamicStyle(styles.dragging), [setDynamicStyle, styles.dragging]);\n const dropping = useCallback(reason => {\n if (reason === 'DROP') {\n setDynamicStyle(styles.dropAnimating);\n return;\n }\n setDynamicStyle(styles.userCancel);\n }, [setDynamicStyle, styles.dropAnimating, styles.userCancel]);\n const resting = useCallback(() => {\n if (!dynamicRef.current) {\n return;\n }\n setDynamicStyle(styles.resting);\n }, [setDynamicStyle, styles.resting]);\n const marshal = useMemo(() => ({\n dragging,\n dropping,\n resting\n }), [dragging, dropping, resting]);\n return marshal;\n}\n\nfunction querySelectorAll(parentNode, selector) {\n return Array.from(parentNode.querySelectorAll(selector));\n}\n\nvar getWindowFromEl = el => {\n if (el && el.ownerDocument && el.ownerDocument.defaultView) {\n return el.ownerDocument.defaultView;\n }\n return window;\n};\n\nfunction isHtmlElement(el) {\n return el instanceof getWindowFromEl(el).HTMLElement;\n}\n\nfunction findDragHandle(contextId, draggableId) {\n const selector = `[${dragHandle.contextId}=\"${contextId}\"]`;\n const possible = querySelectorAll(document, selector);\n if (!possible.length) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find any drag handles in the context \"${contextId}\"`) : void 0;\n return null;\n }\n const handle = possible.find(el => {\n return el.getAttribute(dragHandle.draggableId) === draggableId;\n });\n if (!handle) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find drag handle with id \"${draggableId}\" as no handle with a matching id was found`) : void 0;\n return null;\n }\n if (!isHtmlElement(handle)) {\n process.env.NODE_ENV !== \"production\" ? warning('drag handle needs to be a HTMLElement') : void 0;\n return null;\n }\n return handle;\n}\n\nfunction useFocusMarshal(contextId) {\n const entriesRef = useRef({});\n const recordRef = useRef(null);\n const restoreFocusFrameRef = useRef(null);\n const isMountedRef = useRef(false);\n const register = useCallback(function register(id, focus) {\n const entry = {\n id,\n focus\n };\n entriesRef.current[id] = entry;\n return function unregister() {\n const entries = entriesRef.current;\n const current = entries[id];\n if (current !== entry) {\n delete entries[id];\n }\n };\n }, []);\n const tryGiveFocus = useCallback(function tryGiveFocus(tryGiveFocusTo) {\n const handle = findDragHandle(contextId, tryGiveFocusTo);\n if (handle && handle !== document.activeElement) {\n handle.focus();\n }\n }, [contextId]);\n const tryShiftRecord = useCallback(function tryShiftRecord(previous, redirectTo) {\n if (recordRef.current === previous) {\n recordRef.current = redirectTo;\n }\n }, []);\n const tryRestoreFocusRecorded = useCallback(function tryRestoreFocusRecorded() {\n if (restoreFocusFrameRef.current) {\n return;\n }\n if (!isMountedRef.current) {\n return;\n }\n restoreFocusFrameRef.current = requestAnimationFrame(() => {\n restoreFocusFrameRef.current = null;\n const record = recordRef.current;\n if (record) {\n tryGiveFocus(record);\n }\n });\n }, [tryGiveFocus]);\n const tryRecordFocus = useCallback(function tryRecordFocus(id) {\n recordRef.current = null;\n const focused = document.activeElement;\n if (!focused) {\n return;\n }\n if (focused.getAttribute(dragHandle.draggableId) !== id) {\n return;\n }\n recordRef.current = id;\n }, []);\n useIsomorphicLayoutEffect(() => {\n isMountedRef.current = true;\n return function clearFrameOnUnmount() {\n isMountedRef.current = false;\n const frameId = restoreFocusFrameRef.current;\n if (frameId) {\n cancelAnimationFrame(frameId);\n }\n };\n }, []);\n const marshal = useMemo(() => ({\n register,\n tryRecordFocus,\n tryRestoreFocusRecorded,\n tryShiftRecord\n }), [register, tryRecordFocus, tryRestoreFocusRecorded, tryShiftRecord]);\n return marshal;\n}\n\nfunction createRegistry() {\n const entries = {\n draggables: {},\n droppables: {}\n };\n const subscribers = [];\n function subscribe(cb) {\n subscribers.push(cb);\n return function unsubscribe() {\n const index = subscribers.indexOf(cb);\n if (index === -1) {\n return;\n }\n subscribers.splice(index, 1);\n };\n }\n function notify(event) {\n if (subscribers.length) {\n subscribers.forEach(cb => cb(event));\n }\n }\n function findDraggableById(id) {\n return entries.draggables[id] || null;\n }\n function getDraggableById(id) {\n const entry = findDraggableById(id);\n !entry ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find draggable entry with id [${id}]`) : invariant() : void 0;\n return entry;\n }\n const draggableAPI = {\n register: entry => {\n entries.draggables[entry.descriptor.id] = entry;\n notify({\n type: 'ADDITION',\n value: entry\n });\n },\n update: (entry, last) => {\n const current = entries.draggables[last.descriptor.id];\n if (!current) {\n return;\n }\n if (current.uniqueId !== entry.uniqueId) {\n return;\n }\n delete entries.draggables[last.descriptor.id];\n entries.draggables[entry.descriptor.id] = entry;\n },\n unregister: entry => {\n const draggableId = entry.descriptor.id;\n const current = findDraggableById(draggableId);\n if (!current) {\n return;\n }\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n delete entries.draggables[draggableId];\n if (entries.droppables[entry.descriptor.droppableId]) {\n notify({\n type: 'REMOVAL',\n value: entry\n });\n }\n },\n getById: getDraggableById,\n findById: findDraggableById,\n exists: id => Boolean(findDraggableById(id)),\n getAllByType: type => Object.values(entries.draggables).filter(entry => entry.descriptor.type === type)\n };\n function findDroppableById(id) {\n return entries.droppables[id] || null;\n }\n function getDroppableById(id) {\n const entry = findDroppableById(id);\n !entry ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot find droppable entry with id [${id}]`) : invariant() : void 0;\n return entry;\n }\n const droppableAPI = {\n register: entry => {\n entries.droppables[entry.descriptor.id] = entry;\n },\n unregister: entry => {\n const current = findDroppableById(entry.descriptor.id);\n if (!current) {\n return;\n }\n if (entry.uniqueId !== current.uniqueId) {\n return;\n }\n delete entries.droppables[entry.descriptor.id];\n },\n getById: getDroppableById,\n findById: findDroppableById,\n exists: id => Boolean(findDroppableById(id)),\n getAllByType: type => Object.values(entries.droppables).filter(entry => entry.descriptor.type === type)\n };\n function clean() {\n entries.draggables = {};\n entries.droppables = {};\n subscribers.length = 0;\n }\n return {\n draggable: draggableAPI,\n droppable: droppableAPI,\n subscribe,\n clean\n };\n}\n\nfunction useRegistry() {\n const registry = useMemo(createRegistry, []);\n useEffect(() => {\n return function unmount() {\n registry.clean();\n };\n }, [registry]);\n return registry;\n}\n\nvar StoreContext = React.createContext(null);\n\nvar getBodyElement = () => {\n const body = document.body;\n !body ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot find document.body') : invariant() : void 0;\n return body;\n};\n\nconst visuallyHidden = {\n position: 'absolute',\n width: '1px',\n height: '1px',\n margin: '-1px',\n border: '0',\n padding: '0',\n overflow: 'hidden',\n clip: 'rect(0 0 0 0)',\n 'clip-path': 'inset(100%)'\n};\n\nconst getId = contextId => `rfd-announcement-${contextId}`;\nfunction useAnnouncer(contextId) {\n const id = useMemo(() => getId(contextId), [contextId]);\n const ref = useRef(null);\n useEffect(function setup() {\n const el = document.createElement('div');\n ref.current = el;\n el.id = id;\n el.setAttribute('aria-live', 'assertive');\n el.setAttribute('aria-atomic', 'true');\n _extends(el.style, visuallyHidden);\n getBodyElement().appendChild(el);\n return function cleanup() {\n setTimeout(function remove() {\n const body = getBodyElement();\n if (body.contains(el)) {\n body.removeChild(el);\n }\n if (el === ref.current) {\n ref.current = null;\n }\n });\n };\n }, [id]);\n const announce = useCallback(message => {\n const el = ref.current;\n if (el) {\n el.textContent = message;\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n A screen reader message was trying to be announced but it was unable to do so.\n This can occur if you unmount your <DragDropContext /> in your onDragEnd.\n Consider calling provided.announce() before the unmount so that the instruction will\n not be lost for users relying on a screen reader.\n\n Message not passed to screen reader:\n\n \"${message}\"\n `) : void 0;\n }, []);\n return announce;\n}\n\nconst defaults = {\n separator: '::'\n};\nfunction useUniqueId(prefix, options = defaults) {\n const id = React.useId();\n return useMemo(() => `${prefix}${options.separator}${id}`, [options.separator, prefix, id]);\n}\n\nfunction getElementId({\n contextId,\n uniqueId\n}) {\n return `rfd-hidden-text-${contextId}-${uniqueId}`;\n}\nfunction useHiddenTextElement({\n contextId,\n text\n}) {\n const uniqueId = useUniqueId('hidden-text', {\n separator: '-'\n });\n const id = useMemo(() => getElementId({\n contextId,\n uniqueId\n }), [uniqueId, contextId]);\n useEffect(function mount() {\n const el = document.createElement('div');\n el.id = id;\n el.textContent = text;\n el.style.display = 'none';\n getBodyElement().appendChild(el);\n return function unmount() {\n const body = getBodyElement();\n if (body.contains(el)) {\n body.removeChild(el);\n }\n };\n }, [id, text]);\n return id;\n}\n\nvar AppContext = React.createContext(null);\n\nvar peerDependencies = {\n\treact: \"^18.0.0 || ^19.0.0\"};\n\nconst semver = /(\\d+)\\.(\\d+)\\.(\\d+)/;\nconst getVersion = value => {\n const result = semver.exec(value);\n !(result != null) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Unable to parse React version ${value}`) : invariant() : void 0;\n const major = Number(result[1]);\n const minor = Number(result[2]);\n const patch = Number(result[3]);\n return {\n major,\n minor,\n patch,\n raw: value\n };\n};\nconst isSatisfied = (expected, actual) => {\n if (actual.major > expected.major) {\n return true;\n }\n if (actual.major < expected.major) {\n return false;\n }\n if (actual.minor > expected.minor) {\n return true;\n }\n if (actual.minor < expected.minor) {\n return false;\n }\n return actual.patch >= expected.patch;\n};\nvar checkReactVersion = (peerDepValue, actualValue) => {\n const peerDep = getVersion(peerDepValue);\n const actual = getVersion(actualValue);\n if (isSatisfied(peerDep, actual)) {\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n React version: [${actual.raw}]\n does not satisfy expected peer dependency version: [${peerDep.raw}]\n\n This can result in run time bugs, and even fatal crashes\n `) : void 0;\n};\n\nconst suffix = `\n We expect a html5 doctype: <!doctype html>\n This is to ensure consistent browser layout and measurement\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/doctype.md\n`;\nvar checkDoctype = doc => {\n const doctype = doc.doctype;\n if (!doctype) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n No <!doctype html> found.\n\n ${suffix}\n `) : void 0;\n return;\n }\n if (doctype.name.toLowerCase() !== 'html') {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Unexpected <!doctype> found: (${doctype.name})\n\n ${suffix}\n `) : void 0;\n }\n if (doctype.publicId !== '') {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Unexpected <!doctype> publicId found: (${doctype.publicId})\n A html5 doctype does not have a publicId\n\n ${suffix}\n `) : void 0;\n }\n};\n\nfunction useDev(useHook) {\n if (process.env.NODE_ENV !== 'production') {\n useHook();\n }\n}\n\nfunction useDevSetupWarning(fn, inputs) {\n useDev(() => {\n useEffect(() => {\n try {\n fn();\n } catch (e) {\n error(`\n A setup problem was encountered.\n\n > ${e.message}\n `);\n }\n }, inputs);\n });\n}\n\nfunction useStartupValidation() {\n useDevSetupWarning(() => {\n checkReactVersion(peerDependencies.react, React.version);\n checkDoctype(document);\n }, []);\n}\n\nfunction usePrevious(current) {\n const ref = useRef(current);\n useEffect(() => {\n ref.current = current;\n });\n return ref;\n}\n\nfunction create() {\n let lock = null;\n function isClaimed() {\n return Boolean(lock);\n }\n function isActive(value) {\n return value === lock;\n }\n function claim(abandon) {\n !!lock ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot claim lock as it is already claimed') : invariant() : void 0;\n const newLock = {\n abandon\n };\n lock = newLock;\n return newLock;\n }\n function release() {\n !lock ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot release lock when there is no lock') : invariant() : void 0;\n lock = null;\n }\n function tryAbandon() {\n if (lock) {\n lock.abandon();\n release();\n }\n }\n return {\n isClaimed,\n isActive,\n claim,\n release,\n tryAbandon\n };\n}\n\nfunction isDragging(state) {\n if (state.phase === 'IDLE' || state.phase === 'DROP_ANIMATING') {\n return false;\n }\n return state.isDragging;\n}\n\nconst tab = 9;\nconst enter = 13;\nconst escape = 27;\nconst space = 32;\nconst pageUp = 33;\nconst pageDown = 34;\nconst end = 35;\nconst home = 36;\nconst arrowLeft = 37;\nconst arrowUp = 38;\nconst arrowRight = 39;\nconst arrowDown = 40;\n\nconst preventedKeys = {\n [enter]: true,\n [tab]: true\n};\nvar preventStandardKeyEvents = event => {\n if (preventedKeys[event.keyCode]) {\n event.preventDefault();\n }\n};\n\nconst supportedEventName = (() => {\n const base = 'visibilitychange';\n if (typeof document === 'undefined') {\n return base;\n }\n const candidates = [base, `ms${base}`, `webkit${base}`, `moz${base}`, `o${base}`];\n const supported = candidates.find(eventName => `on${eventName}` in document);\n return supported || base;\n})();\n\nconst primaryButton = 0;\nconst sloppyClickThreshold = 5;\nfunction isSloppyClickThresholdExceeded(original, current) {\n return Math.abs(current.x - original.x) >= sloppyClickThreshold || Math.abs(current.y - original.y) >= sloppyClickThreshold;\n}\nconst idle$1 = {\n type: 'IDLE'\n};\nfunction getCaptureBindings({\n cancel,\n completed,\n getPhase,\n setPhase\n}) {\n return [{\n eventName: 'mousemove',\n fn: event => {\n const {\n button,\n clientX,\n clientY\n } = event;\n if (button !== primaryButton) {\n return;\n }\n const point = {\n x: clientX,\n y: clientY\n };\n const phase = getPhase();\n if (phase.type === 'DRAGGING') {\n event.preventDefault();\n phase.actions.move(point);\n return;\n }\n !(phase.type === 'PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot be IDLE') : invariant() : void 0;\n const pending = phase.point;\n if (!isSloppyClickThresholdExceeded(pending, point)) {\n return;\n }\n event.preventDefault();\n const actions = phase.actions.fluidLift(point);\n setPhase({\n type: 'DRAGGING',\n actions\n });\n }\n }, {\n eventName: 'mouseup',\n fn: event => {\n const phase = getPhase();\n if (phase.type !== 'DRAGGING') {\n cancel();\n return;\n }\n event.preventDefault();\n phase.actions.drop({\n shouldBlockNextClick: true\n });\n completed();\n }\n }, {\n eventName: 'mousedown',\n fn: event => {\n if (getPhase().type === 'DRAGGING') {\n event.preventDefault();\n }\n cancel();\n }\n }, {\n eventName: 'keydown',\n fn: event => {\n const phase = getPhase();\n if (phase.type === 'PENDING') {\n cancel();\n return;\n }\n if (event.keyCode === escape) {\n event.preventDefault();\n cancel();\n return;\n }\n preventStandardKeyEvents(event);\n }\n }, {\n eventName: 'resize',\n fn: cancel\n }, {\n eventName: 'scroll',\n options: {\n passive: true,\n capture: false\n },\n fn: () => {\n if (getPhase().type === 'PENDING') {\n cancel();\n }\n }\n }, {\n eventName: 'webkitmouseforcedown',\n fn: event => {\n const phase = getPhase();\n !(phase.type !== 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Unexpected phase') : invariant() : void 0;\n if (phase.actions.shouldRespectForcePress()) {\n cancel();\n return;\n }\n event.preventDefault();\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction useMouseSensor(api) {\n const phaseRef = useRef(idle$1);\n const unbindEventsRef = useRef(noop$2);\n const startCaptureBinding = useMemo(() => ({\n eventName: 'mousedown',\n fn: function onMouseDown(event) {\n if (event.defaultPrevented) {\n return;\n }\n if (event.button !== primaryButton) {\n return;\n }\n if (event.ctrlKey || event.metaKey || event.shiftKey || event.altKey) {\n return;\n }\n const draggableId = api.findClosestDraggableId(event);\n if (!draggableId) {\n return;\n }\n const actions = api.tryGetLock(draggableId, stop, {\n sourceEvent: event\n });\n if (!actions) {\n return;\n }\n event.preventDefault();\n const point = {\n x: event.clientX,\n y: event.clientY\n };\n unbindEventsRef.current();\n startPendingDrag(actions, point);\n }\n }), [api]);\n const preventForcePressBinding = useMemo(() => ({\n eventName: 'webkitmouseforcewillbegin',\n fn: event => {\n if (event.defaultPrevented) {\n return;\n }\n const id = api.findClosestDraggableId(event);\n if (!id) {\n return;\n }\n const options = api.findOptionsForDraggable(id);\n if (!options) {\n return;\n }\n if (options.shouldRespectForcePress) {\n return;\n }\n if (!api.canGetLock(id)) {\n return;\n }\n event.preventDefault();\n }\n }), [api]);\n const listenForCapture = useCallback(function listenForCapture() {\n const options = {\n passive: false,\n capture: true\n };\n unbindEventsRef.current = bindEvents(window, [preventForcePressBinding, startCaptureBinding], options);\n }, [preventForcePressBinding, startCaptureBinding]);\n const stop = useCallback(() => {\n const current = phaseRef.current;\n if (current.type === 'IDLE') {\n return;\n }\n phaseRef.current = idle$1;\n unbindEventsRef.current();\n listenForCapture();\n }, [listenForCapture]);\n const cancel = useCallback(() => {\n const phase = phaseRef.current;\n stop();\n if (phase.type === 'DRAGGING') {\n phase.actions.cancel({\n shouldBlockNextClick: true\n });\n }\n if (phase.type === 'PENDING') {\n phase.actions.abort();\n }\n }, [stop]);\n const bindCapturingEvents = useCallback(function bindCapturingEvents() {\n const options = {\n capture: true,\n passive: false\n };\n const bindings = getCaptureBindings({\n cancel,\n completed: stop,\n getPhase: () => phaseRef.current,\n setPhase: phase => {\n phaseRef.current = phase;\n }\n });\n unbindEventsRef.current = bindEvents(window, bindings, options);\n }, [cancel, stop]);\n const startPendingDrag = useCallback(function startPendingDrag(actions, point) {\n !(phaseRef.current.type === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected to move from IDLE to PENDING drag') : invariant() : void 0;\n phaseRef.current = {\n type: 'PENDING',\n point,\n actions\n };\n bindCapturingEvents();\n }, [bindCapturingEvents]);\n useIsomorphicLayoutEffect(function mount() {\n listenForCapture();\n return function unmount() {\n unbindEventsRef.current();\n };\n }, [listenForCapture]);\n}\n\nfunction noop$1() {}\nconst scrollJumpKeys = {\n [pageDown]: true,\n [pageUp]: true,\n [home]: true,\n [end]: true\n};\nfunction getDraggingBindings(actions, stop) {\n function cancel() {\n stop();\n actions.cancel();\n }\n function drop() {\n stop();\n actions.drop();\n }\n return [{\n eventName: 'keydown',\n fn: event => {\n if (event.keyCode === escape) {\n event.preventDefault();\n cancel();\n return;\n }\n if (event.keyCode === space) {\n event.preventDefault();\n drop();\n return;\n }\n if (event.keyCode === arrowDown) {\n event.preventDefault();\n actions.moveDown();\n return;\n }\n if (event.keyCode === arrowUp) {\n event.preventDefault();\n actions.moveUp();\n return;\n }\n if (event.keyCode === arrowRight) {\n event.preventDefault();\n actions.moveRight();\n return;\n }\n if (event.keyCode === arrowLeft) {\n event.preventDefault();\n actions.moveLeft();\n return;\n }\n if (scrollJumpKeys[event.keyCode]) {\n event.preventDefault();\n return;\n }\n preventStandardKeyEvents(event);\n }\n }, {\n eventName: 'mousedown',\n fn: cancel\n }, {\n eventName: 'mouseup',\n fn: cancel\n }, {\n eventName: 'click',\n fn: cancel\n }, {\n eventName: 'touchstart',\n fn: cancel\n }, {\n eventName: 'resize',\n fn: cancel\n }, {\n eventName: 'wheel',\n fn: cancel,\n options: {\n passive: true\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction useKeyboardSensor(api) {\n const unbindEventsRef = useRef(noop$1);\n const startCaptureBinding = useMemo(() => ({\n eventName: 'keydown',\n fn: function onKeyDown(event) {\n if (event.defaultPrevented) {\n return;\n }\n if (event.keyCode !== space) {\n return;\n }\n const draggableId = api.findClosestDraggableId(event);\n if (!draggableId) {\n return;\n }\n const preDrag = api.tryGetLock(draggableId, stop, {\n sourceEvent: event\n });\n if (!preDrag) {\n return;\n }\n event.preventDefault();\n let isCapturing = true;\n const actions = preDrag.snapLift();\n unbindEventsRef.current();\n function stop() {\n !isCapturing ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot stop capturing a keyboard drag when not capturing') : invariant() : void 0;\n isCapturing = false;\n unbindEventsRef.current();\n listenForCapture();\n }\n unbindEventsRef.current = bindEvents(window, getDraggingBindings(actions, stop), {\n capture: true,\n passive: false\n });\n }\n }), [api]);\n const listenForCapture = useCallback(function tryStartCapture() {\n const options = {\n passive: false,\n capture: true\n };\n unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);\n }, [startCaptureBinding]);\n useIsomorphicLayoutEffect(function mount() {\n listenForCapture();\n return function unmount() {\n unbindEventsRef.current();\n };\n }, [listenForCapture]);\n}\n\nconst idle = {\n type: 'IDLE'\n};\nconst timeForLongPress = 120;\nconst forcePressThreshold = 0.15;\nfunction getWindowBindings({\n cancel,\n getPhase\n}) {\n return [{\n eventName: 'orientationchange',\n fn: cancel\n }, {\n eventName: 'resize',\n fn: cancel\n }, {\n eventName: 'contextmenu',\n fn: event => {\n event.preventDefault();\n }\n }, {\n eventName: 'keydown',\n fn: event => {\n if (getPhase().type !== 'DRAGGING') {\n cancel();\n return;\n }\n if (event.keyCode === escape) {\n event.preventDefault();\n }\n cancel();\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction getHandleBindings({\n cancel,\n completed,\n getPhase\n}) {\n return [{\n eventName: 'touchmove',\n options: {\n capture: false\n },\n fn: event => {\n const phase = getPhase();\n if (phase.type !== 'DRAGGING') {\n cancel();\n return;\n }\n phase.hasMoved = true;\n const {\n clientX,\n clientY\n } = event.touches[0];\n const point = {\n x: clientX,\n y: clientY\n };\n event.preventDefault();\n phase.actions.move(point);\n }\n }, {\n eventName: 'touchend',\n fn: event => {\n const phase = getPhase();\n if (phase.type !== 'DRAGGING') {\n cancel();\n return;\n }\n event.preventDefault();\n phase.actions.drop({\n shouldBlockNextClick: true\n });\n completed();\n }\n }, {\n eventName: 'touchcancel',\n fn: event => {\n if (getPhase().type !== 'DRAGGING') {\n cancel();\n return;\n }\n event.preventDefault();\n cancel();\n }\n }, {\n eventName: 'touchforcechange',\n fn: event => {\n const phase = getPhase();\n !(phase.type !== 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n const touch = event.touches[0];\n if (!touch) {\n return;\n }\n const isForcePress = touch.force >= forcePressThreshold;\n if (!isForcePress) {\n return;\n }\n const shouldRespect = phase.actions.shouldRespectForcePress();\n if (phase.type === 'PENDING') {\n if (shouldRespect) {\n cancel();\n }\n return;\n }\n if (shouldRespect) {\n if (phase.hasMoved) {\n event.preventDefault();\n return;\n }\n cancel();\n return;\n }\n event.preventDefault();\n }\n }, {\n eventName: supportedEventName,\n fn: cancel\n }];\n}\nfunction useTouchSensor(api) {\n const phaseRef = useRef(idle);\n const unbindEventsRef = useRef(noop$2);\n const getPhase = useCallback(function getPhase() {\n return phaseRef.current;\n }, []);\n const setPhase = useCallback(function setPhase(phase) {\n phaseRef.current = phase;\n }, []);\n const startCaptureBinding = useMemo(() => ({\n eventName: 'touchstart',\n fn: function onTouchStart(event) {\n if (event.defaultPrevented) {\n return;\n }\n const draggableId = api.findClosestDraggableId(event);\n if (!draggableId) {\n return;\n }\n const actions = api.tryGetLock(draggableId, stop, {\n sourceEvent: event\n });\n if (!actions) {\n return;\n }\n const touch = event.touches[0];\n const {\n clientX,\n clientY\n } = touch;\n const point = {\n x: clientX,\n y: clientY\n };\n unbindEventsRef.current();\n startPendingDrag(actions, point);\n }\n }), [api]);\n const listenForCapture = useCallback(function listenForCapture() {\n const options = {\n capture: true,\n passive: false\n };\n unbindEventsRef.current = bindEvents(window, [startCaptureBinding], options);\n }, [startCaptureBinding]);\n const stop = useCallback(() => {\n const current = phaseRef.current;\n if (current.type === 'IDLE') {\n return;\n }\n if (current.type === 'PENDING') {\n clearTimeout(current.longPressTimerId);\n }\n setPhase(idle);\n unbindEventsRef.current();\n listenForCapture();\n }, [listenForCapture, setPhase]);\n const cancel = useCallback(() => {\n const phase = phaseRef.current;\n stop();\n if (phase.type === 'DRAGGING') {\n phase.actions.cancel({\n shouldBlockNextClick: true\n });\n }\n if (phase.type === 'PENDING') {\n phase.actions.abort();\n }\n }, [stop]);\n const bindCapturingEvents = useCallback(function bindCapturingEvents() {\n const options = {\n capture: true,\n passive: false\n };\n const args = {\n cancel,\n completed: stop,\n getPhase\n };\n const unbindTarget = bindEvents(window, getHandleBindings(args), options);\n const unbindWindow = bindEvents(window, getWindowBindings(args), options);\n unbindEventsRef.current = function unbindAll() {\n unbindTarget();\n unbindWindow();\n };\n }, [cancel, getPhase, stop]);\n const startDragging = useCallback(function startDragging() {\n const phase = getPhase();\n !(phase.type === 'PENDING') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot start dragging from phase ${phase.type}`) : invariant() : void 0;\n const actions = phase.actions.fluidLift(phase.point);\n setPhase({\n type: 'DRAGGING',\n actions,\n hasMoved: false\n });\n }, [getPhase, setPhase]);\n const startPendingDrag = useCallback(function startPendingDrag(actions, point) {\n !(getPhase().type === 'IDLE') ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected to move from IDLE to PENDING drag') : invariant() : void 0;\n const longPressTimerId = setTimeout(startDragging, timeForLongPress);\n setPhase({\n type: 'PENDING',\n point,\n actions,\n longPressTimerId\n });\n bindCapturingEvents();\n }, [bindCapturingEvents, getPhase, setPhase, startDragging]);\n useIsomorphicLayoutEffect(function mount() {\n listenForCapture();\n return function unmount() {\n unbindEventsRef.current();\n const phase = getPhase();\n if (phase.type === 'PENDING') {\n clearTimeout(phase.longPressTimerId);\n setPhase(idle);\n }\n };\n }, [getPhase, listenForCapture, setPhase]);\n useIsomorphicLayoutEffect(function webkitHack() {\n const unbind = bindEvents(window, [{\n eventName: 'touchmove',\n fn: () => {},\n options: {\n capture: false,\n passive: false\n }\n }]);\n return unbind;\n }, []);\n}\n\nfunction useValidateSensorHooks(sensorHooks) {\n useDev(() => {\n const previousRef = usePrevious(sensorHooks);\n useDevSetupWarning(() => {\n !(previousRef.current.length === sensorHooks.length) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot change the amount of sensor hooks after mounting') : invariant(false) : void 0;\n });\n });\n}\n\nconst interactiveTagNames = ['input', 'button', 'textarea', 'select', 'option', 'optgroup', 'video', 'audio'];\nfunction isAnInteractiveElement(parent, current) {\n if (current == null) {\n return false;\n }\n const hasAnInteractiveTag = interactiveTagNames.includes(current.tagName.toLowerCase());\n if (hasAnInteractiveTag) {\n return true;\n }\n const attribute = current.getAttribute('contenteditable');\n if (attribute === 'true' || attribute === '') {\n return true;\n }\n if (current === parent) {\n return false;\n }\n return isAnInteractiveElement(parent, current.parentElement);\n}\nfunction isEventInInteractiveElement(draggable, event) {\n const target = event.target;\n if (!isHtmlElement(target)) {\n return false;\n }\n return isAnInteractiveElement(draggable, target);\n}\n\nvar getBorderBoxCenterPosition = el => getRect(el.getBoundingClientRect()).center;\n\nfunction isElement(el) {\n return el instanceof getWindowFromEl(el).Element;\n}\n\nconst supportedMatchesName = (() => {\n const base = 'matches';\n if (typeof document === 'undefined') {\n return base;\n }\n const candidates = [base, 'msMatchesSelector', 'webkitMatchesSelector'];\n const value = candidates.find(name => name in Element.prototype);\n return value || base;\n})();\nfunction closestPonyfill(el, selector) {\n if (el == null) {\n return null;\n }\n if (el[supportedMatchesName](selector)) {\n return el;\n }\n return closestPonyfill(el.parentElement, selector);\n}\nfunction closest(el, selector) {\n if (el.closest) {\n return el.closest(selector);\n }\n return closestPonyfill(el, selector);\n}\n\nfunction getSelector(contextId) {\n return `[${dragHandle.contextId}=\"${contextId}\"]`;\n}\nfunction findClosestDragHandleFromEvent(contextId, event) {\n const target = event.target;\n if (!isElement(target)) {\n process.env.NODE_ENV !== \"production\" ? warning('event.target must be a Element') : void 0;\n return null;\n }\n const selector = getSelector(contextId);\n const handle = closest(target, selector);\n if (!handle) {\n return null;\n }\n if (!isHtmlElement(handle)) {\n process.env.NODE_ENV !== \"production\" ? warning('drag handle must be a HTMLElement') : void 0;\n return null;\n }\n return handle;\n}\nfunction tryGetClosestDraggableIdFromEvent(contextId, event) {\n const handle = findClosestDragHandleFromEvent(contextId, event);\n if (!handle) {\n return null;\n }\n return handle.getAttribute(dragHandle.draggableId);\n}\n\nfunction findDraggable(contextId, draggableId) {\n const selector = `[${draggable.contextId}=\"${contextId}\"]`;\n const possible = querySelectorAll(document, selector);\n const draggable$1 = possible.find(el => {\n return el.getAttribute(draggable.id) === draggableId;\n });\n if (!draggable$1) {\n return null;\n }\n if (!isHtmlElement(draggable$1)) {\n process.env.NODE_ENV !== \"production\" ? warning('Draggable element is not a HTMLElement') : void 0;\n return null;\n }\n return draggable$1;\n}\n\nfunction preventDefault(event) {\n event.preventDefault();\n}\nfunction isActive({\n expected,\n phase,\n isLockActive,\n shouldWarn\n}) {\n if (!isLockActive()) {\n if (shouldWarn) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Cannot perform action.\n The sensor no longer has an action lock.\n\n Tips:\n\n - Throw away your action handlers when forceStop() is called\n - Check actions.isActive() if you really need to\n `) : void 0;\n }\n return false;\n }\n if (expected !== phase) {\n if (shouldWarn) {\n process.env.NODE_ENV !== \"production\" ? warning(`\n Cannot perform action.\n The actions you used belong to an outdated phase\n\n Current phase: ${expected}\n You called an action from outdated phase: ${phase}\n\n Tips:\n\n - Do not use preDragActions actions after calling preDragActions.lift()\n `) : void 0;\n }\n return false;\n }\n return true;\n}\nfunction canStart({\n lockAPI,\n store,\n registry,\n draggableId\n}) {\n if (lockAPI.isClaimed()) {\n return false;\n }\n const entry = registry.draggable.findById(draggableId);\n if (!entry) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find draggable with id: ${draggableId}`) : void 0;\n return false;\n }\n if (!entry.options.isEnabled) {\n return false;\n }\n if (!canStartDrag(store.getState(), draggableId)) {\n return false;\n }\n return true;\n}\nfunction tryStart({\n lockAPI,\n contextId,\n store,\n registry,\n draggableId,\n forceSensorStop,\n sourceEvent\n}) {\n const shouldStart = canStart({\n lockAPI,\n store,\n registry,\n draggableId\n });\n if (!shouldStart) {\n return null;\n }\n const entry = registry.draggable.getById(draggableId);\n const el = findDraggable(contextId, entry.descriptor.id);\n if (!el) {\n process.env.NODE_ENV !== \"production\" ? warning(`Unable to find draggable element with id: ${draggableId}`) : void 0;\n return null;\n }\n if (sourceEvent && !entry.options.canDragInteractiveElements && isEventInInteractiveElement(el, sourceEvent)) {\n return null;\n }\n const lock = lockAPI.claim(forceSensorStop || noop$2);\n let phase = 'PRE_DRAG';\n function getShouldRespectForcePress() {\n return entry.options.shouldRespectForcePress;\n }\n function isLockActive() {\n return lockAPI.isActive(lock);\n }\n function tryDispatch(expected, getAction) {\n if (isActive({\n expected,\n phase,\n isLockActive,\n shouldWarn: true\n })) {\n store.dispatch(getAction());\n }\n }\n const tryDispatchWhenDragging = tryDispatch.bind(null, 'DRAGGING');\n function lift(args) {\n function completed() {\n lockAPI.release();\n phase = 'COMPLETED';\n }\n if (phase !== 'PRE_DRAG') {\n completed();\n process.env.NODE_ENV !== \"production\" ? invariant(false, `Cannot lift in phase ${phase}`) : invariant() ;\n }\n store.dispatch(lift$1(args.liftActionArgs));\n phase = 'DRAGGING';\n function finish(reason, options = {\n shouldBlockNextClick: false\n }) {\n args.cleanup();\n if (options.shouldBlockNextClick) {\n const unbind = bindEvents(window, [{\n eventName: 'click',\n fn: preventDefault,\n options: {\n once: true,\n passive: false,\n capture: true\n }\n }]);\n setTimeout(unbind);\n }\n completed();\n store.dispatch(drop({\n reason\n }));\n }\n return {\n isActive: () => isActive({\n expected: 'DRAGGING',\n phase,\n isLockActive,\n shouldWarn: false\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n drop: options => finish('DROP', options),\n cancel: options => finish('CANCEL', options),\n ...args.actions\n };\n }\n function fluidLift(clientSelection) {\n const move$1 = rafSchd(client => {\n tryDispatchWhenDragging(() => move({\n client\n }));\n });\n const api = lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection,\n movementMode: 'FLUID'\n },\n cleanup: () => move$1.cancel(),\n actions: {\n move: move$1\n }\n });\n return {\n ...api,\n move: move$1\n };\n }\n function snapLift() {\n const actions = {\n moveUp: () => tryDispatchWhenDragging(moveUp),\n moveRight: () => tryDispatchWhenDragging(moveRight),\n moveDown: () => tryDispatchWhenDragging(moveDown),\n moveLeft: () => tryDispatchWhenDragging(moveLeft)\n };\n return lift({\n liftActionArgs: {\n id: draggableId,\n clientSelection: getBorderBoxCenterPosition(el),\n movementMode: 'SNAP'\n },\n cleanup: noop$2,\n actions\n });\n }\n function abortPreDrag() {\n const shouldRelease = isActive({\n expected: 'PRE_DRAG',\n phase,\n isLockActive,\n shouldWarn: true\n });\n if (shouldRelease) {\n lockAPI.release();\n }\n }\n const preDrag = {\n isActive: () => isActive({\n expected: 'PRE_DRAG',\n phase,\n isLockActive,\n shouldWarn: false\n }),\n shouldRespectForcePress: getShouldRespectForcePress,\n fluidLift,\n snapLift,\n abort: abortPreDrag\n };\n return preDrag;\n}\nconst defaultSensors = [useMouseSensor, useKeyboardSensor, useTouchSensor];\nfunction useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors,\n enableDefaultSensors\n}) {\n const useSensors = [...(enableDefaultSensors ? defaultSensors : []), ...(customSensors || [])];\n const lockAPI = useState(() => create())[0];\n const tryAbandonLock = useCallback(function tryAbandonLock(previous, current) {\n if (isDragging(previous) && !isDragging(current)) {\n lockAPI.tryAbandon();\n }\n }, [lockAPI]);\n useIsomorphicLayoutEffect(function listenToStore() {\n let previous = store.getState();\n const unsubscribe = store.subscribe(() => {\n const current = store.getState();\n tryAbandonLock(previous, current);\n previous = current;\n });\n return unsubscribe;\n }, [lockAPI, store, tryAbandonLock]);\n useIsomorphicLayoutEffect(() => {\n return lockAPI.tryAbandon;\n }, [lockAPI.tryAbandon]);\n const canGetLock = useCallback(draggableId => {\n return canStart({\n lockAPI,\n registry,\n store,\n draggableId\n });\n }, [lockAPI, registry, store]);\n const tryGetLock = useCallback((draggableId, forceStop, options) => tryStart({\n lockAPI,\n registry,\n contextId,\n store,\n draggableId,\n forceSensorStop: forceStop || null,\n sourceEvent: options && options.sourceEvent ? options.sourceEvent : null\n }), [contextId, lockAPI, registry, store]);\n const findClosestDraggableId = useCallback(event => tryGetClosestDraggableIdFromEvent(contextId, event), [contextId]);\n const findOptionsForDraggable = useCallback(id => {\n const entry = registry.draggable.findById(id);\n return entry ? entry.options : null;\n }, [registry.draggable]);\n const tryReleaseLock = useCallback(function tryReleaseLock() {\n if (!lockAPI.isClaimed()) {\n return;\n }\n lockAPI.tryAbandon();\n if (store.getState().phase !== 'IDLE') {\n store.dispatch(flush());\n }\n }, [lockAPI, store]);\n const isLockClaimed = useCallback(() => lockAPI.isClaimed(), [lockAPI]);\n const api = useMemo(() => ({\n canGetLock,\n tryGetLock,\n findClosestDraggableId,\n findOptionsForDraggable,\n tryReleaseLock,\n isLockClaimed\n }), [canGetLock, tryGetLock, findClosestDraggableId, findOptionsForDraggable, tryReleaseLock, isLockClaimed]);\n useValidateSensorHooks(useSensors);\n for (let i = 0; i < useSensors.length; i++) {\n useSensors[i](api);\n }\n}\n\nconst createResponders = props => ({\n onBeforeCapture: t => {\n const onBeforeCapureCallback = () => {\n if (props.onBeforeCapture) {\n props.onBeforeCapture(t);\n }\n };\n flushSync(onBeforeCapureCallback);\n },\n onBeforeDragStart: props.onBeforeDragStart,\n onDragStart: props.onDragStart,\n onDragEnd: props.onDragEnd,\n onDragUpdate: props.onDragUpdate\n});\nconst createAutoScrollerOptions = props => ({\n ...defaultAutoScrollerOptions,\n ...props.autoScrollerOptions,\n durationDampening: {\n ...defaultAutoScrollerOptions.durationDampening,\n ...props.autoScrollerOptions\n }\n});\nfunction getStore(lazyRef) {\n !lazyRef.current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find store from lazy ref') : invariant() : void 0;\n return lazyRef.current;\n}\nfunction App(props) {\n const {\n contextId,\n setCallbacks,\n sensors,\n nonce,\n dragHandleUsageInstructions\n } = props;\n const lazyStoreRef = useRef(null);\n useStartupValidation();\n const lastPropsRef = usePrevious(props);\n const getResponders = useCallback(() => {\n return createResponders(lastPropsRef.current);\n }, [lastPropsRef]);\n const getAutoScrollerOptions = useCallback(() => {\n return createAutoScrollerOptions(lastPropsRef.current);\n }, [lastPropsRef]);\n const announce = useAnnouncer(contextId);\n const dragHandleUsageInstructionsId = useHiddenTextElement({\n contextId,\n text: dragHandleUsageInstructions\n });\n const styleMarshal = useStyleMarshal(contextId, nonce);\n const lazyDispatch = useCallback(action => {\n getStore(lazyStoreRef).dispatch(action);\n }, []);\n const marshalCallbacks = useMemo(() => bindActionCreators({\n publishWhileDragging,\n updateDroppableScroll,\n updateDroppableIsEnabled,\n updateDroppableIsCombineEnabled,\n collectionStarting\n }, lazyDispatch), [lazyDispatch]);\n const registry = useRegistry();\n const dimensionMarshal = useMemo(() => {\n return createDimensionMarshal(registry, marshalCallbacks);\n }, [registry, marshalCallbacks]);\n const autoScroller = useMemo(() => createAutoScroller({\n scrollWindow,\n scrollDroppable: dimensionMarshal.scrollDroppable,\n getAutoScrollerOptions,\n ...bindActionCreators({\n move\n }, lazyDispatch)\n }), [dimensionMarshal.scrollDroppable, lazyDispatch, getAutoScrollerOptions]);\n const focusMarshal = useFocusMarshal(contextId);\n const store = useMemo(() => createStore({\n announce,\n autoScroller,\n dimensionMarshal,\n focusMarshal,\n getResponders,\n styleMarshal\n }), [announce, autoScroller, dimensionMarshal, focusMarshal, getResponders, styleMarshal]);\n if (process.env.NODE_ENV !== 'production') {\n if (lazyStoreRef.current && lazyStoreRef.current !== store) {\n process.env.NODE_ENV !== \"production\" ? warning('unexpected store change') : void 0;\n }\n }\n lazyStoreRef.current = store;\n const tryResetStore = useCallback(() => {\n const current = getStore(lazyStoreRef);\n const state = current.getState();\n if (state.phase !== 'IDLE') {\n current.dispatch(flush());\n }\n }, []);\n const isDragging = useCallback(() => {\n const state = getStore(lazyStoreRef).getState();\n if (state.phase === 'DROP_ANIMATING') {\n return true;\n }\n if (state.phase === 'IDLE') {\n return false;\n }\n return state.isDragging;\n }, []);\n const appCallbacks = useMemo(() => ({\n isDragging,\n tryAbort: tryResetStore\n }), [isDragging, tryResetStore]);\n setCallbacks(appCallbacks);\n const getCanLift = useCallback(id => canStartDrag(getStore(lazyStoreRef).getState(), id), []);\n const getIsMovementAllowed = useCallback(() => isMovementAllowed(getStore(lazyStoreRef).getState()), []);\n const appContext = useMemo(() => ({\n marshal: dimensionMarshal,\n focus: focusMarshal,\n contextId,\n canLift: getCanLift,\n isMovementAllowed: getIsMovementAllowed,\n dragHandleUsageInstructionsId,\n registry\n }), [contextId, dimensionMarshal, dragHandleUsageInstructionsId, focusMarshal, getCanLift, getIsMovementAllowed, registry]);\n useSensorMarshal({\n contextId,\n store,\n registry,\n customSensors: sensors || null,\n enableDefaultSensors: props.enableDefaultSensors !== false\n });\n useEffect(() => {\n return tryResetStore;\n }, [tryResetStore]);\n return React.createElement(AppContext.Provider, {\n value: appContext\n }, React.createElement(Provider, {\n context: StoreContext,\n store: store\n }, props.children));\n}\n\nfunction useUniqueContextId() {\n return React.useId();\n}\n\nfunction DragDropContext(props) {\n const contextId = useUniqueContextId();\n const dragHandleUsageInstructions = props.dragHandleUsageInstructions || preset.dragHandleUsageInstructions;\n return React.createElement(ErrorBoundary, null, setCallbacks => React.createElement(App, {\n nonce: props.nonce,\n contextId: contextId,\n setCallbacks: setCallbacks,\n dragHandleUsageInstructions: dragHandleUsageInstructions,\n enableDefaultSensors: props.enableDefaultSensors,\n sensors: props.sensors,\n onBeforeCapture: props.onBeforeCapture,\n onBeforeDragStart: props.onBeforeDragStart,\n onDragStart: props.onDragStart,\n onDragUpdate: props.onDragUpdate,\n onDragEnd: props.onDragEnd,\n autoScrollerOptions: props.autoScrollerOptions\n }, props.children));\n}\n\nconst zIndexOptions = {\n dragging: 5000,\n dropAnimating: 4500\n};\nconst getDraggingTransition = (shouldAnimateDragMovement, dropping) => {\n if (dropping) {\n return transitions.drop(dropping.duration);\n }\n if (shouldAnimateDragMovement) {\n return transitions.snap;\n }\n return transitions.fluid;\n};\nconst getDraggingOpacity = (isCombining, isDropAnimating) => {\n if (!isCombining) {\n return undefined;\n }\n return isDropAnimating ? combine.opacity.drop : combine.opacity.combining;\n};\nconst getShouldDraggingAnimate = dragging => {\n if (dragging.forceShouldAnimate != null) {\n return dragging.forceShouldAnimate;\n }\n return dragging.mode === 'SNAP';\n};\nfunction getDraggingStyle(dragging) {\n const dimension = dragging.dimension;\n const box = dimension.client;\n const {\n offset,\n combineWith,\n dropping\n } = dragging;\n const isCombining = Boolean(combineWith);\n const shouldAnimate = getShouldDraggingAnimate(dragging);\n const isDropAnimating = Boolean(dropping);\n const transform = isDropAnimating ? transforms.drop(offset, isCombining) : transforms.moveTo(offset);\n const style = {\n position: 'fixed',\n top: box.marginBox.top,\n left: box.marginBox.left,\n boxSizing: 'border-box',\n width: box.borderBox.width,\n height: box.borderBox.height,\n transition: getDraggingTransition(shouldAnimate, dropping),\n transform,\n opacity: getDraggingOpacity(isCombining, isDropAnimating),\n zIndex: isDropAnimating ? zIndexOptions.dropAnimating : zIndexOptions.dragging,\n pointerEvents: 'none'\n };\n return style;\n}\nfunction getSecondaryStyle(secondary) {\n return {\n transform: transforms.moveTo(secondary.offset),\n transition: secondary.shouldAnimateDisplacement ? undefined : 'none'\n };\n}\nfunction getStyle$1(mapped) {\n return mapped.type === 'DRAGGING' ? getDraggingStyle(mapped) : getSecondaryStyle(mapped);\n}\n\nfunction getDimension$1(descriptor, el, windowScroll = origin) {\n const computedStyles = window.getComputedStyle(el);\n const borderBox = el.getBoundingClientRect();\n const client = calculateBox(borderBox, computedStyles);\n const page = withScroll(client, windowScroll);\n const placeholder = {\n client,\n tagName: el.tagName.toLowerCase(),\n display: computedStyles.display\n };\n const displaceBy = {\n x: client.marginBox.width,\n y: client.marginBox.height\n };\n const dimension = {\n descriptor,\n placeholder,\n displaceBy,\n client,\n page\n };\n return dimension;\n}\n\nfunction useDraggablePublisher(args) {\n const uniqueId = useUniqueId('draggable');\n const {\n descriptor,\n registry,\n getDraggableRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled\n } = args;\n const options = useMemo(() => ({\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled\n }), [canDragInteractiveElements, isEnabled, shouldRespectForcePress]);\n const getDimension = useCallback(windowScroll => {\n const el = getDraggableRef();\n !el ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot get dimension when no ref is set') : invariant() : void 0;\n return getDimension$1(descriptor, el, windowScroll);\n }, [descriptor, getDraggableRef]);\n const entry = useMemo(() => ({\n uniqueId,\n descriptor,\n options,\n getDimension\n }), [descriptor, getDimension, options, uniqueId]);\n const publishedRef = useRef(entry);\n const isFirstPublishRef = useRef(true);\n useIsomorphicLayoutEffect(() => {\n registry.draggable.register(publishedRef.current);\n return () => registry.draggable.unregister(publishedRef.current);\n }, [registry.draggable]);\n useIsomorphicLayoutEffect(() => {\n if (isFirstPublishRef.current) {\n isFirstPublishRef.current = false;\n return;\n }\n const last = publishedRef.current;\n publishedRef.current = entry;\n registry.draggable.update(entry, last);\n }, [entry, registry.draggable]);\n}\n\nvar DroppableContext = React.createContext(null);\n\nfunction checkIsValidInnerRef(el) {\n !(el && isHtmlElement(el)) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `\n provided.innerRef has not been provided with a HTMLElement.\n\n You can find a guide on using the innerRef callback functions at:\n https://github.com/hello-pangea/dnd/blob/main/docs/guides/using-inner-ref.md\n `) : invariant() : void 0;\n}\n\nfunction useValidation$1(props, contextId, getRef) {\n useDevSetupWarning(() => {\n function prefix(id) {\n return `Draggable[id: ${id}]: `;\n }\n const id = props.draggableId;\n !id ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Draggable requires a draggableId') : invariant(false) : void 0;\n !(typeof id === 'string') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `Draggable requires a [string] draggableId.\n Provided: [type: ${typeof id}] (value: ${id})`) : invariant(false) : void 0;\n !Number.isInteger(props.index) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${prefix(id)} requires an integer index prop`) : invariant(false) : void 0;\n if (props.mapped.type === 'DRAGGING') {\n return;\n }\n checkIsValidInnerRef(getRef());\n if (props.isEnabled) {\n !findDragHandle(contextId, id) ? process.env.NODE_ENV !== \"production\" ? invariant(false, `${prefix(id)} Unable to find drag handle`) : invariant(false) : void 0;\n }\n });\n}\nfunction useClonePropValidation(isClone) {\n useDev(() => {\n const initialRef = useRef(isClone);\n useDevSetupWarning(() => {\n !(isClone === initialRef.current) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Draggable isClone prop value changed during component life') : invariant(false) : void 0;\n }, [isClone]);\n });\n}\n\nfunction useRequiredContext(Context) {\n const result = useContext(Context);\n !result ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find required context') : invariant() : void 0;\n return result;\n}\n\nfunction preventHtml5Dnd(event) {\n event.preventDefault();\n}\nconst Draggable = props => {\n const ref = useRef(null);\n const setRef = useCallback((el = null) => {\n ref.current = el;\n }, []);\n const getRef = useCallback(() => ref.current, []);\n const {\n contextId,\n dragHandleUsageInstructionsId,\n registry\n } = useRequiredContext(AppContext);\n const {\n type,\n droppableId\n } = useRequiredContext(DroppableContext);\n const descriptor = useMemo(() => ({\n id: props.draggableId,\n index: props.index,\n type,\n droppableId\n }), [props.draggableId, props.index, type, droppableId]);\n const {\n children,\n draggableId,\n isEnabled,\n shouldRespectForcePress,\n canDragInteractiveElements,\n isClone,\n mapped,\n dropAnimationFinished: dropAnimationFinishedAction\n } = props;\n useValidation$1(props, contextId, getRef);\n useClonePropValidation(isClone);\n if (!isClone) {\n const forPublisher = useMemo(() => ({\n descriptor,\n registry,\n getDraggableRef: getRef,\n canDragInteractiveElements,\n shouldRespectForcePress,\n isEnabled\n }), [descriptor, registry, getRef, canDragInteractiveElements, shouldRespectForcePress, isEnabled]);\n useDraggablePublisher(forPublisher);\n }\n const dragHandleProps = useMemo(() => isEnabled ? {\n tabIndex: 0,\n role: 'button',\n 'aria-describedby': dragHandleUsageInstructionsId,\n 'data-rfd-drag-handle-draggable-id': draggableId,\n 'data-rfd-drag-handle-context-id': contextId,\n draggable: false,\n onDragStart: preventHtml5Dnd\n } : null, [contextId, dragHandleUsageInstructionsId, draggableId, isEnabled]);\n const onMoveEnd = useCallback(event => {\n if (mapped.type !== 'DRAGGING') {\n return;\n }\n if (!mapped.dropping) {\n return;\n }\n if (event.propertyName !== 'transform') {\n return;\n }\n flushSync(dropAnimationFinishedAction);\n }, [dropAnimationFinishedAction, mapped]);\n const provided = useMemo(() => {\n const style = getStyle$1(mapped);\n const onTransitionEnd = mapped.type === 'DRAGGING' && mapped.dropping ? onMoveEnd : undefined;\n const result = {\n innerRef: setRef,\n draggableProps: {\n 'data-rfd-draggable-context-id': contextId,\n 'data-rfd-draggable-id': draggableId,\n style,\n onTransitionEnd\n },\n dragHandleProps\n };\n return result;\n }, [contextId, dragHandleProps, draggableId, mapped, onMoveEnd, setRef]);\n const rubric = useMemo(() => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId\n }\n }), [descriptor.droppableId, descriptor.id, descriptor.index, descriptor.type]);\n return React.createElement(React.Fragment, null, children(provided, mapped.snapshot, rubric));\n};\n\nvar isStrictEqual = (a, b) => a === b;\n\nvar whatIsDraggedOverFromResult = result => {\n const {\n combine,\n destination\n } = result;\n if (destination) {\n return destination.droppableId;\n }\n if (combine) {\n return combine.droppableId;\n }\n return null;\n};\n\nconst getCombineWithFromResult = result => {\n return result.combine ? result.combine.draggableId : null;\n};\nconst getCombineWithFromImpact = impact => {\n return impact.at && impact.at.type === 'COMBINE' ? impact.at.combine.draggableId : null;\n};\nfunction getDraggableSelector() {\n const memoizedOffset = memoizeOne((x, y) => ({\n x,\n y\n }));\n const getMemoizedSnapshot = memoizeOne((mode, isClone, draggingOver = null, combineWith = null, dropping = null) => ({\n isDragging: true,\n isClone,\n isDropAnimating: Boolean(dropping),\n dropAnimation: dropping,\n mode,\n draggingOver,\n combineWith,\n combineTargetFor: null\n }));\n const getMemoizedProps = memoizeOne((offset, mode, dimension, isClone, draggingOver = null, combineWith = null, forceShouldAnimate = null) => ({\n mapped: {\n type: 'DRAGGING',\n dropping: null,\n draggingOver,\n combineWith,\n mode,\n offset,\n dimension,\n forceShouldAnimate,\n snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, null)\n }\n }));\n const selector = (state, ownProps) => {\n if (isDragging(state)) {\n if (state.critical.draggable.id !== ownProps.draggableId) {\n return null;\n }\n const offset = state.current.client.offset;\n const dimension = state.dimensions.draggables[ownProps.draggableId];\n const draggingOver = whatIsDraggedOver(state.impact);\n const combineWith = getCombineWithFromImpact(state.impact);\n const forceShouldAnimate = state.forceShouldAnimate;\n return getMemoizedProps(memoizedOffset(offset.x, offset.y), state.movementMode, dimension, ownProps.isClone, draggingOver, combineWith, forceShouldAnimate);\n }\n if (state.phase === 'DROP_ANIMATING') {\n const completed = state.completed;\n if (completed.result.draggableId !== ownProps.draggableId) {\n return null;\n }\n const isClone = ownProps.isClone;\n const dimension = state.dimensions.draggables[ownProps.draggableId];\n const result = completed.result;\n const mode = result.mode;\n const draggingOver = whatIsDraggedOverFromResult(result);\n const combineWith = getCombineWithFromResult(result);\n const duration = state.dropDuration;\n const dropping = {\n duration,\n curve: curves.drop,\n moveTo: state.newHomeClientOffset,\n opacity: combineWith ? combine.opacity.drop : null,\n scale: combineWith ? combine.scale.drop : null\n };\n return {\n mapped: {\n type: 'DRAGGING',\n offset: state.newHomeClientOffset,\n dimension,\n dropping,\n draggingOver,\n combineWith,\n mode,\n forceShouldAnimate: null,\n snapshot: getMemoizedSnapshot(mode, isClone, draggingOver, combineWith, dropping)\n }\n };\n }\n return null;\n };\n return selector;\n}\nfunction getSecondarySnapshot(combineTargetFor = null) {\n return {\n isDragging: false,\n isDropAnimating: false,\n isClone: false,\n dropAnimation: null,\n mode: null,\n draggingOver: null,\n combineTargetFor,\n combineWith: null\n };\n}\nconst atRest = {\n mapped: {\n type: 'SECONDARY',\n offset: origin,\n combineTargetFor: null,\n shouldAnimateDisplacement: true,\n snapshot: getSecondarySnapshot(null)\n }\n};\nfunction getSecondarySelector() {\n const memoizedOffset = memoizeOne((x, y) => ({\n x,\n y\n }));\n const getMemoizedSnapshot = memoizeOne(getSecondarySnapshot);\n const getMemoizedProps = memoizeOne((offset, combineTargetFor = null, shouldAnimateDisplacement) => ({\n mapped: {\n type: 'SECONDARY',\n offset,\n combineTargetFor,\n shouldAnimateDisplacement,\n snapshot: getMemoizedSnapshot(combineTargetFor)\n }\n }));\n const getFallback = combineTargetFor => {\n return combineTargetFor ? getMemoizedProps(origin, combineTargetFor, true) : null;\n };\n const getProps = (ownId, draggingId, impact, afterCritical) => {\n const visualDisplacement = impact.displaced.visible[ownId];\n const isAfterCriticalInVirtualList = Boolean(afterCritical.inVirtualList && afterCritical.effected[ownId]);\n const combine = tryGetCombine(impact);\n const combineTargetFor = combine && combine.draggableId === ownId ? draggingId : null;\n if (!visualDisplacement) {\n if (!isAfterCriticalInVirtualList) {\n return getFallback(combineTargetFor);\n }\n if (impact.displaced.invisible[ownId]) {\n return null;\n }\n const change = negate(afterCritical.displacedBy.point);\n const offset = memoizedOffset(change.x, change.y);\n return getMemoizedProps(offset, combineTargetFor, true);\n }\n if (isAfterCriticalInVirtualList) {\n return getFallback(combineTargetFor);\n }\n const displaceBy = impact.displacedBy.point;\n const offset = memoizedOffset(displaceBy.x, displaceBy.y);\n return getMemoizedProps(offset, combineTargetFor, visualDisplacement.shouldAnimate);\n };\n const selector = (state, ownProps) => {\n if (isDragging(state)) {\n if (state.critical.draggable.id === ownProps.draggableId) {\n return null;\n }\n return getProps(ownProps.draggableId, state.critical.draggable.id, state.impact, state.afterCritical);\n }\n if (state.phase === 'DROP_ANIMATING') {\n const completed = state.completed;\n if (completed.result.draggableId === ownProps.draggableId) {\n return null;\n }\n return getProps(ownProps.draggableId, completed.result.draggableId, completed.impact, completed.afterCritical);\n }\n return null;\n };\n return selector;\n}\nconst makeMapStateToProps$1 = () => {\n const draggingSelector = getDraggableSelector();\n const secondarySelector = getSecondarySelector();\n const selector = (state, ownProps) => draggingSelector(state, ownProps) || secondarySelector(state, ownProps) || atRest;\n return selector;\n};\nconst mapDispatchToProps$1 = {\n dropAnimationFinished: dropAnimationFinished\n};\nconst ConnectedDraggable = connect(makeMapStateToProps$1, mapDispatchToProps$1, null, {\n context: StoreContext,\n areStatePropsEqual: isStrictEqual\n})(Draggable);\n\nfunction PrivateDraggable(props) {\n const droppableContext = useRequiredContext(DroppableContext);\n const isUsingCloneFor = droppableContext.isUsingCloneFor;\n if (isUsingCloneFor === props.draggableId && !props.isClone) {\n return null;\n }\n return React.createElement(ConnectedDraggable, props);\n}\nfunction PublicDraggable(props) {\n const isEnabled = typeof props.isDragDisabled === 'boolean' ? !props.isDragDisabled : true;\n const canDragInteractiveElements = Boolean(props.disableInteractiveElementBlocking);\n const shouldRespectForcePress = Boolean(props.shouldRespectForcePress);\n return React.createElement(PrivateDraggable, _extends({}, props, {\n isClone: false,\n isEnabled: isEnabled,\n canDragInteractiveElements: canDragInteractiveElements,\n shouldRespectForcePress: shouldRespectForcePress\n }));\n}\n\nconst isEqual = base => value => base === value;\nconst isScroll = isEqual('scroll');\nconst isAuto = isEqual('auto');\nconst isVisible = isEqual('visible');\nconst isEither = (overflow, fn) => fn(overflow.overflowX) || fn(overflow.overflowY);\nconst isBoth = (overflow, fn) => fn(overflow.overflowX) && fn(overflow.overflowY);\nconst isElementScrollable = el => {\n const style = window.getComputedStyle(el);\n const overflow = {\n overflowX: style.overflowX,\n overflowY: style.overflowY\n };\n return isEither(overflow, isScroll) || isEither(overflow, isAuto);\n};\nconst isBodyScrollable = () => {\n if (process.env.NODE_ENV === 'production') {\n return false;\n }\n const body = getBodyElement();\n const html = document.documentElement;\n !html ? process.env.NODE_ENV !== \"production\" ? invariant() : invariant() : void 0;\n if (!isElementScrollable(body)) {\n return false;\n }\n const htmlStyle = window.getComputedStyle(html);\n const htmlOverflow = {\n overflowX: htmlStyle.overflowX,\n overflowY: htmlStyle.overflowY\n };\n if (isBoth(htmlOverflow, isVisible)) {\n return false;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n We have detected that your <body> element might be a scroll container.\n We have found no reliable way of detecting whether the <body> element is a scroll container.\n Under most circumstances a <body> scroll bar will be on the <html> element (document.documentElement)\n\n Because we cannot determine if the <body> is a scroll container, and generally it is not one,\n we will be treating the <body> as *not* a scroll container\n\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/guides/how-we-detect-scroll-containers.md\n `) : void 0;\n return false;\n};\nconst getClosestScrollable = el => {\n if (el == null) {\n return null;\n }\n if (el === document.body) {\n return isBodyScrollable() ? el : null;\n }\n if (el === document.documentElement) {\n return null;\n }\n if (!isElementScrollable(el)) {\n return getClosestScrollable(el.parentElement);\n }\n return el;\n};\n\nvar checkForNestedScrollContainers = scrollable => {\n if (!scrollable) {\n return;\n }\n const anotherScrollParent = getClosestScrollable(scrollable.parentElement);\n if (!anotherScrollParent) {\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n Droppable: unsupported nested scroll container detected.\n A Droppable can only have one scroll parent (which can be itself)\n Nested scroll containers are currently not supported.\n\n We hope to support nested scroll containers soon: https://github.com/atlassian/react-beautiful-dnd/issues/131\n `) : void 0;\n};\n\nvar getScroll = el => ({\n x: el.scrollLeft,\n y: el.scrollTop\n});\n\nconst getIsFixed = el => {\n if (!el) {\n return false;\n }\n const style = window.getComputedStyle(el);\n if (style.position === 'fixed') {\n return true;\n }\n return getIsFixed(el.parentElement);\n};\nvar getEnv = start => {\n const closestScrollable = getClosestScrollable(start);\n const isFixedOnPage = getIsFixed(start);\n return {\n closestScrollable,\n isFixedOnPage\n };\n};\n\nvar getDroppableDimension = ({\n descriptor,\n isEnabled,\n isCombineEnabled,\n isFixedOnPage,\n direction,\n client,\n page,\n closest\n}) => {\n const frame = (() => {\n if (!closest) {\n return null;\n }\n const {\n scrollSize,\n client: frameClient\n } = closest;\n const maxScroll = getMaxScroll({\n scrollHeight: scrollSize.scrollHeight,\n scrollWidth: scrollSize.scrollWidth,\n height: frameClient.paddingBox.height,\n width: frameClient.paddingBox.width\n });\n return {\n pageMarginBox: closest.page.marginBox,\n frameClient,\n scrollSize,\n shouldClipSubject: closest.shouldClipSubject,\n scroll: {\n initial: closest.scroll,\n current: closest.scroll,\n max: maxScroll,\n diff: {\n value: origin,\n displacement: origin\n }\n }\n };\n })();\n const axis = direction === 'vertical' ? vertical : horizontal;\n const subject = getSubject({\n page,\n withPlaceholder: null,\n axis,\n frame\n });\n const dimension = {\n descriptor,\n isCombineEnabled,\n isFixedOnPage,\n axis,\n isEnabled,\n client,\n page,\n frame,\n subject\n };\n return dimension;\n};\n\nconst getClient = (targetRef, closestScrollable) => {\n const base = getBox(targetRef);\n if (!closestScrollable) {\n return base;\n }\n if (targetRef !== closestScrollable) {\n return base;\n }\n const top = base.paddingBox.top - closestScrollable.scrollTop;\n const left = base.paddingBox.left - closestScrollable.scrollLeft;\n const bottom = top + closestScrollable.scrollHeight;\n const right = left + closestScrollable.scrollWidth;\n const paddingBox = {\n top,\n right,\n bottom,\n left\n };\n const borderBox = expand(paddingBox, base.border);\n const client = createBox({\n borderBox,\n margin: base.margin,\n border: base.border,\n padding: base.padding\n });\n return client;\n};\nvar getDimension = ({\n ref,\n descriptor,\n env,\n windowScroll,\n direction,\n isDropDisabled,\n isCombineEnabled,\n shouldClipSubject\n}) => {\n const closestScrollable = env.closestScrollable;\n const client = getClient(ref, closestScrollable);\n const page = withScroll(client, windowScroll);\n const closest = (() => {\n if (!closestScrollable) {\n return null;\n }\n const frameClient = getBox(closestScrollable);\n const scrollSize = {\n scrollHeight: closestScrollable.scrollHeight,\n scrollWidth: closestScrollable.scrollWidth\n };\n return {\n client: frameClient,\n page: withScroll(frameClient, windowScroll),\n scroll: getScroll(closestScrollable),\n scrollSize,\n shouldClipSubject\n };\n })();\n const dimension = getDroppableDimension({\n descriptor,\n isEnabled: !isDropDisabled,\n isCombineEnabled,\n isFixedOnPage: env.isFixedOnPage,\n direction,\n client,\n page,\n closest\n });\n return dimension;\n};\n\nconst immediate = {\n passive: false\n};\nconst delayed = {\n passive: true\n};\nvar getListenerOptions = options => options.shouldPublishImmediately ? immediate : delayed;\n\nconst getClosestScrollableFromDrag = dragging => dragging && dragging.env.closestScrollable || null;\nfunction useDroppablePublisher(args) {\n const whileDraggingRef = useRef(null);\n const appContext = useRequiredContext(AppContext);\n const uniqueId = useUniqueId('droppable');\n const {\n registry,\n marshal\n } = appContext;\n const previousRef = usePrevious(args);\n const descriptor = useMemo(() => ({\n id: args.droppableId,\n type: args.type,\n mode: args.mode\n }), [args.droppableId, args.mode, args.type]);\n const publishedDescriptorRef = useRef(descriptor);\n const memoizedUpdateScroll = useMemo(() => memoizeOne((x, y) => {\n !whileDraggingRef.current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only update scroll when dragging') : invariant() : void 0;\n const scroll = {\n x,\n y\n };\n marshal.updateDroppableScroll(descriptor.id, scroll);\n }), [descriptor.id, marshal]);\n const getClosestScroll = useCallback(() => {\n const dragging = whileDraggingRef.current;\n if (!dragging || !dragging.env.closestScrollable) {\n return origin;\n }\n return getScroll(dragging.env.closestScrollable);\n }, []);\n const updateScroll = useCallback(() => {\n const scroll = getClosestScroll();\n memoizedUpdateScroll(scroll.x, scroll.y);\n }, [getClosestScroll, memoizedUpdateScroll]);\n const scheduleScrollUpdate = useMemo(() => rafSchd(updateScroll), [updateScroll]);\n const onClosestScroll = useCallback(() => {\n const dragging = whileDraggingRef.current;\n const closest = getClosestScrollableFromDrag(dragging);\n !(dragging && closest) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find scroll options while scrolling') : invariant() : void 0;\n const options = dragging.scrollOptions;\n if (options.shouldPublishImmediately) {\n updateScroll();\n return;\n }\n scheduleScrollUpdate();\n }, [scheduleScrollUpdate, updateScroll]);\n const getDimensionAndWatchScroll = useCallback((windowScroll, options) => {\n !!whileDraggingRef.current ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot collect a droppable while a drag is occurring') : invariant() : void 0;\n const previous = previousRef.current;\n const ref = previous.getDroppableRef();\n !ref ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot collect without a droppable ref') : invariant() : void 0;\n const env = getEnv(ref);\n const dragging = {\n ref,\n descriptor,\n env,\n scrollOptions: options\n };\n whileDraggingRef.current = dragging;\n const dimension = getDimension({\n ref,\n descriptor,\n env,\n windowScroll,\n direction: previous.direction,\n isDropDisabled: previous.isDropDisabled,\n isCombineEnabled: previous.isCombineEnabled,\n shouldClipSubject: !previous.ignoreContainerClipping\n });\n const scrollable = env.closestScrollable;\n if (scrollable) {\n scrollable.setAttribute(scrollContainer.contextId, appContext.contextId);\n scrollable.addEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));\n if (process.env.NODE_ENV !== 'production') {\n checkForNestedScrollContainers(scrollable);\n }\n }\n return dimension;\n }, [appContext.contextId, descriptor, onClosestScroll, previousRef]);\n const getScrollWhileDragging = useCallback(() => {\n const dragging = whileDraggingRef.current;\n const closest = getClosestScrollableFromDrag(dragging);\n !(dragging && closest) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Can only recollect Droppable client for Droppables that have a scroll container') : invariant() : void 0;\n return getScroll(closest);\n }, []);\n const dragStopped = useCallback(() => {\n const dragging = whileDraggingRef.current;\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot stop drag when no active drag') : invariant() : void 0;\n const closest = getClosestScrollableFromDrag(dragging);\n whileDraggingRef.current = null;\n if (!closest) {\n return;\n }\n scheduleScrollUpdate.cancel();\n closest.removeAttribute(scrollContainer.contextId);\n closest.removeEventListener('scroll', onClosestScroll, getListenerOptions(dragging.scrollOptions));\n }, [onClosestScroll, scheduleScrollUpdate]);\n const scroll = useCallback(change => {\n const dragging = whileDraggingRef.current;\n !dragging ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot scroll when there is no drag') : invariant() : void 0;\n const closest = getClosestScrollableFromDrag(dragging);\n !closest ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Cannot scroll a droppable with no closest scrollable') : invariant() : void 0;\n closest.scrollTop += change.y;\n closest.scrollLeft += change.x;\n }, []);\n const callbacks = useMemo(() => {\n return {\n getDimensionAndWatchScroll,\n getScrollWhileDragging,\n dragStopped,\n scroll\n };\n }, [dragStopped, getDimensionAndWatchScroll, getScrollWhileDragging, scroll]);\n const entry = useMemo(() => ({\n uniqueId,\n descriptor,\n callbacks\n }), [callbacks, descriptor, uniqueId]);\n useIsomorphicLayoutEffect(() => {\n publishedDescriptorRef.current = entry.descriptor;\n registry.droppable.register(entry);\n return () => {\n if (whileDraggingRef.current) {\n process.env.NODE_ENV !== \"production\" ? warning('Unsupported: changing the droppableId or type of a Droppable during a drag') : void 0;\n dragStopped();\n }\n registry.droppable.unregister(entry);\n };\n }, [callbacks, descriptor, dragStopped, entry, marshal, registry.droppable]);\n useIsomorphicLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsEnabled(publishedDescriptorRef.current.id, !args.isDropDisabled);\n }, [args.isDropDisabled, marshal]);\n useIsomorphicLayoutEffect(() => {\n if (!whileDraggingRef.current) {\n return;\n }\n marshal.updateDroppableIsCombineEnabled(publishedDescriptorRef.current.id, args.isCombineEnabled);\n }, [args.isCombineEnabled, marshal]);\n}\n\nfunction noop() {}\nconst empty = {\n width: 0,\n height: 0,\n margin: noSpacing\n};\nconst getSize = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate\n}) => {\n if (isAnimatingOpenOnMount) {\n return empty;\n }\n if (animate === 'close') {\n return empty;\n }\n return {\n height: placeholder.client.borderBox.height,\n width: placeholder.client.borderBox.width,\n margin: placeholder.client.margin\n };\n};\nconst getStyle = ({\n isAnimatingOpenOnMount,\n placeholder,\n animate\n}) => {\n const size = getSize({\n isAnimatingOpenOnMount,\n placeholder,\n animate\n });\n return {\n display: placeholder.display,\n boxSizing: 'border-box',\n width: size.width,\n height: size.height,\n marginTop: size.margin.top,\n marginRight: size.margin.right,\n marginBottom: size.margin.bottom,\n marginLeft: size.margin.left,\n flexShrink: '0',\n flexGrow: '0',\n pointerEvents: 'none',\n transition: animate !== 'none' ? transitions.placeholder : null\n };\n};\nconst Placeholder = props => {\n const animateOpenTimerRef = useRef(null);\n const tryClearAnimateOpenTimer = useCallback(() => {\n if (!animateOpenTimerRef.current) {\n return;\n }\n clearTimeout(animateOpenTimerRef.current);\n animateOpenTimerRef.current = null;\n }, []);\n const {\n animate,\n onTransitionEnd,\n onClose,\n contextId\n } = props;\n const [isAnimatingOpenOnMount, setIsAnimatingOpenOnMount] = useState(props.animate === 'open');\n useEffect(() => {\n if (!isAnimatingOpenOnMount) {\n return noop;\n }\n if (animate !== 'open') {\n tryClearAnimateOpenTimer();\n setIsAnimatingOpenOnMount(false);\n return noop;\n }\n if (animateOpenTimerRef.current) {\n return noop;\n }\n animateOpenTimerRef.current = setTimeout(() => {\n animateOpenTimerRef.current = null;\n setIsAnimatingOpenOnMount(false);\n });\n return tryClearAnimateOpenTimer;\n }, [animate, isAnimatingOpenOnMount, tryClearAnimateOpenTimer]);\n const onSizeChangeEnd = useCallback(event => {\n if (event.propertyName !== 'height') {\n return;\n }\n onTransitionEnd();\n if (animate === 'close') {\n onClose();\n }\n }, [animate, onClose, onTransitionEnd]);\n const style = getStyle({\n isAnimatingOpenOnMount,\n animate: props.animate,\n placeholder: props.placeholder\n });\n return React.createElement(props.placeholder.tagName, {\n style,\n 'data-rfd-placeholder-context-id': contextId,\n onTransitionEnd: onSizeChangeEnd,\n ref: props.innerRef\n });\n};\nvar Placeholder$1 = React.memo(Placeholder);\n\nfunction isBoolean(value) {\n return typeof value === 'boolean';\n}\nfunction runChecks(args, checks) {\n checks.forEach(check => check(args));\n}\nconst shared = [function required({\n props\n}) {\n !props.droppableId ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'A Droppable requires a droppableId prop') : invariant() : void 0;\n !(typeof props.droppableId === 'string') ? process.env.NODE_ENV !== \"production\" ? invariant(false, `A Droppable requires a [string] droppableId. Provided: [${typeof props.droppableId}]`) : invariant() : void 0;\n}, function boolean({\n props\n}) {\n !isBoolean(props.isDropDisabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'isDropDisabled must be a boolean') : invariant() : void 0;\n !isBoolean(props.isCombineEnabled) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'isCombineEnabled must be a boolean') : invariant() : void 0;\n !isBoolean(props.ignoreContainerClipping) ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'ignoreContainerClipping must be a boolean') : invariant() : void 0;\n}, function ref({\n getDroppableRef\n}) {\n checkIsValidInnerRef(getDroppableRef());\n}];\nconst standard = [function placeholder({\n props,\n getPlaceholderRef\n}) {\n if (!props.placeholder) {\n return;\n }\n const ref = getPlaceholderRef();\n if (ref) {\n return;\n }\n process.env.NODE_ENV !== \"production\" ? warning(`\n Droppable setup issue [droppableId: \"${props.droppableId}\"]:\n DroppableProvided > placeholder could not be found.\n\n Please be sure to add the {provided.placeholder} React Node as a child of your Droppable.\n More information: https://github.com/hello-pangea/dnd/blob/main/docs/api/droppable.md\n `) : void 0;\n}];\nconst virtual = [function hasClone({\n props\n}) {\n !props.renderClone ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Must provide a clone render function (renderClone) for virtual lists') : invariant() : void 0;\n}, function hasNoPlaceholder({\n getPlaceholderRef\n}) {\n !!getPlaceholderRef() ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Expected virtual list to not have a placeholder') : invariant() : void 0;\n}];\nfunction useValidation(args) {\n useDevSetupWarning(() => {\n runChecks(args, shared);\n if (args.props.mode === 'standard') {\n runChecks(args, standard);\n }\n if (args.props.mode === 'virtual') {\n runChecks(args, virtual);\n }\n });\n}\n\nclass AnimateInOut extends React.PureComponent {\n constructor(...args) {\n super(...args);\n this.state = {\n isVisible: Boolean(this.props.on),\n data: this.props.on,\n animate: this.props.shouldAnimate && this.props.on ? 'open' : 'none'\n };\n this.onClose = () => {\n if (this.state.animate !== 'close') {\n return;\n }\n this.setState({\n isVisible: false\n });\n };\n }\n static getDerivedStateFromProps(props, state) {\n if (!props.shouldAnimate) {\n return {\n isVisible: Boolean(props.on),\n data: props.on,\n animate: 'none'\n };\n }\n if (props.on) {\n return {\n isVisible: true,\n data: props.on,\n animate: 'open'\n };\n }\n if (state.isVisible) {\n return {\n isVisible: true,\n data: state.data,\n animate: 'close'\n };\n }\n return {\n isVisible: false,\n animate: 'close',\n data: null\n };\n }\n render() {\n if (!this.state.isVisible) {\n return null;\n }\n const provided = {\n onClose: this.onClose,\n data: this.state.data,\n animate: this.state.animate\n };\n return this.props.children(provided);\n }\n}\n\nconst Droppable = props => {\n const appContext = useContext(AppContext);\n !appContext ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'Could not find app context') : invariant() : void 0;\n const {\n contextId,\n isMovementAllowed\n } = appContext;\n const droppableRef = useRef(null);\n const placeholderRef = useRef(null);\n const {\n children,\n droppableId,\n type,\n mode,\n direction,\n ignoreContainerClipping,\n isDropDisabled,\n isCombineEnabled,\n snapshot,\n useClone,\n updateViewportMaxScroll,\n getContainerForClone\n } = props;\n const getDroppableRef = useCallback(() => droppableRef.current, []);\n const setDroppableRef = useCallback((value = null) => {\n droppableRef.current = value;\n }, []);\n const getPlaceholderRef = useCallback(() => placeholderRef.current, []);\n const setPlaceholderRef = useCallback((value = null) => {\n placeholderRef.current = value;\n }, []);\n useValidation({\n props,\n getDroppableRef,\n getPlaceholderRef\n });\n const onPlaceholderTransitionEnd = useCallback(() => {\n if (isMovementAllowed()) {\n updateViewportMaxScroll({\n maxScroll: getMaxWindowScroll()\n });\n }\n }, [isMovementAllowed, updateViewportMaxScroll]);\n useDroppablePublisher({\n droppableId,\n type,\n mode,\n direction,\n isDropDisabled,\n isCombineEnabled,\n ignoreContainerClipping,\n getDroppableRef\n });\n const placeholder = useMemo(() => React.createElement(AnimateInOut, {\n on: props.placeholder,\n shouldAnimate: props.shouldAnimatePlaceholder\n }, ({\n onClose,\n data,\n animate\n }) => React.createElement(Placeholder$1, {\n placeholder: data,\n onClose: onClose,\n innerRef: setPlaceholderRef,\n animate: animate,\n contextId: contextId,\n onTransitionEnd: onPlaceholderTransitionEnd\n })), [contextId, onPlaceholderTransitionEnd, props.placeholder, props.shouldAnimatePlaceholder, setPlaceholderRef]);\n const provided = useMemo(() => ({\n innerRef: setDroppableRef,\n placeholder,\n droppableProps: {\n 'data-rfd-droppable-id': droppableId,\n 'data-rfd-droppable-context-id': contextId\n }\n }), [contextId, droppableId, placeholder, setDroppableRef]);\n const isUsingCloneFor = useClone ? useClone.dragging.draggableId : null;\n const droppableContext = useMemo(() => ({\n droppableId,\n type,\n isUsingCloneFor\n }), [droppableId, isUsingCloneFor, type]);\n function getClone() {\n if (!useClone) {\n return null;\n }\n const {\n dragging,\n render\n } = useClone;\n const node = React.createElement(PrivateDraggable, {\n draggableId: dragging.draggableId,\n index: dragging.source.index,\n isClone: true,\n isEnabled: true,\n shouldRespectForcePress: false,\n canDragInteractiveElements: true\n }, (draggableProvided, draggableSnapshot) => render(draggableProvided, draggableSnapshot, dragging));\n return ReactDOM.createPortal(node, getContainerForClone());\n }\n return React.createElement(DroppableContext.Provider, {\n value: droppableContext\n }, children(provided, snapshot), getClone());\n};\n\nfunction getBody() {\n !document.body ? process.env.NODE_ENV !== \"production\" ? invariant(false, 'document.body is not ready') : invariant() : void 0;\n return document.body;\n}\nconst defaultProps = {\n mode: 'standard',\n type: 'DEFAULT',\n direction: 'vertical',\n isDropDisabled: false,\n isCombineEnabled: false,\n ignoreContainerClipping: false,\n renderClone: null,\n getContainerForClone: getBody\n};\nconst attachDefaultPropsToOwnProps = ownProps => {\n let mergedProps = {\n ...ownProps\n };\n let defaultPropKey;\n for (defaultPropKey in defaultProps) {\n if (ownProps[defaultPropKey] === undefined) {\n mergedProps = {\n ...mergedProps,\n [defaultPropKey]: defaultProps[defaultPropKey]\n };\n }\n }\n return mergedProps;\n};\nconst isMatchingType = (type, critical) => type === critical.droppable.type;\nconst getDraggable = (critical, dimensions) => dimensions.draggables[critical.draggable.id];\nconst makeMapStateToProps = () => {\n const idleWithAnimation = {\n placeholder: null,\n shouldAnimatePlaceholder: true,\n snapshot: {\n isDraggingOver: false,\n draggingOverWith: null,\n draggingFromThisWith: null,\n isUsingPlaceholder: false\n },\n useClone: null\n };\n const idleWithoutAnimation = {\n ...idleWithAnimation,\n shouldAnimatePlaceholder: false\n };\n const getDraggableRubric = memoizeOne(descriptor => ({\n draggableId: descriptor.id,\n type: descriptor.type,\n source: {\n index: descriptor.index,\n droppableId: descriptor.droppableId\n }\n }));\n const getMapProps = memoizeOne((id, isEnabled, isDraggingOverForConsumer, isDraggingOverForImpact, dragging, renderClone) => {\n const draggableId = dragging.descriptor.id;\n const isHome = dragging.descriptor.droppableId === id;\n if (isHome) {\n const useClone = renderClone ? {\n render: renderClone,\n dragging: getDraggableRubric(dragging.descriptor)\n } : null;\n const snapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: isDraggingOverForConsumer ? draggableId : null,\n draggingFromThisWith: draggableId,\n isUsingPlaceholder: true\n };\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: false,\n snapshot,\n useClone\n };\n }\n if (!isEnabled) {\n return idleWithoutAnimation;\n }\n if (!isDraggingOverForImpact) {\n return idleWithAnimation;\n }\n const snapshot = {\n isDraggingOver: isDraggingOverForConsumer,\n draggingOverWith: draggableId,\n draggingFromThisWith: null,\n isUsingPlaceholder: true\n };\n return {\n placeholder: dragging.placeholder,\n shouldAnimatePlaceholder: true,\n snapshot,\n useClone: null\n };\n });\n const selector = (state, ownProps) => {\n const ownPropsWithDefaultProps = attachDefaultPropsToOwnProps(ownProps);\n const id = ownPropsWithDefaultProps.droppableId;\n const type = ownPropsWithDefaultProps.type;\n const isEnabled = !ownPropsWithDefaultProps.isDropDisabled;\n const renderClone = ownPropsWithDefaultProps.renderClone;\n if (isDragging(state)) {\n const critical = state.critical;\n if (!isMatchingType(type, critical)) {\n return idleWithoutAnimation;\n }\n const dragging = getDraggable(critical, state.dimensions);\n const isDraggingOver = whatIsDraggedOver(state.impact) === id;\n return getMapProps(id, isEnabled, isDraggingOver, isDraggingOver, dragging, renderClone);\n }\n if (state.phase === 'DROP_ANIMATING') {\n const completed = state.completed;\n if (!isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n const dragging = getDraggable(completed.critical, state.dimensions);\n return getMapProps(id, isEnabled, whatIsDraggedOverFromResult(completed.result) === id, whatIsDraggedOver(completed.impact) === id, dragging, renderClone);\n }\n if (state.phase === 'IDLE' && state.completed && !state.shouldFlush) {\n const completed = state.completed;\n if (!isMatchingType(type, completed.critical)) {\n return idleWithoutAnimation;\n }\n const wasOver = whatIsDraggedOver(completed.impact) === id;\n const wasCombining = Boolean(completed.impact.at && completed.impact.at.type === 'COMBINE');\n const isHome = completed.critical.droppable.id === id;\n if (wasOver) {\n return wasCombining ? idleWithAnimation : idleWithoutAnimation;\n }\n if (isHome) {\n return idleWithAnimation;\n }\n return idleWithoutAnimation;\n }\n return idleWithoutAnimation;\n };\n return selector;\n};\nconst mapDispatchToProps = {\n updateViewportMaxScroll: updateViewportMaxScroll\n};\nconst ConnectedDroppable = connect(makeMapStateToProps, mapDispatchToProps, (stateProps, dispatchProps, ownProps) => {\n return {\n ...attachDefaultPropsToOwnProps(ownProps),\n ...stateProps,\n ...dispatchProps\n };\n}, {\n context: StoreContext,\n areStatePropsEqual: isStrictEqual\n})(Droppable);\n\nexport { DragDropContext, PublicDraggable as Draggable, ConnectedDroppable as Droppable, useKeyboardSensor, useMouseSensor, useTouchSensor };\n","import { Draggable } from \"@hello-pangea/dnd\";\nimport { useRedirect } from \"ra-core\";\nimport { ReferenceField } from \"@/components/admin/reference-field\";\nimport { Card, CardContent } from \"@/components/ui/card\";\n\nimport { CompanyAvatar } from \"../companies/CompanyAvatar\";\nimport type { Deal } from \"../types\";\n\nexport const DealCard = ({ deal, index }: { deal: Deal; index: number }) => {\n if (!deal) return null;\n\n return (\n <Draggable draggableId={String(deal.id)} index={index}>\n {(provided, snapshot) => (\n <DealCardContent provided={provided} snapshot={snapshot} deal={deal} />\n )}\n </Draggable>\n );\n};\n\nexport const DealCardContent = ({\n provided,\n snapshot,\n deal,\n}: {\n provided?: any;\n snapshot?: any;\n deal: Deal;\n}) => {\n const redirect = useRedirect();\n const handleClick = () => {\n redirect(`/deals/${deal.id}/show`, undefined, undefined, undefined, {\n _scrollToTop: false,\n });\n };\n\n return (\n <div\n className=\"cursor-pointer\"\n {...provided?.draggableProps}\n {...provided?.dragHandleProps}\n ref={provided?.innerRef}\n onClick={handleClick}\n >\n <Card\n className={`py-4 transition-all duration-200 ${\n snapshot?.isDragging\n ? \"opacity-90 transform rotate-1 shadow-lg\"\n : \"shadow-sm hover:shadow-md\"\n }`}\n >\n <CardContent className=\"px-4 flex\">\n <ReferenceField\n source=\"company_id\"\n record={deal}\n reference=\"companies\"\n link={false}\n >\n <CompanyAvatar width={20} height={20} />\n </ReferenceField>\n <div className=\"ml-3\">\n <p className=\"text-sm font-medium mb-2\">{deal.name}</p>\n <p className=\"text-xs text-muted-foreground\">\n {deal.amount.toLocaleString(\"en-US\", {\n notation: \"compact\",\n style: \"currency\",\n currency: \"USD\",\n currencyDisplay: \"narrowSymbol\",\n minimumSignificantDigits: 3,\n })}\n {deal.category ? `, ${deal.category}` : \"\"}\n </p>\n </div>\n </CardContent>\n </Card>\n </div>\n );\n};\n","/* eslint-disable react-refresh/only-export-components */\nimport { useGetIdentity, useGetList } from \"ra-core\";\nimport { useEffect, useState } from \"react\";\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\n\nimport type { Deal } from \"../types\";\nimport { DealCardContent } from \"./DealCard\";\n\nexport const DealArchivedList = () => {\n const { identity } = useGetIdentity();\n const {\n data: archivedLists,\n total,\n isPending,\n } = useGetList(\"deals\", {\n pagination: { page: 1, perPage: 1000 },\n sort: { field: \"archived_at\", order: \"DESC\" },\n filter: { \"archived_at@not.is\": null },\n });\n const [openDialog, setOpenDialog] = useState(false);\n\n useEffect(() => {\n if (!isPending && total === 0) {\n setOpenDialog(false);\n }\n }, [isPending, total]);\n\n useEffect(() => {\n setOpenDialog(false);\n }, [archivedLists]);\n\n if (!identity || isPending || !total || !archivedLists) return null;\n\n // Group archived lists by date\n const archivedListsByDate: { [date: string]: Deal[] } = archivedLists.reduce(\n (acc, deal) => {\n const date = new Date(deal.archived_at).toDateString();\n if (!acc[date]) {\n acc[date] = [];\n }\n acc[date].push(deal);\n return acc;\n },\n {} as { [date: string]: Deal[] },\n );\n\n return (\n <div className=\"w-full flex flex-row items-center justify-center\">\n <Button\n variant=\"ghost\"\n onClick={() => setOpenDialog(true)}\n className=\"my-4\"\n >\n View archived deals\n </Button>\n <Dialog open={openDialog} onOpenChange={() => setOpenDialog(false)}>\n <DialogContent className=\"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n <DialogTitle>Archived Deals</DialogTitle>\n <div className=\"flex flex-col gap-8\">\n {Object.entries(archivedListsByDate).map(([date, deals]) => (\n <div key={date} className=\"flex flex-col gap-4\">\n <h4 className=\"font-bold\">{getRelativeTimeString(date)}</h4>\n <div className=\"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8\">\n {deals.map((deal: Deal) => (\n <div key={deal.id}>\n <DealCardContent deal={deal} />\n </div>\n ))}\n </div>\n </div>\n ))}\n </div>\n </DialogContent>\n </Dialog>\n </div>\n );\n};\n\nexport function getRelativeTimeString(dateString: string): string {\n const date = new Date(dateString);\n date.setHours(0, 0, 0, 0);\n\n const today = new Date();\n today.setHours(0, 0, 0, 0);\n\n const diff = date.getTime() - today.getTime();\n const unitDiff = Math.round(diff / (1000 * 60 * 60 * 24));\n\n // Check if the date is more than one week old\n if (Math.abs(unitDiff) > 7) {\n return new Intl.DateTimeFormat(undefined, {\n day: \"numeric\",\n month: \"long\",\n }).format(date);\n }\n\n // Intl.RelativeTimeFormat for dates within the last week\n const rtf = new Intl.RelativeTimeFormat(undefined, { numeric: \"auto\" });\n return ucFirst(rtf.format(unitDiff, \"day\"));\n}\n\nfunction ucFirst(str: string): string {\n return str.charAt(0).toUpperCase() + str.slice(1);\n}\n","import * as React from \"react\"\nimport * as VisuallyHiddenPrimitive from \"@radix-ui/react-visually-hidden\"\n\nfunction VisuallyHidden({\n ...props\n}: React.ComponentProps<typeof VisuallyHiddenPrimitive.Root>) {\n return <VisuallyHiddenPrimitive.Root data-slot=\"visually-hidden\" {...props} />\n}\n\nexport { VisuallyHidden }\n","import { required } from \"ra-core\";\nimport { AutocompleteArrayInput } from \"@/components/admin/autocomplete-array-input\";\nimport { ReferenceArrayInput } from \"@/components/admin/reference-array-input\";\nimport { ReferenceInput } from \"@/components/admin/reference-input\";\nimport { TextInput } from \"@/components/admin/text-input\";\nimport { NumberInput } from \"@/components/admin/number-input\";\nimport { DateInput } from \"@/components/admin/date-input\";\nimport { SelectInput } from \"@/components/admin/select-input\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { useIsMobile } from \"@/hooks/use-mobile\";\n\nimport { contactOptionText } from \"../misc/ContactOption\";\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport { AutocompleteCompanyInput } from \"../companies/AutocompleteCompanyInput.tsx\";\n\nexport const DealInputs = () => {\n const isMobile = useIsMobile();\n return (\n <div className=\"flex flex-col gap-8\">\n <DealInfoInputs />\n\n <div className={`flex gap-6 ${isMobile ? \"flex-col\" : \"flex-row\"}`}>\n <DealLinkedToInputs />\n <Separator orientation={isMobile ? \"horizontal\" : \"vertical\"} />\n <DealMiscInputs />\n </div>\n </div>\n );\n};\n\nconst DealInfoInputs = () => {\n return (\n <div className=\"flex flex-col gap-4 flex-1\">\n <TextInput\n source=\"name\"\n label=\"Deal name\"\n validate={required()}\n helperText={false}\n />\n <TextInput source=\"description\" multiline rows={3} helperText={false} />\n </div>\n );\n};\n\nconst DealLinkedToInputs = () => {\n return (\n <div className=\"flex flex-col gap-4 flex-1\">\n <h3 className=\"text-base font-medium\">Linked to</h3>\n <ReferenceInput source=\"company_id\" reference=\"companies\">\n <AutocompleteCompanyInput validate={required()} />\n </ReferenceInput>\n\n <ReferenceArrayInput source=\"contact_ids\" reference=\"contacts_summary\">\n <AutocompleteArrayInput\n label=\"Contacts\"\n optionText={contactOptionText}\n helperText={false}\n />\n </ReferenceArrayInput>\n </div>\n );\n};\n\nconst DealMiscInputs = () => {\n const { dealStages, dealCategories } = useConfigurationContext();\n return (\n <div className=\"flex flex-col gap-4 flex-1\">\n <h3 className=\"text-base font-medium\">Misc</h3>\n\n <SelectInput\n source=\"category\"\n label=\"Category\"\n choices={dealCategories.map((type) => ({\n id: type,\n name: type,\n }))}\n helperText={false}\n />\n <NumberInput\n source=\"amount\"\n defaultValue={0}\n helperText={false}\n validate={required()}\n />\n <DateInput\n validate={required()}\n source=\"expected_closing_date\"\n helperText={false}\n defaultValue={new Date().toISOString().split(\"T\")[0]}\n />\n <SelectInput\n source=\"stage\"\n choices={dealStages.map((stage) => ({\n id: stage.value,\n name: stage.label,\n }))}\n defaultValue=\"opportunity\"\n helperText={false}\n validate={required()}\n />\n </div>\n );\n};\n","import { useQueryClient } from \"@tanstack/react-query\";\nimport {\n Form,\n useDataProvider,\n useGetIdentity,\n useListContext,\n useRedirect,\n type GetListResult,\n} from \"ra-core\";\nimport { Create } from \"@/components/admin/create\";\nimport { SaveButton } from \"@/components/admin/form\";\nimport { FormToolbar } from \"@/components/admin/simple-form\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\nimport { VisuallyHidden } from \"@/components/ui/visually-hidden\";\n\nimport type { Deal } from \"../types\";\nimport { DealInputs } from \"./DealInputs\";\n\nexport const DealCreate = ({ open }: { open: boolean }) => {\n const redirect = useRedirect();\n const dataProvider = useDataProvider();\n const { data: allDeals } = useListContext<Deal>();\n\n const handleClose = () => {\n redirect(\"/deals\");\n };\n\n const queryClient = useQueryClient();\n\n const onSuccess = async (deal: Deal) => {\n if (!allDeals) {\n redirect(\"/deals\");\n return;\n }\n // increase the index of all deals in the same stage as the new deal\n // first, get the list of deals in the same stage\n const deals = allDeals.filter(\n (d: Deal) => d.stage === deal.stage && d.id !== deal.id,\n );\n // update the actual deals in the database\n await Promise.all(\n deals.map(async (oldDeal) =>\n dataProvider.update(\"deals\", {\n id: oldDeal.id,\n data: { index: oldDeal.index + 1 },\n previousData: oldDeal,\n }),\n ),\n );\n // refresh the list of deals in the cache as we used dataProvider.update(),\n // which does not update the cache\n const dealsById = deals.reduce(\n (acc, d) => ({\n ...acc,\n [d.id]: { ...d, index: d.index + 1 },\n }),\n {} as { [key: string]: Deal },\n );\n const now = Date.now();\n queryClient.setQueriesData<GetListResult | undefined>(\n { queryKey: [\"deals\", \"getList\"] },\n (res) => {\n if (!res) return res;\n return {\n ...res,\n data: res.data.map((d: Deal) => dealsById[d.id] || d),\n };\n },\n { updatedAt: now },\n );\n redirect(\"/deals\");\n };\n\n const { identity } = useGetIdentity();\n\n return (\n <Dialog open={open} onOpenChange={() => handleClose()}>\n <DialogContent className=\"lg:max-w-4xl overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n <VisuallyHidden>\n <DialogTitle>Create Deal</DialogTitle>\n </VisuallyHidden>\n <Create resource=\"deals\" mutationOptions={{ onSuccess }}>\n <Form\n defaultValues={{\n sales_id: identity?.id,\n contact_ids: [],\n index: 0,\n }}\n >\n <DealInputs />\n <FormToolbar>\n <SaveButton />\n </FormToolbar>\n </Form>\n </Create>\n </DialogContent>\n </Dialog>\n );\n};\n","import {\n EditBase,\n Form,\n useNotify,\n useRecordContext,\n useRedirect,\n} from \"ra-core\";\nimport { Link } from \"react-router\";\nimport { DeleteButton } from \"@/components/admin/delete-button\";\nimport { ReferenceField } from \"@/components/admin/reference-field\";\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\n\nimport { FormToolbar } from \"../layout/FormToolbar\";\nimport { CompanyAvatar } from \"../companies/CompanyAvatar\";\nimport type { Deal } from \"../types\";\nimport { DealInputs } from \"./DealInputs\";\n\nexport const DealEdit = ({ open, id }: { open: boolean; id?: string }) => {\n const redirect = useRedirect();\n const notify = useNotify();\n\n const handleClose = () => {\n redirect(\"/deals\", undefined, undefined, undefined, {\n _scrollToTop: false,\n });\n };\n\n return (\n <Dialog open={open} onOpenChange={() => handleClose()}>\n <DialogContent className=\"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n {id ? (\n <EditBase\n id={id}\n mutationMode=\"pessimistic\"\n mutationOptions={{\n onSuccess: () => {\n notify(\"Deal updated\");\n redirect(`/deals/${id}/show`, undefined, undefined, undefined, {\n _scrollToTop: false,\n });\n },\n }}\n >\n <EditHeader />\n <Form>\n <DealInputs />\n <FormToolbar />\n </Form>\n </EditBase>\n ) : null}\n </DialogContent>\n </Dialog>\n );\n};\n\nfunction EditHeader() {\n const deal = useRecordContext<Deal>();\n if (!deal) {\n return null;\n }\n\n return (\n <DialogTitle className=\"pb-0\">\n <div className=\"flex justify-between items-start mb-8\">\n <div className=\"flex items-center gap-4\">\n <ReferenceField source=\"company_id\" reference=\"companies\" link=\"show\">\n <CompanyAvatar />\n </ReferenceField>\n <h2 className=\"text-2xl font-semibold\">Edit {deal.name} deal</h2>\n </div>\n <div className=\"flex gap-2 pr-12\">\n <DeleteButton />\n <Button asChild variant=\"outline\" className=\"h-9\">\n <Link to={`/deals/${deal.id}/show`}>Back to deal</Link>\n </Button>\n </div>\n </div>\n </DialogTitle>\n );\n}\n","import { useGetList } from \"ra-core\";\nimport { matchPath, useLocation, Link } from \"react-router\";\nimport type { ReactNode } from \"react\";\nimport { CreateButton } from \"@/components/admin/create-button\";\nimport { Progress } from \"@/components/ui/progress\";\n\nimport useAppBarHeight from \"../misc/useAppBarHeight\";\nimport type { Contact } from \"../types\";\nimport { DealCreate } from \"./DealCreate\";\n\nexport const DealEmpty = ({ children }: { children?: ReactNode }) => {\n const location = useLocation();\n const matchCreate = matchPath(\"/deals/create\", location.pathname);\n const appbarHeight = useAppBarHeight();\n\n // get Contact data\n const { data: contacts, isPending: contactsLoading } = useGetList<Contact>(\n \"contacts\",\n {\n pagination: { page: 1, perPage: 1 },\n },\n );\n\n if (contactsLoading) return <Progress value={50} />;\n\n return (\n <div\n className=\"flex flex-col justify-center items-center gap-12\"\n style={{\n height: `calc(100dvh - ${appbarHeight}px)`,\n }}\n >\n <img src=\"./img/empty.svg\" alt=\"No deals found\" />\n {contacts && contacts.length > 0 ? (\n <>\n <div className=\"flex flex-col items-center gap-0\">\n <h3 className=\"text-lg font-bold\">No deals found</h3>\n <p className=\"text-sm text-center text-muted-foreground mb-4\">\n It seems your deal list is empty.\n </p>\n </div>\n <div className=\"flex space-x-8\">\n <CreateButton label=\"Create deal\" />\n </div>\n <DealCreate open={!!matchCreate} />\n {children}\n </>\n ) : (\n <div className=\"flex flex-col items-center gap-0\">\n <h3 className=\"text-lg font-bold\">No deals found</h3>\n <p className=\"text-sm text-center text-muted-foreground mb-4\">\n It seems your contact list is empty.\n <br />\n <Link to=\"/contacts/create\" className=\"hover:underline\">\n Add your first contact\n </Link>{\" \"}\n before creating a deal.\n </p>\n </div>\n )}\n </div>\n );\n};\n","import { Droppable } from \"@hello-pangea/dnd\";\n\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\nimport { findDealLabel } from \"./deal\";\nimport { DealCard } from \"./DealCard\";\n\nexport const DealColumn = ({\n stage,\n deals,\n}: {\n stage: string;\n deals: Deal[];\n}) => {\n const totalAmount = deals.reduce((sum, deal) => sum + deal.amount, 0);\n\n const { dealStages } = useConfigurationContext();\n return (\n <div className=\"flex-1 pb-8\">\n <div className=\"flex flex-col items-center\">\n <h3 className=\"text-base font-medium\">\n {findDealLabel(dealStages, stage)}\n </h3>\n <p className=\"text-sm text-muted-foreground\">\n {totalAmount.toLocaleString(\"en-US\", {\n notation: \"compact\",\n style: \"currency\",\n currency: \"USD\",\n currencyDisplay: \"narrowSymbol\",\n minimumSignificantDigits: 3,\n })}\n </p>\n </div>\n <Droppable droppableId={stage}>\n {(droppableProvided, snapshot) => (\n <div\n ref={droppableProvided.innerRef}\n {...droppableProvided.droppableProps}\n className={`flex flex-col rounded-2xl mt-2 gap-2 ${\n snapshot.isDraggingOver ? \"bg-muted\" : \"\"\n }`}\n >\n {deals.map((deal, index) => (\n <DealCard key={deal.id} deal={deal} index={index} />\n ))}\n {droppableProvided.placeholder}\n </div>\n )}\n </Droppable>\n </div>\n );\n};\n","import type { ConfigurationContextValue } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\n\nexport type DealsByStage = Record<Deal[\"stage\"], Deal[]>;\n\nexport const getDealsByStage = (\n unorderedDeals: Deal[],\n dealStages: ConfigurationContextValue[\"dealStages\"],\n) => {\n if (!dealStages) return {};\n const dealsByStage: Record<Deal[\"stage\"], Deal[]> = unorderedDeals.reduce(\n (acc, deal) => {\n if (acc[deal.stage]) {\n acc[deal.stage].push(deal);\n }\n return acc;\n },\n dealStages.reduce(\n (obj, stage) => ({ ...obj, [stage.value]: [] }),\n {} as Record<Deal[\"stage\"], Deal[]>,\n ),\n );\n // order each column by index\n dealStages.forEach((stage) => {\n dealsByStage[stage.value] = dealsByStage[stage.value].sort(\n (recordA: Deal, recordB: Deal) => recordA.index - recordB.index,\n );\n });\n return dealsByStage;\n};\n","import { DragDropContext, type OnDragEndResponder } from \"@hello-pangea/dnd\";\nimport isEqual from \"lodash/isEqual\";\nimport { useDataProvider, useListContext, type DataProvider } from \"ra-core\";\nimport { useEffect, useState } from \"react\";\n\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\nimport { DealColumn } from \"./DealColumn\";\nimport type { DealsByStage } from \"./stages\";\nimport { getDealsByStage } from \"./stages\";\n\nexport const DealListContent = () => {\n const { dealStages } = useConfigurationContext();\n const { data: unorderedDeals, isPending, refetch } = useListContext<Deal>();\n const dataProvider = useDataProvider();\n\n const [dealsByStage, setDealsByStage] = useState<DealsByStage>(\n getDealsByStage([], dealStages),\n );\n\n useEffect(() => {\n if (unorderedDeals) {\n const newDealsByStage = getDealsByStage(unorderedDeals, dealStages);\n if (!isEqual(newDealsByStage, dealsByStage)) {\n setDealsByStage(newDealsByStage);\n }\n }\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [unorderedDeals]);\n\n if (isPending) return null;\n\n const onDragEnd: OnDragEndResponder = (result) => {\n const { destination, source } = result;\n\n if (!destination) {\n return;\n }\n\n if (\n destination.droppableId === source.droppableId &&\n destination.index === source.index\n ) {\n return;\n }\n\n const sourceStage = source.droppableId;\n const destinationStage = destination.droppableId;\n const sourceDeal = dealsByStage[sourceStage][source.index]!;\n const destinationDeal = dealsByStage[destinationStage][\n destination.index\n ] ?? {\n stage: destinationStage,\n index: undefined, // undefined if dropped after the last item\n };\n\n // compute local state change synchronously\n setDealsByStage(\n updateDealStageLocal(\n sourceDeal,\n { stage: sourceStage, index: source.index },\n { stage: destinationStage, index: destination.index },\n dealsByStage,\n ),\n );\n\n // persist the changes\n updateDealStage(sourceDeal, destinationDeal, dataProvider).then(() => {\n refetch();\n });\n };\n\n return (\n <DragDropContext onDragEnd={onDragEnd}>\n <div className=\"flex gap-4\">\n {dealStages.map((stage) => (\n <DealColumn\n stage={stage.value}\n deals={dealsByStage[stage.value]}\n key={stage.value}\n />\n ))}\n </div>\n </DragDropContext>\n );\n};\n\nconst updateDealStageLocal = (\n sourceDeal: Deal,\n source: { stage: string; index: number },\n destination: {\n stage: string;\n index?: number; // undefined if dropped after the last item\n },\n dealsByStage: DealsByStage,\n) => {\n if (source.stage === destination.stage) {\n // moving deal inside the same column\n const column = dealsByStage[source.stage];\n column.splice(source.index, 1);\n column.splice(destination.index ?? column.length + 1, 0, sourceDeal);\n return {\n ...dealsByStage,\n [destination.stage]: column,\n };\n } else {\n // moving deal across columns\n const sourceColumn = dealsByStage[source.stage];\n const destinationColumn = dealsByStage[destination.stage];\n sourceColumn.splice(source.index, 1);\n destinationColumn.splice(\n destination.index ?? destinationColumn.length + 1,\n 0,\n sourceDeal,\n );\n return {\n ...dealsByStage,\n [source.stage]: sourceColumn,\n [destination.stage]: destinationColumn,\n };\n }\n};\n\nconst updateDealStage = async (\n source: Deal,\n destination: {\n stage: string;\n index?: number; // undefined if dropped after the last item\n },\n dataProvider: DataProvider,\n) => {\n if (source.stage === destination.stage) {\n // moving deal inside the same column\n // Fetch all the deals in this stage (because the list may be filtered, but we need to update even non-filtered deals)\n const { data: columnDeals } = await dataProvider.getList(\"deals\", {\n sort: { field: \"index\", order: \"ASC\" },\n pagination: { page: 1, perPage: 100 },\n filter: { stage: source.stage },\n });\n const destinationIndex = destination.index ?? columnDeals.length + 1;\n\n if (source.index > destinationIndex) {\n // deal moved up, eg\n // dest src\n // <------\n // [4, 7, 23, 5]\n await Promise.all([\n // for all deals between destinationIndex and source.index, increase the index\n ...columnDeals\n .filter(\n (deal) =>\n deal.index >= destinationIndex && deal.index < source.index,\n )\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index + 1 },\n previousData: deal,\n }),\n ),\n // for the deal that was moved, update its index\n dataProvider.update(\"deals\", {\n id: source.id,\n data: { index: destinationIndex },\n previousData: source,\n }),\n ]);\n } else {\n // deal moved down, e.g\n // src dest\n // ------>\n // [4, 7, 23, 5]\n await Promise.all([\n // for all deals between source.index and destinationIndex, decrease the index\n ...columnDeals\n .filter(\n (deal) =>\n deal.index <= destinationIndex && deal.index > source.index,\n )\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index - 1 },\n previousData: deal,\n }),\n ),\n // for the deal that was moved, update its index\n dataProvider.update(\"deals\", {\n id: source.id,\n data: { index: destinationIndex },\n previousData: source,\n }),\n ]);\n }\n } else {\n // moving deal across columns\n // Fetch all the deals in both stages (because the list may be filtered, but we need to update even non-filtered deals)\n const [{ data: sourceDeals }, { data: destinationDeals }] =\n await Promise.all([\n dataProvider.getList(\"deals\", {\n sort: { field: \"index\", order: \"ASC\" },\n pagination: { page: 1, perPage: 100 },\n filter: { stage: source.stage },\n }),\n dataProvider.getList(\"deals\", {\n sort: { field: \"index\", order: \"ASC\" },\n pagination: { page: 1, perPage: 100 },\n filter: { stage: destination.stage },\n }),\n ]);\n const destinationIndex = destination.index ?? destinationDeals.length + 1;\n\n await Promise.all([\n // decrease index on the deals after the source index in the source columns\n ...sourceDeals\n .filter((deal) => deal.index > source.index)\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index - 1 },\n previousData: deal,\n }),\n ),\n // increase index on the deals after the destination index in the destination columns\n ...destinationDeals\n .filter((deal) => deal.index >= destinationIndex)\n .map((deal) =>\n dataProvider.update(\"deals\", {\n id: deal.id,\n data: { index: deal.index + 1 },\n previousData: deal,\n }),\n ),\n // change the dragged deal to take the destination index and column\n dataProvider.update(\"deals\", {\n id: source.id,\n data: {\n index: destinationIndex,\n stage: destination.stage,\n },\n previousData: source,\n }),\n ]);\n }\n};\n","import { useListContext } from \"ra-core\";\nimport { Link as RouterLink } from \"react-router\";\n\nimport { Avatar } from \"../contacts/Avatar\";\n\nexport const ContactList = () => {\n const { data, error, isPending } = useListContext();\n if (isPending || error) return <div className=\"h-8\" />;\n return (\n <div className=\"flex flex-row flex-wrap gap-4 mt-4\">\n {data.map((contact) => (\n <div className=\"flex flex-row gap-4 items-center\" key={contact.id}>\n <Avatar record={contact} />\n <div className=\"flex flex-col\">\n <RouterLink\n to={`/contacts/${contact.id}/show`}\n className=\"text-sm hover:underline\"\n >\n {contact.first_name} {contact.last_name}\n </RouterLink>\n <span className=\"text-xs text-muted-foreground\">\n {contact.title}\n {contact.title && contact.company_name && \" at \"}\n {contact.company_name}\n </span>\n </div>\n </div>\n ))}\n </div>\n );\n};\n","import { useMutation } from \"@tanstack/react-query\";\nimport { format, isValid } from \"date-fns\";\nimport { Archive, ArchiveRestore } from \"lucide-react\";\nimport {\n ShowBase,\n useDataProvider,\n useNotify,\n useRecordContext,\n useRedirect,\n useRefresh,\n useUpdate,\n} from \"ra-core\";\nimport { DeleteButton } from \"@/components/admin/delete-button\";\nimport { EditButton } from \"@/components/admin/edit-button\";\nimport { ReferenceArrayField } from \"@/components/admin/reference-array-field\";\nimport { ReferenceField } from \"@/components/admin/reference-field\";\nimport { ReferenceManyField } from \"@/components/admin/reference-many-field\";\nimport { Badge } from \"@/components/ui/badge\";\nimport { Button } from \"@/components/ui/button\";\nimport { Dialog, DialogContent, DialogTitle } from \"@/components/ui/dialog\";\nimport { Separator } from \"@/components/ui/separator\";\nimport { VisuallyHidden } from \"@/components/ui/visually-hidden\";\n\nimport { CompanyAvatar } from \"../companies/CompanyAvatar\";\nimport { NoteCreate } from \"../notes/NoteCreate\";\nimport { NotesIterator } from \"../notes/NotesIterator\";\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport type { Deal } from \"../types\";\nimport { ContactList } from \"./ContactList\";\nimport { findDealLabel } from \"./deal\";\n\nexport const DealShow = ({ open, id }: { open: boolean; id?: string }) => {\n const redirect = useRedirect();\n const handleClose = () => {\n redirect(\"list\", \"deals\");\n };\n\n return (\n <Dialog open={open} onOpenChange={(open) => !open && handleClose()}>\n <DialogContent className=\"lg:max-w-4xl p-4 overflow-y-auto max-h-9/10 top-1/20 translate-y-0\">\n <VisuallyHidden>\n <DialogTitle>Deal Details</DialogTitle>\n </VisuallyHidden>\n {id ? (\n <ShowBase id={id}>\n <DealShowContent />\n </ShowBase>\n ) : null}\n </DialogContent>\n </Dialog>\n );\n};\n\nconst DealShowContent = () => {\n const { dealStages } = useConfigurationContext();\n const record = useRecordContext<Deal>();\n if (!record) return null;\n\n return (\n <>\n <div className=\"space-y-2\">\n {record.archived_at ? <ArchivedTitle /> : null}\n <div className=\"flex-1\">\n <div className=\"flex justify-between items-start mb-8\">\n <div className=\"flex items-center gap-4\">\n <ReferenceField\n source=\"company_id\"\n reference=\"companies\"\n link=\"show\"\n >\n <CompanyAvatar />\n </ReferenceField>\n <h2 className=\"text-2xl font-semibold\">{record.name}</h2>\n </div>\n <div className={`flex gap-2 ${record.archived_at ? \"\" : \"pr-12\"}`}>\n {record.archived_at ? (\n <>\n <UnarchiveButton record={record} />\n <DeleteButton />\n </>\n ) : (\n <>\n <ArchiveButton record={record} />\n <EditButton />\n </>\n )}\n </div>\n </div>\n\n <div className=\"flex gap-8 m-4\">\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Expected closing date\n </span>\n <div className=\"flex items-center gap-2\">\n <span className=\"text-sm\">\n {isValid(new Date(record.expected_closing_date))\n ? format(new Date(record.expected_closing_date), \"PP\")\n : \"Invalid date\"}\n </span>\n {new Date(record.expected_closing_date) < new Date() ? (\n <Badge variant=\"destructive\">Past</Badge>\n ) : null}\n </div>\n </div>\n\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Budget\n </span>\n <span className=\"text-sm\">\n {record.amount.toLocaleString(\"en-US\", {\n notation: \"compact\",\n style: \"currency\",\n currency: \"USD\",\n currencyDisplay: \"narrowSymbol\",\n minimumSignificantDigits: 3,\n })}\n </span>\n </div>\n\n {record.category && (\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Category\n </span>\n <span className=\"text-sm\">{record.category}</span>\n </div>\n )}\n\n <div className=\"flex flex-col mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Stage\n </span>\n <span className=\"text-sm\">\n {findDealLabel(dealStages, record.stage)}\n </span>\n </div>\n </div>\n\n {!!record.contact_ids?.length && (\n <div className=\"m-4\">\n <div className=\"flex flex-col min-h-12 mr-10\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Contacts\n </span>\n <ReferenceArrayField\n source=\"contact_ids\"\n reference=\"contacts_summary\"\n >\n <ContactList />\n </ReferenceArrayField>\n </div>\n </div>\n )}\n\n {record.description && (\n <div className=\"m-4 whitespace-pre-line\">\n <span className=\"text-xs text-muted-foreground tracking-wide\">\n Description\n </span>\n <p className=\"text-sm leading-6\">{record.description}</p>\n </div>\n )}\n\n <div className=\"m-4\">\n <Separator className=\"mb-4\" />\n <ReferenceManyField\n target=\"deal_id\"\n reference=\"dealNotes\"\n sort={{ field: \"date\", order: \"DESC\" }}\n empty={<NoteCreate reference={\"deals\"} />}\n >\n <NotesIterator reference=\"deals\" />\n </ReferenceManyField>\n </div>\n </div>\n </div>\n </>\n );\n};\n\nconst ArchivedTitle = () => (\n <div className=\"bg-orange-500 px-6 py-4\">\n <h3 className=\"text-lg font-bold text-white\">Archived Deal</h3>\n </div>\n);\n\nconst ArchiveButton = ({ record }: { record: Deal }) => {\n const [update] = useUpdate();\n const redirect = useRedirect();\n const notify = useNotify();\n const refresh = useRefresh();\n const handleClick = () => {\n update(\n \"deals\",\n {\n id: record.id,\n data: { archived_at: new Date().toISOString() },\n previousData: record,\n },\n {\n onSuccess: () => {\n redirect(\"list\", \"deals\");\n notify(\"Deal archived\", { type: \"info\", undoable: false });\n refresh();\n },\n onError: () => {\n notify(\"Error: deal not archived\", { type: \"error\" });\n },\n },\n );\n };\n\n return (\n <Button\n onClick={handleClick}\n size=\"sm\"\n variant=\"outline\"\n className=\"flex items-center gap-2 h-9\"\n >\n <Archive className=\"w-4 h-4\" />\n Archive\n </Button>\n );\n};\n\nconst UnarchiveButton = ({ record }: { record: Deal }) => {\n const dataProvider = useDataProvider();\n const redirect = useRedirect();\n const notify = useNotify();\n const refresh = useRefresh();\n\n const { mutate } = useMutation({\n mutationFn: () => dataProvider.unarchiveDeal(record),\n onSuccess: () => {\n redirect(\"list\", \"deals\");\n notify(\"Deal unarchived\", {\n type: \"info\",\n undoable: false,\n });\n refresh();\n },\n onError: () => {\n notify(\"Error: deal not unarchived\", { type: \"error\" });\n },\n });\n\n const handleClick = () => {\n mutate();\n };\n\n return (\n <Button\n onClick={handleClick}\n size=\"sm\"\n variant=\"outline\"\n className=\"flex items-center gap-2 h-9\"\n >\n <ArchiveRestore className=\"w-4 h-4\" />\n Send back to the board\n </Button>\n );\n};\n","import { useGetIdentity, useListFilterContext } from \"ra-core\";\nimport { Label } from \"@/components/ui/label\";\nimport { Switch } from \"@/components/ui/switch\";\n\nexport const OnlyMineInput = (_: { alwaysOn: boolean; source: string }) => {\n const { filterValues, displayedFilters, setFilters } = useListFilterContext();\n const { identity } = useGetIdentity();\n\n const handleChange = () => {\n const newFilterValues = { ...filterValues };\n if (typeof filterValues.sales_id !== \"undefined\") {\n delete newFilterValues.sales_id;\n } else {\n newFilterValues.sales_id = identity && identity?.id;\n }\n setFilters(newFilterValues, displayedFilters);\n };\n return (\n <div className=\"mt-auto pb-2.25\">\n <div className=\"flex items-center space-x-2\">\n <Switch\n id=\"only-mine\"\n checked={typeof filterValues.sales_id !== \"undefined\"}\n onCheckedChange={handleChange}\n />\n <Label htmlFor=\"only-mine\">Only companies I manage</Label>\n </div>\n </div>\n );\n};\n","import { useGetIdentity, useListContext } from \"ra-core\";\nimport { matchPath, useLocation } from \"react-router\";\nimport { AutocompleteInput } from \"@/components/admin/autocomplete-input\";\nimport { CreateButton } from \"@/components/admin/create-button\";\nimport { ExportButton } from \"@/components/admin/export-button\";\nimport { List } from \"@/components/admin/list\";\nimport { ReferenceInput } from \"@/components/admin/reference-input\";\nimport { FilterButton } from \"@/components/admin/filter-form\";\nimport { SearchInput } from \"@/components/admin/search-input\";\nimport { SelectInput } from \"@/components/admin/select-input\";\nimport { Skeleton } from \"@/components/ui/skeleton\";\nimport { Card } from \"@/components/ui/card\";\n\nimport { useConfigurationContext } from \"../root/ConfigurationContext\";\nimport { TopToolbar } from \"../layout/TopToolbar\";\nimport { DealArchivedList } from \"./DealArchivedList\";\nimport { DealCreate } from \"./DealCreate\";\nimport { DealEdit } from \"./DealEdit\";\nimport { DealEmpty } from \"./DealEmpty\";\nimport { DealListContent } from \"./DealListContent\";\nimport { DealShow } from \"./DealShow\";\nimport { OnlyMineInput } from \"./OnlyMineInput\";\n\nconst DealList = () => {\n const { dealCategories } = useConfigurationContext();\n\n const dealFilters = [\n <SearchInput source=\"q\" alwaysOn />,\n <ReferenceInput source=\"company_id\" reference=\"companies\">\n <AutocompleteInput label={false} placeholder=\"Company\" />\n </ReferenceInput>,\n <SelectInput\n source=\"category\"\n emptyText=\"Category\"\n choices={dealCategories.map((type) => ({ id: type, name: type }))}\n />,\n <OnlyMineInput source=\"sales_id\" alwaysOn />,\n ];\n\n return (\n <List\n perPage={100}\n filter={{ \"archived_at@is\": null }}\n title={false}\n sort={{ field: \"index\", order: \"DESC\" }}\n filters={dealFilters}\n actions={<DealActions />}\n pagination={null}\n >\n <DealLayout />\n </List>\n );\n};\n\nconst DealLayout = () => {\n const location = useLocation();\n const matchCreate = matchPath(\"/deals/create\", location.pathname);\n const matchShow = matchPath(\"/deals/:id/show\", location.pathname);\n const matchEdit = matchPath(\"/deals/:id\", location.pathname);\n\n const { data, isPending, filterValues } = useListContext();\n const { identity } = useGetIdentity();\n const hasFilters = filterValues && Object.keys(filterValues).length > 0;\n\n // Show loading skeleton while identity or data is loading\n if (!identity || isPending) {\n return (\n <div className=\"w-full\">\n <Card className=\"p-4\">\n <div className=\"flex gap-4\">\n <Skeleton className=\"h-96 w-1/4\" />\n <Skeleton className=\"h-96 w-1/4\" />\n <Skeleton className=\"h-96 w-1/4\" />\n <Skeleton className=\"h-96 w-1/4\" />\n </div>\n </Card>\n </div>\n );\n }\n\n if (!data?.length && !hasFilters)\n return (\n <>\n <DealEmpty>\n <DealShow open={!!matchShow} id={matchShow?.params.id} />\n <DealArchivedList />\n </DealEmpty>\n </>\n );\n\n return (\n <div className=\"w-full\">\n <DealListContent />\n <DealArchivedList />\n <DealCreate open={!!matchCreate} />\n <DealEdit open={!!matchEdit && !matchCreate} id={matchEdit?.params.id} />\n <DealShow open={!!matchShow} id={matchShow?.params.id} />\n </div>\n );\n};\n\nconst DealActions = () => (\n <TopToolbar>\n <FilterButton />\n <ExportButton />\n <CreateButton label=\"New Deal\" />\n </TopToolbar>\n);\n\nexport default DealList;\n"],"names":["__assign","t","s","i","n","p","__rest","e","__spreadArray","to","from","pack","l","ar","useReferenceArrayInputController","__name","props","_a","debounce","enableGetChoices","filter","_b","initialPage","_c","initialPerPage","_d","initialSort","_e","queryOptions","reference","source","getValues","useFormContext","finalSource","useWrappedSource","value","useWatch","meta","otherQueryOptions","_f","useGetManyAggregate","EmptyArray","referenceRecords","errorGetMany","isLoadingGetMany","isFetchingGetMany","isPausedGetMany","isPendingGetMany","isPlaceholderDataGetMany","refetchGetMany","_g","useReferenceParams","params","paramsModifiers","finalReferenceRecords","isGetMatchingEnabled","_h","useGetList","previousData","matchingReferences","total","pageInfo","errorGetList","isLoadingGetList","isFetchingGetList","isPausedGetList","isPendingGetList","isPlaceholderDataGetList","refetchGetMatching","finalMatchingReferences","mergeReferences","refetch","useCallback","currentSort","useMemo","ref1","ref2","res","ids","ref","__iconNode","ArchiveRestore","createLucideIcon","Archive","AutocompleteArrayInput","filterToQuery","DefaultFilterToQuery","inputText","allChoices","resource","isFromReference","setFilters","useChoicesContext","id","field","isRequired","useInput","translate","useTranslate","placeholder","getRecordRepresentation","useGetRecordRepresentation","getChoiceText","getChoiceValue","useChoices","inputRef","React.useRef","open","setOpen","React.useState","handleUnselect","useEvent","choice","v","handleKeyDown","input","availableChoices","selectedChoices","filterValue","setFilterValue","getInputText","selectedChoice","jsxs","FormField","jsx","FormLabel","FieldTitle","FormControl","Command","Badge","X","CommandPrimitive","CommandList","CommandGroup","CommandItem","InputHelperText","FormError","searchText","ReferenceArrayInput","children","defaultChildren","sort","defaultFilter","React.Children","controllerProps","ResourceContextProvider","ChoicesContextProvider","NumberInput","label","className","resourceProp","_validateProp","_formatProp","parse","convertStringToNumber","onFocus","rest","useResourceContext","handleChange","event","numberValue","setValue","useState","hasFocus","handleFocus","handleBlur","useEffect","Input","float","formatProdErrorMessage","code","$$observable","symbol_observable_default","randomString","ActionTypes","actionTypes_default","isPlainObject","obj","proto","createStore","reducer","preloadedState","enhancer","currentReducer","currentState","currentListeners","nextListeners","listenerIdCounter","isDispatching","ensureCanMutateNextListeners","listener","key","getState","subscribe","isSubscribed","listenerId","dispatch","action","replaceReducer","nextReducer","observable","outerSubscribe","observer","observeState","observerAsObserver","bindActionCreator","actionCreator","args","bindActionCreators","actionCreators","boundActionCreators","compose","funcs","arg","a","b","applyMiddleware","middlewares","createStore2","store","middlewareAPI","chain","middleware","React","require$$0","is","x","y","objectIs","useSyncExternalStore","useRef","useDebugValue","useSyncExternalStoreWithSelector_production","getSnapshot","getServerSnapshot","selector","isEqual","instRef","inst","memoizedSelector","nextSnapshot","hasMemo","memoizedSnapshot","currentSelection","memoizedSelection","nextSelection","maybeGetServerSnapshot","withSelectorModule","IS_REACT_19","React.version","REACT_ELEMENT_TYPE","REACT_PORTAL_TYPE","REACT_FRAGMENT_TYPE","REACT_STRICT_MODE_TYPE","REACT_PROFILER_TYPE","REACT_CONSUMER_TYPE","REACT_CONTEXT_TYPE","REACT_FORWARD_REF_TYPE","REACT_SUSPENSE_TYPE","REACT_SUSPENSE_LIST_TYPE","REACT_MEMO_TYPE","REACT_LAZY_TYPE","ForwardRef","Memo","typeOf","object","$$typeof","isMemo","pureFinalPropsSelectorFactory","mapStateToProps","mapDispatchToProps","mergeProps","areStatesEqual","areOwnPropsEqual","areStatePropsEqual","hasRunAtLeastOnce","state","ownProps","stateProps","dispatchProps","mergedProps","handleFirstCall","firstState","firstOwnProps","handleNewPropsAndNewState","handleNewProps","handleNewState","nextStateProps","statePropsChanged","handleSubsequentCalls","nextState","nextOwnProps","propsChanged","stateChanged","finalPropsSelectorFactory","initMapStateToProps","initMapDispatchToProps","initMergeProps","options","wrapMapToPropsConstant","getConstant","constant","constantSelector","getDependsOnOwnProps","mapToProps","wrapMapToPropsFunc","methodName","displayName","proxy","stateOrDispatch","createInvalidArgFactory","name","mapDispatchToPropsFactory","mapStateToPropsFactory","defaultMergeProps","wrapMergePropsFunc","areMergedPropsEqual","hasRunOnce","nextMergedProps","mergePropsFactory","defaultNoopBatch","callback","createListenerCollection","first","last","listeners","nullListeners","createSubscription","parentSub","unsubscribe","subscriptionsAmount","selfSubscribed","addNestedSub","trySubscribe","cleanupListener","removed","tryUnsubscribe","notifyNestedSubs","handleChangeWrapper","subscription","trySubscribeSelf","tryUnsubscribeSelf","canUseDOM","isDOM","isRunningInReactNative","isReactNative","getUseIsomorphicLayoutEffect","React.useLayoutEffect","React.useEffect","useIsomorphicLayoutEffect","shallowEqual","objA","objB","keysA","keysB","REACT_STATICS","KNOWN_STATICS","FORWARD_REF_STATICS","MEMO_STATICS","TYPE_STATICS","getStatics","component","defineProperty","getOwnPropertyNames","getOwnPropertySymbols","getOwnPropertyDescriptor","getPrototypeOf","objectPrototype","hoistNonReactStatics","targetComponent","sourceComponent","inheritedComponent","keys","targetStatics","sourceStatics","descriptor","ContextKey","gT","getContext","React.createContext","contextMap","realContext","ReactReduxContext","NO_SUBSCRIPTION_ARRAY","useIsomorphicLayoutEffectWithArgs","effectFunc","effectArgs","dependencies","captureWrapperProps","lastWrapperProps","lastChildProps","renderIsScheduled","wrapperProps","childPropsFromStoreUpdate","subscribeUpdates","shouldHandleStateChanges","childPropsSelector","isMounted","additionalSubscribeListener","didUnsubscribe","lastThrownError","checkForUpdates","latestStoreState","newChildProps","error","strictEqual","connect","pure","forwardRef","context","Context","WrappedComponent","wrappedComponentName","selectorFactoryOptions","ConnectFunction","propsContext","reactReduxForwardedRef","React.useMemo","reactReduxForwardedRef2","wrapperProps2","ContextToUse","ResultContext","contextValue","React.useContext","didStoreComeFromProps","didStoreComeFromContext","getServerState","subscription2","notifyNestedSubs2","overriddenContextValue","latestSubscriptionCallbackError","actualChildPropsSelector","subscribeForReact","reactListener","actualChildProps","React.useSyncExternalStore","err","renderedWrappedComponent","React.createElement","Connect","React.memo","forwarded","React.forwardRef","connect_default","Provider","providerProps","serverState","previousState","Provider_default","prefix","invariant","condition","message","getRect","_ref","top","right","bottom","left","width","height","rect","expand","target","expandBy","shrink","shrinkBy","shift","shiftBy","noSpacing","createBox","_ref2","borderBox","_ref2$margin","margin","_ref2$border","border","_ref2$padding","padding","marginBox","paddingBox","contentBox","raw","suffix","result","getWindowScroll","offset","original","change","shifted","withScroll","scroll","calculateBox","styles","getBox","el","rafSchd","fn","lastArgs","frameId","wrapperFn","_len","_key","_extends","log","type","noop$2","getOptions","shared","fromBinding","bindEvents","bindings","sharedOptions","unbindings","binding","unbind","prefix$1","_RbdInvariant","RbdInvariant","_ErrorBoundary","callbacks","ErrorBoundary","dragHandleUsageInstructions","position","index","onDragStart","start","withLocation","destination","isInHomeList","startPosition","endPosition","withCombine","combine","onDragUpdate","update","location","returnedToStart","onDragEnd","preset","isEqual$2","second","areInputsEqual","newInputs","lastInputs","getResult","inputs","initial","isFirstRun","committed","cache","origin","add","point1","point2","subtract","isEqual$1","negate","point","patch","line","otherValue","distance","closest$1","points","apply","executeClip","frame","subject","offsetByPosition","spacing","getCorners","scroll$1","increase","axis","withPlaceholder","clip","getSubject","page","scrolled","increased","clipped","scrollDroppable","droppable","newScroll","scrollable","scrollDiff","scrollDisplacement","memoizeOne","resultFn","memoized","newArgs","lastResult","toDroppableMap","droppables","previous","current","toDraggableMap","draggables","toDroppableList","toDraggableList","getDraggablesInsideDroppable","droppableId","draggable","tryGetDestination","impact","tryGetCombine","removeDraggableFromList","remove","list","item","moveToNextCombine","isMovingForward","insideDestination","previousImpact","getImpact","at","all","closestId","withoutDraggable","indexOfClosest","d","proposedIndex","before","isHomeOf","noDisplacedBy","emptyGroups","noImpact","isWithin","lowerBound","upperBound","isPartiallyVisibleThroughFrame","isWithinVertical","isWithinHorizontal","isPartiallyVisibleVertically","isPartiallyVisibleHorizontally","isBiggerVertically","isBiggerHorizontally","isTotallyVisibleThroughFrame","vertical","horizontal","isTotallyVisibleThroughFrameOnAxis","getDroppableDisplaced","displacement","isVisibleInDroppable","isVisibleThroughFrameFn","isVisibleInViewport","viewport","isVisible$1","toBeDisplaced","withDroppableDisplacement","displacedTarget","isPartiallyVisible","isTotallyVisible","isTotallyVisibleOnAxis","getShouldAnimate","forceShouldAnimate","invisible","visible","getTarget","displacedBy","getDisplacementGroups","afterDragging","groups","shouldAnimate","getIndexOfLastItem","indexOfLastItem","goAtEnd","inHomeList","newIndex","calculateReorderImpact","match","withoutDragging","sliceFrom","impacted","didStartAfterCritical","draggableId","afterCritical","fromCombine","combineId","combineWithIndex","fromReorder","currentIndex","firstIndex","lastIndex","moveToNextIndex","wasAt","getCombinedItemDisplacement","displaced","combineWith","isDisplaced","whenCombining","center","displaceBy","distanceFromStartToBorderBoxCenter","box","distanceFromEndToBorderBoxCenter","getCrossAxisBorderBoxCenter","isMoving","goAfter","moveRelativeTo","goBefore","goIntoStart","moveInto","whenReordering","draggablePage","closestAfter","closest","withDisplacement","getResultWithoutDroppableDisplacement","getPageBorderBoxCenterFromImpact","withoutDisplacement","scrollViewport","diff","getDraggables$1","tryGetVisible","speculativelyIncrease","maxScrollChange","scrolledViewport","scrolledDroppable","withViewportScroll","withDroppableScroll","withViewportDisplacement","getClientFromPageBorderBoxCenter","pageBorderBoxCenter","withoutPageScrollChange","isTotallyVisibleInNewLocation","newPageBorderBoxCenter","onlyOnMainAxis","changeNeeded","moveToNextPlace","previousPageBorderBoxCenter","previousClientSelection","cautious","getKnownActive","getBestCrossAxisDroppable","active","isBetweenSourceClipped","candidates","activeOfTarget","isBetweenDestinationClipped","array","contains","getCurrentPageBorderBoxCenter","getCurrentPageBorderBox","getClosestDraggable","distanceToA","distanceToB","getDisplacedBy","getRequiredGrowthForPlaceholder","placeholderSize","availableSpace","needsToGrowBy","sum","dimension","withMaxScroll","max","addPlaceholder","requiredGrowth","added","maxScroll","newFrame","removePlaceholder","oldMaxScroll","moveToNewDroppable","proposed","proposedPageBorderBoxCenter","isGoingBeforeTarget","relativeTo","moveCrossAxis","isOver","whatIsDraggedOver","getDroppableOver$1","moveInDirection","isActuallyOver","isMainAxisMovementAllowed","home","direction","isMovingOnMainAxis","isMovementAllowed","isPositionInFrame","getHasOverlap","getFurthestAway","pageBorderBox","startCenter","sorted","candidate","getDroppableOver","childCenter","crossAxisStart","crossAxisEnd","isContained","isStartContained","isEndContained","offsetRectByPosition","area","getIsDisplaced","atIndex","getReorderImpact","targetRect","targetStart","targetEnd","child","didStartAfterCritical$1","combineThresholdDivisor","getCombineImpact","childRect","threshold","getDragImpact","pageOffset","destinationId","pageBorderBoxWithDroppableScroll","patchDroppableMap","updated","clearUnusedPlaceholder","now","lastDroppable","recomputePlaceholders","cleaned","patched","forcedClientSelection","forcedDimensions","forcedViewport","forcedImpact","scrollJumpRequest","dimensions","clientSelection","client","newImpact","withUpdatedPlaceholders","getDraggables","recompute","getClientBorderBoxCenter","refreshSnap","needsVisibilityCheck","getHomeLocation","getLiftEffect","insideHome","rawIndex","effected","patchDimensionMap","offsetDraggable","offset$1","initialWindowScroll","getFrame","adjustAdditionsForScrollChanges","additions","updatedDroppables","windowScrollChange","modified","droppableScrollChange","totalChange","publishWhileDraggingInVirtual","published","withScrollChange","existing","updatedAdditions","wasOverId","wasOver","onLiftImpact","draggingState","isSnapping","postDroppableChange","isEnabledChanging","removeScrollJumpRequest","idle$2","critical","movementMode","isWindowScrollAllowed","isEnabled","isCombineEnabled","reason","completed","dropDuration","newHomeClientOffset","guard","predicate","beforeInitialCapture","lift$1","initialPublish","publishWhileDragging","collectionStarting","updateDroppableScroll","updateDroppableIsEnabled","updateDroppableIsCombineEnabled","move","moveByWindowScroll","updateViewportMaxScroll","moveUp","moveDown","moveRight","moveLeft","flush","animateDrop","completeDrop","drop","dropPending","dropAnimationFinished","lift","next","request","marshal","style","curves","timings","outOfTheWayTiming","transitions","duration","timing","moveTo","transforms","isCombining","minDropTime","maxDropTime","dropTimeRange","maxDropTimeAtDistance","cancelDropModifier","getDropDuration","distance$1","percentage","withDuration","getNewHomeClientOffset","newClientCenter","getDropImpact","lastImpact","dropMiddleware","didDropInsideDroppable","getWindowScrollBinding","getScrollListener","onWindowScroll","updateScroll","scheduled","isActive","stop","shouldStop$1","scrollListener","getExpiringAnnounce","announce","wasCalled","isExpired","timeoutId","getAsyncMarshal","entries","execute","timerId","entry","shallow","areLocationsEqual","isCombineEqual","isCriticalEqual","isDraggableEqual","isDroppableEqual","withTimings","getDragStart","mode","responder","data","getDefaultMessage","willExpire","getPublisher","getResponders","asyncMarshal","dragging","beforeCapture","beforeStart","hasCriticalChanged","hasLocationChanged","hasGroupingChanged","responders","publisher","dropAnimationFinishMiddleware","dropAnimationFlushOnScrollMiddleware","clear","dimensionMarshalStopper","focus","isWatching","shouldStop","autoScroll","autoScroller","pendingDrop","postActionState","composeEnhancers","dimensionMarshal","focusMarshal","styleMarshal","createStore$1","clean$1","createPublisher","registry","staging","collect","removals","getMaxScroll","scrollHeight","scrollWidth","getDocumentElement","doc","getMaxWindowScroll","getViewport","getInitialPublish","scrollOptions","windowScroll","shouldPublishUpdate","createDimensionMarshal","collection","stopPublishing","subscriber","canStartDrag","scrollWindow","getScrollableDroppables","getScrollableDroppableOver","getBestScrollableDroppable","defaultAutoScrollerOptions","getDistanceThresholds","container","getAutoScrollerOptions","autoScrollerOptions","startScrollingFrom","maxScrollValueAt","getPercentage","startOfRange","endOfRange","range","minScroll","getValueFromDistance","distanceToEdge","thresholds","percentageFromStartScrollingFrom","dampenValueByTime","proposedScroll","dragStartTime","accelerateAt","stopAt","runTime","betweenAccelerateAtAndStopAtPercentage","getValue","shouldUseTimeDampening","getScrollOnAxis","distanceToEdges","adjustForSizeLimits","isTooBigVertically","isTooBigHorizontally","clean","getScroll$1","required","limited","smallestSigned","getOverlap","getRemainder","targetScroll","overlap","canPartiallyScroll","rawMax","smallestChange","canScrollWindow","getWindowOverlap","canScrollDroppable","getDroppableOverlap","getWindowScrollChange","getDroppableScrollChange","createFluidScroller","scheduleWindowScroll","scheduleDroppableScroll","tryScroll","wasScrollNeeded","fakeScrollCallback","createJumpScroller","moveByOffset","scrollDroppableAsMuchAsItCan","whatTheDroppableCanScroll","scrollWindowAsMuchAsItCan","whatTheWindowCanScroll","droppableRemainder","windowRemainder","createAutoScroller","fluidScroller","jumpScroll","dragHandle","base","scrollContainer","makeGetSelector","attribute","getStyles","rules","property","rule","noPointerEvents","getStyles$1","contextId","getSelector","dragHandle$1","grabCursor","draggable$1","transition","droppable$1","useLayoutEffect","getHead","head","createStyleEl","nonce","useStyleMarshal","alwaysRef","dynamicRef","setDynamicStyle","setAlwaysStyle","always","dynamic","dropping","resting","querySelectorAll","parentNode","getWindowFromEl","isHtmlElement","findDragHandle","possible","handle","useFocusMarshal","entriesRef","recordRef","restoreFocusFrameRef","isMountedRef","register","tryGiveFocus","tryGiveFocusTo","tryShiftRecord","redirectTo","tryRestoreFocusRecorded","record","tryRecordFocus","focused","createRegistry","subscribers","cb","notify","findDraggableById","getDraggableById","draggableAPI","findDroppableById","getDroppableById","droppableAPI","useRegistry","StoreContext","getBodyElement","body","visuallyHidden","getId","useAnnouncer","defaults","useUniqueId","getElementId","uniqueId","useHiddenTextElement","text","AppContext","usePrevious","create","lock","isClaimed","claim","abandon","newLock","release","tryAbandon","isDragging","tab","enter","escape","space","pageUp","pageDown","end","arrowLeft","arrowUp","arrowRight","arrowDown","preventedKeys","preventStandardKeyEvents","supportedEventName","eventName","primaryButton","sloppyClickThreshold","isSloppyClickThresholdExceeded","idle$1","getCaptureBindings","cancel","getPhase","setPhase","button","clientX","clientY","phase","pending","actions","useMouseSensor","api","phaseRef","unbindEventsRef","startCaptureBinding","startPendingDrag","preventForcePressBinding","listenForCapture","bindCapturingEvents","noop$1","scrollJumpKeys","getDraggingBindings","useKeyboardSensor","preDrag","isCapturing","idle","timeForLongPress","forcePressThreshold","getWindowBindings","getHandleBindings","touch","shouldRespect","useTouchSensor","unbindTarget","unbindWindow","startDragging","longPressTimerId","interactiveTagNames","isAnInteractiveElement","parent","isEventInInteractiveElement","getBorderBoxCenterPosition","isElement","supportedMatchesName","closestPonyfill","findClosestDragHandleFromEvent","tryGetClosestDraggableIdFromEvent","findDraggable","preventDefault","expected","isLockActive","shouldWarn","canStart","lockAPI","tryStart","forceSensorStop","sourceEvent","getShouldRespectForcePress","tryDispatch","getAction","tryDispatchWhenDragging","finish","fluidLift","move$1","snapLift","abortPreDrag","defaultSensors","useSensorMarshal","customSensors","enableDefaultSensors","useSensors","tryAbandonLock","canGetLock","tryGetLock","forceStop","findClosestDraggableId","findOptionsForDraggable","tryReleaseLock","isLockClaimed","createResponders","onBeforeCapureCallback","flushSync","createAutoScrollerOptions","getStore","lazyRef","App","setCallbacks","sensors","lazyStoreRef","lastPropsRef","dragHandleUsageInstructionsId","lazyDispatch","marshalCallbacks","tryResetStore","appCallbacks","getCanLift","getIsMovementAllowed","appContext","useUniqueContextId","DragDropContext","zIndexOptions","getDraggingTransition","shouldAnimateDragMovement","getDraggingOpacity","isDropAnimating","getShouldDraggingAnimate","getDraggingStyle","transform","getSecondaryStyle","secondary","getStyle$1","mapped","getDimension$1","computedStyles","useDraggablePublisher","getDraggableRef","canDragInteractiveElements","shouldRespectForcePress","getDimension","publishedRef","isFirstPublishRef","DroppableContext","useRequiredContext","useContext","preventHtml5Dnd","Draggable","setRef","getRef","isClone","dropAnimationFinishedAction","forPublisher","dragHandleProps","onMoveEnd","provided","onTransitionEnd","rubric","isStrictEqual","whatIsDraggedOverFromResult","getCombineWithFromResult","getCombineWithFromImpact","getDraggableSelector","memoizedOffset","getMemoizedSnapshot","draggingOver","getMemoizedProps","getSecondarySnapshot","combineTargetFor","atRest","getSecondarySelector","shouldAnimateDisplacement","getFallback","getProps","ownId","draggingId","visualDisplacement","isAfterCriticalInVirtualList","makeMapStateToProps$1","draggingSelector","secondarySelector","mapDispatchToProps$1","ConnectedDraggable","PrivateDraggable","PublicDraggable","isScroll","isAuto","isEither","overflow","isElementScrollable","isBodyScrollable","getClosestScrollable","getScroll","getIsFixed","getEnv","closestScrollable","isFixedOnPage","getDroppableDimension","scrollSize","frameClient","getClient","targetRef","env","isDropDisabled","shouldClipSubject","immediate","delayed","getListenerOptions","getClosestScrollableFromDrag","useDroppablePublisher","whileDraggingRef","previousRef","publishedDescriptorRef","memoizedUpdateScroll","getClosestScroll","scheduleScrollUpdate","onClosestScroll","getDimensionAndWatchScroll","getScrollWhileDragging","dragStopped","noop","empty","getSize","isAnimatingOpenOnMount","animate","getStyle","size","Placeholder","animateOpenTimerRef","tryClearAnimateOpenTimer","onClose","setIsAnimatingOpenOnMount","onSizeChangeEnd","Placeholder$1","_AnimateInOut","AnimateInOut","Droppable","droppableRef","placeholderRef","ignoreContainerClipping","snapshot","useClone","getContainerForClone","getDroppableRef","setDroppableRef","setPlaceholderRef","onPlaceholderTransitionEnd","isUsingCloneFor","droppableContext","getClone","render","node","draggableProvided","draggableSnapshot","ReactDOM","getBody","defaultProps","attachDefaultPropsToOwnProps","defaultPropKey","isMatchingType","getDraggable","makeMapStateToProps","idleWithAnimation","idleWithoutAnimation","getDraggableRubric","getMapProps","isDraggingOverForConsumer","isDraggingOverForImpact","renderClone","ownPropsWithDefaultProps","isDraggingOver","wasCombining","isHome","ConnectedDroppable","DealCard","deal","DealCardContent","redirect","useRedirect","handleClick","Card","CardContent","ReferenceField","CompanyAvatar","DealArchivedList","identity","useGetIdentity","archivedLists","isPending","openDialog","setOpenDialog","archivedListsByDate","acc","date","Button","Dialog","DialogContent","DialogTitle","deals","getRelativeTimeString","dateString","today","unitDiff","rtf","ucFirst","str","VisuallyHidden","VisuallyHiddenPrimitive.Root","DealInputs","isMobile","useIsMobile","DealInfoInputs","DealLinkedToInputs","Separator","DealMiscInputs","TextInput","ReferenceInput","AutocompleteCompanyInput","contactOptionText","dealStages","dealCategories","useConfigurationContext","SelectInput","DateInput","stage","DealCreate","dataProvider","useDataProvider","allDeals","useListContext","handleClose","queryClient","useQueryClient","onSuccess","oldDeal","dealsById","Create","Form","FormToolbar","SaveButton","DealEdit","useNotify","EditBase","EditHeader","useRecordContext","DeleteButton","Link","DealEmpty","useLocation","matchCreate","matchPath","appbarHeight","useAppBarHeight","contacts","contactsLoading","Progress","Fragment","CreateButton","DealColumn","totalAmount","findDealLabel","droppableProvided","getDealsByStage","unorderedDeals","dealsByStage","recordA","recordB","DealListContent","setDealsByStage","newDealsByStage","sourceStage","destinationStage","sourceDeal","destinationDeal","updateDealStageLocal","updateDealStage","column","sourceColumn","destinationColumn","columnDeals","destinationIndex","sourceDeals","destinationDeals","ContactList","contact","Avatar","RouterLink","DealShow","ShowBase","DealShowContent","ArchivedTitle","UnarchiveButton","ArchiveButton","EditButton","format","ReferenceArrayField","ReferenceManyField","NoteCreate","NotesIterator","useUpdate","refresh","useRefresh","mutate","useMutation","OnlyMineInput","_","filterValues","displayedFilters","useListFilterContext","newFilterValues","Switch","Label","DealList","dealFilters","SearchInput","AutocompleteInput","List","DealActions","DealLayout","matchShow","matchEdit","hasFilters","Skeleton","TopToolbar","FilterButton","ExportButton"],"mappings":"o7BAAA,IAAIA,GAAsC,UAAY,CAClD,OAAAA,GAAW,OAAO,QAAU,SAASC,EAAG,CACpC,QAASC,EAAGC,EAAI,EAAGC,EAAI,UAAU,OAAQD,EAAIC,EAAGD,IAAK,CACjDD,EAAI,UAAUC,CAAC,EACf,QAASE,KAAKH,EAAO,OAAO,UAAU,eAAe,KAAKA,EAAGG,CAAC,IAC1DJ,EAAEI,CAAC,EAAIH,EAAEG,CAAC,EAClB,CACA,OAAOJ,CACX,EACOD,GAAS,MAAM,KAAM,SAAS,CACzC,EACIM,GAAkC,SAAUJ,EAAGK,EAAG,CAClD,IAAIN,EAAI,CAAA,EACR,QAASI,KAAKH,EAAO,OAAO,UAAU,eAAe,KAAKA,EAAGG,CAAC,GAAKE,EAAE,QAAQF,CAAC,EAAI,IAC9EJ,EAAEI,CAAC,EAAIH,EAAEG,CAAC,GACd,GAAIH,GAAK,MAAQ,OAAO,OAAO,uBAA0B,WACrD,QAASC,EAAI,EAAGE,EAAI,OAAO,sBAAsBH,CAAC,EAAGC,EAAIE,EAAE,OAAQF,IAC3DI,EAAE,QAAQF,EAAEF,CAAC,CAAC,EAAI,GAAK,OAAO,UAAU,qBAAqB,KAAKD,EAAGG,EAAEF,CAAC,CAAC,IACzEF,EAAEI,EAAEF,CAAC,CAAC,EAAID,EAAEG,EAAEF,CAAC,CAAC,GAE5B,OAAOF,CACX,EACIO,GAAgD,SAAUC,EAAIC,EAAMC,EAAM,CAC1E,GAAIA,GAAQ,UAAU,SAAW,EAAG,QAASR,EAAI,EAAGS,EAAIF,EAAK,OAAQG,EAAIV,EAAIS,EAAGT,KACxEU,GAAM,EAAEV,KAAKO,MACRG,IAAIA,EAAK,MAAM,UAAU,MAAM,KAAKH,EAAM,EAAGP,CAAC,GACnDU,EAAGV,CAAC,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