{"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","trigger","buildStringOption","buildJsonOption","buildBooleanOption","scIsUserAnonymous","scMaximumAge","buildNumberOption","Component","Initialization","registerAutoCreateComponent","LegacyFieldTypeResolver","parseExternalFields","externalField","fieldName","toLowerCase","shouldEscape","isExternalFieldConfig","shouldEscapeFirstCharacter","shouldEscapeSpecialCharacters","field","shouldDecorate","some","isExternalField","obj","ItemIdSelectorPrebind","resolvers","ResolveIfSelector","ResolveIfItemIdInPage","UseItemIdSelectorAsIs","getPrebind","itemId","getFirstValidResolver","getValue","resolver","message","canResolve","isItemDefined","isIdSelectorValid","selector","querySelector","isStartingWithSelectorCharacter","firstCharacter","indexOf","ExternalComponentInitializer_1","SearchboxInitializer_1","SearchInterfaceInitializer_1","ElementWithContextInitializer_1","HostedSearchPageInitializer_1","initSearchInterface","searchInterfaceElement","searchInterfaceInitializer","initExternalComponentsSection","externalComponentInitializer","initializeExternalComponentSection","SearchInterfaceInitializer","searchboxInitializer","SearchboxInitializer","ExternalComponentInitializer","hostedSearchPageInitializer","HostedSearchPageInitializer","initializeSearchInterfaceForExperienceEditor","initializeExperienceEditorHooksForSearchInterface","initSearchboxIfStandalone","searchBoxElement","searchPageUri","initContextOnElement","ElementWithContextInitializer","initializeContextWithinElement","initExternalComponentsSectionForExperienceEditor","initializeExperienceEditorHooksForExternalComponentsSection","initHostedSearchPageInitializer","initializeSearchPage","Prebinding_1","HTMLUtils_1","SearchInterfaceComponentInitializer","loadComponentsForSearchInterface","searchInterface","newComponent","automaticallyCreateComponentsInside","getBindings","initResult","then","removeAllPlaceholdersWithinElement","queryController","executeQuery","ignoreWarningSearchEvent","tryUnloadComponentsForSearchInterface","getElementsByClassName","facet","facetComponent","detachComponent","removeAllChildren","tab","tabComponent","removePlaceholders","classList","remove","contains","removeFacetsPlaceholders","firstChild","removeChild","loadComponentsWithSearchInterfaceInitialization","componentsContainer","Coveo","externalComponents","initializer","getInitializerInstance","SitecoreExperienceEditor","isAfterFrameLoadedOverriden","isAfterPersonalizationChangedOverriden","isBeforeUnloadingChromeOverriden","onAfterFrameLoadedCallbacks","onAfterPersonalizationChanged","onBeforeUnloadingChrome","registerOnLoadRenderingFromUrl","onAfterFrameLoadedCallback","tryOverrideSitecoreLoadRenderingFromUrl","registerBeforeUnloadingChrome","onBeforeUnloadingChromeCallback","tryOverrideOnUnloadingChrome","registerOnAfterPersonalizationChanged","tryOverrideSitecoreChromeTypesRenderingChangeCondition","isInBackgroundRendering","location","search","isInBackgroundRenderingParameterName","getComponentFromLoadRenderingFromUrlCallbackData","callbackData","getElementById","opening","id","nextElementSibling","overrideSitecoreLoadRenderingFromUrl","originalLoad","Sitecore","PageModes","ChromeTypes","Placeholder","insertRendering","frameLoadedCallback","callback","overrideSitecoreChromeChangeCondition","originalChangeCondition","Rendering","changeCondition","sender","preserveCacheUpdating","changedElement","chrome","apply","arguments","overrideSitecoreChromeTypesRenderingChangeCondition","elementToProcessWhenFinished","originalStartActivation","_startActivation","originalEndActivation","_endActivation","markersAndElements","fieldId","isDifferentFirstLoadMarker","getValidMarker","reason","nodeType","Node","TEXT_NODE","registerShowDebugInformationCallback","debugModeEnabled","debugInfoElements","add","ChromeManager","resetChromes","staticInstance","getExperienceEditorInstance","SearchInterfacesProvider","getSearchInterfacesInPage","componentsIds","searchInterfacesSelector","getSearchInterfacesSelectorFromComponentIds","searchInterfaces","componentIds","componentId","computeSelectorForType","join","Context_1","ExpressionEvents_1","SearchEndpoint_1","SearchEndpoint","CoveoFieldsHandler_1","SourceSpecificFieldResolver_1","CoveoLabelsHandler_1","PrebindHelpers_1","LegacyFieldTypeResolver_1","fieldTypeResolver","SourceSpecificFieldResolver","CoveoFieldsHandler","CoveoLabelsHandler","PrebindHelpers","getAllPrebindHelpers","helper","TemplateHelpers","registerTemplateHelper","raw","toCoveo","labelKey","translate","isValidFieldName","lowerCaseFieldName","fieldWithoutDelimiter","stripCoveoFieldDelimiter","escapedCharacterRegex","test","warn","trace","translatedFieldWithoutDelimiter","translateFieldName","startsWithAt","addCoveoFieldDelimiter","fieldNameWithDelimiter","coveoFieldDelimiter","isCoveoFieldName","strippedFieldName","isDecorated","regexString","RegExp","substr","isFieldAlreadyTranslated","replaceSpecialCharacters","replaceFirstCharacter","fieldNameRegex","characters","split","unshift","escapeSpecialCharacter","replaceSpecialCharacter","character","match","nonSpecialCharacters","charCodeAt","nonSpecialCharactersString","validFirstCharacters","prebindAppliedValue","helpers","hasHelper","dataset","attributes","getPrebindingAttributesForElement","applyPrebindToElement","exception","getAllPrebindingAttributesNames","methodName","attribute","lowerCaseFirstCharacter","removePrebindPrefix","attributeValue","method","keys","stringStartsWithPrebindingString","filterAndWarnNonExistingHelperName","lastIndexOf","prebindString","hasHelperWithName","attributeName","substring","charAt","prebind","createReversedSortElement","sortElement","sortElementReverse","sortCriteria","JSON","parse","direction","stringify","addDirectionToCaption","caption","_i","_a","insertAdjacentElement","adjustSortDropdown","AnalyticsEnabled_1","CoveoForSitecoreAnalyticsEndpoint_1","CurrentMaximumAge_1","CurrentPageName_1","FieldTranslator_1","IsAnonymous_1","MainSearchInterfaceSelector_1","ItemIdSelector_1","SortCriteria_1","UnfoldDictionaryToAttributes_1","AnalyticsEnabledPrebind","CoveoForSitecoreAnalyticsEndpointPrebind","CurrentMaximumAge","CurrentPageNamePrebind","FieldTranslatorPrebind","IsAnonymousPrebind","MainSearchInterfaceSelectorPrebind","SortCriteriaPrebind","UnfoldDictionaryToAttributesPrebind","currentValue","toString","pageName","isAnonymous","ResolveParentSearchInterfaceId","mainSearchInterfaceId","foundId","tryFindParentSearchInterfaceFromElement","parentSearchInterface","findParentWithClass","SearchInterface","className","parent","parentElement","SortCriteriaResolver_1","criteriaResolver","SortCriteriaResolver","sortCriteriaRawValue","sortType","sortDirection","enableBothSortDirections","sortDropdownElement","enableSortDropdown","body","resolveRelevancyCriteria","resolveDateCriteria","sortField","resolveFieldCriteria","fieldCriteria","getFieldCriteria","getFieldWithDirection","getInvertedDirection","rawDictionary","parsedDictionary","translatedField","dataKey","toUpperCase","configureSitecoreEndpoint","getAccessToken","accessToken","initializeEndPoint","dispatchInitializationEvent","endpoint","createNewEndpoint","endpoints","createEvent","initEvent","dispatchEvent","fetchAccessToken","response","ok","json","token","catch","fetch","restUri","queryStringArguments","itemUri","renewAccessToken","SearchInterfaceComponentInitializer_1","SitecoreExperienceEditor_1","SearchInterfaceProvider_1","experienceEditor","searchInterfaceComponentInitializer","searchInterfacesProvider","externalComponentsSection","findSearchInterfaceForSection","getAllSearchInterfaceIds","getAllSearchInterfaceIdsInPage","getSearchInterfaceId","component","searchInterfaceId","searchboxElement","waitForSearchInterfacesInitialization","sent","searchboxElementIsNotInitialized","initSearchbox","Searchbox","getAllSearchInterfacesAfterComponentInitialization","$$","waitForSearchInterfaceInitialization","hasClass","on","Initialization_1","searchInterfacePromise","init","done","searchInterfaceComponent","UNABLE_TO_RETRIEVE_ACCESS_TOKEN","searchPageElement","searchEndpointUri","organizationId","searchHub","initializeCoveo","displayErrorMessageInExperienceEditor","searchPageRoot","Analytics","organization","errorMessageElement","insertAdjacentHTML","SitecorePublicPathUtils_1","SitecorePublicPathUtils","getDynamicPublicPath","lazyCoveoForSitecoreAnalytics","lazyCoveoForSitecoreConfigureSearchHub","lazyCoveoSendAnalyticsToSitecore","lazyValidateAnalyticsIncluded","lazyCoveoForSitecoreBindWithUserContext","lazyCoveoForSitecoreExpressions","lazyCoveoForSitecoreSyntax","lazyCoveoForSitecoreRankingExpression","lazyCoveoForSitecoreExternalContent","lazyCoveoForSitecoreFilterExpression","lazyCoveoForSitecoreLocalExpression","lazyCoveoGoogleApiPositionProvider","lazyCoveoNavigatorPositionProvider","lazyCoveoStaticPositionProvider","__export","getCoveoScript","scriptElements","el","isScript","Logger","getCurrentScript","is","PublicPathUtils","LazyInitialization","registerLazyComponent","loaded","buildErrorCallback"],"mappings":"CAAA,SAAAA,EAAAC,GACA,iBAAAC,SAAA,iBAAAC,OACAA,OAAAD,QAAAD,EAAAG,QAAA,oBACA,mBAAAC,eAAAC,IACAD,OAAA,oBAAAJ,GACA,iBAAAC,QACAA,QAAA,iBAAAD,EAAAG,QAAA,oBAEAJ,EAAA,iBAAAC,EAAAD,EAAA,OARA,CASCO,OAAA,SAAAC,GACD,mBCTA,SAAAC,EAAAC,GAQA,IAPA,IAMAC,EAAAC,EANAC,EAAAH,EAAA,GACAI,EAAAJ,EAAA,GAKAK,EAAA,EAAAC,EAAA,GACQD,EAAAF,EAAAI,OAAoBF,IAC5BH,EAAAC,EAAAE,GACAG,EAAAN,IACAI,EAAAG,KAAAD,EAAAN,GAAA,IAEAM,EAAAN,GAAA,EAEA,IAAAD,KAAAG,EACAM,OAAAC,UAAAC,eAAAC,KAAAT,EAAAH,KACAa,EAAAb,GAAAG,EAAAH,IAKA,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A,WACI,IAAMyV,EAASvnB,EAA8B,IAAyE,gCACtHO,EAAQgnB,IACXjjB,KAAA,KAAAtE,IAAA4iB,MAAEvd,EAAAgiB,mBAAmBG,mBAAmB,kCAAmCjnB,wFCXxF,IAAA8E,EAAArF,EAAA,GAKA3B,EAAAooB,mCAAA,WACIphB,EAAAgiB,mBAAmBC,sBAAsB,4BAA6B,WAClE,OAAO,IAAIhnB,QAAQ,SAACC,EAASC,GACzBR,EAAAE,EAAA,IAAA4R,KAAA,WACI,IAAMyV,EAASvnB,EAA8B,IAA6D,0BAC1GO,EAAQgnB,IACXjjB,KAAA,KAAAtE,IAAA4iB,MAAEvd,EAAAgiB,mBAAmBG,mBAAmB,4BAA6BjnB,wFCXlF,IAAA8E,EAAArF,EAAA,GAKA3B,EAAAqoB,mCAAA,WACIrhB,EAAAgiB,mBAAmBC,sBAAsB,4BAA6B,WAClE,OAAO,IAAIhnB,QAAQ,SAACC,EAASC,GACzBR,EAAAE,EAAA,IAAA4R,KAAA,WACI,IAAMyV,EAASvnB,EAA8B,IAA6D,0BAC1GO,EAAQgnB,IACXjjB,KAAA,KAAAtE,IAAA4iB,MAAEvd,EAAAgiB,mBAAmBG,mBAAmB,4BAA6BjnB,wFCXlF,IAAA8E,EAAArF,EAAA,GAKA3B,EAAAsoB,gCAAA,WACIthB,EAAAgiB,mBAAmBC,sBAAsB,yBAA0B,WAC/D,OAAO,IAAIhnB,QAAQ,SAACC,EAASC,GACzBR,EAAAE,EAAA,IAAA4R,KAAA,WACI,IAAMyV,EAASvnB,EAA8B,IAAuD,uBACpGO,EAAQgnB,IACXjjB,KAAA,KAAAtE,IAAA4iB,MAAEvd,EAAAgiB,mBAAmBG,mBAAmB,yBAA0BjnB","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}\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(contextElement, CoveoForSitecoreContext);\r\n this.initializeWithContextOptions(contextElement, options);\r\n }\r\n\r\n private static initializeWithContextOptions(contextElement: HTMLElement, contextOptions: ICoveoForSitecoreContextOptions): 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 {\r\n ExpressionBuilder\r\n} 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 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 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(public element: HTMLElement, public options: ICoveoForSitecoreContextOptions, public bindings: IComponentBindings) {\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 };\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 typeof (obj) !== \"undefined\" &&\r\n typeof (obj.fieldName) !== \"undefined\" &&\r\n typeof (obj.shouldEscape) !== \"undefined\";\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 = \"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) &&\r\n 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 &&\r\n 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\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(searchInterfaceElement: HTMLElement): Promise<{ elem: HTMLElement }> {\r\n searchInterfaceInitializer.initializeExperienceEditorHooksForSearchInterface(searchInterfaceElement);\r\n return initSearchInterface(searchInterfaceElement);\r\n}\r\n\r\nexport function initSearchboxIfStandalone(searchBoxElement: HTMLElement, searchPageUri: string, options?: any): 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}","import { Prebinding } from \"../../base/Prebinding\";\r\nimport { nodeListToArray } from \"../../utils/HTMLUtils\";\r\n\r\nimport {\r\n Initialization,\r\n SearchInterface,\r\n get,\r\n Facet,\r\n Tab\r\n} from \"coveo-search-ui\";\r\n\r\nconst duringInitializationClass = \"coveo-during-initialization\";\r\n\r\nexport class SearchInterfaceComponentInitializer implements ISearchInterfaceComponentInitializer {\r\n public loadComponentsForSearchInterface(searchInterface: SearchInterface, newComponent: HTMLElement): 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(element.getElementsByClassName(duringInitializationClass));\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(searchInterfaceElement: HTMLElement, componentsContainer: HTMLElement): 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(onAfterPersonalizationChanged: IAfterPersonalizationChangedCallback): 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 (frameLoadedCallback: IRenderingElement): 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 (id, sender, preserveCacheUpdating): 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 (markersAndElements: HTMLElement[], fieldId?: string): 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 {\r\n Component\r\n} 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))\r\n .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\";","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 {\r\n TemplateHelpers\r\n} from \"coveo-search-ui\";\r\nimport { LegacyFieldTypeResolver } from \"../../handlers/LegacyFieldTypeResolver\";\r\n\r\nexport interface ICoveoFieldsHandlerOptions {\r\n externalFields: ILegacyExternalFieldConfig[] | IExternalFieldConfig[];\r\n sourceSpecificFields: ISourceSpecificFieldConfig[];\r\n preferSourceSpecificFields: boolean;\r\n prefix: string;\r\n suffix: string;\r\n}\r\n\r\nexport interface ICoveoLabelsHandlerOptions {\r\n labels: ILabelsDictionary;\r\n}\r\n\r\nexport class ContextInitializer {\r\n public createFieldsHandler(options: ICoveoFieldsHandlerOptions): ICoveoFieldHandler {\r\n const externalFields: ILegacyExternalFieldConfig[] | IExternalFieldConfig[] = options.externalFields || [];\r\n const sourceSpecificFields: ISourceSpecificFieldConfig[] = options.sourceSpecificFields || [];\r\n\r\n const fieldTypeResolver: IFieldTypeResolver = options.preferSourceSpecificFields\r\n ? new LegacyFieldTypeResolver(externalFields as ILegacyExternalFieldConfig[])\r\n : new SourceSpecificFieldResolver(sourceSpecificFields, externalFields);\r\n\r\n return new CoveoFieldsHandler(fieldTypeResolver, options.prefix, options.suffix);\r\n }\r\n\r\n public createLabelsHandler(options: ICoveoLabelsHandlerOptions): ICoveoLabelsHandler {\r\n const labels: ILabelsDictionary = options.labels || {};\r\n return new CoveoLabelsHandler(labels);\r\n }\r\n\r\n public initializePrebinding(args: IPrebindHelperInitializationArgs): void {\r\n PrebindHelpers.getAllPrebindHelpers().forEach(helper => {\r\n Prebinding.registerPrebindHelper(helper.name, helper.getPrebind(args));\r\n });\r\n }\r\n\r\n public initializeUnderscoreFieldsHelpers(fieldsHandler: ICoveoFieldHandler): void {\r\n TemplateHelpers.registerTemplateHelper(\"coveoFieldValue\", function (fieldName: string): string {\r\n return this.raw[fieldsHandler.toCoveo(fieldName)];\r\n });\r\n TemplateHelpers.registerTemplateHelper(\"coveoFieldName\", function (fieldName: string): string {\r\n return fieldsHandler.toCoveo(fieldName);\r\n });\r\n }\r\n\r\n public initializeUnderscoreLabelsHelpers(labels: ICoveoLabelsHandler): void {\r\n TemplateHelpers.registerTemplateHelper(\"translateLabel\", function (labelKey: string): string {\r\n return labels.translate(labelKey);\r\n });\r\n }\r\n\r\n public initializeUnderscoreContextHelpers(sourceName: string): void {\r\n TemplateHelpers.registerTemplateHelper(\"currentSourceName\", function (): string {\r\n return sourceName;\r\n });\r\n }\r\n\r\n public initializeContextElement(contextElement: HTMLElement): void {\r\n Prebinding.applyPrebindingOnElement(contextElement);\r\n }\r\n}\r\n","import { IFieldTypeResolver } from \"./IFieldTypeResolver\";\r\nimport { LegacyFieldTypeResolver } from \"./LegacyFieldTypeResolver\";\r\n\r\nexport interface ICoveoFieldHandler {\r\n isCoveoFieldName(fieldName: string): boolean;\r\n toCoveo(fieldName: string): string;\r\n addCoveoFieldDelimiter(fieldName: string): string;\r\n}\r\n\r\nexport interface IExternalFieldConfig {\r\n fieldName: string;\r\n shouldEscape: boolean;\r\n}\r\n\r\nexport class CoveoFieldsHandler implements ICoveoFieldHandler {\r\n // 'z' and 'x' are also considered as special characters because\r\n // they are used in the escaping logic. So we have to remove them\r\n // from the regular expression pattern.\r\n private static readonly nonSpecialCharactersString = \"[a-wyA-WY0-9]\";\r\n private static readonly nonSpecialCharacters = new RegExp(CoveoFieldsHandler.nonSpecialCharactersString);\r\n private static readonly coveoFieldDelimiter = \"@\";\r\n private static readonly fieldNameRegex = new RegExp(\"^[^\\\\W_]*$\");\r\n private static readonly escapedCharacterRegex = new RegExp(\"z\\\\d{2,3}x\");\r\n\r\n private readonly resolver: IFieldTypeResolver;\r\n\r\n constructor(resolver: IFieldTypeResolver, prefix: string, suffix: string);\r\n /**\r\n * @deprecated. Use the `constructor(IFieldTypeResolver, string, string)` constructor instead.\r\n */\r\n constructor(resolver: IExternalFieldConfig[], prefix: string, suffix: string);\r\n constructor(resolver: IExternalFieldConfig[] | IFieldTypeResolver, private prefix: string, private suffix: string) {\r\n if ((resolver).shouldDecorate !== undefined) {\r\n this.resolver = resolver as IFieldTypeResolver;\r\n } else {\r\n // Handle legacy constructor case.\r\n this.resolver = new LegacyFieldTypeResolver(resolver as IExternalFieldConfig[]);\r\n }\r\n }\r\n\r\n public toCoveo(fieldName: string): string {\r\n if (this.isValidFieldName(fieldName)) {\r\n const lowerCaseFieldName = fieldName.toLowerCase();\r\n const fieldWithoutDelimiter = this.stripCoveoFieldDelimiter(lowerCaseFieldName);\r\n if (CoveoFieldsHandler.escapedCharacterRegex.test(fieldWithoutDelimiter)) {\r\n console.warn(`Field name ${fieldName} contains the z\\\\d{2,3}x pattern. Ensure you avoid using this pattern in field names.`);\r\n console.trace();\r\n }\r\n\r\n const translatedFieldWithoutDelimiter = this.translateFieldName(fieldWithoutDelimiter);\r\n return this.startsWithAt(fieldName) ? this.addCoveoFieldDelimiter(translatedFieldWithoutDelimiter) : translatedFieldWithoutDelimiter;\r\n } else {\r\n console.error(`Could not translate the '${fieldName}' field to a Coveo field. Returning as is.`);\r\n return fieldName;\r\n }\r\n }\r\n\r\n public addCoveoFieldDelimiter(fieldName: string): string {\r\n let fieldNameWithDelimiter = fieldName;\r\n if (!this.startsWithAt(fieldName)) {\r\n fieldNameWithDelimiter = `${CoveoFieldsHandler.coveoFieldDelimiter}${fieldName}`.toLowerCase();\r\n }\r\n return fieldNameWithDelimiter;\r\n }\r\n\r\n public isCoveoFieldName(fieldName: string): boolean {\r\n const strippedFieldName = this.stripCoveoFieldDelimiter(fieldName);\r\n return this.resolver.isExternalField(strippedFieldName) || this.isDecorated(strippedFieldName);\r\n }\r\n\r\n private isDecorated(fieldName: string): boolean {\r\n const regexString = this.prefix + \"[\\\\w]+\" + this.suffix;\r\n const coveoFieldNameRegex = new RegExp(regexString);\r\n return coveoFieldNameRegex.test(fieldName);\r\n }\r\n\r\n private isValidFieldName(fieldName: string): boolean {\r\n return typeof (fieldName) !== \"undefined\" && fieldName !== \"\";\r\n }\r\n\r\n private startsWithAt(fieldName: string): boolean {\r\n return fieldName[0] === CoveoFieldsHandler.coveoFieldDelimiter;\r\n }\r\n\r\n private stripCoveoFieldDelimiter(fieldName: string): string {\r\n let field = fieldName;\r\n if (this.startsWithAt(fieldName)) {\r\n field = field.substr(1);\r\n }\r\n return field;\r\n }\r\n\r\n private translateFieldName(fieldName: string): string {\r\n let field = fieldName;\r\n\r\n if (this.resolver.shouldEscapeSpecialCharacters(fieldName) && !this.isFieldAlreadyTranslated(fieldName)) {\r\n field = this.replaceSpecialCharacters(field);\r\n }\r\n if (this.resolver.shouldDecorate(fieldName)) {\r\n field = this.prefix + field + this.suffix;\r\n }\r\n if (this.resolver.shouldEscapeFirstCharacter(field)) {\r\n field = this.replaceFirstCharacter(field);\r\n }\r\n\r\n return field;\r\n }\r\n\r\n // This check was added to avoid fields from being double translated. See SC-4266.\r\n private isFieldAlreadyTranslated(fieldName: string): boolean {\r\n return CoveoFieldsHandler.fieldNameRegex.test(fieldName) && CoveoFieldsHandler.escapedCharacterRegex.test(fieldName);\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(\"\")\r\n .map(this.replaceSpecialCharacter.bind(this))\r\n .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 {\r\n IFieldTypeResolver,\r\n IExternalFieldConfig,\r\n ISourceSpecificFieldConfig\r\n } 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(private sourceSpecificFields: ISourceSpecificFieldConfig[], private externalFields: IExternalFieldConfig[]) {}\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\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(`(CoveoForSitecore) an unregistered prebinding '${helperName}' was set on the element. Register this method using Prebinding.registerPrebindHelper(\"${helperName}\", handler).`, element);\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\n ? ASCENDING_CRITERIA\n : 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 = 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}","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 { IItemIdValueResolver,\r\n ResolveIfSelector,\r\n ResolveIfItemIdInPage,\r\n UseItemIdSelectorAsIs } 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 = \"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 = (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(sortDirection, enableBothSortDirections, enableSortDropdown);\r\n } else {\r\n const sortField = sortCriteria.field;\r\n return criteriaResolver.resolveFieldCriteria(sortField, sortDirection, enableBothSortDirections, enableSortDropdown);\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\r\n resolveFieldCriteria(fieldCriteria: string, sortDirection: ISortDirection, enableBothSortDirections: boolean, enableSortDropdown: boolean): string {\r\n const field = fieldCriteria.charAt(0) !== \"@\" ? `@${fieldCriteria}` : fieldCriteria;\r\n return this.getFieldCriteria(this.fieldsHandler.toCoveo(field), sortDirection, enableBothSortDirections, enableSortDropdown);\r\n }\r\n\r\n resolveDateCriteria(sortDirection: ISortDirection, enableBothSortDirections: boolean, enableSortDropdown: boolean): 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(fieldCriteria: string, sortDirection: ISortDirection, enableBothSortDirections: boolean, enableSortDropdown: boolean): string {\r\n if (enableBothSortDirections && !enableSortDropdown) {\r\n return `${this.getFieldWithDirection(fieldCriteria, sortDirection)}, ${this.getFieldWithDirection(fieldCriteria, this.getInvertedDirection(sortDirection))}`;\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 event = document.createEvent(\"CustomEvent\");\r\n event.initEvent(\"CoveoSearchEndpointInitialized\", false, true);\r\n document.dispatchEvent(event);\r\n }\r\n\r\n static getAccessToken() {\r\n return SearchEndpoint.fetchAccessToken()\r\n .then(response => {\r\n if (response.ok) {\r\n return response.json();\r\n }\r\n })\r\n .then(data => data.token)\r\n .catch(() => {\r\n // Returning an empty token delegates error handling of invalid access token to the Coveo Search UI.\r\n return \"\";\r\n });\r\n }\r\n\r\n static fetchAccessToken() {\r\n return fetch('/coveo/rest/token');\r\n }\r\n\r\n private static createNewEndpoint(options: ICoveoForSitecoreEndpointOptions, accessToken: string): 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 { ISearchInterfaceComponentInitializer, getInitializerInstance } from \"../../resolvers/components/SearchInterfaceComponentInitializer\";\r\nimport { ISitecoreExperienceEditor, getExperienceEditorInstance } from \"./SitecoreExperienceEditor\";\r\nimport { SearchInterfacesProvider } from \"../../utils/SearchInterfaceProvider\";\r\n\r\nimport {\r\n SearchInterface,\r\n get as getCoveoComponent\r\n} from \"coveo-search-ui\";\r\n\r\n\r\nexport class ExternalComponentInitializer {\r\n private searchInterfacesProvider = new SearchInterfacesProvider();\r\n\r\n constructor(private experienceEditor: ISitecoreExperienceEditor = getExperienceEditorInstance(), 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(searchInterface, externalComponentsSection);\r\n } else {\r\n const getAllSearchInterfaceIds = this.getAllSearchInterfaceIdsInPage();\r\n if (getAllSearchInterfaceIds.length > 0) {\r\n console.error(`Could not find the search interface element with the following ID: ${this.getSearchInterfaceId(externalComponentsSection)}. The following IDs were found: ${getAllSearchInterfaceIds.join(\",\")}.`, externalComponentsSection);\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(getCoveoComponent(searchInterface, SearchInterface) as SearchInterface, component);\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 {\r\n $$,\r\n Dom,\r\n get as getCoveoComponents,\r\n initSearchbox,\r\n InitializationEvents\r\n} from \"coveo-search-ui\";\r\n\r\nexport class SearchboxInitializer {\r\n private searchInterfacesProvider = new SearchInterfacesProvider();\r\n\r\n async initSearchboxIfStandalone(searchboxElement: HTMLElement, searchPageUri?: string, options?: any): Promise {\r\n const searchInterfaces = this.searchInterfacesProvider.getSearchInterfacesInPage([\"Recommendation\", \"SearchInterface\"]);\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(`The search box is not included in any search interface and the \"searchPageUri\" parameters is not specified. Consider using a Global Searchbox instead.`, searchboxElement);\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.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 { ISearchInterfaceComponentInitializer, getInitializerInstance } from \"../../resolvers/components/SearchInterfaceComponentInitializer\";\r\nimport { ISitecoreExperienceEditor, getExperienceEditorInstance } from \"./SitecoreExperienceEditor\";\r\n\r\nimport {\r\n SearchInterface,\r\n init\r\n} from \"coveo-search-ui\";\r\n\r\nexport class SearchInterfaceInitializer {\r\n constructor(private experienceEditor: ISitecoreExperienceEditor = getExperienceEditorInstance(), private searchInterfaceComponentInitializer: ISearchInterfaceComponentInitializer = getInitializerInstance()) { }\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.done(() => {\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(searchInterfaceComponent, component);\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(searchInterfaceComponent, element);\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(searchInterfaceComponent, 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 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.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(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(accessToken: string): void {\n const searchPageRoot: HTMLElement = document.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\n Coveo.init(searchPageRoot);\n }\n }\n\n private async fetchAccessToken() {\n return await fetch(`/coveo/rest/token`);\n }\n\n private displayErrorMessageInExperienceEditor(message: string): void {\n const errorMessageElement = `\n ${message}\n `;\n\n this.searchPageElement.insertAdjacentHTML('afterbegin', errorMessageElement);\n }\n}","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 {\r\n PublicPathUtils,\r\n $$,\r\n Logger\r\n} 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 => this.isScript(el));\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}","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreAnalytics\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreAnalytics.ts\")[\"CoveoForSitecoreAnalytics\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreAnalytics\", resolve), \"CoveoForSitecoreAnalytics\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreConfigureSearchHub\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreConfigureSearchHub.ts\")[\"CoveoForSitecoreConfigureSearchHub\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreConfigureSearchHub\", resolve), \"CoveoForSitecoreConfigureSearchHub\");\r\n });\r\n });\r\n}\r\n","import {\r\n LazyInitialization,\r\n IComponentDefinition\r\n} 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([\"./SendAnalyticsToSitecore\"], () => {\r\n const loaded = require(\"./SendAnalyticsToSitecore.ts\")[\"SendAnalyticsToSitecore\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"SendAnalyticsToSitecore\", resolve), \"SendAnalyticsToSitecore\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./ValidateAnalyticsIncluded\"], () => {\r\n const loaded = require(\"./ValidateAnalyticsIncluded.ts\")[\"ValidateAnalyticsIncluded\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"ValidateAnalyticsIncluded\", resolve), \"ValidateAnalyticsIncluded\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreBindWithUserContext\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreBindWithUserContext.ts\")[\"CoveoForSitecoreBindWithUserContext\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreBindWithUserContext\", resolve), \"CoveoForSitecoreBindWithUserContext\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreExpressions\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreExpressions.ts\")[\"CoveoForSitecoreExpressions\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreExpressions\", resolve), \"CoveoForSitecoreExpressions\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreSyntax\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreSyntax.ts\")[\"CoveoForSitecoreSyntax\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreSyntax\", resolve), \"CoveoForSitecoreSyntax\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreRankingExpression\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreRankingExpression.ts\")[\"CoveoForSitecoreRankingExpression\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreRankingExpression\", resolve), \"CoveoForSitecoreRankingExpression\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreExternalContent\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreExternalContent.ts\")[\"CoveoForSitecoreExternalContent\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreExternalContent\", resolve), \"CoveoForSitecoreExternalContent\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreFilterExpression\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreFilterExpression.ts\")[\"CoveoForSitecoreFilterExpression\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreFilterExpression\", resolve), \"CoveoForSitecoreFilterExpression\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./CoveoForSitecoreLocalExpression\"], () => {\r\n const loaded = require(\"./CoveoForSitecoreLocalExpression.ts\")[\"CoveoForSitecoreLocalExpression\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"CoveoForSitecoreLocalExpression\", resolve), \"CoveoForSitecoreLocalExpression\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./GoogleApiPositionProvider\"], () => {\r\n const loaded = require(\"./GoogleApiPositionProvider.ts\")[\"GoogleApiPositionProvider\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"GoogleApiPositionProvider\", resolve), \"GoogleApiPositionProvider\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./NavigatorPositionProvider\"], () => {\r\n const loaded = require(\"./NavigatorPositionProvider.ts\")[\"NavigatorPositionProvider\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"NavigatorPositionProvider\", resolve), \"NavigatorPositionProvider\");\r\n });\r\n });\r\n}\r\n","import {\r\n IComponentDefinition,\r\n LazyInitialization\r\n} 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([\"./StaticPositionProvider\"], () => {\r\n const loaded = require(\"./StaticPositionProvider.ts\")[\"StaticPositionProvider\"];\r\n resolve(loaded);\r\n }, LazyInitialization.buildErrorCallback(\"StaticPositionProvider\", resolve), \"StaticPositionProvider\");\r\n });\r\n });\r\n}\r\n"],"sourceRoot":""}