UNPKG

coveo-search-ui

Version:

Coveo JavaScript Search Framework

1 lines • 55.4 kB
webpackJsonpCoveo__temporary([16,19],{118:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),r=n(93),o=n(1),s=n(0),l=n(9),a=function(){function e(){}return e.hideIfInfiniteScrollEnabled=function(t){e.isInfiniteScrollEnabled(t.searchInterface.element)?(t.disable(),o.$$(t.element).hide(),e.warnIfComponentNotNeeded(t)):(t.enable(),o.$$(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 l.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 s.find(n,function(e){var t=e.searchInterface.element.classList.contains("CoveoRecommendation");return!e.disabled&&!t})},e.getResultLists=function(t){return o.$$(t).findAll("."+e.cssClass()).map(function(e){return i.Component.get(e,r.ResultList)})},e.cssClass=function(){return i.Component.computeCssClassName(r.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),r="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 l.Logger(t).warn(r)},e}();t.ResultListUtils=a},215:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(7),r=n(0),o=function(){function e(e,t){this.resultListOptions=e,this.autoCreateComponentsFn=t}return e.prototype.renderResults=function(e,t,n){var o=this;return void 0===t&&(t=!1),Promise.all([this.getStartFragment(e,t),this.getEndFragment(e,t)]).then(function(t){var s=t[0],l=t[1],a=document.createDocumentFragment();s&&a.appendChild(s),r.each(e,function(e){a.appendChild(e),n(i.Component.getResult(e),e)}),l&&a.appendChild(l),o.resultListOptions.resultsContainer.appendChild(a)})},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=o},264: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}),n(638);var r=n(11),o=n(29),s=n(3),l=n(5),a=n(18),u=n(13),c=n(6),p=n(15),h=n(24),d=n(1),f=n(118),g=n(16),m=n(12),y=n(10),v=n(7),b=n(8),T=n(2),C=function(e){function t(n,i,o){var s=e.call(this,n,t.ID,o)||this;return s.element=n,s.options=i,s.listenToQueryStateChange=!0,s.ignoreNextQuerySuccess=!1,s.needToReset=!0,s.options=b.ComponentOptions.initComponentOptions(n,t,i),s.currentPage=1,s.bind.onRootElement(r.QueryEvents.newQuery,function(e){return s.handleNewQuery(e)}),s.bind.onRootElement(r.QueryEvents.buildingQuery,function(e){return s.handleBuildingQuery(e)}),s.bind.onRootElement(r.QueryEvents.querySuccess,function(e){return s.handleQuerySuccess(e)}),s.bind.onRootElement(r.QueryEvents.queryError,function(){return s.handleQueryError()}),s.bind.onRootElement(r.QueryEvents.noResults,function(e){return s.handleNoResults(e)}),s.bind.onQueryState(a.MODEL_EVENTS.CHANGE_ONE,u.QUERY_STATE_ATTRIBUTES.FIRST,function(e){return s.handleQueryStateFirstResultChanged(e)}),s.bind.onQueryState(a.MODEL_EVENTS.CHANGE_ONE,u.QUERY_STATE_ATTRIBUTES.NUMBER_OF_RESULTS,function(e){return s.handleQueryStateNumberOfResultsPerPageChanged(e)}),s.addAlwaysActiveListeners(),s.addAccessibilityAttributes(),s.list=d.$$("ul",{className:"coveo-pager-list"}).el,n.appendChild(s.list),s}return i(t,e),Object.defineProperty(t.prototype,"currentPage",{get:function(){return this._currentPage},set:function(e){var t=e;isNaN(e)&&(this.logger.warn("Unable to set pager current page to an invalid value: "+e+". Resetting to 1."),t=1),t=Math.max(Math.min(t,this.getMaxNumberOfPagesForCurrentResultsPerPage()),1),t=Math.floor(t),this._currentPage=t},enumerable:!0,configurable:!0}),t.prototype.setPage=function(e,t){void 0===t&&(t=y.analyticsActionCauseList.pagerNumber),l.Assert.exists(e),this.currentPage=e,this.updateQueryStateModel(this.getFirstResultNumber(this.currentPage)),this.usageAnalytics.logCustomEvent(t,{pagerNumber:this.currentPage},this.element),this.queryController.executeQuery({ignoreWarningSearchEvent:!0,keepLastSearchUid:!0,origin:this})},t.prototype.previousPage=function(){this.setPage(this.currentPage-1,y.analyticsActionCauseList.pagerPrevious)},t.prototype.nextPage=function(){this.setPage(this.currentPage+1,y.analyticsActionCauseList.pagerNext)},t.prototype.addAccessibilityAttributes=function(){this.element.getAttribute("role")||this.element.setAttribute("role","navigation"),this.element.hasAttribute("aria-label")||this.element.setAttribute("aria-label",c.l("Pagination"))},t.prototype.addAlwaysActiveListeners=function(){var e=this;this.searchInterface.element.addEventListener(o.ResultListEvents.newResultsDisplayed,function(){return f.ResultListUtils.hideIfInfiniteScrollEnabled(e)})},t.prototype.getMaxNumberOfPagesForCurrentResultsPerPage=function(){return Math.ceil(this.options.maximumNumberOfResultsFromIndex/this.searchInterface.resultsPerPage)},t.prototype.handleNewQuery=function(e){var n=e&&e.origin&&(e.origin.type==t.ID||"Debug"==e.origin.type);this.needToReset&&!n&&(this.currentPage=1,this.updateQueryStateModel(this.getFirstResultNumber(this.currentPage))),this.needToReset=!0},t.prototype.updateQueryStateModel=function(e){this.listenToQueryStateChange=!1,this.queryStateModel.set(u.QueryStateModel.attributesEnum.first,e),this.listenToQueryStateChange=!0},t.prototype.handleQueryError=function(){this.reset()},t.prototype.handleQuerySuccess=function(e){var t=this;if(this.reset(),this.ignoreNextQuerySuccess)this.ignoreNextQuerySuccess=!1;else{l.Assert.isNotUndefined(e);var n=e.query.firstResult,i=e.results.totalCountFiltered,r=this.computePagerBoundary(n,i);if(this.currentPage=r.currentPage,r.end-r.start>0){for(var o=this,s=r.start;s<=r.end;s++)!function(e){var n=e,i=n===o.currentPage,r=d.$$("span",{className:"coveo-pager-list-item-text coveo-pager-anchor",tabindex:0,ariaPressed:""+i},e.toString(10)).el,s=d.$$("li",{className:"coveo-pager-list-item"}).el;i&&(d.$$(s).addClass("coveo-active"),r.setAttribute("aria-current","page"));var l=function(e){e.stopPropagation(),t.handleClickPage(n)};(new p.AccessibleButton).withElement(r).withLabel(c.l("PageNumber",e.toString(10))).withClickAction(l).withEnterKeyboardAction(l).build(),d.$$(s).on("click",function(e){return l(e)}),s.appendChild(r),o.list.appendChild(s)}(s);this.options.enableNavigationButton&&r.lastResultPage>1&&this.renderNavigationButton(r)}}},t.prototype.handleNoResults=function(e){var t;if(e.results.totalCount>0){var n=this.computePagerBoundary(e.results.totalCountFiltered,e.results.totalCount).lastResultPage;this.currentPage>n&&(t=n)}else this.currentPage>this.getMaxNumberOfPagesForCurrentResultsPerPage()&&(t=this.getMaxNumberOfPagesForCurrentResultsPerPage());null!=t&&(this.currentPage=t,e.retryTheQuery=!0,this.needToReset=!1,this.ignoreNextQuerySuccess=!1,this.updateQueryStateModel(this.getFirstResultNumber(this.currentPage)))},t.prototype.reset=function(){d.$$(this.list).empty()},t.prototype.handleBuildingQuery=function(e){l.Assert.exists(e);var t=this.getQueryEventArgs();e.queryBuilder.firstResult=t.first,null==e.queryBuilder.numberOfResults&&(e.queryBuilder.numberOfResults=t.count);var n=e.queryBuilder.firstResult+e.queryBuilder.numberOfResults,i=Math.max(0,n-this.options.maximumNumberOfResultsFromIndex);e.queryBuilder.numberOfResults-=i},t.prototype.computePagerBoundary=function(e,t){var n=this.searchInterface.resultsPerPage,i=Math.floor(e/n)+1,r=Math.max(Math.min(Math.ceil(t/n),this.getMaxNumberOfPagesForCurrentResultsPerPage()),1),o=Math.floor(this.options.numberOfPages/2),s=Math.max(Math.min(i-o,r-this.options.numberOfPages+1),1);return{start:s,end:Math.min(s+this.options.numberOfPages-1,r),lastResultPage:r,currentPage:i}},t.prototype.renderNavigationButton=function(e){if(this.currentPage>1){var t=this.renderPreviousButton();this.list.insertBefore(t.el,this.list.firstChild)}if(this.currentPage<e.lastResultPage){var n=this.renderNextButton();this.list.appendChild(n.el)}},t.prototype.renderPreviousButton=function(){var e=this,t=d.$$("li",{className:"coveo-pager-previous coveo-pager-anchor coveo-pager-list-item"}),n=d.$$("span",{title:c.l("Previous"),tabindex:0}),i=d.$$("span",{className:"coveo-pager-previous-icon"},m.SVGIcons.icons.pagerLeftArrow);return g.SVGDom.addClassToSVGInContainer(i.el,"coveo-pager-previous-icon-svg"),n.append(i.el),t.append(n.el),(new p.AccessibleButton).withElement(n).withLabel(c.l("Previous")).withSelectAction(function(){return e.handleClickPrevious()}).build(),t},t.prototype.renderNextButton=function(){var e=this,t=d.$$("li",{className:"coveo-pager-next coveo-pager-anchor coveo-pager-list-item"}),n=d.$$("span",{title:c.l("Next"),tabindex:0}),i=d.$$("span",{className:"coveo-pager-next-icon"},m.SVGIcons.icons.pagerRightArrow);return g.SVGDom.addClassToSVGInContainer(i.el,"coveo-pager-next-icon-svg"),n.append(i.el),t.append(n.el),(new p.AccessibleButton).withElement(n).withLabel(c.l("Next")).withSelectAction(function(){return e.handleClickNext()}).build(),t},t.prototype.handleQueryStateFirstResultChanged=function(e){if(this.listenToQueryStateChange){l.Assert.exists(e),this.needToReset=!1;var t=e.value;this.currentPage=this.fromFirstResultsToPageNumber(t)}},t.prototype.handleQueryStateNumberOfResultsPerPageChanged=function(e){var t=this.queryStateModel.get(u.QUERY_STATE_ATTRIBUTES.FIRST);this.searchInterface.resultsPerPage=e.value,this.currentPage=this.fromFirstResultsToPageNumber(t)},t.prototype.handleClickPage=function(e){l.Assert.exists(e),this.setPage(e)},t.prototype.handleClickPrevious=function(){this.previousPage()},t.prototype.handleClickNext=function(){this.nextPage()},t.prototype.fromFirstResultsToPageNumber=function(e){return e/this.searchInterface.resultsPerPage+1},t.prototype.getFirstResultNumber=function(e){return void 0===e&&(e=this.currentPage),(e-1)*this.searchInterface.resultsPerPage},t.prototype.getQueryEventArgs=function(){return{count:this.searchInterface.resultsPerPage,first:this.getFirstResultNumber()}},t.ID="Pager",t.doExport=function(){s.exportGlobally({Pager:t})},t.options={numberOfPages:b.ComponentOptions.buildNumberOption({defaultFunction:function(){return h.DeviceUtils.isMobileDevice()?3:5},min:1}),enableNavigationButton:b.ComponentOptions.buildBooleanOption({defaultValue:!0}),maxNumberOfPages:b.ComponentOptions.buildNumberOption({defaultValue:void 0,deprecated:"This is a deprecated option. The pager will automatically adapt itself on each new query. You no longer need to specify this option. Use maximumNumberOfResultsFromIndex instead."}),maximumNumberOfResultsFromIndex:b.ComponentOptions.buildNumberOption({defaultValue:1e3})},t}(v.Component);t.Pager=C,T.Initialization.registerAutoCreateComponent(C)},40:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(22),r=n(21),o=n(121),s=n(33),l=n(4),a=n(1),u=n(0),c=n(6),p=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?(u.chain(t.options.valueCaption).pairs().filter(function(e){return i.test(e[1])}).each(function(e){n.push(e[0])}),(r.QueryUtils.isStratusAgnosticField(t.options.field,"@objecttype")||r.QueryUtils.isStratusAgnosticField(t.options.field,"@filetype"))&&u.each(o.FileTypes.getFileTypeCaptions(),function(e,r){r in t.options.valueCaption||!i.test(e)||n.push(r)})):r.QueryUtils.isStratusAgnosticField(t.options.field,"@objecttype")||r.QueryUtils.isStratusAgnosticField(t.options.field,"@filetype")?u.each(u.filter(u.pairs(o.FileTypes.getFileTypeCaptions()),function(e){return i.test(e[1])}),function(e){n.push(e[0])}):r.QueryUtils.isStratusAgnosticField(t.options.field,"@month")&&u.each(u.range(1,13),function(e){i.test(s.DateUtils.monthToString(e-1))&&n.push(("0"+e.toString()).substr(-2))}),n},e.buildFacetSearchPattern=function(e){return e=u.map(e,function(e){return l.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=a.$$(t).findAll("li:not(.coveo-selected)");u.each(n,function(e){a.$$(e).addClass("coveo-no-state")})}},e.tryToGetTranslatedCaption=function(t,n,i){void 0===i&&(i=!0);var a;if(r.QueryUtils.isStratusAgnosticField(t.toLowerCase(),"@filetype"))a=o.FileTypes.getFileType(n,i).caption;else if(r.QueryUtils.isStratusAgnosticField(t.toLowerCase(),"@objecttype"))a=o.FileTypes.getObjectType(n,i).caption;else if(e.isMonthFieldValue(t,n)){var u=parseInt(n,10);a=s.DateUtils.monthToString(u-1)}else i&&(a=c.l(n));return void 0!=a&&l.Utils.isNonEmptyString(a)?a:n},e.isMonthFieldValue=function(e,t){if(!r.QueryUtils.isStratusAgnosticField(e.toLowerCase(),"@month"))return!1;var n=parseInt(t,10);return!isNaN(n)&&!(n<1||n>12)},e}();t.FacetUtils=p},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 r=n(27),o=n(96),s=n(0),l=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=s.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=s.find(this.templates,function(t){return t.role===e});if(n)return n.instantiateToElement(void 0,{});var i=new r.Template(function(){return t.defaultRoledTemplates[e]});return i.layout="table",i.instantiateToElement(void 0)},t.prototype.getFallbackTemplate=function(){var e=this;return new r.Template(function(){return e.defaultTemplate})},t.prototype.hasTemplateWithRole=function(e){return s.find(this.templates,function(t){return t.role===e})},t}(o.TemplateList);t.TableTemplate=l},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 r=n(27),o=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 r=document.createElement("div");r.innerHTML=t.instantiateToString(e),n(r)})},t}(r.Template);t.DefaultRecommendationTemplate=o},473:function(e,t,n){"use strict";var i=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{a(i.next(e))}catch(e){o(e)}}function l(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,l)}a((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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(s=a.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){a.label=n[1];break}if(6===n[0]&&a.label<s[1]){a.label=s[1],s=n;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(n);break}s[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,l,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var o=n(20),s=n(93),l=n(0),a=n(1),u=n(9),c=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,o,a=this;return r(this,function(r){return i=[],o=l.map(e.results,function(e,r){return a.buildResult(e,t,n).then(function(e){return null!=e&&i.push({elem:e,idx:r}),s.ResultList.resultCurrentlyBeingRendered=null,e})}),[2,Promise.all(o).then(function(){return l.pluck(l.sortBy(i,"idx"),"elem")})]})})},e.prototype.buildResult=function(e,t,n){return i(this,void 0,void 0,function(){var i;return r(this,function(r){switch(r.label){case 0:return o.Assert.exists(e),o.QueryUtils.setStateObjectOnQueryResult(this.args.queryStateModel.get(),e),o.QueryUtils.setSearchInterfaceObjectOnQueryResult(this.args.searchInterface,e),s.ResultList.resultCurrentlyBeingRendered=e,[4,this.createHtmlElement(e,t)];case 1:return i=r.sent(),null!=i&&o.Component.bindResultToElement(i,e),n.push(e),[4,this.autoCreateComponentsInsideResult(i,e).initResult];case 2:return r.sent(),this.verifyChildren(i),[2,i]}})})},e.prototype.autoCreateComponentsInsideResult=function(e,t){return o.Assert.exists(e),o.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){a.$$(e).find(".CoveoResultLink")||new u.Logger(e).warn('Result does not contain a "CoveoResultLink" component, please verify the result template',this.args.resultTemplate)},e}();t.TemplateToHtml=c},474:function(e,t,n){"use strict";function i(){var e,t=E.Component.getComponentRef("ResultList");if(t&&(e=t.resultCurrentlyBeingRendered),!e){var n=E.Component.getComponentRef("Quickview");n&&(e=n.resultCurrentlyBeingRendered)}return e}function r(){var e=i();if(e)return e.termsToHighlight}function o(){var e=i();if(e)return e.phrasesToHighlight}function s(e,t){return d.Utils.isNonEmptyArray(w.keys(e))||d.Utils.isNonEmptyArray(w.keys(t))}var l=this&&this.__assign||Object.assign||function(e){for(var t,n=1,i=arguments.length;n<i;n++){t=arguments[n];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(e[r]=t[r])}return e};Object.defineProperty(t,"__esModule",{value:!0});var a=n(122),u=n(69),c=n(33),p=n(135),h=n(179),d=n(4),f=n(22),g=n(73),m=n(178),y=n(21),v=n(24),b=n(1),T=n(53),C=n(120),R=n(40),S=n(23),w=n(0),E=n(7),O=n(68),A=function(){function e(){}return e.exportAllHelpersGlobally=function(e){w.each(a.TemplateHelpers.getHelpers(),function(t,n){void 0==e[n]&&(e[n]=t)})},e}();t.CoreHelpers=A,a.TemplateHelpers.registerFieldHelper("javascriptEncode",function(e){return d.Utils.exists(e)?f.StringUtils.javascriptEncode(e):void 0});var P=function(e,t){var n=u.StringAndHoles.shortenString(e,t.length,"...");return d.Utils.exists(t.highlights)?u.HighlightUtils.highlightString(n.value,t.highlights,n.holes,t.cssClass||"highlight"):n.value};a.TemplateHelpers.registerTemplateHelper("shorten",function(e,t,n,i){return P(e,{length:t,highlights:n,cssClass:i})}),a.TemplateHelpers.registerTemplateHelper("shortenv2",function(e,t){return P(e,t)});var H=function(e,t){var n=u.StringAndHoles.shortenPath(e,t.length);return d.Utils.exists(t.highlights)?u.HighlightUtils.highlightString(n.value,t.highlights,n.holes,t.cssClass||"highlight"):n.value};a.TemplateHelpers.registerTemplateHelper("shortenPath",function(e,t,n,i){return H(e,{length:t,highlights:n,cssClass:i})}),a.TemplateHelpers.registerFieldHelper("shortenPathv2",function(e,t){return H(e,t)});var F=function(e,t){var n=u.StringAndHoles.shortenUri(e,t.length);return d.Utils.exists(t.highlights)?u.HighlightUtils.highlightString(n.value,t.highlights,n.holes,t.cssClass||"highlight"):n.value};a.TemplateHelpers.registerTemplateHelper("shortenUri",function(e,t,n,i){return F(e,{length:t,highlights:n,cssClass:i})}),a.TemplateHelpers.registerTemplateHelper("shortenUriv2",function(e,t){return F(e,t)});var L=function(e,t){return d.Utils.exists(e)?d.Utils.exists(t.highlights)?u.HighlightUtils.highlightString(e,t.highlights,null,t.cssClass||"highlight"):e:void 0};a.TemplateHelpers.registerTemplateHelper("highlight",function(e,t,n){return L(e,{highlights:t,cssClass:n})}),a.TemplateHelpers.registerTemplateHelper("highlightv2",function(e,t){return L(e,t)});var I=function(e,t){return d.Utils.exists(e)&&d.Utils.exists(t.termsToHighlight)&&d.Utils.exists(t.phrasesToHighlight)?s(t.termsToHighlight,t.phrasesToHighlight)?C.StreamHighlightUtils.highlightStreamText(e,t.termsToHighlight,t.phrasesToHighlight,t.opts):e:void 0};a.TemplateHelpers.registerTemplateHelper("highlightStreamText",function(e,t,n,i){return void 0===t&&(t=r()),void 0===n&&(n=o()),I(e,{termsToHighlight:t,phrasesToHighlight:n,opts:i})}),a.TemplateHelpers.registerTemplateHelper("highlightStreamTextv2",function(e,t){var n=l({termsToHighlight:r(),phrasesToHighlight:o()},t);return I(e,n)});var $=function(e,t){return d.Utils.exists(e)&&d.Utils.exists(t.termsToHighlight)&&d.Utils.exists(t.phrasesToHighlight)?s(t.termsToHighlight,t.phrasesToHighlight)?C.StreamHighlightUtils.highlightStreamHTML(e,t.termsToHighlight,t.phrasesToHighlight,t.opts):e:void 0};a.TemplateHelpers.registerTemplateHelper("highlightStreamHTML",function(e,t,n,i){return void 0===t&&(t=r()),void 0===n&&(n=o()),$(e,{termsToHighlight:t,phrasesToHighlight:n,opts:i})}),a.TemplateHelpers.registerTemplateHelper("highlightStreamHTMLv2",function(e,t){var n=l({termsToHighlight:r(),phrasesToHighlight:o()},t);return $(e,n)}),a.TemplateHelpers.registerFieldHelper("number",function(e,t){if(d.Utils.exists(e)){var n=Number(e),i=w.isString(t)?t:t&&t.format;return i?f.StringUtils.htmlEncode(S.format(n,i)):f.StringUtils.htmlEncode(n.toString())}}),a.TemplateHelpers.registerFieldHelper("date",function(e,t){return c.DateUtils.dateToString(c.DateUtils.convertFromJsonDateIfNeeded(e),t)}),a.TemplateHelpers.registerFieldHelper("time",function(e,t){return c.DateUtils.timeToString(c.DateUtils.convertFromJsonDateIfNeeded(e),t)}),a.TemplateHelpers.registerFieldHelper("dateTime",function(e,t){return c.DateUtils.dateTimeToString(c.DateUtils.convertFromJsonDateIfNeeded(e),t)}),a.TemplateHelpers.registerFieldHelper("emailDateTime",function(e,t){var n={};n.includeTimeIfThisWeek=!0;var i=w.extend(t,n);return e?c.DateUtils.dateTimeToString(c.DateUtils.convertFromJsonDateIfNeeded(e),i):void 0}),a.TemplateHelpers.registerFieldHelper("currency",function(e,t){return p.CurrencyUtils.currencyToString(e,t)}),a.TemplateHelpers.registerFieldHelper("timeSpan",function(e,t){return void 0===t&&(t={isMilliseconds:!1}),new g.TimeSpan(e,t.isMilliseconds).getHHMMSS()}),a.TemplateHelpers.registerFieldHelper("email",function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];var i,r,o,s;if(w.isObject(t[0])?(i=t[0].companyDomain,r=t[0].me,o=t[0].lengthLimit,s=t[0].truncateName):(i=t[0],r=t[1],o=t[2],s=t[3]),void 0==o&&(o=2),void 0==s&&(s=!1),w.isString(e)){var l=m.EmailUtils.splitSemicolonSeparatedListOfEmailAddresses(e);return m.EmailUtils.emailAddressesToHyperlinks(l,i,r,o,s)}return w.isArray(e)?m.EmailUtils.emailAddressesToHyperlinks(e,i,r,o,s):void 0}),a.TemplateHelpers.registerTemplateHelper("excessEmailToggle",function(e){b.$$(e).removeClass("coveo-active"),b.$$(e).hasClass("coveo-emails-excess-collapsed")?w.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"),w.each(b.$$(e.parentElement).siblings(".coveo-emails-excess-collapsed"),function(e){b.$$(e).addClass("coveo-active")}))}),a.TemplateHelpers.registerFieldHelper("anchor",function(e,t){return h.AnchorUtils.buildAnchor(e,t)}),a.TemplateHelpers.registerFieldHelper("image",function(e,t,n){return void 0===n&&(n=i()),t&&t.srcTemplate?h.ImageUtils.buildImage(f.StringUtils.buildStringTemplateFromResult(t.srcTemplate,n),{alt:t.alt,height:t.height,width:t.width}):h.ImageUtils.buildImage(e,t)}),a.TemplateHelpers.registerTemplateHelper("thumbnail",function(e,t,n){if(void 0===e&&(e=i()),void 0===t&&(t="default"),y.QueryUtils.hasThumbnail(e))return h.ImageUtils.buildImageFromResult(e,T.SearchEndpoint.endpoints[t],n)}),a.TemplateHelpers.registerTemplateHelper("fromFileTypeToIcon",function(e,t){void 0===e&&(e=i()),void 0===t&&(t={});var n=E.Component.getComponentRef("Icon");if(n)return n.createIcon(e,t).outerHTML}),a.TemplateHelpers.registerTemplateHelper("attrEncode",function(e){return(""+e).replace(/&/g,"&amp;").replace(/'/g,"&apos;").replace(/'/g,"&quot;").replace(/</g,"&lt;").replace(/>/g,"&gt;")}),a.TemplateHelpers.registerTemplateHelper("loadTemplates",function(e,t){void 0===t&&(t=!0);var n,r="",o=i(),s=!1,l=e;return w.each(e,function(e,t,i){"default"==e&&(n=t)}),void 0!=n&&(l=w.omit(e,n)),w.each(l,function(e,n,i){s&&t||(s=s||e,r+=a.TemplateHelpers.getHelper("loadTemplate")(n,e,o))}),s||void 0==n||(r+=a.TemplateHelpers.getHelper("loadTemplate")(n,!0,o)),r});var _=["B","KB","MB","GB","TB","PB","EB"];a.TemplateHelpers.registerFieldHelper("size",function(e,t){for(var n=parseInt(e,10),i=null!=t&&null!=t.precision?t.precision:2,r=null!=t&&null!=t.base?t.base:0;n>1024&&r+1<_.length;)n/=1024,r++;return(n=Math.floor(n*Math.pow(10,i))/Math.pow(10,i))+" "+_[r]}),a.TemplateHelpers.registerFieldHelper("translatedCaption",function(e){return R.FacetUtils.tryToGetTranslatedCaption("@filetype",e)}),a.TemplateHelpers.registerTemplateHelper("loadTemplate",function(e,t,n){return void 0===t&&(t=!0),d.Utils.isNullOrUndefined(n)&&(n=i()),t?O.TemplateCache.getTemplate(e).instantiateToString(n,{checkCondition:!1}):""}),a.TemplateHelpers.registerTemplateHelper("encodeCarriageReturn",function(e){return d.Utils.isNullOrUndefined(e)?void 0:f.StringUtils.encodeCarriageReturn(e)}),a.TemplateHelpers.registerTemplateHelper("isMobileDevice",function(){return v.DeviceUtils.isMobileDevice()?v.DeviceUtils.getDeviceName():null}),a.TemplateHelpers.registerTemplateHelper("pluralHelper",function(e,t){return e>1?t.plural:t.singular})},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),r=n(19),o=n(93),s=n(1),l=n(7),a=n(9),u=function(){function e(e,t,n,i){this.coveoRoot=e,this.ID=t,this.searchInterface=l.Component.get(this.coveoRoot.el,r.SearchInterface,!1),this.currentMode="large"}return e.init=function(t,n,r){if(!s.$$(t).find("."+l.Component.computeCssClassName(o.ResultList))){return void new a.Logger("ResponsiveDefaultResultTemplate").trace("No ResultLayout component found : Cannot instantiate ResponsiveResultLayout")}i.ResponsiveComponentsManager.register(e,s.$$(t),o.ResultList.ID,n,r)},e.prototype.registerComponent=function(e){return e instanceof o.ResultList&&(this.resultList=e,!0)},e.prototype.handleResizeEvent=function(){var e=this,t=this.resultList.queryController.getLastResults();this.needSmallMode()?(s.$$(this.resultList.options.resultsContainer).addClass("coveo-card-layout-container"),s.$$(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")):(s.$$(this.resultList.options.resultsContainer).removeClass("coveo-card-layout-container"),s.$$(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=u},532:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var i=n(1),r=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=r},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 r=n(215),o=n(1),s=n(0),l=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(!s.isEmpty(e)){if(t.resultListOptions.enableInfiniteScroll){var i=o.$$(t.resultListOptions.resultsContainer).findAll(".coveo-card-layout-padding");s.each(i,function(e){return o.$$(e).remove()})}var r=document.createDocumentFragment();s.times(3,function(){return r.appendChild(o.$$("div",{className:"coveo-card-layout coveo-card-layout-padding"}).el)}),n(r)}n(null)})},t}(r.ResultListRenderer);t.ResultListCardRenderer=l},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)}}(),r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{a(i.next(e))}catch(e){o(e)}}function l(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,l)}a((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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(s=a.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){a.label=n[1];break}if(6===n[0]&&a.label<s[1]){a.label=s[1],s=n;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(n);break}s[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,l,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0});var s=n(215),l=n(470),a=n(1),u=n(0),c=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 l.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&&!u.isEmpty(e)&&this.shouldDisplayHeader)return this.renderRoledTemplate("table-header")},t.prototype.getEndFragment=function(e,t){if(!t&&!u.isEmpty(e)&&this.shouldDisplayFooter)return this.renderRoledTemplate("table-footer")},t.prototype.renderRoledTemplate=function(e){return r(this,void 0,void 0,function(){var t,n;return o(this,function(i){switch(i.label){case 0:return[4,this.resultListOptions.resultTemplate.instantiateRoleToElement(e)];case 1:return t=i.sent(),a.$$(t).addClass("coveo-result-list-"+e),this.autoCreateComponentsFn(t,void 0),n=document.createDocumentFragment(),n.appendChild(t),[2,n]}})})},t}(s.ResultListRenderer);t.ResultListTableRenderer=c},638:function(e,t){},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)}}(),r=this&&this.__awaiter||function(e,t,n,i){return new(n||(n=Promise))(function(r,o){function s(e){try{a(i.next(e))}catch(e){o(e)}}function l(e){try{a(i.throw(e))}catch(e){o(e)}}function a(e){e.done?r(e.value):new n(function(t){t(e.value)}).then(s,l)}a((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(r)throw new TypeError("Generator is already executing.");for(;a;)try{if(r=1,o&&(s=o[2&n[0]?"return":n[0]?"throw":"next"])&&!(s=s.call(o,n[1])).done)return s;switch(o=0,s&&(n=[0,s.value]),n[0]){case 0:case 1:s=n;break;case 4:return a.label++,{value:n[1],done:!1};case 5:a.label++,o=n[1],n=[0];continue;case 7:n=a.ops.pop(),a.trys.pop();continue;default:if(s=a.trys,!(s=s.length>0&&s[s.length-1])&&(6===n[0]||2===n[0])){a=0;continue}if(3===n[0]&&(!s||n[1]>s[0]&&n[1]<s[3])){a.label=n[1];break}if(6===n[0]&&a.label<s[1]){a.label=s[1],s=n;break}if(s&&a.label<s[2]){a.label=s[2],a.ops.push(n);break}s[2]&&a.ops.pop(),a.trys.pop();continue}n=t.call(e,a)}catch(e){n=[6,e],o=0}finally{r=s=0}if(5&n[0])throw n[1];return{value:n[0]?n[1]:void 0,done:!0}}var r,o,s,l,a={label:0,sent:function(){if(1&s[0])throw s[1];return s[1]},trys:[],ops:[]};return l={next:n(0),throw:n(1),return:n(2)},"function"==typeof Symbol&&(l[Symbol.iterator]=function(){return this}),l};Object.defineProperty(t,"__esModule",{value:!0}),n(528),n(529),n(530);var s=n(0),l=n(11),a=n(134),u=n(29),c=n(3),p=n(5),h=n(31),d=n(18),f=n(13),g=n(24),m=n(1),y=n(97),v=n(4),b=n(10),T=n(7),C=n(8),R=n(2),S=n(177),w=n(63),E=n(531),O=n(474),A=n(472),P=n(123),H=n(470),F=n(68),L=n(96),I=n(532),$=n(533),_=n(215),x=n(534),M=n(118),N=n(473);O.CoreHelpers.exportAllHelpersGlobally(window.Coveo);var U=function(e){function t(n,i,r,o){void 0===o&&(o=t.ID);var s=e.call(this,n,o,r)||this;return s.element=n,s.options=i,s.bindings=r,s.currentlyDisplayedResults=[],s.reachedTheEndOfResults=!1,s.disableLayoutChange=!1,s.successiveScrollCount=0,s.options=C.ComponentOptions.initComponentOptions(n,t,i),p.Assert.exists(n),p.Assert.exists(s.options),p.Assert.exists(s.options.resultTemplate),p.Assert.exists(s.options.infiniteScrollContainer),s.showOrHideElementsDependingOnState(!1,!1),s.addListeners(),s.resultContainer=s.initResultContainer(),p.Assert.exists(s.options.resultsContainer),s.initWaitAnimationContainer(),p.Assert.exists(s.options.waitAnimationContainer),s.setupTemplatesVersusLayouts(),m.$$(s.root).on(a.ResultLayoutEvents.populateResultLayout,function(e,t){return t.layouts.push(s.options.layout)}),s.setupRenderer(),s.makeElementFocusable(),s.ensureHasId(),s}return i(t,e),t.getDefaultTemplate=function(e){var n=t.loadTemplatesFromCache();if(null!=n)return n;var i=T.Component.get(e);return Coveo.Recommendation&&i.searchInterface instanceof Coveo.Recommendation?new A.DefaultRecommendationTemplate:new P.DefaultResultTemplate},t.loadTemplatesFromCache=function(){var e=F.TemplateCache.getResultListTemplateNames();return e.length>0?new L.TemplateList(s.compact(s.map(e,function(e){return F.TemplateCache.getTemplate(e)}))):null},t.prototype.addListeners=function(){var e=this;this.bind.onRootElement(l.QueryEvents.newQuery,function(t){return e.handleNewQuery()}),this.bind.onRootElement(l.QueryEvents.buildingQuery,function(t){return e.handleBuildingQuery(t)}),this.bind.onRootElement(l.QueryEvents.querySuccess,function(t){return e.handleQuerySuccess(t)}),this.bind.onRootElement(l.QueryEvents.fetchMoreSuccess,function(t){return e.handleFetchMoreSuccess(t)}),this.bind.onRootElement(l.QueryEvents.duringQuery,function(t){return e.handleDuringQuery()}),this.bind.onRootElement(l.QueryEvents.queryError,function(t){return e.handleQueryError()}),m.$$(this.root).on(u.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(l.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(l.QueryEvents.deferredQuerySuccess,function(){setTimeout(function(){e.scrollToTopIfEnabled()},0)})})},t.prototype.getAutoSelectedFieldsToInclude=function(){return s.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 H.TableTemplate(this.options.resultTemplate.templates||[])),this.options.resultTemplate instanceof L.TemplateList?s.each(this.options.resultTemplate.templates,function(t){t.layout||(t.layout=e.options.layout)}):this.options.resultTemplate instanceof P.DefaultResultTemplate&&"list"==this.options.layout&&E.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 p.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 N.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),m.$$(this.element).removeClass("coveo-hidden"))},t.prototype.disable=function(){var t=this;e.prototype.disable.call(this);var n=s.map(this.otherResultLists,function(e){return e.options.layout});s.contains(n,this.options.layout)||this.disableLayoutChange||s.each(this.resultLayoutSelectors,function(e){e.disableLayouts([t.options.layout])}),this.disableLayoutChange=!1,m.$$(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};m.$$(this.element).trigger(u.ResultListEvents.newResultDisplayed,n)},t.prototype.triggerNewResultsDisplayed=function(){var e={isInfiniteScrollEnabled:this.options.enableInfiniteScroll};m.$$(this.element).trigger(u.ResultListEvents.newResultsDisplayed,e)},t.prototype.fetchAndRenderMoreResults=function(e){return r(this,void 0,void 0,function(){var t,n;return o(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(),p.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 r(this,void 0,void 0,function(){var t,n;return o(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,h.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;p.Assert.exists(e),p.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 r(n,void 0,void 0,function(){return o(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),g.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&&M.ResultListUtils.scrollToTop(this.root)},t.prototype.handleNewQuery=function(){m.$$(this.element).removeClass("coveo-hidden"),t.resultCurrentlyBeingRendered=void 0},Object.defineProperty(t.prototype,"otherResultLists",{get:function(){var e=this.searchInterface.getComponents(t.ID);return s.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(s.map(this.options.fieldsToInclude,function(e){return e.substr(1)})),this.options.autoSelectFieldsToInclude){var t=s.flatten(s.map(this.otherResultLists,function(e){return e.getAutoSelectedFieldsToInclude()}));e.queryBuilder.addRequiredFields(s.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 S.InitializationPlaceholder(this.root).withVisibleRootElement().withPlaceholderForResultList(),h.Defer.defer(function(){return r(t,void 0,void 0,function(){var t;return o(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 m.Win(window),t=e.height(),n=e.scrollY();return new m.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