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IY,YAAYzB,SAASC,IACvB,MAAMK,EAAQL,EAAKK,OACJ,IAAXA,IACJ6B,EAAQ7B,GAAOwE,UAAW,EAAI,IAEhClC,EAAQT,EAASqC,KAAKO,SAAUf,E,0PCpYpC,IAAI6E,GAAeC,EACfC,EAAS,mBACb,SAASC,EAAUC,EAAWC,GAC1B,IAAID,EAAJ,CAGA,GAAIJ,EACA,MAAM,IAAIM,MAAMJ,GAEpB,IAAIK,EAA8B,oBAAZF,EAAyBA,IAAYA,EAE3D,MAAM,IAAIC,MADEC,EAAWL,EAAS,KAAOK,EAAWL,EALlD,CAOJ,C","sources":["../node_modules/react-sortablejs/dist/src/util.ts","../node_modules/react-sortablejs/dist/src/react-sortable.tsx","../node_modules/tiny-invariant/dist/tiny-invariant.esm.js"],"sourcesContent":["import { PropsWithChildren } from \"react\";\nimport Sortable, { Options } from \"sortablejs\";\nimport { MultiDragEvent } from \"./react-sortable\";\nimport { AllMethodNames, ItemInterface, ReactSortableProps } from \"./types\";\n\n/**\n * Removes the `node` from the DOM\n * @param node\n */\nexport function removeNode(node: HTMLElement): void {\n if (node.parentElement !== null) node.parentElement.removeChild(node);\n}\n\n/**\n * Inserts the `newChild` node at the given index in a parent\n * @param parent The parent HTML Element.\n * @param newChild A HTML eement to add as a child of the parent.\n * @param index index of the parent to place the new child in.\n */\nexport function insertNodeAt(\n parent: HTMLElement,\n newChild: HTMLElement,\n index: number\n): void {\n const refChild = parent.children[index] || null;\n parent.insertBefore(newChild, refChild);\n}\n\n// @todo - create a dom handler function for arrays or not at all\n\n/** removes stuff from the dom in a nice order */\n// @todo - do I need parenElement?\nexport function handleDOMChanges<T extends ItemInterface>(\n customs: Normalized<T>[]\n): void {\n removeNodes(customs);\n insertNodes(customs);\n}\n\nexport function removeNodes<T extends ItemInterface>(\n customs: Normalized<T>[]\n): void {\n customs.forEach((curr) => removeNode(curr.element));\n}\n\nexport function insertNodes<T extends ItemInterface>(\n customs: Normalized<T>[]\n): void {\n customs.forEach((curr) => {\n insertNodeAt(curr.parentElement, curr.element, curr.oldIndex);\n });\n}\n\nexport function createCustoms<T extends ItemInterface>(\n evt: MultiDragEvent,\n list: T[]\n): Normalized<T>[] {\n const mode = getMode(evt);\n const parentElement = { parentElement: evt.from };\n let custom = [];\n switch (mode) {\n case \"normal\":\n /* eslint-disable */\n const item = {\n element: evt.item,\n newIndex: evt.newIndex!,\n oldIndex: evt.oldIndex!,\n parentElement: evt.from,\n };\n custom = [item];\n break;\n case \"swap\":\n const drag: Input = {\n element: evt.item,\n oldIndex: evt.oldIndex!,\n newIndex: evt.newIndex!,\n ...parentElement,\n };\n const swap: Input = {\n element: evt.swapItem!,\n oldIndex: evt.newIndex!,\n newIndex: evt.oldIndex!,\n ...parentElement,\n };\n custom = [drag, swap];\n break;\n case \"multidrag\":\n custom = evt.oldIndicies.map<Input>((curr, index) => ({\n element: curr.multiDragElement,\n oldIndex: curr.index,\n newIndex: evt.newIndicies[index].index,\n ...parentElement,\n }));\n break;\n }\n /* eslint-enable */\n\n const customs = createNormalized(custom, list);\n return customs;\n}\n\n/** moves items form old index to new index without breaking anything ideally. */\nexport function handleStateChanges<T extends ItemInterface>(\n normalized: Normalized<T>[],\n list: T[]\n): T[] {\n const a = handleStateRemove(normalized, list);\n const b = handleStateAdd(normalized, a);\n return b;\n}\n\nexport function handleStateRemove<T extends ItemInterface>(\n normalized: Normalized<T>[],\n list: T[]\n): T[] {\n const newList = [...list];\n normalized\n .concat()\n .reverse()\n .forEach((curr) => newList.splice(curr.oldIndex, 1));\n return newList;\n}\n\nexport function handleStateAdd<T extends ItemInterface>(\n normalized: Normalized<T>[],\n list: T[],\n evt?: Sortable.SortableEvent,\n clone?: ((currentItem: T, evt: Sortable.SortableEvent) => T) | undefined\n): T[] {\n const newList = [...list];\n normalized.forEach((curr) => {\n const newItem = clone && evt && clone(curr.item, evt);\n newList.splice(curr.newIndex, 0, newItem || curr.item);\n });\n return newList;\n}\n\nexport function getMode(evt: MultiDragEvent): \"multidrag\" | \"swap\" | \"normal\" {\n if (evt.oldIndicies && evt.oldIndicies.length > 0) return \"multidrag\";\n if (evt.swapItem) return \"swap\";\n return \"normal\";\n}\n\nexport function createNormalized<T extends ItemInterface>(\n inputs: Input[],\n list: T[]\n): Normalized<T>[] {\n const normalized = inputs\n .map<Normalized<T>>((curr) => ({ ...curr, item: list[curr.oldIndex] }))\n .sort((a, b) => a.oldIndex - b.oldIndex);\n return normalized;\n}\n\nexport interface Input {\n parentElement: HTMLElement;\n element: HTMLElement;\n oldIndex: number;\n newIndex: number;\n}\n\nexport interface Normalized<T> extends Input {\n item: T;\n}\n\n/**\n * Removes the following group of properties from `props`,\n * leaving only `Sortable.Options` without any `on` methods.\n * @param props `ReactSortable.Props`\n */\nexport function destructurePropsForOptions<T>(\n props: PropsWithChildren<ReactSortableProps<T>>\n): Exclude<Options, AllMethodNames> {\n /* eslint-disable */\n const {\n // react sortable props\n list,\n setList,\n children,\n tag,\n style,\n className,\n clone,\n // sortable options that have methods we want to overwrite\n onAdd,\n onChange,\n onChoose,\n onClone,\n onEnd,\n onFilter,\n onRemove,\n onSort,\n onStart,\n onUnchoose,\n onUpdate,\n onMove,\n onSpill,\n onSelect,\n onDeselect,\n ...options\n } = props;\n /* eslint-enable */\n return options;\n}\n\n/**\n * Construct a type with the properties of T except for those in type K.\n * Including this allows for backwards compatibility with earlier versions of TS.\n */\nexport type Omit<T, K extends keyof T> = Pick<T, Exclude<keyof T, K>>;\n","import classNames from \"classnames\";\nimport {\n Children,\n cloneElement,\n Component,\n createElement,\n createRef,\n ReactElement,\n RefObject,\n} from \"react\";\nimport Sortable, { MoveEvent, Options, SortableEvent } from \"sortablejs\";\nimport invariant from \"tiny-invariant\";\nimport {\n AllMethodsExceptMove,\n HandledMethodNames,\n ItemInterface,\n ReactSortableProps,\n Store,\n UnHandledMethodNames,\n} from \"./types\";\nimport {\n createCustoms,\n destructurePropsForOptions,\n getMode,\n handleStateAdd,\n handleStateChanges,\n handleStateRemove,\n insertNodes,\n removeNode,\n removeNodes,\n} from \"./util\";\n\n/** Holds a global reference for which react element is being dragged */\n// @todo - use context to manage this. How does one use 2 different providers?\nconst store: Store = { dragging: null };\n\nexport class ReactSortable<T extends ItemInterface> extends Component<\n ReactSortableProps<T>\n> {\n /* eslint-disable-next-line */\n static defaultProps: Partial<ReactSortableProps<any>> = {\n clone: (item) => item,\n };\n\n private ref: RefObject<HTMLElement>;\n constructor(props: ReactSortableProps<T>) {\n super(props);\n // @todo forward ref this component\n this.ref = createRef<HTMLElement>();\n\n // make all state false because we can't change sortable unless a mouse gesture is made.\n const newList = [...props.list].map((item) =>\n Object.assign(item, {\n chosen: false,\n selected: false,\n })\n );\n\n props.setList(newList, this.sortable, store);\n invariant(\n //@ts-expect-error: Doesn't exist. Will deprecate soon.\n !props.plugins,\n `\nPlugins prop is no longer supported.\nInstead, mount it with \"Sortable.mount(new MultiDrag())\"\nPlease read the updated README.md at https://github.com/SortableJS/react-sortablejs.\n `\n );\n }\n\n componentDidMount(): void {\n if (this.ref.current === null) return;\n const newOptions = this.makeOptions();\n Sortable.create(this.ref.current, newOptions);\n }\n\n componentDidUpdate(prevProps: ReactSortableProps<T>): void {\n if (prevProps.disabled !== this.props.disabled && this.sortable) {\n this.sortable.option(\"disabled\", this.props.disabled);\n }\n }\n\n render(): JSX.Element {\n const { tag, style, className, id } = this.props;\n const classicProps = { style, className, id };\n\n // if no tag, default to a `div` element.\n const newTag = !tag || tag === null ? \"div\" : tag;\n return createElement(\n newTag,\n {\n // @todo - find a way (perhaps with the callback) to allow AntD components to work\n ref: this.ref,\n ...classicProps,\n },\n this.getChildren()\n );\n }\n\n private getChildren() {\n const {\n children,\n dataIdAttr,\n selectedClass = \"sortable-selected\",\n chosenClass = \"sortable-chosen\",\n /* eslint-disable */\n dragClass = \"sortable-drag\",\n fallbackClass = \"sortable-falback\",\n ghostClass = \"sortable-ghost\",\n swapClass = \"sortable-swap-highlight\",\n /* eslint-enable */\n filter = \"sortable-filter\",\n list,\n } = this.props;\n\n // if no children, don't do anything.\n if (!children || children == null) return null;\n const dataid = dataIdAttr || \"data-id\";\n /* eslint-disable-next-line */\n return Children.map(children as ReactElement<any>[], (child, index) => {\n if (child === undefined) return undefined;\n\n const item = list[index] || {};\n const { className: prevClassName } = child.props;\n\n // @todo - handle the function if avalable. I don't think anyone will be doing this soon.\n const filtered = typeof filter === \"string\" && {\n [filter.replace(\".\", \"\")]: !!item.filtered,\n };\n\n const className = classNames(prevClassName, {\n [selectedClass]: item.selected,\n [chosenClass]: item.chosen,\n ...filtered,\n // [dragClass]: true,\n // [fallbackClass]: true,\n // [ghostClass]: true,\n // [swapClass]: true\n });\n\n return cloneElement(child, {\n [dataid]: child.key,\n className,\n });\n });\n }\n\n /** Appends the `sortable` property to this component */\n private get sortable(): Sortable | null {\n const el = this.ref.current;\n if (el === null) return null;\n const key = Object.keys(el).find((k) => k.includes(\"Sortable\"));\n if (!key) return null;\n //@ts-expect-error: fix me.\n return el[key] as Sortable;\n }\n\n /** Converts all the props from `ReactSortable` into the `options` object that `Sortable.create(el, [options])` can use. */\n makeOptions(): Options {\n const DOMHandlers: HandledMethodNames[] = [\n \"onAdd\",\n \"onChoose\",\n \"onDeselect\",\n \"onEnd\",\n \"onRemove\",\n \"onSelect\",\n \"onSpill\",\n \"onStart\",\n \"onUnchoose\",\n \"onUpdate\",\n ];\n const NonDOMHandlers: UnHandledMethodNames[] = [\n \"onChange\",\n \"onClone\",\n \"onFilter\",\n \"onSort\",\n ];\n const newOptions: Options = destructurePropsForOptions(this.props);\n DOMHandlers.forEach(\n (name) => (newOptions[name] = this.prepareOnHandlerPropAndDOM(name))\n );\n NonDOMHandlers.forEach(\n (name) => (newOptions[name] = this.prepareOnHandlerProp(name))\n );\n\n /** onMove has 2 arguments and needs to be handled seperately. */\n const onMove = (evt: MoveEvent, originalEvt: Event) => {\n const { onMove } = this.props;\n const defaultValue = evt.willInsertAfter || -1;\n if (!onMove) return defaultValue;\n const result = onMove(evt, originalEvt, this.sortable, store);\n if (typeof result === \"undefined\") return false;\n return result;\n };\n\n return {\n ...newOptions,\n onMove,\n };\n }\n\n /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop & an `on[Handler]` ReactSortable method. */\n prepareOnHandlerPropAndDOM(\n evtName: HandledMethodNames\n ): (evt: SortableEvent) => void {\n return (evt) => {\n // call the component prop\n this.callOnHandlerProp(evt, evtName);\n // calls state change\n //@ts-expect-error: until @types multidrag item is in\n this[evtName](evt);\n };\n }\n\n /** Prepares a method that will be used in the sortable options to call an `on[Handler]` prop */\n prepareOnHandlerProp(\n evtName: Exclude<AllMethodsExceptMove, HandledMethodNames>\n ): (evt: SortableEvent) => void {\n return (evt) => {\n // call the component prop\n this.callOnHandlerProp(evt, evtName);\n };\n }\n\n /** Calls the `props.on[Handler]` function */\n callOnHandlerProp(evt: SortableEvent, evtName: AllMethodsExceptMove): void {\n const propEvent = this.props[evtName];\n if (propEvent) propEvent(evt, this.sortable, store);\n }\n\n // SORTABLE DOM HANDLING\n\n onAdd(evt: MultiDragEvent): void {\n const { list, setList, clone } = this.props;\n /* eslint-disable-next-line */\n const otherList = [...store.dragging!.props.list];\n const customs = createCustoms(evt, otherList);\n removeNodes(customs);\n\n const newList = handleStateAdd(customs, list, evt, clone).map((item) =>\n Object.assign(item, {\n selected: false,\n })\n );\n\n setList(newList, this.sortable, store);\n }\n\n onRemove(evt: MultiDragEvent): void {\n const { list, setList } = this.props;\n const mode = getMode(evt);\n const customs = createCustoms(evt, list);\n insertNodes(customs);\n\n let newList = [...list];\n // remove state if not in clone mode. otherwise, keep.\n if (evt.pullMode !== \"clone\") newList = handleStateRemove(customs, newList);\n // if clone, it doesn't really remove. instead it clones in place.\n // @todo -\n else {\n // switch used to get the clone\n let customClones = customs;\n switch (mode) {\n case \"multidrag\":\n customClones = customs.map((item, index) => ({\n ...item,\n element: evt.clones[index],\n }));\n break;\n case \"normal\":\n customClones = customs.map((item) => ({\n ...item,\n element: evt.clone,\n }));\n break;\n case \"swap\":\n default: {\n invariant(\n true,\n `mode \"${mode}\" cannot clone. Please remove \"props.clone\" from <ReactSortable/> when using the \"${mode}\" plugin`\n );\n }\n }\n removeNodes(customClones);\n\n // replace selected items with cloned items\n customs.forEach((curr) => {\n const index = curr.oldIndex;\n /* eslint-disable-next-line */\n const newItem = this.props.clone!(curr.item, evt);\n newList.splice(index, 1, newItem);\n });\n }\n\n // remove item.selected from list\n newList = newList.map((item: T) =>\n Object.assign(item, {\n selected: false,\n })\n );\n\n setList(newList, this.sortable, store);\n }\n\n onUpdate(evt: MultiDragEvent): void {\n const { list, setList } = this.props;\n const customs = createCustoms(evt, list);\n removeNodes(customs);\n insertNodes(customs);\n const newList = handleStateChanges(customs, list);\n return setList(newList, this.sortable, store);\n }\n\n onStart(): void {\n store.dragging = this;\n }\n\n onEnd(): void {\n store.dragging = null;\n }\n\n onChoose(evt: SortableEvent): void {\n const { list, setList } = this.props;\n const newList = list.map((item, index) => {\n let newItem = item;\n if (index === evt.oldIndex) {\n newItem = Object.assign(item, {\n chosen: true,\n });\n }\n return newItem;\n });\n setList(newList, this.sortable, store);\n }\n\n onUnchoose(evt: SortableEvent): void {\n const { list, setList } = this.props;\n const newList = list.map((item, index) => {\n let newItem = item;\n if (index === evt.oldIndex) {\n newItem = Object.assign(newItem, {\n chosen: false,\n });\n }\n return newItem;\n });\n setList(newList, this.sortable, store);\n }\n\n onSpill(evt: SortableEvent): void {\n const { removeOnSpill, revertOnSpill } = this.props;\n if (removeOnSpill && !revertOnSpill) removeNode(evt.item);\n }\n\n onSelect(evt: MultiDragEvent): void {\n const { list, setList } = this.props;\n const newList = list.map((item) =>\n Object.assign(item, {\n selected: false,\n })\n );\n\n evt.newIndicies.forEach((curr) => {\n const index = curr.index;\n if (index === -1) {\n console.log(\n `\"${evt.type}\" had indice of \"${curr.index}\", which is probably -1 and doesn't usually happen here.`\n );\n console.log(evt);\n return;\n }\n newList[index].selected = true;\n });\n setList(newList, this.sortable, store);\n }\n\n onDeselect(evt: MultiDragEvent): void {\n const { list, setList } = this.props;\n const newList = list.map((item) =>\n Object.assign(item, {\n selected: false,\n })\n );\n evt.newIndicies.forEach((curr) => {\n const index = curr.index;\n if (index === -1) return;\n newList[index].selected = true;\n });\n setList(newList, this.sortable, store);\n }\n}\n\n// everything below this point can be removed\n// once @types has been merged. PR submited\ninterface MultiIndices {\n multiDragElement: HTMLElement;\n index: number;\n}\n\nexport interface MultiDragEvent extends SortableEvent {\n // @todo - add this to @types\n clones: HTMLElement[];\n oldIndicies: MultiIndices[];\n newIndicies: MultiIndices[];\n swapItem: HTMLElement | null;\n}\n","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 ? prefix + \": \" + provided : prefix;\n throw new Error(value);\n}\n\nexport { invariant as default };\n"],"names":["$eb03e74f8f7db1f3$export$1d0aa160432dfea5","node","parentElement","removeChild","$eb03e74f8f7db1f3$export$77f49a256021c8de","customs","forEach","curr","element","$eb03e74f8f7db1f3$export$a6177d5829f70ebc","parent","newChild","index","refChild","children","insertBefore","$eb03e74f8f7db1f3$export$6d240faa51aa562f","oldIndex","$eb03e74f8f7db1f3$export$4655efe700f887a","evt","list","mode","$eb03e74f8f7db1f3$export$1fc0f6205829e19c","from","custom","item","newIndex","swapItem","oldIndicies","map","multiDragElement","newIndicies","inputs","normalized","sort","a","b","$eb03e74f8f7db1f3$export$bc06a3af7dc65f53","$eb03e74f8f7db1f3$export$c25cf8080bd305ec","$eb03e74f8f7db1f3$export$eca851ee65ae17e4","$eb03e74f8f7db1f3$export$be2da95e6167b0bd","newList","concat","reverse","splice","clone","newItem","length","$eb03e74f8f7db1f3$export$7553c81e62e31b7e","props","setList","tag","style","className","onAdd","onChange","onChoose","onClone","onEnd","onFilter","onRemove","onSort","onStart","onUnchoose","onUpdate","onMove","onSpill","onSelect","onDeselect","options","$7fe8e3ea572bda7a$var$store","dragging","$7fe8e3ea572bda7a$export$11bbed9ee0012c13","$8zHUo$react","Component","static","constructor","super","this","ref","createRef","Object","assign","chosen","selected","sortable","$parcel$interopDefault","$8zHUo$tinyinvariant","plugins","componentDidMount","current","newOptions","makeOptions","$8zHUo$sortablejs","create","componentDidUpdate","prevProps","disabled","option","render","id","classicProps","newTag","createElement","getChildren","dataIdAttr","selectedClass","chosenClass","dragClass","fallbackClass","ghostClass","swapClass","filter","dataid","Children","child","undefined","prevClassName","filtered","replace","$8zHUo$classnames","cloneElement","key","el","keys","find","k","includes","name","prepareOnHandlerPropAndDOM","prepareOnHandlerProp","onMove1","originalEvt","defaultValue","willInsertAfter","result","evtName","callOnHandlerProp","propEvent","pullMode","customClones","clones","removeOnSpill","revertOnSpill","console","log","type","isProduction","process","prefix","invariant","condition","message","Error","provided"],"sourceRoot":""}