{"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","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","onSitecoreContextInitialization","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","Context","removeAllIDAttributes","removeAttribute","children","querySelectorAll","item","elements","array","cloneNode","registerPrebindHelper","helperName","handler","processor","getHelper","applyPrebindingOnElement","rootElement","canApplyPrebind","hasNotAppliedPrebind","applyToElement","applyPreprocessingToElements","SortCriteriaPreprocessor","adjustDOMElements","applyPrebindingOnChildren","processedElements","nodeListToArray","map","filter","forEach","PrebindResolver","onBuildingSitecoreExternalContent","onBuildingLocalSitecoreInstanceExpression","bindings","ID","onRootElement","InitializationEvents","afterComponentsInitialization","QueryEvents","doneBuildingQuery","OmniboxEvents","buildingQuerySuggest","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","SitecoreContextEvents","buildStringOption","buildJsonOption","buildBooleanOption","scIsUserAnonymous","scMaximumAge","buildNumberOption","Component","Initialization","registerAutoCreateComponent","parseExternalFields","externalField","fieldName","toLowerCase","shouldEscape","isExternalFieldConfig","shouldEscapeFirstCharacter","shouldEscapeSpecialCharacters","field","shouldDecorate","some","isExternalField","obj","LegacyFieldTypeResolver","resolvers","ResolveIfSelector","ResolveIfItemIdInPage","UseItemIdSelectorAsIs","getPrebind","itemId","getFirstValidResolver","getValue","resolver","message","canResolve","ItemIdSelectorPrebind","isItemDefined","isIdSelectorValid","selector","querySelector","isStartingWithSelectorCharacter","firstCharacter","indexOf","initSearchInterface","searchInterfaceElement","searchInterfaceInitializer","initExternalComponentsSection","externalComponentInitializer","initializeExternalComponentSection","SearchInterfaceInitializer","searchboxInitializer","SearchboxInitializer","ExternalComponentInitializer","hostedSearchPageInitializer","HostedSearchPageInitializer","initializeExperienceEditorHooksForSearchInterface","searchBoxElement","searchPageUri","initSearchboxIfStandalone","ElementWithContextInitializer","initializeContextWithinElement","initializeExperienceEditorHooksForExternalComponentsSection","initializeSearchPage","loadComponentsForSearchInterface","searchInterface","newComponent","Prebinding","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","SearchInterfaceComponentInitializer","initializer","staticInstance","isAfterFrameLoadedOverriden","isAfterPersonalizationChangedOverriden","isBeforeUnloadingChromeOverriden","onAfterFrameLoadedCallbacks","onAfterPersonalizationChanged","onBeforeUnloadingChrome","registerOnLoadRenderingFromUrl","onAfterFrameLoadedCallback","tryOverrideSitecoreLoadRenderingFromUrl","registerBeforeUnloadingChrome","onBeforeUnloadingChromeCallback","tryOverrideOnUnloadingChrome","registerOnAfterPersonalizationChanged","tryOverrideSitecoreChromeTypesRenderingChangeCondition","isInBackgroundRendering","location","search","SitecoreExperienceEditor","isInBackgroundRenderingParameterName","getComponentFromLoadRenderingFromUrlCallbackData","callbackData","getElementById","opening","id","nextElementSibling","Sitecore","overrideSitecoreLoadRenderingFromUrl","originalLoad","PageModes","ChromeTypes","Placeholder","insertRendering","frameLoadedCallback","callback","overrideSitecoreChromeChangeCondition","originalChangeCondition","Rendering","changeCondition","onBeforeChangeCondition","changedElement","sender","preserveCacheUpdating","chrome","apply","arguments","overrideSitecoreChromeTypesRenderingChangeCondition","elementToProcessWhenFinished","originalStartActivation","_startActivation","originalEndActivation","_endActivation","getValidMarker","markersAndElements","isDifferentFirstLoadMarker","fieldId","reason","nodeType","Node","TEXT_NODE","registerShowDebugInformationCallback","debugModeEnabled","debugInfoElements","add","ChromeManager","resetChromes","getSearchInterfacesInPage","componentsIds","searchInterfacesSelector","getSearchInterfacesSelectorFromComponentIds","searchInterfaces","componentIds","componentId","computeSelectorForType","join","SearchInterfacesProvider","cloneElementSafelyForAccessibility","SitecoreExpressionEvents","SearchEndpoint","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","insertAdjacentElement","adjustSortDropdown","AnalyticsEnabledPrebind","CoveoForSitecoreAnalyticsEndpointPrebind","CurrentMaximumAge","CurrentPageNamePrebind","FieldTranslatorPrebind","IsAnonymousPrebind","MainSearchInterfaceSelectorPrebind","SortCriteriaPrebind","UnfoldDictionaryToAttributesPrebind","currentValue","toString","pageName","isAnonymous","ResolveParentSearchInterfaceId","mainSearchInterfaceId","foundId","tryFindParentSearchInterfaceFromElement","parentSearchInterface","findParentWithClass","SearchInterface","className","parent","parentElement","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","Date","now","restUri","queryStringArguments","itemUri","renewAccessToken","experienceEditor","searchInterfaceComponentInitializer","getExperienceEditorInstance","getInitializerInstance","searchInterfacesProvider","externalComponentsSection","findSearchInterfaceForSection","getAllSearchInterfaceIds","getAllSearchInterfaceIdsInPage","getSearchInterfaceId","component","searchInterfaceId","searchboxElement","waitForSearchInterfacesInitialization","searchboxElementIsNotInitialized","initSearchbox","Searchbox","getAllSearchInterfacesAfterComponentInitialization","$$","waitForSearchInterfaceInitialization","hasClass","on","initContextOnElement","searchInterfacePromise","init","searchInterfaceComponent","UNABLE_TO_RETRIEVE_ACCESS_TOKEN","searchPageElement","searchEndpointUri","organizationId","searchHub","initializeCoveo","displayErrorMessageInExperienceEditor","searchPageRoot","Analytics","organization","errorMessageElement","insertAdjacentHTML","SitecorePublicPathUtils","getDynamicPublicPath","lazyCoveoForSitecoreAnalytics","lazyCoveoForSitecoreConfigureSearchHub","lazyCoveoSendAnalyticsToSitecore","lazyValidateAnalyticsIncluded","lazyCoveoForSitecoreBindWithUserContext","lazyCoveoForSitecoreExpressions","lazyCoveoForSitecoreSyntax","lazyCoveoForSitecoreRankingExpression","lazyCoveoForSitecoreExternalContent","lazyCoveoForSitecoreFilterExpression","lazyCoveoForSitecoreLocalExpression","lazyCoveoGoogleApiPositionProvider","lazyCoveoNavigatorPositionProvider","lazyCoveoStaticPositionProvider","getCoveoScript","scriptElements","el","isScript","Logger","getCurrentScript","is","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AQ,SAACC,EAASC,GACzB,uBAGQ,IAAM0jB,EAAS,EAA8B,IACR,gCAErC3jB,EAAQ2jB,IACX,oBACD,EAAAF,mBAAmBG,mBAAmB,kCAAmC5jB,Y,0HCbzF,WAEA,gDACI,EAAAyjB,mBAAmBC,sBAAsB,6BAA6B,WAClE,OAAO,IAAI3jB,SAAQ,SAACC,EAASC,GACzB,wBAGQ,IAAM0jB,EAAS,EAA8B,IACd,0BAE/B3jB,EAAQ2jB,IACX,oBACD,EAAAF,mBAAmBG,mBAAmB,4BAA6B5jB,Y,0HCbnF,WAEA,gDACI,EAAAyjB,mBAAmBC,sBAAsB,6BAA6B,WAClE,OAAO,IAAI3jB,SAAQ,SAACC,EAASC,GACzB,wBAGQ,IAAM0jB,EAAS,EAA8B,IACd,0BAE/B3jB,EAAQ2jB,IACX,oBACD,EAAAF,mBAAmBG,mBAAmB,4BAA6B5jB,Y,uHCbnF,WAEA,6CACI,EAAAyjB,mBAAmBC,sBAAsB,0BAA0B,WAC/D,OAAO,IAAI3jB,SAAQ,SAACC,EAASC,GACzB,wBAGQ,IAAM0jB,EAAS,EAA8B,IACjB,uBAE5B3jB,EAAQ2jB,IACX,oBACD,EAAAF,mBAAmBG,mBAAmB,yBAA0B5jB","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 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 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 }\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 fieldName && fieldName !== CoveoFieldsHandler.coveoFieldDelimiter;\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.hasHelper(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';\r\n\r\nconst CSS_SORT_BOTH_DIRECTIONS = '.CoveoSort[data-sc-enable-both-sort-directions=\"true\"]';\r\nconst CSS_DROPDOWN_SELECTOR = '.CoveoSortDropdown';\r\nconst DESCENDING_CRITERIA = 'Descending';\r\nconst ASCENDING_CRITERIA = 'Ascending';\r\n\r\nconst createReversedSortElement = (sortElement: HTMLElement): HTMLElement => {\r\n const sortElementReverse: HTMLElement = sortElement.cloneNode(false) as HTMLElement;\r\n const sortCriteria = JSON.parse(sortElementReverse.dataset.sortCriteria);\r\n\r\n sortCriteria.direction = sortCriteria.direction === DESCENDING_CRITERIA ? ASCENDING_CRITERIA : DESCENDING_CRITERIA;\r\n\r\n sortElementReverse.dataset.sortCriteria = JSON.stringify(sortCriteria);\r\n\r\n return sortElementReverse;\r\n};\r\n\r\nconst addDirectionToCaption = (element: HTMLElement): void => {\r\n const sortCriteria = JSON.parse(element.dataset.sortCriteria);\r\n\r\n element.dataset.caption =\r\n sortCriteria.direction === DESCENDING_CRITERIA\r\n ? `${element.dataset.caption} ${Context.labels.translate('Descending')}`\r\n : `${element.dataset.caption} ${Context.labels.translate('Ascending')}`;\r\n};\r\n\r\nconst adjustSortDropdown = (rootElement: HTMLElement): void => {\r\n const dropdownElement: HTMLElement = rootElement.querySelector(CSS_DROPDOWN_SELECTOR);\r\n\r\n if (dropdownElement) {\r\n for (const sortElement of rootElement.querySelectorAll(CSS_SORT_BOTH_DIRECTIONS) as any) {\r\n const sortElementReverse: HTMLElement = createReversedSortElement(sortElement);\r\n\r\n sortElement.insertAdjacentElement('afterend', sortElementReverse);\r\n\r\n addDirectionToCaption(sortElement);\r\n addDirectionToCaption(sortElementReverse);\r\n }\r\n }\r\n};\r\n\r\nexport const adjustDOMElements = (rootElement: HTMLElement): void => {\r\n adjustSortDropdown(rootElement);\r\n};\r\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.scAnalyticsEndpointUri}`;\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?t=${Date.now()}`);\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 {\r\n private searchPageElement: HTMLElement;\r\n private searchEndpointUri: string;\r\n private analyticsEndpointUri: string;\r\n private organizationId: string;\r\n private searchHub: string;\r\n private isInExperienceEditor: boolean;\r\n\r\n private UNABLE_TO_RETRIEVE_ACCESS_TOKEN = 'Unable to retrieve access token.';\r\n\r\n public initializeSearchPage(element: HTMLElement): void {\r\n this.searchPageElement = element;\r\n this.searchEndpointUri = element.dataset.searchEndpointUri;\r\n this.analyticsEndpointUri = element.dataset.analyticsEndpointUri;\r\n this.organizationId = element.dataset.organizationId;\r\n this.searchHub = element.dataset.searchHub;\r\n this.isInExperienceEditor = element.dataset.isInExperienceEditor === 'true';\r\n\r\n this.getAccessToken = this.getAccessToken.bind(this);\r\n\r\n this.getAccessToken()\r\n .then((accessToken) => {\r\n this.initializeCoveo(element, accessToken);\r\n })\r\n .catch((err) => {\r\n if (this.isInExperienceEditor) {\r\n this.displayErrorMessageInExperienceEditor(err.message);\r\n }\r\n });\r\n }\r\n\r\n private async getAccessToken() {\r\n return this.fetchAccessToken()\r\n .then((response) => {\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n\r\n throw Error(this.UNABLE_TO_RETRIEVE_ACCESS_TOKEN);\r\n })\r\n .then((data) => data.token)\r\n .catch((err) => {\r\n if (this.isInExperienceEditor) {\r\n this.displayErrorMessageInExperienceEditor(err.message);\r\n }\r\n\r\n return '';\r\n });\r\n }\r\n\r\n private initializeCoveo(element: HTMLElement, accessToken: string): void {\r\n const searchPageRoot: HTMLElement = element.querySelector('.CoveoSearchInterface');\r\n\r\n if (searchPageRoot && typeof Coveo !== 'undefined') {\r\n Coveo.SearchEndpoint.endpoints['default'] = new Coveo.SearchEndpoint({\r\n restUri: `${this.searchEndpointUri}/rest/search/`,\r\n accessToken: accessToken,\r\n queryStringArguments: {\r\n organizationId: this.organizationId,\r\n },\r\n renewAccessToken: this.getAccessToken,\r\n });\r\n\r\n Coveo.Analytics.options.searchHub['defaultValue'] = this.searchHub;\r\n Coveo.Analytics.options.organization['defaultValue'] = this.organizationId;\r\n Coveo.Analytics.options.endpoint['defaultValue'] = `${this.analyticsEndpointUri}/rest/ua/`;\r\n\r\n Coveo.init(searchPageRoot);\r\n }\r\n }\r\n\r\n private async fetchAccessToken() {\r\n return await fetch(`/coveo/rest/token?t=${Date.now()}`);\r\n }\r\n\r\n private displayErrorMessageInExperienceEditor(message: string): void {\r\n const errorMessageElement = `\r\n ${message}\r\n `;\r\n\r\n this.searchPageElement.insertAdjacentHTML('afterbegin', errorMessageElement);\r\n }\r\n}\r\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":""}