@coveo/quantic 3.43.0 → 3.43.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (17) hide show
  1. package/force-app/main/default/lwc/quanticGeneratedAnswer/__tests__/quanticGeneratedAnswer.test.js +145 -60
  2. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture-agent.ts +3 -3
  3. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/fixture.ts +12 -9
  4. package/force-app/main/default/lwc/quanticGeneratedAnswer/e2e/pageObject.ts +5 -8
  5. package/force-app/main/default/lwc/quanticGeneratedAnswer/quanticGeneratedAnswer.js +12 -108
  6. package/force-app/main/default/lwc/quanticGeneratedAnswer/templates/generatedAnswer.html +8 -47
  7. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/__tests__/quanticGeneratedAnswerContent.test.js +27 -0
  8. package/force-app/main/default/lwc/quanticGeneratedAnswerContent/quanticGeneratedAnswerContent.js +8 -1
  9. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.css +16 -4
  10. package/force-app/main/default/lwc/quanticGeneratedAnswerThread/quanticGeneratedAnswerThread.html +12 -16
  11. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.css +29 -11
  12. package/force-app/main/default/lwc/quanticThreadItem/quanticThreadItem.html +11 -15
  13. package/force-app/main/default/staticresources/coveoheadless/case-assist/headless.js +2 -2
  14. package/force-app/main/default/staticresources/coveoheadless/headless.js +2 -2
  15. package/force-app/main/default/staticresources/coveoheadless/insight/headless.js +2 -2
  16. package/force-app/main/default/staticresources/coveoheadless/recommendation/headless.js +2 -2
  17. package/package.json +3 -2
@@ -29,7 +29,7 @@ ${g}`:g;break;case"event":n.event=g;break;case"id":e(n.id=g);break;case"retry":v
29
29
  We've detected you're using React Native but have not provided the corresponding runtime,
30
30
  for an optimal experience please use the "coveo.analytics/react-native" subpackage.
31
31
  Follow the Readme on how to set it up: https://github.com/coveo/coveo.analytics.js#using-react-native
32
- `;function rM(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var nM=["1",1,"yes",!0];function ip(){let e=[];return DS()&&e.push(window.doNotTrack),WS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>nM.indexOf(t)!==-1)}var Sw="v15",vw={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function oM(e=vw.default,t=Sw,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var aM="38824e1f-37f5-42d3-8372-a4b8fa9df946",en=class{get defaultOptions(){return{endpoint:vw.default,isCustomEndpoint:!1,token:"",version:Sw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return mw}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[zD,QD].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};ip()?this.runtime=new ap:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(_e.view,{newEventType:_e.view,addClientIdParameter:!0}),this.addEventTypeMapping(_e.click,{newEventType:_e.click,addClientIdParameter:!0}),this.addEventTypeMapping(_e.custom,{newEventType:_e.custom,addClientIdParameter:!0}),this.addEventTypeMapping(_e.search,{newEventType:_e.search,addClientIdParameter:!0})}initRuntime(t){return DS()&&Hi()?new HS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(rM()&&console.warn(tM),new zS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return DS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(tp(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(tw(t,tw(r,aM)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(ip())return null;try{let r=new URL(t).searchParams.get(Co.cvo_cid);if(r==null)return null;let n=Co.fromString(r);return!n||!Hi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>Q(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>a?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((C,b)=>Q(this,void 0,void 0,function*(){let w=yield C;return yield b(t,w)}),y)].reduce((y,C)=>Q(this,void 0,void 0,function*(){let b=yield y;return yield C(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?$q(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,x)=>Q(this,void 0,void 0,function*(){let y=yield v;return yield x(y)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ep().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Wn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Wn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return Q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Wn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(this,void 0,void 0,function*(){return yield(yield S(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[_e.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Kq(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=Wn(t,["custom"]),o={};r&&Zd(r)&&(o=this.lowercaseKeys(r));let a=Yq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Wn(t,["custom"]);if(r&&Zd(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=Wn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==_e.view||r==_e.click||r==_e.search||r==_e.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==_e.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=Wn(t,["userId"]);return eM(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Wn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Zd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Zd(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?cq(t,r):t}get baseUrl(){return oM(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Kn;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(Kn||(Kn={}));var $;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var cw={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Kn.expandToFullUI]:"interface",[Kn.openUserActions]:"User Actions",[Kn.showPrecedingSessions]:"User Actions",[Kn.showFollowingSessions]:"User Actions",[Kn.clickViewedDocument]:"User Actions",[Kn.clickPageView]:"User Actions",[Kn.createArticle]:"createArticle"},Ki=class{constructor(){this.runtime=new ap,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(_e.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(_e.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(_e.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(_e.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return mw}};function iM(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function sM(e){return e.map(t=>t.replace(/;/g,""))}function Aw(e){let r=e.join(";");return r.length<=256?r:Aw(e.slice(1))}var uw=e=>{let t=sM(e),r=iM(t);return Aw(r)};function lw(e){let t=typeof e.partialQueries=="string"?e.partialQueries:uw(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:uw(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var sp=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||ip();this.coveoAnalyticsClient=n?new Ki:new en(t)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new en(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,lw(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,lw(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return Q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=cw[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=cw[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof en?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},cp=Object.assign({},tl),dw=Object.keys(cp).map(e=>cp[e]),zi=class extends VS{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>dw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(dw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(cp.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(cp.event,{newEventType:_e.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return fq(this.ticket)}};zi.Id="svc";var up;(function(e){e.click="click",e.flowStart="flowStart"})(up||(up={}));var yr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(yr||(yr={}));var lp;(function(e){e.quit="Quit",e.solved="Solved"})(lp||(lp={}));var dp=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!ip();this.coveoAnalyticsClient=o?new en(t):new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new en(this.options),this.svc=new zi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(yr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(yr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(yr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(yr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(yr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(yr.caseCancelled,{reason:lp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(yr.caseSolved,{reason:lp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(yr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof en?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var xo=()=>"default";var cM=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Ca=class{constructor(t){de(this,"getState",t);de(this,"state");this.state=t()}getLanguage(){return cM(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||xo()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var Cw=e=>new en(e).getCurrentVisitorId(),ol=(e,t)=>typeof t=="function"?(...r)=>{let n=ku(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,al=(e,t)=>(...r)=>{let n=ku(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var il=class extends Ca{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},xw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new il(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??gr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new dp({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:ol(e,n),beforeSendHooks:[al(e,r),(v,x)=>(e.info({...x,type:v,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Yi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function uM(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),pp=(e,t)=>e.facetSet[t]?.request,Ji=(e,t)=>{let r=Lr(e,t);return uM(e,r)?r:void 0},bw=(e,t)=>Ji(e,t)?.values.filter(r=>r.state==="selected")||[],ww=(e,t)=>Ji(e,t)?.values.filter(r=>r.state!=="idle")||[],tn=e=>e.search.isLoading;d();c();l();u();function Rw(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function cr(e){let{activeValue:t,ancestryMap:r}=lM(e);return t?dM(t,r):[]}function lM(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function dM(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function pM(e,t){return!!t&&t.facetId in e.categoryFacetSet}var JS=(e,t)=>{let r=Lr(e,t);if(pM(e,r))return r},XS=(e,t)=>e.categoryFacetSet[t]?.request,Fw=(e,t)=>{let r=JS(e,t);return cr(r?.values??[])},ZS=(e,t)=>{let r=XS(e,t);return cr(r?.currentValues??[])};d();c();l();u();function Xi(){return{}}d();c();l();u();function Ew(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();l();u();function Iw(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();l();u();function Tw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ts(){return{}}var rs=(e,t)=>{let r=_w(t,e),n=r?r.field:"",o=tv(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ns(e,t){let{facetId:r,facetValue:n}=e,o=rs(r,t),a=Nw(t,r);return{...o,facetValue:a==="hierarchical"?Ow(t,r):n}}function ur(e){return{facetSet:e.facetSet??ts(),categoryFacetSet:e.categoryFacetSet??Xi(),dateFacetSet:e.dateFacetSet??Zi(),numericFacetSet:e.numericFacetSet??es(),automaticFacetSet:e.automaticFacetSet??Yi()}}var ev=e=>{let t=[];return gM(e).forEach((r,n)=>{let o=Nw(e,r.facetId),a=AM(r,n+1);if(mM(r)){if(!!!ZS(e,r.facetId).length)return;t.push({...a,...SM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Pw(i,p+1,o),m=fM(r)?kw(i):yM(i);t.push({...a,...f,...m})})}),hM(e).forEach((r,n)=>{let o=vM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Pw(a,i+1,"specific"),f=kw(a);t.push({...o,...p,...f})})}),t},fM=e=>e.type==="specific",mM=e=>e.type==="hierarchical",gM=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),hM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Pw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),yM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),kw=e=>({displayValue:e.value,value:e.value}),Ow=(e,t)=>ZS(e,t).map(n=>n.value).join(";"),SM=(e,t)=>{let n=Ow(e,t);return{value:n,valuePosition:1,displayValue:n}},vM=(e,t)=>({title:tv(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),AM=(e,t)=>({title:tv(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),tv=(e,t)=>`${e}_${t}`,_w=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Nw=(e,t)=>{let r=_w(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var rv=e=>e.configuration.search.locale,Dw=e=>e.configuration.search.timezone,fp=e=>e.configuration.accessToken,mp=e=>e.configuration.organizationId,gp=e=>e.configuration.environment,hp=e=>e.configuration?.knowledge?.agentId,qw=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(CM(e)||nv(e))return e.generatedAnswer?.answerId;if(xM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},CM=e=>"answer"in e&&"generatedAnswer"in e&&!pe(e.generatedAnswer?.answerConfigurationId),nv=e=>{let t=hp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},xM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",ov=e=>e.generatedAnswer?.fieldsToIncludeInCitations,bo=e=>e.followUpAnswers?.conversationId,bM=e=>e.generatedAnswer?.citations,wM=e=>e.followUpAnswers?.followUpAnswers,RM=tt(wM,e=>e?.flatMap(t=>t.citations)),FM=(e,t)=>t,os=tt(bM,RM,FM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var sl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(sl||{}),xa=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(xa||{}),rn=e=>{if(_i(e))return e.map(t=>rn(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},as=()=>({by:"relevancy"}),yp=e=>({by:"date",order:e}),Sp=(e,t)=>({by:"field",order:t,field:e}),vp=()=>({by:"qre"}),Ap=()=>({by:"nosort"}),Mw=new X({values:{by:new Pu({enum:xa,required:!0}),order:new Pu({enum:sl}),field:new L}});function vr(){return rn(as())}d();c();l();u();d();c();l();u();d();c();l();u();var is=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?av(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],av(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function av(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function EM(){return typeof navigator<"u"}function Vw(){try{return typeof localStorage<"u"}catch{return!1}}function jw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Lw(){return!!(EM()&&navigator.cookieEnabled)}var Uw=null;function Qw(){return Uw||(Vw()?localStorage:Lw()?new iv:jw()?sessionStorage:new sv)}var ss=class ss{getItem(t){return is.get(`${ss.prefix}${t}`)}removeItem(t){is.erase(`${ss.prefix}${t}`)}setItem(t,r,n){is.set(`${ss.prefix}${t}`,r,n)}};de(ss,"prefix","coveo_");var iv=ss;var sv=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Cp="__coveo.analytics.history",IM=20,TM=1e3*60,PM=75,ba=class ba{constructor(t){de(this,"store");this.store=t||Qw()}static getInstance(t){return ba.instance||(ba.instance=new ba(t)),ba.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Cp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Cp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Cp,JSON.stringify(t.slice(0,IM)))}catch{}}clear(){try{this.store.removeItem(Cp)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,PM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>TM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(ba,"instance",null);var cv=ba,Xt=cv;var cl=class cl extends Ca{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return ev(ur(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||cl.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||ir().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||cl.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ue(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??vr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||dt().q}get responseTime(){return this.state.search?.duration||ir().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ir().response.totalCountFiltered}};de(cl,"fallbackPipelineName","default");var wo=cl,Bw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??gr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new sp({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:ol(e,n),beforeSendHooks:[al(e,r),(v,x)=>(e.info({...x,type:v,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g},uv=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function xp(e){let t=Gw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return px([e,...t,...r],o=>o.uniqueId)}function Gw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Gw(t)]):[]}d();c();l();u();var nn=()=>"";function Hw(e,t){return{...new wo(t).getBaseMetadata(),actionCause:e,type:e}}function kM(e){return Object.assign(e,{instantlyCallable:!0})}function OM(e,t){let r=a=>{let i=xe(e,a);return kM(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(v,{getState:x,extra:y}){return yield g({state:x(),extra:y})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var zw=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return DM(a)}return n},_M=e=>e.configuration.analytics.analyticsMode==="legacy",NM=e=>e.configuration.analytics.analyticsMode==="next",DM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),OM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let v=[],x={log:function(){var _ref14=_asyncToGenerator(function*({state:F}){for(let I of v)yield I(F)});return function log(_x25){return _ref14.apply(this,arguments)}}()},y=p(),C=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(C,p());x.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(F){_M(F)&&(yield qM(b,r,F,g,C.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=el(y);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(F){if(NM(F)&&o&&n){let I=n(F);yield GM(w,o,I)}});return function(_x27){return _ref16.apply(this,arguments)}}()),x});return function(_x24){return _ref13.apply(this,arguments)}}()));function qM(_x28,_x29,_x30,_x31,_x32){return _qM.apply(this,arguments)}function _qM(){_qM=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _qM.apply(this,arguments)}var MM=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),J=zw(e=>Bw({...e,provider:e.provider||new wo(e.getState)}),e=>e,wo),N7=zw(xw,MM("caseAssist"),il);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Zw(e,o),n<0&&(n=BM(e,o)),n<0&&(n=0),VM(e,r(n),t)};var Ww=(e,t)=>({sourceName:Yw(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()}),Kw=(e,t)=>({sourceName:Yw(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()});function Yw(e){let t=e.source;return pe(t)?"unknown":t}var Jw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function VM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:UM(e),...($w(e)?{documentCategory:$w(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:QM(e),queryPipeline:r.pipeline||nn()}}function $w(e){return e.raw?.objecttype||void 0}var Ke=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Xw={urihash:new L,sourcetype:new L,permanentid:new L},bp={uniqueId:z,raw:new X({values:Xw}),title:z,uri:z,clickUri:z,rankingModifier:new L({required:!1,emptyAllowed:!0})};function jM(e){return Object.assign({},...Object.keys(Xw).map(t=>({[t]:e[t]})))}function LM(e){return Object.assign({},...Object.keys(bp).map(t=>({[t]:e[t]})),{raw:jM(e.raw)})}function UM(e){let t=e.raw.author;return pe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function QM(e){let t=e.raw.source;return pe(t)?"unknown":t}var Zt=e=>new ve(bp).validate(LM(e));function BM(e,t){for(let[r,n]of t.entries()){let o=xp(n);if(Zw(e,o)!==-1)return r}return-1}function Zw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function GM(_x34,_x35,_x36){return _GM.apply(this,arguments)}function _GM(){_GM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _GM.apply(this,arguments)}d();c();l();u();var lv=e=>O(e,{evt:z,type:st}),eR=e=>J("analytics/generic/search",t=>{lv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),tR=e=>J("analytics/generic/click",(t,r)=>(Zt(e.result),lv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),rR=e=>J("analytics/generic/custom",t=>(lv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),wp=()=>J("analytics/interface/load",e=>e.makeInterfaceLoad()),Ro=()=>J("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Rp=()=>J("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),Fp=e=>J("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),nR=()=>({actionCause:"interfaceLoad"}),cs=()=>({actionCause:"interfaceChange"}),oR=()=>({actionCause:"searchFromLink"}),aR=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var dv=()=>st,iR=()=>z,on=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),Ar=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:z})})),$M={enabled:new fe({default:!0}),originContext:dv(),originLevel2:dv(),originLevel3:dv(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new fe({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:Gx,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new X({options:{required:!1},values:Xb.reduce((e,t)=>(e[t]=Bx,e),{})})},Fo=P("configuration/updateAnalyticsConfiguration",e=>O(e,$M)),us=P("configuration/analytics/disable"),ls=P("configuration/analytics/enable"),Ep=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:iR()})),Ip=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:iR()})),Tp=P("knowledge/setAgentId",e=>O(e,new L({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Pp={q:new L,enableQuerySyntax:new fe,aq:new L,cq:new L,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new L,f:new X,fExcluded:new X,cf:new X,nf:new X,mnf:new X,df:new X,debug:new fe,sf:new X,tab:new L,af:new X};var Me=P("searchParameters/restore",e=>O(e,Pp)),ds=P("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var Eo=P("debug/enable"),ps=P("debug/disable");d();c();l();u();var Io=()=>!1;var fs=ae(Io(),e=>{e.addCase(Eo,()=>!0).addCase(ps,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var pv=P("history/undo"),fv=P("history/redo"),lr=P("history/snapshot"),ul=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(pv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),kp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(fv()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var ms=P("pipeline/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var gs=ae(nn(),e=>{e.addCase(ms,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ar,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=P("breadcrumb/deselectAll"),hs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var an=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new fe({required:!0})}));d();c();l();u();d();c();l();u();var ll=class extends wo{constructor(r){super(r);de(this,"getState",r)}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ir().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ir().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var sR=e=>J({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new ll(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),cR=()=>J("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new ll(e)),uR=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var mv={id:z},HM={...mv,q:Ge},ys=P("instantResults/register",e=>O(e,mv)),sn=P("instantResults/updateQuery",e=>O(e,HM)),Ss=P("instantResults/clearExpired",e=>O(e,mv));d();c();l();u();var Op=new re({required:!0,min:0}),vs=P("pagination/registerNumberOfResults",e=>O(e,Op)),As=P("pagination/updateNumberOfResults",e=>O(e,Op)),Cs=P("pagination/registerPage",e=>O(e,Op)),cn=P("pagination/updatePage",e=>O(e,Op)),xs=P("pagination/nextPage"),bs=P("pagination/previousPage");d();c();l();u();var Vt=P("query/updateQuery",e=>O(e,{q:new L,enableQuerySyntax:new fe}));d();c();l();u();d();c();l();u();var Ur=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:$i(e)}});var ws=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Ur(e.configuration.analytics,t,r)),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var Rs=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Cw(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(uv()&&{pageId:uv()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:$i(e)})}}});return function Rs(_x43,_x44){return _ref21.apply(this,arguments)}}();var To=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Rs(e.configuration.analytics,t))),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function To(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Qr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var gv=()=>J("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Po=e=>J("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Qr().aq,cq:r.advancedSearchQueries?.cq||Qr().cq,dq:r.advancedSearchQueries?.dq||Qr().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var pl=Vr(_p(),1),mR=Vr(lR(),1);d();c();l();u();var Np=Vr(_p(),1),pR=Vr(dR(),1);Np.default.extend(pR.default);var Fs="YYYY/MM/DD@HH:mm:ss",zM="1401-01-01";function wa(e,t){let r=(0,Np.default)(e,t);return!r.isValid()&&!t?(0,Np.default)(e,Fs):r}function dl(e){return e.format(Fs)}function fR(e){return dl(wa(e))===e}function Dp(e,t){let r=wa(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}xv(r)}function xv(e){if(e.isBefore(zM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}pl.default.extend(mR.default);var gR=["past","now","next"],hR=["minute","hour","day","week","month","quarter","year"],WM=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new L({required:!t,constrainTo:hR}),period:new L({required:!0,constrainTo:gR})}};function ko(e){if(typeof e=="string"&&!un(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?bv(e):e;new ve(WM(t.period)).validate(t);let r=SR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);xv(r)}function yR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function SR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,pl.default)().subtract(r,n);case"next":return(0,pl.default)().add(r,n);case"now":return(0,pl.default)()}}function fl(e){return dl(SR(bv(e)))}function vR(e){return e.toLocaleLowerCase().split("-")}function un(e){let[t,r,n]=vR(e);if(t==="now")return!0;if(!gR.includes(t)||!hR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function AR(e){return!!e&&typeof e=="object"&&"period"in e}function bv(e){let[t,r,n]=vR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function CR(e){return ko(e),bv(e)}d();c();l();u();function xR(e){return e.type==="dateRange"}function bR(e){return`start${e}`}function wR(e){return`end${e}`}var wv=()=>({dateFacetValueMap:{}});function KM(e,t,r){let n=e.start,o=e.end;return un(n)&&(n=fl(n),r.dateFacetValueMap[t][bR(n)]=e.start),un(o)&&(o=fl(o),r.dateFacetValueMap[t][wR(o)]=e.end),{...e,start:n,end:o}}function Rv(e,t){if(xR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>KM(o,r,t))}}return e}function Oo(e){let t=wv();return{request:{...e,facets:e.facets?.map(n=>Rv(n,t))},mappings:t}}function YM(e,t,r){return{...e,start:r.dateFacetValueMap[t][bR(e.start)]||e.start,end:r.dateFacetValueMap[t][wR(e.end)]||e.end}}function JM(e,t){return e.facetId in t.dateFacetValueMap}function XM(e,t){return JM(e,t)?{...e,values:e.values.map(r=>YM(r,e.facetId,t))}:e}function qp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>XM(n,t))}}:e}d();c();l();u();d();c();l();u();var Es=P("didYouMean/enable"),Mp=P("didYouMean/disable"),Is=P("didYouMean/automaticCorrections/disable"),Vp=P("didYouMean/automaticCorrections/enable"),Cr=P("didYouMean/correction",e=>O(e,z)),Ra=P("didYouMean/automaticCorrections/mode",e=>O(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var jp=()=>J("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),Fv=()=>J("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),RR=()=>({actionCause:"didYouMeanClick"}),FR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Lp(){return{contextValues:{}}}d();c();l();u();function Up(){return{contextValues:{}}}d();c();l();u();function Ev(){return{enabled:!0,tabs:{}}}function Qp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Bp(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Gp(){return{}}d();c();l();u();function $p(){return{}}d();c();l();u();function Hp(){return{}}function ER(){return Br({})}function Br(e){return{context:e.context||Lp(),dictionaryFieldContext:e.dictionaryFieldContext||Up(),facetSet:e.facetSet||ts(),numericFacetSet:e.numericFacetSet||es(),dateFacetSet:e.dateFacetSet||Zi(),categoryFacetSet:e.categoryFacetSet||Xi(),automaticFacetSet:e.automaticFacetSet??Yi(),pagination:e.pagination||xr(),query:e.query||dt(),tabSet:e.tabSet||Hp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||$p(),querySet:e.querySet||Gp(),sortCriteria:e.sortCriteria||vr(),pipeline:e.pipeline||nn(),searchHub:e.searchHub||xo(),facetOptions:e.facetOptions||Qp(),facetOrder:e.facetOrder??Bp(),debug:e.debug??Io()}}d();c();l();u();var ZM=new X({values:{undoneQuery:Ge},options:{required:!0}}),zp=()=>J("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Wp=e=>J("analytics/trigger/query/undo",t=>(O(e,ZM),t.makeUndoTriggerQuery(e))),Kp=()=>J("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Yp=()=>J("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Jp=()=>J("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var _o=P("trigger/query/ignore",e=>O(e,new L({emptyAllowed:!0,required:!0}))),Ts=P("trigger/query/modification",e=>O(e,new X({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function No(e){return Object.values(e).map(t=>t.request)}function ml(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function IR(e){return No(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Iv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function eV(e){return No(e).map(t=>{let r=Iv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function tV(e){return[...eV(e.facetSet??{}),...IR(e.numericFacetSet??{}),...IR(e.dateFacetSet??{}),...No(e.categoryFacetSet??{})]}function rV(e){return tV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Xp(e){return ml(rV(e),e.facetOrder??[])}d();c();l();u();var Do=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=aV(e),n=Xp(e),o=nV(e),a=yield To(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Oo({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Do(_x47,_x48){return _ref23.apply(this,arguments)}}();function nV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(oV).filter(r=>r.currentValues.length>0):void 0}function oV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function aV(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=iV(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function iV(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var qo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=qp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(Po(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(lr(Br(_this12.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this13.dispatch(Po(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(lr(Br(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Fv()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Fv()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(_o("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(Po(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(lr(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:zp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ir(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(lr(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Rd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Do(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Cr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ts({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Do(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var TR=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Zp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),PR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Pv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),kR=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield kv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),OR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield lV(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),_R=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Tv(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),sV=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield Do(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function sV(_x61,_x62){return _ref29.apply(this,arguments)}}(),cV=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield To(e);return Oo({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function cV(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),uV=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield Do(e,t);return r.request.numberOfResults=0,r});return function uV(_x66,_x67){return _ref31.apply(this,arguments)}}(),NR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Tv(_x68,_x69){return _Tv.apply(this,arguments)}function _Tv(){_Tv=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new qo({...t,analyticsAction:cR()},m=>{t.dispatch(sn({q:m,id:e.id}))}),i=yield cV(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Tv.apply(this,arguments)}function Pv(_x70,_x71,_x72){return _Pv.apply(this,arguments)}function _Pv(){_Pv=_asyncToGenerator(function*(e,t,r){NR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new qo({...t,analyticsAction:r}),f=yield Do(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Pv.apply(this,arguments)}function kv(_x73,_x74){return _kv.apply(this,arguments)}function _kv(){_kv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield gv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new qo({...e,analyticsAction:gv()}),p=yield sV(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _kv.apply(this,arguments)}function lV(_x75,_x76,_x77){return _lV.apply(this,arguments)}function _lV(){_lV=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new qo({...e,analyticsAction:t}),f=yield uV(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _lV.apply(this,arguments)}function Zp(_x78,_x79,_x80){return _Zp.apply(this,arguments)}function _Zp(){_Zp=_asyncToGenerator(function*(e,t,r){NR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield Do(e,i),f=new qo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Zp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var DR=tt(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var br=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=_v(e),o=dV(e),a=pV(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield To(e,r):ws(e,t,r);return Oo({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Ov(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function br(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function Ov(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function dV(e){return ml(mV(e),e.facetOrder??[])}function pV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(fV).filter(r=>r.currentValues.length>0):void 0}function fV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function mV(e){return gV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function gV(e){return[...hV(e.facetSet??{}),...qR(e.numericFacetSet??{}),...qR(e.dateFacetSet??{}),...No(e.categoryFacetSet??{})]}function hV(e){return No(e).map(t=>{let r=Iv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function qR(e){return No(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function _v(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=DR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Mo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=qp(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(Po(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o)return null;if(!a)return!pe(f)&&!pe(f.correctedQuery)?_this19.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(lr(Br(_this19.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this20.dispatch(Po(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(lr(Br(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(_o("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(Po(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(lr(Br(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(lr(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Rd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=FR(),o=yield _this22.fetchFromAPI(yield br(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Cr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ts({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield br(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ps=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new L,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(ft()),r(hs())),r(an({allow:!0})),r(Vt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(cn(1))}),MR=P("search/updateSearchAction"),W=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Zp(r,t,e.legacy);VR(r);let n=e.next?jR(e.next):void 0,o=yield br(r,t.extra.navigatorContext,n),a=new Mo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),jt=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(VR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Pv(r,t,e.legacy);let n=new Mo({...t,analyticsAction:e.next}),o=yield br(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),wr=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return kv(t,r);let n=Hw("browseResults",t.getState),o=new Mo({...t,analyticsAction:n}),a=yield yV(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),Rr=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Zp(r,t,e.legacy);let n=new Mo({...t,analyticsAction:{}}),o=yield vV(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),ks=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Tv(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=jR(uR()),i=yield SV(r,t.extra.navigatorContext,n,o,a),p=new Mo({...t,analyticsAction:a},g=>{t.dispatch(sn({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),yV=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield br(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function yV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),SV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=ws(e,t,o);return Oo({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function SV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),vV=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield br(e,t,r);return n.request.numberOfResults=0,n});return function vV(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),VR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},jR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Vo=(e,t)=>{let r=e;return pe(r[t])?pe(e.raw[t])?null:e.raw[t]:r[t]},AV=e=>t=>e.every(r=>!pe(Vo(t,r))),CV=e=>t=>e.every(r=>pe(Vo(t,r))),xV=(e,t)=>r=>{let n=LR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},bV=(e,t)=>r=>{let n=LR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},LR=(e,t)=>{let r=Vo(t,e);return md(r)?r:[r]},UR={getResultProperty:Vo,fieldsMustBeDefined:AV,fieldsMustNotBeDefined:CV,fieldMustMatch:xV,fieldMustNotMatch:bV};function gl(e){return e.search.response.searchUid!==""}function QR(e,t,r){return e.search.results.find(n=>Vo(n,t)===r)}var Nv=tt(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Os=P("app/setError");function Dv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function qv(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function wV(e,t){qv(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function BR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function RV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ir(),e=>{e.addCase(W.rejected,(t,r)=>Dv(t,r)),e.addCase(wr.rejected,(t,r)=>Dv(t,r)),e.addCase(jt.rejected,(t,r)=>Dv(t,r)),e.addCase(W.fulfilled,(t,r)=>{wV(t,r)}),e.addCase(wr.fulfilled,(t,r)=>{qv(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(jt.fulfilled,(t,r)=>{qv(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Rr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(W.pending,BR),e.addCase(wr.pending,RV),e.addCase(jt.pending,BR),e.addCase(MR,(t,r)=>{t.searchAction=r.payload}),e.addCase(Os,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var _s=P("searchHub/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var Ns=ae(xo(),e=>{e.addCase(_s,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ar,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var GR=class extends Error{constructor(t){super(t[0].message);de(this,"issues");this.name="SchemaError",this.issues=t}};var Jn="uninitialized",Vv="pending",yl="fulfilled",Sl="rejected";function $R(e){return{status:e,isUninitialized:e===Jn,isLoading:e===Vv,isSuccess:e===yl,isError:e===Sl}}var HR=Jr;function iF(e,t){if(e===t||!(HR(e)&&HR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=iF(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function jv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function FV(e){return new RegExp("(^|:)//").test(e)}function EV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Bv(e){return e!=null}function zR(e){return[...(e?.values()??[])].filter(Bv)}function IV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var TV=e=>e.replace(/\/$/,""),PV=e=>e.replace(/^\//,"");function kV(e,t){if(!e)return t;if(!t)return e;if(FV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=TV(e),t=PV(t),`${e}${r}${t}`}function rf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Lv=()=>new Map,OV=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},_V=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},WR=(...e)=>S(...e),NV=e=>e.status>=200&&e.status<=299,DV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function KR(e){if(!Jr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var qV=e=>typeof e=="object"&&(Jr(e)||Array.isArray(e)||typeof e.toJSON=="function");function sF({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=WR,paramsSerializer:n,isJsonContentType:o=DV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===WR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(x,y,C){let{getState:b,extra:w,endpoint:F,forced:I,type:E}=y,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:U=f??"json",validateStatus:V=m??NV,timeout:B=p,...j}=typeof x=="string"?{url:x}:x,_={...g,signal:B?_V(y.signal,OV(B)):y.signal,...j};D=new A(KR(D)),_.headers=(yield t(D,{getState:b,arg:x,extra:w,endpoint:F,forced:I,type:E,extraOptions:C}))||D;let N=qV(_.body);if(_.body!=null&&!N&&typeof _.body!="string"&&_.headers.delete("content-type"),!_.headers.has("content-type")&&N&&_.headers.set("content-type",a),N&&o(_.headers)&&(_.body=JSON.stringify(_.body,i)),_.headers.has("accept")||(U==="json"?_.headers.set("accept","application/json"):U==="text"&&_.headers.set("accept","text/plain, text/html, */*")),G){let ue=~T.indexOf("?")?"&":"?",Se=n?n(G):new URLSearchParams(KR(G));T+=ue+Se}T=kV(e,T);let q=new Request(T,_);k={request:new Request(T,_)};let H;try{H=yield r(q)}catch(ue){return{error:{status:(ue instanceof Error||typeof DOMException<"u"&&ue instanceof DOMException)&&ue.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let ue;if(yield Promise.all([v(H,U).then(Se=>te=Se,Se=>ue=Se),ne.text().then(Se=>Z=Se,()=>{})]),ue)throw ue}catch(ue){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ue)},meta:k}}return V(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function v(_x110,_x111){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(x,y){if(typeof y=="function")return y(x);if(y==="content-type"&&(y=o(x.headers)?"json":"text"),y==="json"){let C=yield x.text();return C.length?JSON.parse(C):null}return x.text()});return _v2.apply(this,arguments)}}var Ds=class{constructor(e,t=void 0){de(this,"value");de(this,"meta");this.value=e,this.meta=t}};function MV(){return _MV.apply(this,arguments)}function _MV(){_MV=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _MV.apply(this,arguments)}function cF(e,t){throw Object.assign(new Ds({error:e,meta:t}),{throwImmediately:!0})}function Mv(e){e.aborted&&cF({status:"CUSTOM_ERROR",error:"Aborted"})}var YR={},VV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||YR).maxRetries,(o||YR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:MV,retryCondition:(g,v,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){Mv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ds(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ds)return g.value;throw g}if(g instanceof Ds){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Mv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw Mv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),uF=Object.assign(VV,{fail:cF}),of="__rtkq/",jV="online",LV="offline";var lF="focused";var Gv=P(`${of}${lF}`),dF=P(`${of}un${lF}`),$v=P(`${of}${jV}`),pF=P(`${of}${LV}`);var Cl="query",fF="mutation",mF="infinitequery";function af(e){return e.type===Cl}function UV(e){return e.type===fF}function sf(e){return e.type===mF}function nf(e){return af(e)||sf(e)}function Hv(e,t,r,n,o,a){let i=QV(e)?e(t,r,n,o):e;return i?jv(i,Bv,p=>a(gF(p))):[]}function QV(e){return typeof e=="function"}function gF(e){return typeof e=="string"?{type:e}:e}function BV(e,t){return e.catch(t)}var qs=(e,t)=>e.endpointDefinitions[t],vl=Symbol("forceQueryFn"),Uv=e=>typeof e[vl]=="function";function GV({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:I,buildInitiateInfiniteQuery:E,buildInitiateMutation:k,getRunningQueryThunk:x,getRunningMutationThunk:y,getRunningQueriesThunk:C,getRunningMutationsThunk:b};function x(T,D){return G=>{let U=qs(a,T),V=e({queryArgs:D,endpointDefinition:U,endpointName:T});return p(G)?.get(V)}}function y(T,D){return G=>f(G)?.get(D)}function C(){return T=>zR(p(T))}function b(){return T=>zR(f(T))}function w(T){}function F(T,D){let G=(U,{subscribe:V=!0,forceRefetch:B,subscriptionOptions:j,[vl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:U,endpointDefinition:D,endpointName:T}),ne,te={...N,type:Cl,subscribe:V,forceRefetch:B,subscriptionOptions:j,endpointName:T,originalArgs:U,queryCacheKey:H,[vl]:_};if(af(D))ne=t(te);else{let{direction:Re,initialPageParam:ke,refetchCachedPages:Ie}=N;ne=r({...te,direction:Re,initialPageParam:ke,refetchCachedPages:Ie})}let Z=o.endpoints[T].select(U),ue=q(ne),Se=Z(Y());let{requestId:Ve,abort:Je}=ue,Qe=Se.requestId!==Ve,ze=p(q)?.get(H),We=()=>Z(Y()),Ee=Object.assign(_?ue.then(We):Qe&&!ze?Promise.resolve(Se):Promise.all([ze,ue]).then(We),{arg:U,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Je,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(U,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(v({endpointName:T,requestId:Ve,queryCacheKey:H,options:Re}))}});if(!ze&&!Qe&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function I(T,D){return F(T,D)}function E(T,D){return F(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:U}={})=>(V,B)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:U}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=BV(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:U}))},te=Object.assign(H,{arg:_.arg,requestId:N,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(N,te),te.then(()=>{Z.delete(N)}),U&&(Z.set(U,te),te.then(()=>{Z.get(U)===te&&Z.delete(U)})),te}}}var hF=class extends GR{constructor(t,r,n,o){super(t);de(this,"value");de(this,"schemaName");de(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ea=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ia(_x115,_x116,_x117,_x118){return _Ia.apply(this,arguments)}function _Ia(){_Ia=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new hF(o.issues,t,r,n);return o.value});return _Ia.apply(this,arguments)}function JR(e){return e}var hl=(e={})=>({...e,[Yu]:!0});function $V({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(j,_,N,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:_,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:N})),!q)return;let Z=o.endpoints[j].select(_)(H()),ue=Hv(ne.providesTags,Z.data,void 0,_,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ue}]))};function v(j,_,N=0){let q=[_,...j];return N&&q.length>N?q.slice(0,-1):q}function x(j,_,N=0){let q=[...j,_];return N&&q.length>N?q.slice(1):q}let y=(j,_,N,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(_)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,_,Z.inversePatches,q))};if(te.status===Jn)return Z;let ue;if("data"in te)if(Kt(te.data)){let[Se,Ve,Je]=SS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Je),ue=Se}else ue=N(te.data),Z.patches.push({op:"replace",path:[],value:ue}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,_,Z.patches,q)),Z},C=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[vl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:JR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:_,abort:N,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ue,skipSchemaValidation:Se=m}=Z,Ve=j.type===Cl;try{let Je=JR,Qe={signal:_,abort:N,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:Ve?F(j,ne()):void 0,queryCacheKey:Ve?j.queryCacheKey:void 0},ze=Ve?j[vl]:void 0,We,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(ke,Ie,ut,yt){if(Ie==null&&ke.pages.length)return Promise.resolve({data:ke});let qr={queryArg:j.originalArgs,pageParam:Ie},ar=yield Re(qr),Yr=yt?v:x;return{data:{pages:Yr(ke.pages,ar.data,ut),pageParams:Yr(ke.pageParams,Ie,ut)},meta:ar.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(ke){let Ie,{extraOptions:ut,argSchema:yt,rawResponseSchema:qr,responseSchema:ar}=Z;if(yt&&!Ea(Se,"arg")&&(ke=yield Ia(yt,ke,"argSchema",{})),ze?Ie=ze():Z.query?(Je=b(Z,"transformResponse"),Ie=yield t(Z.query(ke),Qe,ut)):Ie=yield Z.queryFn(ke,Qe,ut,Mr=>t(Mr,Qe,ut)),typeof process<"u",Ie.error)throw new Ds(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ea(Se,"rawResponse")&&(Yr=yield Ia(qr,Ie.data,"rawResponseSchema",Ie.meta));let mr=yield Je(Yr,Ie.meta,ke);return ar&&!Ea(Se,"response")&&(mr=yield Ia(ar,mr,"responseSchema",Ie.meta)),{...Ie,data:mr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:ke}=Z,{maxPages:Ie=1/0}=ke,ut=j.refetchCachedPages??ke.refetchCachedPages??!0,yt,qr={pages:[],pageParams:[]},ar=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,mr=F(j,ne())&&!j.direction||!ar?qr:ar;if("direction"in j&&j.direction&&mr.pages.length){let Mr=j.direction==="backward",cd=(Mr?yF:Qv)(ke,mr,j.originalArgs);yt=yield Ee(mr,cd,Ie,Mr)}else{let{initialPageParam:Mr=ke.initialPageParam}=j,bu=ar?.pageParams??[],cd=bu[0]??Mr,D_=bu.length;if(yt=yield Ee(mr,cd,Ie),ze&&(yt={data:yt.data.pages[0]}),ut)for(let WC=1;WC<D_;WC++){let q_=Qv(ke,yt.data,j.originalArgs);yt=yield Ee(yt.data,q_,Ie)}}We=yt}else We=yield Re(j.originalArgs);return ue&&!Ea(Se,"meta")&&We.meta&&(We.meta=yield Ia(ue,We.meta,"metaSchema",We.meta)),Y(We.data,hl({fulfilledTimeStamp:Date.now(),baseQueryMeta:We.meta}))}catch(Je){let Qe=Je;if(Qe instanceof Ds){let ze=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:We,errorResponseSchema:Ee}=Z,{value:Re,meta:ke}=Qe;try{We&&!Ea(Se,"rawErrorResponse")&&(Re=yield Ia(We,Re,"rawErrorResponseSchema",ke)),ue&&!Ea(Se,"meta")&&(ke=yield Ia(ue,ke,"metaSchema",ke));let Ie=yield ze(Re,ke,j.originalArgs);return Ee&&!Ea(Se,"errorResponse")&&(Ie=yield Ia(Ee,Ie,"errorResponseSchema",ke)),q(Ie,hl({baseQueryMeta:ke}))}catch(Ie){Qe=Ie}}try{if(Qe instanceof hF){let ze={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Qe,ze),p?.(Qe,ze);let{catchSchemaFailure:We=f}=Z;if(We)return q(We(Qe,ze),hl({baseQueryMeta:Qe._bqMeta}))}}catch(ze){Qe=ze}throw typeof process<"u",console.error(Qe),Qe}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function F(j,_){let N=i.selectQueryEntry(_,j.queryCacheKey),q=i.selectConfig(_).refetchOnMountOrArgChange,Y=N?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let I=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return hl({startedTimeStamp:Date.now(),...(sf(N)?{direction:_.direction}:{})})},condition(_,{getState:N}){let q=N(),Y=i.selectQueryEntry(q,_.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=_.originalArgs,te=Y?.originalArgs,Z=r[_.endpointName],ue=_.direction;return Uv(_)?!0:Y?.status==="pending"?!1:F(_,q)||af(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),E=I(),k=I(),T=xe(`${e}/executeMutation`,w,{getPendingMeta(){return hl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,U=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let Se={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,Se)},Z=o.endpoints[j].select(_)(Y());if(H)q(te());else if(ne){let ue=Z?.fulfilledTimeStamp;if(!ue){q(te());return}(Number(new Date)-Number(new Date(ue)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return _=>_?.meta?.arg?.endpointName===j}function B(j,_){return{matchPending:Bi(zd(j),V(_)),matchFulfilled:Bi(zn(j),V(_)),matchRejected:Bi(Sa(j),V(_))}}return{queryThunk:E,mutationThunk:T,infiniteQueryThunk:k,prefetch:U,updateQueryData:y,upsertQueryData:C,patchQueryData:g,buildMatchThunkActions:B}}function Qv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function yF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function SF(e,t,r,n){return Hv(r[e.meta.arg.endpointName][t],zn(e)?e.payload:void 0,Xu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function XR(e){return Wt(e)?Ld(e):e}function ef(e,t,r){let n=e[t];n&&r(n)}function Al(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function ZR(e,t,r){let n=e[Al(t)];n&&r(n)}var tf={};function HV({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function v(V,B,j,_){var N;V[N=B.queryCacheKey]??(V[N]={status:Jn,endpointName:B.endpointName}),ef(V,B.queryCacheKey,q=>{q.status=Vv,q.requestId=j&&q.requestId?q.requestId:_.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];sf(Y)&&"direction"in B&&(q.direction=B.direction)})}function x(V,B,j,_){ef(V,B.arg.queryCacheKey,N=>{if(N.requestId!==B.requestId&&!_)return;let{merge:q}=o[B.arg.endpointName];if(N.status=yl,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,Z=ha(N.data,ue=>q(ue,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));N.data=Z}else N.data=j;}else N.data=o[B.arg.endpointName].structuralSharing??!0?iF(Wt(N.data)?rb(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=B.fulfilledTimeStamp})}let y=va({name:`${e}/queries`,initialState:tf,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:B}}){delete V[B]},prepare:Gi()},cacheEntriesUpserted:{reducer(V,B){for(let j of B.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),x(V,{arg:_,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:Cl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Yu]:!0,requestId:Zu(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:B,patches:j}}){ef(V,B,_=>{_.data=vS(_.data,j.concat())})},prepare:Gi()}},extraReducers(V){V.addCase(t.pending,(B,{meta:j,meta:{arg:_}})=>{let N=Uv(_);v(B,_,N,j)}).addCase(t.fulfilled,(B,{meta:j,payload:_})=>{let N=Uv(j.arg);x(B,j,_,N)}).addCase(t.rejected,(B,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{ef(B,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=Sl,H.error=Y??q}})}).addMatcher(p,(B,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===yl||q?.status===Sl)&&(B[N]=q)})}}),C=va({name:`${e}/mutations`,initialState:tf,reducers:{removeMutationResult:{reducer(V,{payload:B}){let j=Al(B);j in V&&delete V[j]},prepare:Gi()}},extraReducers(V){V.addCase(r.pending,(B,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(B[Al(j)]={requestId:_,status:Vv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:j,meta:_})=>{_.arg.track&&ZR(B,_,N=>{N.requestId===_.requestId&&(N.status=yl,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:j,error:_,meta:N})=>{N.arg.track&&ZR(B,N,q=>{q.requestId===N.requestId&&(q.status=Sl,q.error=j??_)})}).addMatcher(p,(B,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===yl||q?.status===Sl)&&N!==q?.requestId&&(B[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,B){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of B.payload){F(V,q);for(let{type:H,id:ne}of Y){let te=(_=(j=V.tags)[H]??(j[H]={}))[N=ne||"__internal_without_id"]??(_[N]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:Gi()}},extraReducers(V){V.addCase(y.actions.removeQueryResult,(B,{payload:{queryCacheKey:j}})=>{F(B,j)}).addMatcher(p,(B,j)=>{var N,q,Y;let{provided:_}=i(j);for(let[H,ne]of Object.entries(_.tags??{}))for(let[te,Z]of Object.entries(ne)){let ue=(q=(N=B.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let Se of Z)ue.includes(Se)||ue.push(Se),B.keys[Se]=_.keys[Se]}}).addMatcher(Zr(zn(t),Xu(t)),(B,j)=>{I(B,[j])}).addMatcher(y.actions.cacheEntriesUpserted.match,(B,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));I(B,_)})}});function F(V,B){let j=XR(V.keys[B]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=XR(Y).filter(H=>H!==B))}delete V.keys[B]}function I(V,B){let j=B.map(_=>{let N=SF(_,"providesTags",o,f),{queryCacheKey:q}=_.meta.arg;return{queryCacheKey:q,providedTags:N}});w.caseReducers.updateProvidedBy(V,w.actions.updateProvidedBy(j))}let E=va({name:`${e}/subscriptions`,initialState:tf,reducers:{updateSubscriptionOptions(V,B){},unsubscribeQueryResult(V,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:tf,reducers:{subscriptionsUpdated:{reducer(V,B){return vS(V,B.payload)},prepare:Gi()}}}),T=va({name:`${e}/config`,initialState:{online:IV(),focused:EV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:B}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:V=>{V.addCase($v,B=>{B.online=!0}).addCase(pF,B=>{B.online=!1}).addCase(Gv,B=>{B.focused=!0}).addCase(dF,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=ji({queries:y.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,B)=>D(g.match(B)?void 0:V,B),U={...T.actions,...y.actions,...E.actions,...k.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:G,actions:U}}var Ta=Symbol.for("RTKQ/skipToken"),vF={status:Jn},eF=ha(vF,()=>{}),tF=ha(vF,()=>{});function zV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>eF,o=E=>tF;return{buildQuerySelector:x,buildInfiniteQuerySelector:y,buildMutationSelector:C,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...$R(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,k){return p(E)?.[k]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function v(E,k,T){return D=>{if(D===Ta)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:E});return r(V=>f(V,G)??eF,T)}}function x(E,k){return v(E,k,a)}function y(E,k){let{infiniteQueryOptions:T}=k;function D(G){let U={...G,...$R(G.status)},{isLoading:V,isError:B,direction:j}=U,_=j==="forward",N=j==="backward";return{...U,hasNextPage:F(T,U.data,U.originalArgs),hasPreviousPage:I(T,U.data,U.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:B&&_,isFetchPreviousPageError:B&&N}}return v(E,k,D)}function C(){return E=>{let k;return typeof E=="object"?k=Al(E)??Ta:k=E,r(k===Ta?o:G=>i(G)?.mutations?.[k]??tF,a)}}function b(E,k){let T=E[t],D=new Set,G=jv(k,Bv,gF);for(let U of G){let V=T.provided.tags[U.type];if(!V)continue;let B=(U.id!==void 0?V[U.id]:Object.values(V).flat())??[];for(let j of B)D.add(j)}return Array.from(D.values()).flatMap(U=>{let V=T.queries[U];return V?{queryCacheKey:U,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(E,k){return jv(Object.values(p(E)),T=>T?.endpointName===k&&T.status!==Jn,T=>T.originalArgs)}function F(E,k,T){return k?Qv(E,k,T)!=null:!1}function I(E,k,T){return!k||!E.getPreviousPageParam?!1:yF(E,k,T)!=null}}var rF=WeakMap?new WeakMap:void 0,nF=({endpointName:e,queryArgs:t})=>{let r="",n=rF?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Jr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Jr(t)&&rF?.set(t,o),r=o}return`${e}(${r})`};function WV(...e){return function(r){let n=Wu(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=nF;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=x=>{let y=v(x);return typeof y=="string"?y:nF({...x,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Zu(),extractRehydrationInfo:n,hasRehydrationInfo:Wu(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let v of m)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,x]of Object.entries(g))typeof x=="function"?x(qs(a,v)):Object.assign(qs(a,v)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:v=>({...v,type:Cl}),mutation:v=>({...v,type:fF}),infiniteQuery:v=>({...v,type:mF})});for(let[v,x]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Yt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[v]=x;for(let y of p)y.injectEndpoint(v,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Yn(e,...t){return Object.assign(e,...t)}var KV=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:I,requestId:E,options:k}=w.payload,T=b.get(I);return T?.has(E)&&T.set(E,k),!0}if(f.match(w)){let{queryCacheKey:I,requestId:E}=w.payload,k=b.get(I);return k&&k.delete(E),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:I,requestId:E}}=w,k=rf(b,I.queryCacheKey,Lv);return I.subscribe&&k.set(E,I.subscriptionOptions??k.get(E)??{}),!0}let F=!1;if(t.rejected.match(w)){let{meta:{condition:I,arg:E,requestId:k}}=w;if(I&&E.subscribe){let T=rf(b,E.queryCacheKey,Lv);T.set(k,E.subscriptionOptions??T.get(k)??{}),F=!0}}return F},g=()=>r.currentSubscriptions,y={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function C(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,F])=>[w,Object.fromEntries(F)]))))}return(b,w)=>{if(a||(a=C(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,y];let F=m(r.currentSubscriptions,b),I=!0;if(F){i||(i=setTimeout(()=>{let T=C(r.currentSubscriptions),[,D]=SS(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(D)),a=T,i=null},500));let E=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;I=!E&&!k}return[I,!1]}},YV=2147483647/1e3-1,JV=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,x=Zr(g.match,r.fulfilled,r.rejected,v.match);function y(E){let k=o.currentSubscriptions.get(E);return k?k.size>0:!1}let C={};function b(E){for(let k of E.values())k?.abort?.()}let w=(E,k)=>{let T=k.getState(),D=i(T);if(x(E)){let G;if(v.match(E))G=E.payload.map(U=>U.queryDescription.queryCacheKey);else{let{queryCacheKey:U}=g.match(E)?E.payload:E.meta.arg;G=[U]}F(G,k,D)}if(t.util.resetApiState.match(E)){for(let[G,U]of Object.entries(C))U&&clearTimeout(U),delete C[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(E)){let{queries:G}=n.extractRehydrationInfo(E);F(Object.keys(G),k,D)}};function F(E,k,T){let D=k.getState();for(let G of E){let U=a(D,G);U?.endpointName&&I(G,U.endpointName,k,T)}}function I(E,k,T,D){let U=qs(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(U===1/0)return;let V=Math.max(0,Math.min(U,YV));if(!y(E)){let B=C[E];B&&clearTimeout(B),C[E]=setTimeout(()=>{if(!y(E)){let j=a(T.getState(),E);j?.endpointName&&T.dispatch(p(j.endpointName,j.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:E}))}delete C[E]},V*1e3)}}return w},oF=new Error("Promise never resolved before cacheEntryRemoved."),XV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Wd(n),m=Wd(o),g=zn(n,o),v={},{removeQueryResult:x,removeMutationResult:y,cacheEntriesUpserted:C}=e.internalActions;function b(T,D,G){let U=v[T];U?.valueResolved&&(U.valueResolved({data:D,meta:G}),delete U.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function F(T){let{arg:D,requestId:G}=T.meta,{endpointName:U,originalArgs:V}=D;return[U,V,G]}let I=(T,D,G)=>{let U=E(T);function V(B,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(B,N,j,D,_)}if(n.pending.match(T)){let[B,j,_]=F(T);V(B,U,_,j)}else if(C.match(T))for(let{queryDescription:B,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=B;V(_,q,T.meta.requestId,N),b(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[U]){let[j,_,N]=F(T);k(j,_,U,D,N)}}else if(g(T))b(U,T.payload,T.meta.baseQueryMeta);else if(x.match(T)||y.match(T))w(U);else if(e.util.resetApiState.match(T))for(let B of Object.keys(v))w(B)};function E(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:x.match(T)?T.payload.queryCacheKey:y.match(T)?Al(T.payload):""}function k(T,D,G,U,V){let B=qs(r,T),j=B?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw oF})]);q.catch(()=>{}),v[G]=_;let Y=e.endpoints[T].select(nf(B)?D:G),H=U.dispatch((Z,ue,Se)=>Se),ne={...U,getCacheEntry:()=>Y(U.getState()),requestId:V,extra:H,updateCachedData:nf(B)?Z=>U.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==oF)throw Z})}return I},ZV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},ej=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Zr(zn(n),Xu(n)),v=Zr(zn(o,n),Sa(o,n)),x=[],y=0,C=(F,I)=>{(o.pending.match(F)||n.pending.match(F))&&y++,v(F)&&(y=Math.max(0,y-1)),g(F)?w(SF(F,"invalidatesTags",r,i),I):v(F)?w([],I):a.util.invalidateTags.match(F)&&w(Hv(F.payload,void 0,void 0,void 0,void 0,i),I)};function b(){return y>0}function w(F,I){let E=I.getState(),k=E[e];if(x.push(...F),k.config.invalidationBehavior==="delayed"&&b())return;let T=x;if(x=[],T.length===0)return;let D=a.util.selectInvalidatedBy(E,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:U}of G){let V=k.queries[U],B=rf(f.currentSubscriptions,U,Lv);V&&(B.size===0?I.dispatch(m({queryCacheKey:U})):V.status!==Jn&&I.dispatch(p(V)))}})}return C},tj=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,F)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,F),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,F),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&v(w.meta.arg,F),r.util.resetApiState.match(w)&&(C(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,F){p.add(w),f||(f=setTimeout(()=>{for(let I of p)x({queryCacheKey:I},F);p.clear(),f=null},0))}function v({queryCacheKey:w},F){let I=F.getState()[e],E=I.queries[w],k=i.get(w);if(!E||E.status===Jn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let U=Date.now()+T;a.set(w,{nextPollTimestamp:U,pollingInterval:T,timeout:setTimeout(()=>{(I.config.focused||!D)&&F.dispatch(n(E)),v({queryCacheKey:w},F)},T)})}function x({queryCacheKey:w},F){let E=F.getState()[e].queries[w],k=i.get(w);if(!E||E.status===Jn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){y(w);return}let D=a.get(w),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:w},F)}function y(w){let F=a.get(w);F?.timeout&&clearTimeout(F.timeout),a.delete(w)}function C(){for(let w of a.keys())y(w)}function b(w=new Map){let F=!1,I=Number.POSITIVE_INFINITY;for(let E of w.values())E.pollingInterval&&(I=Math.min(E.pollingInterval,I),F=E.skipPollingIfUnfocused||F);return{lowestPollingInterval:I,skipPollingIfUnfocused:F}}return m},rj=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=zd(r,n),a=Sa(r,n),i=zn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:v,arg:{endpointName:x,originalArgs:y}}=m.meta,C=qs(t,x),b=C?.onQueryStarted;if(b){let w={},F=new Promise((T,D)=>{w.resolve=T,w.reject=D});F.catch(()=>{}),p[v]=w;let I=e.endpoints[x].select(nf(C)?y:v),E=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>I(g.getState()),requestId:v,extra:E,updateCachedData:nf(C)?T=>g.dispatch(e.util.updateQueryData(x,y,T)):void 0,queryFulfilled:F};b(y,k)}}else if(i(m)){let{requestId:v,baseQueryMeta:x}=m.meta;p[v]?.resolve({data:m.payload,meta:x}),delete p[v]}else if(a(m)){let{requestId:v,rejectedWithValue:x,baseQueryMeta:y}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:y}),delete p[v]}}},nj=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Gv.match(f)&&p(m,"refetchOnFocus"),$v.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],v=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let y of x.keys()){let C=v[y],b=x.get(y);if(!b||!C)continue;let w=[...b.values()];(w.some(I=>I[m]===!0)||w.every(I=>I[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:y})):C.status!==Jn&&f.dispatch(n(C)))}})}return i};function oj(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=x=>x.type.startsWith(`${t}/`),m=[ZV,JV,ej,tj,XV,rj];return{middleware:x=>{let y=!1,C=a(x.dispatch),b={...e,internalState:C,refetchQuery:v,isThisApiSliceAction:f,mwApi:x},w=m.map(E=>E(b)),F=KV(b),I=nj(b);return E=>k=>{if(!qu(k))return E(k);y||(y=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let T={...x,next:E},D=x.getState(),[G,U]=F(k,T,D),V;if(G?V=E(k):V=U,x.getState()[t]&&(I(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return V}},actions:p};function v(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var aF=Symbol(),aj=({createSelector:e=tt}={})=>({name:aF,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:x,skipSchemaValidation:y},C){ub();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:$v,onOffline:pF,onFocus:Gv,onFocusLost:dF},util:{}});let w=zV({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:F,selectCachedArgsForQuery:I,buildQuerySelector:E,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Yn(t.util,{selectInvalidatedBy:F,selectCachedArgsForQuery:I});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=$V({baseQuery:r,reducerPath:o,context:C,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:x,skipSchemaValidation:y}),{reducer:q,actions:Y}=HV({context:C,queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Yn(t.util,{patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>rf(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:Se,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Je,getRunningQueryThunk:Qe}=GV({queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:C,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:Se,getRunningMutationsThunk:Ve,getRunningQueryThunk:Qe,getRunningQueriesThunk:Je});let{middleware:ze,actions:We}=oj({reducerPath:o,context:C,queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Qe,getInternalState:ne});return Yn(t.util,We),Yn(t,{reducer:q,middleware:ze}),{name:aF,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});af(Re)&&Yn(Ie,{name:Ee,select:E(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),UV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(U,Ee)),sf(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),AF=WV(aj());d();c();l();u();d();c();l();u();var Pa=e=>e.query,CF=e=>e.query?.enableQuerySyntax;var xF=tt(e=>Pa(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),cf=tt(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var uf=e=>{if(e==="yes")return!0;if(e==="no")return!1},ij=()=>J("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function lf(e,t){return J({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Ue(n),a=os(n,e);if(!o||!a)return null;let i=bo(n);return r.makeGeneratedAnswerCitationClick(Ww(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Jw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=os(r,e);return{answerId:t??Ue(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function sj(e,t,r){return J({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??Ue(o),i=os(o,e);if(!a||!i)return null;let p=bo(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=os(n,e);return{answerId:r??Ue(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function cj(e,t){return J({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function uj(e){return J({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"like"})})}function lj(e){return J({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"dislike"})})}var dj=e=>J({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ue(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ue(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:uf(o),documented:uf(a),correctTopic:uf(p),hallucinationFree:uf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Xn=(e,t,r)=>J({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=bo(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Ue(n)??"",answerGenerated:e??!1})}),jo=e=>J({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),pj=()=>J({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"show"})}),fj=()=>J({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"hide"})}),mj=()=>J({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"expand"})}),gj=()=>J({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"collapse"})});function hj(e){return J({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"copyToClipboard"})})}function zv(e,t){return J({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=os(n,e);if(!o)return null;let a=bo(n);return a?r.makeGeneratedAnswerFollowupOpenSource({...Kw(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:a}):null}})}var Ms={logCopyGeneratedAnswer:hj,logGeneratedAnswerHideAnswers:fj,logGeneratedAnswerShowAnswers:pj,logGeneratedAnswerStreamEnd:Xn,logGeneratedAnswerFeedback:dj,logDislikeGeneratedAnswer:lj,logLikeGeneratedAnswer:uj,logGeneratedAnswerOpenInlineLink:cj,logHoverCitation:sj,logOpenGeneratedAnswerSource:lf,logOpenGeneratedAnswerFollowUpSource:zv,logRetryGeneratedAnswer:ij,logGeneratedAnswerExpand:mj,logGeneratedAnswerCollapse:gj};d();c();l();u();d();c();l();u();var bF=tt(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Wv=e=>e.context;d();c();l();u();var Kv=e=>e.pipeline;d();c();l();u();var Yv=e=>e.searchHub;d();c();l();u();var Lt=tt(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),jie=tt(e=>e,e=>{let t=Lt(e);return t&&e?e[t].expression:""});d();c();l();u();var wF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var RF=e=>e.excerptLength?.length;d();c();l();u();var ln=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,FF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var EF=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var IF=e=>e.sortCriteria;var TF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Vi(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function TF(_x126){return _ref45.apply(this,arguments)}}(),PF=(e,t)=>{let r=Pa(e)?.q,{aq:n,cq:o,dq:a,lq:i}=_F(e),p=Wv(e),f=Ur(e.configuration.analytics,t,{actionCause:Nv(e)}),m=Yv(e),g=Kv(e),v=ov(e)??[],x=OF(e),y=Lt(e.tabSet)||"default",C=rv(e),b=Dw(e),w=t.referrer||"",F=FF(e),I=IF(e),E=yj(e),k=RF(e),T=EF(e),D=wF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:CF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(x.length&&{facets:x}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Ov(e),firstResult:e.pagination.firstResult}),tab:y,locale:C,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:I,...(F&&{facetOptions:F}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},kF=(e,t)=>{let r=Pa(e)?.q,n=OF(e),o=Ur(e.configuration.analytics,t,{actionCause:Nv(e)}),a=rv(e),i=Lt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=_F(e),g=Yv(e),v=Kv(e),x=Wv(e),y=ov(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:y,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},OF=e=>Xp(e)?.map(t=>Rv(t,wv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),yj=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),_F=e=>{let t=bF(e),r=_v(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var df=["searching","thinking","answering"];function pf(e){return e.toLowerCase()}var ff=["search","generic"];function Jv(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var NF=["text/plain","text/markdown"];var Vs=new L({required:!0}),DF=new L,js=new fe({required:!0}),Xv={id:Vs,title:Vs,uri:Vs,permanentid:Vs,clickUri:DF},mf=new L({required:!0,constrainTo:NF}),qF=new L({required:!0,constrainTo:df}),MF=e=>({...e,name:pf(e.name)}),Ls=P("generatedAnswer/setIsVisible",e=>O(e,js)),Us=P("generatedAnswer/setAnswerId",e=>O(e,z)),gf=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Qs=P("generatedAnswer/setIsEnabled",e=>O(e,js)),Oa=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:Vs})),_a=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new X({values:Xv})})})),Na=P("generatedAnswer/updateError",e=>O(e,{message:DF,code:new re({min:0})})),dr=P("generatedAnswer/resetAnswer"),hf=P("generatedAnswer/like"),yf=P("generatedAnswer/dislike"),Sf=P("generatedAnswer/feedbackModal/open"),xl=P("generatedAnswer/expand"),vf=P("generatedAnswer/collapse"),Af=P("generatedAnswer/setId",e=>O(e,{id:new L({required:!0})})),Cf=P("generatedAnswer/feedbackModal/close"),Bs=P("generatedAnswer/sendFeedback"),dn=P("generatedAnswer/setIsLoading",e=>O(e,js)),ka=P("generatedAnswer/setIsStreaming",e=>O(e,js)),Da=P("generatedAnswer/setAnswerContentFormat",e=>O(e,mf)),xf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:mf,default:["text/plain"]})})),bf=P("knowledge/updateAnswerConfigurationId",e=>O(e,Vs)),wf=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Fd)),bl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,js)),qa=P("generatedAnswer/setCannotAnswer",e=>O(e,js)),Zv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new X({}))),Rf=P("generatedAnswer/startStep",e=>O(MF(e),{name:qF,startedAt:new re({min:0,required:!0})})),Ff=P("generatedAnswer/finishStep",e=>O(MF(e),{name:qF,finishedAt:new re({min:0,required:!0})})),Ef=P("generatedAnswer/startToolCall",e=>O(e,{toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),If=P("generatedAnswer/finishToolCall",e=>O(e,{finishedAt:new re({min:0,required:!0}),toolCallId:z})),Gs=P("generatedAnswer/toolCallArgs",e=>O(e,{toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:ff})})),VF=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield TF(r),g=(y,C)=>{switch(y){case"genqa.headerMessageType":{let b=JSON.parse(C);n(Da(b.contentFormat));break}case"genqa.messageType":n(Oa(JSON.parse(C)));break;case"genqa.citationsType":n(_a(JSON.parse(C)));break;case"genqa.endOfStreamType":{let b=JSON.parse(C).answerGenerated,{answerId:w,answer:F}=a().generatedAnswer,E=p.length!==0&&!b,k=!F?.trim();n(qa(E)),n(ka(!1)),n(bl(b)),n(Xn(b,w,b?k:void 0)),n(jo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(dn(!0));let v=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,x=o.streamingClient?.streamGeneratedAnswer(m,{write:y=>{v(m)&&(n(dn(!1)),y.payload&&y.payloadType&&g(y.payloadType,y.payload))},abort:y=>{v(m)&&n(Na(y))},close:()=>{v(m)&&n(ka(!1))},resetAnswer:()=>{v(m)&&n(dr())}});x?f(x):n(dn(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),Tf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(dr());let a=t();if(a.generatedAnswer.isEnabled===!1){o.warn("[WARNING] The generateAnswer action was dispatched while the generated answer is disabled. No answer will be generated. Enable the generated answer before dispatching generateAnswer.");return}if(a.generatedAnswer.answerConfigurationId){let i=PF(a,n);r(Zv(i)),yield r(Pf(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();l();u();var Sj=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Vi(n.configuration.search?.apiBaseUrl,i,a);return sF({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,x={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(y=>{x[y]=g[y]}),x.duplex="half",x.body=yield g.text(),S(v,x)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function Sj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),kf=AF({reducerPath:"answer",baseQuery:uF(Sj,{maxRetries:3}),endpoints:()=>({})});var vj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Aj=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(e.answer=n?.trim()?n.concat(r):r)},Cj=(e,t)=>{e.citations=t.citations},xj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},bj=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},wj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&bj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(vj(t,o),r(Da(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(Aj(t,o),r(Oa({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(Cj(t,o),r(_a({citations:o.citations})));break;case"genqa.endOfStreamType":{xj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Xn(i,a,p)),r(jo());break}}},Rj=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Ma=kf.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:v}=i,x=Vi(i.search.apiBaseUrl,m,g),y=Rj(x,m,p.answerConfigurationId,f?.insightId);yield Sd(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(C){let b=C.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(Us(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:C=>{o(b=>{wj(C,b,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(qa(!C.generated))})}})}).apply(this,arguments)}})})}),Pf=e=>Ma.endpoints.getAnswer.initiate(e),eA=e=>{let t=cf(e);return Ma.endpoints.getAnswer.select(t??Ta)(e)};d();c();l();u();var jF=ae(Ao,e=>e);d();c();l();u();function Fj(e){let t=e.payload?.analyticsAction;return LF(e)&&!pe(t)}function LF(e){return"type"in e}var UF=e=>t=>r=>{let n;Fj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return LF(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var $s=P("tab/register",e=>{let t=new X({values:{id:z,expression:Ge}});return O(e,t)}),ht=P("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var Of=Vr(_p(),1),GF=Vr(QF(),1),$F=Vr(BF(),1);Of.default.extend($F.default);Of.default.extend(GF.default);var Hs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Of.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var Ej=/(^|; )Coveo-Pendragon=([^;]*)/,Ij=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function HF(){return typeof window>"u"?!1:Ej.exec(document.cookie)?.pop()||null}function zF(){return typeof window>"u"?!1:Ij.test(document.cookie)}var _f=ae(Hs(),e=>e.addCase(on,(t,r)=>{Tj(t,r.payload)}).addCase(Ar,(t,r)=>{Pj(t,r.payload)}).addCase(Fo,(t,r)=>{kj(t,r.payload)}).addCase(us,t=>{t.analytics.enabled=!1}).addCase(ls,t=>{t.analytics.enabled=!0}).addCase(Ep,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Ip,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ds,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{pe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Tp,(t,{payload:r})=>{Oj(t,r)}));function Tj(e,t){pe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",pe(t.organizationId)||(e.organizationId=t.organizationId)}function Pj(e,t){pe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),pe(t.locale)||(e.search.locale=t.locale),pe(t.timezone)||(e.search.timezone=t.timezone),pe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function kj(e,t){pe(t.enabled)||(e.analytics.enabled=t.enabled),pe(t.originContext)||(e.analytics.originContext=t.originContext),pe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),pe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),pe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),pe(t.trackingId)||(e.analytics.trackingId=t.trackingId),pe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),pe(t.source)||(e.analytics.source=t.source);try{let r=HF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}pe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),pe(t.anonymous)||(e.analytics.anonymous=t.anonymous),pe(t.deviceId)||(e.analytics.deviceId=t.deviceId),pe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),pe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function Oj(e,t){e.knowledge.agentId=t;try{zF()&&(e.knowledge.debugAgentSession=!0)}catch{}}var me=_f;d();c();l();u();function _j(e){return e.instantlyCallable}var WF=()=>e=>t=>e(_j(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function KF(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var aA,Nj=new Uint8Array(16);function iA(){if(!aA){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");aA=crypto.getRandomValues.bind(crypto)}return aA(Nj)}d();c();l();u();d();c();l();u();var Dj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sA={randomUUID:Dj};function qj(e,t,r){if(sA.randomUUID&&!t&&!e)return sA.randomUUID();e=e||{};let n=e.random??e.rng?.()??iA();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return KF(n)}var Lo=qj;d();c();l();u();d();c();l();u();var R={};Ru(R,{BRAND:()=>cL,DIRTY:()=>Va,EMPTY_PATH:()=>Lj,INVALID:()=>be,NEVER:()=>HL,OK:()=>Ut,ParseStatus:()=>Dt,Schema:()=>Oe,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>La,ZodBoolean:()=>Ua,ZodBranded:()=>Rl,ZodCatch:()=>Xa,ZodDate:()=>Qa,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>qf,ZodEffects:()=>Ir,ZodEnum:()=>Ka,ZodError:()=>tr,ZodFirstPartyTypeKind:()=>we,ZodFunction:()=>Vf,ZodIntersection:()=>Ha,ZodIssueCode:()=>ee,ZodLazy:()=>za,ZodLiteral:()=>Wa,ZodMap:()=>Xs,ZodNaN:()=>ec,ZodNativeEnum:()=>Ya,ZodNever:()=>Gr,ZodNull:()=>Ga,ZodNullable:()=>mn,ZodNumber:()=>ja,ZodObject:()=>rr,ZodOptional:()=>Fr,ZodParsedType:()=>le,ZodPipeline:()=>Fl,ZodPromise:()=>Go,ZodReadonly:()=>Za,ZodRecord:()=>Mf,ZodSchema:()=>Oe,ZodSet:()=>Zs,ZodString:()=>Qo,ZodSymbol:()=>Ys,ZodTransformer:()=>Ir,ZodTuple:()=>fn,ZodType:()=>Oe,ZodUndefined:()=>Ba,ZodUnion:()=>$a,ZodUnknown:()=>to,ZodVoid:()=>Js,addIssueToContext:()=>ce,any:()=>yL,array:()=>CL,bigint:()=>pL,boolean:()=>iE,coerce:()=>$L,custom:()=>nE,date:()=>fL,datetimeRegex:()=>tE,defaultErrorMap:()=>Zn,discriminatedUnion:()=>RL,effect:()=>ML,enum:()=>NL,function:()=>kL,getErrorMap:()=>zs,getParsedType:()=>pn,instanceof:()=>lL,intersection:()=>FL,isAborted:()=>Nf,isAsync:()=>Ws,isDirty:()=>Df,isValid:()=>Uo,late:()=>uL,lazy:()=>OL,literal:()=>_L,makeIssue:()=>wl,map:()=>TL,nan:()=>dL,nativeEnum:()=>DL,never:()=>vL,null:()=>hL,nullable:()=>jL,number:()=>aE,object:()=>xL,objectUtil:()=>cA,oboolean:()=>GL,onumber:()=>BL,optional:()=>VL,ostring:()=>QL,pipeline:()=>UL,preprocess:()=>LL,promise:()=>qL,quotelessJson:()=>Mj,record:()=>IL,set:()=>PL,setErrorMap:()=>jj,strictObject:()=>bL,string:()=>oE,symbol:()=>mL,transformer:()=>ML,tuple:()=>EL,undefined:()=>gL,union:()=>wL,unknown:()=>SL,util:()=>De,void:()=>AL});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var De;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(De||(De={}));var cA;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(cA||(cA={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pn=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}};var ee=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Mj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),tr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};tr.create=e=>new tr(e);var Vj=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===le.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=Vj;var YF=Zn;function jj(e){YF=e}function zs(){return YF}d();c();l();u();var wl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},Lj=[];function ce(e,t){let r=zs(),n=wl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var Dt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return be;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return be;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},be=Object.freeze({status:"aborted"}),Va=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),Nf=e=>e.status==="aborted",Df=e=>e.status==="dirty",Uo=e=>e.status==="valid",Ws=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Er=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},JF=(e,t)=>{if(Uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new tr(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Oe=class{get description(){return this._def.description}_getType(t){return pn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ws(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return JF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pn(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Uo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Uo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:pn(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Ws(o)?o:Promise.resolve(o);return JF(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:ee.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Ir({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Fr.create(this,this._def)}nullable(){return mn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.create(this,this._def)}or(t){return $a.create([this,t],this._def)}and(t){return Ha.create(this,t,this._def)}transform(t){return new Ir({...Te(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new Rl({typeName:we.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Xa({...Te(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Fl.create(this,t)}readonly(){return Za.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Uj=/^c[^\s-]{8,}$/i,Qj=/^[0-9a-z]+$/,Bj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Gj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$j=/^[a-z0-9_-]{21}$/i,Hj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uA,Yj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Xj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Zj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ZF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rL=new RegExp(`^${ZF}$`);function eE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function nL(e){return new RegExp(`^${eE(e)}$`)}function tE(e){let t=`${ZF}T${eE(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function oL(e,t){return!!((t==="v4"||!t)&&Yj.test(e)||(t==="v6"||!t)&&Xj.test(e))}function aL(e,t){if(!Hj.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function iL(e,t){return!!((t==="v4"||!t)&&Jj.test(e)||(t==="v6"||!t)&&Zj.test(e))}var Qo=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.string,received:a.parsedType}),be}let n=new Dt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Wj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")uA||(uA=new RegExp(Kj,"u")),uA.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Gj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")$j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Uj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Qj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Bj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:ee.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?tE(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?rL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?nL(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?zj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?oL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?aL(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?iL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?eL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?tL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Qo.create=e=>new Qo({checks:[],typeName:we.ZodString,coerce:e?.coerce??!1,...Te(e)});function sL(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var ja=class e extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==le.number){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.number,received:a.parsedType}),be}let n,o=new Dt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?sL(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ja.create=e=>new ja({checks:[],typeName:we.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var La=class e extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==le.bigint)return this._getInvalidInput(t);let n,o=new Dt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.bigint,received:r.parsedType}),be}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};La.create=e=>new La({checks:[],typeName:we.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Ua=class extends Oe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),be}return Ut(t.data)}};Ua.create=e=>new Ua({typeName:we.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Qa=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.date,received:a.parsedType}),be}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),be}let n=new Dt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Qa.create=e=>new Qa({checks:[],coerce:e?.coerce||!1,typeName:we.ZodDate,...Te(e)});var Ys=class extends Oe{_parse(t){if(this._getType(t)!==le.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),be}return Ut(t.data)}};Ys.create=e=>new Ys({typeName:we.ZodSymbol,...Te(e)});var Ba=class extends Oe{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),be}return Ut(t.data)}};Ba.create=e=>new Ba({typeName:we.ZodUndefined,...Te(e)});var Ga=class extends Oe{_parse(t){if(this._getType(t)!==le.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),be}return Ut(t.data)}};Ga.create=e=>new Ga({typeName:we.ZodNull,...Te(e)});var Bo=class extends Oe{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Bo.create=e=>new Bo({typeName:we.ZodAny,...Te(e)});var to=class extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}};to.create=e=>new to({typeName:we.ZodUnknown,...Te(e)});var Gr=class extends Oe{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.never,received:r.parsedType}),be}};Gr.create=e=>new Gr({typeName:we.ZodNever,...Te(e)});var Js=class extends Oe{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),be}return Ut(t.data)}};Js.create=e=>new Js({typeName:we.ZodVoid,...Te(e)});var ro=class e extends Oe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==le.array)return ce(r,{code:ee.invalid_type,expected:le.array,received:r.parsedType}),be;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ce(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ce(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Er(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Er(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.toString(r)}})}nonempty(t){return this.min(1,t)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Te(t)});function Ks(e){if(e instanceof rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Fr.create(Ks(n))}return new rr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:Ks(e.element)}):e instanceof Fr?Fr.create(Ks(e.unwrap())):e instanceof mn?mn.create(Ks(e.unwrap())):e instanceof fn?fn.create(e.items.map(t=>Ks(t))):e}var rr=class e extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==le.object){let m=this._getOrReturnCtx(t);return ce(m,{code:ee.invalid_type,expected:le.object,received:m.parsedType}),be}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Gr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],v=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Er(o,v,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Gr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ce(o,{code:ee.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let v=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Er(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let v=yield g.key,x=yield g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ge.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of De.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Ks(this)}partial(t){let r={};for(let n of De.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Fr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return rE(De.objectKeys(this.shape))}};rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:Gr.create(),typeName:we.ZodObject,...Te(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:Gr.create(),typeName:we.ZodObject,...Te(t)});rr.lazycreate=(e,t)=>new rr({shape:e,unknownKeys:"strip",catchall:Gr.create(),typeName:we.ZodObject,...Te(t)});var $a=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new tr(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),be}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x138){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new tr(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),be}}get options(){return this._def.options}};$a.create=(e,t)=>new $a({options:e,typeName:we.ZodUnion,...Te(t)});var eo=e=>e instanceof za?eo(e.schema):e instanceof Ir?eo(e.innerType()):e instanceof Wa?[e.value]:e instanceof Ka?e.options:e instanceof Ya?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ba?[void 0]:e instanceof Ga?[null]:e instanceof Fr?[void 0,...eo(e.unwrap())]:e instanceof mn?[null,...eo(e.unwrap())]:e instanceof Rl||e instanceof Za?eo(e.unwrap()):e instanceof Xa?eo(e._def.innerType):[],qf=class e extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.object)return ce(r,{code:ee.invalid_type,expected:le.object,received:r.parsedType}),be;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=eo(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function lA(e,t){let r=pn(e),n=pn(t);if(e===t)return{valid:!0,data:e};if(r===le.object&&n===le.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=lA(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===le.array&&n===le.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=lA(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===le.date&&n===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ha=class extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(Nf(a)||Nf(i))return be;let p=lA(a.value,i.value);return p.valid?((Df(a)||Df(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ha.create=(e,t,r)=>new Ha({left:e,right:t,typeName:we.ZodIntersection,...Te(r)});var fn=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.array)return ce(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Er(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fn({items:e,typeName:we.ZodTuple,rest:null,...Te(t)})};var Mf=class e extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.object)return ce(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Er(n,p,n.path,p)),value:i._parse(new Er(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Oe?new e({keyType:t,valueType:r,typeName:we.ZodRecord,...Te(n)}):new e({keyType:Qo.create(),valueType:t,typeName:we.ZodRecord,...Te(r)})}},Xs=class extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.map)return ce(n,{code:ee.invalid_type,expected:le.map,received:n.parsedType}),be;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Er(n,p,n.path,[m,"key"])),value:a._parse(new Er(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return be;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return be;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Xs.create=(e,t,r)=>new Xs({valueType:t,keyType:e,typeName:we.ZodMap,...Te(r)});var Zs=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.set)return ce(n,{code:ee.invalid_type,expected:le.set,received:n.parsedType}),be;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ce(n,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return be;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Er(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Te(t)});var Vf=class e extends Oe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.function)return ce(r,{code:ee.invalid_type,expected:le.function,received:r.parsedType}),be;function n(p,f){return wl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return wl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Go){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new tr([]),g=yield p._def.args.parseAsync(f,a).catch(y=>{throw m.addIssue(n(f,y)),m}),v=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(v,a).catch(y=>{throw m.addIssue(o(v,y)),m})}))}else{let p=this;return Ut(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new tr([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),v=p._def.returns.safeParse(g,a);if(!v.success)throw new tr([o(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:fn.create(t).rest(to.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||fn.create([]).rest(to.create()),returns:r||to.create(),typeName:we.ZodFunction,...Te(n)})}},za=class extends Oe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};za.create=(e,t)=>new za({getter:e,typeName:we.ZodLazy,...Te(t)});var Wa=class extends Oe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}};Wa.create=(e,t)=>new Wa({value:e,typeName:we.ZodLiteral,...Te(t)});function rE(e,t){return new Ka({values:e,typeName:we.ZodEnum,...Te(t)})}var Ka=class e extends Oe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),be}return Ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ka.create=rE;var Ya=class extends Oe{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==le.string&&n.parsedType!==le.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Ut(t.data)}get enum(){return this._def.values}};Ya.create=(e,t)=>new Ya({values:e,typeName:we.ZodNativeEnum,...Te(t)});var Go=class extends Oe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:le.promise,received:r.parsedType}),be;let n=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Go.create=(e,t)=>new Go({type:e,typeName:we.ZodPromise,...Te(t)});var Ir=class extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return be;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?be:f.status==="dirty"?Va(f.value):r.value==="dirty"?Va(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return be;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?be:p.status==="dirty"?Va(p.value):r.value==="dirty"?Va(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?be:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?be:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Uo(i))return be;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):be);De.assertNever(o)}};Ir.create=(e,t,r)=>new Ir({schema:e,typeName:we.ZodEffects,effect:t,...Te(r)});Ir.createWithPreprocess=(e,t,r)=>new Ir({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Te(r)});var Fr=class extends Oe{_parse(t){return this._getType(t)===le.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:we.ZodOptional,...Te(t)});var mn=class extends Oe{_parse(t){return this._getType(t)===le.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};mn.create=(e,t)=>new mn({innerType:e,typeName:we.ZodNullable,...Te(t)});var Ja=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===le.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Xa=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ws(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var ec=class extends Oe{_parse(t){if(this._getType(t)!==le.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}};ec.create=e=>new ec({typeName:we.ZodNaN,...Te(e)});var cL=Symbol("zod_brand"),Rl=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Fl=class e extends Oe{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),Va(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?be:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:we.ZodPipeline})}},Za=class extends Oe{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Ws(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:we.ZodReadonly,...Te(t)});function XF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function nE(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=XF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=XF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var uL={object:rr.lazycreate},we;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(we||(we={}));var lL=(e,t={message:`Input not instance of ${e.name}`})=>nE(r=>r instanceof e,t),oE=Qo.create,aE=ja.create,dL=ec.create,pL=La.create,iE=Ua.create,fL=Qa.create,mL=Ys.create,gL=Ba.create,hL=Ga.create,yL=Bo.create,SL=to.create,vL=Gr.create,AL=Js.create,CL=ro.create,xL=rr.create,bL=rr.strictCreate,wL=$a.create,RL=qf.create,FL=Ha.create,EL=fn.create,IL=Mf.create,TL=Xs.create,PL=Zs.create,kL=Vf.create,OL=za.create,_L=Wa.create,NL=Ka.create,DL=Ya.create,qL=Go.create,ML=Ir.create,VL=Fr.create,jL=mn.create,LL=Ir.createWithPreprocess,UL=Fl.create,QL=()=>oE().optional(),BL=()=>aE().optional(),GL=()=>iE().optional(),$L={string:e=>Qo.create({...e,coerce:!0}),number:e=>ja.create({...e,coerce:!0}),boolean:e=>Ua.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Qa.create({...e,coerce:!0})};var HL=be;var zL=R.object({name:R.string(),arguments:R.string()}),WL=R.object({id:R.string(),type:R.literal("function"),function:zL,encryptedValue:R.string().optional()}),jf=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),KL=R.object({type:R.literal("text"),text:R.string()}),YL=R.object({type:R.literal("data"),value:R.string(),mimeType:R.string()}),JL=R.object({type:R.literal("url"),value:R.string(),mimeType:R.string().optional()}),Lf=R.discriminatedUnion("type",[YL,JL]),XL=R.object({type:R.literal("image"),source:Lf,metadata:R.unknown().optional()}),ZL=R.object({type:R.literal("audio"),source:Lf,metadata:R.unknown().optional()}),eU=R.object({type:R.literal("video"),source:Lf,metadata:R.unknown().optional()}),tU=R.object({type:R.literal("document"),source:Lf,metadata:R.unknown().optional()});var sE=R.object({type:R.literal("binary"),mimeType:R.string(),id:R.string().optional(),url:R.string().optional(),data:R.string().optional(),filename:R.string().optional()}),cE=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:R.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Cde=sE.superRefine((e,t)=>{cE(e,t)}),rU=R.discriminatedUnion("type",[KL,XL,ZL,eU,tU,sE]),nU=rU.superRefine((e,t)=>{e.type==="binary"&&cE(e,t)}),oU=jf.extend({role:R.literal("developer"),content:R.string()}),aU=jf.extend({role:R.literal("system"),content:R.string()}),iU=jf.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array(WL).optional()}),sU=jf.extend({role:R.literal("user"),content:R.union([R.string(),R.array(nU)])}),cU=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),uU=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),lU=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),uE=R.discriminatedUnion("role",[oU,aU,iU,sU,cU,uU,lU]),xde=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),dU=R.object({description:R.string(),value:R.string()}),lE=R.object({name:R.string(),description:R.string(),parameters:R.any(),metadata:R.record(R.any()).optional()}),pU=R.object({id:R.string(),reason:R.string(),message:R.string().optional(),toolCallId:R.string().optional(),responseSchema:R.record(R.any()).optional(),expiresAt:R.string().optional(),metadata:R.record(R.any()).optional()}),fU=R.object({interruptId:R.string(),status:R.enum(["resolved","cancelled"]),payload:R.any().optional()}),mU=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(uE),tools:R.array(lE),context:R.array(dU),forwardedProps:R.any(),resume:R.array(fU).optional()}),gU=R.any(),Xe=class extends Error{constructor(e){super(e)}},dA=class extends Xe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},hU=R.object({name:R.string(),description:R.string().optional()}),yU=R.object({name:R.string().optional(),type:R.string().optional(),description:R.string().optional(),version:R.string().optional(),provider:R.string().optional(),documentationUrl:R.string().optional(),metadata:R.record(R.unknown()).optional()}),SU=R.object({streaming:R.boolean().optional(),websocket:R.boolean().optional(),httpBinary:R.boolean().optional(),pushNotifications:R.boolean().optional(),resumable:R.boolean().optional()}),vU=R.object({supported:R.boolean().optional(),items:R.array(lE).optional(),parallelCalls:R.boolean().optional(),clientProvided:R.boolean().optional()}),AU=R.object({structuredOutput:R.boolean().optional(),supportedMimeTypes:R.array(R.string()).optional()}),CU=R.object({snapshots:R.boolean().optional(),deltas:R.boolean().optional(),memory:R.boolean().optional(),persistentState:R.boolean().optional()}),xU=R.object({supported:R.boolean().optional(),delegation:R.boolean().optional(),handoffs:R.boolean().optional(),subAgents:R.array(hU).optional()}),bU=R.object({supported:R.boolean().optional(),streaming:R.boolean().optional(),encrypted:R.boolean().optional()}),wU=R.object({image:R.boolean().optional(),audio:R.boolean().optional(),video:R.boolean().optional(),pdf:R.boolean().optional(),file:R.boolean().optional()}),RU=R.object({image:R.boolean().optional(),audio:R.boolean().optional()}),FU=R.object({input:wU.optional(),output:RU.optional()}),EU=R.object({codeExecution:R.boolean().optional(),sandboxed:R.boolean().optional(),maxIterations:R.number().optional(),maxExecutionTime:R.number().optional()}),IU=R.object({supported:R.boolean().optional(),approvals:R.boolean().optional(),interventions:R.boolean().optional(),feedback:R.boolean().optional(),interrupts:R.boolean().optional(),approveWithEdits:R.boolean().optional()}),bde=R.object({identity:yU.optional(),transport:SU.optional(),tools:vU.optional(),output:AU.optional(),state:CU.optional(),multiAgent:xU.optional(),reasoning:bU.optional(),multimodal:FU.optional(),execution:EU.optional(),humanInTheLoop:IU.optional(),custom:R.record(R.unknown()).optional()}),dE=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Le=R.object({type:R.nativeEnum(M),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),TU=Le.extend({type:R.literal(M.TEXT_MESSAGE_START),messageId:R.string(),role:dE.default("assistant"),name:R.string().optional()}),pE=Le.extend({type:R.literal(M.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),PU=Le.extend({type:R.literal(M.TEXT_MESSAGE_END),messageId:R.string()}),kU=Le.extend({type:R.literal(M.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:dE.optional(),delta:R.string().optional(),name:R.string().optional()}),OU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_START)}),_U=pE.omit({messageId:!0,type:!0}).extend({type:R.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),NU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_END)}),DU=Le.extend({type:R.literal(M.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),qU=Le.extend({type:R.literal(M.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),MU=Le.extend({type:R.literal(M.TOOL_CALL_END),toolCallId:R.string()}),VU=Le.extend({messageId:R.string(),type:R.literal(M.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),jU=Le.extend({type:R.literal(M.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),LU=Le.extend({type:R.literal(M.THINKING_START),title:R.string().optional()}),UU=Le.extend({type:R.literal(M.THINKING_END)}),QU=Le.extend({type:R.literal(M.STATE_SNAPSHOT),snapshot:gU}),BU=Le.extend({type:R.literal(M.STATE_DELTA),delta:R.array(R.any())}),GU=Le.extend({type:R.literal(M.MESSAGES_SNAPSHOT),messages:R.array(uE)}),$U=Le.extend({type:R.literal(M.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),HU=Le.extend({type:R.literal(M.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),zU=Le.extend({type:R.literal(M.RAW),event:R.any(),source:R.string().optional()}),WU=Le.extend({type:R.literal(M.CUSTOM),name:R.string(),value:R.any()}),KU=Le.extend({type:R.literal(M.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:mU.optional()}),YU=R.object({type:R.literal("success")}).strict(),JU=R.object({type:R.literal("interrupt"),interrupts:R.array(pU).min(1)}).strict(),XU=R.discriminatedUnion("type",[YU,JU]),ZU=Le.extend({type:R.literal(M.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional(),outcome:XU.nullable().optional().transform(e=>e??void 0)}),eQ=Le.extend({type:R.literal(M.RUN_ERROR),message:R.string(),code:R.string().optional()}),tQ=Le.extend({type:R.literal(M.STEP_STARTED),stepName:R.string()}),rQ=Le.extend({type:R.literal(M.STEP_FINISHED),stepName:R.string()}),nQ=R.union([R.literal("tool-call"),R.literal("message")]),oQ=Le.extend({type:R.literal(M.REASONING_START),messageId:R.string()}),aQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),iQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),sQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_END),messageId:R.string()}),cQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),uQ=Le.extend({type:R.literal(M.REASONING_END),messageId:R.string()}),lQ=Le.extend({type:R.literal(M.REASONING_ENCRYPTED_VALUE),subtype:nQ,entityId:R.string(),encryptedValue:R.string()}),Uf=R.discriminatedUnion("type",[TU,pE,PU,kU,LU,UU,OU,_U,NU,DU,qU,MU,jU,VU,QU,BU,GU,$U,HU,zU,WU,KU,ZU,eQ,tQ,rQ,oQ,aQ,iQ,sQ,cQ,uQ,lQ]);d();c();l();u();var pA={};Ru(pA,{JsonPatchError:()=>at,_areEquals:()=>Tl,applyOperation:()=>ei,applyPatch:()=>Wf,applyReducer:()=>gQ,deepClone:()=>fQ,getValueByPointer:()=>Hf,validate:()=>mE,validator:()=>zf});d();c();l();u();d();c();l();u();var dQ=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pQ=Object.prototype.hasOwnProperty;function Bf(e,t){return pQ.call(e,t)}function Gf(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Bf(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function $f(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function gn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function El(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Qf(e[t]))return!0}else if(typeof e=="object"){for(var n=Gf(e),o=n.length,a=0;a<o;a++)if(Qf(e[n[a]]))return!0}}return!1}function fE(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
32
+ `;function rM(){return typeof navigator<"u"&&navigator.product=="ReactNative"}var nM=["1",1,"yes",!0];function ip(){let e=[];return DS()&&e.push(window.doNotTrack),WS()&&e.push(navigator.doNotTrack,navigator.msDoNotTrack,navigator.globalPrivacyControl),e.some(t=>nM.indexOf(t)!==-1)}var Sw="v15",vw={default:"https://analytics.cloud.coveo.com/rest/ua",production:"https://analytics.cloud.coveo.com/rest/ua",hipaa:"https://analyticshipaa.cloud.coveo.com/rest/ua"};function oM(e=vw.default,t=Sw,r=!1){if(e=e.replace(/\/$/,""),r)return`${e}/${t}`;let n=e.endsWith("/rest")||e.endsWith("/rest/ua");return`${e}${n?"":"/rest"}/${t}`}var aM="38824e1f-37f5-42d3-8372-a4b8fa9df946",en=class{get defaultOptions(){return{endpoint:vw.default,isCustomEndpoint:!1,token:"",version:Sw,beforeSendHooks:[],afterSendHooks:[]}}get version(){return mw}constructor(t){if(this.acceptedLinkReferrers=[],!t)throw new Error("You have to pass options to this constructor");this.options=Object.assign(Object.assign({},this.defaultOptions),t),this.visitorId="",this.bufferedRequests=[],this.beforeSendHooks=[zD,QD].concat(this.options.beforeSendHooks),this.afterSendHooks=this.options.afterSendHooks,this.eventTypeMapping={};let r={baseUrl:this.baseUrl,token:this.options.token,visitorIdProvider:this,preprocessRequest:this.options.preprocessRequest};ip()?this.runtime=new ap:this.runtime=this.options.runtimeEnvironment||this.initRuntime(r),this.addEventTypeMapping(_e.view,{newEventType:_e.view,addClientIdParameter:!0}),this.addEventTypeMapping(_e.click,{newEventType:_e.click,addClientIdParameter:!0}),this.addEventTypeMapping(_e.custom,{newEventType:_e.custom,addClientIdParameter:!0}),this.addEventTypeMapping(_e.search,{newEventType:_e.search,addClientIdParameter:!0})}initRuntime(t){return DS()&&Hi()?new HS(t,()=>{let r=[...this.bufferedRequests];return this.bufferedRequests=[],r}):(rM()&&console.warn(tM),new zS(t))}get storage(){return this.runtime.storage}determineVisitorId(){return Q(this,void 0,void 0,function*(){try{return DS()&&this.extractClientIdFromLink(window.location.href)||(yield this.storage.getItem("visitorId"))||Aa()}catch(t){return console.log("Could not get visitor ID from the current runtime environment storage. Using a random ID instead.",t),Aa()}})}getCurrentVisitorId(){return Q(this,void 0,void 0,function*(){if(!this.visitorId){let t=yield this.determineVisitorId();yield this.setCurrentVisitorId(t)}return this.visitorId})}setCurrentVisitorId(t){return Q(this,void 0,void 0,function*(){this.visitorId=t,yield this.storage.setItem("visitorId",t)})}setClientId(t,r){return Q(this,void 0,void 0,function*(){if(tp(t))this.setCurrentVisitorId(t.toLowerCase());else{if(!r)throw Error("Cannot generate uuid client id without a specific namespace string.");this.setCurrentVisitorId(tw(t,tw(r,aM)))}})}getParameters(t,...r){return Q(this,void 0,void 0,function*(){return yield this.resolveParameters(t,...r)})}getPayload(t,...r){return Q(this,void 0,void 0,function*(){let n=yield this.resolveParameters(t,...r);return yield this.resolvePayloadForParameters(t,n)})}get currentVisitorId(){return typeof(this.visitorId||this.storage.getItem("visitorId"))!="string"&&this.setCurrentVisitorId(Aa()),this.visitorId}set currentVisitorId(t){this.visitorId=t,this.storage.setItem("visitorId",t)}extractClientIdFromLink(t){if(ip())return null;try{let r=new URL(t).searchParams.get(Co.cvo_cid);if(r==null)return null;let n=Co.fromString(r);return!n||!Hi()||!n.validate(document.referrer,this.acceptedLinkReferrers)?null:n.clientId}catch{}return null}resolveParameters(t,...r){return Q(this,void 0,void 0,function*(){let{variableLengthArgumentsNames:n=[],addVisitorIdParameter:o=!1,usesMeasurementProtocol:a=!1,addClientIdParameter:i=!1}=this.eventTypeMapping[t]||{};return yield[y=>n.length>0?this.parseVariableArgumentsPayload(n,y):y[0],y=>Q(this,void 0,void 0,function*(){return Object.assign(Object.assign({},y),{visitorId:o?yield this.getCurrentVisitorId():""})}),y=>Q(this,void 0,void 0,function*(){return i?Object.assign(Object.assign({},y),{clientId:yield this.getCurrentVisitorId()}):y}),y=>a?this.ensureAnonymousUserWhenUsingApiKey(y):y,y=>this.beforeSendHooks.reduce((C,b)=>Q(this,void 0,void 0,function*(){let w=yield C;return yield b(t,w)}),y)].reduce((y,C)=>Q(this,void 0,void 0,function*(){let b=yield y;return yield C(b)}),Promise.resolve(r))})}resolvePayloadForParameters(t,r){return Q(this,void 0,void 0,function*(){let{usesMeasurementProtocol:n=!1}=this.eventTypeMapping[t]||{};return yield[v=>this.setTrackingIdIfTrackingIdNotPresent(v),v=>this.removeEmptyPayloadValues(v,t),v=>this.validateParams(v,t),v=>n?$q(v):v,v=>n?this.removeUnknownParameters(v):v,v=>n?this.processCustomParameters(v):this.mapCustomParametersToCustomData(v)].reduce((v,x)=>Q(this,void 0,void 0,function*(){let y=yield v;return yield x(y)}),Promise.resolve(r))})}makeEvent(t,...r){return Q(this,void 0,void 0,function*(){let{newEventType:n=t}=this.eventTypeMapping[t]||{},o=yield this.resolveParameters(t,...r),a=yield this.resolvePayloadForParameters(t,o);return{eventType:n,payload:a,log:i=>Q(this,void 0,void 0,function*(){return this.bufferedRequests.push({eventType:n,payload:Object.assign(Object.assign({},a),i)}),yield Promise.all(this.afterSendHooks.map(p=>p(t,Object.assign(Object.assign({},o),i)))),yield this.deferExecution(),yield this.sendFromBuffer()})}})}sendEvent(t,...r){return Q(this,void 0,void 0,function*(){return(yield this.makeEvent(t,...r)).log({})})}deferExecution(){return new Promise(t=>setTimeout(t,0))}sendFromBuffer(){return Q(this,void 0,void 0,function*(){let t=this.bufferedRequests.shift();if(t){let{eventType:r,payload:n}=t;return this.runtime.getClientDependingOnEventType(r).sendEvent(r,n)}})}clear(){this.storage.removeItem("visitorId"),new ep().clear()}deleteHttpOnlyVisitorId(){this.runtime.client.deleteHttpCookieVisitorId()}makeSearchEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.search,t)})}sendSearchEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Wn(t,["searchQueryUid"]);return(yield this.makeSearchEvent(n)).log({searchQueryUid:r})})}makeClickEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.click,t)})}sendClickEvent(t){return Q(this,void 0,void 0,function*(){var{searchQueryUid:r}=t,n=Wn(t,["searchQueryUid"]);return(yield this.makeClickEvent(n)).log({searchQueryUid:r})})}makeCustomEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.custom,t)})}sendCustomEvent(t){return Q(this,void 0,void 0,function*(){var{lastSearchQueryUid:r}=t,n=Wn(t,["lastSearchQueryUid"]);return(yield this.makeCustomEvent(n)).log({lastSearchQueryUid:r})})}makeViewEvent(t){return Q(this,void 0,void 0,function*(){return this.makeEvent(_e.view,t)})}sendViewEvent(t){return Q(this,void 0,void 0,function*(){return(yield this.makeViewEvent(t)).log({})})}getVisit(){return Q(this,void 0,void 0,function*(){let r=yield(yield S(`${this.baseUrl}/analytics/visit`)).json();return this.visitorId=r.visitorId,r})}getHealth(){return Q(this,void 0,void 0,function*(){return yield(yield S(`${this.baseUrl}/analytics/monitoring/health`)).json()})}registerBeforeSendEventHook(t){this.beforeSendHooks.push(t)}registerAfterSendEventHook(t){this.afterSendHooks.push(t)}addEventTypeMapping(t,r){this.eventTypeMapping[t]=r}setAcceptedLinkReferrers(t){if(Array.isArray(t)&&t.every(r=>typeof r=="string"))this.acceptedLinkReferrers=t;else throw Error("Parameter should be an array of domain strings")}parseVariableArgumentsPayload(t,r){let n={};for(let o=0,a=r.length;o<a;o++){let i=r[o];if(typeof i=="string")n[t[o]]=i;else if(typeof i=="object")return Object.assign(Object.assign({},n),i)}return n}isKeyAllowedEmpty(t,r){return({[_e.search]:["queryText"]}[t]||[]).indexOf(r)!==-1}removeEmptyPayloadValues(t,r){let n=o=>typeof o<"u"&&o!==null&&o!=="";return Object.keys(t).filter(o=>this.isKeyAllowedEmpty(r,o)||n(t[o])).reduce((o,a)=>Object.assign(Object.assign({},o),{[a]:t[a]}),{})}removeUnknownParameters(t){return Object.keys(t).filter(n=>{if(Kq(n))return!0;console.log(n,"is not processed by coveoua")}).reduce((n,o)=>Object.assign(Object.assign({},n),{[o]:t[o]}),{})}processCustomParameters(t){let{custom:r}=t,n=Wn(t,["custom"]),o={};r&&Zd(r)&&(o=this.lowercaseKeys(r));let a=Yq(n);return Object.assign(Object.assign({},o),a)}mapCustomParametersToCustomData(t){let{custom:r}=t,n=Wn(t,["custom"]);if(r&&Zd(r)){let o=this.lowercaseKeys(r);return Object.assign(Object.assign({},n),{customData:Object.assign(Object.assign({},o),t.customData)})}else return t}lowercaseKeys(t){let r=Object.keys(t),n={};return r.forEach(o=>{n[o.toLowerCase()]=t[o]}),n}validateParams(t,r){let{anonymizeIp:n}=t,o=Wn(t,["anonymizeIp"]);return n!==void 0&&["0","false","undefined","null","{}","[]",""].indexOf(`${n}`.toLowerCase())==-1&&(o.anonymizeIp=1),(r==_e.view||r==_e.click||r==_e.search||r==_e.custom)&&(o.originLevel3=this.limit(o.originLevel3,1024)),r==_e.view&&(o.location=this.limit(o.location,1024)),(r=="pageview"||r=="event")&&(o.referrer=this.limit(o.referrer,2048),o.location=this.limit(o.location,2048),o.page=this.limit(o.page,2048)),o}ensureAnonymousUserWhenUsingApiKey(t){let{userId:r}=t,n=Wn(t,["userId"]);return eM(this.options.token)&&!r?(n.userId="anonymous",n):t}setTrackingIdIfTrackingIdNotPresent(t){let{trackingId:r}=t,n=Wn(t,["trackingId"]);return r?t:(n.hasOwnProperty("custom")&&Zd(n.custom)&&(n.custom.hasOwnProperty("context_website")||n.custom.hasOwnProperty("siteName"))&&(n.trackingId=n.custom.context_website||n.custom.siteName),n.hasOwnProperty("customData")&&Zd(n.customData)&&(n.customData.hasOwnProperty("context_website")||n.customData.hasOwnProperty("siteName"))&&(n.trackingId=n.customData.context_website||n.customData.siteName),n)}limit(t,r){return typeof t=="string"?cq(t,r):t}get baseUrl(){return oM(this.options.endpoint,this.options.version,this.options.isCustomEndpoint)}},Kn;(function(e){e.contextChanged="contextChanged",e.expandToFullUI="expandToFullUI",e.openUserActions="openUserActions",e.showPrecedingSessions="showPrecedingSessions",e.showFollowingSessions="showFollowingSessions",e.clickViewedDocument="clickViewedDocument",e.clickPageView="clickPageView",e.createArticle="createArticle"})(Kn||(Kn={}));var $;(function(e){e.interfaceLoad="interfaceLoad",e.interfaceChange="interfaceChange",e.didyoumeanAutomatic="didyoumeanAutomatic",e.didyoumeanClick="didyoumeanClick",e.resultsSort="resultsSort",e.searchboxSubmit="searchboxSubmit",e.searchboxClear="searchboxClear",e.searchboxAsYouType="searchboxAsYouType",e.breadcrumbFacet="breadcrumbFacet",e.breadcrumbResetAll="breadcrumbResetAll",e.documentQuickview="documentQuickview",e.documentOpen="documentOpen",e.omniboxAnalytics="omniboxAnalytics",e.omniboxFromLink="omniboxFromLink",e.searchFromLink="searchFromLink",e.triggerNotify="notify",e.triggerExecute="execute",e.triggerQuery="query",e.undoTriggerQuery="undoQuery",e.triggerRedirect="redirect",e.pagerResize="pagerResize",e.pagerNumber="pagerNumber",e.pagerNext="pagerNext",e.pagerPrevious="pagerPrevious",e.pagerScrolling="pagerScrolling",e.staticFilterClearAll="staticFilterClearAll",e.staticFilterSelect="staticFilterSelect",e.staticFilterDeselect="staticFilterDeselect",e.facetClearAll="facetClearAll",e.facetSearch="facetSearch",e.facetSelect="facetSelect",e.facetSelectAll="facetSelectAll",e.facetDeselect="facetDeselect",e.facetExclude="facetExclude",e.facetUnexclude="facetUnexclude",e.facetUpdateSort="facetUpdateSort",e.facetShowMore="showMoreFacetResults",e.facetShowLess="showLessFacetResults",e.queryError="query",e.queryErrorBack="errorBack",e.queryErrorClear="errorClearQuery",e.queryErrorRetry="errorRetry",e.recommendation="recommendation",e.recommendationInterfaceLoad="recommendationInterfaceLoad",e.recommendationOpen="recommendationOpen",e.likeSmartSnippet="likeSmartSnippet",e.dislikeSmartSnippet="dislikeSmartSnippet",e.expandSmartSnippet="expandSmartSnippet",e.collapseSmartSnippet="collapseSmartSnippet",e.openSmartSnippetFeedbackModal="openSmartSnippetFeedbackModal",e.closeSmartSnippetFeedbackModal="closeSmartSnippetFeedbackModal",e.sendSmartSnippetReason="sendSmartSnippetReason",e.expandSmartSnippetSuggestion="expandSmartSnippetSuggestion",e.collapseSmartSnippetSuggestion="collapseSmartSnippetSuggestion",e.showMoreSmartSnippetSuggestion="showMoreSmartSnippetSuggestion",e.showLessSmartSnippetSuggestion="showLessSmartSnippetSuggestion",e.openSmartSnippetSource="openSmartSnippetSource",e.openSmartSnippetSuggestionSource="openSmartSnippetSuggestionSource",e.openSmartSnippetInlineLink="openSmartSnippetInlineLink",e.openSmartSnippetSuggestionInlineLink="openSmartSnippetSuggestionInlineLink",e.recentQueryClick="recentQueriesClick",e.clearRecentQueries="clearRecentQueries",e.recentResultClick="recentResultClick",e.clearRecentResults="clearRecentResults",e.noResultsBack="noResultsBack",e.showMoreFoldedResults="showMoreFoldedResults",e.showLessFoldedResults="showLessFoldedResults",e.copyToClipboard="copyToClipboard",e.caseSendEmail="Case.SendEmail",e.feedItemTextPost="FeedItem.TextPost",e.caseAttach="caseAttach",e.caseDetach="caseDetach",e.retryGeneratedAnswer="retryGeneratedAnswer",e.likeGeneratedAnswer="likeGeneratedAnswer",e.dislikeGeneratedAnswer="dislikeGeneratedAnswer",e.openGeneratedAnswerSource="openGeneratedAnswerSource",e.generatedAnswerOpenInlineLink="generatedAnswerOpenInlineLink",e.generatedAnswerStreamEnd="generatedAnswerStreamEnd",e.generatedAnswerSourceHover="generatedAnswerSourceHover",e.generatedAnswerCopyToClipboard="generatedAnswerCopyToClipboard",e.generatedAnswerHideAnswers="generatedAnswerHideAnswers",e.generatedAnswerShowAnswers="generatedAnswerShowAnswers",e.generatedAnswerExpand="generatedAnswerExpand",e.generatedAnswerCollapse="generatedAnswerCollapse",e.generatedAnswerFeedbackSubmit="generatedAnswerFeedbackSubmit",e.rephraseGeneratedAnswer="rephraseGeneratedAnswer",e.generatedAnswerFeedbackSubmitV2="generatedAnswerFeedbackSubmitV2",e.generatedAnswerCitationClick="generatedAnswerCitationClick",e.generatedAnswerFollowupOpenSource="generatedAnswerFollowupOpenSource",e.generatedAnswerCitationDocumentAttach="generatedAnswerCitationDocumentAttach"})($||($={}));var cw={[$.triggerNotify]:"queryPipelineTriggers",[$.triggerExecute]:"queryPipelineTriggers",[$.triggerQuery]:"queryPipelineTriggers",[$.triggerRedirect]:"queryPipelineTriggers",[$.queryErrorBack]:"errors",[$.queryErrorClear]:"errors",[$.queryErrorRetry]:"errors",[$.pagerNext]:"getMoreResults",[$.pagerPrevious]:"getMoreResults",[$.pagerNumber]:"getMoreResults",[$.pagerResize]:"getMoreResults",[$.pagerScrolling]:"getMoreResults",[$.facetSearch]:"facet",[$.facetShowLess]:"facet",[$.facetShowMore]:"facet",[$.recommendation]:"recommendation",[$.likeSmartSnippet]:"smartSnippet",[$.dislikeSmartSnippet]:"smartSnippet",[$.expandSmartSnippet]:"smartSnippet",[$.collapseSmartSnippet]:"smartSnippet",[$.openSmartSnippetFeedbackModal]:"smartSnippet",[$.closeSmartSnippetFeedbackModal]:"smartSnippet",[$.sendSmartSnippetReason]:"smartSnippet",[$.expandSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.collapseSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showMoreSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.showLessSmartSnippetSuggestion]:"smartSnippetSuggestions",[$.clearRecentQueries]:"recentQueries",[$.recentResultClick]:"recentlyClickedDocuments",[$.clearRecentResults]:"recentlyClickedDocuments",[$.showLessFoldedResults]:"folding",[$.caseDetach]:"case",[$.likeGeneratedAnswer]:"generatedAnswer",[$.dislikeGeneratedAnswer]:"generatedAnswer",[$.openGeneratedAnswerSource]:"generatedAnswer",[$.generatedAnswerOpenInlineLink]:"generatedAnswer",[$.generatedAnswerFollowupOpenSource]:"generatedAnswer",[$.generatedAnswerStreamEnd]:"generatedAnswer",[$.generatedAnswerSourceHover]:"generatedAnswer",[$.generatedAnswerCopyToClipboard]:"generatedAnswer",[$.generatedAnswerHideAnswers]:"generatedAnswer",[$.generatedAnswerShowAnswers]:"generatedAnswer",[$.generatedAnswerExpand]:"generatedAnswer",[$.generatedAnswerCollapse]:"generatedAnswer",[$.generatedAnswerFeedbackSubmit]:"generatedAnswer",[$.generatedAnswerFeedbackSubmitV2]:"generatedAnswer",[Kn.expandToFullUI]:"interface",[Kn.openUserActions]:"User Actions",[Kn.showPrecedingSessions]:"User Actions",[Kn.showFollowingSessions]:"User Actions",[Kn.clickViewedDocument]:"User Actions",[Kn.clickPageView]:"User Actions",[Kn.createArticle]:"createArticle"},Ki=class{constructor(){this.runtime=new ap,this.currentVisitorId=""}getPayload(){return Promise.resolve()}getParameters(){return Promise.resolve()}makeEvent(t){return Promise.resolve({eventType:t,payload:null,log:()=>Promise.resolve()})}sendEvent(){return Promise.resolve()}makeSearchEvent(){return this.makeEvent(_e.search)}sendSearchEvent(){return Promise.resolve()}makeClickEvent(){return this.makeEvent(_e.click)}sendClickEvent(){return Promise.resolve()}makeCustomEvent(){return this.makeEvent(_e.custom)}sendCustomEvent(){return Promise.resolve()}makeViewEvent(){return this.makeEvent(_e.view)}sendViewEvent(){return Promise.resolve()}getVisit(){return Promise.resolve({id:"",visitorId:""})}getHealth(){return Promise.resolve({status:""})}registerBeforeSendEventHook(){}registerAfterSendEventHook(){}addEventTypeMapping(){}get version(){return mw}};function iM(e){let t="";return e.filter(r=>{let n=r!==t;return t=r,n})}function sM(e){return e.map(t=>t.replace(/;/g,""))}function Aw(e){let r=e.join(";");return r.length<=256?r:Aw(e.slice(1))}var uw=e=>{let t=sM(e),r=iM(t);return Aw(r)};function lw(e){let t=typeof e.partialQueries=="string"?e.partialQueries:uw(e.partialQueries),r=typeof e.suggestions=="string"?e.suggestions:uw(e.suggestions);return Object.assign(Object.assign({},e),{partialQueries:t,suggestions:r})}var sp=class{constructor(t,r){this.opts=t,this.provider=r;let n=t.enableAnalytics===!1||ip();this.coveoAnalyticsClient=n?new Ki:new en(t)}disable(){this.coveoAnalyticsClient=new Ki}enable(){this.coveoAnalyticsClient=new en(this.opts)}makeInterfaceLoad(){return this.makeSearchEvent($.interfaceLoad)}logInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationInterfaceLoad(){return this.makeSearchEvent($.recommendationInterfaceLoad)}logRecommendationInterfaceLoad(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationInterfaceLoad()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendation(){return this.makeCustomEvent($.recommendation)}logRecommendation(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendation()).log({searchUID:this.provider.getSearchUID()})})}makeRecommendationOpen(t,r){return this.makeClickEvent($.recommendationOpen,t,r)}logRecommendationOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecommendationOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterClearAll(t){return this.makeSearchEvent($.staticFilterClearAll,t)}logStaticFilterClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterSelect(t){return this.makeSearchEvent($.staticFilterSelect,t)}logStaticFilterSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeStaticFilterDeselect(t){return this.makeSearchEvent($.staticFilterDeselect,t)}logStaticFilterDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeStaticFilterDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFetchMoreResults(){return this.makeCustomEvent($.pagerScrolling,{type:"getMoreResults"})}logFetchMoreResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeFetchMoreResults()).log({searchUID:this.provider.getSearchUID()})})}makeInterfaceChange(t){return this.makeSearchEvent($.interfaceChange,t)}logInterfaceChange(t){return Q(this,void 0,void 0,function*(){return(yield this.makeInterfaceChange(t)).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanAutomatic(){return this.makeSearchEvent($.didyoumeanAutomatic)}logDidYouMeanAutomatic(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanAutomatic()).log({searchUID:this.provider.getSearchUID()})})}makeDidYouMeanClick(){return this.makeSearchEvent($.didyoumeanClick)}logDidYouMeanClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeDidYouMeanClick()).log({searchUID:this.provider.getSearchUID()})})}makeResultsSort(t){return this.makeSearchEvent($.resultsSort,t)}logResultsSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeResultsSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxSubmit(){return this.makeSearchEvent($.searchboxSubmit)}logSearchboxSubmit(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxSubmit()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxClear(){return this.makeSearchEvent($.searchboxClear)}logSearchboxClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxClear()).log({searchUID:this.provider.getSearchUID()})})}makeSearchboxAsYouType(){return this.makeSearchEvent($.searchboxAsYouType)}logSearchboxAsYouType(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchboxAsYouType()).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbFacet(t){return this.makeSearchEvent($.breadcrumbFacet,t)}logBreadcrumbFacet(t){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbFacet(t)).log({searchUID:this.provider.getSearchUID()})})}makeBreadcrumbResetAll(){return this.makeSearchEvent($.breadcrumbResetAll)}logBreadcrumbResetAll(){return Q(this,void 0,void 0,function*(){return(yield this.makeBreadcrumbResetAll()).log({searchUID:this.provider.getSearchUID()})})}makeDocumentQuickview(t,r){return this.makeClickEvent($.documentQuickview,t,r)}logDocumentQuickview(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentQuickview(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeDocumentOpen(t,r){return this.makeClickEvent($.documentOpen,t,r)}logDocumentOpen(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeDocumentOpen(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxAnalytics(t){return this.makeSearchEvent($.omniboxAnalytics,lw(t))}logOmniboxAnalytics(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxAnalytics(t)).log({searchUID:this.provider.getSearchUID()})})}makeOmniboxFromLink(t){return this.makeSearchEvent($.omniboxFromLink,lw(t))}logOmniboxFromLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOmniboxFromLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeSearchFromLink(){return this.makeSearchEvent($.searchFromLink)}logSearchFromLink(){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchFromLink()).log({searchUID:this.provider.getSearchUID()})})}makeTriggerNotify(t){return this.makeCustomEvent($.triggerNotify,t)}logTriggerNotify(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerNotify(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerExecute(t){return this.makeCustomEvent($.triggerExecute,t)}logTriggerExecute(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerExecute(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerQuery(){return this.makeCustomEvent($.triggerQuery,{query:this.provider.getSearchEventRequestPayload().queryText},"queryPipelineTriggers")}logTriggerQuery(){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerQuery()).log({searchUID:this.provider.getSearchUID()})})}makeUndoTriggerQuery(t){return this.makeSearchEvent($.undoTriggerQuery,t)}logUndoTriggerQuery(t){return Q(this,void 0,void 0,function*(){return(yield this.makeUndoTriggerQuery(t)).log({searchUID:this.provider.getSearchUID()})})}makeTriggerRedirect(t){return this.makeCustomEvent($.triggerRedirect,Object.assign(Object.assign({},t),{query:this.provider.getSearchEventRequestPayload().queryText}))}logTriggerRedirect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeTriggerRedirect(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerResize(t){return this.makeCustomEvent($.pagerResize,t)}logPagerResize(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerResize(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNumber(t){return this.makeCustomEvent($.pagerNumber,t)}logPagerNumber(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNumber(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerNext(t){return this.makeCustomEvent($.pagerNext,t)}logPagerNext(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerNext(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerPrevious(t){return this.makeCustomEvent($.pagerPrevious,t)}logPagerPrevious(t){return Q(this,void 0,void 0,function*(){return(yield this.makePagerPrevious(t)).log({searchUID:this.provider.getSearchUID()})})}makePagerScrolling(){return this.makeCustomEvent($.pagerScrolling)}logPagerScrolling(){return Q(this,void 0,void 0,function*(){return(yield this.makePagerScrolling()).log({searchUID:this.provider.getSearchUID()})})}makeFacetClearAll(t){return this.makeSearchEvent($.facetClearAll,t)}logFacetClearAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetClearAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSearch(t){return this.makeSearchEvent($.facetSearch,t)}logFacetSearch(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSearch(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelect(t){return this.makeSearchEvent($.facetSelect,t)}logFacetSelect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetDeselect(t){return this.makeSearchEvent($.facetDeselect,t)}logFacetDeselect(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetDeselect(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetExclude(t){return this.makeSearchEvent($.facetExclude,t)}logFacetExclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetExclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUnexclude(t){return this.makeSearchEvent($.facetUnexclude,t)}logFacetUnexclude(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUnexclude(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetSelectAll(t){return this.makeSearchEvent($.facetSelectAll,t)}logFacetSelectAll(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetSelectAll(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetUpdateSort(t){return this.makeSearchEvent($.facetUpdateSort,t)}logFacetUpdateSort(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetUpdateSort(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowMore(t){return this.makeCustomEvent($.facetShowMore,t)}logFacetShowMore(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowMore(t)).log({searchUID:this.provider.getSearchUID()})})}makeFacetShowLess(t){return this.makeCustomEvent($.facetShowLess,t)}logFacetShowLess(t){return Q(this,void 0,void 0,function*(){return(yield this.makeFacetShowLess(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryError(t){return this.makeCustomEvent($.queryError,t)}logQueryError(t){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryError(t)).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorBack(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorBack);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorBack)})}})}logQueryErrorBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorBack()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorRetry(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorRetry);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorRetry)})}})}logQueryErrorRetry(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorRetry()).log({searchUID:this.provider.getSearchUID()})})}makeQueryErrorClear(){return Q(this,void 0,void 0,function*(){let t=yield this.makeCustomEvent($.queryErrorClear);return{description:t.description,log:()=>Q(this,void 0,void 0,function*(){return yield t.log({searchUID:this.provider.getSearchUID()}),this.logSearchEvent($.queryErrorClear)})}})}logQueryErrorClear(){return Q(this,void 0,void 0,function*(){return(yield this.makeQueryErrorClear()).log({searchUID:this.provider.getSearchUID()})})}makeLikeSmartSnippet(){return this.makeCustomEvent($.likeSmartSnippet)}logLikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeDislikeSmartSnippet(){return this.makeCustomEvent($.dislikeSmartSnippet)}logDislikeSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippet(){return this.makeCustomEvent($.expandSmartSnippet)}logExpandSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippet(){return this.makeCustomEvent($.collapseSmartSnippet)}logCollapseSmartSnippet(){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippet()).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetFeedbackModal(){return this.makeCustomEvent($.openSmartSnippetFeedbackModal)}logOpenSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeCloseSmartSnippetFeedbackModal(){return this.makeCustomEvent($.closeSmartSnippetFeedbackModal)}logCloseSmartSnippetFeedbackModal(){return Q(this,void 0,void 0,function*(){return(yield this.makeCloseSmartSnippetFeedbackModal()).log({searchUID:this.provider.getSearchUID()})})}makeSmartSnippetFeedbackReason(t,r){return this.makeCustomEvent($.sendSmartSnippetReason,{reason:t,details:r})}logSmartSnippetFeedbackReason(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSmartSnippetFeedbackReason(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeExpandSmartSnippetSuggestion(t){return this.makeCustomEvent($.expandSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logExpandSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeExpandSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeCollapseSmartSnippetSuggestion(t){return this.makeCustomEvent($.collapseSmartSnippetSuggestion,"documentId"in t?t:{documentId:t})}logCollapseSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeCollapseSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreSmartSnippetSuggestion(t){return this.makeCustomEvent($.showMoreSmartSnippetSuggestion,t)}logShowMoreSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessSmartSnippetSuggestion(t){return this.makeCustomEvent($.showLessSmartSnippetSuggestion,t)}logShowLessSmartSnippetSuggestion(t){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessSmartSnippetSuggestion(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSource(t,r){return this.makeClickEvent($.openSmartSnippetSource,t,r)}logOpenSmartSnippetSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionSource(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionSource,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}makeCopyToClipboard(t,r){return this.makeClickEvent($.copyToClipboard,t,r)}logCopyToClipboard(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeCopyToClipboard(t,r)).log({searchUID:this.provider.getSearchUID()})})}logOpenSmartSnippetSuggestionSource(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionSource(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetInlineLink,t,{contentIDKey:r.contentIDKey,contentIDValue:r.contentIDValue},r)}logOpenSmartSnippetInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeOpenSmartSnippetSuggestionInlineLink(t,r){return this.makeClickEvent($.openSmartSnippetSuggestionInlineLink,t,{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logOpenSmartSnippetSuggestionInlineLink(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenSmartSnippetSuggestionInlineLink(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeRecentQueryClick(){return this.makeSearchEvent($.recentQueryClick)}logRecentQueryClick(){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentQueryClick()).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentQueries(){return this.makeCustomEvent($.clearRecentQueries)}logClearRecentQueries(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentQueries()).log({searchUID:this.provider.getSearchUID()})})}makeRecentResultClick(t,r){return this.makeCustomEvent($.recentResultClick,{info:t,identifier:r})}logRecentResultClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeRecentResultClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeClearRecentResults(){return this.makeCustomEvent($.clearRecentResults)}logClearRecentResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeClearRecentResults()).log({searchUID:this.provider.getSearchUID()})})}makeNoResultsBack(){return this.makeSearchEvent($.noResultsBack)}logNoResultsBack(){return Q(this,void 0,void 0,function*(){return(yield this.makeNoResultsBack()).log({searchUID:this.provider.getSearchUID()})})}makeShowMoreFoldedResults(t,r){return this.makeClickEvent($.showMoreFoldedResults,t,r)}logShowMoreFoldedResults(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeShowMoreFoldedResults(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeShowLessFoldedResults(){return this.makeCustomEvent($.showLessFoldedResults)}logShowLessFoldedResults(){return Q(this,void 0,void 0,function*(){return(yield this.makeShowLessFoldedResults()).log({searchUID:this.provider.getSearchUID()})})}makeEventDescription(t,r){var n;return{actionCause:r,customData:(n=t.payload)===null||n===void 0?void 0:n.customData}}makeCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=cw[n]){this.coveoAnalyticsClient.getParameters;let i=Object.assign(Object.assign({},this.provider.getBaseMetadata()),o),p=Object.assign(Object.assign({},yield this.getBaseEventRequest(i)),{eventType:a,eventValue:n}),f=yield this.coveoAnalyticsClient.makeCustomEvent(p);return{description:this.makeEventDescription(f,n),log:({searchUID:m})=>f.log({lastSearchQueryUid:m})}})}logCustomEvent(t,r){return Q(this,arguments,void 0,function*(n,o,a=cw[n]){return(yield this.makeCustomEvent(n,o,a)).log({searchUID:this.provider.getSearchUID()})})}makeCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){let o=Object.assign(Object.assign({},this.provider.getBaseMetadata()),n),a=Object.assign(Object.assign({},yield this.getBaseEventRequest(o)),{eventType:r,eventValue:t}),i=yield this.coveoAnalyticsClient.makeCustomEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({lastSearchQueryUid:p})}})}logCustomEventWithType(t,r,n){return Q(this,void 0,void 0,function*(){return(yield this.makeCustomEventWithType(t,r,n)).log({searchUID:this.provider.getSearchUID()})})}logSearchEvent(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeSearchEvent(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeSearchEvent(t,r){return Q(this,void 0,void 0,function*(){let n=yield this.getBaseSearchEventRequest(t,r),o=yield this.coveoAnalyticsClient.makeSearchEvent(n);return{description:this.makeEventDescription(o,t),log:({searchUID:a})=>o.log({searchQueryUid:a})}})}makeClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){let a=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{queryPipeline:this.provider.getPipeline(),actionCause:t}),i=yield this.coveoAnalyticsClient.makeClickEvent(a);return{description:this.makeEventDescription(i,t),log:({searchUID:p})=>i.log({searchQueryUid:p})}})}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){return(yield this.makeClickEvent(t,r,n,o)).log({searchUID:this.provider.getSearchUID()})})}getBaseSearchEventRequest(t,r){return Q(this,void 0,void 0,function*(){var n,o;return Object.assign(Object.assign(Object.assign({},yield this.getBaseEventRequest(Object.assign(Object.assign({},r),(o=(n=this.provider).getGeneratedAnswerMetadata)===null||o===void 0?void 0:o.call(n)))),this.provider.getSearchEventRequestPayload()),{queryPipeline:this.provider.getPipeline(),actionCause:t})})}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){let r=Object.assign(Object.assign({},this.provider.getBaseMetadata()),t);return Object.assign(Object.assign(Object.assign({},this.getOrigins()),this.getSplitTestRun()),{customData:r,language:this.provider.getLanguage(),facetState:this.provider.getFacetState?this.provider.getFacetState():[],anonymous:this.provider.getIsAnonymous(),clientId:yield this.getClientId()})})}getOrigins(){var t,r;return{originContext:(r=(t=this.provider).getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:this.provider.getOriginLevel1(),originLevel2:this.provider.getOriginLevel2(),originLevel3:this.provider.getOriginLevel3()}}getClientId(){return this.coveoAnalyticsClient instanceof en?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getSplitTestRun(){let t=this.provider.getSplitTestRunName?this.provider.getSplitTestRunName():"",r=this.provider.getSplitTestRunVersion?this.provider.getSplitTestRunVersion():"";return Object.assign(Object.assign({},t&&{splitTestRunName:t}),r&&{splitTestRunVersion:r})}makeLikeGeneratedAnswer(t){return this.makeCustomEvent($.likeGeneratedAnswer,t)}logLikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeLikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeDislikeGeneratedAnswer(t){return this.makeCustomEvent($.dislikeGeneratedAnswer,t)}logDislikeGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeDislikeGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeOpenGeneratedAnswerSource(t){return this.makeCustomEvent($.openGeneratedAnswerSource,t)}logOpenGeneratedAnswerSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeOpenGeneratedAnswerSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerOpenInlineLink(t){return this.makeCustomEvent($.generatedAnswerOpenInlineLink,t)}logGeneratedAnswerOpenInlineLink(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerOpenInlineLink(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCitationClick(t,r){return this.makeClickEvent($.generatedAnswerCitationClick,Object.assign(Object.assign({},t),{documentPosition:1}),{contentIDKey:r.documentId.contentIdKey,contentIDValue:r.documentId.contentIdValue},r)}logGeneratedAnswerCitationClick(t,r){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCitationClick(t,r)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFollowupOpenSource(t){return this.makeCustomEvent($.generatedAnswerFollowupOpenSource,t)}logGeneratedAnswerFollowupOpenSource(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFollowupOpenSource(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerSourceHover(t){return this.makeCustomEvent($.generatedAnswerSourceHover,t)}logGeneratedAnswerSourceHover(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerSourceHover(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCopyToClipboard(t){return this.makeCustomEvent($.generatedAnswerCopyToClipboard,t)}logGeneratedAnswerCopyToClipboard(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCopyToClipboard(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerHideAnswers(t){return this.makeCustomEvent($.generatedAnswerHideAnswers,t)}logGeneratedAnswerHideAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerHideAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerShowAnswers(t){return this.makeCustomEvent($.generatedAnswerShowAnswers,t)}logGeneratedAnswerShowAnswers(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerShowAnswers(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerExpand(t){return this.makeCustomEvent($.generatedAnswerExpand,t)}logGeneratedAnswerExpand(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerExpand(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerCollapse(t){return this.makeCustomEvent($.generatedAnswerCollapse,t)}logGeneratedAnswerCollapse(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerCollapse(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmit(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmit,t)}logGeneratedAnswerFeedbackSubmit(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmit(t)).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerFeedbackSubmitV2(t){return this.makeCustomEvent($.generatedAnswerFeedbackSubmitV2,t)}logGeneratedAnswerFeedbackSubmitV2(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerFeedbackSubmitV2(t)).log({searchUID:this.provider.getSearchUID()})})}makeRephraseGeneratedAnswer(t){return this.makeSearchEvent($.rephraseGeneratedAnswer,t)}logRephraseGeneratedAnswer(t){return Q(this,void 0,void 0,function*(){return(yield this.makeRephraseGeneratedAnswer(t)).log({searchUID:this.provider.getSearchUID()})})}makeRetryGeneratedAnswer(){return this.makeSearchEvent($.retryGeneratedAnswer)}logRetryGeneratedAnswer(){return Q(this,void 0,void 0,function*(){return(yield this.makeRetryGeneratedAnswer()).log({searchUID:this.provider.getSearchUID()})})}makeGeneratedAnswerStreamEnd(t){return this.makeCustomEvent($.generatedAnswerStreamEnd,t)}logGeneratedAnswerStreamEnd(t){return Q(this,void 0,void 0,function*(){return(yield this.makeGeneratedAnswerStreamEnd(t)).log({searchUID:this.provider.getSearchUID()})})}},cp=Object.assign({},tl),dw=Object.keys(cp).map(e=>cp[e]),zi=class extends VS{constructor({client:t,uuidGenerator:r=Aa}){super({client:t,uuidGenerator:r}),this.ticket={}}getApi(t){let r=super.getApi(t);return r!==null?r:t==="setTicket"?this.setTicket:null}addHooks(){this.addHooksForEvent(),this.addHooksForPageView(),this.addHooksForSVCEvents()}setTicket(t){this.ticket=t}clearPluginData(){this.ticket={}}addHooksForSVCEvents(){this.client.registerBeforeSendEventHook((t,...[r])=>dw.indexOf(t)!==-1?this.addSVCDataToPayload(t,r):r),this.client.registerAfterSendEventHook((t,...[r])=>(dw.indexOf(t)!==-1&&this.updateLocationInformation(t,r),r))}addHooksForPageView(){this.client.addEventTypeMapping(cp.pageview,{newEventType:_e.collect,variableLengthArgumentsNames:["page"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addHooksForEvent(){this.client.addEventTypeMapping(cp.event,{newEventType:_e.collect,variableLengthArgumentsNames:["eventCategory","eventAction","eventLabel","eventValue"],addVisitorIdParameter:!0,usesMeasurementProtocol:!0})}addSVCDataToPayload(t,r){var n;let o=Object.assign(Object.assign(Object.assign(Object.assign({},this.getLocationInformation(t,r)),this.getDefaultContextInformation(t)),this.action?{svcAction:this.action}:{}),Object.keys((n=this.actionData)!==null&&n!==void 0?n:{}).length>0?{svcActionData:this.actionData}:{}),a=this.getTicketPayload();return this.clearData(),Object.assign(Object.assign(Object.assign({},a),o),r)}getTicketPayload(){return fq(this.ticket)}};zi.Id="svc";var up;(function(e){e.click="click",e.flowStart="flowStart"})(up||(up={}));var yr;(function(e){e.enterInterface="ticket_create_start",e.fieldUpdate="ticket_field_update",e.fieldSuggestionClick="ticket_classification_click",e.documentSuggestionClick="documentSuggestionClick",e.documentSuggestionQuickview="documentSuggestionQuickview",e.suggestionRate="suggestion_rate",e.nextCaseStep="ticket_next_stage",e.caseCancelled="ticket_cancel",e.caseSolved="ticket_cancel",e.caseCreated="ticket_create"})(yr||(yr={}));var lp;(function(e){e.quit="Quit",e.solved="Solved"})(lp||(lp={}));var dp=class{constructor(t,r){var n;this.options=t,this.provider=r;let o=((n=t.enableAnalytics)!==null&&n!==void 0?n:!0)&&!ip();this.coveoAnalyticsClient=o?new en(t):new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}disable(){this.coveoAnalyticsClient=new Ki,this.svc=new zi({client:this.coveoAnalyticsClient})}enable(){this.coveoAnalyticsClient=new en(this.options),this.svc=new zi({client:this.coveoAnalyticsClient})}logEnterInterface(t){return this.svc.setAction(yr.enterInterface),this.svc.setTicket(t.ticket),this.sendFlowStartEvent()}logUpdateCaseField(t){return this.svc.setAction(yr.fieldUpdate,{fieldName:t.fieldName}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectFieldSuggestion(t){return this.svc.setAction(yr.fieldSuggestionClick,t.suggestion),this.svc.setTicket(t.ticket),this.sendClickEvent()}logSelectDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionClick,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logQuickviewDocumentSuggestion(t){return this.logClickEvent(yr.documentSuggestionQuickview,t.suggestion.suggestion,{contentIDKey:"permanentId",contentIDValue:t.suggestion.permanentId})}logRateDocumentSuggestion(t){return this.svc.setAction(yr.suggestionRate,Object.assign({rate:t.rating},t.suggestion)),this.svc.setTicket(t.ticket),this.sendClickEvent()}logMoveToNextCaseStep(t){return this.svc.setAction(yr.nextCaseStep,{stage:t?.stage}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCancelled(t){return this.svc.setAction(yr.caseCancelled,{reason:lp.quit}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseSolved(t){return this.svc.setAction(yr.caseSolved,{reason:lp.solved}),this.svc.setTicket(t.ticket),this.sendClickEvent()}logCaseCreated(t){return this.svc.setAction(yr.caseCreated),this.svc.setTicket(t.ticket),this.sendClickEvent()}sendFlowStartEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.flowStart,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}sendClickEvent(){return this.coveoAnalyticsClient.sendEvent("event","svc",up.click,this.provider?{searchHub:this.provider.getOriginLevel1()}:null)}getBaseEventRequest(t){return Q(this,void 0,void 0,function*(){var r,n;let o=Object.assign({},t);return Object.assign(Object.assign({},this.getOrigins()),{customData:o,language:(r=this.provider)===null||r===void 0?void 0:r.getLanguage(),anonymous:(n=this.provider)===null||n===void 0?void 0:n.getIsAnonymous(),clientId:yield this.getClientId()})})}getClientId(){return this.coveoAnalyticsClient instanceof en?this.coveoAnalyticsClient.getCurrentVisitorId():void 0}getOrigins(){var t,r,n,o,a;return{originContext:(r=(t=this.provider)===null||t===void 0?void 0:t.getOriginContext)===null||r===void 0?void 0:r.call(t),originLevel1:(n=this.provider)===null||n===void 0?void 0:n.getOriginLevel1(),originLevel2:(o=this.provider)===null||o===void 0?void 0:o.getOriginLevel2(),originLevel3:(a=this.provider)===null||a===void 0?void 0:a.getOriginLevel3()}}logClickEvent(t,r,n,o){return Q(this,void 0,void 0,function*(){var a,i;let p=Object.assign(Object.assign(Object.assign({},r),yield this.getBaseEventRequest(Object.assign(Object.assign({},n),o))),{searchQueryUid:(i=(a=this.provider)===null||a===void 0?void 0:a.getSearchUID())!==null&&i!==void 0?i:"",actionCause:t});return this.coveoAnalyticsClient.sendClickEvent(p)})}};d();c();l();u();d();c();l();u();var xo=()=>"default";var cM=e=>{let t=e.configuration.search.locale.split("-")[0];return!t||t.length!==2?"en":t},Ca=class{constructor(t){de(this,"getState",t);de(this,"state");this.state=t()}getLanguage(){return cM(this.state)}getBaseMetadata(){let{context:t,configuration:r}=this.state,n=t?.contextValues||{},o={};for(let[a,i]of Object.entries(n)){let p=`context_${a}`;o[p]=i}return r.analytics.analyticsMode==="legacy"&&(o.coveoHeadlessVersion=Ao),o}getOriginContext(){return this.state.configuration.analytics.originContext}getOriginLevel1(){return this.state.searchHub||xo()}getOriginLevel2(){return this.state.configuration.analytics.originLevel2}getOriginLevel3(){return this.state.configuration.analytics.originLevel3}getIsAnonymous(){return this.state.configuration.analytics.anonymous}};d();c();l();u();var Cw=e=>new en(e).getCurrentVisitorId(),ol=(e,t)=>typeof t=="function"?(...r)=>{let n=ku(r[0]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics preprocessRequest. Returning original request."),n}}:void 0,al=(e,t)=>(...r)=>{let n=ku(r[1]);try{return t.apply(t,r)}catch(o){return e.error(o,"Error in analytics hook. Returning original request."),n}};var il=class extends Ca{getSearchUID(){return this.state.documentSuggestion?.status.lastResponseId??""}},xw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o=new il(t)})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??gr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new dp({enableAnalytics:m,token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:ol(e,n),beforeSendHooks:[al(e,r),(v,x)=>(e.info({...x,type:v,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g};d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();function Yi(){return{desiredCount:5,numberOfValues:8,set:{}}}d();c();l();u();d();c();l();u();function uM(e,t){return!!t&&t.facetId in e.facetSet}var Lr=(e,t)=>e.search?.response.facets.find(r=>r.facetId===t),pp=(e,t)=>e.facetSet[t]?.request,Ji=(e,t)=>{let r=Lr(e,t);return uM(e,r)?r:void 0},bw=(e,t)=>Ji(e,t)?.values.filter(r=>r.state==="selected")||[],ww=(e,t)=>Ji(e,t)?.values.filter(r=>r.state!=="idle")||[],tn=e=>e.search.isLoading;d();c();l();u();function Rw(e){if(!e)return{parents:[],values:[]};let t=[],r=e;for(;r.length&&r[0].children.length;)t=[...t,...r],r=r[0].children;let n=r.find(o=>o.state==="selected");return n&&(t=[...t,n],r=[]),{parents:t,values:r}}function cr(e){let{activeValue:t,ancestryMap:r}=lM(e);return t?dM(t,r):[]}function lM(e){let t=[...e],r=new Map;for(;t.length>0;){let n=t.shift();if(n.state==="selected")return{activeValue:n,ancestryMap:r};if(r)for(let o of n.children)r.set(o,n);t.unshift(...n.children)}return{}}function dM(e,t){let r=[];if(!e)return[];let n=e;do r.unshift(n),n=t.get(n);while(n);return r}function pM(e,t){return!!t&&t.facetId in e.categoryFacetSet}var JS=(e,t)=>{let r=Lr(e,t);if(pM(e,r))return r},XS=(e,t)=>e.categoryFacetSet[t]?.request,Fw=(e,t)=>{let r=JS(e,t);return cr(r?.values??[])},ZS=(e,t)=>{let r=XS(e,t);return cr(r?.currentValues??[])};d();c();l();u();function Xi(){return{}}d();c();l();u();function Ew(e,t){return{request:e,tabs:t}}function Zi(){return{}}d();c();l();u();function Iw(e,t){return{request:e,tabs:t}}function es(){return{}}d();c();l();u();function Tw(e,t){return{request:e,hasBreadcrumbs:!0,tabs:t}}function ts(){return{}}var rs=(e,t)=>{let r=_w(t,e),n=r?r.field:"",o=tv(n,e);return{facetId:e,facetField:n,facetTitle:o}};function ns(e,t){let{facetId:r,facetValue:n}=e,o=rs(r,t),a=Nw(t,r);return{...o,facetValue:a==="hierarchical"?Ow(t,r):n}}function ur(e){return{facetSet:e.facetSet??ts(),categoryFacetSet:e.categoryFacetSet??Xi(),dateFacetSet:e.dateFacetSet??Zi(),numericFacetSet:e.numericFacetSet??es(),automaticFacetSet:e.automaticFacetSet??Yi()}}var ev=e=>{let t=[];return gM(e).forEach((r,n)=>{let o=Nw(e,r.facetId),a=AM(r,n+1);if(mM(r)){if(!!!ZS(e,r.facetId).length)return;t.push({...a,...SM(e,r.facetId),facetType:o,state:"selected"});return}r.currentValues.forEach((i,p)=>{if(i.state==="idle")return;let f=Pw(i,p+1,o),m=fM(r)?kw(i):yM(i);t.push({...a,...f,...m})})}),hM(e).forEach((r,n)=>{let o=vM(r,n+1);r.values.forEach((a,i)=>{if(a.state==="idle")return;let p=Pw(a,i+1,"specific"),f=kw(a);t.push({...o,...p,...f})})}),t},fM=e=>e.type==="specific",mM=e=>e.type==="hierarchical",gM=e=>[...Object.values(e.facetSet),...Object.values(e.categoryFacetSet),...Object.values(e.dateFacetSet),...Object.values(e.numericFacetSet)].map(t=>t.request),hM=e=>[...Object.values(e.automaticFacetSet.set)].map(t=>t.response),Pw=(e,t,r)=>({state:e.state,valuePosition:t,facetType:r}),yM=e=>({displayValue:`${e.start}..${e.end}`,value:`${e.start}..${e.end}`,start:e.start,end:e.end,endInclusive:e.endInclusive}),kw=e=>({displayValue:e.value,value:e.value}),Ow=(e,t)=>ZS(e,t).map(n=>n.value).join(";"),SM=(e,t)=>{let n=Ow(e,t);return{value:n,valuePosition:1,displayValue:n}},vM=(e,t)=>({title:tv(e.field,e.field),field:e.field,id:e.field,facetPosition:t}),AM=(e,t)=>({title:tv(e.field,e.facetId),field:e.field,id:e.facetId,facetPosition:t}),tv=(e,t)=>`${e}_${t}`,_w=(e,t)=>e.facetSet[t]?.request||e.categoryFacetSet[t]?.request||e.dateFacetSet[t]?.request||e.numericFacetSet[t]?.request||e.automaticFacetSet.set[t]?.response,Nw=(e,t)=>{let r=_w(e,t);return r?r.type:"specific"};d();c();l();u();d();c();l();u();var rv=e=>e.configuration.search.locale,Dw=e=>e.configuration.search.timezone,fp=e=>e.configuration.accessToken,mp=e=>e.configuration.organizationId,gp=e=>e.configuration.environment,hp=e=>e.configuration?.knowledge?.agentId,qw=e=>e.configuration.knowledge.debugAgentSession;var Ue=e=>{if(CM(e)||nv(e))return e.generatedAnswer?.answerId;if(xM(e))return e.search?.response?.extendedResults?.generativeQuestionAnsweringId},CM=e=>"answer"in e&&"generatedAnswer"in e&&!pe(e.generatedAnswer?.answerConfigurationId),nv=e=>{let t=hp(e);return"generatedAnswer"in e&&typeof t=="string"&&t.trim().length>0},xM=e=>"search"in e&&e.search!==void 0&&typeof e.search=="object",ov=e=>e.generatedAnswer?.fieldsToIncludeInCitations,bo=e=>e.followUpAnswers?.conversationId,bM=e=>e.generatedAnswer?.citations,wM=e=>e.followUpAnswers?.followUpAnswers,RM=tt(wM,e=>e?.flatMap(t=>t.citations)),FM=(e,t)=>t,os=tt(bM,RM,FM,(e,t,r)=>e?.find(n=>n.id===r)??t?.find(n=>n.id===r));d();c();l();u();var dt=()=>({q:"",enableQuerySyntax:!1});d();c();l();u();d();c();l();u();d();c();l();u();var sl=(r=>(r.Ascending="ascending",r.Descending="descending",r))(sl||{}),xa=(a=>(a.Relevancy="relevancy",a.QRE="qre",a.Date="date",a.Field="field",a.NoSort="nosort",a))(xa||{}),rn=e=>{if(_i(e))return e.map(t=>rn(t)).join(",");switch(e.by){case"relevancy":case"qre":case"nosort":return e.by;case"date":return`date ${e.order}`;case"field":return`@${e.field} ${e.order}`;default:return""}},as=()=>({by:"relevancy"}),yp=e=>({by:"date",order:e}),Sp=(e,t)=>({by:"field",order:t,field:e}),vp=()=>({by:"qre"}),Ap=()=>({by:"nosort"}),Mw=new X({values:{by:new Pu({enum:xa,required:!0}),order:new Pu({enum:sl}),field:new L}});function vr(){return rn(as())}d();c();l();u();d();c();l();u();d();c();l();u();var is=class e{static set(t,r,n){let o,a,i;n&&(a=new Date,a.setTime(a.getTime()+n));let p=window.location.hostname,f=/^(\d{1,3}\.){3}\d{1,3}$/,m=/^([0-9a-fA-F]{0,4}:){2,7}[0-9a-fA-F]{0,4}$/;f.test(p)||m.test(p)||p.indexOf(".")===-1?av(t,r,a):(i=p.split("."),o=i[i.length-2]+"."+i[i.length-1],av(t,r,a,o))}static get(t){let r=t+"=",n=document.cookie.split(";");for(let o=0;o<n.length;o++){let a=n[o];if(a=a.replace(/^\s+/,""),a.lastIndexOf(r,0)===0)return a.substring(r.length,a.length)}return null}static erase(t){e.set(t,"",-1)}};function av(e,t,r,n){document.cookie=`${e}=${t}`+(r?`;expires=${r.toUTCString()}`:"")+(n?`;domain=${n}`:"")+";path=/;SameSite=Lax"+(window.location.protocol==="https:"?";Secure":"")}d();c();l();u();function EM(){return typeof navigator<"u"}function Vw(){try{return typeof localStorage<"u"}catch{return!1}}function jw(){try{return typeof sessionStorage<"u"}catch{return!1}}function Lw(){return!!(EM()&&navigator.cookieEnabled)}var Uw=null;function Qw(){return Uw||(Vw()?localStorage:Lw()?new iv:jw()?sessionStorage:new sv)}var ss=class ss{getItem(t){return is.get(`${ss.prefix}${t}`)}removeItem(t){is.erase(`${ss.prefix}${t}`)}setItem(t,r,n){is.set(`${ss.prefix}${t}`,r,n)}};de(ss,"prefix","coveo_");var iv=ss;var sv=class{getItem(t){return null}removeItem(t){}setItem(t,r){}};var Cp="__coveo.analytics.history",IM=20,TM=1e3*60,PM=75,ba=class ba{constructor(t){de(this,"store");this.store=t||Qw()}static getInstance(t){return ba.instance||(ba.instance=new ba(t)),ba.instance}addElement(t){t.internalTime=new Date().getTime(),t=this.cropQueryElement(this.stripEmptyQuery(t));let r=this.getHistoryWithInternalTime();r!==null?this.isValidEntry(t)&&this.setHistory([t].concat(r)):this.setHistory([t])}addElementAsync(t){var _this9=this;return _asyncToGenerator(function*(){t.internalTime=new Date().getTime(),t=_this9.cropQueryElement(_this9.stripEmptyQuery(t));let r=yield _this9.getHistoryWithInternalTimeAsync();r!==null?_this9.isValidEntry(t)&&_this9.setHistory([t].concat(r)):_this9.setHistory([t])})()}getHistory(){let t=this.getHistoryWithInternalTime();return this.stripEmptyQueries(this.stripInternalTime(t))}getHistoryAsync(){var _this0=this;return _asyncToGenerator(function*(){let t=yield _this0.getHistoryWithInternalTimeAsync();return _this0.stripEmptyQueries(_this0.stripInternalTime(t))})()}getHistoryWithInternalTime(){try{let t=this.store.getItem(Cp);return t&&typeof t=="string"?JSON.parse(t):[]}catch{return[]}}getHistoryWithInternalTimeAsync(){var _this1=this;return _asyncToGenerator(function*(){try{let t=yield _this1.store.getItem(Cp);return t?JSON.parse(t):[]}catch{return[]}})()}setHistory(t){try{this.store.setItem(Cp,JSON.stringify(t.slice(0,IM)))}catch{}}clear(){try{this.store.removeItem(Cp)}catch{}}getMostRecentElement(){let t=this.getHistoryWithInternalTime();return Array.isArray(t)?t.sort((n,o)=>(o.internalTime||0)-(n.internalTime||0))[0]:null}cropQueryElement(t){return t.name&&t.value&&t.name.toLowerCase()==="query"&&(t.value=t.value.slice(0,PM)),t}isValidEntry(t){let r=this.getMostRecentElement();return r&&r.value===t.value?(t.internalTime||0)-(r.internalTime||0)>TM:!0}stripInternalTime(t){return Array.isArray(t)?t.map(r=>{let{name:n,time:o,value:a}=r;return{name:n,time:o,value:a}}):[]}stripEmptyQuery(t){let{name:r,time:n,value:o}=t;return r&&typeof o=="string"&&r.toLowerCase()==="query"&&o.trim()===""?{name:r,time:n}:t}stripEmptyQueries(t){return t.map(r=>this.stripEmptyQuery(r))}};de(ba,"instance",null);var cv=ba,Xt=cv;var cl=class cl extends Ca{constructor(){super(...arguments);de(this,"getFacetRequest",r=>this.state.facetSet?.[r]?.request||this.state.categoryFacetSet?.[r]?.request||this.state.dateFacetSet?.[r]?.request||this.state.numericFacetSet?.[r]?.request||this.state.automaticFacetSet?.set[r]?.response)}getFacetState(){return ev(ur(this.getState()))}getPipeline(){return this.state.pipeline||this.state.search?.response.pipeline||cl.fallbackPipelineName}getSearchEventRequestPayload(){return{queryText:this.queryText,responseTime:this.responseTime,results:this.resultURIs,numberOfResults:this.numberOfResults}}getSearchUID(){let r=this.getState();return r.search?.searchResponseId||r.search?.response.searchUid||ir().response.searchUid}getSplitTestRunName(){return this.state.search?.response.splitTestRun}getSplitTestRunVersion(){let r=!!this.getSplitTestRunName(),n=this.state.search?.response.pipeline||this.state.pipeline||cl.fallbackPipelineName;return r?n:void 0}getBaseMetadata(){let r=this.getState(),n=super.getBaseMetadata(),o=Ue(r);return o&&(n.generativeQuestionAnsweringId=o),n}getFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetValue:n,facetTitle:`${a}_${r}`}}getFacetClearAllMetadata(r){let o=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:o,facetTitle:`${o}_${r}`}}getFacetUpdateSortMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,criteria:n,facetTitle:`${a}_${r}`}}getRangeBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),facetId:r,facetField:a,facetRangeEnd:n.end,facetRangeEndInclusive:n.endInclusive,facetRangeStart:n.start,facetTitle:`${a}_${r}`}}getResultSortMetadata(){return{...this.getBaseMetadata(),resultsSortBy:this.state.sortCriteria??vr()}}getStaticFilterToggleMetadata(r,n){return{...this.getBaseMetadata(),staticFilterId:r,staticFilterValue:n}}getStaticFilterClearAllMetadata(r){return{...this.getBaseMetadata(),staticFilterId:r}}getUndoTriggerQueryMetadata(r){return{...this.getBaseMetadata(),undoneQuery:r}}getCategoryBreadcrumbFacetMetadata(r,n){let a=this.getFacetRequest(r)?.field??"";return{...this.getBaseMetadata(),categoryFacetId:r,categoryFacetField:a,categoryFacetPath:n,categoryFacetTitle:`${a}_${r}`}}getOmniboxAnalyticsMetadata(r,n){let o=this.state.querySuggest?.[r],a=o.completions.map(m=>m.expression),i=o.partialQueries.length-1,p=o.partialQueries[i]||"",f=o.responseId;return{...this.getBaseMetadata(),suggestionRanking:a.indexOf(n),partialQuery:p,partialQueries:o.partialQueries.length>0?o.partialQueries:"",suggestions:a.length>0?a:"",querySuggestResponseId:f}}getInterfaceChangeMetadata(){return{...this.getBaseMetadata(),interfaceChangeTo:this.state.configuration.analytics.originLevel2}}getOmniboxFromLinkMetadata(r){return{...this.getBaseMetadata(),...r}}getGeneratedAnswerMetadata(){let r=this.getState(),n={};return r.generatedAnswer?.isVisible!==void 0&&(n.showGeneratedAnswer=r.generatedAnswer.isVisible),n}get resultURIs(){return this.results?.map(r=>({documentUri:r.uri,documentUriHash:r.raw.urihash}))}get results(){return this.state.search?.response.results}get queryText(){return this.state.query?.q||dt().q}get responseTime(){return this.state.search?.duration||ir().duration}get numberOfResults(){return this.state.search?.response.totalCountFiltered||ir().response.totalCountFiltered}};de(cl,"fallbackPipelineName","default");var wo=cl,Bw=({logger:e,getState:t,analyticsClientMiddleware:r=(a,i)=>i,preprocessRequest:n,provider:o})=>{let a=t(),i=a.configuration.accessToken,p=a.configuration.analytics.apiBaseUrl??gr(a.configuration.organizationId,a.configuration.environment,"analytics"),f=a.configuration.analytics.runtimeEnvironment,m=a.configuration.analytics.enabled,g=new sp({token:i,endpoint:p,runtimeEnvironment:f,preprocessRequest:ol(e,n),beforeSendHooks:[al(e,r),(v,x)=>(e.info({...x,type:v,endpoint:p,token:i},"Analytics request"),x)]},o);return m||g.disable(),g},uv=()=>{let t=Xt.getInstance().getHistory().reverse().find(r=>r.name==="PageView"&&r.value);return t?t.value:""};d();c();l();u();function xp(e){let t=Gw(e),r=[e,...t].filter(o=>o.parentResult).map(o=>o.parentResult);return px([e,...t,...r],o=>o.uniqueId)}function Gw(e){return e.childResults?e.childResults.flatMap(t=>[t,...Gw(t)]):[]}d();c();l();u();var nn=()=>"";function Hw(e,t){return{...new wo(t).getBaseMetadata(),actionCause:e,type:e}}function kM(e){return Object.assign(e,{instantlyCallable:!0})}function OM(e,t){let r=a=>{let i=xe(e,a);return kM(Object.assign(i,{type:i.typePrefix}))},n=r(/*#__PURE__*/function(){var _ref10=_asyncToGenerator(function*(a,{getState:i,extra:p}){let{analyticsClientMiddleware:f,preprocessRequest:m,logger:g}=p;return yield(yield t({getState:i,analyticsClientMiddleware:f,preprocessRequest:m,logger:g})).log({state:i(),extra:p})});return function(_x19,_x20){return _ref10.apply(this,arguments)}}());return Object.assign(n,{prepare:function(){var _ref11=_asyncToGenerator(function*({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f}){let{description:m,log:g}=yield t({getState:a,analyticsClientMiddleware:i,preprocessRequest:p,logger:f});return{description:m,action:r(/*#__PURE__*/function(){var _ref12=_asyncToGenerator(function*(v,{getState:x,extra:y}){return yield g({state:x(),extra:y})});return function(_x22,_x23){return _ref12.apply(this,arguments)}}())}});return function prepare(_x21){return _ref11.apply(this,arguments)}}()}),n}var zw=(e,t,r)=>{function n(...o){let a=o.length===1?{...o[0],__legacy__getBuilder:t(o[0].__legacy__getBuilder),analyticsConfigurator:e,providerClass:r}:{prefix:o[0],__legacy__getBuilder:t(o[1]),__legacy__provider:o[2],analyticsConfigurator:e,providerClass:r};return DM(a)}return n},_M=e=>e.configuration.analytics.analyticsMode==="legacy",NM=e=>e.configuration.analytics.analyticsMode==="next",DM=({prefix:e,__legacy__getBuilder:t,__legacy__provider:r,analyticsPayloadBuilder:n,analyticsType:o,analyticsConfigurator:a,providerClass:i})=>(r??(r=p=>new i(p)),OM(e,/*#__PURE__*/function(){var _ref13=_asyncToGenerator(function*({getState:p,analyticsClientMiddleware:f,preprocessRequest:m,logger:g}){let v=[],x={log:function(){var _ref14=_asyncToGenerator(function*({state:F}){for(let I of v)yield I(F)});return function log(_x25){return _ref14.apply(this,arguments)}}()},y=p(),C=a({getState:p,logger:g,analyticsClientMiddleware:f,preprocessRequest:m,provider:r(p)}),b=yield t(C,p());x.description=b?.description,v.push(/*#__PURE__*/function(){var _ref15=_asyncToGenerator(function*(F){_M(F)&&(yield qM(b,r,F,g,C.coveoAnalyticsClient))});return function(_x26){return _ref15.apply(this,arguments)}}());let{emit:w}=el(y);return v.push(/*#__PURE__*/function(){var _ref16=_asyncToGenerator(function*(F){if(NM(F)&&o&&n){let I=n(F);yield GM(w,o,I)}});return function(_x27){return _ref16.apply(this,arguments)}}()),x});return function(_x24){return _ref13.apply(this,arguments)}}()));function qM(_x28,_x29,_x30,_x31,_x32){return _qM.apply(this,arguments)}function _qM(){_qM=_asyncToGenerator(function*(e,t,r,n,o){t(()=>r);let a=yield e?.log({searchUID:t(()=>r).getSearchUID()});n.info({client:o,response:a},"Analytics response")});return _qM.apply(this,arguments)}var MM=e=>r=>(n,o)=>Promise.resolve({description:{actionCause:e},log:function(){var _ref17=_asyncToGenerator(function*(a){r(n,o)});return function log(_x33){return _ref17.apply(this,arguments)}}()}),J=zw(e=>Bw({...e,provider:e.provider||new wo(e.getState)}),e=>e,wo),N7=zw(xw,MM("caseAssist"),il);var pt=(e,t)=>{let r=a=>a+(t.pagination?.firstResult??0),n=-1,o=t.search?.results;return n=Zw(e,o),n<0&&(n=BM(e,o)),n<0&&(n=0),VM(e,r(n),t)};var Ww=(e,t)=>({sourceName:Yw(e),documentPosition:1,documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()}),Kw=(e,t)=>({sourceName:Yw(e),documentTitle:e.title,documentUri:e.uri,documentUrl:e.clickUri,queryPipeline:t.pipeline||nn()});function Yw(e){let t=e.source;return pe(t)?"unknown":t}var Jw=e=>({contentIdKey:"permanentid",contentIdValue:e.permanentid||""});function VM(e,t,r){let n=e.raw.collection;return{collectionName:typeof n=="string"?n:"default",documentAuthor:UM(e),...($w(e)?{documentCategory:$w(e)}:{}),documentPosition:t+1,documentTitle:e.title,documentUri:e.uri,documentUriHash:e.raw.urihash,documentUrl:e.clickUri,rankingModifier:e.rankingModifier||"",sourceName:QM(e),queryPipeline:r.pipeline||nn()}}function $w(e){return e.raw?.objecttype||void 0}var Ke=e=>(e.raw.permanentid||console.warn("Missing field permanentid on result. This might cause many issues with your Coveo deployment. See https://docs.coveo.com/en/1913 and https://docs.coveo.com/en/1640 for more information.",e),{contentIDKey:"permanentid",contentIDValue:e.raw.permanentid||""}),Xw={urihash:new L,sourcetype:new L,permanentid:new L},bp={uniqueId:z,raw:new X({values:Xw}),title:z,uri:z,clickUri:z,rankingModifier:new L({required:!1,emptyAllowed:!0})};function jM(e){return Object.assign({},...Object.keys(Xw).map(t=>({[t]:e[t]})))}function LM(e){return Object.assign({},...Object.keys(bp).map(t=>({[t]:e[t]})),{raw:jM(e.raw)})}function UM(e){let t=e.raw.author;return pe(t)?"unknown":Array.isArray(t)?t.join(";"):`${t}`}function QM(e){let t=e.raw.source;return pe(t)?"unknown":t}var Zt=e=>new ve(bp).validate(LM(e));function BM(e,t){for(let[r,n]of t.entries()){let o=xp(n);if(Zw(e,o)!==-1)return r}return-1}function Zw(e,t=[]){return t.findIndex(({uniqueId:r})=>r===e.uniqueId)}function GM(_x34,_x35,_x36){return _GM.apply(this,arguments)}function _GM(){_GM=_asyncToGenerator(function*(e,t,r){yield e(t,r)});return _GM.apply(this,arguments)}d();c();l();u();var lv=e=>O(e,{evt:z,type:st}),eR=e=>J("analytics/generic/search",t=>{lv(e);let{evt:r,meta:n}=e;return t.makeSearchEvent(r,n)}),tR=e=>J("analytics/generic/click",(t,r)=>(Zt(e.result),lv(e),t.makeClickEvent(e.evt,pt(e.result,r),Ke(e.result),e.meta))),rR=e=>J("analytics/generic/custom",t=>(lv(e),t.makeCustomEventWithType(e.evt,e.type,e.meta))),wp=()=>J("analytics/interface/load",e=>e.makeInterfaceLoad()),Ro=()=>J("analytics/interface/change",(e,t)=>e.makeInterfaceChange({interfaceChangeTo:t.configuration.analytics.originLevel2})),Rp=()=>J("analytics/interface/searchFromLink",e=>e.makeSearchFromLink()),Fp=e=>J("analytics/interface/omniboxFromLink",t=>t.makeOmniboxFromLink(e)),nR=()=>({actionCause:"interfaceLoad"}),cs=()=>({actionCause:"interfaceChange"}),oR=()=>({actionCause:"searchFromLink"}),aR=()=>({actionCause:"omniboxFromLink"});d();c();l();u();var dv=()=>st,iR=()=>z,on=P("configuration/updateBasicConfiguration",e=>O(e,{accessToken:st,environment:new L({required:!1,constrainTo:["prod","hipaa","stg","dev"]}),organizationId:st})),Ar=P("configuration/updateSearchConfiguration",e=>O(e,{proxyBaseUrl:new L({required:!1,url:!0}),pipeline:new L({required:!1,emptyAllowed:!0}),searchHub:st,timezone:st,locale:st,authenticationProviders:new ie({required:!1,each:z})})),$M={enabled:new fe({default:!0}),originContext:dv(),originLevel2:dv(),originLevel3:dv(),proxyBaseUrl:new L({required:!1,url:!0}),runtimeEnvironment:new Be,anonymous:new fe({default:!1}),deviceId:st,userDisplayName:st,documentLocation:st,trackingId:Gx,analyticsMode:new L({constrainTo:["legacy","next"],required:!1,default:"next"}),source:new X({options:{required:!1},values:Xb.reduce((e,t)=>(e[t]=Bx,e),{})})},Fo=P("configuration/updateAnalyticsConfiguration",e=>O(e,$M)),us=P("configuration/analytics/disable"),ls=P("configuration/analytics/enable"),Ep=P("configuration/analytics/originlevel2",e=>O(e,{originLevel2:iR()})),Ip=P("configuration/analytics/originlevel3",e=>O(e,{originLevel3:iR()})),Tp=P("knowledge/setAgentId",e=>O(e,new L({required:!0})));d();c();l();u();d();c();l();u();d();c();l();u();var Pp={q:new L,enableQuerySyntax:new fe,aq:new L,cq:new L,firstResult:new re({min:0}),numberOfResults:new re({min:0}),sortCriteria:new L,f:new X,fExcluded:new X,cf:new X,nf:new X,mnf:new X,df:new X,debug:new fe,sf:new X,tab:new L,af:new X};var Me=P("searchParameters/restore",e=>O(e,Pp)),ds=P("searchParameters/restoreTab",e=>O(e,z));d();c();l();u();var Eo=P("debug/enable"),ps=P("debug/disable");d();c();l();u();var Io=()=>!1;var fs=ae(Io(),e=>{e.addCase(Eo,()=>!0).addCase(ps,()=>!1).addCase(Me,(t,r)=>r.payload.debug??t)});d();c();l();u();d();c();l();u();var pv=P("history/undo"),fv=P("history/redo"),lr=P("history/snapshot"),ul=xe("history/back",/*#__PURE__*/function(){var _ref18=_asyncToGenerator(function*(e,{dispatch:t}){t(pv()),yield t(qe())});return function(_x37,_x38){return _ref18.apply(this,arguments)}}()),kp=xe("history/forward",/*#__PURE__*/function(){var _ref19=_asyncToGenerator(function*(e,{dispatch:t}){t(fv()),yield t(qe())});return function(_x39,_x40){return _ref19.apply(this,arguments)}}()),qe=xe("history/change",/*#__PURE__*/function(){var _ref20=_asyncToGenerator(function*(e,{getState:t}){return t().history.present});return function(_x41,_x42){return _ref20.apply(this,arguments)}}());d();c();l();u();var ms=P("pipeline/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var gs=ae(nn(),e=>{e.addCase(ms,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.pipeline??t).addCase(Ar,(t,r)=>r.payload.pipeline||t)});d();c();l();u();d();c();l();u();var ft=P("breadcrumb/deselectAll"),hs=P("breadcrumb/deselectAllNonBreadcrumbs");d();c();l();u();var an=P("facet/updateFacetAutoSelection",e=>O(e,{allow:new fe({required:!0})}));d();c();l();u();d();c();l();u();var ll=class extends wo{constructor(r){super(r);de(this,"getState",r)}get activeInstantResultQuery(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].q;return null}get activeInstantResultCache(){let r=this.getState().instantResults;for(let n in r)for(let o in r[n].cache)if(r[n].cache[o].isActive)return r[n].cache[o];return null}get results(){return this.activeInstantResultCache?.results}get queryText(){return this.activeInstantResultQuery??dt().q}get responseTime(){return this.activeInstantResultCache?.duration??ir().duration}get numberOfResults(){return this.activeInstantResultCache?.totalCountFiltered??ir().response.totalCountFiltered}getSearchUID(){return this.activeInstantResultCache?.searchUid||super.getSearchUID()}};var sR=e=>J({prefix:"analytics/instantResult/open",__legacy__getBuilder:(t,r)=>(Zt(e),t.makeDocumentOpen(pt(e,r),Ke(e))),__legacy__provider:t=>new ll(t),analyticsType:"itemClick",analyticsPayloadBuilder:t=>{let r=pt(e,t),n=Ke(e);return{responseId:e.searchUid??"",position:r.documentPosition,itemMetadata:{uniqueFieldName:n.contentIDKey,uniqueFieldValue:n.contentIDValue,title:r.documentTitle,author:r.documentAuthor,url:r.documentUrl}}}}),cR=()=>J("analytics/instantResult/searchboxAsYouType",e=>e.makeSearchboxAsYouType(),e=>new ll(e)),uR=()=>({actionCause:"searchboxAsYouType"});d();c();l();u();var mv={id:z},HM={...mv,q:Ge},ys=P("instantResults/register",e=>O(e,mv)),sn=P("instantResults/updateQuery",e=>O(e,HM)),Ss=P("instantResults/clearExpired",e=>O(e,mv));d();c();l();u();var Op=new re({required:!0,min:0}),vs=P("pagination/registerNumberOfResults",e=>O(e,Op)),As=P("pagination/updateNumberOfResults",e=>O(e,Op)),Cs=P("pagination/registerPage",e=>O(e,Op)),cn=P("pagination/updatePage",e=>O(e,Op)),xs=P("pagination/nextPage"),bs=P("pagination/previousPage");d();c();l();u();var Vt=P("query/updateQuery",e=>O(e,{q:new L,enableQuerySyntax:new fe}));d();c();l();u();d();c();l();u();var Ur=(e,t,r)=>({analytics:{clientId:t.clientId,clientTimestamp:new Date().toISOString(),documentReferrer:t.referrer,documentLocation:t.location,originContext:e.originContext,...(r&&{actionCause:r.actionCause}),...(r&&{customData:r.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.deviceId&&{deviceId:e.deviceId}),...(e.trackingId&&{trackingId:e.trackingId}),capture:t.capture??t.clientId!=="",source:$i(e)}});var ws=(e,t,r)=>({accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:t.referrer,timezone:e.configuration.search.timezone,...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&Ur(e.configuration.analytics,t,r)),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})});d();c();l();u();d();c();l();u();d();c();l();u();var Rs=/*#__PURE__*/function(){var _ref21=_asyncToGenerator(function*(e,t){let r=e.analyticsMode==="next";return{analytics:{clientId:yield Cw(e),clientTimestamp:new Date().toISOString(),documentReferrer:e.originLevel3,originContext:e.originContext,...(t&&{actionCause:t.actionCause,customData:t.customData}),...(t&&!r&&{customData:t.customData}),...(e.userDisplayName&&{userDisplayName:e.userDisplayName}),...(e.documentLocation&&{documentLocation:e.documentLocation}),...(e.deviceId&&{deviceId:e.deviceId}),...(uv()&&{pageId:uv()}),...(r&&e.trackingId&&{trackingId:e.trackingId}),capture:r,...(r&&{source:$i(e)})}}});return function Rs(_x43,_x44){return _ref21.apply(this,arguments)}}();var To=/*#__PURE__*/function(){var _ref22=_asyncToGenerator(function*(e,t){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:e.configuration.search.apiBaseUrl??St(e.configuration.organizationId,e.configuration.environment),locale:e.configuration.search.locale,debug:e.debug,tab:e.configuration.analytics.originLevel2,referrer:e.configuration.analytics.originLevel3,timezone:e.configuration.search.timezone,...(e.configuration.analytics.enabled&&{actionsHistory:Xt.getInstance().getHistory()}),...(e.advancedSearchQueries?.aq&&{aq:e.advancedSearchQueries.aq}),...(e.advancedSearchQueries?.cq&&{cq:e.advancedSearchQueries.cq}),...(e.advancedSearchQueries?.lq&&{lq:e.advancedSearchQueries.lq}),...(e.advancedSearchQueries?.dq&&{dq:e.advancedSearchQueries.dq}),...(e.context&&{context:e.context.contextValues}),...(e.fields&&!e.fields.fetchAllFields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.dictionaryFieldContext&&{dictionaryFieldContext:e.dictionaryFieldContext.contextValues}),...(e.pipeline&&{pipeline:e.pipeline}),...(e.query&&{q:e.query.q,enableQuerySyntax:e.query.enableQuerySyntax}),...(e.searchHub&&{searchHub:e.searchHub}),...(e.sortCriteria&&{sortCriteria:e.sortCriteria}),...(e.configuration.analytics.enabled&&(yield Rs(e.configuration.analytics,t))),...(e.excerptLength&&!pe(e.excerptLength.length)&&{excerptLength:e.excerptLength.length}),...(e.configuration.search.authenticationProviders.length&&{authentication:e.configuration.search.authenticationProviders.join(",")})}});return function To(_x45,_x46){return _ref22.apply(this,arguments)}}();d();c();l();u();d();c();l();u();var Qr=()=>({cq:"",cqWasSet:!1,aq:"",aqWasSet:!1,lq:"",lqWasSet:!1,dq:"",dqWasSet:!1,defaultFilters:{cq:"",aq:"",lq:"",dq:""}});var gv=()=>J("search/logFetchMoreResults",e=>e.makeFetchMoreResults()),Po=e=>J("search/queryError",(t,r)=>t.makeQueryError({query:r.query?.q||dt().q,aq:r.advancedSearchQueries?.aq||Qr().aq,cq:r.advancedSearchQueries?.cq||Qr().cq,dq:r.advancedSearchQueries?.dq||Qr().dq,errorType:e.type,errorMessage:e.message}));d();c();l();u();d();c();l();u();var pl=Vr(_p(),1),mR=Vr(lR(),1);d();c();l();u();var Np=Vr(_p(),1),pR=Vr(dR(),1);Np.default.extend(pR.default);var Fs="YYYY/MM/DD@HH:mm:ss",zM="1401-01-01";function wa(e,t){let r=(0,Np.default)(e,t);return!r.isValid()&&!t?(0,Np.default)(e,Fs):r}function dl(e){return e.format(Fs)}function fR(e){return dl(wa(e))===e}function Dp(e,t){let r=wa(e,t);if(!r.isValid()){let n=". Please provide a date format string in the configuration options. See https://day.js.org/docs/en/parse/string-format for more information.",o=` with the format "${t}"`;throw new Error(`Could not parse the provided date "${e}"${t?o:n}`)}xv(r)}function xv(e){if(e.isBefore(zM))throw new Error(`Date is before year 1401, which is unsupported by the API: ${e}`)}pl.default.extend(mR.default);var gR=["past","now","next"],hR=["minute","hour","day","week","month","quarter","year"],WM=e=>{let t=e==="now";return{amount:new re({required:!t,min:1}),unit:new L({required:!t,constrainTo:hR}),period:new L({required:!0,constrainTo:gR})}};function ko(e){if(typeof e=="string"&&!un(e))throw new Error(`The value "${e}" is not respecting the relative date format "period-amount-unit"`);let t=typeof e=="string"?bv(e):e;new ve(WM(t.period)).validate(t);let r=SR(t),n=JSON.stringify(t);if(!r.isValid())throw new Error(`Date is invalid: ${n}`);xv(r)}function yR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":case"next":return`${t}-${r}-${n}`;case"now":return t}}function SR(e){let{period:t,amount:r,unit:n}=e;switch(t){case"past":return(0,pl.default)().subtract(r,n);case"next":return(0,pl.default)().add(r,n);case"now":return(0,pl.default)()}}function fl(e){return dl(SR(bv(e)))}function vR(e){return e.toLocaleLowerCase().split("-")}function un(e){let[t,r,n]=vR(e);if(t==="now")return!0;if(!gR.includes(t)||!hR.includes(n))return!1;let o=parseInt(r,10);return!(Number.isNaN(o)||o<=0)}function AR(e){return!!e&&typeof e=="object"&&"period"in e}function bv(e){let[t,r,n]=vR(e);return t==="now"?{period:"now"}:{period:t,amount:r?parseInt(r,10):void 0,unit:n||void 0}}function CR(e){return ko(e),bv(e)}d();c();l();u();function xR(e){return e.type==="dateRange"}function bR(e){return`start${e}`}function wR(e){return`end${e}`}var wv=()=>({dateFacetValueMap:{}});function KM(e,t,r){let n=e.start,o=e.end;return un(n)&&(n=fl(n),r.dateFacetValueMap[t][bR(n)]=e.start),un(o)&&(o=fl(o),r.dateFacetValueMap[t][wR(o)]=e.end),{...e,start:n,end:o}}function Rv(e,t){if(xR(e)){let{facetId:r,currentValues:n}=e;return t.dateFacetValueMap[r]={},{...e,currentValues:n.map(o=>KM(o,r,t))}}return e}function Oo(e){let t=wv();return{request:{...e,facets:e.facets?.map(n=>Rv(n,t))},mappings:t}}function YM(e,t,r){return{...e,start:r.dateFacetValueMap[t][bR(e.start)]||e.start,end:r.dateFacetValueMap[t][wR(e.end)]||e.end}}function JM(e,t){return e.facetId in t.dateFacetValueMap}function XM(e,t){return JM(e,t)?{...e,values:e.values.map(r=>YM(r,e.facetId,t))}:e}function qp(e,t){return"success"in e?{success:{...e.success,facets:e.success.facets?.map(n=>XM(n,t))}}:e}d();c();l();u();d();c();l();u();var Es=P("didYouMean/enable"),Mp=P("didYouMean/disable"),Is=P("didYouMean/automaticCorrections/disable"),Vp=P("didYouMean/automaticCorrections/enable"),Cr=P("didYouMean/correction",e=>O(e,z)),Ra=P("didYouMean/automaticCorrections/mode",e=>O(e,new L({constrainTo:["next","legacy"],emptyAllowed:!1,required:!0})));d();c();l();u();var jp=()=>J("analytics/didyoumean/click",e=>e.makeDidYouMeanClick()),Fv=()=>J("analytics/didyoumean/automatic",e=>e.makeDidYouMeanAutomatic()),RR=()=>({actionCause:"didYouMeanClick"}),FR=()=>({actionCause:"didYouMeanAutomatic"});d();c();l();u();d();c();l();u();function Lp(){return{contextValues:{}}}d();c();l();u();function Up(){return{contextValues:{}}}d();c();l();u();function Ev(){return{enabled:!0,tabs:{}}}function Qp(){return{freezeFacetOrder:!1,facets:{}}}d();c();l();u();function Bp(){return[]}d();c();l();u();function xr(){return{firstResult:0,defaultNumberOfResults:10,numberOfResults:10,totalCountFiltered:0}}d();c();l();u();function Gp(){return{}}d();c();l();u();function $p(){return{}}d();c();l();u();function Hp(){return{}}function ER(){return Br({})}function Br(e){return{context:e.context||Lp(),dictionaryFieldContext:e.dictionaryFieldContext||Up(),facetSet:e.facetSet||ts(),numericFacetSet:e.numericFacetSet||es(),dateFacetSet:e.dateFacetSet||Zi(),categoryFacetSet:e.categoryFacetSet||Xi(),automaticFacetSet:e.automaticFacetSet??Yi(),pagination:e.pagination||xr(),query:e.query||dt(),tabSet:e.tabSet||Hp(),advancedSearchQueries:e.advancedSearchQueries||Qr(),staticFilterSet:e.staticFilterSet||$p(),querySet:e.querySet||Gp(),sortCriteria:e.sortCriteria||vr(),pipeline:e.pipeline||nn(),searchHub:e.searchHub||xo(),facetOptions:e.facetOptions||Qp(),facetOrder:e.facetOrder??Bp(),debug:e.debug??Io()}}d();c();l();u();var ZM=new X({values:{undoneQuery:Ge},options:{required:!0}}),zp=()=>J("analytics/trigger/query",(e,t)=>t.triggers?.queryModification.newQuery?e.makeTriggerQuery():null),Wp=e=>J("analytics/trigger/query/undo",t=>(O(e,ZM),t.makeUndoTriggerQuery(e))),Kp=()=>J("analytics/trigger/notify",(e,t)=>t.triggers?.notifications.length?e.makeTriggerNotify({notifications:t.triggers.notifications}):null),Yp=()=>J("analytics/trigger/redirect",(e,t)=>t.triggers?.redirectTo?e.makeTriggerRedirect({redirectedTo:t.triggers.redirectTo}):null),Jp=()=>J("analytics/trigger/execute",(e,t)=>t.triggers?.executions.length?e.makeTriggerExecute({executions:t.triggers.executions}):null);d();c();l();u();var _o=P("trigger/query/ignore",e=>O(e,new L({emptyAllowed:!0,required:!0}))),Ts=P("trigger/query/modification",e=>O(e,new X({values:{originalQuery:st,modification:st}})));d();c();l();u();d();c();l();u();d();c();l();u();function No(e){return Object.values(e).map(t=>t.request)}function ml(e,t){let r={};e.forEach(a=>{r[a.facetId]=a});let n=[];t.forEach(a=>{a in r&&(n.push(r[a]),delete r[a])});let o=Object.values(r);return[...n,...o]}function IR(e){return No(e).map(t=>{let n=t.currentValues.some(({state:o})=>o!=="idle");return t.generateAutomaticRanges&&!n?{...t,currentValues:[]}:t})}var Iv={alphanumericDescending:{type:"alphanumeric",order:"descending"},alphanumericNaturalDescending:{type:"alphanumericNatural",order:"descending"}};function eV(e){return No(e).map(t=>{let r=Iv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function tV(e){return[...eV(e.facetSet??{}),...IR(e.numericFacetSet??{}),...IR(e.dateFacetSet??{}),...No(e.categoryFacetSet??{})]}function rV(e){return tV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function Xp(e){return ml(rV(e),e.facetOrder??[])}d();c();l();u();var Do=/*#__PURE__*/function(){var _ref23=_asyncToGenerator(function*(e,t){let r=aV(e),n=Xp(e),o=nV(e),a=yield To(e,t),i=()=>e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0;return Oo({...a,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(r&&{cq:r}),...(n.length&&{facets:n}),...(e.pagination&&{numberOfResults:i(),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:o}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function Do(_x47,_x48){return _ref23.apply(this,arguments)}}();function nV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(oV).filter(r=>r.currentValues.length>0):void 0}function oV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function aV(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=iV(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}function iV(e){return Object.values(e.staticFilterSet||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o})}var qo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x49,_x50){var _this10=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=qp(yield _this10.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this10.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this11=this;return _asyncToGenerator(function*(){return _this11.processQueryErrorOrContinue(t)??(yield _this11.processQueryCorrectionsOrContinue(t))??(yield _this11.processQueryTriggersOrContinue(t))??_this11.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(Po(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this12=this;return _asyncToGenerator(function*(){let r=_this12.getState(),n=_this12.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o||!a)return null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this12.processLegacyDidYouMeanAutoCorrection(t):_this12.processModernDidYouMeanAutoCorrection(t);return _this12.dispatch(lr(Br(_this12.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this13=this;return _asyncToGenerator(function*(){let r=_this13.getCurrentQuery(),n=_this13.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this13.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this13.dispatch(Po(a.response.error)),_this13.rejectWithValue(a.response.error)):(_this13.logOriginalAnalyticsQueryBeforeAutoCorrection(t),_this13.dispatch(lr(Br(_this13.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r,analyticsAction:Fv()})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o,analyticsAction:Fv()}}logOriginalAnalyticsQueryBeforeAutoCorrection(t){let r=this.getState(),n=this.getSuccessResponse(t);this.analyticsAction?.()(this.dispatch,()=>this.getStateAfterResponse(t.queryExecuted,t.duration,r,n),this.extra)}processQueryTriggersOrContinue(t){var _this14=this;return _asyncToGenerator(function*(){let r=_this14.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this14.getState().triggers?.queryModification.queryToIgnore===n)return _this14.dispatch(_o("")),null;_this14.analyticsAction&&(yield _this14.dispatch(_this14.analyticsAction));let a=_this14.getCurrentQuery(),i=yield _this14.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this14.dispatch(Po(i.response.error)),_this14.rejectWithValue(i.response.error)):(_this14.dispatch(lr(Br(_this14.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a,analyticsAction:zp()})})()}getStateAfterResponse(t,r,n,o){return{...n,query:{q:t,enableQuerySyntax:n.query?.enableQuerySyntax??dt().enableQuerySyntax},search:{...ir(),duration:r,response:o,results:o.results}}}processSuccessResponse(t){return this.dispatch(lr(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery(),analyticsAction:this.analyticsAction}}getSuccessResponse(t){return Rd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this15=this;return _asyncToGenerator(function*(){_this15.onUpdateQueryForCorrection(t);let r=yield _this15.fetchFromAPI(yield Do(_this15.getState()),{origin:"mainSearch"});return _this15.dispatch(Cr(t)),r})()}automaticallyRetryQueryWithTriggerModification(t){var _this16=this;return _asyncToGenerator(function*(){return _this16.dispatch(Ts({newQuery:t,originalQuery:_this16.getCurrentQuery()})),_this16.onUpdateQueryForCorrection(t),yield _this16.fetchFromAPI(yield Do(_this16.getState()),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get analyticsAction(){return this.config.analyticsAction}get rejectWithValue(){return this.config.rejectWithValue}};var TR=xe("search/executeSearch",/*#__PURE__*/function(){var _ref24=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Zp(r,t,e)});return function(_x51,_x52){return _ref24.apply(this,arguments)}}()),PR=xe("search/fetchPage",/*#__PURE__*/function(){var _ref25=_asyncToGenerator(function*(e,t){let r=t.getState();return yield Pv(r,t,e)});return function(_x53,_x54){return _ref25.apply(this,arguments)}}()),kR=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref26=_asyncToGenerator(function*(e,t){let r=t.getState();return yield kv(t,r)});return function(_x55,_x56){return _ref26.apply(this,arguments)}}()),OR=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref27=_asyncToGenerator(function*(e,t){let r=t.getState();return yield lV(t,e,r)});return function(_x57,_x58){return _ref27.apply(this,arguments)}}()),_R=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref28=_asyncToGenerator(function*(e,t){return Tv(e,t)});return function(_x59,_x60){return _ref28.apply(this,arguments)}}()),sV=/*#__PURE__*/function(){var _ref29=_asyncToGenerator(function*(e,t){let r=yield Do(e,t);return r.request={...r.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},r});return function sV(_x61,_x62){return _ref29.apply(this,arguments)}}(),cV=/*#__PURE__*/function(){var _ref30=_asyncToGenerator(function*(e,t,r){let n=yield To(e);return Oo({...n,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:r,q:t})});return function cV(_x63,_x64,_x65){return _ref30.apply(this,arguments)}}(),uV=/*#__PURE__*/function(){var _ref31=_asyncToGenerator(function*(e,t){let r=yield Do(e,t);return r.request.numberOfResults=0,r});return function uV(_x66,_x67){return _ref31.apply(this,arguments)}}(),NR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})};function Tv(_x68,_x69){return _Tv.apply(this,arguments)}function _Tv(){_Tv=_asyncToGenerator(function*(e,t){O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:r,maxResultsPerQuery:n}=e,o=t.getState(),a=new qo({...t,analyticsAction:cR()},m=>{t.dispatch(sn({q:m,id:e.id}))}),i=yield cV(o,r,n),p=yield a.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),f=yield a.process(p);return"response"in f?{results:f.response.results,searchUid:f.response.searchUid,analyticsAction:f.analyticsAction,totalCountFiltered:f.response.totalCountFiltered,duration:f.duration}:f});return _Tv.apply(this,arguments)}function Pv(_x70,_x71,_x72){return _Pv.apply(this,arguments)}function _Pv(){_Pv=_asyncToGenerator(function*(e,t,r){NR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new qo({...t,analyticsAction:r}),f=yield Do(e,i),m=yield p.fetchFromAPI(f,{origin:"mainSearch"});return yield p.process(m)});return _Pv.apply(this,arguments)}function kv(_x73,_x74){return _kv.apply(this,arguments)}function _kv(){_kv=_asyncToGenerator(function*(e,t){let{analyticsClientMiddleware:r,preprocessRequest:n,logger:o}=e.extra,{description:a}=yield gv().prepare({getState:()=>e.getState(),analyticsClientMiddleware:r,preprocessRequest:n,logger:o}),i=new qo({...e,analyticsAction:gv()}),p=yield sV(t,a),f=yield i.fetchFromAPI(p,{origin:"mainSearch"});return yield i.process(f)});return _kv.apply(this,arguments)}function lV(_x75,_x76,_x77){return _lV.apply(this,arguments)}function _lV(){_lV=_asyncToGenerator(function*(e,t,r){let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=e.extra,{description:i}=yield t.prepare({getState:()=>e.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=new qo({...e,analyticsAction:t}),f=yield uV(r,i),m=yield p.fetchFromAPI(f,{origin:"facetValues"});return yield p.process(m)});return _lV.apply(this,arguments)}function Zp(_x78,_x79,_x80){return _Zp.apply(this,arguments)}function _Zp(){_Zp=_asyncToGenerator(function*(e,t,r){NR(e);let{analyticsClientMiddleware:n,preprocessRequest:o,logger:a}=t.extra,{description:i}=yield r.prepare({getState:()=>t.getState(),analyticsClientMiddleware:n,preprocessRequest:o,logger:a}),p=yield Do(e,i),f=new qo({...t,analyticsAction:r}),m=yield f.fetchFromAPI(p,{origin:"mainSearch"});return yield f.process(m)});return _Zp.apply(this,arguments)}d();c();l();u();d();c();l();u();d();c();l();u();var DR=tt(e=>e.staticFilterSet,e=>Object.values(e||{}).map(r=>{let n=r.values.filter(a=>a.state==="selected"&&!!a.expression.trim()),o=n.map(a=>a.expression).join(" OR ");return n.length>1?`(${o})`:o}));var br=/*#__PURE__*/function(){var _ref32=_asyncToGenerator(function*(e,t,r){let n=_v(e),o=dV(e),a=pV(e),i=e.configuration.analytics.analyticsMode==="legacy"?yield To(e,r):ws(e,t,r);return Oo({...i,...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(n&&{cq:n}),...(o.length&&{facets:o}),...(e.pagination&&{numberOfResults:Ov(e),firstResult:e.pagination.firstResult}),...(e.facetOptions&&{facetOptions:{freezeFacetOrder:e.facetOptions.freezeFacetOrder}}),...(e.folding?.enabled&&{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}),...(e.automaticFacetSet&&{generateAutomaticFacets:{desiredCount:e.automaticFacetSet.desiredCount,numberOfValues:e.automaticFacetSet.numberOfValues,currentFacets:a}}),...(e.generatedAnswer&&{pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:e.generatedAnswer.fieldsToIncludeInCitations}}})})});return function br(_x81,_x82,_x83){return _ref32.apply(this,arguments)}}();function Ov(e){return e.pagination?e.pagination.firstResult+e.pagination.numberOfResults>5e3?5e3-e.pagination.firstResult:e.pagination.numberOfResults:void 0}function dV(e){return ml(mV(e),e.facetOrder??[])}function pV(e){let t=e.automaticFacetSet?.set;return t?Object.values(t).map(r=>r.response).map(fV).filter(r=>r.currentValues.length>0):void 0}function fV(e){let{field:t,label:r,values:n}=e,o=n.filter(a=>a.state==="selected");return{field:t,label:r,currentValues:o}}function mV(e){return gV(e).filter(({facetId:t})=>e.facetOptions?.facets[t]?.enabled??!0)}function gV(e){return[...hV(e.facetSet??{}),...qR(e.numericFacetSet??{}),...qR(e.dateFacetSet??{}),...No(e.categoryFacetSet??{})]}function hV(e){return No(e).map(t=>{let r=Iv[t.sortCriteria];return r?{...t,sortCriteria:r}:t})}function qR(e){return No(e).map(t=>{let r=t.currentValues,n=r.some(({state:a})=>a!=="idle"),o=r.some(a=>a.previousState);return t.generateAutomaticRanges&&!n&&!o?{...t,currentValues:[]}:t})}function _v(e){let t=e.advancedSearchQueries?.cq.trim()||"",n=Object.values(e.tabSet||{}).find(a=>a.isActive)?.expression.trim()||"",o=DR(e);return[t,n,...o].filter(a=>!!a).join(" AND ")}var Mo=class{constructor(t,r=n=>{this.dispatch(Vt({q:n}))}){de(this,"config",t);de(this,"onUpdateQueryForCorrection",r)}fetchFromAPI(_x84,_x85){var _this17=this;return _asyncToGenerator(function*({mappings:t,request:r},n){let o=Date.now(),a=qp(yield _this17.extra.apiClient.search(r,n),t),i=Date.now()-o,p=_this17.getState().query?.q||"";return{response:a,duration:i,queryExecuted:p,requestExecuted:r}}).apply(this,arguments)}process(t){var _this18=this;return _asyncToGenerator(function*(){return _this18.processQueryErrorOrContinue(t)??(yield _this18.processQueryCorrectionsOrContinue(t))??(yield _this18.processQueryTriggersOrContinue(t))??_this18.processSuccessResponse(t)})()}processQueryErrorOrContinue(t){return vt(t.response)?(this.dispatch(Po(t.response.error)),this.rejectWithValue(t.response.error)):null}processQueryCorrectionsOrContinue(t){var _this19=this;return _asyncToGenerator(function*(){let r=_this19.getState(),n=_this19.getSuccessResponse(t);if(!n||!r.didYouMean)return null;let{enableDidYouMean:o,automaticallyCorrectQuery:a}=r.didYouMean,{results:i,queryCorrections:p,queryCorrection:f}=n;if(!o)return null;if(!a)return!pe(f)&&!pe(f.correctedQuery)?_this19.processModernDidYouMeanAutoCorrection(t):null;let m=i.length===0&&p&&p.length!==0,g=!pe(f)&&!pe(f.correctedQuery);if(!m&&!g)return null;let x=m?yield _this19.processLegacyDidYouMeanAutoCorrection(t):_this19.processModernDidYouMeanAutoCorrection(t);return _this19.dispatch(lr(Br(_this19.getState()))),x})()}processLegacyDidYouMeanAutoCorrection(t){var _this20=this;return _asyncToGenerator(function*(){let r=_this20.getCurrentQuery(),n=_this20.getSuccessResponse(t);if(!n.queryCorrections)return null;let{correctedQuery:o}=n.queryCorrections[0],a=yield _this20.automaticallyRetryQueryWithCorrection(o);return vt(a.response)?(_this20.dispatch(Po(a.response.error)),_this20.rejectWithValue(a.response.error)):(_this20.dispatch(lr(Br(_this20.getState()))),{...a,response:{...a.response.success,queryCorrections:n.queryCorrections},automaticallyCorrected:!0,originalQuery:r})})()}processModernDidYouMeanAutoCorrection(t){let r=this.getSuccessResponse(t),{correctedQuery:n,originalQuery:o}=r.queryCorrection;return this.onUpdateQueryForCorrection(n),{...t,response:{...r},queryExecuted:n,automaticallyCorrected:!0,originalQuery:o}}processQueryTriggersOrContinue(t){var _this21=this;return _asyncToGenerator(function*(){let r=_this21.getSuccessResponse(t);if(!r)return null;let n=r.triggers.find(p=>p.type==="query")?.content||"";if(!n)return null;if(_this21.getState().triggers?.queryModification.queryToIgnore===n)return _this21.dispatch(_o("")),null;let a=_this21.getCurrentQuery(),i=yield _this21.automaticallyRetryQueryWithTriggerModification(n);return vt(i.response)?(_this21.dispatch(Po(i.response.error)),_this21.rejectWithValue(i.response.error)):(_this21.dispatch(lr(Br(_this21.getState()))),{...i,response:{...i.response.success},automaticallyCorrected:!1,originalQuery:a})})()}processSuccessResponse(t){return this.dispatch(lr(Br(this.getState()))),{...t,response:this.getSuccessResponse(t),automaticallyCorrected:!1,originalQuery:this.getCurrentQuery()}}getSuccessResponse(t){return Rd(t.response)?t.response.success:null}automaticallyRetryQueryWithCorrection(t){var _this22=this;return _asyncToGenerator(function*(){_this22.onUpdateQueryForCorrection(t);let r=_this22.getState(),{actionCause:n}=FR(),o=yield _this22.fetchFromAPI(yield br(r,_this22.extra.navigatorContext,{actionCause:n}),{origin:"mainSearch"});return _this22.dispatch(Cr(t)),o})()}automaticallyRetryQueryWithTriggerModification(t){var _this23=this;return _asyncToGenerator(function*(){return _this23.dispatch(Ts({newQuery:t,originalQuery:_this23.getCurrentQuery()})),_this23.onUpdateQueryForCorrection(t),yield _this23.fetchFromAPI(yield br(_this23.getState(),_this23.extra.navigatorContext),{origin:"mainSearch"})})()}getCurrentQuery(){let t=this.getState();return t.query?.q!==void 0?t.query.q:""}get extra(){return this.config.extra}getState(){return this.config.getState()}get dispatch(){return this.config.dispatch}get rejectWithValue(){return this.config.rejectWithValue}};var Ps=xe("search/prepareForSearchWithQuery",(e,t)=>{let{dispatch:r}=t;O(e,{q:new L,enableQuerySyntax:new fe,clearFilters:new fe}),e.clearFilters&&(r(ft()),r(hs())),r(an({allow:!0})),r(Vt({q:e.q,enableQuerySyntax:e.enableQuerySyntax})),r(cn(1))}),MR=P("search/updateSearchAction"),W=xe("search/executeSearch",/*#__PURE__*/function(){var _ref33=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Zp(r,t,e.legacy);VR(r);let n=e.next?jR(e.next):void 0,o=yield br(r,t.extra.navigatorContext,n),a=new Mo({...t,analyticsAction:n??{}}),i=yield a.fetchFromAPI(o,{origin:"mainSearch"});return yield a.process(i)});return function(_x86,_x87){return _ref33.apply(this,arguments)}}()),jt=xe("search/fetchPage",/*#__PURE__*/function(){var _ref34=_asyncToGenerator(function*(e,t){let r=t.getState();if(VR(r),r.configuration.analytics.analyticsMode==="legacy"||!e.next)return Pv(r,t,e.legacy);let n=new Mo({...t,analyticsAction:e.next}),o=yield br(r,t.extra.navigatorContext,e.next),a=yield n.fetchFromAPI(o,{origin:"mainSearch"});return yield n.process(a)});return function(_x88,_x89){return _ref34.apply(this,arguments)}}()),wr=xe("search/fetchMoreResults",/*#__PURE__*/function(){var _ref35=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return kv(t,r);let n=Hw("browseResults",t.getState),o=new Mo({...t,analyticsAction:n}),a=yield yV(r,t.extra.navigatorContext,n),i=yield o.fetchFromAPI(a,{origin:"mainSearch"});return yield o.process(i)});return function(_x90,_x91){return _ref35.apply(this,arguments)}}()),Rr=xe("search/fetchFacetValues",/*#__PURE__*/function(){var _ref36=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Zp(r,t,e.legacy);let n=new Mo({...t,analyticsAction:{}}),o=yield vV(r,t.extra.navigatorContext),a=yield n.fetchFromAPI(o,{origin:"facetValues"});return yield n.process(a)});return function(_x92,_x93){return _ref36.apply(this,arguments)}}()),ks=xe("search/fetchInstantResults",/*#__PURE__*/function(){var _ref37=_asyncToGenerator(function*(e,t){let r=t.getState();if(r.configuration.analytics.analyticsMode==="legacy")return Tv(e,t);O(e,{id:z,q:z,maxResultsPerQuery:new re({required:!0,min:1}),cacheTimeout:new re});let{q:n,maxResultsPerQuery:o}=e,a=jR(uR()),i=yield SV(r,t.extra.navigatorContext,n,o,a),p=new Mo({...t,analyticsAction:a},g=>{t.dispatch(sn({q:g,id:e.id}))}),f=yield p.fetchFromAPI(i,{origin:"instantResults",disableAbortWarning:!0}),m=yield p.process(f);return"response"in m?{results:m.response.results,searchUid:m.response.searchUid,totalCountFiltered:m.response.totalCountFiltered,duration:m.duration}:m});return function(_x94,_x95){return _ref37.apply(this,arguments)}}()),yV=/*#__PURE__*/function(){var _ref38=_asyncToGenerator(function*(e,t,r){let n=yield br(e,t,r);return n.request={...n.request,firstResult:(e.pagination?.firstResult??0)+(e.search?.results.length??0)},n});return function yV(_x96,_x97,_x98){return _ref38.apply(this,arguments)}}(),SV=/*#__PURE__*/function(){var _ref39=_asyncToGenerator(function*(e,t,r,n,o){let a=ws(e,t,o);return Oo({...a,...(e.didYouMean&&{enableDidYouMean:e.didYouMean.enableDidYouMean}),numberOfResults:n,q:r})});return function SV(_x99,_x100,_x101,_x102,_x103){return _ref39.apply(this,arguments)}}(),vV=/*#__PURE__*/function(){var _ref40=_asyncToGenerator(function*(e,t,r){let n=yield br(e,t,r);return n.request.numberOfResults=0,n});return function vV(_x104,_x105,_x106){return _ref40.apply(this,arguments)}}(),VR=e=>{e.configuration.analytics.enabled&&Xt.getInstance().addElement({name:"Query",...(e.query?.q&&{value:e.query.q}),time:JSON.stringify(new Date)})},jR=e=>({actionCause:e.actionCause,type:e.actionCause});d();c();l();u();d();c();l();u();var Vo=(e,t)=>{let r=e;return pe(r[t])?pe(e.raw[t])?null:e.raw[t]:r[t]},AV=e=>t=>e.every(r=>!pe(Vo(t,r))),CV=e=>t=>e.every(r=>pe(Vo(t,r))),xV=(e,t)=>r=>{let n=LR(e,r);return t.some(o=>n.some(a=>`${a}`.toLowerCase()===o.toLowerCase()))},bV=(e,t)=>r=>{let n=LR(e,r);return t.every(o=>n.every(a=>`${a}`.toLowerCase()!==o.toLowerCase()))},LR=(e,t)=>{let r=Vo(t,e);return md(r)?r:[r]},UR={getResultProperty:Vo,fieldsMustBeDefined:AV,fieldsMustNotBeDefined:CV,fieldMustMatch:xV,fieldMustNotMatch:bV};function gl(e){return e.search.response.searchUid!==""}function QR(e,t,r){return e.search.results.find(n=>Vo(n,t)===r)}var Nv=tt(e=>e.search,e=>e?.searchAction?.actionCause||"");d();c();l();u();d();c();l();u();var Os=P("app/setError");function Dv(e,t){let r=t.payload??null;r&&(e.response=ir().response,e.results=[],e.questionAnswer=qi()),e.error=r,e.isLoading=!1}function qv(e,t){e.error=null,e.response=t.payload.response,e.queryExecuted=t.payload.queryExecuted,e.duration=t.payload.duration,e.isLoading=!1}function wV(e,t){qv(e,t),e.results=t.payload.response.results.map(r=>({...r,searchUid:t.payload.response.searchUid})),e.searchResponseId=t.payload.response.searchUid,e.questionAnswer=t.payload.response.questionAnswer,e.extendedResults=t.payload.response.extendedResults}function BR(e,t){e.isLoading=!0,e.searchAction=t.meta.arg.next,e.requestId=t.meta.requestId}function RV(e,t){e.isLoading=!0,e.searchAction={actionCause:"browseResults"},e.requestId=t.meta.requestId}var he=ae(ir(),e=>{e.addCase(W.rejected,(t,r)=>Dv(t,r)),e.addCase(wr.rejected,(t,r)=>Dv(t,r)),e.addCase(jt.rejected,(t,r)=>Dv(t,r)),e.addCase(W.fulfilled,(t,r)=>{wV(t,r)}),e.addCase(wr.fulfilled,(t,r)=>{qv(t,r),t.results=[...t.results,...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(jt.fulfilled,(t,r)=>{qv(t,r),t.results=[...r.payload.response.results.map(n=>({...n,searchUid:r.payload.response.searchUid}))]}),e.addCase(Rr.fulfilled,(t,r)=>{t.response.facets=r.payload.response.facets,t.response.searchUid=r.payload.response.searchUid}),e.addCase(W.pending,BR),e.addCase(wr.pending,RV),e.addCase(jt.pending,BR),e.addCase(MR,(t,r)=>{t.searchAction=r.payload}),e.addCase(Os,(t,r)=>{t.error=r.payload,t.isLoading=!1})});d();c();l();u();d();c();l();u();var _s=P("searchHub/set",e=>O(e,new L({required:!0,emptyAllowed:!0})));var Ns=ae(xo(),e=>{e.addCase(_s,(t,r)=>r.payload).addCase(qe.fulfilled,(t,r)=>r.payload?.searchHub??t).addCase(Ar,(t,r)=>r.payload.searchHub||t)});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var GR=class extends Error{constructor(t){super(t[0].message);de(this,"issues");this.name="SchemaError",this.issues=t}};var Jn="uninitialized",Vv="pending",yl="fulfilled",Sl="rejected";function $R(e){return{status:e,isUninitialized:e===Jn,isLoading:e===Vv,isSuccess:e===yl,isError:e===Sl}}var HR=Jr;function iF(e,t){if(e===t||!(HR(e)&&HR(t)||Array.isArray(e)&&Array.isArray(t)))return t;let r=Object.keys(t),n=Object.keys(e),o=r.length===n.length,a=Array.isArray(t)?[]:{};for(let i of r)a[i]=iF(e[i],t[i]),o&&(o=e[i]===a[i]);return o?e:a}function jv(e,t,r){return e.reduce((n,o,a)=>(t(o,a)&&n.push(r(o,a)),n),[]).flat()}function FV(e){return new RegExp("(^|:)//").test(e)}function EV(){return typeof document>"u"?!0:document.visibilityState!=="hidden"}function Bv(e){return e!=null}function zR(e){return[...(e?.values()??[])].filter(Bv)}function IV(){return typeof navigator>"u"||navigator.onLine===void 0?!0:navigator.onLine}var TV=e=>e.replace(/\/$/,""),PV=e=>e.replace(/^\//,"");function kV(e,t){if(!e)return t;if(!t)return e;if(FV(t))return t;let r=e.endsWith("/")||!t.startsWith("?")?"/":"";return e=TV(e),t=PV(t),`${e}${r}${t}`}function rf(e,t,r){return e.has(t)?e.get(t):e.set(t,r(t)).get(t)}var Lv=()=>new Map,OV=e=>{let t=new s.AbortController;return setTimeout(()=>{let r="signal timed out",n="TimeoutError";t.abort(typeof DOMException<"u"?new DOMException(r,n):Object.assign(new Error(r),{name:n}))},e),t.signal},_V=(...e)=>{for(let r of e)if(r.aborted)return s.AbortSignal.abort(r.reason);let t=new s.AbortController;for(let r of e)r.addEventListener("abort",()=>t.abort(r.reason),{signal:t.signal,once:!0});return t.signal},WR=(...e)=>S(...e),NV=e=>e.status>=200&&e.status<=299,DV=e=>/ion\/(vnd\.api\+)?json/.test(e.get("content-type")||"");function KR(e){if(!Jr(e))return e;let t={...e};for(let[r,n]of Object.entries(t))n===void 0&&delete t[r];return t}var qV=e=>typeof e=="object"&&(Jr(e)||Array.isArray(e)||typeof e.toJSON=="function");function sF({baseUrl:e,prepareHeaders:t=v=>v,fetchFn:r=WR,paramsSerializer:n,isJsonContentType:o=DV,jsonContentType:a="application/json",jsonReplacer:i,timeout:p,responseHandler:f,validateStatus:m,...g}={}){return typeof S>"u"&&r===WR&&console.warn("Warning: `fetch` is not available. Please supply a custom `fetchFn` property to use `fetchBaseQuery` on SSR environments."),(/*#__PURE__*/function(){var _ref41=_asyncToGenerator(function*(x,y,C){let{getState:b,extra:w,endpoint:F,forced:I,type:E}=y,k,{url:T,headers:D=new A(g.headers),params:G=void 0,responseHandler:U=f??"json",validateStatus:V=m??NV,timeout:B=p,...j}=typeof x=="string"?{url:x}:x,_={...g,signal:B?_V(y.signal,OV(B)):y.signal,...j};D=new A(KR(D)),_.headers=(yield t(D,{getState:b,arg:x,extra:w,endpoint:F,forced:I,type:E,extraOptions:C}))||D;let N=qV(_.body);if(_.body!=null&&!N&&typeof _.body!="string"&&_.headers.delete("content-type"),!_.headers.has("content-type")&&N&&_.headers.set("content-type",a),N&&o(_.headers)&&(_.body=JSON.stringify(_.body,i)),_.headers.has("accept")||(U==="json"?_.headers.set("accept","application/json"):U==="text"&&_.headers.set("accept","text/plain, text/html, */*")),G){let ue=~T.indexOf("?")?"&":"?",Se=n?n(G):new URLSearchParams(KR(G));T+=ue+Se}T=kV(e,T);let q=new Request(T,_);k={request:new Request(T,_)};let H;try{H=yield r(q)}catch(ue){return{error:{status:(ue instanceof Error||typeof DOMException<"u"&&ue instanceof DOMException)&&ue.name==="TimeoutError"?"TIMEOUT_ERROR":"FETCH_ERROR",error:String(ue)},meta:k}}let ne=H.clone();k.response=ne;let te,Z="";try{let ue;if(yield Promise.all([v(H,U).then(Se=>te=Se,Se=>ue=Se),ne.text().then(Se=>Z=Se,()=>{})]),ue)throw ue}catch(ue){return{error:{status:"PARSING_ERROR",originalStatus:H.status,data:Z,error:String(ue)},meta:k}}return V(H,te)?{data:te,meta:k}:{error:{status:H.status,data:te},meta:k}});return function(_x107,_x108,_x109){return _ref41.apply(this,arguments)}}());function v(_x110,_x111){return _v2.apply(this,arguments)}function _v2(){_v2=_asyncToGenerator(function*(x,y){if(typeof y=="function")return y(x);if(y==="content-type"&&(y=o(x.headers)?"json":"text"),y==="json"){let C=yield x.text();return C.length?JSON.parse(C):null}return x.text()});return _v2.apply(this,arguments)}}var Ds=class{constructor(e,t=void 0){de(this,"value");de(this,"meta");this.value=e,this.meta=t}};function MV(){return _MV.apply(this,arguments)}function _MV(){_MV=_asyncToGenerator(function*(e=0,t=5,r){let n=Math.min(e,t),o=~~((Math.random()+.4)*(300<<n));yield new Promise((a,i)=>{let p=setTimeout(()=>a(),o);if(r){let f=()=>{clearTimeout(p),i(new Error("Aborted"))};r.aborted?(clearTimeout(p),i(new Error("Aborted"))):r.addEventListener("abort",f,{once:!0})}})});return _MV.apply(this,arguments)}function cF(e,t){throw Object.assign(new Ds({error:e,meta:t}),{throwImmediately:!0})}function Mv(e){e.aborted&&cF({status:"CUSTOM_ERROR",error:"Aborted"})}var YR={},VV=(e,t)=>(/*#__PURE__*/function(){var _ref42=_asyncToGenerator(function*(r,n,o){let a=[5,(t||YR).maxRetries,(o||YR).maxRetries].filter(g=>g!==void 0),[i]=a.slice(-1),f={maxRetries:i,backoff:MV,retryCondition:(g,v,{attempt:x})=>x<=i,...t,...o},m=0;for(;;){Mv(n.signal);try{let g=yield e(r,n,o);if(g.error)throw new Ds(g);return g}catch(g){if(m++,g.throwImmediately){if(g instanceof Ds)return g.value;throw g}if(g instanceof Ds){if(!f.retryCondition(g.value.error,r,{attempt:m,baseQueryApi:n,extraOptions:o}))return g.value}else if(m>f.maxRetries)return{error:g};Mv(n.signal);try{yield f.backoff(m,f.maxRetries,n.signal)}catch(v){throw Mv(n.signal),v}}}});return function(_x112,_x113,_x114){return _ref42.apply(this,arguments)}}()),uF=Object.assign(VV,{fail:cF}),of="__rtkq/",jV="online",LV="offline";var lF="focused";var Gv=P(`${of}${lF}`),dF=P(`${of}un${lF}`),$v=P(`${of}${jV}`),pF=P(`${of}${LV}`);var Cl="query",fF="mutation",mF="infinitequery";function af(e){return e.type===Cl}function UV(e){return e.type===fF}function sf(e){return e.type===mF}function nf(e){return af(e)||sf(e)}function Hv(e,t,r,n,o,a){let i=QV(e)?e(t,r,n,o):e;return i?jv(i,Bv,p=>a(gF(p))):[]}function QV(e){return typeof e=="function"}function gF(e){return typeof e=="string"?{type:e}:e}function BV(e,t){return e.catch(t)}var qs=(e,t)=>e.endpointDefinitions[t],vl=Symbol("forceQueryFn"),Uv=e=>typeof e[vl]=="function";function GV({serializeQueryArgs:e,queryThunk:t,infiniteQueryThunk:r,mutationThunk:n,api:o,context:a,getInternalState:i}){let p=T=>i(T)?.runningQueries,f=T=>i(T)?.runningMutations,{unsubscribeQueryResult:m,removeMutationResult:g,updateSubscriptionOptions:v}=o.internalActions;return{buildInitiateQuery:I,buildInitiateInfiniteQuery:E,buildInitiateMutation:k,getRunningQueryThunk:x,getRunningMutationThunk:y,getRunningQueriesThunk:C,getRunningMutationsThunk:b};function x(T,D){return G=>{let U=qs(a,T),V=e({queryArgs:D,endpointDefinition:U,endpointName:T});return p(G)?.get(V)}}function y(T,D){return G=>f(G)?.get(D)}function C(){return T=>zR(p(T))}function b(){return T=>zR(f(T))}function w(T){}function F(T,D){let G=(U,{subscribe:V=!0,forceRefetch:B,subscriptionOptions:j,[vl]:_,...N}={})=>(q,Y)=>{let H=e({queryArgs:U,endpointDefinition:D,endpointName:T}),ne,te={...N,type:Cl,subscribe:V,forceRefetch:B,subscriptionOptions:j,endpointName:T,originalArgs:U,queryCacheKey:H,[vl]:_};if(af(D))ne=t(te);else{let{direction:Re,initialPageParam:ke,refetchCachedPages:Ie}=N;ne=r({...te,direction:Re,initialPageParam:ke,refetchCachedPages:Ie})}let Z=o.endpoints[T].select(U),ue=q(ne),Se=Z(Y());let{requestId:Ve,abort:Je}=ue,Qe=Se.requestId!==Ve,ze=p(q)?.get(H),We=()=>Z(Y()),Ee=Object.assign(_?ue.then(We):Qe&&!ze?Promise.resolve(Se):Promise.all([ze,ue]).then(We),{arg:U,requestId:Ve,subscriptionOptions:j,queryCacheKey:H,abort:Je,unwrap(){return _asyncToGenerator(function*(){let Re=yield Ee;if(Re.isError)throw Re.error;return Re.data})()},refetch:Re=>q(G(U,{subscribe:!1,forceRefetch:!0,...Re})),unsubscribe(){V&&q(m({queryCacheKey:H,requestId:Ve}))},updateSubscriptionOptions(Re){Ee.subscriptionOptions=Re,q(v({endpointName:T,requestId:Ve,queryCacheKey:H,options:Re}))}});if(!ze&&!Qe&&!_){let Re=p(q);Re.set(H,Ee),Ee.then(()=>{Re.delete(H)})}return Ee};return G}function I(T,D){return F(T,D)}function E(T,D){return F(T,D)}function k(T){return(D,{track:G=!0,fixedCacheKey:U}={})=>(V,B)=>{let j=n({type:"mutation",endpointName:T,originalArgs:D,track:G,fixedCacheKey:U}),_=V(j);let{requestId:N,abort:q,unwrap:Y}=_,H=BV(_.unwrap().then(ue=>({data:ue})),ue=>({error:ue})),ne=()=>{V(g({requestId:N,fixedCacheKey:U}))},te=Object.assign(H,{arg:_.arg,requestId:N,abort:q,unwrap:Y,reset:ne}),Z=f(V);return Z.set(N,te),te.then(()=>{Z.delete(N)}),U&&(Z.set(U,te),te.then(()=>{Z.get(U)===te&&Z.delete(U)})),te}}}var hF=class extends GR{constructor(t,r,n,o){super(t);de(this,"value");de(this,"schemaName");de(this,"_bqMeta");this.value=r,this.schemaName=n,this._bqMeta=o}},Ea=(e,t)=>Array.isArray(e)?e.includes(t):!!e;function Ia(_x115,_x116,_x117,_x118){return _Ia.apply(this,arguments)}function _Ia(){_Ia=_asyncToGenerator(function*(e,t,r,n){let o=yield e["~standard"].validate(t);if(o.issues)throw new hF(o.issues,t,r,n);return o.value});return _Ia.apply(this,arguments)}function JR(e){return e}var hl=(e={})=>({...e,[Yu]:!0});function $V({reducerPath:e,baseQuery:t,context:{endpointDefinitions:r},serializeQueryArgs:n,api:o,assertTagType:a,selectors:i,onSchemaFailure:p,catchSchemaFailure:f,skipSchemaValidation:m}){let g=(j,_,N,q)=>(Y,H)=>{let ne=r[j],te=n({queryArgs:_,endpointDefinition:ne,endpointName:j});if(Y(o.internalActions.queryResultPatched({queryCacheKey:te,patches:N})),!q)return;let Z=o.endpoints[j].select(_)(H()),ue=Hv(ne.providesTags,Z.data,void 0,_,{},a);Y(o.internalActions.updateProvidedBy([{queryCacheKey:te,providedTags:ue}]))};function v(j,_,N=0){let q=[_,...j];return N&&q.length>N?q.slice(0,-1):q}function x(j,_,N=0){let q=[...j,_];return N&&q.length>N?q.slice(1):q}let y=(j,_,N,q=!0)=>(Y,H)=>{let te=o.endpoints[j].select(_)(H()),Z={patches:[],inversePatches:[],undo:()=>Y(o.util.patchQueryData(j,_,Z.inversePatches,q))};if(te.status===Jn)return Z;let ue;if("data"in te)if(Kt(te.data)){let[Se,Ve,Je]=SS(te.data,N);Z.patches.push(...Ve),Z.inversePatches.push(...Je),ue=Se}else ue=N(te.data),Z.patches.push({op:"replace",path:[],value:ue}),Z.inversePatches.push({op:"replace",path:[],value:te.data});return Z.patches.length===0||Y(o.util.patchQueryData(j,_,Z.patches,q)),Z},C=(j,_,N)=>q=>q(o.endpoints[j].initiate(_,{subscribe:!1,forceRefetch:!0,[vl]:()=>({data:N})})),b=(j,_)=>j.query&&j[_]?j[_]:JR,w=/*#__PURE__*/function(){var _ref43=_asyncToGenerator(function*(j,{signal:_,abort:N,rejectWithValue:q,fulfillWithValue:Y,dispatch:H,getState:ne,extra:te}){let Z=r[j.endpointName],{metaSchema:ue,skipSchemaValidation:Se=m}=Z,Ve=j.type===Cl;try{let Je=JR,Qe={signal:_,abort:N,dispatch:H,getState:ne,extra:te,endpoint:j.endpointName,type:j.type,forced:Ve?F(j,ne()):void 0,queryCacheKey:Ve?j.queryCacheKey:void 0},ze=Ve?j[vl]:void 0,We,Ee=/*#__PURE__*/function(){var _ref44=_asyncToGenerator(function*(ke,Ie,ut,yt){if(Ie==null&&ke.pages.length)return Promise.resolve({data:ke});let qr={queryArg:j.originalArgs,pageParam:Ie},ar=yield Re(qr),Yr=yt?v:x;return{data:{pages:Yr(ke.pages,ar.data,ut),pageParams:Yr(ke.pageParams,Ie,ut)},meta:ar.meta}});return function Ee(_x121,_x122,_x123,_x124){return _ref44.apply(this,arguments)}}();function Re(_x125){return _Re.apply(this,arguments)}function _Re(){_Re=_asyncToGenerator(function*(ke){let Ie,{extraOptions:ut,argSchema:yt,rawResponseSchema:qr,responseSchema:ar}=Z;if(yt&&!Ea(Se,"arg")&&(ke=yield Ia(yt,ke,"argSchema",{})),ze?Ie=ze():Z.query?(Je=b(Z,"transformResponse"),Ie=yield t(Z.query(ke),Qe,ut)):Ie=yield Z.queryFn(ke,Qe,ut,Mr=>t(Mr,Qe,ut)),typeof process<"u",Ie.error)throw new Ds(Ie.error,Ie.meta);let{data:Yr}=Ie;qr&&!Ea(Se,"rawResponse")&&(Yr=yield Ia(qr,Ie.data,"rawResponseSchema",Ie.meta));let mr=yield Je(Yr,Ie.meta,ke);return ar&&!Ea(Se,"response")&&(mr=yield Ia(ar,mr,"responseSchema",Ie.meta)),{...Ie,data:mr}});return _Re.apply(this,arguments)}if(Ve&&"infiniteQueryOptions"in Z){let{infiniteQueryOptions:ke}=Z,{maxPages:Ie=1/0}=ke,ut=j.refetchCachedPages??ke.refetchCachedPages??!0,yt,qr={pages:[],pageParams:[]},ar=i.selectQueryEntry(ne(),j.queryCacheKey)?.data,mr=F(j,ne())&&!j.direction||!ar?qr:ar;if("direction"in j&&j.direction&&mr.pages.length){let Mr=j.direction==="backward",cd=(Mr?yF:Qv)(ke,mr,j.originalArgs);yt=yield Ee(mr,cd,Ie,Mr)}else{let{initialPageParam:Mr=ke.initialPageParam}=j,bu=ar?.pageParams??[],cd=bu[0]??Mr,D_=bu.length;if(yt=yield Ee(mr,cd,Ie),ze&&(yt={data:yt.data.pages[0]}),ut)for(let WC=1;WC<D_;WC++){let q_=Qv(ke,yt.data,j.originalArgs);yt=yield Ee(yt.data,q_,Ie)}}We=yt}else We=yield Re(j.originalArgs);return ue&&!Ea(Se,"meta")&&We.meta&&(We.meta=yield Ia(ue,We.meta,"metaSchema",We.meta)),Y(We.data,hl({fulfilledTimeStamp:Date.now(),baseQueryMeta:We.meta}))}catch(Je){let Qe=Je;if(Qe instanceof Ds){let ze=b(Z,"transformErrorResponse"),{rawErrorResponseSchema:We,errorResponseSchema:Ee}=Z,{value:Re,meta:ke}=Qe;try{We&&!Ea(Se,"rawErrorResponse")&&(Re=yield Ia(We,Re,"rawErrorResponseSchema",ke)),ue&&!Ea(Se,"meta")&&(ke=yield Ia(ue,ke,"metaSchema",ke));let Ie=yield ze(Re,ke,j.originalArgs);return Ee&&!Ea(Se,"errorResponse")&&(Ie=yield Ia(Ee,Ie,"errorResponseSchema",ke)),q(Ie,hl({baseQueryMeta:ke}))}catch(Ie){Qe=Ie}}try{if(Qe instanceof hF){let ze={endpoint:j.endpointName,arg:j.originalArgs,type:j.type,queryCacheKey:Ve?j.queryCacheKey:void 0};Z.onSchemaFailure?.(Qe,ze),p?.(Qe,ze);let{catchSchemaFailure:We=f}=Z;if(We)return q(We(Qe,ze),hl({baseQueryMeta:Qe._bqMeta}))}}catch(ze){Qe=ze}throw typeof process<"u",console.error(Qe),Qe}});return function w(_x119,_x120){return _ref43.apply(this,arguments)}}();function F(j,_){let N=i.selectQueryEntry(_,j.queryCacheKey),q=i.selectConfig(_).refetchOnMountOrArgChange,Y=N?.fulfilledTimeStamp,H=j.forceRefetch??(j.subscribe&&q);return H?H===!0||(Number(new Date)-Number(Y))/1e3>=H:!1}let I=()=>xe(`${e}/executeQuery`,w,{getPendingMeta({arg:_}){let N=r[_.endpointName];return hl({startedTimeStamp:Date.now(),...(sf(N)?{direction:_.direction}:{})})},condition(_,{getState:N}){let q=N(),Y=i.selectQueryEntry(q,_.queryCacheKey),H=Y?.fulfilledTimeStamp,ne=_.originalArgs,te=Y?.originalArgs,Z=r[_.endpointName],ue=_.direction;return Uv(_)?!0:Y?.status==="pending"?!1:F(_,q)||af(Z)&&Z?.forceRefetch?.({currentArg:ne,previousArg:te,endpointState:Y,state:q})?!0:!(H&&!ue)},dispatchConditionRejection:!0}),E=I(),k=I(),T=xe(`${e}/executeMutation`,w,{getPendingMeta(){return hl({startedTimeStamp:Date.now()})}}),D=j=>"force"in j,G=j=>"ifOlderThan"in j,U=(j,_,N={})=>(q,Y)=>{let H=D(N)&&N.force,ne=G(N)&&N.ifOlderThan,te=(ue=!0)=>{let Se={forceRefetch:ue,subscribe:!1};return o.endpoints[j].initiate(_,Se)},Z=o.endpoints[j].select(_)(Y());if(H)q(te());else if(ne){let ue=Z?.fulfilledTimeStamp;if(!ue){q(te());return}(Number(new Date)-Number(new Date(ue)))/1e3>=ne&&q(te())}else q(te(!1))};function V(j){return _=>_?.meta?.arg?.endpointName===j}function B(j,_){return{matchPending:Bi(zd(j),V(_)),matchFulfilled:Bi(zn(j),V(_)),matchRejected:Bi(Sa(j),V(_))}}return{queryThunk:E,mutationThunk:T,infiniteQueryThunk:k,prefetch:U,updateQueryData:y,upsertQueryData:C,patchQueryData:g,buildMatchThunkActions:B}}function Qv(e,{pages:t,pageParams:r},n){let o=t.length-1;return e.getNextPageParam(t[o],t,r[o],r,n)}function yF(e,{pages:t,pageParams:r},n){return e.getPreviousPageParam?.(t[0],t,r[0],r,n)}function SF(e,t,r,n){return Hv(r[e.meta.arg.endpointName][t],zn(e)?e.payload:void 0,Xu(e)?e.payload:void 0,e.meta.arg.originalArgs,"baseQueryMeta"in e.meta?e.meta.baseQueryMeta:void 0,n)}function XR(e){return Wt(e)?Ld(e):e}function ef(e,t,r){let n=e[t];n&&r(n)}function Al(e){return("arg"in e?e.arg.fixedCacheKey:e.fixedCacheKey)??e.requestId}function ZR(e,t,r){let n=e[Al(t)];n&&r(n)}var tf={};function HV({reducerPath:e,queryThunk:t,mutationThunk:r,serializeQueryArgs:n,context:{endpointDefinitions:o,apiUid:a,extractRehydrationInfo:i,hasRehydrationInfo:p},assertTagType:f,config:m}){let g=P(`${e}/resetApiState`);function v(V,B,j,_){var N;V[N=B.queryCacheKey]??(V[N]={status:Jn,endpointName:B.endpointName}),ef(V,B.queryCacheKey,q=>{q.status=Vv,q.requestId=j&&q.requestId?q.requestId:_.requestId,B.originalArgs!==void 0&&(q.originalArgs=B.originalArgs),q.startedTimeStamp=_.startedTimeStamp;let Y=o[_.arg.endpointName];sf(Y)&&"direction"in B&&(q.direction=B.direction)})}function x(V,B,j,_){ef(V,B.arg.queryCacheKey,N=>{if(N.requestId!==B.requestId&&!_)return;let{merge:q}=o[B.arg.endpointName];if(N.status=yl,q){if(N.data!==void 0){let{fulfilledTimeStamp:Y,arg:H,baseQueryMeta:ne,requestId:te}=B,Z=ha(N.data,ue=>q(ue,j,{arg:H.originalArgs,baseQueryMeta:ne,fulfilledTimeStamp:Y,requestId:te}));N.data=Z}else N.data=j;}else N.data=o[B.arg.endpointName].structuralSharing??!0?iF(Wt(N.data)?rb(N.data):N.data,j):j;delete N.error,N.fulfilledTimeStamp=B.fulfilledTimeStamp})}let y=va({name:`${e}/queries`,initialState:tf,reducers:{removeQueryResult:{reducer(V,{payload:{queryCacheKey:B}}){delete V[B]},prepare:Gi()},cacheEntriesUpserted:{reducer(V,B){for(let j of B.payload){let{queryDescription:_,value:N}=j;v(V,_,!0,{arg:_,requestId:B.meta.requestId,startedTimeStamp:B.meta.timestamp}),x(V,{arg:_,requestId:B.meta.requestId,fulfilledTimeStamp:B.meta.timestamp,baseQueryMeta:{}},N,!0)}},prepare:V=>({payload:V.map(_=>{let{endpointName:N,arg:q,value:Y}=_,H=o[N];return{queryDescription:{type:Cl,endpointName:N,originalArgs:_.arg,queryCacheKey:n({queryArgs:q,endpointDefinition:H,endpointName:N})},value:Y}}),meta:{[Yu]:!0,requestId:Zu(),timestamp:Date.now()}})},queryResultPatched:{reducer(V,{payload:{queryCacheKey:B,patches:j}}){ef(V,B,_=>{_.data=vS(_.data,j.concat())})},prepare:Gi()}},extraReducers(V){V.addCase(t.pending,(B,{meta:j,meta:{arg:_}})=>{let N=Uv(_);v(B,_,N,j)}).addCase(t.fulfilled,(B,{meta:j,payload:_})=>{let N=Uv(j.arg);x(B,j,_,N)}).addCase(t.rejected,(B,{meta:{condition:j,arg:_,requestId:N},error:q,payload:Y})=>{ef(B,_.queryCacheKey,H=>{if(!j){if(H.requestId!==N)return;H.status=Sl,H.error=Y??q}})}).addMatcher(p,(B,j)=>{let{queries:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===yl||q?.status===Sl)&&(B[N]=q)})}}),C=va({name:`${e}/mutations`,initialState:tf,reducers:{removeMutationResult:{reducer(V,{payload:B}){let j=Al(B);j in V&&delete V[j]},prepare:Gi()}},extraReducers(V){V.addCase(r.pending,(B,{meta:j,meta:{requestId:_,arg:N,startedTimeStamp:q}})=>{N.track&&(B[Al(j)]={requestId:_,status:Vv,endpointName:N.endpointName,startedTimeStamp:q})}).addCase(r.fulfilled,(B,{payload:j,meta:_})=>{_.arg.track&&ZR(B,_,N=>{N.requestId===_.requestId&&(N.status=yl,N.data=j,N.fulfilledTimeStamp=_.fulfilledTimeStamp)})}).addCase(r.rejected,(B,{payload:j,error:_,meta:N})=>{N.arg.track&&ZR(B,N,q=>{q.requestId===N.requestId&&(q.status=Sl,q.error=j??_)})}).addMatcher(p,(B,j)=>{let{mutations:_}=i(j);for(let[N,q]of Object.entries(_))(q?.status===yl||q?.status===Sl)&&N!==q?.requestId&&(B[N]=q)})}}),b={tags:{},keys:{}},w=va({name:`${e}/invalidation`,initialState:b,reducers:{updateProvidedBy:{reducer(V,B){var j,_,N;for(let{queryCacheKey:q,providedTags:Y}of B.payload){F(V,q);for(let{type:H,id:ne}of Y){let te=(_=(j=V.tags)[H]??(j[H]={}))[N=ne||"__internal_without_id"]??(_[N]=[]);te.includes(q)||te.push(q)}V.keys[q]=Y}},prepare:Gi()}},extraReducers(V){V.addCase(y.actions.removeQueryResult,(B,{payload:{queryCacheKey:j}})=>{F(B,j)}).addMatcher(p,(B,j)=>{var N,q,Y;let{provided:_}=i(j);for(let[H,ne]of Object.entries(_.tags??{}))for(let[te,Z]of Object.entries(ne)){let ue=(q=(N=B.tags)[H]??(N[H]={}))[Y=te||"__internal_without_id"]??(q[Y]=[]);for(let Se of Z)ue.includes(Se)||ue.push(Se),B.keys[Se]=_.keys[Se]}}).addMatcher(Zr(zn(t),Xu(t)),(B,j)=>{I(B,[j])}).addMatcher(y.actions.cacheEntriesUpserted.match,(B,j)=>{let _=j.payload.map(({queryDescription:N,value:q})=>({type:"UNKNOWN",payload:q,meta:{requestStatus:"fulfilled",requestId:"UNKNOWN",arg:N}}));I(B,_)})}});function F(V,B){let j=XR(V.keys[B]??[]);for(let _ of j){let N=_.type,q=_.id??"__internal_without_id",Y=V.tags[N]?.[q];Y&&(V.tags[N][q]=XR(Y).filter(H=>H!==B))}delete V.keys[B]}function I(V,B){let j=B.map(_=>{let N=SF(_,"providesTags",o,f),{queryCacheKey:q}=_.meta.arg;return{queryCacheKey:q,providedTags:N}});w.caseReducers.updateProvidedBy(V,w.actions.updateProvidedBy(j))}let E=va({name:`${e}/subscriptions`,initialState:tf,reducers:{updateSubscriptionOptions(V,B){},unsubscribeQueryResult(V,B){},internal_getRTKQSubscriptions(){}}}),k=va({name:`${e}/internalSubscriptions`,initialState:tf,reducers:{subscriptionsUpdated:{reducer(V,B){return vS(V,B.payload)},prepare:Gi()}}}),T=va({name:`${e}/config`,initialState:{online:IV(),focused:EV(),middlewareRegistered:!1,...m},reducers:{middlewareRegistered(V,{payload:B}){V.middlewareRegistered=V.middlewareRegistered==="conflict"||a!==B?"conflict":!0}},extraReducers:V=>{V.addCase($v,B=>{B.online=!0}).addCase(pF,B=>{B.online=!1}).addCase(Gv,B=>{B.focused=!0}).addCase(dF,B=>{B.focused=!1}).addMatcher(p,B=>({...B}))}}),D=ji({queries:y.reducer,mutations:C.reducer,provided:w.reducer,subscriptions:k.reducer,config:T.reducer}),G=(V,B)=>D(g.match(B)?void 0:V,B),U={...T.actions,...y.actions,...E.actions,...k.actions,...C.actions,...w.actions,resetApiState:g};return{reducer:G,actions:U}}var Ta=Symbol.for("RTKQ/skipToken"),vF={status:Jn},eF=ha(vF,()=>{}),tF=ha(vF,()=>{});function zV({serializeQueryArgs:e,reducerPath:t,createSelector:r}){let n=E=>eF,o=E=>tF;return{buildQuerySelector:x,buildInfiniteQuerySelector:y,buildMutationSelector:C,selectInvalidatedBy:b,selectCachedArgsForQuery:w,selectApiState:i,selectQueries:p,selectMutations:m,selectQueryEntry:f,selectConfig:g};function a(E){return{...E,...$R(E.status)}}function i(E){return E[t]}function p(E){return i(E)?.queries}function f(E,k){return p(E)?.[k]}function m(E){return i(E)?.mutations}function g(E){return i(E)?.config}function v(E,k,T){return D=>{if(D===Ta)return r(n,T);let G=e({queryArgs:D,endpointDefinition:k,endpointName:E});return r(V=>f(V,G)??eF,T)}}function x(E,k){return v(E,k,a)}function y(E,k){let{infiniteQueryOptions:T}=k;function D(G){let U={...G,...$R(G.status)},{isLoading:V,isError:B,direction:j}=U,_=j==="forward",N=j==="backward";return{...U,hasNextPage:F(T,U.data,U.originalArgs),hasPreviousPage:I(T,U.data,U.originalArgs),isFetchingNextPage:V&&_,isFetchingPreviousPage:V&&N,isFetchNextPageError:B&&_,isFetchPreviousPageError:B&&N}}return v(E,k,D)}function C(){return E=>{let k;return typeof E=="object"?k=Al(E)??Ta:k=E,r(k===Ta?o:G=>i(G)?.mutations?.[k]??tF,a)}}function b(E,k){let T=E[t],D=new Set,G=jv(k,Bv,gF);for(let U of G){let V=T.provided.tags[U.type];if(!V)continue;let B=(U.id!==void 0?V[U.id]:Object.values(V).flat())??[];for(let j of B)D.add(j)}return Array.from(D.values()).flatMap(U=>{let V=T.queries[U];return V?{queryCacheKey:U,endpointName:V.endpointName,originalArgs:V.originalArgs}:[]})}function w(E,k){return jv(Object.values(p(E)),T=>T?.endpointName===k&&T.status!==Jn,T=>T.originalArgs)}function F(E,k,T){return k?Qv(E,k,T)!=null:!1}function I(E,k,T){return!k||!E.getPreviousPageParam?!1:yF(E,k,T)!=null}}var rF=WeakMap?new WeakMap:void 0,nF=({endpointName:e,queryArgs:t})=>{let r="",n=rF?.get(t);if(typeof n=="string")r=n;else{let o=JSON.stringify(t,(a,i)=>(i=typeof i=="bigint"?{$bigint:i.toString()}:i,i=Jr(i)?Object.keys(i).sort().reduce((p,f)=>(p[f]=i[f],p),{}):i,i));Jr(t)&&rF?.set(t,o),r=o}return`${e}(${r})`};function WV(...e){return function(r){let n=Wu(m=>r.extractRehydrationInfo?.(m,{reducerPath:r.reducerPath??"api"})),o={reducerPath:"api",keepUnusedDataFor:60,refetchOnMountOrArgChange:!1,refetchOnFocus:!1,refetchOnReconnect:!1,invalidationBehavior:"delayed",...r,extractRehydrationInfo:n,serializeQueryArgs(m){let g=nF;if("serializeQueryArgs"in m.endpointDefinition){let v=m.endpointDefinition.serializeQueryArgs;g=x=>{let y=v(x);return typeof y=="string"?y:nF({...x,queryArgs:y})}}else r.serializeQueryArgs&&(g=r.serializeQueryArgs);return g(m)},tagTypes:[...(r.tagTypes||[])]},a={endpointDefinitions:{},batch(m){m()},apiUid:Zu(),extractRehydrationInfo:n,hasRehydrationInfo:Wu(m=>n(m)!=null)},i={injectEndpoints:f,enhanceEndpoints({addTagTypes:m,endpoints:g}){if(m)for(let v of m)o.tagTypes.includes(v)||o.tagTypes.push(v);if(g)for(let[v,x]of Object.entries(g))typeof x=="function"?x(qs(a,v)):Object.assign(qs(a,v)||{},x);return i}},p=e.map(m=>m.init(i,o,a));function f(m){let g=m.endpoints({query:v=>({...v,type:Cl}),mutation:v=>({...v,type:fF}),infiniteQuery:v=>({...v,type:mF})});for(let[v,x]of Object.entries(g)){if(m.overrideExisting!==!0&&v in a.endpointDefinitions){if(m.overrideExisting==="throw")throw new Error(Yt(39));typeof process<"u";continue}typeof process<"u",a.endpointDefinitions[v]=x;for(let y of p)y.injectEndpoint(v,x)}return i}return i.injectEndpoints({endpoints:r.endpoints})}}function Yn(e,...t){return Object.assign(e,...t)}var KV=({api:e,queryThunk:t,internalState:r,mwApi:n})=>{let o=`${e.reducerPath}/subscriptions`,a=null,i=null,{updateSubscriptionOptions:p,unsubscribeQueryResult:f}=e.internalActions,m=(b,w)=>{if(p.match(w)){let{queryCacheKey:I,requestId:E,options:k}=w.payload,T=b.get(I);return T?.has(E)&&T.set(E,k),!0}if(f.match(w)){let{queryCacheKey:I,requestId:E}=w.payload,k=b.get(I);return k&&k.delete(E),!0}if(e.internalActions.removeQueryResult.match(w))return b.delete(w.payload.queryCacheKey),!0;if(t.pending.match(w)){let{meta:{arg:I,requestId:E}}=w,k=rf(b,I.queryCacheKey,Lv);return I.subscribe&&k.set(E,I.subscriptionOptions??k.get(E)??{}),!0}let F=!1;if(t.rejected.match(w)){let{meta:{condition:I,arg:E,requestId:k}}=w;if(I&&E.subscribe){let T=rf(b,E.queryCacheKey,Lv);T.set(k,E.subscriptionOptions??T.get(k)??{}),F=!0}}return F},g=()=>r.currentSubscriptions,y={getSubscriptions:g,getSubscriptionCount:b=>g().get(b)?.size??0,isRequestSubscribed:(b,w)=>!!g()?.get(b)?.get(w)};function C(b){return JSON.parse(JSON.stringify(Object.fromEntries([...b].map(([w,F])=>[w,Object.fromEntries(F)]))))}return(b,w)=>{if(a||(a=C(r.currentSubscriptions)),e.util.resetApiState.match(b))return a={},r.currentSubscriptions.clear(),i=null,[!0,!1];if(e.internalActions.internal_getRTKQSubscriptions.match(b))return[!1,y];let F=m(r.currentSubscriptions,b),I=!0;if(F){i||(i=setTimeout(()=>{let T=C(r.currentSubscriptions),[,D]=SS(a,()=>T);w.next(e.internalActions.subscriptionsUpdated(D)),a=T,i=null},500));let E=typeof b.type=="string"&&!!b.type.startsWith(o),k=t.rejected.match(b)&&b.meta.condition&&!!b.meta.arg.subscribe;I=!E&&!k}return[I,!1]}},YV=2147483647/1e3-1,JV=({reducerPath:e,api:t,queryThunk:r,context:n,internalState:o,selectors:{selectQueryEntry:a,selectConfig:i},getRunningQueryThunk:p,mwApi:f})=>{let{removeQueryResult:m,unsubscribeQueryResult:g,cacheEntriesUpserted:v}=t.internalActions,x=Zr(g.match,r.fulfilled,r.rejected,v.match);function y(E){let k=o.currentSubscriptions.get(E);return k?k.size>0:!1}let C={};function b(E){for(let k of E.values())k?.abort?.()}let w=(E,k)=>{let T=k.getState(),D=i(T);if(x(E)){let G;if(v.match(E))G=E.payload.map(U=>U.queryDescription.queryCacheKey);else{let{queryCacheKey:U}=g.match(E)?E.payload:E.meta.arg;G=[U]}F(G,k,D)}if(t.util.resetApiState.match(E)){for(let[G,U]of Object.entries(C))U&&clearTimeout(U),delete C[G];b(o.runningQueries),b(o.runningMutations)}if(n.hasRehydrationInfo(E)){let{queries:G}=n.extractRehydrationInfo(E);F(Object.keys(G),k,D)}};function F(E,k,T){let D=k.getState();for(let G of E){let U=a(D,G);U?.endpointName&&I(G,U.endpointName,k,T)}}function I(E,k,T,D){let U=qs(n,k)?.keepUnusedDataFor??D.keepUnusedDataFor;if(U===1/0)return;let V=Math.max(0,Math.min(U,YV));if(!y(E)){let B=C[E];B&&clearTimeout(B),C[E]=setTimeout(()=>{if(!y(E)){let j=a(T.getState(),E);j?.endpointName&&T.dispatch(p(j.endpointName,j.originalArgs))?.abort(),T.dispatch(m({queryCacheKey:E}))}delete C[E]},V*1e3)}}return w},oF=new Error("Promise never resolved before cacheEntryRemoved."),XV=({api:e,reducerPath:t,context:r,queryThunk:n,mutationThunk:o,internalState:a,selectors:{selectQueryEntry:i,selectApiState:p}})=>{let f=Wd(n),m=Wd(o),g=zn(n,o),v={},{removeQueryResult:x,removeMutationResult:y,cacheEntriesUpserted:C}=e.internalActions;function b(T,D,G){let U=v[T];U?.valueResolved&&(U.valueResolved({data:D,meta:G}),delete U.valueResolved)}function w(T){let D=v[T];D&&(delete v[T],D.cacheEntryRemoved())}function F(T){let{arg:D,requestId:G}=T.meta,{endpointName:U,originalArgs:V}=D;return[U,V,G]}let I=(T,D,G)=>{let U=E(T);function V(B,j,_,N){let q=i(G,j),Y=i(D.getState(),j);!q&&Y&&k(B,N,j,D,_)}if(n.pending.match(T)){let[B,j,_]=F(T);V(B,U,_,j)}else if(C.match(T))for(let{queryDescription:B,value:j}of T.payload){let{endpointName:_,originalArgs:N,queryCacheKey:q}=B;V(_,q,T.meta.requestId,N),b(q,j,{})}else if(o.pending.match(T)){if(D.getState()[t].mutations[U]){let[j,_,N]=F(T);k(j,_,U,D,N)}}else if(g(T))b(U,T.payload,T.meta.baseQueryMeta);else if(x.match(T)||y.match(T))w(U);else if(e.util.resetApiState.match(T))for(let B of Object.keys(v))w(B)};function E(T){return f(T)?T.meta.arg.queryCacheKey:m(T)?T.meta.arg.fixedCacheKey??T.meta.requestId:x.match(T)?T.payload.queryCacheKey:y.match(T)?Al(T.payload):""}function k(T,D,G,U,V){let B=qs(r,T),j=B?.onCacheEntryAdded;if(!j)return;let _={},N=new Promise(Z=>{_.cacheEntryRemoved=Z}),q=Promise.race([new Promise(Z=>{_.valueResolved=Z}),N.then(()=>{throw oF})]);q.catch(()=>{}),v[G]=_;let Y=e.endpoints[T].select(nf(B)?D:G),H=U.dispatch((Z,ue,Se)=>Se),ne={...U,getCacheEntry:()=>Y(U.getState()),requestId:V,extra:H,updateCachedData:nf(B)?Z=>U.dispatch(e.util.updateQueryData(T,D,Z)):void 0,cacheDataLoaded:q,cacheEntryRemoved:N},te=j(D,ne);Promise.resolve(te).catch(Z=>{if(Z!==oF)throw Z})}return I},ZV=({api:e,context:{apiUid:t},reducerPath:r})=>(n,o)=>{e.util.resetApiState.match(n)&&o.dispatch(e.internalActions.middlewareRegistered(t)),typeof process<"u"},ej=({reducerPath:e,context:t,context:{endpointDefinitions:r},mutationThunk:n,queryThunk:o,api:a,assertTagType:i,refetchQuery:p,internalState:f})=>{let{removeQueryResult:m}=a.internalActions,g=Zr(zn(n),Xu(n)),v=Zr(zn(o,n),Sa(o,n)),x=[],y=0,C=(F,I)=>{(o.pending.match(F)||n.pending.match(F))&&y++,v(F)&&(y=Math.max(0,y-1)),g(F)?w(SF(F,"invalidatesTags",r,i),I):v(F)?w([],I):a.util.invalidateTags.match(F)&&w(Hv(F.payload,void 0,void 0,void 0,void 0,i),I)};function b(){return y>0}function w(F,I){let E=I.getState(),k=E[e];if(x.push(...F),k.config.invalidationBehavior==="delayed"&&b())return;let T=x;if(x=[],T.length===0)return;let D=a.util.selectInvalidatedBy(E,T);t.batch(()=>{let G=Array.from(D.values());for(let{queryCacheKey:U}of G){let V=k.queries[U],B=rf(f.currentSubscriptions,U,Lv);V&&(B.size===0?I.dispatch(m({queryCacheKey:U})):V.status!==Jn&&I.dispatch(p(V)))}})}return C},tj=({reducerPath:e,queryThunk:t,api:r,refetchQuery:n,internalState:o})=>{let{currentPolls:a,currentSubscriptions:i}=o,p=new Set,f=null,m=(w,F)=>{(r.internalActions.updateSubscriptionOptions.match(w)||r.internalActions.unsubscribeQueryResult.match(w))&&g(w.payload.queryCacheKey,F),(t.pending.match(w)||t.rejected.match(w)&&w.meta.condition)&&g(w.meta.arg.queryCacheKey,F),(t.fulfilled.match(w)||t.rejected.match(w)&&!w.meta.condition)&&v(w.meta.arg,F),r.util.resetApiState.match(w)&&(C(),f&&(clearTimeout(f),f=null),p.clear())};function g(w,F){p.add(w),f||(f=setTimeout(()=>{for(let I of p)x({queryCacheKey:I},F);p.clear(),f=null},0))}function v({queryCacheKey:w},F){let I=F.getState()[e],E=I.queries[w],k=i.get(w);if(!E||E.status===Jn)return;let{lowestPollingInterval:T,skipPollingIfUnfocused:D}=b(k);if(!Number.isFinite(T))return;let G=a.get(w);G?.timeout&&(clearTimeout(G.timeout),G.timeout=void 0);let U=Date.now()+T;a.set(w,{nextPollTimestamp:U,pollingInterval:T,timeout:setTimeout(()=>{(I.config.focused||!D)&&F.dispatch(n(E)),v({queryCacheKey:w},F)},T)})}function x({queryCacheKey:w},F){let E=F.getState()[e].queries[w],k=i.get(w);if(!E||E.status===Jn)return;let{lowestPollingInterval:T}=b(k);if(!Number.isFinite(T)){y(w);return}let D=a.get(w),G=Date.now()+T;(!D||G<D.nextPollTimestamp)&&v({queryCacheKey:w},F)}function y(w){let F=a.get(w);F?.timeout&&clearTimeout(F.timeout),a.delete(w)}function C(){for(let w of a.keys())y(w)}function b(w=new Map){let F=!1,I=Number.POSITIVE_INFINITY;for(let E of w.values())E.pollingInterval&&(I=Math.min(E.pollingInterval,I),F=E.skipPollingIfUnfocused||F);return{lowestPollingInterval:I,skipPollingIfUnfocused:F}}return m},rj=({api:e,context:t,queryThunk:r,mutationThunk:n})=>{let o=zd(r,n),a=Sa(r,n),i=zn(r,n),p={};return(m,g)=>{if(o(m)){let{requestId:v,arg:{endpointName:x,originalArgs:y}}=m.meta,C=qs(t,x),b=C?.onQueryStarted;if(b){let w={},F=new Promise((T,D)=>{w.resolve=T,w.reject=D});F.catch(()=>{}),p[v]=w;let I=e.endpoints[x].select(nf(C)?y:v),E=g.dispatch((T,D,G)=>G),k={...g,getCacheEntry:()=>I(g.getState()),requestId:v,extra:E,updateCachedData:nf(C)?T=>g.dispatch(e.util.updateQueryData(x,y,T)):void 0,queryFulfilled:F};b(y,k)}}else if(i(m)){let{requestId:v,baseQueryMeta:x}=m.meta;p[v]?.resolve({data:m.payload,meta:x}),delete p[v]}else if(a(m)){let{requestId:v,rejectedWithValue:x,baseQueryMeta:y}=m.meta;p[v]?.reject({error:m.payload??m.error,isUnhandledError:!x,meta:y}),delete p[v]}}},nj=({reducerPath:e,context:t,api:r,refetchQuery:n,internalState:o})=>{let{removeQueryResult:a}=r.internalActions,i=(f,m)=>{Gv.match(f)&&p(m,"refetchOnFocus"),$v.match(f)&&p(m,"refetchOnReconnect")};function p(f,m){let g=f.getState()[e],v=g.queries,x=o.currentSubscriptions;t.batch(()=>{for(let y of x.keys()){let C=v[y],b=x.get(y);if(!b||!C)continue;let w=[...b.values()];(w.some(I=>I[m]===!0)||w.every(I=>I[m]===void 0)&&g.config[m])&&(b.size===0?f.dispatch(a({queryCacheKey:y})):C.status!==Jn&&f.dispatch(n(C)))}})}return i};function oj(e){let{reducerPath:t,queryThunk:r,api:n,context:o,getInternalState:a}=e,{apiUid:i}=o,p={invalidateTags:P(`${t}/invalidateTags`)},f=x=>x.type.startsWith(`${t}/`),m=[ZV,JV,ej,tj,XV,rj];return{middleware:x=>{let y=!1,C=a(x.dispatch),b={...e,internalState:C,refetchQuery:v,isThisApiSliceAction:f,mwApi:x},w=m.map(E=>E(b)),F=KV(b),I=nj(b);return E=>k=>{if(!qu(k))return E(k);y||(y=!0,x.dispatch(n.internalActions.middlewareRegistered(i)));let T={...x,next:E},D=x.getState(),[G,U]=F(k,T,D),V;if(G?V=E(k):V=U,x.getState()[t]&&(I(k,T,D),f(k)||o.hasRehydrationInfo(k)))for(let B of w)B(k,T,D);return V}},actions:p};function v(x){return e.api.endpoints[x.endpointName].initiate(x.originalArgs,{subscribe:!1,forceRefetch:!0})}}var aF=Symbol(),aj=({createSelector:e=tt}={})=>({name:aF,init(t,{baseQuery:r,tagTypes:n,reducerPath:o,serializeQueryArgs:a,keepUnusedDataFor:i,refetchOnMountOrArgChange:p,refetchOnFocus:f,refetchOnReconnect:m,invalidationBehavior:g,onSchemaFailure:v,catchSchemaFailure:x,skipSchemaValidation:y},C){ub();let b=Ee=>(typeof process<"u",Ee);Object.assign(t,{reducerPath:o,endpoints:{},internalActions:{onOnline:$v,onOffline:pF,onFocus:Gv,onFocusLost:dF},util:{}});let w=zV({serializeQueryArgs:a,reducerPath:o,createSelector:e}),{selectInvalidatedBy:F,selectCachedArgsForQuery:I,buildQuerySelector:E,buildInfiniteQuerySelector:k,buildMutationSelector:T}=w;Yn(t.util,{selectInvalidatedBy:F,selectCachedArgsForQuery:I});let{queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,buildMatchThunkActions:N}=$V({baseQuery:r,reducerPath:o,context:C,api:t,serializeQueryArgs:a,assertTagType:b,selectors:w,onSchemaFailure:v,catchSchemaFailure:x,skipSchemaValidation:y}),{reducer:q,actions:Y}=HV({context:C,queryThunk:D,infiniteQueryThunk:G,mutationThunk:U,serializeQueryArgs:a,reducerPath:o,assertTagType:b,config:{refetchOnFocus:f,refetchOnReconnect:m,refetchOnMountOrArgChange:p,keepUnusedDataFor:i,reducerPath:o,invalidationBehavior:g}});Yn(t.util,{patchQueryData:V,updateQueryData:B,upsertQueryData:j,prefetch:_,resetApiState:Y.resetApiState,upsertQueryEntries:Y.cacheEntriesUpserted}),Yn(t.internalActions,Y);let H=new WeakMap,ne=Ee=>rf(H,Ee,()=>({currentSubscriptions:new Map,currentPolls:new Map,runningQueries:new Map,runningMutations:new Map})),{buildInitiateQuery:te,buildInitiateInfiniteQuery:Z,buildInitiateMutation:ue,getRunningMutationThunk:Se,getRunningMutationsThunk:Ve,getRunningQueriesThunk:Je,getRunningQueryThunk:Qe}=GV({queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,serializeQueryArgs:a,context:C,getInternalState:ne});Yn(t.util,{getRunningMutationThunk:Se,getRunningMutationsThunk:Ve,getRunningQueryThunk:Qe,getRunningQueriesThunk:Je});let{middleware:ze,actions:We}=oj({reducerPath:o,context:C,queryThunk:D,mutationThunk:U,infiniteQueryThunk:G,api:t,assertTagType:b,selectors:w,getRunningQueryThunk:Qe,getInternalState:ne});return Yn(t.util,We),Yn(t,{reducer:q,middleware:ze}),{name:aF,injectEndpoint(Ee,Re){var ut;let Ie=(ut=t.endpoints)[Ee]??(ut[Ee]={});af(Re)&&Yn(Ie,{name:Ee,select:E(Ee,Re),initiate:te(Ee,Re)},N(D,Ee)),UV(Re)&&Yn(Ie,{name:Ee,select:T(),initiate:ue(Ee)},N(U,Ee)),sf(Re)&&Yn(Ie,{name:Ee,select:k(Ee,Re),initiate:Z(Ee,Re)},N(D,Ee))}}}}),AF=WV(aj());d();c();l();u();d();c();l();u();var Pa=e=>e.query,CF=e=>e.query?.enableQuerySyntax;var xF=tt(e=>Pa(e)?.q,e=>e.search.requestId,e=>e.generatedAnswer.cannotAnswer,e=>e.configuration.analytics.analyticsMode,e=>e.search.searchAction?.actionCause,(e,t,r,n,o)=>({q:e,requestId:t,cannotAnswer:r,analyticsMode:n,actionCause:o})),cf=tt(e=>e.generatedAnswer?.answerApiQueryParams,e=>e);d();c();l();u();d();c();l();u();var uf=e=>{if(e==="yes")return!0;if(e==="no")return!1},ij=()=>J("analytics/generatedAnswer/retry",e=>e.makeRetryGeneratedAnswer());function lf(e,t){return J({prefix:"analytics/generatedAnswer/openAnswerSource",__legacy__getBuilder:(r,n)=>{let o=t??Ue(n),a=os(n,e);if(!o||!a)return null;let i=bo(n);return r.makeGeneratedAnswerCitationClick(Ww(a,n),{generativeQuestionAnsweringId:o,citationId:a.id,documentId:Jw(a),...(i&&{conversationId:i})})},analyticsType:"Rga.CitationClick",analyticsPayloadBuilder:r=>{let n=os(r,e);return{answerId:t??Ue(r)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:n?.permanentid??"",title:n?.title,url:n?.clickUri}}}})}function sj(e,t,r){return J({prefix:"analytics/generatedAnswer/hoverCitation",__legacy__getBuilder:(n,o)=>{let a=r??Ue(o),i=os(o,e);if(!a||!i)return null;let p=bo(o);return n.makeGeneratedAnswerSourceHover({generativeQuestionAnsweringId:a,permanentId:i.permanentid,citationId:i.id,citationHoverTimeMs:t,...(p&&{conversationId:p})})},analyticsType:"Rga.CitationHover",analyticsPayloadBuilder:n=>{let o=os(n,e);return{answerId:r??Ue(n)??"",citationId:e,itemMetadata:{uniqueFieldName:"permanentid",uniqueFieldValue:o?.permanentid??"",title:o?.title,url:o?.clickUri},citationHoverTimeInMs:t}}})}function cj(e,t){return J({prefix:"analytics/generatedAnswer/openInlineLink",__legacy__getBuilder:r=>r.makeGeneratedAnswerOpenInlineLink({generativeQuestionAnsweringId:t,...e})})}function uj(e){return J({prefix:"analytics/generatedAnswer/like",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeLikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"like"})})}function lj(e){return J({prefix:"analytics/generatedAnswer/dislike",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeDislikeGeneratedAnswer({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"dislike"})})}var dj=e=>J({prefix:"analytics/generatedAnswer/sendFeedback",__legacy__getBuilder:(t,r)=>{let n=Ue(r);return n?t.makeGeneratedAnswerFeedbackSubmitV2({generativeQuestionAnsweringId:n,...e}):null},analyticsType:"Rga.SubmitFeedback",analyticsPayloadBuilder:t=>{let r=Ue(t),{helpful:n,readable:o,documented:a,hallucinationFree:i,correctTopic:p,documentUrl:f,details:m}=e;return{answerId:r??"",helpful:n,details:{readable:uf(o),documented:uf(a),correctTopic:uf(p),hallucinationFree:uf(i)},additionalNotes:m,correctAnswerUrl:f}}}),Xn=(e,t,r)=>J({prefix:"analytics/generatedAnswer/streamEnd",__legacy__getBuilder:(n,o)=>{let a=t??Ue(o);if(!a)return null;let i=bo(o);return n.makeGeneratedAnswerStreamEnd({generativeQuestionAnsweringId:a,answerGenerated:e,answerTextIsEmpty:r,...(i&&{conversationId:i})})},analyticsType:"Rga.AnswerReceived",analyticsPayloadBuilder:n=>({answerId:t??Ue(n)??"",answerGenerated:e??!1})}),jo=e=>J({prefix:"analytics/generatedAnswer/responseLinked",__legacy__getBuilder:()=>null,analyticsType:"Rga.ResponseLinked",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",responseId:t.search?.searchResponseId||t.search?.response.searchUid||""})}),pj=()=>J({prefix:"analytics/generatedAnswer/show",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerShowAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"show"})}),fj=()=>J({prefix:"analytics/generatedAnswer/hide",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerHideAnswers({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"hide"})}),mj=()=>J({prefix:"analytics/generatedAnswer/expand",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerExpand({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"expand"})}),gj=()=>J({prefix:"analytics/generatedAnswer/collapse",__legacy__getBuilder:(e,t)=>{let r=Ue(t);return r?e.makeGeneratedAnswerCollapse({generativeQuestionAnsweringId:r}):null},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:e=>({answerId:Ue(e)??"",action:"collapse"})});function hj(e){return J({prefix:"analytics/generatedAnswer/copy",__legacy__getBuilder:(t,r)=>{let n=e??Ue(r);if(!n)return null;let o=bo(r);return t.makeGeneratedAnswerCopyToClipboard({generativeQuestionAnsweringId:n,...(o&&{conversationId:o})})},analyticsType:"Rga.AnswerAction",analyticsPayloadBuilder:t=>({answerId:e??Ue(t)??"",action:"copyToClipboard"})})}function zv(e,t){return J({prefix:"analytics/generatedAnswer/openFollowUpAnswerSource",__legacy__getBuilder:(r,n)=>{let o=os(n,e);if(!o)return null;let a=bo(n);return a?r.makeGeneratedAnswerFollowupOpenSource({...Kw(o,n),generativeQuestionAnsweringId:t,citationId:o.id,permanentId:o.permanentid,conversationId:a}):null}})}var Ms={logCopyGeneratedAnswer:hj,logGeneratedAnswerHideAnswers:fj,logGeneratedAnswerShowAnswers:pj,logGeneratedAnswerStreamEnd:Xn,logGeneratedAnswerFeedback:dj,logDislikeGeneratedAnswer:lj,logLikeGeneratedAnswer:uj,logGeneratedAnswerOpenInlineLink:cj,logHoverCitation:sj,logOpenGeneratedAnswerSource:lf,logOpenGeneratedAnswerFollowUpSource:zv,logRetryGeneratedAnswer:ij,logGeneratedAnswerExpand:mj,logGeneratedAnswerCollapse:gj};d();c();l();u();d();c();l();u();var bF=tt(e=>e.advancedSearchQueries,e=>{if(!e)return{};let{aq:t,cq:r,dq:n,lq:o}=e;return{...(t&&{aq:t}),...(r&&{cq:r}),...(n&&{dq:n}),...(o&&{lq:o})}});d();c();l();u();var Wv=e=>e.context;d();c();l();u();var Kv=e=>e.pipeline;d();c();l();u();var Yv=e=>e.searchHub;d();c();l();u();var Lt=tt(e=>e,e=>{if(!e)return"";for(let t in e)if(e[t].isActive)return e[t].id;return""}),jie=tt(e=>e,e=>{let t=Lt(e);return t&&e?e[t].expression:""});d();c();l();u();var wF=e=>{if(!(!e.dictionaryFieldContext||!Object.keys(e.dictionaryFieldContext.contextValues).length))return e.dictionaryFieldContext.contextValues};d();c();l();u();var RF=e=>e.excerptLength?.length;d();c();l();u();var ln=(e,t)=>e.facetOptions.facets[t]?.enabled??!0,FF=e=>{let{freezeFacetOrder:t}=e.facetOptions??{};return t!==void 0?{freezeFacetOrder:t}:void 0};d();c();l();u();var EF=e=>{if(e.folding)return{filterField:e.folding.fields.collection,childField:e.folding.fields.parent,parentField:e.folding.fields.child,filterFieldRange:e.folding.filterFieldRange}};d();c();l();u();var IF=e=>e.sortCriteria;var TF=/*#__PURE__*/function(){var _ref45=_asyncToGenerator(function*(e){return{accessToken:e.configuration.accessToken,organizationId:e.configuration.organizationId,url:Vi(e.configuration.search.apiBaseUrl,e.configuration.organizationId,e.configuration.environment),streamId:e.search.extendedResults?.generativeQuestionAnsweringId}});return function TF(_x126){return _ref45.apply(this,arguments)}}(),PF=(e,t)=>{let r=Pa(e)?.q,{aq:n,cq:o,dq:a,lq:i}=_F(e),p=Wv(e),f=Ur(e.configuration.analytics,t,{actionCause:Nv(e)}),m=Yv(e),g=Kv(e),v=ov(e)??[],x=OF(e),y=Lt(e.tabSet)||"default",C=rv(e),b=Dw(e),w=t.referrer||"",F=FF(e),I=IF(e),E=yj(e),k=RF(e),T=EF(e),D=wF(e);return{q:r,...(n&&{aq:n}),...(o&&{cq:o}),...(a&&{dq:a}),...(i&&{lq:i}),...(e.query&&{enableQuerySyntax:CF(e)}),...(p?.contextValues&&{context:p.contextValues}),pipelineRuleParameters:{mlGenerativeQuestionAnswering:{responseFormat:e.generatedAnswer.responseFormat,citationsFieldToInclude:v}},...(m?.length&&{searchHub:m}),...(g?.length&&{pipeline:g}),...(x.length&&{facets:x}),...(e.fields&&{fieldsToInclude:e.fields.fieldsToInclude}),...(e.didYouMean&&{queryCorrection:{enabled:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="next",options:{automaticallyCorrect:e.didYouMean.automaticallyCorrectQuery?"whenNoResults":"never"}},enableDidYouMean:e.didYouMean.enableDidYouMean&&e.didYouMean.queryCorrectionMode==="legacy"}),...(e.pagination&&{numberOfResults:Ov(e),firstResult:e.pagination.firstResult}),tab:y,locale:C,timezone:b,...(e.debug!==void 0&&{debug:e.debug}),referrer:w,...E,...(T??{}),...(k&&{excerptLength:k}),...(D&&{dictionaryFieldContext:D}),sortCriteria:I,...(F&&{facetOptions:F}),...f,...(e.insightCaseContext?.caseContext&&{caseContext:e.insightCaseContext?.caseContext})}},kF=(e,t)=>{let r=Pa(e)?.q,n=OF(e),o=Ur(e.configuration.analytics,t,{actionCause:Nv(e)}),a=rv(e),i=Lt(e.tabSet)||"default",p=t.referrer,{aq:f,cq:m}=_F(e),g=Yv(e),v=Kv(e),x=Wv(e),y=ov(e)??[];return{q:r||"",...(n.length&&{facets:n}),citationsFieldToInclude:y,...(g?.length&&{searchHub:g}),...(v?.length&&{pipeline:v}),...(x?.contextValues&&{context:x.contextValues}),...(f&&{aq:f}),...(m&&{cq:m}),tab:i,referrer:p,...o,locale:a}},OF=e=>Xp(e)?.map(t=>Rv(t,wv())).sort((t,r)=>t.facetId>r.facetId?1:r.facetId>t.facetId?-1:0),yj=e=>({actionsHistory:e.configuration.analytics.enabled?Xt.getInstance().getHistory():[]}),_F=e=>{let t=bF(e),r=_v(e);return{...t,...(r&&{cq:r})}};d();c();l();u();var df=["searching","thinking","answering"];function pf(e){return e.toLowerCase()}var ff=["search","generic"];function Jv(){return{id:"",isVisible:!0,isEnabled:!0,isLoading:!1,isStreaming:!1,citations:[],liked:!1,disliked:!1,responseFormat:{contentFormat:["text/plain"]},feedbackModalOpen:!1,feedbackSubmitted:!1,fieldsToIncludeInCitations:[],isAnswerGenerated:!1,expanded:!1,cannotAnswer:!1,answerApiQueryParams:void 0,answerId:void 0,answerGenerationMode:"automatic",generationSteps:[]}}d();c();l();u();var NF=["text/plain","text/markdown"];var Vs=new L({required:!0}),DF=new L,js=new fe({required:!0}),Xv={id:Vs,title:Vs,uri:Vs,permanentid:Vs,clickUri:DF},mf=new L({required:!0,constrainTo:NF}),qF=new L({required:!0,constrainTo:df}),MF=e=>({...e,name:pf(e.name)}),Ls=P("generatedAnswer/setIsVisible",e=>O(e,js)),Us=P("generatedAnswer/setAnswerId",e=>O(e,z)),gf=P("generatedAnswer/setAnswerGenerationMode",e=>O(e,new L({constrainTo:["automatic","manual"],required:!1,default:"automatic"}))),Qs=P("generatedAnswer/setIsEnabled",e=>O(e,js)),Oa=P("generatedAnswer/updateMessage",e=>O(e,{textDelta:Vs})),_a=P("generatedAnswer/updateCitations",e=>O(e,{citations:new ie({required:!0,each:new X({values:Xv})})})),Na=P("generatedAnswer/updateError",e=>O(e,{message:DF,code:new re({min:0})})),dr=P("generatedAnswer/resetAnswer"),hf=P("generatedAnswer/like"),yf=P("generatedAnswer/dislike"),Sf=P("generatedAnswer/feedbackModal/open"),xl=P("generatedAnswer/expand"),vf=P("generatedAnswer/collapse"),Af=P("generatedAnswer/setId",e=>O(e,{id:new L({required:!0})})),Cf=P("generatedAnswer/feedbackModal/close"),Bs=P("generatedAnswer/sendFeedback"),dn=P("generatedAnswer/setIsLoading",e=>O(e,js)),ka=P("generatedAnswer/setIsStreaming",e=>O(e,js)),Da=P("generatedAnswer/setAnswerContentFormat",e=>O(e,mf)),xf=P("generatedAnswer/updateResponseFormat",e=>O(e,{contentFormat:new ie({each:mf,default:["text/plain"]})})),bf=P("knowledge/updateAnswerConfigurationId",e=>O(e,Vs)),wf=P("generatedAnswer/registerFieldsToIncludeInCitations",e=>O(e,Fd)),bl=P("generatedAnswer/setIsAnswerGenerated",e=>O(e,js)),qa=P("generatedAnswer/setCannotAnswer",e=>O(e,js)),Zv=P("generatedAnswer/setAnswerApiQueryParams",e=>O(e,new X({}))),Rf=P("generatedAnswer/startStep",e=>O(MF(e),{name:qF,startedAt:new re({min:0,required:!0})})),Ff=P("generatedAnswer/finishStep",e=>O(MF(e),{name:qF,finishedAt:new re({min:0,required:!0})})),Ef=P("generatedAnswer/startToolCall",e=>O(e,{toolCallName:z,startedAt:new re({min:0,required:!0}),toolCallId:z})),If=P("generatedAnswer/finishToolCall",e=>O(e,{finishedAt:new re({min:0,required:!0}),toolCallId:z})),Gs=P("generatedAnswer/toolCallArgs",e=>O(e,{toolCallId:z,args:new X({options:{required:!0}}),type:new L({required:!0,constrainTo:ff})})),VF=xe("generatedAnswer/streamAnswer",/*#__PURE__*/function(){var _ref46=_asyncToGenerator(function*(e,t){let r=t.getState(),{dispatch:n,extra:o,getState:a}=t,{search:i}=a(),{queryExecuted:p}=i,{setAbortControllerRef:f}=e,m=yield TF(r),g=(y,C)=>{switch(y){case"genqa.headerMessageType":{let b=JSON.parse(C);n(Da(b.contentFormat));break}case"genqa.messageType":n(Oa(JSON.parse(C)));break;case"genqa.citationsType":n(_a(JSON.parse(C)));break;case"genqa.endOfStreamType":{let b=JSON.parse(C).answerGenerated,{answerId:w,answer:F}=a().generatedAnswer,E=p.length!==0&&!b,k=!F?.trim();n(qa(E)),n(ka(!1)),n(bl(b)),n(Xn(b,w,b?k:void 0)),n(jo());break}default:r.debug&&o.logger.warn(`Unknown payloadType: "${y}"`)}};n(dn(!0));let v=y=>y.streamId===t.getState().search.extendedResults.generativeQuestionAnsweringId,x=o.streamingClient?.streamGeneratedAnswer(m,{write:y=>{v(m)&&(n(dn(!1)),y.payload&&y.payloadType&&g(y.payloadType,y.payload))},abort:y=>{v(m)&&n(Na(y))},close:()=>{v(m)&&n(ka(!1))},resetAnswer:()=>{v(m)&&n(dr())}});x?f(x):n(dn(!1))});return function(_x127,_x128){return _ref46.apply(this,arguments)}}()),Tf=xe("generatedAnswer/generateAnswer",/*#__PURE__*/function(){var _ref47=_asyncToGenerator(function*(e,{getState:t,dispatch:r,extra:{navigatorContext:n,logger:o}}){r(dr());let a=t();if(a.generatedAnswer.isEnabled===!1){o.warn("[WARNING] The generateAnswer action was dispatched while the generated answer is disabled. No answer will be generated. Enable the generated answer before dispatching generateAnswer.");return}if(a.generatedAnswer.answerConfigurationId){let i=PF(a,n);r(Zv(i)),yield r(Pf(i))}else o.warn("[WARNING] Missing answerConfigurationId in engine configuration. The generateAnswer action requires an answer configuration ID to use CRGA with the Answer API.")});return function(_x129,_x130){return _ref47.apply(this,arguments)}}());d();c();l();u();var Sj=/*#__PURE__*/function(){var _ref48=_asyncToGenerator(function*(e,t,r){let n=t.getState(),{accessToken:o,environment:a,organizationId:i}=n.configuration,p=n.generatedAnswer.answerConfigurationId,f={...e,headers:{...(e?.headers||{}),Authorization:`Bearer ${o}`}};try{let m=Vi(n.configuration.search?.apiBaseUrl,i,a);return sF({baseUrl:`${m}/rest/organizations/${i}/answer/v1/configs/${p}`,fetchFn:function(){var _ref49=_asyncToGenerator(function*(g){if(g instanceof String)throw new Error("The provided 'request' must be a Request object.");let v=g.url,x={};return["method","headers","mode","credentials","cache","redirect","referrer","referrerPolicy","integrity","keepalive","signal"].forEach(y=>{x[y]=g[y]}),x.duplex="half",x.body=yield g.text(),S(v,x)});return function fetchFn(_x134){return _ref49.apply(this,arguments)}}()})(f,{...t,signal:null},r)}catch(m){return{error:m}}});return function Sj(_x131,_x132,_x133){return _ref48.apply(this,arguments)}}(),kf=AF({reducerPath:"answer",baseQuery:uF(Sj,{maxRetries:3}),endpoints:()=>({})});var vj=(e,t)=>{let{contentFormat:r}=t;e.contentFormat=r,e.isStreaming=!0,e.isLoading=!1},Aj=(e,t)=>{let{textDelta:r}=t;if(typeof r!="string")return;let n=e.answer;!n?.trim()&&!r.trim()||(delete e.error,e.answer=n?.trim()?n.concat(r):r)},Cj=(e,t)=>{delete e.error,e.citations=t.citations},xj=(e,t)=>{e.generated=t.answerGenerated,e.isStreaming=!1},bj=(e,t)=>{let r=t.errorMessage||"Unknown error occurred";e.error={message:r,code:t.code},e.isStreaming=!1,e.isLoading=!1,console.error(`Generated answer error: ${r} (code: ${t.code})`)},wj=(e,t,r)=>{let n=JSON.parse(e.data);n.finishReason==="ERROR"&&n.errorMessage&&bj(t,n);let o=n.payload.length?JSON.parse(n.payload):{};switch(n.payloadType){case"genqa.headerMessageType":o.contentFormat&&(vj(t,o),r(Da(o.contentFormat)));break;case"genqa.messageType":typeof o.textDelta=="string"&&(Aj(t,o),r(Oa({textDelta:o.textDelta})));break;case"genqa.citationsType":o.citations&&(Cj(t,o),r(_a({citations:o.citations})));break;case"genqa.endOfStreamType":{xj(t,o);let a=t.answerId,i=o.answerGenerated??!1,p=i?!t.answer?.trim():void 0;r(Xn(i,a,p)),r(jo());break}}},Rj=(e,t,r,n)=>{if(!e||!t||!r)throw new Error("Missing required parameters for answer endpoint");let o=`/rest/organizations/${t}`,a=n?`insight/v1/configs/${n}/answer`:"answer/v1/configs";return`${e}${o}/${a}/${r}/generate`},Ma=kf.injectEndpoints({overrideExisting:!0,endpoints:e=>({getAnswer:e.query({queryFn:()=>({data:{contentFormat:void 0,answer:void 0,citations:void 0,error:void 0,generated:!1,isStreaming:!0,isLoading:!0}}),serializeQueryArgs:({endpointName:t,queryArgs:r})=>{let{analytics:n,...o}=r;return`${t}(${JSON.stringify(o)})`},onCacheEntryAdded(_x135,_x136){return _asyncToGenerator(function*(t,{getState:r,cacheDataLoaded:n,updateCachedData:o,dispatch:a}){yield n;let{configuration:i,generatedAnswer:p,insightConfiguration:f}=r(),{organizationId:m,environment:g,accessToken:v}=i,x=Vi(i.search.apiBaseUrl,m,g),y=Rj(x,m,p.answerConfigurationId,f?.insightId);yield Sd(y,{method:"POST",body:JSON.stringify(t),headers:{Authorization:`Bearer ${v}`,Accept:"application/json","Content-Type":"application/json","Accept-Encoding":"*"},fetch:S,onopen:function(){var _ref50=_asyncToGenerator(function*(C){let b=C.headers.get("x-answer-id");b&&o(w=>{w.answerId=b,a(Us(b))})});return function onopen(_x137){return _ref50.apply(this,arguments)}}(),onmessage:C=>{o(b=>{wj(C,b,a)})},onerror:C=>{throw C},onclose:()=>{o(C=>{a(qa(!C.generated))})}})}).apply(this,arguments)}})})}),Pf=e=>Ma.endpoints.getAnswer.initiate(e),eA=e=>{let t=cf(e);return Ma.endpoints.getAnswer.select(t??Ta)(e)};d();c();l();u();var jF=ae(Ao,e=>e);d();c();l();u();function Fj(e){let t=e.payload?.analyticsAction;return LF(e)&&!pe(t)}function LF(e){return"type"in e}var UF=e=>t=>r=>{let n;Fj(r)&&(n=r.payload.analyticsAction,delete r.payload.analyticsAction);let o=t(r);return LF(r)&&(r.type==="search/executeSearch/fullfilled"&&n===void 0&&console.error("No analytics action associated with search:",r),r.type==="recommendation/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with recommendation:",r),r.type==="productRecommendations/get/fullfilled"&&n===void 0&&console.error("No analytics action associated with product recommendation:",r)),n!==void 0&&e.dispatch(n),o};d();c();l();u();d();c();l();u();d();c();l();u();var $s=P("tab/register",e=>{let t=new X({values:{id:z,expression:Ge}});return O(e,t)}),ht=P("tab/updateActiveTab",e=>O(e,z));d();c();l();u();var Of=Vr(_p(),1),GF=Vr(QF(),1),$F=Vr(BF(),1);Of.default.extend($F.default);Of.default.extend(GF.default);var Hs=()=>({organizationId:"",accessToken:"",search:{locale:"en-US",timezone:Of.default.tz.guess(),authenticationProviders:[]},analytics:{enabled:!0,originContext:"Search",originLevel2:"default",originLevel3:"default",anonymous:!1,deviceId:"",userDisplayName:"",documentLocation:"",analyticsMode:"next",source:{}},knowledge:{answerConfigurationId:"",agentId:void 0},environment:"prod"});d();c();l();u();var Ej=/(^|; )Coveo-Pendragon=([^;]*)/,Ij=/(^|; )Coveo-SearchAgentDebug=([^;]*)/;function HF(){return typeof window>"u"?!1:Ej.exec(document.cookie)?.pop()||null}function zF(){return typeof window>"u"?!1:Ij.test(document.cookie)}var _f=ae(Hs(),e=>e.addCase(on,(t,r)=>{Tj(t,r.payload)}).addCase(Ar,(t,r)=>{Pj(t,r.payload)}).addCase(Fo,(t,r)=>{kj(t,r.payload)}).addCase(us,t=>{t.analytics.enabled=!1}).addCase(ls,t=>{t.analytics.enabled=!0}).addCase(Ep,(t,r)=>{t.analytics.originLevel2=r.payload.originLevel2}).addCase(Ip,(t,r)=>{t.analytics.originLevel3=r.payload.originLevel3}).addCase(ht,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(ds,(t,r)=>{t.analytics.originLevel2=r.payload}).addCase(Me,(t,r)=>{pe(r.payload.tab)||(t.analytics.originLevel2=r.payload.tab)}).addCase(Tp,(t,{payload:r})=>{Oj(t,r)}));function Tj(e,t){pe(t.accessToken)||(e.accessToken=t.accessToken),e.environment=t.environment??"prod",pe(t.organizationId)||(e.organizationId=t.organizationId)}function Pj(e,t){pe(t.proxyBaseUrl)||(e.search.apiBaseUrl=t.proxyBaseUrl),pe(t.locale)||(e.search.locale=t.locale),pe(t.timezone)||(e.search.timezone=t.timezone),pe(t.authenticationProviders)||(e.search.authenticationProviders=t.authenticationProviders)}function kj(e,t){pe(t.enabled)||(e.analytics.enabled=t.enabled),pe(t.originContext)||(e.analytics.originContext=t.originContext),pe(t.originLevel2)||(e.analytics.originLevel2=t.originLevel2),pe(t.originLevel3)||(e.analytics.originLevel3=t.originLevel3),pe(t.proxyBaseUrl)||(e.analytics.apiBaseUrl=t.proxyBaseUrl),pe(t.trackingId)||(e.analytics.trackingId=t.trackingId),pe(t.analyticsMode)||(e.analytics.analyticsMode=t.analyticsMode),pe(t.source)||(e.analytics.source=t.source);try{let r=HF();r&&(e.analytics.analyticsMode="next",e.analytics.trackingId=r)}catch{}pe(t.runtimeEnvironment)||(e.analytics.runtimeEnvironment=t.runtimeEnvironment),pe(t.anonymous)||(e.analytics.anonymous=t.anonymous),pe(t.deviceId)||(e.analytics.deviceId=t.deviceId),pe(t.userDisplayName)||(e.analytics.userDisplayName=t.userDisplayName),pe(t.documentLocation)||(e.analytics.documentLocation=t.documentLocation)}function Oj(e,t){e.knowledge.agentId=t;try{zF()&&(e.knowledge.debugAgentSession=!0)}catch{}}var me=_f;d();c();l();u();function _j(e){return e.instantlyCallable}var WF=()=>e=>t=>e(_j(t)?t():t);d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var Nt=[];for(let e=0;e<256;++e)Nt.push((e+256).toString(16).slice(1));function KF(e,t=0){return(Nt[e[t+0]]+Nt[e[t+1]]+Nt[e[t+2]]+Nt[e[t+3]]+"-"+Nt[e[t+4]]+Nt[e[t+5]]+"-"+Nt[e[t+6]]+Nt[e[t+7]]+"-"+Nt[e[t+8]]+Nt[e[t+9]]+"-"+Nt[e[t+10]]+Nt[e[t+11]]+Nt[e[t+12]]+Nt[e[t+13]]+Nt[e[t+14]]+Nt[e[t+15]]).toLowerCase()}d();c();l();u();var aA,Nj=new Uint8Array(16);function iA(){if(!aA){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");aA=crypto.getRandomValues.bind(crypto)}return aA(Nj)}d();c();l();u();d();c();l();u();var Dj=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),sA={randomUUID:Dj};function qj(e,t,r){if(sA.randomUUID&&!t&&!e)return sA.randomUUID();e=e||{};let n=e.random??e.rng?.()??iA();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,t){if(r=r||0,r<0||r+16>t.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)t[r+o]=n[o];return t}return KF(n)}var Lo=qj;d();c();l();u();d();c();l();u();var R={};Ru(R,{BRAND:()=>cL,DIRTY:()=>Va,EMPTY_PATH:()=>Lj,INVALID:()=>be,NEVER:()=>HL,OK:()=>Ut,ParseStatus:()=>Dt,Schema:()=>Oe,ZodAny:()=>Bo,ZodArray:()=>ro,ZodBigInt:()=>La,ZodBoolean:()=>Ua,ZodBranded:()=>Rl,ZodCatch:()=>Xa,ZodDate:()=>Qa,ZodDefault:()=>Ja,ZodDiscriminatedUnion:()=>qf,ZodEffects:()=>Ir,ZodEnum:()=>Ka,ZodError:()=>tr,ZodFirstPartyTypeKind:()=>we,ZodFunction:()=>Vf,ZodIntersection:()=>Ha,ZodIssueCode:()=>ee,ZodLazy:()=>za,ZodLiteral:()=>Wa,ZodMap:()=>Xs,ZodNaN:()=>ec,ZodNativeEnum:()=>Ya,ZodNever:()=>Gr,ZodNull:()=>Ga,ZodNullable:()=>mn,ZodNumber:()=>ja,ZodObject:()=>rr,ZodOptional:()=>Fr,ZodParsedType:()=>le,ZodPipeline:()=>Fl,ZodPromise:()=>Go,ZodReadonly:()=>Za,ZodRecord:()=>Mf,ZodSchema:()=>Oe,ZodSet:()=>Zs,ZodString:()=>Qo,ZodSymbol:()=>Ys,ZodTransformer:()=>Ir,ZodTuple:()=>fn,ZodType:()=>Oe,ZodUndefined:()=>Ba,ZodUnion:()=>$a,ZodUnknown:()=>to,ZodVoid:()=>Js,addIssueToContext:()=>ce,any:()=>yL,array:()=>CL,bigint:()=>pL,boolean:()=>iE,coerce:()=>$L,custom:()=>nE,date:()=>fL,datetimeRegex:()=>tE,defaultErrorMap:()=>Zn,discriminatedUnion:()=>RL,effect:()=>ML,enum:()=>NL,function:()=>kL,getErrorMap:()=>zs,getParsedType:()=>pn,instanceof:()=>lL,intersection:()=>FL,isAborted:()=>Nf,isAsync:()=>Ws,isDirty:()=>Df,isValid:()=>Uo,late:()=>uL,lazy:()=>OL,literal:()=>_L,makeIssue:()=>wl,map:()=>TL,nan:()=>dL,nativeEnum:()=>DL,never:()=>vL,null:()=>hL,nullable:()=>jL,number:()=>aE,object:()=>xL,objectUtil:()=>cA,oboolean:()=>GL,onumber:()=>BL,optional:()=>VL,ostring:()=>QL,pipeline:()=>UL,preprocess:()=>LL,promise:()=>qL,quotelessJson:()=>Mj,record:()=>IL,set:()=>PL,setErrorMap:()=>jj,strictObject:()=>bL,string:()=>oE,symbol:()=>mL,transformer:()=>ML,tuple:()=>EL,undefined:()=>gL,union:()=>wL,unknown:()=>SL,util:()=>De,void:()=>AL});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var De;(function(e){e.assertEqual=o=>{};function t(o){}e.assertIs=t;function r(o){throw new Error}e.assertNever=r,e.arrayToEnum=o=>{let a={};for(let i of o)a[i]=i;return a},e.getValidEnumValues=o=>{let a=e.objectKeys(o).filter(p=>typeof o[o[p]]!="number"),i={};for(let p of a)i[p]=o[p];return e.objectValues(i)},e.objectValues=o=>e.objectKeys(o).map(function(a){return o[a]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let a=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&a.push(i);return a},e.find=(o,a)=>{for(let i of o)if(a(i))return i},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,a=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(a)}e.joinValues=n,e.jsonStringifyReplacer=(o,a)=>typeof a=="bigint"?a.toString():a})(De||(De={}));var cA;(function(e){e.mergeShapes=(t,r)=>({...t,...r})})(cA||(cA={}));var le=De.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),pn=e=>{switch(typeof e){case"undefined":return le.undefined;case"string":return le.string;case"number":return Number.isNaN(e)?le.nan:le.number;case"boolean":return le.boolean;case"function":return le.function;case"bigint":return le.bigint;case"symbol":return le.symbol;case"object":return Array.isArray(e)?le.array:e===null?le.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?le.promise:typeof Map<"u"&&e instanceof Map?le.map:typeof Set<"u"&&e instanceof Set?le.set:typeof Date<"u"&&e instanceof Date?le.date:le.object;default:return le.unknown}};var ee=De.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Mj=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),tr=class e extends Error{get errors(){return this.issues}constructor(t){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=t}format(t){let r=t||function(a){return a.message},n={_errors:[]},o=a=>{for(let i of a.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)n._errors.push(r(i));else{let p=n,f=0;for(;f<i.path.length;){let m=i.path[f];f===i.path.length-1?(p[m]=p[m]||{_errors:[]},p[m]._errors.push(r(i))):p[m]=p[m]||{_errors:[]},p=p[m],f++}}};return o(this),n}static assert(t){if(!(t instanceof e))throw new Error(`Not a ZodError: ${t}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,De.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=r=>r.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let a=o.path[0];r[a]=r[a]||[],r[a].push(t(o))}else n.push(t(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};tr.create=e=>new tr(e);var Vj=(e,t)=>{let r;switch(e.code){case ee.invalid_type:e.received===le.undefined?r="Required":r=`Expected ${e.expected}, received ${e.received}`;break;case ee.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(e.expected,De.jsonStringifyReplacer)}`;break;case ee.unrecognized_keys:r=`Unrecognized key(s) in object: ${De.joinValues(e.keys,", ")}`;break;case ee.invalid_union:r="Invalid input";break;case ee.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${De.joinValues(e.options)}`;break;case ee.invalid_enum_value:r=`Invalid enum value. Expected ${De.joinValues(e.options)}, received '${e.received}'`;break;case ee.invalid_arguments:r="Invalid function arguments";break;case ee.invalid_return_type:r="Invalid function return type";break;case ee.invalid_date:r="Invalid date";break;case ee.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(r=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?r=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?r=`Invalid input: must end with "${e.validation.endsWith}"`:De.assertNever(e.validation):e.validation!=="regex"?r=`Invalid ${e.validation}`:r="Invalid";break;case ee.too_small:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="bigint"?r=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:r="Invalid input";break;case ee.too_big:e.type==="array"?r=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?r=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?r=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?r=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?r=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:r="Invalid input";break;case ee.custom:r="Invalid input";break;case ee.invalid_intersection_types:r="Intersection results could not be merged";break;case ee.not_multiple_of:r=`Number must be a multiple of ${e.multipleOf}`;break;case ee.not_finite:r="Number must be finite";break;default:r=t.defaultError,De.assertNever(e)}return{message:r}},Zn=Vj;var YF=Zn;function jj(e){YF=e}function zs(){return YF}d();c();l();u();var wl=e=>{let{data:t,path:r,errorMaps:n,issueData:o}=e,a=[...r,...(o.path||[])],i={...o,path:a};if(o.message!==void 0)return{...o,path:a,message:o.message};let p="",f=n.filter(m=>!!m).slice().reverse();for(let m of f)p=m(i,{data:t,defaultError:p}).message;return{...o,path:a,message:p}},Lj=[];function ce(e,t){let r=zs(),n=wl({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,r,r===Zn?void 0:Zn].filter(o=>!!o)});e.common.issues.push(n)}var Dt=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,r){let n=[];for(let o of r){if(o.status==="aborted")return be;o.status==="dirty"&&t.dirty(),n.push(o.value)}return{status:t.value,value:n}}static mergeObjectAsync(t,r){return _asyncToGenerator(function*(){let n=[];for(let o of r){let a=yield o.key,i=yield o.value;n.push({key:a,value:i})}return e.mergeObjectSync(t,n)})()}static mergeObjectSync(t,r){let n={};for(let o of r){let{key:a,value:i}=o;if(a.status==="aborted"||i.status==="aborted")return be;a.status==="dirty"&&t.dirty(),i.status==="dirty"&&t.dirty(),a.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(n[a.value]=i.value)}return{status:t.value,value:n}}},be=Object.freeze({status:"aborted"}),Va=e=>({status:"dirty",value:e}),Ut=e=>({status:"valid",value:e}),Nf=e=>e.status==="aborted",Df=e=>e.status==="dirty",Uo=e=>e.status==="valid",Ws=e=>typeof Promise<"u"&&e instanceof Promise;d();c();l();u();d();c();l();u();var ge;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(ge||(ge={}));var Er=class{constructor(t,r,n,o){this._cachedPath=[],this.parent=t,this.data=r,this._path=n,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},JF=(e,t)=>{if(Uo(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new tr(e.common.issues);return this._error=r,this._error}}};function Te(e){if(!e)return{};let{errorMap:t,invalid_type_error:r,required_error:n,description:o}=e;if(t&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(i,p)=>{let{message:f}=e;return i.code==="invalid_enum_value"?{message:f??p.defaultError}:typeof p.data>"u"?{message:f??n??p.defaultError}:i.code!=="invalid_type"?{message:p.defaultError}:{message:f??r??p.defaultError}},description:o}}var Oe=class{get description(){return this._def.description}_getType(t){return pn(t.data)}_getOrReturnCtx(t,r){return r||{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new Dt,ctx:{common:t.parent.common,data:t.data,parsedType:pn(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let r=this._parse(t);if(Ws(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(t){let r=this._parse(t);return Promise.resolve(r)}parse(t,r){let n=this.safeParse(t,r);if(n.success)return n.data;throw n.error}safeParse(t,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pn(t)},o=this._parseSync({data:t,path:n.path,parent:n});return JF(n,o)}"~validate"(t){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:pn(t)};if(!this["~standard"].async)try{let n=this._parseSync({data:t,path:[],parent:r});return Uo(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:t,path:[],parent:r}).then(n=>Uo(n)?{value:n.value}:{issues:r.common.issues})}parseAsync(t,r){var _this24=this;return _asyncToGenerator(function*(){let n=yield _this24.safeParseAsync(t,r);if(n.success)return n.data;throw n.error})()}safeParseAsync(t,r){var _this25=this;return _asyncToGenerator(function*(){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:_this25._def.errorMap,parent:null,data:t,parsedType:pn(t)},o=_this25._parse({data:t,path:n.path,parent:n}),a=yield Ws(o)?o:Promise.resolve(o);return JF(n,a)})()}refine(t,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,a)=>{let i=t(o),p=()=>a.addIssue({code:ee.custom,...n(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(f=>f?!0:(p(),!1)):i?!0:(p(),!1)})}refinement(t,r){return this._refinement((n,o)=>t(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(t){return new Ir({schema:this,typeName:we.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return Fr.create(this,this._def)}nullable(){return mn.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return ro.create(this)}promise(){return Go.create(this,this._def)}or(t){return $a.create([this,t],this._def)}and(t){return Ha.create(this,t,this._def)}transform(t){return new Ir({...Te(this._def),schema:this,typeName:we.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let r=typeof t=="function"?t:()=>t;return new Ja({...Te(this._def),innerType:this,defaultValue:r,typeName:we.ZodDefault})}brand(){return new Rl({typeName:we.ZodBranded,type:this,...Te(this._def)})}catch(t){let r=typeof t=="function"?t:()=>t;return new Xa({...Te(this._def),innerType:this,catchValue:r,typeName:we.ZodCatch})}describe(t){let r=this.constructor;return new r({...this._def,description:t})}pipe(t){return Fl.create(this,t)}readonly(){return Za.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Uj=/^c[^\s-]{8,}$/i,Qj=/^[0-9a-z]+$/,Bj=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Gj=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,$j=/^[a-z0-9_-]{21}$/i,Hj=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,zj=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Wj=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kj="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",uA,Yj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Jj=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,Xj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,Zj=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,eL=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,tL=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,ZF="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",rL=new RegExp(`^${ZF}$`);function eE(e){let t="[0-5]\\d";e.precision?t=`${t}\\.\\d{${e.precision}}`:e.precision==null&&(t=`${t}(\\.\\d+)?`);let r=e.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${t})${r}`}function nL(e){return new RegExp(`^${eE(e)}$`)}function tE(e){let t=`${ZF}T${eE(e)}`,r=[];return r.push(e.local?"Z?":"Z"),e.offset&&r.push("([+-]\\d{2}:?\\d{2})"),t=`${t}(${r.join("|")})`,new RegExp(`^${t}$`)}function oL(e,t){return!!((t==="v4"||!t)&&Yj.test(e)||(t==="v6"||!t)&&Xj.test(e))}function aL(e,t){if(!Hj.test(e))return!1;try{let[r]=e.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||t&&o.alg!==t)}catch{return!1}}function iL(e,t){return!!((t==="v4"||!t)&&Jj.test(e)||(t==="v6"||!t)&&Zj.test(e))}var Qo=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==le.string){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.string,received:a.parsedType}),be}let n=new Dt,o;for(let a of this._def.checks)if(a.kind==="min")t.data.length<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="max")t.data.length>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!1,message:a.message}),n.dirty());else if(a.kind==="length"){let i=t.data.length>a.value,p=t.data.length<a.value;(i||p)&&(o=this._getOrReturnCtx(t,o),i?ce(o,{code:ee.too_big,maximum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}):p&&ce(o,{code:ee.too_small,minimum:a.value,type:"string",inclusive:!0,exact:!0,message:a.message}),n.dirty())}else if(a.kind==="email")Wj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"email",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="emoji")uA||(uA=new RegExp(Kj,"u")),uA.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"emoji",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="uuid")Gj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"uuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="nanoid")$j.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"nanoid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid")Uj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="cuid2")Qj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cuid2",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="ulid")Bj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ulid",code:ee.invalid_string,message:a.message}),n.dirty());else if(a.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ce(o,{validation:"url",code:ee.invalid_string,message:a.message}),n.dirty()}else a.kind==="regex"?(a.regex.lastIndex=0,a.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"regex",code:ee.invalid_string,message:a.message}),n.dirty())):a.kind==="trim"?t.data=t.data.trim():a.kind==="includes"?t.data.includes(a.value,a.position)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{includes:a.value,position:a.position},message:a.message}),n.dirty()):a.kind==="toLowerCase"?t.data=t.data.toLowerCase():a.kind==="toUpperCase"?t.data=t.data.toUpperCase():a.kind==="startsWith"?t.data.startsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{startsWith:a.value},message:a.message}),n.dirty()):a.kind==="endsWith"?t.data.endsWith(a.value)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:{endsWith:a.value},message:a.message}),n.dirty()):a.kind==="datetime"?tE(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"datetime",message:a.message}),n.dirty()):a.kind==="date"?rL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"date",message:a.message}),n.dirty()):a.kind==="time"?nL(a).test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.invalid_string,validation:"time",message:a.message}),n.dirty()):a.kind==="duration"?zj.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"duration",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="ip"?oL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"ip",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="jwt"?aL(t.data,a.alg)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"jwt",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="cidr"?iL(t.data,a.version)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"cidr",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64"?eL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64",code:ee.invalid_string,message:a.message}),n.dirty()):a.kind==="base64url"?tL.test(t.data)||(o=this._getOrReturnCtx(t,o),ce(o,{validation:"base64url",code:ee.invalid_string,message:a.message}),n.dirty()):De.assertNever(a);return{status:n.value,value:t.data}}_regex(t,r,n){return this.refinement(o=>t.test(o),{validation:r,code:ee.invalid_string,...ge.errToObj(n)})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...ge.errToObj(t)})}url(t){return this._addCheck({kind:"url",...ge.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...ge.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...ge.errToObj(t)})}nanoid(t){return this._addCheck({kind:"nanoid",...ge.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...ge.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...ge.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...ge.errToObj(t)})}base64(t){return this._addCheck({kind:"base64",...ge.errToObj(t)})}base64url(t){return this._addCheck({kind:"base64url",...ge.errToObj(t)})}jwt(t){return this._addCheck({kind:"jwt",...ge.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...ge.errToObj(t)})}cidr(t){return this._addCheck({kind:"cidr",...ge.errToObj(t)})}datetime(t){return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:t?.offset??!1,local:t?.local??!1,...ge.errToObj(t?.message)})}date(t){return this._addCheck({kind:"date",message:t})}time(t){return typeof t=="string"?this._addCheck({kind:"time",precision:null,message:t}):this._addCheck({kind:"time",precision:typeof t?.precision>"u"?null:t?.precision,...ge.errToObj(t?.message)})}duration(t){return this._addCheck({kind:"duration",...ge.errToObj(t)})}regex(t,r){return this._addCheck({kind:"regex",regex:t,...ge.errToObj(r)})}includes(t,r){return this._addCheck({kind:"includes",value:t,position:r?.position,...ge.errToObj(r?.message)})}startsWith(t,r){return this._addCheck({kind:"startsWith",value:t,...ge.errToObj(r)})}endsWith(t,r){return this._addCheck({kind:"endsWith",value:t,...ge.errToObj(r)})}min(t,r){return this._addCheck({kind:"min",value:t,...ge.errToObj(r)})}max(t,r){return this._addCheck({kind:"max",value:t,...ge.errToObj(r)})}length(t,r){return this._addCheck({kind:"length",value:t,...ge.errToObj(r)})}nonempty(t){return this.min(1,ge.errToObj(t))}trim(){return new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isDate(){return!!this._def.checks.find(t=>t.kind==="date")}get isTime(){return!!this._def.checks.find(t=>t.kind==="time")}get isDuration(){return!!this._def.checks.find(t=>t.kind==="duration")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(t=>t.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get isCIDR(){return!!this._def.checks.find(t=>t.kind==="cidr")}get isBase64(){return!!this._def.checks.find(t=>t.kind==="base64")}get isBase64url(){return!!this._def.checks.find(t=>t.kind==="base64url")}get minLength(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxLength(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};Qo.create=e=>new Qo({checks:[],typeName:we.ZodString,coerce:e?.coerce??!1,...Te(e)});function sL(e,t){let r=(e.toString().split(".")[1]||"").length,n=(t.toString().split(".")[1]||"").length,o=r>n?r:n,a=Number.parseInt(e.toFixed(o).replace(".","")),i=Number.parseInt(t.toFixed(o).replace(".",""));return a%i/10**o}var ja=class e extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==le.number){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.number,received:a.parsedType}),be}let n,o=new Dt;for(let a of this._def.checks)a.kind==="int"?De.isInteger(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.invalid_type,expected:"integer",received:"float",message:a.message}),o.dirty()):a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,minimum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,maximum:a.value,type:"number",inclusive:a.inclusive,exact:!1,message:a.message}),o.dirty()):a.kind==="multipleOf"?sL(t.data,a.value)!==0&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):a.kind==="finite"?Number.isFinite(t.data)||(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_finite,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:ge.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}finite(t){return this._addCheck({kind:"finite",message:ge.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:ge.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:ge.toString(t)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&De.isInteger(t.value))}get isFinite(){let t=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(t===null||n.value<t)&&(t=n.value)}return Number.isFinite(r)&&Number.isFinite(t)}};ja.create=e=>new ja({checks:[],typeName:we.ZodNumber,coerce:e?.coerce||!1,...Te(e)});var La=class e extends Oe{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce)try{t.data=BigInt(t.data)}catch{return this._getInvalidInput(t)}if(this._getType(t)!==le.bigint)return this._getInvalidInput(t);let n,o=new Dt;for(let a of this._def.checks)a.kind==="min"?(a.inclusive?t.data<a.value:t.data<=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_small,type:"bigint",minimum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="max"?(a.inclusive?t.data>a.value:t.data>=a.value)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.too_big,type:"bigint",maximum:a.value,inclusive:a.inclusive,message:a.message}),o.dirty()):a.kind==="multipleOf"?t.data%a.value!==BigInt(0)&&(n=this._getOrReturnCtx(t,n),ce(n,{code:ee.not_multiple_of,multipleOf:a.value,message:a.message}),o.dirty()):De.assertNever(a);return{status:o.value,value:t.data}}_getInvalidInput(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.bigint,received:r.parsedType}),be}gte(t,r){return this.setLimit("min",t,!0,ge.toString(r))}gt(t,r){return this.setLimit("min",t,!1,ge.toString(r))}lte(t,r){return this.setLimit("max",t,!0,ge.toString(r))}lt(t,r){return this.setLimit("max",t,!1,ge.toString(r))}setLimit(t,r,n,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:r,inclusive:n,message:ge.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:ge.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:ge.toString(t)})}multipleOf(t,r){return this._addCheck({kind:"multipleOf",value:t,message:ge.toString(r)})}get minValue(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t}get maxValue(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t}};La.create=e=>new La({checks:[],typeName:we.ZodBigInt,coerce:e?.coerce??!1,...Te(e)});var Ua=class extends Oe{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==le.boolean){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.boolean,received:n.parsedType}),be}return Ut(t.data)}};Ua.create=e=>new Ua({typeName:we.ZodBoolean,coerce:e?.coerce||!1,...Te(e)});var Qa=class e extends Oe{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==le.date){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_type,expected:le.date,received:a.parsedType}),be}if(Number.isNaN(t.data.getTime())){let a=this._getOrReturnCtx(t);return ce(a,{code:ee.invalid_date}),be}let n=new Dt,o;for(let a of this._def.checks)a.kind==="min"?t.data.getTime()<a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_small,message:a.message,inclusive:!0,exact:!1,minimum:a.value,type:"date"}),n.dirty()):a.kind==="max"?t.data.getTime()>a.value&&(o=this._getOrReturnCtx(t,o),ce(o,{code:ee.too_big,message:a.message,inclusive:!0,exact:!1,maximum:a.value,type:"date"}),n.dirty()):De.assertNever(a);return{status:n.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,r){return this._addCheck({kind:"min",value:t.getTime(),message:ge.toString(r)})}max(t,r){return this._addCheck({kind:"max",value:t.getTime(),message:ge.toString(r)})}get minDate(){let t=null;for(let r of this._def.checks)r.kind==="min"&&(t===null||r.value>t)&&(t=r.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let r of this._def.checks)r.kind==="max"&&(t===null||r.value<t)&&(t=r.value);return t!=null?new Date(t):null}};Qa.create=e=>new Qa({checks:[],coerce:e?.coerce||!1,typeName:we.ZodDate,...Te(e)});var Ys=class extends Oe{_parse(t){if(this._getType(t)!==le.symbol){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.symbol,received:n.parsedType}),be}return Ut(t.data)}};Ys.create=e=>new Ys({typeName:we.ZodSymbol,...Te(e)});var Ba=class extends Oe{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.undefined,received:n.parsedType}),be}return Ut(t.data)}};Ba.create=e=>new Ba({typeName:we.ZodUndefined,...Te(e)});var Ga=class extends Oe{_parse(t){if(this._getType(t)!==le.null){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.null,received:n.parsedType}),be}return Ut(t.data)}};Ga.create=e=>new Ga({typeName:we.ZodNull,...Te(e)});var Bo=class extends Oe{constructor(){super(...arguments),this._any=!0}_parse(t){return Ut(t.data)}};Bo.create=e=>new Bo({typeName:we.ZodAny,...Te(e)});var to=class extends Oe{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ut(t.data)}};to.create=e=>new to({typeName:we.ZodUnknown,...Te(e)});var Gr=class extends Oe{_parse(t){let r=this._getOrReturnCtx(t);return ce(r,{code:ee.invalid_type,expected:le.never,received:r.parsedType}),be}};Gr.create=e=>new Gr({typeName:we.ZodNever,...Te(e)});var Js=class extends Oe{_parse(t){if(this._getType(t)!==le.undefined){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.void,received:n.parsedType}),be}return Ut(t.data)}};Js.create=e=>new Js({typeName:we.ZodVoid,...Te(e)});var ro=class e extends Oe{_parse(t){let{ctx:r,status:n}=this._processInputParams(t),o=this._def;if(r.parsedType!==le.array)return ce(r,{code:ee.invalid_type,expected:le.array,received:r.parsedType}),be;if(o.exactLength!==null){let i=r.data.length>o.exactLength.value,p=r.data.length<o.exactLength.value;(i||p)&&(ce(r,{code:i?ee.too_big:ee.too_small,minimum:p?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),n.dirty())}if(o.minLength!==null&&r.data.length<o.minLength.value&&(ce(r,{code:ee.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),n.dirty()),o.maxLength!==null&&r.data.length>o.maxLength.value&&(ce(r,{code:ee.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((i,p)=>o.type._parseAsync(new Er(r,i,r.path,p)))).then(i=>Dt.mergeArray(n,i));let a=[...r.data].map((i,p)=>o.type._parseSync(new Er(r,i,r.path,p)));return Dt.mergeArray(n,a)}get element(){return this._def.type}min(t,r){return new e({...this._def,minLength:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxLength:{value:t,message:ge.toString(r)}})}length(t,r){return new e({...this._def,exactLength:{value:t,message:ge.toString(r)}})}nonempty(t){return this.min(1,t)}};ro.create=(e,t)=>new ro({type:e,minLength:null,maxLength:null,exactLength:null,typeName:we.ZodArray,...Te(t)});function Ks(e){if(e instanceof rr){let t={};for(let r in e.shape){let n=e.shape[r];t[r]=Fr.create(Ks(n))}return new rr({...e._def,shape:()=>t})}else return e instanceof ro?new ro({...e._def,type:Ks(e.element)}):e instanceof Fr?Fr.create(Ks(e.unwrap())):e instanceof mn?mn.create(Ks(e.unwrap())):e instanceof fn?fn.create(e.items.map(t=>Ks(t))):e}var rr=class e extends Oe{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),r=De.objectKeys(t);return this._cached={shape:t,keys:r},this._cached}_parse(t){if(this._getType(t)!==le.object){let m=this._getOrReturnCtx(t);return ce(m,{code:ee.invalid_type,expected:le.object,received:m.parsedType}),be}let{status:n,ctx:o}=this._processInputParams(t),{shape:a,keys:i}=this._getCached(),p=[];if(!(this._def.catchall instanceof Gr&&this._def.unknownKeys==="strip"))for(let m in o.data)i.includes(m)||p.push(m);let f=[];for(let m of i){let g=a[m],v=o.data[m];f.push({key:{status:"valid",value:m},value:g._parse(new Er(o,v,o.path,m)),alwaysSet:m in o.data})}if(this._def.catchall instanceof Gr){let m=this._def.unknownKeys;if(m==="passthrough")for(let g of p)f.push({key:{status:"valid",value:g},value:{status:"valid",value:o.data[g]}});else if(m==="strict")p.length>0&&(ce(o,{code:ee.unrecognized_keys,keys:p}),n.dirty());else if(m!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let m=this._def.catchall;for(let g of p){let v=o.data[g];f.push({key:{status:"valid",value:g},value:m._parse(new Er(o,v,o.path,g)),alwaysSet:g in o.data})}}return o.common.async?Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){let m=[];for(let g of f){let v=yield g.key,x=yield g.value;m.push({key:v,value:x,alwaysSet:g.alwaysSet})}return m})).then(m=>Dt.mergeObjectSync(n,m)):Dt.mergeObjectSync(n,f)}get shape(){return this._def.shape()}strict(t){return ge.errToObj,new e({...this._def,unknownKeys:"strict",...(t!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:ge.errToObj(t).message??o}:{message:o}}}:{})})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:we.ZodObject})}setKey(t,r){return this.augment({[t]:r})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let r={};for(let n of De.objectKeys(t))t[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}omit(t){let r={};for(let n of De.objectKeys(this.shape))t[n]||(r[n]=this.shape[n]);return new e({...this._def,shape:()=>r})}deepPartial(){return Ks(this)}partial(t){let r={};for(let n of De.objectKeys(this.shape)){let o=this.shape[n];t&&!t[n]?r[n]=o:r[n]=o.optional()}return new e({...this._def,shape:()=>r})}required(t){let r={};for(let n of De.objectKeys(this.shape))if(t&&!t[n])r[n]=this.shape[n];else{let a=this.shape[n];for(;a instanceof Fr;)a=a._def.innerType;r[n]=a}return new e({...this._def,shape:()=>r})}keyof(){return rE(De.objectKeys(this.shape))}};rr.create=(e,t)=>new rr({shape:()=>e,unknownKeys:"strip",catchall:Gr.create(),typeName:we.ZodObject,...Te(t)});rr.strictCreate=(e,t)=>new rr({shape:()=>e,unknownKeys:"strict",catchall:Gr.create(),typeName:we.ZodObject,...Te(t)});rr.lazycreate=(e,t)=>new rr({shape:e,unknownKeys:"strip",catchall:Gr.create(),typeName:we.ZodObject,...Te(t)});var $a=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=this._def.options;function o(a){for(let p of a)if(p.result.status==="valid")return p.result;for(let p of a)if(p.result.status==="dirty")return r.common.issues.push(...p.ctx.common.issues),p.result;let i=a.map(p=>new tr(p.ctx.common.issues));return ce(r,{code:ee.invalid_union,unionErrors:i}),be}if(r.common.async)return Promise.all(n.map(/*#__PURE__*/function(){var _ref52=_asyncToGenerator(function*(a){let i={...r,common:{...r.common,issues:[]},parent:null};return{result:yield a._parseAsync({data:r.data,path:r.path,parent:i}),ctx:i}});return function(_x138){return _ref52.apply(this,arguments)}}())).then(o);{let a,i=[];for(let f of n){let m={...r,common:{...r.common,issues:[]},parent:null},g=f._parseSync({data:r.data,path:r.path,parent:m});if(g.status==="valid")return g;g.status==="dirty"&&!a&&(a={result:g,ctx:m}),m.common.issues.length&&i.push(m.common.issues)}if(a)return r.common.issues.push(...a.ctx.common.issues),a.result;let p=i.map(f=>new tr(f));return ce(r,{code:ee.invalid_union,unionErrors:p}),be}}get options(){return this._def.options}};$a.create=(e,t)=>new $a({options:e,typeName:we.ZodUnion,...Te(t)});var eo=e=>e instanceof za?eo(e.schema):e instanceof Ir?eo(e.innerType()):e instanceof Wa?[e.value]:e instanceof Ka?e.options:e instanceof Ya?De.objectValues(e.enum):e instanceof Ja?eo(e._def.innerType):e instanceof Ba?[void 0]:e instanceof Ga?[null]:e instanceof Fr?[void 0,...eo(e.unwrap())]:e instanceof mn?[null,...eo(e.unwrap())]:e instanceof Rl||e instanceof Za?eo(e.unwrap()):e instanceof Xa?eo(e._def.innerType):[],qf=class e extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.object)return ce(r,{code:ee.invalid_type,expected:le.object,received:r.parsedType}),be;let n=this.discriminator,o=r.data[n],a=this.optionsMap.get(o);return a?r.common.async?a._parseAsync({data:r.data,path:r.path,parent:r}):a._parseSync({data:r.data,path:r.path,parent:r}):(ce(r,{code:ee.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),be)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,r,n){let o=new Map;for(let a of r){let i=eo(a.shape[t]);if(!i.length)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let p of i){if(o.has(p))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(p)}`);o.set(p,a)}}return new e({typeName:we.ZodDiscriminatedUnion,discriminator:t,options:r,optionsMap:o,...Te(n)})}};function lA(e,t){let r=pn(e),n=pn(t);if(e===t)return{valid:!0,data:e};if(r===le.object&&n===le.object){let o=De.objectKeys(t),a=De.objectKeys(e).filter(p=>o.indexOf(p)!==-1),i={...e,...t};for(let p of a){let f=lA(e[p],t[p]);if(!f.valid)return{valid:!1};i[p]=f.data}return{valid:!0,data:i}}else if(r===le.array&&n===le.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let a=0;a<e.length;a++){let i=e[a],p=t[a],f=lA(i,p);if(!f.valid)return{valid:!1};o.push(f.data)}return{valid:!0,data:o}}else return r===le.date&&n===le.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}var Ha=class extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t),o=(a,i)=>{if(Nf(a)||Nf(i))return be;let p=lA(a.value,i.value);return p.valid?((Df(a)||Df(i))&&r.dirty(),{status:r.value,value:p.data}):(ce(n,{code:ee.invalid_intersection_types}),be)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([a,i])=>o(a,i)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};Ha.create=(e,t,r)=>new Ha({left:e,right:t,typeName:we.ZodIntersection,...Te(r)});var fn=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.array)return ce(n,{code:ee.invalid_type,expected:le.array,received:n.parsedType}),be;if(n.data.length<this._def.items.length)return ce(n,{code:ee.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),be;!this._def.rest&&n.data.length>this._def.items.length&&(ce(n,{code:ee.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let a=[...n.data].map((i,p)=>{let f=this._def.items[p]||this._def.rest;return f?f._parse(new Er(n,i,n.path,p)):null}).filter(i=>!!i);return n.common.async?Promise.all(a).then(i=>Dt.mergeArray(r,i)):Dt.mergeArray(r,a)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};fn.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new fn({items:e,typeName:we.ZodTuple,rest:null,...Te(t)})};var Mf=class e extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.object)return ce(n,{code:ee.invalid_type,expected:le.object,received:n.parsedType}),be;let o=[],a=this._def.keyType,i=this._def.valueType;for(let p in n.data)o.push({key:a._parse(new Er(n,p,n.path,p)),value:i._parse(new Er(n,n.data[p],n.path,p)),alwaysSet:p in n.data});return n.common.async?Dt.mergeObjectAsync(r,o):Dt.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(t,r,n){return r instanceof Oe?new e({keyType:t,valueType:r,typeName:we.ZodRecord,...Te(n)}):new e({keyType:Qo.create(),valueType:t,typeName:we.ZodRecord,...Te(r)})}},Xs=class extends Oe{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.map)return ce(n,{code:ee.invalid_type,expected:le.map,received:n.parsedType}),be;let o=this._def.keyType,a=this._def.valueType,i=[...n.data.entries()].map(([p,f],m)=>({key:o._parse(new Er(n,p,n.path,[m,"key"])),value:a._parse(new Er(n,f,n.path,[m,"value"]))}));if(n.common.async){let p=new Map;return Promise.resolve().then(/*#__PURE__*/_asyncToGenerator(function*(){for(let f of i){let m=yield f.key,g=yield f.value;if(m.status==="aborted"||g.status==="aborted")return be;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}))}else{let p=new Map;for(let f of i){let m=f.key,g=f.value;if(m.status==="aborted"||g.status==="aborted")return be;(m.status==="dirty"||g.status==="dirty")&&r.dirty(),p.set(m.value,g.value)}return{status:r.value,value:p}}}};Xs.create=(e,t,r)=>new Xs({valueType:t,keyType:e,typeName:we.ZodMap,...Te(r)});var Zs=class e extends Oe{_parse(t){let{status:r,ctx:n}=this._processInputParams(t);if(n.parsedType!==le.set)return ce(n,{code:ee.invalid_type,expected:le.set,received:n.parsedType}),be;let o=this._def;o.minSize!==null&&n.data.size<o.minSize.value&&(ce(n,{code:ee.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),r.dirty()),o.maxSize!==null&&n.data.size>o.maxSize.value&&(ce(n,{code:ee.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let a=this._def.valueType;function i(f){let m=new Set;for(let g of f){if(g.status==="aborted")return be;g.status==="dirty"&&r.dirty(),m.add(g.value)}return{status:r.value,value:m}}let p=[...n.data.values()].map((f,m)=>a._parse(new Er(n,f,n.path,m)));return n.common.async?Promise.all(p).then(f=>i(f)):i(p)}min(t,r){return new e({...this._def,minSize:{value:t,message:ge.toString(r)}})}max(t,r){return new e({...this._def,maxSize:{value:t,message:ge.toString(r)}})}size(t,r){return this.min(t,r).max(t,r)}nonempty(t){return this.min(1,t)}};Zs.create=(e,t)=>new Zs({valueType:e,minSize:null,maxSize:null,typeName:we.ZodSet,...Te(t)});var Vf=class e extends Oe{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.function)return ce(r,{code:ee.invalid_type,expected:le.function,received:r.parsedType}),be;function n(p,f){return wl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_arguments,argumentsError:f}})}function o(p,f){return wl({data:p,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,zs(),Zn].filter(m=>!!m),issueData:{code:ee.invalid_return_type,returnTypeError:f}})}let a={errorMap:r.common.contextualErrorMap},i=r.data;if(this._def.returns instanceof Go){let p=this;return Ut(/*#__PURE__*/_asyncToGenerator(function*(...f){let m=new tr([]),g=yield p._def.args.parseAsync(f,a).catch(y=>{throw m.addIssue(n(f,y)),m}),v=yield Reflect.apply(i,this,g);return yield p._def.returns._def.type.parseAsync(v,a).catch(y=>{throw m.addIssue(o(v,y)),m})}))}else{let p=this;return Ut(function(...f){let m=p._def.args.safeParse(f,a);if(!m.success)throw new tr([n(f,m.error)]);let g=Reflect.apply(i,this,m.data),v=p._def.returns.safeParse(g,a);if(!v.success)throw new tr([o(g,v.error)]);return v.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:fn.create(t).rest(to.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,r,n){return new e({args:t||fn.create([]).rest(to.create()),returns:r||to.create(),typeName:we.ZodFunction,...Te(n)})}},za=class extends Oe{get schema(){return this._def.getter()}_parse(t){let{ctx:r}=this._processInputParams(t);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};za.create=(e,t)=>new za({getter:e,typeName:we.ZodLazy,...Te(t)});var Wa=class extends Oe{_parse(t){if(t.data!==this._def.value){let r=this._getOrReturnCtx(t);return ce(r,{received:r.data,code:ee.invalid_literal,expected:this._def.value}),be}return{status:"valid",value:t.data}}get value(){return this._def.value}};Wa.create=(e,t)=>new Wa({value:e,typeName:we.ZodLiteral,...Te(t)});function rE(e,t){return new Ka({values:e,typeName:we.ZodEnum,...Te(t)})}var Ka=class e extends Oe{_parse(t){if(typeof t.data!="string"){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{expected:De.joinValues(n),received:r.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(t.data)){let r=this._getOrReturnCtx(t),n=this._def.values;return ce(r,{received:r.data,code:ee.invalid_enum_value,options:n}),be}return Ut(t.data)}get options(){return this._def.values}get enum(){let t={};for(let r of this._def.values)t[r]=r;return t}get Values(){let t={};for(let r of this._def.values)t[r]=r;return t}get Enum(){let t={};for(let r of this._def.values)t[r]=r;return t}extract(t,r=this._def){return e.create(t,{...this._def,...r})}exclude(t,r=this._def){return e.create(this.options.filter(n=>!t.includes(n)),{...this._def,...r})}};Ka.create=rE;var Ya=class extends Oe{_parse(t){let r=De.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(t);if(n.parsedType!==le.string&&n.parsedType!==le.number){let o=De.objectValues(r);return ce(n,{expected:De.joinValues(o),received:n.parsedType,code:ee.invalid_type}),be}if(this._cache||(this._cache=new Set(De.getValidEnumValues(this._def.values))),!this._cache.has(t.data)){let o=De.objectValues(r);return ce(n,{received:n.data,code:ee.invalid_enum_value,options:o}),be}return Ut(t.data)}get enum(){return this._def.values}};Ya.create=(e,t)=>new Ya({values:e,typeName:we.ZodNativeEnum,...Te(t)});var Go=class extends Oe{unwrap(){return this._def.type}_parse(t){let{ctx:r}=this._processInputParams(t);if(r.parsedType!==le.promise&&r.common.async===!1)return ce(r,{code:ee.invalid_type,expected:le.promise,received:r.parsedType}),be;let n=r.parsedType===le.promise?r.data:Promise.resolve(r.data);return Ut(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};Go.create=(e,t)=>new Go({type:e,typeName:we.ZodPromise,...Te(t)});var Ir=class extends Oe{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===we.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){var _this26=this;let{status:r,ctx:n}=this._processInputParams(t),o=this._def.effect||null,a={addIssue:i=>{ce(n,i),i.fatal?r.abort():r.dirty()},get path(){return n.path}};if(a.addIssue=a.addIssue.bind(a),o.type==="preprocess"){let i=o.transform(n.data,a);if(n.common.async)return Promise.resolve(i).then(/*#__PURE__*/function(){var _ref55=_asyncToGenerator(function*(p){if(r.value==="aborted")return be;let f=yield _this26._def.schema._parseAsync({data:p,path:n.path,parent:n});return f.status==="aborted"?be:f.status==="dirty"?Va(f.value):r.value==="dirty"?Va(f.value):f});return function(_x139){return _ref55.apply(this,arguments)}}());{if(r.value==="aborted")return be;let p=this._def.schema._parseSync({data:i,path:n.path,parent:n});return p.status==="aborted"?be:p.status==="dirty"?Va(p.value):r.value==="dirty"?Va(p.value):p}}if(o.type==="refinement"){let i=p=>{let f=o.refinement(p,a);if(n.common.async)return Promise.resolve(f);if(f instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return p};if(n.common.async===!1){let p=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return p.status==="aborted"?be:(p.status==="dirty"&&r.dirty(),i(p.value),{status:r.value,value:p.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(p=>p.status==="aborted"?be:(p.status==="dirty"&&r.dirty(),i(p.value).then(()=>({status:r.value,value:p.value}))))}if(o.type==="transform")if(n.common.async===!1){let i=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!Uo(i))return be;let p=o.transform(i.value,a);if(p instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:p}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(i=>Uo(i)?Promise.resolve(o.transform(i.value,a)).then(p=>({status:r.value,value:p})):be);De.assertNever(o)}};Ir.create=(e,t,r)=>new Ir({schema:e,typeName:we.ZodEffects,effect:t,...Te(r)});Ir.createWithPreprocess=(e,t,r)=>new Ir({schema:t,effect:{type:"preprocess",transform:e},typeName:we.ZodEffects,...Te(r)});var Fr=class extends Oe{_parse(t){return this._getType(t)===le.undefined?Ut(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};Fr.create=(e,t)=>new Fr({innerType:e,typeName:we.ZodOptional,...Te(t)});var mn=class extends Oe{_parse(t){return this._getType(t)===le.null?Ut(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};mn.create=(e,t)=>new mn({innerType:e,typeName:we.ZodNullable,...Te(t)});var Ja=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return r.parsedType===le.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Ja.create=(e,t)=>new Ja({innerType:e,typeName:we.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...Te(t)});var Xa=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return Ws(o)?o.then(a=>({status:"valid",value:a.status==="valid"?a.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new tr(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Xa.create=(e,t)=>new Xa({innerType:e,typeName:we.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...Te(t)});var ec=class extends Oe{_parse(t){if(this._getType(t)!==le.nan){let n=this._getOrReturnCtx(t);return ce(n,{code:ee.invalid_type,expected:le.nan,received:n.parsedType}),be}return{status:"valid",value:t.data}}};ec.create=e=>new ec({typeName:we.ZodNaN,...Te(e)});var cL=Symbol("zod_brand"),Rl=class extends Oe{_parse(t){let{ctx:r}=this._processInputParams(t),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},Fl=class e extends Oe{_parse(t){var _this27=this;let{status:r,ctx:n}=this._processInputParams(t);if(n.common.async)return _asyncToGenerator(function*(){let a=yield _this27._def.in._parseAsync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?be:a.status==="dirty"?(r.dirty(),Va(a.value)):_this27._def.out._parseAsync({data:a.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?be:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(t,r){return new e({in:t,out:r,typeName:we.ZodPipeline})}},Za=class extends Oe{_parse(t){let r=this._def.innerType._parse(t),n=o=>(Uo(o)&&(o.value=Object.freeze(o.value)),o);return Ws(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Za.create=(e,t)=>new Za({innerType:e,typeName:we.ZodReadonly,...Te(t)});function XF(e,t){let r=typeof e=="function"?e(t):typeof e=="string"?{message:e}:e;return typeof r=="string"?{message:r}:r}function nE(e,t={},r){return e?Bo.create().superRefine((n,o)=>{let a=e(n);if(a instanceof Promise)return a.then(i=>{if(!i){let p=XF(t,n),f=p.fatal??r??!0;o.addIssue({code:"custom",...p,fatal:f})}});if(!a){let i=XF(t,n),p=i.fatal??r??!0;o.addIssue({code:"custom",...i,fatal:p})}}):Bo.create()}var uL={object:rr.lazycreate},we;(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(we||(we={}));var lL=(e,t={message:`Input not instance of ${e.name}`})=>nE(r=>r instanceof e,t),oE=Qo.create,aE=ja.create,dL=ec.create,pL=La.create,iE=Ua.create,fL=Qa.create,mL=Ys.create,gL=Ba.create,hL=Ga.create,yL=Bo.create,SL=to.create,vL=Gr.create,AL=Js.create,CL=ro.create,xL=rr.create,bL=rr.strictCreate,wL=$a.create,RL=qf.create,FL=Ha.create,EL=fn.create,IL=Mf.create,TL=Xs.create,PL=Zs.create,kL=Vf.create,OL=za.create,_L=Wa.create,NL=Ka.create,DL=Ya.create,qL=Go.create,ML=Ir.create,VL=Fr.create,jL=mn.create,LL=Ir.createWithPreprocess,UL=Fl.create,QL=()=>oE().optional(),BL=()=>aE().optional(),GL=()=>iE().optional(),$L={string:e=>Qo.create({...e,coerce:!0}),number:e=>ja.create({...e,coerce:!0}),boolean:e=>Ua.create({...e,coerce:!0}),bigint:e=>La.create({...e,coerce:!0}),date:e=>Qa.create({...e,coerce:!0})};var HL=be;var zL=R.object({name:R.string(),arguments:R.string()}),WL=R.object({id:R.string(),type:R.literal("function"),function:zL,encryptedValue:R.string().optional()}),jf=R.object({id:R.string(),role:R.string(),content:R.string().optional(),name:R.string().optional(),encryptedValue:R.string().optional()}),KL=R.object({type:R.literal("text"),text:R.string()}),YL=R.object({type:R.literal("data"),value:R.string(),mimeType:R.string()}),JL=R.object({type:R.literal("url"),value:R.string(),mimeType:R.string().optional()}),Lf=R.discriminatedUnion("type",[YL,JL]),XL=R.object({type:R.literal("image"),source:Lf,metadata:R.unknown().optional()}),ZL=R.object({type:R.literal("audio"),source:Lf,metadata:R.unknown().optional()}),eU=R.object({type:R.literal("video"),source:Lf,metadata:R.unknown().optional()}),tU=R.object({type:R.literal("document"),source:Lf,metadata:R.unknown().optional()});var sE=R.object({type:R.literal("binary"),mimeType:R.string(),id:R.string().optional(),url:R.string().optional(),data:R.string().optional(),filename:R.string().optional()}),cE=(e,t)=>{!e.id&&!e.url&&!e.data&&t.addIssue({code:R.ZodIssueCode.custom,message:"BinaryInputContent requires at least one of id, url, or data.",path:["id"]})},Cde=sE.superRefine((e,t)=>{cE(e,t)}),rU=R.discriminatedUnion("type",[KL,XL,ZL,eU,tU,sE]),nU=rU.superRefine((e,t)=>{e.type==="binary"&&cE(e,t)}),oU=jf.extend({role:R.literal("developer"),content:R.string()}),aU=jf.extend({role:R.literal("system"),content:R.string()}),iU=jf.extend({role:R.literal("assistant"),content:R.string().optional(),toolCalls:R.array(WL).optional()}),sU=jf.extend({role:R.literal("user"),content:R.union([R.string(),R.array(nU)])}),cU=R.object({id:R.string(),content:R.string(),role:R.literal("tool"),toolCallId:R.string(),error:R.string().optional(),encryptedValue:R.string().optional()}),uU=R.object({id:R.string(),role:R.literal("activity"),activityType:R.string(),content:R.record(R.any())}),lU=R.object({id:R.string(),role:R.literal("reasoning"),content:R.string(),encryptedValue:R.string().optional()}),uE=R.discriminatedUnion("role",[oU,aU,iU,sU,cU,uU,lU]),xde=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user"),R.literal("tool"),R.literal("activity"),R.literal("reasoning")]),dU=R.object({description:R.string(),value:R.string()}),lE=R.object({name:R.string(),description:R.string(),parameters:R.any(),metadata:R.record(R.any()).optional()}),pU=R.object({id:R.string(),reason:R.string(),message:R.string().optional(),toolCallId:R.string().optional(),responseSchema:R.record(R.any()).optional(),expiresAt:R.string().optional(),metadata:R.record(R.any()).optional()}),fU=R.object({interruptId:R.string(),status:R.enum(["resolved","cancelled"]),payload:R.any().optional()}),mU=R.object({threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),state:R.any(),messages:R.array(uE),tools:R.array(lE),context:R.array(dU),forwardedProps:R.any(),resume:R.array(fU).optional()}),gU=R.any(),Xe=class extends Error{constructor(e){super(e)}},dA=class extends Xe{constructor(){super("Connect not implemented. This method is not supported by the current agent.")}},hU=R.object({name:R.string(),description:R.string().optional()}),yU=R.object({name:R.string().optional(),type:R.string().optional(),description:R.string().optional(),version:R.string().optional(),provider:R.string().optional(),documentationUrl:R.string().optional(),metadata:R.record(R.unknown()).optional()}),SU=R.object({streaming:R.boolean().optional(),websocket:R.boolean().optional(),httpBinary:R.boolean().optional(),pushNotifications:R.boolean().optional(),resumable:R.boolean().optional()}),vU=R.object({supported:R.boolean().optional(),items:R.array(lE).optional(),parallelCalls:R.boolean().optional(),clientProvided:R.boolean().optional()}),AU=R.object({structuredOutput:R.boolean().optional(),supportedMimeTypes:R.array(R.string()).optional()}),CU=R.object({snapshots:R.boolean().optional(),deltas:R.boolean().optional(),memory:R.boolean().optional(),persistentState:R.boolean().optional()}),xU=R.object({supported:R.boolean().optional(),delegation:R.boolean().optional(),handoffs:R.boolean().optional(),subAgents:R.array(hU).optional()}),bU=R.object({supported:R.boolean().optional(),streaming:R.boolean().optional(),encrypted:R.boolean().optional()}),wU=R.object({image:R.boolean().optional(),audio:R.boolean().optional(),video:R.boolean().optional(),pdf:R.boolean().optional(),file:R.boolean().optional()}),RU=R.object({image:R.boolean().optional(),audio:R.boolean().optional()}),FU=R.object({input:wU.optional(),output:RU.optional()}),EU=R.object({codeExecution:R.boolean().optional(),sandboxed:R.boolean().optional(),maxIterations:R.number().optional(),maxExecutionTime:R.number().optional()}),IU=R.object({supported:R.boolean().optional(),approvals:R.boolean().optional(),interventions:R.boolean().optional(),feedback:R.boolean().optional(),interrupts:R.boolean().optional(),approveWithEdits:R.boolean().optional()}),bde=R.object({identity:yU.optional(),transport:SU.optional(),tools:vU.optional(),output:AU.optional(),state:CU.optional(),multiAgent:xU.optional(),reasoning:bU.optional(),multimodal:FU.optional(),execution:EU.optional(),humanInTheLoop:IU.optional(),custom:R.record(R.unknown()).optional()}),dE=R.union([R.literal("developer"),R.literal("system"),R.literal("assistant"),R.literal("user")]),M=function(e){return e.TEXT_MESSAGE_START="TEXT_MESSAGE_START",e.TEXT_MESSAGE_CONTENT="TEXT_MESSAGE_CONTENT",e.TEXT_MESSAGE_END="TEXT_MESSAGE_END",e.TEXT_MESSAGE_CHUNK="TEXT_MESSAGE_CHUNK",e.TOOL_CALL_START="TOOL_CALL_START",e.TOOL_CALL_ARGS="TOOL_CALL_ARGS",e.TOOL_CALL_END="TOOL_CALL_END",e.TOOL_CALL_CHUNK="TOOL_CALL_CHUNK",e.TOOL_CALL_RESULT="TOOL_CALL_RESULT",e.THINKING_START="THINKING_START",e.THINKING_END="THINKING_END",e.THINKING_TEXT_MESSAGE_START="THINKING_TEXT_MESSAGE_START",e.THINKING_TEXT_MESSAGE_CONTENT="THINKING_TEXT_MESSAGE_CONTENT",e.THINKING_TEXT_MESSAGE_END="THINKING_TEXT_MESSAGE_END",e.STATE_SNAPSHOT="STATE_SNAPSHOT",e.STATE_DELTA="STATE_DELTA",e.MESSAGES_SNAPSHOT="MESSAGES_SNAPSHOT",e.ACTIVITY_SNAPSHOT="ACTIVITY_SNAPSHOT",e.ACTIVITY_DELTA="ACTIVITY_DELTA",e.RAW="RAW",e.CUSTOM="CUSTOM",e.RUN_STARTED="RUN_STARTED",e.RUN_FINISHED="RUN_FINISHED",e.RUN_ERROR="RUN_ERROR",e.STEP_STARTED="STEP_STARTED",e.STEP_FINISHED="STEP_FINISHED",e.REASONING_START="REASONING_START",e.REASONING_MESSAGE_START="REASONING_MESSAGE_START",e.REASONING_MESSAGE_CONTENT="REASONING_MESSAGE_CONTENT",e.REASONING_MESSAGE_END="REASONING_MESSAGE_END",e.REASONING_MESSAGE_CHUNK="REASONING_MESSAGE_CHUNK",e.REASONING_END="REASONING_END",e.REASONING_ENCRYPTED_VALUE="REASONING_ENCRYPTED_VALUE",e}({}),Le=R.object({type:R.nativeEnum(M),timestamp:R.number().optional(),rawEvent:R.any().optional()}).passthrough(),TU=Le.extend({type:R.literal(M.TEXT_MESSAGE_START),messageId:R.string(),role:dE.default("assistant"),name:R.string().optional()}),pE=Le.extend({type:R.literal(M.TEXT_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),PU=Le.extend({type:R.literal(M.TEXT_MESSAGE_END),messageId:R.string()}),kU=Le.extend({type:R.literal(M.TEXT_MESSAGE_CHUNK),messageId:R.string().optional(),role:dE.optional(),delta:R.string().optional(),name:R.string().optional()}),OU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_START)}),_U=pE.omit({messageId:!0,type:!0}).extend({type:R.literal(M.THINKING_TEXT_MESSAGE_CONTENT)}),NU=Le.extend({type:R.literal(M.THINKING_TEXT_MESSAGE_END)}),DU=Le.extend({type:R.literal(M.TOOL_CALL_START),toolCallId:R.string(),toolCallName:R.string(),parentMessageId:R.string().optional()}),qU=Le.extend({type:R.literal(M.TOOL_CALL_ARGS),toolCallId:R.string(),delta:R.string()}),MU=Le.extend({type:R.literal(M.TOOL_CALL_END),toolCallId:R.string()}),VU=Le.extend({messageId:R.string(),type:R.literal(M.TOOL_CALL_RESULT),toolCallId:R.string(),content:R.string(),role:R.literal("tool").optional()}),jU=Le.extend({type:R.literal(M.TOOL_CALL_CHUNK),toolCallId:R.string().optional(),toolCallName:R.string().optional(),parentMessageId:R.string().optional(),delta:R.string().optional()}),LU=Le.extend({type:R.literal(M.THINKING_START),title:R.string().optional()}),UU=Le.extend({type:R.literal(M.THINKING_END)}),QU=Le.extend({type:R.literal(M.STATE_SNAPSHOT),snapshot:gU}),BU=Le.extend({type:R.literal(M.STATE_DELTA),delta:R.array(R.any())}),GU=Le.extend({type:R.literal(M.MESSAGES_SNAPSHOT),messages:R.array(uE)}),$U=Le.extend({type:R.literal(M.ACTIVITY_SNAPSHOT),messageId:R.string(),activityType:R.string(),content:R.record(R.any()),replace:R.boolean().optional().default(!0)}),HU=Le.extend({type:R.literal(M.ACTIVITY_DELTA),messageId:R.string(),activityType:R.string(),patch:R.array(R.any())}),zU=Le.extend({type:R.literal(M.RAW),event:R.any(),source:R.string().optional()}),WU=Le.extend({type:R.literal(M.CUSTOM),name:R.string(),value:R.any()}),KU=Le.extend({type:R.literal(M.RUN_STARTED),threadId:R.string(),runId:R.string(),parentRunId:R.string().optional(),input:mU.optional()}),YU=R.object({type:R.literal("success")}).strict(),JU=R.object({type:R.literal("interrupt"),interrupts:R.array(pU).min(1)}).strict(),XU=R.discriminatedUnion("type",[YU,JU]),ZU=Le.extend({type:R.literal(M.RUN_FINISHED),threadId:R.string(),runId:R.string(),result:R.any().optional(),outcome:XU.nullable().optional().transform(e=>e??void 0)}),eQ=Le.extend({type:R.literal(M.RUN_ERROR),message:R.string(),code:R.string().optional()}),tQ=Le.extend({type:R.literal(M.STEP_STARTED),stepName:R.string()}),rQ=Le.extend({type:R.literal(M.STEP_FINISHED),stepName:R.string()}),nQ=R.union([R.literal("tool-call"),R.literal("message")]),oQ=Le.extend({type:R.literal(M.REASONING_START),messageId:R.string()}),aQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_START),messageId:R.string(),role:R.literal("reasoning")}),iQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CONTENT),messageId:R.string(),delta:R.string()}),sQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_END),messageId:R.string()}),cQ=Le.extend({type:R.literal(M.REASONING_MESSAGE_CHUNK),messageId:R.string().optional(),delta:R.string().optional()}),uQ=Le.extend({type:R.literal(M.REASONING_END),messageId:R.string()}),lQ=Le.extend({type:R.literal(M.REASONING_ENCRYPTED_VALUE),subtype:nQ,entityId:R.string(),encryptedValue:R.string()}),Uf=R.discriminatedUnion("type",[TU,pE,PU,kU,LU,UU,OU,_U,NU,DU,qU,MU,jU,VU,QU,BU,GU,$U,HU,zU,WU,KU,ZU,eQ,tQ,rQ,oQ,aQ,iQ,sQ,cQ,uQ,lQ]);d();c();l();u();var pA={};Ru(pA,{JsonPatchError:()=>at,_areEquals:()=>Tl,applyOperation:()=>ei,applyPatch:()=>Wf,applyReducer:()=>gQ,deepClone:()=>fQ,getValueByPointer:()=>Hf,validate:()=>mE,validator:()=>zf});d();c();l();u();d();c();l();u();var dQ=function(){var e=function(t,r){return e=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,o){n.__proto__=o}||function(n,o){for(var a in o)o.hasOwnProperty(a)&&(n[a]=o[a])},e(t,r)};return function(t,r){e(t,r);function n(){this.constructor=t}t.prototype=r===null?Object.create(r):(n.prototype=r.prototype,new n)}}(),pQ=Object.prototype.hasOwnProperty;function Bf(e,t){return pQ.call(e,t)}function Gf(e){if(Array.isArray(e)){for(var t=new Array(e.length),r=0;r<t.length;r++)t[r]=""+r;return t}if(Object.keys)return Object.keys(e);var n=[];for(var o in e)Bf(e,o)&&n.push(o);return n}function qt(e){switch(typeof e){case"object":return JSON.parse(JSON.stringify(e));case"undefined":return null;default:return e}}function $f(e){for(var t=0,r=e.length,n;t<r;){if(n=e.charCodeAt(t),n>=48&&n<=57){t++;continue}return!1}return!0}function gn(e){return e.indexOf("/")===-1&&e.indexOf("~")===-1?e:e.replace(/~/g,"~0").replace(/\//g,"~1")}function El(e){return e.replace(/~1/g,"/").replace(/~0/g,"~")}function Qf(e){if(e===void 0)return!0;if(e){if(Array.isArray(e)){for(var t=0,r=e.length;t<r;t++)if(Qf(e[t]))return!0}else if(typeof e=="object"){for(var n=Gf(e),o=n.length,a=0;a<o;a++)if(Qf(e[n[a]]))return!0}}return!1}function fE(e,t){var r=[e];for(var n in t){var o=typeof t[n]=="object"?JSON.stringify(t[n],null,2):t[n];typeof o<"u"&&r.push(n+": "+o)}return r.join(`
33
33
  `)}var Il=function(e){dQ(t,e);function t(r,n,o,a,i){var p=this.constructor,f=e.call(this,fE(r,{name:n,index:o,operation:a,tree:i}))||this;return f.name=n,f.index=o,f.operation=a,f.tree=i,Object.setPrototypeOf(f,p.prototype),f.message=fE(r,{name:n,index:o,operation:a,tree:i}),f}return t}(Error);var at=Il,fQ=qt,tc={add:function(e,t,r){return e[t]=this.value,{newDocument:r}},remove:function(e,t,r){var n=e[t];return delete e[t],{newDocument:r,removed:n}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:function(e,t,r){var n=Hf(r,this.path);n&&(n=qt(n));var o=ei(r,{op:"remove",path:this.from}).removed;return ei(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(e,t,r){var n=Hf(r,this.from);return ei(r,{op:"add",path:this.path,value:qt(n)}),{newDocument:r}},test:function(e,t,r){return{newDocument:r,test:Tl(e[t],this.value)}},_get:function(e,t,r){return this.value=e[t],{newDocument:r}}},mQ={add:function(e,t,r){return $f(t)?e.splice(t,0,this.value):e[t]=this.value,{newDocument:r,index:t}},remove:function(e,t,r){var n=e.splice(t,1);return{newDocument:r,removed:n[0]}},replace:function(e,t,r){var n=e[t];return e[t]=this.value,{newDocument:r,removed:n}},move:tc.move,copy:tc.copy,test:tc.test,_get:tc._get};function Hf(e,t){if(t=="")return e;var r={op:"_get",path:t};return ei(e,r),r.value}function ei(e,t,r,n,o,a){if(r===void 0&&(r=!1),n===void 0&&(n=!0),o===void 0&&(o=!0),a===void 0&&(a=0),r&&(typeof r=="function"?r(t,0,e,t.path):zf(t,0)),t.path===""){var i={newDocument:e};if(t.op==="add")return i.newDocument=t.value,i;if(t.op==="replace")return i.newDocument=t.value,i.removed=e,i;if(t.op==="move"||t.op==="copy")return i.newDocument=Hf(e,t.from),t.op==="move"&&(i.removed=e),i;if(t.op==="test"){if(i.test=Tl(e,t.value),i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i.newDocument=e,i}else{if(t.op==="remove")return i.removed=e,i.newDocument=null,i;if(t.op==="_get")return t.value=e,i;if(r)throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",a,t,e);return i}}else{n||(e=qt(e));var p=t.path||"",f=p.split("/"),m=e,g=1,v=f.length,x=void 0,y=void 0,C=void 0;for(typeof r=="function"?C=r:C=zf;;){if(y=f[g],y&&y.indexOf("~")!=-1&&(y=El(y)),o&&(y=="__proto__"||y=="prototype"&&g>0&&f[g-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&x===void 0&&(m[y]===void 0?x=f.slice(0,g).join("/"):g==v-1&&(x=t.path),x!==void 0&&C(t,0,e,x)),g++,Array.isArray(m)){if(y==="-")y=m.length;else{if(r&&!$f(y))throw new at("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",a,t,e);$f(y)&&(y=~~y)}if(g>=v){if(r&&t.op==="add"&&y>m.length)throw new at("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",a,t,e);var i=mQ[t.op].call(t,m,y,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}}else if(g>=v){var i=tc[t.op].call(t,m,y,e);if(i.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",a,t,e);return i}if(m=m[y],r&&g<v&&(!m||typeof m!="object"))throw new at("Cannot perform operation at the desired path","OPERATION_PATH_UNRESOLVABLE",a,t,e)}}}function Wf(e,t,r,n,o){if(n===void 0&&(n=!0),o===void 0&&(o=!0),r&&!Array.isArray(t))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");n||(e=qt(e));for(var a=new Array(t.length),i=0,p=t.length;i<p;i++)a[i]=ei(e,t[i],r,!0,o,i),e=a[i].newDocument;return a.newDocument=e,a}function gQ(e,t,r){var n=ei(e,t);if(n.test===!1)throw new at("Test operation failed","TEST_OPERATION_FAILED",r,t,e);return n.newDocument}function zf(e,t,r,n){if(typeof e!="object"||e===null||Array.isArray(e))throw new at("Operation is not an object","OPERATION_NOT_AN_OBJECT",t,e,r);if(tc[e.op]){if(typeof e.path!="string")throw new at("Operation `path` property is not a string","OPERATION_PATH_INVALID",t,e,r);if(e.path.indexOf("/")!==0&&e.path.length>0)throw new at("Operation `path` property must start with \"/\"","OPERATION_PATH_INVALID",t,e,r);if((e.op==="move"||e.op==="copy")&&typeof e.from!="string")throw new at("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&e.value===void 0)throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",t,e,r);if((e.op==="add"||e.op==="replace"||e.op==="test")&&Qf(e.value))throw new at("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",t,e,r);if(r){if(e.op=="add"){var o=e.path.split("/").length,a=n.split("/").length;if(o!==a+1&&o!==a)throw new at("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",t,e,r)}else if(e.op==="replace"||e.op==="remove"||e.op==="_get"){if(e.path!==n)throw new at("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",t,e,r)}else if(e.op==="move"||e.op==="copy"){var i={op:"_get",path:e.from,value:void 0},p=mE([i],r);if(p&&p.name==="OPERATION_PATH_UNRESOLVABLE")throw new at("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",t,e,r)}}}else throw new at("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",t,e,r)}function mE(e,t,r){try{if(!Array.isArray(e))throw new at("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(t)Wf(qt(t),qt(e),r||!0);else{r=r||zf;for(var n=0;n<e.length;n++)r(e[n],n,t,void 0)}}catch(o){if(o instanceof at)return o;throw o}}function Tl(e,t){if(e===t)return!0;if(e&&t&&typeof e=="object"&&typeof t=="object"){var r=Array.isArray(e),n=Array.isArray(t),o,a,i;if(r&&n){if(a=e.length,a!=t.length)return!1;for(o=a;o--!==0;)if(!Tl(e[o],t[o]))return!1;return!0}if(r!=n)return!1;var p=Object.keys(e);if(a=p.length,a!==Object.keys(t).length)return!1;for(o=a;o--!==0;)if(!t.hasOwnProperty(p[o]))return!1;for(o=a;o--!==0;)if(i=p[o],!Tl(e[i],t[i]))return!1;return!0}return e!==e&&t!==t}var hA={};Ru(hA,{compare:()=>bQ,generate:()=>fA,observe:()=>xQ,unobserve:()=>CQ});d();c();l();u();var mA=new WeakMap,hQ=function(){function e(t){this.observers=new Map,this.obj=t}return e}(),yQ=function(){function e(t,r){this.callback=t,this.observer=r}return e}();function SQ(e){return mA.get(e)}function vQ(e,t){return e.observers.get(t)}function AQ(e,t){e.observers.delete(t.callback)}function CQ(e,t){t.unobserve()}function xQ(e,t){var r=[],n,o=SQ(e);if(!o)o=new hQ(e),mA.set(e,o);else{var a=vQ(o,t);n=a&&a.observer}if(n)return n;if(n={},o.value=qt(e),t){n.callback=t,n.next=null;var i=function(){fA(n)},p=function(){clearTimeout(n.next),n.next=setTimeout(i)};typeof window<"u"&&(window.addEventListener("mouseup",p),window.addEventListener("keyup",p),window.addEventListener("mousedown",p),window.addEventListener("keydown",p),window.addEventListener("change",p))}return n.patches=r,n.object=e,n.unobserve=function(){fA(n),clearTimeout(n.next),AQ(o,n),typeof window<"u"&&(window.removeEventListener("mouseup",p),window.removeEventListener("keyup",p),window.removeEventListener("mousedown",p),window.removeEventListener("keydown",p),window.removeEventListener("change",p))},o.observers.set(t,new yQ(t,n)),n}function fA(e,t){t===void 0&&(t=!1);var r=mA.get(e.object);gA(r.value,e.object,e.patches,"",t),e.patches.length&&Wf(r.value,e.patches);var n=e.patches;return n.length>0&&(e.patches=[],e.callback&&e.callback(n)),n}function gA(e,t,r,n,o){if(t!==e){typeof t.toJSON=="function"&&(t=t.toJSON());for(var a=Gf(t),i=Gf(e),p=!1,f=!1,m=i.length-1;m>=0;m--){var g=i[m],v=e[g];if(Bf(t,g)&&!(t[g]===void 0&&v!==void 0&&Array.isArray(t)===!1)){var x=t[g];typeof v=="object"&&v!=null&&typeof x=="object"&&x!=null&&Array.isArray(v)===Array.isArray(x)?gA(v,x,r,n+"/"+gn(g),o):v!==x&&(p=!0,o&&r.push({op:"test",path:n+"/"+gn(g),value:qt(v)}),r.push({op:"replace",path:n+"/"+gn(g),value:qt(x)}))}else Array.isArray(e)===Array.isArray(t)?(o&&r.push({op:"test",path:n+"/"+gn(g),value:qt(v)}),r.push({op:"remove",path:n+"/"+gn(g)}),f=!0):(o&&r.push({op:"test",path:n,value:e}),r.push({op:"replace",path:n,value:t}),p=!0)}if(!(!f&&a.length==i.length))for(var m=0;m<a.length;m++){var g=a[m];!Bf(e,g)&&t[g]!==void 0&&r.push({op:"add",path:n+"/"+gn(g),value:qt(t[g])})}}}function bQ(e,t,r){r===void 0&&(r=!1);var n=[];return gA(e,t,n,"",r),n}var Kf=Object.assign({},pA,hA,{JsonPatchError:Il,deepClone:qt,escapePathComponent:gn,unescapePathComponent:El});d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var yA=function(e,t){return yA=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},yA(e,t)};function hn(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");yA(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}function gE(e,t,r,n){function o(a){return a instanceof r?a:new r(function(i){i(a)})}return new(r||(r=Promise))(function(a,i){function p(g){try{m(n.next(g))}catch(v){i(v)}}function f(g){try{m(n.throw(g))}catch(v){i(v)}}function m(g){g.done?a(g.value):o(g.value).then(p,f)}m((n=n.apply(e,t||[])).next())})}function Yf(e,t){var r={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},n,o,a,i=Object.create((typeof Iterator=="function"?Iterator:Object).prototype);return i.next=p(0),i.throw=p(1),i.return=p(2),typeof Symbol=="function"&&(i[Symbol.iterator]=function(){return this}),i;function p(m){return function(g){return f([m,g])}}function f(m){if(n)throw new TypeError("Generator is already executing.");for(;i&&(i=0,m[0]&&(r=0)),r;)try{if(n=1,o&&(a=m[0]&2?o.return:m[0]?o.throw||((a=o.return)&&a.call(o),0):o.next)&&!(a=a.call(o,m[1])).done)return a;switch(o=0,a&&(m=[m[0]&2,a.value]),m[0]){case 0:case 1:a=m;break;case 4:return r.label++,{value:m[1],done:!1};case 5:r.label++,o=m[1],m=[0];continue;case 7:m=r.ops.pop(),r.trys.pop();continue;default:if(a=r.trys,!(a=a.length>0&&a[a.length-1])&&(m[0]===6||m[0]===2)){r=0;continue}if(m[0]===3&&(!a||m[1]>a[0]&&m[1]<a[3])){r.label=m[1];break}if(m[0]===6&&r.label<a[1]){r.label=a[1],a=m;break}if(a&&r.label<a[2]){r.label=a[2],r.ops.push(m);break}a[2]&&r.ops.pop(),r.trys.pop();continue}m=t.call(e,r)}catch(g){m=[6,g],o=0}finally{n=a=0}if(m[0]&5)throw m[1];return{value:m[0]?m[1]:void 0,done:!0}}}function no(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function rc(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),o,a=[],i;try{for(;(t===void 0||t-->0)&&!(o=n.next()).done;)a.push(o.value)}catch(p){i={error:p}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(i)throw i.error}}return a}function nc(e,t,r){if(r||arguments.length===2)for(var n=0,o=t.length,a;n<o;n++)(a||!(n in t))&&(a||(a=Array.prototype.slice.call(t,0,n)),a[n]=t[n]);return e.concat(a||Array.prototype.slice.call(t))}function ti(e){return this instanceof ti?(this.v=e,this):new ti(e)}function hE(e,t,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(e,t||[]),o,a=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),p("next"),p("throw"),p("return",i),o[Symbol.asyncIterator]=function(){return this},o;function i(y){return function(C){return Promise.resolve(C).then(y,v)}}function p(y,C){n[y]&&(o[y]=function(b){return new Promise(function(w,F){a.push([y,b,w,F])>1||f(y,b)})},C&&(o[y]=C(o[y])))}function f(y,C){try{m(n[y](C))}catch(b){x(a[0][3],b)}}function m(y){y.value instanceof ti?Promise.resolve(y.value.v).then(g,v):x(a[0][2],y)}function g(y){f("next",y)}function v(y){f("throw",y)}function x(y,C){y(C),a.shift(),a.length&&f(a[0][0],a[0][1])}}function yE(e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=e[Symbol.asyncIterator],r;return t?t.call(e):(e=typeof no=="function"?no(e):e[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(a){r[a]=e[a]&&function(i){return new Promise(function(p,f){i=e[a](i),o(p,f,i.done,i.value)})}}function o(a,i,p,f){Promise.resolve(f).then(function(m){a({value:m,done:p})},i)}}d();c();l();u();function Ne(e){return typeof e=="function"}d();c();l();u();d();c();l();u();d();c();l();u();function oc(e){var t=function(n){Error.call(n),n.stack=new Error().stack},r=e(t);return r.prototype=Object.create(Error.prototype),r.prototype.constructor=r,r}var Jf=oc(function(e){return function(r){e(this),this.message=r?r.length+` errors occurred during unsubscription:
34
34
  `+r.map(function(n,o){return o+1+") "+n.toString()}).join(`
35
35
  `):"",this.name="UnsubscriptionError",this.errors=r}});d();c();l();u();function Pl(e,t){if(e){var r=e.indexOf(t);0<=r&&e.splice(r,1)}}var ac=function(){function e(t){this.initialTeardown=t,this.closed=!1,this._parentage=null,this._finalizers=null}return e.prototype.unsubscribe=function(){var t,r,n,o,a;if(!this.closed){this.closed=!0;var i=this._parentage;if(i)if(this._parentage=null,Array.isArray(i))try{for(var p=no(i),f=p.next();!f.done;f=p.next()){var m=f.value;m.remove(this)}}catch(b){t={error:b}}finally{try{f&&!f.done&&(r=p.return)&&r.call(p)}finally{if(t)throw t.error}}else i.remove(this);var g=this.initialTeardown;if(Ne(g))try{g()}catch(b){a=b instanceof Jf?b.errors:[b]}var v=this._finalizers;if(v){this._finalizers=null;try{for(var x=no(v),y=x.next();!y.done;y=x.next()){var C=y.value;try{SE(C)}catch(b){a=a??[],b instanceof Jf?a=nc(nc([],rc(a)),rc(b.errors)):a.push(b)}}}catch(b){n={error:b}}finally{try{y&&!y.done&&(o=x.return)&&o.call(x)}finally{if(n)throw n.error}}}if(a)throw new Jf(a)}},e.prototype.add=function(t){var r;if(t&&t!==this)if(this.closed)SE(t);else{if(t instanceof e){if(t.closed||t._hasParent(this))return;t._addParent(this)}(this._finalizers=(r=this._finalizers)!==null&&r!==void 0?r:[]).push(t)}},e.prototype._hasParent=function(t){var r=this._parentage;return r===t||Array.isArray(r)&&r.includes(t)},e.prototype._addParent=function(t){var r=this._parentage;this._parentage=Array.isArray(r)?(r.push(t),r):r?[r,t]:t},e.prototype._removeParent=function(t){var r=this._parentage;r===t?this._parentage=null:Array.isArray(r)&&Pl(r,t)},e.prototype.remove=function(t){var r=this._finalizers;r&&Pl(r,t),t instanceof e&&t._removeParent(this)},e.EMPTY=function(){var t=new e;return t.closed=!0,t}(),e}();var SA=ac.EMPTY;function Xf(e){return e instanceof ac||e&&"closed"in e&&Ne(e.remove)&&Ne(e.add)&&Ne(e.unsubscribe)}function SE(e){Ne(e)?e():e.unsubscribe()}d();c();l();u();var $r={onUnhandledError:null,onStoppedNotification:null,Promise:void 0,useDeprecatedSynchronousErrorHandling:!1,useDeprecatedNextContext:!1};d();c();l();u();d();c();l();u();var ic={setTimeout:function(e,t){for(var r=[],n=2;n<arguments.length;n++)r[n-2]=arguments[n];var o=ic.delegate;return o?.setTimeout?o.setTimeout.apply(o,nc([e,t],rc(r))):setTimeout.apply(void 0,nc([e,t],rc(r)))},clearTimeout:function(e){var t=ic.delegate;return(t?.clearTimeout||clearTimeout)(e)},delegate:void 0};function Zf(e){ic.setTimeout(function(){var t=$r.onUnhandledError;if(t)t(e);else throw e})}d();c();l();u();function kl(){}d();c();l();u();var vE=function(){return vA("C",void 0,void 0)}();function AE(e){return vA("E",void 0,e)}function CE(e){return vA("N",e,void 0)}function vA(e,t,r){return{kind:e,value:t,error:r}}d();c();l();u();var ri=null;function sc(e){if($r.useDeprecatedSynchronousErrorHandling){var t=!ri;if(t&&(ri={errorThrown:!1,error:null}),e(),t){var r=ri,n=r.errorThrown,o=r.error;if(ri=null,n)throw o}}else e()}function xE(e){$r.useDeprecatedSynchronousErrorHandling&&ri&&(ri.errorThrown=!0,ri.error=e)}var Ol=function(e){hn(t,e);function t(r){var n=e.call(this)||this;return n.isStopped=!1,r?(n.destination=r,Xf(r)&&r.add(n)):n.destination=EQ,n}return t.create=function(r,n,o){return new tm(r,n,o)},t.prototype.next=function(r){this.isStopped?CA(CE(r),this):this._next(r)},t.prototype.error=function(r){this.isStopped?CA(AE(r),this):(this.isStopped=!0,this._error(r))},t.prototype.complete=function(){this.isStopped?CA(vE,this):(this.isStopped=!0,this._complete())},t.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this),this.destination=null)},t.prototype._next=function(r){this.destination.next(r)},t.prototype._error=function(r){try{this.destination.error(r)}finally{this.unsubscribe()}},t.prototype._complete=function(){try{this.destination.complete()}finally{this.unsubscribe()}},t}(ac);var wQ=Function.prototype.bind;function AA(e,t){return wQ.call(e,t)}var RQ=function(){function e(t){this.partialObserver=t}return e.prototype.next=function(t){var r=this.partialObserver;if(r.next)try{r.next(t)}catch(n){em(n)}},e.prototype.error=function(t){var r=this.partialObserver;if(r.error)try{r.error(t)}catch(n){em(n)}else em(t)},e.prototype.complete=function(){var t=this.partialObserver;if(t.complete)try{t.complete()}catch(r){em(r)}},e}(),tm=function(e){hn(t,e);function t(r,n,o){var a=e.call(this)||this,i;if(Ne(r)||!r)i={next:r??void 0,error:n??void 0,complete:o??void 0};else{var p;a&&$r.useDeprecatedNextContext?(p=Object.create(r),p.unsubscribe=function(){return a.unsubscribe()},i={next:r.next&&AA(r.next,p),error:r.error&&AA(r.error,p),complete:r.complete&&AA(r.complete,p)}):i=r}return a.destination=new RQ(i),a}return t}(Ol);function em(e){$r.useDeprecatedSynchronousErrorHandling?xE(e):Zf(e)}function FQ(e){throw e}function CA(e,t){var r=$r.onStoppedNotification;r&&ic.setTimeout(function(){return r(e,t)})}var EQ={closed:!0,next:kl,error:FQ,complete:kl};d();c();l();u();var cc=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}();d();c();l();u();d();c();l();u();function uc(e){return e}function rm(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return xA(e)}function xA(e){return e.length===0?uc:e.length===1?e[0]:function(r){return e.reduce(function(n,o){return o(n)},r)}}var Ze=function(){function e(t){t&&(this._subscribe=t)}return e.prototype.lift=function(t){var r=new e;return r.source=this,r.operator=t,r},e.prototype.subscribe=function(t,r,n){var o=this,a=TQ(t)?t:new tm(t,r,n);return sc(function(){var i=o,p=i.operator,f=i.source;a.add(p?p.call(a,f):f?o._subscribe(a):o._trySubscribe(a))}),a},e.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(r){t.error(r)}},e.prototype.forEach=function(t,r){var n=this;return r=bE(r),new r(function(o,a){var i=new tm({next:function(p){try{t(p)}catch(f){a(f),i.unsubscribe()}},error:a,complete:o});n.subscribe(i)})},e.prototype._subscribe=function(t){var r;return(r=this.source)===null||r===void 0?void 0:r.subscribe(t)},e.prototype[cc]=function(){return this},e.prototype.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];return xA(t)(this)},e.prototype.toPromise=function(t){var r=this;return t=bE(t),new t(function(n,o){var a;r.subscribe(function(i){return a=i},function(i){return o(i)},function(){return n(a)})})},e.create=function(t){return new e(t)},e}();function bE(e){var t;return(t=e??$r.Promise)!==null&&t!==void 0?t:Promise}function IQ(e){return e&&Ne(e.next)&&Ne(e.error)&&Ne(e.complete)}function TQ(e){return e&&e instanceof Ol||IQ(e)&&Xf(e)}d();c();l();u();function PQ(e){return Ne(e?.lift)}function mt(e){return function(t){if(PQ(t))return t.lift(function(r){try{return e(r,this)}catch(n){this.error(n)}});throw new TypeError("Unable to lift unknown Observable type")}}d();c();l();u();function Ct(e,t,r,n,o){return new kQ(e,t,r,n,o)}var kQ=function(e){hn(t,e);function t(r,n,o,a,i,p){var f=e.call(this,r)||this;return f.onFinalize=i,f.shouldUnsubscribe=p,f._next=n?function(m){try{n(m)}catch(g){r.error(g)}}:e.prototype._next,f._error=a?function(m){try{a(m)}catch(g){r.error(g)}finally{this.unsubscribe()}}:e.prototype._error,f._complete=o?function(){try{o()}catch(m){r.error(m)}finally{this.unsubscribe()}}:e.prototype._complete,f}return t.prototype.unsubscribe=function(){var r;if(!this.shouldUnsubscribe||this.shouldUnsubscribe()){var n=this.closed;e.prototype.unsubscribe.call(this),!n&&((r=this.onFinalize)===null||r===void 0||r.call(this))}},t}(Ol);d();c();l();u();d();c();l();u();var wE=oc(function(e){return function(){e(this),this.name="ObjectUnsubscribedError",this.message="object unsubscribed"}});var yn=function(e){hn(t,e);function t(){var r=e.call(this)||this;return r.closed=!1,r.currentObservers=null,r.observers=[],r.isStopped=!1,r.hasError=!1,r.thrownError=null,r}return t.prototype.lift=function(r){var n=new RE(this,this);return n.operator=r,n},t.prototype._throwIfClosed=function(){if(this.closed)throw new wE},t.prototype.next=function(r){var n=this;sc(function(){var o,a;if(n._throwIfClosed(),!n.isStopped){n.currentObservers||(n.currentObservers=Array.from(n.observers));try{for(var i=no(n.currentObservers),p=i.next();!p.done;p=i.next()){var f=p.value;f.next(r)}}catch(m){o={error:m}}finally{try{p&&!p.done&&(a=i.return)&&a.call(i)}finally{if(o)throw o.error}}}})},t.prototype.error=function(r){var n=this;sc(function(){if(n._throwIfClosed(),!n.isStopped){n.hasError=n.isStopped=!0,n.thrownError=r;for(var o=n.observers;o.length;)o.shift().error(r)}})},t.prototype.complete=function(){var r=this;sc(function(){if(r._throwIfClosed(),!r.isStopped){r.isStopped=!0;for(var n=r.observers;n.length;)n.shift().complete()}})},t.prototype.unsubscribe=function(){this.isStopped=this.closed=!0,this.observers=this.currentObservers=null},Object.defineProperty(t.prototype,"observed",{get:function(){var r;return((r=this.observers)===null||r===void 0?void 0:r.length)>0},enumerable:!1,configurable:!0}),t.prototype._trySubscribe=function(r){return this._throwIfClosed(),e.prototype._trySubscribe.call(this,r)},t.prototype._subscribe=function(r){return this._throwIfClosed(),this._checkFinalizedStatuses(r),this._innerSubscribe(r)},t.prototype._innerSubscribe=function(r){var n=this,o=this,a=o.hasError,i=o.isStopped,p=o.observers;return a||i?SA:(this.currentObservers=null,p.push(r),new ac(function(){n.currentObservers=null,Pl(p,r)}))},t.prototype._checkFinalizedStatuses=function(r){var n=this,o=n.hasError,a=n.thrownError,i=n.isStopped;o?r.error(a):i&&r.complete()},t.prototype.asObservable=function(){var r=new Ze;return r.source=this,r},t.create=function(r,n){return new RE(r,n)},t}(Ze);var RE=function(e){hn(t,e);function t(r,n){var o=e.call(this)||this;return o.destination=r,o.source=n,o}return t.prototype.next=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.next)===null||o===void 0||o.call(n,r)},t.prototype.error=function(r){var n,o;(o=(n=this.destination)===null||n===void 0?void 0:n.error)===null||o===void 0||o.call(n,r)},t.prototype.complete=function(){var r,n;(n=(r=this.destination)===null||r===void 0?void 0:r.complete)===null||n===void 0||n.call(r)},t.prototype._subscribe=function(r){var n,o;return(o=(n=this.source)===null||n===void 0?void 0:n.subscribe(r))!==null&&o!==void 0?o:SA},t}(yn);d();c();l();u();d();c();l();u();var bA={now:function(){return(bA.delegate||Date).now()},delegate:void 0};var nm=function(e){hn(t,e);function t(r,n,o){r===void 0&&(r=1/0),n===void 0&&(n=1/0),o===void 0&&(o=bA);var a=e.call(this)||this;return a._bufferSize=r,a._windowTime=n,a._timestampProvider=o,a._buffer=[],a._infiniteTimeWindow=!0,a._infiniteTimeWindow=n===1/0,a._bufferSize=Math.max(1,r),a._windowTime=Math.max(1,n),a}return t.prototype.next=function(r){var n=this,o=n.isStopped,a=n._buffer,i=n._infiniteTimeWindow,p=n._timestampProvider,f=n._windowTime;o||(a.push(r),!i&&a.push(p.now()+f)),this._trimBuffer(),e.prototype.next.call(this,r)},t.prototype._subscribe=function(r){this._throwIfClosed(),this._trimBuffer();for(var n=this._innerSubscribe(r),o=this,a=o._infiniteTimeWindow,i=o._buffer,p=i.slice(),f=0;f<p.length&&!r.closed;f+=a?1:2)r.next(p[f]);return this._checkFinalizedStatuses(r),n},t.prototype._trimBuffer=function(){var r=this,n=r._bufferSize,o=r._timestampProvider,a=r._buffer,i=r._infiniteTimeWindow,p=(i?1:2)*n;if(n<1/0&&p<a.length&&a.splice(0,a.length-p),!i){for(var f=o.now(),m=0,g=1;g<a.length&&a[g]<=f;g+=2)m=g;m&&a.splice(0,m+1)}},t}(yn);d();c();l();u();var om=new Ze(function(e){return e.complete()});d();c();l();u();d();c();l();u();d();c();l();u();function FE(e){return e&&Ne(e.schedule)}function OQ(e){return e[e.length-1]}function EE(e){return FE(OQ(e))?e.pop():void 0}d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();d();c();l();u();var am=function(e){return e&&typeof e.length=="number"&&typeof e!="function"};d();c();l();u();function im(e){return Ne(e?.then)}d();c();l();u();function sm(e){return Ne(e[cc])}d();c();l();u();function cm(e){return Symbol.asyncIterator&&Ne(e?.[Symbol.asyncIterator])}d();c();l();u();function um(e){return new TypeError("You provided "+(e!==null&&typeof e=="object"?"an invalid object":"'"+e+"'")+" where a stream was expected. You can provide an Observable, Promise, ReadableStream, Array, AsyncIterable, or Iterable.")}d();c();l();u();d();c();l();u();function _Q(){return typeof Symbol!="function"||!Symbol.iterator?"@@iterator":Symbol.iterator}var lm=_Q();function dm(e){return Ne(e?.[lm])}d();c();l();u();function pm(e){return hE(this,arguments,function(){var r,n,o,a;return Yf(this,function(i){switch(i.label){case 0:r=e.getReader(),i.label=1;case 1:i.trys.push([1,,9,10]),i.label=2;case 2:return[4,ti(r.read())];case 3:return n=i.sent(),o=n.value,a=n.done,a?[4,ti(void 0)]:[3,5];case 4:return[2,i.sent()];case 5:return[4,ti(o)];case 6:return[4,i.sent()];case 7:return i.sent(),[3,2];case 8:return[3,10];case 9:return r.releaseLock(),[7];case 10:return[2]}})})}function fm(e){return Ne(e?.getReader)}function xt(e){if(e instanceof Ze)return e;if(e!=null){if(sm(e))return NQ(e);if(am(e))return DQ(e);if(im(e))return qQ(e);if(cm(e))return IE(e);if(dm(e))return MQ(e);if(fm(e))return VQ(e)}throw um(e)}function NQ(e){return new Ze(function(t){var r=e[cc]();if(Ne(r.subscribe))return r.subscribe(t);throw new TypeError("Provided object does not correctly implement Symbol.observable")})}function DQ(e){return new Ze(function(t){for(var r=0;r<e.length&&!t.closed;r++)t.next(e[r]);t.complete()})}function qQ(e){return new Ze(function(t){e.then(function(r){t.closed||(t.next(r),t.complete())},function(r){return t.error(r)}).then(null,Zf)})}function MQ(e){return new Ze(function(t){var r,n;try{for(var o=no(e),a=o.next();!a.done;a=o.next()){var i=a.value;if(t.next(i),t.closed)return}}catch(p){r={error:p}}finally{try{a&&!a.done&&(n=o.return)&&n.call(o)}finally{if(r)throw r.error}}t.complete()})}function IE(e){return new Ze(function(t){jQ(e,t).catch(function(r){return t.error(r)})})}function VQ(e){return IE(pm(e))}function jQ(e,t){var r,n,o,a;return gE(this,void 0,void 0,function(){var i,p;return Yf(this,function(f){switch(f.label){case 0:f.trys.push([0,5,6,11]),r=yE(e),f.label=1;case 1:return[4,r.next()];case 2:if(n=f.sent(),!!n.done)return[3,4];if(i=n.value,t.next(i),t.closed)return[2];f.label=3;case 3:return[3,1];case 4:return[3,11];case 5:return p=f.sent(),o={error:p},[3,11];case 6:return f.trys.push([6,,9,10]),n&&!n.done&&(a=r.return)?[4,a.call(r)]:[3,8];case 7:f.sent(),f.label=8;case 8:return[3,10];case 9:if(o)throw o.error;return[7];case 10:return[7];case 11:return t.complete(),[2]}})})}d();c();l();u();d();c();l();u();function Tr(e,t,r,n,o){n===void 0&&(n=0),o===void 0&&(o=!1);var a=t.schedule(function(){r(),o?e.add(this.schedule(null,n)):this.unsubscribe()},n);if(e.add(a),!o)return a}function mm(e,t){return t===void 0&&(t=0),mt(function(r,n){r.subscribe(Ct(n,function(o){return Tr(n,e,function(){return n.next(o)},t)},function(){return Tr(n,e,function(){return n.complete()},t)},function(o){return Tr(n,e,function(){return n.error(o)},t)}))})}d();c();l();u();function gm(e,t){return t===void 0&&(t=0),mt(function(r,n){n.add(e.schedule(function(){return r.subscribe(n)},t))})}function TE(e,t){return xt(e).pipe(gm(t),mm(t))}d();c();l();u();function PE(e,t){return xt(e).pipe(gm(t),mm(t))}d();c();l();u();function kE(e,t){return new Ze(function(r){var n=0;return t.schedule(function(){n===e.length?r.complete():(r.next(e[n++]),r.closed||this.schedule())})})}d();c();l();u();function OE(e,t){return new Ze(function(r){var n;return Tr(r,t,function(){n=e[lm](),Tr(r,t,function(){var o,a,i;try{o=n.next(),a=o.value,i=o.done}catch(p){r.error(p);return}i?r.complete():r.next(a)},0,!0)}),function(){return Ne(n?.return)&&n.return()}})}d();c();l();u();function hm(e,t){if(!e)throw new Error("Iterable cannot be null");return new Ze(function(r){Tr(r,t,function(){var n=e[Symbol.asyncIterator]();Tr(r,t,function(){n.next().then(function(o){o.done?r.complete():r.next(o.value)})},0,!0)})})}d();c();l();u();function _E(e,t){return hm(pm(e),t)}function NE(e,t){if(e!=null){if(sm(e))return TE(e,t);if(am(e))return kE(e,t);if(im(e))return PE(e,t);if(cm(e))return hm(e,t);if(dm(e))return OE(e,t);if(fm(e))return _E(e,t)}throw um(e)}function ni(e,t){return t?NE(e,t):xt(e)}function ot(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];var r=EE(e);return ni(e,r)}d();c();l();u();function et(e,t){var r=Ne(e)?e:function(){return e},n=function(o){return o.error(r())};return new Ze(t?function(o){return t.schedule(n,0,o)}:n)}d();c();l();u();d();c();l();u();var DE=oc(function(e){return function(){e(this),this.name="EmptyError",this.message="no elements in sequence"}});function ym(e,t){var r=typeof t=="object";return new Promise(function(n,o){var a=!1,i;e.subscribe({next:function(p){i=p,a=!0},error:o,complete:function(){a?n(i):r?n(t.defaultValue):o(new DE)}})})}d();c();l();u();function oi(e,t){return mt(function(r,n){var o=0;r.subscribe(Ct(n,function(a){n.next(e.call(t,a,o++))}))})}d();c();l();u();d();c();l();u();d();c();l();u();function qE(e,t,r,n,o,a,i,p){var f=[],m=0,g=0,v=!1,x=function(){v&&!f.length&&!m&&t.complete()},y=function(b){return m<n?C(b):f.push(b)},C=function(b){a&&t.next(b),m++;var w=!1;xt(r(b,g++)).subscribe(Ct(t,function(F){o?.(F),a?y(F):t.next(F)},function(){w=!0},void 0,function(){if(w)try{m--;for(var F=function(){var I=f.shift();i?Tr(t,i,function(){return C(I)}):C(I)};f.length&&m<n;)F();x()}catch(I){t.error(I)}}))};return e.subscribe(Ct(t,y,function(){v=!0,x()})),function(){p?.()}}function nr(e,t,r){return r===void 0&&(r=1/0),Ne(t)?nr(function(n,o){return oi(function(a,i){return t(n,a,o,i)})(xt(e(n,o)))},r):(typeof t=="number"&&(r=t),mt(function(n,o){return qE(n,o,e,r)}))}function wA(e){return e===void 0&&(e=1/0),nr(uc,e)}d();c();l();u();function Sm(e){return new Ze(function(t){xt(e()).subscribe(t)})}d();c();l();u();function _l(e){return mt(function(t,r){var n=null,o=!1,a;n=t.subscribe(Ct(r,void 0,void 0,function(i){a=xt(e(i,_l(e)(t))),n?(n.unsubscribe(),n=null,a.subscribe(r)):o=!0})),o&&(n.unsubscribe(),n=null,a.subscribe(r))})}d();c();l();u();function vm(e,t){return Ne(t)?nr(e,t,1):nr(e,1)}d();c();l();u();function RA(e){return mt(function(t,r){var n=!1;t.subscribe(Ct(r,function(o){n=!0,r.next(o)},function(){n||r.next(e),r.complete()}))})}d();c();l();u();function ai(e){return mt(function(t,r){try{t.subscribe(r)}finally{r.add(e)}})}d();c();l();u();function FA(e,t){return mt(function(r,n){var o=null,a=0,i=!1,p=function(){return i&&!o&&n.complete()};r.subscribe(Ct(n,function(f){o?.unsubscribe();var m=0,g=a++;xt(e(f,g)).subscribe(o=Ct(n,function(v){return n.next(t?t(f,v,g,m++):v)},function(){o=null,p()}))},function(){i=!0,p()}))})}d();c();l();u();function Am(e){return mt(function(t,r){xt(e).subscribe(Ct(r,function(){return r.complete()},kl)),!r.closed&&t.subscribe(r)})}d();c();l();u();function EA(e,t,r){var n=Ne(e)||t||r?{next:e,error:t,complete:r}:e;return n?mt(function(o,a){var i;(i=n.subscribe)===null||i===void 0||i.call(n);var p=!0;o.subscribe(Ct(a,function(f){var m;(m=n.next)===null||m===void 0||m.call(n,f),a.next(f)},function(){var f;p=!1,(f=n.complete)===null||f===void 0||f.call(n),a.complete()},function(f){var m;p=!1,(m=n.error)===null||m===void 0||m.call(n,f),a.error(f)},function(){var f,m;p&&((f=n.unsubscribe)===null||f===void 0||f.call(n)),(m=n.finalize)===null||m===void 0||m.call(n)}))}):uc}d();c();l();u();d();c();l();u();function ME(e){return` \r
@@ -79,4 +79,4 @@ fast-json-patch/module/duplex.mjs:
79
79
  *)
80
80
  */if(__exports!=exports)module.exports=exports;return module.exports});
81
81
 
82
- window.coveoQuanticVersion = '3.43.0';
82
+ window.coveoQuanticVersion = '3.43.2';