bitboss-ui 0.2.59 → 0.2.60

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.
Files changed (141) hide show
  1. package/dist/index101.js +3 -3
  2. package/dist/index103.js +2 -2
  3. package/dist/index109.js +1 -1
  4. package/dist/index11.js +2 -2
  5. package/dist/index111.js +4 -4
  6. package/dist/index113.js +1 -1
  7. package/dist/index116.js +1 -1
  8. package/dist/index117.js +1 -1
  9. package/dist/index118.js +1 -1
  10. package/dist/index119.js +1 -1
  11. package/dist/index121.js +1 -1
  12. package/dist/index125.js +1 -1
  13. package/dist/index126.js +1 -1
  14. package/dist/index127.js +1 -1
  15. package/dist/index131.js +2 -2
  16. package/dist/index15.js +7 -7
  17. package/dist/index17.js +8 -8
  18. package/dist/index19.js +3 -3
  19. package/dist/index196.js +2 -2
  20. package/dist/index196.js.map +1 -1
  21. package/dist/index197.js +10 -4
  22. package/dist/index197.js.map +1 -1
  23. package/dist/index198.js +3 -2
  24. package/dist/index198.js.map +1 -1
  25. package/dist/index199.js +34 -9
  26. package/dist/index199.js.map +1 -1
  27. package/dist/index200.js +6 -3
  28. package/dist/index200.js.map +1 -1
  29. package/dist/index201.js +2 -35
  30. package/dist/index201.js.map +1 -1
  31. package/dist/index202.js +2 -6
  32. package/dist/index202.js.map +1 -1
  33. package/dist/index203.js +2 -235
  34. package/dist/index203.js.map +1 -1
  35. package/dist/index204.js +3 -368
  36. package/dist/index204.js.map +1 -1
  37. package/dist/index205.js +3 -134
  38. package/dist/index205.js.map +1 -1
  39. package/dist/index206.js +5 -295
  40. package/dist/index206.js.map +1 -1
  41. package/dist/index207.js +15 -18
  42. package/dist/index207.js.map +1 -1
  43. package/dist/index208.js +16 -2
  44. package/dist/index208.js.map +1 -1
  45. package/dist/index209.js +19 -2
  46. package/dist/index209.js.map +1 -1
  47. package/dist/index21.js +2 -2
  48. package/dist/index210.js +18 -172
  49. package/dist/index210.js.map +1 -1
  50. package/dist/index211.js +29 -23
  51. package/dist/index211.js.map +1 -1
  52. package/dist/index212.js +8 -373
  53. package/dist/index212.js.map +1 -1
  54. package/dist/index213.js +2 -16
  55. package/dist/index213.js.map +1 -1
  56. package/dist/index214.js +4 -16
  57. package/dist/index214.js.map +1 -1
  58. package/dist/index215.js +366 -18
  59. package/dist/index215.js.map +1 -1
  60. package/dist/index216.js +130 -25
  61. package/dist/index216.js.map +1 -1
  62. package/dist/index217.js +174 -8
  63. package/dist/index217.js.map +1 -1
  64. package/dist/index218.js +23 -2
  65. package/dist/index218.js.map +1 -1
  66. package/dist/index219.js +373 -3
  67. package/dist/index219.js.map +1 -1
  68. package/dist/index220.js +121 -3
  69. package/dist/index220.js.map +1 -1
  70. package/dist/index221.js +2 -121
  71. package/dist/index221.js.map +1 -1
  72. package/dist/index222.js +235 -2
  73. package/dist/index222.js.map +1 -1
  74. package/dist/index226.js +78 -3
  75. package/dist/index226.js.map +1 -1
  76. package/dist/index227.js +428 -72
  77. package/dist/index227.js.map +1 -1
  78. package/dist/index228.js +88 -159
  79. package/dist/index228.js.map +1 -1
  80. package/dist/index229.js +202 -1
  81. package/dist/index229.js.map +1 -1
  82. package/dist/index23.js +1 -1
  83. package/dist/index230.js +224 -69
  84. package/dist/index230.js.map +1 -1
  85. package/dist/index231.js +258 -2
  86. package/dist/index231.js.map +1 -1
  87. package/dist/index232.js +2 -5
  88. package/dist/index232.js.map +1 -1
  89. package/dist/index233.js +3 -434
  90. package/dist/index233.js.map +1 -1
  91. package/dist/index234.js +294 -88
  92. package/dist/index234.js.map +1 -1
  93. package/dist/index235.js +5 -14
  94. package/dist/index235.js.map +1 -1
  95. package/dist/index236.js +2 -200
  96. package/dist/index236.js.map +1 -1
  97. package/dist/index237.js +2 -6
  98. package/dist/index237.js.map +1 -1
  99. package/dist/index238.js +2 -2
  100. package/dist/index239.js +2 -2
  101. package/dist/index241.js +2 -117
  102. package/dist/index241.js.map +1 -1
  103. package/dist/index242.js +2 -106
  104. package/dist/index242.js.map +1 -1
  105. package/dist/index243.js +117 -2
  106. package/dist/index243.js.map +1 -1
  107. package/dist/index244.js +106 -2
  108. package/dist/index244.js.map +1 -1
  109. package/dist/index245.js +160 -2
  110. package/dist/index245.js.map +1 -1
  111. package/dist/index246.js +1 -4
  112. package/dist/index246.js.map +1 -1
  113. package/dist/index247.js +69 -224
  114. package/dist/index247.js.map +1 -1
  115. package/dist/index248.js +5 -258
  116. package/dist/index248.js.map +1 -1
  117. package/dist/index249.js +15 -2
  118. package/dist/index249.js.map +1 -1
  119. package/dist/index25.js +2 -2
  120. package/dist/index253.js +2 -3
  121. package/dist/index253.js.map +1 -1
  122. package/dist/index254.js +1 -1
  123. package/dist/index255.js +3 -2
  124. package/dist/index255.js.map +1 -1
  125. package/dist/index256.js +5 -0
  126. package/dist/index256.js.map +1 -0
  127. package/dist/index29.js +3 -3
  128. package/dist/index31.js +9 -9
  129. package/dist/index31.js.map +1 -1
  130. package/dist/index33.js +2 -2
  131. package/dist/index35.js +2 -2
  132. package/dist/index47.js +1 -1
  133. package/dist/index49.js +1 -1
  134. package/dist/index65.js +4 -4
  135. package/dist/index72.js +1 -1
  136. package/dist/index75.js +1 -1
  137. package/dist/index77.js +1 -1
  138. package/dist/index79.js +4 -4
  139. package/dist/index81.js +1 -1
  140. package/dist/style.css +1 -1
  141. package/package.json +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index248.js","sources":["../node_modules/lodash.snakecase/index.js"],"sourcesContent":["/**\n * lodash (Custom Build) <https://lodash.com/>\n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors <https://jquery.org/>\n * Released under MIT license <https://lodash.com/license>\n * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>\n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as references for various `Number` constants. */\nvar INFINITY = 1 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match words composed of alphanumeric characters. */\nvar reAsciiWord = /[^\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\x7f]+/g;\n\n/** Used to match Latin Unicode letters (excluding mathematical operators). */\nvar reLatin = /[\\xc0-\\xd6\\xd8-\\xf6\\xf8-\\xff\\u0100-\\u017f]/g;\n\n/** Used to compose unicode character classes. */\nvar rsAstralRange = '\\\\ud800-\\\\udfff',\n rsComboMarksRange = '\\\\u0300-\\\\u036f\\\\ufe20-\\\\ufe23',\n rsComboSymbolsRange = '\\\\u20d0-\\\\u20f0',\n rsDingbatRange = '\\\\u2700-\\\\u27bf',\n rsLowerRange = 'a-z\\\\xdf-\\\\xf6\\\\xf8-\\\\xff',\n rsMathOpRange = '\\\\xac\\\\xb1\\\\xd7\\\\xf7',\n rsNonCharRange = '\\\\x00-\\\\x2f\\\\x3a-\\\\x40\\\\x5b-\\\\x60\\\\x7b-\\\\xbf',\n rsPunctuationRange = '\\\\u2000-\\\\u206f',\n rsSpaceRange = ' \\\\t\\\\x0b\\\\f\\\\xa0\\\\ufeff\\\\n\\\\r\\\\u2028\\\\u2029\\\\u1680\\\\u180e\\\\u2000\\\\u2001\\\\u2002\\\\u2003\\\\u2004\\\\u2005\\\\u2006\\\\u2007\\\\u2008\\\\u2009\\\\u200a\\\\u202f\\\\u205f\\\\u3000',\n rsUpperRange = 'A-Z\\\\xc0-\\\\xd6\\\\xd8-\\\\xde',\n rsVarRange = '\\\\ufe0e\\\\ufe0f',\n rsBreakRange = rsMathOpRange + rsNonCharRange + rsPunctuationRange + rsSpaceRange;\n\n/** Used to compose unicode capture groups. */\nvar rsApos = \"['\\u2019]\",\n rsBreak = '[' + rsBreakRange + ']',\n rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',\n rsDigits = '\\\\d+',\n rsDingbat = '[' + rsDingbatRange + ']',\n rsLower = '[' + rsLowerRange + ']',\n rsMisc = '[^' + rsAstralRange + rsBreakRange + rsDigits + rsDingbatRange + rsLowerRange + rsUpperRange + ']',\n rsFitz = '\\\\ud83c[\\\\udffb-\\\\udfff]',\n rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',\n rsNonAstral = '[^' + rsAstralRange + ']',\n rsRegional = '(?:\\\\ud83c[\\\\udde6-\\\\uddff]){2}',\n rsSurrPair = '[\\\\ud800-\\\\udbff][\\\\udc00-\\\\udfff]',\n rsUpper = '[' + rsUpperRange + ']',\n rsZWJ = '\\\\u200d';\n\n/** Used to compose unicode regexes. */\nvar rsLowerMisc = '(?:' + rsLower + '|' + rsMisc + ')',\n rsUpperMisc = '(?:' + rsUpper + '|' + rsMisc + ')',\n rsOptLowerContr = '(?:' + rsApos + '(?:d|ll|m|re|s|t|ve))?',\n rsOptUpperContr = '(?:' + rsApos + '(?:D|LL|M|RE|S|T|VE))?',\n reOptMod = rsModifier + '?',\n rsOptVar = '[' + rsVarRange + ']?',\n rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',\n rsSeq = rsOptVar + reOptMod + rsOptJoin,\n rsEmoji = '(?:' + [rsDingbat, rsRegional, rsSurrPair].join('|') + ')' + rsSeq;\n\n/** Used to match apostrophes. */\nvar reApos = RegExp(rsApos, 'g');\n\n/**\n * Used to match [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks) and\n * [combining diacritical marks for symbols](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks_for_Symbols).\n */\nvar reComboMark = RegExp(rsCombo, 'g');\n\n/** Used to match complex or compound words. */\nvar reUnicodeWord = RegExp([\n rsUpper + '?' + rsLower + '+' + rsOptLowerContr + '(?=' + [rsBreak, rsUpper, '$'].join('|') + ')',\n rsUpperMisc + '+' + rsOptUpperContr + '(?=' + [rsBreak, rsUpper + rsLowerMisc, '$'].join('|') + ')',\n rsUpper + '?' + rsLowerMisc + '+' + rsOptLowerContr,\n rsUpper + '+' + rsOptUpperContr,\n rsDigits,\n rsEmoji\n].join('|'), 'g');\n\n/** Used to detect strings that need a more robust regexp to match words. */\nvar reHasUnicodeWord = /[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;\n\n/** Used to map Latin Unicode letters to basic Latin letters. */\nvar deburredLetters = {\n // Latin-1 Supplement block.\n '\\xc0': 'A', '\\xc1': 'A', '\\xc2': 'A', '\\xc3': 'A', '\\xc4': 'A', '\\xc5': 'A',\n '\\xe0': 'a', '\\xe1': 'a', '\\xe2': 'a', '\\xe3': 'a', '\\xe4': 'a', '\\xe5': 'a',\n '\\xc7': 'C', '\\xe7': 'c',\n '\\xd0': 'D', '\\xf0': 'd',\n '\\xc8': 'E', '\\xc9': 'E', '\\xca': 'E', '\\xcb': 'E',\n '\\xe8': 'e', '\\xe9': 'e', '\\xea': 'e', '\\xeb': 'e',\n '\\xcc': 'I', '\\xcd': 'I', '\\xce': 'I', '\\xcf': 'I',\n '\\xec': 'i', '\\xed': 'i', '\\xee': 'i', '\\xef': 'i',\n '\\xd1': 'N', '\\xf1': 'n',\n '\\xd2': 'O', '\\xd3': 'O', '\\xd4': 'O', '\\xd5': 'O', '\\xd6': 'O', '\\xd8': 'O',\n '\\xf2': 'o', '\\xf3': 'o', '\\xf4': 'o', '\\xf5': 'o', '\\xf6': 'o', '\\xf8': 'o',\n '\\xd9': 'U', '\\xda': 'U', '\\xdb': 'U', '\\xdc': 'U',\n '\\xf9': 'u', '\\xfa': 'u', '\\xfb': 'u', '\\xfc': 'u',\n '\\xdd': 'Y', '\\xfd': 'y', '\\xff': 'y',\n '\\xc6': 'Ae', '\\xe6': 'ae',\n '\\xde': 'Th', '\\xfe': 'th',\n '\\xdf': 'ss',\n // Latin Extended-A block.\n '\\u0100': 'A', '\\u0102': 'A', '\\u0104': 'A',\n '\\u0101': 'a', '\\u0103': 'a', '\\u0105': 'a',\n '\\u0106': 'C', '\\u0108': 'C', '\\u010a': 'C', '\\u010c': 'C',\n '\\u0107': 'c', '\\u0109': 'c', '\\u010b': 'c', '\\u010d': 'c',\n '\\u010e': 'D', '\\u0110': 'D', '\\u010f': 'd', '\\u0111': 'd',\n '\\u0112': 'E', '\\u0114': 'E', '\\u0116': 'E', '\\u0118': 'E', '\\u011a': 'E',\n '\\u0113': 'e', '\\u0115': 'e', '\\u0117': 'e', '\\u0119': 'e', '\\u011b': 'e',\n '\\u011c': 'G', '\\u011e': 'G', '\\u0120': 'G', '\\u0122': 'G',\n '\\u011d': 'g', '\\u011f': 'g', '\\u0121': 'g', '\\u0123': 'g',\n '\\u0124': 'H', '\\u0126': 'H', '\\u0125': 'h', '\\u0127': 'h',\n '\\u0128': 'I', '\\u012a': 'I', '\\u012c': 'I', '\\u012e': 'I', '\\u0130': 'I',\n '\\u0129': 'i', '\\u012b': 'i', '\\u012d': 'i', '\\u012f': 'i', '\\u0131': 'i',\n '\\u0134': 'J', '\\u0135': 'j',\n '\\u0136': 'K', '\\u0137': 'k', '\\u0138': 'k',\n '\\u0139': 'L', '\\u013b': 'L', '\\u013d': 'L', '\\u013f': 'L', '\\u0141': 'L',\n '\\u013a': 'l', '\\u013c': 'l', '\\u013e': 'l', '\\u0140': 'l', '\\u0142': 'l',\n '\\u0143': 'N', '\\u0145': 'N', '\\u0147': 'N', '\\u014a': 'N',\n '\\u0144': 'n', '\\u0146': 'n', '\\u0148': 'n', '\\u014b': 'n',\n '\\u014c': 'O', '\\u014e': 'O', '\\u0150': 'O',\n '\\u014d': 'o', '\\u014f': 'o', '\\u0151': 'o',\n '\\u0154': 'R', '\\u0156': 'R', '\\u0158': 'R',\n '\\u0155': 'r', '\\u0157': 'r', '\\u0159': 'r',\n '\\u015a': 'S', '\\u015c': 'S', '\\u015e': 'S', '\\u0160': 'S',\n '\\u015b': 's', '\\u015d': 's', '\\u015f': 's', '\\u0161': 's',\n '\\u0162': 'T', '\\u0164': 'T', '\\u0166': 'T',\n '\\u0163': 't', '\\u0165': 't', '\\u0167': 't',\n '\\u0168': 'U', '\\u016a': 'U', '\\u016c': 'U', '\\u016e': 'U', '\\u0170': 'U', '\\u0172': 'U',\n '\\u0169': 'u', '\\u016b': 'u', '\\u016d': 'u', '\\u016f': 'u', '\\u0171': 'u', '\\u0173': 'u',\n '\\u0174': 'W', '\\u0175': 'w',\n '\\u0176': 'Y', '\\u0177': 'y', '\\u0178': 'Y',\n '\\u0179': 'Z', '\\u017b': 'Z', '\\u017d': 'Z',\n '\\u017a': 'z', '\\u017c': 'z', '\\u017e': 'z',\n '\\u0132': 'IJ', '\\u0133': 'ij',\n '\\u0152': 'Oe', '\\u0153': 'oe',\n '\\u0149': \"'n\", '\\u017f': 'ss'\n};\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/**\n * A specialized version of `_.reduce` for arrays without support for\n * iteratee shorthands.\n *\n * @private\n * @param {Array} [array] The array to iterate over.\n * @param {Function} iteratee The function invoked per iteration.\n * @param {*} [accumulator] The initial value.\n * @param {boolean} [initAccum] Specify using the first element of `array` as\n * the initial value.\n * @returns {*} Returns the accumulated value.\n */\nfunction arrayReduce(array, iteratee, accumulator, initAccum) {\n var index = -1,\n length = array ? array.length : 0;\n\n if (initAccum && length) {\n accumulator = array[++index];\n }\n while (++index < length) {\n accumulator = iteratee(accumulator, array[index], index, array);\n }\n return accumulator;\n}\n\n/**\n * Splits an ASCII `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction asciiWords(string) {\n return string.match(reAsciiWord) || [];\n}\n\n/**\n * The base implementation of `_.propertyOf` without support for deep paths.\n *\n * @private\n * @param {Object} object The object to query.\n * @returns {Function} Returns the new accessor function.\n */\nfunction basePropertyOf(object) {\n return function(key) {\n return object == null ? undefined : object[key];\n };\n}\n\n/**\n * Used by `_.deburr` to convert Latin-1 Supplement and Latin Extended-A\n * letters to basic Latin letters.\n *\n * @private\n * @param {string} letter The matched letter to deburr.\n * @returns {string} Returns the deburred letter.\n */\nvar deburrLetter = basePropertyOf(deburredLetters);\n\n/**\n * Checks if `string` contains a word composed of Unicode symbols.\n *\n * @private\n * @param {string} string The string to inspect.\n * @returns {boolean} Returns `true` if a word is found, else `false`.\n */\nfunction hasUnicodeWord(string) {\n return reHasUnicodeWord.test(string);\n}\n\n/**\n * Splits a Unicode `string` into an array of its words.\n *\n * @private\n * @param {string} The string to inspect.\n * @returns {Array} Returns the words of `string`.\n */\nfunction unicodeWords(string) {\n return string.match(reUnicodeWord) || [];\n}\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\n/** Used to convert symbols to primitives and strings. */\nvar symbolProto = Symbol ? Symbol.prototype : undefined,\n symbolToString = symbolProto ? symbolProto.toString : undefined;\n\n/**\n * The base implementation of `_.toString` which doesn't convert nullish\n * values to empty strings.\n *\n * @private\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n */\nfunction baseToString(value) {\n // Exit early for strings to avoid a performance hit in some environments.\n if (typeof value == 'string') {\n return value;\n }\n if (isSymbol(value)) {\n return symbolToString ? symbolToString.call(value) : '';\n }\n var result = (value + '');\n return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;\n}\n\n/**\n * Creates a function like `_.camelCase`.\n *\n * @private\n * @param {Function} callback The function to combine each word.\n * @returns {Function} Returns the new compounder function.\n */\nfunction createCompounder(callback) {\n return function(string) {\n return arrayReduce(words(deburr(string).replace(reApos, '')), callback, '');\n };\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a string. An empty string is returned for `null`\n * and `undefined` values. The sign of `-0` is preserved.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {string} Returns the string.\n * @example\n *\n * _.toString(null);\n * // => ''\n *\n * _.toString(-0);\n * // => '-0'\n *\n * _.toString([1, 2, 3]);\n * // => '1,2,3'\n */\nfunction toString(value) {\n return value == null ? '' : baseToString(value);\n}\n\n/**\n * Deburrs `string` by converting\n * [Latin-1 Supplement](https://en.wikipedia.org/wiki/Latin-1_Supplement_(Unicode_block)#Character_table)\n * and [Latin Extended-A](https://en.wikipedia.org/wiki/Latin_Extended-A)\n * letters to basic Latin letters and removing\n * [combining diacritical marks](https://en.wikipedia.org/wiki/Combining_Diacritical_Marks).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to deburr.\n * @returns {string} Returns the deburred string.\n * @example\n *\n * _.deburr('déjà vu');\n * // => 'deja vu'\n */\nfunction deburr(string) {\n string = toString(string);\n return string && string.replace(reLatin, deburrLetter).replace(reComboMark, '');\n}\n\n/**\n * Converts `string` to\n * [snake case](https://en.wikipedia.org/wiki/Snake_case).\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to convert.\n * @returns {string} Returns the snake cased string.\n * @example\n *\n * _.snakeCase('Foo Bar');\n * // => 'foo_bar'\n *\n * _.snakeCase('fooBar');\n * // => 'foo_bar'\n *\n * _.snakeCase('--FOO-BAR--');\n * // => 'foo_bar'\n */\nvar snakeCase = createCompounder(function(result, word, index) {\n return result + (index ? '_' : '') + word.toLowerCase();\n});\n\n/**\n * Splits `string` into an array of its words.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category String\n * @param {string} [string=''] The string to inspect.\n * @param {RegExp|string} [pattern] The pattern to match words.\n * @param- {Object} [guard] Enables use as an iteratee for methods like `_.map`.\n * @returns {Array} Returns the words of `string`.\n * @example\n *\n * _.words('fred, barney, & pebbles');\n * // => ['fred', 'barney', 'pebbles']\n *\n * _.words('fred, barney, & pebbles', /[^, ]+/g);\n * // => ['fred', 'barney', '&', 'pebbles']\n */\nfunction words(string, pattern, guard) {\n string = toString(string);\n pattern = guard ? undefined : pattern;\n\n if (pattern === undefined) {\n return hasUnicodeWord(string) ? unicodeWords(string) : asciiWords(string);\n }\n return string.match(pattern) || [];\n}\n\nmodule.exports = snakeCase;\n"],"names":["INFINITY","symbolTag","reAsciiWord","reLatin","rsAstralRange","rsComboMarksRange","rsComboSymbolsRange","rsDingbatRange","rsLowerRange","rsMathOpRange","rsNonCharRange","rsPunctuationRange","rsSpaceRange","rsUpperRange","rsVarRange","rsBreakRange","rsApos","rsBreak","rsCombo","rsDigits","rsDingbat","rsLower","rsMisc","rsFitz","rsModifier","rsNonAstral","rsRegional","rsSurrPair","rsUpper","rsZWJ","rsLowerMisc","rsUpperMisc","rsOptLowerContr","rsOptUpperContr","reOptMod","rsOptVar","rsOptJoin","rsSeq","rsEmoji","reApos","reComboMark","reUnicodeWord","reHasUnicodeWord","deburredLetters","freeGlobal","global","freeSelf","root","arrayReduce","array","iteratee","accumulator","initAccum","index","length","asciiWords","string","basePropertyOf","object","key","deburrLetter","hasUnicodeWord","unicodeWords","objectProto","objectToString","Symbol","symbolProto","symbolToString","baseToString","value","isSymbol","result","createCompounder","callback","words","deburr","isObjectLike","toString","snakeCase","word","pattern","guard","lodash_snakecase"],"mappings":";AAUA,IAAIA,IAAW,OAGXC,IAAY,mBAGZC,IAAc,6CAGdC,IAAU,+CAGVC,IAAgB,mBAChBC,IAAoB,kCACpBC,IAAsB,mBACtBC,IAAiB,mBACjBC,IAAe,6BACfC,IAAgB,wBAChBC,IAAiB,gDACjBC,IAAqB,mBACrBC,IAAe,gKACfC,IAAe,6BACfC,IAAa,kBACbC,IAAeN,IAAgBC,IAAiBC,IAAqBC,GAGrEI,IAAS,QACTC,IAAU,MAAMF,IAAe,KAC/BG,IAAU,MAAMb,IAAoBC,IAAsB,KAC1Da,IAAW,QACXC,IAAY,MAAMb,IAAiB,KACnCc,IAAU,MAAMb,IAAe,KAC/Bc,IAAS,OAAOlB,IAAgBW,IAAeI,IAAWZ,IAAiBC,IAAeK,IAAe,KACzGU,IAAS,4BACTC,IAAa,QAAQN,IAAU,MAAMK,IAAS,KAC9CE,IAAc,OAAOrB,IAAgB,KACrCsB,IAAa,mCACbC,IAAa,sCACbC,IAAU,MAAMf,IAAe,KAC/BgB,IAAQ,WAGRC,IAAc,QAAQT,IAAU,MAAMC,IAAS,KAC/CS,IAAc,QAAQH,IAAU,MAAMN,IAAS,KAC/CU,IAAkB,QAAQhB,IAAS,0BACnCiB,IAAkB,QAAQjB,IAAS,0BACnCkB,IAAWV,IAAa,KACxBW,IAAW,MAAMrB,IAAa,MAC9BsB,IAAY,QAAQP,IAAQ,QAAQ,CAACJ,GAAaC,GAAYC,CAAU,EAAE,KAAK,GAAG,IAAI,MAAMQ,IAAWD,IAAW,MAClHG,IAAQF,IAAWD,IAAWE,GAC9BE,IAAU,QAAQ,CAAClB,GAAWM,GAAYC,CAAU,EAAE,K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{"version":3,"file":"index248.js","sources":["../src/utilities/functions/flattenTree.ts"],"sourcesContent":["export const flattenTree = <T extends Record<string, any>, U>(\n\titems: T[],\n\tkeyName: keyof T,\n\tmapper: (item: T, parent?: U) => U = (x: any) => x,\n\tparent?: ReturnType<typeof mapper>\n): ReturnType<typeof mapper>[] => {\n\treturn items\n\t\t.map((item) => {\n\t\t\tif (Array.isArray(item[keyName])) {\n\t\t\t\treturn [\n\t\t\t\t\tmapper(item, parent),\n\t\t\t\t\t...flattenTree(item[keyName], keyName, mapper, mapper(item, parent)),\n\t\t\t\t];\n\t\t\t}\n\t\t\treturn [mapper(item, parent)];\n\t\t})\n\t\t.flat();\n};\n"],"names":["flattenTree","items","keyName","mapper","x","parent","item"],"mappings":"AAAa,MAAAA,IAAc,CAC1BC,GACAC,GACAC,IAAqC,CAACC,MAAWA,GACjDC,MAEOJ,EACL,IAAI,CAACK,MACD,MAAM,QAAQA,EAAKJ,CAAO,CAAC,IACvB;AAAA,EACNC,EAAOG,GAAMD,CAAM;AAAA,EACnB,GAAGL,EAAYM,EAAKJ,CAAO,GAAGA,GAASC,GAAQA,EAAOG,GAAMD,CAAM,CAAC;AAAA,IAG9D,CAACF,EAAOG,GAAMD,CAAM,CAAC,CAC5B,EACA,KAAK;"}
package/dist/index249.js CHANGED
@@ -1,5 +1,18 @@
1
- import e from "./index203.js";
1
+ function r(t) {
2
+ return Object.prototype.toString.call(t).slice(8, -1);
3
+ }
4
+ function o(t) {
5
+ return r(t) === "Array";
6
+ }
7
+ function c(t) {
8
+ if (r(t) !== "Object")
9
+ return !1;
10
+ const e = Object.getPrototypeOf(t);
11
+ return !!e && e.constructor === Object && e === Object.prototype;
12
+ }
2
13
  export {
3
- e as default
14
+ r as getType,
15
+ o as isArray,
16
+ c as isPlainObject
4
17
  };
5
18
  //# sourceMappingURL=index249.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index249.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
1
+ {"version":3,"file":"index249.js","sources":["../node_modules/is-what/dist/index.js"],"sourcesContent":["function getType(payload) {\n return Object.prototype.toString.call(payload).slice(8, -1);\n}\n\nfunction isAnyObject(payload) {\n return getType(payload) === \"Object\";\n}\n\nfunction isArray(payload) {\n return getType(payload) === \"Array\";\n}\n\nfunction isBlob(payload) {\n return getType(payload) === \"Blob\";\n}\n\nfunction isBoolean(payload) {\n return getType(payload) === \"Boolean\";\n}\n\nfunction isDate(payload) {\n return getType(payload) === \"Date\" && !isNaN(payload);\n}\n\nfunction isEmptyArray(payload) {\n return isArray(payload) && payload.length === 0;\n}\n\nfunction isPlainObject(payload) {\n if (getType(payload) !== \"Object\")\n return false;\n const prototype = Object.getPrototypeOf(payload);\n return !!prototype && prototype.constructor === Object && prototype === Object.prototype;\n}\n\nfunction isEmptyObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length === 0;\n}\n\nfunction isEmptyString(payload) {\n return payload === \"\";\n}\n\nfunction isError(payload) {\n return getType(payload) === \"Error\" || payload instanceof Error;\n}\n\nfunction isFile(payload) {\n return getType(payload) === \"File\";\n}\n\nfunction isFullArray(payload) {\n return isArray(payload) && payload.length > 0;\n}\n\nfunction isFullObject(payload) {\n return isPlainObject(payload) && Object.keys(payload).length > 0;\n}\n\nfunction isString(payload) {\n return getType(payload) === \"String\";\n}\n\nfunction isFullString(payload) {\n return isString(payload) && payload !== \"\";\n}\n\nfunction isFunction(payload) {\n return typeof payload === \"function\";\n}\n\nfunction isType(payload, type) {\n if (!(type instanceof Function)) {\n throw new TypeError(\"Type must be a function\");\n }\n if (!Object.prototype.hasOwnProperty.call(type, \"prototype\")) {\n throw new TypeError(\"Type is not a class\");\n }\n const name = type.name;\n return getType(payload) === name || Boolean(payload && payload.constructor === type);\n}\n\nfunction isInstanceOf(value, classOrClassName) {\n if (typeof classOrClassName === \"function\") {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (isType(p, classOrClassName)) {\n return true;\n }\n }\n return false;\n } else {\n for (let p = value; p; p = Object.getPrototypeOf(p)) {\n if (getType(p) === classOrClassName) {\n return true;\n }\n }\n return false;\n }\n}\n\nfunction isMap(payload) {\n return getType(payload) === \"Map\";\n}\n\nfunction isNaNValue(payload) {\n return getType(payload) === \"Number\" && isNaN(payload);\n}\n\nfunction isNumber(payload) {\n return getType(payload) === \"Number\" && !isNaN(payload);\n}\n\nfunction isNegativeNumber(payload) {\n return isNumber(payload) && payload < 0;\n}\n\nfunction isNull(payload) {\n return getType(payload) === \"Null\";\n}\n\nfunction isOneOf(a, b, c, d, e) {\n return (value) => a(value) || b(value) || !!c && c(value) || !!d && d(value) || !!e && e(value);\n}\n\nfunction isUndefined(payload) {\n return getType(payload) === \"Undefined\";\n}\n\nconst isNullOrUndefined = isOneOf(isNull, isUndefined);\n\nfunction isObject(payload) {\n return isPlainObject(payload);\n}\n\nfunction isObjectLike(payload) {\n return isAnyObject(payload);\n}\n\nfunction isPositiveNumber(payload) {\n return isNumber(payload) && payload > 0;\n}\n\nfunction isSymbol(payload) {\n return getType(payload) === \"Symbol\";\n}\n\nfunction isPrimitive(payload) {\n return isBoolean(payload) || isNull(payload) || isUndefined(payload) || isNumber(payload) || isString(payload) || isSymbol(payload);\n}\n\nfunction isPromise(payload) {\n return getType(payload) === \"Promise\";\n}\n\nfunction isRegExp(payload) {\n return getType(payload) === \"RegExp\";\n}\n\nfunction isSet(payload) {\n return getType(payload) === \"Set\";\n}\n\nfunction isWeakMap(payload) {\n return getType(payload) === \"WeakMap\";\n}\n\nfunction isWeakSet(payload) {\n return getType(payload) === \"WeakSet\";\n}\n\nexport { getType, isAnyObject, isArray, isBlob, isBoolean, isDate, isEmptyArray, isEmptyObject, isEmptyString, isError, isFile, isFullArray, isFullObject, isFullString, isFunction, isInstanceOf, isMap, isNaNValue, isNegativeNumber, isNull, isNullOrUndefined, isNumber, isObject, isObjectLike, isOneOf, isPlainObject, isPositiveNumber, isPrimitive, isPromise, isRegExp, isSet, isString, isSymbol, isType, isUndefined, isWeakMap, isWeakSet };\n"],"names":["getType","payload","isArray","isPlainObject","prototype"],"mappings":"AAAA,SAASA,EAAQC,GAAS;AACxB,SAAO,OAAO,UAAU,SAAS,KAAKA,CAAO,EAAE,MAAM,GAAG,EAAE;AAC5D;AAMA,SAASC,EAAQD,GAAS;AACxB,SAAOD,EAAQC,CAAO,MAAM;AAC9B;AAkBA,SAASE,EAAcF,GAAS;AAC9B,MAAID,EAAQC,CAAO,MAAM;AACvB,WAAO;AACT,QAAMG,IAAY,OAAO,eAAeH,CAAO;AAC/C,SAAO,CAAC,CAACG,KAAaA,EAAU,gBAAgB,UAAUA,MAAc,OAAO;AACjF;","x_google_ignoreList":[0]}
package/dist/index25.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as g, computed as n, ref as _, openBlock as w, createElementBlock as B, normalizeClass as C, createElementVNode as l, normalizeProps as t, guardReactiveProps as u, renderSlot as V } from "vue";
2
- import { isCssColor as i } from "./index196.js";
3
- import { when as E } from "./index197.js";
2
+ import { isCssColor as i } from "./index201.js";
3
+ import { when as E } from "./index214.js";
4
4
  const N = {
5
5
  "aria-hidden": "true",
6
6
  class: "bb-base-radio-container"
package/dist/index253.js CHANGED
@@ -1,6 +1,5 @@
1
- import o from "./index228.js";
2
- import "./index229.js";
1
+ import e from "./index222.js";
3
2
  export {
4
- o as default
3
+ e as default
5
4
  };
6
5
  //# sourceMappingURL=index253.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index253.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
1
+ {"version":3,"file":"index253.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
package/dist/index254.js CHANGED
@@ -1,4 +1,4 @@
1
- import f from "./index230.js";
1
+ import f from "./index247.js";
2
2
  export {
3
3
  f as default
4
4
  };
package/dist/index255.js CHANGED
@@ -1,5 +1,6 @@
1
- const i = (c, e = 0, o = 0) => c.slice(0, o).concat(c.slice(o + e));
1
+ import o from "./index245.js";
2
+ import "./index246.js";
2
3
  export {
3
- i as drop
4
+ o as default
4
5
  };
5
6
  //# sourceMappingURL=index255.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index255.js","sources":["../src/utilities/functions/drop.ts"],"sourcesContent":["/*\n * Drops N elements from an array and returns a new array.\n * Optionally start at an arbitrary index\n */\nexport const drop = <T>(arr: T[], howMany = 0, start = 0) =>\n\tarr.slice(0, start).concat(arr.slice(start + howMany));\n"],"names":["drop","arr","howMany","start"],"mappings":"AAIO,MAAMA,IAAO,CAAIC,GAAUC,IAAU,GAAGC,IAAQ,MACtDF,EAAI,MAAM,GAAGE,CAAK,EAAE,OAAOF,EAAI,MAAME,IAAQD,CAAO,CAAC;"}
1
+ {"version":3,"file":"index255.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;"}
@@ -0,0 +1,5 @@
1
+ const i = (c, e = 0, o = 0) => c.slice(0, o).concat(c.slice(o + e));
2
+ export {
3
+ i as drop
4
+ };
5
+ //# sourceMappingURL=index256.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index256.js","sources":["../src/utilities/functions/drop.ts"],"sourcesContent":["/*\n * Drops N elements from an array and returns a new array.\n * Optionally start at an arbitrary index\n */\nexport const drop = <T>(arr: T[], howMany = 0, start = 0) =>\n\tarr.slice(0, start).concat(arr.slice(start + howMany));\n"],"names":["drop","arr","howMany","start"],"mappings":"AAIO,MAAMA,IAAO,CAAIC,GAAUC,IAAU,GAAGC,IAAQ,MACtDF,EAAI,MAAM,GAAGE,CAAK,EAAE,OAAOF,EAAI,MAAME,IAAQD,CAAO,CAAC;"}
package/dist/index29.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { defineComponent as C, ref as b, computed as f, openBlock as l, createElementBlock as i, mergeProps as g, createElementVNode as r, Fragment as I, renderList as V, normalizeClass as B, toDisplayString as h, renderSlot as x } from "vue";
2
- import { booleanishToBoolean as M } from "./index218.js";
3
- import { identity as F } from "./index208.js";
4
- import { isCssColor as p } from "./index196.js";
2
+ import { booleanishToBoolean as M } from "./index202.js";
3
+ import { identity as F } from "./index203.js";
4
+ import { isCssColor as p } from "./index201.js";
5
5
  import { isNotNil as T } from "./index124.js";
6
6
  const H = { class: "bb-base-rating__inner-container" }, D = { class: "bb-base-rating__label-text" }, N = ["id", "autofocus", "checked", "disabled", "name", "value"], j = ["height", "width"], A = /* @__PURE__ */ r("path", {
7
7
  d: "m8.243 7.34l-6.38.925l-.113.023a1 1 0 0 0-.44 1.684l4.622 4.499l-1.09 6.355l-.013.11a1 1 0 0 0 1.464.944l5.706-3l5.693 3l.1.046a1 1 0 0 0 1.352-1.1l-1.091-6.355l4.624-4.5l.078-.085a1 1 0 0 0-.633-1.62l-6.38-.926l-2.852-5.78a1 1 0 0 0-1.794 0L8.243 7.34z",
package/dist/index31.js CHANGED
@@ -3,21 +3,21 @@ import Ae from "./index115.js";
3
3
  import "./index158.js";
4
4
  import Me from "./index119.js";
5
5
  import "./index185.js";
6
- import { useFloating as Je } from "./index221.js";
7
- import { clamp as qe } from "./index198.js";
6
+ import { useFloating as Je } from "./index220.js";
7
+ import { clamp as qe } from "./index196.js";
8
8
  import { deepEqual as se } from "./index123.js";
9
- import { head as G } from "./index222.js";
9
+ import { head as G } from "./index221.js";
10
10
  import { isNotNil as E } from "./index124.js";
11
- import { last as ze } from "./index209.js";
11
+ import { last as ze } from "./index213.js";
12
12
  import { useItemText as He } from "./index125.js";
13
13
  import { useItemValue as je } from "./index126.js";
14
14
  import { wait as X } from "./index122.js";
15
- import { waitFor as Pe } from "./index202.js";
16
- import { when as Qe } from "./index197.js";
15
+ import { waitFor as Pe } from "./index200.js";
16
+ import { when as Qe } from "./index214.js";
17
17
  import We from "./index116.js";
18
18
  import "./index160.js";
19
- import { autoUpdate as Ue, flip as Ke, shift as Re } from "./index204.js";
20
- import { offset as Ye } from "./index212.js";
19
+ import { autoUpdate as Ue, flip as Ke, shift as Re } from "./index215.js";
20
+ import { offset as Ye } from "./index219.js";
21
21
  const Ze = { class: "bb-base-select__input-container" }, Ge = ["id", "autocomplete", "autofocus", "disabled", "placeholder", "aria-controls", "readonly"], Xe = { class: "bb-base-select__chevron" }, el = /* @__PURE__ */ V("svg", {
22
22
  fill: "none",
23
23
  viewBox: "0 0 16 8",
@@ -78,7 +78,7 @@ const Ze = { class: "bb-base-select__input-container" }, Ge = ["id", "autocomple
78
78
  const L = m(null), J = m(null), k = m(null), { floatingStyles: ce } = Je(J, k, {
79
79
  placement: "bottom",
80
80
  whileElementsMounted: Ue,
81
- middleware: [Ke(), Ye(), Re()]
81
+ middleware: [Ke(), Ye(5), Re()]
82
82
  }), fe = y(() => {
83
83
  const e = {
84
84
  ...ce.value,
@@ -1 +1 @@
1
- {"version":3,"file":"index31.js","sources":["../src/components/BaseSelect/BaseSelect.vue"],"sourcesContent":["<template>\n\t<div\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-select': true,\n\t\t\t'bb-base-select--active': active,\n\t\t\t'bb-base-select--loading': loading,\n\t\t\t'bb-base-select--disabled': disabled,\n\t\t\t'bb-base-select--errors': hasErrors,\n\t\t\t'bb-base-select--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<slot name=\"prepend-outer\"></slot>\n\t\t<span ref=\"innerContainer\" class=\"bb-base-select__inner-container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span class=\"bb-base-select__input-container\">\n\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tv-for=\"(option, index) in selectedOptions\"\n\t\t\t\t\t\t\t:key=\"option.id\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-base-select__selected': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--comma': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--focused':\n\t\t\t\t\t\t\t\t\tindex === selectedOptionsFocusedIndex,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>{{ option.text\n\t\t\t\t\t\t\t}}{{ index < selectedOptions.length - 1 ? ',' : '' }}</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t<BbChip\n\t\t\t\t\t\t\tv-for=\"(option, index) in selectedOptions\"\n\t\t\t\t\t\t\t:key=\"option.id\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-base-select__selected': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--chip': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--focused':\n\t\t\t\t\t\t\t\t\tindex === selectedOptionsFocusedIndex,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t:clearable=\"true\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t@click:clear.stop=\"onOptionSelected(option)\"\n\t\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t\t\t:index=\"option.index\"\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\t:loading=\"!!loading\"\n\t\t\t\t\t\t\t\t:manual=\"option.manual\"\n\t\t\t\t\t\t\t\tname=\"chip\"\n\t\t\t\t\t\t\t\t:selected=\"option.selected\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t\t></BbChip\n\t\t\t\t\t\t>\n\t\t\t\t\t</template>\n\t\t\t\t</template>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tref=\"input\"\n\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t:class=\"'bb-base-select__text-input'\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t:aria-controls=\"`${id}_listbox`\"\n\t\t\t\t\t:aria-autocomplete=\"'list'\"\n\t\t\t\t\t:readonly=\"readonly || !allowWriting\"\n\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t@blur.stop=\"onInputBlur\"\n\t\t\t\t\t@change.stop=\"onInputChange\"\n\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t@input.stop=\"onInputInput\"\n\t\t\t\t\t@keydown.stop=\"onInputKeyDown\"\n\t\t\t\t/>\n\t\t\t</span>\n\t\t\t<span class=\"bb-base-select__chevron\">\n\t\t\t\t<slot :loading=\"!!loading\" name=\"chevron\" :shown=\"shown\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tviewBox=\"0 0 16 8\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\td=\"M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z\"\n\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</slot>\n\t\t\t</span>\n\t\t\t<slot v-if=\"!loading\" name=\"append\"></slot>\n\t\t\t<span\n\t\t\t\tv-else\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-select__spinner': true,\n\t\t\t\t\t'bb-base-select__spinner--loading': loading,\n\t\t\t\t}\"\n\t\t\t\t><slot :loading=\"!!loading\" :name=\"'spinner'\"\n\t\t\t\t\t><BbSpinner :size=\"'sm'\" /></slot\n\t\t\t></span>\n\t\t</span>\n\t\t<slot name=\"append-outer\"></slot>\n\t\t<input v-for=\"input in hiddenInputs\" :key=\"input.value\" v-bind=\"input\" />\n\n\t\t<teleport to=\"body\">\n\t\t\t<span\n\t\t\t\tref=\"optionsContainer\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-select__options-container': true,\n\t\t\t\t\t'bb-base-select__options-container--shown': shown,\n\t\t\t\t\t'bb-base-select__options-container--hidden': hidden,\n\t\t\t\t}\"\n\t\t\t\t:id=\"`${id}_listbox`\"\n\t\t\t\t:role=\"'listbox'\"\n\t\t\t\t:tabindex=\"-1\"\n\t\t\t\t:style=\"optionsContainerStyles\"\n\t\t\t>\n\t\t\t\t<BbCollapsible\n\t\t\t\t\t:modelValue=\"shown\"\n\t\t\t\t\t:transition-duration=\"transitionDuration\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"options:prepend\"></slot>\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"!filteredOptions.length && loading\"\n\t\t\t\t\t\tclass=\"bb-base-select__loading-container\"\n\t\t\t\t\t\t><slot :name=\"'loading'\" :query=\"query\">{{\n\t\t\t\t\t\t\tloadingText\n\t\t\t\t\t\t}}</slot></span\n\t\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-else-if=\"!filteredOptions.length\"\n\t\t\t\t\t\tclass=\"bb-base-select__no-data-container\"\n\t\t\t\t\t\t><slot :name=\"'no-data'\" :query=\"query\">{{\n\t\t\t\t\t\t\tnoDataText\n\t\t\t\t\t\t}}</slot></span\n\t\t\t\t\t>\n\t\t\t\t\t<template v-for=\"(option, index) in filteredOptions\" :key=\"option.id\">\n\t\t\t\t\t\t<slot :item=\"option.original\" name=\"option:prepend\"></slot>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t\t:aria-selected=\"option.selected\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-base-select-option': true,\n\t\t\t\t\t\t\t\t'bb-base-select-option--selected': option.selected,\n\t\t\t\t\t\t\t\t'bb-base-select-option--focused':\n\t\t\t\t\t\t\t\t\tnormalizedFocusedIndex === index,\n\t\t\t\t\t\t\t\t'bb-base-select-option--disabled': option.disabled,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t:role=\"'option'\"\n\t\t\t\t\t\t\t@click.stop=\"onOptionClicked\"\n\t\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t\t\t:focused=\"normalizedFocusedIndex === index\"\n\t\t\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t\t\t:index=\"option.index\"\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\t:loading=\"!!loading\"\n\t\t\t\t\t\t\t\t:manual=\"option.manual\"\n\t\t\t\t\t\t\t\tname=\"option\"\n\t\t\t\t\t\t\t\t:selected=\"option.selected\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\t\t\t><span class=\"bb-base-select-option__content\"\n\t\t\t\t\t\t\t\t\t><span class=\"bb-base-select-option__text\">{{\n\t\t\t\t\t\t\t\t\t\toption.text\n\t\t\t\t\t\t\t\t\t}}</span></span\n\t\t\t\t\t\t\t\t></slot\n\t\t\t\t\t\t\t></span\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<slot :item=\"option.original\" name=\"option:append\"></slot>\n\t\t\t\t\t</template>\n\t\t\t\t\t<slot name=\"options:append\"></slot>\n\t\t\t\t</BbCollapsible>\n\t\t\t</span>\n\t\t</teleport>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport BbChip from '../BbChip/BbChip.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\nimport { computed, nextTick, ref, watch } from 'vue';\nimport { useFloating, autoUpdate, flip, shift, offset } from '@floating-ui/vue';\nimport { clamp } from '@/utilities/functions/clamp';\nimport { deepEqual } from 'fast-equals';\nimport { head } from '@/utilities/functions/head';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { useItemText } from '@/composables/useItemText';\nimport { useItemValue } from '@/composables/useItemValue';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport { when } from '@/utilities/functions/when';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport type { ComputedRef, HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BaseSelectProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\t/**\n\t * Logs messages for debugging purposes.\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid: HTMLAttributes['id'];\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * How long the transition has to last in milliseconds\n\t */\n\ttransitionDuration?: number;\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| any[]\n\t\t| ((query: string, prefill: boolean, modelValue: any) => Promise<any[]>)\n\t\t| ((query: string, prefill: boolean, modelValue: any) => any[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: string | ((item: any) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: string | ((item: any) => string) | undefined;\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the user to add options to the list by\n\t * inserting text in the input and pressing ENTER.\n\t * The value and text of the option generated is a\n\t * string equal to what has been inserted.\n\t */\n\taddOptions?: boolean;\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\t/**\n\t * Defines how the filtering should work.\n\t * In any case options are always filtered by the text displayed but\n\t * they can also take into account other properties of the\n\t * passed elements when this property is a string or an array of string.\n\t * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n\t * You can also pass false to not filter anything or a function for more granular control.\n\t *\n\t */\n\tfilterBy?:\n\t\t| string\n\t\t| string[]\n\t\t| false\n\t\t| ((value: any, item: any) => boolean)\n\t\t| null;\n\t/**\n\t * Defines the prefill strategy for the input. By default the input will prefill\n\t * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n\t */\n\tprefill?: boolean | 'focus';\n\t/**\n\t * Time to wait when the users stops writing in the input before querying data.\n\t * Especially useful when searching live data on big datasets.\n\t */\n\tqueryDebounceTime?: number;\n\t/**\n\t * If `true` when in multiple selection, reset the query immediately\n\t * upon selecting an option. By default the query is\n\t * not reset until focus is lost so the user can search\n\t * for \"Cath\" and select \"Cathy\" and then write more to\n\t * search for \"Catherine\"\n\t */\n\tresetQueryOnOptionSelected?: boolean;\n\t/**\n\t * Adds a stash to accumulate selected values. Especially\n\t * useful when searching in a big database of items.\n\t * E.g. if you search for \"John\" and then search for \"Richard\"\n\t * you either always return the previous items or you stash them passing `true` to this option.\n\t */\n\tstash?: boolean;\n\t/**\n\t * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n\t */\n\tupdateOnAnimationFrame?: boolean;\n};\nexport type BaseSelectEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type BaseSelectSlots = {\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'options:prepend'?: (props: object) => any;\n\tloading?: (props: { query: string }) => any;\n\t'no-data'?: (props: { query: string }) => any;\n\t'option:prepend'?: (props: { item: any }) => any;\n\tchip?: (props: {\n\t\tdisabled: boolean;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\toption?: (props: {\n\t\tdisabled: boolean;\n\t\tfocused: boolean;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\t'option:append'?: (props: { item: any }) => any;\n\t'options:append'?: (props: object) => any;\n\tchevron?: (props: { loading: boolean; shown: boolean }) => any;\n\tappend?: (props: object) => any;\n\tspinner?: (props: { loading: boolean }) => any;\n\t'append-outer'?: (props: object) => any;\n};\n\nexport type BaseOption = {\n\tid: string;\n\tjsonValue: string;\n\tmanual: boolean;\n\toriginal: any;\n\ttext: string;\n\tvalue: any;\n\tdisabled: boolean;\n};\n\nexport type Option = BaseOption & {\n\tindex: number;\n\tselected: boolean;\n};\n\nconst props = withDefaults(defineProps<BaseSelectProps>(), {\n\tallowWriting: true,\n\tdepsDebounceTime: 0,\n\tfilterBy: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n\tprefill: 'focus',\n\tqueryDebounceTime: 500,\n\ttransitionDuration: 200,\n\tupdateOnAnimationFrame: false,\n});\n\nconst emit = defineEmits<BaseSelectEvents>();\n\ndefineSlots<BaseSelectSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst optionsContainer = ref<HTMLElement | null>(null);\n\nconst { floatingStyles } = useFloating(innerContainer, optionsContainer, {\n\tplacement: 'bottom',\n\twhileElementsMounted: autoUpdate,\n\tmiddleware: [flip(), offset(), shift()],\n});\n\nconst optionsContainerStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t};\n\tif (innerContainer.value) {\n\t\tbase.width = `${innerContainer.value.clientWidth}px`;\n\t}\n\n\treturn base;\n});\n\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>('');\nconst computedPlaceholder = computed(() => {\n\tif (selectedOptions.value.length) return '';\n\telse return props.placeholder;\n});\n/**\n * Use a number accumulator because if the fn takes 5 seconds\n * and after 2 seconds another search is run\n * When the first returns the second is still out for 2 seconds\n * and we want to track them both.\n * Debounce will not be enough.\n */\nconst loading = ref(0);\n\nconst internalItems = ref<any[]>([]);\nconst stash = ref<BaseOption[]>([]);\nconst manualItems = ref<BaseOption[]>([]);\nconst { getItemText } = useItemText();\nconst { getItemValue } = useItemValue();\n\nconst internalOptions = computed<BaseOption[]>(() => {\n\treturn internalItems.value.map((item: any, _) => {\n\t\tconst text = getItemText(item, props.itemText as any);\n\t\tconst value = getItemValue(item, props.itemValue);\n\n\t\t// Undefined is not JSONable\n\t\tif (value === undefined)\n\t\t\tthrow new Error(\n\t\t\t\t'The result of extracting \"value\" from option was undefined. Affected item is ' +\n\t\t\t\t\tJSON.stringify(item) +\n\t\t\t\t\t' please check itemValue property is correct.'\n\t\t\t);\n\n\t\tconst jsonValue = JSON.stringify(value);\n\t\treturn {\n\t\t\tdisabled: !!item.disabled,\n\t\t\tid: 'option_' + jsonValue.replace(/\\W/g, '_'),\n\t\t\tjsonValue,\n\t\t\tmanual: false,\n\t\t\toriginal: item,\n\t\t\ttext,\n\t\t\tvalue,\n\t\t};\n\t});\n});\n\nconst options = computed<Option[]>(() => {\n\tlet fromOptions = internalOptions.value.reduce(\n\t\t(acc: { [key: string]: BaseOption }, curr: BaseOption) => {\n\t\t\tacc[curr.id] = curr;\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\tconst withManual: { [key: string]: BaseOption } = manualItems.value.reduce(\n\t\t(acc, curr) => {\n\t\t\tif (!acc[curr.id]) acc[curr.id] = curr as any;\n\t\t\treturn acc;\n\t\t},\n\t\tfromOptions\n\t);\n\tconst withStash: { [key: string]: BaseOption } = stash.value.reduce(\n\t\t(acc, curr) => {\n\t\t\tif (!acc[curr.id]) acc[curr.id] = curr as any;\n\t\t\treturn acc;\n\t\t},\n\t\twithManual\n\t);\n\treturn Object.values(withStash).map<Option>((option: BaseOption, index) => {\n\t\treturn {\n\t\t\t...option,\n\t\t\tselected: isNotNil(modelValueIndexed.value.get(option.value)),\n\t\t\tindex,\n\t\t};\n\t});\n});\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<Option[]>(() => {\n\tlet base = [];\n\t/** Only filter when a value is being searched not when the query is fully set on a selected option text */\n\tif (\n\t\tquery.value &&\n\t\t!selectedOptions.value.some((option: Option) => option.text === query.value)\n\t) {\n\t\tbase = options.value.filter((item: Option) => {\n\t\t\tlet matchedAnything = false;\n\t\t\tif (!props.filterBy) return true;\n\t\t\telse if (typeof props.filterBy === 'function')\n\t\t\t\tmatchedAnything = props.filterBy(item.value, item.original);\n\t\t\telse if (props.filterBy.length) {\n\t\t\t\tconst keys = ([] as string[]).concat(props.filterBy);\n\t\t\t\tfor (let index = 0; index < keys.length; index++) {\n\t\t\t\t\tconst propName = keys[index];\n\t\t\t\t\tmatchedAnything =\n\t\t\t\t\t\tmatchedAnything ||\n\t\t\t\t\t\t((item.original as any)[propName] &&\n\t\t\t\t\t\t\t(item.original as any)[propName]\n\t\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(query.value.toLowerCase()));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchedAnything ||\n\t\t\t\titem.text.toLowerCase().includes(query.value.toLowerCase())\n\t\t\t);\n\t\t});\n\t\t/** Otherwise defaul;t to the whole set of options */\n\t} else base = options.value;\n\n\t/** This is done here so that only visible options are highlighted */\n\treturn base;\n});\n\n/**\n * Indexes options by id for retrieval\n */\n\nconst optionsIndexedById = computed<{\n\t[key: string]: Option;\n}>(() =>\n\toptions.value.reduce(\n\t\t(acc, curr) => ({\n\t\t\t...acc,\n\t\t\t[curr.id]: curr,\n\t\t}),\n\t\t{}\n\t)\n);\n\n/**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\nconst optionsIndexedByValue = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet indexed = options.value.reduce(\n\t\t\t(acc: { [key: string]: Option }, curr: Option) => {\n\t\t\t\tacc[curr.jsonValue] = curr;\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn indexed[JSON.stringify(key)];\n\t\t\t},\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tlet indexed: [any, Option][] = options.value.map((option) => [\n\t\t\toption.value,\n\t\t\toption,\n\t\t]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet map: { [key: string]: number } = {};\n\t\t[].concat(props.modelValue).forEach((value: any, index: number) => {\n\t\t\tmap[JSON.stringify(value)] = index;\n\t\t});\n\t\treturn {\n\t\t\tget: (value: any) => map[JSON.stringify(value)],\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tconst map = []\n\t\t\t.concat(props.modelValue)\n\t\t\t.filter(isNotNil)\n\t\t\t.map((value, index) => [value, index]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * For every item in modelValue find the linked option if it exists.\n * This is used to display chips.\n */\nconst selectedOptions = computed(() => {\n\treturn [].concat(props.modelValue).reduce((acc: Option[], curr: any) => {\n\t\tconst linkedOption = optionsIndexedByValue.value.get(curr);\n\t\tif (linkedOption) acc.push(linkedOption);\n\t\treturn acc;\n\t}, []);\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option) => {\n\tlet valueToEmit;\n\tfocusedIndex.value = option.index;\n\t/**\n\t * For single selection:\n\t * If the option was already selected - restore the value to default, clean the stash, manual items, and query.\n\t * If the option was not selected - use its value, save the option in the stash and display it's text as query\n\t * The stash is used to remove the complexity of stashing items when searching for identifying information,\n\t * like searching an address would not return the option that was used to selected a previous address in another country.\n\t * Or when searching users by username would not return the previous ones.\n\t * We save it so the user hasn't to.\n\t */\n\tif (!props.multiple) {\n\t\tif (option.selected) {\n\t\t\tif (option.manual) {\n\t\t\t\tmanualItems.value = manualItems.value.filter(\n\t\t\t\t\t(current: any) => current.id !== option.id\n\t\t\t\t);\n\t\t\t}\n\t\t\tvalueToEmit = null;\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = [];\n\t\t\t}\n\t\t\tquery.value = '';\n\t\t} else {\n\t\t\tvalueToEmit = option.value;\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = [option as any];\n\t\t\t}\n\t\t\tquery.value = option.text;\n\t\t}\n\t\t/**\n\t\t * For multiple selection\n\t\t * If the option was selected remove it from modelValue, if it is a mnaual iutem also remove it from there.\n\t\t * In the stash we can search for the id of the option.\n\t\t * If the option was not selected we can just add it to modelValue and the stash.\n\t\t */\n\t} else {\n\t\tif (option.selected) {\n\t\t\tif (option.manual) {\n\t\t\t\tmanualItems.value = manualItems.value.filter(\n\t\t\t\t\t(current: any) => current.id !== option.id\n\t\t\t\t);\n\t\t\t}\n\t\t\tvalueToEmit = props.modelValue.filter(\n\t\t\t\t(value: any) => JSON.stringify(value) !== option.jsonValue\n\t\t\t);\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = stash.value.filter((stashed) => stashed.id !== option.id);\n\t\t\t}\n\t\t} else {\n\t\t\tvalueToEmit = props.modelValue.concat(option.value);\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = stash.value.concat(option as any);\n\t\t\t}\n\t\t}\n\t\tif (props.resetQueryOnOptionSelected) {\n\t\t\tquery.value = '';\n\t\t}\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\nconst getOptions = async ({ prefill = false }) => {\n\tlet items: any[] = [];\n\tif (Array.isArray(props.items)) {\n\t\titems = props.items;\n\t} else {\n\t\tif (typeof props.items === 'function') {\n\t\t\tloading.value++;\n\t\t\titems = await props.items(query.value, prefill, props.modelValue);\n\t\t\tloading.value--;\n\t\t}\n\t}\n\tinternalItems.value = items as any;\n};\n\n/**\n * Add an option to the manual items and then reset the query\n */\nconst addOption = () => {\n\tconst text = query.value;\n\tconst value = query.value;\n\tconst jsonValue = JSON.stringify(value);\n\tconst option = {\n\t\ttext,\n\t\tvalue,\n\t\tjsonValue,\n\t\tid: 'option_' + jsonValue.replace(/\\W/g, '_'),\n\t\toriginal: value,\n\t\tmanual: true,\n\t\tdisabled: false,\n\t};\n\tmanualItems.value = manualItems.value.concat(option as any);\n\tquery.value = '';\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\tprops.prefill === true ||\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n/**\n * When modelValue changes split behavior for single and multiple selection:\n */\nlet modelValueTimeout: ReturnType<typeof setTimeout>;\nlet hasRunOnce = false;\nwatch(\n\t() => props.modelValue,\n\t(current, previous) => {\n\t\tif (modelValueTimeout) clearTimeout(modelValueTimeout);\n\t\tmodelValueTimeout = setTimeout(\n\t\t\tasync () => {\n\t\t\t\t/**\n\t\t\t\t * For single selection if the value is already in the option (most likely you are using\n\t\t\t\t * static items) just use it.\n\t\t\t\t * If the value is not in the options try searching for it (outside dependencies may fix it).\n\t\t\t\t * If at last the value cannot be found even after searching\n\t\t\t\t * reset value to the default value when coherence is enforced\n\t\t\t\t * or at least do not display the old query\n\t\t\t\t */\n\t\t\t\tif (!props.multiple) {\n\t\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (\n\t\t\t\t\t\t(!found && isNotNil(props.modelValue)) ||\n\t\t\t\t\t\tprevious === undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst currentQuery = query.value;\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\tquery.value = currentQuery;\n\t\t\t\t\t}\n\t\t\t\t\tfound = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (found) {\n\t\t\t\t\t\tquery.value = found.text;\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = [found as any];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (props.enforceCoherence && isNotNil(current)) {\n\t\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * For multiple selection if every value is already in the options (most likely you are using\n\t\t\t\t\t * static items) just use them.\n\t\t\t\t\t * If not all the values are in the current options or is prefilling try searching (outside depencencies may fix the situation).\n\t\t\t\t\t * If the values are still not in the available options and coherence is enforced\n\t\t\t\t\t * discard the ones that are invalid.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t} else {\n\t\t\t\t\tif (!Array.isArray(props.modelValue)) {\n\t\t\t\t\t\tthrow new Error('props.modelValue is not an array.');\n\t\t\t\t\t}\n\t\t\t\t\tlet allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound || previous === undefined) {\n\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\tallFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (allFound) {\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = props.modelValue.map(\n\t\t\t\t\t\t\t\t(value: any) => optionsIndexedByValue.value.get(value)!\n\t\t\t\t\t\t\t) as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coherentStash: Option[] = [];\n\t\t\t\t\t\tconst coherent = current.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\tif (found) coherentStash.push(found);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = coherentStash as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tshouldPrefill ? 0 : props.modelValueDebounceTime\n\t\t);\n\t},\n\t// Prefill when asked or when items are static\n\t{ immediate: shouldPrefill, deep: true }\n);\n\n/**\n * This is triggered to refresh static items whenever the passed array changes.\n * If the parent defines an array in the template this is triggered\n * at every render so we take counter measures\n * Even if the entire array changes all the previously selected values are still in the stash.\n */\nwatch(\n\t() => props.items,\n\tasync (current, previous) => {\n\t\tif (\n\t\t\ttypeof current === 'function' ||\n\t\t\t// Circumvent arrays defined in the template by the parent\n\t\t\tJSON.stringify(current) !== JSON.stringify(previous)\n\t\t) {\n\t\t\tawait getOptions({ prefill: false });\n\t\t\tif (props.multiple) {\n\t\t\t\tconst allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t);\n\n\t\t\t\tif (!allFound) {\n\t\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\t\tconst coherent = props.modelValue.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\tif (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t}\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t}\n\t\t}\n\t}\n);\n\n/**\n * When dependencies change\n * If the input has not been prefilled yet just return\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\nlet depsTimeout: ReturnType<typeof setTimeout>;\nwatch(\n\t() => props.dependencies,\n\t(current, previous) => {\n\t\tif (!shouldPrefill && props.prefill === 'focus' && isFirstFocus) {\n\t\t\treturn;\n\t\t}\n\t\t// Circumvent array defined in the template by the parent\n\t\tif (JSON.stringify(current) === JSON.stringify(previous)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (depsTimeout) clearTimeout(depsTimeout);\n\t\tdepsTimeout = setTimeout(async () => {\n\t\t\tif (JSON.stringify(current) !== JSON.stringify(previous)) {\n\t\t\t\t// Only reset the stash if we are going to enforce coherence\n\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Momentarily reset query\n\t\t\t\tlet currentQuery = query.value;\n\t\t\t\tquery.value = '';\n\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\tquery.value = currentQuery;\n\t\t\t\tif (!props.multiple) {\n\t\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound && props.enforceCoherence) {\n\t\t\t\t\t\tlet coherentStash: Option[] = [];\n\t\t\t\t\t\tconst coherent = props.modelValue.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\tif (found) coherentStash.push(found);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = coherentStash as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, props.depsDebounceTime);\n\t},\n\t{ deep: true }\n);\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thidden.value = true;\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nlet isFirstFocus = true;\nconst onInputFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tactive.value = true;\n\tdocument.addEventListener('click', onClickOutside);\n\tdocument.addEventListener('focusin', onFocusOutside);\n\tif (input.value instanceof HTMLInputElement) input.value.select();\n\tif (props.prefill === 'focus' && isFirstFocus && !shouldPrefill) {\n\t\tawait getOptions({ prefill: true });\n\t\tisFirstFocus = false;\n\t}\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value && optionsContainer.value) {\n\t\t\tif (\n\t\t\t\t!outerContainer.value.contains(event.target) &&\n\t\t\t\t!optionsContainer.value.contains(event.target)\n\t\t\t) {\n\t\t\t\tclose();\n\t\t\t\temit('inactive');\n\t\t\t\tdocument.removeEventListener('focusin', onFocusOutside);\n\t\t\t\tactive.value = false;\n\t\t\t\tif (props.multiple)\n\t\t\t\t\twait(500).then(() => {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On single selection restore the query that might be partially altered by the user.\n * Input can blur either by clicking outside or clicking on an option.\n * We do nothing if the user has selected an option. And we restore the\n * query to its text if the user has moved focus\n */\nconst onInputBlur = async (event: FocusEvent) => {\n\temit('blur', event);\n\tif (!props.multiple) {\n\t\tlet noop = false;\n\t\tconst currentModelValue = props.modelValue;\n\t\tawait Promise.race([\n\t\t\twait(250),\n\t\t\twaitFor(() => {\n\t\t\t\treturn currentModelValue !== props.modelValue;\n\t\t\t}).then(() => {\n\t\t\t\tnoop = true;\n\t\t\t}),\n\t\t]);\n\t\tif (!noop) {\n\t\t\tconst found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\tif (found) {\n\t\t\t\tquery.value = found.text;\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onInputChange = (event: Event) => emit('change', event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n\temit('input', event);\n\tif (query.value === '') {\n\t\tif (!props.multiple) {\n\t\t\temit('update:modelValue', null);\n\t\t}\n\t}\n\tif (typeof props.items === 'function') {\n\t\tsearchByQuery();\n\t}\n};\n\n// This is the vertical index used to highlight options in the container\nconst focusedIndex = ref<number | null>(null);\n/**\n * Normalize the index using the displayed options so we can start over when reaching the end.\n * Please watch out for the side effect it is used to avoid the\n * complexity of using modulo over negative numbers\n */\nconst normalizedFocusedIndex: ComputedRef<number | null> = computed(() => {\n\tif (focusedIndex.value === null || !filteredOptions.value.length) return null;\n\n\tlet start =\n\t\tfocusedIndex.value >= 0\n\t\t\t? focusedIndex.value\n\t\t\t: filteredOptions.value.length - 1;\n\n\tconst min = 0;\n\tconst max = filteredOptions.value.length - 1;\n\tconst normalized = clamp(start % filteredOptions.value.length, min, max);\n\treturn normalized;\n});\n\n// This is the horizontal index used to highlight selected options\nconst selectedOptionsFocusedIndex = ref<number | null>(null);\n\n/**\n * Increment the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnNextOption = () => {\n\tif (focusedIndex.value !== null) focusedIndex.value++;\n\telse {\n\t\tfocusedIndex.value = 0;\n\t}\n\tnextTick().then(() => {\n\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\tconst foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t`#${options.value[normalizedFocusedIndex.value].id}`\n\t\t\t);\n\t\t\tif (foundOption instanceof HTMLElement)\n\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'start',\n\t\t\t\t});\n\t\t}\n\t});\n};\n\n/**\n * Decrement the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnPreviousOption = () => {\n\tif (focusedIndex.value !== null) focusedIndex.value--;\n\telse focusedIndex.value = options.value.length - 1;\n\n\tnextTick().then(() => {\n\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\tconst foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t`#${options.value[normalizedFocusedIndex.value].id}`\n\t\t\t);\n\t\t\tif (foundOption instanceof HTMLElement)\n\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'start',\n\t\t\t\t});\n\t\t}\n\t});\n};\n\n/**\n * This is handled separately from input because it has a lot to do with user\n * interaction and control characters than it has with the query.\n */\nconst onInputKeyDown = async (event: KeyboardEvent) => {\n\tif (props.readonly || props.disabled) {\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\tswitch (event.key) {\n\t\t/**\n\t\t * On arrow prevent the page from scrolling.\n\t\t * Reset horizontal focus\n\t\t * When the panel is open\n\t\t * - Focus on the previous option\n\t\t * When the panel is closed\n\t\t * - focus on the first selected option\n\t\t */\n\t\tcase 'ArrowUp':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tfocusOnPreviousOption();\n\t\t\t\t} else {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * On arrow prevent the page from scrolling.\n\t\t * Reset horizontal focus\n\t\t * When the panel is open\n\t\t * - Focus on the previous option\n\t\t * When the panel is closed\n\t\t * - focus on the first selected option\n\t\t */\n\t\tcase 'ArrowDown':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tfocusOnNextOption();\n\t\t\t\t} else {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving horizontally\n\t\t * Cycle from rightmost, next, or input focus.\n\t\t * If the focus lands on an option align the vertical focus as well\n\t\t */\n\t\tcase 'ArrowLeft':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value =\n\t\t\t\t\t\t\t\tselectedOptions.value.length - 1;\n\t\t\t\t\t\t} else if (selectedOptionsFocusedIndex.value > 0) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value--;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value !== null) {\n\t\t\t\t\t\t\tlet linkedOption =\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value];\n\t\t\t\t\t\t\tlet foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t\t\t\t\t`#${linkedOption.id}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (foundOption) {\n\t\t\t\t\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tfocusedIndex.value =\n\t\t\t\t\t\t\t\t\toptionsIndexedById.value[\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value].id\n\t\t\t\t\t\t\t\t\t].index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving horizontally\n\t\t * Cycle from leftmost, next, or input focus.\n\t\t * If the focus lands on an option align the vertical focus as well\n\t\t */\n\t\tcase 'ArrowRight':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = 0;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value <\n\t\t\t\t\t\t\tselectedOptions.value.length - 1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value !== null) {\n\t\t\t\t\t\t\tlet linkedOption =\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value];\n\t\t\t\t\t\t\tlet foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t\t\t\t\t`#${linkedOption.id}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (foundOption) {\n\t\t\t\t\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tfocusedIndex.value =\n\t\t\t\t\t\t\t\t\toptionsIndexedById.value[\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value].id\n\t\t\t\t\t\t\t\t\t].index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * If the panel is closed focus on the first selected option.\n\t\t * If the panel was already open select/deselect the currently focused option\n\t\t * and close the panel of single selection is enabled\n\t\t */\n\t\tcase 'Enter':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!shown.value) {\n\t\t\t\t\tif (filteredOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t} else {\n\t\t\t\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\t\t\t\tif (filteredOptions.value[normalizedFocusedIndex.value].disabled)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tif (!props.multiple) {\n\t\t\t\t\t\t\tawait close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonOptionSelected(\n\t\t\t\t\t\t\tfilteredOptions.value[normalizedFocusedIndex.value]\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (props.addOptions) {\n\t\t\t\t\t\t\tif (props.itemText || props.itemValue) {\n\t\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t\t`Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taddOption();\n\t\t\t\t\t\t\tconst added = last(manualItems.value);\n\t\t\t\t\t\t\tonOptionSelected(optionsIndexedById.value[added.id]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving away from the component reset focus both vertically and horizontally\n\t\t */\n\t\tcase 'Tab':\n\t\tcase 'Escape':\n\t\t\t{\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tawait close();\n\t\t\t\t}\n\t\t\t\temit('inactive');\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t}\n\t\t\tbreak;\n\t\t// Prevent shift from opening the panel\n\t\tcase 'Shift':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * Delete behavior is different when query is empty\n\t\t * If query is empty\n\t\t * If no chip is selected - select rightmost chip\n\t\t * If a chip is selected - deselect that option\n\t\t * If any option remains move focus to that or reset\n\t\t */\n\t\tcase 'Backspace':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value =\n\t\t\t\t\t\t\t\tselectedOptions.value.length - 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonOptionSelected(\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = Math.max(\n\t\t\t\t\t\t\t\t\tMath.min(\n\t\t\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value,\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value.length - 2\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait open();\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * Open the panel on writing and reset horizontal focus\n\t\t */\n\t\tdefault:\n\t\t\t{\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t\tawait open();\n\t\t\t}\n\t\t\tbreak;\n\t}\n};\n\n/**\n * Triggered on input when items is a function.\n */\n\nlet timeout: ReturnType<typeof setTimeout>;\nconst searchByQuery = () => {\n\tif (timeout) clearTimeout(timeout);\n\ttimeout = setTimeout(async () => {\n\t\ttry {\n\t\t\tawait getOptions({ prefill: false });\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}, props.queryDebounceTime);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tif (input.value instanceof HTMLElement) {\n\t\tinput.value.focus();\n\t}\n\topen();\n};\n\n/**\n * When an option is clicked wait for it to bubble to the option container to avoid slot event problems.\n * Select / deselect the option and then move focus to the input.\n * If it is single selection mode close the panel\n */\nconst onOptionClicked = (event: Event) => {\n\tif (event.currentTarget instanceof HTMLElement) {\n\t\tif (event.currentTarget.classList.contains('bb-base-select-option')) {\n\t\t\tconst option = optionsIndexedById.value[event.currentTarget.id];\n\t\t\tif (option.disabled) return;\n\t\t\tonOptionSelected(option);\n\t\t\tif (input.value instanceof HTMLInputElement) {\n\t\t\t\tinput.value.focus();\n\t\t\t}\n\t\t\tif (!props.multiple) close();\n\t\t}\n\t}\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value) {\n\t\t\tif (!outerContainer.value.contains(event.target)) {\n\t\t\t\tclose();\n\t\t\t\temit('inactive');\n\t\t\t\tdocument.removeEventListener('click', onClickOutside);\n\t\t\t\tactive.value = false;\n\t\t\t\tif (props.multiple)\n\t\t\t\t\twait(500).then(() => {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSelect';\n</style>\n"],"names":["props","__props","emit","__emit","outerContainer","ref","innerContainer","optionsContainer","floatingStyles","useFloating","autoUpdate","flip","offset","shift","optionsContainerStyles","computed","base","input","query","computedPlaceholder","selectedOptions","loading","internalItems","stash","manualItems","getItemText","useItemText","getItemValue","useItemValue","internalOptions","item","_","text","value","jsonValue","options","fromOptions","acc","curr","withManual","withStash","option","index","isNotNil","modelValueIndexed","filteredOptions","matchedAnything","keys","propName","optionsIndexedById","optionsIndexedByValue","indexed","key","_a","pairs","deepEqual","map","linkedOption","onOptionSelected","valueToEmit","focusedIndex","current","stashed","getOptions","prefill","items","addOption","shouldPrefill","modelValueTimeout","watch","previous","allFound","coherentStash","coherent","found","currentQuery","depsTimeout","isFirstFocus","shown","hidden","open","close","active","onInputFocus","event","onClickOutside","onFocusOutside","wait","onInputBlur","noop","currentModelValue","waitFor","onInputChange","onInputInput","searchByQuery","normalizedFocusedIndex","start","min","max","clamp","selectedOptionsFocusedIndex","focusOnNextOption","nextTick","foundOption","focusOnPreviousOption","onInputKeyDown","head","_b","added","last","timeout","error","onOuterContainerClick","onOptionClicked","makeInputValue","when","hiddenInputs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgcA,UAAMA,IAAQC,IAcRC,IAAOC;AAIb,QAAIH,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC9C,YAAA,IAAI,MAAM,2DAA2D;AAGtE,UAAAI,IAAiBC,EAAwB,IAAI,GAC7CC,IAAiBD,EAAwB,IAAI,GAC7CE,IAAmBF,EAAwB,IAAI,GAE/C,EAAE,gBAAAG,GAAmB,IAAAC,GAAYH,GAAgBC,GAAkB;AAAA,MACxE,WAAW;AAAA,MACX,sBAAsBG;AAAA,MACtB,YAAY,CAACC,GAAA,GAAQC,GAAO,GAAGC,IAAO;AAAA,IAAA,CACtC,GAEKC,KAAyBC,EAAS,MAAM;AAC7C,YAAMC,IAA4B;AAAA,QACjC,GAAGR,GAAe;AAAA,QAClB,oBAAoB,GAAGR,EAAM,kBAAkB;AAAA,MAAA;AAE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"index31.js","sources":["../src/components/BaseSelect/BaseSelect.vue"],"sourcesContent":["<template>\n\t<div\n\t\tref=\"outerContainer\"\n\t\t:class=\"{\n\t\t\t'bb-base-select': true,\n\t\t\t'bb-base-select--active': active,\n\t\t\t'bb-base-select--loading': loading,\n\t\t\t'bb-base-select--disabled': disabled,\n\t\t\t'bb-base-select--errors': hasErrors,\n\t\t\t'bb-base-select--readonly': readonly,\n\t\t}\"\n\t\t@click=\"onOuterContainerClick\"\n\t>\n\t\t<slot name=\"prepend-outer\"></slot>\n\t\t<span ref=\"innerContainer\" class=\"bb-base-select__inner-container\">\n\t\t\t<slot name=\"prepend\"></slot>\n\t\t\t<span class=\"bb-base-select__input-container\">\n\t\t\t\t<template v-if=\"multiple\">\n\t\t\t\t\t<template v-if=\"comma\">\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\tv-for=\"(option, index) in selectedOptions\"\n\t\t\t\t\t\t\t:key=\"option.id\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-base-select__selected': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--comma': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--focused':\n\t\t\t\t\t\t\t\t\tindex === selectedOptionsFocusedIndex,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t>{{ option.text\n\t\t\t\t\t\t\t}}{{ index < selectedOptions.length - 1 ? ',' : '' }}</span\n\t\t\t\t\t\t>\n\t\t\t\t\t</template>\n\t\t\t\t\t<template v-else>\n\t\t\t\t\t\t<BbChip\n\t\t\t\t\t\t\tv-for=\"(option, index) in selectedOptions\"\n\t\t\t\t\t\t\t:key=\"option.id\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-base-select__selected': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--chip': true,\n\t\t\t\t\t\t\t\t'bb-base-select__selected--focused':\n\t\t\t\t\t\t\t\t\tindex === selectedOptionsFocusedIndex,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t:clearable=\"true\"\n\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t@click:clear.stop=\"onOptionSelected(option)\"\n\t\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t\t\t:index=\"option.index\"\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\t:loading=\"!!loading\"\n\t\t\t\t\t\t\t\t:manual=\"option.manual\"\n\t\t\t\t\t\t\t\tname=\"chip\"\n\t\t\t\t\t\t\t\t:selected=\"option.selected\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\t\t\t>{{ option.text }}</slot\n\t\t\t\t\t\t\t></BbChip\n\t\t\t\t\t\t>\n\t\t\t\t\t</template>\n\t\t\t\t</template>\n\t\t\t\t<input\n\t\t\t\t\t:id=\"id\"\n\t\t\t\t\tref=\"input\"\n\t\t\t\t\tv-model=\"query\"\n\t\t\t\t\t:autocomplete=\"autocomplete\"\n\t\t\t\t\t:autofocus=\"autofocus\"\n\t\t\t\t\t:class=\"'bb-base-select__text-input'\"\n\t\t\t\t\t:disabled=\"disabled\"\n\t\t\t\t\t:placeholder=\"computedPlaceholder\"\n\t\t\t\t\trole=\"combobox\"\n\t\t\t\t\t:aria-controls=\"`${id}_listbox`\"\n\t\t\t\t\t:aria-autocomplete=\"'list'\"\n\t\t\t\t\t:readonly=\"readonly || !allowWriting\"\n\t\t\t\t\t:type=\"'text'\"\n\t\t\t\t\t@blur.stop=\"onInputBlur\"\n\t\t\t\t\t@change.stop=\"onInputChange\"\n\t\t\t\t\t@focus.stop=\"onInputFocus\"\n\t\t\t\t\t@input.stop=\"onInputInput\"\n\t\t\t\t\t@keydown.stop=\"onInputKeyDown\"\n\t\t\t\t/>\n\t\t\t</span>\n\t\t\t<span class=\"bb-base-select__chevron\">\n\t\t\t\t<slot :loading=\"!!loading\" name=\"chevron\" :shown=\"shown\">\n\t\t\t\t\t<svg\n\t\t\t\t\t\tfill=\"none\"\n\t\t\t\t\t\tviewBox=\"0 0 16 8\"\n\t\t\t\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<path\n\t\t\t\t\t\t\tclip-rule=\"evenodd\"\n\t\t\t\t\t\t\td=\"M0.851779 0.225802C0.90403 0.173418 0.966103 0.131858 1.03444 0.1035C1.10278 0.0751431 1.17604 0.0605469 1.25003 0.0605469C1.32402 0.0605469 1.39728 0.0751431 1.46562 0.1035C1.53396 0.131858 1.59603 0.173418 1.64828 0.225802L8.00003 6.57868L14.3518 0.225802C14.4041 0.173503 14.4662 0.132017 14.5345 0.103713C14.6028 0.0754093 14.6761 0.0608414 14.75 0.0608414C14.824 0.0608414 14.8972 0.0754093 14.9656 0.103713C15.0339 0.132017 15.096 0.173503 15.1483 0.225802C15.2006 0.278101 15.2421 0.340189 15.2704 0.408521C15.2987 0.476852 15.3132 0.55009 15.3132 0.624052C15.3132 0.698014 15.2987 0.771252 15.2704 0.839584C15.2421 0.907916 15.2006 0.970003 15.1483 1.0223L8.39828 7.7723C8.34603 7.82469 8.28395 7.86625 8.21562 7.8946C8.14728 7.92296 8.07402 7.93756 8.00003 7.93756C7.92604 7.93756 7.85278 7.92296 7.78444 7.8946C7.7161 7.86625 7.65403 7.82469 7.60178 7.7723L0.851779 1.0223C0.799395 0.970051 0.757835 0.907978 0.729477 0.83964C0.70112 0.771302 0.686523 0.69804 0.686523 0.624052C0.686523 0.550064 0.70112 0.476803 0.729477 0.408464C0.757835 0.340126 0.799395 0.278053 0.851779 0.225802Z\"\n\t\t\t\t\t\t\tfill=\"currentColor\"\n\t\t\t\t\t\t\tfill-rule=\"evenodd\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</svg>\n\t\t\t\t</slot>\n\t\t\t</span>\n\t\t\t<slot v-if=\"!loading\" name=\"append\"></slot>\n\t\t\t<span\n\t\t\t\tv-else\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-select__spinner': true,\n\t\t\t\t\t'bb-base-select__spinner--loading': loading,\n\t\t\t\t}\"\n\t\t\t\t><slot :loading=\"!!loading\" :name=\"'spinner'\"\n\t\t\t\t\t><BbSpinner :size=\"'sm'\" /></slot\n\t\t\t></span>\n\t\t</span>\n\t\t<slot name=\"append-outer\"></slot>\n\t\t<input v-for=\"input in hiddenInputs\" :key=\"input.value\" v-bind=\"input\" />\n\n\t\t<teleport to=\"body\">\n\t\t\t<span\n\t\t\t\tref=\"optionsContainer\"\n\t\t\t\t:class=\"{\n\t\t\t\t\t'bb-base-select__options-container': true,\n\t\t\t\t\t'bb-base-select__options-container--shown': shown,\n\t\t\t\t\t'bb-base-select__options-container--hidden': hidden,\n\t\t\t\t}\"\n\t\t\t\t:id=\"`${id}_listbox`\"\n\t\t\t\t:role=\"'listbox'\"\n\t\t\t\t:tabindex=\"-1\"\n\t\t\t\t:style=\"optionsContainerStyles\"\n\t\t\t>\n\t\t\t\t<BbCollapsible\n\t\t\t\t\t:modelValue=\"shown\"\n\t\t\t\t\t:transition-duration=\"transitionDuration\"\n\t\t\t\t>\n\t\t\t\t\t<slot name=\"options:prepend\"></slot>\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-if=\"!filteredOptions.length && loading\"\n\t\t\t\t\t\tclass=\"bb-base-select__loading-container\"\n\t\t\t\t\t\t><slot :name=\"'loading'\" :query=\"query\">{{\n\t\t\t\t\t\t\tloadingText\n\t\t\t\t\t\t}}</slot></span\n\t\t\t\t\t>\n\t\t\t\t\t<span\n\t\t\t\t\t\tv-else-if=\"!filteredOptions.length\"\n\t\t\t\t\t\tclass=\"bb-base-select__no-data-container\"\n\t\t\t\t\t\t><slot :name=\"'no-data'\" :query=\"query\">{{\n\t\t\t\t\t\t\tnoDataText\n\t\t\t\t\t\t}}</slot></span\n\t\t\t\t\t>\n\t\t\t\t\t<template v-for=\"(option, index) in filteredOptions\" :key=\"option.id\">\n\t\t\t\t\t\t<slot :item=\"option.original\" name=\"option:prepend\"></slot>\n\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t:id=\"option.id\"\n\t\t\t\t\t\t\t:aria-selected=\"option.selected\"\n\t\t\t\t\t\t\t:class=\"{\n\t\t\t\t\t\t\t\t'bb-base-select-option': true,\n\t\t\t\t\t\t\t\t'bb-base-select-option--selected': option.selected,\n\t\t\t\t\t\t\t\t'bb-base-select-option--focused':\n\t\t\t\t\t\t\t\t\tnormalizedFocusedIndex === index,\n\t\t\t\t\t\t\t\t'bb-base-select-option--disabled': option.disabled,\n\t\t\t\t\t\t\t}\"\n\t\t\t\t\t\t\t:role=\"'option'\"\n\t\t\t\t\t\t\t@click.stop=\"onOptionClicked\"\n\t\t\t\t\t\t\t><slot\n\t\t\t\t\t\t\t\t:disabled=\"option.disabled\"\n\t\t\t\t\t\t\t\t:focused=\"normalizedFocusedIndex === index\"\n\t\t\t\t\t\t\t\t:has-errors=\"hasErrors\"\n\t\t\t\t\t\t\t\t:index=\"option.index\"\n\t\t\t\t\t\t\t\t:item=\"option.original\"\n\t\t\t\t\t\t\t\t:loading=\"!!loading\"\n\t\t\t\t\t\t\t\t:manual=\"option.manual\"\n\t\t\t\t\t\t\t\tname=\"option\"\n\t\t\t\t\t\t\t\t:selected=\"option.selected\"\n\t\t\t\t\t\t\t\t:text=\"option.text\"\n\t\t\t\t\t\t\t\t:value=\"option.value\"\n\t\t\t\t\t\t\t\t><span class=\"bb-base-select-option__content\"\n\t\t\t\t\t\t\t\t\t><span class=\"bb-base-select-option__text\">{{\n\t\t\t\t\t\t\t\t\t\toption.text\n\t\t\t\t\t\t\t\t\t}}</span></span\n\t\t\t\t\t\t\t\t></slot\n\t\t\t\t\t\t\t></span\n\t\t\t\t\t\t>\n\t\t\t\t\t\t<slot :item=\"option.original\" name=\"option:append\"></slot>\n\t\t\t\t\t</template>\n\t\t\t\t\t<slot name=\"options:append\"></slot>\n\t\t\t\t</BbCollapsible>\n\t\t\t</span>\n\t\t</teleport>\n\t</div>\n</template>\n\n<script setup lang=\"ts\">\nimport BbChip from '../BbChip/BbChip.vue';\nimport BbSpinner from '../BbSpinner/BbSpinner.vue';\nimport { computed, nextTick, ref, watch } from 'vue';\nimport { useFloating, autoUpdate, flip, shift, offset } from '@floating-ui/vue';\nimport { clamp } from '@/utilities/functions/clamp';\nimport { deepEqual } from 'fast-equals';\nimport { head } from '@/utilities/functions/head';\nimport { isNotNil } from '@/utilities/functions/isNotNil';\nimport { last } from '@/utilities/functions/last';\nimport { useItemText } from '@/composables/useItemText';\nimport { useItemValue } from '@/composables/useItemValue';\nimport { wait } from '@/utilities/functions/wait';\nimport { waitFor } from '@/utilities/functions/waitFor';\nimport { when } from '@/utilities/functions/when';\nimport BbCollapsible from '../BbCollapsible/BbCollapsible.vue';\nimport type { ComputedRef, HTMLAttributes, InputHTMLAttributes } from 'vue';\n\nexport type BaseSelectProps = {\n\t/**\n\t * Allows typing into the input.\n\t */\n\tallowWriting?: boolean;\n\n\t/**\n\t * Guides to the browser as to the type of information expected in the field.\n\t */\n\tautocomplete?: InputHTMLAttributes['autocomplete'];\n\n\t/**\n\t * Sets autofocus on page load.\n\t */\n\tautofocus?: InputHTMLAttributes['autofocus'];\n\t/**\n\t * Logs messages for debugging purposes.\n\t */\n\tdebug?: boolean;\n\n\t/**\n\t * Defines an array of dependencies that will trigger actions in the component upon change.\n\t */\n\tdependencies?: any[];\n\n\t/**\n\t * Timeout used to debounce response to changes to dependencies.\n\t */\n\tdepsDebounceTime?: number;\n\n\t/**\n\t * Disables the component\n\t */\n\tdisabled?: boolean;\n\n\t/**\n\t * If coherence is enforce the input cannot have a modelValue the is incoherent with its current items.\n\t *\n\t * e.g. You cannot set v-model to a user that is not present in the items passed.\n\t *\n\t * modelValue will be reset upon incoherence.\n\t */\n\tenforceCoherence?: boolean;\n\n\t/**\n\t * Define if the component should be in an error state.\n\t * It usually attaches a CSS class for styling purposes.\n\t */\n\thasErrors?: boolean;\n\n\t/**\n\t * The identifier of the component.\n\t */\n\tid: HTMLAttributes['id'];\n\n\t/**\n\t * String displayed while items are being loaded.\n\t */\n\tloadingText?: string;\n\n\t/**\n\t * Defines the strategy used to understand whether an option has been selected.\n\t * `string` is 40% faster but relies on property order.\n\t * `equality` is more reliable but is slower.\n\t */\n\tmatchStrategy?: 'string' | 'equality';\n\n\t/**\n\t * Timeout used to debounce response to changes to modelValue.\n\t */\n\tmodelValueDebounceTime?: number;\n\n\t/**\n\t * Allows the selection of multiple items.\n\t */\n\tmultiple?: boolean;\n\n\t/**\n\t * Defines the name of the input.\n\t */\n\tname?: InputHTMLAttributes['name'];\n\n\t/**\n\t * String displayed when there are no items to display.\n\t */\n\tnoDataText?: string;\n\n\t/**\n\t * String displayed when there's no data.\n\t */\n\tplaceholder?: InputHTMLAttributes['placeholder'];\n\n\t/**\n\t * Sets the input in a readonly state.\n\t */\n\treadonly?: InputHTMLAttributes['readonly'];\n\n\t/**\n\t * How long the transition has to last in milliseconds\n\t */\n\ttransitionDuration?: number;\n\t/**\n\t * Used to retrieve items can be an array or a function.\n\t */\n\titems:\n\t\t| any[]\n\t\t| ((query: string, prefill: boolean, modelValue: any) => Promise<any[]>)\n\t\t| ((query: string, prefill: boolean, modelValue: any) => any[]);\n\n\t/**\n\t * Defines a path that returns a property of the object to use as text or a function that returns a string\n\t */\n\titemText?: string | ((item: any) => string) | undefined;\n\n\t/**\n\t * Defines a path that returns a property of the object to use as value or a function that returns any value\n\t */\n\titemValue?: string | ((item: any) => string) | undefined;\n\t/**\n\t * Used by v-model. Can be any serializable type.\n\t */\n\tmodelValue: any;\n\n\t/**\n\t * Allows the user to add options to the list by\n\t * inserting text in the input and pressing ENTER.\n\t * The value and text of the option generated is a\n\t * string equal to what has been inserted.\n\t */\n\taddOptions?: boolean;\n\t/**\n\t * Sets the display model for selected values to a list\n\t * of comma separated string. In this mode the user\n\t * cannot deselect an option by pressing the close button.\n\t */\n\tcomma?: boolean;\n\t/**\n\t * Defines how the filtering should work.\n\t * In any case options are always filtered by the text displayed but\n\t * they can also take into account other properties of the\n\t * passed elements when this property is a string or an array of string.\n\t * E.g. items could be a list of users and you can filter users by email or phone by passing `['email', 'phone']`\n\t * You can also pass false to not filter anything or a function for more granular control.\n\t *\n\t */\n\tfilterBy?:\n\t\t| string\n\t\t| string[]\n\t\t| false\n\t\t| ((value: any, item: any) => boolean)\n\t\t| null;\n\t/**\n\t * Defines the prefill strategy for the input. By default the input will prefill\n\t * on focus. It can also always prefill with `true` and only prefill on search with `false`.\n\t */\n\tprefill?: boolean | 'focus';\n\t/**\n\t * Time to wait when the users stops writing in the input before querying data.\n\t * Especially useful when searching live data on big datasets.\n\t */\n\tqueryDebounceTime?: number;\n\t/**\n\t * If `true` when in multiple selection, reset the query immediately\n\t * upon selecting an option. By default the query is\n\t * not reset until focus is lost so the user can search\n\t * for \"Cath\" and select \"Cathy\" and then write more to\n\t * search for \"Catherine\"\n\t */\n\tresetQueryOnOptionSelected?: boolean;\n\t/**\n\t * Adds a stash to accumulate selected values. Especially\n\t * useful when searching in a big database of items.\n\t * E.g. if you search for \"John\" and then search for \"Richard\"\n\t * you either always return the previous items or you stash them passing `true` to this option.\n\t */\n\tstash?: boolean;\n\t/**\n\t * Pass `true` if the dropdown is not updating following movement in the UI, like in modals. Very expensive so use with care.\n\t */\n\tupdateOnAnimationFrame?: boolean;\n};\nexport type BaseSelectEvents = {\n\t(e: 'blur', event: FocusEvent): void;\n\t(e: 'change', event: Event): void;\n\t(e: 'click', event: MouseEvent): void;\n\t(e: 'focus', event: FocusEvent): void;\n\t(e: 'inactive'): void;\n\t(e: 'input', event: Event): void;\n\t(e: 'update:modelValue', value: any): void;\n};\n\nexport type BaseSelectSlots = {\n\t'prepend-outer'?: (props: object) => any;\n\tprepend?: (props: object) => any;\n\t'options:prepend'?: (props: object) => any;\n\tloading?: (props: { query: string }) => any;\n\t'no-data'?: (props: { query: string }) => any;\n\t'option:prepend'?: (props: { item: any }) => any;\n\tchip?: (props: {\n\t\tdisabled: boolean;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\toption?: (props: {\n\t\tdisabled: boolean;\n\t\tfocused: boolean;\n\t\thasErrors?: boolean;\n\t\tindex: number;\n\t\titem: any;\n\t\tloading: boolean;\n\t\tmanual: boolean;\n\t\tselected: boolean;\n\t\ttext: string;\n\t\tvalue: any;\n\t}) => any;\n\t'option:append'?: (props: { item: any }) => any;\n\t'options:append'?: (props: object) => any;\n\tchevron?: (props: { loading: boolean; shown: boolean }) => any;\n\tappend?: (props: object) => any;\n\tspinner?: (props: { loading: boolean }) => any;\n\t'append-outer'?: (props: object) => any;\n};\n\nexport type BaseOption = {\n\tid: string;\n\tjsonValue: string;\n\tmanual: boolean;\n\toriginal: any;\n\ttext: string;\n\tvalue: any;\n\tdisabled: boolean;\n};\n\nexport type Option = BaseOption & {\n\tindex: number;\n\tselected: boolean;\n};\n\nconst props = withDefaults(defineProps<BaseSelectProps>(), {\n\tallowWriting: true,\n\tdepsDebounceTime: 0,\n\tfilterBy: () => [],\n\tloadingText: 'Caricamento...',\n\tmatchStrategy: 'string',\n\tmodelValueDebounceTime: 0,\n\tnoDataText: 'Nessun elemento da visualizzare',\n\tprefill: 'focus',\n\tqueryDebounceTime: 500,\n\ttransitionDuration: 200,\n\tupdateOnAnimationFrame: false,\n});\n\nconst emit = defineEmits<BaseSelectEvents>();\n\ndefineSlots<BaseSelectSlots>();\n\nif (props.multiple && !Array.isArray(props.modelValue)) {\n\tthrow new Error('Multiple is set to \"true\" but modelValue is not an array.');\n}\n\nconst outerContainer = ref<HTMLElement | null>(null);\nconst innerContainer = ref<HTMLElement | null>(null);\nconst optionsContainer = ref<HTMLElement | null>(null);\n\nconst { floatingStyles } = useFloating(innerContainer, optionsContainer, {\n\tplacement: 'bottom',\n\twhileElementsMounted: autoUpdate,\n\tmiddleware: [flip(), offset(5), shift()],\n});\n\nconst optionsContainerStyles = computed(() => {\n\tconst base: Record<string, any> = {\n\t\t...floatingStyles.value,\n\t\ttransitionDuration: `${props.transitionDuration}ms`,\n\t};\n\tif (innerContainer.value) {\n\t\tbase.width = `${innerContainer.value.clientWidth}px`;\n\t}\n\n\treturn base;\n});\n\nconst input = ref<HTMLElement | null>(null);\nconst query = ref<string>('');\nconst computedPlaceholder = computed(() => {\n\tif (selectedOptions.value.length) return '';\n\telse return props.placeholder;\n});\n/**\n * Use a number accumulator because if the fn takes 5 seconds\n * and after 2 seconds another search is run\n * When the first returns the second is still out for 2 seconds\n * and we want to track them both.\n * Debounce will not be enough.\n */\nconst loading = ref(0);\n\nconst internalItems = ref<any[]>([]);\nconst stash = ref<BaseOption[]>([]);\nconst manualItems = ref<BaseOption[]>([]);\nconst { getItemText } = useItemText();\nconst { getItemValue } = useItemValue();\n\nconst internalOptions = computed<BaseOption[]>(() => {\n\treturn internalItems.value.map((item: any, _) => {\n\t\tconst text = getItemText(item, props.itemText as any);\n\t\tconst value = getItemValue(item, props.itemValue);\n\n\t\t// Undefined is not JSONable\n\t\tif (value === undefined)\n\t\t\tthrow new Error(\n\t\t\t\t'The result of extracting \"value\" from option was undefined. Affected item is ' +\n\t\t\t\t\tJSON.stringify(item) +\n\t\t\t\t\t' please check itemValue property is correct.'\n\t\t\t);\n\n\t\tconst jsonValue = JSON.stringify(value);\n\t\treturn {\n\t\t\tdisabled: !!item.disabled,\n\t\t\tid: 'option_' + jsonValue.replace(/\\W/g, '_'),\n\t\t\tjsonValue,\n\t\t\tmanual: false,\n\t\t\toriginal: item,\n\t\t\ttext,\n\t\t\tvalue,\n\t\t};\n\t});\n});\n\nconst options = computed<Option[]>(() => {\n\tlet fromOptions = internalOptions.value.reduce(\n\t\t(acc: { [key: string]: BaseOption }, curr: BaseOption) => {\n\t\t\tacc[curr.id] = curr;\n\t\t\treturn acc;\n\t\t},\n\t\t{}\n\t);\n\tconst withManual: { [key: string]: BaseOption } = manualItems.value.reduce(\n\t\t(acc, curr) => {\n\t\t\tif (!acc[curr.id]) acc[curr.id] = curr as any;\n\t\t\treturn acc;\n\t\t},\n\t\tfromOptions\n\t);\n\tconst withStash: { [key: string]: BaseOption } = stash.value.reduce(\n\t\t(acc, curr) => {\n\t\t\tif (!acc[curr.id]) acc[curr.id] = curr as any;\n\t\t\treturn acc;\n\t\t},\n\t\twithManual\n\t);\n\treturn Object.values(withStash).map<Option>((option: BaseOption, index) => {\n\t\treturn {\n\t\t\t...option,\n\t\t\tselected: isNotNil(modelValueIndexed.value.get(option.value)),\n\t\t\tindex,\n\t\t};\n\t});\n});\n\n/**\n * Filter options to be displayed based on the current query.\n * If no query is used or when query is set from the inside (after a selection) display all possible options\n */\nconst filteredOptions = computed<Option[]>(() => {\n\tlet base = [];\n\t/** Only filter when a value is being searched not when the query is fully set on a selected option text */\n\tif (\n\t\tquery.value &&\n\t\t!selectedOptions.value.some((option: Option) => option.text === query.value)\n\t) {\n\t\tbase = options.value.filter((item: Option) => {\n\t\t\tlet matchedAnything = false;\n\t\t\tif (!props.filterBy) return true;\n\t\t\telse if (typeof props.filterBy === 'function')\n\t\t\t\tmatchedAnything = props.filterBy(item.value, item.original);\n\t\t\telse if (props.filterBy.length) {\n\t\t\t\tconst keys = ([] as string[]).concat(props.filterBy);\n\t\t\t\tfor (let index = 0; index < keys.length; index++) {\n\t\t\t\t\tconst propName = keys[index];\n\t\t\t\t\tmatchedAnything =\n\t\t\t\t\t\tmatchedAnything ||\n\t\t\t\t\t\t((item.original as any)[propName] &&\n\t\t\t\t\t\t\t(item.original as any)[propName]\n\t\t\t\t\t\t\t\t.toLowerCase()\n\t\t\t\t\t\t\t\t.includes(query.value.toLowerCase()));\n\t\t\t\t}\n\t\t\t}\n\t\t\treturn (\n\t\t\t\tmatchedAnything ||\n\t\t\t\titem.text.toLowerCase().includes(query.value.toLowerCase())\n\t\t\t);\n\t\t});\n\t\t/** Otherwise defaul;t to the whole set of options */\n\t} else base = options.value;\n\n\t/** This is done here so that only visible options are highlighted */\n\treturn base;\n});\n\n/**\n * Indexes options by id for retrieval\n */\n\nconst optionsIndexedById = computed<{\n\t[key: string]: Option;\n}>(() =>\n\toptions.value.reduce(\n\t\t(acc, curr) => ({\n\t\t\t...acc,\n\t\t\t[curr.id]: curr,\n\t\t}),\n\t\t{}\n\t)\n);\n\n/**\n * Indexes options by their value\n * (using JSON to circumvent identical objects not being equal in JS)\n */\nconst optionsIndexedByValue = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet indexed = options.value.reduce(\n\t\t\t(acc: { [key: string]: Option }, curr: Option) => {\n\t\t\t\tacc[curr.jsonValue] = curr;\n\t\t\t\treturn acc;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn indexed[JSON.stringify(key)];\n\t\t\t},\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tlet indexed: [any, Option][] = options.value.map((option) => [\n\t\t\toption.value,\n\t\t\toption,\n\t\t]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn indexed.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * Indexes modelValue to a map so when can easily know which values are selected\n * (using JSON to circumvent identical object not being equal in JS)\n */\nconst modelValueIndexed = computed(() => {\n\tif (props.matchStrategy === 'string') {\n\t\tlet map: { [key: string]: number } = {};\n\t\t[].concat(props.modelValue).forEach((value: any, index: number) => {\n\t\t\tmap[JSON.stringify(value)] = index;\n\t\t});\n\t\treturn {\n\t\t\tget: (value: any) => map[JSON.stringify(value)],\n\t\t};\n\t} else if (props.matchStrategy === 'equality') {\n\t\tconst map = []\n\t\t\t.concat(props.modelValue)\n\t\t\t.filter(isNotNil)\n\t\t\t.map((value, index) => [value, index]);\n\n\t\treturn {\n\t\t\tget: (key: any) => {\n\t\t\t\treturn map.find((pairs) => deepEqual(pairs[0], key))?.[1];\n\t\t\t},\n\t\t};\n\t} else {\n\t\tthrow new Error('No match strategy has been defined');\n\t}\n});\n\n/**\n * For every item in modelValue find the linked option if it exists.\n * This is used to display chips.\n */\nconst selectedOptions = computed(() => {\n\treturn [].concat(props.modelValue).reduce((acc: Option[], curr: any) => {\n\t\tconst linkedOption = optionsIndexedByValue.value.get(curr);\n\t\tif (linkedOption) acc.push(linkedOption);\n\t\treturn acc;\n\t}, []);\n});\n\n/**\n * When selecting an option split behavior based on single or multiple selection\n */\nconst onOptionSelected = (option: Option) => {\n\tlet valueToEmit;\n\tfocusedIndex.value = option.index;\n\t/**\n\t * For single selection:\n\t * If the option was already selected - restore the value to default, clean the stash, manual items, and query.\n\t * If the option was not selected - use its value, save the option in the stash and display it's text as query\n\t * The stash is used to remove the complexity of stashing items when searching for identifying information,\n\t * like searching an address would not return the option that was used to selected a previous address in another country.\n\t * Or when searching users by username would not return the previous ones.\n\t * We save it so the user hasn't to.\n\t */\n\tif (!props.multiple) {\n\t\tif (option.selected) {\n\t\t\tif (option.manual) {\n\t\t\t\tmanualItems.value = manualItems.value.filter(\n\t\t\t\t\t(current: any) => current.id !== option.id\n\t\t\t\t);\n\t\t\t}\n\t\t\tvalueToEmit = null;\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = [];\n\t\t\t}\n\t\t\tquery.value = '';\n\t\t} else {\n\t\t\tvalueToEmit = option.value;\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = [option as any];\n\t\t\t}\n\t\t\tquery.value = option.text;\n\t\t}\n\t\t/**\n\t\t * For multiple selection\n\t\t * If the option was selected remove it from modelValue, if it is a mnaual iutem also remove it from there.\n\t\t * In the stash we can search for the id of the option.\n\t\t * If the option was not selected we can just add it to modelValue and the stash.\n\t\t */\n\t} else {\n\t\tif (option.selected) {\n\t\t\tif (option.manual) {\n\t\t\t\tmanualItems.value = manualItems.value.filter(\n\t\t\t\t\t(current: any) => current.id !== option.id\n\t\t\t\t);\n\t\t\t}\n\t\t\tvalueToEmit = props.modelValue.filter(\n\t\t\t\t(value: any) => JSON.stringify(value) !== option.jsonValue\n\t\t\t);\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = stash.value.filter((stashed) => stashed.id !== option.id);\n\t\t\t}\n\t\t} else {\n\t\t\tvalueToEmit = props.modelValue.concat(option.value);\n\t\t\tif (props.stash) {\n\t\t\t\tstash.value = stash.value.concat(option as any);\n\t\t\t}\n\t\t}\n\t\tif (props.resetQueryOnOptionSelected) {\n\t\t\tquery.value = '';\n\t\t}\n\t}\n\temit('update:modelValue', valueToEmit);\n};\n\nconst getOptions = async ({ prefill = false }) => {\n\tlet items: any[] = [];\n\tif (Array.isArray(props.items)) {\n\t\titems = props.items;\n\t} else {\n\t\tif (typeof props.items === 'function') {\n\t\t\tloading.value++;\n\t\t\titems = await props.items(query.value, prefill, props.modelValue);\n\t\t\tloading.value--;\n\t\t}\n\t}\n\tinternalItems.value = items as any;\n};\n\n/**\n * Add an option to the manual items and then reset the query\n */\nconst addOption = () => {\n\tconst text = query.value;\n\tconst value = query.value;\n\tconst jsonValue = JSON.stringify(value);\n\tconst option = {\n\t\ttext,\n\t\tvalue,\n\t\tjsonValue,\n\t\tid: 'option_' + jsonValue.replace(/\\W/g, '_'),\n\t\toriginal: value,\n\t\tmanual: true,\n\t\tdisabled: false,\n\t};\n\tmanualItems.value = manualItems.value.concat(option as any);\n\tquery.value = '';\n};\n\n/**\n * It should prefill if asked, or\n * when single if modelValue is not null\n * when multiple if modelValue is not empty\n */\nconst shouldPrefill =\n\tprops.prefill === true ||\n\t(!props.multiple && isNotNil(props.modelValue)) ||\n\t(props.multiple && !!props.modelValue.length);\n/**\n * When modelValue changes split behavior for single and multiple selection:\n */\nlet modelValueTimeout: ReturnType<typeof setTimeout>;\nlet hasRunOnce = false;\nwatch(\n\t() => props.modelValue,\n\t(current, previous) => {\n\t\tif (modelValueTimeout) clearTimeout(modelValueTimeout);\n\t\tmodelValueTimeout = setTimeout(\n\t\t\tasync () => {\n\t\t\t\t/**\n\t\t\t\t * For single selection if the value is already in the option (most likely you are using\n\t\t\t\t * static items) just use it.\n\t\t\t\t * If the value is not in the options try searching for it (outside dependencies may fix it).\n\t\t\t\t * If at last the value cannot be found even after searching\n\t\t\t\t * reset value to the default value when coherence is enforced\n\t\t\t\t * or at least do not display the old query\n\t\t\t\t */\n\t\t\t\tif (!props.multiple) {\n\t\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (\n\t\t\t\t\t\t(!found && isNotNil(props.modelValue)) ||\n\t\t\t\t\t\tprevious === undefined\n\t\t\t\t\t) {\n\t\t\t\t\t\tconst currentQuery = query.value;\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\tquery.value = currentQuery;\n\t\t\t\t\t}\n\t\t\t\t\tfound = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (found) {\n\t\t\t\t\t\tquery.value = found.text;\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = [found as any];\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (props.enforceCoherence && isNotNil(current)) {\n\t\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t/**\n\t\t\t\t\t * For multiple selection if every value is already in the options (most likely you are using\n\t\t\t\t\t * static items) just use them.\n\t\t\t\t\t * If not all the values are in the current options or is prefilling try searching (outside depencencies may fix the situation).\n\t\t\t\t\t * If the values are still not in the available options and coherence is enforced\n\t\t\t\t\t * discard the ones that are invalid.\n\t\t\t\t\t *\n\t\t\t\t\t */\n\t\t\t\t} else {\n\t\t\t\t\tif (!Array.isArray(props.modelValue)) {\n\t\t\t\t\t\tthrow new Error('props.modelValue is not an array.');\n\t\t\t\t\t}\n\t\t\t\t\tlet allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound || previous === undefined) {\n\t\t\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\t\t\tallFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tif (allFound) {\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = props.modelValue.map(\n\t\t\t\t\t\t\t\t(value: any) => optionsIndexedByValue.value.get(value)!\n\t\t\t\t\t\t\t) as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t} else {\n\t\t\t\t\t\tlet coherentStash: Option[] = [];\n\t\t\t\t\t\tconst coherent = current.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\tif (found) coherentStash.push(found);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = coherentStash as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t},\n\t\t\tshouldPrefill ? 0 : props.modelValueDebounceTime\n\t\t);\n\t},\n\t// Prefill when asked or when items are static\n\t{ immediate: shouldPrefill, deep: true }\n);\n\n/**\n * This is triggered to refresh static items whenever the passed array changes.\n * If the parent defines an array in the template this is triggered\n * at every render so we take counter measures\n * Even if the entire array changes all the previously selected values are still in the stash.\n */\nwatch(\n\t() => props.items,\n\tasync (current, previous) => {\n\t\tif (\n\t\t\ttypeof current === 'function' ||\n\t\t\t// Circumvent arrays defined in the template by the parent\n\t\t\tJSON.stringify(current) !== JSON.stringify(previous)\n\t\t) {\n\t\t\tawait getOptions({ prefill: false });\n\t\t\tif (props.multiple) {\n\t\t\t\tconst allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t);\n\n\t\t\t\tif (!allFound) {\n\t\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\t\tconst coherent = props.modelValue.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else {\n\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\tif (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t}\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t}\n\t\t}\n\t}\n);\n\n/**\n * When dependencies change\n * If the input has not been prefilled yet just return\n * Check dependencies are the same by value and not reference\n * Otherwise we search again for options as they might be different base on dependencies.\n * If coherence is enforced we set the state accordingly\n */\nlet depsTimeout: ReturnType<typeof setTimeout>;\nwatch(\n\t() => props.dependencies,\n\t(current, previous) => {\n\t\tif (!shouldPrefill && props.prefill === 'focus' && isFirstFocus) {\n\t\t\treturn;\n\t\t}\n\t\t// Circumvent array defined in the template by the parent\n\t\tif (JSON.stringify(current) === JSON.stringify(previous)) {\n\t\t\treturn;\n\t\t}\n\n\t\tif (depsTimeout) clearTimeout(depsTimeout);\n\t\tdepsTimeout = setTimeout(async () => {\n\t\t\tif (JSON.stringify(current) !== JSON.stringify(previous)) {\n\t\t\t\t// Only reset the stash if we are going to enforce coherence\n\t\t\t\tif (props.enforceCoherence) {\n\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t// Momentarily reset query\n\t\t\t\tlet currentQuery = query.value;\n\t\t\t\tquery.value = '';\n\t\t\t\tawait getOptions({ prefill: true });\n\t\t\t\tquery.value = currentQuery;\n\t\t\t\tif (!props.multiple) {\n\t\t\t\t\tlet found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\t\t\tif (!found && props.enforceCoherence && isNotNil(props.modelValue)) {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = [];\n\t\t\t\t\t\t}\n\t\t\t\t\t\temit('update:modelValue', null);\n\t\t\t\t\t}\n\t\t\t\t} else {\n\t\t\t\t\tlet allFound = props.modelValue.every((value: any) =>\n\t\t\t\t\t\toptionsIndexedByValue.value.get(value)\n\t\t\t\t\t);\n\t\t\t\t\tif (!allFound && props.enforceCoherence) {\n\t\t\t\t\t\tlet coherentStash: Option[] = [];\n\t\t\t\t\t\tconst coherent = props.modelValue.filter((value: any) => {\n\t\t\t\t\t\t\tlet found = optionsIndexedByValue.value.get(value);\n\t\t\t\t\t\t\tif (found) coherentStash.push(found);\n\t\t\t\t\t\t\treturn found;\n\t\t\t\t\t\t});\n\t\t\t\t\t\tif (props.stash) {\n\t\t\t\t\t\t\tstash.value = coherentStash as any;\n\t\t\t\t\t\t}\n\t\t\t\t\t\temit('update:modelValue', coherent);\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t}, props.depsDebounceTime);\n\t},\n\t{ deep: true }\n);\n\n/**\n * We need the transitions because elements must be hidden and shown\n * to accessibility tools when they are fully closed or fully open,\n * while still being animated for sighted users.\n */\n\n// Option panel is open\nconst shown = ref(false);\n// Option panel il closed\nconst hidden = ref(true);\n\nconst open = async () => {\n\thidden.value = false;\n\tshown.value = true;\n};\n\nconst close = async () => {\n\tshown.value = false;\n\thidden.value = true;\n};\n\n/**\n * Applies a class when the user is inside this whole component.\n * We cannot use focus within as it doesn't work for elements that are teleported.\n * Also we cannot use the <input/> if we phisically move focus to the options so\n * we track it manually.\n */\nconst active = ref(false);\n\n/**\n * When the focus goes to the input we select the current text\n * so the user can replace or delete it.\n * On top of that if the prefill strategy is to prefill on first focus and options\n * weren't already retrieved by the watcher on mount, we do that\n */\nlet isFirstFocus = true;\nconst onInputFocus = async (event: FocusEvent) => {\n\temit('focus', event);\n\tactive.value = true;\n\tdocument.addEventListener('click', onClickOutside);\n\tdocument.addEventListener('focusin', onFocusOutside);\n\tif (input.value instanceof HTMLInputElement) input.value.select();\n\tif (props.prefill === 'focus' && isFirstFocus && !shouldPrefill) {\n\t\tawait getOptions({ prefill: true });\n\t\tisFirstFocus = false;\n\t}\n};\n\nconst onFocusOutside = (event: FocusEvent) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value && optionsContainer.value) {\n\t\t\tif (\n\t\t\t\t!outerContainer.value.contains(event.target) &&\n\t\t\t\t!optionsContainer.value.contains(event.target)\n\t\t\t) {\n\t\t\t\tclose();\n\t\t\t\temit('inactive');\n\t\t\t\tdocument.removeEventListener('focusin', onFocusOutside);\n\t\t\t\tactive.value = false;\n\t\t\t\tif (props.multiple)\n\t\t\t\t\twait(500).then(() => {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * On single selection restore the query that might be partially altered by the user.\n * Input can blur either by clicking outside or clicking on an option.\n * We do nothing if the user has selected an option. And we restore the\n * query to its text if the user has moved focus\n */\nconst onInputBlur = async (event: FocusEvent) => {\n\temit('blur', event);\n\tif (!props.multiple) {\n\t\tlet noop = false;\n\t\tconst currentModelValue = props.modelValue;\n\t\tawait Promise.race([\n\t\t\twait(250),\n\t\t\twaitFor(() => {\n\t\t\t\treturn currentModelValue !== props.modelValue;\n\t\t\t}).then(() => {\n\t\t\t\tnoop = true;\n\t\t\t}),\n\t\t]);\n\t\tif (!noop) {\n\t\t\tconst found = optionsIndexedByValue.value.get(props.modelValue);\n\t\t\tif (found) {\n\t\t\t\tquery.value = found.text;\n\t\t\t}\n\t\t}\n\t}\n};\n\nconst onInputChange = (event: Event) => emit('change', event);\n\n/**\n * Search at every input by the user.\n * When the user deletes the query unselect the current option\n */\nconst onInputInput = (event: Event) => {\n\temit('input', event);\n\tif (query.value === '') {\n\t\tif (!props.multiple) {\n\t\t\temit('update:modelValue', null);\n\t\t}\n\t}\n\tif (typeof props.items === 'function') {\n\t\tsearchByQuery();\n\t}\n};\n\n// This is the vertical index used to highlight options in the container\nconst focusedIndex = ref<number | null>(null);\n/**\n * Normalize the index using the displayed options so we can start over when reaching the end.\n * Please watch out for the side effect it is used to avoid the\n * complexity of using modulo over negative numbers\n */\nconst normalizedFocusedIndex: ComputedRef<number | null> = computed(() => {\n\tif (focusedIndex.value === null || !filteredOptions.value.length) return null;\n\n\tlet start =\n\t\tfocusedIndex.value >= 0\n\t\t\t? focusedIndex.value\n\t\t\t: filteredOptions.value.length - 1;\n\n\tconst min = 0;\n\tconst max = filteredOptions.value.length - 1;\n\tconst normalized = clamp(start % filteredOptions.value.length, min, max);\n\treturn normalized;\n});\n\n// This is the horizontal index used to highlight selected options\nconst selectedOptionsFocusedIndex = ref<number | null>(null);\n\n/**\n * Increment the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnNextOption = () => {\n\tif (focusedIndex.value !== null) focusedIndex.value++;\n\telse {\n\t\tfocusedIndex.value = 0;\n\t}\n\tnextTick().then(() => {\n\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\tconst foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t`#${options.value[normalizedFocusedIndex.value].id}`\n\t\t\t);\n\t\t\tif (foundOption instanceof HTMLElement)\n\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'start',\n\t\t\t\t});\n\t\t}\n\t});\n};\n\n/**\n * Decrement the focusIndex and wait for it to be normalized.\n * If the index corresponds to an option scroll it into view\n */\nconst focusOnPreviousOption = () => {\n\tif (focusedIndex.value !== null) focusedIndex.value--;\n\telse focusedIndex.value = options.value.length - 1;\n\n\tnextTick().then(() => {\n\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\tconst foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t`#${options.value[normalizedFocusedIndex.value].id}`\n\t\t\t);\n\t\t\tif (foundOption instanceof HTMLElement)\n\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\tinline: 'start',\n\t\t\t\t});\n\t\t}\n\t});\n};\n\n/**\n * This is handled separately from input because it has a lot to do with user\n * interaction and control characters than it has with the query.\n */\nconst onInputKeyDown = async (event: KeyboardEvent) => {\n\tif (props.readonly || props.disabled) {\n\t\tevent.preventDefault();\n\t\treturn;\n\t}\n\tswitch (event.key) {\n\t\t/**\n\t\t * On arrow prevent the page from scrolling.\n\t\t * Reset horizontal focus\n\t\t * When the panel is open\n\t\t * - Focus on the previous option\n\t\t * When the panel is closed\n\t\t * - focus on the first selected option\n\t\t */\n\t\tcase 'ArrowUp':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tfocusOnPreviousOption();\n\t\t\t\t} else {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * On arrow prevent the page from scrolling.\n\t\t * Reset horizontal focus\n\t\t * When the panel is open\n\t\t * - Focus on the previous option\n\t\t * When the panel is closed\n\t\t * - focus on the first selected option\n\t\t */\n\t\tcase 'ArrowDown':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tfocusOnNextOption();\n\t\t\t\t} else {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving horizontally\n\t\t * Cycle from rightmost, next, or input focus.\n\t\t * If the focus lands on an option align the vertical focus as well\n\t\t */\n\t\tcase 'ArrowLeft':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value =\n\t\t\t\t\t\t\t\tselectedOptions.value.length - 1;\n\t\t\t\t\t\t} else if (selectedOptionsFocusedIndex.value > 0) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value--;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value !== null) {\n\t\t\t\t\t\t\tlet linkedOption =\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value];\n\t\t\t\t\t\t\tlet foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t\t\t\t\t`#${linkedOption.id}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (foundOption) {\n\t\t\t\t\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tfocusedIndex.value =\n\t\t\t\t\t\t\t\t\toptionsIndexedById.value[\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value].id\n\t\t\t\t\t\t\t\t\t].index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving horizontally\n\t\t * Cycle from leftmost, next, or input focus.\n\t\t * If the focus lands on an option align the vertical focus as well\n\t\t */\n\t\tcase 'ArrowRight':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = 0;\n\t\t\t\t\t\t} else if (\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value <\n\t\t\t\t\t\t\tselectedOptions.value.length - 1\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value++;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value !== null) {\n\t\t\t\t\t\t\tlet linkedOption =\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value];\n\t\t\t\t\t\t\tlet foundOption = optionsContainer.value?.querySelector(\n\t\t\t\t\t\t\t\t`#${linkedOption.id}`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (foundOption) {\n\t\t\t\t\t\t\t\tfoundOption.scrollIntoView({\n\t\t\t\t\t\t\t\t\tbehavior: 'smooth',\n\t\t\t\t\t\t\t\t\tblock: 'nearest',\n\t\t\t\t\t\t\t\t\tinline: 'start',\n\t\t\t\t\t\t\t\t});\n\n\t\t\t\t\t\t\t\tfocusedIndex.value =\n\t\t\t\t\t\t\t\t\toptionsIndexedById.value[\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value].id\n\t\t\t\t\t\t\t\t\t].index;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * If the panel is closed focus on the first selected option.\n\t\t * If the panel was already open select/deselect the currently focused option\n\t\t * and close the panel of single selection is enabled\n\t\t */\n\t\tcase 'Enter':\n\t\t\t{\n\t\t\t\tevent.preventDefault();\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!shown.value) {\n\t\t\t\t\tif (filteredOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\t\tfocusedIndex.value = head(selectedOptions.value).index;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\tawait open();\n\t\t\t\t} else {\n\t\t\t\t\tif (normalizedFocusedIndex.value !== null) {\n\t\t\t\t\t\tif (filteredOptions.value[normalizedFocusedIndex.value].disabled)\n\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\tif (!props.multiple) {\n\t\t\t\t\t\t\tawait close();\n\t\t\t\t\t\t}\n\t\t\t\t\t\tonOptionSelected(\n\t\t\t\t\t\t\tfilteredOptions.value[normalizedFocusedIndex.value]\n\t\t\t\t\t\t);\n\t\t\t\t\t} else {\n\t\t\t\t\t\tif (props.addOptions) {\n\t\t\t\t\t\t\tif (props.itemText || props.itemValue) {\n\t\t\t\t\t\t\t\tconsole.error(\n\t\t\t\t\t\t\t\t\t`Adding an option for mapped items is not supported. You can't create an option while passing \"item-text\" or \"item-value\".`\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\taddOption();\n\t\t\t\t\t\t\tconst added = last(manualItems.value);\n\t\t\t\t\t\t\tonOptionSelected(optionsIndexedById.value[added.id]);\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * When moving away from the component reset focus both vertically and horizontally\n\t\t */\n\t\tcase 'Tab':\n\t\tcase 'Escape':\n\t\t\t{\n\t\t\t\tif (shown.value) {\n\t\t\t\t\tawait close();\n\t\t\t\t}\n\t\t\t\temit('inactive');\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t}\n\t\t\tbreak;\n\t\t// Prevent shift from opening the panel\n\t\tcase 'Shift':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * Delete behavior is different when query is empty\n\t\t * If query is empty\n\t\t * If no chip is selected - select rightmost chip\n\t\t * If a chip is selected - deselect that option\n\t\t * If any option remains move focus to that or reset\n\t\t */\n\t\tcase 'Backspace':\n\t\t\t{\n\t\t\t\tif (loading.value) return;\n\t\t\t\tif (!query.value) {\n\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\tif (selectedOptionsFocusedIndex.value === null) {\n\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value =\n\t\t\t\t\t\t\t\tselectedOptions.value.length - 1;\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tonOptionSelected(\n\t\t\t\t\t\t\t\tselectedOptions.value[selectedOptionsFocusedIndex.value]\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tif (selectedOptions.value.length) {\n\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = Math.max(\n\t\t\t\t\t\t\t\t\tMath.min(\n\t\t\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value,\n\t\t\t\t\t\t\t\t\t\tselectedOptions.value.length - 2\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t0\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tawait open();\n\t\t\t}\n\t\t\tbreak;\n\t\t/**\n\t\t * Open the panel on writing and reset horizontal focus\n\t\t */\n\t\tdefault:\n\t\t\t{\n\t\t\t\tselectedOptionsFocusedIndex.value = null;\n\t\t\t\tfocusedIndex.value = null;\n\t\t\t\tawait open();\n\t\t\t}\n\t\t\tbreak;\n\t}\n};\n\n/**\n * Triggered on input when items is a function.\n */\n\nlet timeout: ReturnType<typeof setTimeout>;\nconst searchByQuery = () => {\n\tif (timeout) clearTimeout(timeout);\n\ttimeout = setTimeout(async () => {\n\t\ttry {\n\t\t\tawait getOptions({ prefill: false });\n\t\t} catch (error) {\n\t\t\tconsole.error(error);\n\t\t}\n\t}, props.queryDebounceTime);\n};\n\n/**\n * When clicking on the outside container seamlessly move focus to the input and open the panel\n */\nconst onOuterContainerClick = (event: MouseEvent) => {\n\temit('click', event);\n\tif (props.disabled || props.readonly) return;\n\tif (input.value instanceof HTMLElement) {\n\t\tinput.value.focus();\n\t}\n\topen();\n};\n\n/**\n * When an option is clicked wait for it to bubble to the option container to avoid slot event problems.\n * Select / deselect the option and then move focus to the input.\n * If it is single selection mode close the panel\n */\nconst onOptionClicked = (event: Event) => {\n\tif (event.currentTarget instanceof HTMLElement) {\n\t\tif (event.currentTarget.classList.contains('bb-base-select-option')) {\n\t\t\tconst option = optionsIndexedById.value[event.currentTarget.id];\n\t\t\tif (option.disabled) return;\n\t\t\tonOptionSelected(option);\n\t\t\tif (input.value instanceof HTMLInputElement) {\n\t\t\t\tinput.value.focus();\n\t\t\t}\n\t\t\tif (!props.multiple) close();\n\t\t}\n\t}\n};\n\n/**\n * On click outside of the container close the panel, remove active state.\n * In multiple selection clear query after a timeout\n */\nconst onClickOutside = (event: Event) => {\n\tif (event.target instanceof Node) {\n\t\tif (outerContainer.value) {\n\t\t\tif (!outerContainer.value.contains(event.target)) {\n\t\t\t\tclose();\n\t\t\t\temit('inactive');\n\t\t\t\tdocument.removeEventListener('click', onClickOutside);\n\t\t\t\tactive.value = false;\n\t\t\t\tif (props.multiple)\n\t\t\t\t\twait(500).then(() => {\n\t\t\t\t\t\tquery.value = '';\n\t\t\t\t\t});\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n * When using this component for submission we add a bunch of hidden\n * inputs so the submitted inputs are on par with v-model\n */\n/**\n * This is used to keep the value compatible to common html expected values.\n * Convert to string everything that's not but do not double encode strings\n */\nconst makeInputValue = when(\n\t(item: unknown) => typeof item !== 'string',\n\tJSON.stringify\n);\n\nconst hiddenInputs = computed(() => {\n\treturn [].concat(props.modelValue).map((current) => {\n\t\tconst value = makeInputValue(current);\n\t\treturn {\n\t\t\tdisabled: props.disabled,\n\t\t\tname: props.name,\n\t\t\ttype: 'hidden',\n\t\t\tvalue: value,\n\t\t};\n\t});\n});\n</script>\n<style lang=\"postcss\">\n@import '@/assets/css/BaseSelect';\n</style>\n"],"names":["props","__props","emit","__emit","outerContainer","ref","innerContainer","optionsContainer","floatingStyles","useFloating","autoUpdate","flip","offset","shift","optionsContainerStyles","computed","base","input","query","computedPlaceholder","selectedOptions","loading","internalItems","stash","manualItems","getItemText","useItemText","getItemValue","useItemValue","internalOptions","item","_","text","value","jsonValue","options","fromOptions","acc","curr","withManual","withStash","option","index","isNotNil","modelValueIndexed","filteredOptions","matchedAnything","keys","propName","optionsIndexedById","optionsIndexedByValue","indexed","key","_a","pairs","deepEqual","map","linkedOption","onOptionSelected","valueToEmit","focusedIndex","current","stashed","getOptions","prefill","items","addOption","shouldPrefill","modelValueTimeout","watch","previous","allFound","coherentStash","coherent","found","currentQuery","depsTimeout","isFirstFocus","shown","hidden","open","close","active","onInputFocus","event","onClickOutside","onFocusOutside","wait","onInputBlur","noop","currentModelValue","waitFor","onInputChange","onInputInput","searchByQuery","normalizedFocusedIndex","start","min","max","clamp","selectedOptionsFocusedIndex","focusOnNextOption","nextTick","foundOption","focusOnPreviousOption","onInputKeyDown","head","_b","added","last","timeout","error","onOuterContainerClick","onOptionClicked","makeInputValue","when","hiddenInputs"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgcA,UAAMA,IAAQC,IAcRC,IAAOC;AAIb,QAAIH,EAAM,YAAY,CAAC,MAAM,QAAQA,EAAM,UAAU;AAC9C,YAAA,IAAI,MAAM,2DAA2D;AAGtE,UAAAI,IAAiBC,EAAwB,IAAI,GAC7CC,IAAiBD,EAAwB,IAAI,GAC7CE,IAAmBF,EAAwB,IAAI,GAE/C,EAAE,gBAAAG,GAAmB,IAAAC,GAAYH,GAAgBC,GAAkB;AAAA,MACxE,WAAW;AAAA,MACX,sBAAsBG;AAAA,MACtB,YAAY,CAACC,GAAK,GAAGC,GAAO,CAAC,GAAGC,IAAO;AAAA,IAAA,CACvC,GAEKC,KAAyBC,EAAS,MAAM;AAC7C,YAAMC,IAA4B;AAAA,QACjC,GAAGR,GAAe;AAAA,QAClB,oBAAoB,GAAGR,EAAM,kBAAkB;AAAA,MAAA;AAEhD,aAAIM,EAAe,UAClBU,EAAK,QAAQ,GAAGV,EAAe,MAAM,WAAW,OAG1CU;AAAA,IAAA,CACP,GAEKC,IAAQZ,EAAwB,IAAI,GACpCa,IAAQb,EAAY,EAAE,GACtBc,KAAsBJ,EAAS,MAChCK,EAAgB,MAAM,SAAe,KAC7BpB,EAAM,WAClB,GAQKqB,IAAUhB,EAAI,CAAC,GAEfiB,KAAgBjB,EAAW,CAAA,CAAE,GAC7BkB,IAAQlB,EAAkB,CAAA,CAAE,GAC5BmB,IAAcnB,EAAkB,CAAA,CAAE,GAClC,EAAE,aAAAoB,OAAgBC,MAClB,EAAE,cAAAC,OAAiB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MAAM,SAASgF,EAAM,MAAM,GAAG;AAC3C,QAAAH,KACN/E,EAAK,UAAU,GACN,SAAA,oBAAoB,SAASmF,EAAc,GACpDH,EAAO,QAAQ,IACXlF,EAAM,YACJuF,EAAA,GAAG,EAAE,KAAK,MAAM;AACpB,UAAArE,EAAM,QAAQ;AAAA,QAAA,CACd;AACF;AAAA,MACD;AAAA,IAEF,GAWKgG,KAAiBC;AAAA,MACtB,CAACrF,MAAkB,OAAOA,KAAS;AAAA,MACnC,KAAK;AAAA,IAAA,GAGAsF,KAAerG,EAAS,MACtB,CAAA,EAAG,OAAOf,EAAM,UAAU,EAAE,IAAI,CAAC6D,MAAY;AAC7C,YAAA5B,IAAQiF,GAAerD,CAAO;AAC7B,aAAA;AAAA,QACN,UAAU7D,EAAM;AAAA,QAChB,MAAMA,EAAM;AAAA,QACZ,MAAM;AAAA,QACN,OAAAiC;AAAA,MAAA;AAAA,IACD,CACA,CACD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/dist/index33.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as R, ref as l, onMounted as S, watchEffect as z, computed as y, openBlock as D, createElementBlock as F, mergeProps as h, renderSlot as g, createElementVNode as t, normalizeProps as H, guardReactiveProps as T, normalizeStyle as E, unref as X } from "vue";
2
- import { clamp as K } from "./index198.js";
3
- import { isCssColor as w } from "./index196.js";
2
+ import { clamp as K } from "./index196.js";
3
+ import { isCssColor as w } from "./index201.js";
4
4
  import { isNil as O } from "./index120.js";
5
5
  import { transposeValue as L } from "./index121.js";
6
6
  const Y = { class: "bb-base-slider__slider-container" }, j = ["id", "disabled", "name", "readonly", "value"], q = ["aria-readonly", "aria-valuemax", "aria-valuemin", "aria-valuenow", "tabindex"], W = /* @__PURE__ */ R({
package/dist/index35.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as I, ref as b, computed as n, watch as F, openBlock as m, createElementBlock as p, normalizeClass as N, normalizeProps as c, mergeProps as h, createCommentVNode as S, createElementVNode as l, renderSlot as x, guardReactiveProps as f } from "vue";
2
- import { isCssColor as V } from "./index196.js";
3
- import { when as A } from "./index197.js";
2
+ import { isCssColor as V } from "./index201.js";
3
+ import { when as A } from "./index214.js";
4
4
  const J = { class: "bb-base-switch-container" }, M = /* @__PURE__ */ l("span", { class: "bb-base-switch-container__icon-thumb" }, null, -1), O = [
5
5
  M
6
6
  ], H = /* @__PURE__ */ I({
package/dist/index47.js CHANGED
@@ -1,5 +1,5 @@
1
1
  import { defineComponent as p, computed as u, ref as d, watch as f, openBlock as a, createElementBlock as l, normalizeProps as b, guardReactiveProps as z, createElementVNode as v, renderSlot as g, createCommentVNode as h } from "vue";
2
- import { isCssColor as _ } from "./index196.js";
2
+ import { isCssColor as _ } from "./index201.js";
3
3
  const k = { class: "bb-avatar__fallback" }, C = ["alt", "sizes", "src", "srcset"], B = /* @__PURE__ */ p({
4
4
  __name: "BbAvatar",
5
5
  props: {