\\n
\\n \";\n this.eventToRemovePlaceholder = InitializationEvents_1.InitializationEvents.afterComponentsInitialization;\n }\n InitializationPlaceholder.prototype.withEventToRemovePlaceholder = function (event) {\n this.eventToRemovePlaceholder = event;\n return this;\n };\n InitializationPlaceholder.prototype.withFullInitializationStyling = function () {\n var _this = this;\n Dom_1.$$(this.root).addClass(InitializationPlaceholder.INITIALIZATION_CLASS);\n Dom_1.$$(this.root).removeClass(InitializationPlaceholder.AFTER_INITIALIZATION_CLASS);\n Dom_1.$$(this.root).one(this.eventToRemovePlaceholder, function () {\n Dom_1.$$(_this.root).removeClass(InitializationPlaceholder.INITIALIZATION_CLASS);\n Dom_1.$$(_this.root).addClass(InitializationPlaceholder.AFTER_INITIALIZATION_CLASS);\n });\n return this;\n };\n InitializationPlaceholder.prototype.withHiddenRootElement = function () {\n Dom_1.$$(this.root).addClass('coveo-hidden');\n return this;\n };\n InitializationPlaceholder.prototype.withVisibleRootElement = function () {\n Dom_1.$$(this.root).removeClass('coveo-hidden');\n return this;\n };\n InitializationPlaceholder.prototype.withWaitingForFirstQueryMode = function () {\n var _this = this;\n Dom_1.$$(this.root).addClass('coveo-waiting-for-query');\n Dom_1.$$(this.root).one(QueryEvents_1.QueryEvents.duringQuery, function () {\n Dom_1.$$(_this.root).removeClass('coveo-waiting-for-query');\n });\n return this;\n };\n InitializationPlaceholder.prototype.withAllPlaceholders = function () {\n this.withPlaceholderForFacets();\n this.withPlaceholderForResultList();\n this.withPlaceholderSearchbox();\n return this;\n };\n InitializationPlaceholder.prototype.withPlaceholderForFacets = function () {\n // Render an arbitrary number of placeholder facet.\n // Facets should become usable on the first deferredQuerySuccess\n var _this = this;\n var facetElements = ComponentsTypes_1.ComponentsTypes.getAllFacetElementsFromElement(this.root);\n if (Utils_1.Utils.isNonEmptyArray(facetElements)) {\n var placeholders_1 = [];\n _.each(facetElements, function (facetElement) { return Dom_1.$$(facetElement).addClass(InitializationPlaceholder.INITIALIZATION_CLASS); });\n _.each(_.first(facetElements, InitializationPlaceholder.NUMBER_OF_FACETS), function (facetElement) {\n Dom_1.$$(facetElement).addClass('coveo-with-placeholder');\n var placeHolder = Dom_1.$$('div', { className: 'coveo-facet-placeholder' }, _this.facetPlaceholder);\n facetElement.appendChild(placeHolder.el);\n placeholders_1.push(placeHolder);\n });\n Dom_1.$$(this.root).one(this.eventToRemovePlaceholder, function () {\n var toExecuteAfterInitialization = function () {\n _.each(placeholders_1, function (placeholder) { return placeholder.remove(); });\n _.each(facetElements, function (facetElement) {\n return Dom_1.$$(facetElement).removeClass(InitializationPlaceholder.INITIALIZATION_CLASS);\n });\n _.each(facetElements, function (facetElement) { return Dom_1.$$(facetElement).removeClass('coveo-with-placeholder'); });\n };\n Dom_1.$$(_this.root).one(QueryEvents_1.QueryEvents.queryError, function () { return toExecuteAfterInitialization(); });\n Dom_1.$$(_this.root).one(QueryEvents_1.QueryEvents.deferredQuerySuccess, function () { return toExecuteAfterInitialization(); });\n });\n }\n return this;\n };\n InitializationPlaceholder.prototype.withPlaceholderSearchbox = function () {\n // Searchbox should be good/usable afterComponentsInitialization\n // Create a placeholder until we reach that event.\n var searchBoxElements = Dom_1.$$(this.root).findAll('.CoveoSearchbox');\n if (Utils_1.Utils.isNonEmptyArray(searchBoxElements)) {\n _.each(searchBoxElements, function (el) {\n Dom_1.$$(el).addClass(InitializationPlaceholder.INITIALIZATION_CLASS);\n });\n Dom_1.$$(this.root).one(this.eventToRemovePlaceholder, function () {\n _.each(searchBoxElements, function (el) { return Dom_1.$$(el).removeClass(InitializationPlaceholder.INITIALIZATION_CLASS); });\n });\n }\n return this;\n };\n InitializationPlaceholder.prototype.withPlaceholderForResultList = function () {\n // Render an arbitrary number of placeholder in the first result list we find\n // When we get the first newResultDisplayedEvent, the result list should be usable.\n var resultListsElements = Dom_1.$$(this.root).findAll('.CoveoResultList');\n if (Utils_1.Utils.isNonEmptyArray(resultListsElements)) {\n _.each(resultListsElements, function (el) { return Dom_1.$$(el).addClass(InitializationPlaceholder.INITIALIZATION_CLASS); });\n var _a = this.determineResultListPlaceholder(resultListsElements), placeholderToUse_1 = _a.placeholderToUse, resultListToUse_1 = _a.resultListToUse, rootToUse_1 = _a.rootToUse;\n Dom_1.$$(resultListToUse_1).append(rootToUse_1);\n Dom_1.$$(resultListToUse_1).addClass('coveo-with-placeholder');\n _.times(this.isRecommendationRoot()\n ? InitializationPlaceholder.NUMBER_OF_RESULTS_RECOMMENDATION\n : InitializationPlaceholder.NUMBER_OF_RESULTS, function () {\n rootToUse_1.innerHTML += placeholderToUse_1;\n });\n var reset_1 = function () {\n Dom_1.$$(rootToUse_1).remove();\n _.each(resultListsElements, function (el) { return Dom_1.$$(el).removeClass(InitializationPlaceholder.INITIALIZATION_CLASS); });\n Dom_1.$$(resultListToUse_1).removeClass('coveo-with-placeholder');\n };\n Dom_1.$$(this.root).one(ResultListEvents_1.ResultListEvents.newResultDisplayed, function () { return reset_1(); });\n Dom_1.$$(this.root).one(QueryEvents_1.QueryEvents.queryError, function () { return reset_1(); });\n Dom_1.$$(this.root).one(QueryEvents_1.QueryEvents.noResults, function () { return reset_1(); });\n }\n return this;\n };\n InitializationPlaceholder.prototype.determineResultListPlaceholder = function (resultListElements) {\n var currentLayout;\n if (resultListElements.length > 1) {\n currentLayout = HashUtils_1.HashUtils.getValue('layout', HashUtils_1.HashUtils.getHash());\n }\n else if (resultListElements.length == 1) {\n currentLayout = resultListElements[0].getAttribute('data-layout');\n }\n if (!currentLayout) {\n currentLayout = 'list';\n }\n if (resultListElements.length > 1) {\n var resultListElement = _.find(resultListElements, function (resultListElement) {\n return resultListElement.getAttribute('data-layout') == currentLayout;\n });\n if (!resultListElement) {\n // No data-layout default to list\n resultListElement = _.find(resultListElements, function (resultListElement) {\n return resultListElement.getAttribute('data-layout') == null;\n });\n }\n if (!resultListElement) {\n // Last fallback\n resultListElement = _.first(resultListElements);\n }\n return {\n placeholderToUse: this.determineResultListFromLayout(currentLayout),\n resultListToUse: resultListElement,\n rootToUse: this.determineRootFromLayout(currentLayout)\n };\n }\n else if (resultListElements.length == 1) {\n return {\n placeholderToUse: this.determineResultListFromLayout(currentLayout),\n resultListToUse: resultListElements[0],\n rootToUse: this.determineRootFromLayout(currentLayout)\n };\n }\n else {\n return null;\n }\n };\n InitializationPlaceholder.prototype.determineResultListFromLayout = function (layout) {\n switch (layout) {\n case 'list':\n if (this.isRecommendationRoot()) {\n return this.recommendationResultListPlaceholder;\n }\n else {\n return this.resultListPlaceholder;\n }\n case 'card':\n return this.cardResultListPlaceholder;\n default:\n return this.resultListPlaceholder;\n }\n };\n InitializationPlaceholder.prototype.determineRootFromLayout = function (layout) {\n switch (layout) {\n case 'list':\n return Dom_1.$$('div').el;\n case 'card':\n return Dom_1.$$('div', { className: 'coveo-result-list-container coveo-card-layout-container' }).el;\n default:\n return Dom_1.$$('div').el;\n }\n };\n InitializationPlaceholder.prototype.isRecommendationRoot = function () {\n return Dom_1.$$(this.root).hasClass('CoveoRecommendation');\n };\n InitializationPlaceholder.NUMBER_OF_FACETS = 3;\n InitializationPlaceholder.NUMBER_OF_RESULTS = 10;\n InitializationPlaceholder.NUMBER_OF_RESULTS_RECOMMENDATION = 5;\n InitializationPlaceholder.INITIALIZATION_CLASS = 'coveo-during-initialization';\n InitializationPlaceholder.AFTER_INITIALIZATION_CLASS = 'coveo-after-initialization';\n return InitializationPlaceholder;\n}());\nexports.InitializationPlaceholder = InitializationPlaceholder;\n\n\n/***/ }),\n/* 177 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Utils_1 = __webpack_require__(4);\nvar Strings_1 = __webpack_require__(6);\nvar _ = __webpack_require__(0);\nvar EmailUtils = /** @class */ (function () {\n function EmailUtils() {\n }\n EmailUtils.splitSemicolonSeparatedListOfEmailAddresses = function (addresses) {\n var addressesAsList = addresses.split(/\\s*;\\s*/);\n return _.filter(addressesAsList, function (s) {\n return Utils_1.Utils.exists(s) && Utils_1.Utils.isNonEmptyString(Utils_1.Utils.trim(s));\n });\n };\n EmailUtils.emailAddressesToHyperlinks = function (addresses, companyDomain, me, lengthLimit, truncateName) {\n if (lengthLimit === void 0) { lengthLimit = 2; }\n if (truncateName === void 0) { truncateName = false; }\n addresses = _.filter(addresses, function (s) {\n return Utils_1.Utils.exists(s) && Utils_1.Utils.isNonEmptyString(Utils_1.Utils.trim(s));\n });\n var hyperlinks = _.map(addresses, function (item) {\n var emailArray = EmailUtils.parseEmail(item);\n var email = emailArray[1];\n var name = emailArray[0];\n if (Utils_1.Utils.exists(me) && email == me) {\n name = Strings_1.l('Me');\n }\n if (truncateName) {\n var split = name.split(' ');\n if (!Utils_1.Utils.isNullOrUndefined(split[1])) {\n name = split[0] + ' ' + split[1].substring(0, 1) + '.';\n }\n }\n var domainIndex = email.indexOf('@') >= 0 ? email.indexOf('@') + 1 : 0;\n var domain = email.substr(domainIndex);\n if (Utils_1.Utils.exists(companyDomain) && domain != companyDomain) {\n name += ' (' + domain + ')';\n }\n return '
' + name + '';\n });\n var excess = hyperlinks.length - lengthLimit;\n var andOthers = excess > 0 ? EmailUtils.buildEmailAddressesAndOthers(_.last(hyperlinks, excess)) : '';\n return _.first(hyperlinks, lengthLimit).join(', ') + andOthers;\n };\n EmailUtils.buildEmailAddressesAndOthers = function (excessHyperLinks) {\n return ('
' +\n Strings_1.l('AndOthers', excessHyperLinks.length.toString(), excessHyperLinks.length) +\n '' +\n '
, ' +\n excessHyperLinks.join(' , ') +\n '');\n };\n EmailUtils.parseEmail = function (email) {\n var name;\n var match = email.match(/^\\s*(.*)\\s+<(.*)>$/);\n if (match != null) {\n name = match[1];\n if (/^'.*'|'.*'$/.test(name)) {\n name = name.substr(1, name.length - 2);\n }\n email = match[2];\n }\n else {\n name = email;\n email = email;\n }\n return [name, email];\n };\n return EmailUtils;\n}());\nexports.EmailUtils = EmailUtils;\n\n\n/***/ }),\n/* 178 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar _ = __webpack_require__(0);\nvar HTMLUtils = /** @class */ (function () {\n function HTMLUtils() {\n }\n HTMLUtils.buildAttributeString = function (options) {\n var ret = [];\n _.each(options, function (val, key, obj) {\n if (val != undefined) {\n ret.push(key + '=' + JSON.stringify(val.toString()));\n }\n });\n return ret.join(' ');\n };\n return HTMLUtils;\n}());\nexports.HTMLUtils = HTMLUtils;\nvar AnchorUtils = /** @class */ (function () {\n function AnchorUtils() {\n }\n AnchorUtils.buildAnchor = function (href, options) {\n var text;\n if (!options || !options.text) {\n text = href;\n }\n else {\n text = options.text;\n options.text = undefined;\n }\n return \"
\" + text + \"\";\n };\n return AnchorUtils;\n}());\nexports.AnchorUtils = AnchorUtils;\nvar ImageUtils = /** @class */ (function () {\n function ImageUtils() {\n }\n ImageUtils.buildImage = function (src, options) {\n var ret = '
![]()
';\n return ret;\n };\n ImageUtils.selectImageFromResult = function (result) {\n return document.querySelector(\"img[data-coveo-uri-hash=\" + result.raw['urihash'] + \"]\");\n };\n ImageUtils.buildImageWithDirectSrcAttribute = function (endpoint, result) {\n var image = new Image();\n var dataStreamUri = endpoint.getViewAsDatastreamUri(result.uniqueId, '$Thumbnail$', { contentType: 'image/png' });\n image.onload = function () {\n ImageUtils.selectImageFromResult(result).setAttribute('src', dataStreamUri);\n };\n image.src = dataStreamUri;\n };\n ImageUtils.buildImageWithBase64SrcAttribute = function (endpoint, result) {\n endpoint\n .getRawDataStream(result.uniqueId, '$Thumbnail$')\n .then(function (response) {\n var rawBinary = String.fromCharCode.apply(null, new Uint8Array(response));\n ImageUtils.selectImageFromResult(result).setAttribute('src', 'data:image/png;base64, ' + btoa(rawBinary));\n })\n .catch(function () {\n ImageUtils.selectImageFromResult(result).remove();\n });\n };\n ImageUtils.buildImageFromResult = function (result, endpoint, options) {\n options = options ? options : {};\n var img = ImageUtils.buildImage(undefined, _.extend(options, { 'data-coveo-uri-hash': result.raw['urihash'] }));\n if (endpoint.isJsonp()) {\n // For jsonp we can't GET/POST for binary data. We are limited to only setting the src attribute directly on the img.\n ImageUtils.buildImageWithDirectSrcAttribute(endpoint, result);\n }\n else {\n // Base 64 img allows us to GET/POST the image as raw binary, so that we can also pass the credential of the user\n // Useful for phonegap.\n ImageUtils.buildImageWithBase64SrcAttribute(endpoint, result);\n }\n return img;\n };\n return ImageUtils;\n}());\nexports.ImageUtils = ImageUtils;\n\n\n/***/ }),\n/* 179 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExternalModulesShim_1 = __webpack_require__(26);\nvar FocusTrap_1 = __webpack_require__(469);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar KeyboardUtils_1 = __webpack_require__(25);\nvar Core_1 = __webpack_require__(20);\nvar AccessibleModal = /** @class */ (function () {\n function AccessibleModal(className, ownerElement, modalboxModule, options) {\n if (modalboxModule === void 0) { modalboxModule = ExternalModulesShim_1.ModalBox; }\n if (options === void 0) { options = {}; }\n this.className = className;\n this.ownerElement = ownerElement;\n this.modalboxModule = modalboxModule;\n this.options = __assign({\n sizeMod: 'big'\n }, options);\n }\n Object.defineProperty(AccessibleModal.prototype, \"isOpen\", {\n get: function () {\n return !!this.focusTrap;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AccessibleModal.prototype, \"element\", {\n get: function () {\n return this.activeModal && this.activeModal.modalBox;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AccessibleModal.prototype, \"content\", {\n get: function () {\n return this.activeModal && this.activeModal.content;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AccessibleModal.prototype, \"wrapper\", {\n get: function () {\n return this.activeModal && this.activeModal.wrapper;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(AccessibleModal.prototype, \"headerElement\", {\n get: function () {\n return this.element && this.element.querySelector('.coveo-modal-header h1');\n },\n enumerable: true,\n configurable: true\n });\n AccessibleModal.prototype.openResult = function (parameters) {\n if (this.isOpen) {\n return;\n }\n this.openModalAndTrap({\n content: parameters.content,\n validation: parameters.validation,\n origin: parameters.origin,\n title: Core_1.DomUtils.getQuickviewHeader(parameters.result, parameters.options, parameters.bindings).el\n });\n this.makeAccessible(parameters.options.title || parameters.result.title);\n };\n AccessibleModal.prototype.open = function (parameters) {\n if (this.isOpen) {\n return;\n }\n this.openModalAndTrap(parameters);\n this.makeAccessible();\n };\n AccessibleModal.prototype.openModalAndTrap = function (parameters) {\n var _this = this;\n this.initiallyFocusedElement = parameters.origin || document.activeElement;\n this.activeModal = this.modalboxModule.open(parameters.content, {\n title: parameters.title,\n className: this.className,\n validation: function () {\n _this.onModalClose();\n return parameters.validation();\n },\n body: this.ownerElement,\n sizeMod: this.options.sizeMod,\n overlayClose: this.options.overlayClose\n });\n this.focusTrap = new FocusTrap_1.FocusTrap(this.element);\n };\n AccessibleModal.prototype.close = function () {\n if (!this.isOpen) {\n return;\n }\n this.activeModal.close();\n this.activeModal = null;\n };\n AccessibleModal.prototype.makeAccessible = function (title) {\n this.element.setAttribute('aria-modal', 'true');\n if (title) {\n this.headerElement.setAttribute('aria-label', title);\n }\n this.makeCloseButtonAccessible();\n this.updateFocus();\n };\n Object.defineProperty(AccessibleModal.prototype, \"closeButton\", {\n get: function () {\n return this.element.querySelector('.coveo-small-close');\n },\n enumerable: true,\n configurable: true\n });\n AccessibleModal.prototype.makeCloseButtonAccessible = function () {\n var closeButton = this.closeButton;\n closeButton.setAttribute('aria-label', Strings_1.l('Close'));\n closeButton.setAttribute('role', 'button');\n closeButton.tabIndex = 0;\n Dom_1.$$(closeButton).on('keyup', KeyboardUtils_1.KeyboardUtils.keypressAction(KeyboardUtils_1.KEYBOARD.ENTER, function () { return closeButton.click(); }));\n };\n AccessibleModal.prototype.updateFocus = function () {\n var focusOnElement = (this.options.focusOnOpen && this.options.focusOnOpen()) || this.closeButton;\n focusOnElement.focus();\n };\n AccessibleModal.prototype.onModalClose = function () {\n this.focusTrap.disable();\n this.focusTrap = null;\n if (this.initiallyFocusedElement && document.body.contains(this.initiallyFocusedElement)) {\n this.initiallyFocusedElement.focus();\n }\n };\n return AccessibleModal;\n}());\nexports.AccessibleModal = AccessibleModal;\n\n\n/***/ }),\n/* 180 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar OS_NAME;\n(function (OS_NAME) {\n OS_NAME[OS_NAME[\"WINDOWS\"] = 0] = \"WINDOWS\";\n OS_NAME[OS_NAME[\"MACOSX\"] = 1] = \"MACOSX\";\n OS_NAME[OS_NAME[\"UNIX\"] = 2] = \"UNIX\";\n OS_NAME[OS_NAME[\"LINUX\"] = 3] = \"LINUX\";\n OS_NAME[OS_NAME[\"UNKNOWN\"] = 4] = \"UNKNOWN\";\n})(OS_NAME = exports.OS_NAME || (exports.OS_NAME = {}));\nvar OSUtils = /** @class */ (function () {\n function OSUtils() {\n }\n OSUtils.get = function (nav) {\n if (nav === void 0) { nav = navigator; }\n var osName;\n if (nav.appVersion.indexOf('Win') != -1) {\n osName = OS_NAME.WINDOWS;\n }\n else if (nav.appVersion.indexOf('Mac') != -1) {\n osName = OS_NAME.MACOSX;\n }\n else if (nav.appVersion.indexOf('X11') != -1) {\n osName = OS_NAME.UNIX;\n }\n else if (nav.appVersion.indexOf('Linux') != -1) {\n osName = OS_NAME.LINUX;\n }\n else {\n osName = OS_NAME.UNKNOWN;\n }\n return osName;\n };\n return OSUtils;\n}());\nexports.OSUtils = OSUtils;\n\n\n/***/ }),\n/* 181 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Utils_1 = __webpack_require__(4);\nvar DynamicFacetRequestBuilder = /** @class */ (function () {\n function DynamicFacetRequestBuilder(request) {\n this.request = request;\n }\n DynamicFacetRequestBuilder.prototype.buildBaseRequestForQuery = function () {\n return __assign({}, this.request, { filterFacetCount: determineFilterFacetCount(this.request) });\n };\n return DynamicFacetRequestBuilder;\n}());\nexports.DynamicFacetRequestBuilder = DynamicFacetRequestBuilder;\nfunction determineFilterFacetCount(options) {\n var filterFacetCount = options.filterFacetCount;\n return Utils_1.Utils.isUndefined(filterFacetCount) ? true : filterFacetCount;\n}\nexports.determineFilterFacetCount = determineFilterFacetCount;\n\n\n/***/ }),\n/* 182 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(567);\nvar Dom_1 = __webpack_require__(1);\nvar Strings_1 = __webpack_require__(6);\nvar SVGIcons_1 = __webpack_require__(12);\nvar SVGDom_1 = __webpack_require__(16);\nvar DynamicFacetHeaderButton_1 = __webpack_require__(504);\nvar DynamicFacetHeaderCollapseToggle_1 = __webpack_require__(568);\nvar AccessibilityUtils_1 = __webpack_require__(48);\nfunction getDynamicFacetHeaderId(facetId) {\n return facetId + \"-facet-heading\";\n}\nexports.getDynamicFacetHeaderId = getDynamicFacetHeaderId;\nvar DynamicFacetHeader = /** @class */ (function () {\n function DynamicFacetHeader(options) {\n this.options = options;\n this.element = Dom_1.$$('div', { className: 'coveo-dynamic-facet-header' }).el;\n this.title = this.createTitle();\n Dom_1.$$(this.element).append(this.title.el);\n Dom_1.$$(this.element).append(this.createWaitAnimation());\n Dom_1.$$(this.element).append(this.createClearButton());\n this.options.enableCollapse && this.enableCollapse();\n }\n DynamicFacetHeader.prototype.createClearButton = function () {\n var _this = this;\n this.clearButton = new DynamicFacetHeaderButton_1.DynamicFacetHeaderButton({\n label: Strings_1.l('Clear'),\n ariaLabel: Strings_1.l('Clear', this.options.title),\n className: 'coveo-dynamic-facet-header-clear',\n shouldDisplay: false,\n action: function () { return _this.options.clear(); }\n });\n return this.clearButton.element;\n };\n DynamicFacetHeader.prototype.createCollapseToggle = function () {\n this.collapseToggle = new DynamicFacetHeaderCollapseToggle_1.DynamicFacetHeaderCollapseToggle(this.options);\n return this.collapseToggle.element;\n };\n DynamicFacetHeader.prototype.enableCollapse = function () {\n var _this = this;\n Dom_1.$$(this.element).append(this.createCollapseToggle());\n Dom_1.$$(this.title).addClass('coveo-clickable');\n Dom_1.$$(this.title).on('click', function () { return _this.options.toggleCollapse(); });\n };\n DynamicFacetHeader.prototype.toggleCollapse = function (isCollapsed) {\n this.options.enableCollapse && this.collapseToggle.toggleButton(isCollapsed);\n };\n DynamicFacetHeader.prototype.createTitle = function () {\n return Dom_1.$$(AccessibilityUtils_1.getHeadingTag(this.options.headingLevel), {\n className: 'coveo-dynamic-facet-header-title',\n ariaLabel: \"\" + Strings_1.l('FacetTitle', this.options.title),\n id: getDynamicFacetHeaderId(this.options.id)\n }, Dom_1.$$('span', { ariaHidden: true, title: this.options.title }, this.options.title));\n };\n DynamicFacetHeader.prototype.createWaitAnimation = function () {\n this.waitAnimation = Dom_1.$$('div', { className: 'coveo-dynamic-facet-header-wait-animation' }, SVGIcons_1.SVGIcons.icons.loading);\n SVGDom_1.SVGDom.addClassToSVGInContainer(this.waitAnimation.el, 'coveo-dynamic-facet-header-wait-animation-svg');\n this.waitAnimation.toggle(false);\n return this.waitAnimation.el;\n };\n DynamicFacetHeader.prototype.toggleClear = function (visible) {\n this.clearButton.toggle(visible);\n };\n DynamicFacetHeader.prototype.showLoading = function () {\n var _this = this;\n clearTimeout(this.showLoadingTimeout);\n this.showLoadingTimeout = window.setTimeout(function () { return _this.waitAnimation.toggle(true); }, DynamicFacetHeader.showLoadingDelay);\n };\n DynamicFacetHeader.prototype.hideLoading = function () {\n clearTimeout(this.showLoadingTimeout);\n this.waitAnimation.toggle(false);\n };\n DynamicFacetHeader.showLoadingDelay = 2000;\n return DynamicFacetHeader;\n}());\nexports.DynamicFacetHeader = DynamicFacetHeader;\n\n\n/***/ }),\n/* 183 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * The allowed values for the [`facetType`]{@link IFacetRequest.facetType} property of a [facet request]{@link IFacetRequest}.\n */\nvar FacetType;\n(function (FacetType) {\n /**\n * Request facet values representing specific values.\n */\n FacetType[\"specific\"] = \"specific\";\n /**\n * Request facet values representing ranges of numbers.\n */\n FacetType[\"numericalRange\"] = \"numericalRange\";\n /**\n * Request facet values representing ranges of dates.\n */\n FacetType[\"dateRange\"] = \"dateRange\";\n /**\n * Request facet values representing a hierarchy.\n */\n FacetType[\"hierarchical\"] = \"hierarchical\";\n})(FacetType = exports.FacetType || (exports.FacetType = {}));\n\n\n/***/ }),\n/* 184 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar _ = __webpack_require__(0);\nvar ExpressionBuilder_1 = __webpack_require__(74);\nvar Utils_1 = __webpack_require__(4);\nvar QueryBuilderExpression = /** @class */ (function () {\n function QueryBuilderExpression(basicExpression, advancedExpression, constantExpression, disjunctionExpression) {\n this.basicExpression = basicExpression;\n this.advancedExpression = advancedExpression;\n this.constantExpression = constantExpression;\n this.disjunctionExpression = disjunctionExpression;\n }\n QueryBuilderExpression.isEmpty = function (queryBuilderExpression) {\n var allNonEmptyValues = _.chain(queryBuilderExpression)\n .values()\n .compact()\n .value();\n return _.isEmpty(allNonEmptyValues);\n };\n QueryBuilderExpression.prototype.reset = function () {\n this.basicExpression = '';\n this.advancedExpression = '';\n this.constantExpression = '';\n this.disjunctionExpression = '';\n };\n Object.defineProperty(QueryBuilderExpression.prototype, \"withoutConstant\", {\n get: function () {\n return this.expressionBuilders.withoutConstantExpression.build();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryBuilderExpression.prototype, \"full\", {\n get: function () {\n return ExpressionBuilder_1.ExpressionBuilder.mergeUsingOr(this.expressionBuilders.fullExpression, this.expressionBuilders.disjunctionExpression).build();\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryBuilderExpression.prototype, \"basic\", {\n get: function () {\n return this.expressionBuilders.basicExpression.build();\n },\n set: function (value) {\n this.basicExpression = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryBuilderExpression.prototype, \"advanced\", {\n get: function () {\n return this.expressionBuilders.advancedExpression.build();\n },\n set: function (value) {\n this.advancedExpression = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryBuilderExpression.prototype, \"constant\", {\n get: function () {\n return this.expressionBuilders.constantExpression.build();\n },\n set: function (value) {\n this.constantExpression = value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(QueryBuilderExpression.prototype, \"expressionBuilders\", {\n get: function () {\n var addIfNotEmpty = function (expression, value) {\n if (Utils_1.Utils.isNonEmptyString(value)) {\n expression.add(value);\n }\n };\n var basicExpression = new ExpressionBuilder_1.ExpressionBuilder();\n addIfNotEmpty(basicExpression, this.basicExpression);\n var advancedExpression = new ExpressionBuilder_1.ExpressionBuilder();\n addIfNotEmpty(advancedExpression, this.advancedExpression);\n var constantExpression = new ExpressionBuilder_1.ExpressionBuilder();\n addIfNotEmpty(constantExpression, this.constantExpression);\n var disjunctionExpression = new ExpressionBuilder_1.ExpressionBuilder();\n addIfNotEmpty(disjunctionExpression, this.disjunctionExpression);\n var withoutConstantExpression = ExpressionBuilder_1.ExpressionBuilder.merge(basicExpression, advancedExpression);\n var fullExpression = ExpressionBuilder_1.ExpressionBuilder.merge(basicExpression, advancedExpression, constantExpression);\n return {\n basicExpression: basicExpression,\n advancedExpression: advancedExpression,\n constantExpression: constantExpression,\n disjunctionExpression: disjunctionExpression,\n withoutConstantExpression: withoutConstantExpression,\n fullExpression: fullExpression\n };\n },\n enumerable: true,\n configurable: true\n });\n return QueryBuilderExpression;\n}());\nexports.QueryBuilderExpression = QueryBuilderExpression;\n\n\n/***/ }),\n/* 185 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar TextInput_1 = __webpack_require__(57);\nvar AdvancedSearchEvents_1 = __webpack_require__(88);\nvar Dom_1 = __webpack_require__(1);\nvar KeywordsInput = /** @class */ (function () {\n function KeywordsInput(inputName, root) {\n this.inputName = inputName;\n this.root = root;\n }\n KeywordsInput.prototype.reset = function () {\n this.clear();\n };\n KeywordsInput.prototype.build = function () {\n this.input = new TextInput_1.TextInput(this.onChange.bind(this), this.inputName);\n return this.input.getElement();\n };\n KeywordsInput.prototype.setValue = function (value) {\n this.input.setValue(value);\n };\n KeywordsInput.prototype.getValue = function () {\n return this.input.getValue();\n };\n KeywordsInput.prototype.clear = function () {\n this.input.setValue('');\n };\n KeywordsInput.prototype.updateQuery = function (queryBuilder) {\n var value = this.getValue();\n if (value) {\n queryBuilder.advancedExpression.add(value);\n }\n };\n KeywordsInput.prototype.onChange = function () {\n if (this.root) {\n Dom_1.$$(this.root).trigger(AdvancedSearchEvents_1.AdvancedSearchEvents.executeAdvancedSearch);\n }\n else if (this.input) {\n Dom_1.$$(this.input.getElement()).trigger(AdvancedSearchEvents_1.AdvancedSearchEvents.executeAdvancedSearch);\n }\n };\n return KeywordsInput;\n}());\nexports.KeywordsInput = KeywordsInput;\n\n\n/***/ }),\n/* 186 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/map.js\nvar prefix = \"$\";\n\nfunction Map() {}\n\nMap.prototype = map.prototype = {\n constructor: Map,\n has: function(key) {\n return (prefix + key) in this;\n },\n get: function(key) {\n return this[prefix + key];\n },\n set: function(key, value) {\n this[prefix + key] = value;\n return this;\n },\n remove: function(key) {\n var property = prefix + key;\n return property in this && delete this[property];\n },\n clear: function() {\n for (var property in this) if (property[0] === prefix) delete this[property];\n },\n keys: function() {\n var keys = [];\n for (var property in this) if (property[0] === prefix) keys.push(property.slice(1));\n return keys;\n },\n values: function() {\n var values = [];\n for (var property in this) if (property[0] === prefix) values.push(this[property]);\n return values;\n },\n entries: function() {\n var entries = [];\n for (var property in this) if (property[0] === prefix) entries.push({key: property.slice(1), value: this[property]});\n return entries;\n },\n size: function() {\n var size = 0;\n for (var property in this) if (property[0] === prefix) ++size;\n return size;\n },\n empty: function() {\n for (var property in this) if (property[0] === prefix) return false;\n return true;\n },\n each: function(f) {\n for (var property in this) if (property[0] === prefix) f(this[property], property.slice(1), this);\n }\n};\n\nfunction map(object, f) {\n var map = new Map;\n\n // Copy constructor.\n if (object instanceof Map) object.each(function(value, key) { map.set(key, value); });\n\n // Index array by numeric index or specified key function.\n else if (Array.isArray(object)) {\n var i = -1,\n n = object.length,\n o;\n\n if (f == null) while (++i < n) map.set(i, object[i]);\n else while (++i < n) map.set(f(o = object[i], i, object), o);\n }\n\n // Convert object to map.\n else if (object) for (var key in object) map.set(key, object[key]);\n\n return map;\n}\n\n/* harmony default export */ var src_map = (map);\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/nest.js\n\n\n/* harmony default export */ var src_nest = (function() {\n var keys = [],\n sortKeys = [],\n sortValues,\n rollup,\n nest;\n\n function apply(array, depth, createResult, setResult) {\n if (depth >= keys.length) {\n if (sortValues != null) array.sort(sortValues);\n return rollup != null ? rollup(array) : array;\n }\n\n var i = -1,\n n = array.length,\n key = keys[depth++],\n keyValue,\n value,\n valuesByKey = src_map(),\n values,\n result = createResult();\n\n while (++i < n) {\n if (values = valuesByKey.get(keyValue = key(value = array[i]) + \"\")) {\n values.push(value);\n } else {\n valuesByKey.set(keyValue, [value]);\n }\n }\n\n valuesByKey.each(function(values, key) {\n setResult(result, key, apply(values, depth, createResult, setResult));\n });\n\n return result;\n }\n\n function entries(map, depth) {\n if (++depth > keys.length) return map;\n var array, sortKey = sortKeys[depth - 1];\n if (rollup != null && depth >= keys.length) array = map.entries();\n else array = [], map.each(function(v, k) { array.push({key: k, values: entries(v, depth)}); });\n return sortKey != null ? array.sort(function(a, b) { return sortKey(a.key, b.key); }) : array;\n }\n\n return nest = {\n object: function(array) { return apply(array, 0, createObject, setObject); },\n map: function(array) { return apply(array, 0, createMap, setMap); },\n entries: function(array) { return entries(apply(array, 0, createMap, setMap), 0); },\n key: function(d) { keys.push(d); return nest; },\n sortKeys: function(order) { sortKeys[keys.length - 1] = order; return nest; },\n sortValues: function(order) { sortValues = order; return nest; },\n rollup: function(f) { rollup = f; return nest; }\n };\n});\n\nfunction createObject() {\n return {};\n}\n\nfunction setObject(object, key, value) {\n object[key] = value;\n}\n\nfunction createMap() {\n return src_map();\n}\n\nfunction setMap(map, key, value) {\n map.set(key, value);\n}\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/set.js\n\n\nfunction Set() {}\n\nvar proto = src_map.prototype;\n\nSet.prototype = set.prototype = {\n constructor: Set,\n has: proto.has,\n add: function(value) {\n value += \"\";\n this[prefix + value] = value;\n return this;\n },\n remove: proto.remove,\n clear: proto.clear,\n values: proto.keys,\n size: proto.size,\n empty: proto.empty,\n each: proto.each\n};\n\nfunction set(object, f) {\n var set = new Set;\n\n // Copy constructor.\n if (object instanceof Set) object.each(function(value) { set.add(value); });\n\n // Otherwise, assume it’s an array.\n else if (object) {\n var i = -1, n = object.length;\n if (f == null) while (++i < n) set.add(object[i]);\n else while (++i < n) set.add(f(object[i], i, object));\n }\n\n return set;\n}\n\n/* harmony default export */ var src_set = (set);\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/keys.js\n/* harmony default export */ var src_keys = (function(map) {\n var keys = [];\n for (var key in map) keys.push(key);\n return keys;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/values.js\n/* harmony default export */ var src_values = (function(map) {\n var values = [];\n for (var key in map) values.push(map[key]);\n return values;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/entries.js\n/* harmony default export */ var src_entries = (function(map) {\n var entries = [];\n for (var key in map) entries.push({key: key, value: map[key]});\n return entries;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-collection/src/index.js\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"d\", function() { return src_nest; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"e\", function() { return src_set; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"c\", function() { return src_map; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"b\", function() { return src_keys; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"f\", function() { return src_values; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"a\", function() { return src_entries; });\n\n\n\n\n\n\n\n\n/***/ }),\n/* 187 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/interval.js\nvar t0 = new Date,\n t1 = new Date;\n\nfunction newInterval(floori, offseti, count, field) {\n\n function interval(date) {\n return floori(date = arguments.length === 0 ? new Date : new Date(+date)), date;\n }\n\n interval.floor = function(date) {\n return floori(date = new Date(+date)), date;\n };\n\n interval.ceil = function(date) {\n return floori(date = new Date(date - 1)), offseti(date, 1), floori(date), date;\n };\n\n interval.round = function(date) {\n var d0 = interval(date),\n d1 = interval.ceil(date);\n return date - d0 < d1 - date ? d0 : d1;\n };\n\n interval.offset = function(date, step) {\n return offseti(date = new Date(+date), step == null ? 1 : Math.floor(step)), date;\n };\n\n interval.range = function(start, stop, step) {\n var range = [], previous;\n start = interval.ceil(start);\n step = step == null ? 1 : Math.floor(step);\n if (!(start < stop) || !(step > 0)) return range; // also handles Invalid Date\n do range.push(previous = new Date(+start)), offseti(start, step), floori(start);\n while (previous < start && start < stop);\n return range;\n };\n\n interval.filter = function(test) {\n return newInterval(function(date) {\n if (date >= date) while (floori(date), !test(date)) date.setTime(date - 1);\n }, function(date, step) {\n if (date >= date) {\n if (step < 0) while (++step <= 0) {\n while (offseti(date, -1), !test(date)) {} // eslint-disable-line no-empty\n } else while (--step >= 0) {\n while (offseti(date, +1), !test(date)) {} // eslint-disable-line no-empty\n }\n }\n });\n };\n\n if (count) {\n interval.count = function(start, end) {\n t0.setTime(+start), t1.setTime(+end);\n floori(t0), floori(t1);\n return Math.floor(count(t0, t1));\n };\n\n interval.every = function(step) {\n step = Math.floor(step);\n return !isFinite(step) || !(step > 0) ? null\n : !(step > 1) ? interval\n : interval.filter(field\n ? function(d) { return field(d) % step === 0; }\n : function(d) { return interval.count(0, d) % step === 0; });\n };\n }\n\n return interval;\n}\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/millisecond.js\n\n\nvar millisecond = newInterval(function() {\n // noop\n}, function(date, step) {\n date.setTime(+date + step);\n}, function(start, end) {\n return end - start;\n});\n\n// An optimized implementation for this simple case.\nmillisecond.every = function(k) {\n k = Math.floor(k);\n if (!isFinite(k) || !(k > 0)) return null;\n if (!(k > 1)) return millisecond;\n return newInterval(function(date) {\n date.setTime(Math.floor(date / k) * k);\n }, function(date, step) {\n date.setTime(+date + step * k);\n }, function(start, end) {\n return (end - start) / k;\n });\n};\n\n/* harmony default export */ var src_millisecond = (millisecond);\nvar milliseconds = millisecond.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/duration.js\nvar durationSecond = 1e3;\nvar durationMinute = 6e4;\nvar durationHour = 36e5;\nvar durationDay = 864e5;\nvar durationWeek = 6048e5;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/second.js\n\n\n\nvar second = newInterval(function(date) {\n date.setTime(date - date.getMilliseconds());\n}, function(date, step) {\n date.setTime(+date + step * durationSecond);\n}, function(start, end) {\n return (end - start) / durationSecond;\n}, function(date) {\n return date.getUTCSeconds();\n});\n\n/* harmony default export */ var src_second = (second);\nvar seconds = second.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/minute.js\n\n\n\nvar minute = newInterval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getMinutes();\n});\n\n/* harmony default export */ var src_minute = (minute);\nvar minutes = minute.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/hour.js\n\n\n\nvar hour = newInterval(function(date) {\n date.setTime(date - date.getMilliseconds() - date.getSeconds() * durationSecond - date.getMinutes() * durationMinute);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getHours();\n});\n\n/* harmony default export */ var src_hour = (hour);\nvar hours = hour.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/day.js\n\n\n\nvar day = newInterval(function(date) {\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setDate(date.getDate() + step);\n}, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationDay;\n}, function(date) {\n return date.getDate() - 1;\n});\n\n/* harmony default export */ var src_day = (day);\nvar days = day.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/week.js\n\n\n\nfunction weekday(i) {\n return newInterval(function(date) {\n date.setDate(date.getDate() - (date.getDay() + 7 - i) % 7);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setDate(date.getDate() + step * 7);\n }, function(start, end) {\n return (end - start - (end.getTimezoneOffset() - start.getTimezoneOffset()) * durationMinute) / durationWeek;\n });\n}\n\nvar sunday = weekday(0);\nvar monday = weekday(1);\nvar tuesday = weekday(2);\nvar wednesday = weekday(3);\nvar thursday = weekday(4);\nvar friday = weekday(5);\nvar saturday = weekday(6);\n\nvar sundays = sunday.range;\nvar mondays = monday.range;\nvar tuesdays = tuesday.range;\nvar wednesdays = wednesday.range;\nvar thursdays = thursday.range;\nvar fridays = friday.range;\nvar saturdays = saturday.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/month.js\n\n\nvar month = newInterval(function(date) {\n date.setDate(1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setMonth(date.getMonth() + step);\n}, function(start, end) {\n return end.getMonth() - start.getMonth() + (end.getFullYear() - start.getFullYear()) * 12;\n}, function(date) {\n return date.getMonth();\n});\n\n/* harmony default export */ var src_month = (month);\nvar months = month.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/year.js\n\n\nvar year = newInterval(function(date) {\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setFullYear(date.getFullYear() + step);\n}, function(start, end) {\n return end.getFullYear() - start.getFullYear();\n}, function(date) {\n return date.getFullYear();\n});\n\n// An optimized implementation for this simple case.\nyear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {\n date.setFullYear(Math.floor(date.getFullYear() / k) * k);\n date.setMonth(0, 1);\n date.setHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setFullYear(date.getFullYear() + step * k);\n });\n};\n\n/* harmony default export */ var src_year = (year);\nvar years = year.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/utcMinute.js\n\n\n\nvar utcMinute = newInterval(function(date) {\n date.setUTCSeconds(0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationMinute);\n}, function(start, end) {\n return (end - start) / durationMinute;\n}, function(date) {\n return date.getUTCMinutes();\n});\n\n/* harmony default export */ var src_utcMinute = (utcMinute);\nvar utcMinutes = utcMinute.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/utcHour.js\n\n\n\nvar utcHour = newInterval(function(date) {\n date.setUTCMinutes(0, 0, 0);\n}, function(date, step) {\n date.setTime(+date + step * durationHour);\n}, function(start, end) {\n return (end - start) / durationHour;\n}, function(date) {\n return date.getUTCHours();\n});\n\n/* harmony default export */ var src_utcHour = (utcHour);\nvar utcHours = utcHour.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/utcDay.js\n\n\n\nvar utcDay = newInterval(function(date) {\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step);\n}, function(start, end) {\n return (end - start) / durationDay;\n}, function(date) {\n return date.getUTCDate() - 1;\n});\n\n/* harmony default export */ var src_utcDay = (utcDay);\nvar utcDays = utcDay.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/utcWeek.js\n\n\n\nfunction utcWeekday(i) {\n return newInterval(function(date) {\n date.setUTCDate(date.getUTCDate() - (date.getUTCDay() + 7 - i) % 7);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCDate(date.getUTCDate() + step * 7);\n }, function(start, end) {\n return (end - start) / durationWeek;\n });\n}\n\nvar utcSunday = utcWeekday(0);\nvar utcMonday = utcWeekday(1);\nvar utcTuesday = utcWeekday(2);\nvar utcWednesday = utcWeekday(3);\nvar utcThursday = utcWeekday(4);\nvar utcFriday = utcWeekday(5);\nvar utcSaturday = utcWeekday(6);\n\nvar utcSundays = utcSunday.range;\nvar utcMondays = utcMonday.range;\nvar utcTuesdays = utcTuesday.range;\nvar utcWednesdays = utcWednesday.range;\nvar utcThursdays = utcThursday.range;\nvar utcFridays = utcFriday.range;\nvar utcSaturdays = utcSaturday.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/utcMonth.js\n\n\nvar utcMonth = newInterval(function(date) {\n date.setUTCDate(1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCMonth(date.getUTCMonth() + step);\n}, function(start, end) {\n return end.getUTCMonth() - start.getUTCMonth() + (end.getUTCFullYear() - start.getUTCFullYear()) * 12;\n}, function(date) {\n return date.getUTCMonth();\n});\n\n/* harmony default export */ var src_utcMonth = (utcMonth);\nvar utcMonths = utcMonth.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/utcYear.js\n\n\nvar utcYear = newInterval(function(date) {\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n}, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step);\n}, function(start, end) {\n return end.getUTCFullYear() - start.getUTCFullYear();\n}, function(date) {\n return date.getUTCFullYear();\n});\n\n// An optimized implementation for this simple case.\nutcYear.every = function(k) {\n return !isFinite(k = Math.floor(k)) || !(k > 0) ? null : newInterval(function(date) {\n date.setUTCFullYear(Math.floor(date.getUTCFullYear() / k) * k);\n date.setUTCMonth(0, 1);\n date.setUTCHours(0, 0, 0, 0);\n }, function(date, step) {\n date.setUTCFullYear(date.getUTCFullYear() + step * k);\n });\n};\n\n/* harmony default export */ var src_utcYear = (utcYear);\nvar utcYears = utcYear.range;\n\n// CONCATENATED MODULE: ./node_modules/d3-time/src/index.js\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"g\", function() { return newInterval; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"h\", function() { return src_millisecond; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"i\", function() { return milliseconds; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"L\", function() { return src_millisecond; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"M\", function() { return milliseconds; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"r\", function() { return src_second; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"s\", function() { return seconds; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"V\", function() { return src_second; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"W\", function() { return seconds; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"j\", function() { return src_minute; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"k\", function() { return minutes; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"e\", function() { return src_hour; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"f\", function() { return hours; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"a\", function() { return src_day; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"b\", function() { return days; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"B\", function() { return sunday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"C\", function() { return sundays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"t\", function() { return sunday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"u\", function() { return sundays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"l\", function() { return monday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"m\", function() { return mondays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"x\", function() { return tuesday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"y\", function() { return tuesdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"z\", function() { return wednesday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"A\", function() { return wednesdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"v\", function() { return thursday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"w\", function() { return thursdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"c\", function() { return friday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"d\", function() { return fridays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"p\", function() { return saturday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"q\", function() { return saturdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"n\", function() { return src_month; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"o\", function() { return months; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"D\", function() { return src_year; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"E\", function() { return years; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"N\", function() { return src_utcMinute; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"O\", function() { return utcMinutes; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"J\", function() { return src_utcHour; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"K\", function() { return utcHours; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"F\", function() { return src_utcDay; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"G\", function() { return utcDays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_5\", function() { return utcSunday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_6\", function() { return utcSundays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"X\", function() { return utcSunday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Y\", function() { return utcSundays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"P\", function() { return utcMonday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Q\", function() { return utcMondays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_1\", function() { return utcTuesday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_2\", function() { return utcTuesdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_3\", function() { return utcWednesday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_4\", function() { return utcWednesdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"Z\", function() { return utcThursday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_0\", function() { return utcThursdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"H\", function() { return utcFriday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"I\", function() { return utcFridays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"T\", function() { return utcSaturday; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"U\", function() { return utcSaturdays; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"R\", function() { return src_utcMonth; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"S\", function() { return utcMonths; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_7\", function() { return src_utcYear; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"_8\", function() { return utcYears; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/***/ }),\n/* 188 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExternalModulesShim_1 = __webpack_require__(26);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Dom_1 = __webpack_require__(1);\nvar SVGDom_1 = __webpack_require__(16);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Utils_1 = __webpack_require__(4);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar RegisteredNamedMethods_1 = __webpack_require__(30);\nvar ResultLink_1 = __webpack_require__(70);\nvar AccessibleModal_1 = __webpack_require__(179);\n/**\n * The YouTubeThumbnail component automatically fetches the thumbnail of a YouTube video.\n *\n * This component differs from the standard {@link Thumbnail} component because the thumbnail it outputs is always\n * clickable.\n *\n * Depending on the component configuration, clicking a YouTube thumbnail can either automatically open a modal box\n * containing the `iframe` from YouTube, or open the target URL in the current window (see\n * {@link YouTubeThumbnail.options.embed}).\n *\n * This component is a result template component (see [Result Templates](https://docs.coveo.com/en/413/)).\n */\nvar YouTubeThumbnail = /** @class */ (function (_super) {\n __extends(YouTubeThumbnail, _super);\n function YouTubeThumbnail(element, options, bindings, result, ModalBox, origin) {\n if (ModalBox === void 0) { ModalBox = ExternalModulesShim_1.ModalBox; }\n var _this = _super.call(this, element, YouTubeThumbnail.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.bindings = bindings;\n _this.result = result;\n _this.origin = origin;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, YouTubeThumbnail, options);\n _this.resultLink = Dom_1.$$('a', {\n className: Component_1.Component.computeCssClassName(ResultLink_1.ResultLink)\n });\n if (!origin) {\n _this.origin = _this.resultLink.el;\n }\n var thumbnailDiv = Dom_1.$$('div', {\n className: 'coveo-youtube-thumbnail-container'\n });\n _this.resultLink.append(thumbnailDiv.el);\n var img = Dom_1.$$('img', {\n src: Utils_1.Utils.getFieldValue(_this.result, 'ytthumbnailurl'),\n className: 'coveo-youtube-thumbnail-img',\n alt: _this.result.title,\n title: _this.result.title\n });\n img.el.style.width = _this.options.width;\n img.el.style.height = _this.options.height;\n img.el.onerror = function () {\n var svgVideo = Dom_1.$$('div', {}, SVGIcons_1.SVGIcons.icons.video).el;\n SVGDom_1.SVGDom.addStyleToSVGInContainer(svgVideo, {\n width: _this.options.width\n });\n Dom_1.$$(img).remove();\n thumbnailDiv.append(svgVideo);\n };\n thumbnailDiv.append(img.el);\n var span = Dom_1.$$('span', {\n className: 'coveo-youtube-thumbnail-play-button'\n });\n thumbnailDiv.append(span.el);\n Dom_1.$$(_this.element).append(_this.resultLink.el);\n Initialization_1.Initialization.automaticallyCreateComponentsInsideResult(element, result, {\n ResultLink: _this.options.embed ? { onClick: function () { return _this.openYoutubeIframe(); } } : null\n });\n _this.modalbox = new AccessibleModal_1.AccessibleModal('coveo-youtube-player', _this.searchInterface.options.modalContainer, ModalBox, {\n overlayClose: true\n });\n return _this;\n }\n /**\n * Open the result link embedded in this component.\n *\n * With a standard configuration of this component, this will open an iframe that automatically plays the video.\n */\n YouTubeThumbnail.prototype.openResultLink = function () {\n var resultLinkComponent = RegisteredNamedMethods_1.get(this.resultLink.el);\n resultLinkComponent.openLinkAsConfigured();\n };\n YouTubeThumbnail.prototype.openYoutubeIframe = function () {\n var _this = this;\n // need to put iframe inside div : iframe with position absolute and left:0, right : 0 , bottom: 0 is not standard/supported\n var iframe = Dom_1.$$('iframe', {\n src: \"https://www.youtube.com/embed/\" + this.extractVideoId() + \"?autoplay=1\",\n allowfullscreen: 'allowfullscreen',\n width: '100%',\n height: '100%',\n title: this.result.title\n });\n var div = Dom_1.$$('div');\n div.append(iframe.el);\n this.modalbox.openResult({\n result: this.result,\n options: { showDate: true, title: this.result.title },\n bindings: this.bindings,\n content: div.el,\n validation: function () { return true; },\n origin: this.origin\n });\n Dom_1.$$(Dom_1.$$(this.modalbox.wrapper).find('.coveo-quickview-close-button')).on('click', function () {\n _this.modalbox.close();\n });\n };\n YouTubeThumbnail.prototype.extractVideoId = function () {\n return this.result.clickUri.split('watch?v=')[1];\n };\n YouTubeThumbnail.ID = 'YouTubeThumbnail';\n YouTubeThumbnail.doExport = function () {\n GlobalExports_1.exportGlobally({\n YouTubeThumbnail: YouTubeThumbnail\n });\n };\n /**\n * @componentOptions\n */\n YouTubeThumbnail.options = {\n /**\n * Specifies the width (in pixels) of the YouTube thumbnail.\n *\n * Default value is `200px`.\n */\n width: ComponentOptions_1.ComponentOptions.buildStringOption({ defaultValue: '200px' }),\n /**\n * Specifies the height (in pixels) of the YouTube thumbnail.\n *\n * Default value is `112px`.\n */\n height: ComponentOptions_1.ComponentOptions.buildStringOption({ defaultValue: '112px' }),\n /**\n * Specifies whether clicking on the YouTube thumbnail loads the video in a modal box.\n *\n * Setting this option to `false` causes the browser to change its current location to that of the target URL when\n * the end user clicks the YouTube thumbnail.\n *\n * Default value is `true`.\n */\n embed: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true })\n };\n return YouTubeThumbnail;\n}(Component_1.Component));\nexports.YouTubeThumbnail = YouTubeThumbnail;\nInitialization_1.Initialization.registerAutoCreateComponent(YouTubeThumbnail);\n\n\n/***/ }),\n/* 189 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n///
\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Facet_1 = __webpack_require__(69);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar TemplateHelpers_1 = __webpack_require__(121);\nvar FacetRangeQueryController_1 = __webpack_require__(572);\nvar Initialization_1 = __webpack_require__(2);\nvar Globalize = __webpack_require__(23);\nvar GlobalExports_1 = __webpack_require__(3);\nvar ResponsiveFacetOptions_1 = __webpack_require__(84);\nvar ResponsiveFacets_1 = __webpack_require__(174);\nvar underscore_1 = __webpack_require__(0);\n/**\n * A `FacetRange` is a [facet](https://docs.coveo.com/en/198/) whose values are expressed as ranges.\n *\n * You must set the [`field`]{@link Facet.options.field} option to a value targeting a numeric or date [field](https://docs.coveo.com/en/200/) in your index for this component to work.\n *\n * This component extends the [`Facet`]{@link Facet} component and supports all `Facet` options except:\n *\n * - **Settings** menu options\n * - [`enableSettings`]{@link Facet.options.enableSettings}\n * - [`enableSettingsFacetState`]{@link Facet.options.enableSettingsFacetState}\n * - [`enableCollapse`]{@link Facet.options.enableCollapse}\n * - [`availableSorts`]{@link Facet.options.availableSorts}\n * - [`customSort`]{@link Facet.options.customSort}\n * - [`computedFieldCaption`]{@link Facet.options.computedFieldCaption}\n * - **Facet Search** options\n * - [`enableFacetSearch`]{@link Facet.options.enableFacetSearch}\n * - [`facetSearchDelay`]{@link Facet.options.facetSearchDelay}\n * - [`facetSearchIgnoreAccents`]{@link Facet.options.facetSearchIgnoreAccents}\n * - [`numberOfValuesInFacetSearch`]{@link Facet.options.numberOfValuesInFacetSearch}\n * - **More and Less** options\n * - [`enableMoreLess`]{@link Facet.options.enableMoreLess}\n * - [`pageSize`]{@link Facet.options.pageSize}\n *\n * @notSupportedIn salesforcefree\n */\nvar FacetRange = /** @class */ (function (_super) {\n __extends(FacetRange, _super);\n /**\n * Creates a new `FacetRange`.\n * @param element The HTML element on which to instantiate the component.\n * @param options The configuration options to apply when creating the component.\n * @param bindings The bindings required by the component.\n */\n function FacetRange(element, options, bindings) {\n var _this = _super.call(this, element, ComponentOptions_1.ComponentOptions.initComponentOptions(element, FacetRange, options), bindings, FacetRange.ID) || this;\n _this.element = element;\n _this.isFieldValueCompatible = false;\n _this.options.enableFacetSearch = false;\n _this.options.enableSettings = false;\n _this.options.includeInOmnibox = false;\n _this.options.enableMoreLess = false;\n ResponsiveFacets_1.ResponsiveFacets.init(_this.root, _this, _this.options);\n return _this;\n }\n FacetRange.prototype.getValueCaption = function (facetValue) {\n if (this.options.valueCaption || this.isLabelSpecifiedForValue(facetValue)) {\n return _super.prototype.getValueCaption.call(this, facetValue);\n }\n return this.translateValuesFromFormat(facetValue);\n };\n FacetRange.prototype.isLabelSpecifiedForValue = function (facetValue) {\n return this.options.ranges && !!underscore_1.find(this.options.ranges, function (range) { return !underscore_1.isUndefined(range.label) && range.label === facetValue.lookupValue; });\n };\n FacetRange.prototype.initFacetQueryController = function () {\n this.facetQueryController = new FacetRangeQueryController_1.FacetRangeQueryController(this);\n };\n FacetRange.prototype.processNewGroupByResults = function (groupByResults) {\n var _this = this;\n if (groupByResults != null && this.options.ranges == null) {\n groupByResults.values.sort(function (valueA, valueB) { return _this.sortRangeGroupByResults(valueA.value, valueB.value); });\n }\n _super.prototype.processNewGroupByResults.call(this, groupByResults);\n };\n FacetRange.prototype.sortRangeGroupByResults = function (valueA, valueB) {\n var startEndA = this.extractStartAndEndValue(valueA);\n var startEndB = this.extractStartAndEndValue(valueB);\n var firstValue;\n var secondValue;\n if (!startEndA) {\n firstValue = valueA;\n }\n else {\n firstValue = startEndA.start;\n }\n if (!startEndB) {\n secondValue = valueB;\n }\n else {\n secondValue = startEndB.start;\n }\n if (this.options.dateField) {\n return Date.parse(firstValue) - Date.parse(secondValue);\n }\n return Number(firstValue) - Number(secondValue);\n };\n FacetRange.prototype.translateValuesFromFormat = function (facetValue) {\n var startAndEnd = this.extractStartAndEndValue(facetValue.lookupValue || facetValue.value);\n if (!startAndEnd) {\n return null;\n }\n return this.formatValue(startAndEnd.start) + \" - \" + this.formatValue(startAndEnd.end);\n };\n FacetRange.prototype.extractStartAndEndValue = function (value) {\n var startAndEnd = /^(.*)\\.\\.(.*)$/.exec(value);\n if (startAndEnd == null) {\n return null;\n }\n return {\n start: startAndEnd[1],\n end: startAndEnd[2]\n };\n };\n FacetRange.prototype.formatValue = function (value) {\n var isNumber = !!value.match(/^[\\+\\-]?[0-9]+(\\.[0-9]+)?$/);\n return this.options.dateField || !isNumber ? this.formatDateValue(value) : this.formatNumberValue(Number(value));\n };\n FacetRange.prototype.formatDateValue = function (value) {\n var helper = TemplateHelpers_1.TemplateHelpers.getHelper('dateTime');\n var helperOptions = {\n alwaysIncludeTime: false,\n includeTimeIfThisWeek: false,\n includeTimeIfToday: false,\n omitYearIfCurrentOne: false,\n useTodayYesterdayAndTomorrow: false,\n useWeekdayIfThisWeek: false\n };\n return helper(value, helperOptions);\n };\n FacetRange.prototype.formatNumberValue = function (value) {\n return Globalize.format(value, this.options.valueFormat);\n };\n FacetRange.ID = 'FacetRange';\n FacetRange.parent = Facet_1.Facet;\n FacetRange.doExport = function () {\n GlobalExports_1.exportGlobally({\n FacetRange: FacetRange\n });\n };\n /**\n * The options for the component\n * @componentOptions\n */\n FacetRange.options = __assign({ \n /**\n * Whether the specified [`field`]{@link Facet.options.field} option value targets a date field in your index.\n *\n * This allows the component to correctly build the outgoing [Group By](https://docs.coveo.com/en/203/).\n *\n * **Default:** `false`.\n */\n dateField: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false }), \n /**\n * The list of [range values]{@link IRangeValue} to request (see [Requesting Specific FacetRange Values](https://docs.coveo.com/en/2790/)).\n *\n * By default, the index automatically generates range values.\n *\n * **Note:**\n * > The index cannot automatically generate range values for a `FacetRange` whose [`field`]{@link Facet.options.field} option value references a dynamic field generated by a [query function](https://docs.coveo.com/en/232/). In such a case, you _must_ use the `ranges` option.\n */\n ranges: ComponentOptions_1.ComponentOptions.buildJsonOption(), \n /**\n * The format to apply to the range values. Only works for numeric values.\n *\n * Some of the most commonly used formats are:\n *\n * - `c0`: format a numeric value as currency.\n * - `n0`: formats a numeric value as an integer.\n * - `n2`: formats a numeric value as a floating point number with two decimal digits.\n *\n * The available formats are defined in the [Globalize](https://github.com/klaaspieter/jquery-global#numbers) library.\n *\n * **Note:** This option is ignored when the [`valueCaption`]{@link Facet.options.valueCaption} is defined.\n */\n valueFormat: ComponentOptions_1.ComponentOptions.buildStringOption({ defaultValue: 'n0' }) }, ResponsiveFacetOptions_1.ResponsiveFacetOptions);\n return FacetRange;\n}(Facet_1.Facet));\nexports.FacetRange = FacetRange;\nInitialization_1.Initialization.registerAutoCreateComponent(FacetRange);\n\n\n/***/ }),\n/* 190 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar underscore_1 = __webpack_require__(0);\nvar QueryEvents_1 = __webpack_require__(11);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Assert_1 = __webpack_require__(5);\nvar Dom_1 = __webpack_require__(1);\nvar Utils_1 = __webpack_require__(4);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar QueryBuilder_1 = __webpack_require__(49);\nvar SortCriteria_1 = __webpack_require__(505);\n/**\n * The `Folding` component makes it possible to render hierarchic representations of search results sharing a common\n * [`field`]{@link Folding.options.field}.\n *\n * This component has no visual impact on its own. It simply folds certain search results so that the\n * [`ResultFolding`]{@link ResultFolding} and [`ResultAttachments`]{@link ResultAttachments} components can then nicely\n * render them within result templates (see [Result Templates](https://docs.coveo.com/en/413/)).\n *\n * A typical use case of the `Folding` component is to fold email conversations and message board threads results in a\n * result set in order to display them in a convenient format. Messages belonging to a single conversation typically\n * have a unique conversation ID. By indexing this ID on a field, you can use it to fold search results (see\n * [Folding Results](https://docs.coveo.com/en/428/)).\n *\n * **Note:**\n * > There can only be one `Folding` component per [`Tab`]{@link Tab} component.\n *\n */\nvar Folding = /** @class */ (function (_super) {\n __extends(Folding, _super);\n /**\n * Creates a new `Folding` component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the `Folding` component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n function Folding(element, options, bindings) {\n var _this = _super.call(this, element, Folding.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Folding, options);\n Assert_1.Assert.check(Utils_1.Utils.isCoveoField(_this.options.field), _this.options.field + ' is not a valid field');\n Assert_1.Assert.exists(_this.options.maximumExpandedResults);\n _this.swapParentChildFoldingFields();\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.buildingQuery, _this.handleBuildingQuery);\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.preprocessResults, _this.handlepreprocessResults);\n return _this;\n }\n // From a list of results, return a list of results and their attachments\n // We use parentResult to build a tree of result\n Folding.foldWithParent = function (queryResults) {\n var rootNode = {\n score: Number.NEGATIVE_INFINITY,\n children: [],\n result: {\n raw: false\n }\n };\n underscore_1.each(queryResults, function (queryResult, i) {\n var resultNode = Folding.findUniqueId(rootNode.children, queryResult.uniqueId);\n // If he have no parent or is parent is him self, add it to the root\n if (queryResult.parentResult == null || queryResult.parentResult.uniqueId == queryResult.uniqueId) {\n // Add it only if he do not exist\n if (resultNode == null) {\n resultNode = {\n result: queryResult,\n score: i,\n children: []\n };\n rootNode.children.push(resultNode);\n resultNode.parent = rootNode;\n }\n }\n else {\n // If the resultNode already exist\n if (resultNode != null) {\n resultNode.score = Math.min(i, resultNode.score);\n // Remove himself from his parent because it will be added in his parent. This allowed to remove duplicate.\n resultNode.parent.children = underscore_1.without(resultNode.parent.children, resultNode);\n }\n else {\n resultNode = {\n result: queryResult,\n score: i,\n children: []\n };\n }\n var parentResult = Folding.findUniqueId(rootNode.children, queryResult.parentResult.uniqueId);\n // If the parent does not already exist, create it and add it the root\n if (parentResult == null) {\n parentResult = {\n result: queryResult.parentResult,\n score: Number.POSITIVE_INFINITY,\n children: []\n };\n rootNode.children.push(parentResult);\n parentResult.parent = rootNode;\n }\n // Add the resultNode to parent\n parentResult.children.push(resultNode);\n resultNode.parent = parentResult;\n var parent_1 = parentResult;\n while (parent_1 != null && resultNode.score < parent_1.score) {\n parent_1.score = resultNode.score;\n parent_1 = parent_1.parent;\n }\n }\n });\n var rootResult = Folding.resultNodeToQueryResult(rootNode);\n // Remove the root from all results\n underscore_1.each(rootResult.attachments, function (attachment) { return (attachment.parentResult = null); });\n return rootResult.attachments;\n };\n // 99.9% of the folding case will be alright with those default functions.\n // Otherwise use the options getResult and getMoreResults\n Folding.defaultGetResult = function (result) {\n var results = result.childResults || [];\n // Add the top result at the top of the list\n results.unshift(result);\n // Empty childResults just to make it more clean\n result.childResults = [];\n // Fold those results\n results = Folding.foldWithParent(results);\n // The first result is the top one\n var topResult = results.shift();\n // All other the results are childResults\n topResult.childResults = results;\n return topResult;\n };\n Folding.defaultGetMoreResults = function (results) {\n // The result are flat, just do the fold\n return Folding.foldWithParent(results);\n };\n // Convert ResultNode to QueryResult\n Folding.resultNodeToQueryResult = function (resultNode) {\n var result = resultNode.result;\n result.attachments = underscore_1.map(underscore_1.sortBy(resultNode.children, 'score'), Folding.resultNodeToQueryResult);\n result.parentResult = resultNode.parent != null ? resultNode.parent.result : null;\n return result;\n };\n Folding.findUniqueId = function (resultNodes, uniqueId) {\n for (var i = 0; i < resultNodes.length; i++) {\n if (resultNodes[i].result.uniqueId == uniqueId) {\n return resultNodes[i];\n }\n var resultNode = Folding.findUniqueId(resultNodes[i].children, uniqueId);\n if (resultNode != null) {\n return resultNode;\n }\n }\n return null;\n };\n Folding.prototype.swapParentChildFoldingFields = function () {\n // Swap \"old\" childField and parentField and assign them to the \"new\" parent option\n // This needs to be done because connectors push the default data in *reverse* order compared to what the index expect.\n if (this.options.childField != null) {\n this.logger.warn('Detecting usage of deprecated option \"childField\". Assigning it automatically to the \"parent\" option instead.');\n this.logger.warn('The option definition was changed to support universal folding across all sources.');\n this.logger.warn('To remove this warning, rename the \"childField\" option (data-child-field) to \"parent\" (data-parent).');\n this.options.parent = this.options.childField;\n }\n if (this.options.parentField != null) {\n this.logger.warn('Detecting usage of deprecated option \"parentField\". Assigning it automatically to the \"child\" option instead.');\n this.logger.warn('The option definition was changed to support universal folding across all sources.');\n this.logger.warn('To remove this warning, rename the \"parentField\" option (data-parent-field) to \"child\" (data-child).');\n this.options.child = this.options.parentField;\n }\n };\n Folding.prototype.handleBuildingQuery = function (data) {\n Assert_1.Assert.exists(data);\n if (!this.disabled) {\n data.queryBuilder.childField = this.options.parent;\n data.queryBuilder.parentField = this.options.child;\n data.queryBuilder.filterField = this.options.field;\n data.queryBuilder.filterFieldRange = this.options.range;\n data.queryBuilder.requiredFields.push(this.options.field);\n if (this.options.parent != null) {\n data.queryBuilder.requiredFields.push(this.options.parent);\n }\n if (this.options.child != null) {\n data.queryBuilder.requiredFields.push(this.options.child);\n }\n }\n };\n Folding.prototype.handlepreprocessResults = function (data) {\n var _this = this;\n Assert_1.Assert.exists(data);\n Assert_1.Assert.check(!data.results._folded, 'Two or more Folding components are active at the same time for the same Tab. Cannot process the results.');\n data.results._folded = true;\n var queryResults = data.results;\n var getResult = this.options.getResult || Folding.defaultGetResult;\n queryResults.results = underscore_1.map(queryResults.results, getResult);\n if (this.options.rearrange) {\n queryResults.results.forEach(function (result) {\n result.childResults = underscore_1.sortBy(result.childResults, function (result) { return Utils_1.Utils.getFieldValue(result, _this.options.rearrange.sort); });\n if (_this.shouldBeReversed(result.childResults)) {\n result.childResults = result.childResults.reverse();\n }\n });\n }\n this.addLoadMoreHandler(queryResults.results, data.query);\n };\n Folding.prototype.shouldBeReversed = function (childResults) {\n var _this = this;\n if (this.options.rearrange.direction == 'ascending') {\n return false;\n }\n var childMissingSortByValue = underscore_1.any(childResults, function (childResult) {\n return Utils_1.Utils.isNullOrUndefined(Utils_1.Utils.getFieldValue(childResult, _this.options.rearrange.sort));\n });\n if (childMissingSortByValue) {\n return false;\n }\n return true;\n };\n Folding.prototype.addLoadMoreHandler = function (results, originalQuery) {\n var _this = this;\n return underscore_1.map(results, function (result) {\n if (_this.options.enableExpand && !Utils_1.Utils.isNullOrUndefined(Utils_1.Utils.getFieldValue(result, _this.options.field))) {\n result.moreResults = function () {\n return _this.moreResults(result, originalQuery);\n };\n }\n return result;\n });\n };\n Folding.prototype.moreResults = function (result, originalQuery) {\n var _this = this;\n var query = underscore_1.clone(originalQuery);\n var builder = new QueryBuilder_1.QueryBuilder();\n query.numberOfResults = this.options.maximumExpandedResults;\n var fieldValue = Utils_1.Utils.getFieldValue(result, this.options.field);\n if (Utils_1.Utils.isNonEmptyString(fieldValue)) {\n builder.advancedExpression.addFieldExpression(this.options.field, '=', [fieldValue]);\n query.aq = builder.build().aq;\n query.facets = [];\n query.categoryFacets = [];\n query.facetOptions = {};\n }\n if (Utils_1.Utils.isNonEmptyString(originalQuery.q)) {\n // We add keywords to get the highlight and we add @uri to get all results\n // To ensure it plays nicely with query syntax, we ensure that the needed part of the query\n // are correctly surrounded with the no syntax block\n if (originalQuery.enableQuerySyntax) {\n query.q = \"( \" + originalQuery.q + \" ) OR @uri\";\n }\n else {\n query.enableQuerySyntax = true;\n query.q = \"( <@- \" + originalQuery.q + \" -@> ) OR @uri\";\n }\n }\n if (Utils_1.Utils.isNonEmptyString(this.options.expandExpression)) {\n query.cq = this.options.expandExpression;\n }\n if (this.options.child != null) {\n query.parentField = this.options.child;\n }\n if (this.options.parent != null) {\n query.childField = this.options.parent;\n }\n query.filterField = null;\n query.filterFieldRange = null;\n query.firstResult = 0;\n if (this.options.rearrange) {\n this.options.rearrange.putInQueryBuilder(builder);\n query.sortCriteria = builder.sortCriteria;\n query.sortField = builder.sortField;\n }\n else {\n query.sortCriteria = originalQuery.sortCriteria;\n query.sortField = originalQuery.sortField;\n }\n return this.queryController\n .getEndpoint()\n .search(query)\n .then(function (results) {\n _this.handlePreprocessMoreResults(results);\n return results.results;\n })\n .catch(function (e) {\n _this.logger.error(\"Invalid query performed while trying to retrieve more results for folding.\", e);\n return [];\n });\n };\n Folding.prototype.handlePreprocessMoreResults = function (queryResults) {\n var getResults = this.options.getMoreResults || Folding.defaultGetMoreResults;\n queryResults.results = getResults(queryResults.results);\n Dom_1.$$(this.element).trigger(QueryEvents_1.QueryEvents.preprocessMoreResults, {\n results: queryResults\n });\n };\n Folding.ID = 'Folding';\n Folding.doExport = function () {\n GlobalExports_1.exportGlobally({\n Folding: Folding\n });\n };\n /**\n * The options for the component\n * @componentOptions\n */\n Folding.options = {\n /**\n * Specifies the name of the field on which to do the folding.\n *\n * Specifying a value for this option is required for this component to work.\n *\n * **Note:**\n * > In an Elasticsearch index, the corresponding field must be configured as a *Facet* field\n * > (see [Add or Edit Fields](https://docs.coveo.com/en/1982/)).\n * > This limitation does not apply to Coveo indexes.\n *\n * Default value is `@foldingcollection`.\n */\n field: ComponentOptions_1.ComponentOptions.buildFieldOption({ defaultValue: '@foldingcollection' }),\n /**\n * Specifies the field that determines whether a certain result is a child of another top result.\n *\n * **Note:**\n * > In the index, the values of the corresponding field must:\n * > - Contain alphanumerical characters only.\n * > - Contain no more than 60 characters.\n *\n * Default value is `@foldingchild`.\n */\n child: ComponentOptions_1.ComponentOptions.buildFieldOption({ defaultValue: '@foldingchild' }),\n /**\n * Specifies the field that determines whether a certain result is a top result containing other child results.\n *\n * **Note:**\n * > In the index, the values of the corresponding field must:\n * > - Contain alphanumerical characters only.\n * > - Contain no more than 60 characters.\n *\n * Default value is `@foldingparent`.\n */\n parent: ComponentOptions_1.ComponentOptions.buildFieldOption({ defaultValue: '@foldingparent' }),\n /**\n * This option is deprecated. Instead, use the {@link Folding.options.parent} option.\n * @deprecated\n */\n childField: ComponentOptions_1.ComponentOptions.buildFieldOption({\n deprecated: 'This option is deprecated. Instead, use the data-parent option.'\n }),\n /**\n * This option is deprecated. Instead, use the {@link Folding.options.child} option.\n * @deprecated\n */\n parentField: ComponentOptions_1.ComponentOptions.buildFieldOption({\n deprecated: 'This option is deprecated. Instead, use the data-child option.'\n }),\n /**\n * Specifies the maximum number of child results to fold.\n *\n * **Example:**\n * > For an email thread with a total of 20 messages, using the default value of `2` means that the component loads\n * > up to a maximum of 2 child messages under the original message, unless the end user expands the entire\n * > conversation using the **Show More** link (see the [`enableExpand`]{@link Folding.options.enableExpand}\n * > option).\n *\n * Default value is `2`. Minimum value is `0`.\n */\n range: ComponentOptions_1.ComponentOptions.buildNumberOption({ defaultValue: 2, min: 0 }),\n /**\n * Specifies the sort criteria to apply to the top result and its child results (e.g., `date ascending`,\n * `@myfield descending`, etc.). See [sortCriteria](https://docs.coveo.com/en/1461/#RestQueryParameters-sortCriteria).\n *\n * This option works from the results returned by the index. This means that if only the three most relevant folded results are returned by the index\n * and you choose to rearrange the folded results by date, then the three most relevant results will be rearranged by date,\n * meaning that the first folded result is not necessarily the oldest or newest item.\n *\n * However, since clicking on the `Show More` button triggers a new query, you would receive new results based on the sort criteria of this option.\n *\n * **Example**\n * > If you are folding email results by conversation and you specify `date descending` as the `rearrange` value of\n * > the `Folding` component, the component re-arranges email conversations so that the newest email is always the\n * > top result. Specifying `date ascending` instead always makes the original email the top result, as it is also\n * > necessarily the oldest.\n *\n * By default, the component displays the results in the order that the index returns them.\n */\n rearrange: ComponentOptions_1.ComponentOptions.buildCustomOption(function (value) { return (Utils_1.Utils.isNonEmptyString(value) ? SortCriteria_1.SortCriteria.parse(value) : null); }),\n /**\n * Specifies whether to add a callback function on the top result, allowing to make an additional query to load all\n * of its child results (e.g., to load all conversations of a given thread).\n *\n * Concretely, the [`ResultFolding`]{@link ResultFolding} component uses this for its **Show More** link.\n *\n * See also the [`expandExpression`]{@link Folding.options.expandExpression} and\n * [`maximumExpandedResults`]{@link Folding.options.maximumExpandedResults} options.\n *\n * Default value is `true`.\n */\n enableExpand: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true }),\n /**\n * If the [`enableExpand`]{@link Folding.options.enableExpand} option is `true`, specifies a custom constant\n * expression to send when querying the expanded results.\n *\n * Default value is `undefined`.\n */\n expandExpression: ComponentOptions_1.ComponentOptions.buildQueryExpressionOption({ depend: 'enableExpand' }),\n /**\n * If the [`enableExpand`]{@link Folding.options.enableExpand} option is `true`, specifies the maximum number of\n * results to load when expanding.\n *\n * Default value is `100`. Minimum value is `1`.\n */\n maximumExpandedResults: ComponentOptions_1.ComponentOptions.buildNumberOption({ defaultValue: 100, min: 1, depend: 'enableExpand' }),\n /**\n * Specifies the function that manages the individual folding of each result.\n *\n * Default value is:\n *\n * ```javascript\n * var results = result.childResults || [];\n * // Add the top result at the top of the list.\n * results.unshift(result);\n * // Empty childResults just to clean it.\n * result.childResults = [];\n * // Fold those results.\n * results = Coveo.Folding.foldWithParent(results);\n * // The first result is the top one.\n * var topResult = results.shift();\n * // All other results are childResults.\n * topResult.childResults = results;\n * return topResult;\n * ```\n *\n * You can pre-process all the result with this option in the [`init`]{@link init} call of your search interface:\n *\n * ```javascript\n * Coveo.init(document.querySelector('#search'), {\n * Folding: {\n * getResult: function(result) {\n * result = Coveo.Folding.defaultGetResult(result);\n * // Your code here\n * }\n * }\n * })\n * ```\n */\n getResult: ComponentOptions_1.ComponentOptions.buildCustomOption(function () {\n return null;\n }),\n /**\n * Specifies the function that manages the folding of all results.\n *\n * Default value is:\n *\n * ```javascript\n * Coveo.Folding.defaultGetMoreResults = function(results) {\n * // The results are flat, just do the folding.\n * return Coveo.Folding.foldWithParent(results);\n * }\n * ```\n */\n getMoreResults: ComponentOptions_1.ComponentOptions.buildCustomOption(function () {\n return null;\n })\n };\n return Folding;\n}(Component_1.Component));\nexports.Folding = Folding;\nInitialization_1.Initialization.registerAutoCreateComponent(Folding);\n\n\n/***/ }),\n/* 191 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Assert_1 = __webpack_require__(5);\nvar QueryUtils_1 = __webpack_require__(21);\nvar Initialization_1 = __webpack_require__(2);\nvar Utils_1 = __webpack_require__(4);\nvar FileTypes_1 = __webpack_require__(120);\nvar Dom_1 = __webpack_require__(1);\nvar GlobalExports_1 = __webpack_require__(3);\nvar TemplateFieldsEvaluator_1 = __webpack_require__(136);\n/**\n * The Icon component outputs the corresponding icon for a given file type. The component searches for a suitable icon\n * from those available in the Coveo JavaScript Search Framework. If the component finds no suitable icon, it instead\n * outputs a generic icon.\n *\n * This component is a result template component (see [Result Templates](https://docs.coveo.com/en/413/)).\n */\nvar Icon = /** @class */ (function (_super) {\n __extends(Icon, _super);\n /**\n * Creates a new Icon component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the Icon component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n * @param result The result to associate the component with.\n */\n function Icon(element, options, bindings, result) {\n var _this = _super.call(this, element, Icon.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.result = result;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Icon, options);\n _this.result = _this.result || _this.resolveResult();\n Assert_1.Assert.exists(_this.result);\n if (TemplateFieldsEvaluator_1.TemplateFieldsEvaluator.evaluateFieldsToMatch(_this.options.conditions, _this.result)) {\n _this.initialize(element, bindings);\n }\n else if (_this.element.parentElement != null) {\n _this.element.parentElement.removeChild(_this.element);\n }\n return _this;\n }\n Icon.prototype.initialize = function (element, bindings) {\n var possibleInternalQuickview = Dom_1.$$(this.element).find('.' + Component_1.Component.computeCssClassNameForType('Quickview'));\n if (!Utils_1.Utils.isNullOrUndefined(possibleInternalQuickview) && QueryUtils_1.QueryUtils.hasHTMLVersion(this.result)) {\n Dom_1.$$(this.element).addClass('coveo-with-quickview');\n Dom_1.$$(this.element).on('click', function () {\n var qv = Component_1.Component.get(possibleInternalQuickview);\n qv.open();\n });\n }\n Icon.createIcon(this.result, this.options, element, bindings);\n };\n Icon.createIcon = function (result, options, element, bindings) {\n if (options === void 0) { options = {}; }\n if (element === void 0) { element = Dom_1.$$('div').el; }\n var info = FileTypes_1.FileTypes.get(result);\n if (!bindings && result.searchInterface) {\n // try to resolve results bindings automatically\n bindings = result.searchInterface.getBindings();\n }\n info = Icon.preprocessIconInfo(options, info);\n Dom_1.$$(element).toggleClass('coveo-small', options.small === true);\n if (options.value != undefined) {\n if (options.small === true) {\n if (options.value.indexOf('-small') == -1) {\n info.icon += '-small';\n }\n }\n if (options.small === false) {\n if (options.value.indexOf('-small') != -1) {\n info.icon = info.icon.replace('-small', '');\n }\n }\n }\n Dom_1.$$(element).addClass(info.icon);\n element.setAttribute('title', info.caption);\n if (Icon.shouldDisplayLabel(options, bindings)) {\n element.appendChild(Dom_1.$$('span', {\n className: 'coveo-icon-caption-overlay'\n }, info.caption).el);\n Dom_1.$$(element).addClass('coveo-icon-with-caption-overlay');\n Dom_1.$$(element).setAttribute('data-with-label', 'true');\n }\n return element;\n };\n Icon.shouldDisplayLabel = function (options, bindings) {\n // If withLabel is explicitely set to false, the label will never display\n // If withLabel is explicitely set to true, the label will always display\n // If withLabel is set to default value (not a hard true or false), the label will display based on ./core/filetypes/**.json\n // with the property shouldDisplayLabel set on each file type/ objecttype\n // In this case, the generated css will take care of outputting the correct css to display : block\n return options.withLabel !== false;\n };\n Icon.preprocessIconInfo = function (options, info) {\n if (options.labelValue != null) {\n info.caption = options.labelValue;\n }\n if (options.value != null) {\n info.icon = 'coveo-icon ' + options.value;\n }\n if (info.caption == null) {\n info.caption = '';\n }\n if (info.icon == null) {\n info.icon = 'coveo-icon coveo-sprites-custom';\n }\n return info;\n };\n Icon.ID = 'Icon';\n Icon.doExport = function () {\n GlobalExports_1.exportGlobally({\n Icon: Icon\n });\n };\n /**\n * The options for the Icon\n * @componentOptions\n */\n Icon.options = {\n /**\n * Specifies the value that the Icon component should output as its CSS class instead of the auto-selected value.\n *\n * Default value is `undefined`, which means that the Coveo JavaScript Search Framework outputs a suitable icon\n * depending on the result file type.\n */\n value: ComponentOptions_1.ComponentOptions.buildStringOption(),\n /**\n * Specifies whether the Icon component should output the smaller version of the icon instead of the regular one.\n *\n * Default value is `undefined`.\n */\n small: ComponentOptions_1.ComponentOptions.buildBooleanOption(),\n /**\n * Specifies whether the Icon component should force the output icon to display its caption/label.\n *\n * **Note:**\n *\n * > Due to limited screen real estate, setting this option to `true` has no effect on icons used inside Coveo for\n * > Salesforce Insight Panels.\n *\n * Default value is `undefined`, which means that the Coveo JavaScript Search Framework determines whether the icon\n * needs to display a caption/label depending on the result file type.\n */\n withLabel: ComponentOptions_1.ComponentOptions.buildBooleanOption(),\n /**\n * Specifies what text to display as the icon caption/label.\n *\n * Default value is `undefined`, which means that the Coveo JavaScript Search Framework determines what text the icon\n * needs to display depending on the result file type.\n */\n labelValue: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption(),\n /**\n * A field-based condition that must be satisfied by the query result item for the component to be rendered.\n *\n * Note: This option uses a distinctive markup configuration syntax allowing multiple conditions to be expressed. Its underlying logic is the same as that of the field value conditions mechanism used by result templates.\n *\n * **Examples:**\n * Render the component if the query result item's @documenttype field value is Article or Documentation.\n * ```html\n *
\n * ```\n *\n * Render the component if the query result item's @documenttype field value is anything but Case.\n * ```html\n *
\n * ```\n * Render the component if the query result item's @documenttype field value is Article, and if its @author field value is anything but Anonymous.\n * ```html\n *
\n * ```\n * Default value is `undefined`.\n */\n conditions: ComponentOptions_1.ComponentOptions.buildFieldConditionOption()\n };\n return Icon;\n}(Component_1.Component));\nexports.Icon = Icon;\nInitialization_1.Initialization.registerAutoCreateComponent(Icon);\n\n\n/***/ }),\n/* 192 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n///
\n///
\n///
\n///
\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(573);\nvar _ = __webpack_require__(0);\nvar underscore_1 = __webpack_require__(0);\nvar BreadcrumbEvents_1 = __webpack_require__(35);\nvar OmniboxEvents_1 = __webpack_require__(34);\nvar QueryEvents_1 = __webpack_require__(11);\nvar StandaloneSearchInterfaceEvents_1 = __webpack_require__(99);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Grammar_1 = __webpack_require__(175);\nvar Complete_1 = __webpack_require__(506);\nvar Expressions_1 = __webpack_require__(507);\nvar MagicBox_1 = __webpack_require__(221);\nvar Assert_1 = __webpack_require__(5);\nvar ComponentOptionsModel_1 = __webpack_require__(28);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar Utils_1 = __webpack_require__(4);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar PendingSearchAsYouTypeSearchEvent_1 = __webpack_require__(127);\nvar SharedAnalyticsCalls_1 = __webpack_require__(125);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar Querybox_1 = __webpack_require__(138);\nvar QueryboxOptionsProcessing_1 = __webpack_require__(509);\nvar QueryboxQueryParameters_1 = __webpack_require__(510);\nvar SearchInterface_1 = __webpack_require__(19);\nvar FieldAddon_1 = __webpack_require__(574);\nvar OldOmniboxAddon_1 = __webpack_require__(575);\nvar QueryExtensionAddon_1 = __webpack_require__(576);\nvar QuerySuggestAddon_1 = __webpack_require__(577);\nvar MINIMUM_EXECUTABLE_CONFIDENCE = 0.8;\n/**\n * The `Omnibox` component extends the [`Querybox`]{@link Querybox}, and thus provides the same basic options and\n * behaviors. Furthermore, the `Omnibox` adds a type-ahead capability to the search input.\n *\n * You can configure the type-ahead feature by enabling or disabling certain addons, which the Coveo JavaScript Search\n * Framework provides out-of-the-box (see the [`enableFieldAddon`]{@link Omnibox.options.enableFieldAddon},\n * [`enableQueryExtension`]{@link Omnibox.options.enableQueryExtensionAddon}, and\n * [`enableQuerySuggestAddon`]{@link Omnibox.options.enableQuerySuggestAddon} options).\n *\n * Custom components and external code can also extend or customize the type-ahead feature and the query completion\n * suggestions it provides by attaching their own handlers to the\n * [`populateOmniboxSuggestions`]{@link OmniboxEvents.populateOmniboxSuggestions} event.\n *\n * See also the [`Searchbox`]{@link Searchbox} component, which can automatically instantiate an `Omnibox` along with an\n * optional {@link SearchButton}.\n */\nvar Omnibox = /** @class */ (function (_super) {\n __extends(Omnibox, _super);\n /**\n * Creates a new Omnibox component. Also enables necessary addons and binds events on various query events.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the Omnibox component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n function Omnibox(element, options, bindings) {\n var _this = _super.call(this, element, Omnibox.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.lastSuggestions = [];\n _this.movedOnce = false;\n _this.skipAutoSuggest = false;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Omnibox, options);\n var originalValueForQuerySyntax = _this.options.enableQuerySyntax;\n new QueryboxOptionsProcessing_1.QueryboxOptionsProcessing(_this).postProcess();\n _this.omniboxAnalytics = _this.searchInterface.getOmniboxAnalytics();\n Dom_1.$$(_this.element).toggleClass('coveo-query-syntax-disabled', _this.options.enableQuerySyntax == false);\n _this.suggestionAddon = _this.options.enableQuerySuggestAddon ? new QuerySuggestAddon_1.QuerySuggestAddon(_this) : new QuerySuggestAddon_1.VoidQuerySuggestAddon();\n new OldOmniboxAddon_1.OldOmniboxAddon(_this);\n _this.createMagicBox();\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.newQuery, function (args) { return _this.handleNewQuery(args); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.buildingQuery, function (args) { return _this.handleBuildingQuery(args); });\n _this.bind.onRootElement(StandaloneSearchInterfaceEvents_1.StandaloneSearchInterfaceEvents.beforeRedirect, function () { return _this.handleBeforeRedirect(); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.querySuccess, function () { return _this.handleQuerySuccess(); });\n _this.bind.onQueryState(Model_1.MODEL_EVENTS.CHANGE_ONE, QueryStateModel_1.QUERY_STATE_ATTRIBUTES.Q, function (args) {\n return _this.handleQueryStateChanged(args);\n });\n if (_this.isAutoSuggestion()) {\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.duringQuery, function (args) { return _this.handleDuringQuery(args); });\n }\n _this.bind.onComponentOptions(Model_1.MODEL_EVENTS.CHANGE_ONE, ComponentOptionsModel_1.COMPONENT_OPTIONS_ATTRIBUTES.SEARCH_BOX, function (args) {\n if (args.value.enableQuerySyntax != null) {\n _this.options.enableQuerySyntax = args.value.enableQuerySyntax;\n }\n else {\n _this.options.enableQuerySyntax = originalValueForQuerySyntax;\n }\n _this.updateGrammar();\n });\n _this.bind.onRootElement(OmniboxEvents_1.OmniboxEvents.querySuggestGetFocus, function (args) { return _this.handleQuerySuggestGetFocus(args); });\n return _this;\n }\n /**\n * Adds the current content of the input to the query and triggers a query if the current content of the input has\n * changed since last submit.\n *\n * Also logs a `searchboxSubmit` event in the usage analytics.\n */\n Omnibox.prototype.submit = function () {\n var _this = this;\n this.magicBox.clearSuggestion();\n this.updateQueryState();\n this.triggerNewQuery(false, function () {\n SharedAnalyticsCalls_1.logSearchBoxSubmitEvent(_this.usageAnalytics);\n });\n this.magicBox.blur();\n };\n /**\n * Gets the current content of the input.\n * @returns {string} The current content of the input.\n */\n Omnibox.prototype.getText = function () {\n return this.magicBox.getText();\n };\n /**\n * Sets the content of the input\n * @param text The string to set in the input.\n */\n Omnibox.prototype.setText = function (text) {\n this.magicBox.setText(text);\n this.updateQueryState();\n };\n /**\n * Clears the content of the input.\n */\n Omnibox.prototype.clear = function () {\n this.magicBox.clear();\n };\n /**\n * Gets the `HTMLInputElement` of the Omnibox.\n */\n Omnibox.prototype.getInput = function () {\n return this.magicBox.element.querySelector('input');\n };\n Omnibox.prototype.getResult = function () {\n return this.magicBox.getResult();\n };\n Omnibox.prototype.getDisplayedResult = function () {\n return this.magicBox.getDisplayedResult();\n };\n Omnibox.prototype.getCursor = function () {\n return this.magicBox.getCursor();\n };\n Omnibox.prototype.resultAtCursor = function (match) {\n return this.magicBox.resultAtCursor(match);\n };\n Omnibox.prototype.createGrammar = function () {\n var grammar = null;\n if (this.options.enableQuerySyntax) {\n grammar = Expressions_1.Expressions(Complete_1.Complete);\n if (this.options.enableFieldAddon) {\n new FieldAddon_1.FieldAddon(this);\n }\n if (this.options.fieldAlias != null) {\n this.options.listOfFields = this.options.listOfFields || [];\n this.options.listOfFields = this.options.listOfFields.concat(_.keys(this.options.fieldAlias));\n }\n if (this.options.enableQueryExtensionAddon) {\n new QueryExtensionAddon_1.QueryExtensionAddon(this);\n }\n }\n else {\n grammar = { start: 'Any', expressions: { Any: /.*/ } };\n }\n if (this.options.grammar != null) {\n grammar = this.options.grammar(grammar);\n }\n return grammar;\n };\n Omnibox.prototype.updateGrammar = function () {\n var grammar = this.createGrammar();\n this.magicBox.grammar = new Grammar_1.Grammar(grammar.start, grammar.expressions);\n this.magicBox.setText(this.magicBox.getText());\n };\n Omnibox.prototype.createMagicBox = function () {\n var grammar = this.createGrammar();\n this.magicBox = MagicBox_1.createMagicBox(this.element, new Grammar_1.Grammar(grammar.start, grammar.expressions), {\n inline: this.options.inline,\n selectableSuggestionClass: 'coveo-omnibox-selectable',\n selectedSuggestionClass: 'coveo-omnibox-selected',\n suggestionTimeout: this.options.omniboxTimeout\n });\n var input = Dom_1.$$(this.magicBox.element).find('input');\n if (input) {\n Dom_1.$$(input).setAttribute('aria-label', Strings_1.l('Search'));\n }\n this.setupMagicBox();\n };\n Omnibox.prototype.setupMagicBox = function () {\n var _this = this;\n this.magicBox.onmove = function () {\n // We assume that once the user has moved its selection, it becomes an explicit omnibox analytics event\n if (_this.isAutoSuggestion()) {\n _this.modifyEventTo = _this.getOmniboxAnalyticsEventCause();\n }\n _this.movedOnce = true;\n };\n this.magicBox.onfocus = function () {\n if (_this.isAutoSuggestion()) {\n // This flag is used to block the automatic query when the UI is loaded with a query (#q=foo)\n // and then the input is focused. We want to block that query, even if it match the suggestion\n // Only when there is an actual change in the input (user typing something) is when we want the automatic query to kick in\n _this.skipAutoSuggest = true;\n }\n };\n this.magicBox.onSuggestions = function (suggestions) {\n // If text is empty, this can mean that user selected text from the search box\n // and hit \"delete\" : Reset the partial queries in this case\n if (Utils_1.Utils.isEmptyString(_this.getText())) {\n _this.omniboxAnalytics.partialQueries = [];\n }\n _this.movedOnce = false;\n _this.lastSuggestions = suggestions;\n if (_this.isAutoSuggestion() && !_this.skipAutoSuggest) {\n _this.searchAsYouType();\n }\n };\n if (this.options.enableSearchAsYouType) {\n Dom_1.$$(this.element).addClass('coveo-magicbox-search-as-you-type');\n }\n this.magicBox.onchange = function () {\n _this.skipAutoSuggest = false;\n var text = _this.getText();\n if (text != undefined && text != '') {\n if (_this.isAutoSuggestion()) {\n if (_this.movedOnce) {\n _this.searchAsYouType(true);\n }\n }\n else if (_this.options.enableSearchAsYouType) {\n _this.searchAsYouType(true);\n }\n }\n else {\n _this.clear();\n }\n };\n if (this.options.placeholder) {\n this.magicBox.element.querySelector('input').placeholder = this.options.placeholder;\n }\n this.magicBox.onsubmit = function () { return _this.submit(); };\n this.magicBox.onselect = function (suggestion) {\n var index = _.indexOf(_this.lastSuggestions, suggestion);\n var suggestions = _.compact(_.map(_this.lastSuggestions, function (suggestion) { return suggestion.text; }));\n _this.magicBox.clearSuggestion();\n _this.updateQueryState();\n // A bit tricky here : When it's machine learning auto suggestions\n // the mouse selection and keyboard selection acts differently :\n // keyboard selection will automatically do the query (which will log a search as you type event -> further modified by this.modifyEventTo if needed)\n // mouse selection will not \"auto\" send the query.\n // the movedOnce variable detect the keyboard movement, and is used to differentiate mouse vs keyboard\n if (!_this.isAutoSuggestion()) {\n _this.usageAnalytics.cancelAllPendingEvents();\n _this.triggerNewQuery(false, function () {\n _this.usageAnalytics.logSearchEvent(_this.getOmniboxAnalyticsEventCause(), _this.buildCustomDataForPartialQueries(index, suggestions));\n });\n }\n else if (_this.isAutoSuggestion() && _this.movedOnce) {\n _this.handleAutoSuggestionWithKeyboard(index, suggestions);\n }\n else if (_this.isAutoSuggestion() && !_this.movedOnce) {\n _this.handleAutoSuggestionsWithMouse(index, suggestions);\n }\n // Consider a selection like a reset of the partial queries (it's the end of a suggestion pattern)\n if (_this.isAutoSuggestion()) {\n _this.omniboxAnalytics.partialQueries = [];\n }\n };\n this.magicBox.onblur = function () {\n if (_this.isAutoSuggestion()) {\n _this.setText(_this.getQuery(true));\n _this.usageAnalytics.sendAllPendingEvents();\n }\n };\n this.magicBox.onclear = function () {\n _this.updateQueryState();\n if (_this.options.triggerQueryOnClear || _this.options.enableSearchAsYouType) {\n _this.triggerNewQuery(false, function () {\n _this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.searchboxClear, {});\n });\n }\n };\n this.magicBox.ontabpress = function () {\n _this.handleTabPress();\n };\n this.magicBox.getSuggestions = function () { return _this.handleSuggestions(); };\n };\n Omnibox.prototype.handleAutoSuggestionWithKeyboard = function (index, suggestions) {\n var _this = this;\n if (this.searchAsYouTypeTimeout) {\n // Here, there is currently a search as you typed queued up :\n // Think : user typed very quickly, then very quickly selected a suggestion (without waiting for the search as you type)\n // Cancel the search as you type query, then immediately do the query with the selection (+analytics event with the selection)\n this.usageAnalytics.cancelAllPendingEvents();\n clearTimeout(this.searchAsYouTypeTimeout);\n this.searchAsYouTypeTimeout = undefined;\n this.triggerNewQuery(false, function () {\n _this.usageAnalytics.logSearchEvent(_this.getOmniboxAnalyticsEventCause(), _this.buildCustomDataForPartialQueries(index, suggestions));\n });\n }\n else {\n // Here, the search as you type query has returned, but the analytics event has not ye been sent.\n // Think : user typed slowly, the query returned, and then the user selected a suggestion.\n // Since the analytics event has not yet been sent (search as you type event have a 5 sec delay)\n // modify the pending event, then send the newly modified analytics event immediately.\n this.modifyEventTo = this.getOmniboxAnalyticsEventCause();\n this.modifyCustomDataOnPending(index, suggestions);\n this.modifyQueryContentOnPending();\n this.usageAnalytics.sendAllPendingEvents();\n }\n };\n Omnibox.prototype.handleAutoSuggestionsWithMouse = function (index, suggestions) {\n var _this = this;\n if (this.searchAsYouTypeTimeout || index != 0) {\n // Here : the user either very quickly chose the first suggestion, and the search as you type is still queued up.\n // OR\n // the user chose something different then the first suggestion.\n // Remove the search as you type if it's there, and do the query with the suggestion directly.\n this.clearSearchAsYouType();\n this.usageAnalytics.cancelAllPendingEvents();\n this.triggerNewQuery(false, function () {\n _this.usageAnalytics.logSearchEvent(_this.getOmniboxAnalyticsEventCause(), _this.buildCustomDataForPartialQueries(index, suggestions));\n });\n }\n else {\n // Here : the user either very slowly chose a suggestion, and there is no search as you typed queued up\n // AND\n // the user chose the first suggestion.\n // this means the query is already returned, but the analytics event is still queued up.\n // modify the analytics event, and send it.\n this.modifyEventTo = this.getOmniboxAnalyticsEventCause();\n this.modifyCustomDataOnPending(index, suggestions);\n this.modifyQueryContentOnPending();\n this.usageAnalytics.sendAllPendingEvents();\n // This should happen if :\n // users did a (short) query first, which does not match the first suggestion. (eg: typed \"t\", then search)\n // then, refocus the search box. The same suggestion(s) will re-appear.\n // By selecting the first one with the mouse, we need to retrigger a query because this means the search as you type could not\n // kick in and do the query automatically.\n if (this.lastQuery != this.getText()) {\n this.triggerNewQuery(false, function () {\n _this.usageAnalytics.logSearchEvent(_this.getOmniboxAnalyticsEventCause(), _this.buildCustomDataForPartialQueries(index, suggestions));\n });\n }\n }\n };\n Omnibox.prototype.modifyCustomDataOnPending = function (index, suggestions) {\n var pendingEvt = this.usageAnalytics.getPendingSearchEvent();\n if (pendingEvt instanceof PendingSearchAsYouTypeSearchEvent_1.PendingSearchAsYouTypeSearchEvent) {\n var newCustomData_1 = this.buildCustomDataForPartialQueries(index, suggestions);\n _.each(_.keys(newCustomData_1), function (k) {\n pendingEvt.modifyCustomData(k, newCustomData_1[k]);\n });\n }\n };\n Omnibox.prototype.modifyQueryContentOnPending = function () {\n var pendingEvt = this.usageAnalytics.getPendingSearchEvent();\n if (pendingEvt instanceof PendingSearchAsYouTypeSearchEvent_1.PendingSearchAsYouTypeSearchEvent) {\n var queryContent = this.getQuery(this.options.enableSearchAsYouType);\n pendingEvt.modifyQueryContent(queryContent);\n }\n };\n Omnibox.prototype.buildCustomDataForPartialQueries = function (index, suggestions) {\n this.updateOmniboxAnalytics(suggestions, index);\n return this.omniboxAnalytics.buildCustomDataForPartialQueries();\n };\n Omnibox.prototype.handleQuerySuggestGetFocus = function (_a) {\n var suggestion = _a.suggestion;\n var suggestions = _.compact(_.map(this.lastSuggestions, function (suggestion) { return suggestion.text; }));\n var ranking = this.lastSuggestions.indexOf(underscore_1.findWhere(this.lastSuggestions, { text: suggestion }));\n this.updateOmniboxAnalytics(suggestions, ranking);\n };\n Omnibox.prototype.updateOmniboxAnalytics = function (suggestions, suggestionRanking) {\n this.omniboxAnalytics.suggestions = suggestions;\n this.omniboxAnalytics.suggestionRanking = suggestionRanking;\n };\n Omnibox.prototype.handleSuggestions = function () {\n var text = this.getText();\n if (this.options.querySuggestCharacterThreshold <= text.length) {\n var suggestionsEventArgs = {\n suggestions: [],\n omnibox: this\n };\n this.triggerOmniboxSuggestions(suggestionsEventArgs);\n if (!Utils_1.Utils.isNullOrEmptyString(text)) {\n this.omniboxAnalytics.partialQueries.push(text);\n }\n return _.compact(suggestionsEventArgs.suggestions);\n }\n else {\n return [];\n }\n };\n Omnibox.prototype.triggerOmniboxSuggestions = function (args) {\n this.bind.trigger(this.element, OmniboxEvents_1.OmniboxEvents.populateOmniboxSuggestions, args);\n if (!Dom_1.$$(this.element).isDescendant(this.root)) {\n this.bind.trigger(this.root, OmniboxEvents_1.OmniboxEvents.populateOmniboxSuggestions, args);\n }\n };\n Omnibox.prototype.handleBeforeRedirect = function () {\n this.updateQueryState();\n };\n Omnibox.prototype.handleBuildingQuery = function (data) {\n var _this = this;\n Assert_1.Assert.exists(data);\n Assert_1.Assert.exists(data.queryBuilder);\n this.updateQueryState();\n this.lastQuery = this.getQuery(data.searchAsYouType);\n var result = this.lastQuery == this.magicBox.getDisplayedResult().input\n ? this.magicBox.getDisplayedResult().clone()\n : this.magicBox.grammar.parse(this.lastQuery).clean();\n var preprocessResultForQueryArgs = {\n result: result\n };\n if (this.options.enableQuerySyntax) {\n var notQuotedValues = preprocessResultForQueryArgs.result.findAll('FieldValueNotQuoted');\n _.each(notQuotedValues, function (value) { return (value.value = '\"' + value.value.replace(/\"|\\u00A0/g, ' ') + '\"'); });\n if (this.options.fieldAlias) {\n var fieldNames = preprocessResultForQueryArgs.result.findAll(function (result) { return result.expression.id == 'FieldName' && result.isSuccess(); });\n _.each(fieldNames, function (result) {\n var alias = _.find(_.keys(_this.options.fieldAlias), function (alias) { return alias.toLowerCase() == result.value.toLowerCase(); });\n if (alias != null) {\n result.value = _this.options.fieldAlias[alias];\n }\n });\n }\n }\n this.triggerOmniboxPreprocessResultForQuery(preprocessResultForQueryArgs);\n var query = preprocessResultForQueryArgs.result.toString();\n new QueryboxQueryParameters_1.QueryboxQueryParameters(this.options).addParameters(data.queryBuilder, query);\n };\n Omnibox.prototype.triggerOmniboxPreprocessResultForQuery = function (args) {\n this.bind.trigger(this.element, OmniboxEvents_1.OmniboxEvents.omniboxPreprocessResultForQuery, args);\n if (!Dom_1.$$(this.element).isDescendant(this.root)) {\n this.bind.trigger(this.root, OmniboxEvents_1.OmniboxEvents.omniboxPreprocessResultForQuery, args);\n }\n };\n Omnibox.prototype.handleNewQuery = function (data) {\n Assert_1.Assert.exists(data);\n this.options.clearFiltersOnNewQuery && this.clearFiltersIfNewQuery(data);\n };\n Omnibox.prototype.clearFiltersIfNewQuery = function (_a) {\n var origin = _a.origin, searchAsYouType = _a.searchAsYouType;\n if (this.queryController.firstQuery) {\n return;\n }\n // Prevent queries triggered by unrelated components to clear the the filters\n // e.g., a facet selection\n var validOrigins = [Omnibox.ID, 'SearchButton'];\n if (!origin || validOrigins.indexOf(origin.type) === -1) {\n return;\n }\n var lastQuery = this.queryController.getLastQuery().q || '';\n var newQuery = this.getQuery(searchAsYouType);\n if (lastQuery !== newQuery) {\n this.bind.trigger(this.root, BreadcrumbEvents_1.BreadcrumbEvents.clearBreadcrumb);\n }\n };\n Omnibox.prototype.handleTabPress = function () {\n if (this.options.enableQuerySuggestAddon) {\n this.handleTabPressForSuggestions();\n }\n this.handleTabPressForOldOmniboxAddon();\n };\n Omnibox.prototype.handleTabPressForSuggestions = function () {\n if (!this.options.enableSearchAsYouType) {\n var suggestions = _.compact(_.map(this.lastSuggestions, function (suggestion) { return suggestion.text; }));\n this.usageAnalytics.logCustomEvent(this.getOmniboxAnalyticsEventCause(), this.buildCustomDataForPartialQueries(0, suggestions), this.element);\n }\n else {\n this.setText(this.getQuery(true));\n }\n };\n Omnibox.prototype.handleTabPressForOldOmniboxAddon = function () {\n var domSuggestions = this.lastSuggestions.filter(function (suggestions) { return suggestions.dom; }).map(function (suggestions) { return Dom_1.$$(suggestions.dom); });\n var selected = this.findAllElementsWithClass(domSuggestions, '.coveo-omnibox-selected');\n if (selected.length > 0) {\n Dom_1.$$(selected[0]).trigger('tabSelect');\n }\n else if (!this.options.enableQuerySuggestAddon) {\n var selectable = this.findAllElementsWithClass(domSuggestions, '.coveo-omnibox-selectable');\n if (selectable.length > 0) {\n Dom_1.$$(selectable[0]).trigger('tabSelect');\n }\n }\n };\n Omnibox.prototype.findAllElementsWithClass = function (elements, className) {\n return elements\n .map(function (element) { return element.find(className); })\n .filter(function (s) { return s; })\n .reduce(function (total, s) { return total.concat(s); }, []);\n };\n Omnibox.prototype.triggerNewQuery = function (searchAsYouType, analyticsEvent) {\n clearTimeout(this.searchAsYouTypeTimeout);\n var shouldExecuteQuery = this.shouldExecuteQuery(searchAsYouType);\n this.lastQuery = this.getQuery(searchAsYouType);\n shouldExecuteQuery && analyticsEvent();\n this.queryController.executeQuery({\n searchAsYouType: searchAsYouType,\n logInActionsHistory: true,\n cancel: !shouldExecuteQuery,\n origin: this\n });\n };\n Omnibox.prototype.getQuery = function (searchAsYouType) {\n if (this.lastQuery == this.magicBox.getText()) {\n return this.lastQuery;\n }\n if (!searchAsYouType) {\n return this.magicBox.getText();\n }\n var wordCompletion = this.magicBox.getWordCompletion();\n if (wordCompletion != null) {\n return wordCompletion;\n }\n var currentOmniboxSuggestion = this.magicBox.getWordCompletion() || this.getFirstSuggestion();\n if (currentOmniboxSuggestion) {\n return currentOmniboxSuggestion;\n }\n if (this.isAutoSuggestion()) {\n return this.lastQuery || this.magicBox.getText();\n }\n return this.magicBox.getText();\n };\n Omnibox.prototype.getFirstSuggestion = function () {\n if (this.lastSuggestions == null) {\n return '';\n }\n if (this.lastSuggestions.length <= 0) {\n return '';\n }\n var textSuggestion = _.find(this.lastSuggestions, function (suggestion) { return suggestion.text != null; });\n if (textSuggestion == null) {\n return '';\n }\n return textSuggestion.text;\n };\n Omnibox.prototype.updateQueryState = function () {\n this.queryStateModel.set(QueryStateModel_1.QueryStateModel.attributesEnum.q, this.magicBox.getText());\n };\n Omnibox.prototype.handleQueryStateChanged = function (args) {\n Assert_1.Assert.exists(args);\n var q = args.value;\n if (q != this.magicBox.getText()) {\n this.magicBox.setText(q);\n }\n };\n Omnibox.prototype.handleQuerySuccess = function () {\n if (!this.isAutoSuggestion()) {\n this.omniboxAnalytics.partialQueries = [];\n }\n };\n Omnibox.prototype.handleDuringQuery = function (args) {\n var _this = this;\n // When the query results returns ... (args.promise)\n args.promise.then(function () {\n // Get a handle on a pending search as you type (those events are delayed, not sent instantly)\n var pendingEvent = _this.usageAnalytics.getPendingSearchEvent();\n if (pendingEvent instanceof PendingSearchAsYouTypeSearchEvent_1.PendingSearchAsYouTypeSearchEvent) {\n pendingEvent.beforeResolve.then(function (evt) {\n // Check if we need to modify the event type beforeResolving it\n args.promise.then(function () {\n if (_this.modifyEventTo) {\n evt.modifyEventCause(_this.modifyEventTo);\n _this.modifyEventTo = null;\n }\n });\n });\n }\n });\n };\n Omnibox.prototype.searchAsYouType = function (forceExecuteQuery) {\n var _this = this;\n if (forceExecuteQuery === void 0) { forceExecuteQuery = false; }\n this.clearSearchAsYouType();\n if (this.shouldExecuteQuery(true)) {\n this.searchAsYouTypeTimeout = window.setTimeout(function () {\n if (_this.suggestionShouldTriggerQuery() || forceExecuteQuery) {\n var suggestions_1 = _.map(_this.lastSuggestions, function (suggestion) { return suggestion.text; });\n var index_1 = _.indexOf(suggestions_1, _this.magicBox.getWordCompletion());\n _this.triggerNewQuery(true, function () {\n _this.usageAnalytics.logSearchAsYouType(AnalyticsActionListMeta_1.analyticsActionCauseList.searchboxAsYouType, _this.buildCustomDataForPartialQueries(index_1, suggestions_1));\n });\n _this.clearSearchAsYouType();\n }\n }, this.options.searchAsYouTypeDelay);\n }\n };\n Omnibox.prototype.isAutoSuggestion = function () {\n return this.options.enableSearchAsYouType && this.options.enableQuerySuggestAddon;\n };\n Omnibox.prototype.shouldExecuteQuery = function (searchAsYouType) {\n var text = this.getQuery(searchAsYouType);\n if (this.searchInterface.options.allowQueriesWithoutKeywords === false) {\n return this.lastQuery != text && Utils_1.Utils.isNonEmptyString(text);\n }\n return this.lastQuery != text && text != null;\n };\n Omnibox.prototype.suggestionShouldTriggerQuery = function (suggestions) {\n if (suggestions === void 0) { suggestions = this.lastSuggestions; }\n if (this.shouldExecuteQuery(true)) {\n if (suggestions && suggestions[0]) {\n var suggestion = suggestions[0];\n // If we have access to a confidence level, return true if we are equal or above the minimum confidence level.\n if (suggestion && suggestion.executableConfidence != undefined) {\n return suggestion.executableConfidence >= MINIMUM_EXECUTABLE_CONFIDENCE;\n }\n // If we don't have access to a confidence level, return true only if it \"starts with\" the content of the search box\n if (suggestion.text && suggestion.text.indexOf(this.magicBox.getText()) == 0) {\n return true;\n }\n }\n }\n return false;\n };\n Omnibox.prototype.clearSearchAsYouType = function () {\n clearTimeout(this.searchAsYouTypeTimeout);\n this.searchAsYouTypeTimeout = undefined;\n };\n Omnibox.prototype.getOmniboxAnalyticsEventCause = function () {\n if (this.searchInterface instanceof SearchInterface_1.StandaloneSearchInterface) {\n return AnalyticsActionListMeta_1.analyticsActionCauseList.omniboxFromLink;\n }\n return AnalyticsActionListMeta_1.analyticsActionCauseList.omniboxAnalytics;\n };\n Omnibox.ID = 'Omnibox';\n Omnibox.doExport = function () {\n GlobalExports_1.exportGlobally({\n Omnibox: Omnibox,\n QueryboxQueryParameters: QueryboxQueryParameters_1.QueryboxQueryParameters\n });\n };\n /**\n * The options for the omnibox\n * @componentOptions\n */\n Omnibox.options = {\n /**\n * Specifies whether query completion suggestions appearing in the `Omnibox` should push the result list and facets\n * down, rather than rendering themselves over them (and partially hiding them).\n *\n * Set this option as well as {@link Omnibox.options.enableSearchAsYouType} and\n * {@link Omnibox.options.enableQuerySuggestAddon} to `true` for a cool effect!\n *\n * Default value is `false`.\n */\n inline: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false }),\n /**\n * Whether to automatically trigger a new query whenever the end user types additional text in the search box input.\n *\n * See also the [`searchAsYouTypeDelay`]{@link Omnibox.options.searchAsYouTypeDelay} option.\n *\n * **Note:**\n * > If you set this option and the [`enableQuerySuggestAddon`]{@link Omnibox.options.enableQuerySuggestAddon}\n * > option to `true`, the query suggestion feature returns the auto-completion of the currently typed keyword as\n * > its first suggestion.\n *\n * Default value is `false`.\n */\n enableSearchAsYouType: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false, section: 'Advanced Options' }),\n /**\n * If {@link Omnibox.options.enableSearchAsYouType} is `true`, specifies the delay (in milliseconds) before\n * triggering a new query when the end user types in the `Omnibox`.\n *\n * Default value is `2000`. Minimum value is `0`.\n */\n searchAsYouTypeDelay: ComponentOptions_1.ComponentOptions.buildNumberOption({\n defaultValue: 2000,\n min: 0,\n depend: 'enableSearchAsYouType',\n section: 'Advanced Options'\n }),\n /**\n * The `field` addon makes the `Omnibox` highlight and complete field syntax. Setting this option to `true` automatically sets\n * the [enableQuerySyntax]{@link Querybox.options.enableQuerySyntax} option to `true` as a side effect.\n *\n * **Example:**\n * > Suppose you want to search for PDF files. You start typing `@f` in the search box. The `Omnibox` provides\n * > you with several matching fields. You select the `@filetype` field. Then, you start typing `=p` in the input.\n * > This time, the `Omnibox` provides you with several matching values for the `@filetype` field. You select the\n * > `pdf` suggestion, and submit your search request. Since the `enableQuerySyntax` option is set to `true`, the\n * > Coveo Search API interprets the basic expression as query syntax and returns the items whose `@filetype` field\n * > matches the `pdf` value.\n *\n * Default value is `false`.\n */\n enableFieldAddon: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n defaultValue: false,\n depend: 'enableQuerySyntax',\n postProcessing: function (value, options) {\n if (value) {\n options.enableQuerySyntax = true;\n }\n return value;\n },\n section: 'Advanced Options'\n }),\n enableSimpleFieldAddon: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false, depend: 'enableFieldAddon' }),\n listOfFields: ComponentOptions_1.ComponentOptions.buildFieldsOption({ depend: 'enableFieldAddon' }),\n /**\n * Whether to display Coveo Machine Learning (Coveo ML) query suggestions in the `Omnibox`.\n *\n * A Coveo ML query suggestions (QS) model must be properly configured in your Coveo Cloud organization, otherwise this\n * option has no effect (see\n * [Create a QS Model](https://docs.coveo.com/en/1832/#create-a-qs-model)).\n *\n * **Note:**\n * > When you set this option and the [`enableSearchAsYouType`]{@link Omnibox.options.enableSearchAsYouType} option\n * > to `true`, the query suggestion feature returns the auto-completion of the currently typed keyword as its first\n * > query suggestion.\n *\n * @availablesince [December 2015 Release (v1.0.273)](https://docs.coveo.com/en/289/#december-2015-release-v10273)\n */\n enableQuerySuggestAddon: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n defaultValue: true,\n alias: ['enableTopQueryAddon', 'enableRevealQuerySuggestAddon']\n }),\n /**\n * If {@link Querybox.options.enableQuerySyntax} is `true`, specifies whether to enable the `query extension` addon.\n *\n * The `query extension` addon allows the Omnibox to complete the syntax for query extensions.\n *\n * Default value is `false`.\n */\n enableQueryExtensionAddon: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n defaultValue: false,\n depend: 'enableQuerySyntax',\n postProcessing: function (value, options) {\n if (value) {\n options.enableQuerySyntax = true;\n }\n return value;\n },\n section: 'Advanced Options'\n }),\n /**\n * Specifies a placeholder for the input.\n *\n * @availablesince [July 2016 Release (v1.667.24)](https://docs.coveo.com/en/309/#july-2016-release-v166724)\n */\n placeholder: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption(),\n /**\n * Specifies a timeout (in milliseconds) before rejecting suggestions in the Omnibox.\n *\n * Default value is `2000`. Minimum value is `0`.\n */\n omniboxTimeout: ComponentOptions_1.ComponentOptions.buildNumberOption({ defaultValue: 2000, min: 0 }),\n /**\n * Specifies whether the Coveo Platform should try to interpret special query syntax such as field references in the\n * query that the user enters in the Querybox (see\n * [Coveo Query Syntax Reference](https://docs.coveo.com/en/1552/searching-with-coveo/coveo-cloud-query-syntax)).\n *\n * Setting this option to `true` also causes the query syntax in the Querybox to highlight.\n *\n * Default value is `false`.\n */\n enableQuerySyntax: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n defaultValue: false,\n section: 'Advanced Options'\n }),\n /**\n * Specifies the number of suggestions that should appear in standard ML-powered query suggestions.\n *\n * This option only affects the number of suggestions that appear with the {@link Omnibox.options.enableQuerySuggestAddon} option.\n *\n * This options does not affect the {@link AnalyticsSuggestions} or the {@link FieldSuggestions} component, which expose their own dedicated options for this parameter.\n *\n * Default value is `5`.\n *\n * Minimum value is `1`.\n */\n numberOfSuggestions: ComponentOptions_1.ComponentOptions.buildNumberOption({\n defaultValue: 5,\n min: 1\n }),\n /**\n * The minimum number of characters required in the in the text input before displaying available query suggestions when focus is on the component.\n *\n * Note: Only effective when [enableQuerySuggestAddon]{@link Omnibox.options.enableQuerySuggestAddon} is true.\n *\n * depend: 'enableQuerySuggestAddon'\n *\n * Default (and minimum): 0, meaning that trending query suggestions are displayed when focus is on the component, even if its text input is empty.\n *\n * @availablesince [July 2019 Release (v2.6459)](https://docs.coveo.com/en/2938/)\n */\n querySuggestCharacterThreshold: ComponentOptions_1.ComponentOptions.buildNumberOption({\n defaultValue: 0,\n min: 0\n }),\n /**\n * Whether to clear all active query filters when the end user submits a new query from the search box.\n *\n * Note: This does not include the filter expression enforced by the currently selected tab, if any.\n *\n * @availablesince [September 2019 Release (v2.7023)](https://docs.coveo.com/en/2990/)\n */\n clearFiltersOnNewQuery: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false })\n };\n return Omnibox;\n}(Component_1.Component));\nexports.Omnibox = Omnibox;\nOmnibox.options = __assign({}, Omnibox.options, Querybox_1.Querybox.options);\nInitialization_1.Initialization.registerAutoCreateComponent(Omnibox);\n\n\n/***/ }),\n/* 193 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom_1 = __webpack_require__(1);\nvar _ = __webpack_require__(0);\nvar Strings_1 = __webpack_require__(6);\n__webpack_require__(578);\nvar Utils_1 = __webpack_require__(4);\nvar GlobalExports_1 = __webpack_require__(3);\n/**\n * A multi select widget with standard styling.\n */\nvar MultiSelect = /** @class */ (function () {\n /**\n * Creates a new `MultiSelect`.\n * @param onChange The function to call when the widget selected values change. This function takes the current\n * `MultiSelect` instance as an argument.\n * @param options The values which can be selected with the multi select.\n * @param label The label to display for the multi select.\n */\n function MultiSelect(onChange, options, label) {\n if (onChange === void 0) { onChange = function (multiSelect) { }; }\n this.onChange = onChange;\n this.options = options;\n this.label = label;\n this.buildContent();\n }\n MultiSelect.doExport = function () {\n GlobalExports_1.exportGlobally({\n MultiSelect: MultiSelect\n });\n };\n /**\n * Gets the element on which the multi select is bound.\n * @returns {HTMLSelectElement} The multi select element.\n */\n MultiSelect.prototype.build = function () {\n return this.element;\n };\n /**\n * Gets the element on which the multi select is bound.\n * @returns {HTMLSelectElement} The multi select element.\n */\n MultiSelect.prototype.getElement = function () {\n return this.element;\n };\n /**\n * Gets the currently selected values.\n * @returns {string[]} The array of selected multi select values.\n */\n MultiSelect.prototype.getValue = function () {\n return _.chain(this.element.options)\n .toArray()\n .filter(function (opt) { return opt.selected; })\n .map(function (selected) { return selected.value; })\n .value();\n };\n /**\n * Gets the currently un-selected values.\n * @returns {string[]} The array of un-selected multi select values.\n */\n MultiSelect.prototype.getUnselectedValues = function () {\n return _.chain(this.element.options)\n .toArray()\n .filter(function (opt) { return !opt.selected; })\n .map(function (selected) { return selected.value; })\n .value();\n };\n /**\n * Sets the currently selected values.\n * @param values The values to select.\n */\n MultiSelect.prototype.setValue = function (values) {\n var currentlySelected = this.getValue();\n var currentStateSplit = _.partition(_.toArray(this.element.options), function (opt) {\n return _.contains(currentlySelected, opt.value);\n });\n var newStateToApplySplit = _.partition(_.toArray(this.element.options), function (opt) { return _.contains(values, opt.value); });\n _.each(newStateToApplySplit[0], function (toSelect) { return (toSelect.selected = true); });\n _.each(newStateToApplySplit[1], function (toUnSelect) { return (toUnSelect.selected = false); });\n var hasChanged = false;\n if (!Utils_1.Utils.arrayEqual(currentStateSplit[0], newStateToApplySplit[0], false)) {\n hasChanged = true;\n }\n if (!Utils_1.Utils.arrayEqual(currentStateSplit[1], newStateToApplySplit[1], false)) {\n hasChanged = true;\n }\n if (hasChanged) {\n Dom_1.$$(this.element).trigger('change');\n }\n };\n /**\n * Resets the multi select.\n */\n MultiSelect.prototype.reset = function () {\n var currentlySelected = this.getValue();\n this.element.selectedIndex = -1;\n if (!Utils_1.Utils.isEmptyArray(currentlySelected)) {\n Dom_1.$$(this.element).trigger('change');\n }\n };\n MultiSelect.prototype.buildContent = function () {\n var _this = this;\n this.element = Dom_1.$$('select', {\n className: 'coveo-multi-select',\n multiple: '',\n size: this.options.length.toString()\n }).el;\n var optgroup = Dom_1.$$('optgroup', {\n className: 'coveo-list-group',\n label: this.label\n });\n var options = _.map(this.options, function (opt) {\n return Dom_1.$$('option', { value: opt, className: 'coveo-list-item' }, Strings_1.l(opt));\n });\n _.each(options, function (opt) { return optgroup.append(opt.el); });\n this.element.appendChild(optgroup.el);\n Dom_1.$$(this.element).on('change', function () { return _this.onChange(_this); });\n };\n return MultiSelect;\n}());\nexports.MultiSelect = MultiSelect;\n\n\n/***/ }),\n/* 194 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar GlobalExports_1 = __webpack_require__(3);\nvar Strings_1 = __webpack_require__(6);\nvar AccessibleButton_1 = __webpack_require__(15);\nvar Dom_1 = __webpack_require__(1);\nvar SVGDom_1 = __webpack_require__(16);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Utils_1 = __webpack_require__(4);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Component_1 = __webpack_require__(7);\nvar Initialization_1 = __webpack_require__(2);\nvar QueryStateModel_1 = __webpack_require__(13);\n/**\n * The SearchButton component renders a search icon that the end user can click to trigger a new query.\n *\n * See also the {@link Searchbox} component, which can automatically instantiate a SearchButton component along with a\n * {@link Querybox} component or an {@link Omnibox} component.\n */\nvar SearchButton = /** @class */ (function (_super) {\n __extends(SearchButton, _super);\n /**\n * Creates a new SearchButton. Binds a `click` event on the element. Adds a search icon on the element.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the SearchButton component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n function SearchButton(element, options, bindings) {\n var _this = _super.call(this, element, SearchButton.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n new AccessibleButton_1.AccessibleButton()\n .withElement(element)\n .withOwner(_this.bind)\n .withLabel(Strings_1.l('Search'))\n .withSelectAction(function () { return _this.handleClick(); })\n .build();\n // Provide a magnifier icon if element contains nothing\n if (Utils_1.Utils.trim(Dom_1.$$(_this.element).text()) == '') {\n var svgMagnifierContainer = Dom_1.$$('span', { className: 'coveo-search-button' }, SVGIcons_1.SVGIcons.icons.search).el;\n SVGDom_1.SVGDom.addClassToSVGInContainer(svgMagnifierContainer, 'coveo-search-button-svg');\n var svgLoadingAnimationContainer = Dom_1.$$('span', { className: 'coveo-search-button-loading' }, SVGIcons_1.SVGIcons.icons.loading).el;\n SVGDom_1.SVGDom.addClassToSVGInContainer(svgLoadingAnimationContainer, 'coveo-search-button-loading-svg');\n element.appendChild(svgMagnifierContainer);\n element.appendChild(svgLoadingAnimationContainer);\n }\n return _this;\n }\n /**\n * Triggers the `click` event handler, which logs a `searchboxSubmit` event in the usage analytics and executes a\n * query.\n */\n SearchButton.prototype.click = function () {\n this.handleClick();\n };\n SearchButton.prototype.handleClick = function () {\n this.logger.debug('Performing query following button click');\n this.updateQueryStateModelWithSearchboxQuery();\n this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.searchboxSubmit, {});\n this.queryController.executeQuery({ origin: this, logInActionsHistory: true });\n };\n SearchButton.prototype.updateQueryStateModelWithSearchboxQuery = function () {\n var searchbox = this.options && this.options.searchbox;\n searchbox && this.queryStateModel.set(QueryStateModel_1.QueryStateModel.attributesEnum.q, searchbox.getText());\n };\n SearchButton.ID = 'SearchButton';\n SearchButton.doExport = function () {\n GlobalExports_1.exportGlobally({\n SearchButton: SearchButton\n });\n };\n SearchButton.options = {};\n return SearchButton;\n}(Component_1.Component));\nexports.SearchButton = SearchButton;\nInitialization_1.Initialization.registerAutoCreateComponent(SearchButton);\n\n\n/***/ }),\n/* 195 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(579);\nvar GlobalExports_1 = __webpack_require__(3);\nvar QueryEvents_1 = __webpack_require__(11);\nvar Assert_1 = __webpack_require__(5);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar Dom_1 = __webpack_require__(1);\nvar SVGDom_1 = __webpack_require__(16);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Utils_1 = __webpack_require__(4);\nvar SharedAnalyticsCalls_1 = __webpack_require__(125);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar SortCriteria_1 = __webpack_require__(505);\nvar AccessibleButton_1 = __webpack_require__(15);\nvar Strings_1 = __webpack_require__(6);\nvar underscore_1 = __webpack_require__(0);\n/**\n * The `Sort` component renders a widget that the end user can interact with to select the criterion to use when sorting query results.\n *\n * To improve accessibility, it's recommended to group `Sort` components in a container with `role=\"radiogroup\"`.\n */\nvar Sort = /** @class */ (function (_super) {\n __extends(Sort, _super);\n /**\n * Creates a new `Sort` component instance.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for this component instance.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n function Sort(element, options, bindings) {\n var _this = _super.call(this, element, Sort.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Sort, options);\n Assert_1.Assert.isLargerOrEqualsThan(1, _this.options.sortCriteria.length);\n _this.bind.onQueryState(Model_1.MODEL_EVENTS.CHANGE_ONE, QueryStateModel_1.QUERY_STATE_ATTRIBUTES.SORT, function () { return _this.handleQueryStateChanged(); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.querySuccess, function (args) { return _this.handleQuerySuccess(args); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.buildingQuery, function (args) { return _this.handleBuildingQuery(args); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.queryError, function (args) { return _this.handleQueryError(args); });\n _this.ensureDom();\n return _this;\n }\n Sort.prototype.createDom = function () {\n var _this = this;\n var el = Dom_1.$$(this.element);\n el.on('click', function () { return _this.selectAndExecuteQuery(); });\n var innerText = el.text();\n el.empty();\n this.findOrCreateRadioGroup();\n this.createSortButton(innerText);\n if (this.isToggle()) {\n this.createDirectionButton();\n }\n this.update();\n };\n /**\n * Selects this `Sort` component.\n *\n * Updates the state model if selecting this component toggles its current [`sortCriteria`]{@link Sort.options.sortCriteria}.\n *\n * @param direction The sort direction. Can be one of: `ascending`, `descending`.\n */\n Sort.prototype.select = function (direction) {\n if (direction) {\n this.currentCriteria = underscore_1.find(this.options.sortCriteria, function (criteria) {\n return criteria.direction == direction;\n });\n this.updateQueryStateModel();\n }\n else if (Utils_1.Utils.exists(this.currentCriteria)) {\n this.selectNextCriteria();\n }\n else {\n this.selectFirstCriteria();\n }\n };\n /**\n * Selects this `Sort` component, then triggers a query if selecting this component toggles its current [`sortCriteria`]{@link Sort.options.sortCriteria}.\n *\n * Also logs an event in the usage analytics with the new current sort criteria.\n */\n Sort.prototype.selectAndExecuteQuery = function () {\n var oldCriteria = this.currentCriteria;\n this.select();\n if (oldCriteria != this.currentCriteria) {\n this.executeSearchQuery();\n }\n };\n Sort.prototype.enable = function () {\n Dom_1.$$(this.element).removeClass('coveo-tab-disabled');\n this.update();\n _super.prototype.enable.call(this);\n };\n Sort.prototype.disable = function () {\n Dom_1.$$(this.element).addClass('coveo-tab-disabled');\n _super.prototype.disable.call(this);\n };\n /**\n * Gets the current [`sortCriteria`]{@link Sort.options.sortCriteria} of this `Sort` component.\n * @returns {SortCriteria}\n */\n Sort.prototype.getCurrentCriteria = function () {\n return this.currentCriteria;\n };\n /**\n * Indicates whether the name of any of the available [`sortCriteria`]{@link Sort.options.sortCriteria} of this `Sort` component matches the argument.\n * @param sortId The sort criteria name to look for (e.g., `date descending`).\n */\n Sort.prototype.match = function (sortId) {\n return underscore_1.any(this.options.sortCriteria, function (sortCriteria) { return sortId == sortCriteria.toString(); });\n };\n Sort.prototype.findOrCreateRadioGroup = function () {\n this.radioGroup = this.findRadioGroup();\n if (!this.radioGroup) {\n this.element.setAttribute('role', 'radiogroup');\n this.radioGroup = this.element;\n }\n };\n Sort.prototype.createSortButton = function (innerText) {\n var _this = this;\n this.sortButton = Dom_1.$$('span').el;\n this.sortButton.innerText = this.options.caption || innerText;\n new AccessibleButton_1.AccessibleButton()\n .withElement(this.sortButton)\n .withEnterKeyboardAction(function () { return _this.selectAndExecuteQuery(); })\n .withArrowsAction(function (direction, e) { return _this.onArrowPressed(direction, e); })\n .withLabel(this.isToggle() ? this.getDirectionalLabel(this.initialDirection) : this.getOmnidirectionalLabel())\n .withRole('radio')\n .build();\n this.element.appendChild(this.sortButton);\n };\n Sort.prototype.createDirectionButton = function () {\n var _this = this;\n this.directionButton = Dom_1.$$.apply(void 0, ['span', { className: 'coveo-icon' }].concat(this.createIcons())).el;\n new AccessibleButton_1.AccessibleButton()\n .withElement(this.directionButton)\n .withSelectAction(function (e) {\n e.stopPropagation();\n _this.selectNextCriteriaAndExecuteQuery();\n })\n .withArrowsAction(function (direction, e) { return _this.onArrowPressed(direction, e); })\n .withLabel(this.getDirectionalLabel(this.initialDirection === SortCriteria_1.VALID_DIRECTION.DESCENDING ? SortCriteria_1.VALID_DIRECTION.ASCENDING : SortCriteria_1.VALID_DIRECTION.DESCENDING))\n .withRole('radio')\n .build();\n this.element.appendChild(this.directionButton);\n };\n Sort.prototype.onArrowPressed = function (direction, e) {\n this.selectNextRadioButton(direction === AccessibleButton_1.ArrowDirection.RIGHT || direction === AccessibleButton_1.ArrowDirection.DOWN ? 1 : -1);\n e.stopPropagation();\n };\n Sort.prototype.createIcons = function () {\n var iconAscending = Dom_1.$$('span', { className: 'coveo-sort-icon-ascending' }, SVGIcons_1.SVGIcons.icons.arrowUp);\n SVGDom_1.SVGDom.addClassToSVGInContainer(iconAscending.el, 'coveo-sort-icon-ascending-svg');\n var iconDescending = Dom_1.$$('span', { className: 'coveo-sort-icon-descending' }, SVGIcons_1.SVGIcons.icons.arrowDown);\n SVGDom_1.SVGDom.addClassToSVGInContainer(iconDescending.el, 'coveo-sort-icon-descending-svg');\n return [iconAscending, iconDescending];\n };\n Sort.prototype.findRadioGroup = function (element) {\n if (element === void 0) { element = this.element; }\n if (!element || element === document.body) {\n return null;\n }\n if (element.getAttribute('role') === 'radiogroup') {\n return element;\n }\n return this.findRadioGroup(element.parentElement);\n };\n Sort.prototype.selectNextRadioButton = function (direction) {\n if (direction === void 0) { direction = 1; }\n var radioButtons = Dom_1.$$(this.radioGroup).findAll('[role=\"radio\"]');\n var currentIndex = underscore_1.findIndex(radioButtons, function (radio) { return radio.getAttribute('aria-checked') === 'true'; });\n var indexToSelect;\n var isAnythingSelected = currentIndex !== -1;\n if (isAnythingSelected) {\n indexToSelect = (currentIndex + direction + radioButtons.length) % radioButtons.length;\n }\n else {\n if (direction >= 0) {\n indexToSelect = 0;\n }\n else {\n indexToSelect = radioButtons.length - 1;\n }\n }\n var radioToSelect = radioButtons[indexToSelect];\n radioToSelect.focus();\n radioToSelect.click();\n };\n Sort.prototype.executeSearchQuery = function () {\n var _this = this;\n this.queryController.deferExecuteQuery({\n beforeExecuteQuery: function () { return SharedAnalyticsCalls_1.logSortEvent(_this.usageAnalytics, _this.currentCriteria.sort + _this.currentCriteria.direction); }\n });\n };\n Sort.prototype.selectFirstCriteria = function () {\n this.currentCriteria = this.options.sortCriteria[0];\n this.updateQueryStateModel();\n };\n Sort.prototype.selectNextCriteria = function () {\n var indexOfCurrentCriteria = this.currentCriteria ? this.options.sortCriteria.indexOf(this.currentCriteria) : 0;\n this.currentCriteria = this.options.sortCriteria[(indexOfCurrentCriteria + 1) % this.options.sortCriteria.length];\n this.updateQueryStateModel();\n };\n Sort.prototype.selectNextCriteriaAndExecuteQuery = function () {\n var oldCriteria = this.currentCriteria;\n this.selectNextCriteria();\n if (oldCriteria != this.currentCriteria) {\n this.executeSearchQuery();\n }\n };\n Sort.prototype.handleQueryStateChanged = function () {\n this.update();\n };\n Sort.prototype.update = function () {\n // Basically, if the criteria in the model fits with one of ours, it'll become our active criteria\n var sortCriteria = this.queryStateModel.get(QueryStateModel_1.QueryStateModel.attributesEnum.sort);\n if (Utils_1.Utils.isNonEmptyString(sortCriteria)) {\n var criteriaFromModel = SortCriteria_1.SortCriteria.parse(sortCriteria);\n this.currentCriteria = underscore_1.find(this.options.sortCriteria, function (criteria) { return criteriaFromModel.equals(criteria); });\n }\n else {\n this.currentCriteria = null;\n }\n this.updateAppearance();\n this.updateAccessibilityProperties();\n };\n Object.defineProperty(Sort.prototype, \"captionIsDefined\", {\n get: function () {\n return Utils_1.Utils.isNonEmptyString(this.options.caption);\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sort.prototype, \"currentDirection\", {\n get: function () {\n return this.currentCriteria ? this.currentCriteria.direction : this.initialDirection;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sort.prototype, \"initialDirection\", {\n get: function () {\n return this.options.sortCriteria[0].direction;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(Sort.prototype, \"displayedSortText\", {\n get: function () {\n return this.captionIsDefined ? this.options.caption : this.element.textContent;\n },\n enumerable: true,\n configurable: true\n });\n Sort.prototype.handleBuildingQuery = function (data) {\n Assert_1.Assert.exists(data);\n var sort = this.queryStateModel.get(QueryStateModel_1.QueryStateModel.attributesEnum.sort);\n if (sort == QueryStateModel_1.QueryStateModel.defaultAttributes.sort || this.isSelected()) {\n if (this.currentCriteria) {\n this.currentCriteria.putInQueryBuilder(data.queryBuilder);\n }\n }\n };\n Sort.prototype.handleQuerySuccess = function (data) {\n if (data.results.results.length == 0) {\n Dom_1.$$(this.element).addClass('coveo-sort-hidden');\n }\n else {\n Dom_1.$$(this.element).removeClass('coveo-sort-hidden');\n }\n };\n Sort.prototype.handleQueryError = function (data) {\n Dom_1.$$(this.element).addClass('coveo-sort-hidden');\n };\n Sort.prototype.isToggle = function () {\n return this.options.sortCriteria.length > 1;\n };\n Sort.prototype.isSelected = function () {\n return Utils_1.Utils.exists(this.currentCriteria);\n };\n Sort.prototype.updateAppearance = function () {\n Dom_1.$$(this.element).toggleClass('coveo-selected', this.isSelected());\n if (this.isToggle()) {\n Dom_1.$$(this.element).removeClass('coveo-ascending');\n Dom_1.$$(this.element).removeClass('coveo-descending');\n if (this.isSelected()) {\n Dom_1.$$(this.element).addClass(this.currentDirection === 'ascending' ? 'coveo-ascending' : 'coveo-descending');\n }\n }\n };\n Sort.prototype.updateAccessibilityProperties = function () {\n this.sortButton.setAttribute('aria-controls', this.resultListsIds);\n var directionIsInitial = this.currentDirection === this.initialDirection;\n this.sortButton.setAttribute('aria-checked', \"\" + (this.isSelected() && directionIsInitial));\n if (this.isToggle()) {\n this.directionButton.setAttribute('aria-controls', this.resultListsIds);\n this.directionButton.setAttribute('aria-checked', \"\" + (this.isSelected() && !directionIsInitial));\n }\n };\n Object.defineProperty(Sort.prototype, \"resultListsIds\", {\n get: function () {\n var resultLists = this.searchInterface.getComponents('ResultList');\n return resultLists.map(function (resultList) { return resultList.element.id; }).join(' ');\n },\n enumerable: true,\n configurable: true\n });\n Sort.prototype.getDirectionalLabel = function (direction) {\n var localizedCaption = Strings_1.l(this.displayedSortText);\n return direction === SortCriteria_1.VALID_DIRECTION.DESCENDING\n ? Strings_1.l('SortResultsByDescending', localizedCaption)\n : Strings_1.l('SortResultsByAscending', localizedCaption);\n };\n Sort.prototype.getOmnidirectionalLabel = function () {\n var localizedCaption = Strings_1.l(this.displayedSortText);\n return Strings_1.l('SortResultsBy', localizedCaption);\n };\n Sort.prototype.updateQueryStateModel = function () {\n this.queryStateModel.set(QueryStateModel_1.QueryStateModel.attributesEnum.sort, this.currentCriteria.toString());\n };\n Sort.ID = 'Sort';\n Sort.doExport = function () {\n GlobalExports_1.exportGlobally({\n Sort: Sort,\n SortCriteria: SortCriteria_1.SortCriteria\n });\n };\n /**\n * Options for the component\n * @componentOptions\n */\n Sort.options = {\n /**\n * The sort criterion/criteria the end user can select/toggle between when interacting with this component instance.\n *\n * The available sort criteria are:\n * - `relevancy`\n * - `date ascending`/`date descending`\n * - `qre`\n * - `@field ascending`/`@field descending`, where you must replace `field` with the name of a sortable field in your index (e.g., `data-sort-criteria=\"@size ascending\"`).\n *\n * You can specify a comma separated list of sort criteria to toggle between when interacting with this component instance (e.g., `data-sort-criteria=\"date descending,date ascending\"`).\n *\n * You can specify multiple sort criteria to be used in the same request by separating them with a semicolon (e.g., `data-sort-criteria=\"@size ascending;date ascending\"` ).\n *\n * Interacting with this component instance will cycle through those criteria in the order they are listed in.\n * Typically, you should only specify a list of sort criteria when you want the end user to be able to to toggle the direction of a `date` or `@field` sort criteria.\n * Otherwise, you should configure a distinct `Sort` component instance for each sort criterion you want to make available in your search page.\n *\n * You must specify a valid value for this option in order for this component instance to work correctly.\n *\n * Examples:\n *\n * - `data-sort-criteria=\"date ascending\"` createes a Sort component that allows to sort on `date ascending`, without being able to toggle the order.\n * - `data-sort-criteria=\"date ascending, date descending\"` creates a Sort component that allows end users to toggle between `date ascending` and `date descending` on click.\n * - `data-sort-criteria=\"@size ascending; date descending\"` creates a Sort component that only allows end users to sort on `@size ascending`. The index then applies a second sort on `date descending` when two items are of equal value.\n * - `data-sort-criteria=\"@size ascending; date descending, @size descending; date descending\"` creates a Sort component that allows end users to toggle between `@size ascending` and `@size descending`. For each value, the index applies a second sort on `date descending` when two items are of equal value.\n */\n sortCriteria: ComponentOptions_1.ComponentOptions.buildCustomListOption(function (values) {\n return values.map(function (criteria) {\n // 'any' because Underscore won't accept the union type as an argument.\n if (typeof criteria === 'string') {\n return new SortCriteria_1.SortCriteria(criteria);\n }\n else {\n return criteria;\n }\n });\n }, { required: true }),\n /**\n * The caption to display on this component instance.\n *\n * By default, the component uses the text content of the element it is instanciated on.\n */\n caption: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({ required: true })\n };\n return Sort;\n}(Component_1.Component));\nexports.Sort = Sort;\nInitialization_1.Initialization.registerAutoCreateComponent(Sort);\n\n\n/***/ }),\n/* 196 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Core_1 = __webpack_require__(20);\nvar GlobalExports_1 = __webpack_require__(3);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar FieldValue_1 = __webpack_require__(124);\n/**\n * This component renders an image from a URL retrieved in a given [`field`]{@link ImageFieldValue.options.field}.\n *\n * A typical use case of this component is to display product images in the context of commerce.\n *\n * @isresulttemplatecomponent\n * @availablesince [September 2019 Release (v2.7023)](https://docs.coveo.com/en/2990/)\n */\nvar ImageFieldValue = /** @class */ (function (_super) {\n __extends(ImageFieldValue, _super);\n /**\n * Creates a new ImageFieldValue.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the ImageFieldValue component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n * @param result The result to associate the component with.\n */\n function ImageFieldValue(element, options, bindings, result) {\n var _this = _super.call(this, element, ImageFieldValue.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.result = result;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, ImageFieldValue, options);\n var fieldValueOption = {\n field: _this.options.field,\n helper: 'image',\n htmlValue: true,\n helperOptions: {\n height: _this.options.height,\n width: _this.options.width,\n alt: result.title,\n srcTemplate: _this.options.srcTemplate\n }\n };\n new FieldValue_1.FieldValue(element, fieldValueOption, bindings, result);\n return _this;\n }\n ImageFieldValue.ID = 'ImageFieldValue';\n ImageFieldValue.doExport = function () {\n GlobalExports_1.exportGlobally({\n ImageFieldValue: ImageFieldValue\n });\n };\n /**\n * The options for the component\n * @componentOptions\n */\n ImageFieldValue.options = {\n /**\n * **Required**. The name of a field whose value is the URL of the image to display.\n *\n * **Note:** The component uses the value of this field to set the `src` attribute of the [`img`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) HTML tag it generates.\n */\n field: ComponentOptions_1.ComponentOptions.buildFieldOption({ required: true }),\n /**\n * The width of the image (in pixels).\n *\n * **Note:** The component uses this value to set the `width` attribute of the [`img`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) HTML tag it generates.\n */\n width: ComponentOptions_1.ComponentOptions.buildNumberOption(),\n /**\n * The height of the image (in pixels).\n *\n * **Note:** The component uses this value to set the `height` attribute of the [`img`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/img) HTML tag it generates.\n */\n height: ComponentOptions_1.ComponentOptions.buildNumberOption(),\n /**\n * A [template literal](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Template_literals)\n * from which to generate the `img` tag's `src` attribute value.\n *\n * This option overrides the [`field`]{@link ImageFieldValue.options.field} option value.\n *\n * The template literal can reference any number of fields from the parent result. It can also reference global\n * scope properties.\n *\n * **Examples:**\n *\n * - The following markup generates an `src` value such as `http://uri.com?id=itemTitle`:\n *\n * ```html\n *
\n * ```\n *\n * - The following markup generates an `src` value such as `localhost/fooBar`:\n *\n * ```html\n *
\n * ```\n *\n * Default value is `undefined`.\n */\n srcTemplate: ComponentOptions_1.ComponentOptions.buildStringOption()\n };\n return ImageFieldValue;\n}(Core_1.Component));\nexports.ImageFieldValue = ImageFieldValue;\nCore_1.Initialization.registerAutoCreateComponent(ImageFieldValue);\n\n\n/***/ }),\n/* 197 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom_1 = __webpack_require__(1);\nvar PopupVerticalAlignment;\n(function (PopupVerticalAlignment) {\n PopupVerticalAlignment[PopupVerticalAlignment[\"TOP\"] = 0] = \"TOP\";\n PopupVerticalAlignment[PopupVerticalAlignment[\"MIDDLE\"] = 1] = \"MIDDLE\";\n PopupVerticalAlignment[PopupVerticalAlignment[\"BOTTOM\"] = 2] = \"BOTTOM\";\n PopupVerticalAlignment[PopupVerticalAlignment[\"INNERTOP\"] = 3] = \"INNERTOP\";\n PopupVerticalAlignment[PopupVerticalAlignment[\"INNERBOTTOM\"] = 4] = \"INNERBOTTOM\";\n})(PopupVerticalAlignment = exports.PopupVerticalAlignment || (exports.PopupVerticalAlignment = {}));\nvar PopupHorizontalAlignment;\n(function (PopupHorizontalAlignment) {\n PopupHorizontalAlignment[PopupHorizontalAlignment[\"LEFT\"] = 0] = \"LEFT\";\n PopupHorizontalAlignment[PopupHorizontalAlignment[\"CENTER\"] = 1] = \"CENTER\";\n PopupHorizontalAlignment[PopupHorizontalAlignment[\"RIGHT\"] = 2] = \"RIGHT\";\n PopupHorizontalAlignment[PopupHorizontalAlignment[\"INNERLEFT\"] = 3] = \"INNERLEFT\";\n PopupHorizontalAlignment[PopupHorizontalAlignment[\"INNERRIGHT\"] = 4] = \"INNERRIGHT\";\n})(PopupHorizontalAlignment = exports.PopupHorizontalAlignment || (exports.PopupHorizontalAlignment = {}));\nvar PopupUtils = /** @class */ (function () {\n function PopupUtils() {\n }\n PopupUtils.positionPopup = function (popUp, nextTo, boundary, desiredPosition, appendTo, checkForBoundary) {\n if (checkForBoundary === void 0) { checkForBoundary = 0; }\n popUp.style.position = 'absolute';\n if (appendTo) {\n Dom_1.$$(appendTo).append(popUp);\n }\n desiredPosition.verticalOffset = desiredPosition.verticalOffset ? desiredPosition.verticalOffset : 0;\n desiredPosition.horizontalOffset = desiredPosition.horizontalOffset ? desiredPosition.horizontalOffset : 0;\n var popUpPosition = Dom_1.$$(nextTo).offset();\n PopupUtils.basicVerticalAlignment(popUpPosition, popUp, nextTo, desiredPosition);\n PopupUtils.basicHorizontalAlignment(popUpPosition, popUp, nextTo, desiredPosition);\n PopupUtils.finalAdjustement(Dom_1.$$(popUp).offset(), popUpPosition, popUp, desiredPosition);\n var popUpBoundary = PopupUtils.getBoundary(popUp);\n var boundaryPosition = PopupUtils.getBoundary(boundary);\n if (checkForBoundary < 2) {\n var checkBoundary = PopupUtils.checkForOutOfBoundary(popUpBoundary, boundaryPosition);\n if (checkBoundary.horizontal != 'ok' && desiredPosition.horizontalClip === true) {\n var width = popUp.offsetWidth;\n if (popUpBoundary.left < boundaryPosition.left) {\n width -= boundaryPosition.left - popUpBoundary.left;\n }\n if (popUpBoundary.right > boundaryPosition.right) {\n width -= popUpBoundary.right - boundaryPosition.right;\n }\n popUp.style.width = width + 'px';\n checkBoundary.horizontal = 'ok';\n }\n if (checkBoundary.vertical != 'ok' || checkBoundary.horizontal != 'ok') {\n var newDesiredPosition = PopupUtils.alignInsideBoundary(desiredPosition, checkBoundary);\n PopupUtils.positionPopup(popUp, nextTo, boundary, newDesiredPosition, appendTo, checkForBoundary + 1);\n }\n }\n };\n PopupUtils.finalAdjustement = function (popUpOffSet, popUpPosition, popUp, desiredPosition) {\n var position = Dom_1.$$(popUp).position();\n popUp.style.top = position.top + desiredPosition.verticalOffset - (popUpOffSet.top - popUpPosition.top) + 'px';\n popUp.style.left = position.left + desiredPosition.horizontalOffset - (popUpOffSet.left - popUpPosition.left) + 'px';\n };\n PopupUtils.basicVerticalAlignment = function (popUpPosition, popUp, nextTo, desiredPosition) {\n switch (desiredPosition.vertical) {\n case PopupVerticalAlignment.TOP:\n popUpPosition.top -= popUp.offsetHeight;\n break;\n case PopupVerticalAlignment.BOTTOM:\n popUpPosition.top += nextTo.offsetHeight;\n break;\n case PopupVerticalAlignment.MIDDLE:\n popUpPosition.top -= popUp.offsetHeight / 3;\n case PopupVerticalAlignment.INNERTOP:\n break; // Nothing to do, it's the default alignment normally\n case PopupVerticalAlignment.INNERBOTTOM:\n popUpPosition.top -= popUp.offsetHeight - nextTo.offsetHeight;\n break;\n default:\n break;\n }\n };\n PopupUtils.basicHorizontalAlignment = function (popUpPosition, popUp, nextTo, desiredPosition) {\n switch (desiredPosition.horizontal) {\n case PopupHorizontalAlignment.LEFT:\n popUpPosition.left -= popUp.offsetWidth;\n break;\n case PopupHorizontalAlignment.RIGHT:\n popUpPosition.left += nextTo.offsetWidth;\n break;\n case PopupHorizontalAlignment.CENTER:\n popUpPosition.left += PopupUtils.offSetToAlignCenter(popUp, nextTo);\n break;\n case PopupHorizontalAlignment.INNERLEFT:\n break; // Nothing to do, it's the default alignment normally\n case PopupHorizontalAlignment.INNERRIGHT:\n popUpPosition.left -= popUp.offsetWidth - nextTo.offsetWidth;\n break;\n default:\n break;\n }\n };\n PopupUtils.alignInsideBoundary = function (oldPosition, checkBoundary) {\n var newDesiredPosition = oldPosition;\n if (checkBoundary.horizontal == 'left') {\n newDesiredPosition.horizontal = PopupHorizontalAlignment.RIGHT;\n }\n if (checkBoundary.horizontal == 'right') {\n newDesiredPosition.horizontal = PopupHorizontalAlignment.LEFT;\n }\n if (checkBoundary.vertical == 'top') {\n newDesiredPosition.vertical = PopupVerticalAlignment.BOTTOM;\n }\n if (checkBoundary.vertical == 'bottom') {\n newDesiredPosition.vertical = PopupVerticalAlignment.TOP;\n }\n return newDesiredPosition;\n };\n PopupUtils.offSetToAlignCenter = function (popUp, nextTo) {\n return (nextTo.offsetWidth - popUp.offsetWidth) / 2;\n };\n PopupUtils.getBoundary = function (element) {\n var boundaryOffset = Dom_1.$$(element).offset();\n var toAddVertically;\n if (element.tagName.toLowerCase() == 'body') {\n toAddVertically = Math.max(element.scrollHeight, element.offsetHeight);\n }\n else if (element.tagName.toLowerCase() == 'html') {\n toAddVertically = Math.max(element.clientHeight, element.scrollHeight, element.offsetHeight);\n }\n else {\n toAddVertically = element.offsetHeight;\n }\n return {\n top: boundaryOffset.top,\n left: boundaryOffset.left,\n right: boundaryOffset.left + element.offsetWidth,\n bottom: boundaryOffset.top + toAddVertically\n };\n };\n PopupUtils.checkForOutOfBoundary = function (popUpBoundary, boundary) {\n var ret = {\n vertical: 'ok',\n horizontal: 'ok'\n };\n if (popUpBoundary.top < boundary.top) {\n ret.vertical = 'top';\n }\n if (popUpBoundary.bottom > boundary.bottom) {\n ret.vertical = 'bottom';\n }\n if (popUpBoundary.left < boundary.left) {\n ret.horizontal = 'left';\n }\n if (popUpBoundary.right > boundary.right) {\n ret.horizontal = 'right';\n }\n return ret;\n };\n return PopupUtils;\n}());\nexports.PopupUtils = PopupUtils;\n\n\n/***/ }),\n/* 198 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n///
\n///
\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(614);\nvar underscore_1 = __webpack_require__(0);\nvar FacetSliderQueryController_1 = __webpack_require__(615);\nvar BreadcrumbEvents_1 = __webpack_require__(35);\nvar InitializationEvents_1 = __webpack_require__(17);\nvar QueryEvents_1 = __webpack_require__(11);\nvar SearchAlertEvents_1 = __webpack_require__(86);\nvar SliderEvents_1 = __webpack_require__(141);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Assert_1 = __webpack_require__(5);\nvar MiscModules_1 = __webpack_require__(73);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar Strings_1 = __webpack_require__(6);\nvar AccessibilityUtils_1 = __webpack_require__(48);\nvar Dom_1 = __webpack_require__(1);\nvar SVGDom_1 = __webpack_require__(16);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Utils_1 = __webpack_require__(4);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar FacetHeader_1 = __webpack_require__(483);\nvar Slider_1 = __webpack_require__(616);\nvar ResponsiveComponentsUtils_1 = __webpack_require__(130);\nvar ResponsiveDropdown_1 = __webpack_require__(123);\nvar ResponsiveFacetOptions_1 = __webpack_require__(84);\nvar ResponsiveFacetSlider_1 = __webpack_require__(618);\n/**\n * The `FacetSlider` component creates a facet which contains a slider widget that allows the end user to filter results\n * based on a range of numerical values (e.g., a date range, a price range, etc.).\n *\n * **Note:**\n * > This component does **not** inherit from the [`Facet`]{@link Facet} component. Consequently, it does not offer the\n * > same configuration options. Moreover, some of the `FacetSlider` options (see\n * > [`getSteps`]{@link FacetSlider.options.getSteps} and [`valueCaption`]{@link FacetSlider.options.valueCaption})\n * > cannot be configured as `data-` attributes in the markup. If you wish to configure those options, you must either\n * > do so in the [`init`]{@link init} call of your search interface (see\n * > [Passing Component Options in the init Call](https://docs.coveo.com/en/346/#passing-component-options-in-the-init-call)),\n * > or before the `init` call, using the `options` top-level function (see\n * > [Passing Component Options Before the init Call](https://docs.coveo.com/en/346/#passing-component-options-before-the-init-call)).\n * @notSupportedIn salesforcefree\n */\nvar FacetSlider = /** @class */ (function (_super) {\n __extends(FacetSlider, _super);\n /**\n * Creates a new `FacetSlider` component. Binds multiple query events as well.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the `FacetSlider` component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n * @param slider\n */\n function FacetSlider(element, options, bindings, slider) {\n var _this = _super.call(this, element, FacetSlider.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.slider = slider;\n _this.isSimpleSliderConfig = false;\n _this.isFieldValueCompatible = false;\n _this.isEmpty = false;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, FacetSlider, options);\n _this.isSimpleSliderConfig = _this.options.start != null && _this.options.end != null;\n ResponsiveFacetSlider_1.ResponsiveFacetSlider.init(_this.root, _this, _this.options);\n if (_this.options.excludeOuterBounds == null) {\n _this.options.excludeOuterBounds = false;\n }\n _this.normalizeStartAndEndOptionsValues();\n _this.facetQueryController = new FacetSliderQueryController_1.FacetSliderQueryController(_this);\n _this.bindQueryStateEvents();\n _this.bindQueryEvents();\n _this.bindResizeEvents();\n _this.bindBreadcrumbEvents();\n _this.bind.onRootElement(SearchAlertEvents_1.SearchAlertsEvents.searchAlertsPopulateMessage, function (args) {\n return _this.handlePopulateSearchAlerts(args);\n });\n return _this;\n }\n FacetSlider.prototype.isCurrentlyDisplayed = function () {\n if (!Dom_1.$$(this.element).isVisible()) {\n return false;\n }\n if (Dom_1.$$(this.element).hasClass('coveo-disabled-empty')) {\n return false;\n }\n return true;\n };\n FacetSlider.prototype.createDom = function () {\n this.facetHeader = new FacetHeader_1.FacetHeader({\n field: this.options.field,\n facetElement: this.element,\n title: this.options.title,\n enableClearElement: true,\n enableCollapseElement: true,\n facetSlider: this\n });\n this.element.appendChild(this.facetHeader.build());\n };\n /**\n * Resets the `FacetSlider` (meaning that you need to set the range value as inactive).\n */\n FacetSlider.prototype.reset = function () {\n if (this.slider) {\n this.slider.initializeState();\n this.updateQueryState();\n this.updateAppearanceDependingOnState();\n }\n };\n /**\n * Gets the current selection in the slider.\n *\n * **Note:**\n * > This method returns an array of number for selected date values. These numbers represent a number of milliseconds\n * > before or after January 1, 1970. Therefore, you can use these numbers to instantiate standard JavaScript Date\n * > objects.\n *\n * @returns {any} An array of number containing the first and last selected values, if possible. An array containing\n * two `undefined` values otherwise.\n */\n FacetSlider.prototype.getSelectedValues = function () {\n if (this.startOfSlider != undefined && this.endOfSlider != undefined) {\n return [this.startOfSlider, this.endOfSlider];\n }\n else {\n return [undefined, undefined];\n }\n };\n /**\n * Sets the selected values in the slider.\n *\n * **Note:**\n * > You must set date values with numbers representing a number of milliseconds before or after January 1, 1970. You\n * > can easily extract such numbers from standard JavaScript Date objects.\n *\n * @param values [start, end] An array containing the first and last values to select in the slider.\n */\n FacetSlider.prototype.setSelectedValues = function (values) {\n this.setupSliderIfNeeded(undefined);\n this.startOfSlider = values[0];\n this.endOfSlider = values[1];\n this.slider.setValues([this.startOfSlider, this.endOfSlider]);\n this.updateAppearanceDependingOnState();\n };\n /**\n * Indicates whether the `FacetSlider` is active. An active `FacetSlider` outputs an expression in the query when a\n * search is performed.\n * @returns {boolean} `true` if the FacetSlider is active; `false` otherwise.\n */\n FacetSlider.prototype.isActive = function () {\n return (!isNaN(this.startOfSlider) &&\n !isNaN(this.endOfSlider) &&\n !isNaN(this.initialStartOfSlider) &&\n !isNaN(this.initialEndOfSlider) &&\n (this.startOfSlider != this.initialStartOfSlider || this.endOfSlider != this.initialEndOfSlider));\n };\n FacetSlider.prototype.getSliderBoundaryForQuery = function () {\n var needToReturnABoundary = false;\n if (!this.slider) {\n needToReturnABoundary = true;\n }\n else if (this.slider && this.isActive()) {\n needToReturnABoundary = true;\n }\n if (needToReturnABoundary) {\n return this.generateBoundary();\n }\n else {\n return undefined;\n }\n };\n // There is delayed graph data if at the time the facet slider tried to draw, the facet was hidden in the\n // facet dropdown. This method will draw delayed graph data if it exists.\n FacetSlider.prototype.drawDelayedGraphData = function () {\n if (this.delayedGraphData != null && !this.isEmpty) {\n this.slider.drawGraph(this.delayedGraphData);\n }\n this.delayedGraphData = null;\n };\n FacetSlider.prototype.hasAGraph = function () {\n return this.options.graph != undefined;\n };\n FacetSlider.prototype.normalizeStartAndEndOptionsValues = function () {\n if (this.options.start) {\n this.options.start = this.options.dateField\n ? new Date(this.options.start.replace(/-/g, '/')).getTime()\n : Number(this.options.start);\n }\n if (this.options.end) {\n this.options.end = this.options.dateField\n ? new Date(this.options.end.replace(/-/g, '/')).getTime()\n : Number(this.options.end);\n }\n };\n FacetSlider.prototype.bindQueryEvents = function () {\n var _this = this;\n this.bind.onRootElement(QueryEvents_1.QueryEvents.newQuery, function () { return _this.handleNewQuery(); });\n this.bind.onRootElement(QueryEvents_1.QueryEvents.noResults, function () { return _this.handleNoresults(); });\n this.bind.onRootElement(QueryEvents_1.QueryEvents.deferredQuerySuccess, function (args) { return _this.handleDeferredQuerySuccess(args); });\n this.bind.onRootElement(QueryEvents_1.QueryEvents.buildingQuery, function (args) { return _this.handleBuildingQuery(args); });\n this.bind.onRootElement(QueryEvents_1.QueryEvents.doneBuildingQuery, function (args) { return _this.handleDoneBuildingQuery(args); });\n };\n FacetSlider.prototype.bindResizeEvents = function () {\n var _this = this;\n this.onResize = underscore_1.debounce(function () {\n if (ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.shouldDrawFacetSlider(Dom_1.$$(_this.root), Dom_1.$$(_this.element)) && _this.slider && !_this.isEmpty) {\n if (_this.delayedGraphData) {\n _this.drawDelayedGraphData();\n }\n else {\n _this.slider.drawGraph();\n }\n }\n if (_this.slider) {\n _this.slider.onMoving();\n }\n }, 250);\n window.addEventListener('resize', this.onResize);\n this.bind.onRootElement(ResponsiveDropdown_1.ResponsiveDropdownEvent.OPEN, this.onResize);\n // This is used inside SF integration\n this.bind.onRootElement('onPopupOpen', this.onResize);\n Dom_1.$$(this.root).on(InitializationEvents_1.InitializationEvents.nuke, function () { return _this.handleNuke(); });\n };\n FacetSlider.prototype.bindBreadcrumbEvents = function () {\n var _this = this;\n this.bind.onRootElement(BreadcrumbEvents_1.BreadcrumbEvents.clearBreadcrumb, function () { return _this.reset(); });\n this.bind.onRootElement(BreadcrumbEvents_1.BreadcrumbEvents.populateBreadcrumb, function (args) {\n return _this.handlePopulateBreadcrumb(args);\n });\n };\n FacetSlider.prototype.handleNoresults = function () {\n this.isEmpty = true;\n this.updateAppearanceDependingOnState();\n };\n FacetSlider.prototype.handleNewQuery = function () {\n this.isEmpty = false;\n };\n FacetSlider.prototype.handleRangeQueryStateChanged = function (args) {\n this.setupSliderIfNeeded(args);\n this.startOfSlider = args.value[0] == undefined ? this.startOfSlider : args.value[0];\n this.endOfSlider = args.value[1] == undefined ? this.endOfSlider : args.value[1];\n this.setSelectedValues([this.startOfSlider, this.endOfSlider]);\n };\n FacetSlider.prototype.handlePopulateBreadcrumb = function (args) {\n var _this = this;\n var populateBreadcrumb = function () {\n if (_this.isActive()) {\n args.breadcrumbs.push({\n element: _this.buildBreadcrumbFacetSlider(args.headingLevel)\n });\n }\n };\n if (this.slider) {\n populateBreadcrumb();\n }\n else {\n Dom_1.$$(this.root).one(QueryEvents_1.QueryEvents.deferredQuerySuccess, function () {\n populateBreadcrumb();\n Dom_1.$$(_this.root).trigger(BreadcrumbEvents_1.BreadcrumbEvents.redrawBreadcrumb);\n });\n }\n };\n FacetSlider.prototype.handlePopulateSearchAlerts = function (args) {\n if (this.isActive()) {\n args.text.push(Dom_1.$$(this.buildBreadcrumbFacetSlider()).text());\n }\n };\n FacetSlider.prototype.buildBreadcrumbFacetSlider = function (headingLevel) {\n var _this = this;\n var elem = Dom_1.$$('div', {\n className: 'coveo-facet-slider-breadcrumb'\n }).el;\n var title = Dom_1.$$(AccessibilityUtils_1.getHeadingTag(headingLevel, 'span'), {\n className: 'coveo-facet-slider-breadcrumb-title'\n });\n title.text(this.options.title + ': ');\n elem.appendChild(title.el);\n var values = Dom_1.$$('span', {\n className: 'coveo-facet-slider-breadcrumb-values'\n });\n elem.appendChild(values.el);\n var value = Dom_1.$$('span', {\n className: 'coveo-facet-slider-breadcrumb-value'\n });\n var caption = Dom_1.$$('span', {\n className: 'coveo-facet-slider-breadcrumb-caption'\n });\n caption.text(this.slider.getCaption());\n value.append(caption.el);\n values.el.appendChild(value.el);\n var clear = Dom_1.$$('span', {\n className: 'coveo-facet-slider-breadcrumb-clear'\n }, SVGIcons_1.SVGIcons.icons.mainClear);\n SVGDom_1.SVGDom.addClassToSVGInContainer(clear.el, 'coveo-facet-slider-clear-svg');\n value.el.appendChild(clear.el);\n value.on('click', function () {\n _this.reset();\n _this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.facetClearAll, {\n facetId: _this.options.id,\n facetField: _this.options.field.toString(),\n facetTitle: _this.options.title\n });\n _this.queryController.executeQuery();\n });\n return elem;\n };\n FacetSlider.prototype.initSlider = function () {\n this.buildSlider();\n this.slider.initializeState([this.startOfSlider, this.endOfSlider]);\n this.updateAppearanceDependingOnState();\n };\n FacetSlider.prototype.bindQueryStateEvents = function () {\n var _this = this;\n this.rangeQueryStateAttribute = QueryStateModel_1.QueryStateModel.getFacetId(this.options.id) + ':range';\n this.queryStateModel.registerNewAttribute(this.rangeQueryStateAttribute, [undefined, undefined]);\n var eventName = this.queryStateModel.getEventName(Model_1.Model.eventTypes.changeOne + this.rangeQueryStateAttribute);\n this.bind.onRootElement(eventName, function (args) {\n _this.slider ? _this.handleRangeQueryStateChanged(args) : _this.setRangeStateSliderStillNotCreated(args);\n });\n };\n FacetSlider.prototype.setRangeStateSliderStillNotCreated = function (args) {\n this.rangeFromUrlState = this.copyValues(args.value);\n };\n FacetSlider.prototype.buildSlider = function () {\n var _this = this;\n var sliderContainer = Dom_1.$$('div', {\n className: 'coveo-slider-container'\n }).el;\n if (this.hasAGraph()) {\n Dom_1.$$(sliderContainer).addClass('coveo-with-graph');\n }\n var sliderDiv = Dom_1.$$('div').el;\n this.slider = this.slider\n ? this.slider\n : new Slider_1.Slider(sliderDiv, __assign({}, this.options, { dateField: this.options.dateField }), this.root);\n Dom_1.$$(sliderDiv).on(SliderEvents_1.SliderEvents.endSlide, function (e, args) {\n _this.handleEndSlide(args);\n });\n Dom_1.$$(sliderDiv).on(SliderEvents_1.SliderEvents.duringSlide, function (e, args) {\n _this.handleDuringSlide(args);\n });\n if (this.hasAGraph()) {\n Dom_1.$$(sliderDiv).on(SliderEvents_1.SliderEvents.graphValueSelected, function (e, args) {\n _this.handleGraphValueSelected(args);\n });\n }\n sliderContainer.appendChild(sliderDiv);\n this.element.appendChild(sliderContainer);\n this.updateAppearanceDependingOnState();\n };\n FacetSlider.prototype.handleBuildingQuery = function (data) {\n Assert_1.Assert.exists(data);\n Assert_1.Assert.exists(data.queryBuilder);\n var boundary = this.getSliderBoundaryForQuery();\n if (boundary != undefined) {\n this.facetQueryController.prepareForNewQuery();\n var expression = this.facetQueryController.computeOurFilterExpression(boundary);\n if (Utils_1.Utils.isNonEmptyString(expression)) {\n this.logger.trace('Putting filter in query', expression);\n data.queryBuilder.advancedExpression.add(expression);\n }\n }\n };\n FacetSlider.prototype.handleDoneBuildingQuery = function (data) {\n var queryBuilder = data.queryBuilder;\n this.facetQueryController.putGroupByIntoQueryBuilder(queryBuilder);\n };\n FacetSlider.prototype.handleDeferredQuerySuccess = function (data) {\n this.ensureDom();\n this.setupSliderIfNeeded(data);\n var groupByResults = data.results.groupByResults[this.facetQueryController.lastGroupByRequestIndex];\n this.isEmpty = this.isFacetEmpty(groupByResults, data);\n this.updateAppearanceDependingOnState();\n if (this.hasAGraph()) {\n this.renderToSliderGraph(data);\n }\n };\n FacetSlider.prototype.handleEndSlide = function (args) {\n var values = args.slider.getValues();\n this.startOfSlider = values[0];\n this.endOfSlider = values[1];\n if (this.updateQueryState(values)) {\n this.updateAppearanceDependingOnState();\n this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.facetRangeSlider, {\n facetId: this.options.id,\n facetField: this.options.field.toString(),\n facetRangeStart: this.startOfSlider.toString(),\n facetRangeEnd: this.endOfSlider.toString()\n });\n this.queryController.executeQuery();\n }\n };\n FacetSlider.prototype.handleDuringSlide = function (args) {\n var values = args.slider.getValues();\n this.startOfSlider = values[0];\n this.endOfSlider = values[1];\n this.slider.setValues([this.startOfSlider, this.endOfSlider]);\n this.updateAppearanceDependingOnState(true);\n };\n FacetSlider.prototype.handleGraphValueSelected = function (args) {\n if ((this.options.rangeSlider && this.startOfSlider != args.start) || this.endOfSlider != args.end) {\n if (this.options.rangeSlider) {\n this.startOfSlider = args.start;\n }\n this.endOfSlider = args.end;\n this.slider.setValues([this.startOfSlider, this.endOfSlider]);\n this.updateQueryState();\n this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.facetRangeGraph, {\n facetId: this.options.id,\n facetField: this.options.field.toString(),\n facetRangeStart: this.startOfSlider.toString(),\n facetRangeEnd: this.endOfSlider.toString()\n });\n this.queryController.executeQuery();\n }\n };\n FacetSlider.prototype.updateQueryState = function (values, silent) {\n if (values === void 0) { values = this.slider.getValues(); }\n if (silent === void 0) { silent = false; }\n var copyOfValues = this.copyValues(values);\n var start = values[0] + 0.0;\n var end = values[1] + 0.0;\n var model = this.queryStateModel.get(this.rangeQueryStateAttribute);\n if (model == null || copyOfValues[0] != model[0] || copyOfValues[1] != model[1]) {\n copyOfValues[0] = start;\n copyOfValues[1] = end;\n this.queryStateModel.set(this.rangeQueryStateAttribute, copyOfValues, { silent: silent });\n return true;\n }\n return false;\n };\n FacetSlider.prototype.copyValues = function (values) {\n // Creating a copy of the values prevents an unwanted automatic update of the state while sliding\n // That's the cleanest way I found to copy that array correctly\n var copyOfValues = [];\n copyOfValues[0] = Number(values[0]) + 0.0;\n copyOfValues[1] = Number(values[1]) + 0.0;\n return copyOfValues;\n };\n FacetSlider.prototype.renderToSliderGraph = function (data) {\n var _this = this;\n var rawGroupByResults = data.results.groupByResults[this.facetQueryController.graphGroupByQueriesIndex];\n var graphData;\n var totalGraphResults = 0;\n if (rawGroupByResults) {\n graphData = underscore_1.map(rawGroupByResults.values, function (value) {\n totalGraphResults += value.numberOfResults;\n var start = value.value.split('..')[0];\n var end = value.value.split('..')[1];\n if (!_this.options.dateField) {\n start = Number(start);\n end = Number(end);\n }\n else {\n start = new Date(start.split('@')[0]).getTime();\n end = new Date(end.split('@')[0]).getTime();\n }\n var y = value.numberOfResults;\n return {\n start: start,\n y: y,\n end: end,\n isDate: _this.options.dateField\n };\n });\n }\n if (totalGraphResults == 0) {\n this.isEmpty = true;\n this.updateAppearanceDependingOnState();\n }\n if (graphData != undefined && !this.isDropdownHidden()) {\n // This is deferred since it might be called on initialization with a placehoder over the facet during load time\n // We need to wait that the animation is gone so that the width/height calculation done by the graph are okay.\n MiscModules_1.Defer.defer(function () { return _this.slider.drawGraph(graphData); });\n }\n else if (graphData != undefined && this.isDropdownHidden()) {\n this.delayedGraphData = graphData;\n }\n };\n FacetSlider.prototype.isDropdownHidden = function () {\n var facetDropdown = this.root.querySelector('.coveo-facet-column');\n if (facetDropdown) {\n return Dom_1.$$(facetDropdown).css('display') == 'none';\n }\n if (Dom_1.$$(this.root).hasClass('CoveoRecommendation')) {\n var recommendationDropdown = Dom_1.$$(this.root).parents('.coveo-recommendation-column')[0] || this.root;\n return Dom_1.$$(recommendationDropdown).css('display') == 'none';\n }\n return false;\n };\n FacetSlider.prototype.generateBoundary = function () {\n if (!this.slider) {\n // If the slider is not initialized, the only boundary we can get is from the state.\n return this.generateBoundaryFromState();\n }\n else {\n // Else, try to get one from the slider itself. If we cant, try to return one from the state.\n var boundary = this.generateBoundaryFromSlider();\n if (boundary[0] == undefined && boundary[1] == undefined) {\n return this.generateBoundaryFromState();\n }\n else {\n return boundary;\n }\n }\n };\n FacetSlider.prototype.generateBoundaryFromSlider = function () {\n var start, end;\n if (this.startOfSlider != undefined) {\n start = this.startOfSlider;\n }\n if (this.endOfSlider != undefined) {\n end = this.endOfSlider;\n }\n return [start, end];\n };\n FacetSlider.prototype.generateBoundaryFromState = function () {\n var start, end;\n var startFromState = this.queryStateModel.get(this.rangeQueryStateAttribute)[0];\n if (startFromState != undefined) {\n start = startFromState;\n }\n var endFromState = this.queryStateModel.get(this.rangeQueryStateAttribute)[1];\n if (endFromState != undefined) {\n end = endFromState;\n }\n if (start != this.queryStateModel.getDefault(this.rangeQueryStateAttribute)[0] ||\n end != this.queryStateModel.getDefault(this.rangeQueryStateAttribute)[1]) {\n return [start, end];\n }\n else {\n return [undefined, undefined];\n }\n };\n FacetSlider.prototype.setupSliderIfNeeded = function (data) {\n this.ensureDom();\n if (Utils_1.Utils.isNullOrUndefined(this.slider)) {\n if (!this.alreadySetBoundary()) {\n this.trySetSliderBoundaryFromOptions();\n }\n if (!this.alreadySetBoundary() && data != undefined) {\n this.trySetSliderBoundaryFromQueryResult(data);\n }\n this.trySetSliderBoundaryFromState();\n this.setupSliderStateVariables();\n var isInError = this.verifySetup();\n if (isInError) {\n this.logger.warn('Unable to initialize slider with current values', this);\n }\n else {\n this.initSlider();\n this.updateQueryState();\n }\n }\n };\n FacetSlider.prototype.verifySetup = function () {\n var isInError = 0;\n isInError += this.initialStartOfSlider == undefined ? 1 : 0;\n isInError += isNaN(this.initialStartOfSlider) ? 1 : 0;\n isInError += this.initialEndOfSlider == undefined ? 1 : 0;\n isInError += isNaN(this.initialEndOfSlider) ? 1 : 0;\n return isInError;\n };\n FacetSlider.prototype.setupSliderStateVariables = function () {\n if (isNaN(this.initialStartOfSlider) || isNaN(this.initialEndOfSlider)) {\n this.logger.warn('Cannnot initialize slider with those values : start: ' + this.initialStartOfSlider + ' end: ' + this.initialEndOfSlider);\n }\n else {\n this.initialStartOfSlider = Number(this.initialStartOfSlider);\n this.initialEndOfSlider = Number(this.initialEndOfSlider);\n this.startOfSlider = this.startOfSlider != undefined ? Number(this.startOfSlider) : this.initialStartOfSlider;\n this.endOfSlider = this.endOfSlider != undefined ? Number(this.endOfSlider) : this.initialEndOfSlider;\n this.options.start = this.initialStartOfSlider;\n this.options.end = this.initialEndOfSlider;\n this.queryStateModel.setNewDefault(this.rangeQueryStateAttribute, [this.initialStartOfSlider, this.initialEndOfSlider]);\n }\n };\n FacetSlider.prototype.alreadySetBoundary = function () {\n return this.startOfSlider != undefined && this.endOfSlider != undefined;\n };\n FacetSlider.prototype.trySetSliderBoundaryFromOptions = function () {\n if (!Utils_1.Utils.isNullOrUndefined(this.options.start)) {\n this.setupInitialSliderStateStart(this.options.start);\n }\n if (!Utils_1.Utils.isNullOrUndefined(this.options.end)) {\n this.setupInitialSliderStateEnd(this.options.end);\n }\n };\n FacetSlider.prototype.trySetSliderBoundaryFromState = function () {\n var boundaries = this.getBoundariesFromState();\n if (!boundaries) {\n return;\n }\n this.setupInitialSliderStateStart(boundaries.start);\n this.setupInitialSliderStateEnd(boundaries.end);\n this.startOfSlider = boundaries.start;\n this.endOfSlider = boundaries.end;\n };\n FacetSlider.prototype.trySetSliderBoundaryFromQueryResult = function (data) {\n var groupByResults = data.results.groupByResults[this.facetQueryController.lastGroupByRequestForFullRangeIndex];\n if (!groupByResults || groupByResults.values.length <= 0 || groupByResults.values[0].numberOfResults == 0) {\n return;\n }\n var start = groupByResults.values[0].value.split('..')[0];\n var end = groupByResults.values[groupByResults.values.length - 1].value.split('..')[1];\n if (this.isValueADate(start) && this.isValueADate(end)) {\n this.setupInitialSliderStateStart(start);\n this.setupInitialSliderStateEnd(end);\n return;\n }\n var boudariesFromState = this.getBoundariesFromState();\n var startAsNumber = Number(start);\n var endAsNumber = Number(end);\n if (boudariesFromState) {\n startAsNumber = Math.min(startAsNumber, boudariesFromState.start);\n endAsNumber = Math.max(endAsNumber, boudariesFromState.end);\n }\n this.setupInitialSliderStateStart(startAsNumber);\n this.setupInitialSliderStateEnd(endAsNumber);\n };\n FacetSlider.prototype.getBoundariesFromState = function () {\n var stateValues = this.rangeFromUrlState || this.queryStateModel.get(this.rangeQueryStateAttribute);\n if (!stateValues || stateValues[0] == undefined || stateValues[1] == undefined) {\n return undefined;\n }\n var startAsNumber = Number(stateValues[0]);\n var endAsNumber = Number(stateValues[1]);\n if (isNaN(startAsNumber) || isNaN(endAsNumber)) {\n return undefined;\n }\n return {\n start: startAsNumber,\n end: endAsNumber\n };\n };\n FacetSlider.prototype.setupInitialSliderStateStart = function (value) {\n if (this.initialStartOfSlider == undefined) {\n this.initialStartOfSlider = value;\n if (this.isValueADate(value)) {\n this.initialStartOfSlider = this.getTimeFromAPIResponse(value);\n }\n }\n };\n FacetSlider.prototype.setupInitialSliderStateEnd = function (value) {\n if (this.initialEndOfSlider == undefined) {\n this.initialEndOfSlider = value;\n if (this.isValueADate(value)) {\n this.initialEndOfSlider = this.getTimeFromAPIResponse(value);\n }\n }\n };\n FacetSlider.prototype.getTimeFromAPIResponse = function (value) {\n return new Date(value.replace('@', ' ')).getTime();\n };\n FacetSlider.prototype.isValueADate = function (value) {\n return this.options.dateField && isNaN(value);\n };\n FacetSlider.prototype.updateAppearanceDependingOnState = function (sliding) {\n var _this = this;\n if (sliding === void 0) { sliding = false; }\n // Defer the visual update so that we can execute it after the current call stack has resolved.\n // Since this component is closely linked to DOM size calculation (width), this allows to cover some corner cases\n // where the component would be visually hidden, leading to incorrect width calculation.\n // For example, first query placeholder animation hiding the component, or switching between different tabs would affect the calculation otherwise.\n MiscModules_1.Defer.defer(function () {\n if (_this.isEmpty && !_this.isActive() && !sliding) {\n Dom_1.$$(_this.element).addClass('coveo-disabled-empty');\n }\n else {\n Dom_1.$$(_this.element).removeClass('coveo-disabled-empty');\n Dom_1.$$(_this.facetHeader.eraserElement).toggle(_this.isActive());\n }\n if (!_this.isActive() && !sliding) {\n Dom_1.$$(_this.element).addClass('coveo-disabled');\n }\n else {\n Dom_1.$$(_this.element).removeClass('coveo-disabled');\n }\n if (_this.isActive() && _this.slider) {\n _this.slider.onMoving();\n }\n });\n };\n FacetSlider.prototype.handleNuke = function () {\n window.removeEventListener('resize', this.onResize);\n };\n FacetSlider.prototype.isFacetEmpty = function (groupByResults, data) {\n return (Utils_1.Utils.isNullOrUndefined(groupByResults) ||\n underscore_1.every(groupByResults.values, function (value) { return Utils_1.Utils.isNullOrUndefined(value) || value.numberOfResults === 0; }) ||\n data.results.results.length == 0);\n };\n /**\n * The component options\n * @componentOptions\n */\n FacetSlider.options = __assign({ \n /**\n * Specifies the title to display on top of the `FacetSlider`.\n *\n * Default value is the localized string for `NoTitle`.\n */\n title: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({\n localizedString: function () { return Strings_1.l('NoTitle'); },\n section: 'CommonOptions'\n }), \n /**\n * Specifies whether the [`field`]{@link FacetSlider.options.field} for which you are requesting a range is a date\n * field. This allows the `FacetSlider` to correctly build the outgoing [GroupByRequest]{@link IGroupByRequest} and\n * render itself properly.\n *\n * Default value is `false`.\n */\n dateField: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false, section: 'CommonOptions' }), \n /**\n * Specifies the index field whose values the `FacetSlider` should use.\n *\n * The field must be configured correctly as a Facet field in the index (see\n * [Adding and Managing Fields](https://docs.coveo.com/en/1833/)).\n *\n * Specifying a value for this option is required for the `FacetSlider` component to work.\n */\n field: ComponentOptions_1.ComponentOptions.buildFieldOption({ groupByField: true, required: true, section: 'CommonOptions' }), \n /**\n * Specifies a unique identifier for the `FacetSlider`. Among other things, this identifier serves the purpose of\n * saving the facet state in the URL hash.\n *\n * If you have two facets with the same field in the same page, you should specify a unique `id` value for at least\n * one of those two facets. This `id` must be unique in the page.\n *\n * Default value is the [`field`]{@link FacetSlider.options.field} option value.\n */\n id: ComponentOptions_1.ComponentOptions.buildStringOption({\n postProcessing: function (value, options) { return value || options.field; }\n }), \n /**\n * Specifies the format to use when displaying date values.\n *\n * See also the [`dateField`]{@link FacetSlider.options.dateField} option.\n *\n * Default value is `MMM dd, yyyy`.\n */\n dateFormat: ComponentOptions_1.ComponentOptions.buildStringOption({ section: 'Display' }), \n /**\n * Specifies a query to filter automatic minimum and maximum values for the slider range.\n *\n * This is especially useful in the case of date ranges since the index may contain values which are not set, and\n * thus return values from the year 1400 (the earliest date from the boost C++ library).\n *\n * **Example:**\n *\n * The query override in the following markup filters out any `@date` value anterior to January 1st 2000.\n * ```html\n *
2000/01/01\">
\n * ```\n */\n queryOverride: ComponentOptions_1.ComponentOptions.buildQueryExpressionOption({ section: 'Filtering' }), \n /**\n * Specifies the starting boundary of the slider.\n *\n * Date values are rounded to the nearest year when you set the [`dateField`]{@link FacetSlider.options.dateField}\n * option to `true`.\n *\n * Default value is the lowest available field value in the index.\n */\n start: ComponentOptions_1.ComponentOptions.buildStringOption({ section: 'Filtering' }), \n /**\n * Specifies the ending boundary of the slider.\n *\n * Date values are rounded to the nearest year when you set the [`dateField`]{@link FacetSlider.options.dateField}\n * option to `true`.\n *\n * Default value is the highest available field value in the index.\n */\n end: ComponentOptions_1.ComponentOptions.buildStringOption({ section: 'Filtering' }), \n /**\n * Specifies whether to exclude the outer bounds of the slider in the generated query when they are not active.\n *\n * Default value is `false`.\n */\n excludeOuterBounds: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false, section: 'Filtering' }), \n /**\n * Specifies the number of decimal places to round the displayed numerical values to.\n *\n * Default (and minimum) value is `0`.\n */\n rounded: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 0, section: 'Filtering' }), \n /**\n * Specifies the number of steps to split the slider into.\n *\n * For example, if your range is [ 0 , 100 ] and you specify `10` steps, then the end user can move the slider only\n * to the values [ 0, 10, 20, 30 ... , 100 ].\n *\n * For performance reasons, the maximum value for this option is `100`\n *\n * Default value is `undefined`, and the slider allows up to 100 steps. Minimum value is `2`.\n */\n steps: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 2 }), \n /**\n * Specifies whether you want a slider with two buttons instead of a slider with a single button.\n *\n * By default, only one button appears in the slider.\n */\n rangeSlider: ComponentOptions_1.ComponentOptions.buildBooleanOption(), \n /**\n * Specifies the caption options to use when displaying the field values.\n *\n * Available options are:\n * - enable (`data-display-as-value-enable`): boolean; specifies whether to display the caption as a value. Default\n * value is `true`.\n * - unitSign (`data-display-as-value-unit-sign`): string; specifies the unit sign for this value (e.g., `$`).\n * Default value is `undefined`.\n * - separator (`data-display-as-value-separator`): string; specifies the character(s) to use as a separator in the\n * caption. Default value is `\"-\"`.\n */\n displayAsValue: ComponentOptions_1.ComponentOptions.buildObjectOption({\n subOptions: {\n enable: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true }),\n unitSign: ComponentOptions_1.ComponentOptions.buildStringOption(),\n separator: ComponentOptions_1.ComponentOptions.buildStringOption({ defaultValue: '-' })\n },\n section: 'Display'\n }), \n /**\n * Specifies the percentage caption options to use when displaying the field values.\n *\n * Available options are:\n * - enable (`data-display-as-percent-enable`): boolean; specifies whether to display the caption as a percentage.\n * Default value is `false`.\n * separator (`data-display-as-percent-separator`): string; specifies the character(s) to use as a separator in the\n * caption. Default value is `\"-\"`.\n */\n displayAsPercent: ComponentOptions_1.ComponentOptions.buildObjectOption({\n subOptions: {\n enable: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false }),\n separator: ComponentOptions_1.ComponentOptions.buildStringOption({ defaultValue: '-' })\n },\n section: 'Display'\n }), \n /**\n * Specifies whether to display a small graph on top of the slider.\n *\n * Available options are:\n * - steps (`data-graph-steps`): number; specifies the number of steps/columns to display in your graph. Default\n * value is `10`. Minimum value is `2`.\n */\n graph: ComponentOptions_1.ComponentOptions.buildObjectOption({\n subOptions: {\n steps: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 2 }),\n animationDuration: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 0 }),\n margin: ComponentOptions_1.ComponentOptions.buildObjectOption({\n subOptions: {\n top: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 0 }),\n bottom: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 0 }),\n left: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 0 }),\n right: ComponentOptions_1.ComponentOptions.buildNumberOption({ min: 0 })\n }\n })\n },\n section: 'Graph'\n }), \n /**\n * Specifies a function to generate the `FacetSlider` steps (see the [`steps`]{@link FacetSlider.options.steps}\n * option). This function receives the `FacetSlider` boundaries (see the [`start`]{@link FacetSlider.options.start}\n * and [`end`]{@link FacetSlider.options.end} options), and must return an array of numbers (the steps).\n *\n * **Note:**\n * > You cannot set this option directly in the component markup as an HTML attribute. You must either set it in the\n * > [`init`]{@link init} call of your search interface (see\n * > [Passing Component Options in the init Call](https://docs.coveo.com/en/346/#passing-component-options-in-the-init-call)),\n * > or before the `init` call, using the `options` top-level function (see\n * > [Passing Component Options Before the init Call](https://docs.coveo.com/en/346/#passing-component-options-before-the-init-call)).\n *\n * **Example:**\n * ```javascript\n *\n * var myGetStepsFunction = function(start, end) {\n * var result = [];\n * for (i = start; i < end; i += 2) {\n * result.push(i);\n * }\n * return result;\n * }\n *\n * // You can set the option in the 'init' call:\n * Coveo.init(document.querySelector(\"#search\"), {\n * FacetSlider: {\n * getSteps: myGetStepsFunction\n * }\n * });\n *\n * // Or before the 'init' call, using the 'options' top-level function:\n * // Coveo.options(document.querySelector(\"#search\"), {\n * // FacetSlider : {\n * // valueCaption : myGetStepsFunction\n * // }\n * // });\n * ```\n */\n getSteps: ComponentOptions_1.ComponentOptions.buildCustomOption(function () {\n return null;\n }), \n /**\n * Specifies a function to generate the value caption for the `FacetSlider`. This function receives the current\n * slider values (number[]), and must return the caption (string).\n *\n * **Note:**\n * > You cannot set this option directly in the component markup as an HTML attribute. You must either set it in the\n * > [`init`]{@link init} call of your search interface (see\n * > [Passing Component Options in the init Call](https://docs.coveo.com/en/346/#passing-component-options-in-the-init-call)),\n * > or before the `init` call, using the `options` top-level function (see\n * > [Passing Component Options Before the init Call](https://docs.coveo.com/en/346/#passing-component-options-before-the-init-call)).\n *\n * **Example:**\n * ```javascript\n *\n * var myValueCaptionFunction = function(values) {\n * return \"From \" + values[0] + \" to \" + values[1];\n * }\n *\n * // You can set the option in the 'init' call:\n * Coveo.init(document.querySelector(\"#search\"), {\n * FacetSlider: {\n * valueCaption: myValueCaptionFunction\n * }\n * });\n *\n * // Or before the 'init' call, using the 'options' top-level function:\n * // Coveo.options(document.querySelector(\"#search\"), {\n * // FacetSlider : {\n * // valueCaption : myValueCaptionFunction\n * // }\n * // });\n * ```\n */\n valueCaption: ComponentOptions_1.ComponentOptions.buildCustomOption(function () {\n return null;\n }) }, ResponsiveFacetOptions_1.ResponsiveFacetOptions);\n FacetSlider.ID = 'FacetSlider';\n FacetSlider.doExport = function () {\n GlobalExports_1.exportGlobally({\n FacetSlider: FacetSlider,\n Slider: Slider_1.Slider\n });\n };\n FacetSlider.DEBOUNCED_RESIZE_DELAY = 250;\n return FacetSlider;\n}(Component_1.Component));\nexports.FacetSlider = FacetSlider;\nInitialization_1.Initialization.registerAutoCreateComponent(FacetSlider);\n\n\n/***/ }),\n/* 199 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SearchInterface_1 = __webpack_require__(19);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar QueryEvents_1 = __webpack_require__(11);\nvar OmniboxEvents_1 = __webpack_require__(34);\nvar ResultListEvents_1 = __webpack_require__(29);\nvar SettingsEvents_1 = __webpack_require__(56);\nvar PreferencesPanelEvents_1 = __webpack_require__(100);\nvar AnalyticsEvents_1 = __webpack_require__(58);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar BreadcrumbEvents_1 = __webpack_require__(35);\nvar QuickviewEvents_1 = __webpack_require__(227);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar Model_1 = __webpack_require__(18);\nvar Utils_1 = __webpack_require__(4);\nvar Dom_1 = __webpack_require__(1);\nvar ResponsiveRecommendation_1 = __webpack_require__(651);\nvar RegisteredNamedMethods_1 = __webpack_require__(30);\nvar InitializationEvents_1 = __webpack_require__(17);\nvar _ = __webpack_require__(0);\nvar GlobalExports_1 = __webpack_require__(3);\nvar DefaultRecommendationTemplate_1 = __webpack_require__(470);\nvar RecommendationQuery_1 = __webpack_require__(654);\nvar RecommendationAnalyticsClient_1 = __webpack_require__(209);\n__webpack_require__(655);\nvar Strings_1 = __webpack_require__(6);\n/**\n * The Recommendation component is a {@link SearchInterface} that displays recommendations typically based on user\n * history.\n *\n * This component usually listens to the main SearchInterface. When the main SearchInterface generates a query, the\n * Recommendation component generates another query to get the recommendations at the same time.\n *\n * To get history-based recommendations, you will likely want to include the `pageview` script in your page (see\n * [coveo.analytics.js](https://github.com/coveo/coveo.analytics.js)). However, including this script is not mandatory.\n * For instance, you could use the Recommendation component without the Coveo Machine Learning service to create a\n * simple \"recommended people\" interface.\n *\n * It is possible to include this component inside another SearchInterface, but it is also possible to instantiate it as\n * a \"standalone\" search interface, without even instantiating a main SearchInterface component. In any case, a\n * Recommendation component always acts as a full-fledged search interface. Therefore, you can include any component\n * inside the Recommendation component (Searchbox, Facet, Sort, etc.), just as you would inside the main SearchInterface\n * component.\n *\n * @availablesince [July 2016 Release (v1.667.24)](https://docs.coveo.com/en/309/#july-2016-release-v166724)\n */\nvar Recommendation = /** @class */ (function (_super) {\n __extends(Recommendation, _super);\n /**\n * Creates a new Recommendation component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the Recommendation component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time)\n * @param _window\n */\n function Recommendation(element, options, analyticsOptions, _window) {\n if (options === void 0) { options = {}; }\n if (analyticsOptions === void 0) { analyticsOptions = {}; }\n if (_window === void 0) { _window = window; }\n var _this = _super.call(this, element, ComponentOptions_1.ComponentOptions.initComponentOptions(element, Recommendation, options), analyticsOptions, _window) || this;\n _this.element = element;\n _this.options = options;\n _this.analyticsOptions = analyticsOptions;\n _this.element.style.display = '';\n if (!_this.options.id) {\n _this.generateDefaultId();\n }\n // This is done to allow the component to be included in another search interface without triggering the parent events.\n _this.preventEventPropagation();\n if (_this.options.mainSearchInterface) {\n _this.bindToMainSearchInterface();\n }\n Dom_1.$$(_this.element).on(QueryEvents_1.QueryEvents.buildingQuery, function (e, args) {\n return _this.handleRecommendationBuildingQuery(args);\n });\n Dom_1.$$(_this.element).on(QueryEvents_1.QueryEvents.querySuccess, function (e, args) { return _this.handleRecommendationQuerySuccess(args); });\n Dom_1.$$(_this.element).on(QueryEvents_1.QueryEvents.noResults, function (e, args) { return _this.handleRecommendationNoResults(); });\n Dom_1.$$(_this.element).on(QueryEvents_1.QueryEvents.queryError, function (e, args) { return _this.handleRecommendationQueryError(); });\n if (!_this.options.mainSearchInterface) {\n // When the recommendation component is \"standalone\", we add additional safeguard against bad config.\n _this.ensureCurrentPageViewExistsInStore();\n }\n ResponsiveRecommendation_1.ResponsiveRecommendation.init(_this.root, _this, options);\n return _this;\n }\n Object.defineProperty(Recommendation.prototype, \"historyStore\", {\n get: function () {\n return this.queryController.historyStore;\n },\n enumerable: true,\n configurable: true\n });\n Recommendation.prototype.getId = function () {\n return this.options.id;\n };\n Recommendation.prototype.enable = function () {\n _super.prototype.enable.call(this);\n this.show();\n };\n Recommendation.prototype.disable = function () {\n _super.prototype.disable.call(this);\n this.hide();\n };\n Recommendation.prototype.hide = function () {\n Dom_1.$$(this.element).addClass('coveo-hidden');\n };\n Recommendation.prototype.show = function () {\n Dom_1.$$(this.element).removeClass('coveo-hidden');\n };\n Recommendation.prototype.ensureCurrentPageViewExistsInStore = function () {\n // It's not 100% sure that the element will actually be added in the store.\n // It's possible that an external script configured by the end user to log the page view already did that.\n // So we *could* end up with duplicate values in the store :\n // We rely on the fact that the coveo.analytics lib has defensive code against consecutive page view that are identical.\n // This is mainly done if the recommendation component is being initialized before the page view could be logged correctly by the coveo.analytics externa lib.\n var historyElement = {\n name: 'PageView',\n value: document.location.toString(),\n time: JSON.stringify(new Date()),\n title: _.escape(document.title)\n };\n this.historyStore.addElement(historyElement);\n };\n Recommendation.prototype.bindToMainSearchInterface = function () {\n this.bindComponentOptionsModelToMainSearchInterface();\n this.bindQueryEventsToMainSearchInterface();\n };\n Recommendation.prototype.bindComponentOptionsModelToMainSearchInterface = function () {\n var _this = this;\n // Try to fetch the componentOptions from the main search interface.\n // Since we do not know which interface is init first (recommendation or full search interface)\n // add a mechanism that waits for the full search interface to be correctly initialized\n // then, set the needed values on the component options model.\n var searchInterfaceComponent = RegisteredNamedMethods_1.get(this.options.mainSearchInterface, SearchInterface_1.SearchInterface);\n var alreadyInitialized = searchInterfaceComponent != null;\n var onceInitialized = function () {\n var mainSearchInterfaceOptionsModel = searchInterfaceComponent.getBindings().componentOptionsModel;\n _this.componentOptionsModel.setMultiple(mainSearchInterfaceOptionsModel.getAttributes());\n Dom_1.$$(_this.options.mainSearchInterface).on(_this.componentOptionsModel.getEventName(Model_1.MODEL_EVENTS.ALL), function () {\n _this.componentOptionsModel.setMultiple(mainSearchInterfaceOptionsModel.getAttributes());\n });\n };\n if (alreadyInitialized) {\n onceInitialized();\n }\n else {\n Dom_1.$$(this.options.mainSearchInterface).on(InitializationEvents_1.InitializationEvents.afterComponentsInitialization, function () {\n searchInterfaceComponent = RegisteredNamedMethods_1.get(_this.options.mainSearchInterface, SearchInterface_1.SearchInterface);\n onceInitialized();\n });\n }\n };\n Recommendation.prototype.bindQueryEventsToMainSearchInterface = function () {\n var _this = this;\n // Whenever a query sucessfully returns on the full search interface, refresh the recommendation component.\n Dom_1.$$(this.options.mainSearchInterface).on(QueryEvents_1.QueryEvents.querySuccess, function (e, args) {\n _this.mainInterfaceQuery = args;\n _this.mainQuerySearchUID = args.results.searchUid;\n _this.mainQueryPipeline = args.results.pipeline;\n if (args.results.results.length != 0) {\n _this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.recommendation, {});\n _this.queryController.executeQuery({\n closeModalBox: false\n });\n }\n });\n Dom_1.$$(this.options.mainSearchInterface).on(QueryEvents_1.QueryEvents.queryError, function () { return _this.hide(); });\n Dom_1.$$(this.options.mainSearchInterface).on(QueryEvents_1.QueryEvents.noResults, function () { return _this.hide(); });\n };\n Recommendation.prototype.handleRecommendationBuildingQuery = function (data) {\n if (!this.disabled) {\n this.modifyQueryForRecommendation(data);\n this.addRecommendationInfoInQuery(data);\n }\n };\n Recommendation.prototype.handleRecommendationQuerySuccess = function (data) {\n if (!this.disabled) {\n if (this.options.hideIfNoResults) {\n if (data.results.totalCount === 0) {\n this.hide();\n }\n else {\n this.show();\n }\n }\n }\n };\n Recommendation.prototype.handleRecommendationNoResults = function () {\n if (!this.disabled) {\n if (this.options.hideIfNoResults) {\n this.hide();\n }\n }\n };\n Recommendation.prototype.handleRecommendationQueryError = function () {\n if (!this.disabled) {\n this.hide();\n }\n };\n Recommendation.prototype.modifyQueryForRecommendation = function (data) {\n if (this.mainInterfaceQuery) {\n Utils_1.Utils.copyObjectAttributes(data.queryBuilder, this.mainInterfaceQuery.queryBuilder, this.options.optionsToUse);\n }\n };\n Recommendation.prototype.addRecommendationInfoInQuery = function (data) {\n if (!_.isEmpty(this.options.userContext)) {\n data.queryBuilder.addContext(this.options.userContext);\n }\n data.queryBuilder.recommendation = this.options.id;\n };\n Recommendation.prototype.preventEventPropagation = function () {\n this.preventEventPropagationOn(QueryEvents_1.QueryEvents);\n this.preventEventPropagationOn(OmniboxEvents_1.OmniboxEvents);\n this.preventEventPropagationOn(ResultListEvents_1.ResultListEvents);\n this.preventEventPropagationOn(SettingsEvents_1.SettingsEvents);\n this.preventEventPropagationOn(PreferencesPanelEvents_1.PreferencesPanelEvents);\n this.preventEventPropagationOn(AnalyticsEvents_1.AnalyticsEvents);\n this.preventEventPropagationOn(BreadcrumbEvents_1.BreadcrumbEvents);\n this.preventEventPropagationOn(QuickviewEvents_1.QuickviewEvents);\n this.preventEventPropagationOn(InitializationEvents_1.InitializationEvents);\n this.preventEventPropagationOn(this.getAllModelEvents());\n };\n Recommendation.prototype.preventEventPropagationOn = function (eventType, eventName) {\n if (eventName === void 0) { eventName = function (event) {\n return event;\n }; }\n for (var event_1 in eventType) {\n Dom_1.$$(this.root).on(eventName(event_1), function (e) { return e.stopPropagation(); });\n }\n };\n Recommendation.prototype.getAllModelEvents = function () {\n var _this = this;\n var events = {};\n var queryStateModel = this.getBindings().queryStateModel;\n _.each(_.values(Model_1.Model.eventTypes), function (event) {\n var eventName = queryStateModel.getEventName(event);\n events[eventName] = eventName;\n _.each(_.values(QueryStateModel_1.QUERY_STATE_ATTRIBUTES), function (attribute) {\n var eventName = _this.queryStateModel.getEventName(event + attribute);\n events[eventName] = eventName;\n });\n });\n return events;\n };\n Recommendation.prototype.generateDefaultId = function () {\n var id = 'Recommendation';\n if (Recommendation.NEXT_ID !== 1) {\n this.logger.warn('Generating another recommendation default id', 'Consider configuring a human friendly / meaningful id for this interface');\n id = id + '_' + Recommendation.NEXT_ID;\n }\n Recommendation.NEXT_ID++;\n this.options.id = id;\n };\n Recommendation.ID = 'Recommendation';\n Recommendation.NEXT_ID = 1;\n Recommendation.doExport = function () {\n GlobalExports_1.exportGlobally({\n Recommendation: Recommendation,\n DefaultRecommendationTemplate: DefaultRecommendationTemplate_1.DefaultRecommendationTemplate,\n RecommendationQuery: RecommendationQuery_1.RecommendationQuery,\n RecommendationAnalyticsClient: RecommendationAnalyticsClient_1.RecommendationAnalyticsClient\n });\n };\n /**\n * The options for the recommendation component\n * @componentOptions\n */\n Recommendation.options = {\n /**\n * Specifies the main {@link SearchInterface} to listen to.\n */\n mainSearchInterface: ComponentOptions_1.ComponentOptions.buildSelectorOption(),\n /**\n * Specifies the user context to send to Coveo usage analytics.\n * The component sends this information with the query alongside the user history to get the recommendations.\n */\n userContext: ComponentOptions_1.ComponentOptions.buildJsonOption(),\n /**\n * Specifies the ID of the interface.\n * The usage analytics use the interface ID to know which recommendation interface was selected.\n *\n * Default value is `Recommendation` for the first one and `Recommendation_{number}`, where {number} depends on the\n * number of Recommendation interfaces with default IDs in the page for the others.\n */\n id: ComponentOptions_1.ComponentOptions.buildStringOption(),\n /**\n * Specifies which options from the main {@link QueryBuilder} to use in the triggered query.\n *\n * Possible values are:\n * - `expression`\n * - `advancedExpression`\n * - `constantExpression`\n * - `disjunctionExpression`\n *\n * **Example:**\n *\n * Adding the expression (`q`) and the advanced expression (`aq`) parts of the main query in the triggered query:\n *\n * `data-options-to-use=\"expression,advancedExpression\"`\n *\n * Default value is `expression`.\n */\n optionsToUse: ComponentOptions_1.ComponentOptions.buildListOption({\n defaultValue: ['expression']\n }),\n /**\n * Specifies whether to send the actions history along with the triggered query.\n *\n * Setting this option to `false` makes it impossible for this component to get Coveo Machine Learning\n * recommendations.\n *\n * However, setting this option to `false` can be useful to display side results in a search page.\n *\n * Default value is `true`.\n *\n * @deprecated This option is now deprecated. The correct way to control this behavior is to configure an appropriate machine learning model in the administration interface (Recommendation, Relevance tuning, Query suggestions).\n */\n sendActionsHistory: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n defaultValue: true,\n deprecated: 'This option is now deprecated. The correct way to control this behaviour is to configure an appropriate machine learning model in the administration interface (Recommendation, Relevance tuning, Query suggestions)'\n }),\n /**\n * Specifies whether to hide the Recommendations component if no result or recommendation is available.\n *\n * Default value is `true`.\n */\n hideIfNoResults: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true }),\n autoTriggerQuery: ComponentOptions_1.ComponentOptions.buildBooleanOption({\n postProcessing: function (value, options) {\n if (options.mainSearchInterface) {\n return false;\n }\n return value;\n }\n }),\n /**\n * Specifies whether to enable *responsive mode* for Recommendation components. Setting this options to `false` on\n * any Recommendation component in a search interface disables responsive mode for all other Recommendation\n * components in the search interface.\n *\n * Responsive mode displays all Recommendation components under a single dropdown button whenever the width of the\n * HTML element which the search interface is bound to reaches or falls behind a certain threshold (see\n * {@link Recommendation.options.responsiveBreakpoint}).\n *\n * See also {@link Recommendation.options.dropdownHeaderLabel}.\n *\n * Default value is `true`.\n */\n enableResponsiveMode: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true }),\n /**\n * If {@link Recommendation.options.enableResponsiveMode} is `true` for all Recommendation components, specifies the\n * width threshold (in pixels) of the search interface at which Recommendation components go in responsive mode.\n *\n * Recommendation components go in responsive mode when the width of the search interface is equal to or lower than\n * this value.\n *\n * The `search interface` corresponds to the HTML element with the class `CoveoSearchInterface`.\n *\n * If more than one Recommendation component in the search interface specifies a value for this option, then the\n * framework uses the last occurrence of the option.\n *\n * Default value is `1000`.\n */\n responsiveBreakpoint: ComponentOptions_1.ComponentOptions.buildNumberOption({ defaultValue: 1000 }),\n /**\n * If {@link Recommendation.options.enableResponsiveMode} is `true` for all Recommendation components, specifies the\n * label of the dropdown button that allows to display the Recommendation components when in responsive mode.\n *\n * If more than one Recommendation component in the search interface specifies a value for this option, then the\n * framework uses the first occurrence of the option.\n *\n * Default value is `Recommendations`.\n */\n dropdownHeaderLabel: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({\n localizedString: function () { return Strings_1.l('Recommendations'); }\n })\n };\n return Recommendation;\n}(SearchInterface_1.SearchInterface));\nexports.Recommendation = Recommendation;\n// We do not register the Recommendation component since it is done with .coveo('initRecommendation')\n\n\n/***/ }),\n/* 200 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(661);\nvar underscore_1 = __webpack_require__(0);\nvar InitializationEvents_1 = __webpack_require__(17);\nvar QueryEvents_1 = __webpack_require__(11);\nvar ResultLayoutEvents_1 = __webpack_require__(133);\nvar ResultListEvents_1 = __webpack_require__(29);\nvar Assert_1 = __webpack_require__(5);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar SVGDom_1 = __webpack_require__(16);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Utils_1 = __webpack_require__(4);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar ResponsiveResultLayout_1 = __webpack_require__(662);\nvar AccessibleButton_1 = __webpack_require__(15);\nexports.defaultLayout = 'list';\n/**\n * The ResultLayoutSelector component allows the end user to switch between multiple {@link ResultList} components that have\n * different {@link ResultList.options.layout} values.\n *\n * This component automatically populates itself with buttons to switch between the ResultList components that have a\n * valid layout value (see the {@link ValidLayout} type).\n *\n * See also the [Result Layouts](https://docs.coveo.com/en/360/) documentation.\n *\n * @availablesince [February 2018 Release (v2.3826.10)](https://docs.coveo.com/en/410/#february-2018-release-v2382610)\n */\nvar ResultLayoutSelector = /** @class */ (function (_super) {\n __extends(ResultLayoutSelector, _super);\n /**\n * Creates a new ResultLayoutSelector component.\n * @param element The HTMLElement on which to instantiate the component.\n * @param options The options for the ResultLayout component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n function ResultLayoutSelector(element, options, bindings) {\n var _this = _super.call(this, element, ResultLayoutSelector.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.preferredLayout = null;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, ResultLayoutSelector, options);\n _this.currentActiveLayouts = {};\n _this.bind.onQueryState(Model_1.MODEL_EVENTS.CHANGE_ONE, QueryStateModel_1.QUERY_STATE_ATTRIBUTES.LAYOUT, _this.handleQueryStateChanged.bind(_this));\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.querySuccess, function (args) { return _this.handleQuerySuccess(args); });\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.queryError, function (args) { return _this.handleQueryError(args); });\n _this.resultLayoutSection = Dom_1.$$(_this.element).closest('.coveo-result-layout-section');\n _this.bind.oneRootElement(InitializationEvents_1.InitializationEvents.afterComponentsInitialization, function () { return _this.populate(); });\n _this.bind.oneRootElement(InitializationEvents_1.InitializationEvents.afterInitialization, function () { return _this.handleQueryStateChanged(); });\n ResponsiveResultLayout_1.ResponsiveResultLayout.init(_this.root, _this, {});\n return _this;\n }\n Object.defineProperty(ResultLayoutSelector.prototype, \"activeLayouts\", {\n get: function () {\n if (this.searchInterface.responsiveComponents.isLargeScreenWidth()) {\n return underscore_1.pick(this.currentActiveLayouts, this.options.desktopLayouts);\n }\n if (this.searchInterface.responsiveComponents.isMediumScreenWidth()) {\n return underscore_1.pick(this.currentActiveLayouts, this.options.tabletLayouts);\n }\n if (this.searchInterface.responsiveComponents.isSmallScreenWidth()) {\n return underscore_1.pick(this.currentActiveLayouts, this.options.mobileLayouts);\n }\n return this.currentActiveLayouts;\n },\n enumerable: true,\n configurable: true\n });\n /**\n * Changes the current layout.\n *\n * Also logs a `resultLayoutChange` event in the usage analytics with the new layout as metadeta.\n *\n * Triggers a new query.\n *\n * @param layout The new layout. The page must contain a valid {@link ResultList} component with a matching\n * {@link ResultList.options.layout} value for this method to work.\n */\n ResultLayoutSelector.prototype.changeLayout = function (layout) {\n this.preferredLayout = null;\n this.performLayoutChange(layout);\n };\n /**\n * Gets the current layout (`list`, `card` or `table`).\n * @returns {string} The current current layout.\n */\n ResultLayoutSelector.prototype.getCurrentLayout = function () {\n return this.currentLayout;\n };\n ResultLayoutSelector.prototype.disableLayouts = function (layouts) {\n var _this = this;\n if (Utils_1.Utils.isNonEmptyArray(layouts)) {\n underscore_1.each(layouts, function (layout) { return _this.disableLayout(layout); });\n var remainingValidLayouts = underscore_1.difference(underscore_1.keys(this.currentActiveLayouts), layouts);\n this.preferredLayout = this.currentLayout;\n if (!underscore_1.isEmpty(remainingValidLayouts)) {\n var newLayout = underscore_1.contains(remainingValidLayouts, this.currentLayout) ? this.currentLayout : remainingValidLayouts[0];\n this.performLayoutChange(newLayout);\n }\n else {\n this.logger.error('Cannot disable the last valid layout ... Re-enabling the first one possible');\n var firstPossibleValidLayout = underscore_1.keys(this.currentActiveLayouts)[0];\n this.enableLayout(firstPossibleValidLayout);\n this.setLayout(firstPossibleValidLayout);\n }\n }\n };\n ResultLayoutSelector.prototype.enableLayouts = function (layouts) {\n var _this = this;\n underscore_1.each(layouts, function (layout) { return _this.enableLayout(layout); });\n var preferredLayoutAvailable = underscore_1.find(layouts, function (layout) { return layout === _this.preferredLayout; });\n preferredLayoutAvailable && this.restorePreferredLayout();\n };\n ResultLayoutSelector.prototype.restorePreferredLayout = function () {\n this.performLayoutChange(this.preferredLayout);\n this.preferredLayout = null;\n };\n ResultLayoutSelector.prototype.performLayoutChange = function (layout) {\n Assert_1.Assert.check(this.isLayoutDisplayedByButton(layout), 'Layout not available or invalid');\n if (layout !== this.currentLayout || this.getModelValue() === '') {\n this.setModelValue(layout);\n var lastResults = this.queryController.getLastResults();\n this.setLayout(layout, lastResults);\n if (lastResults) {\n this.usageAnalytics.logCustomEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.resultsLayoutChange, {\n resultsLayoutChangeTo: layout\n }, this.element);\n }\n else {\n this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.resultsLayoutChange, {\n resultsLayoutChangeTo: layout\n });\n if (!this.queryController.firstQuery) {\n this.queryController.executeQuery();\n }\n }\n }\n };\n ResultLayoutSelector.prototype.disableLayout = function (layout) {\n if (this.isLayoutDisplayedByButton(layout)) {\n this.hideButton(layout);\n }\n };\n ResultLayoutSelector.prototype.enableLayout = function (layout) {\n var allResultLists = this.resultLists;\n var atLeastOneResultListCanShowLayout = underscore_1.find(allResultLists, function (resultList) { return resultList.options.layout == layout; });\n if (atLeastOneResultListCanShowLayout && this.isLayoutDisplayedByButton(layout)) {\n this.showButton(layout);\n this.updateSelectorAppearance();\n }\n };\n Object.defineProperty(ResultLayoutSelector.prototype, \"resultLists\", {\n get: function () {\n return this.searchInterface.getComponents('ResultList');\n },\n enumerable: true,\n configurable: true\n });\n ResultLayoutSelector.prototype.hideButton = function (layout) {\n if (this.isLayoutDisplayedByButton(layout)) {\n var btn = this.currentActiveLayouts[layout].button;\n Dom_1.$$(btn.el).addClass('coveo-hidden');\n btn.visible = false;\n this.updateSelectorAppearance();\n }\n };\n ResultLayoutSelector.prototype.showButton = function (layout) {\n if (this.isLayoutDisplayedByButton(layout)) {\n var btn = this.currentActiveLayouts[layout].button;\n Dom_1.$$(btn.el).removeClass('coveo-hidden');\n btn.visible = true;\n }\n };\n ResultLayoutSelector.prototype.setLayout = function (layout, results) {\n if (layout) {\n if (this.currentLayout) {\n Dom_1.$$(this.currentActiveLayouts[this.currentLayout].button.el).removeClass('coveo-selected');\n Dom_1.$$(this.currentActiveLayouts[this.currentLayout].button.el).setAttribute('aria-pressed', false.toString());\n }\n Dom_1.$$(this.currentActiveLayouts[layout].button.el).addClass('coveo-selected');\n Dom_1.$$(this.currentActiveLayouts[layout].button.el).setAttribute('aria-pressed', true.toString());\n this.currentLayout = layout;\n Dom_1.$$(this.element).trigger(ResultListEvents_1.ResultListEvents.changeLayout, {\n layout: layout,\n results: results\n });\n }\n };\n ResultLayoutSelector.prototype.handleQuerySuccess = function (args) {\n this.hasNoResults = args.results.results.length == 0;\n if (this.shouldShowSelector()) {\n this.show();\n }\n else {\n this.hide();\n }\n };\n ResultLayoutSelector.prototype.handleQueryStateChanged = function (args) {\n var modelLayout = this.getModelValue();\n var newLayout = underscore_1.find(underscore_1.keys(this.currentActiveLayouts), function (l) { return l === modelLayout; });\n if (newLayout !== undefined) {\n this.setLayout(newLayout);\n }\n else {\n this.setLayout(underscore_1.keys(this.currentActiveLayouts)[0]);\n }\n };\n ResultLayoutSelector.prototype.handleQueryError = function (args) {\n this.hasNoResults = true;\n this.hide();\n };\n ResultLayoutSelector.prototype.updateSelectorAppearance = function () {\n if (this.shouldShowSelector()) {\n this.show();\n }\n else {\n this.hide();\n }\n };\n ResultLayoutSelector.prototype.populate = function () {\n var _this = this;\n var populateArgs = { layouts: [] };\n Dom_1.$$(this.root).trigger(ResultLayoutEvents_1.ResultLayoutEvents.populateResultLayout, populateArgs);\n var layouts = underscore_1.uniq(populateArgs.layouts.map(function (layout) { return layout.toLowerCase(); }));\n underscore_1.each(layouts, function (layout) { return Assert_1.Assert.check(underscore_1.contains(ResultLayoutSelector.validLayouts, layout), 'Invalid layout'); });\n if (!underscore_1.isEmpty(layouts)) {\n underscore_1.each(layouts, function (layout) { return _this.addButton(layout); });\n if (!this.shouldShowSelector()) {\n this.hide();\n }\n }\n };\n ResultLayoutSelector.prototype.addButton = function (layout) {\n var _this = this;\n var btn = Dom_1.$$('span', {\n className: 'coveo-result-layout-selector'\n });\n var caption = Dom_1.$$('span', { className: 'coveo-result-layout-selector-caption' }, Strings_1.l(layout));\n btn.append(caption.el);\n var icon = Dom_1.$$('span', { className: \"coveo-icon coveo-\" + layout + \"-layout-icon\" }, SVGIcons_1.SVGIcons.icons[layout + \"Layout\"]);\n SVGDom_1.SVGDom.addClassToSVGInContainer(icon.el, \"coveo-\" + layout + \"-svg\");\n btn.prepend(icon.el);\n var selectAction = function () { return _this.changeLayout(layout); };\n new AccessibleButton_1.AccessibleButton()\n .withElement(btn)\n .withLabel(Strings_1.l('DisplayResultsAs', Strings_1.l(layout)))\n .withSelectAction(selectAction)\n .withOwner(this.bind)\n .build();\n var isCurrentLayout = layout === this.currentLayout;\n btn.toggleClass('coveo-selected', isCurrentLayout);\n btn.setAttribute('aria-pressed', isCurrentLayout.toString());\n Dom_1.$$(this.element).append(btn.el);\n this.currentActiveLayouts[layout] = {\n button: {\n visible: true,\n el: btn.el\n },\n enabled: true\n };\n };\n ResultLayoutSelector.prototype.hide = function () {\n var elem = this.resultLayoutSection || this.element;\n Dom_1.$$(elem).addClass('coveo-result-layout-hidden');\n };\n ResultLayoutSelector.prototype.show = function () {\n var elem = this.resultLayoutSection || this.element;\n Dom_1.$$(elem).removeClass('coveo-result-layout-hidden');\n };\n ResultLayoutSelector.prototype.getModelValue = function () {\n return this.queryStateModel.get(QueryStateModel_1.QueryStateModel.attributesEnum.layout);\n };\n ResultLayoutSelector.prototype.setModelValue = function (val) {\n this.queryStateModel.set(QueryStateModel_1.QueryStateModel.attributesEnum.layout, val);\n };\n ResultLayoutSelector.prototype.shouldShowSelector = function () {\n return (underscore_1.keys(this.currentActiveLayouts).length > 1 &&\n underscore_1.filter(this.currentActiveLayouts, function (activeLayout) { return activeLayout.button.visible; }).length > 1 &&\n !this.hasNoResults);\n };\n ResultLayoutSelector.prototype.isLayoutDisplayedByButton = function (layout) {\n return underscore_1.contains(underscore_1.keys(this.currentActiveLayouts), layout);\n };\n ResultLayoutSelector.ID = 'ResultLayoutSelector';\n ResultLayoutSelector.aliases = ['ResultLayout'];\n ResultLayoutSelector.doExport = function () {\n GlobalExports_1.exportGlobally({\n ResultLayoutSelector: ResultLayoutSelector,\n ResultLayout: ResultLayoutSelector\n });\n };\n ResultLayoutSelector.validLayouts = ['list', 'card', 'table'];\n /**\n * The component options\n * @componentOptions\n */\n ResultLayoutSelector.options = {\n /**\n * Specifies the layouts that should be available when the search page is displayed in mobile mode.\n *\n * By default, the mobile mode breakpoint is at 480 px screen width.\n *\n * To change this default value, use the [responsiveSmallBreakpoint]{@link SearchInterface.options.responsiveSmallBreakpoint} option.\n *\n * When the breakpoint is reached, layouts that are not specified becomes inactive and the linked result list will be disabled.\n *\n * The possible values for layouts are `list`, `card`, `table`.\n *\n * The default value is `card`, `table`.\n */\n mobileLayouts: ComponentOptions_1.ComponentOptions.buildListOption({ defaultValue: ['card', 'table'] }),\n /**\n * Specifies the layouts that should be available when the search page is displayed in tablet mode.\n *\n * By default, the tablet mode breakpoint is at 800 px screen width.\n *\n * To change this default value, use the [responsiveMediumBreakpoint]{@link SearchInterface.options.responsiveMediumBreakpoint} option.\n *\n * When the breakpoint is reached, layouts that are not specified becomes inactive and the linked result list will be disabled.\n *\n * The possible values for layouts are `list`, `card`, `table`.\n *\n * The default value is `list`, `card`, `table`.\n */\n tabletLayouts: ComponentOptions_1.ComponentOptions.buildListOption({ defaultValue: ['list', 'card', 'table'] }),\n /**\n * Specifies the layouts that should be available when the search page is displayed in desktop mode.\n *\n * By default, the desktop mode breakpoint is any screen size over 800 px.\n *\n * To change this default value, use the [responsiveMediumBreakpoint]{@link SearchInterface.options.responsiveMediumBreakpoint} option.\n *\n * When the breakpoint is reached, layouts that are not specified becomes inactive and the linked result list will be disabled.\n *\n * The possible values for layouts are `list`, `card`, `table`.\n *\n * The default value is `list`, `card`, `table`.\n */\n desktopLayouts: ComponentOptions_1.ComponentOptions.buildListOption({ defaultValue: ['list', 'card', 'table'] })\n };\n return ResultLayoutSelector;\n}(Component_1.Component));\nexports.ResultLayoutSelector = ResultLayoutSelector;\nInitialization_1.Initialization.registerAutoCreateComponent(ResultLayoutSelector);\n\n\n/***/ }),\n/* 201 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(674);\nvar underscore_1 = __webpack_require__(0);\nvar InitializationEvents_1 = __webpack_require__(17);\nvar QueryEvents_1 = __webpack_require__(11);\nvar GlobalExports_1 = __webpack_require__(3);\nvar Assert_1 = __webpack_require__(5);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar SearchEndpoint_1 = __webpack_require__(53);\nvar AccessibleButton_1 = __webpack_require__(15);\nvar Dom_1 = __webpack_require__(1);\nvar Utils_1 = __webpack_require__(4);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar ResponsiveTabs_1 = __webpack_require__(675);\n/**\n * The Tab component renders a widget that allows the end user to select a specific search interface.\n *\n * This component attaches itself to a `div` element. It is in charge of adding an advanced expression to the outgoing\n * query in order to refine the results.\n *\n * The Tab component can also hide and show different parts of the UI. For each individual component in the UI, you can\n * specify whether you wish to include or exclude that component when the user selects a certain Tab (see [Using Components\n * Only on Specific Tabs](https://docs.coveo.com/en/508/javascript-search-framework/using-components-only-on-specific-tabs)).\n *\n * **Setting a New Endpoint for a Tab:**\n *\n * A Tab can use a custom endpoint when performing a query. Of course, you need to make sure that the endpoint exists in\n * the array of Coveo.SearchEndpoint.endpoints (see {@link SearchEndpoint.endpoints}).\n *\n * ```\n * Coveo.SearchEndpoint.endpoints[\"specialEndpoint\"] = new Coveo.SearchEndpoint({\n * restUri : 'https://somewhere.com/rest/search'\n * })\n *\n * [ ... ]\n *\n *
\n *\n * ```\n */\nvar Tab = /** @class */ (function (_super) {\n __extends(Tab, _super);\n /**\n * Creates a new Tab. Binds on buildingQuery event as well as an event on click of the element.\n * @param element The HTMLElement on which to instantiate the component. Normally a `div`.\n * @param options The options for the Tab component.\n * @param bindings The bindings that the component requires to function normally. If not set, these will be\n * automatically resolved (with a slower execution time).\n */\n function Tab(element, options, bindings) {\n var _this = _super.call(this, element, Tab.ID, bindings) || this;\n _this.element = element;\n _this.options = options;\n _this.options = ComponentOptions_1.ComponentOptions.initComponentOptions(element, Tab, options);\n _this.bind.onRootElement(QueryEvents_1.QueryEvents.buildingQuery, function (args) { return _this.handleBuildingQuery(args); });\n _this.bind.onRootElement(InitializationEvents_1.InitializationEvents.afterInitialization, function () { return _this.handleAfterInitialization(); });\n _this.bind.onQueryState(Model_1.MODEL_EVENTS.CHANGE_ONE, QueryStateModel_1.QUERY_STATE_ATTRIBUTES.T, function (args) {\n return _this.handleQueryStateChanged(args);\n });\n new AccessibleButton_1.AccessibleButton()\n .withElement(element)\n .withSelectAction(function () { return _this.select(); })\n .withTitle(_this.options.caption)\n .withOwner(_this.bind)\n .build();\n _this.render();\n ResponsiveTabs_1.ResponsiveTabs.init(_this.root, _this, _this.options);\n return _this;\n }\n /**\n * Selects the current Tab.\n *\n * Also logs the `interfaceChange` event in the usage analytics with the new current {@link Tab.options.id} as metada\n * and triggers a new query.\n */\n Tab.prototype.select = function () {\n if (!this.disabled) {\n var state = {\n t: this.options.id,\n sort: this.options.sort || QueryStateModel_1.QueryStateModel.defaultAttributes.sort\n };\n if (this.options.layout) {\n state.layout = this.options.layout;\n }\n this.queryStateModel.setMultiple(state);\n this.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.interfaceChange, {\n interfaceChangeTo: this.options.id\n });\n this.queryController.executeQuery();\n }\n };\n /**\n * Indicates whether the HTMLElement argument is included in the Tab. *Included* elements are shown when the Tab is\n * selected, whereas *excluded* elements are not.\n * @param element The HTMLElement to verify.\n * @returns {boolean} `true` if the HTMLElement is included in the Tab; `false` if it is excluded.\n */\n Tab.prototype.isElementIncludedInTab = function (element) {\n Assert_1.Assert.exists(element);\n var includedTabs = this.splitListOfTabs(element.getAttribute('data-tab'));\n var excludedTabs = this.splitListOfTabs(element.getAttribute('data-tab-not'));\n Assert_1.Assert.check(!(includedTabs.length != 0 && excludedTabs.length != 0), 'You cannot both explicitly include and exclude an element from tabs.');\n return ((includedTabs.length != 0 && underscore_1.indexOf(includedTabs, this.options.id) != -1) ||\n (excludedTabs.length != 0 && underscore_1.indexOf(excludedTabs, this.options.id) == -1) ||\n (includedTabs.length == 0 && excludedTabs.length == 0));\n };\n Tab.prototype.render = function () {\n var icon = this.options.icon;\n if (Utils_1.Utils.isNonEmptyString(icon)) {\n var iconSpan = Dom_1.$$('span').el;\n Dom_1.$$(iconSpan).addClass(['coveo-icon', icon]);\n this.element.insertBefore(iconSpan, this.element.firstChild);\n }\n var caption = this.options.caption;\n if (Utils_1.Utils.isNonEmptyString(caption)) {\n var captionP = document.createElement('p');\n Dom_1.$$(captionP).text(caption);\n this.element.appendChild(captionP);\n }\n };\n Tab.prototype.handleBuildingQuery = function (data) {\n Assert_1.Assert.exists(data);\n if (!this.disabled && this.isSelected()) {\n data.queryBuilder.tab = this.options.id;\n if (Utils_1.Utils.isNonEmptyString(this.options.expression)) {\n if (this.options.constant) {\n data.queryBuilder.constantExpression.add(this.options.expression);\n }\n else {\n data.queryBuilder.advancedExpression.add(this.options.expression);\n }\n }\n if (this.options.enableDuplicateFiltering) {\n data.queryBuilder.enableDuplicateFiltering = true;\n }\n if (this.options.pipeline != null) {\n data.queryBuilder.pipeline = this.options.pipeline;\n }\n if (this.options.maximumAge != null) {\n data.queryBuilder.maximumAge = this.options.maximumAge;\n }\n }\n };\n Tab.prototype.handleQueryStateChanged = function (data) {\n Assert_1.Assert.exists(data);\n if (!this.disabled && this.isSelected()) {\n Dom_1.$$(this.element).addClass('coveo-selected');\n this.queryController.setEndpoint(this.options.endpoint);\n this.showAndHideAppropriateElements();\n }\n else {\n Dom_1.$$(this.element).removeClass('coveo-selected');\n }\n };\n Tab.prototype.handleAfterInitialization = function () {\n if (this.isSelected() && this.options.layout) {\n this.queryStateModel.set(QueryStateModel_1.QUERY_STATE_ATTRIBUTES.LAYOUT, this.options.layout);\n }\n };\n Tab.prototype.isSelected = function () {\n var activeTab = this.queryStateModel.get(QueryStateModel_1.QueryStateModel.attributesEnum.t);\n return activeTab == this.options.id;\n };\n Tab.prototype.showAndHideAppropriateElements = function () {\n var _this = this;\n var showElements = [];\n var hideElements = [];\n underscore_1.each(Dom_1.$$(this.root).findAll('[data-tab],[data-tab-not]'), function (element) {\n if (_this.isElementIncludedInTab(element)) {\n _this.toggleAllComponentsUnder(element, true);\n showElements.push(element);\n }\n else {\n _this.toggleAllComponentsUnder(element, false);\n hideElements.push(element);\n }\n });\n Dom_1.$$(this.root).one(QueryEvents_1.QueryEvents.querySuccess, function () {\n underscore_1.each(showElements, function (elem) { return Dom_1.$$(elem).removeClass('coveo-tab-disabled'); });\n underscore_1.each(hideElements, function (elem) { return Dom_1.$$(elem).addClass('coveo-tab-disabled'); });\n });\n };\n Tab.prototype.splitListOfTabs = function (value) {\n if (Utils_1.Utils.exists(value)) {\n return underscore_1.map(value.split(','), function (tab) { return Utils_1.Utils.trim(tab); });\n }\n else {\n return [];\n }\n };\n Tab.prototype.toggleAllComponentsUnder = function (element, enable) {\n Assert_1.Assert.exists(element);\n var togglePossibleComponent = function (possibleComponent) {\n var possibleCmp = Component_1.Component.get(possibleComponent, undefined, true);\n if (possibleCmp) {\n if (enable) {\n possibleCmp.enable();\n }\n else {\n possibleCmp.disable();\n }\n }\n };\n togglePossibleComponent(element);\n underscore_1.each(Dom_1.$$(element).findAll('*'), function (el) {\n togglePossibleComponent(el);\n });\n };\n Tab.prototype.enable = function () {\n _super.prototype.enable.call(this);\n this.element.style.display = '';\n };\n Tab.prototype.disable = function () {\n _super.prototype.disable.call(this);\n this.element.style.display = 'none';\n };\n Tab.ID = 'Tab';\n Tab.doExport = function () {\n GlobalExports_1.exportGlobally({\n Tab: Tab\n });\n };\n /**\n * The options for a Tab\n * @componentOptions\n */\n Tab.options = {\n /**\n * Specifies a unique ID for the Tab.\n *\n * Specifying a value for this option is necessary for this component to work.\n */\n id: ComponentOptions_1.ComponentOptions.buildStringOption({ required: true, section: 'Common Options' }),\n /**\n * Specifies the caption of the Tab.\n *\n * Specifying a value for this option is necessary for this component to work.\n */\n caption: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({ required: true, section: 'Common Options' }),\n /**\n * Specifies an icon to use for the Tab.\n *\n * @deprecated This options is mostly kept for legacy reasons. If possible, you should avoid using it.\n */\n icon: ComponentOptions_1.ComponentOptions.buildStringOption(),\n /**\n * Specifies an advanced expression or filter that the Tab should add to any outgoing query.\n *\n * **Example:**\n *\n * `@objecttype==Message`\n *\n * Default value is `undefined` and the Tab applies no additional expression or filter to the query.\n */\n expression: ComponentOptions_1.ComponentOptions.buildQueryExpressionOption({ section: 'Common Options' }),\n /**\n * Specifies the {@link SearchEndpoint} to point to when performing queries from within the Tab.\n *\n * By default, the Tab uses the \"default\" endpoint.\n */\n endpoint: ComponentOptions_1.ComponentOptions.buildCustomOption(function (endpoint) { return (endpoint != null ? SearchEndpoint_1.SearchEndpoint.endpoints[endpoint] : null); }),\n /**\n * Specifies the default sort criteria to use when selecting the Tab. A {@link Sort} component with the same\n * parameter needs to be present in the search interface in order for this option to function properly.\n *\n * **Examples:**\n *\n * - `data-sort='relevancy'`\n * - `data-sort='date descending'`\n *\n * Default value is `undefined` and the normal {@link Sort} component behavior applies.\n */\n sort: ComponentOptions_1.ComponentOptions.buildStringOption(),\n /**\n * Specifies the default layout to display when the user selects the Tab (see {@link ResultList.options.layout} and\n * {@link ResultLayout}).\n *\n * See the {@link ValidLayout} type for the list of possible values.\n *\n * If not specified, it will default to 'list'.\n *\n * See also [Result Layouts](https://docs.coveo.com/en/360/).\n *\n * Default value is `undefined` and the component selects the first available layout.\n */\n layout: ComponentOptions_1.ComponentOptions.buildStringOption(),\n /**\n * Specifies whether to include the {@link Tab.options.expression} in the constant part of the query.\n *\n * The index specially optimizes the constant part of the query to execute faster. However, you must be careful not\n * to include dynamic query expressions, otherwise the cache will lose its efficiency.\n *\n * Default value is `true`.\n */\n constant: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true, section: 'Filtering' }),\n /**\n * Whether to filter out duplicates, so that items resembling one another only appear once in the query results.\n *\n * **Notes:**\n * - Two items must be at least 85% similar to one another to be considered duplicates.\n * - When a pair of duplicates is found, only the higher-ranked item of the two is kept in the result set.\n * - Enabling this feature can make the total result count less precise, as only the requested page of query results is submitted to duplicate filtering.\n * - The default value for this option can be modified through the {@link SearchInterface} component.\n */\n enableDuplicateFiltering: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: false }),\n /**\n * Specifies the name of the query pipeline to use for the queries when the Tab is selected.\n *\n * You can specify a value for this option if your index is in a Coveo Cloud organization in which pipelines have\n * been created (see [Adding and Managing Query Pipelines](https://docs.coveo.com/en/1791/)).\n *\n * Default value is `undefined`, which means that pipeline selection conditions defined in the Coveo Cloud\n * organization apply.\n */\n pipeline: ComponentOptions_1.ComponentOptions.buildStringOption(),\n /**\n * Specifies the maximum age (in milliseconds) that cached query results can have to still be usable as results\n * instead of performing a new query on the index from within the Tab. The cache is located in the Coveo Search API\n * (which resides between the index and the search interface).\n *\n * If cached results that are older than the age you specify in this option are available, a new query will be\n * performed on the index anyhow.\n *\n * On high-volume public web sites, specifying a higher value for this option can greatly improve query response\n * time at the cost of result freshness.\n *\n * **Note:**\n *\n * > It is also possible to set a maximum cache age for the entire {@link SearchInterface} rather than for a single\n * > Tab (see {@link SearchInterface.options.maximumAge}).\n *\n * Default value is `undefined` and the Coveo Search API determines the maximum cache age. This is typically\n * equivalent to 30 minutes (see [maximumAge](https://docs.coveo.com/en/1461/#RestQueryParameters-maximumAge)).\n */\n maximumAge: ComponentOptions_1.ComponentOptions.buildNumberOption(),\n /**\n * Specifies whether to enable responsive mode for tabs. Responsive mode makes overflowing tabs disappear, instead\n * making them available using a dropdown button. Responsive tabs are enabled either when tabs overflow or when the\n * width of the search interface becomes too small.\n *\n * Disabling responsive mode for one Tab also disables it for all tabs. Therefore, you only need to set this option\n * to `false` on one Tab to disable responsive mode.\n *\n * Default value is `true`.\n *\n * @availablesince [October 2016 Release (v1.1550.5)](https://docs.coveo.com/en/309/#october-2016-release-v115505)\n */\n enableResponsiveMode: ComponentOptions_1.ComponentOptions.buildBooleanOption({ defaultValue: true, section: 'ResponsiveOptions' }),\n /**\n * Specifies the label of the button that allows to show the hidden tabs when in responsive mode.\n *\n * If more than one Tab in the search interface specifies a value for this option, then the framework uses the first\n * occurrence of the option.\n *\n * The default value is `\"More\"`.\n */\n dropdownHeaderLabel: ComponentOptions_1.ComponentOptions.buildLocalizedStringOption({ section: 'ResponsiveOptions' })\n };\n return Tab;\n}(Component_1.Component));\nexports.Tab = Tab;\nInitialization_1.Initialization.registerAutoCreateComponent(Tab);\n\n\n/***/ }),\n/* 202 */\n/***/ (function(module, exports) {\n\n// shim for using process in browser\nvar process = module.exports = {};\n\n// cached from whatever global is present so that test runners that stub it\n// don't break things. But we need to wrap it in a try catch in case it is\n// wrapped in strict mode code which doesn't define any globals. It's inside a\n// function because try/catches deoptimize in certain engines.\n\nvar cachedSetTimeout;\nvar cachedClearTimeout;\n\nfunction defaultSetTimout() {\n throw new Error('setTimeout has not been defined');\n}\nfunction defaultClearTimeout () {\n throw new Error('clearTimeout has not been defined');\n}\n(function () {\n try {\n if (typeof setTimeout === 'function') {\n cachedSetTimeout = setTimeout;\n } else {\n cachedSetTimeout = defaultSetTimout;\n }\n } catch (e) {\n cachedSetTimeout = defaultSetTimout;\n }\n try {\n if (typeof clearTimeout === 'function') {\n cachedClearTimeout = clearTimeout;\n } else {\n cachedClearTimeout = defaultClearTimeout;\n }\n } catch (e) {\n cachedClearTimeout = defaultClearTimeout;\n }\n} ())\nfunction runTimeout(fun) {\n if (cachedSetTimeout === setTimeout) {\n //normal enviroments in sane situations\n return setTimeout(fun, 0);\n }\n // if setTimeout wasn't available but was latter defined\n if ((cachedSetTimeout === defaultSetTimout || !cachedSetTimeout) && setTimeout) {\n cachedSetTimeout = setTimeout;\n return setTimeout(fun, 0);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedSetTimeout(fun, 0);\n } catch(e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedSetTimeout.call(null, fun, 0);\n } catch(e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error\n return cachedSetTimeout.call(this, fun, 0);\n }\n }\n\n\n}\nfunction runClearTimeout(marker) {\n if (cachedClearTimeout === clearTimeout) {\n //normal enviroments in sane situations\n return clearTimeout(marker);\n }\n // if clearTimeout wasn't available but was latter defined\n if ((cachedClearTimeout === defaultClearTimeout || !cachedClearTimeout) && clearTimeout) {\n cachedClearTimeout = clearTimeout;\n return clearTimeout(marker);\n }\n try {\n // when when somebody has screwed with setTimeout but no I.E. maddness\n return cachedClearTimeout(marker);\n } catch (e){\n try {\n // When we are in I.E. but the script has been evaled so I.E. doesn't trust the global object when called normally\n return cachedClearTimeout.call(null, marker);\n } catch (e){\n // same as above but when it's a version of I.E. that must have the global object for 'this', hopfully our context correct otherwise it will throw a global error.\n // Some versions of I.E. have different rules for clearTimeout vs setTimeout\n return cachedClearTimeout.call(this, marker);\n }\n }\n\n\n\n}\nvar queue = [];\nvar draining = false;\nvar currentQueue;\nvar queueIndex = -1;\n\nfunction cleanUpNextTick() {\n if (!draining || !currentQueue) {\n return;\n }\n draining = false;\n if (currentQueue.length) {\n queue = currentQueue.concat(queue);\n } else {\n queueIndex = -1;\n }\n if (queue.length) {\n drainQueue();\n }\n}\n\nfunction drainQueue() {\n if (draining) {\n return;\n }\n var timeout = runTimeout(cleanUpNextTick);\n draining = true;\n\n var len = queue.length;\n while(len) {\n currentQueue = queue;\n queue = [];\n while (++queueIndex < len) {\n if (currentQueue) {\n currentQueue[queueIndex].run();\n }\n }\n queueIndex = -1;\n len = queue.length;\n }\n currentQueue = null;\n draining = false;\n runClearTimeout(timeout);\n}\n\nprocess.nextTick = function (fun) {\n var args = new Array(arguments.length - 1);\n if (arguments.length > 1) {\n for (var i = 1; i < arguments.length; i++) {\n args[i - 1] = arguments[i];\n }\n }\n queue.push(new Item(fun, args));\n if (queue.length === 1 && !draining) {\n runTimeout(drainQueue);\n }\n};\n\n// v8 likes predictible objects\nfunction Item(fun, array) {\n this.fun = fun;\n this.array = array;\n}\nItem.prototype.run = function () {\n this.fun.apply(null, this.array);\n};\nprocess.title = 'browser';\nprocess.browser = true;\nprocess.env = {};\nprocess.argv = [];\nprocess.version = ''; // empty string to avoid regexp issues\nprocess.versions = {};\n\nfunction noop() {}\n\nprocess.on = noop;\nprocess.addListener = noop;\nprocess.once = noop;\nprocess.off = noop;\nprocess.removeListener = noop;\nprocess.removeAllListeners = noop;\nprocess.emit = noop;\nprocess.prependListener = noop;\nprocess.prependOnceListener = noop;\n\nprocess.listeners = function (name) { return [] }\n\nprocess.binding = function (name) {\n throw new Error('process.binding is not supported');\n};\n\nprocess.cwd = function () { return '/' };\nprocess.chdir = function (dir) {\n throw new Error('process.chdir is not supported');\n};\nprocess.umask = function() { return 0; };\n\n\n/***/ }),\n/* 203 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * The `DistanceEvents` static class contains the string definitions of all events related to distance\n * list.\n *\n * See [Events](https://docs.coveo.com/en/417/).\n */\nvar DistanceEvents = /** @class */ (function () {\n function DistanceEvents() {\n }\n /**\n * Triggered when the [`DistanceResources`]{@link DistanceResources} component successfully resolves the position.\n *\n * All `onPositionResolved` event handlers receive a [`PositionResolvedEventArgs`]{@link IPositionResolvedEventArgs}\n * object as an argument.\n *\n * @type {string} The string value is `onPositionResolved`.\n */\n DistanceEvents.onPositionResolved = 'onPositionResolved';\n /**\n * Triggered when the [`DistanceResources`]{@link DistanceResources} component tries to resolve the position.\n *\n * All `onResolvingPosition` event handlers receive a\n * [`ResolvingPositionEventArgs`]{@link IResolvingPositionEventArgs} object as an argument.\n *\n * **Note:**\n * > You should bind a handler to this event if you want to register one or several new position providers.\n *\n * @type {string} The string value is `onResolvingPosition`.\n */\n DistanceEvents.onResolvingPosition = 'onResolvingPosition';\n /**\n * Triggered when the [`DistanceResources`]{@link DistanceResources} component fails to resolve the position.\n *\n * **Note:**\n * > You should bind a handler to this event if you want to display an error message to the end user, or hide\n * > components that cannot be used.\n *\n * @type {string} The string value is `onPositionNotResolved`.\n */\n DistanceEvents.onPositionNotResolved = 'onPositionNotResolved';\n return DistanceEvents;\n}());\nexports.DistanceEvents = DistanceEvents;\n\n\n/***/ }),\n/* 204 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Model_1 = __webpack_require__(18);\nexports.Model = Model_1.Model;\nvar QueryStateModel_1 = __webpack_require__(13);\nexports.QueryStateModel = QueryStateModel_1.QueryStateModel;\nvar ComponentOptionsModel_1 = __webpack_require__(28);\nexports.ComponentOptionsModel = ComponentOptionsModel_1.ComponentOptionsModel;\nvar ComponentStateModel_1 = __webpack_require__(78);\nexports.ComponentStateModel = ComponentStateModel_1.ComponentStateModel;\n\n\n/***/ }),\n/* 205 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Globalize = __webpack_require__(23);\nvar underscore_1 = __webpack_require__(0);\nvar Strings_1 = __webpack_require__(6);\nvar RegisteredNamedMethods_1 = __webpack_require__(30);\nvar Dom_1 = __webpack_require__(1);\nvar QuerySummaryUtils = /** @class */ (function () {\n function QuerySummaryUtils() {\n }\n QuerySummaryUtils.message = function (root, data) {\n var messageBuilder = QuerySummaryUtils.messageBuilderForMode(root);\n var strings = QuerySummaryUtils.getSummaryStrings(data);\n return messageBuilder(data, strings);\n };\n QuerySummaryUtils.htmlMessage = function (root, data) {\n var messageBuilder = QuerySummaryUtils.messageBuilderForMode(root);\n var strings = QuerySummaryUtils.getHtmlSummaryStrings(data);\n return messageBuilder(data, strings);\n };\n QuerySummaryUtils.replaceQueryTags = function (template, replacement) {\n var queryTag = /\\$\\{query\\}/g;\n return template ? template.replace(queryTag, replacement) : '';\n };\n QuerySummaryUtils.messageBuilderForMode = function (root) {\n if (QuerySummaryUtils.isInfiniteScrollMode(root)) {\n return QuerySummaryUtils.buildInfiniteScrollMessage;\n }\n return QuerySummaryUtils.buildStandardMessage;\n };\n QuerySummaryUtils.isInfiniteScrollMode = function (root) {\n var resultListSelector = \".CoveoResultList\";\n var resultLists = Dom_1.$$(root).findAll(resultListSelector);\n return underscore_1.any(resultLists, function (resultList) {\n var options = RegisteredNamedMethods_1.get(resultList).options;\n return options && options.enableInfiniteScroll;\n });\n };\n QuerySummaryUtils.buildStandardMessage = function (data, strings) {\n var numOfResults = data.results.results.length;\n var messages = {\n includingQuery: Strings_1.l('ShowingResultsOfWithQuery', strings.first, strings.last, strings.totalCount, strings.query, numOfResults),\n excludingQuery: Strings_1.l('ShowingResultsOf', strings.first, strings.last, strings.totalCount, numOfResults)\n };\n return QuerySummaryUtils.buildMessage(data, messages);\n };\n QuerySummaryUtils.buildInfiniteScrollMessage = function (data, strings) {\n var numOfResults = data.results.results.length;\n var messages = {\n includingQuery: Strings_1.l('ShowingResultsWithQuery', strings.totalCount, strings.query, numOfResults),\n excludingQuery: Strings_1.l('ShowingResults', strings.totalCount, numOfResults)\n };\n return QuerySummaryUtils.buildMessage(data, messages);\n };\n QuerySummaryUtils.buildMessage = function (data, message) {\n var numOfResults = data.results.results.length;\n var sanitizedQuery = QuerySummaryUtils.sanitizeQuery(data.query);\n if (!numOfResults) {\n return '';\n }\n return sanitizedQuery ? message.includingQuery : message.excludingQuery;\n };\n QuerySummaryUtils.getHtmlSummaryStrings = function (data) {\n var strings = QuerySummaryUtils.getSummaryStrings(data);\n return {\n first: QuerySummaryUtils.wrapWithSpanTag(strings.first),\n last: QuerySummaryUtils.wrapWithSpanTag(strings.last),\n totalCount: QuerySummaryUtils.wrapWithSpanTag(strings.totalCount),\n query: QuerySummaryUtils.wrapWithSpanTag(strings.query)\n };\n };\n QuerySummaryUtils.wrapWithSpanTag = function (word) {\n return Dom_1.$$('span', { className: 'coveo-highlight' }, word).el.outerHTML;\n };\n QuerySummaryUtils.getSummaryStrings = function (data) {\n var queryPerformed = data.query;\n var queryResults = data.results;\n var first = Globalize.format(queryPerformed.firstResult + 1, 'n0');\n var last = Globalize.format(queryPerformed.firstResult + queryResults.results.length, 'n0');\n var totalCount = Globalize.format(queryResults.totalCountFiltered, 'n0');\n var query = QuerySummaryUtils.sanitizeQuery(queryPerformed);\n return { first: first, last: last, totalCount: totalCount, query: query };\n };\n QuerySummaryUtils.sanitizeQuery = function (query) {\n return query.q ? underscore_1.escape(query.q.trim()) : '';\n };\n return QuerySummaryUtils;\n}());\nexports.QuerySummaryUtils = QuerySummaryUtils;\n\n\n/***/ }),\n/* 206 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(392);\nvar Dom_1 = __webpack_require__(1);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Core_1 = __webpack_require__(20);\nvar SVGIcons_1 = __webpack_require__(12);\nvar Model_1 = __webpack_require__(18);\nvar QueryStateModel_1 = __webpack_require__(13);\nvar XRegExp = __webpack_require__(207);\nvar underscore_1 = __webpack_require__(0);\nvar AccessibilityUtils_1 = __webpack_require__(48);\nvar MissingTermManager = /** @class */ (function () {\n function MissingTermManager(args) {\n var _this = this;\n this.args = args;\n Dom_1.$$(args.element).on(Core_1.QueryEvents.doneBuildingQuery, function (event, args) {\n return _this.handleBuildingQuery(args);\n });\n Dom_1.$$(args.element).on(\"state:\" + Model_1.MODEL_EVENTS.CHANGE_ONE + QueryStateModel_1.QUERY_STATE_ATTRIBUTES.Q, function (evt, args) {\n return _this.handleQueryChange(args);\n });\n Dom_1.$$(args.element).on(Core_1.BreadcrumbEvents.populateBreadcrumb, function (evt, args) {\n _this.handlePopulateBreadcrumb(args);\n });\n Dom_1.$$(args.element).on(Core_1.BreadcrumbEvents.clearBreadcrumb, function (evt, args) { return _this.handleClearBreadcrumb(); });\n }\n MissingTermManager.prototype.handleBuildingQuery = function (data) {\n var currentMissingTerm = this.args.queryStateModel.get('missingTerms');\n currentMissingTerm.forEach(function (term) {\n data.queryBuilder.advancedExpression.add(term);\n });\n };\n Object.defineProperty(MissingTermManager.prototype, \"termsForcedToAppear\", {\n get: function () {\n return this.args.queryStateModel.get('missingTerms').slice();\n },\n enumerable: true,\n configurable: true\n });\n MissingTermManager.prototype.setUpdateTermsForcedToAppear = function (terms) {\n this.args.queryStateModel.set('missingTerms', terms.slice());\n };\n MissingTermManager.prototype.handlePopulateBreadcrumb = function (args) {\n if (this.termsForcedToAppear.length === 0) {\n return;\n }\n var missingTerms = this.buildTermForcedToAppear();\n var BreadcrumbContainer = this.buildBreadcrumbContainer(args.headingLevel);\n missingTerms.forEach(function (term) { return Dom_1.$$(BreadcrumbContainer).append(term.el); });\n args.breadcrumbs.push({\n element: BreadcrumbContainer.el\n });\n };\n MissingTermManager.prototype.buildTermForcedToAppear = function () {\n var _this = this;\n return this.termsForcedToAppear.map(function (term) {\n var termContainer = Dom_1.$$('button', {\n type: 'button',\n className: 'coveo-missing-term-breadcrumb-value coveo-accessible-button'\n }, Dom_1.$$('span', { className: 'coveo-missing-term-breadcrumb-caption' }, underscore_1.escape(term)), Dom_1.$$('span', { className: 'coveo-missing-term-breadcrumb-clear' }, SVGIcons_1.SVGIcons.icons.mainClear));\n termContainer.on('click', function () { return _this.removeTermForcedToAppear(term); });\n return termContainer;\n });\n };\n MissingTermManager.prototype.buildBreadcrumbContainer = function (headingLevel) {\n return Dom_1.$$('div', {\n className: 'coveo-remove-term-container'\n }, Dom_1.$$(AccessibilityUtils_1.getHeadingTag(headingLevel, 'span'), {\n className: 'coveo-missing-term-breadcrumb-title'\n }, Core_1.l('MustContain')));\n };\n MissingTermManager.prototype.removeTermForcedToAppear = function (term) {\n var termsForcedToAppearCopy = this.termsForcedToAppear;\n var termIndex = termsForcedToAppearCopy.indexOf(term);\n termsForcedToAppearCopy.splice(termIndex, 1);\n this.setUpdateTermsForcedToAppear(termsForcedToAppearCopy);\n this.logAnalyticsRemoveMissingTerm(term);\n this.args.queryController.executeQuery();\n };\n MissingTermManager.prototype.logAnalyticsRemoveMissingTerm = function (term) {\n this.args.usageAnalytics.logSearchEvent(AnalyticsActionListMeta_1.analyticsActionCauseList.removeMissingTerm, {\n missingTerm: term\n });\n };\n MissingTermManager.prototype.handleClearBreadcrumb = function () {\n this.setUpdateTermsForcedToAppear([]);\n };\n MissingTermManager.prototype.handleQueryChange = function (args) {\n this.updateTermsForcedToAppearToOnlyIncludeWords(args);\n var breadcrumbSelector = document.querySelector('.CoveoBreadcrumb');\n if (!breadcrumbSelector) {\n return;\n }\n var breadcrumb = Core_1.get(breadcrumbSelector);\n if (breadcrumb) {\n breadcrumb.getBreadcrumbs();\n Dom_1.$$(this.args.element).trigger(Core_1.BreadcrumbEvents.redrawBreadcrumb);\n }\n };\n MissingTermManager.prototype.updateTermsForcedToAppearToOnlyIncludeWords = function (args) {\n var termForcedToAppearCopy = this.termsForcedToAppear;\n this.termsForcedToAppear.forEach(function (term) {\n var regex = XRegExp(MissingTermManager.wordBoundary + \"(\" + term + \")\" + MissingTermManager.wordBoundary, 'g');\n if (!regex.test(args.value)) {\n var termIndex = termForcedToAppearCopy.indexOf(term);\n termForcedToAppearCopy.splice(termIndex, 1);\n }\n });\n this.setUpdateTermsForcedToAppear(termForcedToAppearCopy);\n };\n MissingTermManager.ID = 'MissingTermManager';\n // We only need to import one Asian characters script because what is important here is the space\n // between characters and any of those scripts will contain it.\n // p{Han}: import the unicode script for chinese caracter\n // List of script: https://www.fontspace.com/unicode/script\n MissingTermManager.wordBoundary = '(([\\\\p{Han}])?([^(\\\\p{Latin}-)])|^|$)';\n return MissingTermManager;\n}());\nexports.MissingTermManager = MissingTermManager;\n\n\n/***/ }),\n/* 207 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n\nvar _interopRequireDefault = __webpack_require__(37);\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _xregexp = _interopRequireDefault(__webpack_require__(393));\n\nvar _build = _interopRequireDefault(__webpack_require__(436));\n\nvar _matchrecursive = _interopRequireDefault(__webpack_require__(437));\n\nvar _unicodeBase = _interopRequireDefault(__webpack_require__(438));\n\nvar _unicodeBlocks = _interopRequireDefault(__webpack_require__(439));\n\nvar _unicodeCategories = _interopRequireDefault(__webpack_require__(441));\n\nvar _unicodeProperties = _interopRequireDefault(__webpack_require__(443));\n\nvar _unicodeScripts = _interopRequireDefault(__webpack_require__(445));\n\n(0, _build.default)(_xregexp.default);\n(0, _matchrecursive.default)(_xregexp.default);\n(0, _unicodeBase.default)(_xregexp.default);\n(0, _unicodeBlocks.default)(_xregexp.default);\n(0, _unicodeCategories.default)(_xregexp.default);\n(0, _unicodeProperties.default)(_xregexp.default);\n(0, _unicodeScripts.default)(_xregexp.default);\nvar _default = _xregexp.default;\nexports.default = _default;\nmodule.exports = exports[\"default\"];\n\n/***/ }),\n/* 208 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar StorageUtils = /** @class */ (function () {\n function StorageUtils(id, storageProvider) {\n if (storageProvider === void 0) { storageProvider = 'local'; }\n this.id = id;\n // This check must be made in a try/catch. If cookies are disabled for a\n // browser then window.localStorage will throw an undefined exception.\n try {\n switch (storageProvider) {\n case 'local':\n this.storage = window.localStorage;\n break;\n case 'session':\n this.storage = window.sessionStorage;\n break;\n default:\n this.storage = null;\n }\n }\n catch (error) {\n this.storage = null;\n }\n }\n StorageUtils.prototype.save = function (data) {\n if (!this.storage) {\n return;\n }\n try {\n this.storage.setItem(this.getStorageKey(), JSON.stringify(data));\n }\n catch (error) { }\n };\n StorageUtils.prototype.load = function () {\n if (!this.storage) {\n return null;\n }\n try {\n var value = this.storage.getItem(this.getStorageKey());\n return value && JSON.parse(value);\n }\n catch (error) {\n return null;\n }\n };\n StorageUtils.prototype.remove = function (key) {\n if (!this.storage) {\n return;\n }\n try {\n if (key == undefined) {\n this.storage.removeItem(this.getStorageKey());\n }\n else {\n var oldObj = this.load();\n delete oldObj[key];\n this.save(oldObj);\n }\n }\n catch (error) { }\n };\n StorageUtils.prototype.getStorageKey = function () {\n return 'coveo-' + this.id;\n };\n return StorageUtils;\n}());\nexports.StorageUtils = StorageUtils;\n\n\n/***/ }),\n/* 209 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar LiveAnalyticsClient_1 = __webpack_require__(170);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Component_1 = __webpack_require__(7);\nvar SearchInterface_1 = __webpack_require__(19);\nvar _ = __webpack_require__(0);\nvar RecommendationAnalyticsClient = /** @class */ (function (_super) {\n __extends(RecommendationAnalyticsClient, _super);\n function RecommendationAnalyticsClient(endpoint, rootElement, userId, userDisplayName, anonymous, splitTestRunName, splitTestRunVersion, originLevel1, sendToCloud, bindings) {\n var _this = _super.call(this, endpoint, rootElement, userId, userDisplayName, anonymous, splitTestRunName, splitTestRunVersion, originLevel1, sendToCloud, bindings) || this;\n _this.endpoint = endpoint;\n _this.rootElement = rootElement;\n _this.userId = userId;\n _this.userDisplayName = userDisplayName;\n _this.anonymous = anonymous;\n _this.splitTestRunName = splitTestRunName;\n _this.splitTestRunVersion = splitTestRunVersion;\n _this.originLevel1 = originLevel1;\n _this.sendToCloud = sendToCloud;\n _this.bindings = bindings;\n _this.recommendation = _this.bindings.searchInterface;\n return _this;\n }\n RecommendationAnalyticsClient.prototype.logSearchEvent = function (actionCause, meta) {\n if (actionCause == AnalyticsActionListMeta_1.analyticsActionCauseList.interfaceLoad) {\n actionCause = AnalyticsActionListMeta_1.analyticsActionCauseList.recommendationInterfaceLoad;\n }\n _super.prototype.logSearchEvent.call(this, actionCause, meta);\n };\n RecommendationAnalyticsClient.prototype.logClickEvent = function (actionCause, meta, result, element) {\n if (actionCause == AnalyticsActionListMeta_1.analyticsActionCauseList.documentOpen) {\n actionCause = AnalyticsActionListMeta_1.analyticsActionCauseList.recommendationOpen;\n }\n var promises = [_super.prototype.logClickEvent.call(this, actionCause, meta, result, element)];\n if (this.recommendation.mainQuerySearchUID && this.recommendation.mainQueryPipeline != null) {\n // We log a second click associated with the main interface query to tell the analytics that the query was a success.\n var mainInterface = Component_1.Component.get(this.recommendation.options.mainSearchInterface, SearchInterface_1.SearchInterface);\n result.queryUid = this.recommendation.mainQuerySearchUID;\n result.pipeline = this.recommendation.mainQueryPipeline;\n promises.push(mainInterface.usageAnalytics.logClickEvent(actionCause, meta, result, element));\n }\n return Promise.all(promises).then(function (responses) { return _.first(responses); });\n };\n RecommendationAnalyticsClient.prototype.getOriginLevel2 = function (element) {\n return this.recommendation.getId();\n };\n return RecommendationAnalyticsClient;\n}(LiveAnalyticsClient_1.LiveAnalyticsClient));\nexports.RecommendationAnalyticsClient = RecommendationAnalyticsClient;\n\n\n/***/ }),\n/* 210 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar _ = __webpack_require__(0);\nexports.underscoreInstance = _;\nsetCoveoUnderscore();\nfunction setCoveoUnderscore() {\n if (window['Coveo'] == undefined) {\n window['Coveo'] = {};\n }\n if (window['Coveo']['_'] == undefined) {\n window['Coveo']['_'] = _;\n setTemplateSettings(window['Coveo']['_']);\n exports.underscoreInstance = window['Coveo']['_'];\n }\n}\nfunction setTemplateSettings(_a) {\n var templateSettings = _a.templateSettings;\n templateSettings.evaluate = /(?:<%|{{)([\\s\\S]+?)(?:%>|}})/g;\n templateSettings.interpolate = /(?:<%|{{)=([\\s\\S]+?)(?:%>|}})/g;\n templateSettings.escape = /(?:<%|{{)-([\\s\\S]+?)(?:%>|}})/g;\n}\nvar previousUnderscore = window['_'];\nwindow['_'] = _;\n// Run Underscore.js in \"noConflict\" mode, returning the `_` variable to its previous owner.\n// Returns a reference to the Underscore object. This method was removed from the module in v1.10.0\nwindow['_'].noConflict = function () {\n window['_'] = previousUnderscore;\n return _;\n};\nsetTemplateSettings(window['_']);\n\n\n/***/ }),\n/* 211 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar AnalyticsUtils = /** @class */ (function () {\n function AnalyticsUtils() {\n }\n AnalyticsUtils.addActionCauseToList = function (newActionCause) {\n if (newActionCause.name && newActionCause.type) {\n AnalyticsActionListMeta_1.analyticsActionCauseList[newActionCause.name] = newActionCause;\n }\n };\n AnalyticsUtils.removeActionCauseFromList = function (actionCauseToRemoveName) {\n delete AnalyticsActionListMeta_1.analyticsActionCauseList[actionCauseToRemoveName];\n };\n return AnalyticsUtils;\n}());\nexports.AnalyticsUtils = AnalyticsUtils;\n\n\n/***/ }),\n/* 212 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Initialization_1 = __webpack_require__(2);\nvar _ = __webpack_require__(0);\nif (!initCoveoJQuery()) {\n // Adding a check in case jQuery was added after the jsSearch\n // Since this event listener is registered before the Coveo.init call, JQuery should always be initiated before the Coveo.init call\n document.addEventListener('DOMContentLoaded', function () {\n initCoveoJQuery();\n });\n}\nfunction initCoveoJQuery() {\n if (!jQueryIsDefined()) {\n return false;\n }\n exports.jQueryInstance = getJQuery();\n if (window['Coveo'] == undefined) {\n window['Coveo'] = {};\n }\n if (window['Coveo']['$'] == undefined) {\n window['Coveo']['$'] = exports.jQueryInstance;\n }\n exports.jQueryInstance.fn.coveo = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var returnValue;\n this.each(function (index, element) {\n var returnValueForThisElement;\n if (_.isString(args[0])) {\n var token = args[0];\n returnValueForThisElement = Initialization_1.Initialization.dispatchNamedMethodCallOrComponentCreation(token, element, args.slice(1));\n }\n else {\n // Invoking with no method name is a shortcut for the 'get' method (from Component).\n returnValueForThisElement = Initialization_1.Initialization.dispatchNamedMethodCall('get', element, args);\n }\n // Keep only the first return value we encounter\n returnValue = returnValue || returnValueForThisElement;\n });\n return returnValue;\n };\n return true;\n}\nexports.initCoveoJQuery = initCoveoJQuery;\nfunction jQueryIsDefined() {\n return jQueryDefinedOnWindow() || jQueryDefinedOnCoveoObject();\n}\nexports.jQueryIsDefined = jQueryIsDefined;\nfunction jQueryDefinedOnCoveoObject() {\n return window['Coveo'] != undefined && window['Coveo']['$'] != undefined;\n}\nfunction jQueryDefinedOnWindow() {\n return window['$'] != undefined && window['$'].fn != undefined && window['$'].fn.jquery != undefined;\n}\nfunction getJQuery() {\n var jQueryInstance;\n if (window['$']) {\n jQueryInstance = window['$'];\n }\n else {\n jQueryInstance = window['Coveo']['$'];\n }\n return jQueryInstance;\n}\n\n\n/***/ }),\n/* 213 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Initialization_1 = __webpack_require__(2);\nexports.fields = ['ytthumbnailurl'];\nfunction registerFields() {\n Initialization_1.Initialization.registerComponentFields('YouTubeThumbnail', exports.fields);\n}\nexports.registerFields = registerFields;\n\n\n/***/ }),\n/* 214 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Component_1 = __webpack_require__(7);\nvar _ = __webpack_require__(0);\nvar ResultListRenderer = /** @class */ (function () {\n function ResultListRenderer(resultListOptions, autoCreateComponentsFn) {\n this.resultListOptions = resultListOptions;\n this.autoCreateComponentsFn = autoCreateComponentsFn;\n }\n ResultListRenderer.prototype.renderResults = function (resultElements, append, resultDisplayedCallback) {\n var _this = this;\n if (append === void 0) { append = false; }\n return Promise.all([this.getStartFragment(resultElements, append), this.getEndFragment(resultElements, append)]).then(function (_a) {\n var startFrag = _a[0], endFrag = _a[1];\n var resultsFragment = document.createDocumentFragment();\n if (startFrag) {\n resultsFragment.appendChild(startFrag);\n }\n _.each(resultElements, function (resultElement) {\n resultsFragment.appendChild(resultElement);\n resultDisplayedCallback(Component_1.Component.getResult(resultElement), resultElement);\n });\n if (endFrag) {\n resultsFragment.appendChild(endFrag);\n }\n _this.resultListOptions.resultsContainer.appendChild(resultsFragment);\n });\n };\n ResultListRenderer.prototype.getStartFragment = function (resultElements, append) {\n return Promise.resolve(document.createDocumentFragment());\n };\n ResultListRenderer.prototype.getEndFragment = function (resultElements, append) {\n return Promise.resolve(document.createDocumentFragment());\n };\n return ResultListRenderer;\n}());\nexports.ResultListRenderer = ResultListRenderer;\n\n\n/***/ }),\n/* 215 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__webpack_require__(535);\nvar QueryEvents_1 = __webpack_require__(11);\nvar Logger_1 = __webpack_require__(9);\nvar Strings_1 = __webpack_require__(6);\nvar Dom_1 = __webpack_require__(1);\nvar Utils_1 = __webpack_require__(4);\nvar Component_1 = __webpack_require__(7);\nvar SearchInterface_1 = __webpack_require__(19);\nvar ResponsiveComponents_1 = __webpack_require__(55);\nvar ResponsiveComponentsManager_1 = __webpack_require__(62);\nvar ResponsiveComponentsUtils_1 = __webpack_require__(130);\nvar ResponsiveDropdown_1 = __webpack_require__(123);\nvar ResponsiveDropdownContent_1 = __webpack_require__(93);\nvar ResponsiveDropdownHeader_1 = __webpack_require__(135);\nvar underscore_1 = __webpack_require__(0);\nvar ComponentsTypes_1 = __webpack_require__(47);\nvar ResponsiveDropdownModalContent_1 = __webpack_require__(536);\nvar FacetsMobileMode_1 = __webpack_require__(85);\nvar FacetsMobileModeEvents_1 = __webpack_require__(537);\nvar ResponsiveFacetColumn = /** @class */ (function () {\n function ResponsiveFacetColumn(coveoRoot, ID, options, responsiveDropdown) {\n this.coveoRoot = coveoRoot;\n this.ID = ID;\n this.componentsInFacetColumn = [];\n this.preservePositionOriginalValues = [];\n this.searchInterface = Component_1.Component.get(this.coveoRoot.el, SearchInterface_1.SearchInterface, false);\n this.dropdownHeaderLabel = this.getDropdownHeaderLabel();\n this.dropdown = this.buildDropdown(responsiveDropdown);\n this.bindDropdownContentEvents();\n this.bindFacetsMobileModeEvents();\n this.registerOnCloseHandler();\n this.registerQueryEvents();\n this.initializeBreakpoint(options.responsiveBreakpoint);\n }\n ResponsiveFacetColumn.init = function (responsiveComponentConstructor, root, component, options, ID) {\n var column = this.findColumn(root);\n if (!column) {\n return;\n }\n ResponsiveComponentsManager_1.ResponsiveComponentsManager.register(ResponsiveFacetColumn, Dom_1.$$(root), 'ResponsiveFacetColumn', component, options);\n ResponsiveComponentsManager_1.ResponsiveComponentsManager.register(responsiveComponentConstructor, Dom_1.$$(root), ID, component, options);\n };\n ResponsiveFacetColumn.findColumn = function (root) {\n var column = Dom_1.$$(root).find('.coveo-facet-column');\n if (!column) {\n this.logger.info('No element with class coveo-facet-column. Responsive facets cannot be enabled');\n }\n return column;\n };\n Object.defineProperty(ResponsiveFacetColumn.prototype, \"facetsMobileModeComponent\", {\n get: function () {\n return this.searchInterface ? this.searchInterface.getComponents(FacetsMobileMode_1.FacetsMobileMode.ID)[0] : null;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(ResponsiveFacetColumn.prototype, \"facetsMobileModeOptions\", {\n get: function () {\n var facetsMobileModeComponent = this.facetsMobileModeComponent;\n if (!facetsMobileModeComponent) {\n ResponsiveFacetColumn.logger.warn('The \"FacetsMobileMode\" component did not load properly, disabling the ResponsiveFacets modal.');\n return {\n isModal: false,\n preventScrolling: false,\n displayOverlayWhileOpen: true\n };\n }\n return facetsMobileModeComponent.options;\n },\n enumerable: true,\n configurable: true\n });\n ResponsiveFacetColumn.prototype.registerComponent = function (accept) {\n this.componentsInFacetColumn.push(accept);\n this.preservePositionOriginalValues.push(accept.options.preservePosition);\n return true;\n };\n ResponsiveFacetColumn.prototype.needDropdownWrapper = function () {\n return this.needSmallMode();\n };\n ResponsiveFacetColumn.prototype.handleResizeEvent = function () {\n if (this.needSmallMode() && !ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallFacetActivated(this.coveoRoot)) {\n this.changeToSmallMode();\n }\n else if (!this.needSmallMode() && ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.isSmallFacetActivated(this.coveoRoot)) {\n this.changeToLargeMode();\n }\n if (this.dropdown.isOpened) {\n this.dropdown.dropdownContent.positionDropdown();\n }\n };\n ResponsiveFacetColumn.prototype.dismissFacetSearches = function () {\n underscore_1.each(this.componentsInFacetColumn, function (component) {\n if (component.facetSearch && component.facetSearch.currentlyDisplayedResults) {\n component.facetSearch.dismissSearchResults();\n }\n });\n };\n ResponsiveFacetColumn.prototype.needSmallMode = function () {\n if (!this.searchInterface) {\n return (this.coveoRoot.width() <=\n (Utils_1.Utils.isNullOrUndefined(this.breakpoint) ? new ResponsiveComponents_1.ResponsiveComponents().getMediumScreenWidth() : this.breakpoint));\n }\n switch (this.searchInterface.responsiveComponents.getResponsiveMode()) {\n case 'small':\n case 'medium':\n return true;\n case 'auto':\n return (this.coveoRoot.width() <=\n (Utils_1.Utils.isNullOrUndefined(this.breakpoint) ? this.searchInterface.responsiveComponents.getMediumScreenWidth() : this.breakpoint));\n default:\n return false;\n }\n };\n ResponsiveFacetColumn.prototype.changeToSmallMode = function () {\n this.dropdown.close();\n this.disableFacetPreservePosition();\n Dom_1.$$(this.coveoRoot.find(\".\" + ResponsiveComponentsManager_1.ResponsiveComponentsManager.DROPDOWN_HEADER_WRAPPER_CSS_CLASS)).append(this.dropdown.dropdownHeader.element.el);\n ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.activateSmallFacet(this.coveoRoot);\n };\n ResponsiveFacetColumn.prototype.changeToLargeMode = function () {\n this.restoreFacetPreservePositionValue();\n this.dropdown.cleanUp();\n ResponsiveComponentsUtils_1.ResponsiveComponentsUtils.deactivateSmallFacet(this.coveoRoot);\n };\n ResponsiveFacetColumn.prototype.buildDropdown = function (responsiveDropdown) {\n var dropdownContent = this.buildDropdownContent();\n var dropdownHeader = this.buildDropdownHeader();\n var dropdown = responsiveDropdown ? responsiveDropdown : new ResponsiveDropdown_1.ResponsiveDropdown(dropdownContent, dropdownHeader, this.coveoRoot);\n if (!this.facetsMobileModeOptions.displayOverlayWhileOpen) {\n dropdown.disablePopupBackground();\n }\n if (this.facetsMobileModeOptions.preventScrolling) {\n dropdown.enableScrollLocking(this.facetsMobileModeOptions.scrollContainer);\n }\n return dropdown;\n };\n ResponsiveFacetColumn.prototype.buildDropdownContent = function () {\n var _this = this;\n var dropdownContentElement = Dom_1.$$(this.coveoRoot.find('.coveo-facet-column'));\n var filterByContainer = Dom_1.$$('div', { className: 'coveo-facet-header-filter-by-container', style: 'display: none' });\n var filterBy = Dom_1.$$('div', { className: 'coveo-facet-header-filter-by' });\n filterBy.text(Strings_1.l('Filter by:'));\n filterByContainer.append(filterBy.el);\n dropdownContentElement.prepend(filterByContainer.el);\n if (this.facetsMobileModeOptions.isModal) {\n return new ResponsiveDropdownModalContent_1.ResponsiveDropdownModalContent('facet', dropdownContentElement, Strings_1.l('CloseFiltersDropdown'), function () { return _this.dropdown.close(); });\n }\n return new ResponsiveDropdownContent_1.ResponsiveDropdownContent('facet', dropdownContentElement, this.coveoRoot, ResponsiveFacetColumn.DROPDOWN_MIN_WIDTH, ResponsiveFacetColumn.DROPDOWN_WIDTH_RATIO);\n };\n ResponsiveFacetColumn.prototype.buildDropdownHeader = function () {\n var dropdownHeaderElement = Dom_1.$$('a');\n var content = Dom_1.$$('p');\n content.text(this.dropdownHeaderLabel);\n dropdownHeaderElement.el.appendChild(content.el);\n var dropdownHeader = new ResponsiveDropdownHeader_1.ResponsiveDropdownHeader('facet', dropdownHeaderElement);\n return dropdownHeader;\n };\n ResponsiveFacetColumn.prototype.initializeBreakpoint = function (defaultBreakpoint) {\n var facetsMobileModeBreakpoint = this.facetsMobileModeOptions.breakpoint;\n this.breakpoint = Utils_1.Utils.isNullOrUndefined(facetsMobileModeBreakpoint) ? defaultBreakpoint : facetsMobileModeBreakpoint;\n };\n ResponsiveFacetColumn.prototype.registerOnCloseHandler = function () {\n this.dropdown.registerOnCloseHandler(this.dismissFacetSearches, this);\n };\n ResponsiveFacetColumn.prototype.registerQueryEvents = function () {\n var _this = this;\n this.coveoRoot.on(QueryEvents_1.QueryEvents.noResults, function () { return _this.handleNoResults(); });\n this.coveoRoot.on(QueryEvents_1.QueryEvents.querySuccess, function (e, data) { return _this.handleQuerySuccess(data); });\n this.coveoRoot.on(QueryEvents_1.QueryEvents.queryError, function () { return _this.handleQueryError(); });\n };\n ResponsiveFacetColumn.prototype.bindDropdownContentEvents = function () {\n var _this = this;\n this.dropdown.dropdownContent.element.on('scroll', underscore_1.debounce(function () {\n underscore_1.each(_this.componentsInFacetColumn, function (component) {\n var facetSearch = component.facetSearch;\n if (facetSearch && facetSearch.currentlyDisplayedResults && !_this.isFacetSearchScrolledIntoView(facetSearch.search)) {\n component.facetSearch.positionSearchResults(_this.dropdown.dropdownContent.element.el);\n }\n else if (facetSearch && component.facetSearch.currentlyDisplayedResults) {\n component.facetSearch.positionSearchResults();\n }\n });\n }, ResponsiveFacetColumn.DEBOUNCE_SCROLL_WAIT));\n };\n ResponsiveFacetColumn.prototype.bindFacetsMobileModeEvents = function () {\n var facetsMobileModeComponent = this.facetsMobileModeComponent;\n if (facetsMobileModeComponent) {\n this.dropdown.registerOnOpenHandler(function () { return Dom_1.$$(facetsMobileModeComponent.element).trigger(FacetsMobileModeEvents_1.FacetsMobileModeEvents.popupOpened); }, facetsMobileModeComponent);\n this.dropdown.registerOnCloseHandler(function () { return Dom_1.$$(facetsMobileModeComponent.element).trigger(FacetsMobileModeEvents_1.FacetsMobileModeEvents.popupClosed); }, facetsMobileModeComponent);\n }\n };\n ResponsiveFacetColumn.prototype.restoreFacetPreservePositionValue = function () {\n var _this = this;\n underscore_1.each(this.componentsInFacetColumn, function (component, index) {\n if (component.options) {\n component.options.preservePosition = _this.preservePositionOriginalValues[index];\n }\n });\n };\n ResponsiveFacetColumn.prototype.disableFacetPreservePosition = function () {\n underscore_1.each(this.componentsInFacetColumn, function (component) {\n if (component.options) {\n component.options.preservePosition = false;\n }\n });\n };\n ResponsiveFacetColumn.prototype.isFacetSearchScrolledIntoView = function (facetSearchElement) {\n var facetTop = facetSearchElement.getBoundingClientRect().top;\n var facetBottom = facetSearchElement.getBoundingClientRect().bottom;\n var dropdownTop = this.dropdown.dropdownContent.element.el.getBoundingClientRect().top;\n var dropdownBottom = this.dropdown.dropdownContent.element.el.getBoundingClientRect().bottom;\n dropdownTop = dropdownTop >= 0 ? dropdownTop : 0;\n return facetTop >= dropdownTop && facetBottom <= dropdownBottom;\n };\n ResponsiveFacetColumn.prototype.getDropdownHeaderLabel = function () {\n var dropdownHeaderLabel;\n ComponentsTypes_1.ComponentsTypes.getAllFacetInstancesFromElement(this.coveoRoot.find('.coveo-facet-column')).forEach(function (facet) {\n var options = facet.options;\n if (!dropdownHeaderLabel && options.dropdownHeaderLabel) {\n dropdownHeaderLabel = options.dropdownHeaderLabel;\n }\n });\n if (!dropdownHeaderLabel) {\n dropdownHeaderLabel = Strings_1.l(ResponsiveFacetColumn.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE);\n }\n return dropdownHeaderLabel;\n };\n ResponsiveFacetColumn.prototype.handleNoResults = function () {\n this.dropdown.dropdownHeader.hide();\n };\n ResponsiveFacetColumn.prototype.handleQueryError = function () {\n this.dropdown.dropdownHeader.hide();\n };\n ResponsiveFacetColumn.prototype.handleQuerySuccess = function (data) {\n if (data.results.totalCount === 0) {\n this.dropdown.dropdownHeader.hide();\n }\n else {\n this.dropdown.dropdownHeader.show();\n }\n };\n ResponsiveFacetColumn.DEBOUNCE_SCROLL_WAIT = 250;\n ResponsiveFacetColumn.logger = new Logger_1.Logger('ResponsiveFacets');\n ResponsiveFacetColumn.DROPDOWN_MIN_WIDTH = 280;\n ResponsiveFacetColumn.DROPDOWN_WIDTH_RATIO = 0.35; // Used to set the width relative to the coveo root.\n ResponsiveFacetColumn.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE = 'Filters';\n return ResponsiveFacetColumn;\n}());\nexports.ResponsiveFacetColumn = ResponsiveFacetColumn;\n\n\n/***/ }),\n/* 216 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\n///
\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ExpressionBuilder_1 = __webpack_require__(74);\nvar Utils_1 = __webpack_require__(4);\nvar FacetSearchParameters_1 = __webpack_require__(172);\nvar Assert_1 = __webpack_require__(5);\nvar FacetUtils_1 = __webpack_require__(40);\nvar _ = __webpack_require__(0);\nvar QueryBuilderExpression_1 = __webpack_require__(184);\nvar FacetQueryController = /** @class */ (function () {\n function FacetQueryController(facet) {\n this.facet = facet;\n }\n /**\n * Reset the expression for the facet search, used when a new query is triggered\n */\n FacetQueryController.prototype.prepareForNewQuery = function () {\n this.lastGroupByRequestIndex = undefined;\n this.expressionToUseForFacetSearch = undefined;\n this.constantExpressionToUseForFacetSearch = undefined;\n };\n /**\n * Compute the filter expression that the facet needs to output for the query\n * @returns {string}\n */\n FacetQueryController.prototype.computeOurFilterExpression = function () {\n var _this = this;\n var builder = new ExpressionBuilder_1.ExpressionBuilder();\n var selected = this.facet.values.getSelected();\n if (selected.length > 0) {\n if (this.facet.options.useAnd) {\n _.each(selected, function (value) {\n builder.addFieldExpression(_this.facet.options.field, '==', [value.value]);\n });\n }\n else {\n builder.addFieldExpression(this.facet.options.field, '==', _.map(selected, function (value) { return value.value; }));\n }\n }\n var excluded = this.facet.values.getExcluded();\n if (excluded.length > 0) {\n builder.addFieldNotEqualExpression(this.facet.options.field, _.map(excluded, function (value) { return value.value; }));\n }\n if (Utils_1.Utils.isNonEmptyString(this.facet.options.additionalFilter)) {\n builder.add(this.facet.options.additionalFilter);\n }\n return builder.build();\n };\n /**\n * Build the group by request for the facet, and insert it in the query builder\n * @param queryBuilder\n */\n FacetQueryController.prototype.putGroupByIntoQueryBuilder = function (queryBuilder) {\n Assert_1.Assert.exists(queryBuilder);\n var allowedValues = this.createGroupByAllowedValues();\n var groupByRequest = this.createBasicGroupByRequest(allowedValues);\n var queryOverrideObject = this.createGroupByQueryOverride(queryBuilder);\n if (!Utils_1.Utils.isNullOrUndefined(queryOverrideObject) || !QueryBuilderExpression_1.QueryBuilderExpression.isEmpty(queryOverrideObject)) {\n groupByRequest.queryOverride = queryOverrideObject.basic;\n groupByRequest.advancedQueryOverride = queryOverrideObject.advanced;\n groupByRequest.constantQueryOverride = queryOverrideObject.constant;\n this.expressionToUseForFacetSearch = queryOverrideObject.withoutConstant;\n this.basicExpressionToUseForFacetSearch = queryOverrideObject.basic;\n this.advancedExpressionToUseForFacetSearch = queryOverrideObject.advanced;\n this.constantExpressionToUseForFacetSearch = queryOverrideObject.constant;\n }\n else {\n var parts = queryBuilder.computeCompleteExpressionParts();\n this.expressionToUseForFacetSearch = parts.withoutConstant == null ? '' : parts.withoutConstant;\n this.basicExpressionToUseForFacetSearch = parts.basic == null ? '' : parts.basic;\n this.advancedExpressionToUseForFacetSearch = parts.advanced;\n this.constantExpressionToUseForFacetSearch = parts.constant;\n }\n this.lastGroupByRequestIndex = queryBuilder.groupByRequests.length;\n this.lastGroupByRequest = groupByRequest;\n queryBuilder.groupByRequests.push(groupByRequest);\n };\n /**\n * Search inside the facet, using a group by request\n * @param params\n * @param oldLength Optional params, used by the search method to call itself recursively to fetch all required values\n * @returns {Promise|Promise
}\n */\n FacetQueryController.prototype.search = function (params, oldLength) {\n var _this = this;\n if (oldLength === void 0) { oldLength = params.nbResults; }\n // For search, we want to retrieve the exact values we requested, and not additional ones\n params.completeFacetWithStandardValues = false;\n return new Promise(function (resolve, reject) {\n var onResult = function (fieldValues) {\n var newLength = fieldValues.length;\n fieldValues = _this.checkForFacetSearchValuesToRemove(fieldValues, params.valueToSearch);\n if (FacetUtils_1.FacetUtils.needAnotherFacetSearch(fieldValues.length, newLength, oldLength, 5)) {\n // This means that we removed enough values from the returned one that we need to perform a new search with more values requested.\n params.nbResults += 5;\n return _this.search(params, fieldValues.length);\n }\n else {\n resolve(fieldValues);\n }\n };\n var searchPromise = _this.facet.getEndpoint().search(params.getQuery());\n _this.currentSearchPromise = searchPromise;\n searchPromise\n .then(function (queryResults) {\n if (_this.currentSearchPromise == searchPromise) {\n // params.getQuery() will generate a query for all excluded values + some new values\n // there is no clean way to do a group by and remove some values\n // so instead we request more values than we need, and crop all the one we don't want\n var valuesCropped_1 = [];\n if (queryResults.groupByResults && queryResults.groupByResults[0]) {\n _.each(queryResults.groupByResults[0].values, function (v) {\n if (v.lookupValue) {\n if (!_.contains(params.alwaysExclude, v.lookupValue.toLowerCase())) {\n valuesCropped_1.push(v);\n }\n }\n else {\n if (!_.contains(params.alwaysExclude, v.value.toLowerCase())) {\n valuesCropped_1.push(v);\n }\n }\n });\n }\n onResult(_.first(valuesCropped_1, params.nbResults));\n }\n else {\n reject();\n }\n })\n .catch(function (error) {\n reject(error);\n });\n });\n };\n FacetQueryController.prototype.fetchMore = function (numberOfValuesToFetch) {\n var _this = this;\n var params = new FacetSearchParameters_1.FacetSearchParameters(this.facet);\n params.alwaysInclude = this.facet.options.allowedValues || _.pluck(this.facet.values.getAll(), 'value');\n params.nbResults = numberOfValuesToFetch;\n return this.facet\n .getEndpoint()\n .search(params.getQuery())\n .then(function (results) {\n if (_this.facet.options.allowedValues && results && results.groupByResults && results.groupByResults[0]) {\n results.groupByResults[0].values = _this.filterByAllowedValueOption(results.groupByResults[0].values);\n }\n return results;\n });\n };\n FacetQueryController.prototype.searchInFacetToUpdateDelta = function (facetValues) {\n var params = new FacetSearchParameters_1.FacetSearchParameters(this.facet);\n var query = params.getQuery();\n query.aq = (query.aq ? query.aq : '') + \" \" + this.computeOurFilterExpression();\n _.each(facetValues, function (facetValue) {\n facetValue.waitingForDelta = true;\n });\n query.groupBy = [this.createBasicGroupByRequest(_.map(facetValues, function (facetValue) { return facetValue.value; }))];\n query.groupBy[0].completeFacetWithStandardValues = false;\n return this.facet.getEndpoint().search(query);\n };\n FacetQueryController.prototype.createGroupByAllowedValues = function () {\n // if you want to keep displayed values next time, take all current values as allowed values\n // otherwise take only the selected value\n if (this.facet.options.allowedValues != undefined) {\n return this.facet.options.allowedValues;\n }\n else if (this.facet.options.customSort != undefined) {\n // If there is a custom sort, we still need to add selectedValues to the group by\n // Filter out duplicates with a lower case comparison on the value\n return this.getUnionWithCustomSortLowercase(this.facet.options.customSort, this.getAllowedValuesFromSelected());\n }\n else {\n return _.map(this.getAllowedValuesFromSelected(), function (facetValue) { return facetValue.value; });\n }\n };\n FacetQueryController.prototype.createBasicGroupByRequest = function (allowedValues, addComputedField) {\n if (addComputedField === void 0) { addComputedField = true; }\n var nbOfRequestedValues = this.facet.numberOfValues;\n if (this.facet.options.customSort != null) {\n // If we have a custom sort, we need to make sure that we always request at least enough values to always receive them\n var usedValues = this.getUnionWithCustomSortLowercase(this.facet.options.customSort, this.facet.values.getSelected().concat(this.facet.values.getExcluded()));\n nbOfRequestedValues = Math.max(nbOfRequestedValues, usedValues.length);\n }\n var groupByRequest = {\n field: this.facet.options.field,\n maximumNumberOfValues: nbOfRequestedValues + (this.facet.options.enableMoreLess ? 1 : 0),\n sortCriteria: this.facet.options.sortCriteria,\n injectionDepth: this.facet.options.injectionDepth,\n completeFacetWithStandardValues: this.facet.options.allowedValues == undefined ? true : false\n };\n if (this.facet.options.lookupField) {\n groupByRequest.lookupField = this.facet.options.lookupField;\n }\n if (allowedValues != null) {\n groupByRequest.allowedValues = allowedValues;\n }\n if (addComputedField && Utils_1.Utils.isNonEmptyString(this.facet.options.computedField)) {\n groupByRequest.computedFields = [\n {\n field: this.facet.options.computedField,\n operation: this.facet.options.computedFieldOperation\n }\n ];\n }\n return groupByRequest;\n };\n FacetQueryController.prototype.getAllowedValuesFromSelected = function () {\n var facetValues = [];\n if (this.facet.options.useAnd || !this.facet.keepDisplayedValuesNextTime) {\n var selected = this.facet.values.getSelected();\n if (selected.length == 0) {\n return undefined;\n }\n facetValues = this.facet.values.getSelected();\n }\n else {\n facetValues = this.facet.values.getAll();\n }\n return facetValues;\n };\n Object.defineProperty(FacetQueryController.prototype, \"additionalFilter\", {\n get: function () {\n return this.facet.options.additionalFilter ? this.facet.options.additionalFilter : '';\n },\n enumerable: true,\n configurable: true\n });\n FacetQueryController.prototype.getUnionWithCustomSortLowercase = function (customSort, facetValues) {\n // This will take the custom sort, compare it against the passed in facetValues\n // The comparison is lowercase.\n // The union of the 2 arrays with duplicated filtered out is returned.\n var toCompare = _.map(customSort, function (val) {\n return val.toLowerCase();\n });\n var filtered = _.chain(facetValues)\n .filter(function (facetValue) {\n return !_.contains(toCompare, facetValue.value.toLowerCase());\n })\n .map(function (facetValue) {\n return facetValue.value;\n })\n .value();\n return _.compact(customSort.concat(filtered));\n };\n FacetQueryController.prototype.createGroupByQueryOverride = function (queryBuilder) {\n var queryBuilderExpression = queryBuilder.computeCompleteExpressionParts();\n if (this.queryOverrideIsNeededForMultiSelection()) {\n queryBuilderExpression = this.processQueryOverrideForMultiSelection(queryBuilder, queryBuilderExpression);\n }\n else {\n queryBuilderExpression.reset();\n }\n if (this.queryOverrideIsNeededForAdditionalFilter()) {\n queryBuilderExpression = this.processQueryOverrideForAdditionalFilter(queryBuilder, queryBuilderExpression);\n }\n queryBuilderExpression = this.processQueryOverrideForEmptyValues(queryBuilder, queryBuilderExpression);\n if (QueryBuilderExpression_1.QueryBuilderExpression.isEmpty(queryBuilderExpression)) {\n return null;\n }\n return queryBuilderExpression;\n };\n FacetQueryController.prototype.queryOverrideIsNeededForMultiSelection = function () {\n if (this.facet.options.useAnd) {\n return false;\n }\n if (this.facet.values.hasSelectedOrExcludedValues()) {\n return true;\n }\n return false;\n };\n FacetQueryController.prototype.queryOverrideIsNeededForAdditionalFilter = function () {\n return Utils_1.Utils.isNonEmptyString(this.additionalFilter);\n };\n FacetQueryController.prototype.processQueryOverrideForMultiSelection = function (queryBuilder, mergeWith) {\n if (this.facet.values.hasSelectedOrExcludedValues()) {\n var ourExpression = this.computeOurFilterExpression();\n mergeWith = queryBuilder.computeCompleteExpressionPartsExcept(ourExpression);\n if (QueryBuilderExpression_1.QueryBuilderExpression.isEmpty(mergeWith)) {\n mergeWith.advanced = '@uri';\n }\n }\n return mergeWith;\n };\n FacetQueryController.prototype.processQueryOverrideForAdditionalFilter = function (queryBuilder, mergeWith) {\n if (Utils_1.Utils.isEmptyString(mergeWith.basic)) {\n mergeWith.basic = queryBuilder.expression.build();\n }\n if (Utils_1.Utils.isEmptyString(mergeWith.constant)) {\n var addExistingConstantExpressionIfNotEmpty = queryBuilder.constantExpression.isEmpty()\n ? ''\n : queryBuilder.constantExpression.build() + ' ';\n mergeWith.constant = \"\" + addExistingConstantExpressionIfNotEmpty + this.additionalFilter;\n }\n else {\n mergeWith.constant = mergeWith.constant + \" \" + this.additionalFilter;\n }\n if (!mergeWith.advanced) {\n mergeWith.advanced = this.getFilterExpressionWithoutOurFilterExpression(queryBuilder);\n }\n return mergeWith;\n };\n FacetQueryController.prototype.getFilterExpressionWithoutOurFilterExpression = function (queryBuilder) {\n var expression = new ExpressionBuilder_1.ExpressionBuilder();\n var advancedExpressionParts = queryBuilder.advancedExpression.getParts();\n advancedExpressionParts.forEach(function (part) { return expression.add(part); });\n var currentFacetAdvancedExpression = this.computeOurFilterExpression();\n expression.remove(currentFacetAdvancedExpression);\n return expression.build();\n };\n FacetQueryController.prototype.processQueryOverrideForEmptyValues = function (queryBuilder, mergeWith) {\n var withoutEmptyValues = _.chain(mergeWith)\n .keys()\n .each(function (key) {\n if (Utils_1.Utils.isEmptyString(mergeWith[key]) || Utils_1.Utils.isNullOrUndefined(mergeWith[key])) {\n delete mergeWith[key];\n }\n })\n .value();\n if (_.keys(withoutEmptyValues).length == 0) {\n mergeWith = undefined;\n }\n return mergeWith;\n };\n FacetQueryController.prototype.checkForFacetSearchValuesToRemove = function (fieldValues, valueToCheckAgainst) {\n var _this = this;\n var regex = FacetUtils_1.FacetUtils.getRegexToUseForFacetSearch(valueToCheckAgainst, this.facet.options.facetSearchIgnoreAccents);\n return _.filter(fieldValues, function (fieldValue) {\n var isAllowed = _.isEmpty(_this.facet.options.allowedValues) || _this.isValueAllowedByAllowedValueOption(fieldValue.value);\n var value = _this.facet.getValueCaption(fieldValue);\n return isAllowed && regex.test(value);\n });\n };\n FacetQueryController.prototype.filterByAllowedValueOption = function (values) {\n var _this = this;\n return _.filter(values, function (value) { return _this.isValueAllowedByAllowedValueOption(value.value); });\n };\n FacetQueryController.prototype.isValueAllowedByAllowedValueOption = function (value) {\n var _this = this;\n return _.some(this.facet.options.allowedValues, function (allowedValue) {\n var regexContent = _this.replaceWildcardsWithRegexEquivalent(_this.escapeMostRegexCharacters(allowedValue));\n var regex = new RegExp(\"^\" + regexContent + \"$\", 'gi');\n return regex.test(value);\n });\n };\n FacetQueryController.prototype.escapeMostRegexCharacters = function (text) {\n // Regex taken from https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions\n // `*` and `?` were removed because they are used for wildcards\n return text.replace(/[.+^${}()|[\\]\\\\]/g, '\\\\$&');\n };\n FacetQueryController.prototype.replaceWildcardsWithRegexEquivalent = function (text) {\n // Allowed value option on the facet should support * (wildcard searches)\n // We need to filter values client side the index will completeWithStandardValues\n // Replace the wildcard (*) for a regex match (.*)\n // Also replace the (?) with \"any character once\" since it is also supported by the index\n return text.replace(/\\*/g, '.*').replace(/\\?/g, '.');\n };\n return FacetQueryController;\n}());\nexports.FacetQueryController = FacetQueryController;\n\n\n/***/ }),\n/* 217 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ExpressionEndOfInput = {\n id: 'end of input',\n parse: null\n};\n\n\n/***/ }),\n/* 218 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Result_1 = __webpack_require__(52);\nvar Result_2 = __webpack_require__(52);\nvar ExpressionConstant = /** @class */ (function () {\n function ExpressionConstant(value, id) {\n this.value = value;\n this.id = id;\n }\n ExpressionConstant.prototype.parse = function (input, end) {\n // the value must be at the start of the input\n var success = input.indexOf(this.value) == 0;\n var result = new Result_1.Result(success ? this.value : null, this, input);\n // if is successful and we require the end but the length of parsed is\n // lower than the input length, return a EndOfInputExpected Result\n if (success && end && input.length > this.value.length) {\n return new Result_2.EndOfInputResult(result);\n }\n return result;\n };\n ExpressionConstant.prototype.toString = function () {\n return this.value;\n };\n return ExpressionConstant;\n}());\nexports.ExpressionConstant = ExpressionConstant;\n\n\n/***/ }),\n/* 219 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Basic_1 = __webpack_require__(132);\nvar Date_1 = __webpack_require__(499);\nexports.Field = {\n basicExpressions: ['FieldSimpleQuery', 'FieldQuery', 'Field'],\n grammars: {\n FieldQuery: '[Field][OptionalSpaces][FieldQueryOperation]',\n FieldQueryOperation: ['FieldQueryValue', 'FieldQueryNumeric'],\n FieldQueryValue: '[FieldOperator][OptionalSpaces][FieldValue]',\n FieldQueryNumeric: '[FieldOperatorNumeric][OptionalSpaces][FieldValueNumeric]',\n FieldSimpleQuery: '[FieldName]:[OptionalSpaces][FieldValue]',\n Field: '@[FieldName]',\n FieldName: /[a-zA-Z][a-zA-Z0-9\\.\\_]*/,\n FieldOperator: /==|=|<>/,\n FieldOperatorNumeric: /<=|>=|<|>/,\n FieldValue: ['DateRange', 'NumberRange', 'DateRelative', 'Date', 'Number', 'FieldValueList', 'FieldValueString'],\n FieldValueNumeric: ['DateRelative', 'Date', 'Number'],\n FieldValueString: ['DoubleQuoted', 'FieldValueNotQuoted'],\n FieldValueList: '([FieldValueString][FieldValueStringList*])',\n FieldValueStringList: '[FieldValueSeparator][FieldValueString]',\n FieldValueSeparator: / *, */,\n FieldValueNotQuoted: /[^ \\(\\)\\[\\],]+/,\n NumberRange: '[Number][Spaces?]..[Spaces?][Number]'\n },\n include: [Date_1.Date, Basic_1.Basic]\n};\n\n\n/***/ }),\n/* 220 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar underscore_1 = __webpack_require__(0);\nvar OmniboxEvents_1 = __webpack_require__(34);\nvar Component_1 = __webpack_require__(7);\nvar Dom_1 = __webpack_require__(1);\nvar ResultPreviewsManager_1 = __webpack_require__(563);\nvar QueryProcessor_1 = __webpack_require__(503);\nvar QueryUtils_1 = __webpack_require__(21);\nvar Direction;\n(function (Direction) {\n Direction[\"Up\"] = \"Up\";\n Direction[\"Down\"] = \"Down\";\n Direction[\"Left\"] = \"Left\";\n Direction[\"Right\"] = \"Right\";\n})(Direction = exports.Direction || (exports.Direction = {}));\nvar SuggestionsManager = /** @class */ (function () {\n function SuggestionsManager(element, magicBoxContainer, inputManager, options) {\n var _this = this;\n this.element = element;\n this.magicBoxContainer = magicBoxContainer;\n this.inputManager = inputManager;\n this.suggestionListboxID = \"coveo-magicbox-suggestions-\" + QueryUtils_1.QueryUtils.createGuid();\n this.suggestionListboxClassName = \"coveo-magicbox-suggestions\";\n this.root = Component_1.Component.resolveRoot(element);\n this.options = underscore_1.defaults(options, {\n suggestionClass: 'magic-box-suggestion',\n selectedClass: 'magic-box-selected'\n });\n // Put in a sane default, so as to not reject every suggestions if not set on initialization\n if (this.options.timeout == undefined) {\n this.options.timeout = 500;\n }\n Dom_1.$$(this.element).on('mouseover', function (e) {\n _this.handleMouseOver(e);\n });\n Dom_1.$$(this.element).on('mouseout', function (e) {\n _this.handleMouseOut(e);\n });\n this.suggestionsProcessor = new QueryProcessor_1.QueryProcessor({ timeout: this.options.timeout });\n this.resultPreviewsManager = new ResultPreviewsManager_1.ResultPreviewsManager(element, {\n selectedClass: this.options.selectedClass,\n timeout: this.options.timeout\n });\n this.suggestionsListbox = this.buildSuggestionsContainer();\n Dom_1.$$(this.element).append(this.suggestionsListbox.el);\n this.addAccessibilityProperties();\n this.appendEmptySuggestionOption();\n }\n Object.defineProperty(SuggestionsManager.prototype, \"hasSuggestions\", {\n get: function () {\n return this.currentSuggestions && this.currentSuggestions.length > 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SuggestionsManager.prototype, \"hasFocus\", {\n get: function () {\n return Dom_1.$$(this.element).findClass(this.options.selectedClass).length > 0;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SuggestionsManager.prototype, \"hasPreviews\", {\n get: function () {\n return this.resultPreviewsManager.hasPreviews;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(SuggestionsManager.prototype, \"focusedSuggestion\", {\n get: function () {\n var _this = this;\n return underscore_1.find(this.currentSuggestions, function (suggestion) {\n return Dom_1.$$(suggestion.dom).hasClass(_this.options.selectedClass) || Dom_1.$$(suggestion.dom).findClass(_this.options.selectedClass).length > 0;\n });\n },\n enumerable: true,\n configurable: true\n });\n SuggestionsManager.prototype.handleMouseOver = function (e) {\n var target = Dom_1.$$(e.target);\n var parents = target.parents(this.options.suggestionClass);\n if (target.hasClass(this.options.suggestionClass)) {\n this.processMouseSelection(target.el);\n }\n else if (parents.length > 0 && this.element.contains(parents[0])) {\n this.processMouseSelection(parents[0]);\n }\n };\n SuggestionsManager.prototype.handleMouseOut = function (e) {\n var target = Dom_1.$$(e.target);\n var targetParents = target.parents(this.options.suggestionClass);\n //e.relatedTarget is not available if moving off the browser window or is an empty object `{}` when moving out of namespace in LockerService.\n if (e.relatedTarget && Dom_1.$$(e.relatedTarget).isValid()) {\n var relatedTargetParents = Dom_1.$$(e.relatedTarget).parents(this.options.suggestionClass);\n if (target.hasClass(this.options.selectedClass) && !Dom_1.$$(e.relatedTarget).hasClass(this.options.suggestionClass)) {\n this.removeSelectedStatus(target.el);\n }\n else if (relatedTargetParents.length == 0 && targetParents.length > 0) {\n this.removeSelectedStatus(targetParents[0]);\n }\n }\n else {\n if (target.hasClass(this.options.selectedClass)) {\n this.removeSelectedStatus(target.el);\n }\n else if (targetParents.length > 0) {\n this.removeSelectedStatus(targetParents[0]);\n }\n }\n Dom_1.$$(this.root).trigger(OmniboxEvents_1.OmniboxEvents.querySuggestLoseFocus);\n };\n SuggestionsManager.prototype.moveDown = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.move(Direction.Down)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.moveUp = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.move(Direction.Up)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.moveLeft = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.move(Direction.Left)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.moveRight = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.move(Direction.Right)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.selectAndReturnKeyboardFocusedElement = function () {\n var selected = this.keyboardFocusedElement;\n if (selected) {\n Dom_1.$$(selected).trigger('keyboardSelect');\n // By definition, once an element has been \"selected\" with the keyboard,\n // it is not longer \"active\" since the event has been processed.\n this.keyboardFocusedElement = null;\n this.inputManager.blur();\n }\n return selected;\n };\n SuggestionsManager.prototype.clearKeyboardFocusedElement = function () {\n this.keyboardFocusedElement = null;\n };\n SuggestionsManager.prototype.receiveSuggestions = function (suggestions) {\n return __awaiter(this, void 0, void 0, function () {\n var _a, results, status;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0: return [4 /*yield*/, this.suggestionsProcessor.processQueries(suggestions)];\n case 1:\n _a = _b.sent(), results = _a.results, status = _a.status;\n if (status === QueryProcessor_1.ProcessingStatus.Overriden) {\n return [2 /*return*/, []];\n }\n this.updateSuggestions(results);\n return [2 /*return*/, results];\n }\n });\n });\n };\n SuggestionsManager.prototype.clearSuggestions = function () {\n this.updateSuggestions([]);\n };\n SuggestionsManager.prototype.updateSuggestions = function (suggestions) {\n var _this = this;\n this.suggestionsListbox.empty();\n this.inputManager.activeDescendant = null;\n this.currentSuggestions = suggestions;\n Dom_1.$$(this.element).toggleClass('magic-box-hasSuggestion', this.hasSuggestions);\n this.inputManager.expanded = this.hasSuggestions;\n this.resultPreviewsManager.displaySearchResultPreviewsForSuggestion(null);\n if (!this.hasSuggestions) {\n this.appendEmptySuggestionOption();\n Dom_1.$$(this.root).trigger(OmniboxEvents_1.OmniboxEvents.querySuggestLoseFocus);\n return;\n }\n suggestions\n .sort(function (a, b) { return (b.index || 0) - (a.index || 0); })\n .forEach(function (suggestion) {\n var dom = suggestion.dom ? _this.modifyDomFromExistingSuggestion(suggestion.dom) : _this.createDomFromSuggestion(suggestion);\n dom.setAttribute('id', \"magic-box-suggestion-\" + underscore_1.indexOf(suggestions, suggestion));\n dom.setAttribute('role', 'option');\n dom.setAttribute('aria-selected', 'false');\n dom.setAttribute('aria-label', dom.text());\n dom['suggestion'] = suggestion;\n _this.suggestionsListbox.append(dom.el);\n });\n Dom_1.$$(this.root).trigger(OmniboxEvents_1.OmniboxEvents.querySuggestRendered);\n };\n Object.defineProperty(SuggestionsManager.prototype, \"selectedSuggestion\", {\n get: function () {\n if (this.htmlElementIsSuggestion(this.keyboardFocusedElement)) {\n return this.returnMoved(this.keyboardFocusedElement);\n }\n return null;\n },\n enumerable: true,\n configurable: true\n });\n SuggestionsManager.prototype.processKeyboardSelection = function (suggestion) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n this.addSelectedStatus(suggestion);\n this.keyboardFocusedElement = suggestion;\n return [4 /*yield*/, this.updateSelectedSuggestion(this.focusedSuggestion)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.processKeyboardPreviewSelection = function (preview) {\n this.addSelectedStatus(preview);\n this.keyboardFocusedElement = preview;\n };\n SuggestionsManager.prototype.processMouseSelection = function (suggestion) {\n this.addSelectedStatus(suggestion);\n this.updateSelectedSuggestion(this.focusedSuggestion);\n this.keyboardFocusedElement = null;\n };\n SuggestionsManager.prototype.buildSuggestionsContainer = function () {\n return Dom_1.$$('div', {\n className: this.suggestionListboxClassName,\n id: this.suggestionListboxID,\n role: 'listbox',\n ariaLabel: 'Search Suggestions'\n });\n };\n SuggestionsManager.prototype.createDomFromSuggestion = function (suggestion) {\n var _this = this;\n var dom = Dom_1.$$('div', {\n className: \"magic-box-suggestion \" + this.options.suggestionClass\n });\n suggestion.dom = dom.el;\n dom.on('click', function () {\n _this.selectSuggestion(suggestion);\n });\n dom.on('keyboardSelect', function () {\n _this.selectSuggestion(suggestion);\n });\n if (suggestion.html) {\n dom.el.innerHTML = suggestion.html;\n return dom;\n }\n if (suggestion.text) {\n dom.text(suggestion.text);\n return dom;\n }\n if (suggestion.separator) {\n dom.addClass('magic-box-suggestion-seperator');\n var suggestionLabel = Dom_1.$$('div', {\n className: 'magic-box-suggestion-seperator-label'\n }, suggestion.separator);\n dom.append(suggestionLabel.el);\n return dom;\n }\n return dom;\n };\n SuggestionsManager.prototype.selectSuggestion = function (suggestion) {\n suggestion.onSelect();\n Dom_1.$$(this.root).trigger(OmniboxEvents_1.OmniboxEvents.querySuggestSelection, { suggestion: suggestion.text });\n };\n SuggestionsManager.prototype.appendEmptySuggestionOption = function () {\n // Accessibility tools reports that a listbox element must always have at least one child with an option\n // Even if there is no suggestions to show.\n this.suggestionsListbox.append(Dom_1.$$('div', { role: 'option' }).el);\n };\n SuggestionsManager.prototype.modifyDomFromExistingSuggestion = function (dom) {\n // this need to be done if the selection is in cache and the dom is set in the suggestion\n this.removeSelectedStatus(dom);\n var found = dom.classList.contains(this.options.suggestionClass) ? dom : Dom_1.$$(dom).find('.' + this.options.suggestionClass);\n this.removeSelectedStatus(found);\n return Dom_1.$$(dom);\n };\n SuggestionsManager.prototype.move = function (direction) {\n return __awaiter(this, void 0, void 0, function () {\n var firstPreview;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!this.resultPreviewsManager.focusedPreviewElement) return [3 /*break*/, 2];\n return [4 /*yield*/, this.moveWithinPreview(direction)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n case 2:\n if (direction === Direction.Right || direction === Direction.Left) {\n firstPreview = this.resultPreviewsManager.previewElements[0];\n if (firstPreview) {\n this.processKeyboardPreviewSelection(firstPreview);\n return [2 /*return*/];\n }\n }\n return [4 /*yield*/, this.moveWithinSuggestion(direction)];\n case 3:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.moveWithinSuggestion = function (direction) {\n return __awaiter(this, void 0, void 0, function () {\n var currentlySelected, selectables, currentIndex, index;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n currentlySelected = Dom_1.$$(this.element).find(\".\" + this.options.selectedClass);\n selectables = Dom_1.$$(this.element).findAll(\".\" + this.options.suggestionClass);\n currentIndex = underscore_1.indexOf(selectables, currentlySelected);\n index = direction === Direction.Up ? currentIndex - 1 : currentIndex + 1;\n index = (index + selectables.length) % selectables.length;\n return [4 /*yield*/, this.selectQuerySuggest(selectables[index])];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.selectQuerySuggest = function (suggestion) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!suggestion) return [3 /*break*/, 2];\n return [4 /*yield*/, this.processKeyboardSelection(suggestion)];\n case 1:\n _a.sent();\n return [3 /*break*/, 3];\n case 2:\n this.keyboardFocusedElement = null;\n this.inputManager.input.removeAttribute('aria-activedescendant');\n _a.label = 3;\n case 3: return [2 /*return*/, suggestion];\n }\n });\n });\n };\n SuggestionsManager.prototype.moveWithinPreview = function (direction) {\n return __awaiter(this, void 0, void 0, function () {\n var newFocusedPreview;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n newFocusedPreview = this.resultPreviewsManager.getElementInDirection(direction);\n if (!!newFocusedPreview) return [3 /*break*/, 2];\n return [4 /*yield*/, this.selectQuerySuggest(this.resultPreviewsManager.previewsOwner.dom)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n case 2:\n this.processKeyboardPreviewSelection(newFocusedPreview);\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.returnMoved = function (selected) {\n if (selected) {\n if (selected['suggestion']) {\n return selected['suggestion'];\n }\n if (selected['no-text-suggestion']) {\n return null;\n }\n if (selected instanceof HTMLElement) {\n return {\n text: Dom_1.$$(selected).text()\n };\n }\n }\n return null;\n };\n SuggestionsManager.prototype.addSelectedStatus = function (element) {\n var selected = this.element.getElementsByClassName(this.options.selectedClass);\n for (var i = 0; i < selected.length; i++) {\n var elem = selected.item(i);\n this.removeSelectedStatus(elem);\n }\n Dom_1.$$(element).addClass(this.options.selectedClass);\n this.updateAreaSelectedIfDefined(element, 'true');\n };\n SuggestionsManager.prototype.updateSelectedSuggestion = function (suggestion) {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n Dom_1.$$(this.root).trigger(OmniboxEvents_1.OmniboxEvents.querySuggestGetFocus, {\n suggestion: suggestion.text\n });\n return [4 /*yield*/, this.resultPreviewsManager.displaySearchResultPreviewsForSuggestion(suggestion)];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n SuggestionsManager.prototype.removeSelectedStatus = function (suggestion) {\n Dom_1.$$(suggestion).removeClass(this.options.selectedClass);\n this.updateAreaSelectedIfDefined(suggestion, 'false');\n };\n SuggestionsManager.prototype.updateAreaSelectedIfDefined = function (element, value) {\n if (Dom_1.$$(element).getAttribute('aria-selected')) {\n this.inputManager.activeDescendant = element;\n Dom_1.$$(element).setAttribute('aria-selected', value);\n }\n };\n SuggestionsManager.prototype.addAccessibilityProperties = function () {\n this.addAccessibilityPropertiesForMagicBox();\n this.addAccessibilityPropertiesForInput();\n };\n SuggestionsManager.prototype.addAccessibilityPropertiesForMagicBox = function () {\n var magicBox = Dom_1.$$(this.magicBoxContainer);\n magicBox.setAttribute('role', 'search');\n magicBox.setAttribute('aria-haspopup', 'listbox');\n };\n SuggestionsManager.prototype.addAccessibilityPropertiesForInput = function () {\n var input = Dom_1.$$(this.inputManager.input);\n this.inputManager.activeDescendant = null;\n this.inputManager.expanded = false;\n input.setAttribute('aria-owns', this.suggestionListboxID);\n input.setAttribute('aria-controls', this.suggestionListboxID);\n };\n SuggestionsManager.prototype.htmlElementIsSuggestion = function (selected) {\n var omniboxSelectables = Dom_1.$$(this.element).findAll(\".\" + this.options.suggestionClass);\n return underscore_1.indexOf(omniboxSelectables, selected) > -1;\n };\n return SuggestionsManager;\n}());\nexports.SuggestionsManager = SuggestionsManager;\n\n\n/***/ }),\n/* 221 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar underscore_1 = __webpack_require__(0);\nvar Core_1 = __webpack_require__(20);\nvar Dom_1 = __webpack_require__(1);\nvar doMagicBoxExport_1 = __webpack_require__(561);\nvar InputManager_1 = __webpack_require__(502);\nvar MagicBoxClear_1 = __webpack_require__(564);\nvar SuggestionsManager_1 = __webpack_require__(220);\nvar MagicBoxInstance = /** @class */ (function () {\n function MagicBoxInstance(element, grammar, options) {\n if (options === void 0) { options = {}; }\n var _this = this;\n this.element = element;\n this.grammar = grammar;\n this.options = options;\n this.lastSuggestions = [];\n if (underscore_1.isUndefined(this.options.inline)) {\n this.options.inline = false;\n }\n Dom_1.$$(element).addClass('magic-box');\n if (this.options.inline) {\n Dom_1.$$(element).addClass('magic-box-inline');\n }\n this.result = this.grammar.parse('');\n this.displayedResult = this.result.clean();\n var inputContainer = Dom_1.$$(element).find('.magic-box-input');\n if (!inputContainer) {\n inputContainer = document.createElement('div');\n inputContainer.className = 'magic-box-input';\n element.appendChild(inputContainer);\n }\n this.inputManager = new InputManager_1.InputManager(inputContainer, function (text, wordCompletion) {\n if (!wordCompletion) {\n _this.setText(text);\n _this.addSuggestions();\n _this.onchange && _this.onchange();\n }\n else {\n _this.setText(text);\n _this.onselect && _this.onselect(_this.firstSuggestionWithText);\n }\n }, this);\n this.inputManager.ontabpress = function () {\n _this.ontabpress && _this.ontabpress();\n };\n var existingValue = this.inputManager.getValue();\n if (existingValue) {\n this.displayedResult.input = existingValue;\n }\n this.inputManager.setResult(this.displayedResult);\n var suggestionsContainer = document.createElement('div');\n suggestionsContainer.className = 'magic-box-suggestions';\n this.element.appendChild(suggestionsContainer);\n this.suggestionsManager = new SuggestionsManager_1.SuggestionsManager(suggestionsContainer, this.element, this.inputManager, {\n suggestionClass: this.options.selectableSuggestionClass,\n selectedClass: this.options.selectedSuggestionClass,\n timeout: this.options.suggestionTimeout\n });\n this.magicBoxClear = new MagicBoxClear_1.MagicBoxClear(this);\n this.setupHandler();\n }\n Object.defineProperty(MagicBoxInstance.prototype, \"firstSuggestionWithText\", {\n get: function () {\n return underscore_1.find(this.lastSuggestions, function (suggestion) { return suggestion.text; });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(MagicBoxInstance.prototype, \"firstSuggestionText\", {\n get: function () {\n var firstSuggestionWithText = this.firstSuggestionWithText;\n return firstSuggestionWithText ? firstSuggestionWithText.text : '';\n },\n enumerable: true,\n configurable: true\n });\n MagicBoxInstance.prototype.getResult = function () {\n return this.result;\n };\n MagicBoxInstance.prototype.getDisplayedResult = function () {\n return this.displayedResult;\n };\n MagicBoxInstance.prototype.setText = function (text) {\n Dom_1.$$(this.element).toggleClass('magic-box-notEmpty', text.length > 0);\n this.magicBoxClear.toggleTabindexAndAriaHidden(text.length > 0);\n this.result = this.grammar.parse(text);\n this.displayedResult = this.result.clean();\n this.inputManager.setResult(this.displayedResult);\n };\n MagicBoxInstance.prototype.setCursor = function (index) {\n this.inputManager.setCursor(index);\n };\n MagicBoxInstance.prototype.getCursor = function () {\n return this.inputManager.getCursor();\n };\n MagicBoxInstance.prototype.resultAtCursor = function (match) {\n return this.displayedResult.resultAt(this.getCursor(), match);\n };\n MagicBoxInstance.prototype.setupHandler = function () {\n var _this = this;\n this.inputManager.onblur = function () {\n Dom_1.$$(_this.element).removeClass('magic-box-hasFocus');\n _this.onblur && _this.onblur();\n if (!_this.options.inline) {\n _this.clearSuggestion();\n }\n };\n this.inputManager.onfocus = function () {\n Dom_1.$$(_this.element).addClass('magic-box-hasFocus');\n _this.addSuggestions();\n _this.onfocus && _this.onfocus();\n };\n this.inputManager.onkeydown = function (key) {\n if (_this.shouldMoveInSuggestions(key)) {\n return false;\n }\n if (key === Core_1.KEYBOARD.ENTER) {\n var suggestion = _this.suggestionsManager.selectAndReturnKeyboardFocusedElement();\n if (suggestion == null) {\n _this.onsubmit && _this.onsubmit();\n }\n return false;\n }\n else if (key === Core_1.KEYBOARD.ESCAPE) {\n _this.clearSuggestion();\n _this.blur();\n }\n else {\n _this.suggestionsManager.clearKeyboardFocusedElement();\n }\n return true;\n };\n this.inputManager.onchangecursor = function () {\n _this.addSuggestions();\n };\n this.inputManager.onkeyup = function (key) {\n _this.onmove && _this.onmove();\n if (!_this.shouldMoveInSuggestions(key)) {\n return true;\n }\n switch (key) {\n case Core_1.KEYBOARD.UP_ARROW:\n _this.suggestionsManager.moveUp();\n break;\n case Core_1.KEYBOARD.DOWN_ARROW:\n _this.suggestionsManager.moveDown();\n break;\n case Core_1.KEYBOARD.LEFT_ARROW:\n _this.suggestionsManager.moveLeft();\n break;\n case Core_1.KEYBOARD.RIGHT_ARROW:\n _this.suggestionsManager.moveRight();\n break;\n }\n if (_this.suggestionsManager.selectedSuggestion) {\n _this.focusOnSuggestion(_this.suggestionsManager.selectedSuggestion);\n }\n _this.onchange && _this.onchange();\n return false;\n };\n };\n MagicBoxInstance.prototype.addSuggestions = function () {\n return __awaiter(this, void 0, void 0, function () {\n var suggestions;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0: return [4 /*yield*/, this.suggestionsManager.receiveSuggestions(this.getSuggestions != null ? this.getSuggestions() : [])];\n case 1:\n suggestions = _a.sent();\n this.addSelectEventHandlers(suggestions);\n this.inputManager.setWordCompletion(this.firstSuggestionText);\n this.onSuggestions(suggestions);\n return [2 /*return*/];\n }\n });\n });\n };\n MagicBoxInstance.prototype.shouldMoveInSuggestions = function (key) {\n switch (key) {\n case Core_1.KEYBOARD.UP_ARROW:\n case Core_1.KEYBOARD.DOWN_ARROW:\n return true;\n case Core_1.KEYBOARD.LEFT_ARROW:\n case Core_1.KEYBOARD.RIGHT_ARROW:\n if (this.suggestionsManager.hasFocus && this.suggestionsManager.hasPreviews) {\n return true;\n }\n }\n return false;\n };\n MagicBoxInstance.prototype.addSelectEventHandlers = function (suggestions) {\n var _this = this;\n underscore_1.each(suggestions, function (suggestion) {\n if (suggestion.onSelect == null && suggestion.text != null) {\n suggestion.onSelect = function () {\n _this.setText(suggestion.text);\n _this.onselect && _this.onselect(suggestion);\n };\n }\n });\n };\n MagicBoxInstance.prototype.focus = function () {\n Dom_1.$$(this.element).addClass('magic-box-hasFocus');\n this.inputManager.focus();\n };\n MagicBoxInstance.prototype.blur = function () {\n this.inputManager.blur();\n };\n MagicBoxInstance.prototype.clearSuggestion = function () {\n return __awaiter(this, void 0, void 0, function () {\n return __generator(this, function (_a) {\n this.inputManager.setWordCompletion(null);\n this.suggestionsManager.clearSuggestions();\n this.onSuggestions([]);\n return [2 /*return*/];\n });\n });\n };\n MagicBoxInstance.prototype.focusOnSuggestion = function (suggestion) {\n if (suggestion == null || suggestion.text == null) {\n this.inputManager.setResult(this.displayedResult, this.firstSuggestionText);\n }\n else {\n this.inputManager.setResult(this.grammar.parse(suggestion.text).clean(), suggestion.text);\n }\n };\n MagicBoxInstance.prototype.getText = function () {\n return this.inputManager.getValue();\n };\n MagicBoxInstance.prototype.getWordCompletion = function () {\n return this.inputManager.getWordCompletion();\n };\n MagicBoxInstance.prototype.clear = function () {\n this.setText('');\n this.clearSuggestion();\n this.focus();\n this.onclear && this.onclear();\n };\n MagicBoxInstance.prototype.hasSuggestions = function () {\n return this.suggestionsManager.hasSuggestions;\n };\n return MagicBoxInstance;\n}());\nexports.MagicBoxInstance = MagicBoxInstance;\nfunction createMagicBox(element, grammar, options) {\n return new MagicBoxInstance(element, grammar, options);\n}\nexports.createMagicBox = createMagicBox;\nfunction requestAnimationFrame(callback) {\n if ('requestAnimationFrame' in window) {\n return window.requestAnimationFrame(callback);\n }\n return setTimeout(callback);\n}\nexports.requestAnimationFrame = requestAnimationFrame;\ndoMagicBoxExport_1.doMagicBoxExport();\n\n\n/***/ }),\n/* 222 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar _ = __webpack_require__(0);\nvar MagicBoxUtils = /** @class */ (function () {\n function MagicBoxUtils() {\n }\n MagicBoxUtils.escapeRegExp = function (str) {\n return str.replace(/[\\-\\[\\]\\/\\{\\}\\(\\)\\*\\+\\?\\.\\\\\\^\\$\\|]/g, '\\\\$&');\n };\n MagicBoxUtils.highlightText = function (text, highligth, ignoreCase, matchClass, doNotMatchClass) {\n var _this = this;\n if (ignoreCase === void 0) { ignoreCase = false; }\n if (matchClass === void 0) { matchClass = 'magic-box-hightlight'; }\n if (doNotMatchClass === void 0) { doNotMatchClass = ''; }\n if (highligth.length == 0) {\n return text;\n }\n var escaped = this.escapeRegExp(highligth);\n var stringRegex = '(' + escaped + ')|(.*?(?=' + escaped + ')|.+)';\n var regex = new RegExp(stringRegex, ignoreCase ? 'gi' : 'g');\n return text.replace(regex, function (text, match, notmatch) { return _this.escapeText(match != null ? matchClass : doNotMatchClass, text); });\n };\n MagicBoxUtils.escapeText = function (classname, text) {\n return \"\" + _.escape(text) + \"\";\n };\n return MagicBoxUtils;\n}());\nexports.MagicBoxUtils = MagicBoxUtils;\n\n\n/***/ }),\n/* 223 */\n/***/ (function(module, exports) {\n\n// removed by extract-text-webpack-plugin\n\n/***/ }),\n/* 224 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom_1 = __webpack_require__(1);\nvar DynamicFacetValueShowMoreLessButton = /** @class */ (function () {\n function DynamicFacetValueShowMoreLessButton(options) {\n var btn = Dom_1.$$('button', {\n className: options.className,\n ariaLabel: options.ariaLabel,\n type: 'button'\n }, options.label);\n this.element = Dom_1.$$('li', { role: 'none' }, btn).el;\n btn.on('click', function () { return options.action(); });\n }\n return DynamicFacetValueShowMoreLessButton;\n}());\nexports.DynamicFacetValueShowMoreLessButton = DynamicFacetValueShowMoreLessButton;\n\n\n/***/ }),\n/* 225 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Globalize = __webpack_require__(23);\nvar FacetValueState_1 = __webpack_require__(71);\nvar AnalyticsActionListMeta_1 = __webpack_require__(10);\nvar Strings_1 = __webpack_require__(6);\nvar FacetRequest_1 = __webpack_require__(183);\nvar DynamicFacetValue = /** @class */ (function () {\n function DynamicFacetValue(facetValue, facet, rendererKlass) {\n this.facet = facet;\n this.element = null;\n this.value = facetValue.value;\n this.start = facetValue.start;\n this.end = facetValue.end;\n this.endInclusive = facetValue.endInclusive;\n this.state = facetValue.state;\n this.numberOfResults = facetValue.numberOfResults;\n this.position = facetValue.position;\n this.displayValue = facetValue.displayValue;\n this.renderer = new rendererKlass(this, facet);\n }\n Object.defineProperty(DynamicFacetValue.prototype, \"isSelected\", {\n get: function () {\n return this.state === FacetValueState_1.FacetValueState.selected;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"isIdle\", {\n get: function () {\n return this.state === FacetValueState_1.FacetValueState.idle;\n },\n enumerable: true,\n configurable: true\n });\n DynamicFacetValue.prototype.toggleSelect = function () {\n this.state === FacetValueState_1.FacetValueState.selected ? this.deselect() : this.select();\n };\n DynamicFacetValue.prototype.select = function () {\n this.state = FacetValueState_1.FacetValueState.selected;\n };\n DynamicFacetValue.prototype.deselect = function () {\n this.state = FacetValueState_1.FacetValueState.idle;\n };\n DynamicFacetValue.prototype.equals = function (arg) {\n var value = typeof arg === 'string' ? arg : arg.value;\n return value.toLowerCase() === this.value.toLowerCase();\n };\n DynamicFacetValue.prototype.focus = function () {\n if (!this.renderedElement) {\n return;\n }\n var checkbox = this.renderedElement.querySelector('.coveo-checkbox-button');\n if (!checkbox) {\n return;\n }\n checkbox.focus();\n };\n Object.defineProperty(DynamicFacetValue.prototype, \"formattedCount\", {\n get: function () {\n return Globalize.format(this.numberOfResults, 'n0');\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"selectAriaLabel\", {\n get: function () {\n var resultCount = Strings_1.l('ResultCount', this.formattedCount, this.numberOfResults);\n return this.displayValue + \" \" + resultCount;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"isRange\", {\n get: function () {\n return this.facet.facetType !== FacetRequest_1.FacetType.specific;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"analyticsValue\", {\n get: function () {\n return this.isRange ? this.start + \"..\" + this.end : this.value;\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"rangeFacetState\", {\n get: function () {\n if (!this.isRange) {\n return null;\n }\n return {\n start: \"\" + this.start,\n end: \"\" + this.end,\n endInclusive: this.endInclusive\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"analyticsFacetState\", {\n get: function () {\n return __assign({}, this.facet.basicAnalyticsFacetState, this.rangeFacetState, { value: this.analyticsValue, valuePosition: this.position, displayValue: this.displayValue, state: this.state });\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"rangeFacetMeta\", {\n get: function () {\n if (!this.isRange) {\n return null;\n }\n return {\n facetRangeStart: \"\" + this.start,\n facetRangeEnd: \"\" + this.end,\n facetRangeEndInclusive: this.endInclusive\n };\n },\n enumerable: true,\n configurable: true\n });\n Object.defineProperty(DynamicFacetValue.prototype, \"analyticsFacetMeta\", {\n get: function () {\n return __assign({}, this.facet.basicAnalyticsFacetMeta, this.rangeFacetMeta, { facetValue: this.analyticsValue });\n },\n enumerable: true,\n configurable: true\n });\n DynamicFacetValue.prototype.logSelectActionToAnalytics = function () {\n var action = this.state === FacetValueState_1.FacetValueState.selected ? AnalyticsActionListMeta_1.analyticsActionCauseList.dynamicFacetSelect : AnalyticsActionListMeta_1.analyticsActionCauseList.dynamicFacetDeselect;\n this.facet.logAnalyticsEvent(action, this.analyticsFacetMeta);\n };\n DynamicFacetValue.prototype.render = function () {\n this.element = this.renderer.render();\n return this.element;\n };\n Object.defineProperty(DynamicFacetValue.prototype, \"renderedElement\", {\n get: function () {\n if (this.element) {\n return this.element;\n }\n return this.render();\n },\n enumerable: true,\n configurable: true\n });\n return DynamicFacetValue;\n}());\nexports.DynamicFacetValue = DynamicFacetValue;\n\n\n/***/ }),\n/* 226 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ChatterUtils = /** @class */ (function () {\n function ChatterUtils() {\n }\n ChatterUtils.buildURI = function (objectURI, objectId, newObjectId) {\n return objectURI.replace(objectId, newObjectId);\n };\n ChatterUtils.bindClickEventToElement = function (element, openInPrimaryTab, openInSubTab) {\n return element;\n };\n return ChatterUtils;\n}());\nexports.ChatterUtils = ChatterUtils;\n\n\n/***/ }),\n/* 227 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * The `QuickviewEvents` static class contains the string definitions of all events that strongly relate to the\n * [`Quickview`]{@link Quickview} component.\n */\nvar QuickviewEvents = /** @class */ (function () {\n function QuickviewEvents() {\n }\n /**\n * Triggered by the [`QuickviewDocument`]{@link QuickviewDocument} component when the content to display in the\n * quickview modal window has just finished downloading.\n *\n * The [`Quickview`]{@link Quickview} component listens to this event to know when to remove its loading animation.\n *\n * All `quickviewLoaded` event handlers receive a [`QuickviewLoadedEventArgs`]{@link IQuickviewLoadedEventArgs} object\n * as an argument.\n *\n * @type {string} The string value is `quickviewLoaded`.\n */\n QuickviewEvents.quickviewLoaded = 'quickviewLoaded';\n /**\n * Triggered by the [`QuickviewDocument`]{@link QuickviewDocument} component when the end user has just clicked the\n * **Quickview** button/link to open the quickview modal window.\n *\n * This event allows external code to modify the terms to highlight before the content of the quickview modal window\n * is rendered.\n *\n * All `openQuickview` event handlers receive an\n * [`OpenQuickviewEventArgs`]{@link ResultListEvents.IOpenQuickviewEventArgs} object as an argument.\n *\n * @type {string} The string value is `openQuickview`.\n */\n QuickviewEvents.openQuickview = 'openQuickview';\n return QuickviewEvents;\n}());\nexports.QuickviewEvents = QuickviewEvents;\n\n\n/***/ }),\n/* 228 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.SUBSCRIPTION_TYPE = {\n followQuery: 'followQuery',\n followDocument: 'followDocument'\n};\n\n\n/***/ }),\n/* 229 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar dompurify_1 = __webpack_require__(588);\nvar Dom_1 = __webpack_require__(1);\nvar ResultLinkCommon_1 = __webpack_require__(473);\nexports.getDefaultSnippetStyle = function (contentClassName) { return \"\\n body {\\n font-family: \\\"Lato\\\", \\\"Helvetica Neue\\\", Helvetica, Arial, sans-serif, sans-serif;\\n }\\n\\n .\" + contentClassName + \" > :first-child {\\n margin-top: 0;\\n }\\n\\n .\" + contentClassName + \" > :last-child {\\n margin-bottom: 0;\\n }\\n\"; };\nfunction getSanitizedAnswerSnippet(questionAnswer) {\n return (questionAnswer.answerSnippet &&\n dompurify_1.sanitize(questionAnswer.answerSnippet, {\n USE_PROFILES: { html: true }\n }));\n}\nexports.getSanitizedAnswerSnippet = getSanitizedAnswerSnippet;\nexports.transformSnippetLinks = function (renderedSnippetParent, alwaysOpenInNewWindow, logAnalytics) {\n Dom_1.Dom.nodeListToArray(renderedSnippetParent.querySelectorAll('a')).forEach(function (link) {\n ResultLinkCommon_1.bindAnalyticsToLink(link, function () { return logAnalytics(link); });\n link.target = alwaysOpenInNewWindow ? '_blank' : '_top';\n });\n};\n\n\n/***/ }),\n/* 230 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar AdvancedSearchEvents_1 = __webpack_require__(88);\nvar Dom_1 = __webpack_require__(1);\nvar RadioButton_1 = __webpack_require__(98);\nvar _ = __webpack_require__(0);\nvar DateInput = /** @class */ (function () {\n function DateInput(inputName, root) {\n this.inputName = inputName;\n this.root = root;\n this.buildContent();\n }\n DateInput.prototype.reset = function () {\n this.radio.reset();\n };\n DateInput.prototype.build = function () {\n return this.element;\n };\n DateInput.prototype.getElement = function () {\n return this.element;\n };\n DateInput.prototype.isSelected = function () {\n return this.getRadio().checked;\n };\n DateInput.prototype.updateQuery = function (queryBuilder) {\n try {\n var value = this.getValue();\n if (value) {\n queryBuilder.advancedExpression.add(value);\n }\n this.removeErrorMessage();\n }\n catch (error) {\n this.setErrorMessage(error);\n }\n };\n DateInput.prototype.getRadio = function () {\n return Dom_1.$$(this.element).find('input');\n };\n DateInput.prototype.setErrorMessage = function (message) {\n this.removeErrorMessage();\n this.error = Dom_1.$$('div', {\n className: 'coveo-error coveo-error-date-input'\n }, message).el;\n Dom_1.$$(this.element).append(this.error);\n };\n DateInput.prototype.removeErrorMessage = function () {\n if (this.error) {\n Dom_1.$$(this.error).remove();\n }\n };\n DateInput.prototype.buildContent = function () {\n var _this = this;\n this.radio = new RadioButton_1.RadioButton(function () {\n _this.deactivateAllInputs();\n _this.activateSelectedInput();\n }, this.inputName, 'coveo-advanced-search-date-input');\n this.element = this.radio.getElement();\n Dom_1.$$(this.element).addClass('coveo-advanced-search-date-input-section');\n Dom_1.$$(this.radio.getRadio()).addClass('coveo-advanced-search-date');\n Dom_1.$$(this.radio.getLabel()).addClass('coveo-advanced-search-label');\n };\n DateInput.prototype.deactivateAllInputs = function () {\n var elements = Dom_1.$$(this.element.parentElement).findAll('fieldset');\n _.each(elements, function (element) {\n element.disabled = true;\n });\n };\n DateInput.prototype.activateSelectedInput = function () {\n var elements = Dom_1.$$(this.element).findAll('fieldset');\n _.each(elements, function (element) {\n element.disabled = false;\n });\n };\n DateInput.prototype.onChange = function () {\n if (this.root) {\n Dom_1.$$(this.root).trigger(AdvancedSearchEvents_1.AdvancedSearchEvents.executeAdvancedSearch);\n }\n else if (this.element) {\n Dom_1.$$(this.element).trigger(AdvancedSearchEvents_1.AdvancedSearchEvents.executeAdvancedSearch);\n }\n };\n return DateInput;\n}());\nexports.DateInput = DateInput;\n\n\n/***/ }),\n/* 231 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Dom_1 = __webpack_require__(1);\nvar AdvancedSearchEvents_1 = __webpack_require__(88);\nvar Strings_1 = __webpack_require__(6);\nvar DocumentInput = /** @class */ (function () {\n function DocumentInput(inputName, root) {\n this.inputName = inputName;\n this.root = root;\n }\n DocumentInput.prototype.reset = function () { };\n DocumentInput.prototype.build = function () {\n var documentInput = Dom_1.$$('div', { className: 'coveo-advanced-search-document-input-section' });\n var label = Dom_1.$$('span', { className: 'coveo-advanced-search-label' });\n label.text(Strings_1.l(this.inputName));\n documentInput.append(label.el);\n this.element = documentInput.el;\n return this.element;\n };\n DocumentInput.prototype.getValue = function () {\n return '';\n };\n DocumentInput.prototype.updateQuery = function (queryBuilder) {\n var value = this.getValue();\n if (value) {\n queryBuilder.advancedExpression.add(this.getValue());\n }\n };\n DocumentInput.prototype.onChange = function () {\n if (this.root) {\n Dom_1.$$(this.root).trigger(AdvancedSearchEvents_1.AdvancedSearchEvents.executeAdvancedSearch);\n }\n else if (this.element) {\n Dom_1.$$(this.element).trigger(AdvancedSearchEvents_1.AdvancedSearchEvents.executeAdvancedSearch);\n }\n };\n return DocumentInput;\n}());\nexports.DocumentInput = DocumentInput;\n\n\n/***/ }),\n/* 232 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatDecimal.js\n/* harmony default export */ var formatDecimal = (function(x) {\n return Math.abs(x = Math.round(x)) >= 1e21\n ? x.toLocaleString(\"en\").replace(/,/g, \"\")\n : x.toString(10);\n});\n\n// Computes the decimal coefficient and exponent of the specified number x with\n// significant digits p, where x is positive and p is in [1, 21] or undefined.\n// For example, formatDecimalParts(1.23) returns [\"123\", 0].\nfunction formatDecimalParts(x, p) {\n if ((i = (x = p ? x.toExponential(p - 1) : x.toExponential()).indexOf(\"e\")) < 0) return null; // NaN, ±Infinity\n var i, coefficient = x.slice(0, i);\n\n // The string returned by toExponential either has the form \\d\\.\\d+e[-+]\\d+\n // (e.g., 1.2e+3) or the form \\de[-+]\\d+ (e.g., 1e+3).\n return [\n coefficient.length > 1 ? coefficient[0] + coefficient.slice(2) : coefficient,\n +x.slice(i + 1)\n ];\n}\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/exponent.js\n\n\n/* harmony default export */ var src_exponent = (function(x) {\n return x = formatDecimalParts(Math.abs(x)), x ? x[1] : NaN;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatGroup.js\n/* harmony default export */ var formatGroup = (function(grouping, thousands) {\n return function(value, width) {\n var i = value.length,\n t = [],\n j = 0,\n g = grouping[0],\n length = 0;\n\n while (i > 0 && g > 0) {\n if (length + g + 1 > width) g = Math.max(1, width - length);\n t.push(value.substring(i -= g, i + g));\n if ((length += g + 1) > width) break;\n g = grouping[j = (j + 1) % grouping.length];\n }\n\n return t.reverse().join(thousands);\n };\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatNumerals.js\n/* harmony default export */ var formatNumerals = (function(numerals) {\n return function(value) {\n return value.replace(/[0-9]/g, function(i) {\n return numerals[+i];\n });\n };\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatSpecifier.js\n// [[fill]align][sign][symbol][0][width][,][.precision][~][type]\nvar re = /^(?:(.)?([<>=^]))?([+\\-( ])?([$#])?(0)?(\\d+)?(,)?(\\.\\d+)?(~)?([a-z%])?$/i;\n\nfunction formatSpecifier(specifier) {\n if (!(match = re.exec(specifier))) throw new Error(\"invalid format: \" + specifier);\n var match;\n return new FormatSpecifier({\n fill: match[1],\n align: match[2],\n sign: match[3],\n symbol: match[4],\n zero: match[5],\n width: match[6],\n comma: match[7],\n precision: match[8] && match[8].slice(1),\n trim: match[9],\n type: match[10]\n });\n}\n\nformatSpecifier.prototype = FormatSpecifier.prototype; // instanceof\n\nfunction FormatSpecifier(specifier) {\n this.fill = specifier.fill === undefined ? \" \" : specifier.fill + \"\";\n this.align = specifier.align === undefined ? \">\" : specifier.align + \"\";\n this.sign = specifier.sign === undefined ? \"-\" : specifier.sign + \"\";\n this.symbol = specifier.symbol === undefined ? \"\" : specifier.symbol + \"\";\n this.zero = !!specifier.zero;\n this.width = specifier.width === undefined ? undefined : +specifier.width;\n this.comma = !!specifier.comma;\n this.precision = specifier.precision === undefined ? undefined : +specifier.precision;\n this.trim = !!specifier.trim;\n this.type = specifier.type === undefined ? \"\" : specifier.type + \"\";\n}\n\nFormatSpecifier.prototype.toString = function() {\n return this.fill\n + this.align\n + this.sign\n + this.symbol\n + (this.zero ? \"0\" : \"\")\n + (this.width === undefined ? \"\" : Math.max(1, this.width | 0))\n + (this.comma ? \",\" : \"\")\n + (this.precision === undefined ? \"\" : \".\" + Math.max(0, this.precision | 0))\n + (this.trim ? \"~\" : \"\")\n + this.type;\n};\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatTrim.js\n// Trims insignificant zeros, e.g., replaces 1.2000k with 1.2k.\n/* harmony default export */ var formatTrim = (function(s) {\n out: for (var n = s.length, i = 1, i0 = -1, i1; i < n; ++i) {\n switch (s[i]) {\n case \".\": i0 = i1 = i; break;\n case \"0\": if (i0 === 0) i0 = i; i1 = i; break;\n default: if (!+s[i]) break out; if (i0 > 0) i0 = 0; break;\n }\n }\n return i0 > 0 ? s.slice(0, i0) + s.slice(i1 + 1) : s;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatPrefixAuto.js\n\n\nvar prefixExponent;\n\n/* harmony default export */ var formatPrefixAuto = (function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1],\n i = exponent - (prefixExponent = Math.max(-8, Math.min(8, Math.floor(exponent / 3))) * 3) + 1,\n n = coefficient.length;\n return i === n ? coefficient\n : i > n ? coefficient + new Array(i - n + 1).join(\"0\")\n : i > 0 ? coefficient.slice(0, i) + \".\" + coefficient.slice(i)\n : \"0.\" + new Array(1 - i).join(\"0\") + formatDecimalParts(x, Math.max(0, p + i - 1))[0]; // less than 1y!\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatRounded.js\n\n\n/* harmony default export */ var formatRounded = (function(x, p) {\n var d = formatDecimalParts(x, p);\n if (!d) return x + \"\";\n var coefficient = d[0],\n exponent = d[1];\n return exponent < 0 ? \"0.\" + new Array(-exponent).join(\"0\") + coefficient\n : coefficient.length > exponent + 1 ? coefficient.slice(0, exponent + 1) + \".\" + coefficient.slice(exponent + 1)\n : coefficient + new Array(exponent - coefficient.length + 2).join(\"0\");\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/formatTypes.js\n\n\n\n\n/* harmony default export */ var formatTypes = ({\n \"%\": function(x, p) { return (x * 100).toFixed(p); },\n \"b\": function(x) { return Math.round(x).toString(2); },\n \"c\": function(x) { return x + \"\"; },\n \"d\": formatDecimal,\n \"e\": function(x, p) { return x.toExponential(p); },\n \"f\": function(x, p) { return x.toFixed(p); },\n \"g\": function(x, p) { return x.toPrecision(p); },\n \"o\": function(x) { return Math.round(x).toString(8); },\n \"p\": function(x, p) { return formatRounded(x * 100, p); },\n \"r\": formatRounded,\n \"s\": formatPrefixAuto,\n \"X\": function(x) { return Math.round(x).toString(16).toUpperCase(); },\n \"x\": function(x) { return Math.round(x).toString(16); }\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/identity.js\n/* harmony default export */ var identity = (function(x) {\n return x;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/locale.js\n\n\n\n\n\n\n\n\n\nvar map = Array.prototype.map,\n prefixes = [\"y\",\"z\",\"a\",\"f\",\"p\",\"n\",\"µ\",\"m\",\"\",\"k\",\"M\",\"G\",\"T\",\"P\",\"E\",\"Z\",\"Y\"];\n\n/* harmony default export */ var src_locale = (function(locale) {\n var group = locale.grouping === undefined || locale.thousands === undefined ? identity : formatGroup(map.call(locale.grouping, Number), locale.thousands + \"\"),\n currencyPrefix = locale.currency === undefined ? \"\" : locale.currency[0] + \"\",\n currencySuffix = locale.currency === undefined ? \"\" : locale.currency[1] + \"\",\n decimal = locale.decimal === undefined ? \".\" : locale.decimal + \"\",\n numerals = locale.numerals === undefined ? identity : formatNumerals(map.call(locale.numerals, String)),\n percent = locale.percent === undefined ? \"%\" : locale.percent + \"\",\n minus = locale.minus === undefined ? \"-\" : locale.minus + \"\",\n nan = locale.nan === undefined ? \"NaN\" : locale.nan + \"\";\n\n function newFormat(specifier) {\n specifier = formatSpecifier(specifier);\n\n var fill = specifier.fill,\n align = specifier.align,\n sign = specifier.sign,\n symbol = specifier.symbol,\n zero = specifier.zero,\n width = specifier.width,\n comma = specifier.comma,\n precision = specifier.precision,\n trim = specifier.trim,\n type = specifier.type;\n\n // The \"n\" type is an alias for \",g\".\n if (type === \"n\") comma = true, type = \"g\";\n\n // The \"\" type, and any invalid type, is an alias for \".12~g\".\n else if (!formatTypes[type]) precision === undefined && (precision = 12), trim = true, type = \"g\";\n\n // If zero fill is specified, padding goes after sign and before digits.\n if (zero || (fill === \"0\" && align === \"=\")) zero = true, fill = \"0\", align = \"=\";\n\n // Compute the prefix and suffix.\n // For SI-prefix, the suffix is lazily computed.\n var prefix = symbol === \"$\" ? currencyPrefix : symbol === \"#\" && /[boxX]/.test(type) ? \"0\" + type.toLowerCase() : \"\",\n suffix = symbol === \"$\" ? currencySuffix : /[%p]/.test(type) ? percent : \"\";\n\n // What format function should we use?\n // Is this an integer type?\n // Can this type generate exponential notation?\n var formatType = formatTypes[type],\n maybeSuffix = /[defgprs%]/.test(type);\n\n // Set the default precision if not specified,\n // or clamp the specified precision to the supported range.\n // For significant precision, it must be in [1, 21].\n // For fixed precision, it must be in [0, 20].\n precision = precision === undefined ? 6\n : /[gprs]/.test(type) ? Math.max(1, Math.min(21, precision))\n : Math.max(0, Math.min(20, precision));\n\n function format(value) {\n var valuePrefix = prefix,\n valueSuffix = suffix,\n i, n, c;\n\n if (type === \"c\") {\n valueSuffix = formatType(value) + valueSuffix;\n value = \"\";\n } else {\n value = +value;\n\n // Determine the sign. -0 is not less than 0, but 1 / -0 is!\n var valueNegative = value < 0 || 1 / value < 0;\n\n // Perform the initial formatting.\n value = isNaN(value) ? nan : formatType(Math.abs(value), precision);\n\n // Trim insignificant zeros.\n if (trim) value = formatTrim(value);\n\n // If a negative value rounds to zero after formatting, and no explicit positive sign is requested, hide the sign.\n if (valueNegative && +value === 0 && sign !== \"+\") valueNegative = false;\n\n // Compute the prefix and suffix.\n valuePrefix = (valueNegative ? (sign === \"(\" ? sign : minus) : sign === \"-\" || sign === \"(\" ? \"\" : sign) + valuePrefix;\n valueSuffix = (type === \"s\" ? prefixes[8 + prefixExponent / 3] : \"\") + valueSuffix + (valueNegative && sign === \"(\" ? \")\" : \"\");\n\n // Break the formatted value into the integer “value” part that can be\n // grouped, and fractional or exponential “suffix” part that is not.\n if (maybeSuffix) {\n i = -1, n = value.length;\n while (++i < n) {\n if (c = value.charCodeAt(i), 48 > c || c > 57) {\n valueSuffix = (c === 46 ? decimal + value.slice(i + 1) : value.slice(i)) + valueSuffix;\n value = value.slice(0, i);\n break;\n }\n }\n }\n }\n\n // If the fill character is not \"0\", grouping is applied before padding.\n if (comma && !zero) value = group(value, Infinity);\n\n // Compute the padding.\n var length = valuePrefix.length + value.length + valueSuffix.length,\n padding = length < width ? new Array(width - length + 1).join(fill) : \"\";\n\n // If the fill character is \"0\", grouping is applied after padding.\n if (comma && zero) value = group(padding + value, padding.length ? width - valueSuffix.length : Infinity), padding = \"\";\n\n // Reconstruct the final output based on the desired alignment.\n switch (align) {\n case \"<\": value = valuePrefix + value + valueSuffix + padding; break;\n case \"=\": value = valuePrefix + padding + value + valueSuffix; break;\n case \"^\": value = padding.slice(0, length = padding.length >> 1) + valuePrefix + value + valueSuffix + padding.slice(length); break;\n default: value = padding + valuePrefix + value + valueSuffix; break;\n }\n\n return numerals(value);\n }\n\n format.toString = function() {\n return specifier + \"\";\n };\n\n return format;\n }\n\n function formatPrefix(specifier, value) {\n var f = newFormat((specifier = formatSpecifier(specifier), specifier.type = \"f\", specifier)),\n e = Math.max(-8, Math.min(8, Math.floor(src_exponent(value) / 3))) * 3,\n k = Math.pow(10, -e),\n prefix = prefixes[8 + e / 3];\n return function(value) {\n return f(k * value) + prefix;\n };\n }\n\n return {\n format: newFormat,\n formatPrefix: formatPrefix\n };\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/defaultLocale.js\n\n\nvar defaultLocale_locale;\nvar defaultLocale_format;\nvar defaultLocale_formatPrefix;\n\ndefaultLocale({\n decimal: \".\",\n thousands: \",\",\n grouping: [3],\n currency: [\"$\", \"\"],\n minus: \"-\"\n});\n\nfunction defaultLocale(definition) {\n defaultLocale_locale = src_locale(definition);\n defaultLocale_format = defaultLocale_locale.format;\n defaultLocale_formatPrefix = defaultLocale_locale.formatPrefix;\n return defaultLocale_locale;\n}\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionFixed.js\n\n\n/* harmony default export */ var precisionFixed = (function(step) {\n return Math.max(0, -src_exponent(Math.abs(step)));\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionPrefix.js\n\n\n/* harmony default export */ var precisionPrefix = (function(step, value) {\n return Math.max(0, Math.max(-8, Math.min(8, Math.floor(src_exponent(value) / 3))) * 3 - src_exponent(Math.abs(step)));\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/precisionRound.js\n\n\n/* harmony default export */ var precisionRound = (function(step, max) {\n step = Math.abs(step), max = Math.abs(max) - step;\n return Math.max(0, src_exponent(max) - src_exponent(step)) + 1;\n});\n\n// CONCATENATED MODULE: ./node_modules/d3-format/src/index.js\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"c\", function() { return defaultLocale; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"b\", function() { return defaultLocale_format; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"e\", function() { return defaultLocale_formatPrefix; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"d\", function() { return src_locale; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"f\", function() { return formatSpecifier; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"a\", function() { return FormatSpecifier; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"g\", function() { return precisionFixed; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"h\", function() { return precisionPrefix; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"i\", function() { return precisionRound; });\n\n\n\n\n\n\n\n\n/***/ }),\n/* 233 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n\n// EXTERNAL MODULE: ./node_modules/d3-time/src/index.js + 16 modules\nvar src = __webpack_require__(187);\n\n// CONCATENATED MODULE: ./node_modules/d3-time-format/src/locale.js\n\n\nfunction localDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(-1, d.m, d.d, d.H, d.M, d.S, d.L);\n date.setFullYear(d.y);\n return date;\n }\n return new Date(d.y, d.m, d.d, d.H, d.M, d.S, d.L);\n}\n\nfunction utcDate(d) {\n if (0 <= d.y && d.y < 100) {\n var date = new Date(Date.UTC(-1, d.m, d.d, d.H, d.M, d.S, d.L));\n date.setUTCFullYear(d.y);\n return date;\n }\n return new Date(Date.UTC(d.y, d.m, d.d, d.H, d.M, d.S, d.L));\n}\n\nfunction newDate(y, m, d) {\n return {y: y, m: m, d: d, H: 0, M: 0, S: 0, L: 0};\n}\n\nfunction formatLocale(locale) {\n var locale_dateTime = locale.dateTime,\n locale_date = locale.date,\n locale_time = locale.time,\n locale_periods = locale.periods,\n locale_weekdays = locale.days,\n locale_shortWeekdays = locale.shortDays,\n locale_months = locale.months,\n locale_shortMonths = locale.shortMonths;\n\n var periodRe = formatRe(locale_periods),\n periodLookup = formatLookup(locale_periods),\n weekdayRe = formatRe(locale_weekdays),\n weekdayLookup = formatLookup(locale_weekdays),\n shortWeekdayRe = formatRe(locale_shortWeekdays),\n shortWeekdayLookup = formatLookup(locale_shortWeekdays),\n monthRe = formatRe(locale_months),\n monthLookup = formatLookup(locale_months),\n shortMonthRe = formatRe(locale_shortMonths),\n shortMonthLookup = formatLookup(locale_shortMonths);\n\n var formats = {\n \"a\": formatShortWeekday,\n \"A\": formatWeekday,\n \"b\": formatShortMonth,\n \"B\": formatMonth,\n \"c\": null,\n \"d\": formatDayOfMonth,\n \"e\": formatDayOfMonth,\n \"f\": formatMicroseconds,\n \"g\": formatYearISO,\n \"G\": formatFullYearISO,\n \"H\": formatHour24,\n \"I\": formatHour12,\n \"j\": formatDayOfYear,\n \"L\": formatMilliseconds,\n \"m\": formatMonthNumber,\n \"M\": formatMinutes,\n \"p\": formatPeriod,\n \"q\": formatQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatSeconds,\n \"u\": formatWeekdayNumberMonday,\n \"U\": formatWeekNumberSunday,\n \"V\": formatWeekNumberISO,\n \"w\": formatWeekdayNumberSunday,\n \"W\": formatWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatYear,\n \"Y\": formatFullYear,\n \"Z\": formatZone,\n \"%\": formatLiteralPercent\n };\n\n var utcFormats = {\n \"a\": formatUTCShortWeekday,\n \"A\": formatUTCWeekday,\n \"b\": formatUTCShortMonth,\n \"B\": formatUTCMonth,\n \"c\": null,\n \"d\": formatUTCDayOfMonth,\n \"e\": formatUTCDayOfMonth,\n \"f\": formatUTCMicroseconds,\n \"g\": formatUTCYearISO,\n \"G\": formatUTCFullYearISO,\n \"H\": formatUTCHour24,\n \"I\": formatUTCHour12,\n \"j\": formatUTCDayOfYear,\n \"L\": formatUTCMilliseconds,\n \"m\": formatUTCMonthNumber,\n \"M\": formatUTCMinutes,\n \"p\": formatUTCPeriod,\n \"q\": formatUTCQuarter,\n \"Q\": formatUnixTimestamp,\n \"s\": formatUnixTimestampSeconds,\n \"S\": formatUTCSeconds,\n \"u\": formatUTCWeekdayNumberMonday,\n \"U\": formatUTCWeekNumberSunday,\n \"V\": formatUTCWeekNumberISO,\n \"w\": formatUTCWeekdayNumberSunday,\n \"W\": formatUTCWeekNumberMonday,\n \"x\": null,\n \"X\": null,\n \"y\": formatUTCYear,\n \"Y\": formatUTCFullYear,\n \"Z\": formatUTCZone,\n \"%\": formatLiteralPercent\n };\n\n var parses = {\n \"a\": parseShortWeekday,\n \"A\": parseWeekday,\n \"b\": parseShortMonth,\n \"B\": parseMonth,\n \"c\": parseLocaleDateTime,\n \"d\": parseDayOfMonth,\n \"e\": parseDayOfMonth,\n \"f\": parseMicroseconds,\n \"g\": parseYear,\n \"G\": parseFullYear,\n \"H\": parseHour24,\n \"I\": parseHour24,\n \"j\": parseDayOfYear,\n \"L\": parseMilliseconds,\n \"m\": parseMonthNumber,\n \"M\": parseMinutes,\n \"p\": parsePeriod,\n \"q\": parseQuarter,\n \"Q\": parseUnixTimestamp,\n \"s\": parseUnixTimestampSeconds,\n \"S\": parseSeconds,\n \"u\": parseWeekdayNumberMonday,\n \"U\": parseWeekNumberSunday,\n \"V\": parseWeekNumberISO,\n \"w\": parseWeekdayNumberSunday,\n \"W\": parseWeekNumberMonday,\n \"x\": parseLocaleDate,\n \"X\": parseLocaleTime,\n \"y\": parseYear,\n \"Y\": parseFullYear,\n \"Z\": parseZone,\n \"%\": parseLiteralPercent\n };\n\n // These recursive directive definitions must be deferred.\n formats.x = newFormat(locale_date, formats);\n formats.X = newFormat(locale_time, formats);\n formats.c = newFormat(locale_dateTime, formats);\n utcFormats.x = newFormat(locale_date, utcFormats);\n utcFormats.X = newFormat(locale_time, utcFormats);\n utcFormats.c = newFormat(locale_dateTime, utcFormats);\n\n function newFormat(specifier, formats) {\n return function(date) {\n var string = [],\n i = -1,\n j = 0,\n n = specifier.length,\n c,\n pad,\n format;\n\n if (!(date instanceof Date)) date = new Date(+date);\n\n while (++i < n) {\n if (specifier.charCodeAt(i) === 37) {\n string.push(specifier.slice(j, i));\n if ((pad = pads[c = specifier.charAt(++i)]) != null) c = specifier.charAt(++i);\n else pad = c === \"e\" ? \" \" : \"0\";\n if (format = formats[c]) c = format(date, pad);\n string.push(c);\n j = i + 1;\n }\n }\n\n string.push(specifier.slice(j, i));\n return string.join(\"\");\n };\n }\n\n function newParse(specifier, Z) {\n return function(string) {\n var d = newDate(1900, undefined, 1),\n i = parseSpecifier(d, specifier, string += \"\", 0),\n week, day;\n if (i != string.length) return null;\n\n // If a UNIX timestamp is specified, return it.\n if (\"Q\" in d) return new Date(d.Q);\n if (\"s\" in d) return new Date(d.s * 1000 + (\"L\" in d ? d.L : 0));\n\n // If this is utcParse, never use the local timezone.\n if (Z && !(\"Z\" in d)) d.Z = 0;\n\n // The am-pm flag is 0 for AM, and 1 for PM.\n if (\"p\" in d) d.H = d.H % 12 + d.p * 12;\n\n // If the month was not specified, inherit from the quarter.\n if (d.m === undefined) d.m = \"q\" in d ? d.q : 0;\n\n // Convert day-of-week and week-of-year to day-of-year.\n if (\"V\" in d) {\n if (d.V < 1 || d.V > 53) return null;\n if (!(\"w\" in d)) d.w = 1;\n if (\"Z\" in d) {\n week = utcDate(newDate(d.y, 0, 1)), day = week.getUTCDay();\n week = day > 4 || day === 0 ? src[\"P\" /* utcMonday */].ceil(week) : Object(src[\"P\" /* utcMonday */])(week);\n week = src[\"F\" /* utcDay */].offset(week, (d.V - 1) * 7);\n d.y = week.getUTCFullYear();\n d.m = week.getUTCMonth();\n d.d = week.getUTCDate() + (d.w + 6) % 7;\n } else {\n week = localDate(newDate(d.y, 0, 1)), day = week.getDay();\n week = day > 4 || day === 0 ? src[\"l\" /* timeMonday */].ceil(week) : Object(src[\"l\" /* timeMonday */])(week);\n week = src[\"a\" /* timeDay */].offset(week, (d.V - 1) * 7);\n d.y = week.getFullYear();\n d.m = week.getMonth();\n d.d = week.getDate() + (d.w + 6) % 7;\n }\n } else if (\"W\" in d || \"U\" in d) {\n if (!(\"w\" in d)) d.w = \"u\" in d ? d.u % 7 : \"W\" in d ? 1 : 0;\n day = \"Z\" in d ? utcDate(newDate(d.y, 0, 1)).getUTCDay() : localDate(newDate(d.y, 0, 1)).getDay();\n d.m = 0;\n d.d = \"W\" in d ? (d.w + 6) % 7 + d.W * 7 - (day + 5) % 7 : d.w + d.U * 7 - (day + 6) % 7;\n }\n\n // If a time zone is specified, all fields are interpreted as UTC and then\n // offset according to the specified time zone.\n if (\"Z\" in d) {\n d.H += d.Z / 100 | 0;\n d.M += d.Z % 100;\n return utcDate(d);\n }\n\n // Otherwise, all fields are in local time.\n return localDate(d);\n };\n }\n\n function parseSpecifier(d, specifier, string, j) {\n var i = 0,\n n = specifier.length,\n m = string.length,\n c,\n parse;\n\n while (i < n) {\n if (j >= m) return -1;\n c = specifier.charCodeAt(i++);\n if (c === 37) {\n c = specifier.charAt(i++);\n parse = parses[c in pads ? specifier.charAt(i++) : c];\n if (!parse || ((j = parse(d, string, j)) < 0)) return -1;\n } else if (c != string.charCodeAt(j++)) {\n return -1;\n }\n }\n\n return j;\n }\n\n function parsePeriod(d, string, i) {\n var n = periodRe.exec(string.slice(i));\n return n ? (d.p = periodLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortWeekday(d, string, i) {\n var n = shortWeekdayRe.exec(string.slice(i));\n return n ? (d.w = shortWeekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseWeekday(d, string, i) {\n var n = weekdayRe.exec(string.slice(i));\n return n ? (d.w = weekdayLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseShortMonth(d, string, i) {\n var n = shortMonthRe.exec(string.slice(i));\n return n ? (d.m = shortMonthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseMonth(d, string, i) {\n var n = monthRe.exec(string.slice(i));\n return n ? (d.m = monthLookup[n[0].toLowerCase()], i + n[0].length) : -1;\n }\n\n function parseLocaleDateTime(d, string, i) {\n return parseSpecifier(d, locale_dateTime, string, i);\n }\n\n function parseLocaleDate(d, string, i) {\n return parseSpecifier(d, locale_date, string, i);\n }\n\n function parseLocaleTime(d, string, i) {\n return parseSpecifier(d, locale_time, string, i);\n }\n\n function formatShortWeekday(d) {\n return locale_shortWeekdays[d.getDay()];\n }\n\n function formatWeekday(d) {\n return locale_weekdays[d.getDay()];\n }\n\n function formatShortMonth(d) {\n return locale_shortMonths[d.getMonth()];\n }\n\n function formatMonth(d) {\n return locale_months[d.getMonth()];\n }\n\n function formatPeriod(d) {\n return locale_periods[+(d.getHours() >= 12)];\n }\n\n function formatQuarter(d) {\n return 1 + ~~(d.getMonth() / 3);\n }\n\n function formatUTCShortWeekday(d) {\n return locale_shortWeekdays[d.getUTCDay()];\n }\n\n function formatUTCWeekday(d) {\n return locale_weekdays[d.getUTCDay()];\n }\n\n function formatUTCShortMonth(d) {\n return locale_shortMonths[d.getUTCMonth()];\n }\n\n function formatUTCMonth(d) {\n return locale_months[d.getUTCMonth()];\n }\n\n function formatUTCPeriod(d) {\n return locale_periods[+(d.getUTCHours() >= 12)];\n }\n\n function formatUTCQuarter(d) {\n return 1 + ~~(d.getUTCMonth() / 3);\n }\n\n return {\n format: function(specifier) {\n var f = newFormat(specifier += \"\", formats);\n f.toString = function() { return specifier; };\n return f;\n },\n parse: function(specifier) {\n var p = newParse(specifier += \"\", false);\n p.toString = function() { return specifier; };\n return p;\n },\n utcFormat: function(specifier) {\n var f = newFormat(specifier += \"\", utcFormats);\n f.toString = function() { return specifier; };\n return f;\n },\n utcParse: function(specifier) {\n var p = newParse(specifier += \"\", true);\n p.toString = function() { return specifier; };\n return p;\n }\n };\n}\n\nvar pads = {\"-\": \"\", \"_\": \" \", \"0\": \"0\"},\n numberRe = /^\\s*\\d+/, // note: ignores next directive\n percentRe = /^%/,\n requoteRe = /[\\\\^$*+?|[\\]().{}]/g;\n\nfunction pad(value, fill, width) {\n var sign = value < 0 ? \"-\" : \"\",\n string = (sign ? -value : value) + \"\",\n length = string.length;\n return sign + (length < width ? new Array(width - length + 1).join(fill) + string : string);\n}\n\nfunction requote(s) {\n return s.replace(requoteRe, \"\\\\$&\");\n}\n\nfunction formatRe(names) {\n return new RegExp(\"^(?:\" + names.map(requote).join(\"|\") + \")\", \"i\");\n}\n\nfunction formatLookup(names) {\n var map = {}, i = -1, n = names.length;\n while (++i < n) map[names[i].toLowerCase()] = i;\n return map;\n}\n\nfunction parseWeekdayNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.w = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekdayNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.u = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberSunday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.U = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberISO(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.V = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseWeekNumberMonday(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.W = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseFullYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 4));\n return n ? (d.y = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.y = +n[0] + (+n[0] > 68 ? 1900 : 2000), i + n[0].length) : -1;\n}\n\nfunction parseZone(d, string, i) {\n var n = /^(Z)|([+-]\\d\\d)(?::?(\\d\\d))?/.exec(string.slice(i, i + 6));\n return n ? (d.Z = n[1] ? 0 : -(n[2] + (n[3] || \"00\")), i + n[0].length) : -1;\n}\n\nfunction parseQuarter(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 1));\n return n ? (d.q = n[0] * 3 - 3, i + n[0].length) : -1;\n}\n\nfunction parseMonthNumber(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.m = n[0] - 1, i + n[0].length) : -1;\n}\n\nfunction parseDayOfMonth(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseDayOfYear(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.m = 0, d.d = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseHour24(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.H = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMinutes(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.M = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 2));\n return n ? (d.S = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMilliseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 3));\n return n ? (d.L = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseMicroseconds(d, string, i) {\n var n = numberRe.exec(string.slice(i, i + 6));\n return n ? (d.L = Math.floor(n[0] / 1000), i + n[0].length) : -1;\n}\n\nfunction parseLiteralPercent(d, string, i) {\n var n = percentRe.exec(string.slice(i, i + 1));\n return n ? i + n[0].length : -1;\n}\n\nfunction parseUnixTimestamp(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.Q = +n[0], i + n[0].length) : -1;\n}\n\nfunction parseUnixTimestampSeconds(d, string, i) {\n var n = numberRe.exec(string.slice(i));\n return n ? (d.s = +n[0], i + n[0].length) : -1;\n}\n\nfunction formatDayOfMonth(d, p) {\n return pad(d.getDate(), p, 2);\n}\n\nfunction formatHour24(d, p) {\n return pad(d.getHours(), p, 2);\n}\n\nfunction formatHour12(d, p) {\n return pad(d.getHours() % 12 || 12, p, 2);\n}\n\nfunction formatDayOfYear(d, p) {\n return pad(1 + src[\"a\" /* timeDay */].count(Object(src[\"D\" /* timeYear */])(d), d), p, 3);\n}\n\nfunction formatMilliseconds(d, p) {\n return pad(d.getMilliseconds(), p, 3);\n}\n\nfunction formatMicroseconds(d, p) {\n return formatMilliseconds(d, p) + \"000\";\n}\n\nfunction formatMonthNumber(d, p) {\n return pad(d.getMonth() + 1, p, 2);\n}\n\nfunction formatMinutes(d, p) {\n return pad(d.getMinutes(), p, 2);\n}\n\nfunction formatSeconds(d, p) {\n return pad(d.getSeconds(), p, 2);\n}\n\nfunction formatWeekdayNumberMonday(d) {\n var day = d.getDay();\n return day === 0 ? 7 : day;\n}\n\nfunction formatWeekNumberSunday(d, p) {\n return pad(src[\"t\" /* timeSunday */].count(Object(src[\"D\" /* timeYear */])(d) - 1, d), p, 2);\n}\n\nfunction dISO(d) {\n var day = d.getDay();\n return (day >= 4 || day === 0) ? Object(src[\"v\" /* timeThursday */])(d) : src[\"v\" /* timeThursday */].ceil(d);\n}\n\nfunction formatWeekNumberISO(d, p) {\n d = dISO(d);\n return pad(src[\"v\" /* timeThursday */].count(Object(src[\"D\" /* timeYear */])(d), d) + (Object(src[\"D\" /* timeYear */])(d).getDay() === 4), p, 2);\n}\n\nfunction formatWeekdayNumberSunday(d) {\n return d.getDay();\n}\n\nfunction formatWeekNumberMonday(d, p) {\n return pad(src[\"l\" /* timeMonday */].count(Object(src[\"D\" /* timeYear */])(d) - 1, d), p, 2);\n}\n\nfunction formatYear(d, p) {\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatYearISO(d, p) {\n d = dISO(d);\n return pad(d.getFullYear() % 100, p, 2);\n}\n\nfunction formatFullYear(d, p) {\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatFullYearISO(d, p) {\n var day = d.getDay();\n d = (day >= 4 || day === 0) ? Object(src[\"v\" /* timeThursday */])(d) : src[\"v\" /* timeThursday */].ceil(d);\n return pad(d.getFullYear() % 10000, p, 4);\n}\n\nfunction formatZone(d) {\n var z = d.getTimezoneOffset();\n return (z > 0 ? \"-\" : (z *= -1, \"+\"))\n + pad(z / 60 | 0, \"0\", 2)\n + pad(z % 60, \"0\", 2);\n}\n\nfunction formatUTCDayOfMonth(d, p) {\n return pad(d.getUTCDate(), p, 2);\n}\n\nfunction formatUTCHour24(d, p) {\n return pad(d.getUTCHours(), p, 2);\n}\n\nfunction formatUTCHour12(d, p) {\n return pad(d.getUTCHours() % 12 || 12, p, 2);\n}\n\nfunction formatUTCDayOfYear(d, p) {\n return pad(1 + src[\"F\" /* utcDay */].count(Object(src[\"_7\" /* utcYear */])(d), d), p, 3);\n}\n\nfunction formatUTCMilliseconds(d, p) {\n return pad(d.getUTCMilliseconds(), p, 3);\n}\n\nfunction formatUTCMicroseconds(d, p) {\n return formatUTCMilliseconds(d, p) + \"000\";\n}\n\nfunction formatUTCMonthNumber(d, p) {\n return pad(d.getUTCMonth() + 1, p, 2);\n}\n\nfunction formatUTCMinutes(d, p) {\n return pad(d.getUTCMinutes(), p, 2);\n}\n\nfunction formatUTCSeconds(d, p) {\n return pad(d.getUTCSeconds(), p, 2);\n}\n\nfunction formatUTCWeekdayNumberMonday(d) {\n var dow = d.getUTCDay();\n return dow === 0 ? 7 : dow;\n}\n\nfunction formatUTCWeekNumberSunday(d, p) {\n return pad(src[\"X\" /* utcSunday */].count(Object(src[\"_7\" /* utcYear */])(d) - 1, d), p, 2);\n}\n\nfunction UTCdISO(d) {\n var day = d.getUTCDay();\n return (day >= 4 || day === 0) ? Object(src[\"Z\" /* utcThursday */])(d) : src[\"Z\" /* utcThursday */].ceil(d);\n}\n\nfunction formatUTCWeekNumberISO(d, p) {\n d = UTCdISO(d);\n return pad(src[\"Z\" /* utcThursday */].count(Object(src[\"_7\" /* utcYear */])(d), d) + (Object(src[\"_7\" /* utcYear */])(d).getUTCDay() === 4), p, 2);\n}\n\nfunction formatUTCWeekdayNumberSunday(d) {\n return d.getUTCDay();\n}\n\nfunction formatUTCWeekNumberMonday(d, p) {\n return pad(src[\"P\" /* utcMonday */].count(Object(src[\"_7\" /* utcYear */])(d) - 1, d), p, 2);\n}\n\nfunction formatUTCYear(d, p) {\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCYearISO(d, p) {\n d = UTCdISO(d);\n return pad(d.getUTCFullYear() % 100, p, 2);\n}\n\nfunction formatUTCFullYear(d, p) {\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCFullYearISO(d, p) {\n var day = d.getUTCDay();\n d = (day >= 4 || day === 0) ? Object(src[\"Z\" /* utcThursday */])(d) : src[\"Z\" /* utcThursday */].ceil(d);\n return pad(d.getUTCFullYear() % 10000, p, 4);\n}\n\nfunction formatUTCZone() {\n return \"+0000\";\n}\n\nfunction formatLiteralPercent() {\n return \"%\";\n}\n\nfunction formatUnixTimestamp(d) {\n return +d;\n}\n\nfunction formatUnixTimestampSeconds(d) {\n return Math.floor(+d / 1000);\n}\n\n// CONCATENATED MODULE: ./node_modules/d3-time-format/src/defaultLocale.js\n\n\nvar defaultLocale_locale;\nvar timeFormat;\nvar timeParse;\nvar utcFormat;\nvar utcParse;\n\ndefaultLocale({\n dateTime: \"%x, %X\",\n date: \"%-m/%-d/%Y\",\n time: \"%-I:%M:%S %p\",\n periods: [\"AM\", \"PM\"],\n days: [\"Sunday\", \"Monday\", \"Tuesday\", \"Wednesday\", \"Thursday\", \"Friday\", \"Saturday\"],\n shortDays: [\"Sun\", \"Mon\", \"Tue\", \"Wed\", \"Thu\", \"Fri\", \"Sat\"],\n months: [\"January\", \"February\", \"March\", \"April\", \"May\", \"June\", \"July\", \"August\", \"September\", \"October\", \"November\", \"December\"],\n shortMonths: [\"Jan\", \"Feb\", \"Mar\", \"Apr\", \"May\", \"Jun\", \"Jul\", \"Aug\", \"Sep\", \"Oct\", \"Nov\", \"Dec\"]\n});\n\nfunction defaultLocale(definition) {\n defaultLocale_locale = formatLocale(definition);\n timeFormat = defaultLocale_locale.format;\n timeParse = defaultLocale_locale.parse;\n utcFormat = defaultLocale_locale.utcFormat;\n utcParse = defaultLocale_locale.utcParse;\n return defaultLocale_locale;\n}\n\n// CONCATENATED MODULE: ./node_modules/d3-time-format/src/isoFormat.js\n\n\nvar isoSpecifier = \"%Y-%m-%dT%H:%M:%S.%LZ\";\n\nfunction formatIsoNative(date) {\n return date.toISOString();\n}\n\nvar formatIso = Date.prototype.toISOString\n ? formatIsoNative\n : utcFormat(isoSpecifier);\n\n/* harmony default export */ var isoFormat = (formatIso);\n\n// CONCATENATED MODULE: ./node_modules/d3-time-format/src/isoParse.js\n\n\n\nfunction parseIsoNative(string) {\n var date = new Date(string);\n return isNaN(date) ? null : date;\n}\n\nvar parseIso = +new Date(\"2000-01-01T00:00:00.000Z\")\n ? parseIsoNative\n : utcParse(isoSpecifier);\n\n/* harmony default export */ var isoParse = (parseIso);\n\n// CONCATENATED MODULE: ./node_modules/d3-time-format/src/index.js\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"d\", function() { return defaultLocale; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"c\", function() { return timeFormat; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"f\", function() { return timeParse; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"g\", function() { return utcFormat; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"h\", function() { return utcParse; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"e\", function() { return formatLocale; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"a\", function() { return isoFormat; });\n/* concated harmony reexport */__webpack_require__.d(__webpack_exports__, \"b\", function() { return isoParse; });\n\n\n\n\n\n\n/***/ }),\n/* 234 */\n/***/ (function(module, exports, __webpack_require__) {\n\n\"use strict\";\n\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };\n return function (d, b) {\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n};\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = y[op[0] & 2 ? \"return\" : op[0] ? \"throw\" : \"next\"]) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [0, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar QuickviewEvents_1 = __webpack_require__(227);\nvar Assert_1 = __webpack_require__(5);\nvar Dom_1 = __webpack_require__(1);\nvar Utils_1 = __webpack_require__(4);\nvar Component_1 = __webpack_require__(7);\nvar ComponentOptions_1 = __webpack_require__(8);\nvar Initialization_1 = __webpack_require__(2);\nvar QuickviewDocumentIframe_1 = __webpack_require__(644);\nvar QuickviewDocumentHeader_1 = __webpack_require__(645);\nvar QuickviewDocumentWords_1 = __webpack_require__(646);\nvar underscore_1 = __webpack_require__(0);\nvar QuickviewDocumentWordButton_1 = __webpack_require__(649);\nvar QuickviewDocumentPreviewBar_1 = __webpack_require__(650);\nexports.HIGHLIGHT_PREFIX = 'CoveoHighlight';\n/**\n * The `QuickviewDocument` component normally exists within a [`Quickview`]{@link Quickview} component. The sole purpose\n * of this component is to add an `