\n \n \n {{ __('Select all') }}\n \n \n \n \n \"{{ token }}\"\n \n {{ tokenTitles[token.type] }} :{{ token.value.operator }}\n {{ tokenSymbols[token.type] }}{{ historyTokenOptionTitle(token) }}\n \n \n \n \n \n
\n\n","import { render, staticRenderFns } from \"./filtered_search_bar_root.vue?vue&type=template&id=5fd09c4e\"\nimport script from \"./filtered_search_bar_root.vue?vue&type=script&lang=js\"\nexport * from \"./filtered_search_bar_root.vue?vue&type=script&lang=js\"\n\n\n/* normalize component */\nimport normalizer from \"!../../../../../../node_modules/vue-loader/lib/runtime/componentNormalizer.js\"\nvar component = normalizer(\n script,\n render,\n staticRenderFns,\n false,\n null,\n null,\n null\n \n)\n\nexport default component.exports","import first from 'lodash/first';\nimport last from 'lodash/last';\nimport isString from 'lodash/isString';\nimport { modulo } from '../../../utils/number_utils';\n\nconst TERM_TOKEN_TYPE = 'filtered-search-term';\nconst INTENT_ACTIVATE_PREVIOUS = 'intent-activate-previous';\nconst TOKEN_CLOSE_SELECTOR = '.gl-token-close';\nfunction isEmptyTerm(token) {\n return token.type === TERM_TOKEN_TYPE && token.value.data.trim() === '';\n}\nfunction normalizeTokens(tokens) {\n const result = [];\n tokens.forEach(token => {\n if (isEmptyTerm(token)) {\n return;\n }\n if (token.type !== TERM_TOKEN_TYPE) {\n result.push({\n ...token\n });\n } else if (result.length > 0 && typeof result[result.length - 1] === 'string') {\n result[result.length - 1] += ` ${token.value.data}`;\n } else {\n result.push(token.value.data);\n }\n });\n return result;\n}\nfunction assertValidTokens(tokens) {\n if (!Array.isArray(tokens) && !typeof tokens === 'string') {\n throw new TypeError('Either string or array of tokens is expected');\n }\n}\nfunction needDenormalization(tokens) {\n if (typeof tokens === 'string') {\n return true;\n }\n assertValidTokens(tokens);\n return tokens.some(t => typeof t === 'string' || !t.id);\n}\n\n/**\n * Given an initial index, step size and array length, returns an index that is\n * within the array bounds (unless step is 0; see † below).\n *\n * The step can be any positive or negative integer, including zero.\n *\n * An out-of-bounds index is considered 'uninitialised', and is handled\n * specially. For instance, the 'next' index of 'uninitialised' is the first\n * index:\n *\n * stepIndexAndWrap(-1, 1, 5) === 0\n *\n * The 'previous' index of 'uninitialised' is the last index:\n *\n * stepIndexAndWrap(-1, -1, 5) === 4\n *\n * †: If step is 0, the index is returned as-is, which may be out-of-bounds.\n *\n * @param {number} index The initial index.\n * @param {number} step The amount to step by (positive or negative).\n * @param {number} length The length of the array.\n * @returns {number}\n */\nfunction stepIndexAndWrap(index, step, length) {\n if (step === 0) return index;\n let start;\n const indexInRange = index >= 0 && index < length;\n if (indexInRange) {\n // Step from the valid index.\n start = index;\n } else if (step > 0) {\n // Step forwards from the beginning of the array.\n start = -1;\n } else {\n // Step backwards from the end of the array.\n start = length;\n }\n return modulo(start + step, length);\n}\n\n/**\n * Transforms a given token definition to an option definition.\n *\n * @param {Object} token A token definition (see GlFilteredSearch's\n * availableTokens prop).\n * @returns {Object} A option definition (see GlFilteredSearchTokenSegment's\n * options prop).\n */\nfunction tokenToOption(_ref) {\n let {\n icon,\n title,\n type,\n optionComponent\n } = _ref;\n return {\n icon,\n title,\n value: type,\n component: optionComponent\n };\n}\nlet tokenIdCounter = 0;\nconst getTokenId = () => {\n const tokenId = `token-${tokenIdCounter}`;\n tokenIdCounter += 1;\n return tokenId;\n};\n/**\n * Ensure the given token has an `id` property, which `GlFilteredSearch` relies\n * on as a unique key for the token.\n *\n * If the given token does not have an `id`, it returns a shallow copy of the\n * token with an `id`. Otherwise, it returns the given token.\n *\n * @param {object} token The token to check.\n * @returns {object} A token with an `id`.\n */\nfunction ensureTokenId(token) {\n if (!token.id) {\n return {\n ...token,\n id: getTokenId()\n };\n }\n return token;\n}\nfunction createTerm() {\n let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';\n return {\n id: getTokenId(),\n type: TERM_TOKEN_TYPE,\n value: {\n data\n }\n };\n}\nfunction denormalizeTokens(inputTokens) {\n let termsAsTokens = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n assertValidTokens(inputTokens);\n const tokens = Array.isArray(inputTokens) ? inputTokens : [inputTokens];\n return tokens.reduce((result, t) => {\n if (typeof t === 'string') {\n if (termsAsTokens) {\n const trimmedText = t.trim();\n if (trimmedText) result.push(createTerm(trimmedText));\n } else {\n const stringTokens = t.split(' ').filter(Boolean);\n stringTokens.forEach(strToken => result.push(createTerm(strToken)));\n }\n } else {\n result.push(ensureTokenId(t));\n }\n return result;\n }, []);\n}\n\n/**\n * Returns `true` if `text` contains `query` (case insensitive).\n *\n * This is used in `filter` and `find` array methods for token segment options.\n *\n * @param {string} text The string to look within.\n * @param {string} query The string to find inside the text.\n * @returns {boolean}\n */\nfunction match(text, query) {\n return text.toLowerCase().includes(query.toLowerCase());\n}\nconst termTokenDefinition = {\n type: TERM_TOKEN_TYPE,\n icon: 'title',\n title: 'Search for this text'\n};\nfunction splitOnQuotes(str) {\n if (first(str) === \"'\" && last(str) === \"'\") {\n return [str];\n }\n if (first(str) === '\"' && last(str) === '\"') {\n return [str];\n }\n const queue = str.split(' ');\n const result = [];\n let waitingForMatchingQuote = false;\n let quoteContent = '';\n while (queue.length) {\n const part = queue.shift();\n const quoteIndex = part.indexOf('\"');\n if (quoteIndex === -1) {\n if (waitingForMatchingQuote) {\n quoteContent += ` ${part}`;\n } else {\n result.push(part);\n }\n } else {\n const [firstPart, secondPart] = part.split('\"', 2);\n if (waitingForMatchingQuote) {\n waitingForMatchingQuote = false;\n quoteContent += ` ${firstPart}\"`;\n result.push(quoteContent);\n quoteContent = '';\n if (secondPart.length) {\n queue.unshift(secondPart);\n }\n } else {\n waitingForMatchingQuote = true;\n if (firstPart.length) {\n result.push(firstPart);\n }\n quoteContent = `\"${secondPart}`;\n }\n }\n }\n return result;\n}\n\n/**\n * wraps the incoming token in double quotes.\n * Eg. Foo Bar becomes \"Foo Bar\"\n *\n * 1. token must have space.\n * 2. token should not already have a quote around it.\n */\nfunction wrapTokenInQuotes(token) {\n if (!isString(token)) {\n return token;\n }\n if (!token.includes(' ')) {\n return token;\n }\n const quotes = [\"'\", '\"'];\n\n // If the token starts and ends with a quote, eg. \"Foo Bar\", then return the original token.\n if (quotes.some(quote => first(token) === quote && last(token) === quote)) {\n return token;\n }\n return `\"${token}\"`;\n}\n\nexport { INTENT_ACTIVATE_PREVIOUS, TERM_TOKEN_TYPE, TOKEN_CLOSE_SELECTOR, createTerm, denormalizeTokens, ensureTokenId, isEmptyTerm, match, needDenormalization, normalizeTokens, splitOnQuotes, stepIndexAndWrap, termTokenDefinition, tokenToOption, wrapTokenInQuotes };\n","/**\n * This function is like `arrayIncludes` except that it accepts a comparator.\n *\n * @private\n * @param {Array} [array] The array to inspect.\n * @param {*} target The value to search for.\n * @param {Function} comparator The comparator invoked per element.\n * @returns {boolean} Returns `true` if `target` is found, else `false`.\n */\nfunction arrayIncludesWith(array, value, comparator) {\n var index = -1,\n length = array == null ? 0 : array.length;\n\n while (++index < length) {\n if (comparator(value, array[index])) {\n return true;\n }\n }\n return false;\n}\n\nmodule.exports = arrayIncludesWith;\n","import { __ } from '~/locale';\n\nclass RecentSearchesServiceError extends Error {\n constructor(message) {\n super(message || __('Recent Searches Service is unavailable'));\n this.name = 'RecentSearchesServiceError';\n }\n}\n\nexport default RecentSearchesServiceError;\n","import AccessorUtilities from '~/lib/utils/accessor';\nimport RecentSearchesServiceError from './recent_searches_service_error';\n\nclass RecentSearchesService {\n constructor(localStorageKey = 'issuable-recent-searches') {\n this.localStorageKey = localStorageKey;\n }\n\n fetch() {\n if (!RecentSearchesService.isAvailable()) {\n const error = new RecentSearchesServiceError();\n return Promise.reject(error);\n }\n\n const input = window.localStorage.getItem(this.localStorageKey);\n\n let searches = [];\n if (input && input.length > 0) {\n try {\n searches = JSON.parse(input);\n } catch (err) {\n return Promise.reject(err);\n }\n }\n\n return Promise.resolve(searches);\n }\n\n save(searches = []) {\n if (!RecentSearchesService.isAvailable()) return;\n\n window.localStorage.setItem(this.localStorageKey, JSON.stringify(searches));\n }\n\n static isAvailable() {\n return AccessorUtilities.canUseLocalStorage();\n }\n}\n\nexport default RecentSearchesService;\n","var copyObject = require('./_copyObject'),\n keys = require('./keys');\n\n/**\n * The base implementation of `_.assign` without support for multiple sources\n * or `customizer` functions.\n *\n * @private\n * @param {Object} object The destination object.\n * @param {Object} source The source object.\n * @returns {Object} Returns `object`.\n */\nfunction baseAssign(object, source) {\n return object && copyObject(source, keys(source), object);\n}\n\nmodule.exports = baseAssign;\n","import { extend, mergeData } from '../../vue';\nimport { NAME_INPUT_GROUP_ADDON } from '../../constants/components';\nimport { PROP_TYPE_BOOLEAN, PROP_TYPE_STRING } from '../../constants/props';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BInputGroupText } from './input-group-text'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n append: makeProp(PROP_TYPE_BOOLEAN, false),\n id: makeProp(PROP_TYPE_STRING),\n isText: makeProp(PROP_TYPE_BOOLEAN, false),\n tag: makeProp(PROP_TYPE_STRING, 'div')\n}, NAME_INPUT_GROUP_ADDON); // --- Main component ---\n// @vue/component\n\nexport var BInputGroupAddon = /*#__PURE__*/extend({\n name: NAME_INPUT_GROUP_ADDON,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n var append = props.append;\n return h(props.tag, mergeData(data, {\n class: {\n 'input-group-append': append,\n 'input-group-prepend': !append\n },\n attrs: {\n id: props.id\n }\n }), props.isText ? [h(BInputGroupText, children)] : children);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_INPUT_GROUP_APPEND } from '../../constants/components';\nimport { omit } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { BInputGroupAddon, props as BInputGroupAddonProps } from './input-group-addon'; // --- Props ---\n\nexport var props = makePropsConfigurable(omit(BInputGroupAddonProps, ['append']), NAME_INPUT_GROUP_APPEND); // --- Main component ---\n// @vue/component\n\nexport var BInputGroupAppend = /*#__PURE__*/extend({\n name: NAME_INPUT_GROUP_APPEND,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n // Pass all our data down to child, and set `append` to `true`\n return h(BInputGroupAddon, mergeData(data, {\n props: _objectSpread(_objectSpread({}, props), {}, {\n append: true\n })\n }), children);\n }\n});","function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_INPUT_GROUP_PREPEND } from '../../constants/components';\nimport { omit } from '../../utils/object';\nimport { makePropsConfigurable } from '../../utils/props';\nimport { BInputGroupAddon, props as BInputGroupAddonProps } from './input-group-addon'; // --- Props ---\n\nexport var props = makePropsConfigurable(omit(BInputGroupAddonProps, ['append']), NAME_INPUT_GROUP_PREPEND); // --- Main component ---\n// @vue/component\n\nexport var BInputGroupPrepend = /*#__PURE__*/extend({\n name: NAME_INPUT_GROUP_PREPEND,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n children = _ref.children;\n // Pass all our data down to child, and set `append` to `true`\n return h(BInputGroupAddon, mergeData(data, {\n props: _objectSpread(_objectSpread({}, props), {}, {\n append: false\n })\n }), children);\n }\n});","function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend, mergeData } from '../../vue';\nimport { NAME_INPUT_GROUP } from '../../constants/components';\nimport { PROP_TYPE_STRING } from '../../constants/props';\nimport { SLOT_NAME_APPEND, SLOT_NAME_DEFAULT, SLOT_NAME_PREPEND } from '../../constants/slots';\nimport { htmlOrText } from '../../utils/html';\nimport { hasNormalizedSlot, normalizeSlot } from '../../utils/normalize-slot';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { BInputGroupAppend } from './input-group-append';\nimport { BInputGroupPrepend } from './input-group-prepend';\nimport { BInputGroupText } from './input-group-text'; // --- Props ---\n\nexport var props = makePropsConfigurable({\n append: makeProp(PROP_TYPE_STRING),\n appendHtml: makeProp(PROP_TYPE_STRING),\n id: makeProp(PROP_TYPE_STRING),\n prepend: makeProp(PROP_TYPE_STRING),\n prependHtml: makeProp(PROP_TYPE_STRING),\n size: makeProp(PROP_TYPE_STRING),\n tag: makeProp(PROP_TYPE_STRING, 'div')\n}, NAME_INPUT_GROUP); // --- Main component ---\n// @vue/component\n\nexport var BInputGroup = /*#__PURE__*/extend({\n name: NAME_INPUT_GROUP,\n functional: true,\n props: props,\n render: function render(h, _ref) {\n var props = _ref.props,\n data = _ref.data,\n slots = _ref.slots,\n scopedSlots = _ref.scopedSlots;\n var prepend = props.prepend,\n prependHtml = props.prependHtml,\n append = props.append,\n appendHtml = props.appendHtml,\n size = props.size;\n var $scopedSlots = scopedSlots || {};\n var $slots = slots();\n var slotScope = {};\n var $prepend = h();\n var hasPrependSlot = hasNormalizedSlot(SLOT_NAME_PREPEND, $scopedSlots, $slots);\n\n if (hasPrependSlot || prepend || prependHtml) {\n $prepend = h(BInputGroupPrepend, [hasPrependSlot ? normalizeSlot(SLOT_NAME_PREPEND, slotScope, $scopedSlots, $slots) : h(BInputGroupText, {\n domProps: htmlOrText(prependHtml, prepend)\n })]);\n }\n\n var $append = h();\n var hasAppendSlot = hasNormalizedSlot(SLOT_NAME_APPEND, $scopedSlots, $slots);\n\n if (hasAppendSlot || append || appendHtml) {\n $append = h(BInputGroupAppend, [hasAppendSlot ? normalizeSlot(SLOT_NAME_APPEND, slotScope, $scopedSlots, $slots) : h(BInputGroupText, {\n domProps: htmlOrText(appendHtml, append)\n })]);\n }\n\n return h(props.tag, mergeData(data, {\n staticClass: 'input-group',\n class: _defineProperty({}, \"input-group-\".concat(size), size),\n attrs: {\n id: props.id || null,\n role: 'group'\n }\n }), [$prepend, normalizeSlot(SLOT_NAME_DEFAULT, slotScope, $scopedSlots, $slots), $append]);\n }\n});","const InputGroupMixin = {\n props: {\n value: {\n type: [String, Number],\n default: ''\n }\n },\n data() {\n return {\n localValue: this.stringifyValue(this.value)\n };\n },\n watch: {\n value(newVal) {\n if (newVal !== this.localValue) {\n this.localValue = this.stringifyValue(newVal);\n }\n },\n localValue(newVal) {\n if (newVal !== this.value) {\n this.$emit('input', newVal);\n }\n }\n },\n mounted() {\n const value = this.stringifyValue(this.value);\n if (this.activeOption) {\n const activeOption = this.predefinedOptions.find(opt => opt.name === this.activeOption);\n this.localValue = activeOption.value;\n } else if (value !== this.localValue) {\n this.localValue = value;\n }\n },\n methods: {\n stringifyValue(value) {\n return value === undefined || value === null ? '' : String(value);\n }\n }\n};\n\nexport { InputGroupMixin };\n","import { BInputGroup, BInputGroupPrepend, BInputGroupAppend, BFormInput } from 'bootstrap-vue/esm/index.js';\nimport GlDropdown from '../../dropdown/dropdown';\nimport GlDropdownItem from '../../dropdown/dropdown_item';\nimport { InputGroupMixin } from './form_input_group_mixin';\nimport __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';\n\nvar script = {\n name: 'GlFormInputGroup',\n components: {\n BInputGroup,\n BInputGroupPrepend,\n BInputGroupAppend,\n BFormInput,\n GlDropdown,\n GlDropdownItem\n },\n mixins: [InputGroupMixin],\n props: {\n /**\n * Automatically selects the content of the input field on click.\n */\n selectOnClick: {\n type: Boolean,\n required: false,\n default: false\n },\n /**\n * Array of options. Each option should have `name` and `value` information: {name: \"Foo\", value: \"Bar\"})\n */\n predefinedOptions: {\n type: Array,\n required: false,\n default: () => [{\n value: '',\n name: ''\n }],\n validator: options => options.every(opt => Object.keys(opt).includes('name', 'value'))\n },\n label: {\n type: String,\n required: false,\n default: undefined\n },\n inputClass: {\n type: [String, Array, Object],\n required: false,\n default: ''\n }\n },\n data() {\n return {\n activeOption: this.predefinedOptions && this.predefinedOptions[0].name\n };\n },\n methods: {\n handleClick() {\n if (this.selectOnClick) {\n this.$refs.input.$el.select();\n }\n },\n updateValue(option) {\n const {\n name,\n value\n } = option;\n this.activeOption = name;\n this.localValue = value;\n }\n }\n};\n\n/* script */\nconst __vue_script__ = script;\n\n/* template */\nvar __vue_render__ = function () {var _vm=this;var _h=_vm.$createElement;var _c=_vm._self._c||_h;return _c('b-input-group',[(_vm.activeOption || _vm.$scopedSlots.prepend)?_c('b-input-group-prepend',[_vm._t(\"prepend\"),_vm._v(\" \"),(_vm.activeOption)?_c('gl-dropdown',{attrs:{\"text\":_vm.activeOption}},_vm._l((_vm.predefinedOptions),function(option){return _c('gl-dropdown-item',{key:option.value,attrs:{\"is-check-item\":\"\",\"is-checked\":_vm.activeOption === option.name},on:{\"click\":function($event){return _vm.updateValue(option)}}},[_vm._v(\"\\n \"+_vm._s(option.name)+\"\\n \")])}),1):_vm._e()],2):_vm._e(),_vm._v(\" \"),_vm._t(\"default\",function(){return [_c('b-form-input',_vm._g(_vm._b({ref:\"input\",class:['gl-form-input', _vm.inputClass],attrs:{\"aria-label\":_vm.label},on:{\"click\":_vm.handleClick},model:{value:(_vm.localValue),callback:function ($$v) {_vm.localValue=$$v;},expression:\"localValue\"}},'b-form-input',_vm.$attrs,false),_vm.$listeners))]}),_vm._v(\" \"),(_vm.$scopedSlots.append)?_c('b-input-group-append',[_vm._t(\"append\")],2):_vm._e()],2)};\nvar __vue_staticRenderFns__ = [];\n\n /* style */\n const __vue_inject_styles__ = undefined;\n /* scoped */\n const __vue_scope_id__ = undefined;\n /* module identifier */\n const __vue_module_identifier__ = undefined;\n /* functional template */\n const __vue_is_functional_template__ = false;\n /* style inject */\n \n /* style inject SSR */\n \n /* style inject shadow dom */\n \n\n \n const __vue_component__ = __vue_normalize__(\n { render: __vue_render__, staticRenderFns: __vue_staticRenderFns__ },\n __vue_inject_styles__,\n __vue_script__,\n __vue_scope_id__,\n __vue_is_functional_template__,\n __vue_module_identifier__,\n false,\n undefined,\n undefined,\n undefined\n );\n\nexport default __vue_component__;\n","var _objectSpread2;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nimport { extend } from '../../vue';\nimport { NAME_FORM_CHECKBOX } from '../../constants/components';\nimport { EVENT_NAME_CHANGE, MODEL_EVENT_NAME_PREFIX } from '../../constants/events';\nimport { PROP_TYPE_ANY, PROP_TYPE_BOOLEAN } from '../../constants/props';\nimport { isArray } from '../../utils/inspect';\nimport { looseEqual } from '../../utils/loose-equal';\nimport { looseIndexOf } from '../../utils/loose-index-of';\nimport { sortKeys } from '../../utils/object';\nimport { makeProp, makePropsConfigurable } from '../../utils/props';\nimport { MODEL_EVENT_NAME, formRadioCheckMixin, props as formRadioCheckProps } from '../../mixins/form-radio-check'; // --- Constants ---\n\nvar MODEL_PROP_NAME_INDETERMINATE = 'indeterminate';\nvar MODEL_EVENT_NAME_INDETERMINATE = MODEL_EVENT_NAME_PREFIX + MODEL_PROP_NAME_INDETERMINATE; // --- Props ---\n\nexport var props = makePropsConfigurable(sortKeys(_objectSpread(_objectSpread({}, formRadioCheckProps), {}, (_objectSpread2 = {}, _defineProperty(_objectSpread2, MODEL_PROP_NAME_INDETERMINATE, makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_objectSpread2, \"switch\", makeProp(PROP_TYPE_BOOLEAN, false)), _defineProperty(_objectSpread2, \"uncheckedValue\", makeProp(PROP_TYPE_ANY, false)), _defineProperty(_objectSpread2, \"value\", makeProp(PROP_TYPE_ANY, true)), _objectSpread2))), NAME_FORM_CHECKBOX); // --- Main component ---\n// @vue/component\n\nexport var BFormCheckbox = /*#__PURE__*/extend({\n name: NAME_FORM_CHECKBOX,\n mixins: [formRadioCheckMixin],\n inject: {\n getBvGroup: {\n from: 'getBvCheckGroup',\n default: function _default() {\n return function () {\n return null;\n };\n }\n }\n },\n props: props,\n computed: {\n bvGroup: function bvGroup() {\n return this.getBvGroup();\n },\n isChecked: function isChecked() {\n var value = this.value,\n checked = this.computedLocalChecked;\n return isArray(checked) ? looseIndexOf(checked, value) > -1 : looseEqual(checked, value);\n },\n isRadio: function isRadio() {\n return false;\n }\n },\n watch: _defineProperty({}, MODEL_PROP_NAME_INDETERMINATE, function (newValue, oldValue) {\n if (!looseEqual(newValue, oldValue)) {\n this.setIndeterminate(newValue);\n }\n }),\n mounted: function mounted() {\n // Set initial indeterminate state\n this.setIndeterminate(this[MODEL_PROP_NAME_INDETERMINATE]);\n },\n methods: {\n computedLocalCheckedWatcher: function computedLocalCheckedWatcher(newValue, oldValue) {\n if (!looseEqual(newValue, oldValue)) {\n this.$emit(MODEL_EVENT_NAME, newValue);\n var $input = this.$refs.input;\n\n if ($input) {\n this.$emit(MODEL_EVENT_NAME_INDETERMINATE, $input.indeterminate);\n }\n }\n },\n handleChange: function handleChange(_ref) {\n var _this = this;\n\n var _ref$target = _ref.target,\n checked = _ref$target.checked,\n indeterminate = _ref$target.indeterminate;\n var value = this.value,\n uncheckedValue = this.uncheckedValue; // Update `computedLocalChecked`\n\n var localChecked = this.computedLocalChecked;\n\n if (isArray(localChecked)) {\n var index = looseIndexOf(localChecked, value);\n\n if (checked && index < 0) {\n // Add value to array\n localChecked = localChecked.concat(value);\n } else if (!checked && index > -1) {\n // Remove value from array\n localChecked = localChecked.slice(0, index).concat(localChecked.slice(index + 1));\n }\n } else {\n localChecked = checked ? value : uncheckedValue;\n }\n\n this.computedLocalChecked = localChecked; // Fire events in a `$nextTick()` to ensure the `v-model` is updated\n\n this.$nextTick(function () {\n // Change is only emitted on user interaction\n _this.$emit(EVENT_NAME_CHANGE, localChecked); // If this is a child of a group, we emit a change event on it as well\n\n\n if (_this.isGroup) {\n _this.bvGroup.$emit(EVENT_NAME_CHANGE, localChecked);\n }\n\n _this.$emit(MODEL_EVENT_NAME_INDETERMINATE, indeterminate);\n });\n },\n setIndeterminate: function setIndeterminate(state) {\n // Indeterminate only supported in single checkbox mode\n if (isArray(this.computedLocalChecked)) {\n state = false;\n }\n\n var $input = this.$refs.input;\n\n if ($input) {\n $input.indeterminate = state; // Emit update event to prop\n\n this.$emit(MODEL_EVENT_NAME_INDETERMINATE, state);\n }\n }\n }\n});","import { looseEqual } from './loose-equal'; // Assumes that the first argument is an array\n\nexport var looseIndexOf = function looseIndexOf(array, value) {\n for (var i = 0; i < array.length; i++) {\n if (looseEqual(array[i], value)) {\n return i;\n }\n }\n\n return -1;\n};","import GlDropdownItem from '../dropdown/dropdown_item';\nimport __vue_normalize__ from 'vue-runtime-helpers/dist/normalize-component.js';\n\nvar script = {\n name: 'GlFilteredSearchSuggestion',\n components: {\n GlDropdownItem\n },\n inject: ['filteredSearchSuggestionListInstance'],\n inheritAttrs: false,\n props: {\n /**\n * Value that will be emitted if this suggestion is selected.\n */\n value: {\n required: true,\n validator: () => true\n }\n },\n computed: {\n isActive() {\n return this.filteredSearchSuggestionListInstance.activeItem === this;\n }\n },\n watch: {\n isActive(newValue) {\n if (newValue) {\n window.requestAnimationFrame(() => {\n var _this$$refs$item, _this$$refs$item$$el;\n (_this$$refs$item = this.$refs.item) === null || _this$$refs$item === void 0 ? void 0 : (_this$$refs$item$$el = _this$$refs$item.$el) === null || _this$$refs$item$$el === void 0 ? void 0 : _this$$refs$item$$el.scrollIntoView({\n block: 'nearest',\n inline: 'end'\n });\n });\n }\n }\n },\n created() {\n this.filteredSearchSuggestionListInstance.register(this);\n },\n beforeDestroy() {\n this.filteredSearchSuggestionListInstance.unregister(this);\n },\n methods: {\n emitValue() {\n // We use href argument for gl-dropdown-item to use