{"version":3,"sources":["webpack://CoveoForSitecore/webpack/universalModuleDefinition","webpack://CoveoForSitecore/webpack/bootstrap","webpack://CoveoForSitecore/external {\"root\":\"Coveo\",\"commonjs\":\"coveo-search-ui\",\"commonjs2\":\"coveo-search-ui\",\"amd\":\"coveo-search-ui\"}","webpack://CoveoForSitecore/./src/events/ContextEvents.ts","webpack://CoveoForSitecore/./src/base/Context.ts","webpack://CoveoForSitecore/./src/utils/HTMLUtils.ts","webpack://CoveoForSitecore/./src/base/Prebinding.ts","webpack://CoveoForSitecore/./src/events/ExpressionEvents.ts","webpack://CoveoForSitecore/./src/ui/context/CoveoForSitecoreContext.ts","webpack://CoveoForSitecore/./src/handlers/LegacyFieldTypeResolver.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/ItemIdSelector.ts","webpack://CoveoForSitecore/./src/base/Initialization.ts","webpack://CoveoForSitecore/./src/resolvers/components/SearchInterfaceComponentInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/SitecoreExperienceEditor.ts","webpack://CoveoForSitecore/./src/utils/SearchInterfaceProvider.ts","webpack://CoveoForSitecore/./src/base/initialization/ElementWithContextInitializer.ts","webpack://CoveoForSitecore/./src/EventsModules.ts","webpack://CoveoForSitecore/./src/BaseModules.ts","webpack://CoveoForSitecore/./src/base/initialization/ContextInitializer.ts","webpack://CoveoForSitecore/./src/handlers/CoveoFieldsHandler.ts","webpack://CoveoForSitecore/./src/handlers/SourceSpecificFieldResolver.ts","webpack://CoveoForSitecore/./src/handlers/CoveoLabelsHandler.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/PrebindResolver.ts","webpack://CoveoForSitecore/./src/resolvers/sortCriteria/SortCriteriaPreprocessor.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/PrebindHelpers.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/AnalyticsEnabled.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/CoveoForSitecoreAnalyticsEndpoint.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/CurrentMaximumAge.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/CurrentPageName.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/FieldTranslator.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/IsAnonymous.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/MainSearchInterfaceSelector.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/SortCriteria.ts","webpack://CoveoForSitecore/./src/resolvers/sortCriteria/SortCriteriaResolver.ts","webpack://CoveoForSitecore/./src/resolvers/prebinding/prebindHelpers/UnfoldDictionaryToAttributes.ts","webpack://CoveoForSitecore/./src/base/SearchEndpoint.ts","webpack://CoveoForSitecore/./src/base/initialization/ExternalComponentInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/SearchboxInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/SearchInterfaceInitializer.ts","webpack://CoveoForSitecore/./src/base/initialization/HostedSearchPageInitializer.ts","webpack://CoveoForSitecore/./src/LazyEntry.ts","webpack://CoveoForSitecore/./src/utils/SitecorePublicPathUtils.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazyCoveoForSitecoreAnalytics.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazyCoveoForSitecoreConfigureSearchHub.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazySendAnalyticsToSitecore.ts","webpack://CoveoForSitecore/./src/ui/analytics/LazyValidateAnalyticsIncluded.ts","webpack://CoveoForSitecore/./src/ui/context/LazyCoveoForSitecoreBindWithUserContext.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreExpressions.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreSyntax.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreRankingExpression.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreExternalContent.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreFilterExpression.ts","webpack://CoveoForSitecore/./src/ui/scopes/LazyCoveoForSitecoreLocalExpression.ts","webpack://CoveoForSitecore/./src/ui/distance/LazyGoogleApiPositionProvider.ts","webpack://CoveoForSitecore/./src/ui/distance/LazyNavigatorPositionProvider.ts","webpack://CoveoForSitecore/./src/ui/distance/LazyStaticPositionProvider.ts"],"names":["root","factory","exports","module","require","define","amd","window","__WEBPACK_EXTERNAL_MODULE__0__","webpackJsonpCallback","data","moduleId","chunkId","chunkIds","moreModules","i","resolves","length","installedChunks","push","Object","prototype","hasOwnProperty","call","modules","parentJsonpFunction","shift","installedModules","1","__webpack_require__","l","e","promises","installedChunkData","promise","Promise","resolve","reject","onScriptComplete","script","document","createElement","charset","timeout","nc","setAttribute","src","p","2","3","4","5","6","7","8","9","10","11","12","13","14","15","jsonpScriptSrc","event","onerror","onload","clearTimeout","chunk","errorType","type","realSrc","target","error","Error","request","undefined","setTimeout","head","appendChild","all","m","c","d","name","getter","o","defineProperty","enumerable","get","r","Symbol","toStringTag","value","t","mode","__esModule","ns","create","key","bind","n","object","property","oe","err","console","jsonpArray","oldJsonpFunction","slice","s","SitecoreContextEvents","onSitecoreContextInitialization","ContextInitializer_1","CoveoForSitecoreContext_1","coveo_search_ui_1","Context","configureContext","contextElement","options","ComponentOptions","initComponentOptions","CoveoForSitecoreContext","this","initializeWithContextOptions","contextOptions","contextInitializer","ContextInitializer","fieldsHandler","createFieldsHandler","externalFields","scExternalFields","sourceSpecificFields","scSourceSpecificFields","preferSourceSpecificFields","scPreferSourceSpecificFields","prefix","scFieldPrefix","suffix","scFieldSuffix","labels","createLabelsHandler","scLabels","sourceName","scIndexSourceName","initializePrebinding","context","initializeUnderscoreFieldsHelpers","initializeUnderscoreLabelsHelpers","initializeUnderscoreContextHelpers","initializeContextElement","fields","element","removeAllIDAttributes","removeAttribute","children","querySelectorAll","item","nodeListToArray","elements","array","cloneElementSafelyForAccessibility","cloneNode","PrebindResolver_1","SortCriteriaPreprocessor","Prebinding","registerPrebindHelper","helperName","handler","processor","getHelper","applyPrebindingOnElement","rootElement","canApplyPrebind","hasNotAppliedPrebind","applyToElement","applyPreprocessingToElements","adjustDOMElements","applyPrebindingOnChildren","_this","processedElements","map","filter","forEach","PrebindResolver","SitecoreExpressionEvents","onBuildingSitecoreExternalContent","onBuildingLocalSitecoreInstanceExpression","ContextEvents_1","_super","bindings","ID","onRootElement","InitializationEvents","afterComponentsInitialization","QueryEvents","doneBuildingQuery","OmniboxEvents","buildingQuerySuggest","__extends","args","hasDefaultPipelineNameSet","queryBuilderUsesDefaultPipeline","queryBuilder","pipeline","scDefaultPipelineName","querySuggestUsesDefaultPipeline","payload","querySuggestRequest","contextArgs","sitecoreItemId","scItemId","sitecoreItemUri","scItemUri","sitecorePageName","scPageName","shouldHaveAnalyticsComponent","scShouldHaveAnalyticsComponent","analyticsEnabled","scAnalyticsEnabled","indexSourceName","currentLanguage","scCurrentLanguage","languageFieldName","scLanguageFieldName","latestVersionFieldName","scLatestVersionFieldName","isInExperienceEditor","scIsInExperienceEditor","sitecorePageFullPath","scPageNameFullPath","siteName","scSiteName","restEndpointUri","scRestEndpointUri","analyticsEndpointUri","scAnalyticsEndpointUri","trigger","buildStringOption","buildJsonOption","buildBooleanOption","scIsUserAnonymous","scMaximumAge","buildNumberOption","Component","Initialization","registerAutoCreateComponent","LegacyFieldTypeResolver","parseExternalFields","externalField","fieldName","toLowerCase","shouldEscape","isExternalFieldConfig","concat","shouldEscapeFirstCharacter","shouldEscapeSpecialCharacters","field","shouldDecorate","some","isExternalField","obj","ItemIdSelectorPrebind","resolvers","ResolveIfSelector","ResolveIfItemIdInPage","UseItemIdSelectorAsIs","getPrebind","itemId","getFirstValidResolver","getValue","resolver","message","canResolve","isItemDefined","isIdSelectorValid","selector","querySelector","isStartingWithSelectorCharacter","firstCharacter","indexOf","ExternalComponentInitializer_1","SearchboxInitializer_1","SearchInterfaceInitializer_1","ElementWithContextInitializer_1","HostedSearchPageInitializer_1","initSearchInterface","searchInterfaceElement","searchInterfaceInitializer","initExternalComponentsSection","externalComponentInitializer","initializeExternalComponentSection","SearchInterfaceInitializer","searchboxInitializer","SearchboxInitializer","ExternalComponentInitializer","hostedSearchPageInitializer","HostedSearchPageInitializer","initializeSearchInterfaceForExperienceEditor","initializeExperienceEditorHooksForSearchInterface","initSearchboxIfStandalone","searchBoxElement","searchPageUri","initContextOnElement","ElementWithContextInitializer","initializeContextWithinElement","initExternalComponentsSectionForExperienceEditor","initializeExperienceEditorHooksForExternalComponentsSection","initHostedSearchPageInitializer","initializeSearchPage","Prebinding_1","HTMLUtils_1","SearchInterfaceComponentInitializer","loadComponentsForSearchInterface","searchInterface","newComponent","automaticallyCreateComponentsInside","getBindings","initResult","then","removeAllPlaceholdersWithinElement","queryController","executeQuery","ignoreWarningSearchEvent","tryUnloadComponentsForSearchInterface","getElementsByClassName","facet","facetComponent","detachComponent","removeAllChildren","tab","tabComponent","removePlaceholders","classList","remove","contains","removeFacetsPlaceholders","firstChild","removeChild","loadComponentsWithSearchInterfaceInitialization","componentsContainer","Coveo","externalComponents","initializer","getInitializerInstance","staticInstance","SitecoreExperienceEditor","isAfterFrameLoadedOverriden","isAfterPersonalizationChangedOverriden","isBeforeUnloadingChromeOverriden","onAfterFrameLoadedCallbacks","onAfterPersonalizationChanged","onBeforeUnloadingChrome","registerOnLoadRenderingFromUrl","onAfterFrameLoadedCallback","tryOverrideSitecoreLoadRenderingFromUrl","registerBeforeUnloadingChrome","onBeforeUnloadingChromeCallback","tryOverrideOnUnloadingChrome","registerOnAfterPersonalizationChanged","tryOverrideSitecoreChromeTypesRenderingChangeCondition","isInBackgroundRendering","location","search","isInBackgroundRenderingParameterName","getComponentFromLoadRenderingFromUrlCallbackData","callbackData","getElementById","opening","id","nextElementSibling","Sitecore","overrideSitecoreLoadRenderingFromUrl","originalLoad","PageModes","ChromeTypes","Placeholder","insertRendering","frameLoadedCallback","callback","overrideSitecoreChromeChangeCondition","originalChangeCondition","Rendering","changeCondition","sender","preserveCacheUpdating","changedElement","chrome","apply","arguments","overrideSitecoreChromeTypesRenderingChangeCondition","elementToProcessWhenFinished","originalStartActivation","_startActivation","originalEndActivation","_endActivation","markersAndElements","fieldId","isDifferentFirstLoadMarker","getValidMarker","reason","nodeType","Node","TEXT_NODE","registerShowDebugInformationCallback","debugModeEnabled","debugInfoElements","add","ChromeManager","resetChromes","getExperienceEditorInstance","SearchInterfacesProvider","getSearchInterfacesInPage","componentsIds","searchInterfacesSelector","getSearchInterfacesSelectorFromComponentIds","searchInterfaces","componentIds","componentId","computeSelectorForType","join","Context_1","ExpressionEvents_1","SearchEndpoint_1","SearchEndpoint","CoveoFieldsHandler_1","SourceSpecificFieldResolver_1","CoveoLabelsHandler_1","PrebindHelpers_1","LegacyFieldTypeResolver_1","fieldTypeResolver","SourceSpecificFieldResolver","CoveoFieldsHandler","CoveoLabelsHandler","PrebindHelpers","getAllPrebindHelpers","helper","TemplateHelpers","registerTemplateHelper","raw","toCoveo","labelKey","translate","isValidFieldName","lowerCaseFieldName","fieldWithoutDelimiter","stripCoveoFieldDelimiter","escapedCharacterRegex","test","warn","trace","translatedFieldWithoutDelimiter","translateFieldName","startsWithAt","addCoveoFieldDelimiter","fieldNameWithDelimiter","coveoFieldDelimiter","isCoveoFieldName","strippedFieldName","isDecorated","regexString","RegExp","substr","isFieldAlreadyTranslated","replaceSpecialCharacters","replaceFirstCharacter","fieldNameRegex","characters","split","unshift","escapeSpecialCharacter","replaceSpecialCharacter","character","match","nonSpecialCharacters","charCodeAt","nonSpecialCharactersString","validFirstCharacters","prebindAppliedValue","helpers","hasHelper","dataset","attributes","getPrebindingAttributesForElement","applyPrebindToElement","exception","getAllPrebindingAttributesNames","methodName","attribute","lowerCaseFirstCharacter","removePrebindPrefix","attributeValue","method","keys","stringStartsWithPrebindingString","filterAndWarnNonExistingHelperName","lastIndexOf","prebindString","hasHelperWithName","attributeName","substring","charAt","prebind","createReversedSortElement","sortElement","sortElementReverse","sortCriteria","JSON","parse","direction","stringify","addDirectionToCaption","caption","_i","_a","insertAdjacentElement","adjustSortDropdown","AnalyticsEnabled_1","CoveoForSitecoreAnalyticsEndpoint_1","CurrentMaximumAge_1","CurrentPageName_1","FieldTranslator_1","IsAnonymous_1","MainSearchInterfaceSelector_1","ItemIdSelector_1","SortCriteria_1","UnfoldDictionaryToAttributes_1","AnalyticsEnabledPrebind","CoveoForSitecoreAnalyticsEndpointPrebind","CurrentMaximumAge","CurrentPageNamePrebind","FieldTranslatorPrebind","IsAnonymousPrebind","MainSearchInterfaceSelectorPrebind","SortCriteriaPrebind","UnfoldDictionaryToAttributesPrebind","currentValue","toString","pageName","isAnonymous","ResolveParentSearchInterfaceId","mainSearchInterfaceId","foundId","tryFindParentSearchInterfaceFromElement","parentSearchInterface","findParentWithClass","SearchInterface","className","parent","parentElement","SortCriteriaResolver_1","criteriaResolver","SortCriteriaResolver","sortCriteriaRawValue","sortType","sortDirection","enableBothSortDirections","sortDropdownElement","enableSortDropdown","body","resolveRelevancyCriteria","resolveDateCriteria","sortField","resolveFieldCriteria","fieldCriteria","getFieldCriteria","getFieldWithDirection","getInvertedDirection","rawDictionary","parsedDictionary","translatedField","dataKey","toUpperCase","configureSitecoreEndpoint","getAccessToken","accessToken","initializeEndPoint","dispatchInitializationEvent","endpoint","createNewEndpoint","endpoints","customEvent","createEvent","initEvent","readyState","dispatchEvent","addEventListener","fetchAccessToken","response","ok","json","token","catch","fetch","Date","now","restUri","queryStringArguments","itemUri","renewAccessToken","SearchInterfaceComponentInitializer_1","SitecoreExperienceEditor_1","SearchInterfaceProvider_1","experienceEditor","searchInterfaceComponentInitializer","searchInterfacesProvider","externalComponentsSection","findSearchInterfaceForSection","getAllSearchInterfaceIds","getAllSearchInterfaceIdsInPage","getSearchInterfaceId","component","searchInterfaceId","searchboxElement","waitForSearchInterfacesInitialization","sent","searchboxElementIsNotInitialized","initSearchbox","Searchbox","getAllSearchInterfacesAfterComponentInitialization","$$","waitForSearchInterfaceInitialization","hasClass","on","Initialization_1","searchInterfacePromise","init","searchInterfaceComponent","UNABLE_TO_RETRIEVE_ACCESS_TOKEN","searchPageElement","searchEndpointUri","organizationId","searchHub","initializeCoveo","displayErrorMessageInExperienceEditor","searchPageRoot","Analytics","organization","errorMessageElement","insertAdjacentHTML","SitecorePublicPathUtils_1","SitecorePublicPathUtils","getDynamicPublicPath","lazyCoveoForSitecoreAnalytics","lazyCoveoForSitecoreConfigureSearchHub","lazyCoveoSendAnalyticsToSitecore","lazyValidateAnalyticsIncluded","lazyCoveoForSitecoreBindWithUserContext","lazyCoveoForSitecoreExpressions","lazyCoveoForSitecoreSyntax","lazyCoveoForSitecoreRankingExpression","lazyCoveoForSitecoreExternalContent","lazyCoveoForSitecoreFilterExpression","lazyCoveoForSitecoreLocalExpression","lazyCoveoGoogleApiPositionProvider","lazyCoveoNavigatorPositionProvider","lazyCoveoStaticPositionProvider","__exportStar","getCoveoScript","scriptElements","el","isScript","Logger","getCurrentScript","is","PublicPathUtils","LazyInitialization","registerLazyComponent","loaded","buildErrorCallback"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,oBACA,mBAAAC,eAAAC,IACAD,OAAA,oBAAAJ,GACA,iBAAAC,QACAA,QAAA,iBAAAD,EAAAG,QAAA,oBAEAJ,EAAA,iBAAAC,EAAAD,EAAA,OARA,CASCO,OAAA,SAAAC,GACD,mBCTA,SAAAC,EAAAC,GAQA,IAPA,IAMAC,EAAAC,EANAC,EAAAH,EAAA,GACAI,EAAAJ,EAAA,GAKAK,EAAA,EAAAC,EAAA,GACQD,EAAAF,EAAAI,OAAoBF,IAC5BH,EAAAC,EAAAE,GACAG,EAAAN,IACAI,EAAAG,KAAAD,EAAAN,GAAA,IAEAM,EAAAN,GAAA,EAEA,IAAAD,KAAAG,EACAM,OAAAC,UAA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,IAAM6V,EAAS9nB,EAA8B,IACd,0BAE/BO,EAAQunB,IACXxjB,KAAA,KAAAtE,IAAAkjB,MACD7d,EAAAuiB,mBAAmBG,mBAAmB,4BAA6BxnB,oICbnF,IAAA8E,EAAArF,EAAA,GAEA3B,EAAA4oB,mCAAA,WACI5hB,EAAAuiB,mBAAmBC,sBAAsB,4BAA6B,WAClE,OAAO,IAAIvnB,QAAQ,SAACC,EAASC,GACzBR,EAAAE,EAAA,IAAA+R,KAAA,WAGQ,IAAM6V,EAAS9nB,EAA8B,IACd,0BAE/BO,EAAQunB,IACXxjB,KAAA,KAAAtE,IAAAkjB,MACD7d,EAAAuiB,mBAAmBG,mBAAmB,4BAA6BxnB,iICbnF,IAAA8E,EAAArF,EAAA,GAEA3B,EAAA6oB,gCAAA,WACI7hB,EAAAuiB,mBAAmBC,sBAAsB,yBAA0B,WAC/D,OAAO,IAAIvnB,QAAQ,SAACC,EAASC,GACzBR,EAAAE,EAAA,IAAA+R,KAAA,WAGQ,IAAM6V,EAAS9nB,EAA8B,IACjB,uBAE5BO,EAAQunB,IACXxjB,KAAA,KAAAtE,IAAAkjB,MACD7d,EAAAuiB,mBAAmBG,mBAAmB,yBAA0BxnB","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.helpers.hasOwnProperty(helperName)) {\r\n console.warn(`A prebind handler already exists for '${helperName}'. It will be ignored`);\r\n return;\r\n }\r\n this.helpers[helperName] = handler;\r\n }\r\n\r\n public hasHelper(helperName: string): boolean {\r\n return this.helpers.hasOwnProperty(helperName);\r\n }\r\n\r\n public getHelper(helperName: string): IPrebindHandler {\r\n if (!this.hasHelper(helperName)) {\r\n throw `'${helperName}' has no registered helper.`;\r\n }\r\n return this.helpers[helperName];\r\n }\r\n\r\n public canApplyPrebind(element: HTMLElement): boolean {\r\n return !!element.dataset;\r\n }\r\n\r\n public hasNotAppliedPrebind(element: HTMLElement): boolean {\r\n return element.dataset[this.prebindAppliedValue] !== 'true';\r\n }\r\n\r\n public applyToElement(element: HTMLElement): void {\r\n try {\r\n const attributes = this.getPrebindingAttributesForElement(element);\r\n if (attributes.length > 0) {\r\n element.dataset[this.prebindAppliedValue] = 'true';\r\n }\r\n attributes.forEach((attributes) => this.applyPrebindToElement(attributes, element));\r\n } catch (exception) {\r\n console.warn('(CoveoForSitecore) prebinding failed on element.', element, exception);\r\n }\r\n }\r\n\r\n private getPrebindingAttributesForElement(element: HTMLElement): IPrebindAttribute[] {\r\n return this.getAllPrebindingAttributesNames(element).map((key) => {\r\n const methodName = element.dataset[key];\r\n const attribute = this.lowerCaseFirstCharacter(this.removePrebindPrefix(key));\r\n return {\r\n attribute: attribute,\r\n attributeValue: element.dataset[attribute] || '',\r\n method: this.getHelper(methodName),\r\n };\r\n });\r\n }\r\n\r\n private getAllPrebindingAttributesNames(element: HTMLElement): string[] {\r\n return Object.keys(element.dataset)\r\n .filter((key) => this.stringStartsWithPrebindingString(key))\r\n .filter((key) => {\r\n const helperName = element.dataset[key];\r\n return this.filterAndWarnNonExistingHelperName(helperName, element);\r\n });\r\n }\r\n\r\n private stringStartsWithPrebindingString(value: string): boolean {\r\n return value.lastIndexOf(PrebindResolver.prebindString) === 0;\r\n }\r\n\r\n private filterAndWarnNonExistingHelperName(helperName: string, element: HTMLElement): boolean {\r\n const hasHelperWithName: boolean = this.hasHelper(helperName);\r\n\r\n if (!hasHelperWithName) {\r\n console.warn(\r\n `(CoveoForSitecore) an unregistered prebinding '${helperName}' was set on the element. Register this method using Prebinding.registerPrebindHelper(\"${helperName}\", handler).`,\r\n element\r\n );\r\n }\r\n\r\n return hasHelperWithName;\r\n }\r\n\r\n private removePrebindPrefix(attributeName: string): string {\r\n return attributeName.substring(PrebindResolver.prebindString.length);\r\n }\r\n\r\n private lowerCaseFirstCharacter(value: string): string {\r\n return value.charAt(0).toLowerCase() + value.slice(1);\r\n }\r\n\r\n private applyPrebindToElement(prebind: IPrebindAttribute, element: HTMLElement): void {\r\n element.dataset[prebind.attribute] = prebind.method(prebind.attributeValue, element);\r\n }\r\n}\r\n","import { Context } from '../../base/Context';\n\nconst CSS_SORT_BOTH_DIRECTIONS = '.CoveoSort[data-sc-enable-both-sort-directions=\"true\"]';\nconst CSS_DROPDOWN_SELECTOR = '.CoveoSortDropdown';\nconst DESCENDING_CRITERIA = 'Descending';\nconst ASCENDING_CRITERIA = 'Ascending';\n\nconst createReversedSortElement = (sortElement: HTMLElement): HTMLElement => {\n const sortElementReverse: HTMLElement = sortElement.cloneNode(false) as HTMLElement;\n const sortCriteria = JSON.parse(sortElementReverse.dataset.sortCriteria);\n\n sortCriteria.direction = sortCriteria.direction === DESCENDING_CRITERIA ? ASCENDING_CRITERIA : DESCENDING_CRITERIA;\n\n sortElementReverse.dataset.sortCriteria = JSON.stringify(sortCriteria);\n\n return sortElementReverse;\n};\n\nconst addDirectionToCaption = (element: HTMLElement): void => {\n const sortCriteria = JSON.parse(element.dataset.sortCriteria);\n\n element.dataset.caption =\n sortCriteria.direction === DESCENDING_CRITERIA\n ? `${element.dataset.caption} ${Context.labels.translate('Descending')}`\n : `${element.dataset.caption} ${Context.labels.translate('Ascending')}`;\n};\n\nconst adjustSortDropdown = (rootElement: HTMLElement): void => {\n const dropdownElement: HTMLElement = rootElement.querySelector(CSS_DROPDOWN_SELECTOR);\n\n if (dropdownElement) {\n for (const sortElement of rootElement.querySelectorAll(CSS_SORT_BOTH_DIRECTIONS) as any) {\n const sortElementReverse: HTMLElement = createReversedSortElement(sortElement);\n\n sortElement.insertAdjacentElement('afterend', sortElementReverse);\n\n addDirectionToCaption(sortElement);\n addDirectionToCaption(sortElementReverse);\n }\n }\n};\n\nexport const adjustDOMElements = (rootElement: HTMLElement): void => {\n adjustSortDropdown(rootElement);\n};\n","import { IPrebindHelper } from './PrebindHelper';\r\n\r\nimport { AnalyticsEnabledPrebind } from './prebindHelpers/AnalyticsEnabled';\r\nimport { CoveoForSitecoreAnalyticsEndpointPrebind } from './prebindHelpers/CoveoForSitecoreAnalyticsEndpoint';\r\nimport { CurrentMaximumAge } from './prebindHelpers/CurrentMaximumAge';\r\nimport { CurrentPageNamePrebind } from './prebindHelpers/CurrentPageName';\r\nimport { FieldTranslatorPrebind } from './prebindHelpers/FieldTranslator';\r\nimport { IsAnonymousPrebind } from './prebindHelpers/IsAnonymous';\r\nimport { MainSearchInterfaceSelectorPrebind } from './prebindHelpers/MainSearchInterfaceSelector';\r\nimport { ItemIdSelectorPrebind } from './prebindHelpers/ItemIdSelector';\r\nimport { SortCriteriaPrebind } from './prebindHelpers/SortCriteria';\r\nimport { UnfoldDictionaryToAttributesPrebind } from './prebindHelpers/UnfoldDictionaryToAttributes';\r\n\r\nexport class PrebindHelpers {\r\n public static getAllPrebindHelpers(): IPrebindHelper[] {\r\n return [\r\n new AnalyticsEnabledPrebind(),\r\n new CoveoForSitecoreAnalyticsEndpointPrebind(),\r\n new CurrentMaximumAge(),\r\n new CurrentPageNamePrebind(),\r\n new FieldTranslatorPrebind(),\r\n new IsAnonymousPrebind(),\r\n new MainSearchInterfaceSelectorPrebind(),\r\n new ItemIdSelectorPrebind(),\r\n new SortCriteriaPrebind(),\r\n new UnfoldDictionaryToAttributesPrebind(),\r\n ];\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class AnalyticsEnabledPrebind implements IPrebindHelper {\r\n public name: string = 'analyticsEnabled';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (currentValue: string, element: HTMLElement) => {\r\n return args.context.scAnalyticsEnabled ? 'true' : 'false';\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class CoveoForSitecoreAnalyticsEndpointPrebind implements IPrebindHelper {\r\n public name: string = 'coveoForSitecoreAnalyticsEndpoint';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (currentValue: string, element: HTMLElement) => {\r\n return currentValue || `${args.context.scRestEndpointUri}/ua`;\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class CurrentMaximumAge implements IPrebindHelper {\r\n public name: string = 'currentMaximumAge';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (value: string, element: HTMLElement) => {\r\n return value || args.context.scMaximumAge.toString();\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class CurrentPageNamePrebind implements IPrebindHelper {\r\n public name: string = 'currentPageName';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (pageName: string, element: HTMLElement) => {\r\n return pageName || args.context.scPageName;\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class FieldTranslatorPrebind implements IPrebindHelper {\r\n public name: string = 'fieldTranslator';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (name: string, element: HTMLElement) => {\r\n return args.fieldsHandler.toCoveo(name);\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class IsAnonymousPrebind implements IPrebindHelper {\r\n public name: string = 'isAnonymous';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (isAnonymous: string, element: HTMLElement) => {\r\n return args.context.scIsUserAnonymous ? 'true' : 'false';\r\n };\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\nimport {\r\n IItemIdValueResolver,\r\n ResolveIfSelector,\r\n ResolveIfItemIdInPage,\r\n UseItemIdSelectorAsIs,\r\n} from './ItemIdSelector';\r\n\r\nimport { SearchInterface } from 'coveo-search-ui';\r\n\r\nexport class MainSearchInterfaceSelectorPrebind implements IPrebindHelper {\r\n public name: string = 'mainSearchInterfaceSelector';\r\n\r\n private resolvers: IItemIdValueResolver[] = [\r\n new ResolveIfSelector(),\r\n new ResolveIfItemIdInPage(),\r\n new ResolveParentSearchInterfaceId(),\r\n new UseItemIdSelectorAsIs(),\r\n ];\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (mainSearchInterfaceId: string, element: HTMLElement) => {\r\n const resolver: IItemIdValueResolver = this.getFirstValidResolver(mainSearchInterfaceId, element);\r\n\r\n return resolver.getValue(mainSearchInterfaceId, element);\r\n };\r\n }\r\n\r\n private getFirstValidResolver(mainSearchInterfaceId: string, element: HTMLElement): IItemIdValueResolver {\r\n let resolver: IItemIdValueResolver;\r\n\r\n do {\r\n if (this.resolvers.length === 0) {\r\n const message =\r\n 'Could not resolve the search interface element using the current resolver. Ensure that a valid value is set.';\r\n console.error(message, {\r\n mainSearchInterfaceId: mainSearchInterfaceId,\r\n element: element,\r\n });\r\n throw message;\r\n }\r\n resolver = this.resolvers.shift();\r\n } while (!resolver.canResolve(mainSearchInterfaceId, element));\r\n\r\n return resolver;\r\n }\r\n}\r\n\r\nclass ResolveParentSearchInterfaceId implements IItemIdValueResolver {\r\n private foundId: string;\r\n\r\n canResolve(mainSearchInterfaceId: string, element: HTMLElement): boolean {\r\n return this.getValue(mainSearchInterfaceId, element) !== null;\r\n }\r\n\r\n getValue(mainSearchInterfaceId: string, element: HTMLElement): string {\r\n if (typeof this.foundId === 'undefined') {\r\n this.foundId = this.tryFindParentSearchInterfaceFromElement(element);\r\n }\r\n\r\n return this.foundId;\r\n }\r\n\r\n private tryFindParentSearchInterfaceFromElement(element: HTMLElement): string {\r\n const parentSearchInterface = this.findParentWithClass(element, `Coveo${SearchInterface.ID}`);\r\n\r\n return !!parentSearchInterface ? `#${parentSearchInterface.id}` : null;\r\n }\r\n\r\n private findParentWithClass(element: HTMLElement, className: string): HTMLElement {\r\n let parent = element.parentElement;\r\n while ((parent = parent.parentElement) && !parent.classList.contains(className)) {}\r\n return parent;\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\nimport { ISortDirection, SortCriteriaResolver } from '../../sortCriteria/SortCriteriaResolver';\r\n\r\nexport class SortCriteriaPrebind implements IPrebindHelper {\r\n public name: string = 'sortCriteriaResolver';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n const criteriaResolver = new SortCriteriaResolver(args.fieldsHandler);\r\n return (sortCriteriaRawValue: string, element: HTMLElement) => {\r\n const sortCriteria = JSON.parse(sortCriteriaRawValue);\r\n if (Object.keys(sortCriteria).length === 0) {\r\n return null;\r\n }\r\n const sortType = (sortCriteria.type || 'relevancy').toLowerCase();\r\n const sortDirection = (sortCriteria.direction || 'ascending').toLowerCase() as ISortDirection;\r\n const enableBothSortDirections =\r\n (element.dataset['scEnableBothSortDirections'] || 'false').toLowerCase() === 'true';\r\n const sortDropdownElement = document.querySelector('.coveo-sort-section .CoveoSortDropdown');\r\n const enableSortDropdown = document.body.contains(sortDropdownElement);\r\n\r\n if (sortType === 'relevancy') {\r\n return criteriaResolver.resolveRelevancyCriteria();\r\n } else if (sortType === 'date') {\r\n return criteriaResolver.resolveDateCriteria(\r\n sortDirection,\r\n enableBothSortDirections,\r\n enableSortDropdown\r\n );\r\n } else {\r\n const sortField = sortCriteria.field;\r\n return criteriaResolver.resolveFieldCriteria(\r\n sortField,\r\n sortDirection,\r\n enableBothSortDirections,\r\n enableSortDropdown\r\n );\r\n }\r\n };\r\n }\r\n}\r\n","import { ICoveoFieldHandler } from '../../handlers/CoveoFieldsHandler';\r\n\r\nexport type ISortDirection = 'ascending' | 'descending';\r\n\r\nexport class SortCriteriaResolver {\r\n constructor(private fieldsHandler: ICoveoFieldHandler) {}\r\n\r\n resolveFieldCriteria(\r\n fieldCriteria: string,\r\n sortDirection: ISortDirection,\r\n enableBothSortDirections: boolean,\r\n enableSortDropdown: boolean\r\n ): string {\r\n const field = fieldCriteria.charAt(0) !== '@' ? `@${fieldCriteria}` : fieldCriteria;\r\n return this.getFieldCriteria(\r\n this.fieldsHandler.toCoveo(field),\r\n sortDirection,\r\n enableBothSortDirections,\r\n enableSortDropdown\r\n );\r\n }\r\n\r\n resolveDateCriteria(\r\n sortDirection: ISortDirection,\r\n enableBothSortDirections: boolean,\r\n enableSortDropdown: boolean\r\n ): string {\r\n return this.getFieldCriteria('date', sortDirection, enableBothSortDirections, enableSortDropdown);\r\n }\r\n\r\n resolveRelevancyCriteria(): string {\r\n return 'relevancy';\r\n }\r\n\r\n private getFieldCriteria(\r\n fieldCriteria: string,\r\n sortDirection: ISortDirection,\r\n enableBothSortDirections: boolean,\r\n enableSortDropdown: boolean\r\n ): string {\r\n if (enableBothSortDirections && !enableSortDropdown) {\r\n return `${this.getFieldWithDirection(fieldCriteria, sortDirection)}, ${this.getFieldWithDirection(\r\n fieldCriteria,\r\n this.getInvertedDirection(sortDirection)\r\n )}`;\r\n } else {\r\n return this.getFieldWithDirection(fieldCriteria, sortDirection);\r\n }\r\n }\r\n\r\n private getFieldWithDirection(fieldCriteria: string, sortDirection: ISortDirection): string {\r\n return `${fieldCriteria} ${sortDirection}`;\r\n }\r\n\r\n private getInvertedDirection(sortDirection: ISortDirection): ISortDirection {\r\n return sortDirection === 'descending' ? 'ascending' : 'descending';\r\n }\r\n}\r\n","import { IPrebindHelper, IPrebindHelperInitializationArgs } from '../PrebindHelper';\r\nimport { IPrebindHandler } from '../PrebindResolver';\r\n\r\nexport class UnfoldDictionaryToAttributesPrebind implements IPrebindHelper {\r\n public name: string = 'unfoldDictionaryToAttributesPrebind';\r\n\r\n public getPrebind(args: IPrebindHelperInitializationArgs): IPrebindHandler {\r\n return (rawDictionary: string, element: HTMLElement) => {\r\n const parsedDictionary = JSON.parse(rawDictionary);\r\n Object.keys(parsedDictionary).forEach((key) => {\r\n const translatedField = args.fieldsHandler.toCoveo(key);\r\n const dataKey = 'field' + translatedField.charAt(0).toUpperCase() + translatedField.slice(1);\r\n element.dataset[dataKey] = parsedDictionary[key];\r\n });\r\n return rawDictionary;\r\n };\r\n }\r\n}\r\n","import { SearchEndpoint as CoveoSearchEndpoint } from 'coveo-search-ui';\r\n\r\nexport interface ICoveoForSitecoreEndpointOptions {\r\n restEndpointUri?: string;\r\n itemUri: string;\r\n siteName: string;\r\n}\r\n\r\nexport class SearchEndpoint {\r\n static configureSitecoreEndpoint(options: ICoveoForSitecoreEndpointOptions): void {\r\n if (typeof options === 'undefined') {\r\n throw Error(\"You must define endpoint options when calling 'configureSitecoreEndpoint'.\");\r\n }\r\n\r\n SearchEndpoint.getAccessToken().then((accessToken) => {\r\n SearchEndpoint.initializeEndPoint(options, accessToken);\r\n SearchEndpoint.dispatchInitializationEvent();\r\n });\r\n }\r\n\r\n static initializeEndPoint(options: ICoveoForSitecoreEndpointOptions, accessToken: string): void {\r\n const endpoint = SearchEndpoint.createNewEndpoint(options, accessToken);\r\n CoveoSearchEndpoint.endpoints['default'] = endpoint;\r\n }\r\n\r\n static dispatchInitializationEvent() {\r\n const customEvent = document.createEvent('CustomEvent');\r\n customEvent.initEvent('CoveoSearchEndpointInitialized', false, true);\r\n\r\n if (document.readyState !== 'loading') {\r\n document.dispatchEvent(customEvent);\r\n } else {\r\n document.addEventListener('DOMContentLoaded', () => {\r\n document.dispatchEvent(customEvent);\r\n });\r\n }\r\n }\r\n\r\n static getAccessToken() {\r\n return SearchEndpoint.fetchAccessToken()\r\n .then((response) => {\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n })\r\n .then((data) => data.token)\r\n .catch(() => {\r\n // Returning an empty token delegates error handling of invalid access token to the Coveo Search UI.\r\n return '';\r\n });\r\n }\r\n\r\n static fetchAccessToken() {\r\n return fetch(`/coveo/rest/token?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 {\n private searchPageElement: HTMLElement;\n private searchEndpointUri: string;\n private analyticsEndpointUri: string;\n private organizationId: string;\n private searchHub: string;\n private isInExperienceEditor: boolean;\n\n private UNABLE_TO_RETRIEVE_ACCESS_TOKEN = 'Unable to retrieve access token.';\n\n public initializeSearchPage(element: HTMLElement): void {\n this.searchPageElement = element;\n this.searchEndpointUri = element.dataset.searchEndpointUri;\n this.analyticsEndpointUri = element.dataset.analyticsEndpointUri;\n this.organizationId = element.dataset.organizationId;\n this.searchHub = element.dataset.searchHub;\n this.isInExperienceEditor = element.dataset.isInExperienceEditor === 'true';\n\n this.getAccessToken = this.getAccessToken.bind(this);\n\n this.getAccessToken()\n .then((accessToken) => {\n this.initializeCoveo(element, accessToken);\n })\n .catch((err) => {\n if (this.isInExperienceEditor) {\n this.displayErrorMessageInExperienceEditor(err.message);\n }\n });\n }\n\n private async getAccessToken() {\n return this.fetchAccessToken()\n .then((response) => {\n if (response.ok) {\n return response.json();\n }\n\n throw Error(this.UNABLE_TO_RETRIEVE_ACCESS_TOKEN);\n })\n .then((data) => data.token)\n .catch((err) => {\n if (this.isInExperienceEditor) {\n this.displayErrorMessageInExperienceEditor(err.message);\n }\n\n return '';\n });\n }\n\n private initializeCoveo(element: HTMLElement, accessToken: string): void {\n const searchPageRoot: HTMLElement = element.querySelector('.CoveoSearchInterface');\n\n if (searchPageRoot && typeof Coveo !== 'undefined') {\n Coveo.SearchEndpoint.endpoints['default'] = new Coveo.SearchEndpoint({\n restUri: `${this.searchEndpointUri}/rest/search/`,\n accessToken: accessToken,\n queryStringArguments: {\n organizationId: this.organizationId,\n },\n renewAccessToken: this.getAccessToken,\n });\n\n Coveo.Analytics.options.searchHub['defaultValue'] = this.searchHub;\n Coveo.Analytics.options.organization['defaultValue'] = this.organizationId;\n Coveo.Analytics.options.endpoint['defaultValue'] = `${this.analyticsEndpointUri}/rest/ua/`;\n\n Coveo.init(searchPageRoot);\n }\n }\n\n private async fetchAccessToken() {\n return await fetch(`/coveo/rest/token?t=${Date.now()}`);\n }\n\n private displayErrorMessageInExperienceEditor(message: string): void {\n const errorMessageElement = `\n ${message}\n `;\n\n this.searchPageElement.insertAdjacentHTML('afterbegin', errorMessageElement);\n }\n}\n","import { SitecorePublicPathUtils } from './utils/SitecorePublicPathUtils';\r\n__webpack_public_path__ = SitecorePublicPathUtils.getDynamicPublicPath();\r\n\r\nexport { CoveoForSitecoreContext } from './ui/context/CoveoForSitecoreContext';\r\n\r\nimport { lazyCoveoForSitecoreAnalytics } from './ui/analytics/LazyCoveoForSitecoreAnalytics';\r\nlazyCoveoForSitecoreAnalytics();\r\nimport { lazyCoveoForSitecoreConfigureSearchHub } from './ui/analytics/LazyCoveoForSitecoreConfigureSearchHub';\r\nlazyCoveoForSitecoreConfigureSearchHub();\r\nimport { lazyCoveoSendAnalyticsToSitecore } from './ui/analytics/LazySendAnalyticsToSitecore';\r\nlazyCoveoSendAnalyticsToSitecore();\r\nimport { lazyValidateAnalyticsIncluded } from './ui/analytics/LazyValidateAnalyticsIncluded';\r\nlazyValidateAnalyticsIncluded();\r\n\r\nimport { lazyCoveoForSitecoreBindWithUserContext } from './ui/context/LazyCoveoForSitecoreBindWithUserContext';\r\nlazyCoveoForSitecoreBindWithUserContext();\r\n\r\nimport { lazyCoveoForSitecoreExpressions } from './ui/scopes/LazyCoveoForSitecoreExpressions';\r\nlazyCoveoForSitecoreExpressions();\r\nimport { lazyCoveoForSitecoreSyntax } from './ui/scopes/LazyCoveoForSitecoreSyntax';\r\nlazyCoveoForSitecoreSyntax();\r\nimport { lazyCoveoForSitecoreRankingExpression } from './ui/scopes/LazyCoveoForSitecoreRankingExpression';\r\nlazyCoveoForSitecoreRankingExpression();\r\nimport { lazyCoveoForSitecoreExternalContent } from './ui/scopes/LazyCoveoForSitecoreExternalContent';\r\nlazyCoveoForSitecoreExternalContent();\r\nimport { lazyCoveoForSitecoreFilterExpression } from './ui/scopes/LazyCoveoForSitecoreFilterExpression';\r\nlazyCoveoForSitecoreFilterExpression();\r\nimport { lazyCoveoForSitecoreLocalExpression } from './ui/scopes/LazyCoveoForSitecoreLocalExpression';\r\nlazyCoveoForSitecoreLocalExpression();\r\n\r\nimport { lazyCoveoGoogleApiPositionProvider } from './ui/distance/LazyGoogleApiPositionProvider';\r\nlazyCoveoGoogleApiPositionProvider();\r\nimport { lazyCoveoNavigatorPositionProvider } from './ui/distance/LazyNavigatorPositionProvider';\r\nlazyCoveoNavigatorPositionProvider();\r\nimport { lazyCoveoStaticPositionProvider } from './ui/distance/LazyStaticPositionProvider';\r\nlazyCoveoStaticPositionProvider();\r\n\r\nexport * from './EventsModules';\r\nexport * from './BaseModules';\r\n\r\nexport * from './base/Initialization';\r\n","import { PublicPathUtils, $$, Logger } from 'coveo-search-ui';\r\nimport { nodeListToArray } from './HTMLUtils';\r\n\r\n/**\r\n * Copied from: https://github.com/coveo/search-ui/blob/master/src/utils/PublicPathUtils.ts\r\n * The only modified part is `getCoveoScript()` which references the .coveo-for-sitecore-script instead of coveo-script.\r\n */\r\nexport class SitecorePublicPathUtils extends PublicPathUtils {\r\n // Overrides the coveo-search-ui implementation to check for our script.\r\n public static getCoveoScript() {\r\n const scriptElements = nodeListToArray(document.querySelectorAll('.coveo-for-sitecore-script')).filter((el) =>\r\n this.isScript(el)\r\n );\r\n if (scriptElements.length !== 0) {\r\n return scriptElements[0];\r\n } else {\r\n // Message is strongly inspired by the one in the coveo-search-ui.\r\n new Logger(this)\r\n .warn(`You should add the class coveo-for-sitecore-script on the script tag that includes the Coveo for Sitecore script. Not doing so may cause the framework to not be able to auto-detect the path to load the lazy chunks in certain environments.\r\n More details here https://docs.coveo.com/en/295/javascript-search-framework/lazy-versus-eager-component-loading#fixing-code-chunks-loading-path-issues`);\r\n // Returning a value so that the original `getDynamicPublicPath` does not warn a second time.\r\n return this.getCurrentScript();\r\n }\r\n }\r\n\r\n private static isScript(el: Element): el is HTMLScriptElement {\r\n return el && $$(el).is('script');\r\n }\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreAnalytics(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreAnalytics', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreAnalytics'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreAnalytics.ts')[\r\n 'CoveoForSitecoreAnalytics'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreAnalytics', resolve),\r\n 'CoveoForSitecoreAnalytics'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreConfigureSearchHub(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreConfigureSearchHub', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreConfigureSearchHub'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreConfigureSearchHub.ts')[\r\n 'CoveoForSitecoreConfigureSearchHub'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreConfigureSearchHub', resolve),\r\n 'CoveoForSitecoreConfigureSearchHub'\r\n );\r\n });\r\n });\r\n}\r\n","import { LazyInitialization, IComponentDefinition } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoSendAnalyticsToSitecore(): void {\r\n LazyInitialization.registerLazyComponent('SendAnalyticsToSitecore', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./SendAnalyticsToSitecore'],\r\n () => {\r\n const loaded = require('./SendAnalyticsToSitecore.ts')[\r\n 'SendAnalyticsToSitecore'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('SendAnalyticsToSitecore', resolve),\r\n 'SendAnalyticsToSitecore'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyValidateAnalyticsIncluded(): void {\r\n LazyInitialization.registerLazyComponent('ValidateAnalyticsIncluded', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./ValidateAnalyticsIncluded'],\r\n () => {\r\n const loaded = require('./ValidateAnalyticsIncluded.ts')[\r\n 'ValidateAnalyticsIncluded'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('ValidateAnalyticsIncluded', resolve),\r\n 'ValidateAnalyticsIncluded'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreBindWithUserContext(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreBindWithUserContext', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreBindWithUserContext'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreBindWithUserContext.ts')[\r\n 'CoveoForSitecoreBindWithUserContext'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreBindWithUserContext', resolve),\r\n 'CoveoForSitecoreBindWithUserContext'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreExpressions(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreExpressions', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreExpressions'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreExpressions.ts')[\r\n 'CoveoForSitecoreExpressions'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreExpressions', resolve),\r\n 'CoveoForSitecoreExpressions'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreSyntax(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreSyntax', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreSyntax'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreSyntax.ts')[\r\n 'CoveoForSitecoreSyntax'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreSyntax', resolve),\r\n 'CoveoForSitecoreSyntax'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreRankingExpression(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreRankingExpression', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreRankingExpression'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreRankingExpression.ts')[\r\n 'CoveoForSitecoreRankingExpression'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreRankingExpression', resolve),\r\n 'CoveoForSitecoreRankingExpression'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreExternalContent(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreExternalContent', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreExternalContent'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreExternalContent.ts')[\r\n 'CoveoForSitecoreExternalContent'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreExternalContent', resolve),\r\n 'CoveoForSitecoreExternalContent'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreFilterExpression(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreFilterExpression', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreFilterExpression'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreFilterExpression.ts')[\r\n 'CoveoForSitecoreFilterExpression'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreFilterExpression', resolve),\r\n 'CoveoForSitecoreFilterExpression'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoForSitecoreLocalExpression(): void {\r\n LazyInitialization.registerLazyComponent('ForSitecoreLocalExpression', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./CoveoForSitecoreLocalExpression'],\r\n () => {\r\n const loaded = require('./CoveoForSitecoreLocalExpression.ts')[\r\n 'CoveoForSitecoreLocalExpression'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('CoveoForSitecoreLocalExpression', resolve),\r\n 'CoveoForSitecoreLocalExpression'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoGoogleApiPositionProvider(): void {\r\n LazyInitialization.registerLazyComponent('GoogleApiPositionProvider', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./GoogleApiPositionProvider'],\r\n () => {\r\n const loaded = require('./GoogleApiPositionProvider.ts')[\r\n 'GoogleApiPositionProvider'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('GoogleApiPositionProvider', resolve),\r\n 'GoogleApiPositionProvider'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoNavigatorPositionProvider(): void {\r\n LazyInitialization.registerLazyComponent('NavigatorPositionProvider', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./NavigatorPositionProvider'],\r\n () => {\r\n const loaded = require('./NavigatorPositionProvider.ts')[\r\n 'NavigatorPositionProvider'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('NavigatorPositionProvider', resolve),\r\n 'NavigatorPositionProvider'\r\n );\r\n });\r\n });\r\n}\r\n","import { IComponentDefinition, LazyInitialization } from 'coveo-search-ui';\r\n\r\nexport function lazyCoveoStaticPositionProvider(): void {\r\n LazyInitialization.registerLazyComponent('StaticPositionProvider', () => {\r\n return new Promise((resolve, reject) => {\r\n require.ensure(\r\n ['./StaticPositionProvider'],\r\n () => {\r\n const loaded = require('./StaticPositionProvider.ts')[\r\n 'StaticPositionProvider'\r\n ];\r\n resolve(loaded);\r\n },\r\n LazyInitialization.buildErrorCallback('StaticPositionProvider', resolve),\r\n 'StaticPositionProvider'\r\n );\r\n });\r\n });\r\n}\r\n"],"sourceRoot":""}