{"ast":null,"code":"import { createContext, mergeRefs } from '@chakra-ui/react-utils';\nimport { useLayoutEffect, useEffect, useRef, useState } from 'react';\nfunction _extends() {\n  _extends = Object.assign || function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n    return target;\n  };\n  return _extends.apply(this, arguments);\n}\n\n/**\n * Sort an array of DOM nodes according to the HTML tree order\n * @see http://www.w3.org/TR/html5/infrastructure.html#tree-order\n */\n\nfunction sortNodes(nodes) {\n  return nodes.sort(function (a, b) {\n    var compare = a.compareDocumentPosition(b);\n    if (compare & Node.DOCUMENT_POSITION_FOLLOWING || compare & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n      // a < b\n      return -1;\n    }\n    if (compare & Node.DOCUMENT_POSITION_PRECEDING || compare & Node.DOCUMENT_POSITION_CONTAINS) {\n      // a > b\n      return 1;\n    }\n    if (compare & Node.DOCUMENT_POSITION_DISCONNECTED || compare & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC) {\n      throw Error(\"Cannot sort the given nodes.\");\n    } else {\n      return 0;\n    }\n  });\n}\nvar isElement = function isElement(el) {\n  return typeof el == \"object\" && \"nodeType\" in el && el.nodeType === Node.ELEMENT_NODE;\n};\nfunction getNextIndex(current, max, loop) {\n  var next = current + 1;\n  if (loop && next >= max) next = 0;\n  return next;\n}\nfunction getPrevIndex(current, max, loop) {\n  var next = current - 1;\n  if (loop && next < 0) next = max;\n  return next;\n}\nvar useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nvar cast = function cast(value) {\n  return value;\n};\n\n/**\n * @internal\n *\n * Class to manage descendants and their relative indices in the DOM.\n * It uses `node.compareDocumentPosition(...)` under the hood\n */\nvar DescendantsManager = function DescendantsManager() {\n  var _this = this;\n  this.descendants = new Map();\n  this.register = function (nodeOrOptions) {\n    if (nodeOrOptions == null) return;\n    if (isElement(nodeOrOptions)) {\n      return _this.registerNode(nodeOrOptions);\n    }\n    return function (node) {\n      _this.registerNode(node, nodeOrOptions);\n    };\n  };\n  this.unregister = function (node) {\n    _this.descendants[\"delete\"](node);\n    var sorted = sortNodes(Array.from(_this.descendants.keys()));\n    _this.assignIndex(sorted);\n  };\n  this.destroy = function () {\n    _this.descendants.clear();\n  };\n  this.assignIndex = function (descendants) {\n    _this.descendants.forEach(function (descendant) {\n      var index = descendants.indexOf(descendant.node);\n      descendant.index = index;\n      descendant.node.dataset[\"index\"] = descendant.index.toString();\n    });\n  };\n  this.count = function () {\n    return _this.descendants.size;\n  };\n  this.enabledCount = function () {\n    return _this.enabledValues().length;\n  };\n  this.values = function () {\n    var values = Array.from(_this.descendants.values());\n    return values.sort(function (a, b) {\n      return a.index - b.index;\n    });\n  };\n  this.enabledValues = function () {\n    return _this.values().filter(function (descendant) {\n      return !descendant.disabled;\n    });\n  };\n  this.item = function (index) {\n    if (_this.count() === 0) return undefined;\n    return _this.values()[index];\n  };\n  this.enabledItem = function (index) {\n    if (_this.enabledCount() === 0) return undefined;\n    return _this.enabledValues()[index];\n  };\n  this.first = function () {\n    return _this.item(0);\n  };\n  this.firstEnabled = function () {\n    return _this.enabledItem(0);\n  };\n  this.last = function () {\n    return _this.item(_this.descendants.size - 1);\n  };\n  this.lastEnabled = function () {\n    var lastIndex = _this.enabledValues().length - 1;\n    return _this.enabledItem(lastIndex);\n  };\n  this.indexOf = function (node) {\n    var _this$descendants$get, _this$descendants$get2;\n    if (!node) return -1;\n    return (_this$descendants$get = (_this$descendants$get2 = _this.descendants.get(node)) == null ? void 0 : _this$descendants$get2.index) != null ? _this$descendants$get : -1;\n  };\n  this.enabledIndexOf = function (node) {\n    if (node == null) return -1;\n    return _this.enabledValues().findIndex(function (i) {\n      return i.node.isSameNode(node);\n    });\n  };\n  this.next = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n    var next = getNextIndex(index, _this.count(), loop);\n    return _this.item(next);\n  };\n  this.nextEnabled = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n    var item = _this.item(index);\n    if (!item) return;\n    var enabledIndex = _this.enabledIndexOf(item.node);\n    var nextEnabledIndex = getNextIndex(enabledIndex, _this.enabledCount(), loop);\n    return _this.enabledItem(nextEnabledIndex);\n  };\n  this.prev = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n    var prev = getPrevIndex(index, _this.count() - 1, loop);\n    return _this.item(prev);\n  };\n  this.prevEnabled = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n    var item = _this.item(index);\n    if (!item) return;\n    var enabledIndex = _this.enabledIndexOf(item.node);\n    var prevEnabledIndex = getPrevIndex(enabledIndex, _this.enabledCount() - 1, loop);\n    return _this.enabledItem(prevEnabledIndex);\n  };\n  this.registerNode = function (node, options) {\n    if (!node || _this.descendants.has(node)) return;\n    var keys = Array.from(_this.descendants.keys()).concat(node);\n    var sorted = sortNodes(keys);\n    if (options != null && options.disabled) {\n      options.disabled = !!options.disabled;\n    }\n    var descendant = _extends({\n      node: node,\n      index: -1\n    }, options);\n    _this.descendants.set(node, descendant);\n    _this.assignIndex(sorted);\n  };\n};\n\n/**\n * @internal\n * React hook that initializes the DescendantsManager\n */\n\nfunction useDescendants() {\n  var descendants = useRef(new DescendantsManager());\n  useSafeLayoutEffect(function () {\n    return function () {\n      return descendants.current.destroy();\n    };\n  });\n  return descendants.current;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Descendants context to be used in component-land.\n  - Mount the `DescendantsContextProvider` at the root of the component\n  - Call `useDescendantsContext` anywhere you need access to the descendants information\n\n  NB:  I recommend using `createDescendantContext` below\n * -----------------------------------------------------------------------------------------------*/\nvar _createContext = createContext({\n    name: \"DescendantsProvider\",\n    errorMessage: \"useDescendantsContext must be used within DescendantsProvider\"\n  }),\n  DescendantsContextProvider = _createContext[0],\n  useDescendantsContext = _createContext[1];\n/**\n * @internal\n * This hook provides information a descendant such as:\n * - Its index compared to other descendants\n * - ref callback to register the descendant\n * - Its enabled index compared to other enabled descendants\n */\n\nfunction useDescendant(options) {\n  var descendants = useDescendantsContext();\n  var _useState = useState(-1),\n    index = _useState[0],\n    setIndex = _useState[1];\n  var ref = useRef(null);\n  useSafeLayoutEffect(function () {\n    return function () {\n      if (!ref.current) return;\n      descendants.unregister(ref.current);\n    };\n  }, []);\n  useSafeLayoutEffect(function () {\n    if (!ref.current) return;\n    var dataIndex = Number(ref.current.dataset[\"index\"]);\n    if (index != dataIndex && !Number.isNaN(dataIndex)) {\n      setIndex(dataIndex);\n    }\n  });\n  var refCallback = options ? cast(descendants.register(options)) : cast(descendants.register);\n  return {\n    descendants: descendants,\n    index: index,\n    enabledIndex: descendants.enabledIndexOf(ref.current),\n    register: mergeRefs(refCallback, ref)\n  };\n}\n/* -------------------------------------------------------------------------------------------------\n * Function that provides strongly typed versions of the context provider and hooks above.\n   To be used in component-land\n * -----------------------------------------------------------------------------------------------*/\n\nfunction createDescendantContext() {\n  var ContextProvider = cast(DescendantsContextProvider);\n  var _useDescendantsContext = function _useDescendantsContext() {\n    return cast(useDescendantsContext());\n  };\n  var _useDescendant = function _useDescendant(options) {\n    return useDescendant(options);\n  };\n  var _useDescendants = function _useDescendants() {\n    return useDescendants();\n  };\n  return [\n  // context provider\n  ContextProvider,\n  // call this when you need to read from context\n  _useDescendantsContext,\n  // descendants state information, to be called and passed to `ContextProvider`\n  _useDescendants,\n  // descendant index information\n  _useDescendant];\n}\nexport { createDescendantContext, createDescendantContext as default };","map":{"version":3,"names":["createContext","mergeRefs","useLayoutEffect","useEffect","useRef","useState","_extends","Object","assign","target","i","arguments","length","source","key","prototype","hasOwnProperty","call","apply","sortNodes","nodes","sort","a","b","compare","compareDocumentPosition","Node","DOCUMENT_POSITION_FOLLOWING","DOCUMENT_POSITION_CONTAINED_BY","DOCUMENT_POSITION_PRECEDING","DOCUMENT_POSITION_CONTAINS","DOCUMENT_POSITION_DISCONNECTED","DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC","Error","isElement","el","nodeType","ELEMENT_NODE","getNextIndex","current","max","loop","next","getPrevIndex","useSafeLayoutEffect","window","cast","value","DescendantsManager","_this","descendants","Map","register","nodeOrOptions","registerNode","node","unregister","sorted","Array","from","keys","assignIndex","destroy","clear","forEach","descendant","index","indexOf","dataset","toString","count","size","enabledCount","enabledValues","values","filter","disabled","item","undefined","enabledItem","first","firstEnabled","last","lastEnabled","lastIndex","_this$descendants$get","_this$descendants$get2","get","enabledIndexOf","findIndex","isSameNode","nextEnabled","enabledIndex","nextEnabledIndex","prev","prevEnabled","prevEnabledIndex","options","has","concat","set","useDescendants","_createContext","name","errorMessage","DescendantsContextProvider","useDescendantsContext","useDescendant","_useState","setIndex","ref","dataIndex","Number","isNaN","refCallback","createDescendantContext","ContextProvider","_useDescendantsContext","_useDescendant","_useDescendants","default"],"sources":["D:/DSP_Management/node_modules/@chakra-ui/descendant/dist/chakra-ui-descendant.esm.js"],"sourcesContent":["import { createContext, mergeRefs } from '@chakra-ui/react-utils';\nimport { useLayoutEffect, useEffect, useRef, useState } from 'react';\n\nfunction _extends() {\n  _extends = Object.assign || function (target) {\n    for (var i = 1; i < arguments.length; i++) {\n      var source = arguments[i];\n\n      for (var key in source) {\n        if (Object.prototype.hasOwnProperty.call(source, key)) {\n          target[key] = source[key];\n        }\n      }\n    }\n\n    return target;\n  };\n\n  return _extends.apply(this, arguments);\n}\n\n/**\n * Sort an array of DOM nodes according to the HTML tree order\n * @see http://www.w3.org/TR/html5/infrastructure.html#tree-order\n */\n\nfunction sortNodes(nodes) {\n  return nodes.sort(function (a, b) {\n    var compare = a.compareDocumentPosition(b);\n\n    if (compare & Node.DOCUMENT_POSITION_FOLLOWING || compare & Node.DOCUMENT_POSITION_CONTAINED_BY) {\n      // a < b\n      return -1;\n    }\n\n    if (compare & Node.DOCUMENT_POSITION_PRECEDING || compare & Node.DOCUMENT_POSITION_CONTAINS) {\n      // a > b\n      return 1;\n    }\n\n    if (compare & Node.DOCUMENT_POSITION_DISCONNECTED || compare & Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC) {\n      throw Error(\"Cannot sort the given nodes.\");\n    } else {\n      return 0;\n    }\n  });\n}\nvar isElement = function isElement(el) {\n  return typeof el == \"object\" && \"nodeType\" in el && el.nodeType === Node.ELEMENT_NODE;\n};\nfunction getNextIndex(current, max, loop) {\n  var next = current + 1;\n  if (loop && next >= max) next = 0;\n  return next;\n}\nfunction getPrevIndex(current, max, loop) {\n  var next = current - 1;\n  if (loop && next < 0) next = max;\n  return next;\n}\nvar useSafeLayoutEffect = typeof window !== \"undefined\" ? useLayoutEffect : useEffect;\nvar cast = function cast(value) {\n  return value;\n};\n\n/**\n * @internal\n *\n * Class to manage descendants and their relative indices in the DOM.\n * It uses `node.compareDocumentPosition(...)` under the hood\n */\nvar DescendantsManager = function DescendantsManager() {\n  var _this = this;\n\n  this.descendants = new Map();\n\n  this.register = function (nodeOrOptions) {\n    if (nodeOrOptions == null) return;\n\n    if (isElement(nodeOrOptions)) {\n      return _this.registerNode(nodeOrOptions);\n    }\n\n    return function (node) {\n      _this.registerNode(node, nodeOrOptions);\n    };\n  };\n\n  this.unregister = function (node) {\n    _this.descendants[\"delete\"](node);\n\n    var sorted = sortNodes(Array.from(_this.descendants.keys()));\n\n    _this.assignIndex(sorted);\n  };\n\n  this.destroy = function () {\n    _this.descendants.clear();\n  };\n\n  this.assignIndex = function (descendants) {\n    _this.descendants.forEach(function (descendant) {\n      var index = descendants.indexOf(descendant.node);\n      descendant.index = index;\n      descendant.node.dataset[\"index\"] = descendant.index.toString();\n    });\n  };\n\n  this.count = function () {\n    return _this.descendants.size;\n  };\n\n  this.enabledCount = function () {\n    return _this.enabledValues().length;\n  };\n\n  this.values = function () {\n    var values = Array.from(_this.descendants.values());\n    return values.sort(function (a, b) {\n      return a.index - b.index;\n    });\n  };\n\n  this.enabledValues = function () {\n    return _this.values().filter(function (descendant) {\n      return !descendant.disabled;\n    });\n  };\n\n  this.item = function (index) {\n    if (_this.count() === 0) return undefined;\n    return _this.values()[index];\n  };\n\n  this.enabledItem = function (index) {\n    if (_this.enabledCount() === 0) return undefined;\n    return _this.enabledValues()[index];\n  };\n\n  this.first = function () {\n    return _this.item(0);\n  };\n\n  this.firstEnabled = function () {\n    return _this.enabledItem(0);\n  };\n\n  this.last = function () {\n    return _this.item(_this.descendants.size - 1);\n  };\n\n  this.lastEnabled = function () {\n    var lastIndex = _this.enabledValues().length - 1;\n    return _this.enabledItem(lastIndex);\n  };\n\n  this.indexOf = function (node) {\n    var _this$descendants$get, _this$descendants$get2;\n\n    if (!node) return -1;\n    return (_this$descendants$get = (_this$descendants$get2 = _this.descendants.get(node)) == null ? void 0 : _this$descendants$get2.index) != null ? _this$descendants$get : -1;\n  };\n\n  this.enabledIndexOf = function (node) {\n    if (node == null) return -1;\n    return _this.enabledValues().findIndex(function (i) {\n      return i.node.isSameNode(node);\n    });\n  };\n\n  this.next = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n\n    var next = getNextIndex(index, _this.count(), loop);\n    return _this.item(next);\n  };\n\n  this.nextEnabled = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n\n    var item = _this.item(index);\n\n    if (!item) return;\n\n    var enabledIndex = _this.enabledIndexOf(item.node);\n\n    var nextEnabledIndex = getNextIndex(enabledIndex, _this.enabledCount(), loop);\n    return _this.enabledItem(nextEnabledIndex);\n  };\n\n  this.prev = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n\n    var prev = getPrevIndex(index, _this.count() - 1, loop);\n    return _this.item(prev);\n  };\n\n  this.prevEnabled = function (index, loop) {\n    if (loop === void 0) {\n      loop = true;\n    }\n\n    var item = _this.item(index);\n\n    if (!item) return;\n\n    var enabledIndex = _this.enabledIndexOf(item.node);\n\n    var prevEnabledIndex = getPrevIndex(enabledIndex, _this.enabledCount() - 1, loop);\n    return _this.enabledItem(prevEnabledIndex);\n  };\n\n  this.registerNode = function (node, options) {\n    if (!node || _this.descendants.has(node)) return;\n    var keys = Array.from(_this.descendants.keys()).concat(node);\n    var sorted = sortNodes(keys);\n\n    if (options != null && options.disabled) {\n      options.disabled = !!options.disabled;\n    }\n\n    var descendant = _extends({\n      node: node,\n      index: -1\n    }, options);\n\n    _this.descendants.set(node, descendant);\n\n    _this.assignIndex(sorted);\n  };\n};\n\n/**\n * @internal\n * React hook that initializes the DescendantsManager\n */\n\nfunction useDescendants() {\n  var descendants = useRef(new DescendantsManager());\n  useSafeLayoutEffect(function () {\n    return function () {\n      return descendants.current.destroy();\n    };\n  });\n  return descendants.current;\n}\n\n/* -------------------------------------------------------------------------------------------------\n * Descendants context to be used in component-land.\n  - Mount the `DescendantsContextProvider` at the root of the component\n  - Call `useDescendantsContext` anywhere you need access to the descendants information\n\n  NB:  I recommend using `createDescendantContext` below\n * -----------------------------------------------------------------------------------------------*/\nvar _createContext = createContext({\n  name: \"DescendantsProvider\",\n  errorMessage: \"useDescendantsContext must be used within DescendantsProvider\"\n}),\n    DescendantsContextProvider = _createContext[0],\n    useDescendantsContext = _createContext[1];\n/**\n * @internal\n * This hook provides information a descendant such as:\n * - Its index compared to other descendants\n * - ref callback to register the descendant\n * - Its enabled index compared to other enabled descendants\n */\n\n\nfunction useDescendant(options) {\n  var descendants = useDescendantsContext();\n\n  var _useState = useState(-1),\n      index = _useState[0],\n      setIndex = _useState[1];\n\n  var ref = useRef(null);\n  useSafeLayoutEffect(function () {\n    return function () {\n      if (!ref.current) return;\n      descendants.unregister(ref.current);\n    };\n  }, []);\n  useSafeLayoutEffect(function () {\n    if (!ref.current) return;\n    var dataIndex = Number(ref.current.dataset[\"index\"]);\n\n    if (index != dataIndex && !Number.isNaN(dataIndex)) {\n      setIndex(dataIndex);\n    }\n  });\n  var refCallback = options ? cast(descendants.register(options)) : cast(descendants.register);\n  return {\n    descendants: descendants,\n    index: index,\n    enabledIndex: descendants.enabledIndexOf(ref.current),\n    register: mergeRefs(refCallback, ref)\n  };\n}\n/* -------------------------------------------------------------------------------------------------\n * Function that provides strongly typed versions of the context provider and hooks above.\n   To be used in component-land\n * -----------------------------------------------------------------------------------------------*/\n\n\nfunction createDescendantContext() {\n  var ContextProvider = cast(DescendantsContextProvider);\n\n  var _useDescendantsContext = function _useDescendantsContext() {\n    return cast(useDescendantsContext());\n  };\n\n  var _useDescendant = function _useDescendant(options) {\n    return useDescendant(options);\n  };\n\n  var _useDescendants = function _useDescendants() {\n    return useDescendants();\n  };\n\n  return [// context provider\n  ContextProvider, // call this when you need to read from context\n  _useDescendantsContext, // descendants state information, to be called and passed to `ContextProvider`\n  _useDescendants, // descendant index information\n  _useDescendant];\n}\n\nexport { createDescendantContext, createDescendantContext as default };\n"],"mappings":"AAAA,SAASA,aAAa,EAAEC,SAAS,QAAQ,wBAAwB;AACjE,SAASC,eAAe,EAAEC,SAAS,EAAEC,MAAM,EAAEC,QAAQ,QAAQ,OAAO;AAEpE,SAASC,QAAQA,CAAA,EAAG;EAClBA,QAAQ,GAAGC,MAAM,CAACC,MAAM,IAAI,UAAUC,MAAM,EAAE;IAC5C,KAAK,IAAIC,CAAC,GAAG,CAAC,EAAEA,CAAC,GAAGC,SAAS,CAACC,MAAM,EAAEF,CAAC,EAAE,EAAE;MACzC,IAAIG,MAAM,GAAGF,SAAS,CAACD,CAAC,CAAC;MAEzB,KAAK,IAAII,GAAG,IAAID,MAAM,EAAE;QACtB,IAAIN,MAAM,CAACQ,SAAS,CAACC,cAAc,CAACC,IAAI,CAACJ,MAAM,EAAEC,GAAG,CAAC,EAAE;UACrDL,MAAM,CAACK,GAAG,CAAC,GAAGD,MAAM,CAACC,GAAG,CAAC;QAC3B;MACF;IACF;IAEA,OAAOL,MAAM;EACf,CAAC;EAED,OAAOH,QAAQ,CAACY,KAAK,CAAC,IAAI,EAAEP,SAAS,CAAC;AACxC;;AAEA;AACA;AACA;AACA;;AAEA,SAASQ,SAASA,CAACC,KAAK,EAAE;EACxB,OAAOA,KAAK,CAACC,IAAI,C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