{"version":3,"file":"8553.esm.js","mappings":";qKAeO,SAASA,EAAcC,GAC5B,IAAMC,GAAUC,EAAAA,EAAAA,UAEhB,OADAD,EAAQE,QAAUH,EACXC,CACT,CAaO,SAASG,EACdJ,GAEU,IADVK,EAAgBC,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAEbG,EAAMV,EAAcC,GAC1B,OAAOU,EAAAA,EAAAA,cAAY,kBAAaD,EAAIN,WAAQG,UAAQ,GAAED,EACxD,CAYO,SAASM,EAAaX,EAAeY,GAC1C,IAAMC,GAASX,EAAAA,EAAAA,QAAOF,GAItB,OAHIY,IACFC,EAAOV,QAAUH,GAEZa,EAAOV,OAChB,CAgBO,SAASW,IAGd,IAFAC,EAAcT,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,YACjBU,EAAyBV,UAAAC,OAAA,QAAAC,IAAAF,UAAA,GAAAA,UAAA,GAAG,GAE5B,OAAOW,EAAAA,EAAAA,UAAQ,IAAMC,IAASH,EAAS,MAAMC,EAC/C,mBC7EA,IAAIG,EAAW,EAAQ,OAGnBC,EAAY,EAwBhBC,EAAOC,QALP,SAAkBP,GAChB,IAAIQ,IAAOH,EACX,OAAOD,EAASJ,GAAUQ,CAC5B","sources":["webpack:///./transfer/utils/customHooks.js","webpack:///../../node_modules/lodash/uniqueId.js"],"sourcesContent":["/**\n * @flow\n * Collection of generic React custom hooks.\n */\nimport { useCallback, useMemo, useRef } from 'react'\nimport { uniqueId } from 'lodash'\n\ntype ReactRef = { current: any }\n\n/**\n * Keeps a reference that always stays updated with the latest values.\n * This utility is useful to avoid unnecessary effect re-runs when objects\n * (objects, arrays, etc.) change, which are different from primitive values,\n * that react can directly compared in the dependencies.\n */\nexport function usePointerRef(value: any): ReactRef {\n const pointer = useRef()\n pointer.current = value\n return pointer\n}\n\n/**\n * Creates a memoized callback reference that always invokes the most recent\n * version of the passed function. This hook leverages `usePointerRef` to\n * maintain an up-to-date reference to the function, ensuring that it does not\n * trigger re-renders or effect executions unnecessarily due to dependencies\n * changes. It's particularly useful for optimizing performance in scenarios\n * where functions are defined within components or passed as props, but you\n * want to avoid the overhead of dependency changes causing re-renders. The\n * dependencies array works similarly to `useEffect`, controlling when the\n * memoization should be updated.\n */\nexport function useCallbackRef(\n value: Function,\n deps: Array = []\n): Function {\n const ref = usePointerRef(value)\n return useCallback((...args) => ref.current(...args), deps)\n}\n\n/**\n * Returns a \"sticky\" key value that persists across renders. Initially, the\n * key is set to the provided 'value'. If 'shouldUpdate' is true, the key is\n * updated to the new 'value' in subsequent renders; otherwise, it retains\n * its current value.\n *\n * @param {string} value - value to be used as a key\n * @param {boolean} shouldUpdate - if it should be updated with a new value\n * @returns {string} key - The current or initial key value.\n */\nexport function useStickyKey(value: string, shouldUpdate: boolean): any {\n const keyRef = useRef(value)\n if (shouldUpdate) {\n keyRef.current = value\n }\n return keyRef.current\n}\n\n/**\n * Generates a unique identifier (UID) suitable for use with HTML elements\n * requiring unique IDs. This is especially useful to avoid ID conflicts when\n * multiple instances of the same component are rendered simultaneously.\n *\n * By default, the UID is prefixed with 'unique-id' to ensure uniqueness.\n * By default, the UID will only be generated once per component instance.\n *\n * @param {string} prefix - optional prefix to prepend to the UID.\n * Defaults to 'unique-id' to ensure uniqueness.\n * @param {Array} dependencies - optional array of dependencies.\n * Defaults to an empty array.\n * @returns {string} A unique identifier string.\n */\nexport function useUniqueId(\n prefix: string = 'unique-id',\n dependencies: ?Array = []\n) {\n return useMemo(() => uniqueId(prefix + '-'), dependencies)\n}\n","var toString = require('./toString');\n\n/** Used to generate unique IDs. */\nvar idCounter = 0;\n\n/**\n * Generates a unique ID. If `prefix` is given, the ID is appended to it.\n *\n * @static\n * @since 0.1.0\n * @memberOf _\n * @category Util\n * @param {string} [prefix=''] The value to prefix the ID with.\n * @returns {string} Returns the unique ID.\n * @example\n *\n * _.uniqueId('contact_');\n * // => 'contact_104'\n *\n * _.uniqueId();\n * // => '105'\n */\nfunction uniqueId(prefix) {\n var id = ++idCounter;\n return toString(prefix) + id;\n}\n\nmodule.exports = uniqueId;\n"],"names":["usePointerRef","value","pointer","useRef","current","useCallbackRef","deps","arguments","length","undefined","ref","useCallback","useStickyKey","shouldUpdate","keyRef","useUniqueId","prefix","dependencies","useMemo","_uniqueId","toString","idCounter","module","exports","id"],"sourceRoot":""}