{"version":3,"sources":["webpack://CoveoForSitecore/webpack/universalModuleDefinition","webpack://CoveoForSitecore/webpack/bootstrap","webpack://CoveoForSitecore/external {\"root\":\"Coveo\",\"commonjs\":\"coveo-search-ui\",\"commonjs2\":\"coveo-search-ui\",\"amd\":\"coveo-search-ui\"}","webpack://CoveoForSitecore/./src/events/ContextEvents.ts","webpack://CoveoForSitecore/./src/base/Context.ts","webpack://CoveoForSitecore/./src/utils/HTMLUtils.ts","webpack://CoveoForSitecore/./src/base/Prebinding.ts","webpack://CoveoForSitecore/./src/events/ExpressionEvents.ts","webpack://CoveoForSitecore/./src/ui/context/CoveoForSitecoreContext.ts","webpack://CoveoForSitecore/./src/handlers/LegacyFieldTypeResolver.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/ItemIdSelector.ts","webpack://CoveoForSitecore/./src/base/Initialization.ts","webpack://CoveoForSitecore/./src/resolvers/components/SearchInterfaceComponentInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/SitecoreExperienceEditor.ts","webpack://CoveoForSitecore/./src/utils/SearchInterfaceProvider.ts","webpack://CoveoForSitecore/./src/base/initialization/ElementWithContextInitializer.ts","webpack://CoveoForSitecore/./src/EventsModules.ts","webpack://CoveoForSitecore/./src/BaseModules.ts","webpack://CoveoForSitecore/./src/base/initialization/ContextInitializer.ts","webpack://CoveoForSitecore/./src/handlers/CoveoFieldsHandler.ts","webpack://CoveoForSitecore/./src/handlers/SourceSpecificFieldResolver.ts","webpack://CoveoForSitecore/./src/handlers/CoveoLabelsHandler.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/PrebindResolver.ts","webpack://CoveoForSitecore/./src/resolvers/sortCriteria/SortCriteriaPreprocessor.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/PrebindHelpers.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/AnalyticsEnabled.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/CoveoForSitecoreAnalyticsEndpoint.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/CurrentMaximumAge.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/CurrentPageName.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/FieldTranslator.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/IsAnonymous.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/MainSearchInterfaceSelector.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/SortCriteria.ts","webpack://CoveoForSitecore/./src/resolvers/sortCriteria/SortCriteriaResolver.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/UnfoldDictionaryToAttributes.ts","webpack://CoveoForSitecore/./src/base/SearchEndpoint.ts","webpack://CoveoForSitecore/./src/base/initialization/ExternalComponentInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/SearchboxInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/SearchInterfaceInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/HostedSearchPageInitializer.ts","webpack://CoveoForSitecore/./src/LazyEntry.ts","webpack://CoveoForSitecore/./src/utils/SitecorePublicPathUtils.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazyCoveoForSitecoreAnalytics.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazyCoveoForSitecoreConfigureSearchHub.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazySendAnalyticsToSitecore.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazyValidateAnalyticsIncluded.ts","webpack://CoveoForSitecore/./src/ui/context/LazyCoveoForSitecoreBindWithUserContext.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreExpressions.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreSyntax.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreRankingExpression.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreExternalContent.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreFilterExpression.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreLocalExpression.ts","webpack://CoveoForSitecore/./src/ui/distance/LazyGoogleApiPositionProvider.ts","webpack://CoveoForSitecore/./src/ui/distance/LazyNavigatorPositionProvider.ts","webpack://CoveoForSitecore/./src/ui/distance/LazyStaticPositionProvider.ts"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","installedModules","1","__webpack_require__","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","2","3","4","5","6","7","8","9","10","11","12","13","14","15","jsonpScriptSrc","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","error","Error","request","undefined","setTimeout","head","appendChild","all","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","oldJsonpFunction","slice","s","SitecoreContextEvents","onSitecoreContextInitialization","ContextInitializer_1","CoveoForSitecoreContext_1","coveo_search_ui_1","Context","configureContext","contextElement","options","ComponentOptions","initComponentOptions","CoveoForSitecoreContext","this","initializeWithContextOptions","contextOptions","contextInitializer","ContextInitializer","fieldsHandler","createFieldsHandler","externalFields","scExternalFields","sourceSpecificFields","scSourceSpecificFields","preferSourceSpecificFields","scPreferSourceSpecificFields","prefix","scFieldPrefix","suffix","scFieldSuffix","labels","createLabelsHandler","scLabels","sourceName","scIndexSourceName","initializePrebinding","context","initializeUnderscoreFieldsHelpers","initializeUnderscoreLabelsHelpers","initializeUnderscoreContextHelpers","initializeContextElement","fields","element","removeAllIDAttributes","removeAttribute","children","querySelectorAll","item","nodeListToArray","elements","array","cloneElementSafelyForAccessibility","cloneNode","PrebindResolver_1","SortCriteriaPreprocessor","Prebinding","registerPrebindHelper","helperName","handler","processor","getHelper","applyPrebindingOnElement","rootElement","canApplyPrebind","hasNotAppliedPrebind","applyToElement","applyPreprocessingToElements","adjustDOMElements","applyPrebindingOnChildren","_this","processedElements","map","filter","forEach","PrebindResolver","SitecoreExpressionEvents","onBuildingSitecoreExternalContent","onBuildingLocalSitecoreInstanceExpression","ContextEvents_1","_super","bindings","ID","onRootElement","InitializationEvents","afterComponentsInitialization","QueryEvents","doneBuildingQuery","OmniboxEvents","buildingQuerySuggest","__extends","args","hasDefaultPipelineNameSet","queryBuilderUsesDefaultPipeline","queryBuilder","pipeline","scDefaultPipelineName","querySuggestUsesDefaultPipeline","payload","querySuggestRequest","contextArgs","sitecoreItemId","scItemId","sitecoreItemUri","scItemUri","sitecorePageName","scPageName","shouldHaveAnalyticsComponent","scShouldHaveAnalyticsComponent","analyticsEnabled","scAnalyticsEnabled","indexSourceName","currentLanguage","scCurrentLanguage","languageFieldName","scLanguageFieldName","latestVersionFieldName","scLatestVersionFieldName","isInExperienceEditor","scIsInExperienceEditor","sitecorePageFullPath","scPageNameFullPath","siteName","scSiteName","restEndpointUri","scRestEndpointUri","analyticsEndpointUri","scAnalyticsEndpointUri","trigger","buildStringOption","buildJsonOption","buildBooleanOption","scIsUserAnonymous","scMaximumAge","buildNumberOption","Component","Initialization","registerAutoCreateComponent","LegacyFieldTypeResolver","parseExternalFields","externalField","fieldName","toLowerCase","shouldEscape","isExternalFieldConfig","shouldEscapeFirstCharacter","shouldEscapeSpecialCharacters","field","shouldDecorate","some","isExternalField","obj","ItemIdSelectorPrebind","resolvers","ResolveIfSelector","ResolveIfItemIdInPage","UseItemIdSelectorAsIs","getPrebind","itemId","getFirstValidResolver","getValue","resolver","message","canResolve","isItemDefined","isIdSelectorValid","selector","querySelector","isStartingWithSelectorCharacter","firstCharacter","indexOf","ExternalComponentInitializer_1","SearchboxInitializer_1","SearchInterfaceInitializer_1","ElementWithContextInitializer_1","HostedSearchPageInitializer_1","initSearchInterface","searchInterfaceElement","searchInterfaceInitializer","initExternalComponentsSection","externalComponentInitializer","initializeExternalComponentSection","SearchInterfaceInitializer","searchboxInitializer","SearchboxInitializer","ExternalComponentInitializer","hostedSearchPageInitializer","HostedSearchPageInitializer","initializeSearchInterfaceForExperienceEditor","initializeExperienceEditorHooksForSearchInterface","initSearchboxIfStandalone","searchBoxElement","searchPageUri","initContextOnElement","ElementWithContextInitializer","initializeContextWithinElement","initExternalComponentsSectionForExperienceEditor","initializeExperienceEditorHooksForExternalComponentsSection","initHostedSearchPageInitializer","initializeSearchPage","Prebinding_1","HTMLUtils_1","SearchInterfaceComponentInitializer","loadComponentsForSearchInterface","searchInterface","newComponent","automaticallyCreateComponentsInside","getBindings","initResult","then","removeAllPlaceholdersWithinElement","queryController","executeQuery","ignoreWarningSearchEvent","tryUnloadComponentsForSearchInterface","getElementsByClassName","facet","facetComponent","detachComponent","removeAllChildren","tab","tabComponent","removePlaceholders","classList","remove","contains","removeFacetsPlaceholders","firstChild","removeChild","loadComponentsWithSearchInterfaceInitialization","componentsContainer","Coveo","externalComponents","initializer","getInitializerInstance","SitecoreExperienceEditor","isAfterFrameLoadedOverriden","isAfterPersonalizationChangedOverriden","isBeforeUnloadingChromeOverriden","onAfterFrameLoadedCallbacks","onAfterPersonalizationChanged","onBeforeUnloadingChrome","registerOnLoadRenderingFromUrl","onAfterFrameLoadedCallback","tryOverrideSitecoreLoadRenderingFromUrl","registerBeforeUnloadingChrome","onBeforeUnloadingChromeCallback","tryOverrideOnUnloadingChrome","registerOnAfterPersonalizationChanged","tryOverrideSitecoreChromeTypesRenderingChangeCondition","isInBackgroundRendering","location","search","isInBackgroundRenderingParameterName","getComponentFromLoadRenderingFromUrlCallbackData","callbackData","getElementById","opening","id","nextElementSibling","Sitecore","overrideSitecoreLoadRenderingFromUrl","originalLoad","PageModes","ChromeTypes","Placeholder","insertRendering","frameLoadedCallback","callback","overrideSitecoreChromeChangeCondition","originalChangeCondition","Rendering","changeCondition","sender","preserveCacheUpdating","changedElement","chrome","apply","arguments","overrideSitecoreChromeTypesRenderingChangeCondition","elementToProcessWhenFinished","originalStartActivation","_startActivation","originalEndActivation","_endActivation","markersAndElements","fieldId","isDifferentFirstLoadMarker","getValidMarker","reason","nodeType","Node","TEXT_NODE","registerShowDebugInformationCallback","debugModeEnabled","debugInfoElements","add","ChromeManager","resetChromes","staticInstance","getExperienceEditorInstance","SearchInterfacesProvider","getSearchInterfacesInPage","componentsIds","searchInterfacesSelector","getSearchInterfacesSelectorFromComponentIds","searchInterfaces","componentIds","componentId","computeSelectorForType","join","Context_1","ExpressionEvents_1","SearchEndpoint_1","SearchEndpoint","CoveoFieldsHandler_1","SourceSpecificFieldResolver_1","CoveoLabelsHandler_1","PrebindHelpers_1","LegacyFieldTypeResolver_1","fieldTypeResolver","SourceSpecificFieldResolver","CoveoFieldsHandler","CoveoLabelsHandler","PrebindHelpers","getAllPrebindHelpers","helper","TemplateHelpers","registerTemplateHelper","raw","toCoveo","labelKey","translate","isValidFieldName","lowerCaseFieldName","fieldWithoutDelimiter","stripCoveoFieldDelimiter","escapedCharacterRegex","test","warn","trace","translatedFieldWithoutDelimiter","translateFieldName","startsWithAt","addCoveoFieldDelimiter","fieldNameWithDelimiter","coveoFieldDelimiter","isCoveoFieldName","strippedFieldName","isDecorated","regexString","RegExp","substr","isFieldAlreadyTranslated","replaceSpecialCharacters","replaceFirstCharacter","fieldNameRegex","characters","split","unshift","escapeSpecialCharacter","replaceSpecialCharacter","character","match","nonSpecialCharacters","charCodeAt","nonSpecialCharactersString","validFirstCharacters","prebindAppliedValue","helpers","hasHelper","dataset","attributes","getPrebindingAttributesForElement","applyPrebindToElement","exception","getAllPrebindingAttributesNames","methodName","attribute","lowerCaseFirstCharacter","removePrebindPrefix","attributeValue","method","keys","stringStartsWithPrebindingString","filterAndWarnNonExistingHelperName","lastIndexOf","prebindString","hasHelperWithName","attributeName","substring","charAt","prebind","createReversedSortElement","sortElement","sortElementReverse","sortCriteria","JSON","parse","direction","stringify","addDirectionToCaption","caption","_i","_a","insertAdjacentElement","adjustSortDropdown","AnalyticsEnabled_1","CoveoForSitecoreAnalyticsEndpoint_1","CurrentMaximumAge_1","CurrentPageName_1","FieldTranslator_1","IsAnonymous_1","MainSearchInterfaceSelector_1","ItemIdSelector_1","SortCriteria_1","UnfoldDictionaryToAttributes_1","AnalyticsEnabledPrebind","CoveoForSitecoreAnalyticsEndpointPrebind","CurrentMaximumAge","CurrentPageNamePrebind","FieldTranslatorPrebind","IsAnonymousPrebind","MainSearchInterfaceSelectorPrebind","SortCriteriaPrebind","UnfoldDictionaryToAttributesPrebind","currentValue","toString","pageName","isAnonymous","ResolveParentSearchInterfaceId","mainSearchInterfaceId","foundId","tryFindParentSearchInterfaceFromElement","parentSearchInterface","findParentWithClass","SearchInterface","className","parent","parentElement","SortCriteriaResolver_1","criteriaResolver","SortCriteriaResolver","sortCriteriaRawValue","sortType","sortDirection","enableBothSortDirections","sortDropdownElement","enableSortDropdown","body","resolveRelevancyCriteria","resolveDateCriteria","sortField","resolveFieldCriteria","fieldCriteria","getFieldCriteria","getFieldWithDirection","getInvertedDirection","rawDictionary","parsedDictionary","translatedField","dataKey","toUpperCase","configureSitecoreEndpoint","getAccessToken","accessToken","initializeEndPoint","dispatchInitializationEvent","endpoint","createNewEndpoint","endpoints","customEvent","createEvent","initEvent","readyState","dispatchEvent","addEventListener","fetchAccessToken","response","ok","json","token","catch","fetch","restUri","queryStringArguments","itemUri","renewAccessToken","SearchInterfaceComponentInitializer_1","SitecoreExperienceEditor_1","SearchInterfaceProvider_1","experienceEditor","searchInterfaceComponentInitializer","searchInterfacesProvider","externalComponentsSection","findSearchInterfaceForSection","getAllSearchInterfaceIds","getAllSearchInterfaceIdsInPage","getSearchInterfaceId","component","searchInterfaceId","searchboxElement","waitForSearchInterfacesInitialization","sent","searchboxElementIsNotInitialized","initSearchbox","Searchbox","getAllSearchInterfacesAfterComponentInitialization","$$","waitForSearchInterfaceInitialization","hasClass","on","Initialization_1","searchInterfacePromise","init","searchInterfaceComponent","UNABLE_TO_RETRIEVE_ACCESS_TOKEN","searchPageElement","searchEndpointUri","organizationId","searchHub","initializeCoveo","displayErrorMessageInExperienceEditor","searchPageRoot","Analytics","organization","errorMessageElement","insertAdjacentHTML","SitecorePublicPathUtils_1","SitecorePublicPathUtils","getDynamicPublicPath","lazyCoveoForSitecoreAnalytics","lazyCoveoForSitecoreConfigureSearchHub","lazyCoveoSendAnalyticsToSitecore","lazyValidateAnalyticsIncluded","lazyCoveoForSitecoreBindWithUserContext","lazyCoveoForSitecoreExpressions","lazyCoveoForSitecoreSyntax","lazyCoveoForSitecoreRankingExpression","lazyCoveoForSitecoreExternalContent","lazyCoveoForSitecoreFilterExpression","lazyCoveoForSitecoreLocalExpression","lazyCoveoGoogleApiPositionProvider","lazyCoveoNavigatorPositionProvider","lazyCoveoStaticPositionProvider","__export","getCoveoScript","scriptElements","el","isScript","Logger","getCurrentScript","is","PublicPathUtils","LazyInitialization","registerLazyComponent","loaded","buildErrorCallback"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,oBACA,mBAAAC,eAAAC,IACAD,OAAA,oBAAAJ,GACA,iBAAAC,QACAA,QAAA,iBAAAD,EAAAG,QAAA,oBAEAJ,EAAA,iBAAAC,EAAAD,EAAA,OARA,CASCO,OAAA,SAAAC,GACD,mBCTA,SAAAC,EAAAC,GAQA,IAPA,IAMAC,EAAAC,EANAC,EAAAH,EAAA,GACAI,EAAAJ,EAAA,GAKAK,EAAA,EAAAC,EAAA,GACQD,EAAAF,EAAAI,OAAoBF,IAC5BH,EAAAC,EAAAE,GACAG,EAAAN,IACAI,EAAAG,KAAAD,EAAAN,GAAA,IAEAM,EAAAN,GAAA,EAEA,IAAAD,KAAAG,EACAM,OAAAC,UAAAC,eAAAC,KA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,mBAAmB,yBAA0BrnB","file":"CoveoForSitecore.Lazy.min.js","sourcesContent":["(function webpackUniversalModuleDefinition(root, factory) {\n\tif(typeof exports === 'object' && typeof module === 'object')\n\t\tmodule.exports = factory(require(\"coveo-search-ui\"));\n\telse if(typeof define === 'function' && define.amd)\n\t\tdefine([\"coveo-search-ui\"], factory);\n\telse if(typeof exports === 'object')\n\t\texports[\"CoveoForSitecore\"] = factory(require(\"coveo-search-ui\"));\n\telse\n\t\troot[\"CoveoForSitecore\"] = factory(root[\"Coveo\"]);\n})(window, function(__WEBPACK_EXTERNAL_MODULE__0__) {\nreturn "," \t// install a JSONP callback for chunk loading\n \tfunction webpackJsonpCallback(data) {\n \t\tvar chunkIds = data[0];\n \t\tvar moreModules = data[1];\n\n\n \t\t// add \"moreModules\" to the modules object,\n \t\t// then flag all \"chunkIds\" as loaded and fire callback\n \t\tvar moduleId, chunkId, i = 0, resolves = [];\n \t\tfor(;i < chunkIds.length; i++) {\n \t\t\tchunkId = chunkIds[i];\n \t\t\tif(installedChunks[chunkId]) {\n \t\t\t\tresolves.push(installedChunks[chunkId][0]);\n \t\t\t}\n \t\t\tinstalledChunks[chunkId] = 0;\n \t\t}\n \t\tfor(moduleId in moreModules) {\n \t\t\tif(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {\n \t\t\t\tmodules[moduleId] = moreModules[moduleId];\n \t\t\t}\n \t\t}\n \t\tif(parentJsonpFunction) parentJsonpFunction(data);\n\n \t\twhile(resolves.length) {\n \t\t\tresolves.shift()();\n \t\t}\n\n \t};\n\n\n \t// The module cache\n \tvar installedModules = {};\n\n \t// object to store loaded and loading chunks\n \t// undefined = chunk not loaded, null = chunk preloaded/prefetched\n \t// Promise = chunk loading, 0 = chunk loaded\n \tvar installedChunks = {\n \t\t1: 0\n \t};\n\n\n\n \t// script path function\n \tfunction jsonpScriptSrc(chunkId) {\n \t\treturn __webpack_require__.p + \"\" + ({\"2\":\"CoveoForSitecoreAnalytics\",\"3\":\"CoveoForSitecoreBindWithUserContext\",\"4\":\"CoveoForSitecoreConfigureSearchHub\",\"5\":\"CoveoForSitecoreExpressions\",\"6\":\"CoveoForSitecoreExternalContent\",\"7\":\"CoveoForSitecoreFilterExpression\",\"8\":\"CoveoForSitecoreLocalExpression\",\"9\":\"CoveoForSitecoreRankingExpression\",\"10\":\"CoveoForSitecoreSyntax\",\"11\":\"GoogleApiPositionProvider\",\"12\":\"NavigatorPositionProvider\",\"13\":\"SendAnalyticsToSitecore\",\"14\":\"StaticPositionProvider\",\"15\":\"ValidateAnalyticsIncluded\"}[chunkId]||chunkId) + \".min.js\"\n \t}\n\n \t// The require function\n \tfunction __webpack_require__(moduleId) {\n\n \t\t// Check if module is in cache\n \t\tif(installedModules[moduleId]) {\n \t\t\treturn installedModules[moduleId].exports;\n \t\t}\n \t\t// Create a new module (and put it into the cache)\n \t\tvar module = installedModules[moduleId] = {\n \t\t\ti: moduleId,\n \t\t\tl: false,\n \t\t\texports: {}\n \t\t};\n\n \t\t// Execute the module function\n \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n\n \t\t// Flag the module as loaded\n \t\tmodule.l = true;\n\n \t\t// Return the exports of the module\n \t\treturn module.exports;\n \t}\n\n \t// This file contains only the entry chunk.\n \t// The chunk loading function for additional chunks\n \t__webpack_require__.e = function requireEnsure(chunkId) {\n \t\tvar promises = [];\n\n\n \t\t// JSONP chunk loading for javascript\n\n \t\tvar installedChunkData = installedChunks[chunkId];\n \t\tif(installedChunkData !== 0) { // 0 means \"already installed\".\n\n \t\t\t// a Promise means \"currently loading\".\n \t\t\tif(installedChunkData) {\n \t\t\t\tpromises.push(installedChunkData[2]);\n \t\t\t} else {\n \t\t\t\t// setup Promise in chunk cache\n \t\t\t\tvar promise = new Promise(function(resolve, reject) {\n \t\t\t\t\tinstalledChunkData = installedChunks[chunkId] = [resolve, reject];\n \t\t\t\t});\n \t\t\t\tpromises.push(installedChunkData[2] = promise);\n\n \t\t\t\t// start chunk loading\n \t\t\t\tvar script = document.createElement('script');\n \t\t\t\tvar onScriptComplete;\n\n \t\t\t\tscript.charset = 'utf-8';\n \t\t\t\tscript.timeout = 120;\n \t\t\t\tif (__webpack_require__.nc) {\n \t\t\t\t\tscript.setAttribute(\"nonce\", __webpack_require__.nc);\n \t\t\t\t}\n \t\t\t\tscript.src = jsonpScriptSrc(chunkId);\n\n \t\t\t\tonScriptComplete = function (event) {\n \t\t\t\t\t// avoid mem leaks in IE.\n \t\t\t\t\tscript.onerror = script.onload = null;\n \t\t\t\t\tclearTimeout(timeout);\n \t\t\t\t\tvar chunk = installedChunks[chunkId];\n \t\t\t\t\tif(chunk !== 0) {\n \t\t\t\t\t\tif(chunk) {\n \t\t\t\t\t\t\tvar errorType = event && (event.type === 'load' ? 'missing' : event.type);\n \t\t\t\t\t\t\tvar realSrc = event && event.target && event.target.src;\n \t\t\t\t\t\t\tvar error = new Error('Loading chunk ' + chunkId + ' failed.\\n(' + errorType + ': ' + realSrc + ')');\n \t\t\t\t\t\t\terror.type = errorType;\n \t\t\t\t\t\t\terror.request = realSrc;\n \t\t\t\t\t\t\tchunk[1](error);\n \t\t\t\t\t\t}\n \t\t\t\t\t\tinstalledChunks[chunkId] = undefined;\n \t\t\t\t\t}\n \t\t\t\t};\n \t\t\t\tvar timeout = setTimeout(function(){\n \t\t\t\t\tonScriptComplete({ type: 'timeout', target: script });\n \t\t\t\t}, 120000);\n \t\t\t\tscript.onerror = script.onload = onScriptComplete;\n \t\t\t\tdocument.head.appendChild(script);\n \t\t\t}\n \t\t}\n \t\treturn Promise.all(promises);\n \t};\n\n \t// expose the modules object (__webpack_modules__)\n \t__webpack_require__.m = modules;\n\n \t// expose the module cache\n \t__webpack_require__.c = installedModules;\n\n \t// define getter function for harmony exports\n \t__webpack_require__.d = function(exports, name, getter) {\n \t\tif(!__webpack_require__.o(exports, name)) {\n \t\t\tObject.defineProperty(exports, name, { enumerable: true, get: getter });\n \t\t}\n \t};\n\n \t// define __esModule on exports\n \t__webpack_require__.r = function(exports) {\n \t\tif(typeof Symbol !== 'undefined' && Symbol.toStringTag) {\n \t\t\tObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n \t\t}\n \t\tObject.defineProperty(exports, '__esModule', { value: true });\n \t};\n\n \t// create a fake namespace object\n \t// mode & 1: value is a module id, require it\n \t// mode & 2: merge all properties of value into the ns\n \t// mode & 4: return value when already ns object\n \t// mode & 8|1: behave like require\n \t__webpack_require__.t = function(value, mode) {\n \t\tif(mode & 1) value = __webpack_require__(value);\n \t\tif(mode & 8) return value;\n \t\tif((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;\n \t\tvar ns = Object.create(null);\n \t\t__webpack_require__.r(ns);\n \t\tObject.defineProperty(ns, 'default', { enumerable: true, value: value });\n \t\tif(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));\n \t\treturn ns;\n \t};\n\n \t// getDefaultExport function for compatibility with non-harmony modules\n \t__webpack_require__.n = function(module) {\n \t\tvar getter = module && module.__esModule ?\n \t\t\tfunction getDefault() { return module['default']; } :\n \t\t\tfunction getModuleExports() { return module; };\n \t\t__webpack_require__.d(getter, 'a', getter);\n \t\treturn getter;\n \t};\n\n \t// Object.prototype.hasOwnProperty.call\n \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n\n \t// __webpack_public_path__\n \t__webpack_require__.p = \"\";\n\n \t// on error function for async loading\n \t__webpack_require__.oe = function(err) { console.error(err); throw err; };\n\n \tvar jsonpArray = window[\"webpackJsonpCoveoForSitecore\"] = window[\"webpackJsonpCoveoForSitecore\"] || [];\n \tvar oldJsonpFunction = jsonpArray.push.bind(jsonpArray);\n \tjsonpArray.push = webpackJsonpCallback;\n \tjsonpArray = jsonpArray.slice();\n \tfor(var i = 0; i < jsonpArray.length; i++) webpackJsonpCallback(jsonpArray[i]);\n \tvar parentJsonpFunction = oldJsonpFunction;\n\n\n \t// Load entry module and return exports\n \treturn __webpack_require__(__webpack_require__.s = 65);\n","module.exports = __WEBPACK_EXTERNAL_MODULE__0__;","export interface ISitecoreContextInitializationEventArgs {\r\n sitecoreItemId: string;\r\n sitecoreItemUri: string;\r\n sitecorePageName: string;\r\n shouldHaveAnalyticsComponent: boolean;\r\n analyticsEnabled: boolean;\r\n indexSourceName: string;\r\n currentLanguage: string;\r\n languageFieldName: string;\r\n latestVersionFieldName: string;\r\n isInExperienceEditor: boolean;\r\n sitecorePageFullPath: string;\r\n siteName: string;\r\n restEndpointUri: string;\r\n analyticsEndpointUri: string;\r\n}\r\n\r\nexport class SitecoreContextEvents {\r\n public static onSitecoreContextInitialization = 'onSitecoreContextInitialization';\r\n}\r\n","import { ICoveoFieldHandler } from '../handlers/CoveoFieldsHandler';\r\nimport { ICoveoLabelsHandler } from '../handlers/CoveoLabelsHandler';\r\nimport { ContextInitializer } from './initialization/ContextInitializer';\r\nimport { CoveoForSitecoreContext, ICoveoForSitecoreContextOptions } from '../ui/context/CoveoForSitecoreContext';\r\nimport { ComponentOptions } from 'coveo-search-ui';\r\n\r\nexport interface IOnContextConfiguredHandler {\r\n handle(contextElement: HTMLElement): void;\r\n}\r\n\r\nexport class Context {\r\n public static fields: ICoveoFieldHandler;\r\n public static labels: ICoveoLabelsHandler;\r\n\r\n public static element: HTMLElement;\r\n\r\n static configureContext(contextElement: HTMLElement): void {\r\n if (typeof contextElement === 'undefined' || contextElement === null) {\r\n throw Error('You must execute `configureContext` with an HTML element.');\r\n }\r\n\r\n const options: ICoveoForSitecoreContextOptions = ComponentOptions.initComponentOptions(\r\n contextElement,\r\n CoveoForSitecoreContext\r\n );\r\n this.initializeWithContextOptions(contextElement, options);\r\n }\r\n\r\n private static initializeWithContextOptions(\r\n contextElement: HTMLElement,\r\n contextOptions: ICoveoForSitecoreContextOptions\r\n ): void {\r\n const contextInitializer = new ContextInitializer();\r\n const fieldsHandler = contextInitializer.createFieldsHandler({\r\n externalFields: contextOptions.scExternalFields,\r\n sourceSpecificFields: contextOptions.scSourceSpecificFields,\r\n preferSourceSpecificFields: contextOptions.scPreferSourceSpecificFields,\r\n prefix: contextOptions.scFieldPrefix,\r\n suffix: contextOptions.scFieldSuffix,\r\n });\r\n const labels: ICoveoLabelsHandler = contextInitializer.createLabelsHandler({\r\n labels: contextOptions.scLabels,\r\n });\r\n const sourceName = contextOptions.scIndexSourceName;\r\n\r\n contextInitializer.initializePrebinding({\r\n fieldsHandler: fieldsHandler,\r\n context: contextOptions,\r\n });\r\n contextInitializer.initializeUnderscoreFieldsHelpers(fieldsHandler);\r\n contextInitializer.initializeUnderscoreLabelsHelpers(labels);\r\n contextInitializer.initializeUnderscoreContextHelpers(sourceName);\r\n contextInitializer.initializeContextElement(contextElement);\r\n\r\n this.fields = fieldsHandler;\r\n this.labels = labels;\r\n this.element = contextElement;\r\n }\r\n}\r\n","export function nodeListToArray(elements: HTMLCollectionOf | NodeListOf): HTMLElement[] {\r\n const array: HTMLElement[] = [];\r\n for (var i = 0, length = elements.length; i < length; i++) {\r\n array.push(elements.item(i) as HTMLElement);\r\n }\r\n return array;\r\n}\r\n\r\nexport function cloneElementSafelyForAccessibility(element: HTMLElement): HTMLElement {\r\n const clone = element.cloneNode(true) as HTMLElement;\r\n return removeAllIDAttributes(clone);\r\n}\r\n\r\nexport function removeAllIDAttributes(element: HTMLElement): HTMLElement {\r\n element.removeAttribute('id');\r\n const children = element.querySelectorAll('*[id]');\r\n const length = children.length;\r\n for (let i = 0; i < length; i++) {\r\n children.item(i).removeAttribute('id');\r\n }\r\n return element;\r\n}\r\n","import { IPrebindResolver, PrebindResolver, IPrebindHandler } from '../resolvers/prebinding/PrebindResolver';\r\nimport * as SortCriteriaPreprocessor from '../resolvers/sortCriteria/SortCriteriaPreprocessor';\r\n\r\nexport class Prebinding {\r\n private static processor: IPrebindResolver = new PrebindResolver();\r\n\r\n static registerPrebindHelper(helperName: string, handler: IPrebindHandler): void {\r\n this.processor.registerPrebindHelper(helperName, handler);\r\n }\r\n\r\n static getHelper(helperName: string): IPrebindHandler {\r\n return this.processor.getHelper(helperName);\r\n }\r\n\r\n static applyPrebindingOnElement(rootElement: HTMLElement): void {\r\n if (this.processor.canApplyPrebind(rootElement) && this.processor.hasNotAppliedPrebind(rootElement)) {\r\n this.processor.applyToElement(rootElement);\r\n }\r\n }\r\n\r\n static applyPreprocessingToElements(rootElement: HTMLElement) {\r\n SortCriteriaPreprocessor.adjustDOMElements(rootElement);\r\n\r\n return rootElement.querySelectorAll('*');\r\n }\r\n\r\n static applyPrebindingOnChildren(rootElement: HTMLElement): void {\r\n const processedElements = this.applyPreprocessingToElements(rootElement);\r\n\r\n this.nodeListToArray(processedElements)\r\n .map((element) => element as HTMLElement)\r\n .filter((element) => this.processor.canApplyPrebind(element))\r\n .filter((element) => this.processor.hasNotAppliedPrebind(element))\r\n .forEach((element) => this.processor.applyToElement(element));\r\n }\r\n\r\n private static nodeListToArray(elements: NodeListOf): TElementType[] {\r\n const array: TElementType[] = [];\r\n for (var i = 0, length = elements.length; i < length; i++) {\r\n array.push(elements[i]);\r\n }\r\n return array;\r\n }\r\n}\r\n","import { ExpressionBuilder } from 'coveo-search-ui';\r\n\r\nexport interface IBuildingExternalContentEventArgs {\r\n sources: string[];\r\n}\r\n\r\nexport interface IBuildingLocalSitecoreInstanceExpressionEventArgs {\r\n expression: ExpressionBuilder;\r\n externalSources: string[];\r\n buildingQueryAlreadyProcessed: boolean;\r\n}\r\n\r\nexport class SitecoreExpressionEvents {\r\n public static onBuildingSitecoreExternalContent = 'onBuildingSitecoreExternalContent';\r\n public static onBuildingLocalSitecoreInstanceExpression = 'onBuildingLocalSitecoreInstanceExpression';\r\n}\r\n","import {\r\n Component,\r\n ComponentOptions,\r\n IBuildingQuerySuggestArgs,\r\n IComponentBindings,\r\n InitializationEvents,\r\n IQuerySuggestRequest,\r\n OmniboxEvents,\r\n QueryEvents,\r\n QueryBuilder,\r\n IDoneBuildingQueryEventArgs,\r\n Initialization,\r\n IStringMap,\r\n} from 'coveo-search-ui';\r\n\r\nimport { ISitecoreContextInitializationEventArgs, SitecoreContextEvents } from '../../events/ContextEvents';\r\nimport { IExternalFieldConfig as ILegacyExternalFieldConfig } from '../../handlers/CoveoFieldsHandler';\r\nimport { IExternalFieldConfig, ISourceSpecificFieldConfig } from '../../handlers/IFieldTypeResolver';\r\n\r\nexport interface ICoveoForSitecoreContextOptions {\r\n scItemId: string;\r\n scItemUri: string;\r\n scLatestVersionFieldName: string;\r\n scLanguageFieldName: string;\r\n scCurrentLanguage: string;\r\n scRestEndpointUri: string;\r\n scAnalyticsEndpointUri: string;\r\n scLabels: IStringMap;\r\n scPageName: string;\r\n scDefaultPipelineName: string;\r\n scShouldHaveAnalyticsComponent: boolean;\r\n scAnalyticsEnabled: boolean;\r\n scIsUserAnonymous: boolean;\r\n scFieldPrefix: string;\r\n scFieldSuffix: string;\r\n scExternalFields: IExternalFieldConfig[] | ILegacyExternalFieldConfig[];\r\n scSourceSpecificFields: ISourceSpecificFieldConfig[];\r\n scPreferSourceSpecificFields: boolean;\r\n scIndexSourceName: string;\r\n scIsInExperienceEditor: boolean;\r\n scMaximumAge: number;\r\n scPageNameFullPath: string;\r\n scSiteName: string;\r\n}\r\n\r\nexport class CoveoForSitecoreContext extends Component {\r\n static ID = 'ForSitecoreContext';\r\n\r\n static options: ICoveoForSitecoreContextOptions = {\r\n scItemId: ComponentOptions.buildStringOption(),\r\n scItemUri: ComponentOptions.buildStringOption(),\r\n scLanguageFieldName: ComponentOptions.buildStringOption(),\r\n scLatestVersionFieldName: ComponentOptions.buildStringOption(),\r\n scCurrentLanguage: ComponentOptions.buildStringOption(),\r\n scRestEndpointUri: ComponentOptions.buildStringOption(),\r\n scAnalyticsEndpointUri: ComponentOptions.buildStringOption(),\r\n scLabels: ComponentOptions.buildJsonOption(),\r\n scPageName: ComponentOptions.buildStringOption(),\r\n scDefaultPipelineName: ComponentOptions.buildStringOption(),\r\n scShouldHaveAnalyticsComponent: ComponentOptions.buildBooleanOption(),\r\n scAnalyticsEnabled: ComponentOptions.buildBooleanOption(),\r\n scIsUserAnonymous: ComponentOptions.buildBooleanOption(),\r\n scFieldPrefix: ComponentOptions.buildStringOption(),\r\n scFieldSuffix: ComponentOptions.buildStringOption(),\r\n scExternalFields: ComponentOptions.buildJsonOption(),\r\n scSourceSpecificFields: ComponentOptions.buildJsonOption(),\r\n scPreferSourceSpecificFields: ComponentOptions.buildBooleanOption(),\r\n scIndexSourceName: ComponentOptions.buildStringOption(),\r\n scIsInExperienceEditor: ComponentOptions.buildBooleanOption(),\r\n scMaximumAge: ComponentOptions.buildNumberOption(),\r\n scPageNameFullPath: ComponentOptions.buildStringOption(),\r\n scSiteName: ComponentOptions.buildStringOption(),\r\n };\r\n\r\n constructor(\r\n public element: HTMLElement,\r\n public options: ICoveoForSitecoreContextOptions,\r\n public bindings: IComponentBindings\r\n ) {\r\n super(element, CoveoForSitecoreContext.ID, bindings);\r\n\r\n this.options = ComponentOptions.initComponentOptions(element, CoveoForSitecoreContext, options);\r\n this.bind.onRootElement(InitializationEvents.afterComponentsInitialization, this.afterComponentsInitialization);\r\n this.bind.onRootElement(QueryEvents.doneBuildingQuery, this.doneBuildingQuery);\r\n this.bind.onRootElement(OmniboxEvents.buildingQuerySuggest, this.buildingQuerySuggest);\r\n }\r\n\r\n private doneBuildingQuery(args: IDoneBuildingQueryEventArgs): void {\r\n if (this.hasDefaultPipelineNameSet() && this.queryBuilderUsesDefaultPipeline(args.queryBuilder)) {\r\n args.queryBuilder.pipeline = this.options.scDefaultPipelineName;\r\n }\r\n }\r\n\r\n private buildingQuerySuggest(args: IBuildingQuerySuggestArgs): void {\r\n if (this.hasDefaultPipelineNameSet() && this.querySuggestUsesDefaultPipeline(args.payload)) {\r\n args.payload.pipeline = this.options.scDefaultPipelineName;\r\n }\r\n }\r\n\r\n private hasDefaultPipelineNameSet(): boolean {\r\n return this.options.scDefaultPipelineName !== '';\r\n }\r\n\r\n private queryBuilderUsesDefaultPipeline(queryBuilder: QueryBuilder): boolean {\r\n return typeof queryBuilder.pipeline === 'undefined';\r\n }\r\n\r\n private querySuggestUsesDefaultPipeline(querySuggestRequest: IQuerySuggestRequest): boolean {\r\n return typeof querySuggestRequest.pipeline === 'undefined';\r\n }\r\n\r\n private afterComponentsInitialization(): void {\r\n const contextArgs: ISitecoreContextInitializationEventArgs = {\r\n sitecoreItemId: this.options.scItemId,\r\n sitecoreItemUri: this.options.scItemUri,\r\n sitecorePageName: this.options.scPageName,\r\n shouldHaveAnalyticsComponent: this.options.scShouldHaveAnalyticsComponent,\r\n analyticsEnabled: this.options.scAnalyticsEnabled,\r\n indexSourceName: this.options.scIndexSourceName,\r\n currentLanguage: this.options.scCurrentLanguage,\r\n languageFieldName: this.options.scLanguageFieldName,\r\n latestVersionFieldName: this.options.scLatestVersionFieldName,\r\n isInExperienceEditor: this.options.scIsInExperienceEditor,\r\n sitecorePageFullPath: this.options.scPageNameFullPath,\r\n siteName: this.options.scSiteName,\r\n restEndpointUri: this.options.scRestEndpointUri,\r\n analyticsEndpointUri: this.options.scAnalyticsEndpointUri,\r\n };\r\n this.bind.trigger(this.element, SitecoreContextEvents.onSitecoreContextInitialization, contextArgs);\r\n }\r\n}\r\n\r\nInitialization.registerAutoCreateComponent(CoveoForSitecoreContext);\r\n","import { IExternalFieldConfig } from './CoveoFieldsHandler';\r\nimport { IFieldTypeResolver } from './IFieldTypeResolver';\r\n\r\nexport class LegacyFieldTypeResolver implements IFieldTypeResolver {\r\n private readonly externalFields: IExternalFieldConfig[];\r\n\r\n constructor(externalFields: IExternalFieldConfig[]) {\r\n this.externalFields = this.parseExternalFields(externalFields);\r\n }\r\n\r\n private parseExternalFields(externalFields: Array): IExternalFieldConfig[] {\r\n return externalFields.map((externalField) => {\r\n if (typeof externalField === 'string') {\r\n return {\r\n fieldName: (externalField as string).toLowerCase(),\r\n shouldEscape: false,\r\n };\r\n } else if (this.isExternalFieldConfig(externalField)) {\r\n return {\r\n fieldName: externalField.fieldName.toLowerCase(),\r\n shouldEscape: externalField.shouldEscape,\r\n };\r\n } else {\r\n console.error(`Invalid external field '${externalField}'.`);\r\n }\r\n });\r\n }\r\n\r\n public shouldEscapeFirstCharacter(fieldName: string): boolean {\r\n return false;\r\n }\r\n\r\n public shouldEscapeSpecialCharacters(fieldName: string): boolean {\r\n const fields = this.externalFields.filter((field) => field.fieldName.toLowerCase() === fieldName.toLowerCase());\r\n\r\n return fields.length > 0 ? fields[0].shouldEscape : true;\r\n }\r\n\r\n public shouldDecorate(fieldName: string): boolean {\r\n return !this.externalFields.some((field) => field.fieldName.toLowerCase() === fieldName.toLowerCase());\r\n }\r\n\r\n public isExternalField(fieldName: string): boolean {\r\n return this.externalFields.some((field) => field.fieldName.toLowerCase() === fieldName.toLowerCase());\r\n }\r\n\r\n private isExternalFieldConfig(obj: any): boolean {\r\n return (\r\n typeof obj !== 'undefined' &&\r\n typeof obj.fieldName !== 'undefined' &&\r\n typeof obj.shouldEscape !== 'undefined'\r\n );\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport interface IItemIdValueResolver {\r\n canResolve(itemId: string, element: HTMLElement): boolean;\r\n getValue(itemId: string, element: HTMLElement): string;\r\n}\r\n\r\nexport class ItemIdSelectorPrebind implements IPrebindHelper {\r\n public name: string = 'itemIdSelector';\r\n\r\n private resolvers: IItemIdValueResolver[] = [\r\n new ResolveIfSelector(),\r\n new ResolveIfItemIdInPage(),\r\n new UseItemIdSelectorAsIs(),\r\n ];\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (itemId: string, element: HTMLElement) => {\r\n const resolver: IItemIdValueResolver = this.getFirstValidResolver(itemId, element);\r\n\r\n return resolver.getValue(itemId, element);\r\n };\r\n }\r\n\r\n private getFirstValidResolver(itemId: string, element: HTMLElement): IItemIdValueResolver {\r\n let resolver: IItemIdValueResolver;\r\n\r\n do {\r\n if (this.resolvers.length === 0) {\r\n const message =\r\n 'Could not resolve the element using the current resolver. Ensure that a valid value is set.';\r\n console.error(message, {\r\n itemId: itemId,\r\n element: element,\r\n });\r\n throw message;\r\n }\r\n resolver = this.resolvers.shift();\r\n } while (!resolver.canResolve(itemId, element));\r\n\r\n return resolver;\r\n }\r\n}\r\n\r\nexport class ResolveIfItemIdInPage implements IItemIdValueResolver {\r\n canResolve(itemId: string): boolean {\r\n return this.isItemDefined(itemId) && this.isIdSelectorValid(`#${itemId}`);\r\n }\r\n\r\n getValue(itemId: string): string {\r\n return `#${itemId}`;\r\n }\r\n\r\n private isItemDefined(itemId: string): boolean {\r\n return !!itemId;\r\n }\r\n\r\n private isIdSelectorValid(selector: string): boolean {\r\n return document.querySelector(selector) !== null;\r\n }\r\n}\r\n\r\nexport class ResolveIfSelector implements IItemIdValueResolver {\r\n canResolve(itemId: string, element: HTMLElement): boolean {\r\n return !!itemId && this.isStartingWithSelectorCharacter(itemId);\r\n }\r\n\r\n getValue(itemId: string, element: HTMLElement): string {\r\n return itemId;\r\n }\r\n\r\n private isStartingWithSelectorCharacter(itemId: string): boolean {\r\n const firstCharacter = itemId[0];\r\n\r\n return ['.', '#'].indexOf(firstCharacter) !== -1;\r\n }\r\n}\r\n\r\nexport class UseItemIdSelectorAsIs implements IItemIdValueResolver {\r\n canResolve(itemId: string, element: HTMLElement): boolean {\r\n return true;\r\n }\r\n\r\n getValue(itemId: string, element: HTMLElement): string {\r\n return itemId;\r\n }\r\n}\r\n","import { ExternalComponentInitializer } from './initialization/ExternalComponentInitializer';\r\nimport { SearchboxInitializer } from './initialization/SearchboxInitializer';\r\nimport { SearchInterfaceInitializer } from './initialization/SearchInterfaceInitializer';\r\nimport { ElementWithContextInitializer } from './initialization/ElementWithContextInitializer';\r\nimport { HostedSearchPageInitializer } from './initialization/HostedSearchPageInitializer';\r\n\r\nexport const searchInterfaceInitializer = new SearchInterfaceInitializer();\r\nexport const searchboxInitializer = new SearchboxInitializer();\r\nexport const externalComponentInitializer = new ExternalComponentInitializer();\r\nexport const hostedSearchPageInitializer = new HostedSearchPageInitializer();\r\n\r\nexport function initSearchInterface(searchInterfaceElement: HTMLElement): Promise<{ elem: HTMLElement }> {\r\n return searchInterfaceInitializer.initSearchInterface(searchInterfaceElement);\r\n}\r\n\r\nexport function initializeSearchInterfaceForExperienceEditor(\r\n searchInterfaceElement: HTMLElement\r\n): Promise<{ elem: HTMLElement }> {\r\n searchInterfaceInitializer.initializeExperienceEditorHooksForSearchInterface(searchInterfaceElement);\r\n return initSearchInterface(searchInterfaceElement);\r\n}\r\n\r\nexport function initSearchboxIfStandalone(\r\n searchBoxElement: HTMLElement,\r\n searchPageUri: string,\r\n options?: any\r\n): Promise {\r\n return searchboxInitializer.initSearchboxIfStandalone(searchBoxElement, searchPageUri, options);\r\n}\r\n\r\nexport function initContextOnElement(element: HTMLElement): void {\r\n ElementWithContextInitializer.initializeContextWithinElement(element);\r\n}\r\n\r\nexport function initExternalComponentsSection(element: HTMLElement): void {\r\n externalComponentInitializer.initializeExternalComponentSection(element);\r\n}\r\n\r\nexport function initExternalComponentsSectionForExperienceEditor(element: HTMLElement): void {\r\n externalComponentInitializer.initializeExperienceEditorHooksForExternalComponentsSection(element);\r\n initExternalComponentsSection(element);\r\n}\r\n\r\nexport function initHostedSearchPageInitializer(element: HTMLElement): void {\r\n hostedSearchPageInitializer.initializeSearchPage(element);\r\n}\r\n","import { Prebinding } from '../../base/Prebinding';\r\nimport { nodeListToArray } from '../../utils/HTMLUtils';\r\n\r\nimport { Initialization, SearchInterface, get, Facet, Tab } from 'coveo-search-ui';\r\n\r\nconst duringInitializationClass = 'coveo-during-initialization';\r\n\r\nexport class SearchInterfaceComponentInitializer implements ISearchInterfaceComponentInitializer {\r\n public loadComponentsForSearchInterface(\r\n searchInterface: SearchInterface,\r\n newComponent: HTMLElement\r\n ): Promise {\r\n Prebinding.applyPrebindingOnElement(newComponent);\r\n Prebinding.applyPrebindingOnChildren(newComponent);\r\n const result = Initialization.automaticallyCreateComponentsInside(newComponent, {\r\n bindings: searchInterface.getBindings(),\r\n options: {},\r\n });\r\n return result.initResult.then(() => {\r\n this.removeAllPlaceholdersWithinElement(newComponent);\r\n searchInterface.queryController.executeQuery({\r\n ignoreWarningSearchEvent: true,\r\n });\r\n });\r\n }\r\n\r\n public tryUnloadComponentsForSearchInterface(searchInterface: SearchInterface, newComponent: HTMLElement): void {\r\n const facets = nodeListToArray(newComponent.getElementsByClassName('CoveoFacet'));\r\n facets.forEach((facet) => {\r\n const facetComponent: Facet = get(facet, 'CoveoFacet') as Facet;\r\n if (facetComponent) {\r\n searchInterface.detachComponent('Facet', facetComponent);\r\n }\r\n this.removeAllChildren(facet);\r\n });\r\n\r\n const tabs = nodeListToArray(newComponent.getElementsByClassName('CoveoTab'));\r\n tabs.forEach((tab) => {\r\n const tabComponent: Tab = get(tab, 'CoveoTab') as Tab;\r\n if (tabComponent) {\r\n searchInterface.detachComponent('Tab', tabComponent);\r\n }\r\n this.removeAllChildren(tab);\r\n });\r\n }\r\n\r\n private removeAllPlaceholdersWithinElement(element: HTMLElement): void {\r\n const elementsWithInitializationClass = nodeListToArray(\r\n element.getElementsByClassName(duringInitializationClass)\r\n );\r\n elementsWithInitializationClass.forEach((element) => this.removePlaceholders(element));\r\n }\r\n\r\n private removePlaceholders(element: HTMLElement): void {\r\n element.classList.remove(duringInitializationClass);\r\n\r\n if (element.classList.contains('CoveoFacet')) {\r\n this.removeFacetsPlaceholders(element);\r\n }\r\n }\r\n private removeFacetsPlaceholders(element: HTMLElement): void {\r\n element.classList.remove('coveo-with-placeholder');\r\n\r\n // Since a Facet reinserts DOM as children when initializing, we have to remove all its children,\r\n // else new content will be appended each time the facet is initialized.\r\n this.removeAllChildren(element);\r\n }\r\n\r\n private removeAllChildren(element: HTMLElement): void {\r\n while (element.firstChild) {\r\n element.removeChild(element.firstChild);\r\n }\r\n }\r\n\r\n public loadComponentsWithSearchInterfaceInitialization(\r\n searchInterfaceElement: HTMLElement,\r\n componentsContainer: HTMLElement\r\n ): void {\r\n Prebinding.applyPrebindingOnElement(componentsContainer);\r\n Prebinding.applyPrebindingOnChildren(componentsContainer);\r\n Coveo.options(searchInterfaceElement, {\r\n externalComponents: [componentsContainer],\r\n });\r\n }\r\n}\r\n\r\nexport interface ISearchInterfaceComponentInitializer {\r\n loadComponentsWithSearchInterfaceInitialization(searchInterfaceElement: HTMLElement, element: HTMLElement): void;\r\n loadComponentsForSearchInterface(searchInterface: SearchInterface, newComponent: HTMLElement): Promise;\r\n tryUnloadComponentsForSearchInterface(searchInterface: SearchInterface, newComponent: HTMLElement): void;\r\n}\r\n\r\nconst initializer = new SearchInterfaceComponentInitializer();\r\nexport function getInitializerInstance(): ISearchInterfaceComponentInitializer {\r\n return initializer;\r\n}\r\n","import { nodeListToArray } from '../../utils/HTMLUtils';\r\n\r\ndeclare const Sitecore: any;\r\n\r\nexport interface IRenderingElement {\r\n opening: Array;\r\n}\r\n\r\nexport type IAfterFrameLoadedCallback = (callbackData: IRenderingElement) => void;\r\nexport type IAfterPersonalizationChangedCallback = (element: HTMLElement) => void;\r\nexport type IBeforeUnloadingChromeCallback = (element: HTMLElement) => void;\r\n\r\nexport class SitecoreExperienceEditor implements ISitecoreExperienceEditor {\r\n public static isInBackgroundRenderingParameterName = 'sc_phk';\r\n\r\n private isAfterFrameLoadedOverriden = false;\r\n private isAfterPersonalizationChangedOverriden = false;\r\n private isBeforeUnloadingChromeOverriden = false;\r\n\r\n private onAfterFrameLoadedCallbacks: IAfterFrameLoadedCallback[] = [];\r\n private onAfterPersonalizationChanged: IAfterPersonalizationChangedCallback[] = [];\r\n private onBeforeUnloadingChrome: IBeforeUnloadingChromeCallback[] = [];\r\n\r\n public registerOnLoadRenderingFromUrl(onAfterFrameLoadedCallback: (callbackData: IRenderingElement) => void): void {\r\n this.tryOverrideSitecoreLoadRenderingFromUrl();\r\n this.onAfterFrameLoadedCallbacks.push(onAfterFrameLoadedCallback);\r\n }\r\n\r\n public registerBeforeUnloadingChrome(onBeforeUnloadingChromeCallback: IBeforeUnloadingChromeCallback): void {\r\n this.tryOverrideOnUnloadingChrome();\r\n this.onBeforeUnloadingChrome.push(onBeforeUnloadingChromeCallback);\r\n }\r\n\r\n public registerOnAfterPersonalizationChanged(\r\n onAfterPersonalizationChanged: IAfterPersonalizationChangedCallback\r\n ): void {\r\n this.tryOverrideSitecoreChromeTypesRenderingChangeCondition();\r\n this.onAfterPersonalizationChanged.push(onAfterPersonalizationChanged);\r\n }\r\n\r\n public isInBackgroundRendering(): boolean {\r\n return window.location.search.indexOf(SitecoreExperienceEditor.isInBackgroundRenderingParameterName) !== -1;\r\n }\r\n\r\n public getComponentFromLoadRenderingFromUrlCallbackData(callbackData: IRenderingElement): HTMLElement {\r\n var chromeRendering = document.getElementById(callbackData.opening[0].id);\r\n return chromeRendering.nextElementSibling as HTMLElement;\r\n }\r\n\r\n private tryOverrideSitecoreLoadRenderingFromUrl(): void {\r\n if (!this.isAfterFrameLoadedOverriden && typeof Sitecore !== 'undefined') {\r\n this.overrideSitecoreLoadRenderingFromUrl();\r\n }\r\n }\r\n\r\n private overrideSitecoreLoadRenderingFromUrl(): void {\r\n const originalLoad = Sitecore.PageModes.ChromeTypes.Placeholder.prototype.insertRendering;\r\n const onAfterFrameLoadedCallback = (callbackData: IRenderingElement) => {\r\n this.onAfterFrameLoadedCallbacks.forEach((callback) => callback(callbackData));\r\n };\r\n Sitecore.PageModes.ChromeTypes.Placeholder.prototype.insertRendering = function (\r\n frameLoadedCallback: IRenderingElement\r\n ): void {\r\n originalLoad.call(this, frameLoadedCallback);\r\n onAfterFrameLoadedCallback(frameLoadedCallback);\r\n };\r\n this.isAfterFrameLoadedOverriden = true;\r\n }\r\n\r\n private tryOverrideOnUnloadingChrome(): void {\r\n if (!this.isBeforeUnloadingChromeOverriden && typeof Sitecore !== 'undefined') {\r\n this.overrideSitecoreChromeChangeCondition();\r\n this.isBeforeUnloadingChromeOverriden = true;\r\n }\r\n }\r\n\r\n private overrideSitecoreChromeChangeCondition(): void {\r\n const originalChangeCondition: Function = Sitecore.PageModes.ChromeTypes.Rendering.prototype.changeCondition;\r\n const onBeforeChangeCondition = (changedElement: HTMLElement) => {\r\n this.onBeforeUnloadingChrome.forEach((callback) => callback(changedElement));\r\n };\r\n Sitecore.PageModes.ChromeTypes.Rendering.prototype.changeCondition = function (\r\n id,\r\n sender,\r\n preserveCacheUpdating\r\n ): void {\r\n onBeforeChangeCondition(this.chrome.element[0]);\r\n originalChangeCondition.apply(this, arguments);\r\n };\r\n }\r\n\r\n private tryOverrideSitecoreChromeTypesRenderingChangeCondition(): void {\r\n if (!this.isAfterPersonalizationChangedOverriden && typeof Sitecore !== 'undefined') {\r\n this.overrideSitecoreChromeTypesRenderingChangeCondition();\r\n }\r\n }\r\n\r\n private overrideSitecoreChromeTypesRenderingChangeCondition(): void {\r\n const originalStartActivation: Function = Sitecore.PageModes.ChromeTypes.Rendering.prototype._startActivation;\r\n const originalEndActivation: Function = Sitecore.PageModes.ChromeTypes.Rendering.prototype._endActivation;\r\n let elementToProcessWhenFinished: HTMLElement;\r\n const onAfterPersonalizationChanged = (changedElement: HTMLElement) => {\r\n this.onAfterPersonalizationChanged.forEach((callback) => callback(changedElement));\r\n };\r\n const getValidMarker = (markersAndElements: HTMLElement[]): HTMLElement => {\r\n return this.isDifferentFirstLoadMarker(markersAndElements) ? markersAndElements[2] : markersAndElements[1];\r\n };\r\n Sitecore.PageModes.ChromeTypes.Rendering.prototype._startActivation = function (\r\n markersAndElements: HTMLElement[],\r\n fieldId?: string\r\n ): void {\r\n elementToProcessWhenFinished = getValidMarker(markersAndElements);\r\n originalStartActivation.apply(this, arguments);\r\n };\r\n Sitecore.PageModes.ChromeTypes.Rendering.prototype._endActivation = function (reason: string): void {\r\n originalEndActivation.apply(this, arguments);\r\n if (elementToProcessWhenFinished) {\r\n onAfterPersonalizationChanged(elementToProcessWhenFinished);\r\n }\r\n };\r\n this.isAfterPersonalizationChangedOverriden = true;\r\n }\r\n\r\n // In Sitecore 8.0, for some reason, there are two additionnal text nodes *only on the first load*.\r\n // The cached version does not have those.\r\n private isDifferentFirstLoadMarker(markersAndElements: HTMLElement[]): boolean {\r\n return markersAndElements[1].nodeType === Node.TEXT_NODE;\r\n }\r\n\r\n public registerShowDebugInformationCallback(): void {\r\n if (!window['scCoveoShowDebugInformation']) {\r\n window['scCoveoShowDebugInformation'] = (debugModeEnabled: boolean) => {\r\n const debugInfoElements = nodeListToArray(document.getElementsByClassName('coveo-debug-information'));\r\n if (debugModeEnabled) {\r\n debugInfoElements.forEach((element) => element.classList.remove('coveo-debug-hidden'));\r\n } else {\r\n debugInfoElements.forEach((element) => element.classList.add('coveo-debug-hidden'));\r\n }\r\n // Chromes are not updated correctly until an event refreshes them. This forces the update.\r\n Sitecore.PageModes.ChromeManager.resetChromes();\r\n };\r\n }\r\n }\r\n}\r\n\r\nexport interface ISitecoreExperienceEditor {\r\n registerOnLoadRenderingFromUrl(onAfterFrameLoadedCallback: (callbackData: IRenderingElement) => void): void;\r\n registerBeforeUnloadingChrome(onBeforeUnloadingChromeCallback: IBeforeUnloadingChromeCallback): void;\r\n registerOnAfterPersonalizationChanged(onAfterPersonalizationChanged: IAfterPersonalizationChangedCallback): void;\r\n isInBackgroundRendering(): boolean;\r\n getComponentFromLoadRenderingFromUrlCallbackData(callbackData: IRenderingElement): HTMLElement;\r\n registerShowDebugInformationCallback(): void;\r\n}\r\n\r\nconst staticInstance = new SitecoreExperienceEditor();\r\n\r\nexport function getExperienceEditorInstance(): ISitecoreExperienceEditor {\r\n return staticInstance;\r\n}\r\n","import { Component } from 'coveo-search-ui';\r\n\r\nimport { nodeListToArray } from './HTMLUtils';\r\n\r\nexport class SearchInterfacesProvider {\r\n getSearchInterfacesInPage(componentsIds: string[]): HTMLElement[] {\r\n const searchInterfacesSelector = this.getSearchInterfacesSelectorFromComponentIds(componentsIds);\r\n const searchInterfaces = document.querySelectorAll(searchInterfacesSelector);\r\n return nodeListToArray(searchInterfaces);\r\n }\r\n\r\n private getSearchInterfacesSelectorFromComponentIds(componentIds: string[]): string {\r\n return componentIds.map((componentId) => Component.computeSelectorForType(componentId)).join(', ');\r\n }\r\n}\r\n","import { Prebinding } from '../Prebinding';\r\nimport { Context } from '../Context';\r\nimport { cloneElementSafelyForAccessibility } from '../../utils/HTMLUtils';\r\n\r\nexport class ElementWithContextInitializer {\r\n public static initializeContextWithinElement(element: HTMLElement): void {\r\n if (!!Context.element) {\r\n element.appendChild(cloneElementSafelyForAccessibility(Context.element));\r\n }\r\n Prebinding.applyPrebindingOnElement(element);\r\n Prebinding.applyPrebindingOnChildren(element);\r\n }\r\n}\r\n","export { SitecoreContextEvents } from './events/ContextEvents';\r\nexport { SitecoreExpressionEvents } from './events/ExpressionEvents';\r\n","export { Context } from './base/Context';\r\nexport { Prebinding } from './base/Prebinding';\r\nexport { SearchEndpoint } from './base/SearchEndpoint';\r\n","import {\r\n ICoveoFieldHandler,\r\n IExternalFieldConfig as ILegacyExternalFieldConfig,\r\n CoveoFieldsHandler,\r\n} from '../../handlers/CoveoFieldsHandler';\r\nimport {\r\n IFieldTypeResolver,\r\n ISourceSpecificFieldConfig,\r\n IExternalFieldConfig,\r\n} from '../../handlers/IFieldTypeResolver';\r\nimport { SourceSpecificFieldResolver } from '../../handlers/SourceSpecificFieldResolver';\r\nimport { ICoveoLabelsHandler, ILabelsDictionary, CoveoLabelsHandler } from '../../handlers/CoveoLabelsHandler';\r\nimport { Prebinding } from '../Prebinding';\r\nimport { IPrebindHelperInitializationArgs } from '../../resolvers/prebinding/PrebindHelper';\r\nimport { PrebindHelpers } from '../../resolvers/prebinding/PrebindHelpers';\r\n\r\nimport { TemplateHelpers } from 'coveo-search-ui';\r\nimport { LegacyFieldTypeResolver } from '../../handlers/LegacyFieldTypeResolver';\r\n\r\nexport interface ICoveoFieldsHandlerOptions {\r\n externalFields: ILegacyExternalFieldConfig[] | IExternalFieldConfig[];\r\n sourceSpecificFields: ISourceSpecificFieldConfig[];\r\n preferSourceSpecificFields: boolean;\r\n prefix: string;\r\n suffix: string;\r\n}\r\n\r\nexport interface ICoveoLabelsHandlerOptions {\r\n labels: ILabelsDictionary;\r\n}\r\n\r\nexport class ContextInitializer {\r\n public createFieldsHandler(options: ICoveoFieldsHandlerOptions): ICoveoFieldHandler {\r\n const externalFields: ILegacyExternalFieldConfig[] | IExternalFieldConfig[] = options.externalFields || [];\r\n const sourceSpecificFields: ISourceSpecificFieldConfig[] = options.sourceSpecificFields || [];\r\n\r\n const fieldTypeResolver: IFieldTypeResolver = options.preferSourceSpecificFields\r\n ? new LegacyFieldTypeResolver(externalFields as ILegacyExternalFieldConfig[])\r\n : new SourceSpecificFieldResolver(sourceSpecificFields, externalFields);\r\n\r\n return new CoveoFieldsHandler(fieldTypeResolver, options.prefix, options.suffix);\r\n }\r\n\r\n public createLabelsHandler(options: ICoveoLabelsHandlerOptions): ICoveoLabelsHandler {\r\n const labels: ILabelsDictionary = options.labels || {};\r\n return new CoveoLabelsHandler(labels);\r\n }\r\n\r\n public initializePrebinding(args: IPrebindHelperInitializationArgs): void {\r\n PrebindHelpers.getAllPrebindHelpers().forEach((helper) => {\r\n Prebinding.registerPrebindHelper(helper.name, helper.getPrebind(args));\r\n });\r\n }\r\n\r\n public initializeUnderscoreFieldsHelpers(fieldsHandler: ICoveoFieldHandler): void {\r\n TemplateHelpers.registerTemplateHelper('coveoFieldValue', function (fieldName: string): string {\r\n return this.raw[fieldsHandler.toCoveo(fieldName)];\r\n });\r\n TemplateHelpers.registerTemplateHelper('coveoFieldName', function (fieldName: string): string {\r\n return fieldsHandler.toCoveo(fieldName);\r\n });\r\n }\r\n\r\n public initializeUnderscoreLabelsHelpers(labels: ICoveoLabelsHandler): void {\r\n TemplateHelpers.registerTemplateHelper('translateLabel', function (labelKey: string): string {\r\n return labels.translate(labelKey);\r\n });\r\n }\r\n\r\n public initializeUnderscoreContextHelpers(sourceName: string): void {\r\n TemplateHelpers.registerTemplateHelper('currentSourceName', function (): string {\r\n return sourceName;\r\n });\r\n }\r\n\r\n public initializeContextElement(contextElement: HTMLElement): void {\r\n Prebinding.applyPrebindingOnElement(contextElement);\r\n }\r\n}\r\n","import { IFieldTypeResolver } from './IFieldTypeResolver';\r\nimport { LegacyFieldTypeResolver } from './LegacyFieldTypeResolver';\r\n\r\nexport interface ICoveoFieldHandler {\r\n isCoveoFieldName(fieldName: string): boolean;\r\n toCoveo(fieldName: string): string;\r\n addCoveoFieldDelimiter(fieldName: string): string;\r\n}\r\n\r\nexport interface IExternalFieldConfig {\r\n fieldName: string;\r\n shouldEscape: boolean;\r\n}\r\n\r\nexport class CoveoFieldsHandler implements ICoveoFieldHandler {\r\n // 'z' and 'x' are also considered as special characters because\r\n // they are used in the escaping logic. So we have to remove them\r\n // from the regular expression pattern.\r\n private static readonly nonSpecialCharactersString = '[a-wyA-WY0-9]';\r\n private static readonly nonSpecialCharacters = new RegExp(CoveoFieldsHandler.nonSpecialCharactersString);\r\n private static readonly coveoFieldDelimiter = '@';\r\n private static readonly fieldNameRegex = new RegExp('^[^\\\\W_]*$');\r\n private static readonly escapedCharacterRegex = new RegExp('z\\\\d{2,3}x');\r\n\r\n private readonly resolver: IFieldTypeResolver;\r\n\r\n constructor(resolver: IFieldTypeResolver, prefix: string, suffix: string);\r\n /**\r\n * @deprecated. Use the `constructor(IFieldTypeResolver, string, string)` constructor instead.\r\n */\r\n constructor(resolver: IExternalFieldConfig[], prefix: string, suffix: string);\r\n constructor(resolver: IExternalFieldConfig[] | IFieldTypeResolver, private prefix: string, private suffix: string) {\r\n if ((resolver).shouldDecorate !== undefined) {\r\n this.resolver = resolver as IFieldTypeResolver;\r\n } else {\r\n // Handle legacy constructor case.\r\n this.resolver = new LegacyFieldTypeResolver(resolver as IExternalFieldConfig[]);\r\n }\r\n }\r\n\r\n public toCoveo(fieldName: string): string {\r\n if (this.isValidFieldName(fieldName)) {\r\n const lowerCaseFieldName = fieldName.toLowerCase();\r\n const fieldWithoutDelimiter = this.stripCoveoFieldDelimiter(lowerCaseFieldName);\r\n if (CoveoFieldsHandler.escapedCharacterRegex.test(fieldWithoutDelimiter)) {\r\n console.warn(\r\n `Field name ${fieldName} contains the z\\\\d{2,3}x pattern. Ensure you avoid using this pattern in field names.`\r\n );\r\n console.trace();\r\n }\r\n\r\n const translatedFieldWithoutDelimiter = this.translateFieldName(fieldWithoutDelimiter);\r\n return this.startsWithAt(fieldName)\r\n ? this.addCoveoFieldDelimiter(translatedFieldWithoutDelimiter)\r\n : translatedFieldWithoutDelimiter;\r\n } else {\r\n console.error(`Could not translate the '${fieldName}' field to a Coveo field. Returning as is.`);\r\n return fieldName;\r\n }\r\n }\r\n\r\n public addCoveoFieldDelimiter(fieldName: string): string {\r\n let fieldNameWithDelimiter = fieldName;\r\n if (!this.startsWithAt(fieldName)) {\r\n fieldNameWithDelimiter = `${CoveoFieldsHandler.coveoFieldDelimiter}${fieldName}`.toLowerCase();\r\n }\r\n return fieldNameWithDelimiter;\r\n }\r\n\r\n public isCoveoFieldName(fieldName: string): boolean {\r\n const strippedFieldName = this.stripCoveoFieldDelimiter(fieldName);\r\n return this.resolver.isExternalField(strippedFieldName) || this.isDecorated(strippedFieldName);\r\n }\r\n\r\n private isDecorated(fieldName: string): boolean {\r\n const regexString = this.prefix + '[\\\\w]+' + this.suffix;\r\n const coveoFieldNameRegex = new RegExp(regexString);\r\n return coveoFieldNameRegex.test(fieldName);\r\n }\r\n\r\n private isValidFieldName(fieldName: string): boolean {\r\n return typeof fieldName !== 'undefined' && fieldName !== '';\r\n }\r\n\r\n private startsWithAt(fieldName: string): boolean {\r\n return fieldName[0] === CoveoFieldsHandler.coveoFieldDelimiter;\r\n }\r\n\r\n private stripCoveoFieldDelimiter(fieldName: string): string {\r\n let field = fieldName;\r\n if (this.startsWithAt(fieldName)) {\r\n field = field.substr(1);\r\n }\r\n return field;\r\n }\r\n\r\n private translateFieldName(fieldName: string): string {\r\n let field = fieldName;\r\n\r\n if (this.resolver.shouldEscapeSpecialCharacters(fieldName) && !this.isFieldAlreadyTranslated(fieldName)) {\r\n field = this.replaceSpecialCharacters(field);\r\n }\r\n if (this.resolver.shouldDecorate(fieldName)) {\r\n field = this.prefix + field + this.suffix;\r\n }\r\n if (this.resolver.shouldEscapeFirstCharacter(field)) {\r\n field = this.replaceFirstCharacter(field);\r\n }\r\n\r\n return field;\r\n }\r\n\r\n // This check was added to avoid fields from being double translated. See SC-4266.\r\n private isFieldAlreadyTranslated(fieldName: string): boolean {\r\n return (\r\n CoveoFieldsHandler.fieldNameRegex.test(fieldName) &&\r\n CoveoFieldsHandler.escapedCharacterRegex.test(fieldName)\r\n );\r\n }\r\n\r\n private replaceFirstCharacter(fieldName: string): string {\r\n const characters = fieldName.split('');\r\n const firstCharacter = characters.shift();\r\n characters.unshift(this.escapeSpecialCharacter(firstCharacter));\r\n return characters.join('');\r\n }\r\n\r\n private replaceSpecialCharacters(fieldName: string): string {\r\n return fieldName.split('').map(this.replaceSpecialCharacter.bind(this)).join('');\r\n }\r\n\r\n private replaceSpecialCharacter(character: string): string {\r\n if (character.match(CoveoFieldsHandler.nonSpecialCharacters)) {\r\n return character;\r\n } else {\r\n return this.escapeSpecialCharacter(character);\r\n }\r\n }\r\n\r\n private escapeSpecialCharacter(character: string): string {\r\n return `z${character.charCodeAt(0)}x`;\r\n }\r\n}\r\n","import { IFieldTypeResolver, IExternalFieldConfig, ISourceSpecificFieldConfig } from './IFieldTypeResolver';\r\n\r\nexport class SourceSpecificFieldResolver implements IFieldTypeResolver {\r\n private static readonly validFirstCharacters = new RegExp('[a-zA-Z_]');\r\n\r\n constructor(\r\n private sourceSpecificFields: ISourceSpecificFieldConfig[],\r\n private externalFields: IExternalFieldConfig[]\r\n ) {}\r\n\r\n public shouldEscapeFirstCharacter(fieldName: string): boolean {\r\n return !fieldName[0].match(SourceSpecificFieldResolver.validFirstCharacters);\r\n }\r\n\r\n public shouldEscapeSpecialCharacters(fieldName: string): boolean {\r\n return !this.externalFields.some((field) => field.fieldName.toLowerCase() === fieldName.toLowerCase());\r\n }\r\n\r\n public shouldDecorate(fieldName: string): boolean {\r\n return this.sourceSpecificFields.some((field) => field.fieldName.toLowerCase() === fieldName.toLowerCase());\r\n }\r\n\r\n public isExternalField(fieldName: string): boolean {\r\n return this.externalFields.some((field) => field.fieldName.toLowerCase() === fieldName.toLowerCase());\r\n }\r\n}\r\n","export interface ICoveoLabelsHandler {\r\n translate(key: string): string;\r\n}\r\n\r\nexport interface ILabelsDictionary {\r\n [key: string]: string;\r\n}\r\n\r\nexport class CoveoLabelsHandler implements ICoveoLabelsHandler {\r\n constructor(private labels: ILabelsDictionary) {}\r\n\r\n public translate(key: string): string {\r\n return this.labels[key] || key;\r\n }\r\n}\r\n","export interface IPrebindHandler {\r\n (value: string, element: HTMLElement): string;\r\n}\r\n\r\nexport interface IPrebindAttribute {\r\n attribute: string;\r\n attributeValue: any;\r\n method: IPrebindHandler;\r\n}\r\n\r\nexport interface IPrebindResolver {\r\n registerPrebindHelper(helperName: string, handler: IPrebindHandler): void;\r\n hasHelper(helperName: string): boolean;\r\n getHelper(helperName: string): IPrebindHandler;\r\n canApplyPrebind(element: HTMLElement): boolean;\r\n applyToElement(element: HTMLElement): void;\r\n hasNotAppliedPrebind(element: HTMLElement): boolean;\r\n}\r\n\r\nexport class PrebindResolver implements IPrebindResolver {\r\n public static prebindString = 'prebind';\r\n private prebindAppliedValue = 'appliedPrebind';\r\n private helpers: { [helperName: string]: IPrebindHandler } = {};\r\n\r\n public registerPrebindHelper(helperName: string, handler: IPrebindHandler): void {\r\n if (typeof helperName !== 'string' || helperName === '') {\r\n throw 'You must define a name for the prebind helper.';\r\n }\r\n if (typeof handler === 'undefined' || handler === null) {\r\n throw 'You must define a handler for the prebind helper.';\r\n }\r\n if (this.helpers.hasOwnProperty(helperName)) {\r\n console.warn(`A prebind handler already exists for '${helperName}'. It will be ignored`);\r\n return;\r\n }\r\n this.helpers[helperName] = handler;\r\n }\r\n\r\n public hasHelper(helperName: string): boolean {\r\n return this.helpers.hasOwnProperty(helperName);\r\n }\r\n\r\n public getHelper(helperName: string): IPrebindHandler {\r\n if (!this.hasHelper(helperName)) {\r\n throw `'${helperName}' has no registered helper.`;\r\n }\r\n return this.helpers[helperName];\r\n }\r\n\r\n public canApplyPrebind(element: HTMLElement): boolean {\r\n return !!element.dataset;\r\n }\r\n\r\n public hasNotAppliedPrebind(element: HTMLElement): boolean {\r\n return element.dataset[this.prebindAppliedValue] !== 'true';\r\n }\r\n\r\n public applyToElement(element: HTMLElement): void {\r\n try {\r\n const attributes = this.getPrebindingAttributesForElement(element);\r\n if (attributes.length > 0) {\r\n element.dataset[this.prebindAppliedValue] = 'true';\r\n }\r\n attributes.forEach((attributes) => this.applyPrebindToElement(attributes, element));\r\n } catch (exception) {\r\n console.warn('(CoveoForSitecore) prebinding failed on element.', element, exception);\r\n }\r\n }\r\n\r\n private getPrebindingAttributesForElement(element: HTMLElement): IPrebindAttribute[] {\r\n return this.getAllPrebindingAttributesNames(element).map((key) => {\r\n const methodName = element.dataset[key];\r\n const attribute = this.lowerCaseFirstCharacter(this.removePrebindPrefix(key));\r\n return {\r\n attribute: attribute,\r\n attributeValue: element.dataset[attribute] || '',\r\n method: this.getHelper(methodName),\r\n };\r\n });\r\n }\r\n\r\n private getAllPrebindingAttributesNames(element: HTMLElement): string[] {\r\n return Object.keys(element.dataset)\r\n .filter((key) => this.stringStartsWithPrebindingString(key))\r\n .filter((key) => {\r\n const helperName = element.dataset[key];\r\n return this.filterAndWarnNonExistingHelperName(helperName, element);\r\n });\r\n }\r\n\r\n private stringStartsWithPrebindingString(value: string): boolean {\r\n return value.lastIndexOf(PrebindResolver.prebindString) === 0;\r\n }\r\n\r\n private filterAndWarnNonExistingHelperName(helperName: string, element: HTMLElement): boolean {\r\n const hasHelperWithName: boolean = this.hasHelper(helperName);\r\n\r\n if (!hasHelperWithName) {\r\n console.warn(\r\n `(CoveoForSitecore) an unregistered prebinding '${helperName}' was set on the element. Register this method using Prebinding.registerPrebindHelper(\"${helperName}\", handler).`,\r\n element\r\n );\r\n }\r\n\r\n return hasHelperWithName;\r\n }\r\n\r\n private removePrebindPrefix(attributeName: string): string {\r\n return attributeName.substring(PrebindResolver.prebindString.length);\r\n }\r\n\r\n private lowerCaseFirstCharacter(value: string): string {\r\n return value.charAt(0).toLowerCase() + value.slice(1);\r\n }\r\n\r\n private applyPrebindToElement(prebind: IPrebindAttribute, element: HTMLElement): void {\r\n element.dataset[prebind.attribute] = prebind.method(prebind.attributeValue, element);\r\n }\r\n}\r\n","import { Context } from '../../base/Context';\n\nconst CSS_SORT_BOTH_DIRECTIONS = '.CoveoSort[data-sc-enable-both-sort-directions=\"true\"]';\nconst CSS_DROPDOWN_SELECTOR = '.CoveoSortDropdown';\nconst DESCENDING_CRITERIA = 'Descending';\nconst ASCENDING_CRITERIA = 'Ascending';\n\nconst createReversedSortElement = (sortElement: HTMLElement): HTMLElement => {\n const sortElementReverse: HTMLElement = sortElement.cloneNode(false) as HTMLElement;\n const sortCriteria = JSON.parse(sortElementReverse.dataset.sortCriteria);\n\n sortCriteria.direction = sortCriteria.direction === DESCENDING_CRITERIA ? ASCENDING_CRITERIA : DESCENDING_CRITERIA;\n\n sortElementReverse.dataset.sortCriteria = JSON.stringify(sortCriteria);\n\n return sortElementReverse;\n};\n\nconst addDirectionToCaption = (element: HTMLElement): void => {\n const sortCriteria = JSON.parse(element.dataset.sortCriteria);\n\n element.dataset.caption =\n sortCriteria.direction === DESCENDING_CRITERIA\n ? `${element.dataset.caption} ${Context.labels.translate('Descending')}`\n : `${element.dataset.caption} ${Context.labels.translate('Ascending')}`;\n};\n\nconst adjustSortDropdown = (rootElement: HTMLElement): void => {\n const dropdownElement: HTMLElement = rootElement.querySelector(CSS_DROPDOWN_SELECTOR);\n\n if (dropdownElement) {\n for (const sortElement of rootElement.querySelectorAll(CSS_SORT_BOTH_DIRECTIONS) as any) {\n const sortElementReverse: HTMLElement = createReversedSortElement(sortElement);\n\n sortElement.insertAdjacentElement('afterend', sortElementReverse);\n\n addDirectionToCaption(sortElement);\n addDirectionToCaption(sortElementReverse);\n }\n }\n};\n\nexport const adjustDOMElements = (rootElement: HTMLElement): void => {\n adjustSortDropdown(rootElement);\n};\n","import { IPrebindHelper } from './PrebindHelper';\r\n\r\nimport { AnalyticsEnabledPrebind } from './prebindHelpers/AnalyticsEnabled';\r\nimport { CoveoForSitecoreAnalyticsEndpointPrebind } from './prebindHelpers/CoveoForSitecoreAnalyticsEndpoint';\r\nimport { CurrentMaximumAge } from './prebindHelpers/CurrentMaximumAge';\r\nimport { CurrentPageNamePrebind } from './prebindHelpers/CurrentPageName';\r\nimport { FieldTranslatorPrebind } from './prebindHelpers/FieldTranslator';\r\nimport { IsAnonymousPrebind } from './prebindHelpers/IsAnonymous';\r\nimport { MainSearchInterfaceSelectorPrebind } from './prebindHelpers/MainSearchInterfaceSelector';\r\nimport { ItemIdSelectorPrebind } from './prebindHelpers/ItemIdSelector';\r\nimport { SortCriteriaPrebind } from './prebindHelpers/SortCriteria';\r\nimport { UnfoldDictionaryToAttributesPrebind } from './prebindHelpers/UnfoldDictionaryToAttributes';\r\n\r\nexport class PrebindHelpers {\r\n public static getAllPrebindHelpers(): IPrebindHelper[] {\r\n return [\r\n new AnalyticsEnabledPrebind(),\r\n new CoveoForSitecoreAnalyticsEndpointPrebind(),\r\n new CurrentMaximumAge(),\r\n new CurrentPageNamePrebind(),\r\n new FieldTranslatorPrebind(),\r\n new IsAnonymousPrebind(),\r\n new MainSearchInterfaceSelectorPrebind(),\r\n new ItemIdSelectorPrebind(),\r\n new SortCriteriaPrebind(),\r\n new UnfoldDictionaryToAttributesPrebind(),\r\n ];\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class AnalyticsEnabledPrebind implements IPrebindHelper {\r\n public name: string = 'analyticsEnabled';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (currentValue: string, element: HTMLElement) => {\r\n return args.context.scAnalyticsEnabled ? 'true' : 'false';\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class CoveoForSitecoreAnalyticsEndpointPrebind implements IPrebindHelper {\r\n public name: string = 'coveoForSitecoreAnalyticsEndpoint';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (currentValue: string, element: HTMLElement) => {\r\n return currentValue || `${args.context.scRestEndpointUri}/ua`;\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class CurrentMaximumAge implements IPrebindHelper {\r\n public name: string = 'currentMaximumAge';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (value: string, element: HTMLElement) => {\r\n return value || args.context.scMaximumAge.toString();\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class CurrentPageNamePrebind implements IPrebindHelper {\r\n public name: string = 'currentPageName';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (pageName: string, element: HTMLElement) => {\r\n return pageName || args.context.scPageName;\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class FieldTranslatorPrebind implements IPrebindHelper {\r\n public name: string = 'fieldTranslator';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (name: string, element: HTMLElement) => {\r\n return args.fieldsHandler.toCoveo(name);\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class IsAnonymousPrebind implements IPrebindHelper {\r\n public name: string = 'isAnonymous';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (isAnonymous: string, element: HTMLElement) => {\r\n return args.context.scIsUserAnonymous ? 'true' : 'false';\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\nimport {\r\n IItemIdValueResolver,\r\n ResolveIfSelector,\r\n ResolveIfItemIdInPage,\r\n UseItemIdSelectorAsIs,\r\n} from './ItemIdSelector';\r\n\r\nimport { SearchInterface } from 'coveo-search-ui';\r\n\r\nexport class MainSearchInterfaceSelectorPrebind implements IPrebindHelper {\r\n public name: string = 'mainSearchInterfaceSelector';\r\n\r\n private resolvers: IItemIdValueResolver[] = [\r\n new ResolveIfSelector(),\r\n new ResolveIfItemIdInPage(),\r\n new ResolveParentSearchInterfaceId(),\r\n new UseItemIdSelectorAsIs(),\r\n ];\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (mainSearchInterfaceId: string, element: HTMLElement) => {\r\n const resolver: IItemIdValueResolver = this.getFirstValidResolver(mainSearchInterfaceId, element);\r\n\r\n return resolver.getValue(mainSearchInterfaceId, element);\r\n };\r\n }\r\n\r\n private getFirstValidResolver(mainSearchInterfaceId: string, element: HTMLElement): IItemIdValueResolver {\r\n let resolver: IItemIdValueResolver;\r\n\r\n do {\r\n if (this.resolvers.length === 0) {\r\n const message =\r\n 'Could not resolve the search interface element using the current resolver. Ensure that a valid value is set.';\r\n console.error(message, {\r\n mainSearchInterfaceId: mainSearchInterfaceId,\r\n element: element,\r\n });\r\n throw message;\r\n }\r\n resolver = this.resolvers.shift();\r\n } while (!resolver.canResolve(mainSearchInterfaceId, element));\r\n\r\n return resolver;\r\n }\r\n}\r\n\r\nclass ResolveParentSearchInterfaceId implements IItemIdValueResolver {\r\n private foundId: string;\r\n\r\n canResolve(mainSearchInterfaceId: string, element: HTMLElement): boolean {\r\n return this.getValue(mainSearchInterfaceId, element) !== null;\r\n }\r\n\r\n getValue(mainSearchInterfaceId: string, element: HTMLElement): string {\r\n if (typeof this.foundId === 'undefined') {\r\n this.foundId = this.tryFindParentSearchInterfaceFromElement(element);\r\n }\r\n\r\n return this.foundId;\r\n }\r\n\r\n private tryFindParentSearchInterfaceFromElement(element: HTMLElement): string {\r\n const parentSearchInterface = this.findParentWithClass(element, `Coveo${SearchInterface.ID}`);\r\n\r\n return !!parentSearchInterface ? `#${parentSearchInterface.id}` : null;\r\n }\r\n\r\n private findParentWithClass(element: HTMLElement, className: string): HTMLElement {\r\n let parent = element.parentElement;\r\n while ((parent = parent.parentElement) && !parent.classList.contains(className)) {}\r\n return parent;\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\nimport { ISortDirection, SortCriteriaResolver } from '../../sortCriteria/SortCriteriaResolver';\r\n\r\nexport class SortCriteriaPrebind implements IPrebindHelper {\r\n public name: string = 'sortCriteriaResolver';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n const criteriaResolver = new SortCriteriaResolver(args.fieldsHandler);\r\n return (sortCriteriaRawValue: string, element: HTMLElement) => {\r\n const sortCriteria = JSON.parse(sortCriteriaRawValue);\r\n if (Object.keys(sortCriteria).length === 0) {\r\n return null;\r\n }\r\n const sortType = (sortCriteria.type || 'relevancy').toLowerCase();\r\n const sortDirection = (sortCriteria.direction || 'ascending').toLowerCase() as ISortDirection;\r\n const enableBothSortDirections =\r\n (element.dataset['scEnableBothSortDirections'] || 'false').toLowerCase() === 'true';\r\n const sortDropdownElement = document.querySelector('.coveo-sort-section .CoveoSortDropdown');\r\n const enableSortDropdown = document.body.contains(sortDropdownElement);\r\n\r\n if (sortType === 'relevancy') {\r\n return criteriaResolver.resolveRelevancyCriteria();\r\n } else if (sortType === 'date') {\r\n return criteriaResolver.resolveDateCriteria(\r\n sortDirection,\r\n enableBothSortDirections,\r\n enableSortDropdown\r\n );\r\n } else {\r\n const sortField = sortCriteria.field;\r\n return criteriaResolver.resolveFieldCriteria(\r\n sortField,\r\n sortDirection,\r\n enableBothSortDirections,\r\n enableSortDropdown\r\n );\r\n }\r\n };\r\n }\r\n}\r\n","import { ICoveoFieldHandler } from '../../handlers/CoveoFieldsHandler';\r\n\r\nexport type ISortDirection = 'ascending' | 'descending';\r\n\r\nexport class SortCriteriaResolver {\r\n constructor(private fieldsHandler: ICoveoFieldHandler) {}\r\n\r\n resolveFieldCriteria(\r\n fieldCriteria: string,\r\n sortDirection: ISortDirection,\r\n enableBothSortDirections: boolean,\r\n enableSortDropdown: boolean\r\n ): string {\r\n const field = fieldCriteria.charAt(0) !== '@' ? `@${fieldCriteria}` : fieldCriteria;\r\n return this.getFieldCriteria(\r\n this.fieldsHandler.toCoveo(field),\r\n sortDirection,\r\n enableBothSortDirections,\r\n enableSortDropdown\r\n );\r\n }\r\n\r\n resolveDateCriteria(\r\n sortDirection: ISortDirection,\r\n enableBothSortDirections: boolean,\r\n enableSortDropdown: boolean\r\n ): string {\r\n return this.getFieldCriteria('date', sortDirection, enableBothSortDirections, enableSortDropdown);\r\n }\r\n\r\n resolveRelevancyCriteria(): string {\r\n return 'relevancy';\r\n }\r\n\r\n private getFieldCriteria(\r\n fieldCriteria: string,\r\n sortDirection: ISortDirection,\r\n enableBothSortDirections: boolean,\r\n enableSortDropdown: boolean\r\n ): string {\r\n if (enableBothSortDirections && !enableSortDropdown) {\r\n return `${this.getFieldWithDirection(fieldCriteria, sortDirection)}, ${this.getFieldWithDirection(\r\n fieldCriteria,\r\n this.getInvertedDirection(sortDirection)\r\n )}`;\r\n } else {\r\n return this.getFieldWithDirection(fieldCriteria, sortDirection);\r\n }\r\n }\r\n\r\n private getFieldWithDirection(fieldCriteria: string, sortDirection: ISortDirection): string {\r\n return `${fieldCriteria} ${sortDirection}`;\r\n }\r\n\r\n private getInvertedDirection(sortDirection: ISortDirection): ISortDirection {\r\n return sortDirection === 'descending' ? 'ascending' : 'descending';\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class UnfoldDictionaryToAttributesPrebind implements IPrebindHelper {\r\n public name: string = 'unfoldDictionaryToAttributesPrebind';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (rawDictionary: string, element: HTMLElement) => {\r\n const parsedDictionary = JSON.parse(rawDictionary);\r\n Object.keys(parsedDictionary).forEach((key) => {\r\n const translatedField = args.fieldsHandler.toCoveo(key);\r\n const dataKey = 'field' + translatedField.charAt(0).toUpperCase() + translatedField.slice(1);\r\n element.dataset[dataKey] = parsedDictionary[key];\r\n });\r\n return rawDictionary;\r\n };\r\n }\r\n}\r\n","import { SearchEndpoint as CoveoSearchEndpoint } from 'coveo-search-ui';\r\n\r\nexport interface ICoveoForSitecoreEndpointOptions {\r\n restEndpointUri?: string;\r\n itemUri: string;\r\n siteName: string;\r\n}\r\n\r\nexport class SearchEndpoint {\r\n static configureSitecoreEndpoint(options: ICoveoForSitecoreEndpointOptions): void {\r\n if (typeof options === 'undefined') {\r\n throw Error(\"You must define endpoint options when calling 'configureSitecoreEndpoint'.\");\r\n }\r\n\r\n SearchEndpoint.getAccessToken().then((accessToken) => {\r\n SearchEndpoint.initializeEndPoint(options, accessToken);\r\n SearchEndpoint.dispatchInitializationEvent();\r\n });\r\n }\r\n\r\n static initializeEndPoint(options: ICoveoForSitecoreEndpointOptions, accessToken: string): void {\r\n const endpoint = SearchEndpoint.createNewEndpoint(options, accessToken);\r\n CoveoSearchEndpoint.endpoints['default'] = endpoint;\r\n }\r\n\r\n static dispatchInitializationEvent() {\r\n const customEvent = document.createEvent('CustomEvent');\r\n customEvent.initEvent('CoveoSearchEndpointInitialized', false, true);\r\n\r\n if (document.readyState !== 'loading') {\r\n document.dispatchEvent(customEvent);\r\n } else {\r\n document.addEventListener('DOMContentLoaded', () => {\r\n document.dispatchEvent(customEvent);\r\n });\r\n }\r\n }\r\n\r\n static getAccessToken() {\r\n return SearchEndpoint.fetchAccessToken()\r\n .then((response) => {\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n })\r\n .then((data) => data.token)\r\n .catch(() => {\r\n // Returning an empty token delegates error handling of invalid access token to the Coveo Search UI.\r\n return '';\r\n });\r\n }\r\n\r\n static fetchAccessToken() {\r\n return fetch('/coveo/rest/token');\r\n }\r\n\r\n private static createNewEndpoint(\r\n options: ICoveoForSitecoreEndpointOptions,\r\n accessToken: string\r\n ): CoveoSearchEndpoint {\r\n return new CoveoSearchEndpoint({\r\n restUri: options.restEndpointUri ? `${options.restEndpointUri}/search` : '/coveo/rest/search',\r\n queryStringArguments: {\r\n sitecoreItemUri: options.itemUri,\r\n siteName: options.siteName,\r\n },\r\n accessToken: accessToken,\r\n renewAccessToken: SearchEndpoint.getAccessToken,\r\n });\r\n }\r\n}\r\n","import {\r\n ISearchInterfaceComponentInitializer,\r\n getInitializerInstance,\r\n} from '../../resolvers/components/SearchInterfaceComponentInitializer';\r\nimport { ISitecoreExperienceEditor, getExperienceEditorInstance } from './SitecoreExperienceEditor';\r\nimport { SearchInterfacesProvider } from '../../utils/SearchInterfaceProvider';\r\n\r\nimport { SearchInterface, get as getCoveoComponent } from 'coveo-search-ui';\r\n\r\nexport class ExternalComponentInitializer {\r\n private searchInterfacesProvider = new SearchInterfacesProvider();\r\n\r\n constructor(\r\n private experienceEditor: ISitecoreExperienceEditor = getExperienceEditorInstance(),\r\n private searchInterfaceComponentInitializer: ISearchInterfaceComponentInitializer = getInitializerInstance()\r\n ) {}\r\n\r\n public initializeExternalComponentSection(externalComponentsSection: HTMLElement): void {\r\n const searchInterface = this.findSearchInterfaceForSection(externalComponentsSection);\r\n if (!!searchInterface) {\r\n this.searchInterfaceComponentInitializer.loadComponentsWithSearchInterfaceInitialization(\r\n searchInterface,\r\n externalComponentsSection\r\n );\r\n } else {\r\n const getAllSearchInterfaceIds = this.getAllSearchInterfaceIdsInPage();\r\n if (getAllSearchInterfaceIds.length > 0) {\r\n console.error(\r\n `Could not find the search interface element with the following ID: ${this.getSearchInterfaceId(\r\n externalComponentsSection\r\n )}. The following IDs were found: ${getAllSearchInterfaceIds.join(',')}.`,\r\n externalComponentsSection\r\n );\r\n }\r\n }\r\n }\r\n\r\n public initializeExperienceEditorHooksForExternalComponentsSection(externalComponentsSection: HTMLElement): void {\r\n const searchInterface = this.findSearchInterfaceForSection(externalComponentsSection);\r\n if (!!searchInterface) {\r\n this.experienceEditor.registerOnLoadRenderingFromUrl((callbackData) => {\r\n const component = this.experienceEditor.getComponentFromLoadRenderingFromUrlCallbackData(callbackData);\r\n\r\n if (externalComponentsSection.contains(component)) {\r\n this.searchInterfaceComponentInitializer.loadComponentsForSearchInterface(\r\n getCoveoComponent(searchInterface, SearchInterface) as SearchInterface,\r\n component\r\n );\r\n }\r\n });\r\n }\r\n }\r\n\r\n private findSearchInterfaceForSection(externalComponentsSection: HTMLElement): HTMLElement {\r\n const searchInterfaceId = this.getSearchInterfaceId(externalComponentsSection);\r\n const searchInterfaceElement = document.getElementById(searchInterfaceId);\r\n if (!!searchInterfaceElement) {\r\n return searchInterfaceElement;\r\n }\r\n }\r\n\r\n private getSearchInterfaceId(externalComponentsSection: HTMLElement): string {\r\n return externalComponentsSection.dataset.searchInterfaceId;\r\n }\r\n\r\n private getAllSearchInterfaceIdsInPage(): string[] {\r\n return this.searchInterfacesProvider\r\n .getSearchInterfacesInPage(['SearchInterface'])\r\n .map((element) => element.id)\r\n .filter((id) => !!id);\r\n }\r\n}\r\n","import { SearchInterfacesProvider } from '../../utils/SearchInterfaceProvider';\r\nimport { ElementWithContextInitializer } from './ElementWithContextInitializer';\r\n\r\nimport { $$, Dom, get as getCoveoComponents, initSearchbox, InitializationEvents } from 'coveo-search-ui';\r\n\r\nexport class SearchboxInitializer {\r\n private searchInterfacesProvider = new SearchInterfacesProvider();\r\n\r\n async initSearchboxIfStandalone(\r\n searchboxElement: HTMLElement,\r\n searchPageUri?: string,\r\n options?: any\r\n ): Promise {\r\n const searchInterfaces = this.searchInterfacesProvider.getSearchInterfacesInPage([\r\n 'Recommendation',\r\n 'SearchInterface',\r\n ]);\r\n await this.waitForSearchInterfacesInitialization(searchInterfaces);\r\n if (this.searchboxElementIsNotInitialized(searchboxElement)) {\r\n if (!!searchPageUri) {\r\n ElementWithContextInitializer.initializeContextWithinElement(searchboxElement.parentElement);\r\n // coveo-search-ui doesn't like an initSearchbox directly on the searchbox.\r\n initSearchbox(searchboxElement.parentElement, searchPageUri, options);\r\n } else {\r\n console.warn(\r\n `The search box is not included in any search interface and the \"searchPageUri\" parameters is not specified. Consider using a Global Searchbox instead.`,\r\n searchboxElement\r\n );\r\n }\r\n }\r\n }\r\n\r\n private searchboxElementIsNotInitialized(searchBoxElement: HTMLElement): boolean {\r\n return typeof getCoveoComponents(searchBoxElement, Coveo.Searchbox) === 'undefined';\r\n }\r\n\r\n private async waitForSearchInterfacesInitialization(searchInterfaces: HTMLElement[]): Promise {\r\n await Promise.all(this.getAllSearchInterfacesAfterComponentInitialization(searchInterfaces));\r\n }\r\n\r\n private getAllSearchInterfacesAfterComponentInitialization(searchInterfaces: HTMLElement[]): Promise[] {\r\n return searchInterfaces\r\n .map((searchInterface) => $$(searchInterface))\r\n .map((searchInterface) => this.waitForSearchInterfaceInitialization(searchInterface));\r\n }\r\n\r\n private waitForSearchInterfaceInitialization(searchInterface: Dom): Promise {\r\n return new Promise((resolve, reject) => {\r\n if (searchInterface.hasClass('coveo-after-initialization')) {\r\n return resolve();\r\n }\r\n\r\n searchInterface.on(InitializationEvents.afterComponentsInitialization, () => resolve());\r\n });\r\n }\r\n}\r\n","import { initContextOnElement } from '../Initialization';\r\nimport {\r\n ISearchInterfaceComponentInitializer,\r\n getInitializerInstance,\r\n} from '../../resolvers/components/SearchInterfaceComponentInitializer';\r\nimport { ISitecoreExperienceEditor, getExperienceEditorInstance } from './SitecoreExperienceEditor';\r\n\r\nimport { SearchInterface, init } from 'coveo-search-ui';\r\n\r\nexport class SearchInterfaceInitializer {\r\n constructor(\r\n private experienceEditor: ISitecoreExperienceEditor = getExperienceEditorInstance(),\r\n private searchInterfaceComponentInitializer: ISearchInterfaceComponentInitializer = getInitializerInstance()\r\n ) {}\r\n\r\n public initSearchInterface(searchInterface: HTMLElement): Promise<{ elem: HTMLElement }> {\r\n if (!this.experienceEditor.isInBackgroundRendering()) {\r\n this.experienceEditor.registerShowDebugInformationCallback();\r\n initContextOnElement(searchInterface);\r\n const searchInterfacePromise = init(searchInterface);\r\n searchInterfacePromise.then(() => {\r\n const event = document.createEvent('CustomEvent');\r\n event.initEvent('SearchInterfaceInitialized', false, true);\r\n searchInterface.dispatchEvent(event);\r\n });\r\n return searchInterfacePromise;\r\n }\r\n }\r\n\r\n public initializeExperienceEditorHooksForSearchInterface(searchInterface: HTMLElement): void {\r\n this.experienceEditor.registerOnLoadRenderingFromUrl((callbackData) => {\r\n const component = this.experienceEditor.getComponentFromLoadRenderingFromUrlCallbackData(callbackData);\r\n\r\n // Since multiple search interfaces can register event handlers, this ensures that the component is initializing for the correct search interface.\r\n if (searchInterface.contains(component)) {\r\n const searchInterfaceComponent = Coveo.get(searchInterface, Coveo.SearchInterface) as SearchInterface;\r\n this.searchInterfaceComponentInitializer.loadComponentsForSearchInterface(\r\n searchInterfaceComponent,\r\n component\r\n );\r\n }\r\n });\r\n\r\n this.experienceEditor.registerOnAfterPersonalizationChanged((element) => {\r\n if (searchInterface.contains(element)) {\r\n const searchInterfaceComponent = Coveo.get(searchInterface, Coveo.SearchInterface) as SearchInterface;\r\n this.searchInterfaceComponentInitializer.loadComponentsForSearchInterface(\r\n searchInterfaceComponent,\r\n element\r\n );\r\n }\r\n });\r\n\r\n this.experienceEditor.registerBeforeUnloadingChrome((element) => {\r\n if (searchInterface.contains(element)) {\r\n const searchInterfaceComponent = Coveo.get(searchInterface, Coveo.SearchInterface) as SearchInterface;\r\n this.searchInterfaceComponentInitializer.tryUnloadComponentsForSearchInterface(\r\n searchInterfaceComponent,\r\n element\r\n );\r\n }\r\n });\r\n }\r\n}\r\n","export class HostedSearchPageInitializer {\n private searchPageElement: HTMLElement;\n private searchEndpointUri: string;\n private analyticsEndpointUri: string;\n private organizationId: string;\n private searchHub: string;\n private isInExperienceEditor: boolean;\n\n private UNABLE_TO_RETRIEVE_ACCESS_TOKEN = 'Unable to retrieve access token.';\n\n public initializeSearchPage(element: HTMLElement): void {\n this.searchPageElement = element;\n this.searchEndpointUri = element.dataset.searchEndpointUri;\n this.analyticsEndpointUri = element.dataset.analyticsEndpointUri;\n this.organizationId = element.dataset.organizationId;\n this.searchHub = element.dataset.searchHub;\n this.isInExperienceEditor = element.dataset.isInExperienceEditor === 'true';\n\n this.getAccessToken = this.getAccessToken.bind(this);\n\n this.getAccessToken()\n .then((accessToken) => {\n this.initializeCoveo(element, accessToken);\n })\n .catch((err) => {\n if (this.isInExperienceEditor) {\n this.displayErrorMessageInExperienceEditor(err.message);\n }\n });\n }\n\n private async getAccessToken() {\n return this.fetchAccessToken()\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n throw Error(this.UNABLE_TO_RETRIEVE_ACCESS_TOKEN);\n })\n .then((data) => data.token)\n .catch((err) => {\n if (this.isInExperienceEditor) {\n this.displayErrorMessageInExperienceEditor(err.message);\n }\n\n return '';\n });\n }\n\n private initializeCoveo(element: HTMLElement, accessToken: string): void {\n const searchPageRoot: HTMLElement = element.querySelector('.CoveoSearchInterface');\n\n if (searchPageRoot && typeof Coveo !== 'undefined') {\n Coveo.SearchEndpoint.endpoints['default'] = new Coveo.SearchEndpoint({\n restUri: `${this.searchEndpointUri}/rest/search/`,\n accessToken: accessToken,\n queryStringArguments: {\n organizationId: this.organizationId,\n },\n renewAccessToken: this.getAccessToken,\n });\n\n Coveo.Analytics.options.searchHub['defaultValue'] = this.searchHub;\n Coveo.Analytics.options.organization['defaultValue'] = this.organizationId;\n Coveo.Analytics.options.endpoint['defaultValue'] = `${this.analyticsEndpointUri}/rest/ua/`;\n\n Coveo.init(searchPageRoot);\n }\n }\n\n private async fetchAccessToken() {\n return await fetch(`/coveo/rest/token`);\n }\n\n private displayErrorMessageInExperienceEditor(message: string): void {\n const errorMessageElement = `\n ${message}\n `;\n\n this.searchPageElement.insertAdjacentHTML('afterbegin', errorMessageElement);\n }\n}\n","import { SitecorePublicPathUtils } from './utils/SitecorePublicPathUtils';\r\n__webpack_public_path__ = SitecorePublicPathUtils.getDynamicPublicPath();\r\n\r\nexport { CoveoForSitecoreContext } from './ui/context/CoveoForSitecoreContext';\r\n\r\nimport { lazyCoveoForSitecoreAnalytics } from './ui/analytics/LazyCoveoForSitecoreAnalytics';\r\nlazyCoveoForSitecoreAnalytics();\r\nimport { lazyCoveoForSitecoreConfigureSearchHub } from './ui/analytics/LazyCoveoForSitecoreConfigureSearchHub';\r\nlazyCoveoForSitecoreConfigureSearchHub();\r\nimport { lazyCoveoSendAnalyticsToSitecore } from './ui/analytics/LazySendAnalyticsToSitecore';\r\nlazyCoveoSendAnalyticsToSitecore();\r\nimport { lazyValidateAnalyticsIncluded } from './ui/analytics/LazyValidateAnalyticsIncluded';\r\nlazyValidateAnalyticsIncluded();\r\n\r\nimport { lazyCoveoForSitecoreBindWithUserContext } from './ui/context/LazyCoveoForSitecoreBindWithUserContext';\r\nlazyCoveoForSitecoreBindWithUserContext();\r\n\r\nimport { lazyCoveoForSitecoreExpressions } from './ui/scopes/LazyCoveoForSitecoreExpressions';\r\nlazyCoveoForSitecoreExpressions();\r\nimport { lazyCoveoForSitecoreSyntax } from './ui/scopes/LazyCoveoForSitecoreSyntax';\r\nlazyCoveoForSitecoreSyntax();\r\nimport { lazyCoveoForSitecoreRankingExpression } from './ui/scopes/LazyCoveoForSitecoreRankingExpression';\r\nlazyCoveoForSitecoreRankingExpression();\r\nimport { lazyCoveoForSitecoreExternalContent } from './ui/scopes/LazyCoveoForSitecoreExternalContent';\r\nlazyCoveoForSitecoreExternalContent();\r\nimport { lazyCoveoForSitecoreFilterExpression } from './ui/scopes/LazyCoveoForSitecoreFilterExpression';\r\nlazyCoveoForSitecoreFilterExpression();\r\nimport { lazyCoveoForSitecoreLocalExpression } from './ui/scopes/LazyCoveoForSitecoreLocalExpression';\r\nlazyCoveoForSitecoreLocalExpression();\r\n\r\nimport { lazyCoveoGoogleApiPositionProvider } from './ui/distance/LazyGoogleApiPositionProvider';\r\nlazyCoveoGoogleApiPositionProvider();\r\nimport { lazyCoveoNavigatorPositionProvider } from './ui/distance/LazyNavigatorPositionProvider';\r\nlazyCoveoNavigatorPositionProvider();\r\nimport { lazyCoveoStaticPositionProvider } from './ui/distance/LazyStaticPositionProvider';\r\nlazyCoveoStaticPositionProvider();\r\n\r\nexport * from './EventsModules';\r\nexport * from './BaseModules';\r\n\r\nexport * from './base/Initialization';\r\n","import { PublicPathUtils, $$, Logger } from 'coveo-search-ui';\r\nimport { nodeListToArray } from './HTMLUtils';\r\n\r\n/**\r\n * Copied from: https://github.com/coveo/search-ui/blob/master/src/utils/PublicPathUtils.ts\r\n * The only modified part is `getCoveoScript()` which references the .coveo-for-sitecore-script instead of coveo-script.\r\n */\r\nexport class SitecorePublicPathUtils extends PublicPathUtils {\r\n // Overrides the coveo-search-ui implementation to check for our script.\r\n public static getCoveoScript() {\r\n const scriptElements = nodeListToArray(document.querySelectorAll('.coveo-for-sitecore-script')).filter((el) =>\r\n this.isScript(el)\r\n );\r\n if (scriptElements.length !== 0) {\r\n return scriptElements[0];\r\n } else {\r\n // Message is strongly inspired by the one in the coveo-search-ui.\r\n new Logger(this)\r\n .warn(`You should add the class coveo-for-sitecore-script on the script tag that includes the Coveo for Sitecore script. Not doing so may cause the framework to not be able to auto-detect the path to load the lazy chunks in certain environments.\r\n More details here https://docs.coveo.com/en/295/javascript-search-framework/lazy-versus-eager-component-loading#fixing-code-chunks-loading-path-issues`);\r\n // Returning a value so that the original `getDynamicPublicPath` does not warn a second time.\r\n return this.getCurrentScript();\r\n }\r\n }\r\n\r\n private static isScript(el: Element): el is HTMLScriptElement {\r\n return el && $$(el).is('script');\r\n }\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreAnalytics(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreAnalytics', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreAnalytics'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreAnalytics.ts')[\r\n 'CoveoForSitecoreAnalytics'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreAnalytics', resolve),\r\n 'CoveoForSitecoreAnalytics'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreConfigureSearchHub(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreConfigureSearchHub', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreConfigureSearchHub'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreConfigureSearchHub.ts')[\r\n 'CoveoForSitecoreConfigureSearchHub'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreConfigureSearchHub', resolve),\r\n 'CoveoForSitecoreConfigureSearchHub'\r\n );\r\n });\r\n });\r\n}\r\n","import { LazyInitialization, IComponentDefinition } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoSendAnalyticsToSitecore(): void {\r\n LazyInitialization.registerLazyComponent('SendAnalyticsToSitecore', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./SendAnalyticsToSitecore'],\r\n () => {\r\n const loaded = require('./SendAnalyticsToSitecore.ts')[\r\n 'SendAnalyticsToSitecore'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('SendAnalyticsToSitecore', resolve),\r\n 'SendAnalyticsToSitecore'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyValidateAnalyticsIncluded(): void {\r\n LazyInitialization.registerLazyComponent('ValidateAnalyticsIncluded', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./ValidateAnalyticsIncluded'],\r\n () => {\r\n const loaded = require('./ValidateAnalyticsIncluded.ts')[\r\n 'ValidateAnalyticsIncluded'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('ValidateAnalyticsIncluded', resolve),\r\n 'ValidateAnalyticsIncluded'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreBindWithUserContext(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreBindWithUserContext', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreBindWithUserContext'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreBindWithUserContext.ts')[\r\n 'CoveoForSitecoreBindWithUserContext'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreBindWithUserContext', resolve),\r\n 'CoveoForSitecoreBindWithUserContext'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreExpressions(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreExpressions', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreExpressions'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreExpressions.ts')[\r\n 'CoveoForSitecoreExpressions'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreExpressions', resolve),\r\n 'CoveoForSitecoreExpressions'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreSyntax(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreSyntax', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreSyntax'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreSyntax.ts')[\r\n 'CoveoForSitecoreSyntax'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreSyntax', resolve),\r\n 'CoveoForSitecoreSyntax'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreRankingExpression(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreRankingExpression', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreRankingExpression'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreRankingExpression.ts')[\r\n 'CoveoForSitecoreRankingExpression'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreRankingExpression', resolve),\r\n 'CoveoForSitecoreRankingExpression'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreExternalContent(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreExternalContent', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreExternalContent'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreExternalContent.ts')[\r\n 'CoveoForSitecoreExternalContent'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreExternalContent', resolve),\r\n 'CoveoForSitecoreExternalContent'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreFilterExpression(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreFilterExpression', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreFilterExpression'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreFilterExpression.ts')[\r\n 'CoveoForSitecoreFilterExpression'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreFilterExpression', resolve),\r\n 'CoveoForSitecoreFilterExpression'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreLocalExpression(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreLocalExpression', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreLocalExpression'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreLocalExpression.ts')[\r\n 'CoveoForSitecoreLocalExpression'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreLocalExpression', resolve),\r\n 'CoveoForSitecoreLocalExpression'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoGoogleApiPositionProvider(): void {\r\n LazyInitialization.registerLazyComponent('GoogleApiPositionProvider', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./GoogleApiPositionProvider'],\r\n () => {\r\n const loaded = require('./GoogleApiPositionProvider.ts')[\r\n 'GoogleApiPositionProvider'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('GoogleApiPositionProvider', resolve),\r\n 'GoogleApiPositionProvider'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoNavigatorPositionProvider(): void {\r\n LazyInitialization.registerLazyComponent('NavigatorPositionProvider', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./NavigatorPositionProvider'],\r\n () => {\r\n const loaded = require('./NavigatorPositionProvider.ts')[\r\n 'NavigatorPositionProvider'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('NavigatorPositionProvider', resolve),\r\n 'NavigatorPositionProvider'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoStaticPositionProvider(): void {\r\n LazyInitialization.registerLazyComponent('StaticPositionProvider', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./StaticPositionProvider'],\r\n () => {\r\n const loaded = require('./StaticPositionProvider.ts')[\r\n 'StaticPositionProvider'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('StaticPositionProvider', resolve),\r\n 'StaticPositionProvider'\r\n );\r\n });\r\n });\r\n}\r\n"],"sourceRoot":""}