"use strict";(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[447166],{37884:(e,t,r)=>{r.r(t),r.d(t,{DynamicsVirtualEventsService:()=>l});var s=r(401368),i=r(134185),a=r(135449),n=r(873352),o=r(845097);class l{constructor(e,t,r,a,o,l){this.coreSettings=t,this.loggerFactory=o,this.discover=l,this.logger=this.loggerFactory.newLogger("DynamicsVirtualEventsService","services-io-dynamics-virtual-events");const{virtualEventsOrgResolverAuthResource:c,virtualEventsOrgResolverEndpoint:v}=t.get(s.w.DynamicsMarketing);this.virtualEventsOrgResolverUrl=v||"https://public-usa.mkt-tip.dynamics.com/api/v1.0/teamsevents/dataverses",this._send=(0,n.c)(e.authorize(r,c||"6117447d-9951-4e67-a015-c23757dd9085"),i.nW.OK),this.locale=a.locale,this.regionalOrgResolverPromise=this.regionalVirtualEventsOrgResolverUrl()}async regionalVirtualEventsOrgResolverUrl(){const{useRegionalVirtualEventsOrgResolverHost:e,regionalVirtualEventsOrgResolverPath:t}=this.coreSettings.get(s.w.DynamicsMarketing);if(e)try{const e=await this.discover.regionGtm("teamsEventsIntegration");if(e)try{const r=new URL(e+t);this.virtualEventsOrgResolverUrl=r.href}catch(r){this.logger.error(`Failed to validate regionalUrl "${e+t}".`)}}catch(e){this.logger.error("Could not retrive teamsEventsIntegration from discover service")}}async virtualEventsOrgDetails(e){const t=(0,o.v4)();return await this.regionalOrgResolverPromise,this._send({url:this.virtualEventsOrgResolverUrl,method:"POST",headers:{"Content-Type":"application/json","x-ms-correlation-id":t,"x-locale":this.locale},serviceName:a.p.DynamicsVirtualEvents,apiName:"virtualEventsOrgDetails",body:JSON.stringify({eventId:e}),correlationId:t}).then((({body:e})=>e.json()))}}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/services-dynamics-virtual-events-8da6414e513c338b.js.map