coveo-search-ui
Version:
Coveo JavaScript Search Framework
2 lines • 243 kB
JavaScript
webpackJsonpCoveo__temporary([6,1,3,7,19],{118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=n(93),s=n(1),r=n(0),a=n(9),l=function(){function e(){}return e.hideIfInfiniteScrollEnabled=function(t){e.isInfiniteScrollEnabled(t.searchInterface.element)?(t.disable(),s.$$(t.element).hide(),e.warnIfComponentNotNeeded(t)):(t.enable(),s.$$(t.element).unhide())},e.isInfiniteScrollEnabled=function(t){var n=e.getMainResultList(t);return!!n&&!!n.options.enableInfiniteScroll},e.scrollToTop=function(t){var n=e.getMainResultList(t);if(!n)return new a.Logger(this).warn("No active ResultList, scrolling to the top of the Window"),window.scrollTo(0,0);var i=n.searchInterface.element.getBoundingClientRect().top;i>0||window.scrollTo(0,window.pageYOffset+i)},e.getMainResultList=function(t){var n=e.getResultLists(t);return r.find(n,function(e){var t=e.searchInterface.element.classList.contains("CoveoRecommendation");return!e.disabled&&!t})},e.getResultLists=function(t){return s.$$(t).findAll("."+e.cssClass()).map(function(e){return i.Component.get(e,o.ResultList)})},e.cssClass=function(){return i.Component.computeCssClassName(o.ResultList)},e.warnIfComponentNotNeeded=function(t){var n=t.searchInterface.root;e.allResultListsUseInfiniteScroll(n)&&e.notNeededComponentWarning(t)},e.allResultListsUseInfiniteScroll=function(t){return 0===e.getResultLists(t).filter(function(e){return!e.options.enableInfiniteScroll}).length},e.notNeededComponentWarning=function(t){var n=i.Component.computeCssClassNameForType(t.type),o="The "+n+" component is not needed because all "+e.cssClass()+" components have enableInfiniteScroll set to 'true'.\n For the best performance, remove the "+n+" component from your search page.";new a.Logger(t).warn(o)},e}();t.ResultListUtils=l},119:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=n(4),s=n(23),r=n(0),a=function(){function e(){this.selected=!1,this.excluded=!1,this.waitingForDelta=!1}return e.prototype.reset=function(){this.selected=!1,this.excluded=!1},e.prototype.updateCountsFromNewValue=function(e){i.Assert.exists(e),this.occurrences=e.occurrences,this.delta=e.delta,this.computedField=e.computedField},e.prototype.clone=function(){return this.computedField=void 0,this.delta=void 0,this},e.prototype.cloneWithZeroOccurrences=function(){return this.occurrences=0,this.clone()},e.prototype.cloneWithDelta=function(e,t){i.Assert.isLargerOrEqualsThan(0,e);var n=this.cloneWithZeroOccurrences();return n.delta=t,n.occurrences=e,n},e.prototype.getFormattedCount=function(){var e=void 0;return o.Utils.exists(this.delta)&&this.delta>0?e="+"+s.format(this.delta,"n0"):this.occurrences>0&&(e=s.format(this.occurrences,"n0")),e},e.prototype.getFormattedComputedField=function(e){return 0!=this.computedField?s.format(this.computedField,e):void 0},e.create=function(t){if(r.isString(t))return e.createFromValue(t);if(r.isObject(t))return"computedFieldResults"in t?e.createFromGroupByValue(t):e.createFromFieldValue(t);throw new Error("Can't create value from "+t)},e.createFromValue=function(t){i.Assert.isNonEmptyString(t);var n=new e;return n.value=t,n.lookupValue=t,n},e.createFromGroupByValue=function(t){i.Assert.exists(t),i.Assert.exists(t);var n=new e;return n.value=t.value,n.lookupValue=o.Utils.exists(t.lookupValue)?t.lookupValue:t.value,n.occurrences=t.numberOfResults,n.computedField=o.Utils.isNonEmptyArray(t.computedFieldResults)?t.computedFieldResults[0]:void 0,n.score=t.score,n},e.createFromFieldValue=function(t){i.Assert.exists(t);var n=new e;return n.value=t.value,n.lookupValue=t.lookupValue,n.occurrences=t.numberOfResults,n},e}();t.FacetValue=a},131:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(94),o=function(){function e(){}return e.shouldDrawFacetSlider=function(e,t){return i.ResponsiveDropdownContent.isTargetInsideOpenedDropdown(t)||!this.isSmallFacetActivated(e)},e.isSmallTabsActivated=function(e){return e.hasClass(this.smallTabsClassName)},e.isSmallFacetActivated=function(e){return e.hasClass(this.smallFacetClassName)},e.isSmallRecommendationActivated=function(e){return e.hasClass(this.smallRecommendationClassName)},e.activateSmallTabs=function(e){e.addClass(this.smallTabsClassName)},e.deactivateSmallTabs=function(e){e.removeClass(this.smallTabsClassName)},e.activateSmallFacet=function(e){e.addClass(this.smallFacetClassName)},e.deactivateSmallFacet=function(e){e.removeClass(this.smallFacetClassName)},e.activateSmallRecommendation=function(e){e.addClass(this.smallRecommendationClassName)},e.deactivateSmallRecommendation=function(e){e.removeClass(this.smallRecommendationClassName)},e.smallTabsClassName="coveo-small-tabs",e.smallFacetClassName="coveo-small-facets",e.smallRecommendationClassName="coveo-small-recommendation",e}();t.ResponsiveComponentsUtils=o},132:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(477),s=function(e){function t(t,n,i){var o=e.call(this,t,n)||this;return o.facet=t,o.facetValue=n,o.keepDisplayedValueNextTime=i,o}return i(t,e),t.prototype.bindEvent=function(){e.prototype.bindEvent.call(this,{displayNextTime:this.keepDisplayedValueNextTime,pinFacet:this.facet.options.preservePosition})},t}(o.ValueElement);t.FacetValueElement=s},173:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(4),o=n(40),s=n(49),r=n(1),a=n(0),l=n(476),c=function(){function e(e){this.facet=e,this.valueToSearch="",this.alwaysInclude=[],this.alwaysExclude=[],this.sortCriteria="occurrences",this.fetchMore=!1,this.completeFacetWithStandardValues=!0,this.nbResults=e.options.numberOfValuesInFacetSearch,this.ignoreAccents=e.options.facetSearchIgnoreAccents}return e.prototype.setValueToSearch=function(e){return this.valueToSearch=e,i.Utils.isNonEmptyString(e)&&(this.valueToSearch=this.valueToSearch.trim(),this.alwaysInclude=this.alwaysInclude.concat(o.FacetUtils.getValuesToUseForSearchInFacet(this.valueToSearch,this.facet))),this},e.prototype.excludeCurrentlyDisplayedValuesInSearch=function(e){var t=this;a.each(this.getCurrentlyShowedValueInSearch(e),function(e){var n=o.FacetUtils.getValuesToUseForSearchInFacet(e,t.facet);a.each(n,function(e){t.alwaysExclude.push(e)})}),a.each(this.facet.getDisplayedFacetValues(),function(e){t.alwaysExclude.push(e.value)})},e.prototype.getGroupByRequest=function(){this.lowerCaseAll();var e=this.nbResults;e+=this.alwaysExclude.length;var t=[];this.valueToSearch&&(t=["*"+this.valueToSearch+"*"]);var n;n=this.valueToSearch?t.concat(this.alwaysInclude).concat(this.alwaysExclude):a.compact(t.concat(this.alwaysInclude).concat(this.facet.options.allowedValues));var i=this.completeFacetWithStandardValues;null!=this.facet.options.lookupField&&(i=!1);var o={allowedValues:n,allowedValuesPatternType:this.facet.options.useWildcardsInFacetSearch?l.AllowedValuesPatternType.Wildcards:l.AllowedValuesPatternType.Legacy,maximumNumberOfValues:e,completeFacetWithStandardValues:i,field:this.facet.options.field,sortCriteria:this.facet.options.sortCriteria||this.sortCriteria,injectionDepth:this.facet.options.injectionDepth};return this.facet.options.lookupField&&(o.lookupField=this.facet.options.lookupField),this.facet.options.computedField&&(o.computedFields=[{field:this.facet.options.computedField,operation:this.facet.options.computedFieldOperation}]),o},e.prototype.getQuery=function(){var e=a.clone(this.facet.queryController.getLastQuery());return e||(e=(new s.QueryBuilder).build()),e.enableQuerySyntax?e.q=this.facet.facetQueryController.basicExpressionToUseForFacetSearch:i.Utils.isNonEmptyString(this.facet.facetQueryController.basicExpressionToUseForFacetSearch)?e.q="<@- "+this.facet.facetQueryController.basicExpressionToUseForFacetSearch+" -@>":e.q="",e.enableQuerySyntax=!0,e.cq=this.facet.facetQueryController.constantExpressionToUseForFacetSearch,e.aq=this.facet.facetQueryController.advancedExpressionToUseForFacetSearch,e.enableDidYouMean=!1,e.firstResult=0,e.numberOfResults=0,e.fieldsToInclude=[],e.groupBy=[this.getGroupByRequest()],e},e.prototype.getCurrentlyShowedValueInSearch=function(e){return a.map(r.$$(e).findAll(".coveo-facet-value-caption"),function(e){return r.$$(e).getAttribute("data-original-value")||r.$$(e).text()})},e.prototype.lowerCaseAll=function(){this.alwaysExclude=a.chain(this.alwaysExclude).map(function(e){return e.toLowerCase()}).uniq().value(),this.alwaysInclude=a.chain(this.alwaysInclude).map(function(e){return e.toLowerCase()}).uniq().value()},e}();t.FacetSearchParameters=c},174:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(20),s=n(47),r=n(1),a=n(17),l=function(){function e(e){var t=this;this.facet=e,r.$$(this.facet.ref.searchInterface.element).on(o.QueryEvents.buildingQuery,function(){return t.handleBuildingQuery()}),this.getDependsOn(this.facet.ref)&&this.facet.ref.bind.onRootElement(a.InitializationEvents.afterComponentsInitialization,function(){return t.setupDependentFacet()})}return e.prototype.setupDependentFacet=function(){var e=this;r.$$(this.facet.ref.element).addClass("coveo-hidden-dependant-facet"),this.parentFacetRef=this.getParentFacet(this.facet.ref),this.parentFacetRef&&r.$$(this.facet.ref.root).on("state:change",function(){return e.resetIfConditionUnfullfiled()})},e.prototype.resetIfConditionUnfullfiled=function(){this.getDependsOnCondition(this.facet.ref)(this.parentFacetRef)||this.facet.reset()},e.prototype.getId=function(e){var t=e.options.id;return t?""+t:null},e.prototype.getDependsOn=function(e){var t=e.options.dependsOn;return t?""+t:null},e.prototype.getDependsOnCondition=function(e){var t=this,n=e.options.dependsOnCondition;return n&&i.isFunction(n)?n:function(){return t.parentHasSelectedValues(e)&&t.parentIsEnabled(e)}},e.prototype.parentHasSelectedValues=function(e){var t=this.getParentFacet(e);return t&&this.valuesExistForFacetWithId(this.getId(t))},e.prototype.parentIsEnabled=function(e){var t=this.getParentFacet(e);return t&&!t.disabled},e.prototype.valuesExistForFacetWithId=function(e){var t=this.facet.ref.queryStateModel.get(o.QueryStateModel.getFacetId(e));return!!t&&!!t.length},Object.defineProperty(e.prototype,"allFacetsInInterface",{get:function(){return s.ComponentsTypes.getAllFacetsFromSearchInterface(this.facet.ref.searchInterface)},enumerable:!0,configurable:!0}),e.prototype.getParentFacet=function(e){var t=this,n=this.allFacetsInInterface.filter(function(n){return t.getId(n)===t.getDependsOn(e)});return n.length?n[0]:(e.logger.warn("DependsOn reference does not exist",this.getDependsOn(this.facet.ref)),null)},Object.defineProperty(e.prototype,"dependentFacets",{get:function(){var e=this;return this.allFacetsInInterface.filter(function(t){return e.getId(e.facet.ref)===e.getDependsOn(t)})},enumerable:!0,configurable:!0}),e.prototype.handleBuildingQuery=function(){var e=this;this.dependentFacets.forEach(function(t){if(e.getDependsOnCondition(t)(e.facet.ref))return r.$$(t.element).removeClass("coveo-hidden-dependant-facet"),t.enable();t.disable(),r.$$(t.element).addClass("coveo-hidden-dependant-facet")})},Object.defineProperty(e.prototype,"hasDependentFacets",{get:function(){return!!this.dependentFacets.length},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"dependentFacetsHaveSelectedValues",{get:function(){var e=this;return this.dependentFacets.some(function(t){return e.valuesExistForFacetWithId(e.getId(t))})},enumerable:!0,configurable:!0}),e}();t.DependsOnManager=l},175:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(216),s=n(70),r=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.init=function(e,n,i){o.ResponsiveFacetColumn.init(t,e,n,i,s.Facet.ID)},t}(o.ResponsiveFacetColumn);t.ResponsiveFacets=r},190:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var s=n(70),r=n(8),a=n(122),l=n(573),c=n(2),u=n(23),h=n(3),p=n(85),d=n(175),f=n(0),m=function(e){function t(n,i,o){var s=e.call(this,n,r.ComponentOptions.initComponentOptions(n,t,i),o,t.ID)||this;return s.element=n,s.isFieldValueCompatible=!1,s.options.enableFacetSearch=!1,s.options.enableSettings=!1,s.options.includeInOmnibox=!1,s.options.enableMoreLess=!1,d.ResponsiveFacets.init(s.root,s,s.options),s}return i(t,e),t.prototype.getValueCaption=function(t){return this.options.valueCaption||this.isLabelSpecifiedForValue(t)?e.prototype.getValueCaption.call(this,t):this.translateValuesFromFormat(t)},t.prototype.isLabelSpecifiedForValue=function(e){return this.options.ranges&&!!f.find(this.options.ranges,function(t){return!f.isUndefined(t.label)&&t.label===e.lookupValue})},t.prototype.initFacetQueryController=function(){this.facetQueryController=new l.FacetRangeQueryController(this)},t.prototype.processNewGroupByResults=function(t){var n=this;null!=t&&null==this.options.ranges&&t.values.sort(function(e,t){return n.sortRangeGroupByResults(e.value,t.value)}),e.prototype.processNewGroupByResults.call(this,t)},t.prototype.sortRangeGroupByResults=function(e,t){var n,i,o=this.extractStartAndEndValue(e),s=this.extractStartAndEndValue(t);return n=o?o.start:e,i=s?s.start:t,this.options.dateField?Date.parse(n)-Date.parse(i):Number(n)-Number(i)},t.prototype.translateValuesFromFormat=function(e){var t=this.extractStartAndEndValue(e.lookupValue||e.value);return t?this.formatValue(t.start)+" - "+this.formatValue(t.end):null},t.prototype.extractStartAndEndValue=function(e){var t=/^(.*)\.\.(.*)$/.exec(e);return null==t?null:{start:t[1],end:t[2]}},t.prototype.formatValue=function(e){var t=!!e.match(/^[\+\-]?[0-9]+(\.[0-9]+)?$/);return this.options.dateField||!t?this.formatDateValue(e):this.formatNumberValue(Number(e))},t.prototype.formatDateValue=function(e){return a.TemplateHelpers.getHelper("dateTime")(e,{alwaysIncludeTime:!1,includeTimeIfThisWeek:!1,includeTimeIfToday:!1,omitYearIfCurrentOne:!1,useTodayYesterdayAndTomorrow:!1,useWeekdayIfThisWeek:!1})},t.prototype.formatNumberValue=function(e){return u.format(e,this.options.valueFormat)},t.ID="FacetRange",t.parent=s.Facet,t.doExport=function(){h.exportGlobally({FacetRange:t})},t.options=o({dateField:r.ComponentOptions.buildBooleanOption({defaultValue:!1}),ranges:r.ComponentOptions.buildJsonOption(),valueFormat:r.ComponentOptions.buildStringOption({defaultValue:"n0"})},p.ResponsiveFacetOptions),t}(s.Facet);t.FacetRange=m,c.Initialization.registerAutoCreateComponent(m)},215:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),o=n(0),s=function(){function e(e,t){this.resultListOptions=e,this.autoCreateComponentsFn=t}return e.prototype.renderResults=function(e,t,n){var s=this;return void 0===t&&(t=!1),Promise.all([this.getStartFragment(e,t),this.getEndFragment(e,t)]).then(function(t){var r=t[0],a=t[1],l=document.createDocumentFragment();r&&l.appendChild(r),o.each(e,function(e){l.appendChild(e),n(i.Component.getResult(e),e)}),a&&l.appendChild(a),s.resultListOptions.resultsContainer.appendChild(l)})},e.prototype.getStartFragment=function(e,t){return Promise.resolve(document.createDocumentFragment())},e.prototype.getEndFragment=function(e,t){return Promise.resolve(document.createDocumentFragment())},e}();t.ResultListRenderer=s},216:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(536);var i=n(11),o=n(9),s=n(6),r=n(1),a=n(4),l=n(7),c=n(19),u=n(55),h=n(62),p=n(131),d=n(124),f=n(94),m=n(136),y=n(0),g=n(47),v=n(537),b=n(86),S=n(538),C=function(){function e(e,t,n,i){this.coveoRoot=e,this.ID=t,this.componentsInFacetColumn=[],this.preservePositionOriginalValues=[],this.searchInterface=l.Component.get(this.coveoRoot.el,c.SearchInterface,!1),this.dropdownHeaderLabel=this.getDropdownHeaderLabel(),this.dropdown=this.buildDropdown(i),this.bindDropdownContentEvents(),this.bindFacetsMobileModeEvents(),this.registerOnCloseHandler(),this.registerQueryEvents(),this.initializeBreakpoint(n.responsiveBreakpoint)}return e.init=function(t,n,i,o,s){this.findColumn(n)&&(h.ResponsiveComponentsManager.register(e,r.$$(n),"ResponsiveFacetColumn",i,o),h.ResponsiveComponentsManager.register(t,r.$$(n),s,i,o))},e.findColumn=function(e){var t=r.$$(e).find(".coveo-facet-column");return t||this.logger.info("No element with class coveo-facet-column. Responsive facets cannot be enabled"),t},Object.defineProperty(e.prototype,"facetsMobileModeComponent",{get:function(){return this.searchInterface?this.searchInterface.getComponents(b.FacetsMobileMode.ID)[0]:null},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"facetsMobileModeOptions",{get:function(){var t=this.facetsMobileModeComponent;return t?t.options:(e.logger.warn('The "FacetsMobileMode" component did not load properly, disabling the ResponsiveFacets modal.'),{isModal:!1,preventScrolling:!1,displayOverlayWhileOpen:!0})},enumerable:!0,configurable:!0}),e.prototype.registerComponent=function(e){return this.componentsInFacetColumn.push(e),this.preservePositionOriginalValues.push(e.options.preservePosition),!0},e.prototype.needDropdownWrapper=function(){return this.needSmallMode()},e.prototype.handleResizeEvent=function(){this.needSmallMode()&&!p.ResponsiveComponentsUtils.isSmallFacetActivated(this.coveoRoot)?this.changeToSmallMode():!this.needSmallMode()&&p.ResponsiveComponentsUtils.isSmallFacetActivated(this.coveoRoot)&&this.changeToLargeMode(),this.dropdown.isOpened&&this.dropdown.dropdownContent.positionDropdown()},e.prototype.dismissFacetSearches=function(){y.each(this.componentsInFacetColumn,function(e){e.facetSearch&&e.facetSearch.currentlyDisplayedResults&&e.facetSearch.dismissSearchResults()})},e.prototype.needSmallMode=function(){if(!this.searchInterface)return this.coveoRoot.width()<=(a.Utils.isNullOrUndefined(this.breakpoint)?(new u.ResponsiveComponents).getMediumScreenWidth():this.breakpoint);switch(this.searchInterface.responsiveComponents.getResponsiveMode()){case"small":case"medium":return!0;case"auto":return this.coveoRoot.width()<=(a.Utils.isNullOrUndefined(this.breakpoint)?this.searchInterface.responsiveComponents.getMediumScreenWidth():this.breakpoint);default:return!1}},e.prototype.changeToSmallMode=function(){this.dropdown.close(),this.disableFacetPreservePosition(),r.$$(this.coveoRoot.find("."+h.ResponsiveComponentsManager.DROPDOWN_HEADER_WRAPPER_CSS_CLASS)).append(this.dropdown.dropdownHeader.element.el),p.ResponsiveComponentsUtils.activateSmallFacet(this.coveoRoot)},e.prototype.changeToLargeMode=function(){this.restoreFacetPreservePositionValue(),this.dropdown.cleanUp(),p.ResponsiveComponentsUtils.deactivateSmallFacet(this.coveoRoot)},e.prototype.buildDropdown=function(e){var t=this.buildDropdownContent(),n=this.buildDropdownHeader(),i=e||new d.ResponsiveDropdown(t,n,this.coveoRoot);return this.facetsMobileModeOptions.displayOverlayWhileOpen||i.disablePopupBackground(),this.facetsMobileModeOptions.preventScrolling&&i.enableScrollLocking(this.facetsMobileModeOptions.scrollContainer),i},e.prototype.buildDropdownContent=function(){var t=this,n=r.$$(this.coveoRoot.find(".coveo-facet-column")),i=r.$$("div",{className:"coveo-facet-header-filter-by-container",style:"display: none"}),o=r.$$("div",{className:"coveo-facet-header-filter-by"});return o.text(s.l("Filter by:")),i.append(o.el),n.prepend(i.el),this.facetsMobileModeOptions.isModal?new v.ResponsiveDropdownModalContent("facet",n,s.l("CloseFiltersDropdown"),function(){return t.dropdown.close()}):new f.ResponsiveDropdownContent("facet",n,this.coveoRoot,e.DROPDOWN_MIN_WIDTH,e.DROPDOWN_WIDTH_RATIO)},e.prototype.buildDropdownHeader=function(){var e=r.$$("a"),t=r.$$("p");return t.text(this.dropdownHeaderLabel),e.el.appendChild(t.el),new m.ResponsiveDropdownHeader("facet",e)},e.prototype.initializeBreakpoint=function(e){var t=this.facetsMobileModeOptions.breakpoint;this.breakpoint=a.Utils.isNullOrUndefined(t)?e:t},e.prototype.registerOnCloseHandler=function(){this.dropdown.registerOnCloseHandler(this.dismissFacetSearches,this)},e.prototype.registerQueryEvents=function(){var e=this;this.coveoRoot.on(i.QueryEvents.noResults,function(){return e.handleNoResults()}),this.coveoRoot.on(i.QueryEvents.querySuccess,function(t,n){return e.handleQuerySuccess(n)}),this.coveoRoot.on(i.QueryEvents.queryError,function(){return e.handleQueryError()})},e.prototype.bindDropdownContentEvents=function(){var t=this;this.dropdown.dropdownContent.element.on("scroll",y.debounce(function(){y.each(t.componentsInFacetColumn,function(e){var n=e.facetSearch;n&&n.currentlyDisplayedResults&&!t.isFacetSearchScrolledIntoView(n.search)?e.facetSearch.positionSearchResults(t.dropdown.dropdownContent.element.el):n&&e.facetSearch.currentlyDisplayedResults&&e.facetSearch.positionSearchResults()})},e.DEBOUNCE_SCROLL_WAIT))},e.prototype.bindFacetsMobileModeEvents=function(){var e=this.facetsMobileModeComponent;e&&(this.dropdown.registerOnOpenHandler(function(){return r.$$(e.element).trigger(S.FacetsMobileModeEvents.popupOpened)},e),this.dropdown.registerOnCloseHandler(function(){return r.$$(e.element).trigger(S.FacetsMobileModeEvents.popupClosed)},e))},e.prototype.restoreFacetPreservePositionValue=function(){var e=this;y.each(this.componentsInFacetColumn,function(t,n){t.options&&(t.options.preservePosition=e.preservePositionOriginalValues[n])})},e.prototype.disableFacetPreservePosition=function(){y.each(this.componentsInFacetColumn,function(e){e.options&&(e.options.preservePosition=!1)})},e.prototype.isFacetSearchScrolledIntoView=function(e){var t=e.getBoundingClientRect().top,n=e.getBoundingClientRect().bottom,i=this.dropdown.dropdownContent.element.el.getBoundingClientRect().top,o=this.dropdown.dropdownContent.element.el.getBoundingClientRect().bottom;return i=i>=0?i:0,t>=i&&n<=o},e.prototype.getDropdownHeaderLabel=function(){var t;return g.ComponentsTypes.getAllFacetInstancesFromElement(this.coveoRoot.find(".coveo-facet-column")).forEach(function(e){var n=e.options;!t&&n.dropdownHeaderLabel&&(t=n.dropdownHeaderLabel)}),t||(t=s.l(e.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE)),t},e.prototype.handleNoResults=function(){this.dropdown.dropdownHeader.hide()},e.prototype.handleQueryError=function(){this.dropdown.dropdownHeader.hide()},e.prototype.handleQuerySuccess=function(e){0===e.results.totalCount?this.dropdown.dropdownHeader.hide():this.dropdown.dropdownHeader.show()},e.DEBOUNCE_SCROLL_WAIT=250,e.logger=new o.Logger("ResponsiveFacets"),e.DROPDOWN_MIN_WIDTH=280,e.DROPDOWN_WIDTH_RATIO=.35,e.DROPDOWN_HEADER_LABEL_DEFAULT_VALUE="Filters",e}();t.ResponsiveFacetColumn=C},217:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(75),o=n(4),s=n(173),r=n(5),a=n(40),l=n(0),c=n(185),u=function(){function e(e,t){void 0===t&&(t=!0),this.facet=e,this.shouldEscapeValueInFieldExpression=t}return e.prototype.prepareForNewQuery=function(){this.lastGroupByRequestIndex=void 0,this.expressionToUseForFacetSearch=void 0,this.constantExpressionToUseForFacetSearch=void 0},e.prototype.computeOurFilterExpression=function(){var e=this,t=new i.ExpressionBuilder,n=this.facet.values.getSelected();n.length>0&&(this.facet.options.useAnd?l.each(n,function(n){t.addFieldExpression(e.facet.options.field,"==",[n.value],e.shouldEscapeValueInFieldExpression)}):t.addFieldExpression(this.facet.options.field,"==",l.map(n,function(e){return e.value}),this.shouldEscapeValueInFieldExpression));var s=this.facet.values.getExcluded();return s.length>0&&t.addFieldNotEqualExpression(this.facet.options.field,l.map(s,function(e){return e.value}),!0),o.Utils.isNonEmptyString(this.facet.options.additionalFilter)&&t.add(this.facet.options.additionalFilter),t.build()},e.prototype.putGroupByIntoQueryBuilder=function(e){r.Assert.exists(e);var t=this.createGroupByAllowedValues(),n=this.createBasicGroupByRequest(t),i=this.createGroupByQueryOverride(e);if(o.Utils.isNullOrUndefined(i)&&c.QueryBuilderExpression.isEmpty(i)){var s=e.computeCompleteExpressionParts();this.expressionToUseForFacetSearch=null==s.withoutConstant?"":s.withoutConstant,this.basicExpressionToUseForFacetSearch=null==s.basic?"":s.basic,this.advancedExpressionToUseForFacetSearch=s.advanced,this.constantExpressionToUseForFacetSearch=s.constant}else n.queryOverride=i.basic,n.advancedQueryOverride=i.advanced,n.constantQueryOverride=i.constant,this.expressionToUseForFacetSearch=i.withoutConstant,this.basicExpressionToUseForFacetSearch=i.basic,this.advancedExpressionToUseForFacetSearch=i.advanced,this.constantExpressionToUseForFacetSearch=i.constant;this.lastGroupByRequestIndex=e.groupByRequests.length,this.lastGroupByRequest=n,e.groupByRequests.push(n)},e.prototype.search=function(e,t){var n=this;return void 0===t&&(t=e.nbResults),e.completeFacetWithStandardValues=!1,new Promise(function(i,o){var s=function(o){var s=o.length;if(o=n.checkForFacetSearchValuesToRemove(o,e.valueToSearch),a.FacetUtils.needAnotherFacetSearch(o.length,s,t,5))return e.nbResults+=5,n.search(e,o.length);i(o)},r=n.facet.getEndpoint().search(e.getQuery());n.currentSearchPromise=r,r.then(function(t){if(n.currentSearchPromise==r){var i=[];t.groupByResults&&t.groupByResults[0]&&l.each(t.groupByResults[0].values,function(t){t.lookupValue?l.contains(e.alwaysExclude,t.lookupValue.toLowerCase())||i.push(t):l.contains(e.alwaysExclude,t.value.toLowerCase())||i.push(t)}),s(l.first(i,e.nbResults))}else o()}).catch(function(e){o(e)})})},e.prototype.fetchMore=function(e){var t=this,n=new s.FacetSearchParameters(this.facet);return n.alwaysInclude=this.facet.options.allowedValues||l.pluck(this.facet.values.getAll(),"value"),n.nbResults=e,this.facet.getEndpoint().search(n.getQuery()).then(function(e){return t.facet.options.allowedValues&&e&&e.groupByResults&&e.groupByResults[0]&&(e.groupByResults[0].values=t.filterByAllowedValueOption(e.groupByResults[0].values)),e})},e.prototype.searchInFacetToUpdateDelta=function(e){var t=new s.FacetSearchParameters(this.facet),n=t.getQuery();return n.aq=(n.aq?n.aq:"")+" "+this.computeOurFilterExpression(),l.each(e,function(e){e.waitingForDelta=!0}),n.groupBy=[this.createBasicGroupByRequest(l.map(e,function(e){return e.value}))],n.groupBy[0].completeFacetWithStandardValues=!1,this.facet.getEndpoint().search(n)},e.prototype.createGroupByAllowedValues=function(){return void 0!=this.facet.options.allowedValues?this.facet.options.allowedValues:void 0!=this.facet.options.customSort?this.getUnionWithCustomSortLowercase(this.facet.options.customSort,this.getAllowedValuesFromSelected()):l.map(this.getAllowedValuesFromSelected(),function(e){return e.value})},e.prototype.createBasicGroupByRequest=function(e,t){void 0===t&&(t=!0);var n=this.facet.numberOfValues;if(null!=this.facet.options.customSort){var i=this.getUnionWithCustomSortLowercase(this.facet.options.customSort,this.facet.values.getSelected().concat(this.facet.values.getExcluded()));n=Math.max(n,i.length)}var s={field:this.facet.options.field,maximumNumberOfValues:n+(this.facet.options.enableMoreLess?1:0),sortCriteria:this.facet.options.sortCriteria,injectionDepth:this.facet.options.injectionDepth,completeFacetWithStandardValues:void 0==this.facet.options.allowedValues};return this.facet.options.lookupField&&(s.lookupField=this.facet.options.lookupField),null!=e&&(s.allowedValues=e),t&&o.Utils.isNonEmptyString(this.facet.options.computedField)&&(s.computedFields=[{field:this.facet.options.computedField,operation:this.facet.options.computedFieldOperation}]),s},e.prototype.getAllowedValuesFromSelected=function(){var e=[];if(this.facet.options.useAnd||!this.facet.keepDisplayedValuesNextTime){if(0==this.facet.values.getSelected().length)return;e=this.facet.values.getSelected()}else e=this.facet.values.getAll();return e},Object.defineProperty(e.prototype,"additionalFilter",{get:function(){return this.facet.options.additionalFilter?this.facet.options.additionalFilter:""},enumerable:!0,configurable:!0}),e.prototype.getUnionWithCustomSortLowercase=function(e,t){var n=l.map(e,function(e){return e.toLowerCase()}),i=l.chain(t).filter(function(e){return!l.contains(n,e.value.toLowerCase())}).map(function(e){return e.value}).value();return l.compact(e.concat(i))},e.prototype.createGroupByQueryOverride=function(e){var t=e.computeCompleteExpressionParts();return this.queryOverrideIsNeededForMultiSelection()?t=this.processQueryOverrideForMultiSelection(e,t):t.reset(),this.queryOverrideIsNeededForAdditionalFilter()&&(t=this.processQueryOverrideForAdditionalFilter(e,t)),t=this.processQueryOverrideForEmptyValues(e,t),c.QueryBuilderExpression.isEmpty(t)?null:t},e.prototype.queryOverrideIsNeededForMultiSelection=function(){return!this.facet.options.useAnd&&!!this.facet.values.hasSelectedOrExcludedValues()},e.prototype.queryOverrideIsNeededForAdditionalFilter=function(){return o.Utils.isNonEmptyString(this.additionalFilter)},e.prototype.processQueryOverrideForMultiSelection=function(e,t){if(this.facet.values.hasSelectedOrExcludedValues()){var n=this.computeOurFilterExpression();t=e.computeCompleteExpressionPartsExcept(n),c.QueryBuilderExpression.isEmpty(t)&&(t.advanced="@uri")}return t},e.prototype.processQueryOverrideForAdditionalFilter=function(e,t){if(o.Utils.isEmptyString(t.basic)&&(t.basic=e.expression.build()),o.Utils.isEmptyString(t.constant)){var n=e.constantExpression.isEmpty()?"":e.constantExpression.build()+" ";t.constant=""+n+this.additionalFilter}else t.constant=t.constant+" "+this.additionalFilter;return t.advanced||(t.advanced=this.getFilterExpressionWithoutOurFilterExpression(e)),t},e.prototype.getFilterExpressionWithoutOurFilterExpression=function(e){var t=new i.ExpressionBuilder;e.advancedExpression.getParts().forEach(function(e){return t.add(e)});var n=this.computeOurFilterExpression();return t.remove(n),t.build()},e.prototype.processQueryOverrideForEmptyValues=function(e,t){var n=l.chain(t).keys().each(function(e){(o.Utils.isEmptyString(t[e])||o.Utils.isNullOrUndefined(t[e]))&&delete t[e]}).value();return 0==l.keys(n).length&&(t=void 0),t},e.prototype.checkForFacetSearchValuesToRemove=function(e,t){var n=this,i=a.FacetUtils.getRegexToUseForFacetSearch(t,this.facet.options.facetSearchIgnoreAccents);return l.filter(e,function(e){var t=l.isEmpty(n.facet.options.allowedValues)||n.isValueAllowedByAllowedValueOption(e.value),o=n.facet.getValueCaption(e);return t&&i.test(o)})},e.prototype.filterByAllowedValueOption=function(e){var t=this;return l.filter(e,function(e){return t.isValueAllowedByAllowedValueOption(e.value)})},e.prototype.isValueAllowedByAllowedValueOption=function(e){var t=this;return l.some(this.facet.options.allowedValues,function(n){var i=t.replaceWildcardsWithRegexEquivalent(t.escapeMostRegexCharacters(n));return new RegExp("^"+i+"$","gi").test(e)})},e.prototype.escapeMostRegexCharacters=function(e){return e.replace(/[.+^${}()|[\]\\]/g,"\\$&")},e.prototype.replaceWildcardsWithRegexEquivalent=function(e){return e.replace(/\*/g,".*").replace(/\?/g,".")},e}();t.FacetQueryController=u},290:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var s=n(103),r=n(0),a=n(3),l=n(6),c=n(1),u=n(7),h=n(8),p=n(2),d=n(190),f=n(85),m=function(e){function t(n,i,o){var r=e.call(this,n,t.ID,o)||this;return r.element=n,r.options=i,r.bindings=o,r.isFieldValueCompatible=!1,r.rangeValues=[{start:s(0).toDate(),end:s().endOf("day").toDate(),label:l.l("AllDates"),endInclusive:!1},{start:s().startOf("day").subtract(1,"day").toDate(),end:s().endOf("day").toDate(),label:l.l("WithinLastDay"),endInclusive:!1},{start:s().startOf("day").subtract(1,"week").toDate(),end:s().endOf("day").toDate(),label:l.l("WithinLastWeek"),endInclusive:!1},{start:s().startOf("day").subtract(1,"month").toDate(),end:s().endOf("day").toDate(),label:l.l("WithinLastMonth"),endInclusive:!1},{start:s().startOf("day").subtract(1,"year").toDate(),end:s().endOf("day").toDate(),label:l.l("WithinLastYear"),endInclusive:!1}],r.options=h.ComponentOptions.initComponentOptions(n,t,i),r.buildFacet(),r}return i(t,e),t.prototype.isCurrentlyDisplayed=function(){return!!c.$$(this.element).isVisible()&&!this.disabled},Object.defineProperty(t.prototype,"ranges",{get:function(){return this.rangeValues},set:function(e){this.rangeValues=e,this.buildFacet()},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facet",{get:function(){return this.facetRange},enumerable:!0,configurable:!0}),t.prototype.buildFacet=function(){this.destroyFacet(),this.facetRangeElement=c.$$("div"),c.$$(this.element).append(this.facetRangeElement.el),this.facetRange=new d.FacetRange(this.facetRangeElement.el,{field:this.options.field,title:this.options.title,ranges:this.rangeValues,availableSorts:["custom"],customSort:r.pluck(this.rangeValues,"label"),id:this.options.id},this.bindings),this.facetRange.isCurrentlyDisplayed=this.isCurrentlyDisplayed},t.prototype.destroyFacet=function(){this.facetRangeElement&&this.facetRangeElement.remove(),delete this.facetRange},t.ID="TimespanFacet",t.options=o({title:h.ComponentOptions.buildStringOption({defaultValue:l.l("LastUpdated")}),field:h.ComponentOptions.buildFieldOption({defaultValue:"@date"}),id:h.ComponentOptions.buildStringOption({postProcessing:function(e,t){return e||t.field}})},f.ResponsiveFacetOptions),t.doExport=function(){a.exportGlobally({TimespanFacet:t})},t}(u.Component);t.TimespanFacet=m,p.Initialization.registerAutoCreateComponent(m)},40:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(22),o=n(21),s=n(121),r=n(33),a=n(4),l=n(1),c=n(0),u=n(6),h=function(){function e(){}return e.getRegexToUseForFacetSearch=function(e,t){return new RegExp(i.StringUtils.stringToRegex(e,t),"i")},e.getDisplayValueFromValueCaption=function(e,t,n){var i=this.tryToGetTranslatedCaption(t,e,!1);return n[e]||i},e.getValuesToUseForSearchInFacet=function(e,t){var n=[e],i=this.getRegexToUseForFacetSearch(e,t.options.facetSearchIgnoreAccents);return t.options.valueCaption?(c.chain(t.options.valueCaption).pairs().filter(function(e){return i.test(e[1])}).each(function(e){n.push(e[0])}),(o.QueryUtils.isStratusAgnosticField(t.options.field,"@objecttype")||o.QueryUtils.isStratusAgnosticField(t.options.field,"@filetype"))&&c.each(s.FileTypes.getFileTypeCaptions(),function(e,o){o in t.options.valueCaption||!i.test(e)||n.push(o)})):o.QueryUtils.isStratusAgnosticField(t.options.field,"@objecttype")||o.QueryUtils.isStratusAgnosticField(t.options.field,"@filetype")?c.each(c.filter(c.pairs(s.FileTypes.getFileTypeCaptions()),function(e){return i.test(e[1])}),function(e){n.push(e[0])}):o.QueryUtils.isStratusAgnosticField(t.options.field,"@month")&&c.each(c.range(1,13),function(e){i.test(r.DateUtils.monthToString(e-1))&&n.push(("0"+e.toString()).substr(-2))}),n},e.buildFacetSearchPattern=function(e){return e=c.map(e,function(e){return a.Utils.escapeRegexCharacter(e)}),e[0]=".*"+e[0]+".*",e.join("|")},e.needAnotherFacetSearch=function(e,t,n,i){return e<t&&e<i&&e>n},e.addNoStateCssClassToFacetValues=function(e,t){if(0!=e.values.getSelected().length){var n=l.$$(t).findAll("li:not(.coveo-selected)");c.each(n,function(e){l.$$(e).addClass("coveo-no-state")})}},e.tryToGetTranslatedCaption=function(t,n,i){void 0===i&&(i=!0);var l;if(o.QueryUtils.isStratusAgnosticField(t.toLowerCase(),"@filetype"))l=s.FileTypes.getFileType(n,i).caption;else if(o.QueryUtils.isStratusAgnosticField(t.toLowerCase(),"@objecttype"))l=s.FileTypes.getObjectType(n,i).caption;else if(e.isMonthFieldValue(t,n)){var c=parseInt(n,10);l=r.DateUtils.monthToString(c-1)}else i&&(l=u.l(n));return void 0!=l&&a.Utils.isNonEmptyString(l)?l:n},e.isMonthFieldValue=function(e,t){if(!o.QueryUtils.isStratusAgnosticField(e.toLowerCase(),"@month"))return!1;var n=parseInt(t,10);return!isNaN(n)&&!(n<1||n>12)},e}();t.FacetUtils=h},470:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(27),s=n(96),r=n(0),a=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.defaultTemplate='<td><a class="CoveoResultLink"></a></td>\n <td><span class="CoveoExcerpt"></span></td>\n <td><span class="CoveoFieldValue" data-field="@date" data-helper="date"></span></td>',t.defaultRoledTemplates={"table-header":'<th style="width: 40%">Link</th>\n <th>Excerpt</th>\n <th style="width: 20%"\n class="CoveoSort coveo-table-header-sort"\n data-sort-criteria="date ascending,date descending"\n data-display-unselected-icon="false">Date</th>',"table-footer":"<th>Link</th>\n <th>Excerpt</th>\n <th>Date</th>"},t}return i(t,e),t.prototype.instantiateRoleToString=function(e){var t=r.find(this.templates,function(t){return t.role===e});return t?t.instantiateToString(void 0,{}):this.defaultRoledTemplates[e]},t.prototype.instantiateRoleToElement=function(e){var t=this,n=r.find(this.templates,function(t){return t.role===e});if(n)return n.instantiateToElement(void 0,{});var i=new o.Template(function(){return t.defaultRoledTemplates[e]});return i.layout="table",i.instantiateToElement(void 0)},t.prototype.getFallbackTemplate=function(){var e=this;return new o.Template(function(){return e.defaultTemplate})},t.prototype.hasTemplateWithRole=function(e){return r.find(this.templates,function(t){return t.role===e})},t}(s.TemplateList);t.TableTemplate=a},471:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(31),o=n(0),s=n(1),r=function(){function e(e,t){void 0===t&&(t={focusableSelector:"[tabindex], button"}),this.container=e,this.options=t,this.hiddenElements=[],this.enable()}return Object.defineProperty(e.prototype,"focusableElements",{get:function(){return o.chain(s.Dom.nodeListToArray(this.container.querySelectorAll(this.options.focusableSelector))).filter(function(e){return s.$$(e).isVisible()}).sortBy(function(e){return e.tabIndex}).value()},enumerable:!0,configurable:!0}),e.prototype.disable=function(){document.removeEventListener("focusin",this.focusInEvent),document.removeEventListener("focusout",this.focusOutEvent),this.showHiddenElements(),this.enabled=!1},e.prototype.enable=function(){var e=this;document.addEventListener("focusin",this.focusInEvent=function(t){return e.onFocusIn(t)}),document.addEventListener("focusout",this.focusOutEvent=function(t){return e.onFocusOut(t)}),this.hideAllExcept(this.container),this.enabled=!0},e.prototype.showHiddenElements=function(){for(;this.hiddenElements.length;)this.hiddenElements.pop().removeAttribute("aria-hidden")},e.prototype.hideElement=function(e){e.getAttribute("aria-hidden")||(this.hiddenElements.push(e),e.setAttribute("aria-hidden",""+!0))},e.prototype.hideSiblings=function(e){var t=this,n=e.parentElement;n&&o.without(s.$$(n).children(),e).forEach(function(e){t.hideElement(e)})},e.prototype.hideAllExcept=function(e){this.hideSiblings(e);var t=e.parentElement;t&&t!==document.body&&this.hideAllExcept(t)},e.prototype.getFocusableSibling=function(e,t){void 0===t&&(t=!1);var n=this.focusableElements,i=n.indexOf(e);return-1===i?null:n[(i+(t?-1:1)+n.length)%n.length]},e.prototype.focusSibling=function(e,t){void 0===t&&(t=!1);var n=this.getFocusableSibling(e,t);n&&n.focus()},e.prototype.focusFirstElement=function(){var e=this.focusableElements;e.length&&e[0].focus()},e.prototype.elementIsBefore=function(e,t){return!!t&&e.compareDocumentPosition(t)===Node.DOCUMENT_POSITION_PRECEDING},e.prototype.onLosingFocus=function(e,t){var n=this;i.Defer.defer(function(){n.enabled&&(n.enabled=!1,e&&n.focusIsAllowed(e)?n.focusSibling(e,n.elementIsBefore(e,t)):n.focusFirstElement(),n.enabled=!0)})},e.prototype.focusIsAllowed=function(e){return this.container.contains(e)},e.prototype.elementIsInPage=function(e){return e&&e!==document.body.parentElement},e.prototype.onFocusIn=function(e){if(this.enabled){var t=e.relatedTarget;if(!this.elementIsInPage(t)){var n=e.target;this.elementIsInPage(n)&&(this.focusIsAllowed(n)||this.onLosingFocus(null,n))}}},e.prototype.onFocusOut=function(e){if(this.enabled){var t=e.relatedTarget;this.elementIsInPage(t)&&(t&&this.focusIsAllowed(t)||this.onLosingFocus(e.target,t))}},e}();t.FocusTrap=r},472:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(27),s=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.instantiateToString=function(e){return'<div class="coveo-result-frame">\n <div class="coveo-result-row">\n <div class="coveo-result-cell" style="width:40px;text-align:center;vertical-align:middle;">\n <span class="CoveoIcon" data-small="true" data-with-label="false">\n </span>\n </div>\n <div class="coveo-result-cell" style="padding:0 0 3px 5px;vertical-align:middle">\n <div class="coveo-result-row">\n <div class="coveo-result-cell" style="font-size:10pt;">\n <a class="CoveoResultLink" style="display:block;white-space:nowrap;overflow:hidden;text-overflow:ellipsis">\n </a>\n </div>\n </div>\n </div>\n </div>\n </div>'},t.prototype.instantiateToElement=function(e){var t=this;return new Promise(function(n,i){var o=document.createElement("div");o.innerHTML=t.instantiateToString(e),n(o)})},t}(o.Template);t.DefaultRecommendationTemplate=s},473:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(r,a)}l((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(r=s[2&n[0]?"return":n[0]?"throw":"next"])&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[0,r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,s=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],s=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var s=n(20),r=n(93),a=n(0),l=n(1),c=n(9),u=function(){function e(e){this.args=e}return e.prototype.buildResults=function(e,t,n){return i(this,void 0,void 0,function(){var i,s,l=this;return o(this,function(o){return i=[],s=a.map(e.results,function(e,o){return l.buildResult(e,t,n).then(function(e){return null!=e&&i.push({elem:e,idx:o}),r.ResultList.resultCurrentlyBeingRendered=null,e})}),[2,Promise.all(s).then(function(){return a.pluck(a.sortBy(i,"idx"),"elem")})]})})},e.prototype.buildResult=function(e,t,n){return i(this,void 0,void 0,function(){var i;return o(this,function(o){switch(o.label){case 0:return s.Assert.exists(e),s.QueryUtils.setStateObjectOnQueryResult(this.args.queryStateModel.get(),e),s.QueryUtils.setSearchInterfaceObjectOnQueryResult(this.args.searchInterface,e),r.ResultList.resultCurrentlyBeingRendered=e,[4,this.createHtmlElement(e,t)];case 1:return i=o.sent(),null!=i&&s.Component.bindResultToElement(i,e),n.push(e),[4,this.autoCreateComponentsInsideResult(i,e).initResult];case 2:return o.sent(),this.verifyChildren(i),[2,i]}})})},e.prototype.autoCreateComponentsInsideResult=function(e,t){return s.Assert.exists(e),s.Initialization.automaticallyCreateComponentsInsideResult(e,t)},e.prototype.createHtmlElement=function(e,t){return this.args.resultTemplate.instantiateToElement(e,{wrapInDiv:!0,checkCondition:!0,currentLayout:t,responsiveComponents:this.args.searchInterface.responsiveComponents})},e.prototype.verifyChildren=function(e){l.$$(e).find(".CoveoResultLink")||new c.Logger(e).warn('Result does not contain a "CoveoResultLink" component, please verify the result template',this.args.resultTemplate)},e}();t.TemplateToHtml=u},474:function(e,t,n){"use strict";function i(){var e,t=O.Component.getComponentRef("ResultList");if(t&&(e=t.resultCurrentlyBeingRendered),!e){var n=O.Component.getComponentRef("Quickview");n&&(e=n.resultCurrentlyBeingRendered)}return e}function o(){var e=i();if(e)return e.termsToHighlight}function s(){var e=i();if(e)return e.phrasesToHighlight}function r(e,t){return d.Utils.isNonEmptyArray(V.keys(e))||d.Utils.isNonEmptyArray(V.keys(t))}var a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var l=n(122),c=n(69),u=n(33),h=n(135),p=n(179),d=n(4),f=n(22),m=n(73),y=n(178),g=n(21),v=n(24),b=n(1),S=n(53),C=n(120),F=n(40),E=n(23),V=n(0),O=n(7),A=n(68),w=function(){function e(){}return e.exportAllHelpersGlobally=function(e){V.each(l.TemplateHelpers.getHelpers(),function(t,n){void 0==e[n]&&(e[n]=t)})},e}();t.CoreHelpers=w,l.TemplateHelpers.registerFieldHelper("javascriptEncode",function(e){return d.Utils.exists(e)?f.StringUtils.javascriptEncode(e):void 0});var R=function(e,t){var n=c.StringAndHoles.shortenString(e,t.length,"...");return d.Utils.exists(t.highlights)?c.HighlightUtils.highlightString(n.value,t.highlights,n.holes,t.cssClass||"highlight"):n.value};l.TemplateHelpers.registerTemplateHelper("shorten",function(e,t,n,i){return R(e,{length:t,highlights:n,cssClass:i})}),l.TemplateHelpers.registerTemplateHelper("shortenv2",function(e,t){return R(e,t)});var $=function(e,t){var n=c.StringAndHoles.shortenPath(e,t.length);return d.Utils.exists(t.highlights)?c.HighlightUtils.highlightString(n.value,t.highlights,n.holes,t.cssClass||"highlight"):n.value};l.TemplateHelpers.registerTemplateHelper("shortenPath",function(e,t,n,i){return $(e,{length:t,highlights:n,cssClass:i})}),l.TemplateHelpers.registerFieldHelper("shortenPathv2",function(e,t){return $(e,t)});var x=function(e,t){var n=c.StringAndHoles.shortenUri(e,t.length);return d.Utils.exists(t.highlights)?c.HighlightUtils.highlightString(n.value,t.highlights,n.holes,t.cssClass||"highlight"):n.value};l.TemplateHelpers.registerTemplateHelper("shortenUri",function(e,t,n,i){return x(e,{length:t,highlights:n,cssClass:i})}),l.TemplateHelpers.registerTemplateHelper("shortenUriv2",function(e,t){return x(e,t)});var T=function(e,t){return d.Utils.exists(e)?d.Utils.exists(t.highlights)?c.HighlightUtils.highlightString(e,t.highlights,null,t.cssClass||"highlight"):e:void 0};l.TemplateHelpers.registerTemplateHelper("highlight",function(e,t,n){return T(e,{highlights:t,cssClass:n})}),l.TemplateHelpers.registerTemplateHelper("highlightv2",function(e,t){return T(e,t)});var I=function(e,t){return d.Utils.exists(e)&&d.Utils.exists(t.termsToHighlight)&&d.Utils.exists(t.phrasesToHighlight)?r(t.termsToHighlight,t.phrasesToHighlight)?C.StreamHighlightUtils.highlightStreamText(e,t.termsToHighlight,t.phrasesToHighlight,t.opts):e:void 0};l.TemplateHelpers.registerTemplateHelper("highlightStreamText",function(e,t,n,i){return void 0===t&&(t=o()),void 0===n&&(n=s()),I(e,{termsToHighlight:t,phrasesToHighlight:n,opts:i})}),l.TemplateHelpers.registerTemplateHelper("highlightStreamTextv2",function(e,t){var n=a({termsToHighlight:o(),phrasesToHighlight:s()},t);return I(e,n)});var D=function(e,t){return d.Utils.exists(e)&&d.Utils.exists(t.termsToHighlight)&&d.Utils.exists(t.phrasesToHighlight)?r(t.termsToHighlight,t.phrasesToHighlight)?C.StreamHighlightUtils.highlightStreamHTML(e,t.termsToHighlight,t.phrasesToHighlight,t.opts):e:void 0};l.TemplateHelpers.registerTemplateHelper("highlightStreamHTML",function(e,t,n,i){return void 0===t&&(t=o()),void 0===n&&(n=s()),D(e,{termsToHighlight:t,phrasesToHighlight:n,opts:i})}),l.TemplateHelpers.registerTemplateHelper("highlightStreamHTMLv2",function(e,t){var n=a({termsToHighlight:o(),phrasesToHighlight:s()},t);return D(e,n)}),l.TemplateHelpers.registerFieldHelper("number",function(e,t){if(d.Utils.exists(e)){var n=Number(e),i=V.isString(t)?t:t&&t.format;return i?f.StringUtils.htmlEncode(E.format(n,i)):f.StringUtils.htmlEncode(n.toString())}}),l.TemplateHelpers.registerFieldHelper("date",function(e,t){return u.DateUtils.dateToString(u.DateUtils.convertFromJsonDateIfNeeded(e),t)}),l.TemplateHelpers.registerFieldHelper("time",function(e,t){return u.DateUtils.timeToString(u.DateUtils.convertFromJsonDateIfNeeded(e),t)}),l.TemplateHelpers.registerFieldHelper("dateTime",function(e,t){return u.DateUtils.dateTimeToString(u.DateUtils.convertFromJsonDateIfNeeded(e),t)}),l.TemplateHelpers.registerFieldHelper("emailDateTime",function(e,t){var n={};n.includeTimeIfThisWeek=!0;var i=V.extend(t,n);return e?u.DateUtils.dateTimeToString(u.DateUtils.convertFromJsonDateIfNeeded(e),i):void 0}),l.TemplateHelpers.registerFieldHelper("currency",function(e,t){return h.CurrencyUtils.currencyToString(e,t)}),l.TemplateHelpers.registerFieldHelper("timeSpan",function(e,t){return void 0===t&&(t={isMilliseconds:!1}),new m.TimeSpan(e,t.isMilliseconds).getHHMMSS()}),l.TemplateHelpers.registerFieldHelper("email",function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i,o,s,r;if(V.isObject(t[0])?(i=t[0].companyDomain,o=t[0].me,s=t[0].lengthLimit,r=t[0].truncateName):(i=t[0],o=t[1],s=t[2],r=t[3]),void 0==s&&(s=2),void 0==r&&(r=!1),V.isString(e)){var a=y.EmailUtils.splitSemicolonSeparatedListOfEmailAddresses(e);return y.EmailUtils.emailAddressesToHyperlinks(a,i,o,s,r)}return V.isArray(e)?y.EmailUtils.emailAddressesToHyperlinks(e,i,o,s,r):void 0}),l.TemplateHelpers.registerTemplateHelper("excessEmailToggle",function(e){b.$$(e).removeClass("coveo-active"),b.$$(e).hasClass("coveo-emails-excess-collapsed")?V.each(b.$$(e).siblings(".coveo-emails-excess-expanded"),function(e){b.$$(e).addClass("coveo-active")}):b.$$(e).hasClass("coveo-hide-expanded")&&(b.$$(e.parentElement).addClass("coveo-inactive"),V.each(b.$$(e.parentElement).siblings(".coveo-emails-excess-collapsed"),function(e){b.$$(e).addClass("coveo-active")}))}),l.TemplateHelpers.registerFieldHelper("anchor",function(e,t){return p.AnchorUtils.buildAnchor(e,t)}),l.TemplateHelpers.registerFieldHelper("image",function(e,t,n){return void 0===n&&(n=i()),t&&t.srcTemplate?p.ImageUtils.buildImage(f.StringUtils.buildStringTemplateFromResult(t.srcTemplate,n),{alt:t.alt,height:t.height,width:t.width}):p.ImageUtils.buildImage(e,t)}),l.TemplateHelpers.registerTemplateHelper("thumbnail",function(e,t,n){if(void 0===e&&(e=i()),void 0===t&&(t="default"),g.QueryUtils.hasThumbnail(e))return p.ImageUtils.buildImageFromResult(e,S.SearchEndpoint.endpoints[t],n)}),l.TemplateHelpers.registerTemplateHelper("fromFileTypeToIcon",function(e,t){void 0===e&&(e=i()),void 0===t&&(t={});var n=O.Component.getComponentRef("Icon");if(n)return n.createIcon(e,t).outerHTML}),l.TemplateHelpers.registerTemplateHelper("attrEncode",function(e){return(""+e).replace(/&/g,"&").replace(/'/g,"'").replace(/'/g,""").replace(/</g,"<").replace(/>/g,">")}),l.TemplateHelpers.registerTemplateHelper("loadTemplates",function(e,t){void 0===t&&(t=!0);var n,o="",s=i(),r=!1,a=e;return V.each(e,function(e,t,i){"default"==e&&(n=t)}),void 0!=n&&(a=V.omit(e,n)),V.each(a,function(e,n,i){r&&t||(r=r||e,o+=l.TemplateHelpers.getHelper("loadTemplate")(n,e,s))}),r||void 0==n||(o+=l.TemplateHelpers.getHelper("loadTemplate")(n,!0,s)),o});var L=["B","KB","MB","GB","TB","PB","EB"];l.TemplateHelpers.registerFieldHelper("size",function(e,t){for(var n=parseInt(e,10),i=null!=t&&null!=t.precision?t.precision:2,o=null!=t&&null!=t.base?t.base:0;n>1024&&o+1<L.length;)n/=1024,o++;return(n=Math.floor(n*Math.pow(10,i))/Math.pow(10,i))+" "+L[o]}),l.TemplateHelpers.registerFieldHelper("translatedCaption",function(e){return F.FacetUtils.tryToGetTranslatedCaption("@filetype",e)}),l.TemplateHelpers.registerTemplateHelper("loadTemplate",function(e,t,n){return void 0===t&&(t=!0),d.Utils.isNullOrUndefined(n)&&(n=i()),t?A.TemplateCache.getTemplate(e).instantiateToString(n,{checkCondition:!1}):""}),l.TemplateHelpers.registerTemplateHelper("encodeCarriageReturn",function(e){return d.Utils.isNullOrUndefined(e)?void 0:f.StringUtils.encodeCarriageReturn(e)}),l.TemplateHelpers.registerTemplateHelper("isMobileDevice",function(){return v.DeviceUtils.isMobileDevice()?v.DeviceUtils.getDeviceName():null}),l.TemplateHelpers.registerTemplateHelper("pluralHelper",function(e,t){return e>1?t.plural:t.singular})},476:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.Legacy="legacy",e.Wildcards="wildcards",e.Regex="regex",e.EditDistance="editdistance",e.Phonetic="phonetic"}(t.AllowedValuesPatternType||(t.AllowedValuesPatternType={}))},477:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(478),o=n(4),s=n(10),r=n(1),a=n(25),l=function(){function e(e,t,n,i){this.facet=e,this.facetValue=t,this.onSelect=n,this.onExclude=i}return e.prototype.build=function(){return this.renderer=new i.ValueElementRenderer(this.facet,this.facetValue).build(),this.bindEvent({displayNextTime:!0,pinFacet:this.facet.options.preservePosition}),this},e.prototype.bindEvent=function(e){o.Utils.isNullOrUndefined(e.omniboxObject)?this.isOmnibox=!1:this.isOmnibox=!0,this.handleEventForCheckboxChange(e),this.facetValue.excluded?this.handleEventForExcludedValueElement(e):this.handleEventForValueElement(e)},e.prototype.select=function(){this.facetValue.selected=!0,this.facetValue.excluded=!1,this.renderer.setCssClassOnListValueElement()},e.prototype.unselect=function(){this.facetValue.selected=!1,this.facetValue.excluded=!1,this.renderer.setCssClassOnListValueElement()},e.prototype.exclude=function(){this.facetValue.selected=!1,this.facetValue.excluded=!0,this.renderer.setCssClassOnListValueElement()},e.prototype.unexclude=function(){this.facetValue.selected=!1,this.facetValue.excluded=!1,this.renderer.setCssClassOnListValueElement()},e.prototype.toggleExcludeWithUA=function(){var e,t=this;e=this.facetValue.excluded?this.isOmnibox?s.analyticsActionCauseList.omniboxFacetUnexclude:s.analyticsActionCauseList.facetUnexclude:this.isOmnibox?s.analyticsActionCauseList.omniboxFacetExclude:s.analyticsActionCauseList.facetExclude,this.facet.toggleExcludeValue(this.facetValue),this.onExclude?this.facet.triggerNewQuery(function(){return t.onExclude(t,e)}):this.facet.triggerNewQuery(function(){return t.facet.usageAnalytics.logSearchEvent(e,t.getAnalyticsFacetMeta())})},e.prototype.handleSelectValue=function(e){var t=this;this.facet.keepDisplayedValuesNextTime=e.displayNextTime&&!this.facet.options.useAnd;var n;this.facetValue.excluded?(n=this.isOmnibox?s.analyticsActionCauseList.omniboxFacetUnexclude:s.analyticsActionCauseList.facetUnexclude,this.facet.unexcludeValue(this.facetValue)):(n=this.facetValue.selected?this.isOmnibox?s.analyticsActionCauseList.omniboxFacetDeselect:s.analyticsActionCauseList.facetDeselect:this.isOmnibox?s.analyticsActionCauseList.omniboxFacetSelect:s.analyticsActionCauseList.facetSelect,this.facet.toggleSelectValue(this.facetValue)),this.onSelect?this.facet.triggerNewQuery(function(){return t.onSelect(t,n)}):this.facet.triggerNewQuery(function(){return t.facet.usageAnalytics.logSearchEvent(n,t.getAnalyticsFacetMeta())})},e.prototype.handleExcludeClick=function(e){this.facet.keepDisplayedValuesNextTime=e.displayNextTime&&!this.facet.options.useAnd,this.toggleExcludeWithUA()},e.prototype.handleSelectEventForExcludedValueElement=function(e){var t=this,n=function(){return e.pinFacet&&t.facet.pinFacetPosition(),e.omniboxObject&&t.omniboxCloseEvent(e.omniboxObject),t.handleSelectValue(e),t.tryDismissSearchResults(),!1};r.$$(this.renderer.label).on("click",function(e){e.stopPropagation(),n()}),r.$$(this.renderer.stylishCheckbox).on("keydown",a.KeyboardUtils.keypressAction([a.KEYBOARD.SPACEBAR,a.KEYBOARD.ENTER],n))},e.prototype.handleExcludeEventForValueElement=function(e){var t=this,n=function(n){e.omniboxObject&&t.omniboxCloseEvent(e.omniboxObject),t.handleExcludeClick(e),t.tryDismissSearchResults(),n.stopPropagation(),n.preventDefault()};r.$$(this.renderer.excludeIcon).on("click",n),r.$$(this.renderer.excludeIcon).on("keydown",a.KeyboardUtils.keypressAction([a.KEYBOARD.SPACEBAR,a.KEYBOARD.ENTER],n))},e.prototype.handleSelectEventForValueElement=function(e){var t=this,n=function(n){e.pinFacet&&t.facet.pinFacetPosition(),t.tryDismissSearchResults(),r.$$(t.renderer.checkbox).trigger("change"),n.preventDefault()};r.$$(this.renderer.label).on("click",n),r.$$(this.renderer.stylishCheckbox).on("keydown",a.KeyboardUtils.keypressAction([a.KEYBOARD.SPACEBAR,a.KEYBOARD.ENTER],n))},e.prototype.handleEventForExcludedValueElement=function(e){this.handleSelectEventForExcludedValueElement(e),this.handleExcludeEventForValueElement(e)},e.prototype.handleEventForValueElement=function(e){this.handleSelectEventForValueElement(e),this.handleExcludeEventForValueElement(e)},e.prototype.handleEventForCheckboxChange=function(e){var t=this;r.$$(this.renderer.checkbox).on("change",function(){e.omniboxObject&&t.omniboxCloseEvent(e.omniboxObject),t.handleSelectValue(e)})},e.prototype.omniboxCloseEvent=function(e){e.closeOmnibox(),e.clear()},e.prototype.tryDismissSearchResults=function(){this.facet&&this.facet.facetSearch&&this.facet.facetSearch.dismissSearchResults&&this.facet.facetSearch.dismissSearchResults()},e.prototype.getAnalyticsFacetMeta=function(){return{facetId:this.facet.options.id,facetField:this.facet.options.field.toString(),facetValue:this.facetValue.value,facetTitle:this.facet.options.title}},e}();t.ValueElement=l},478:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(4),s=n(6),r=n(7),a=n(0),l=n(12),c=n(16),u=function(){function e(e,t){this.facet=e,this.facetValue=t}return e.prototype.withNo=function(e){return a.isArray(e)?a.each(e,function(e){e&&i.$$(e).detach()}):e&&i.$$(e).detach(),this},e.prototype.build=function(){return this.buildListItem(),this.initAndAppendLabel(),this.initAndAppendExcludeIcon(),this.setCssClassOnListValueElement(),this.addAccessibilityAttributesToTargetElement(),this},e.prototype.setCssClassOnListValueElement=function(){i.$$(this.listItem).toggleClass("coveo-selected",this.facetValue.selected),i.$$(this.listItem).toggleClass("coveo-excluded",this.facetValue.excluded)},Object.defineProperty(e.prototype,"accessibleElement",{get:function(){return this.stylishCheckbox},enumerable:!0,configurable:!0}),e.prototype.buildExcludeIcon=function(){var e=this.facetValue.excluded,t=i.$$("div",{ariaLabel:s.l("ExcludeValueWithResultCount",this.caption,s.l("ResultCount",this.count,parseInt(this.count,10))),className:"coveo-facet-value-exclude",tabindex:0,role:"button",ariaPressed:e.toString()}).el;return this.addFocusAndBlurEventListeners(t),t.innerHTML=e?l.SVGIcons.icons.plus:l.SVGIcons.icons.checkboxHookExclusionMore,c.SVGDom.addClassToSVGInContainer(t,e?"coveo-facet-value-unexclude-svg":"coveo-facet-value-exclude-svg"),c.SVGDom.addAttributesToSVGInContainer(t,{"aria-hidden":"true"}),t},e.prototype.buildValueComputedField=function(){var e=this.facetValue.getFormattedComputedField(this.facet.options.computedFieldFormat);if(o.Utils.isNonEmptyString(e)){var t=i.$$("span",{className:"coveo-facet-value-computed-field"}).el;return i.$$(t).text(e),t}},e.prototype.buildValueCheckbox=function(){var e=i.$$("input",{type:"checkbox",ariaHidden:!0,ariaLabel:this.ariaLabel}).el;return this.facetValue.selected?e.setAttribute("checked","checked"):e.removeAttribute("checked"),this.facetValue.excluded?e.setAttribute("disabled","disabled"):e.removeAttribute("disabled"),r.Component.pointElementsToDummyForm(e),e},e.prototype.buildValueStylishCheckbox=function(){var e=i.$$("div",{className:"coveo-facet-value-checkbox",tabindex:0}).el;return e.innerHTML=l.SVGIcons.icons.checkboxHookExclusionMore,c.SVGDom.addClassToSVGInContainer(e,"coveo-facet-value-checkbox-svg"),this.addFocusAndBlurEventListeners(e),e},e.prototype.buildValueIcon=function(){var e=this.getValueIcon();return o.Utils.exists(e)?i.$$("img",{className:"coveo-facet-value-icon coveo-icon",src:this.getValueIcon()}).el:this.buildValueIconFromSprite()},e.prototype.getValueIcon=function(){return o.Utils.exists(this.facet.options.valueIcon)?this.facet.options.valueIcon(this.facetValue):void 0},e.prototype.buildValueIconFromSprite=function(){return i.$$("div",{className:"coveo-facet-value-icon coveo-icon "+this.facet.options.field.substr(1)+" "+this.facetValue.value}).el},e.prototype.buildValueCaption=function(){var e=i.$$("span",{className:"coveo-facet-value-caption",title:this.caption,"data-original-value":this.facetValue.value}).el;return i.$$(e).text(this.caption),e},e.prototype.buildValueCount=function(){if(o.Utils.isNonEmptyString(this.count)){var e=i.$$("span",{className:"coveo-facet-value-count"}).el;return i.$$(e).text(this.count),e}},Object.defineProperty(e.prototype,"caption",{get:function(){return this.facet.getValueCaption(this.facetValue)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"count",{get:function(){return this.facetValue.getFormattedCount()},enumerable:!0,configurable:!0}),e.prototype.addFocusAndBlurEventListeners=function(e){var t=this;i.$$(e).on("focus",function(){return i.$$(t.listItem).addClass("coveo-focused")}),i.$$(e).on("blur",function(){return i.$$(t.listItem).removeClass("coveo-focused")})},e.prototype.buildListItem=function(){this.listItem=i.$$("li",{className:"coveo-facet-value coveo-facet-selectable",ariaLabel:this.ariaLabel}).el,i.$$(this.listItem).canHandleEvent("touchstart")||i.$$(this.listItem).addClass("coveo-with-hover"),this.listItem.setAttribute("data-value",this.facetValue.value)},e.prototype.initAndAppendLabel=function(){this.label=i.$$("label",{className:"coveo-facet-value-label"}).el,this.tryToInitAndAppendComputedField(),this.initAndAppendFacetValueLabelWrapper(),this.listItem.appendChild(this.label)},e.prototype.initAndAppendExcludeIcon=function(){this.excludeIcon=this.buildExcludeIcon(),this.attachExcludeIconEventHandlers(),this.listItem.appendChild(this.excludeIcon)},e.prototype.attachExcludeIconEventHandlers=function(){var e=this;i.$$(this.excludeIcon).on("mouseover",function(){i.$$(e.listItem).addClass("coveo-facet-value-will-exclude")}),i.$$(this.excludeIcon).on("mouseout",function(){i.$$(e.listItem).removeClass("coveo-facet-value-will-exclude")})},e.prototype.tryToInitAndAppendComputedField=function(){o.Utils.exists(this.facetValue.computedField)&&(this.computedField=this.buildValueComputedField(),this.computedField&&(this.label.appendChild(this.computedField),i.$$(this.label).addClass("coveo-with-computed-field")))},e.prototype.initAndAppendFacetValueLabelWrapper=function(){this.facetValueLabelWrapper=i.$$("div",{className:"coveo-facet-value-label-wrapper"}).el,this.initAndAppendCheckbox(),this.initAndAppendStylishCheckbox(),this.initAndAppendValueCaption(),this.initAndAppendValueCount(),this.label.appendChild(this.facetValueLabelWrapper)},e.prototype.initAndAppendCheckbox=function(){this.checkbox=this.buildValueCheckbox(),this.facetValueLabelWrapper.appendChild(this.checkbox)},e.prototype.initAndAppendStylishCheckbox=function(){this.stylishCheckbox=this.buildValueStylishCheckbox(),this.facetValueLabelWrapper.appendChild(this.stylishCheckbox)},e.prototype.initAndAppendValueCount=function(){this.valueCount=this.buildValueCount(),this.valueCount&&this.facetValueLabelWrapper.appendChild(this.valueCount)},e.prototype.initAndAppendValueCaption=function(){this.valueCaption=this.buildValueCaption(),this.facetValueLabelWrapper.appendChild(this.valueCaption)},e.prototype.addAccessibilityAttributesToTargetElement=function(){var e=this.accessibleElement;e.setAttribute("aria-label",this.ariaLabel),e.setAttribute("role","button"),e.setAttribute("aria-pressed",this.ariaPressed)},Object.defineProperty(e.prototype,"ariaLabel",{get:function(){var e=s.l("ResultCount",this.count,parseInt(this.count,10));return""+s.l("IncludeValueWithResultCount",this.caption,e)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"ariaPressed",{get:function(){return this.facetValue.excluded?"mixed":this.facetValue.selected?"true":"false"},enumerable:!0,configurable:!0}),e}();t.ValueElementRenderer=u},479:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(22),o=n(0),s=function(){function e(e,t){this.facet=e,this.facetSort=t}return e.prototype.reorderValues=function(e){if(this.facetSort&&this.facetSort.activeSort){if(this.usingCustomSort)return this.reorderValuesWithCustomOrder(e);if(this.usingAlphabeticalSort)return this.reorderValuesWithCustomCaption(e)}return e},e.prototype.reorderValuesIfUsingCustomSort=function(e){return this.usingCustomSort?this.reorderValuesWithCustomOrder(e):e},e.prototype.reorderValuesIfUsingAlphabeticalSort=function(e){return this.usingAlphabeticalSort?this.reorderValuesWithCustomCaption(e):e},Object.defineProperty(e.prototype,"usingCustomSort",{get:function(){return"custom"==this.facetSort.activeSort.name&&void 0!=this.facet.options.customSort},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"usingAlphabeticalSort",{get:function(){return-1!=this.facetSort.activeSort.name.indexOf("alpha")},enumerable:!0,configurable:!0}),e.prototype.reorderValuesWithCustomOrder=function(e){var t=o.map(this.facet.options.customSort,function(e){return e.toLowerCase()}),n=o.map(e,function(e,n){var s=o.findIndex(t,function(t){return i.StringUtils.equalsCaseInsensitive(t,e.value)||null!=e.lookupValue&&i.StringUtils.equalsCaseInsensitive(t,e.lookupValue)});return-1==s&&(s=n+t.length),{facetValue:e,index:s}}),s=o.sortBy(n,"index");return s="ascending"==this.facetSort.customSortDirection?s:s.reverse(),o.pluck(s,"facetValue")},e.prototype.reorderValuesWithCustomCaption=function(e){var t=this,n=e.sort(function(e,n){return t.facet.getValueCaption(e).localeCompare(t.facet.getValueCaption(n),String.locale,{sensitivity:"base"})});return-1!=this.facetSort.activeSort.name.indexOf("descending")&&(n=n.reverse()),n},e}();t.FacetValuesOrder=s},480:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(12),s=n(16),r=n(7),a=n(6),l=n(138),c=n(545),u=n(0),h=n(546),p=n(25),d=function(){function e(e){this.facetSearch=e,this.searchBarIsAnimating=!1,this.triggeredScroll=!1,this.facetSearchId=u.uniqueId("coveo-facet-search-results"),this.facetValueNotFoundId=u.uniqueId("coveo-facet-value-not-found"),this.facetSearchUserInputHandler=new c.FacetSearchUserInputHandler(this.facetSearch),this.initSearchResults()}return e.prototype.build=function(e){var t=this;return this.search=document.createElement("div"),i.$$(this.search).addClass("coveo-facet-search"),this.magnifier=this.buildMagnifierIcon(),this.search.appendChild(this.magnifier),this.wait=this.buildWaitIcon(),this.search.appendChild(this.wait),this.hideFacetSearchWaitingAnimation(),this.clear=i.$$("div",{className:"coveo-facet-search-clear",title:a.l("Clear",a.l("Search"))},o.SVGIcons.icons.clear).el,s.SVGDom.addClassToSVGInContainer(this.clear,"coveo-facet-search-clear-svg"),this.clear.style.display="none",this.search.appendChild(this.clear),this.combobox=this.buildSearchInputWrapper(),this.search.appendChild(this.combobox),this.input=this.buildInputElement(),r.Component.pointElementsToDummyForm(this.input),this.combobox.appendChild(this.input),i.$$(this.input).on("keyup",function(e){t.facetSearchUserInputHandler.handleKeyboardEvent(e)}),i.$$(this.clear).on("click",function(t){e&&e()}),i.$$(this.input).on("focus",function(e){t.handleFacetSearchFocus()}),i.$$(this.input).on("blur",function(e){return t.onInputBlur(e)}),this.detectSearchBarAnimation(),this.initSearchDropdownNavigator(),this.search},e.prototype.initSearchResults=function(){var e=this;this.searchResults=i.$$("ul",{id:this.facetSearchId,className:"coveo-facet-search-results",role:"listbox"}).el,i.$$(this.searchResults).on("scroll",function(){return e.handleScrollEvent()}),i.$$(this.searchResults).on("keyup",function(t){t.which===p.KEYBOARD.ESCAPE&&e.facetSearch.dismissSearchResults()}),i.$$(this.searchResults).on("focusout",function(t){return e.onSearchResultsFocusOut(t)}),i.$$(this.searchResults).hide()},e.prototype.onInputBlur=function(e){var t=e.relatedTarget,n=this.searchResults.contains(t);this.search.parentElement.contains(t)&&!n&&this.facetSearch.dismissSearchResults()},e.prototype.onSearchResultsFocusOut=function(e){var t=e.relatedTarget,n=!!t,i=this.input.contains(t),o=this.searchResults.contains(t);!n||i||o||this.facetSearch.dismissSearchResults()},e.prototype.initSearchDropdownNavigator=function(){var e=this,t={input:this.input,searchResults:this.searchResults,setScrollTrigger:function(t){return e.triggeredScroll=t}};this.searchDropdownNavigator=h.SearchDropdownNavigatorFactory(this.facetSearch,t)},e.prototype.buildSearchInputWrapper=function(){return i.$$("div",{className:"coveo-facet-search-middle"}).el},e.prototype.showFacetSearchWaitingAnimation=function(){this.magnifier&&i.$$(this.magnifier).hide(),i.$$(this.wait).show()},e.prototype.getValueInInputForFacetSearch=function(){return this.input.value.trim()},e.prototype.hideFacetSearchWaitingAnimation=function(){i.$$(this.magnifier).show(),i.$$(this.wait).hide()},e.prototype.detectSearchBarAnimation=function(){var e=this;l.EventsUtils.addPrefixedEvent(this.search,"AnimationStart",function(t){"grow"==t.animationName&&(e.searchBarIsAnimating=!0)}),l.EventsUtils.addPrefixedEvent(this.search,"AnimationEnd",function(t){"grow"==t.animationName&&(e.searchBarIsAnimating=!1)})},e.prototype.positionSearchResults=function(){var e=this;if(null!=this.searchResults){i.$$(this.searchResults).insertAfter(this.search),i.$$(this.searchResults).show(),"none"==i.$$(this.searchResults).css("display")&&(this.searchResults.style.display="");("none"==i.$$(this.search).css("display")||this.searchBarIsAnimating)&&("none"==i.$$(this.searchResults).css("display")&&(this.searchResults.style.display=""),l.EventsUtils.addPrefixedEvent(this.search,"AnimationEnd",function(){l.EventsUtils.removePrefixedEvent(e.search,"AnimationEnd",e)}))}this.addAriaAttributes()},e.prototype.setAsCurrentResult=function(e){this.searchDropdownNavigator.setAsCurrentResult(e)},Object.defineProperty(e.prototype,"currentResult",{get:function(){return this.searchDropdownNavigator.currentResult},enumerable:!0,configurable:!0}),e.prototype.moveCurrentResultDown=function(){this.searchDropdownNavigator.focusNextElement()},e.prototype.moveCurrentResultUp=function(){this.searchDropdownNavigator.focusPreviousElement()},e.prototype.highlightCurrentQueryInSearchResults=function(e){this.facetSearch.getCaptions().forEach(function(t){t.innerHTML=i.$$(t).text().replace(e,'<span class="coveo-highlight">$1</span>')})},e.prototype.appendToSearchResults=function(e){this.searchResults.appendChild(e),this.setupFacetSearchResultsEvents(e)},e.prototype.emptyAndShowNoResults=function(){i.$$(this.searchResults).empty(),this.searchResults.appendChild(i.$$("li",{id:this.facetValueNotFoundId,className:"coveo-facet-value-not-found",role:"option",ariaSelected:"true",tabindex:0},a.l("NoValuesFound")).el),this.input.setAttribute("aria-activedescendant",this.facetValueNotFoundId)},e.prototype.updateAriaLiveWithResults=function(e,t,n){var i=""===e?a.l("ShowingResults",t,e,t):a.l("ShowingResultsWithQuery",t,e,t);n&&(i=i+" ("+a.l("MoreValuesAvailable")+")"),this.facetSearch.updateAriaLive(i)},e.prototype.focus=function(){this.input.focus(),this.handleFacetSearchFocus()},e.prototype.handleFacetSearchFocus=function(){null==this.facetSearch.currentlyDisplayedResults&&(this.facetSearch.displayNewValues(),this.addAriaAttributes())},e.prototype.setupFacetSearchResultsEvents=function(e){var t=this;i.$$(e).on("mousemove",function(){t.setAsCurrentResult(i.$$(e))});var n=!1,o=!1;i.$$(e).on("mousedown",function(){return o=!1}),i.$$(e).on("mousemove",function(){return o=!0}),i.$$(e).on("touchmove",function(){return n=!0}),i.$$(e).on("mouseup touchend",function(){n||o||setTimeout(function(){t.facetSearch.dismissSearchResults()},0),n=!1,o=!1})},e.prototype.hideSearchResultsElement=function(){this.removeAriaAttributes(),i.$$(this.searchResults).hide(),i.$$(this.searchResults).remove()},e.prototype.clearSearchInput=function(){this.input&&(this.input.value="")},e.prototype.buildMagnifierIcon=function(){var e=document.createElement("div");return e.innerHTML=o.SVGIcons.icons.search,i.$$(e).addClass("coveo-facet-search-magnifier"),s.SVGDom.addClassToSVGInContainer(e,"coveo-facet-search-magnifier-svg"),this.search.appendChild(e),e},e.prototype.buildWaitIcon=function(){var e=document.createElement("div");return e.innerHTML=o.SVGIcons.icons.loading,i.$$(e).addClass("coveo-facet-search-wait-animation"),s.SVGDom.addClassToSVGInContainer(e,"coveo-facet-search-wait-animation-svg"),e},e.prototype.buildInputElement=function(){return i.$$("input",{className:"coveo-facet-search-input",type:"text",autocapitalize:"off",autocorrect:"off",ariaLabel:a.l("SearchFacetResults",this.facetSearch.facetTitle),ariaHaspopup:"true",ariaAutocomplete:"list"}).el},e.prototype.handleScrollEvent=function(){this.triggeredScroll?this.triggeredScroll=!1:this.facetSearchUserInputHandler.handleFacetSearchResultsScroll()},e.prototype.addAriaAttributes=function(){this.input&&this.combobox&&(this.input.setAttribute("role","combobox"),this.input.setAttribute("aria-owns",this.facetSearchId),this.input.setAttribute("aria-controls",this.facetSearchId),this.input.setAttribute("aria-expanded","true"),this.facetSearch.setExpandedFacetSearchAccessibilityAttributes(this.searchResults))},e.prototype.removeAriaAttributes=function(){this.input&&this.combobox&&(this.input.removeAttribute("role"),this.input.removeAttribute("aria-owns"),this.input.removeAttribute("aria-controls"),this.input.removeAttribute("aria-activedescendant"),this.input.setAttribute("aria-expanded","false"),this.facetSearch.setCollapsedFacetSearchAccessibilityAttributes())},e}();t.FacetSearchElement=d},481:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),s=function(){function e(e){this.config=e}return e.prototype.setAsCurrentResult=function(e){this.currentResult&&this.currentResult.removeClass("coveo-facet-search-current-result"),this.currentResult=e,e.addClass("coveo-facet-search-current-result"),this.updateSelectedOption(e)},e.prototype.focusNextElement=function(){this.moveCurrentResultDown()},e.prototype.focusPreviousElement=function(){this.moveCurrentResultUp()},e.prototype.moveCurrentResultDown=function(){var e=this.currentResult.el.nextElementSibling;e||(e=i.first(this.searchResults.children)),this.setAsCurrentResult(o.$$(e)),this.highlightAndShowCurrentResultWithKeyboard()},e.prototype.moveCurrentResultUp=function(){var e=this.currentResult.el.previousElementSibling;e||(e=i.last(this.searchResults.children)),this.setAsCurrentResult(o.$$(e)),this.highlightAndShowCurrentResultWithKeyboard()},e.prototype.highlightAndShowCurrentResultWithKeyboard=function(){this.currentResult.addClass("coveo-facet-search-current-result"),this.config.setScrollTrigger(!0),this.searchResults.scrollTop=this.currentResult.el.offsetTop},Object.defineProperty(e.prototype,"searchResults",{get:function(){return this.config.searchResults},enumerable:!0,configurable:!0}),e.prototype.updateSelectedOption=function(e){this.config.input.setAttribute("aria-activedescendant",e.getAttribute("id"));var t=o.$$(this.searchResults).find('[aria-selected^="true"]');t&&t.setAttribute("aria-selected","false"),e.setAttribute("aria-selected","true")},e}();t.DefaultSearchDropdownNavigator=s},482:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(550),o=n(0),s=function(){function e(e,t,n,i){this.element=e,this.categoryFacetTemplates=t,this.categoryValue=n,this.categoryFacet=i,this.children=[]}return e.prototype.clearChildren=function(){this.element.removeClass("coveo-active-category-facet-parent"),this.children.forEach(function(e){e.clear()}),this.children=[]},e.prototype.renderChildren=function(e){var t=this;o.each(e,function(e){t.renderValue(e,!0).makeSelectable()})},e.prototype.renderAsParent=function(e){return this.renderValue(e,!1)},e.prototype.renderValue=function(e,t){var n=this.categoryValue.path.concat([e.value]),o={value:e.value,count:e.numberOfResults,path:n},s=new i.CategoryValue(this.categoryValue.listRoot,o,this.categoryFacetTemplates,this.categoryFacet);return s.render(t),this.children.push(s),s},e}();t.CategoryChildrenValueRenderer=s},483:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(98);n(559);var s=n(0),r=n(17),a=n(13),l=n(6),c=n(15),u=n(1),h=n(25),p=n(41),d=n(16),f=n(12),m=n(4),y=n(10),g=n(484),v=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.sorts=t,i.facet=n,i.customSortDirectionChange=!1,i.onDocumentClick=function(){return i.close()},i.enabledSortsIgnoreRenderBecauseOfPairs=[],i.filterDuplicateForRendering(),i}return i(t,e),Object.defineProperty(t.prototype,"isExpanded",{get:function(){return this.settingsButton&&this.settingsButton.getAttribute("aria-expanded")===""+!0},set:function(e){this.settingsButton.setAttribute("aria-expanded",""+e)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"firstFocusablePopupElement",{get:function(){return s.find(u.$$(this.settingsPopup).findAll("[tabindex]"),function(e){return e.tabIndex>=0})},enumerable:!0,configurable:!0}),t.prototype.build=function(){var e=this;this.buildSettingsButton(),this.buildSettingsPopup(),m.Utils.isNonEmptyArray(this.enabledSorts)&&(this.sortSection=this.buildSortSection(),this.enabledSortsAllowDirection()&&(this.directionSection=this.buildDirectionSection())),this.facet.options.enableSettingsFacetState&&(this.saveStateSection=this.buildSaveStateSection(),this.clearStateSection=this.buildClearStateSection()),this.facet.options.enableCollapse&&(this.hideSection=this.buildHideSection(),this.showSection=this.buildShowSection());var t=function(){e.appendIfNotUndefined(e.saveStateSection),e.appendIfNotUndefined(e.clearStateSection),e.appendIfNotUndefined(e.hideSection),e.appendIfNotUndefined(e.showSection)};return this.addOnDocumentClickHandler(),this.addOnNukeHandler(),m.Utils.isNonEmptyArray(this.enabledSorts)?(this.settingsPopup.appendChild(this.sortSection.element),s.each(this.directionSection,function(t){e.appendIfNotUndefined(t)}),t()):t(),this.settingsButton},t.prototype.loadSavedState=function(){if(this.facetStateLocalStorage){var e=this.facetStateLocalStorage.load(),t=this.facet.queryStateModel.get(this.includedStateAttribute),n=this.facet.queryStateModel.get(this.excludedStateAttribute),i=this.facet.queryStateModel.get(this.operatorStateAttribute);if(!m.Utils.isNullOrUndefined(e)&&m.Utils.isEmptyArray(t)&&m.Utils.isEmptyArray(n)&&!m.Utils.isNonEmptyString(i)){var o={};o[this.includedStateAttribute]=e.included,o[this.excludedStateAttribute]=e.excluded,o[this.operatorStateAttribute]=e.operator,this.facet.queryStateModel.setMultiple(o),this.loadedFromSettings=o}}else this.facet.logger.info("Facet state local storage not enabled : See Facet.options.enableSettingsFacetState")},t.prototype.saveState=function(){this.facetStateLocalStorage?this.facetStateLocalStorage.save({included:this.facet.queryStateModel.get(this.includedStateAttribute),excluded:this.facet.queryStateModel.get(this.excludedStateAttribute),operator:this.facet.queryStateModel.get(this.operatorStateAttribute)}):this.facet.logger.info("Facet state local storage not enabled : See Facet.options.enableSettingsFacetState")},t.prototype.close=function(){this.isExpanded&&(this.isExpanded=!1,u.$$(this.settingsPopup).detach())},t.prototype.open=function(){var e=this;u.$$(this.settingsPopup).insertAfter(this.settingsButton),new o.default(this.settingsButton,this.settingsPopup),this.isExpanded=!0,this.hideSection&&this.showSection&&(u.$$(this.hideSection).toggle(!u.$$(this.facet.element).hasClass("coveo-facet-collapsed")),u.$$(this.showSection).toggle(u.$$(this.facet.element).hasClass("coveo-facet-collapsed"))),this.facet.options.enableSettingsFacetState&&u.$$(this.clearStateSection).toggle(!m.Utils.isNullOrUndefined(this.facetStateLocalStorage.load())),s.each(this.enabledSorts,function(t,n){e.activeSort.name==t.name.toLowerCase()?e.selectItem(e.getSortItem(t.name)):e.unselectItem(e.getSortItem(t.name))});var t=this.firstFocusablePopupElement;t&&t.focus()},t.prototype.getSortItem=function(e){return s.find(this.sortSection.sortItems,function(t){return u.$$(t).getAttribute("data-sort-name").toLowerCase()==e.replace("ascending|descending","").toLowerCase()})},Object.defineProperty(t.prototype,"button",{get:function(){return this.settingsButton},enumerable:!0,configurable:!0}),t.prototype.buildSettingsButton=function(){var e=this;this.settingsButton=u.$$("div",{className:"coveo-facet-header-settings","aria-haspopup":"true"}).el,this.settingsButton.innerHTML=f.SVGIcons.icons.more,d.SVGDom.addClassToSVGInContainer(this.settingsButton,"coveo-facet-settings-more-svg"),this.hideElementOnMouseEnterLeave(this.settingsButton),this.isExpanded=!1,(new c.AccessibleButton).withElement(this.settingsButton).withLabel(l.l("Settings")).withClickAction(function(t){return e.handleSettingsButtonClick(t)}).withEnterKeyboardAction(function(t){return e.handleSettingsButtonClick(t)}).build()},t.prototype.hideElementOnMouseEnterLeave=function(e){var t=this,n=function(){return t.closeTimeout=window.setTimeout(function(){return t.close()},300)},i=function(){return clearTimeout(t.closeTimeout)};u.$$(e).on("mouseleave",n),u.$$(e).on("mouseenter",i),u.$$(e).on("keyup",h.KeyboardUtils.keypressAction(h.KEYBOARD.ESCAPE,function(){return t.handleKeyboardClose()}))},t.prototype.handleKeyboardClose=function(){this.close(),this.settingsButton.focus()},t.prototype.buildSettingsPopup=function(){var e=this;this.settingsPopup=u.$$("div",{className:"coveo-facet-settings-popup"}).el,this.hideElementOnMouseEnterLeave(this.settingsPopup),u.$$(this.settingsPopup).on("focusout",function(t){t.relatedTarget&&e.settingsPopup.contains(t.relatedTarget)||e.close()})},t.prototype.buildSortSection=function(){var e=this.buildSection("coveo-facet-settings-section-sort"),t=this.buildIcon("coveo-facet-settings-section-sort-svg",f.SVGIcons.icons.sort),n=this.buildItems(),i=document.createElement("div");u.$$(i).addClass("coveo-facet-settings-section-sort-title"),u.$$(i).text(l.l("SortBy")+" :"),n.appendChild(i);var o=this.buildSortSectionItems();return s.each(o,function(e){n.appendChild(e)}),e.appendChild(t),e.appendChild(n),{element:e,sortItems:o}},t.prototype.buildSortSectionItems=function(){var e=this,t=s.map(this.enabledSorts,function(t){if(!s.contains(e.enabledSortsIgnoreRenderBecauseOfPairs,t)){var n=e.buildItem(l.l(t.label),t.description);return u.$$(n).setAttribute("data-sort-name",t.name.toLowerCase().replace("ascending|descending","")),(new c.AccessibleButton).withElement(n).withSelectAction(function(n){return e.handleClickSortButton(n,t)}).withLabel(t.label).build(),n}});return t=s.compact(t)},t.prototype.closePopupAndUpdateSort=function(){this.close(),"custom"!=this.activeSort.name?this.facet.updateSort(this.activeSort.name):(this.facet.updateSort("nosort"),this.customSortDirectionChange&&(this.customSortDirectionChange=!1,this.facet.queryController.executeQuery()))},t.prototype.enabledSortsAllowDirection=function(){var e=this,t=s.filter(this.enabledSorts,function(e){return e.directionToggle});return s.filter(t,function(t){return void 0!=s.findWhere(e.enabledSorts,{name:t.relatedSort})}).length>0},t.prototype.buildDirectionSection=function(){var e=this,t=this.buildAscendingOrDescendingSection("Ascending"),n=this.buildIcon("coveo-facet-settings-section-direction-ascending-svg",f.SVGIcons.icons.ascending),i=this.buildIcon("coveo-facet-settings-section-direction-descending-svg",f.SVGIcons.icons.descending),o=this.buildItems(),s=this.buildAscendingOrDescending("Ascending");o.appendChild(s),t.appendChild(n),t.appendChild(o),(new c.AccessibleButton).withElement(s).withoutLabelOrTitle().withSelectAction(function(){return e.handleDirectionClick(s,"ascending")}).build(),this.unselectSection(t);var r=this.buildAscendingOrDescendingSection("Descending"),a=this.buildItems(),l=this.buildAscendingOrDescending("Descending");return a.appendChild(l),r.appendChild(i),r.appendChild(a),(new c.AccessibleButton).withElement(l).withoutLabelOrTitle().withSelectAction(function(){return e.handleDirectionClick(l,"descending")}).build(),this.unselectSection(r),this.activeSort.directionToggle?this.selectItem(this.getItems(t)[0]):(u.$$(t).addClass("coveo-facet-settings-disabled"),u.$$(r).addClass("coveo-facet-settings-disabled")),[t,r]},t.prototype.buildSaveStateSection=function(){var e=this,t=this.buildSection("coveo-facet-settings-section-save-state"),n=this.buildIcon("coveo-facet-settings-section-save-state-svg",f.SVGIcons.icons.dropdownMore),i=this.buildItems();this.facetStateLocalStorage=new p.LocalStorageUtils("facet-state-"+this.facet.options.id),this.includedStateAttribute=a.QueryStateModel.getFacetId(this.facet.options.id),this.excludedStateAttribute=a.QueryStateModel.getFacetId(this.facet.options.id,!1),this.operatorStateAttribute=a.QueryStateModel.getFacetOperator(this.facet.options.id);var o=document.createElement("div");return u.$$(o).addClass("coveo-facet-settings-item"),o.setAttribute("title",l.l("SaveFacetState")),u.$$(o).text(l.l("SaveFacetState")),i.appendChild(o),t.appendChild(n),t.appendChild(i),(new c.AccessibleButton).withElement(t).withSelectAction(function(){return e.handleSaveStateClick()}).withoutLabelOrTitle().build(),t},t.prototype.buildClearStateSection=function(){var e=this,t=this.buildSection("coveo-facet-settings-section-clear-state"),n=this.buildIcon("coveo-facet-settings-section-clear-state-svg",f.SVGIcons.icons.dropdownLess),i=this.buildItems(),o=this.buildItem(l.l("ClearFacetState"));return i.appendChild(o),t.appendChild(n),t.appendChild(i),(new c.AccessibleButton).withElement(t).withSelectAction(function(){return e.handleClearStateClick()}).withoutLabelOrTitle().build(),t},t.prototype.buildHideSection=function(){var e=this,t=this.buildSection("coveo-facet-settings-section-hide"),n=this.buildIcon("coveo-facet-settings-section-hide-svg",f.SVGIcons.icons.facetCollapse),i=this.buildItems(),o=this.buildItem(l.l("Collapse"));return i.appendChild(o),t.appendChild(n),t.appendChild(i),(new c.AccessibleButton).withElement(t).withSelectAction(function(){e.facet.facetHeader.collapseFacet(),e.close()}).withLabel(l.l("CollapseFacet",this.facet.options.title)).build(),t},t.prototype.buildShowSection=function(){var e=this,t=this.buildSection("coveo-facet-settings-section-show"),n=this.buildIcon("coveo-facet-settings-section-show-svg",f.SVGIcons.icons.facetExpand),i=this.buildItems(),o=this.buildItem(l.l("Expand"));return i.appendChild(o),t.appendChild(n),t.appendChild(i),(new c.AccessibleButton).withElement(t).withSelectAction(function(){e.facet.facetHeader.expandFacet(),e.close()}).withLabel(l.l("ExpandFacet",this.facet.options.title)).build(),t},t.prototype.buildIcon=function(e,t){if(e&&t){var n=u.$$("div",{className:"coveo-icon-container"},t);return d.SVGDom.addClassToSVGInContainer(n.el,e),n.el}return u.$$("div",{className:"coveo-icon"}).el},t.prototype.buildAscendingOrDescending=function(e){var t=this.buildItem(l.l(e));return t.setAttribute("aria-disabled",this.activeSort.directionToggle?"false":"true"),t.setAttribute("data-direction",e.toLowerCase()),t},t.prototype.buildAscendingOrDescendingSection=function(e){return this.buildSection("coveo-facet-settings-section-direction-"+e.toLowerCase())},t.prototype.buildItem=function(e,t){return void 0===t&&(t=e),u.$$("div",{className:"coveo-facet-settings-item",title:t},s.escape(e)).el},t.prototype.buildItems=function(){var e=document.createElement("div");return u.$$(e).addClass("coveo-facet-settings-items"),e},t.prototype.buildSection=function(e){var t=document.createElement("div");return u.$$(t).addClass(["coveo-facet-settings-section",e]),t},t.prototype.handleSettingsButtonClick=function(e){e.stopPropagation(),m.Utils.isNullOrUndefined(this.settingsPopup.parentElement)?this.open():this.close()},t.prototype.handleClickSortButton=function(e,n){this.activeSort!=n&&this.activeSort.relatedSort!=n.name&&(this.activeSort=n,n.directionToggle&&s.contains(this.enabledSorts,t.availableSorts[this.activeSort.relatedSort])?this.activateDirectionSection():this.disableDirectionSection(),this.unselectSection(this.sortSection.element),this.selectItem(e.target),this.closePopupAndUpdateSort())},t.prototype.handleDirectionClick=function(e,n){var i=this;"false"===e.getAttribute("aria-disabled")&&-1===this.activeSort.name.indexOf(n)&&(this.activeSort=t.availableSorts[this.activeSort.relatedSort],s.each(this.directionSection,function(e){i.unselectSection(e)}),this.selectItem(e),"custom"==this.activeSort.name&&this.customSortDirection!=n&&(this.customSortDirection=n,this.customSortDirectionChange=!0),this.closePopupAndUpdateSort())},t.prototype.handleSaveStateClick=function(){this.saveState(),this.close()},t.prototype.handleClearStateClick=function(){var e=this;this.facetStateLocalStorage.remove(),this.facet.reset(),this.close(),this.facet.triggerNewQuery(function(){return e.facet.usageAnalytics.logSearchEvent(y.analyticsActionCauseList.facetClearAll,{facetId:e.facet.options.id,facetField:e.facet.options.field.toString(),facetTitle:e.facet.options.title})})},t.prototype.addOnNukeHandler=function(){var e=this;u.$$(this.facet.root).on(r.InitializationEvents.nuke,function(){return e.handleNuke()})},t.prototype.addOnDocumentClickHandler=function(){var e=this;document.addEventListener("click",function(){return e.onDocumentClick()})},t.prototype.getCurrentDirectionItem=function(e){var t=this;void 0===e&&(e=this.directionSection);var n;return s.each(e,function(e){n||(n=s.find(t.getItems(e),function(e){return-1!=t.activeSort.name.indexOf(e.getAttribute("data-direction"))}))}),n||(n=e[0]),n},t.prototype.activateDirectionSection=function(){var e=this;s.each(this.directionSection,function(t){u.$$(t).removeClass("coveo-facet-settings-disabled"),u.$$(t).find(".coveo-facet-settings-item").setAttribute("aria-disabled","false"),e.unselectSection(t)}),this.selectItem(this.getCurrentDirectionItem())},t.prototype.disableDirectionSection=function(){var e=this;s.each(this.directionSection,function(t){u.$$(t).addClass("coveo-facet-settings-disabled"),u.$$(t).find(".coveo-facet-settings-item").setAttribute("aria-disabled","true"),e.unselectSection(t)})},t.prototype.getItems=function(e){return u.$$(e).findAll(".coveo-facet-settings-item")},t.prototype.unselectSection=function(e){var t=this;s.each(this.getItems(e),function(e){return t.unselectItem(e)})},t.prototype.selectItem=function(e){e&&(u.$$(e).addClass("coveo-selected"),e.setAttribute("aria-pressed","true"))},t.prototype.unselectItem=function(e){e&&(u.$$(e).removeClass("coveo-selected"),e.setAttribute("aria-pressed","false"))},t.prototype.filterDuplicateForRendering=function(){var e=this;s.each(this.enabledSorts,function(t,n){if(null!=t.relatedSort)for(var i=n+1;i<e.enabledSorts.length;i++)if(e.enabledSorts[i].name==t.relatedSort){e.enabledSortsIgnoreRenderBecauseOfPairs.push(e.enabledSorts[i]);break}})},t.prototype.appendIfNotUndefined=function(e){m.Utils.isNullOrUndefined(e)||this.settingsPopup.appendChild(e)},t.prototype.handleNuke=function(){document.removeEventListener("click",this.onDocumentClick)},t}(g.FacetSort);t.FacetSettings=v},484:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(6),o=n(483),s=n(4),r=n(0),a=function(){function e(e,t){var n=this;this.facet=t,this.enabledSorts=[],this.customSortDirection="ascending",r.each(e,function(e){var t=o.FacetSettings.availableSorts[e.toLowerCase()];void 0!=t&&n.enabledSorts.push(t)}),this.removeEnabledSortsBasedOnFacetType(),s.Utils.isNonEmptyArray(this.enabledSorts)&&(void 0!=this.facet.options.sortCriteria&&(this.activeSort=r.find(this.enabledSorts,function(e){return e.name==n.facet.options.sortCriteria})),this.activeSort||(this.activeSort=this.enabledSorts[0]))}return e.prototype.removeEnabledSortsBasedOnFacetType=function(){if(Coveo.FacetRange&&this.facet instanceof Coveo.FacetRange){this.facet.options.slider&&(this.enabledSorts=[])}},e.availableSorts={score:{label:i.l("Score"),directionToggle:!1,description:i.l("ScoreDescription"),name:"score"},occurrences:{label:i.l("Occurrences"),directionToggle:!1,description:i.l("OccurrencesDescription"),name:"occurrences"},alphaascending:{label:i.l("Label"),directionToggle:!0,description:i.l("LabelDescription"),name:"alphaascending",relatedSort:"alphadescending"},alphadescending:{label:i.l("Label"),directionToggle:!0,description:i.l("LabelDescription"),name:"alphadescending",relatedSort:"alphaascending"},computedfieldascending:{label:i.l("Value"),directionToggle:!0,description:i.l("ValueDescription"),name:"computedfieldascending",relatedSort:"computedfielddescending"},computedfielddescending:{label:i.l("Value"),directionToggle:!0,description:i.l("ValueDescription"),name:"computedfielddescending",relatedSort:"computedfieldascending"},chisquare:{label:i.l("RelativeFrequency"),directionToggle:!1,description:i.l("RelativeFrequencyDescription"),name:"chisquare"},nosort:{label:i.l("Nosort"),directionToggle:!1,description:i.l("NosortDescription"),name:"nosort"},custom:{label:i.l("Custom"),directionToggle:!0,description:i.l("CustomDescription"),name:"custom",relatedSort:"custom"}},e}();t.FacetSort=a},485:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(6),s=n(10);n(539);var r=n(12),a=n(16),l=n(15),c=function(){function e(e){this.options=e,this.element=document.createElement("div"),i.$$(this.element).addClass("coveo-facet-header")}return e.prototype.build=function(){var e=i.$$("div",{className:"coveo-facet-header-title-section"});void 0!=this.options.icon&&(this.iconElement=this.buildIcon(),e.append(this.iconElement)),e.append(this.buildTitle()),this.waitElement=this.buildWaitAnimation(),e.append(this.waitElement),this.element.appendChild(e.el);var t=i.$$("div",{className:"coveo-facet-header-settings-section"});return this.eraserElement=this.buildEraser(),t.append(this.eraserElement),this.options.facet&&(this.operatorElement=this.buildOperatorToggle(),t.append(this.operatorElement),i.$$(this.operatorElement).toggle(this.options.facet.options.enableTogglingOperator)),this.options.settingsKlass?(this.sort=this.settings=new this.options.settingsKlass(this.options.availableSorts,this.options.facet),t.append(this.settings.build())):this.options.sortKlass&&(this.sort=new this.options.sortKlass(this.options.availableSorts,this.options.facet)),this.element.appendChild(t.el),this.element},e.prototype.switchToAnd=function(){this.options.facet&&(this.options.facet.options.useAnd=!0,this.rebuildOperatorToggle(),this.updateOperatorQueryStateModel())},e.prototype.switchToOr=function(){this.options.facet&&(this.options.facet.options.useAnd=!1,this.rebuildOperatorToggle(),this.updateOperatorQueryStateModel())},e.prototype.collapseFacet=function(){this.collapseElement&&this.expandElement&&(i.$$(this.collapseElement).hide(),i.$$(this.expandElement).show()),i.$$(this.options.facetElement).addClass("coveo-facet-collapsed")},e.prototype.expandFacet=function(){this.collapseElement&&this.expandElement&&(i.$$(this.expandElement).hide(),i.$$(this.collapseElement).show()),i.$$(this.options.facetElement).removeClass("coveo-facet-collapsed")},e.prototype.updateOperatorQueryStateModel=function(){if(this.options.facet&&this.options.facet.options.enableTogglingOperator){var e="";0==this.options.facet.getSelectedValues().length&&0==this.options.facet.getExcludedValues().length||(e=this.options.facet.options.useAnd?"and":"or"),this.options.facet.queryStateModel.set(this.options.facet.operatorAttributeId,e)}},e.prototype.rebuildOperatorToggle=function(){var e=this.buildOperatorToggle();this.operatorElement&&i.$$(this.operatorElement).replaceWith(e),this.operatorElement=e},e.prototype.buildIcon=function(){var e;return e=this.options.icon?"coveo-icon-custom "+this.options.icon:"coveo-icon "+this.options.field.substr(1),this.iconElement=document.createElement("div"),i.$$(this.iconElement).addClass(e),this.iconElement},e.prototype.buildWaitAnimation=function(){return this.waitElement=i.$$("div",{className:"coveo-facet-header-wait-animation"},r.SVGIcons.icons.loading).el,a.SVGDom.addClassToSVGInContainer(this.waitElement,"coveo-facet-header-wait-animation-svg"),this.waitElement.style.visibility="hidden",this.waitElement},e.prototype.buildOperatorToggle=function(){var e=this,t=o.l("SwitchTo",this.options.facet.options.useAnd?o.l("Or"):o.l("And")),n=i.$$("span",{className:"coveo-"+(this.options.facet.options.useAnd?"and":"or")},r.SVGIcons.icons.orAnd);a.SVGDom.addClassToSVGInContainer(n.el,"coveo-or-and-svg");var s=i.$$("div",{className:"coveo-facet-header-operator",title:t});return s.append(n.el),(new l.AccessibleButton).withElement(s).withLabel(t).withSelectAction(function(){return e.handleOperatorClick()}).build(),s.el},e.prototype.handleOperatorClick=function(){var e=this;if(this.options.facet.options.useAnd?this.options.facet.switchToOr():this.options.facet.switchToAnd(),0!=this.options.facet.getSelectedValues().length){var t=this.options.facet.options.useAnd?"AND":"OR",n=this.options.facet.options.useAnd?"OR":"AND";this.options.facet.triggerNewQuery(function(){return e.options.facet.usageAnalytics.logSearchEvent(s.analyticsActionCauseList.facetToggle,{facetId:e.options.facet.options.id,facetField:e.options.field.toString(),facetOperatorBefore:n,facetOperatorAfter:t,facetTitle:e.options.title})})}},e.prototype.buildTitle=function(){var e=i.$$("div",{className:"coveo-facet-header-title"});return e.text(this.options.title),e.setAttribute("role","heading"),e.setAttribute("aria-level","2"),e.setAttribute("aria-label",o.l("FacetTitle",this.options.title)+"."),e.el},e.prototype.buildEraser=function(){var e=this,t=i.$$("div",{className:"coveo-facet-header-eraser"},r.SVGIcons.icons.mainClear);return a.SVGDom.addClassToSVGInContainer(t.el,"coveo-facet-header-eraser-svg"),(new l.AccessibleButton).withElement(t.el).withLabel(o.l("Clear",this.options.title)).withClickAction(function(){return e.onEraserClick()}).withEnterKeyboardAction(function(){return e.onEraserClick()}).build(),t.el},e.prototype.onEraserClick=function(){var e=this.options.facet||this.options.facetSlider;e.reset(),e.usageAnalytics.logSearchEvent(s.analyticsActionCauseList.facetClearAll,{facetId:e.options.id,facetField:e.options.field.toString(),facetTitle:e.options.title}),e.queryController.executeQuery()},e}();t.FacetHeader=c},486:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),n(543);var i=n(0),o=n(5),s=n(15),r=n(1),a=n(12),l=n(10),c=n(6),u=function(){function e(e,t){this.facet=e,this.facetValue=t}return e.prototype.build=function(){o.Assert.exists(this.facetValue);var e=this.buildElements(),t=e.container,n=e.caption,i=e.clear,s=e.listContainer;return t.append(n.el),t.append(i.el),s.append(t.el),s},e.prototype.getBreadcrumbTooltip=function(){var e=[this.facet.getValueCaption(this.facetValue),this.facetValue.getFormattedCount(),this.facetValue.getFormattedComputedField(this.facet.options.computedFieldFormat)];return i.compact(e).join(" ")},e.prototype.buildElements=function(){return{container:this.buildContainer(),clear:this.buildClear(),caption:this.buildCaption(),listContainer:this.buildListContainer()}},e.prototype.buildContainer=function(){var e=this,t=r.$$("div",{className:"coveo-facet-breadcrumb-value"});t.toggleClass("coveo-selected",this.facetValue.selected),t.toggleClass("coveo-excluded",this.facetValue.excluded);var n=this.facetValue.excluded?"Unexclude":"RemoveFilterOn",i=c.l(n,this.facet.getValueCaption(this.facetValue));return(new s.AccessibleButton).withElement(t).withLabel(i).withSelectAction(function(){return e.selectAction()}).build(),t},e.prototype.buildListContainer=function(){return r.$$("li",{className:"coveo-facet-breadcrumb-value-list-item"})},e.prototype.buildClear=function(){return r.$$("span",{className:"coveo-facet-breadcrumb-clear"},a.SVGIcons.icons.mainClear)},e.prototype.buildCaption=function(){var e=r.$$("span",{className:"coveo-facet-breadcrumb-caption"});return e.text(this.facet.getValueCaption(this.facetValue)),e},e.prototype.selectAction=function(){var e=this;this.facetValue.excluded?this.facet.unexcludeValue(this.facetValue.value):this.facet.deselectValue(this.facetValue.value),this.facet.triggerNewQuery(function(){return e.facet.usageAnalytics.logSearchEvent(l.analyticsActionCauseList.breadcrumbFacet,{facetId:e.facet.options.id,facetField:e.facet.options.field.toString(),facetValue:e.facetValue.value,facetTitle:e.facet.options.title})}),this.focusOnContainer()},e.prototype.focusOnContainer=function(){var e=i.first(this.facet.searchInterface.getComponents("Breadcrumb"));e&&e.element.focus()},e}();t.BreadcrumbValueElement=u},487:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(23),o=n(0),s=n(5),r=n(6),a=n(1),l=n(15),c=n(48),u=function(){function e(e,t,n,i){this.facet=e,this.facetValues=t,this.breadcrumbValueElementKlass=n,this.options=i,this.setExpandedAndCollapsed(),this.elem=a.$$("div",{className:"coveo-facet-breadcrumb"}).el;var o=a.$$(c.getHeadingTag(this.options&&this.options.headingLevel,"span"));o.addClass("coveo-facet-breadcrumb-title"),o.text(this.facet.options.title+":"),this.elem.appendChild(o.el),this.valueContainer=a.$$("ul",{className:"coveo-facet-breadcrumb-values"}).el,this.elem.appendChild(this.valueContainer)}return e.prototype.build=function(){return this.buildExpanded(),0!=this.collapsed.length&&this.buildCollapsed(),this.elem},e.prototype.buildAsString=function(){return this.build(),this.elem?this.facet.options.title+": "+a.$$(this.elem).findAll(".coveo-facet-breadcrumb-value").map(function(e){return a.$$(e).text()}).join(", "):""},e.prototype.buildExpanded=function(){var e=this;this.expanded.forEach(function(t){var n=new e.breadcrumbValueElementKlass(e.facet,t).build();e.valueContainer.appendChild(n.el)})},e.prototype.buildCollapsed=function(){var e=this,t=o.filter(this.collapsed,function(e){return e.selected}).length,n=o.filter(this.collapsed,function(e){return e.excluded}).length;s.Assert.check(t+n==this.collapsed.length);var c=a.$$("div",{className:"coveo-facet-breadcrumb-value"},a.$$("span",{className:"coveo-facet-breadcrumb-multi-count"},r.l("NMore",i.format(t+n,"n0")))),u=a.$$("li",{className:"coveo-facet-breadcrumb-value-list-item"},c),h=this.collapsed.map(function(t){return new e.breadcrumbValueElementKlass(e.facet,t)}),p=h.map(function(e){return e.getBreadcrumbTooltip()}).join("\n");(new l.AccessibleButton).withElement(c).withTitle(p).withSelectAction(function(){c.remove(),h.forEach(function(t){e.valueContainer.appendChild(t.build().el)})}).build(),this.valueContainer.appendChild(u.el)},e.prototype.setExpandedAndCollapsed=function(){this.facetValues.length>this.facet.options.numberOfValuesInBreadcrumb?(this.collapsed=o.rest(this.facetValues,this.facet.options.numberOfValuesInBreadcrumb),this.expanded=o.first(this.facetValues,this.facet.options.numberOfValuesInBreadcrumb)):(this.collapsed=[],this.expanded=this.facetValues)},e}();t.BreadcrumbValueList=u},488:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(70),o=n(1),s=n(4),r=n(17),a=n(173),l=n(10),c=n(6),u=n(5),h=n(119),p=n(22),d=n(132),f=n(26),m=n(19),y=n(131),g=n(479);n(544);var v=n(0),b=n(480),S=function(){function e(e,t,n){var s=this;this.facet=e,this.facetSearchValuesListKlass=t,this.root=n,this.moreValuesToFetch=!0,this.lastSearchWasEmpty=!0,this.facetSearchElement=new b.FacetSearchElement(this),this.onResize=v.debounce(function(){s.facet instanceof i.Facet&&s.facet.searchInterface instanceof m.SearchInterface&&s.shouldPositionSearchResults()&&s.positionSearchResults()},250),this.onDocumentClick=function(e){s.handleClickElsewhere(e)},window.addEventListener("resize",this.onResize),document.addEventListener("click",function(e){return s.onDocumentClick(e)}),o.$$(e.root).on(r.InitializationEvents.nuke,function(){return s.handleNuke()})}return Object.defineProperty(e.prototype,"facetType",{get:function(){return i.Facet.ID},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"facetTitle",{get:function(){return this.facet.options.title||this.facet.options.field.toString()},enumerable:!0,configurable:!0}),e.prototype.build=function(){return this.buildBaseSearch()},e.prototype.positionSearchResults=function(){this.facetSearchElement.positionSearchResults()},e.prototype.fetchMoreValues=function(){this.triggerNewFacetSearch(this.buildParamsForFetchingMore())},e.prototype.dismissSearchResults=function(){this.cancelAnyPendingSearchOperation(),this.facet.unfadeInactiveValuesInMainList(),o.$$(this.searchResults).empty(),this.moreValuesToFetch=!0,o.$$(this.search).removeClass("coveo-facet-search-no-results"),o.$$(this.facet.element).removeClass("coveo-facet-searching"),this.facetSearchElement.hideSearchResultsElement(),this.input.value="",o.$$(this.clear).hide(),this.currentlyDisplayedResults=void 0},e.prototype.triggerNewFacetSearch=function(e){var t=this;this.cancelAnyPendingSearchOperation(),this.facetSearchElement.showFacetSearchWaitingAnimation(),this.facet.logger.info("Triggering new facet search"),this.facetSearchPromise=this.facet.facetQueryController.search(e),this.facetSearchPromise&&this.facetSearchPromise.then(function(n){t.facet.usageAnalytics.logCustomEvent(l.analyticsActionCauseList.facetSearch,{facetId:t.facet.options.id,facetField:t.facet.options.field.toString(),facetTitle:t.facet.options.title},t.facet.root),t.facet.logger.debug("Received field values",n),t.processNewFacetSearchResults(n,e),t.facetSearchElement.hideFacetSearchWaitingAnimation(),t.facetSearchPromise=void 0}).catch(function(e){return s.Utils.exists(e)&&(t.facet.logger.error("Error while retrieving facet values",e),t.facetSearchElement.hideFacetSearchWaitingAnimation()),t.facetSearchPromise=void 0,null})},e.prototype.focus=function(){this.facetSearchElement.focus()},Object.defineProperty(e.prototype,"searchResults",{get:function(){return this.facetSearchElement.searchResults},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"searchBarIsAnimating",{get:function(){return this.facetSearchElement.searchBarIsAnimating},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"search",{get:function(){return this.facetSearchElement.search},enumerable:!0,configurable:!0}),e.prototype.setExpandedFacetSearchAccessibilityAttributes=function(e){this.facet.setExpandedFacetSearchAccessibilityAttributes(e)},e.prototype.setCollapsedFacetSearchAccessibilityAttributes=function(){this.facet.setCollapsedFacetSearchAccessibilityAttributes()},e.prototype.keyboardEventDefaultHandler=function(){this.moreValuesToFetch=!0,this.highlightCurrentQueryWithinSearchResults(),this.inputIsEmpty()?this.lastSearchWasEmpty||(this.currentlyDisplayedResults=void 0,o.$$(this.searchResults).empty(),this.lastSearchWasEmpty=!0,this.displayNewValues(this.buildParamsForFetchingMore())):(this.lastSearchWasEmpty=!1,this.displayNewValues(this.buildParamsForNormalSearch()))},e.prototype.keyboardNavigationEnterPressed=function(e){e.shiftKey?this.triggerNewFacetSearch(this.buildParamsForNormalSearch()):"none"!=this.searchResults.style.display?(this.performActionOnCurrentSearchResult(),this.dismissSearchResults()):o.$$(this.search).is(".coveo-facet-search-no-results")&&this.selectAllValuesMatchingSearch()},e.prototype.keyboardNavigationDeletePressed=function(e){e.shiftKey&&(this.performExcludeActionOnCurrentSearchResult(),this.dismissSearchResults(),this.input.value="")},e.prototype.displayNewValues=function(e){var t=this;void 0===e&&(e=this.buildParamsForExcludingCurrentlyDisplayedValues()),this.cancelAnyPendingSearchOperation(),this.facetSearchTimeout=window.setTimeout(function(){t.triggerNewFacetSearch(e)},this.facet.options.facetSearchDelay)},e.prototype.getCaptions=function(){return o.$$(this.searchResults).findAll(".coveo-facet-value-caption")},e.prototype.getValueInInputForFacetSearch=function(){return this.facetSearchElement.getValueInInputForFacetSearch()},e.prototype.updateAriaLive=function(e){this.facet.searchInterface.ariaLive.updateText(e)},Object.defineProperty(e.prototype,"input",{get:function(){return this.facetSearchElement.input},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"clear",{get:function(){return this.facetSearchElement.clear},enumerable:!0,configurable:!0}),e.prototype.shouldPositionSearchResults=function(){return!y.ResponsiveComponentsUtils.isSmallFacetActivated(o.$$(this.root))&&o.$$(this.facet.element).hasClass("coveo-facet-searching")},e.prototype.buildBaseSearch=function(){var e=this;return this.facetSearchElement.build(function(){return e.handleFacetSearchClear()}),o.$$(this.facetSearchElement.input).on("keyup",function(){return e.showOrHideClearElement()}),this.search},e.prototype.handleNuke=function(){window.removeEventListener("resize",this.onResize),document.removeEventListener("click",this.onDocumentClick)},e.prototype.handleClickElsewhere=function(e){this.currentlyDisplayedResults&&this.search!=e.target&&this.searchResults!=e.target&&this.input!=e.target&&this.dismissSearchResults()},e.prototype.handleFacetSearchClear=function(){this.input.value="",o.$$(this.clear).hide(),this.dismissSearchResults()},e.prototype.showOrHideClearElement=function(){this.inputIsEmpty()?(o.$$(this.clear).hide(),o.$$(this.search).removeClass("coveo-facet-search-no-results")):o.$$(this.clear).show()},e.prototype.cancelAnyPendingSearchOperation=function(){s.Utils.exists(this.facetSearchTimeout)&&(clearTimeout(this.facetSearchTimeout),this.facetSearchTimeout=void 0),s.Utils.exists(this.facetSearchPromise)&&(Promise.reject(this.facetSearchPromise).catch(function(){}),this.facetSearchPromise=void 0),this.facetSearchElement.hideFacetSearchWaitingAnimation()},e.prototype.inputIsEmpty=function(){return""==this.input.value.trim()},e.prototype.processNewFacetSearchResults=function(e,t){u.Assert.exists(e),e=new g.FacetValuesOrder(this.facet,this.facet.facetSort).reorderValues(e),e.length>0?(o.$$(this.search).removeClass("coveo-facet-search-no-results"),this.facet.fadeInactiveValuesInMainList(this.facet.options.facetSearchDelay),this.rebuildSearchResults(e,t),t.fetchMore||this.showSearchResultsElement(),this.highlightCurrentQueryWithinSearchResults(),this.makeFirstSearchResultTheCurrentOne(),this.facetSearchElement.updateAriaLiveWithResults(this.input.value,this.currentlyDisplayedResults.length,this.moreValuesToFetch)):t.fetchMore?this.moreValuesToFetch=!1:(o.$$(this.search).addClass("coveo-facet-search-no-results"),this.showSearchResultsElement(),this.facetSearchElement.emptyAndShowNoResults())},e.prototype.rebuildSearchResults=function(e,t){var n=this;u.Assert.exists(e),t.fetchMore||o.$$(this.searchResults).empty(),s.Utils.isNonEmptyString(t.valueToSearch)&&this.appendSelectAllResultsButton();var i=v.map(e,function(e){return h.FacetValue.create(e)});v.each(new this.facetSearchValuesListKlass(this.facet,d.FacetValueElement).build(i),function(e){n.facetSearchElement.appendToSearchResults(e)}),this.currentlyDisplayedResults?this.currentlyDisplayedResults=this.currentlyDisplayedResults.concat(v.pluck(i,"value")):this.currentlyDisplayedResults=v.pluck(i,"value"),v.each(o.$$(this.searchResults).findAll(".coveo-facet-selectable"),function(e,t){o.$$(e).setAttribute("id","coveo-facet-search-"+n.facet.options.id+"-suggestion-"+t),o.$$(e).setAttribute("role","option"),o.$$(e).setAttribute("aria-selected","false"),o.$$(e).addClass("coveo-facet-search-selectable")})},e.prototype.appendSelectAllResultsButton=function(){var e=this,t=document.createElement("li");o.$$(t).addClass(["coveo-facet-selectable","coveo-facet-search-selectable","coveo-facet-search-select-all"]),o.$$(t).text(c.l("SelectAll")),o.$$(t).on("click",function(){return e.selectAllValuesMatchingSearch()}),this.facetSearchElement.appendToSearchResults(t)},e.prototype.buildParamsForNormalSearch=function(){var e=new a.FacetSearchParameters(this.facet);return e.setValueToSearch(this.getValueInInputForFacetSearch()),e.fetchMore=!1,e},e.prototype.buildParamsForFetchingMore=function(){var e=this.buildParamsForExcludingCurrentlyDisplayedValues();return e.fetchMore=!0,e},e.prototype.buildParamsForExcludingCurrentlyDisplayedValues=function(){var e=new a.FacetSearchParameters(this.facet);return e.excludeCurrentlyDisplayedValuesInSearch(this.searchResults),e.setValueToSearch(this.getValueInInputForFacetSearch()),e},e.prototype.showSearchResultsElement=function(){this.positionSearchResults()},e.prototype.highlightCurrentQueryWithinSearchResults=function(){var e=this.getValueInInputForFacetSearch(),t=new RegExp("("+p.StringUtils.wildcardsToRegex(e,this.facet.options.facetSearchIgnoreAccents)+")","ig");this.facetSearchElement.highlightCurrentQueryInSearchResults(t)},e.prototype.makeFirstSearchResultTheCurrentOne=function(){this.facetSearchElement.setAsCurrentResult(o.$$(this.getSelectables()[0]))},e.prototype.getSelectables=function(e){return void 0===e&&(e=this.searchResults),o.$$(e).findAll(".coveo-facet-selectable")},e.prototype.performActionOnCurrentSearchResult=function(){var e=o.$$(this.searchResults).find(".coveo-facet-search-current-result");if(u.Assert.check(void 0!=e),o.$$(e).hasClass("coveo-facet-value-will-exclude"))return void o.$$(e).find(".coveo-facet-value-exclude").click();var t=o.$$(e).find('input[type="checkbox"]');t?(t.checked=!0,o.$$(t).trigger("change")):e.click()},e.prototype.performExcludeActionOnCurrentSearchResult=function(){var e=o.$$(this.searchResults).find(".coveo-facet-search-current-result");u.Assert.check(null!=e);var t=o.$$(e).find(".coveo-facet-value-caption");this.facet.facetValuesList.get(o.$$(t).text()).toggleExcludeWithUA()},e.prototype.selectAllValuesMatchingSearch=function(){var e=this;this.facet.showWaitingAnimation();var t=new a.FacetSearchParameters(this.facet);t.nbResults=1e3,t.setValueToSearch(this.getValueInInputForFacetSearch()),this.facet.facetQueryController.search(t).then(function(t){e.dismissSearchResults(),f.ModalBox.close(!0);var n=v.map(t,function(t){var n=e.facet.values.get(t.value);return s.Utils.exists(n)||(n=h.FacetValue.create(t)),n.selected=!0,n.excluded=!1,n});e.facet.processFacetSearchAllResultsSelected(n)}),this.dismissSearchResults()},e}();t.FacetSearch=S},489:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=function(){function e(e,t){this.facet=e,this.facetValueElementKlass=t}return e.prototype.build=function(e){var t=this,n=i.map(e,function(e){return i.find(t.facet.values.getAll(),function(t){return t.value==e.value})||e});return i.map(n,function(e){return new t.facetValueElementKlass(t.facet,e,t.facet.keepDisplayedValuesNextTime).build().renderer.listItem})},e}();t.FacetSearchValuesList=o},490:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(132),o=n(1),s=n(119),r=n(4),a=n(40),l=n(0),c=function(){function e(e,t){this.facet=e,this.facetValueElementKlass=t,this.valueList={},this.currentlyDisplayed=[]}return e.prototype.build=function(){return this.valueContainer=document.createElement("ul"),o.$$(this.valueContainer).addClass("coveo-facet-values"),this.valueContainer},e.prototype.getAllCurrentlyDisplayed=function(){return this.currentlyDisplayed},e.prototype.getAll=function(){return l.toArray(this.valueList)},e.prototype.getAllFacetValue=function(){return l.map(this.getAll(),function(e){return e.facetValue})},e.prototype.get=function(e){var t;return e instanceof s.FacetValue?t=e.value:(e=r.Utils.anyTypeToString(e),t=e),this.ensureFacetValueIsInList(e),this.valueList[t.toLowerCase()]},e.prototype.select=function(e){var t=this.get(e);return t.select(),t},e.prototype.unselect=function(e){var t=this.get(e);return t.unselect(),t},e.prototype.exclude=function(e){var t=this.get(e);return t.exclude(),t},e.prototype.unExclude=function(e){var t=this.get(e);return t.unexclude(),t},e.prototype.toggleSelect=function(e){var t=this.get(e);return t.facetValue.selected?t.unselect():t.select(),t},e.prototype.toggleExclude=function(e){var t=this.get(e);return t.facetValue.excluded?t.unexclude():t.exclude(),t},e.prototype.rebuild=function(e){var t=this;o.$$(this.valueContainer).empty(),this.currentlyDisplayed=[];var n=this.getValuesToBuildWith(),i=e,s=document.createDocumentFragment();l.each(n,function(e,n,o){if(t.facetValueShouldBeRemoved(e))t.facet.values.remove(e.value),i+=1;else if(n<i){var r=new t.facetValueElementKlass(t.facet,e,!0);t.valueList[e.value.toLowerCase()]=r;var a=r.build().renderer.listItem;s.appendChild(a),t.currentlyDisplayed.push(r)}}),this.valueContainer.appendChild(s),a.FacetUtils.addNoStateCssClassToFacetValues(this.facet,this.valueContainer)},e.prototype.getValuesToBuildWith=function(){return this.facet.values.getAll()},e.prototype.facetValueShouldBeRemoved=function(e){return!(0!=e.occurrences||0!=e.delta&&void 0!=e.delta||e.selected||e.excluded||this.facet.keepDisplayedValuesNextTime)},e.prototype.ensureFacetValueIsInList=function(e){var t;e instanceof s.FacetValue?null==(t=this.facet.values.get(e.value))&&(this.facet.values.add(e),t=e):null==(t=this.facet.values.get(e))&&(t=s.FacetValue.createFromValue(e),this.facet.values.add(t));var n=t.value.toLowerCase(),o=this.valueList[n];void 0==o?(o=this.valueList[n]=new i.FacetValueElement(this.facet,t,!0),o.build()):o.facetValue=t},e}();t.FacetValuesList=c},491:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(477),s=function(e){function t(t,n,i,o,s){var r=e.call(this,t,n,o,s)||this;return r.facet=t,r.facetValue=n,r.eventArg=i,r}return i(t,e),t.prototype.bindEvent=function(){e.prototype.bindEvent.call(this,{displayNextTime:!1,pinFacet:!1,omniboxObject:this.eventArg})},t}(o.ValueElement);t.OmniboxValueElement=s},492:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=n(1),s=n(4),r=n(40),a=function(){function e(e,t,n,i){this.facet=e,this.facetValues=t,this.omniboxObject=n,this.omniboxValueElementKlass=i}return e.prototype.build=function(){var e=this,t=[];return i.each(this.facetValues,function(n){t.push(e.buildOmniboxForOneRow(n,e.omniboxObject))}),this.buildFinalOmniboxElement(t)},e.prototype.buildOmniboxForOneRow=function(e,t){var n=this,i=function(e,t){return n.logAnalyticsEvent(e,t)},s=function(e,t){return n.logAnalyticsEvent(e,t)},r=new this.omniboxValueElementKlass(this.facet,e,t,i,s),a=r.build().renderer.listItem,l=t.completeQueryExpression.regex,c=t.completeQueryExpression.word;o.$$(a).find(".coveo-facet-value-caption").innerHTML=this.highlightOmniboxMatch(this.facet.getValueCaption(e),l,c);var u=o.$$("ul",{className:"coveo-omnibox-selectable coveo-facet-value coveo-omnibox-facet-value"}).el;return u.appendChild(a),o.$$(u).on("keyboardSelect",function(){var e=o.$$(a).find("input[type=checkbox]");o.$$(e).trigger("change")}),u["no-text-suggestion"]=!0,u},e.prototype.buildFinalOmniboxElement=function(e){var t=this.buildOmniboxHeader();if(!s.Utils.isEmptyArray(e)){var n=o.$$("div",{className:"coveo-omnibox-facet-value"}).el;return n.appendChild(t),i.each(e,function(e){n.appendChild(e)}),r.FacetUtils.addNoStateCssClassToFacetValues(this.facet,n),n}},e.prototype.buildOmniboxHeader=function(){var e=this.facet.options.title,t=o.$$("div",{className:"coveo-omnibox-facet-header"}).el;return o.$$(t).text(e),t},e.prototype.highlightOmniboxMatch=function(e,t,n){var i=e.search(t),o=i+n.length;return e.slice(0,i)+'<span class="coveo-highlight">'+e.slice(i,o)+"</span>"+e.slice(o)},e.prototype.logAnalyticsEvent=function(e,t){var n=i.pluck(this.facetValues,"value");e.facet.usageAnalytics.logSearchEvent(t,{query:this.omniboxObject.completeQueryExpression.word,facetId:e.facet.options.id,facetField:e.facet.options.field.toString(),facetTitle:e.facet.options.title,facetValue:e.facetValue.value,suggestions:n.join(";"),suggestionRanking:i.indexOf(n,e.facetValue.value)})},e}();t.OmniboxValuesList=a},528:function(e,t){},529:function(e,t){},530:function(e,t){},531:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(62),o=n(19),s=n(93),r=n(1),a=n(7),l=n(9),c=function(){function e(e,t,n,i){this.coveoRoot=e,this.ID=t,this.searchInterface=a.Component.get(this.coveoRoot.el,o.SearchInterface,!1),this.currentMode="large"}return e.init=function(t,n,o){if(!r.$$(t).find("."+a.Component.computeCssClassName(s.ResultList))){return void new l.Logger("ResponsiveDefaultResultTemplate").trace("No ResultLayout component found : Cannot instantiate ResponsiveResultLayout")}i.ResponsiveComponentsManager.register(e,r.$$(t),s.ResultList.ID,n,o)},e.prototype.registerComponent=function(e){return e instanceof s.ResultList&&(this.resultList=e,!0)},e.prototype.handleResizeEvent=function(){var e=this,t=this.resultList.queryController.getLastResults();this.needSmallMode()?(r.$$(this.resultList.options.resultsContainer).addClass("coveo-card-layout-container"),r.$$(this.resultList.options.resultsContainer).removeClass("coveo-list-layout-container"),"small"!=this.currentMode&&(t&&this.resultList.buildResults(t).then(function(t){e.resultList.renderResults(t)}),this.currentMode="small")):(r.$$(this.resultList.options.resultsContainer).removeClass("coveo-card-layout-container"),r.$$(this.resultList.options.resultsContainer).addClass("coveo-list-layout-container"),"large"!=this.currentMode&&(t&&this.resultList.buildResults(t).then(function(t){e.resultList.renderResults(t)}),this.currentMode="large"))},e.prototype.needSmallMode=function(){return this.coveoRoot.width()<=this.searchInterface.responsiveComponents.getSmallScreenWidth()},e}();t.ResponsiveDefaultResultTemplate=c},532:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=function(){function e(e,t){this.searchInterface=t,this.resultContainerElement=i.$$(e)}return e.prototype.empty=function(){this.searchInterface.detachComponentsInside(this.resultContainerElement.el),i.$$(this.resultContainerElement).empty()},e.prototype.addClass=function(e){this.resultContainerElement.addClass(e)},e.prototype.isEmpty=function(){return this.resultContainerElement.isEmpty()},e.prototype.hideChildren=function(){this.resultContainerElement.children().forEach(function(e){return i.$$(e).hide()})},e.prototype.getResultElements=function(){return this.resultContainerElement.findAll(".CoveoResult")},Object.defineProperty(e.prototype,"el",{get:function(){return this.resultContainerElement.el},enumerable:!0,configurable:!0}),e.resultCurrentlyBeingRendered=null,e}();t.ResultContainer=o},533:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(215),s=n(1),r=n(0),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return i(t,e),t.prototype.getEndFragment=function(e){var t=this;return new Promise(function(n){if(!r.isEmpty(e)){if(t.resultListOptions.enableInfiniteScroll){var i=s.$$(t.resultListOptions.resultsContainer).findAll(".coveo-card-layout-padding");r.each(i,function(e){return s.$$(e).remove()})}var o=document.createDocumentFragment();r.times(3,function(){return o.appendChild(s.$$("div",{className:"coveo-card-layout coveo-card-layout-padding"}).el)}),n(o)}n(null)})},t}(o.ResultListRenderer);t.ResultListCardRenderer=a},534:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(r,a)}l((i=i.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(r=s[2&n[0]?"return":n[0]?"throw":"next"])&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[0,r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,s=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],s=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var r=n(215),a=n(470),l=n(1),c=n(0),u=function(e){function t(t,n){var i=e.call(this,t,n)||this;return i.resultListOptions=t,i.autoCreateComponentsFn=n,i.shouldDisplayHeader=!0,i.shouldDisplayFooter=!1,i.resultListOptions.resultTemplate instanceof a.TableTemplate&&(i.resultListOptions.resultTemplate.hasTemplateWithRole("table-footer")&&(i.shouldDisplayFooter=!0),0===i.resultListOptions.resultTemplate.templates.length||i.resultListOptions.resultTemplate.hasTemplateWithRole("table-header")||(i.shouldDisplayHeader=!1)),i}return i(t,e),t.prototype.getStartFragment=function(e,t){if(!t&&!c.isEmpty(e)&&this.shouldDisplayHeader)return this.renderRoledTemplate("table-header")},t.prototype.getEndFragment=function(e,t){if(!t&&!c.isEmpty(e)&&this.shouldDisplayFooter)return this.renderRoledTemplate("table-footer")},t.prototype.renderRoledTemplate=function(e){return o(this,void 0,void 0,function(){var t,n;return s(this,function(i){switch(i.label){case 0:return[4,this.resultListOptions.resultTemplate.instantiateRoleToElement(e)];case 1:return t=i.sent(),l.$$(t).addClass("coveo-result-list-"+e),this.autoCreateComponentsFn(t,void 0),n=document.createDocumentFragment(),n.appendChild(t),[2,n]}})})},t}(r.ResultListRenderer);t.ResultListTableRenderer=u},536:function(e,t){},537:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(94),o=n(20),s=n(12),r=n(471),a=function(){function e(e,t,n,i){this.componentName=e,this.element=t,this.closeButtonLabel=n,this.close=i,this.className="coveo-"+this.componentName+"-dropdown-modal-content"}return Object.defineProperty(e.prototype,"hidden",{set:function(e){this.element.toggleClass("coveo-hidden",e)},enumerable:!0,configurable:!0}),e.prototype.positionDropdown=function(){this.element.el.classList.add(this.className,i.ResponsiveDropdownContent.DEFAULT_CSS_CLASS_NAME),this.element.setAttribute("role","group"),this.element.setAttribute("aria-label",o.l("FiltersDropdown")),this.hidden=!1,this.ensureCloseButton(),this.ensureFocusTrap()},e.prototype.hideDropdown=function(){this.element.el.classList.remove(this.className,i.ResponsiveDropdownContent.DEFAULT_CSS_CLASS_NAME),this.element.setAttribute("role",null),this.element.setAttribute("aria-label",null),this.hidden=!0,this.removeCloseButton(),this.removeFocusTrap()},e.prototype.cleanUp=function(){this.hidden=!1},e.prototype.ensureCloseButton=function(){var e=this;this.closeButton||(this.closeButton=o.$$("button",{className:"coveo-facet-modal-close-button",type:"button",ariaLabel:this.closeButtonLabel},s.SVGIcons.icons.mainClear),this.closeButton.on("click",function(){return e.close()}),this.element.prepend(this.closeButton.el))},Object.defineProperty(e.prototype,"focusableSelector",{get:function(){return["[data-field]:not(.coveo-facet-empty) [tabindex]","[data-field]:not(.coveo-hidden) button",".coveo-facet-modal-close-button"].join(" , ")},enumerable:!0,configurable:!0}),e.prototype.ensureFocusTrap=function(){this.focusTrap||(this.focusTrap=new r.FocusTrap(this.element.el,{focusableSelector:this.focusableSelector}))},e.prototype.removeCloseButton=function(){this.closeButton&&(this.closeButton.remove(),this.closeButton=null)},e.prototype.removeFocusTrap=function(){this.focusTrap&&(this.focusTrap.disable(),this.focusTrap=null)},e}();t.ResponsiveDropdownModalContent=a},538:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(){}return e.popupOpened="popupOpened",e.popupClosed="popupClosed",e}();t.FacetsMobileModeEvents=i},539:function(e,t){},541:function(e,t){},542:function(e,t){},543:function(e,t){},544:function(e,t){},545:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(25),o=function(){function e(e){this.facetSearch=e}return e.prototype.handleKeyboardEvent=function(e){switch(e.which){case i.KEYBOARD.ENTER:this.facetSearch.keyboardNavigationEnterPressed(e);break;case i.KEYBOARD.DELETE:this.facetSearch.keyboardNavigationDeletePressed&&this.facetSearch.keyboardNavigationDeletePressed(e);break;case i.KEYBOARD.ESCAPE:this.facetSearch.dismissSearchResults();break;case i.KEYBOARD.DOWN_ARROW:this.facetSearch.facetSearchElement.moveCurrentResultDown();break;case i.KEYBOARD.UP_ARROW:this.facetSearch.facetSearchElement.moveCurrentResultUp();break;default:this.facetSearch.keyboardEventDefaultHandler()}},e.prototype.handleFacetSearchResultsScroll=function(){if(!this.facetSearch.facetSearchPromise&&""==this.facetSearch.facetSearchElement.getValueInInputForFacetSearch()&&this.facetSearch.moreValuesToFetch){var e=this.facetSearch.facetSearchElement.searchResults.clientHeight;this.facetSearch.facetSearchElement.searchResults.scrollHeight-(this.facetSearch.facetSearchElement.searchResults.scrollTop+e)<e/2&&this.facetSearch.fetchMoreValues()}},e}();t.FacetSearchUserInputHandler=o},546:function(e,t,n){"use strict";function i(e,t){switch(e.facetType){case l.Facet.ID:return new r.FacetSearchDropdownNavigator(o({},t,{facetSearch:e}));case a.CategoryFacet.ID:default:return new s.DefaultSearchDropdownNavigator(t)}}var o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0});var s=n(481),r=n(547),a=n(95),l=n(70);t.SearchDropdownNavigatorFactory=i},547:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(481),o=n(1),s=function(){function e(e){this.config=e,this.defaultDropdownNavigator=new i.DefaultSearchDropdownNavigator(e)}return e.prototype.setAsCurrentResult=function(e){this.defaultDropdownNavigator.setAsCurrentResult(e)},Object.defineProperty(e.prototype,"currentResult",{get:function(){return this.defaultDropdownNavigator.currentResult},enumerable:!0,configurable:!0}),e.prototype.focusNextElement=function(){if(this.toggleCanExcludeCurrentResult(),this.willExcludeCurrentResult)return void this.announceCurrentResultCanBeExcluded();this.defaultDropdownNavigator.moveCurrentResultDown()},e.prototype.focusPreviousElement=function(){if(this.willExcludeCurrentResult)return void this.toggleCanExcludeCurrentResult();this.moveResultUp(),this.toggleCanExcludeCurrentResult()},e.prototype.moveResultUp=function(){if(this.willExcludeCurrentResult)return void this.toggleCanExcludeCurrentResult();this.defaultDropdownNavigator.moveCurrentResultUp(),this.toggleCanExcludeCurrentResult()},Object.defineProperty(e.prototype,"isCurrentResultNotAFacetValue",{get:function(){return this.currentResult.hasClass("coveo-facet-search-select-all")||this.currentResult.hasClass("coveo-facet-value-not-found")},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"willExcludeCurrentResult",{get:function(){return this.currentResult.hasClass("coveo-facet-value-will-exclude")},enumerable:!0,configurable:!0}),e.prototype.toggleCanExcludeCurrentResult=function(){this.isCurrentResultNotAFacetValue||this.currentResult.toggleClass("coveo-facet-value-will-exclude",!this.willExcludeCurrentResult)},e.prototype.announceCurrentResultCanBeExcluded=function(){if(!this.isCurrentResultNotAFacetValue){var e=o.$$(this.currentResult).find(".coveo-facet-value-exclude");this.config.facetSearch.updateAriaLive(e.getAttribute("aria-label"))}},e}();t.FacetSearchDropdownNavigator=s},548:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(12),s=n(16),r=n(0),a=n(6),l=n(23),c=function(){function e(){this.listRoot=i.$$("ul",{className:"coveo-category-facet-values"}),this.collapseArrow=i.$$("span",{className:"coveo-category-facet-collapse-children"},o.SVGIcons.icons.arrowDown),s.SVGDom.addClassToSVGInContainer(this.collapseArrow.el,"coveo-category-facet-collapse-children-svg")}return e.prototype.buildListRoot=function(){return this.listRoot.clone(!0)},e.prototype.buildListElement=function(e){var t=i.$$("div",{},this.createListElement(e));return i.$$(t.el.firstChild)},e.prototype.buildAllCategoriesButton=function(){var e=i.$$("span",{className:"coveo-category-facet-all-categories-caption"},a.l("AllCategories"));return i.$$("li",{className:"coveo-category-facet-value coveo-category-facet-all-categories"},this.buildCollapseArrow(),e)},e.prototype.buildEllipsis=function(){var e=i.$$("span",{className:"coveo-category-facet-ellipsis-caption"},"[ ... ]");return i.$$("li",{className:"coveo-category-facet-ellipsis"},e)},e.prototype.buildCollapseArrow=function(){return this.collapseArrow.clone(!0)},e.prototype.getFormattedCount=function(e){return l.format(e,"n0")},e.prototype.createListElement=function(e){return'<li class="coveo-category-facet-value">\n <label class="coveo-category-facet-value-label">\n <span title="'+r.escape(e.value)+'" class="coveo-category-facet-value-caption">'+r.escape(e.value)+'</span>\n <span class="coveo-category-facet-value-count">'+this.getFormattedCount(e.count)+"</span>\n </label>\n </li>"},e}();t.CategoryFacetTemplates=c},549:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(482),o=function(){function e(e,t,n){this.element=e,this.path=[],this.categoryChildrenValueRenderer=new i.CategoryChildrenValueRenderer(e,t,this,n),this.listRoot=t.buildListRoot(),this.appendListRoot()}return e.prototype.renderChildren=function(e){this.appendListRoot(),this.categoryChildrenValueRenderer.renderChildren(e)},e.prototype.renderAsParent=function(e){return this.appendListRoot(),this.categoryChildrenValueRenderer.renderAsParent(e)},Object.defineProperty(e.prototype,"children",{get:function(){return this.categoryChildrenValueRenderer.children},enumerable:!0,configurable:!0}),e.prototype.clear=function(){this.listRoot.detach(),this.listRoot.empty(),this.categoryChildrenValueRenderer.clearChildren()},e.prototype.appendListRoot=function(){this.element.append(this.listRoot.el)},e}();t.CategoryValueRoot=o},550:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(482),s=n(10),r=n(15),a=n(6),l=function(){function e(e,t,n,i){this.listRoot=e,this.categoryValueDescriptor=t,this.categoryFacetTemplates=n,this.categoryFacet=i,this.isActive=!1,this.element=this.categoryFacetTemplates.buildListElement({value:this.captionedValueDescriptorValue,count:this.categoryValueDescriptor.count}),this.collapseArrow=this.categoryFacetTemplates.buildCollapseArrow(),this.categoryChildrenValueRenderer=new o.CategoryChildrenValueRenderer(this.element,n,this,this.categoryFacet),this.path=this.categoryValueDescriptor.path}return e.prototype.render=function(e){this.pastMaximumDepth()&&this.element.addClass("coveo-category-facet-last-value"),e?this.element.addClass("coveo-category-facet-child-value"):this.element.addClass("coveo-category-facet-parent-value"),this.listRoot.append(this.element.el)},e.prototype.getDescriptor=function(){return{value:this.categoryValueDescriptor.value,count:this.categoryValueDescriptor.count,path:this.path}},e.prototype.clear=function(){this.element.detach(),this.categoryChildrenValueRenderer.clearChildren()},e.prototype.renderChildren=function(e){this.isActive=!0,this.element.addClass("coveo-active-category-facet-parent"),this.categoryChildrenValueRenderer.renderChildren(e)},e.prototype.renderAsParent=function(e){return this.categoryChildrenValueRenderer.renderAsParent(e)},Object.defineProperty(e.prototype,"children",{get:function(){return this.categoryChildrenValueRenderer.children},enumerable:!0,configurable:!0}),e.prototype.makeSelectable=function(){var e=this,t=i.$$(this.element.find(".coveo-category-facet-value-label"));t.addClass("coveo-selectable");var n=this.categoryValueDescriptor.count,o=a.l("ResultCount",n.toString(),n),s=a.l("IncludeValueWithResultCount",this.captionedValueDescriptorValue,o);return(new r.AccessibleButton).withElement(t).withSelectAction(function(){return e.onSelect()}).withLabel(s).build(),this},e.prototype.showCollapseArrow=function(){if(!this.collapseArrow.el.parentElement){var e=this.element.find("label");i.$$(e).prepend(this.collapseArrow.el)}return this},Object.defineProperty(e.prototype,"captionedValueDescriptorValue",{get:function(){var e=this.categoryValueDescriptor.value;return this.categoryFacet.getCaption(e)},enumerable:!0,configurable:!0}),e.prototype.onSelect=function(){this.pastMaximumDepth()||(this.categoryFacet.logAnalyticsEvent(s.analyticsActionCauseList.categoryFacetSelect,this.path),this.categoryFacet.scrollToTop(),this.categoryFacet.changeActivePath(this.path),this.categoryFacet.executeQuery())},e.prototype.pastMaximumDepth=function(){return this.path.length-this.categoryFacet.options.basePath.length>=this.categoryFacet.options.maximumDepth},e}();t.CategoryValue=l},551:function(e,t,n){"use strict";var i=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},o=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(r,a)}l((i=i.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(r=s[2&n[0]?"return":n[0]?"throw":"next"])&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[0,r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,s=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],s=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var r=n(476),a=n(4),l=function(){function e(e){this.categoryFacet=e}return e.prototype.putCategoryFacetInQueryBuilder=function(e,t,n){var i=e.categoryFacets.length;return this.addQueryFilter(e,t),this.addCategoryFacetRequest(e,t,n),i},e.prototype.searchFacetValues=function(e,t){return o(this,void 0,void 0,function(){var n,o,a,l;return s(this,function(s){switch(s.label){case 0:return n=i({},this.categoryFacet.queryController.getLastQuery()),o={allowedValues:[this.getAllowedValuesPattern(e)],allowedValuesPatternType:r.AllowedValuesPatternType.Wildcards,maximumNumberOfValues:t,field:this.categoryFacet.options.field,sortCriteria:"occurrences",injectionDepth:this.categoryFacet.options.injectionDepth},n.groupBy=[o],n.categoryFacets.splice(this.categoryFacet.positionInQuery,1),[4,this.categoryFacet.queryController.getEndpoint().search(n)];case 1:return a=s.sent(),l=function(e,t){return e.numberOfResults==t.numberOfResults?e.value.length-t.value.length:t.numberOfResults-e.numberOfResults},[2,a.groupByResults[0].values.sort(l)]}})})},e.prototype.addDebugGroupBy=function(e,t){e.groupByRequests.push({field:this.categoryFacet.options.field,allowedValues:[".*"+a.Utils.escapeRegexCharacter(t)+".*"],allowedValuesPatternType:r.AllowedValuesPatternType.Regex})},e.prototype.shouldAddFilterToQuery=function(e){return 0!=e.length&&!a.Utils.arrayEqual(e,this.categoryFacet.options.basePath)},e.prototype.addQueryFilter=function(e,t){this.shouldAddFilterToQuery(t)&&e.advancedExpression.addFieldExpression(this.categoryFacet.options.field,"==",[t.join(this.categoryFacet.options.delimitingCharacter)])},e.prototype.addCategoryFacetRequest=function(e,t,n){var i={field:this.categoryFacet.options.field,path:t,injectionDepth:this.categoryFacet.options.injectionDepth,maximumNumberOfValues:n,delimitingCharacter:this.categoryFacet.options.delimitingCharacter};e.categoryFacets.push(i)},e.prototype.getAllowedValuesPattern=function(e){var t=this.categoryFacet.options.basePath,n=this.categoryFacet.options.delimitingCharacter;return a.Utils.isNonEmptyArray(t)?""+t.join(n)+n+"*"+e+"*":"*"+e+"*"},e}();t.CategoryFacetQueryController=l},552:function(e,t){},553:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(r,a)}l((i=i.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(r=s[2&n[0]?"return":n[0]?"throw":"next"])&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[0,r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,s=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],s=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var s=n(95),r=n(480),a=n(0),l=n(1),c=n(16),u=n(12),h=n(6);n(554);var p=n(22),d=n(10),f=n(15),m=n(23),y=function(){function e(e,t){void 0===t&&(t=!0);var n=this;this.categoryFacet=e,this.displayButton=t,this.moreValuesToFetch=!0,this.facetSearchElement=new r.FacetSearchElement(this),this.displayNewValues=a.debounce(this.getDisplayNewValuesFunction(),this.categoryFacet.options.facetSearchDelay),this.categoryFacet.root.addEventListener("click",function(e){return n.handleClickElsewhere(e)}),this.numberOfValuesToFetch=this.categoryFacet.options.numberOfResultsInFacetSearch}return Object.defineProperty(e.prototype,"facetType",{get:function(){return s.CategoryFacet.ID},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"facetTitle",{get:function(){return this.categoryFacet.options.title||this.categoryFacet.options.field.toString()},enumerable:!0,configurable:!0}),e.prototype.setExpandedFacetSearchAccessibilityAttributes=function(e){this.container.setAttribute("aria-expanded","true")},e.prototype.setCollapsedFacetSearchAccessibilityAttributes=function(){this.container.setAttribute("aria-expanded","false")},e.prototype.build=function(){return this.container=l.$$("div",{className:"coveo-category-facet-search-container",role:"button"}),this.container.toggleClass("coveo-category-facet-search-without-button",!this.displayButton),this.displayButton&&this.buildButton(),this.container.append(this.facetSearchElement.build()),l.$$(this.facetSearchElement.search).toggleClass("without-animation",!this.displayButton),this.container},e.prototype.buildButton=function(){var e=this;(new f.AccessibleButton).withElement(this.container).withSelectAction(function(){l.$$(e.categoryFacet.element).addClass("coveo-category-facet-searching"),e.focus()}).withLabel(h.l("SearchFacetResults",this.facetTitle)).build(),this.buildfacetSearchPlaceholder()},e.prototype.focus=function(){this.facetSearchElement.focus()},e.prototype.clear=function(){this.dismissSearchResults(),this.container&&this.container.detach()},e.prototype.dismissSearchResults=function(){this.removeNoResultsCssClasses(),l.$$(this.categoryFacet.element).removeClass("coveo-category-facet-searching"),l.$$(this.facetSearchElement.searchResults).empty(),this.facetSearchElement.clearSearchInput(),this.facetSearchElement.hideSearchResultsElement(),this.currentlyDisplayedResults=null,this.numberOfValuesToFetch=this.categoryFacet.options.numberOfResultsInFacetSearch,this.moreValuesToFetch=!0},e.prototype.keyboardEventDefaultHandler=function(){this.moreValuesToFetch=!0,this.displayNewValues()},e.prototype.keyboardNavigationEnterPressed=function(){this.selectCurrentResult()},e.prototype.fetchMoreValues=function(){this.numberOfValuesToFetch+=this.categoryFacet.options.numberOfResultsInFacetSearch,this.displayNewValues()},e.prototype.getCaptions=function(){var e=l.$$(this.facetSearchElement.searchResults);return e.findAll(".coveo-category-facet-search-value-caption").concat(e.findAll(".coveo-category-facet-search-path-parents")).concat(e.findAll(".coveo-category-facet-search-path-last-value"))},e.prototype.updateAriaLive=function(e){this.categoryFacet.searchInterface.ariaLive.updateText(e)},e.prototype.selectCurrentResult=function(){if(this.facetSearchElement.currentResult){var e=this.facetSearchElement.currentResult.el.dataset.path,t=this.categoryFacet.options.delimitingCharacter,n=e.split(t);this.categoryFacet.changeActivePath(n),this.categoryFacet.logAnalyticsEvent(d.analyticsActionCauseList.categoryFacetSelect,n),this.categoryFacet.executeQuery(),this.categoryFacet.scrollToTop()}},e.prototype.handleClickElsewhere=function(e){var t=l.$$(e.target).closest(".coveo-category-facet-search-container"),n=this.container&&t===this.container.el;t&&n||this.dismissSearchResults()},e.prototype.buildfacetSearchPlaceholder=function(){var e=l.$$("div",{className:"coveo-category-facet-search-placeholder"}),t=l.$$("div",{className:"coveo-category-facet-search-icon"},u.SVGIcons.icons.checkboxHookExclusionMore);c.SVGDom.addClassToSVGInContainer(t.el,"coveo-category-facet-search-icon-svg");var n=l.$$("span",{className:"coveo-category-facet-search-label"},h.l("Search"));e.append(t.el),e.append(n.el),this.container.append(e.el)},e.prototype.getDisplayNewValuesFunction=function(){var e=this;return function(){return i(e,void 0,void 0,function(){var e;return o(this,function(t){switch(t.label){case 0:return this.facetSearchElement.showFacetSearchWaitingAnimation(),this.categoryFacet.logger.info("Triggering new Category Facet search"),[4,this.categoryFacet.categoryFacetQueryController.searchFacetValues(this.facetSearchElement.input.value,this.numberOfValuesToFetch)];case 1:return e=t.sent(),(this.logAnalyticsEvent(),e.length<this.numberOfValuesToFetch&&(this.moreValuesToFetch=!1),0==e.length)?(this.noFacetSearchResults(),[2]):(this.removeNoResultsCssClasses(),this.setFacetSearchResults(e),this.shouldPositionSearchResults&&this.facetSearchElement.positionSearchResults(),this.facetSearchElement.hideFacetSearchWaitingAnimation(),[2])}})})}},e.prototype.setFacetSearchResults=function(e){l.$$(this.facetSearchElement.searchResults).empty(),this.currentlyDisplayedResults=a.pluck(e,"value");for(var t=0;t<e.length;t++){var n=this.buildFacetSearchValue(e[t],t);0==t&&this.facetSearchElement.setAsCurrentResult(n),this.facetSearchElement.appendToSearchResults(n.el)}this.highlightCurrentQueryWithinSearchResults(),this.facetSearchElement.updateAriaLiveWithResults(this.facetSearchElement.input.value,this.currentlyDisplayedResults.length,this.moreValuesToFetch)},e.prototype.getFormattedCount=function(e){return m.format(e,"n0")},e.prototype.buildFacetSearchValue=function(e,t){var n=this,i=e.value.split(this.categoryFacet.options.delimitingCharacter),o=0!=i.slice(0,-1).length?i.slice(0,-1).join("/")+"/":"",s=l.$$("span",{className:"coveo-category-facet-search-value-caption"},a.last(i)),r=l.$$("span",{className:"coveo-category-facet-search-value-number"},this.getFormattedCount(e.numberOfResults)),c=l.$$("span",{className:"coveo-category-facet-search-path-parents"},o),u=l.$$("span",{className:"coveo-category-facet-search-path"},c),p=l.$$("div",{className:"coveo-category-facet-search-first-row"},s,r),m=l.$$("div",{className:"coveo-category-facet-search-second-row"},u),y=l.$$("li",{id:"coveo-category-facet-search-suggestion-"+t,role:"option",ariaSelected:"false",className:"coveo-category-facet-search-value",title:i},p,m);y.el.dataset.path=e.value;var g=h.l("ResultCount",this.getFormattedCount(e.numberOfResults),e.numberOfResults),v=h.l("IncludeValueWithResultCount",a.last(i),g);return(new f.AccessibleButton).withElement(y).withSelectAction(function(){n.categoryFacet.changeActivePath(i),n.categoryFacet.scrollToTop(),n.categoryFacet.logAnalyticsEvent(d.analyticsActionCauseList.categoryFacetSelect,i),n.categoryFacet.executeQuery()}).withLabel(v).build(),y},e.prototype.noFacetSearchResults=function(){this.facetSearchElement.hideFacetSearchWaitingAnimation(),this.facetSearchElement.emptyAndShowNoResults(),l.$$(this.facetSearchElement.search).addClass("coveo-facet-search-no-results"),l.$$(this.categoryFacet.element).addClass("coveo-no-results")},e.prototype.removeNoResultsCssClasses=function(){this.facetSearchElement.search&&l.$$(this.facetSearchElement.search).removeClass("coveo-facet-search-no-results"),l.$$(this.categoryFacet.element).removeClass("coveo-no-results")},e.prototype.highlightCurrentQueryWithinSearchResults=function(){var e=new RegExp("("+p.StringUtils.stringToRegex(this.facetSearchElement.input.value,!0)+")","ig");this.facetSearchElement.highlightCurrentQueryInSearchResults(e)},e.prototype.logAnalyticsEvent=function(){this.categoryFacet.usageAnalytics.logCustomEvent(d.analyticsActionCauseList.categoryFacetSearch,{categoryFacetId:this.categoryFacet.options.id,categoryFacetField:this.categoryFacet.options.field.toString(),categoryFacetTitle:this.categoryFacet.options.title},this.categoryFacet.root)},Object.defineProperty(e.prototype,"shouldPositionSearchResults",{get:function(){var e=this.facetSearchElement.searchResults;return e&&!e.parentElement},enumerable:!0,configurable:!0}),e}();t.CategoryFacetSearch=y},554:function(e,t){},555:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),o=n(12),s=n(15),r=n(6),a=n(0),l=n(48),c=function(){function e(e,t,n,i){this.categoryFacet=e,this.onClickHandler=t,this.categoryValueDescriptor=n,this.options=i}return e.prototype.build=function(){var e=this,t=i.$$("span",{className:"coveo-facet-breadcrumb-clear"},o.SVGIcons.icons.mainClear),n=a.without.apply(void 0,[this.categoryValueDescriptor.path].concat(this.categoryFacet.options.basePath)),c=n.map(function(t){return e.categoryFacet.getCaption(t)}).join("/"),u=i.$$(l.getHeadingTag(this.options&&this.options.headingLevel,"span"),{className:"coveo-category-facet-breadcrumb-title"},this.categoryFacet.options.title+":"),h=i.$$("span",{className:"coveo-category-facet-breadcrumb-values"},c,t);return(new s.AccessibleButton).withElement(h).withLabel(r.l("RemoveFilterOn",c)).withSelectAction(this.onClickHandler).build(),i.$$("span",{className:"coveo-category-facet-breadcrumb"},u,h).el},e}();t.CategoryFacetBreadcrumb=c},556:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(95),o=n(11),s=n(0),r=n(9),a=(function(){function e(){}}(),function(){function e(e){var t=this;this.categoryFacet=e,this.categoryFacet.bind.onRootElement(o.QueryEvents.buildingQuery,function(e){return t.handleBuildingQuery(e)}),this.categoryFacet.bind.onRootElement(o.QueryEvents.querySuccess,function(e){t.handleQuerySuccess(e)})}return e.prototype.handleBuildingQuery=function(e){var t=e.queryBuilder.groupByRequests.length;if(0==this.categoryFacet.activePath.length)this.positionInQuery={start:t,end:t+1},this.addGroupByForEmptyPath(e.queryBuilder);else{var n=this.categoryFacet.activePath;this.positionInQuery={start:t,end:t+n.length},this.addGroupByForEachPathElement(e.queryBuilder,n)}},e.prototype.handleQuerySuccess=function(t){var n=this;t.results.groupByResults.slice(this.positionInQuery.start,this.positionInQuery.end).forEach(function(t){return e.analyzeResults(t,n.categoryFacet.options.delimitingCharacter)})},e.prototype.addGroupByForEmptyPath=function(e){e.groupByRequests.push({field:this.categoryFacet.options.field,injectionDepth:this.categoryFacet.options.injectionDepth})},e.prototype.addGroupByForEachPathElement=function(e,t){var n=this;t.forEach(function(t){n.categoryFacet.categoryFacetQueryController.addDebugGroupBy(e,t)})},e.analyzeResults=function(e,t){var n=this,i=new Map,o=[],r=this.buildPathsFromGroupByValues(e.values,t);return r=s.sortBy(r,function(e){return e.length}),r.forEach(function(e){if(1==e.length)n.addFirstNodeToTree(i,e);else{for(var s=!0,r=e.slice(0,-1),a=i,l=0,c=r;l<c.length;l++){var u=c[l];if(!(a=a.get(u))){n.processOrphan(o,e,t),s=!1;break}}s&&n.addValidNodeToTree(a,e)}}),o},e.buildPathsFromGroupByValues=function(e,t){return s.chain(e).pluck("value").map(function(e){return e.split(t)}).sortBy(function(e){return e.length}).value()},e.addFirstNodeToTree=function(e,t){e.set(t[0],new Map)},e.addValidNodeToTree=function(e,t){e.set(t.slice(-1)[0],new Map)},e.processOrphan=function(e,t,n){var i=t.join(n);e.push(i),this.logger.error("Value "+i+" has no parent.")},e.logger=new r.Logger(i.CategoryFacet),e}());t.CategoryFacetDebug=a},557:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(95),o=n(1),s=n(6),r=n(12),a=n(16),l=n(15),c=function(){function e(e){this.options=e,this.element=document.createElement("div"),o.$$(this.element).addClass("coveo-facet-header")}return e.prototype.build=function(){var e=this.buildWaitAnimation(),t=o.$$("div",{className:"coveo-category-facet-title",role:"heading","aria-level":"2","aria-label":s.l("FacetTitle",this.options.title)+"."},this.options.title);this.element=o.$$("div",{className:"coveo-category-facet-header"},t).el,o.$$(this.element).append(e);var n=this.buildEraser();return o.$$(this.element).append(n),this.element},e.prototype.buildWaitAnimation=function(){var e=o.$$("div",{className:i.CategoryFacet.WAIT_ELEMENT_CLASS},r.SVGIcons.icons.loading).el;return a.SVGDom.addClassToSVGInContainer(e,"coveo-category-facet-header-wait-animation-svg"),e.style.visibility="hidden",e},e.prototype.buildEraser=function(){var e=this,t=o.$$("div",{className:"coveo-category-facet-header-eraser coveo-facet-header-eraser"},r.SVGIcons.icons.mainClear).el;a.SVGDom.addClassToSVGInContainer(t,"coveo-facet-header-eraser-svg");var n=function(){e.options.categoryFacet.reset(),e.options.categoryFacet.scrollToTop()};return(new l.AccessibleButton).withElement(t).withLabel(s.l("Clear",this.options.title)).withClickAction(n).withEnterKeyboardAction(n).build(),t},e}();t.CategoryFacetHeader=c},558:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),o=function(){function e(){this.seenValues=[]}return e.prototype.getValueForLastPartInPath=function(e){for(var t,n={value:"",numberOfResults:0},i=0,o=e;i<o.length;i++){var s=o[i],r=t?t.children:this.seenValues,a=this.findNodeWithValue(r,s);if(!a)return n;t=a}return t?t.result:n},e.prototype.storeNewValues=function(e){for(var t=this,n=this.seenValues,i=0,o=e.parentValues;i<o.length;i++){var s=o[i];if(!this.findNodeWithValue(n,s.value)){var r={result:s,children:[]};n.push(r)}n=this.findNodeWithValue(n,s.value).children}e.values.filter(function(e){return!t.findNodeWithValue(n,e.value)}).forEach(function(e){return n.push({result:e,children:[]})})},e.prototype.findNodeWithValue=function(e,t){return i.find(e,function(e){return e.result.value===t})},e}();t.CategoryFacetValuesTree=o},559:function(e,t){},560:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(5),o=n(4),s=n(119),r=n(0),a=function(){function e(e){o.Utils.exists(e)?this.values=r.map(e.values,function(e){return s.FacetValue.createFromGroupByValue(e)}):this.values=[]}return e.prototype.add=function(e){i.Assert.exists(e),i.Assert.check(!this.contains(e.value)),this.values.push(e)},e.prototype.remove=function(e){i.Assert.isNonEmptyString(e),e=e,this.values=r.filter(this.values,function(t){return t.value!=e})},e.prototype.size=function(){return this.values.length},e.prototype.isEmpty=function(){return 0==this.values.length},e.prototype.at=function(e){return i.Assert.isLargerOrEqualsThan(0,e),i.Assert.isSmallerThan(this.values.length,e),this.values[e]},e.prototype.get=function(e){return r.find(this.values,function(t){return t.value.toLowerCase()==e.toLowerCase()})},e.prototype.contains=function(e){return o.Utils.exists(this.get(e))},e.prototype.getAll=function(){return this.values},e.prototype.getSelected=function(){return r.filter(this.values,function(e){return e.selected})},e.prototype.getExcluded=function(){return r.filter(this.values,function(e){return e.excluded})},e.prototype.hasSelectedOrExcludedValues=function(){return 0!=this.getSelected().length||0!=this.getExcluded().length},e.prototype.hasSelectedAndExcludedValues=function(){return 0!=this.getSelected().length&&0!=this.getExcluded().length},e.prototype.hasOnlyExcludedValues=function(){return 0==this.getSelected().length&&0!=this.getExcluded().length},e.prototype.hasOnlySelectedValues=function(){return 0!=this.getSelected().length&&0==this.getExcluded().length},e.prototype.reset=function(){r.each(this.values,function(e){return e.reset()})},e.prototype.importActiveValuesFromOtherList=function(e){var t=this;i.Assert.exists(e),r.each(e.getSelected(),function(e){var n=t.get(e.value);o.Utils.exists(n)?n.selected=!0:t.values.push(e.cloneWithZeroOccurrences())}),r.each(e.getExcluded(),function(e){var n=t.get(e.value);if(o.Utils.exists(n))n.excluded=!0;else if(0!=e.occurrences){var i=e.occurrences,s=e.cloneWithZeroOccurrences();s.occurrences=i,t.values.push(s)}else t.values.push(e.cloneWithZeroOccurrences())})},e.prototype.updateCountsFromNewValues=function(e){i.Assert.exists(e),this.values=r.map(this.values,function(t){var n=e.get(t.value);return o.Utils.exists(n)?(t.updateCountsFromNewValue(n),t):null==t.occurrences?t.cloneWithZeroOccurrences():t})},e.prototype.updateDeltaWithFilteredFacetValues=function(e,t){var n=this;i.Assert.exists(e),r.each(this.values,function(i){var s=e.get(i.value);i.waitingForDelta=!1,o.Utils.exists(s)?i.occurrences-s.occurrences>0?n.hasOnlyExcludedValues()?(i.delta=null,i.occurrences=s.occurrences):i.delta=i.occurrences-s.occurrences:i.delta=null:i.selected||i.excluded||(t&&0==e.values.length?(i.delta=null,i.occurrences=0):i.delta=i.occurrences)})},e.prototype.mergeWithUnfilteredFacetValues=function(e){var t=this;i.Assert.exists(e);var n=[];r.each(e.values,function(e){var i=t.get(e.value);o.Utils.exists(i)?i.occurrences==e.occurrences?n.push(i):n.push(e.cloneWithDelta(e.occurrences,e.occurrences-i.occurrences)):n.push(e.cloneWithDelta(e.occurrences,e.occurrences))});var s=0;r.each(this.values,function(t){var i=e.get(t.value);if(o.Utils.exists(i)){for(var r=0;r<n.length;r++)if(n[r].value==t.value){s=r+1;break}}else(t.selected||t.excluded)&&(n.splice(s,0,t),s++)}),this.values=n},e.prototype.sort=function(e){var t=e.facetValuesOrder,n=e.numberOfValues;this.values=t.reorderValuesIfUsingAlphabeticalSort(this.values),this.sortValuesDependingOnStatus(n),this.values=t.reorderValuesIfUsingCustomSort(this.values)},e.prototype.sortValuesDependingOnStatus=function(e){this.values=r.sortBy(this.values,function(e){return e.selected?1:e.excluded?3:2}),this.ensureExcludedValuesAreDisplayed(e)},e.prototype.ensureExcludedValuesAreDisplayed=function(e){if(null!=e&&e<this.values.length){var t=this.getExcluded().length,n=this.values.splice(this.values.length-t,t);(i=this.values).splice.apply(i,[e-t,0].concat(n))}var i},e}();t.FacetValues=a},573:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(217),s=n(4),r=function(e){function t(t){var n=e.call(this,t,!1)||this;return n.facet=t,n}return i(t,e),t.prototype.createBasicGroupByRequest=function(t,n){void 0===n&&(n=!0);var i=e.prototype.createBasicGroupByRequest.call(this,null,n);return i.allowedValues=void 0,i=s.Utils.isNonEmptyArray(this.facet.options.ranges)?this.buildGroupByQueryForPredefinedRanges(i):this.buildGroupByQueryForAutomaticRanges(i)},t.prototype.createGroupByAllowedValues=function(){},t.prototype.buildGroupByQueryForAutomaticRanges=function(e){return e.generateAutomaticRanges=!0,e},t.prototype.buildGroupByQueryForPredefinedRanges=function(e){return e.rangeValues=this.facet.options.ranges,e.maximumNumberOfValues=this.facet.options.ranges.length,e},t}(o.FacetQueryController);t.FacetRangeQueryController=r},70:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e};Object.defineProperty(t,"__esModule",{value:!0}),n(541),n(542);var s=n(0),r=n(217),a=n(35),l=n(34),c=n(11),u=n(87),h=n(3),p=n(5),d=n(31),f=n(18),m=n(13),y=n(6),g=n(15),v=n(47),b=n(174),S=n(24),C=n(1),F=n(16),E=n(12),V=n(4),O=n(10),A=n(7),w=n(8),R=n(2),$=n(85),x=n(175),T=n(486),I=n(487),D=n(485),L=n(488),P=n(173),N=n(489),M=n(483),_=n(484),B=n(40),U=n(132),k=n(119),Q=n(560),H=n(490),j=n(479),W=n(491),q=n(492),G=n(478),K=function(e){function t(n,i,o,r){void 0===r&&(r=t.ID);var a=e.call(this,n,r,o)||this;return a.element=n,a.options=i,a.keepDisplayedValuesNextTime=!1,a.values=new Q.FacetValues,a.currentPage=0,a.firstQuery=!0,a.isFieldValueCompatible=!0,a.isFieldValueHierarchical=!1,a.canFetchMore=!0,a.showingWaitAnimation=!1,a.listenToQueryStateChange=!0,a.options=w.ComponentOptions.initComponentOptions(n,t,i),null!=a.options.valueCaption&&(a.options.availableSorts=s.filter(a.options.availableSorts,function(e){return!/^alpha.*$/.test(e)}),a.logger.warn("Because the "+a.options.field+" facet is using value captions, alphabetical sorts are disabled.")),x.ResponsiveFacets.init(a.root,a,a.options),a.omniboxZIndex=t.omniboxIndex,t.omniboxIndex--,a.checkForComputedFieldAndSort(),a.checkForValueCaptionType(),a.checkForCustomSort(),a.initDependsOnManager(),a.initFacetQueryController(),a.initQueryEvents(),a.initQueryStateEvents(),a.initComponentStateEvents(),a.initOmniboxEvents(),a.initBreadCrumbEvents(),a.initSearchAlertEvents(),a.updateNumberOfValues(),a.bind.oneRootElement(c.QueryEvents.querySuccess,function(){a.firstQuery=!1}),a}return i(t,e),t.prototype.setExpandedFacetSearchAccessibilityAttributes=function(e){if(this.searchContainer){p.Assert.exists(e);this.searchContainer.accessibleElement.setAttribute("aria-expanded",(!0).toString())}},t.prototype.setCollapsedFacetSearchAccessibilityAttributes=function(){this.searchContainer&&this.searchContainer.accessibleElement.setAttribute("aria-expanded",(!1).toString())},t.prototype.isCurrentlyDisplayed=function(){return!!C.$$(this.element).isVisible()&&(!!C.$$(this.element).hasClass("coveo-active")||!C.$$(this.element).hasClass("coveo-facet-empty"))},t.prototype.createDom=function(){var e=this;if(this.initBottomAndTopSpacer(),this.buildFacetContent(),this.updateAppearanceDependingOnState(),this.facetSettings&&this.options.enableSettingsFacetState){var t=s.once(function(){e.facetSettings.loadSavedState.apply(e.facetSettings)});this.bind.onRootElement(c.QueryEvents.newQuery,t)}},t.prototype.selectValue=function(e){p.Assert.exists(e),this.ensureDom(),this.logger.info("Selecting facet value",this.facetValuesList.select(e)),this.facetValueHasChanged()},t.prototype.selectMultipleValues=function(e){var t=this;p.Assert.exists(e),this.ensureDom(),s.each(e,function(e){t.logger.info("Selecting facet value",t.facetValuesList.select(e))}),this.facetValueHasChanged()},t.prototype.deselectValue=function(e){p.Assert.exists(e),this.ensureDom(),this.logger.info("Deselecting facet value",this.facetValuesList.unselect(e)),this.facetValueHasChanged()},t.prototype.deselectMultipleValues=function(e){var t=this;p.Assert.exists(e),this.ensureDom(),s.each(e,function(e){t.logger.info("Deselecting facet value",t.facetValuesList.unselect(e))}),this.facetValueHasChanged()},t.prototype.excludeValue=function(e){p.Assert.exists(e),this.ensureDom(),this.logger.info("Excluding facet value",this.facetValuesList.exclude(e)),this.facetValueHasChanged()},t.prototype.excludeMultipleValues=function(e){var t=this;p.Assert.exists(e),this.ensureDom(),s.each(e,function(e){t.logger.info("Excluding facet value",t.facetValuesList.exclude(e))}),this.facetValueHasChanged()},t.prototype.unexcludeValue=function(e){p.Assert.exists(e),this.ensureDom(),this.logger.info("Unexcluding facet value",this.facetValuesList.unExclude(e)),this.facetValueHasChanged()},t.prototype.unexcludeMultipleValues=function(e){var t=this;p.Assert.exists(e),this.ensureDom(),s.each(e,function(e){t.logger.info("Unexcluding facet value",t.facetValuesList.unExclude(e))}),this.facetValueHasChanged()},t.prototype.toggleSelectValue=function(e){p.Assert.exists(e),this.ensureDom(),this.logger.info("Toggle select facet value",this.facetValuesList.toggleSelect(e)),this.facetValueHasChanged()},t.prototype.toggleExcludeValue=function(e){p.Assert.exists(e),this.ensureDom(),this.logger.info("Toggle exclude facet value",this.facetValuesList.toggleExclude(e)),this.facetValueHasChanged()},t.prototype.getDisplayedValues=function(){return s.pluck(this.getDisplayedFacetValues(),"value")},t.prototype.getDisplayedFacetValues=function(){this.ensureDom();var e=this.facetValuesList.getAllCurrentlyDisplayed();return s.map(e,function(e){return e.facetValue})},t.prototype.getSelectedValues=function(){return this.ensureDom(),s.map(this.values.getSelected(),function(e){return e.value})},t.prototype.hasSelectedValue=function(e){var t=this.values.get(e);return t&&t.selected},t.prototype.getExcludedValues=function(){return this.ensureDom(),s.map(this.values.getExcluded(),function(e){return e.value})},t.prototype.reset=function(){this.ensureDom(),this.values.reset(),this.rebuildValueElements(),this.updateAppearanceDependingOnState(),this.updateQueryStateModel()},t.prototype.switchToAnd=function(){this.ensureDom(),this.logger.info("Switching to AND"),this.facetHeader.switchToAnd()},t.prototype.switchToOr=function(){this.ensureDom(),this.logger.info("Switching to OR"),this.facetHeader.switchToOr()},t.prototype.getEndpoint=function(){return this.queryController.getEndpoint()},t.prototype.updateSort=function(e){this.ensureDom(),this.options.sortCriteria!=e&&(this.options.sortCriteria=e,this.usageAnalytics.logCustomEvent(O.analyticsActionCauseList.facetUpdateSort,{criteria:e,facetId:this.options.id,facetField:this.options.field.toString(),facetTitle:this.options.title},this.element),this.triggerNewQuery())},t.prototype.unfadeInactiveValuesInMainList=function(){C.$$(this.element).removeClass("coveo-facet-fade")},t.prototype.fadeInactiveValuesInMainList=function(e){C.$$(this.element).addClass("coveo-facet-fade")},t.prototype.showWaitingAnimation=function(){this.ensureDom(),this.showingWaitAnimation||(C.$$(this.headerElement).find(".coveo-facet-header-wait-animation").style.visibility="visible",this.showingWaitAnimation=!0)},t.prototype.hideWaitingAnimation=function(){this.ensureDom(),this.showingWaitAnimation&&(C.$$(this.headerElement).find(".coveo-facet-header-wait-animation").style.visibility="hidden",this.showingWaitAnimation=!1)},t.prototype.processFacetSearchAllResultsSelected=function(e){var t=this,n=[];s.each(e,function(e){t.ensureFacetValueIsInList(e),n.push(e.value)});var i=this.values.getSelected().concat(this.values.getExcluded());this.numberOfValues=i.length+s.difference(i,e).length,this.numberOfValues=Math.max(this.numberOfValues,this.options.numberOfValues),this.updateQueryStateModel(),this.triggerNewQuery(function(){return t.usageAnalytics.logSearchEvent(O.analyticsActionCauseList.facetSelectAll,{facetId:t.options.id,facetField:t.options.field.toString(),facetTitle:t.options.title})})},t.prototype.pinFacetPosition=function(){this.options.preservePosition&&(this.pinnedViewportPosition=this.element.getBoundingClientRect().top)},t.prototype.getValueCaption=function(e){p.Assert.exists(e);var t="string"==typeof e?e:e.lookupValue||e.value,n=B.FacetUtils.tryToGetTranslatedCaption(this.options.field,t);if(V.Utils.exists(this.options.valueCaption)&&("object"==typeof this.options.valueCaption&&(n=this.options.valueCaption[t]||n),"function"==typeof this.options.valueCaption)){var i=e instanceof k.FacetValue?e:k.FacetValue.create(e),o=this.facetValuesList.get(i).facetValue;n=this.options.valueCaption.call(this,o)}return n},t.prototype.getCaptionForStringValue=function(e){return p.Assert.exists(e),this.getValueCaption(e)},t.prototype.showMore=function(){this.currentPage=Math.floor((this.numberOfValues-this.options.numberOfValues)/this.options.pageSize)+1,this.updateNumberOfValues(),this.nbAvailableValues>=this.numberOfValues||!this.canFetchMore?this.rebuildValueElements():this.triggerMoreQuery()},t.prototype.showLess=function(){C.$$(this.lessElement).removeClass("coveo-active"),this.currentPage=0,this.updateNumberOfValues(),C.$$(this.moreElement).addClass("coveo-active"),this.values.sortValuesDependingOnStatus(this.numberOfValues),this.rebuildValueElements(),this.logAnalyticsFacetShowMoreLess(O.analyticsActionCauseList.facetShowLess)},t.prototype.collapse=function(){this.ensureDom(),this.facetHeader&&this.facetHeader.collapseFacet()},t.prototype.expand=function(){this.ensureDom(),this.facetHeader&&this.facetHeader.expandFacet()},t.prototype.triggerNewQuery=function(e){e?this.queryController.executeQuery({beforeExecuteQuery:e}):this.queryController.executeQuery({ignoreWarningSearchEvent:!0}),this.showWaitingAnimation()},t.prototype.handleDeferredQuerySuccess=function(e){p.Assert.exists(e),this.unfadeInactiveValuesInMainList(),this.hideWaitingAnimation();var t=e.results.groupByResults[this.facetQueryController.lastGroupByRequestIndex];this.facetQueryController.lastGroupByResult=t,t||(this.keepDisplayedValuesNextTime=!1),1==this.values.getAll().length&&(this.keepDisplayedValuesNextTime=!1),this.processNewGroupByResults(t)},t.prototype.handleQueryError=function(){this.updateValues(new Q.FacetValues),this.updateAppearanceDependingOnState(),this.hideWaitingAnimation()},t.prototype.handlePopulateBreadcrumb=function(e){if(p.Assert.exists(e),this.values.hasSelectedOrExcludedValues()){var t=new I.BreadcrumbValueList(this,this.values.getSelected().concat(this.values.getExcluded()),T.BreadcrumbValueElement,{headingLevel:e.headingLevel}).build();e.breadcrumbs.push({element:t})}},t.prototype.handlePopulateSearchAlerts=function(e){if(this.values.hasSelectedOrExcludedValues()){var t=this.values.getExcluded(),n=this.values.getSelected();s.isEmpty(t)||e.text.push({value:new I.BreadcrumbValueList(this,t,T.BreadcrumbValueElement).buildAsString(),lineThrough:!0}),s.isEmpty(n)||e.text.push({value:new I.BreadcrumbValueList(this,n,T.BreadcrumbValueElement).buildAsString(),lineThrough:!1})}},t.prototype.initFacetQueryController=function(){this.facetQueryController=new r.FacetQueryController(this)},t.prototype.initFacetValuesList=function(){this.facetValuesList=new H.FacetValuesList(this,U.FacetValueElement),this.element.appendChild(this.facetValuesList.build())},t.prototype.initFacetSearch=function(){this.facetSearch=new L.FacetSearch(this,N.FacetSearchValuesList,this.root),this.element.appendChild(this.facetSearch.build())},t.prototype.facetValueHasChanged=function(){var e=this;this.updateQueryStateModel(),this.rebuildValueElements(),d.Defer.defer(function(){e.updateAppearanceDependingOnState()})},t.prototype.updateAppearanceDependingOnState=function(){C.$$(this.element).toggleClass("coveo-active",this.values.hasSelectedOrExcludedValues()),C.$$(this.element).toggleClass("coveo-facet-empty",!this.isAnyValueCurrentlyDisplayed()),C.$$(this.facetHeader.eraserElement).toggleClass("coveo-facet-header-eraser-visible",this.values.hasSelectedOrExcludedValues())},t.prototype.initQueryEvents=function(){var e=this;this.bind.onRootElement(c.QueryEvents.duringQuery,function(){return e.handleDuringQuery()}),this.bind.onRootElement(c.QueryEvents.buildingQuery,function(t){return e.handleBuildingQuery(t)}),this.bind.onRootElement(c.QueryEvents.doneBuildingQuery,function(t){return e.handleDoneBuildingQuery(t)}),this.bind.onRootElement(c.QueryEvents.deferredQuerySuccess,function(t){return e.handleDeferredQuerySuccess(t)}),this.bind.onRootElement(c.QueryEvents.queryError,function(){return e.handleQueryError()})},t.prototype.initQueryStateEvents=function(){var e=this;this.includedAttributeId=m.QueryStateModel.getFacetId(this.options.id),this.excludedAttributeId=m.QueryStateModel.getFacetId(this.options.id,!1),this.operatorAttributeId=m.QueryStateModel.getFacetOperator(this.options.id),this.lookupValueAttributeId=m.QueryStateModel.getFacetLookupValue(this.options.id),this.queryStateModel.registerNewAttribute(this.includedAttributeId,[]),this.queryStateModel.registerNewAttribute(this.excludedAttributeId,[]),this.queryStateModel.registerNewAttribute(this.operatorAttributeId,""),this.queryStateModel.registerNewAttribute(this.lookupValueAttributeId,{}),this.bind.onQueryState(f.MODEL_EVENTS.CHANGE,void 0,function(t){return e.handleQueryStateChanged(t)})},t.prototype.initComponentStateEvents=function(){this.componentStateId=m.QueryStateModel.getFacetId(this.options.id),this.componentStateModel.registerComponent(this.componentStateId,this)},t.prototype.initOmniboxEvents=function(){var e=this;this.options.includeInOmnibox&&this.bind.onRootElement(l.OmniboxEvents.populateOmnibox,function(t){return e.handlePopulateOmnibox(t)})},t.prototype.initBreadCrumbEvents=function(){var e=this;this.options.includeInBreadcrumb&&(this.bind.onRootElement(a.BreadcrumbEvents.populateBreadcrumb,function(t){return e.handlePopulateBreadcrumb(t)}),this.bind.onRootElement(a.BreadcrumbEvents.clearBreadcrumb,function(t){return e.handleClearBreadcrumb()}))},t.prototype.initSearchAlertEvents=function(){var e=this;this.bind.onRootElement(u.SearchAlertsEvents.searchAlertsPopulateMessage,function(t){return e.handlePopulateSearchAlerts(t)})},t.prototype.handleOmniboxWithStaticValue=function(e){var t=this,n=new RegExp("^"+e.completeQueryExpression.regex.source,"i"),i=s.first(s.filter(this.getDisplayedValues(),function(e){var i=t.getValueCaption(t.facetValuesList.get(e).facetValue);return n.test(i)}),this.options.numberOfValuesInOmnibox),o=s.map(i,function(e){return t.facetValuesList.get(e).facetValue}),r=new q.OmniboxValuesList(this,o,e,W.OmniboxValueElement).build();e.rows.push({element:r,zIndex:this.omniboxZIndex})},t.prototype.processNewGroupByResults=function(e){this.logger.trace("Displaying group by results",e),void 0!=e&&void 0!=e.values&&(this.nbAvailableValues=e.values.length);var t=new Q.FacetValues(e);this.updateValues(t),this.canFetchMore=this.numberOfValues<this.nbAvailableValues,this.values.hasSelectedOrExcludedValues()&&!this.options.useAnd&&this.options.isMultiValueField?this.triggerUpdateDeltaQuery(s.filter(this.values.getAll(),function(e){return!e.selected&&!e.excluded})):this.values.getSelected().length>0&&!this.options.useAnd&&this.values.updateDeltaWithFilteredFacetValues(new Q.FacetValues,this.options.isMultiValueField),this.values.hasSelectedOrExcludedValues()&&!this.options.useAnd&&this.options.isMultiValueField||(this.rebuildValueElements(),this.updateAppearanceDependingOnState(),this.ensurePinnedFacetHasntMoved()),this.keepDisplayedValuesNextTime=!1},t.prototype.updateQueryStateModel=function(){this.listenToQueryStateChange=!1,this.updateExcludedQueryStateModel(),this.updateIncludedQueryStateModel(),this.facetHeader.updateOperatorQueryStateModel(),this.updateLookupValueQueryStateModel(),this.listenToQueryStateChange=!0},t.prototype.rebuildValueElements=function(){this.updateNumberOfValues(),this.facetValuesList.rebuild(this.numberOfValues),this.shouldRenderMoreLess()?(this.updateMoreLess(),this.shouldRenderFacetSearch()&&this.updateSearchElement(this.nbAvailableValues>this.numberOfValues)):this.shouldRenderFacetSearch()&&this.updateSearchElement()},t.prototype.updateSearchElement=function(e){var t=this;if(void 0===e&&(e=!0),e){var n=new G.ValueElementRenderer(this,k.FacetValue.create(y.l("Search")));this.searchContainer=n.build().withNo([n.excludeIcon,n.icon]),C.$$(this.searchContainer.listItem).addClass("coveo-facet-search-button"),(new g.AccessibleButton).withElement(this.searchContainer.accessibleElement).withLabel(y.l("SearchFacetResults",this.options.title)).withEnterKeyboardAction(function(e){return t.toggleSearchMenu(e)}).build(),this.setCollapsedFacetSearchAccessibilityAttributes(),S.DeviceUtils.isMobileDevice()&&C.$$(this.searchContainer.label).on("click",function(e){return t.toggleSearchMenu(e)}),C.$$(this.searchContainer.checkbox).on("change",function(){C.$$(t.element).addClass("coveo-facet-searching"),t.facetSearch.focus()}),this.facetValuesList.valueContainer.appendChild(this.searchContainer.listItem)}},t.prototype.updateMoreLess=function(e,t){void 0===e&&(e=this.getMinimumNumberOfValuesToDisplay()<this.numberOfValues),void 0===t&&(t=this.nbAvailableValues>this.numberOfValues),e?C.$$(this.lessElement).addClass("coveo-active"):C.$$(this.lessElement).removeClass("coveo-active"),t?C.$$(this.moreElement).addClass("coveo-active"):C.$$(this.moreElement).removeClass("coveo-active"),e||t?C.$$(this.footerElement).removeClass("coveo-facet-empty"):C.$$(this.footerElement).addClass("coveo-facet-empty")},t.prototype.handleClickMore=function(){this.showMore()},t.prototype.handleClickLess=function(){this.showLess()},t.prototype.toggleSearchMenu=function(e){var t=this.searchContainer;t.checkbox.getAttribute("checked")?t.checkbox.removeAttribute("checked"):t.checkbox.setAttribute("checked","checked"),C.$$(t.checkbox).trigger("change"),e.stopPropagation(),e.preventDefault()},t.prototype.checkForComputedFieldAndSort=function(){-1!=this.options.sortCriteria.toLowerCase().indexOf("computedfield")&&V.Utils.isNullOrUndefined(this.options.computedField)&&this.logger.warn("Sort criteria is specified as ComputedField, but the facet uses no computed field. Facet will always be empty !",this)},t.prototype.checkForValueCaptionType=function(){this.options.valueCaption&&"function"==typeof this.options.valueCaption&&(this.options.enableFacetSearch=!1,this.options.includeInOmnibox=!1,this.logger.warn("Using a function as valueCaption is now deprecated. Use a json key value pair instead. Facet search and omnibox has been disabled for this facet",this))},t.prototype.checkForCustomSort=function(){void 0==this.options.customSort||s.contains(this.options.availableSorts,"custom")||this.options.availableSorts.unshift("custom"),"custom"==this.options.availableSorts[0]&&(this.options.sortCriteria="nosort")},t.prototype.initDependsOnManager=function(){var e=this,t={reset:function(){return e.reset()},ref:this};this.dependsOnManager=new b.DependsOnManager(t)},t.prototype.dependsOnUpdateParentDisplayValue=function(){var e=this;if(this.options.dependsOn){var n=v.ComponentsTypes.getAllFacetInstancesFromElement(this.root).filter(function(n){return n instanceof t&&n.options.id===e.options.dependsOn});if(!n.length)return void this.logger.warn('Unable to find a Facet with the id or field "'+this.options.dependsOn+'".',"The master facet values can't be updated.");if(n.length>1)return void this.logger.warn('Multiple facets with id "'+this.options.dependsOn+'" found.',"A given facet may only depend on a single other facet.","Ensure that each facet in your search interface has a unique id.","The master facet cannot be updated.",n);n[0].keepDisplayedValuesNextTime=!1}},t.prototype.initBottomAndTopSpacer=function(){var e=this,t=C.$$(this.options.paddingContainer).find(".coveo-bottomSpace"),n=C.$$(this.options.paddingContainer).find(".coveo-topSpace");this.options.preservePosition&&(C.$$(this.options.paddingContainer).on("mouseleave",function(){return e.unpinFacetPosition()}),this.pinnedTopSpace=n,this.pinnedBottomSpace=t,this.pinnedTopSpace||(this.pinnedTopSpace=document.createElement("div"),C.$$(this.pinnedTopSpace).addClass("coveo-topSpace"),C.$$(this.pinnedTopSpace).insertBefore(this.options.paddingContainer.firstChild)),this.pinnedBottomSpace||(this.pinnedBottomSpace=document.createElement("div"),C.$$(this.pinnedBottomSpace).addClass("coveo-bottomSpace"),this.options.paddingContainer.appendChild(this.pinnedBottomSpace)))},t.prototype.updateIncludedQueryStateModel=function(){var e={included:this.getSelectedValues(),title:this.includedAttributeId};this.queryStateModel.set(this.includedAttributeId,e.included)},t.prototype.updateExcludedQueryStateModel=function(){var e={title:this.excludedAttributeId,excluded:this.getExcludedValues()};this.queryStateModel.set(this.excludedAttributeId,e.excluded)},t.prototype.updateLookupValueQueryStateModel=function(){if(this.options.lookupField){var e={};s.each(this.values.getSelected().concat(this.values.getExcluded()),function(t){e[t.value]=t.lookupValue}),this.queryStateModel.set(this.lookupValueAttributeId,e)}},t.prototype.handleQueryStateChangedOperator=function(e){"and"==e?this.switchToAnd():"or"==e&&this.switchToOr()},t.prototype.handleQueryStateChangedIncluded=function(e){var t=s.difference(this.getSelectedValues(),e);V.Utils.isNonEmptyArray(t)&&this.deselectMultipleValues(t),V.Utils.arrayEqual(this.getSelectedValues(),e,!1)||this.selectMultipleValues(e)},t.prototype.handleQueryStateChangedExcluded=function(e){var t=s.difference(this.getExcludedValues(),e);V.Utils.isNonEmptyArray(t)&&this.unexcludeMultipleValues(t),V.Utils.arrayEqual(this.getExcludedValues(),e,!1)||this.excludeMultipleValues(e)},t.prototype.handleLookupvalueChanged=function(e){var t=this;s.each(e,function(e,n){t.facetValuesList.get(decodeURIComponent(n)).facetValue.lookupValue=decodeURIComponent(e)})},t.prototype.handleQueryStateChanged=function(e){p.Assert.exists(e),this.ensureDom(),this.dependsOnUpdateParentDisplayValue();var t=function(e){return e&&(e=s.map(e,function(e){return e.trim()})),e},n=e.attributes,i=t(n[this.includedAttributeId]),o=t(n[this.excludedAttributeId]),r=n[this.operatorAttributeId],a=n[this.lookupValueAttributeId];this.listenToQueryStateChange&&(V.Utils.isNullOrEmptyString(r)||this.handleQueryStateChangedOperator(r),V.Utils.isNullOrUndefined(i)||this.handleQueryStateChangedIncluded(i),V.Utils.isNullOrUndefined(o)||this.handleQueryStateChangedExcluded(o),V.Utils.isNullOrUndefined(a)||this.handleLookupvalueChanged(a))},t.prototype.handlePopulateOmnibox=function(e){p.Assert.exists(e),p.Assert.exists(e.completeQueryExpression),this.queryController.ensureCreatedQueryBuilder(),this.canFetchMore?this.handleOmniboxWithSearchInFacet(e):this.handleOmniboxWithStaticValue(e)},t.prototype.handleOmniboxWithSearchInFacet=function(e){var t=this,n=new RegExp("^"+e.completeQueryExpression.regex.source,"i"),i=new Promise(function(i,o){var r=new P.FacetSearchParameters(t);r.setValueToSearch(e.completeQueryExpression.word),r.nbResults=t.options.numberOfValuesInOmnibox,t.facetQueryController.search(r).then(function(o){var r=s.map(s.filter(o,function(e){return n.test(e.lookupValue)}),function(e){return t.values.get(e.lookupValue)||k.FacetValue.create(e)}),a=new q.OmniboxValuesList(t,r,e,W.OmniboxValueElement).build();i({element:a,zIndex:t.omniboxZIndex})}).catch(function(){i({element:void 0})})});e.rows.push({deferred:i})},t.prototype.handleDuringQuery=function(){this.ensureDom(),this.keepDisplayedValuesNextTime||this.fadeInactiveValuesInMainList(this.options.facetSearchDelay)},t.prototype.handleBuildingQuery=function(e){if(p.Assert.exists(e),p.Assert.exists(e.queryBuilder),this.facetQueryController.prepareForNewQuery(),this.values.hasSelectedOrExcludedValues()){var t=this.facetQueryController.computeOurFilterExpression();this.logger.trace("Putting filter in query",t),e.queryBuilder.advancedExpression.add(t)}},t.prototype.handleDoneBuildingQuery=function(e){p.Assert.exists(e),p.Assert.exists(e.queryBuilder);var t=e.queryBuilder;this.facetQueryController.putGroupByIntoQueryBuilder(t)},t.prototype.handleClearBreadcrumb=function(){this.reset()},t.prototype.updateValues=function(e){p.Assert.exists(e),this.keepDisplayedValuesNextTime?this.values.updateCountsFromNewValues(e):this.values=this.consolidateAndSortNewFacetValues(e),this.updateNumberOfValues()},t.prototype.consolidateAndSortNewFacetValues=function(e){return e.importActiveValuesFromOtherList(this.values),e.sort(this.optionsToSortFacetValues),e},Object.defineProperty(t.prototype,"optionsToSortFacetValues",{get:function(){return{facetValuesOrder:this.facetValuesOrder,numberOfValues:this.numberOfValues}},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetValuesOrder",{get:function(){return new j.FacetValuesOrder(this,this.facetSort)},enumerable:!0,configurable:!0}),t.prototype.ensureFacetValueIsInList=function(e){p.Assert.exists(e),this.values.contains(e.value)||this.values.add(e)},t.prototype.isAnyValueCurrentlyDisplayed=function(){return!this.values.isEmpty()},t.prototype.buildFacetContent=function(){this.headerElement=this.buildHeader(),this.element.appendChild(this.headerElement),this.initFacetValuesList(),this.shouldRenderFacetSearch()&&this.initFacetSearch(),this.shouldRenderMoreLess()&&(this.moreElement=this.buildMore(),this.lessElement=this.buildLess()),this.footerElement=this.buildFooter(),this.element.appendChild(this.footerElement),this.lessElement&&this.moreElement&&(this.footerElement.appendChild(this.lessElement),this.footerElement.appendChild(this.moreElement))},t.prototype.buildHeader=function(){var e=this.options.headerIcon;this.options.headerIcon==this.options.field&&(e=void 0),this.facetHeader=new D.FacetHeader({facetElement:this.element,title:this.options.title,icon:e,field:this.options.field,enableClearElement:!0,enableCollapseElement:this.options.enableCollapse,facet:this,settingsKlass:this.options.enableSettings?M.FacetSettings:void 0,sortKlass:_.FacetSort,availableSorts:this.options.availableSorts});var t=this.facetHeader.build();return this.facetSettings=this.facetHeader.settings,this.facetSort=this.facetHeader.sort,t},t.prototype.unpinFacetPosition=function(){this.shouldFacetUnpin()&&this.options.preservePosition&&(C.$$(this.pinnedTopSpace).addClass("coveo-with-animation"),C.$$(this.pinnedBottomSpace).addClass("coveo-with-animation"),this.pinnedTopSpace.style.height="0px",this.pinnedBottomSpace.style.height="0px"),this.unpinnedViewportPosition=void 0,this.pinnedViewportPosition=void 0},t.prototype.isFacetPinned=function(){return V.Utils.exists(this.pinnedViewportPosition)},t.prototype.shouldFacetUnpin=function(){return V.Utils.exists(this.unpinnedViewportPosition)},t.prototype.ensurePinnedFacetHasntMoved=function(){if(this.isFacetPinned()){p.Assert.exists(this.pinnedViewportPosition),C.$$(this.pinnedTopSpace).removeClass("coveo-with-animation"),C.$$(this.pinnedBottomSpace).removeClass("coveo-with-animation"),this.pinnedTopSpace.style.height="0px",this.pinnedBottomSpace.style.height="0px";var e=this.options.scrollContainer==document.body?window:this.options.scrollContainer,t=this.element.getBoundingClientRect().top,n=t-this.pinnedViewportPosition;!function(){e instanceof Window?window.scrollTo(0,new C.Win(e).scrollY()+n):e.scrollTop=e.scrollTop+n}(),t=this.element.getBoundingClientRect().top,n=t-this.pinnedViewportPosition,n<0&&(this.pinnedTopSpace.style.height=-1*n+"px"),this.unpinnedViewportPosition=this.pinnedViewportPosition,this.pinnedViewportPosition=null}},t.prototype.buildFooter=function(){return C.$$("div",{className:"coveo-facet-footer"}).el},t.prototype.buildMore=function(){var e=this,t=C.$$("span",{className:"coveo-facet-more-icon"},E.SVGIcons.icons.arrowDown).el;F.SVGDom.addClassToSVGInContainer(t,"coveo-facet-more-icon-svg");var n=C.$$("div",{className:"coveo-facet-more",tabindex:0},t).el;return(new g.AccessibleButton).withElement(n).withLabel(y.l("ShowMoreFacetResults",this.options.title)).withSelectAction(function(){return e.handleClickMore()}).build(),n},t.prototype.buildLess=function(){var e=this,t=C.$$("span",{className:"coveo-facet-less-icon"},E.SVGIcons.icons.arrowUp).el;F.SVGDom.addClassToSVGInContainer(t,"coveo-facet-less-icon-svg");var n=C.$$("div",{className:"coveo-facet-less",tabindex:0},t).el;return(new g.AccessibleButton).withElement(n).withLabel(y.l("ShowLessFacetResults",this.options.title)).withSelectAction(function(){return e.handleClickLess()}).build(),n},t.prototype.triggerMoreQuery=function(){var e=this;this.logger.info("Triggering new facet more query"),this.showWaitingAnimation(),this.facetQueryController.fetchMore(this.numberOfValues+1).then(function(t){e.logAnalyticsFacetShowMoreLess(O.analyticsActionCauseList.facetShowMore);var n=new Q.FacetValues(t.groupByResults[0]);e.values=e.consolidateAndSortNewFacetValues(n),e.nbAvailableValues=e.values.size(),e.updateNumberOfValues(),e.canFetchMore=e.numberOfValues<e.nbAvailableValues,e.values.hasSelectedOrExcludedValues()&&!e.options.useAnd&&e.options.isMultiValueField?e.triggerUpdateDeltaQuery(s.filter(e.values.getAll(),function(e){return!e.selected&&!e.excluded})):e.values.hasSelectedOrExcludedValues()&&!e.options.useAnd?(e.values.updateDeltaWithFilteredFacetValues(new Q.FacetValues,e.options.isMultiValueField),e.hideWaitingAnimation()):e.hideWaitingAnimation(),e.rebuildValueElements()}).catch(function(){return e.hideWaitingAnimation()})},t.prototype.triggerUpdateDeltaQuery=function(e){var t=this;this.showWaitingAnimation(),this.facetQueryController.searchInFacetToUpdateDelta(e).then(function(e){var n=new Q.FacetValues;s.each(e.groupByResults,function(e){s.each(e.values,function(e){n.contains(e.value)||n.add(k.FacetValue.createFromGroupByValue(e))})}),t.values.updateDeltaWithFilteredFacetValues(n,t.options.isMultiValueField),t.cleanupDeltaValuesForMultiValueField(),t.rebuildValueElements(),t.hideWaitingAnimation()})},t.prototype.updateNumberOfValues=function(){this.keepDisplayedValuesNextTime||(this.currentPage<=0?(this.currentPage=0,this.numberOfValues=0):this.numberOfValues=this.options.numberOfValues+this.currentPage*this.options.pageSize,this.numberOfValues=Math.max(this.numberOfValues,this.getMinimumNumberOfValuesToDisplay()))},t.prototype.getMinimumNumberOfValuesToDisplay=function(){var e=this.values.getExcluded().length+this.values.getSelected().length;if(null!=this.options.customSort&&null!=this.facetSort&&this.options.customSort.length>0){var t=-1;new j.FacetValuesOrder(this,this.facetSort).reorderValues(this.values.getAll()).forEach(function(e,n){e.selected&&(t=n)}),e=t+1}return Math.max(e,this.options.numberOfValues)},t.prototype.cleanupDeltaValuesForMultiValueField=function(){var e=this;this.options.isMultiValueField&&(s.each(this.values.getAll(),function(t){0!=t.occurrences||t.selected||t.excluded||e.values.remove(t.value)}),this.nbAvailableValues=this.values.getAll().length)},t.prototype.shouldRenderFacetSearch=function(){return this.options.enableFacetSearch},t.prototype.shouldRenderMoreLess=function(){return this.options.enableMoreLess},t.prototype.debugInfo=function(){var e={};return e[this.constructor.ID]={component:this,groupByRequest:this.facetQueryController.lastGroupByRequest,groupByResult:this.facetQueryController.lastGroupByResult},e},t.prototype.logAnalyticsFacetShowMoreLess=function(e){this.usageAnalytics.logCustomEvent(e,{facetId:this.options.id,facetField:this.options.field.toString(),facetTitle:this.options.title},this.element)},t.ID="Facet",t.omniboxIndex=50,t.doExport=function(){h.exportGlobally({Facet:t,FacetHeader:D.FacetHeader,FacetSearchValuesList:N.FacetSearchValuesList,FacetSettings:M.FacetSettings,FacetSort:_.FacetSort,FacetUtils:B.FacetUtils,FacetValueElement:U.FacetValueElement,FacetValue:k.FacetValue})},t.options=o({title:w.ComponentOptions.buildLocalizedStringOption({localizedString:function(){return y.l("NoTitle")},section:"CommonOptions",priority:10}),field:w.ComponentOptions.buildFieldOption({required:!0,groupByField:!0,section:"CommonOptions"}),headerIcon:w.ComponentOptions.buildStringOption({deprecated:"This option is exposed for legacy reasons, and the recommendation is to not use this option."}),id:w.ComponentOptions.buildStringOption({postProcessing:function(e,t){if(e){var n=e.replace(/[^a-zA-Z0-9-@$_.+!*'(),,]+/g,"");return V.Utils.isNullOrEmptyString(n)?t.field:n}return t.field}}),isMultiValueField:w.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"CommonOptions"}),lookupField:w.ComponentOptions.buildFieldOption({deprecated:"This option is exposed for legacy reasons. It is not recommended to use this option."}),enableSettings:w.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"Sorting",priority:9}),enableSettingsFacetState:w.ComponentOptions.buildBooleanOption({defaultValue:!1,depend:"enableSettings"}),availableSorts:w.ComponentOptions.buildListOption({defaultValue:["occurrences","score","alphaascending","alphadescending"],section:"Sorting",depend:"enableSettings",values:["occurrences","score","alphaascending","alphadescending","computedfieldascending","computedfielddescending","chisquare","nosort"]}),sortCriteria:w.ComponentOptions.buildStringOption({postProcessing:function(e,t){return e||(t.availableSorts.length>0?t.availableSorts[0]:"occurrences")},section:"Sorting"}),customSort:w.ComponentOptions.buildListOption({section:"Sorting"}),numberOfValues:w.ComponentOptions.buildNumberOption({defaultValue:5,min:0,section:"CommonOptions"}),injectionDepth:w.ComponentOptions.buildNumberOption({defaultValue:1e3,min:1e3}),showIcon:w.ComponentOptions.buildBooleanOption({defaultValue:!1,deprecated:"This option is exposed for legacy reasons. It is not recommended to use this option."}),useAnd:w.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"Filtering"}),enableTogglingOperator:w.ComponentOptions.buildBooleanOption({defaultValue:!1,alias:"allowTogglingOperator"}),enableFacetSearch:w.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"FacetSearch",priority:8}),facetSearchDelay:w.ComponentOptions.buildNumberOption({defaultValue:100,min:0,depend:"enableFacetSearch"}),facetSearchIgnoreAccents:w.ComponentOptions.buildBooleanOption({defaultValue:!1,depend:"enableFacetSearch"}),numberOfValuesInFacetSearch:w.ComponentOptions.buildNumberOption({defaultValue:15,min:1,section:"FacetSearch"}),useWildcardsInFacetSearch:w.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"FacetSearch"}),includeInBreadcrumb:w.ComponentOptions.buildBooleanOption({defaultValue:!0}),numberOfValuesInBreadcrumb:w.ComponentOptions.buildNumberOption({defaultFunction:function(){return S.DeviceUtils.isMobileDevice()?3:5},min:0,depend:"includeInBreadcrumb"}),includeInOmnibox:w.ComponentOptions.buildBooleanOption({defaultValue:!1,deprecated:"This option is exposed for legacy reasons. It is not recommended to use this option."}),numberOfValuesInOmnibox:w.ComponentOptions.buildNumberOption({defaultFunction:function(){return S.DeviceUtils.isMobileDevice()?3:5},min:0,depend:"includeInOmnibox",deprecated:"This option is exposed for legacy reasons. It is not recommended to use this option."}),computedField:w.ComponentOptions.buildFieldOption({priority:7}),computedFieldOperation:w.ComponentOptions.buildStringOption({defaultValue:"sum",section:"ComputedField"}),computedFieldFormat:w.ComponentOptions.buildStringOption({defaultValue:"c0",section:"ComputedField"}),computedFieldCaption:w.ComponentOptions.buildLocalizedStringOption({localizedString:function(){return y.l("ComputedField")},section:"ComputedField"}),preservePosition:w.ComponentOptions.buildBooleanOption({defaultValue:!0}),paddingContainer:w.ComponentOptions.buildSelectorOption({defaultFunction:function(e){var t=C.$$(e).parent("coveo-facet-column");return null!=t?t:e.parentElement}}),scrollContainer:w.ComponentOptions.buildSelectorOption({defaultFunction:function(e){return document.body}}),enableMoreLess:w.ComponentOptions.buildBooleanOption({defaultValue:!0}),pageSize:w.ComponentOptions.buildNumberOption({defaultValue:10,min:1,depend:"enableMoreLess"}),enableCollapse:w.ComponentOptions.buildBooleanOption({defaultValue:!0,depend:"enableSettings"}),allowedValues:w.ComponentOptions.buildListOption(),additionalFilter:w.ComponentOptions.buildQueryExpressionOption(),dependsOn:w.ComponentOptions.buildStringOption(),dependsOnCondition:w.ComponentOptions.buildCustomOption(function(){return null},{depend:"dependsOn",section:"CommonOptions"}),valueCaption:w.ComponentOptions.buildJsonOption()},$.ResponsiveFacetOptions),t}(A.Component);t.Facet=K,R.Initialization.registerAutoCreateComponent(K),K.doExport()},85:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(8);t.ResponsiveFacetOptions={enableResponsiveMode:i.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"ResponsiveOptions"}),responsiveBreakpoint:i.ComponentOptions.buildNumberOption({deprecated:"This option is exposed for legacy reasons. It is not recommended to use this option. Instead, use `SearchInterface.options.responsiveMediumBreakpoint` options exposed on the `SearchInterface`."}),dropdownHeaderLabel:i.ComponentOptions.buildLocalizedStringOption({section:"ResponsiveOptions"})}},86:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=n(7),s=n(8),r=n(3),a=n(20),l=n(2),c=function(e){function t(n,i,o){var r=e.call(this,n,t.ID,o)||this;if(r.element=n,r.options=s.ComponentOptions.initComponentOptions(n,t,i),r.options.preventScrolling){var a=r.options.scrollContainer||r.searchInterface.element;r.options.scrollContainer=s.ComponentOptions.findParentScrollLockable(a)}return r}return i(t,e),t.ID="FacetsMobileMode",t.options={breakpoint:s.ComponentOptions.buildNumberOption(),isModal:s.ComponentOptions.buildBooleanOption({defaultValue:!0}),displayOverlayWhileOpen:s.ComponentOptions.buildBooleanOption({postProcessing:function(e,t){return a.Utils.isNullOrUndefined(e)?!t.isModal:e}}),preventScrolling:s.ComponentOptions.buildBooleanOption({postProcessing:function(e,t){return a.Utils.isNullOrUndefined(e)?t.isModal:e}}),scrollContainer:s.ComponentOptions.buildChildHtmlElementOption({depend:"preventScrolling"})},t.doExport=function(){r.exportGlobally({FacetsMobileMode:t})},t}(o.Component);t.FacetsMobileMode=c,l.Initialization.registerAutoCreateComponent(c)},93:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(r,a)}l((i=i.apply(e,t||[])).next())})},s=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(r=s[2&n[0]?"return":n[0]?"throw":"next"])&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[0,r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,s=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],s=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0}),n(528),n(529),n(530);var r=n(0),a=n(11),l=n(134),c=n(29),u=n(3),h=n(5),p=n(31),d=n(18),f=n(13),m=n(24),y=n(1),g=n(97),v=n(4),b=n(10),S=n(7),C=n(8),F=n(2),E=n(177),V=n(63),O=n(531),A=n(474),w=n(472),R=n(123),$=n(470),x=n(68),T=n(96),I=n(532),D=n(533),L=n(215),P=n(534),N=n(118),M=n(473);A.CoreHelpers.exportAllHelpersGlobally(window.Coveo);var _=function(e){function t(n,i,o,s){void 0===s&&(s=t.ID);var r=e.call(this,n,s,o)||this;return r.element=n,r.options=i,r.bindings=o,r.currentlyDisplayedResults=[],r.reachedTheEndOfResults=!1,r.disableLayoutChange=!1,r.successiveScrollCount=0,r.options=C.ComponentOptions.initComponentOptions(n,t,i),h.Assert.exists(n),h.Assert.exists(r.options),h.Assert.exists(r.options.resultTemplate),h.Assert.exists(r.options.infiniteScrollContainer),r.showOrHideElementsDependingOnState(!1,!1),r.addListeners(),r.resultContainer=r.initResultContainer(),h.Assert.exists(r.options.resultsContainer),r.initWaitAnimationContainer(),h.Assert.exists(r.options.waitAnimationContainer),r.setupTemplatesVersusLayouts(),y.$$(r.root).on(l.ResultLayoutEvents.populateResultLayout,function(e,t){return t.layouts.push(r.options.layout)}),r.setupRenderer(),r.makeElementFocusable(),r.ensureHasId(),r}return i(t,e),t.getDefaultTemplate=function(e){var n=t.loadTemplatesFromCache();if(null!=n)return n;var i=S.Component.get(e);return Coveo.Recommendation&&i.searchInterface instanceof Coveo.Recommendation?new w.DefaultRecommendationTemplate:new R.DefaultResultTemplate},t.loadTemplatesFromCache=function(){var e=x.TemplateCache.getResultListTemplateNames();return e.length>0?new T.TemplateList(r.compact(r.map(e,function(e){return x.TemplateCache.getTemplate(e)}))):null},t.prototype.addListeners=function(){var e=this;this.bind.onRootElement(a.QueryEvents.newQuery,function(t){return e.handleNewQuery()}),this.bind.onRootElement(a.QueryEvents.buildingQuery,function(t){return e.handleBuildingQuery(t)}),this.bind.onRootElement(a.QueryEvents.querySuccess,function(t){return e.handleQuerySuccess(t)}),this.bind.onRootElement(a.QueryEvents.fetchMoreSuccess,function(t){return e.handleFetchMoreSuccess(t)}),this.bind.onRootElement(a.QueryEvents.duringQuery,function(t){return e.handleDuringQuery()}),this.bind.onRootElement(a.QueryEvents.queryError,function(t){return e.handleQueryError()}),y.$$(this.root).on(c.ResultListEvents.changeLayout,function(t,n){return e.handleChangeLayout(n)}),this.options.enableInfiniteScroll?this.addInfiniteScrollListeners():this.addPagerListeners()},t.prototype.addInfiniteScrollListeners=function(){var e=this;this.bind.on(this.options.infiniteScrollContainer,"scroll",function(){e.successiveScrollCount=0,e.handleScrollOfResultList()}),this.bind.onRootElement(a.QueryEvents.deferredQuerySuccess,function(){setTimeout(function(){e.scrollToTopIfEnabled()},0)})},t.prototype.addPagerListeners=function(){var e=this;this.bind.onQueryState(d.MODEL_EVENTS.CHANGE_ONE,f.QUERY_STATE_ATTRIBUTES.FIRST,function(){e.bind.oneRootElement(a.QueryEvents.deferredQuerySuccess,function(){setTimeout(function(){e.scrollToTopIfEnabled()},0)})})},t.prototype.getAutoSelectedFieldsToInclude=function(){return r.chain(this.options.resultTemplate.getFields()).concat(this.getMinimalFieldsToInclude()).compact().unique().value()},t.prototype.setupTemplatesVersusLayouts=function(){var e=this,t="coveo-"+this.options.layout+"-layout-container";this.resultContainer.addClass(t),"table"===this.options.layout&&(this.options.resultTemplate=new $.TableTemplate(this.options.resultTemplate.templates||[])),this.options.resultTemplate instanceof T.TemplateList?r.each(this.options.resultTemplate.templates,function(t){t.layout||(t.layout=e.options.layout)}):this.options.resultTemplate instanceof R.DefaultResultTemplate&&"list"==this.options.layout&&O.ResponsiveDefaultResultTemplate.init(this.root,this,{})},t.prototype.renderResults=function(e,t){var n=this;return void 0===t&&(t=!1),t||this.resultContainer.empty(),this.renderer.renderResults(e,t,this.triggerNewResultDisplayed.bind(this)).then(function(){return n.triggerNewResultsDisplayed()})},t.prototype.buildResults=function(e){var t=this.options.layout;return this.templateToHtml.buildResults(e,t,this.currentlyDisplayedResults)},t.prototype.buildResult=function(e){var t=this.options.layout;return this.templateToHtml.buildResult(e,t,this.currentlyDisplayedResults)},t.prototype.displayMoreResults=function(e){return h.Assert.isLargerOrEqualsThan(1,e),this.isCurrentlyFetchingMoreResults()?void this.logger.warn("Ignoring request to display more results since we're already doing so"):this.hasPotentiallyMoreResultsToDisplay()?(this.options.enableInfiniteScrollWaitingAnimation&&this.showWaitingAnimationForInfiniteScrolling(),this.fetchAndRenderMoreResults(e)):void this.logger.warn("Ignoring request to display more results since we know there aren't more to display")},Object.defineProperty(t.prototype,"templateToHtml",{get:function(){var e={resultTemplate:this.options.resultTemplate,searchInterface:this.searchInterface,queryStateModel:this.queryStateModel};return new M.TemplateToHtml(e)},enumerable:!0,configurable:!0}),t.prototype.getDisplayedResults=function(){return this.currentlyDisplayedResults},t.prototype.getDisplayedResultsElements=function(){return this.resultContainer.getResultElements()},t.prototype.enable=function(){this.disableLayoutChange=!1,this.resultLayoutSelectors.length>0?this.enableBasedOnActiveLayouts():(e.prototype.enable.call(this),y.$$(this.element).removeClass("coveo-hidden"))},t.prototype.disable=function(){var t=this;e.prototype.disable.call(this);var n=r.map(this.otherResultLists,function(e){return e.options.layout});r.contains(n,this.options.layout)||this.disableLayoutChange||r.each(this.resultLayoutSelectors,function(e){e.disableLayouts([t.options.layout])}),this.disableLayoutChange=!1,y.$$(this.element).addClass("coveo-hidden")},t.prototype.autoCreateComponentsInsideResult=function(e,t){return this.templateToHtml.autoCreateComponentsInsideResult(e,t)},t.prototype.triggerNewResultDisplayed=function(e,t){var n={result:e,item:t};y.$$(this.element).trigger(c.ResultListEvents.newResultDisplayed,n)},t.prototype.triggerNewResultsDisplayed=function(){var e={isInfiniteScrollEnabled:this.options.enableInfiniteScroll};y.$$(this.element).trigger(c.ResultListEvents.newResultsDisplayed,e)},t.prototype.fetchAndRenderMoreResults=function(e){return o(this,void 0,void 0,function(){var t,n;return s(this,function(i){switch(i.label){case 0:this.fetchingMoreResults=this.queryController.fetchMore(e),i.label=1;case 1:return i.trys.push([1,3,,4]),[4,this.fetchingMoreResults];case 2:return t=i.sent(),h.Assert.exists(t),this.usageAnalytics.logCustomEvent(b.analyticsActionCauseList.pagerScrolling,{},this.element),this.renderNewResults(t),this.resetStateAfterFetchingMoreResults(),[2,t];case 3:return n=i.sent(),this.resetStateAfterFetchingMoreResults(),[2,Promise.reject(n)];case 4:return[2]}})})},t.prototype.renderNewResults=function(e){return o(this,void 0,void 0,function(){var t,n;return s(this,function(i){switch(i.label){case 0:return[4,this.buildResults(e)];case 1:return t=i.sent(),this.renderResults(t,!0),(n=this.currentlyDisplayedResults).push.apply(n,e.results),[2]}})})},t.prototype.resetStateAfterFetchingMoreResults=function(){var e=this;this.hideWaitingAnimationForInfiniteScrolling(),this.fetchingMoreResults=void 0,p.Defer.defer(function(){e.successiveScrollCount++,e.successiveScrollCount<=t.MAX_AMOUNT_OF_SUCESSIVE_REQUESTS?e.handleScrollOfResultList():e.logger.info("Result list has triggered 5 consecutive queries to try and fill up the scrolling container, but it is still unable to do so.\n Try explicitly setting the 'data-infinite-scroll-container-selector' option on the result list. See: https://coveo.github.io/search-ui/components/resultlist.html#options.infinitescrollcontainer")})},t.prototype.handleDuringQuery=function(){this.logger.trace("Emptying the result container"),this.cancelFetchingMoreResultsIfNeeded(),this.showWaitingAnimation(),this.showOrHideElementsDependingOnState(!1,!1)},t.prototype.handleQueryError=function(){this.hideWaitingAnimation(),this.resultContainer.empty(),this.currentlyDisplayedResults=[],this.reachedTheEndOfResults=!0},t.prototype.handleQuerySuccess=function(e){var n=this;h.Assert.exists(e),h.Assert.exists(e.results);var i=e.results;this.logger.trace("Received query results from new query",i),this.hideWaitingAnimation(),t.resultCurrentlyBeingRendered=void 0,this.currentlyDisplayedResults=[],this.buildResults(e.results).then(function(t){return o(n,void 0,void 0,function(){return s(this,function(n){switch(n.label){case 0:return[4,this.renderResults(t)];case 1:return n.sent(),this.showOrHideElementsDependingOnState(!0,0!=this.currentlyDisplayedResults.length),m.DeviceUtils.isMobileDevice()&&void 0!=this.options.mobileScrollContainer&&(this.options.mobileScrollContainer.scrollTop=0),this.options.enableInfiniteScroll&&i.results.length==e.queryBuilder.numberOfResults&&(this.scrollToTopIfEnabled(),this.handleScrollOfResultList()),[2]}})})}),this.handleQueryOrFetchMoreSuccess(e.query,i)},t.prototype.handleFetchMoreSuccess=function(e){this.handleQueryOrFetchMoreSuccess(e.query,e.results)},t.prototype.handleQueryOrFetchMoreSuccess=function(e,t){var n=(e.firstResult||0)+t.results.length;this.reachedTheEndOfResults=n>=t.totalCountFiltered},t.prototype.handleScrollOfResultList=function(){!this.isCurrentlyFetchingMoreResults()&&this.options.enableInfiniteScroll&&this.isScrollingOfResultListAlmostAtTheBottom()&&this.hasPotentiallyMoreResultsToDisplay()&&this.displayMoreResults(this.options.infiniteScrollPageSize)},t.prototype.scrollToTopIfEnabled=function(){this.options.enableScrollToTop&&N.ResultListUtils.scrollToTop(this.root)},t.prototype.handleNewQuery=function(){y.$$(this.element).removeClass("coveo-hidden"),t.resultCurrentlyBeingRendered=void 0},Object.defineProperty(t.prototype,"otherResultLists",{get:function(){var e=this.searchInterface.getComponents(t.ID);return r.without(e,this)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"resultLayoutSelectors",{get:function(){return this.searchInterface.getComponents("ResultLayoutSelector")},enumerable:!0,configurable:!0}),t.prototype.handleBuildingQuery=function(e){if(e.queryBuilder.addFieldsToInclude(this.getMinimalFieldsToInclude()),null!=this.options.fieldsToInclude&&e.queryBuilder.addFieldsToInclude(r.map(this.options.fieldsToInclude,function(e){return e.substr(1)})),this.options.autoSelectFieldsToInclude){var t=r.flatten(r.map(this.otherResultLists,function(e){return e.getAutoSelectedFieldsToInclude()}));e.queryBuilder.addRequiredFields(r.unique(t.concat(this.getAutoSelectedFieldsToInclude()))),e.queryBuilder.includeRequiredFields=!0}},t.prototype.handleChangeLayout=function(e){var t=this;e.layout===this.options.layout?(this.disableLayoutChange=!1,this.enable(),this.options.resultTemplate.layout=this.options.layout,e.results&&(this.resultContainer.isEmpty()&&new E.InitializationPlaceholder(this.root).withVisibleRootElement().withPlaceholderForResultList(),p.Defer.defer(function(){return o(t,void 0,void 0,function(){var t;return s(this,function(n){switch(n.label){case 0:return[4,this.buildResults(e.results)];case 1:return t=n.sent(),this.renderResults(t),this.showOrHideElementsDependingOnState(!0,0!==this.currentlyDisplayedResults.length),[2]}})})}))):(this.disableLayoutChange=!0,this.disable(),this.resultContainer.empty())},t.prototype.isCurrentlyFetchingMoreResults=function(){return v.Utils.exists(this.fetchingMoreResults)},t.prototype.getMinimalFieldsToInclude=function(){return["author","language","urihash","objecttype","collection","source","language","permanentid"]},t.prototype.isScrollingOfResultListAlmostAtTheBottom=function(){var e;try{e=this.options.infiniteScrollContainer instanceof Window}catch(t){e=!1}return e?this.isScrollAtBottomForWindowElement():this.isScrollAtBottomForHtmlElement()},t.prototype.isScrollAtBottomForWindowElement=function(){var e=new y.Win(window),t=e.height(),n=e.scrollY();return new y.Doc(document).height()-(t+n)<t/2},t.prototype.isScrollAtBottomForHtmlElement=function(){var e=this.options.infiniteScrollContainer,t=e.clientHeight;return e.scrollHeight-(e.scrollTop+t)<t/2},t.prototype.hasPotentiallyMoreResultsToDisplay=function(){return this.currentlyDisplayedResults.length>0&&!this.reachedTheEndOfResults},t.prototype.cancelFetchingMoreResultsIfNeeded=function(){this.isCurrentlyFetchingMoreResults()&&(this.logger.trace("Cancelling fetching more results"),Promise.reject(this.fetchingMoreResults),this.fetchingMoreResults=void 0)},t.prototype.showOrHideElementsDependingOnState=function(e,t){var n=y.$$(this.element).findAll(".coveo-show-if-query"),i=y.$$(this.element).findAll(".coveo-show-if-no-query"),o=y.$$(this.element).findAll(".coveo-show-if-results"),s=y.$$(this.element).findAll(".coveo-show-if-no-results");r.each(n,function(t){y.$$(t).toggle(e)}),r.each(i,function(t){y.$$(t).toggle(!e)}),r.each(o,function(n){y.$$(n).toggle(e&&t)}),r.each(s,function(n){y.$$(n).toggle(e&&!t)})},Object.defineProperty(t.prototype,"waitAnimation",{get:function(){return this.options.waitAnimation.toLowerCase()},enumerable:!0,configurable:!0}),t.prototype.showWaitingAnimation=function(){switch(this.waitAnimation){case"fade":y.$$(this.options.waitAnimationContainer).addClass("coveo-fade-out");break;case"spinner":this.resultContainer.hideChildren(),void 0==y.$$(this.options.waitAnimationContainer).find(".coveo-wait-animation")&&this.options.waitAnimationContainer.appendChild(g.DomUtils.getBasicLoadingAnimation())}},t.prototype.hideWaitingAnimation=function(){switch(this.waitAnimation){case"fade":y.$$(this.options.waitAnimationContainer).removeClass("coveo-fade-out");break;case"spinner":var e=y.$$(this.options.waitAnimationContainer).find(".coveo-loading-spinner");e&&y.$$(e).detach()}},t.prototype.showWaitingAnimationForInfiniteScrolling=function(){var e=g.DomUtils.getLoadingSpinner();if("card"==this.options.layout&&this.options.enableInfiniteScroll){var t=y.$$(this.options.waitAnimationContainer).findAll(".coveo-loading-spinner-container");r.each(t,function(e){return y.$$(e).remove()});var n=y.$$("div",{className:"coveo-loading-spinner-container"});n.append(e),this.options.waitAnimationContainer.appendChild(n.el)}else this.options.waitAnimationContainer.appendChild(g.DomUtils.getLoadingSpinner())},t.prototype.hideWaitingAnimationForInfiniteScrolling=function(){var e=y.$$(this.options.waitAnimationContainer).findAll(".coveo-loading-spinner"),t=y.$$(this.options.waitAnimationContainer).findAll(".coveo-loading-spinner-container");r.each(e,function(e){return y.$$(e).remove()}),r.each(t,function(e){return y.$$(e).remove()})},t.prototype.initResultContainer=function(){if(!this.options.resultsContainer){var e="table"===this.options.layout?"table":"div";this.options.resultsContainer=y.$$(e,{className:"coveo-result-list-container"}).el,this.initResultContainerAddToDom()}return new I.ResultContainer(this.options.resultsContainer,this.searchInterface)},t.prototype.initResultContainerAddToDom=function(){this.element.appendChild(this.options.resultsContainer)},t.prototype.initWaitAnimationContainer=function(){this.options.waitAnimationContainer||(this.options.waitAnimationContainer=this.resultContainer.el)},t.prototype.setupRenderer=function(){var e={options:this.searchInterface.options.originalOptionsObject,bindings:this.bindings},t=function(t){return F.Initialization.automaticallyCreateComponentsInside(t,e)};switch(this.options.layout){case"card":this.renderer=new D.ResultListCardRenderer(this.options,t);break;case"table":this.renderer=new P.ResultListTableRenderer(this.options,t);break;case"list":default:this.renderer=new L.ResultListRenderer(this.options,t)}},t.prototype.makeElementFocusable=function(){y.$$(this.element).setAttribute("tabindex","-1")},t.prototype.ensureHasId=function(){""===this.element.id&&(this.element.id=r.uniqueId("coveo-result-list"))},t.prototype.enableBasedOnActiveLayouts=function(){var t=this;r.each(this.resultLayoutSelectors,function(n){r.find(n.activeLayouts,function(e,n){return n==t.options.layout})&&(e.prototype.enable.call(t),n.enableLayouts([t.options.layout]),y.$$(t.element).removeClass("coveo-hidden"))})},t.ID="ResultList",t.doExport=function(){u.exportGlobally({ResultList:t})},t.options={resultsContainer:C.ComponentOptions.buildChildHtmlElementOption({alias:"resultContainerSelector"}),resultTemplate:V.TemplateComponentOptions.buildTemplateOption({defaultFunction:t.getDefaultTemplate}),waitAnimation:C.ComponentOptions.buildStringOption({defaultValue:"none"}),waitAnimationContainer:C.ComponentOptions.buildChildHtmlElementOption({postProcessing:function(e,t){return e||t.resultsContainer}}),enableInfiniteScroll:C.ComponentOptions.buildBooleanOption({defaultValue:!1}),infiniteScrollPageSize:C.ComponentOptions.buildNumberOption({defaultValue:10,min:1,depend:"enableInfiniteScroll"}),infiniteScrollContainer:C.ComponentOptions.buildChildHtmlElementOption({depend:"enableInfiniteScroll",defaultFunction:function(e){return C.ComponentOptions.findParentScrolling(e)}}),enableInfiniteScrollWaitingAnimation:C.ComponentOptions.buildBooleanOption({depend:"enableInfiniteScroll",defaultValue:!0}),mobileScrollContainer:C.ComponentOptions.buildSelectorOption({defaultFunction:function(){return document.querySelector(".coveo-results-column")}}),autoSelectFieldsToInclude:C.ComponentOptions.buildBooleanOption({defaultValue:!1}),fieldsToInclude:C.ComponentOptions.buildFieldsOption({includeInResults:!0}),layout:C.ComponentOptions.buildStringOption({defaultValue:"list",required:!0}),enableScrollToTop:C.ComponentOptions.buildBooleanOption({defaultValue:!0})},t.resultCurrentlyBeingRendered=null,t.MAX_AMOUNT_OF_SUCESSIVE_REQUESTS=5,t}(S.Component);t.ResultList=_,F.Initialization.registerAutoCreateComponent(_)},95:function(e,t,n){"use strict";var i=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])};return function(t,n){function i(){this.constructor=t}e(t,n),t.prototype=null===n?Object.create(n):(i.prototype=n.prototype,new i)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(o,s){function r(e){try{l(i.next(e))}catch(e){s(e)}}function a(e){try{l(i.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(r,a)}l((i=i.apply(e,t||[])).next())})},r=this&&this.__generator||function(e,t){function n(e){return function(t){return i([e,t])}}function i(n){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(r=s[2&n[0]?"return":n[0]?"throw":"next"])&&!(r=r.call(s,n[1])).done)return r;switch(s=0,r&&(n=[0,r.value]),n[0]){case 0:case 1:r=n;break;case 4:return l.label++,{value:n[1],done:!1};case 5:l.label++,s=n[1],n=[0];continue;case 7:n=l.ops.pop(),l.trys.pop();continue;default:if(r=l.trys,!(r=r.length>0&&r[r.length-1])&&(6===n[0]||2===n[0])){l=0;continue}if(3===n[0]&&(!r||n[1]>r[0]&&n[1]<r[3])){l.label=n[1];break}if(6===n[0]&&l.label<r[1]){l.label=r[1],r=n;break}if(r&&l.label<r[2]){l.label=r[2],l.ops.push(n);break}r[2]&&l.ops.pop(),l.trys.pop();continue}n=t.call(e,l)}catch(e){n=[6,e],s=0}finally{o=r=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var o,s,r,a,l={label:0,sent:function(){if(1&r[0])throw r[1];return r[1]},trys:[],ops:[]};return a={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a};Object.defineProperty(t,"__esModule",{value:!0});var a=n(7),l=n(6),c=n(8),u=n(1),h=n(2),p=n(3),d=n(548),f=n(549),m=n(551),y=n(16),g=n(12),v=n(13);n(552);var b=n(18),S=n(4),C=n(0),F=n(5),E=n(11),V=n(553),O=n(35),A=n(555),w=n(10),R=n(556),$=n(49),x=n(175),T=n(85),I=n(557),D=n(15),L=n(174),P=n(118),N=n(558),M=function(e){function t(n,i,o){var s=e.call(this,n,"CategoryFacet",o)||this;return s.element=n,s.options=i,s.listenToQueryStateChange=!0,s.isFieldValueCompatible=!1,s.moreValuesToFetch=!0,s.showingWaitAnimation=!1,s.numberOfChildValuesCurrentlyDisplayed=0,s.options=c.ComponentOptions.initComponentOptions(n,t,i),s.categoryFacetQueryController=new m.CategoryFacetQueryController(s),s.categoryFacetTemplates=new d.CategoryFacetTemplates,s.categoryValueRoot=new f.CategoryValueRoot(u.$$(s.element),s.categoryFacetTemplates,s),s.categoryValueRoot.path=s.activePath,s.currentPage=0,s.numberOfValues=s.options.numberOfValues,s.categoryFacetValuesTree=new N.CategoryFacetValuesTree,s.tryToInitFacetSearch(),s.options.debug&&new R.CategoryFacetDebug(s),x.ResponsiveFacets.init(s.root,s,s.options),s.initDependsOnManager(),s.bind.onRootElement(E.QueryEvents.buildingQuery,function(e){return s.handleBuildingQuery(e)}),s.bind.onRootElement(E.QueryEvents.querySuccess,function(e){return s.handleQuerySuccess(e)}),s.bind.onRootElement(E.QueryEvents.duringQuery,function(){return s.addFading()}),s.bind.onRootElement(E.QueryEvents.deferredQuerySuccess,function(){return s.handleDeferredQuerySuccess()}),s.bind.onRootElement(O.BreadcrumbEvents.populateBreadcrumb,function(e){return s.handlePopulateBreadCrumb(e)}),s.bind.onRootElement(O.BreadcrumbEvents.clearBreadcrumb,function(){return s.handleClearBreadcrumb()}),s.buildFacetHeader(),s.initQueryStateEvents(),s}return i(t,e),t.prototype.isCurrentlyDisplayed=function(){return u.$$(this.element).isVisible()},Object.defineProperty(t.prototype,"activePath",{get:function(){return this.queryStateModel.get(this.queryStateAttribute)||this.options.basePath},set:function(e){this.listenToQueryStateChange=!1,this.queryStateModel.set(this.queryStateAttribute,e),this.listenToQueryStateChange=!0},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"queryStateAttribute",{get:function(){return v.QueryStateModel.getFacetId(this.options.id)},enumerable:!0,configurable:!0}),t.prototype.handleBuildingQuery=function(e){this.positionInQuery=this.categoryFacetQueryController.putCategoryFacetInQueryBuilder(e.queryBuilder,this.activePath,this.numberOfValues+1)},t.prototype.scrollToTop=function(){P.ResultListUtils.scrollToTop(this.root)},t.prototype.tryToInitFacetSearch=function(){if(!this.isFacetSearchAvailable)return this.logDisabledFacetSearchWarning();this.categoryFacetSearch=new V.CategoryFacetSearch(this,this.options.displaySearchButton)},t.prototype.logDisabledFacetSearchWarning=function(){if(!this.isEnableFacetSearchFalsy){var e=this.getOptionAttributeName("valueCaption"),t=this.getOptionAttributeName("enableFacetSearch"),n=this.options.field;this.logger.warn("The search box is disabled on the "+n+" CategoryFacet. To hide this warning,\n either remove the "+e+" option or set the "+t+' option to "false".')}},t.prototype.getOptionAttributeName=function(e){return c.ComponentOptions.attrNameFromName(e)},Object.defineProperty(t.prototype,"isFacetSearchAvailable",{get:function(){return!this.areValueCaptionsSpecified&&!this.isEnableFacetSearchFalsy},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"areValueCaptionsSpecified",{get:function(){var e=this.options.valueCaption;return 0!==C.keys(e).length},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isEnableFacetSearchFalsy",{get:function(){return!this.options.enableFacetSearch},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"isCategoryEmpty",{get:function(){return!this.categoryValueRoot.children.length},enumerable:!0,configurable:!0}),t.prototype.updateAppearance=function(){if(this.disabled||this.isCategoryEmpty)return this.hide();this.show()},t.prototype.handleQuerySuccess=function(e){if(S.Utils.isNullOrUndefined(e.results.categoryFacets))return this.notImplementedError();if(!S.Utils.isNullOrUndefined(e.results.categoryFacets[this.positionInQuery])){var t=e.query.categoryFacets[this.positionInQuery].maximumNumberOfValues,n=e.results.categoryFacets[this.positionInQuery];if(this.moreValuesToFetch=t==n.values.length,this.clear(),n.notImplemented)return this.notImplementedError();if(n.values.length||n.parentValues.length){if(this.renderValues(n,t),this.isFacetSearchAvailable){var i=this.categoryFacetSearch.build();this.options.displaySearchOnTop?u.$$(i).insertBefore(this.categoryValueRoot.listRoot.el):u.$$(i).insertAfter(this.categoryValueRoot.listRoot.el)}this.moreLessContainer=u.$$("div",{className:"coveo-category-facet-more-less-container"}),u.$$(this.element).append(this.moreLessContainer.el),this.options.enableMoreLess&&this.renderMoreLess(),this.isPristine()||u.$$(this.element).addClass("coveo-category-facet-non-empty-path")}}},t.prototype.changeActivePath=function(e){this.activePath=e},t.prototype.executeQuery=function(){return s(this,void 0,void 0,function(){return r(this,function(e){switch(e.label){case 0:this.showWaitingAnimation(),e.label=1;case 1:return e.trys.push([1,,3,4]),[4,this.queryController.executeQuery()];case 2:return e.sent(),[3,4];case 3:return this.hideWaitingAnimation(),[7];case 4:return[2]}})})},t.prototype.reload=function(){this.changeActivePath(this.activePath),this.logAnalyticsEvent(w.analyticsActionCauseList.categoryFacetReload),this.executeQuery()},t.prototype.getVisibleParentValues=function(){return this.getVisibleParentCategoryValues().map(function(e){return e.getDescriptor()})},t.prototype.getVisibleParentCategoryValues=function(){if(0==this.categoryValueRoot.children.length||0==this.categoryValueRoot.children[0].children.length)return[];for(var e=this.categoryValueRoot.children[0],t=[e];0!=e.children.length&&!S.Utils.arrayEqual(e.path,this.activePath);)e=e.children[0],t.push(e);return t},t.prototype.showMore=function(){this.moreValuesToFetch&&(this.currentPage++,this.numberOfValues=this.options.numberOfValues+this.currentPage*this.options.pageSize,this.reload(),this.logAnalyticsFacetShowMoreLess(w.analyticsActionCauseList.facetShowMore))},t.prototype.showLess=function(){this.currentPage>0&&(this.currentPage--,this.numberOfValues=this.options.numberOfValues+this.currentPage*this.options.pageSize,this.reload(),this.logAnalyticsFacetShowMoreLess(w.analyticsActionCauseList.facetShowLess))},t.prototype.getAvailableValues=function(){return this.activeCategoryValue?this.activeCategoryValue.children.map(function(e){return{value:e.categoryValueDescriptor.value,count:e.categoryValueDescriptor.count,path:e.path}}):[]},t.prototype.selectValue=function(e){F.Assert.check(C.contains(C.pluck(this.getAvailableValues(),"value"),e),"Failed while trying to select a value that is not available.");var t=this.activePath.slice(0);t.push(e),this.changeActivePath(t),this.logAnalyticsEvent(w.analyticsActionCauseList.categoryFacetSelect),this.executeQuery()},t.prototype.deselectCurrentValue=function(){if(0!=this.activePath.length){var e=this.activePath.slice(0);e.pop(),this.changeActivePath(e),this.logAnalyticsEvent(w.analyticsActionCauseList.categoryFacetSelect),this.executeQuery()}},t.prototype.resetPath=function(){this.changeActivePath(this.options.basePath)},t.prototype.reset=function(){this.resetPath(),this.logAnalyticsEvent(w.analyticsActionCauseList.categoryFacetClear),this.executeQuery()},t.prototype.hide=function(){u.$$(this.element).addClass("coveo-hidden")},t.prototype.show=function(){u.$$(this.element).removeClass("coveo-hidden")},t.prototype.enable=function(){e.prototype.enable.call(this),this.updateAppearance()},t.prototype.disable=function(){e.prototype.disable.call(this),this.updateAppearance()},t.prototype.debugValue=function(e){return s(this,void 0,void 0,function(){var t,n;return r(this,function(i){switch(i.label){case 0:return t=new $.QueryBuilder,this.categoryFacetQueryController.addDebugGroupBy(t,e),[4,this.queryController.getEndpoint().search(t.build())];case 1:return n=i.sent(),R.CategoryFacetDebug.analyzeResults(n.groupByResults[0],this.options.delimitingCharacter),[2]}})})},t.prototype.getCaption=function(e){var t=this.options.valueCaption,n=t[e];return n||e},t.prototype.showWaitingAnimation=function(){this.ensureDom(),this.showingWaitAnimation||(u.$$(this.headerElement).find(".coveo-category-facet-header-wait-animation").style.visibility="visible",this.showingWaitAnimation=!0)},t.prototype.hideWaitingAnimation=function(){this.ensureDom(),this.showingWaitAnimation&&(u.$$(this.headerElement).find(".coveo-category-facet-header-wait-animation").style.visibility="hidden",this.showingWaitAnimation=!1)},t.prototype.logAnalyticsEvent=function(e,t){void 0===t&&(t=this.activePath),this.usageAnalytics.logSearchEvent(e,{categoryFacetId:this.options.id,categoryFacetField:this.options.field.toString(),categoryFacetPath:t,categoryFacetTitle:this.options.title})},t.prototype.getEndpoint=function(){return this.queryController.getEndpoint()},Object.defineProperty(t.prototype,"children",{get:function(){return this.categoryValueRoot.children},enumerable:!0,configurable:!0}),t.prototype.renderValues=function(e,n){this.categoryFacetValuesTree.storeNewValues(e);var i,o=this.sortParentValues(e.parentValues),s=this.categoryValueRoot,r=!1,a=Math.floor(t.NUMBER_OF_VALUES_TO_KEEP_AFTER_TRUNCATING/2),l=Math.ceil(t.NUMBER_OF_VALUES_TO_KEEP_AFTER_TRUNCATING/2);o=this.hideBasePathInParentValues(o),this.shouldTruncate(o)&&(i=this.findPathOfLastTruncatedParentValue(o,l),r=!0,o=C.first(o,a).concat(C.last(o,l))),this.isPristine()||this.addAllCategoriesButton();for(var c=0;c<o.length;c++){s=s.renderAsParent(o[c]);c==o.length-1||s.makeSelectable().showCollapseArrow(),r&&(c==a-1&&this.addEllipsis(),c==a&&(s.path=i.concat([o[c].value])))}var u=this.moreValuesToFetch?e.values.slice(0,n-1):e.values.slice(0,n);this.numberOfChildValuesCurrentlyDisplayed=u.length,s.renderChildren(u),this.activeCategoryValue=s},t.prototype.hideBasePathInParentValues=function(e){return S.Utils.arrayEqual(C.first(this.activePath,this.options.basePath.length),this.options.basePath)&&(e=C.last(e,e.length-this.options.basePath.length)),e},t.prototype.shouldTruncate=function(e){return e.length>t.MAXIMUM_NUMBER_OF_VALUES_BEFORE_TRUNCATING},t.prototype.addEllipsis=function(){this.categoryValueRoot.listRoot.append(this.categoryFacetTemplates.buildEllipsis().el)},t.prototype.findPathOfLastTruncatedParentValue=function(e,t){var n=e.length-t-1;return C.reduce(C.first(e,n+1),function(e,t){return e.concat([t.value])},[])},t.prototype.addAllCategoriesButton=function(){var e=this,t=this.categoryFacetTemplates.buildAllCategoriesButton();(new D.AccessibleButton).withLabel(l.l("AllCategories")).withElement(t).withSelectAction(function(){e.reset(),e.scrollToTop()}).build(),this.categoryValueRoot.listRoot.append(t.el)},t.prototype.isPristine=function(){return S.Utils.arrayEqual(this.activePath,this.options.basePath)},t.prototype.buildFacetHeader=function(){var e=new I.CategoryFacetHeader({categoryFacet:this,title:this.options.title});this.headerElement=e.build(),u.$$(this.element).prepend(this.headerElement)},t.prototype.handleQueryStateChanged=function(e){if(this.listenToQueryStateChange){var t=e.attributes[this.queryStateAttribute];!S.Utils.isNullOrUndefined(t)&&C.isArray(t)&&0!=t.length&&(this.activePath=t)}},t.prototype.initQueryStateEvents=function(){var e=this;this.queryStateModel.registerNewAttribute(this.queryStateAttribute,this.options.basePath),this.bind.onQueryState(b.MODEL_EVENTS.CHANGE,void 0,function(t){return e.handleQueryStateChanged(t)})},t.prototype.initDependsOnManager=function(){var e=this,t={reset:function(){return e.dependsOnReset()},ref:this};this.dependsOnManager=new L.DependsOnManager(t)},t.prototype.dependsOnReset=function(){this.changeActivePath(this.options.basePath),this.clear()},t.prototype.addFading=function(){u.$$(this.element).addClass("coveo-category-facet-values-fade")},t.prototype.handleDeferredQuerySuccess=function(){this.updateAppearance(),this.removeFading()},t.prototype.removeFading=function(){u.$$(this.element).removeClass("coveo-category-facet-values-fade")},t.prototype.notImplementedError=function(){this.logger.error("Category Facets are not supported by your current search endpoint. Disabling this component."),this.disable()},t.prototype.sortParentValues=function(e){if(this.activePath.length!=e.length)return this.logger.warn("Inconsistent CategoryFacet results: Number of parent values results does not equal length of active path"),e;for(var t=[],n=this,i=0,o=this.activePath;i<o.length;i++){var s=o[i],r=function(i){var o=C.find(e,function(e){return e.value.toLowerCase()==i.toLowerCase()});if(!o)return n.logger.warn("Inconsistent CategoryFacet results: path not consistent with parent values results"),{value:e};t.push(o)}(s);if("object"==typeof r)return r.value}return t},t.prototype.renderMoreLess=function(){this.numberOfChildValuesCurrentlyDisplayed>this.options.numberOfValues&&this.moreLessContainer.append(this.buildLessButton()),this.moreValuesToFetch&&this.moreLessContainer.append(this.buildMoreButton())},t.prototype.clear=function(){this.categoryValueRoot.clear(),this.isFacetSearchAvailable&&this.categoryFacetSearch.clear(),this.moreLessContainer&&this.moreLessContainer.detach(),u.$$(this.element).removeClass("coveo-category-facet-non-empty-path")},t.prototype.buildMoreButton=function(){var e=this,t=u.$$("span",{className:"coveo-facet-more-icon"},g.SVGIcons.icons.arrowDown).el;y.SVGDom.addClassToSVGInContainer(t,"coveo-facet-more-icon-svg");var n=u.$$("div",{className:"coveo-category-facet-more"},t);return(new D.AccessibleButton).withElement(n).withSelectAction(function(){return e.showMore()}).withLabel(l.l("ShowMoreFacetResults",this.options.title)).build(),n.el},t.prototype.buildLessButton=function(){var e=this,t=u.$$("span",{className:"coveo-facet-less-icon"},g.SVGIcons.icons.arrowUp).el;y.SVGDom.addClassToSVGInContainer(t,"coveo-facet-less-icon-svg");var n=u.$$("div",{className:"coveo-category-facet-less"},t);return(new D.AccessibleButton).withElement(n).withSelectAction(function(){return e.showLess()}).withLabel(l.l("ShowLessFacetResults",this.options.title)).build(),n.el},t.prototype.handlePopulateBreadCrumb=function(e){var t=this;if(!this.isPristine()){var n=this.categoryFacetValuesTree.getValueForLastPartInPath(this.activePath),i={path:this.activePath,count:n.numberOfResults,value:n.value},o=function(){t.logAnalyticsEvent(w.analyticsActionCauseList.breadcrumbFacet),t.reset()},s=new A.CategoryFacetBreadcrumb(this,o,i,{headingLevel:e.headingLevel});e.breadcrumbs.push({element:s.build()})}},t.prototype.handleClearBreadcrumb=function(){this.changeActivePath(this.options.basePath)},t.prototype.logAnalyticsFacetShowMoreLess=function(e){this.usageAnalytics.logCustomEvent(e,{facetId:this.options.id,facetField:this.options.field.toString(),facetTitle:this.options.title},this.element)},t.doExport=function(){p.exportGlobally({CategoryFacet:t})},t.ID="CategoryFacet",t.options=o({field:c.ComponentOptions.buildFieldOption({required:!0}),title:c.ComponentOptions.buildLocalizedStringOption({localizedString:function(){return l.l("NoTitle")}}),numberOfValues:c.ComponentOptions.buildNumberOption({defaultValue:5,min:0,section:"CommonOptions"}),enableFacetSearch:c.ComponentOptions.buildBooleanOption({defaultValue:!0}),id:c.ComponentOptions.buildStringOption({postProcessing:function(e,t){return e||t.field}}),injectionDepth:c.ComponentOptions.buildNumberOption({defaultValue:1e3,min:1e3}),numberOfResultsInFacetSearch:c.ComponentOptions.buildNumberOption({defaultValue:15,min:1}),facetSearchDelay:c.ComponentOptions.buildNumberOption({defaultValue:100,min:0}),enableMoreLess:c.ComponentOptions.buildBooleanOption({defaultValue:!0}),pageSize:c.ComponentOptions.buildNumberOption({defaultValue:10,min:1,depend:"enableMoreLess"}),delimitingCharacter:c.ComponentOptions.buildStringOption({defaultValue:"|"}),basePath:c.ComponentOptions.buildListOption({defaultValue:[]}),maximumDepth:c.ComponentOptions.buildNumberOption({min:1,defaultValue:Number.MAX_VALUE}),debug:c.ComponentOptions.buildBooleanOption({defaultValue:!1}),valueCaption:c.ComponentOptions.buildJsonOption({defaultValue:{}}),dependsOn:c.ComponentOptions.buildStringOption(),dependsOnCondition:c.ComponentOptions.buildCustomOption(function(){return null},{depend:"dependsOn",section:"CommonOptions"}),displaySearchOnTop:c.ComponentOptions.buildBooleanOption({defaultValue:!1}),displaySearchButton:c.ComponentOptions.buildBooleanOption({defaultValue:!0})},T.ResponsiveFacetOptions),t.MAXIMUM_NUMBER_OF_VALUES_BEFORE_TRUNCATING=15,t.NUMBER_OF_VALUES_TO_KEEP_AFTER_TRUNCATING=10,t.WAIT_ELEMENT_CLASS="coveo-category-facet-header-wait-animation",t}(a.Component);t.CategoryFacet=M,h.Initialization.registerAutoCreateComponent(M),M.doExport()}});
//# sourceMappingURL=TimespanFacet.min__cf4c4f4dd6c8a707e936.js.map