UNPKG

coveo-search-ui

Version:

Coveo JavaScript Search Framework

1 lines • 297 kB
webpackJsonpCoveo__temporary([4,1,3,19],{118:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(7),o=i(93),s=i(1),a=i(0),r=i(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 i=e.getMainResultList(t);return!!i&&!!i.options.enableInfiniteScroll},e.scrollToTop=function(t){var i=e.getMainResultList(t);if(!i)return new r.Logger(this).warn("No active ResultList, scrolling to the top of the Window"),window.scrollTo(0,0);var n=i.searchInterface.element.getBoundingClientRect().top;n>0||window.scrollTo(0,window.pageYOffset+n)},e.getMainResultList=function(t){var i=e.getResultLists(t);return a.find(i,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 n.Component.get(e,o.ResultList)})},e.cssClass=function(){return n.Component.computeCssClassName(o.ResultList)},e.warnIfComponentNotNeeded=function(t){var i=t.searchInterface.root;e.allResultListsUseInfiniteScroll(i)&&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 i=n.Component.computeCssClassNameForType(t.type),o="The "+i+" component is not needed because all "+e.cssClass()+" components have enableInfiniteScroll set to 'true'.\n For the best performance, remove the "+i+" component from your search page.";new r.Logger(t).warn(o)},e}();t.ResultListUtils=l},119:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(5),o=i(4),s=i(23),a=i(0),r=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){n.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){n.Assert.isLargerOrEqualsThan(0,e);var i=this.cloneWithZeroOccurrences();return i.delta=t,i.occurrences=e,i},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(a.isString(t))return e.createFromValue(t);if(a.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){n.Assert.isNonEmptyString(t);var i=new e;return i.value=t,i.lookupValue=t,i},e.createFromGroupByValue=function(t){n.Assert.exists(t),n.Assert.exists(t);var i=new e;return i.value=t.value,i.lookupValue=o.Utils.exists(t.lookupValue)?t.lookupValue:t.value,i.occurrences=t.numberOfResults,i.computedField=o.Utils.isNonEmptyArray(t.computedFieldResults)?t.computedFieldResults[0]:void 0,i.score=t.score,i},e.createFromFieldValue=function(t){n.Assert.exists(t);var i=new e;return i.value=t.value,i.lookupValue=t.lookupValue,i.occurrences=t.numberOfResults,i},e}();t.FacetValue=r},131:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(94),o=function(){function e(){}return e.shouldDrawFacetSlider=function(e,t){return n.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,i){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=i(477),s=function(e){function t(t,i,n){var o=e.call(this,t,i)||this;return o.facet=t,o.facetValue=i,o.keepDisplayedValueNextTime=n,o}return n(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,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(4),o=i(40),s=i(49),a=i(1),r=i(0),l=i(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,n.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;r.each(this.getCurrentlyShowedValueInSearch(e),function(e){var i=o.FacetUtils.getValuesToUseForSearchInFacet(e,t.facet);r.each(i,function(e){t.alwaysExclude.push(e)})}),r.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 i;i=this.valueToSearch?t.concat(this.alwaysInclude).concat(this.alwaysExclude):r.compact(t.concat(this.alwaysInclude).concat(this.facet.options.allowedValues));var n=this.completeFacetWithStandardValues;null!=this.facet.options.lookupField&&(n=!1);var o={allowedValues:i,allowedValuesPatternType:this.facet.options.useWildcardsInFacetSearch?l.AllowedValuesPatternType.Wildcards:l.AllowedValuesPatternType.Legacy,maximumNumberOfValues:e,completeFacetWithStandardValues:n,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=r.clone(this.facet.queryController.getLastQuery());return e||(e=(new s.QueryBuilder).build()),e.enableQuerySyntax?e.q=this.facet.facetQueryController.basicExpressionToUseForFacetSearch:n.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 r.map(a.$$(e).findAll(".coveo-facet-value-caption"),function(e){return a.$$(e).getAttribute("data-original-value")||a.$$(e).text()})},e.prototype.lowerCaseAll=function(){this.alwaysExclude=r.chain(this.alwaysExclude).map(function(e){return e.toLowerCase()}).uniq().value(),this.alwaysInclude=r.chain(this.alwaysInclude).map(function(e){return e.toLowerCase()}).uniq().value()},e}();t.FacetSearchParameters=c},174:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(0),o=i(20),s=i(47),a=i(1),r=i(17),l=function(){function e(e){var t=this;this.facet=e,a.$$(this.facet.ref.searchInterface.element).on(o.QueryEvents.buildingQuery,function(){return t.handleBuildingQuery()}),this.getDependsOn(this.facet.ref)&&this.facet.ref.bind.onRootElement(r.InitializationEvents.afterComponentsInitialization,function(){return t.setupDependentFacet()})}return e.prototype.setupDependentFacet=function(){var e=this;a.$$(this.facet.ref.element).addClass("coveo-hidden-dependant-facet"),this.parentFacetRef=this.getParentFacet(this.facet.ref),this.parentFacetRef&&a.$$(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,i=e.options.dependsOnCondition;return i&&n.isFunction(i)?i: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,i=this.allFacetsInInterface.filter(function(i){return t.getId(i)===t.getDependsOn(e)});return i.length?i[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 a.$$(t.element).removeClass("coveo-hidden-dependant-facet"),t.enable();t.disable(),a.$$(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,i){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}();Object.defineProperty(t,"__esModule",{value:!0});var o=i(216),s=i(70),a=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return n(t,e),t.init=function(e,i,n){o.ResponsiveFacetColumn.init(t,e,i,n,s.Facet.ID)},t}(o.ResponsiveFacetColumn);t.ResponsiveFacets=a},182:function(e,t,i){"use strict";function n(e){var t=e.filterFacetCount;return!!s.Utils.isUndefined(t)||t}var o=this&&this.__assign||Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];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=i(4),a=function(){function e(e){this.request=e}return e.prototype.buildBaseRequestForQuery=function(){return o({},this.request,{filterFacetCount:n(this.request)})},e}();t.DynamicFacetRequestBuilder=a,t.determineFilterFacetCount=n},183:function(e,t,i){"use strict";function n(e){return e+"-facet-heading"}Object.defineProperty(t,"__esModule",{value:!0}),i(568);var o=i(1),s=i(6),a=i(12),r=i(16),l=i(506),c=i(569),u=i(48);t.getDynamicFacetHeaderId=n;var h=function(){function e(e){this.options=e,this.element=o.$$("div",{className:"coveo-dynamic-facet-header"}).el,this.title=this.createTitle(),o.$$(this.element).append(this.title.el),o.$$(this.element).append(this.createWaitAnimation()),o.$$(this.element).append(this.createClearButton()),this.options.enableCollapse&&this.enableCollapse()}return e.prototype.createClearButton=function(){var e=this;return this.clearButton=new l.DynamicFacetHeaderButton({label:s.l("Clear"),ariaLabel:s.l("Clear",this.options.title),className:"coveo-dynamic-facet-header-clear",shouldDisplay:!1,action:function(){return e.options.clear()}}),this.clearButton.element},e.prototype.createCollapseToggle=function(){return this.collapseToggle=new c.DynamicFacetHeaderCollapseToggle(this.options),this.collapseToggle.element},e.prototype.enableCollapse=function(){var e=this;o.$$(this.element).append(this.createCollapseToggle()),o.$$(this.title).addClass("coveo-clickable"),o.$$(this.title).on("click",function(){return e.options.toggleCollapse()})},e.prototype.toggleCollapse=function(e){this.options.enableCollapse&&this.collapseToggle.toggleButton(e)},e.prototype.createTitle=function(){return o.$$(u.getHeadingTag(this.options.headingLevel),{className:"coveo-dynamic-facet-header-title",ariaLabel:""+s.l("FacetTitle",this.options.title),id:n(this.options.id)},o.$$("span",{ariaHidden:!0,title:this.options.title},this.options.title))},e.prototype.createWaitAnimation=function(){return this.waitAnimation=o.$$("div",{className:"coveo-dynamic-facet-header-wait-animation"},a.SVGIcons.icons.loading),r.SVGDom.addClassToSVGInContainer(this.waitAnimation.el,"coveo-dynamic-facet-header-wait-animation-svg"),this.waitAnimation.toggle(!1),this.waitAnimation.el},e.prototype.toggleClear=function(e){this.clearButton.toggle(e)},e.prototype.showLoading=function(){var t=this;clearTimeout(this.showLoadingTimeout),this.showLoadingTimeout=window.setTimeout(function(){return t.waitAnimation.toggle(!0)},e.showLoadingDelay)},e.prototype.hideLoading=function(){clearTimeout(this.showLoadingTimeout),this.waitAnimation.toggle(!1)},e.showLoadingDelay=2e3,e}();t.DynamicFacetHeader=h},184:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});!function(e){e.specific="specific",e.numericalRange="numericalRange",e.dateRange="dateRange",e.hierarchical="hierarchical"}(t.FacetType||(t.FacetType={}))},215:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(7),o=i(0),s=function(){function e(e,t){this.resultListOptions=e,this.autoCreateComponentsFn=t}return e.prototype.renderResults=function(e,t,i){var s=this;return void 0===t&&(t=!1),Promise.all([this.getStartFragment(e,t),this.getEndFragment(e,t)]).then(function(t){var a=t[0],r=t[1],l=document.createDocumentFragment();a&&l.appendChild(a),o.each(e,function(e){l.appendChild(e),i(n.Component.getResult(e),e)}),r&&l.appendChild(r),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,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),i(536);var n=i(11),o=i(9),s=i(6),a=i(1),r=i(4),l=i(7),c=i(19),u=i(55),h=i(62),p=i(131),d=i(124),f=i(94),m=i(136),y=i(0),g=i(47),v=i(537),b=i(86),S=i(538),C=function(){function e(e,t,i,n){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(n),this.bindDropdownContentEvents(),this.bindFacetsMobileModeEvents(),this.registerOnCloseHandler(),this.registerQueryEvents(),this.initializeBreakpoint(i.responsiveBreakpoint)}return e.init=function(t,i,n,o,s){this.findColumn(i)&&(h.ResponsiveComponentsManager.register(e,a.$$(i),"ResponsiveFacetColumn",n,o),h.ResponsiveComponentsManager.register(t,a.$$(i),s,n,o))},e.findColumn=function(e){var t=a.$$(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()<=(r.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()<=(r.Utils.isNullOrUndefined(this.breakpoint)?this.searchInterface.responsiveComponents.getMediumScreenWidth():this.breakpoint);default:return!1}},e.prototype.changeToSmallMode=function(){this.dropdown.close(),this.disableFacetPreservePosition(),a.$$(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(),i=this.buildDropdownHeader(),n=e||new d.ResponsiveDropdown(t,i,this.coveoRoot);return this.facetsMobileModeOptions.displayOverlayWhileOpen||n.disablePopupBackground(),this.facetsMobileModeOptions.preventScrolling&&n.enableScrollLocking(this.facetsMobileModeOptions.scrollContainer),n},e.prototype.buildDropdownContent=function(){var t=this,i=a.$$(this.coveoRoot.find(".coveo-facet-column")),n=a.$$("div",{className:"coveo-facet-header-filter-by-container",style:"display: none"}),o=a.$$("div",{className:"coveo-facet-header-filter-by"});return o.text(s.l("Filter by:")),n.append(o.el),i.prepend(n.el),this.facetsMobileModeOptions.isModal?new v.ResponsiveDropdownModalContent("facet",i,s.l("CloseFiltersDropdown"),function(){return t.dropdown.close()}):new f.ResponsiveDropdownContent("facet",i,this.coveoRoot,e.DROPDOWN_MIN_WIDTH,e.DROPDOWN_WIDTH_RATIO)},e.prototype.buildDropdownHeader=function(){var e=a.$$("a"),t=a.$$("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=r.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(n.QueryEvents.noResults,function(){return e.handleNoResults()}),this.coveoRoot.on(n.QueryEvents.querySuccess,function(t,i){return e.handleQuerySuccess(i)}),this.coveoRoot.on(n.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 i=e.facetSearch;i&&i.currentlyDisplayedResults&&!t.isFacetSearchScrolledIntoView(i.search)?e.facetSearch.positionSearchResults(t.dropdown.dropdownContent.element.el):i&&e.facetSearch.currentlyDisplayedResults&&e.facetSearch.positionSearchResults()})},e.DEBOUNCE_SCROLL_WAIT))},e.prototype.bindFacetsMobileModeEvents=function(){var e=this.facetsMobileModeComponent;e&&(this.dropdown.registerOnOpenHandler(function(){return a.$$(e.element).trigger(S.FacetsMobileModeEvents.popupOpened)},e),this.dropdown.registerOnCloseHandler(function(){return a.$$(e.element).trigger(S.FacetsMobileModeEvents.popupClosed)},e))},e.prototype.restoreFacetPreservePositionValue=function(){var e=this;y.each(this.componentsInFacetColumn,function(t,i){t.options&&(t.options.preservePosition=e.preservePositionOriginalValues[i])})},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,i=e.getBoundingClientRect().bottom,n=this.dropdown.dropdownContent.element.el.getBoundingClientRect().top,o=this.dropdown.dropdownContent.element.el.getBoundingClientRect().bottom;return n=n>=0?n:0,t>=n&&i<=o},e.prototype.getDropdownHeaderLabel=function(){var t;return g.ComponentsTypes.getAllFacetInstancesFromElement(this.coveoRoot.find(".coveo-facet-column")).forEach(function(e){var i=e.options;!t&&i.dropdownHeaderLabel&&(t=i.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,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(75),o=i(4),s=i(173),a=i(5),r=i(40),l=i(0),c=i(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 n.ExpressionBuilder,i=this.facet.values.getSelected();i.length>0&&(this.facet.options.useAnd?l.each(i,function(i){t.addFieldExpression(e.facet.options.field,"==",[i.value],e.shouldEscapeValueInFieldExpression)}):t.addFieldExpression(this.facet.options.field,"==",l.map(i,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){a.Assert.exists(e);var t=this.createGroupByAllowedValues(),i=this.createBasicGroupByRequest(t),n=this.createGroupByQueryOverride(e);if(o.Utils.isNullOrUndefined(n)&&c.QueryBuilderExpression.isEmpty(n)){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 i.queryOverride=n.basic,i.advancedQueryOverride=n.advanced,i.constantQueryOverride=n.constant,this.expressionToUseForFacetSearch=n.withoutConstant,this.basicExpressionToUseForFacetSearch=n.basic,this.advancedExpressionToUseForFacetSearch=n.advanced,this.constantExpressionToUseForFacetSearch=n.constant;this.lastGroupByRequestIndex=e.groupByRequests.length,this.lastGroupByRequest=i,e.groupByRequests.push(i)},e.prototype.search=function(e,t){var i=this;return void 0===t&&(t=e.nbResults),e.completeFacetWithStandardValues=!1,new Promise(function(n,o){var s=function(o){var s=o.length;if(o=i.checkForFacetSearchValuesToRemove(o,e.valueToSearch),r.FacetUtils.needAnotherFacetSearch(o.length,s,t,5))return e.nbResults+=5,i.search(e,o.length);n(o)},a=i.facet.getEndpoint().search(e.getQuery());i.currentSearchPromise=a,a.then(function(t){if(i.currentSearchPromise==a){var n=[];t.groupByResults&&t.groupByResults[0]&&l.each(t.groupByResults[0].values,function(t){t.lookupValue?l.contains(e.alwaysExclude,t.lookupValue.toLowerCase())||n.push(t):l.contains(e.alwaysExclude,t.value.toLowerCase())||n.push(t)}),s(l.first(n,e.nbResults))}else o()}).catch(function(e){o(e)})})},e.prototype.fetchMore=function(e){var t=this,i=new s.FacetSearchParameters(this.facet);return i.alwaysInclude=this.facet.options.allowedValues||l.pluck(this.facet.values.getAll(),"value"),i.nbResults=e,this.facet.getEndpoint().search(i.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),i=t.getQuery();return i.aq=(i.aq?i.aq:"")+" "+this.computeOurFilterExpression(),l.each(e,function(e){e.waitingForDelta=!0}),i.groupBy=[this.createBasicGroupByRequest(l.map(e,function(e){return e.value}))],i.groupBy[0].completeFacetWithStandardValues=!1,this.facet.getEndpoint().search(i)},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 i=this.facet.numberOfValues;if(null!=this.facet.options.customSort){var n=this.getUnionWithCustomSortLowercase(this.facet.options.customSort,this.facet.values.getSelected().concat(this.facet.values.getExcluded()));i=Math.max(i,n.length)}var s={field:this.facet.options.field,maximumNumberOfValues:i+(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 i=l.map(e,function(e){return e.toLowerCase()}),n=l.chain(t).filter(function(e){return!l.contains(i,e.value.toLowerCase())}).map(function(e){return e.value}).value();return l.compact(e.concat(n))},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 i=this.computeOurFilterExpression();t=e.computeCompleteExpressionPartsExcept(i),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 i=e.constantExpression.isEmpty()?"":e.constantExpression.build()+" ";t.constant=""+i+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 n.ExpressionBuilder;e.advancedExpression.getParts().forEach(function(e){return t.add(e)});var i=this.computeOurFilterExpression();return t.remove(i),t.build()},e.prototype.processQueryOverrideForEmptyValues=function(e,t){var i=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(i).length&&(t=void 0),t},e.prototype.checkForFacetSearchValuesToRemove=function(e,t){var i=this,n=r.FacetUtils.getRegexToUseForFacetSearch(t,this.facet.options.facetSearchIgnoreAccents);return l.filter(e,function(e){var t=l.isEmpty(i.facet.options.allowedValues)||i.isValueAllowedByAllowedValueOption(e.value),o=i.facet.getValueCaption(e);return t&&n.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(i){var n=t.replaceWildcardsWithRegexEquivalent(t.escapeMostRegexCharacters(i));return new RegExp("^"+n+"$","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},224:function(e,t){},225:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(1),o=function(){function e(e){var t=n.$$("button",{className:e.className,ariaLabel:e.ariaLabel,type:"button"},e.label);this.element=n.$$("li",{role:"none"},t).el,t.on("click",function(){return e.action()})}return e}();t.DynamicFacetValueShowMoreLessButton=o},292:function(e,t,i){"use strict";var n=this&&this.__extends||function(){var e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var i in t)t.hasOwnProperty(i)&&(e[i]=t[i])};return function(t,i){function n(){this.constructor=t}e(t,i),t.prototype=null===i?Object.create(i):(n.prototype=i.prototype,new n)}}(),o=this&&this.__assign||Object.assign||function(e){for(var t,i=1,n=arguments.length;i<n;i++){t=arguments[i];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},s=this&&this.__awaiter||function(e,t,i,n){return new(i||(i=Promise))(function(o,s){function a(e){try{l(n.next(e))}catch(e){s(e)}}function r(e){try{l(n.throw(e))}catch(e){s(e)}}function l(e){e.done?o(e.value):new i(function(t){t(e.value)}).then(a,r)}l((n=n.apply(e,t||[])).next())})},a=this&&this.__generator||function(e,t){function i(e){return function(t){return n([e,t])}}function n(i){if(o)throw new TypeError("Generator is already executing.");for(;l;)try{if(o=1,s&&(a=s[2&i[0]?"return":i[0]?"throw":"next"])&&!(a=a.call(s,i[1])).done)return a;switch(s=0,a&&(i=[0,a.value]),i[0]){case 0:case 1:a=i;break;case 4:return l.label++,{value:i[1],done:!1};case 5:l.label++,s=i[1],i=[0];continue;case 7:i=l.ops.pop(),l.trys.pop();continue;default:if(a=l.trys,!(a=a.length>0&&a[a.length-1])&&(6===i[0]||2===i[0])){l=0;continue}if(3===i[0]&&(!a||i[1]>a[0]&&i[1]<a[3])){l.label=i[1];break}if(6===i[0]&&l.label<a[1]){l.label=a[1],a=i;break}if(a&&l.label<a[2]){l.label=a[2],l.ops.push(i);break}a[2]&&l.ops.pop(),l.trys.pop();continue}i=t.call(e,l)}catch(e){i=[6,e],s=0}finally{o=a=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}var o,s,a,r,l={label:0,sent:function(){if(1&a[0])throw a[1];return a[1]},trys:[],ops:[]};return r={next:i(0),throw:i(1),return:i(2)},"function"==typeof Symbol&&(r[Symbol.iterator]=function(){return this}),r};Object.defineProperty(t,"__esModule",{value:!0}),i(224);var r=i(7),l=i(6),c=i(8),u=i(1),h=i(2),p=i(3),d=i(682),f=i(13),m=i(18),y=i(4),g=i(0),v=i(5),b=i(11),S=i(35),C=i(683),V=i(10),F=i(175),A=i(85),O=i(183),E=i(174),w=i(118),R=i(184),$=i(684),x=i(72),T=i(513),I=i(9),P=i(688),D=function(e){function t(i,n,o){var s=e.call(this,i,"DynamicHierarchicalFacet",o)||this;return s.element=i,s.listenToQueryStateChange=!0,s.moreValuesAvailable=!1,s.isDynamicFacet=!0,s.isFieldValueCompatible=!0,s.isFieldValueHierarchical=!0,s.options=c.ComponentOptions.initComponentOptions(i,t,n),s.dynamicHierarchicalFacetQueryController=new d.DynamicHierarchicalFacetQueryController(s),s.isCollapsed=s.options.enableCollapse&&s.options.collapsedByDefault,s.verifyCollapsingConfiguration(),s.values=new $.DynamicHierarchicalFacetValues(s),F.ResponsiveFacets.init(s.root,s,s.options),s.initDependsOnManager(),s.initBreadCrumbEvents(),s.initQueryEvents(),s.initQueryStateEvents(),s}return n(t,e),Object.defineProperty(t.prototype,"fieldName",{get:function(){return this.options.field.slice(1)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"facetType",{get:function(){return R.FacetType.hierarchical},enumerable:!0,configurable:!0}),t.prototype.isCurrentlyDisplayed=function(){return u.$$(this.element).isVisible()},Object.defineProperty(t.prototype,"hasActiveValues",{get:function(){return this.values.hasSelectedValue},enumerable:!0,configurable:!0}),t.prototype.hasSelectedValue=function(e){var t=this.splitValue(e);return g.isEqual(t,this.values.selectedPath)},t.prototype.selectValue=function(e){this.selectPath(this.splitValue(e))},t.prototype.deselectValue=function(){this.clear()},t.prototype.getCaptionForStringValue=function(e){return this.getCaption(g.last(this.splitValue(e)))},t.prototype.initQueryEvents=function(){var e=this;this.bind.onRootElement(b.QueryEvents.doneBuildingQuery,function(t){return e.handleDoneBuildingQuery(t)}),this.bind.onRootElement(b.QueryEvents.deferredQuerySuccess,function(t){return e.handleQuerySuccess(t.results)}),this.bind.onRootElement(b.QueryEvents.duringQuery,function(){return e.ensureDom()}),this.bind.onRootElement(b.QueryEvents.queryError,function(){return e.onNoValues()})},t.prototype.initBreadCrumbEvents=function(){var e=this;this.options.includeInBreadcrumb&&(this.bind.onRootElement(S.BreadcrumbEvents.populateBreadcrumb,function(t){return e.handlePopulateBreadcrumb(t)}),this.bind.onRootElement(S.BreadcrumbEvents.clearBreadcrumb,function(){return e.reset()}))},Object.defineProperty(t.prototype,"queryStateAttribute",{get:function(){return f.QueryStateModel.getFacetId(this.options.id)},enumerable:!0,configurable:!0}),t.prototype.handleDoneBuildingQuery=function(e){this.dynamicFacetManager||(v.Assert.exists(e),v.Assert.exists(e.queryBuilder),this.putStateIntoQueryBuilder(e.queryBuilder),this.putStateIntoAnalytics())},t.prototype.verifyCollapsingConfiguration=function(){this.options.collapsedByDefault&&!this.options.enableCollapse&&this.logger.warn('Setting "collapseByDefault" to "true" has no effect when "enableCollapse" is set to "false"')},t.prototype.putStateIntoQueryBuilder=function(e){v.Assert.exists(e),this.dynamicHierarchicalFacetQueryController.putFacetIntoQueryBuilder(e)},t.prototype.putStateIntoAnalytics=function(){var e=this.usageAnalytics.getPendingSearchEvent();e&&e.addFacetState(this.analyticsFacetState)},t.prototype.scrollToTop=function(){this.options.enableScrollToTop&&w.ResultListUtils.scrollToTop(this.root)},t.prototype.updateAppearance=function(){this.header.toggleCollapse(this.isCollapsed),this.toggleSearchDisplay(),u.$$(this.element).toggleClass("coveo-dynamic-hierarchical-facet-collapsed",this.isCollapsed),u.$$(this.element).toggleClass("coveo-hidden",!this.values.allFacetValues.length)},t.prototype.toggleSearchDisplay=function(){if(!1!==this.options.enableFacetSearch)return u.$$(this.search.element).toggleClass("coveo-hidden",this.isCollapsed)},t.prototype.handleQuerySuccess=function(e){if(!this.dynamicFacetManager)return y.Utils.isNullOrUndefined(e.facets)?this.notImplementedError():void this.handleQueryResults(e)},t.prototype.handleQueryResults=function(e){var t=g.findIndex(e.facets,{facetId:this.options.id}),i=-1!==t?e.facets[t]:null;this.position=i?t+1:void 0,i?this.onNewValues(i):this.onNoValues(),this.header.hideLoading(),this.updateQueryStateModel(this.values.selectedPath),this.values.render(),this.updateAppearance()},t.prototype.splitValue=function(e){return e.trim().split(this.options.delimitingCharacter)},t.prototype.onNewValues=function(e){var t=this;if(this.moreValuesAvailable=e.moreValuesAvailable,this.values.createFromResponse(e),this.options.customSort){var i=this.options.customSort.split(this.options.customSortDelimitingCharacter).map(function(e){return t.splitValue(e)});this.values.reorderValues(i)}},t.prototype.onNoValues=function(){this.moreValuesAvailable=!1,this.values.resetValues()},t.prototype.updateQueryStateModel=function(e){this.listenToQueryStateChange=!1,this.queryStateModel.set(this.queryStateAttribute,e),this.listenToQueryStateChange=!0},t.prototype.beforeSendingQuery=function(){this.header.showLoading()},t.prototype.triggerNewQuery=function(e){this.beforeSendingQuery();var t=e?{beforeExecuteQuery:e}:{ignoreWarningSearchEvent:!0};this.queryController.executeQuery(t)},t.prototype.triggerNewIsolatedQuery=function(e){return s(this,void 0,void 0,function(){var t,i;return a(this,function(n){switch(n.label){case 0:this.beforeSendingQuery(),e&&e(),n.label=1;case 1:return n.trys.push([1,3,,4]),[4,this.dynamicHierarchicalFacetQueryController.getQueryResults()];case 2:return t=n.sent(),this.handleQueryResults(t),[3,4];case 3:return i=n.sent(),this.header.hideLoading(),[3,4];case 4:return[2]}})})},t.prototype.showMoreValues=function(e){var t=this;void 0===e&&(e=this.options.numberOfValues),this.ensureDom(),this.logger.info("Show more values"),this.dynamicHierarchicalFacetQueryController.increaseNumberOfValuesToRequest(e),this.triggerNewIsolatedQuery(function(){return t.logAnalyticsFacetShowMoreLess(V.analyticsActionCauseList.dynamicFacetShowMore)})},t.prototype.showLessValues=function(){var e=this;this.ensureDom(),this.logger.info("Show less values"),this.dynamicHierarchicalFacetQueryController.resetNumberOfValuesToRequest(),this.triggerNewIsolatedQuery(function(){return e.logAnalyticsFacetShowMoreLess(V.analyticsActionCauseList.dynamicFacetShowLess)})},t.prototype.selectPath=function(e){v.Assert.exists(e),v.Assert.isLargerThan(0,e.length),this.ensureDom(),this.updateQueryStateModel(e),this.values.selectPath(e),this.logger.info("Toggle select facet value at path",e)},t.prototype.clear=function(){var e=this;this.reset(),this.scrollToTop(),this.triggerNewQuery(function(){return e.logAnalyticsEvent(V.analyticsActionCauseList.dynamicFacetClearAll)})},t.prototype.reset=function(){this.ensureDom(),this.values.hasSelectedValue&&(this.enablePreventAutoSelectionFlag(),this.logger.info("Deselect facet value"),this.values.clearPath(),this.updateQueryStateModel([]))},t.prototype.toggleCollapse=function(){this.isCollapsed?this.expand():this.collapse()},t.prototype.expand=function(){if(!this.options.enableCollapse)return this.logger.warn('Calling expand() won\'t do anything on a facet that has the option "enableCollapse" set to "false"');this.isCollapsed&&(this.ensureDom(),this.logger.info("Expand facet values"),this.isCollapsed=!1,this.updateAppearance())},t.prototype.enableFreezeFacetOrderFlag=function(){this.dynamicHierarchicalFacetQueryController.enableFreezeFacetOrderFlag()},t.prototype.enablePreventAutoSelectionFlag=function(){this.dynamicHierarchicalFacetQueryController.enablePreventAutoSelectionFlag()},t.prototype.collapse=function(){if(!this.options.enableCollapse)return this.logger.warn('Calling collapse() won\'t do anything on a facet that has the option "enableCollapse" set to "false"');this.isCollapsed||(this.ensureDom(),this.logger.info("Collapse facet values"),this.isCollapsed=!0,this.updateAppearance())},t.prototype.createDom=function(){this.createAndAppendContent(),this.updateAppearance()},t.prototype.getCaption=function(e){var t=this.options.valueCaption,i=t[e];return i||e},t.prototype.logAnalyticsEvent=function(e){this.usageAnalytics.logSearchEvent(e,this.analyticsFacetMeta)},Object.defineProperty(t.prototype,"analyticsFacetValue",{get:function(){return this.values.selectedPath.join(this.options.delimitingCharacter)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"analyticsFacetState",{get:function(){return this.values.hasSelectedValue?[{field:this.options.field.toString(),id:this.options.id,title:this.options.title,facetType:this.facetType,facetPosition:this.position,value:this.analyticsFacetValue,displayValue:this.analyticsFacetValue,state:x.FacetValueState.selected,valuePosition:1}]:[]},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"analyticsFacetMeta",{get:function(){return{facetField:this.options.field.toString(),facetId:this.options.id,facetTitle:this.options.title,facetValue:this.analyticsFacetValue}},enumerable:!0,configurable:!0}),t.prototype.createAndAppendContent=function(){this.createAndAppendHeader(),this.createAndAppendSearch(),this.createAndAppendValues()},t.prototype.createAndAppendHeader=function(){var e=this;this.header=new O.DynamicFacetHeader({id:this.options.id,title:this.options.title,enableCollapse:this.options.enableCollapse,headingLevel:this.options.headingLevel,clear:function(){return e.clear()},toggleCollapse:function(){return e.toggleCollapse()},expand:function(){return e.expand()},collapse:function(){return e.collapse()}}),this.element.appendChild(this.header.element)},t.prototype.createAndAppendSearch=function(){!1!==this.options.enableFacetSearch&&(this.search=new P.DynamicHierarchicalFacetSearch(this),this.element.appendChild(this.search.element))},t.prototype.createAndAppendValues=function(){this.element.appendChild(this.values.render())},t.prototype.pathIsValidForSelection=function(e){return!y.Utils.isNullOrUndefined(e)&&g.isArray(e)},t.prototype.handleQueryStateChanged=function(e){if(this.listenToQueryStateChange){var t=e.attributes[this.queryStateAttribute];this.pathIsValidForSelection(t)&&(y.Utils.arrayEqual(t,this.values.selectedPath)||(t.length?this.selectPath(t):this.reset()))}},t.prototype.initQueryStateEvents=function(){var e=this;this.queryStateModel.registerNewAttribute(this.queryStateAttribute,[]),this.bind.onQueryState(m.MODEL_EVENTS.CHANGE,void 0,function(t){return e.handleQueryStateChanged(t)})},t.prototype.initDependsOnManager=function(){var e=this,t={reset:function(){return e.reset()},ref:this};this.dependsOnManager=new E.DependsOnManager(t)},t.prototype.notImplementedError=function(){this.logger.error("DynamicHierarchicalFacets are not supported by your current search endpoint. Disabling this component."),this.disable(),this.updateAppearance()},t.prototype.handlePopulateBreadcrumb=function(e){if(v.Assert.exists(e),this.values.hasSelectedValue){var t=new C.DynamicHierarchicalFacetBreadcrumb(this,{headingLevel:e.headingLevel});e.breadcrumbs.push({element:t.element})}},t.prototype.logAnalyticsFacetShowMoreLess=function(e){this.usageAnalytics.logCustomEvent(e,this.analyticsFacetMeta,this.element)},t.ID="DynamicHierarchicalFacet",t.doExport=function(){p.exportGlobally({DynamicHierarchicalFacet:t})},t.options=o({id:c.ComponentOptions.buildStringOption({postProcessing:function(e,t){return e||t.field},section:"CommonOptions"}),field:c.ComponentOptions.buildFieldOption({required:!0,section:"CommonOptions"}),title:c.ComponentOptions.buildLocalizedStringOption({localizedString:function(){return l.l("NoTitle")},section:"CommonOptions"}),numberOfValues:c.ComponentOptions.buildNumberOption({defaultValue:5,min:0,section:"CommonOptions"}),enableCollapse:c.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"CommonOptions"}),collapsedByDefault:c.ComponentOptions.buildBooleanOption({defaultValue:!1,section:"CommonOptions",depend:"enableCollapse"}),enableScrollToTop:c.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"CommonOptions"}),includeInBreadcrumb:c.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"CommonOptions"}),injectionDepth:c.ComponentOptions.buildNumberOption({defaultValue:1e3,min:1e3}),enableMoreLess:c.ComponentOptions.buildBooleanOption({defaultValue:!0,section:"CommonOptions"}),enableFacetSearch:c.ComponentOptions.buildBooleanOption({section:"Filtering",defaultValue:!1}),delimitingCharacter:c.ComponentOptions.buildStringOption({defaultValue:"|",section:"CommonOptions"}),valueCaption:c.ComponentOptions.buildJsonOption({defaultValue:{}}),dependsOn:c.ComponentOptions.buildStringOption({section:"CommonOptions"}),dependsOnCondition:c.ComponentOptions.buildCustomOption(function(){return null},{depend:"dependsOn",section:"CommonOptions"}),filterFacetCount:c.ComponentOptions.buildBooleanOption({section:"Filtering"}),sortCriteria:c.ComponentOptions.buildStringOption({postProcessing:function(e){if(e)return e===T.FacetSortCriteria.alphanumeric||e===T.FacetSortCriteria.occurrences?e:void new I.Logger(e).warn('sortCriteria is not of the the allowed values: "alphanumeric", "occurrences"')},section:"Sorting"}),customSort:c.ComponentOptions.buildStringOption({section:"Sorting"}),customSortDelimitingCharacter:c.ComponentOptions.buildStringOption({section:"Sorting",depend:"customSort",postProcessing:function(e,t){return y.Utils.isNullOrUndefined(e)?","===t.delimitingCharacter?"|":",":e}}),clearLabel:c.ComponentOptions.buildLocalizedStringOption({localizedString:function(){return l.l("AllCategories")},section:"CommonOptions"}),basePath:c.ComponentOptions.buildListOption({defaultValue:[]}),headingLevel:c.ComponentOptions.buildNumberOption({defaultValue:2,min:0,max:6})},A.ResponsiveFacetOptions),t}(r.Component);t.DynamicHierarchicalFacet=D,h.Initialization.registerAutoCreateComponent(D),D.doExport()},40:function(e,t,i){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=i(22),o=i(21),s=i(121),a=i(33),r=i(4),l=i(1),c=i(0),u=i(6),h=function(){function e(){}return e.getRegexToUseForFacetSearch=function(e,t){return new RegExp(n.StringUtils.stringToRegex(e,t),"i")},e.getDisplayValueFromValueCaption=function(e,t,i){var n=this.tryToGetTranslatedCaption(t,e,!1);return i[e]||n},e.getValuesToUseForSearchInFacet=function(e,t){var i=[e],n=this.getRegexToUseForFacetSearch(e,t.options.facetSearchIgnoreAccents);return t.options.valueCaption?(c.chain(t.options.valueCaption).pairs().filter(function(e){return n.test(e[1])}).each(function(e){i.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||!n.test(e)||i.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 n.test(e[1])}),function(e){i.push(e[0])}):o.QueryUtils.isStratusAgnosticField(t.options.field,"@month")&&c.each(c.range(1,13),function(e){n.test(a.DateUtils.monthToString(e-1))&&i.push(("0"+e.toString()).substr(-2))}),i},e.buildFacetSearchPattern=function(e){return e=c.map(e,function(e){return r.Utils.escapeRegexCharacter(e)}),e[0]=".*"+e[0]+".*",e.join("|")},e.needAnotherFacetSearch=function(e,t,i,n){return e<t&&e<n&&e>i},e.addNoStateCssClassToFacetValues=function(e,t){if(0!=e.values.getSelected().length){var i=l.$$(t).findAll("li:not(.coveo-selected)");c.each(i,function(e){l.$$(e).addClass("coveo-no-state