@microsoft/sp-webpart-base
Version:
SharePoint Framework support for building web parts
2 lines • 197 kB
JavaScript
"use strict";(self["webpackJsonp_974a7777-0990-4136-8fa6-95d80114c2e0_1.22.1"]=self["webpackJsonp_974a7777-0990-4136-8fa6-95d80114c2e0_1.22.1"]||[]).push([[183],{732:(e,t,n)=>{n.r(t),n.d(t,{ActionObjectType:()=>ya,AppId:()=>nr,ChannelType:()=>Ua,ChildAppWindow:()=>Of,DialogDimension:()=>Ta,EduType:()=>wa,EmailAddress:()=>If,ErrorCode:()=>Da,FileOpenPreference:()=>va,FrameContexts:()=>ka,HostClientType:()=>Aa,HostName:()=>La,LiveShareHost:()=>up,NotificationTypes:()=>Ee,ParentAppWindow:()=>wf,SecondaryM365ContentIdName:()=>Sa,TaskModuleDimension:()=>Ta,TeamType:()=>Ma,UserSettingTypes:()=>Le,UserTeamRole:()=>Pa,ViewerActionTypes:()=>Ae,app:()=>d,appEntity:()=>j,appInitialization:()=>xe,appInstallDialog:()=>Z,authentication:()=>l,barCode:()=>ee,calendar:()=>ue,call:()=>Ie,chat:()=>te,clipboard:()=>ne,conversations:()=>w,copilot:()=>A,dialog:()=>b,enablePrintCapability:()=>Hf,executeDeepLink:()=>$f,externalAppAuthentication:()=>L,externalAppAuthenticationForCEA:()=>k,externalAppCardActions:()=>M,externalAppCardActionsForCEA:()=>P,externalAppCommands:()=>T,files:()=>U,geoLocation:()=>re,getAdaptiveCardSchemaVersion:()=>xf,getContext:()=>Nf,getMruTabInstances:()=>Xf,getTabInstances:()=>Jf,hostEntity:()=>Q,initialize:()=>Ff,initializeWithFrameContext:()=>tp,liveShare:()=>X,location:()=>se,logs:()=>O,mail:()=>fe,marketplace:()=>ke,media:()=>$,meeting:()=>de,meetingRoom:()=>F,menus:()=>g,messageChannels:()=>H,monetization:()=>le,navigateBack:()=>op,navigateCrossDomain:()=>rp,navigateToTab:()=>ip,nestedAppAuth:()=>ae,notifications:()=>R,openFilePreview:()=>_d,otherAppStateChange:()=>N,pages:()=>x,people:()=>pe,print:()=>Rf,profile:()=>me,registerAppButtonClickHandler:()=>Vf,registerAppButtonHoverEnterHandler:()=>zf,registerAppButtonHoverLeaveHandler:()=>Gf,registerBackButtonHandler:()=>Kf,registerBeforeUnloadHandler:()=>qf,registerChangeSettingsHandler:()=>Yf,registerCustomHandler:()=>pd,registerFocusEnterHandler:()=>Qf,registerFullScreenHandler:()=>jf,registerOnLoadHandler:()=>Wf,registerOnThemeChangeHandler:()=>Bf,registerUserSettingsChangeHandler:()=>md,remoteCamera:()=>B,returnFocus:()=>ap,search:()=>_e,secondaryBrowser:()=>oe,sendCustomEvent:()=>fd,sendCustomMessage:()=>ud,setFrameContext:()=>ep,settings:()=>Oe,shareDeepLink:()=>Zf,sharing:()=>be,stageView:()=>ve,store:()=>Y,tasks:()=>we,teams:()=>G,teamsCore:()=>J,thirdPartyCloudStorage:()=>Ce,uploadCustomApp:()=>ld,version:()=>qi,videoEffects:()=>K,videoEffectsEx:()=>W,visualMedia:()=>Se,webStorage:()=>De});var a={};n.r(a),n.d(a,{ReadStream:()=>We,WriteStream:()=>qe,default:()=>Qe,isatty:()=>Ke});var i={};n.r(i),n.d(i,{_extend:()=>Zt,debuglog:()=>Ot,default:()=>tn,deprecate:()=>It,format:()=>Dt,inherits:()=>dt,inspect:()=>wt,isArray:()=>Pt,isBoolean:()=>Tt,isBuffer:()=>qt,isDate:()=>zt,isError:()=>Gt,isFunction:()=>Kt,isNull:()=>Ut,isNullOrUndefined:()=>Ft,isNumber:()=>Ht,isObject:()=>Vt,isPrimitive:()=>Wt,isRegExp:()=>jt,isString:()=>Rt,isSymbol:()=>Nt,isUndefined:()=>Bt,log:()=>Xt});var r={};n.r(r),n.d(r,{EOL:()=>xn,arch:()=>_n,cpus:()=>ln,default:()=>Cn,endianness:()=>an,freemem:()=>cn,getNetworkInterfaces:()=>mn,hostname:()=>rn,loadavg:()=>on,networkInterfaces:()=>pn,platform:()=>hn,release:()=>fn,tmpDir:()=>bn,tmpdir:()=>In,totalmem:()=>dn,type:()=>un,uptime:()=>sn});var o={};n.r(o),n.d(o,{registerBeforeSuspendOrTerminateHandler:()=>cr,registerOnResumeHandler:()=>dr});var s={};n.r(s),n.d(s,{_clearTelemetryPort:()=>mr,getTelemetryPort:()=>fr,isSupported:()=>pr});var c={};n.r(c),n.d(c,{_clearDataLayerPort:()=>vr,getDataLayerPort:()=>br,isSupported:()=>gr});var d={};n.r(d),n.d(d,{ExpectedFailureReason:()=>xr,FailedReason:()=>Ir,Messages:()=>Dr,_initialize:()=>Er,_uninitialize:()=>Ar,getContext:()=>Lr,getFrameContext:()=>Or,initialize:()=>wr,isInitialized:()=>Cr,lifecycle:()=>o,notifyAppLoaded:()=>kr,notifyExpectedFailure:()=>Tr,notifyFailure:()=>Pr,notifySuccess:()=>Mr,openLink:()=>Hr,registerHostToAppPerformanceMetricsHandler:()=>Fr,registerOnThemeChangeHandler:()=>Ur});var l={};n.r(l),n.d(l,{DataResidency:()=>eo,authenticate:()=>Kr,getAuthToken:()=>Wr,getUser:()=>qr,initialize:()=>zr,notifyFailure:()=>Xr,notifySuccess:()=>Jr,registerAuthenticationHandlers:()=>Gr});var u={};n.r(u),n.d(u,{isSupported:()=>no,resize:()=>to});var f={};n.r(f),n.d(f,{isSupported:()=>io,open:()=>ao});var p={};n.r(p),n.d(p,{isSupported:()=>co,registerOnMessageFromParent:()=>so,sendMessageToDialog:()=>oo,sendMessageToParentFromDialog:()=>ro});var m={};n.r(m),n.d(m,{bot:()=>f,getDialogInfoFromBotUrlDialogInfo:()=>mo,getDialogInfoFromUrlDialogInfo:()=>po,isSupported:()=>fo,open:()=>lo,parentCommunication:()=>p,submit:()=>uo});var _={};n.r(_),n.d(_,{isSupported:()=>xo,open:()=>Io});var h={};n.r(h),n.d(h,{bot:()=>_,isSupported:()=>Oo,open:()=>Co});var b={};n.r(b),n.d(b,{adaptiveCard:()=>h,initialize:()=>wo,isSupported:()=>Eo,update:()=>u,url:()=>m});var g={};n.r(g),n.d(g,{DisplayMode:()=>Lo,MenuItem:()=>Mo,MenuListType:()=>ko,initialize:()=>Ro,isSupported:()=>Ko,setNavBarMenu:()=>jo,setUpViews:()=>No,showActionMenu:()=>zo});var v={};n.r(v),n.d(v,{initialize:()=>Qo,isSupported:()=>os,registerChangeConfigHandler:()=>ns,registerOnRemoveHandler:()=>$o,registerOnRemoveHandlerHelper:()=>es,registerOnSaveHandler:()=>Xo,registerOnSaveHandlerHelper:()=>Zo,setConfig:()=>Jo,setValidityState:()=>Yo});var y={};n.r(y),n.d(y,{isSupported:()=>vs,onClick:()=>hs,onHoverEnter:()=>bs,onHoverLeave:()=>gs});var S={};n.r(S),n.d(S,{isSupported:()=>Ds,navigateTo:()=>ys,navigateToDefaultPage:()=>Ss});var D={};n.r(D),n.d(D,{enterFullscreen:()=>Is,exitFullscreen:()=>xs,isSupported:()=>Cs});var I={};n.r(I),n.d(I,{getMruTabInstances:()=>Es,getTabInstances:()=>ws,isSupported:()=>As,navigateToTab:()=>Os});var x={};n.r(x),n.d(x,{EnterFocusType:()=>Ls,ReturnFocusType:()=>ks,appButton:()=>y,backStack:()=>C,config:()=>v,currentApp:()=>S,fullTrust:()=>D,getConfig:()=>Fs,initializeWithFrameContext:()=>Us,isSupported:()=>js,navigateCrossDomain:()=>Hs,navigateToApp:()=>Rs,registerFocusEnterHandler:()=>Ps,registerFullScreenHandler:()=>Bs,returnFocus:()=>Ms,setCurrentFrame:()=>Ts,shareDeepLink:()=>Ns,tabs:()=>I});var C={};n.r(C),n.d(C,{_initialize:()=>tc,isSupported:()=>oc,navigateBack:()=>nc,registerBackButtonHandler:()=>ac,registerBackButtonHandlerHelper:()=>ic});var O={};n.r(O),n.d(O,{isSupported:()=>bd,registerGetLogHandler:()=>hd});var w={};n.r(w),n.d(w,{closeConversation:()=>yd,getChatMembers:()=>Sd,isSupported:()=>Dd,openConversation:()=>vd});var E={};n.r(E),n.d(E,{getEligibilityInfo:()=>Cd,isSupported:()=>xd});var A={};n.r(A),n.d(A,{eligibility:()=>E});var L={};n.r(L),n.d(L,{ActionExecuteInvokeRequestType:()=>Ad,ActionExecuteResponseHandler:()=>Pd,InvokeErrorCode:()=>Md,InvokeResponseType:()=>kd,OriginalRequestType:()=>Ld,SerializableActionExecuteInvokeRequest:()=>wd,authenticateAndResendRequest:()=>Hd,authenticateWithOauth2:()=>Bd,authenticateWithPowerPlatformConnectorPlugins:()=>jd,authenticateWithSSO:()=>Rd,authenticateWithSSOAndResendRequest:()=>Nd,isActionExecuteResponse:()=>Ed,isInvokeError:()=>Td,isSupported:()=>Vd,validateActionExecuteInvokeRequest:()=>Fd});var k={};n.r(k),n.d(k,{authenticateAndResendRequest:()=>Wd,authenticateWithOauth:()=>Kd,authenticateWithSSO:()=>Gd,authenticateWithSSOAndResendRequest:()=>qd,isSupported:()=>Qd,validateInput:()=>Yd});var M={};n.r(M),n.d(M,{ActionOpenUrlErrorCode:()=>Xd,ActionOpenUrlType:()=>Jd,isSupported:()=>el,processActionOpenUrl:()=>$d,processActionSubmit:()=>Zd});var P={};n.r(P),n.d(P,{isSupported:()=>al,processActionOpenUrl:()=>tl,processActionSubmit:()=>nl});var T={};n.r(T),n.d(T,{isSupported:()=>rl,processActionCommand:()=>il});var U={};n.r(U),n.d(U,{CloudStorageProvider:()=>sl,CloudStorageProviderFileAction:()=>fl,CloudStorageProviderType:()=>cl,DocumentLibraryAccessType:()=>ll,FileDownloadStatus:()=>ul,SpecialDocumentLibraryType:()=>dl,addCloudStorageFolder:()=>ml,addCloudStorageProvider:()=>Dl,addCloudStorageProviderFile:()=>xl,copyMoveFiles:()=>vl,deleteCloudStorageFolder:()=>_l,deleteCloudStorageProviderFile:()=>Ol,downloadCloudStorageProviderFile:()=>wl,getCloudStorageFolderContents:()=>hl,getCloudStorageFolders:()=>pl,getExternalProviders:()=>gl,getFileDownloads:()=>yl,openCloudStorageFile:()=>bl,openDownloadFolder:()=>Sl,registerCloudStorageProviderContentChangeHandler:()=>Ll,registerCloudStorageProviderListChangeHandler:()=>Al,removeCloudStorageProvider:()=>Il,renameCloudStorageProviderFile:()=>Cl,uploadCloudStorageProviderFile:()=>El});var F={};n.r(F),n.d(F,{getPairedMeetingRoomInfo:()=>Pl,isSupported:()=>Hl,registerMeetingRoomCapabilitiesUpdateHandler:()=>Ul,registerMeetingRoomStatesUpdateHandler:()=>Fl,sendCommandToPairedMeetingRoom:()=>Tl});var H={};n.r(H),n.d(H,{dataLayer:()=>c,isSupported:()=>Rl,telemetry:()=>s});var R={};n.r(R),n.d(R,{isSupported:()=>Bl,showNotification:()=>Nl});var N={};n.r(N),n.d(N,{isSupported:()=>Kl,notifyInstallCompleted:()=>Gl,registerAppInstallationHandler:()=>Vl,unregisterAppInstallationHandler:()=>zl});var B={};n.r(B),n.d(B,{ControlCommand:()=>ql,ErrorReason:()=>Ql,SessionTerminatedReason:()=>Yl,getCapableParticipants:()=>Xl,isSupported:()=>ru,registerOnCapableParticipantsChangeHandler:()=>tu,registerOnDeviceStateChangeHandler:()=>au,registerOnErrorHandler:()=>nu,registerOnSessionStatusChangeHandler:()=>iu,requestControl:()=>Zl,sendControlCommand:()=>$l,terminateSession:()=>eu});var j={};n.r(j),n.d(j,{isSupported:()=>su,selectAppEntity:()=>ou});var V={};n.r(V),n.d(V,{getUserJoinedTeams:()=>cu,isSupported:()=>du});var z={};n.r(z),n.d(z,{getConfigSetting:()=>lu,isSupported:()=>uu,joinedTeams:()=>V});var G={};n.r(G),n.d(G,{ChannelType:()=>Jl,fullTrust:()=>z,getTeamChannels:()=>fu,isSupported:()=>mu,refreshSiteUrl:()=>pu});var K={};n.r(K),n.d(K,{EffectChangeType:()=>Du,EffectFailureReason:()=>Iu,VideoFrameFormat:()=>Su,isSupported:()=>Eu,notifySelectedVideoEffectChanged:()=>Cu,registerForVideoEffect:()=>Ou,registerForVideoFrame:()=>xu});var W={};n.r(W),n.d(W,{ErrorLevel:()=>Gu,frameProcessingTimeoutInMs:()=>Vu,isSupported:()=>Ju,notifyFatalError:()=>Zu,notifySelectedVideoEffectChanged:()=>qu,registerForVideoEffect:()=>Qu,registerForVideoFrame:()=>Ku,updatePersonalizedEffects:()=>Yu});var q={};n.r(q),n.d(q,{addAndConfigure:()=>sf,getAll:()=>cf,isSupported:()=>ff,reconfigure:()=>df,remove:()=>uf,rename:()=>lf});var Q={};n.r(Q),n.d(Q,{AppTypes:()=>_f,isSupported:()=>bf,tab:()=>q});var Y={};n.r(Y),n.d(Y,{StoreDialogType:()=>hf,errorInvalidDialogType:()=>gf,errorMissingAppId:()=>vf,errorMissingCollectionId:()=>yf,isSupported:()=>Df,openStoreExperience:()=>Sf});var J={};n.r(J),n.d(J,{enablePrintCapability:()=>Ef,isSupported:()=>Tf,print:()=>Af,registerBeforeUnloadHandler:()=>Mf,registerBeforeUnloadHandlerHelper:()=>Pf,registerOnLoadHandler:()=>Lf,registerOnLoadHandlerHelper:()=>kf});var X={};n.r(X),n.d(X,{ContainerState:()=>dp,LiveShareHost:()=>up,UserMeetingRole:()=>cp,isSupported:()=>lp});var Z={};n.r(Z),n.d(Z,{isSupported:()=>_p,openAppInstallDialog:()=>mp});var $={};n.r($),n.d($,{CameraStartMode:()=>yp,File:()=>Cp,FileFormat:()=>gp,ImageOutputFormats:()=>xp,ImageUriType:()=>Ip,Media:()=>Lp,MediaControllerEvent:()=>vp,MediaType:()=>Dp,Source:()=>Sp,VideoController:()=>kp,captureImage:()=>Op,hasPermission:()=>wp,requestPermission:()=>Ep,scanBarCode:()=>Tp,selectMedia:()=>Mp,viewImages:()=>Pp});var ee={};n.r(ee),n.d(ee,{hasPermission:()=>Bp,isSupported:()=>Vp,requestPermission:()=>jp,scanBarCode:()=>Np});var te={};n.r(te),n.d(te,{isSupported:()=>Wp,openChat:()=>zp,openGroupChat:()=>Kp});var ne={};n.r(ne),n.d(ne,{isSupported:()=>Yp,read:()=>Qp,write:()=>qp});var ae={};n.r(ae),n.d(ae,{isNAAChannelRecommended:()=>Jp});var ie={};n.r(ie),n.d(ie,{chooseLocation:()=>Xp,isSupported:()=>$p,showLocation:()=>Zp});var re={};n.r(re),n.d(re,{getCurrentLocation:()=>tm,hasPermission:()=>nm,isSupported:()=>im,map:()=>ie,requestPermission:()=>am});var oe={};n.r(oe),n.d(oe,{isSupported:()=>om,open:()=>rm});var se={};n.r(se),n.d(se,{getLocation:()=>sm,isSupported:()=>dm,showLocation:()=>cm});var ce={};n.r(ce),n.d(ce,{setOptions:()=>lm});var de={};n.r(de),n.d(de,{CallType:()=>_m,EventActionSource:()=>bm,MeetingReactionType:()=>pm,MeetingType:()=>mm,SharingProtocol:()=>hm,appShareButton:()=>ce,getAppContentStageSharingCapabilities:()=>Am,getAppContentStageSharingState:()=>km,getAuthenticationTokenForAnonymousUser:()=>Im,getIncomingClientAudioState:()=>vm,getLiveStreamState:()=>xm,getMeetingDetails:()=>Sm,getMeetingDetailsVerbose:()=>Dm,joinMeeting:()=>Um,registerLiveStreamChangedHandler:()=>wm,registerMeetingReactionReceivedHandler:()=>Tm,registerRaiseHandStateChangedHandler:()=>Pm,registerSpeakingStateChangeHandler:()=>Mm,requestAppAudioHandling:()=>Fm,requestStartLiveStreaming:()=>Cm,requestStopLiveStreaming:()=>Om,shareAppContentToStage:()=>Em,stopSharingAppContentToStage:()=>Lm,toggleIncomingClientAudio:()=>ym,updateMicState:()=>Hm});var le={};n.r(le),n.d(le,{isSupported:()=>Bm,openPurchaseExperience:()=>Nm});var ue={};n.r(ue),n.d(ue,{composeMeeting:()=>Vm,isSupported:()=>zm,openCalendarItem:()=>jm});var fe={};n.r(fe),n.d(fe,{ComposeMailType:()=>gm,composeMail:()=>Km,isSupported:()=>Wm,openMailItem:()=>Gm});var pe={};n.r(pe),n.d(pe,{isSupported:()=>Ym,selectPeople:()=>qm});var me={};n.r(me),n.d(me,{isSupported:()=>Xm,showProfile:()=>Jm});var _e={};n.r(_e),n.d(_e,{closeSearch:()=>r_,isSupported:()=>i_,registerHandlers:()=>n_,unregisterHandlers:()=>a_});var he={};n.r(he),n.d(he,{getContent:()=>o_,isSupported:()=>s_});var be={};n.r(be),n.d(be,{SharingAPIMessages:()=>c_,history:()=>he,isSupported:()=>u_,shareWebContent:()=>d_});var ge={};n.r(ge),n.d(ge,{close:()=>f_,isSupported:()=>p_});var ve={};n.r(ve),n.d(ve,{StageViewOpenMode:()=>m_,isSupported:()=>g_,open:()=>b_,self:()=>ge});var ye={};n.r(ye),n.d(ye,{captureImages:()=>v_,isSupported:()=>S_,retrieveImages:()=>y_});var Se={};n.r(Se),n.d(Se,{CameraRestriction:()=>__,Source:()=>h_,hasPermission:()=>C_,image:()=>ye,requestPermission:()=>O_});var De={};n.r(De),n.d(De,{isSupported:()=>A_,isWebStorageClearedOnUserLogOut:()=>E_});var Ie={};n.r(Ie),n.d(Ie,{CallModalities:()=>L_,isSupported:()=>M_,startCall:()=>k_});var xe={};n.r(xe),n.d(xe,{ExpectedFailureReason:()=>xr,FailedReason:()=>Ir,Messages:()=>Dr,notifyAppLoaded:()=>T_,notifyExpectedFailure:()=>H_,notifyFailure:()=>F_,notifySuccess:()=>U_});var Ce={};n.r(Ce),n.d(Ce,{getDragAndDropFiles:()=>G_,isSupported:()=>W_});var Oe={};n.r(Oe),n.d(Oe,{getSettings:()=>Y_,registerOnRemoveHandler:()=>Z_,registerOnSaveHandler:()=>X_,setSettings:()=>J_,setValidityState:()=>Q_});var we={};n.r(we),n.d(we,{getDefaultSizeIfNotProvided:()=>ah,startTask:()=>eh,submitTask:()=>nh,updateTask:()=>th});var Ee,Ae,Le,ke={};function Me(e,t){var n={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&t.indexOf(a)<0&&(n[a]=e[a]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(a=Object.getOwnPropertySymbols(e);i<a.length;i++)t.indexOf(a[i])<0&&Object.prototype.propertyIsEnumerable.call(e,a[i])&&(n[a[i]]=e[a[i]])}return n}function Pe(e,t,n,a){return new(n||(n=Promise))(function(i,r){function o(e){try{c(a.next(e))}catch(e){r(e)}}function s(e){try{c(a.throw(e))}catch(e){r(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n(function(e){e(t)})).then(o,s)}c((a=a.apply(e,t||[])).next())})}n.r(ke),n.d(ke,{CartStatus:()=>ph,Intent:()=>fh,addOrUpdateCartItems:()=>_h,cartVersion:()=>uh,getCart:()=>mh,isSupported:()=>gh,removeCartItems:()=>hh,updateCartStatus:()=>bh}),function(e){e.fileDownloadStart="fileDownloadStart",e.fileDownloadComplete="fileDownloadComplete"}(Ee||(Ee={})),function(e){e.view="view",e.edit="edit",e.editNew="editNew"}(Ae||(Ae={})),function(e){e.fileOpenPreference="fileOpenPreference",e.theme="theme"}(Le||(Le={})),"function"==typeof SuppressedError&&SuppressedError;var Te,Ue,Fe,He,Re,Ne={exports:{}},Be={exports:{}};function je(){if(Ue)return Te;Ue=1;var e=1e3,t=60*e,n=60*t,a=24*n;function i(e,t,n,a){var i=t>=1.5*n;return Math.round(e/n)+" "+a+(i?"s":"")}return Te=function(r,o){o=o||{};var s=typeof r;if("string"===s&&r.length>0)return function(i){if(!((i=String(i)).length>100)){var r=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(i);if(r){var o=parseFloat(r[1]);switch((r[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return 315576e5*o;case"weeks":case"week":case"w":return 6048e5*o;case"days":case"day":case"d":return o*a;case"hours":case"hour":case"hrs":case"hr":case"h":return o*n;case"minutes":case"minute":case"mins":case"min":case"m":return o*t;case"seconds":case"second":case"secs":case"sec":case"s":return o*e;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return o;default:return}}}}(r);if("number"===s&&isFinite(r))return o.long?function(r){var o=Math.abs(r);return o>=a?i(r,o,a,"day"):o>=n?i(r,o,n,"hour"):o>=t?i(r,o,t,"minute"):o>=e?i(r,o,e,"second"):r+" ms"}(r):function(i){var r=Math.abs(i);return r>=a?Math.round(i/a)+"d":r>=n?Math.round(i/n)+"h":r>=t?Math.round(i/t)+"m":r>=e?Math.round(i/e)+"s":i+"ms"}(r);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(r))}}function Ve(){return He?Fe:(He=1,Fe=function(e){function t(e){let a,i,r,o=null;function s(...e){if(!s.enabled)return;const n=s,i=Number(new Date),r=i-(a||i);n.diff=r,n.prev=a,n.curr=i,a=i,e[0]=t.coerce(e[0]),"string"!=typeof e[0]&&e.unshift("%O");let o=0;e[0]=e[0].replace(/%([a-zA-Z%])/g,(a,i)=>{if("%%"===a)return"%";o++;const r=t.formatters[i];if("function"==typeof r){const t=e[o];a=r.call(n,t),e.splice(o,1),o--}return a}),t.formatArgs.call(n,e),(n.log||t.log).apply(n,e)}return s.namespace=e,s.useColors=t.useColors(),s.color=t.selectColor(e),s.extend=n,s.destroy=t.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==t.namespaces&&(i=t.namespaces,r=t.enabled(e)),r),set:e=>{o=e}}),"function"==typeof t.init&&t.init(s),s}function n(e,n){const a=t(this.namespace+(void 0===n?":":n)+e);return a.log=this.log,a}function a(e){return e.toString().substring(2,e.toString().length-2).replace(/\.\*\?$/,"*")}return t.debug=t,t.default=t,t.coerce=function(e){return e instanceof Error?e.stack||e.message:e},t.disable=function(){const e=[...t.names.map(a),...t.skips.map(a).map(e=>"-"+e)].join(",");return t.enable(""),e},t.enable=function(e){let n;t.save(e),t.namespaces=e,t.names=[],t.skips=[];const a=("string"==typeof e?e:"").split(/[\s,]+/),i=a.length;for(n=0;n<i;n++)a[n]&&("-"===(e=a[n].replace(/\*/g,".*?"))[0]?t.skips.push(new RegExp("^"+e.slice(1)+"$")):t.names.push(new RegExp("^"+e+"$")))},t.enabled=function(e){if("*"===e[e.length-1])return!0;let n,a;for(n=0,a=t.skips.length;n<a;n++)if(t.skips[n].test(e))return!1;for(n=0,a=t.names.length;n<a;n++)if(t.names[n].test(e))return!0;return!1},t.humanize=je(),t.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(e).forEach(n=>{t[n]=e[n]}),t.names=[],t.skips=[],t.formatters={},t.selectColor=function(e){let n=0;for(let t=0;t<e.length;t++)n=(n<<5)-n+e.charCodeAt(t),n|=0;return t.colors[Math.abs(n)%t.colors.length]},t.enable(t.load()),t})}var ze={exports:{}};function Ge(e){if(e.__esModule)return e;var t=e.default;if("function"==typeof t){var n=function e(){return this instanceof e?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(t){var a=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,a.get?a:{enumerable:!0,get:function(){return e[t]}})}),n}function Ke(){return!1}function We(){throw new Error("tty.ReadStream is not implemented")}function qe(){throw new Error("tty.ReadStream is not implemented")}var Qe={isatty:Ke,ReadStream:We,WriteStream:qe},Ye=Ge(a);function Je(){throw new Error("setTimeout has not been defined")}function Xe(){throw new Error("clearTimeout has not been defined")}var Ze=Je,$e=Xe;function et(e){if(Ze===setTimeout)return setTimeout(e,0);if((Ze===Je||!Ze)&&setTimeout)return Ze=setTimeout,setTimeout(e,0);try{return Ze(e,0)}catch(t){try{return Ze.call(null,e,0)}catch(t){return Ze.call(this,e,0)}}}"function"==typeof n.g.setTimeout&&(Ze=setTimeout),"function"==typeof n.g.clearTimeout&&($e=clearTimeout);var tt,nt=[],at=!1,it=-1;function rt(){at&&tt&&(at=!1,tt.length?nt=tt.concat(nt):it=-1,nt.length&&ot())}function ot(){if(!at){var e=et(rt);at=!0;for(var t=nt.length;t;){for(tt=nt,nt=[];++it<t;)tt&&tt[it].run();it=-1,t=nt.length}tt=null,at=!1,function(e){if($e===clearTimeout)return clearTimeout(e);if(($e===Xe||!$e)&&clearTimeout)return $e=clearTimeout,clearTimeout(e);try{$e(e)}catch(t){try{return $e.call(null,e)}catch(t){return $e.call(this,e)}}}(e)}}function st(e,t){this.fun=e,this.array=t}function ct(){}st.prototype.run=function(){this.fun.apply(null,this.array)};var dt,lt=ct,ut=ct,ft=ct,pt=ct,mt=ct,_t=ct,ht=ct,bt=n.g.performance||{},gt=bt.now||bt.mozNow||bt.msNow||bt.oNow||bt.webkitNow||function(){return(new Date).getTime()},vt=new Date,yt={nextTick:function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];nt.push(new st(e,t)),1!==nt.length||at||et(ot)},title:"browser",browser:!0,env:{},argv:[],version:"",versions:{},on:lt,addListener:ut,once:ft,off:pt,removeListener:mt,removeAllListeners:_t,emit:ht,binding:function(e){throw new Error("process.binding is not supported")},cwd:function(){return"/"},chdir:function(e){throw new Error("process.chdir is not supported")},umask:function(){return 0},hrtime:function(e){var t=.001*gt.call(bt),n=Math.floor(t),a=Math.floor(t%1*1e9);return e&&(n-=e[0],(a-=e[1])<0&&(n--,a+=1e9)),[n,a]},platform:"browser",release:{},config:{},uptime:function(){return(new Date-vt)/1e3}};dt="function"==typeof Object.create?function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e};var St=/%[sdj%]/g;function Dt(e){if(!Rt(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(wt(arguments[n]));return t.join(" ")}n=1;for(var a=arguments,i=a.length,r=String(e).replace(St,function(e){if("%%"===e)return"%";if(n>=i)return e;switch(e){case"%s":return String(a[n++]);case"%d":return Number(a[n++]);case"%j":try{return JSON.stringify(a[n++])}catch(e){return"[Circular]"}default:return e}}),o=a[n];n<i;o=a[++n])Ut(o)||!Vt(o)?r+=" "+o:r+=" "+wt(o);return r}function It(e,t){if(Bt(n.g.process))return function(){return It(e,t).apply(this,arguments)};if(!0===yt.noDeprecation)return e;var a=!1;return function(){if(!a){if(yt.throwDeprecation)throw new Error(t);yt.traceDeprecation?console.trace(t):console.error(t),a=!0}return e.apply(this,arguments)}}var xt,Ct={};function Ot(e){return Bt(xt)&&(xt=yt.env.NODE_DEBUG||""),e=e.toUpperCase(),Ct[e]||(new RegExp("\\b"+e+"\\b","i").test(xt)?Ct[e]=function(){var t=Dt.apply(null,arguments);console.error("%s %d: %s",e,0,t)}:Ct[e]=function(){}),Ct[e]}function wt(e,t){var n={seen:[],stylize:At};return arguments.length>=3&&(n.depth=arguments[2]),arguments.length>=4&&(n.colors=arguments[3]),Tt(t)?n.showHidden=t:t&&Zt(n,t),Bt(n.showHidden)&&(n.showHidden=!1),Bt(n.depth)&&(n.depth=2),Bt(n.colors)&&(n.colors=!1),Bt(n.customInspect)&&(n.customInspect=!0),n.colors&&(n.stylize=Et),Lt(n,e,n.depth)}function Et(e,t){var n=wt.styles[t];return n?"["+wt.colors[n][0]+"m"+e+"["+wt.colors[n][1]+"m":e}function At(e,t){return e}function Lt(e,t,n){if(e.customInspect&&t&&Kt(t.inspect)&&t.inspect!==wt&&(!t.constructor||t.constructor.prototype!==t)){var a=t.inspect(n,e);return Rt(a)||(a=Lt(e,a,n)),a}var i=function(e,t){if(Bt(t))return e.stylize("undefined","undefined");if(Rt(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}return Ht(t)?e.stylize(""+t,"number"):Tt(t)?e.stylize(""+t,"boolean"):Ut(t)?e.stylize("null","null"):void 0}(e,t);if(i)return i;var r=Object.keys(t),o=function(e){var t={};return e.forEach(function(e,n){t[e]=!0}),t}(r);if(e.showHidden&&(r=Object.getOwnPropertyNames(t)),Gt(t)&&(r.indexOf("message")>=0||r.indexOf("description")>=0))return kt(t);if(0===r.length){if(Kt(t)){var s=t.name?": "+t.name:"";return e.stylize("[Function"+s+"]","special")}if(jt(t))return e.stylize(RegExp.prototype.toString.call(t),"regexp");if(zt(t))return e.stylize(Date.prototype.toString.call(t),"date");if(Gt(t))return kt(t)}var c,d="",l=!1,u=["{","}"];return Pt(t)&&(l=!0,u=["[","]"]),Kt(t)&&(d=" [Function"+(t.name?": "+t.name:"")+"]"),jt(t)&&(d=" "+RegExp.prototype.toString.call(t)),zt(t)&&(d=" "+Date.prototype.toUTCString.call(t)),Gt(t)&&(d=" "+kt(t)),0!==r.length||l&&0!=t.length?n<0?jt(t)?e.stylize(RegExp.prototype.toString.call(t),"regexp"):e.stylize("[Object]","special"):(e.seen.push(t),c=l?function(e,t,n,a,i){for(var r=[],o=0,s=t.length;o<s;++o)$t(t,String(o))?r.push(Mt(e,t,n,a,String(o),!0)):r.push("");return i.forEach(function(i){i.match(/^\d+$/)||r.push(Mt(e,t,n,a,i,!0))}),r}(e,t,n,o,r):r.map(function(a){return Mt(e,t,n,o,a,l)}),e.seen.pop(),function(e,t,n){var a=e.reduce(function(e,t){return t.indexOf("\n"),e+t.replace(/\u001b\[\d\d?m/g,"").length+1},0);return a>60?n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1]:n[0]+t+" "+e.join(", ")+" "+n[1]}(c,d,u)):u[0]+d+u[1]}function kt(e){return"["+Error.prototype.toString.call(e)+"]"}function Mt(e,t,n,a,i,r){var o,s,c;if((c=Object.getOwnPropertyDescriptor(t,i)||{value:t[i]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),$t(a,i)||(o="["+i+"]"),s||(e.seen.indexOf(c.value)<0?(s=Ut(n)?Lt(e,c.value,null):Lt(e,c.value,n-1)).indexOf("\n")>-1&&(s=r?s.split("\n").map(function(e){return" "+e}).join("\n").substr(2):"\n"+s.split("\n").map(function(e){return" "+e}).join("\n")):s=e.stylize("[Circular]","special")),Bt(o)){if(r&&i.match(/^\d+$/))return s;(o=JSON.stringify(""+i)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(o=o.substr(1,o.length-2),o=e.stylize(o,"name")):(o=o.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),o=e.stylize(o,"string"))}return o+": "+s}function Pt(e){return Array.isArray(e)}function Tt(e){return"boolean"==typeof e}function Ut(e){return null===e}function Ft(e){return null==e}function Ht(e){return"number"==typeof e}function Rt(e){return"string"==typeof e}function Nt(e){return"symbol"==typeof e}function Bt(e){return void 0===e}function jt(e){return Vt(e)&&"[object RegExp]"===Qt(e)}function Vt(e){return"object"==typeof e&&null!==e}function zt(e){return Vt(e)&&"[object Date]"===Qt(e)}function Gt(e){return Vt(e)&&("[object Error]"===Qt(e)||e instanceof Error)}function Kt(e){return"function"==typeof e}function Wt(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e}function qt(e){return Buffer.isBuffer(e)}function Qt(e){return Object.prototype.toString.call(e)}function Yt(e){return e<10?"0"+e.toString(10):e.toString(10)}wt.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},wt.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"};var Jt=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Xt(){var e,t;console.log("%s - %s",(t=[Yt((e=new Date).getHours()),Yt(e.getMinutes()),Yt(e.getSeconds())].join(":"),[e.getDate(),Jt[e.getMonth()],t].join(" ")),Dt.apply(null,arguments))}function Zt(e,t){if(!t||!Vt(t))return e;for(var n=Object.keys(t),a=n.length;a--;)e[n[a]]=t[n[a]];return e}function $t(e,t){return Object.prototype.hasOwnProperty.call(e,t)}var en,tn={inherits:dt,_extend:Zt,log:Xt,isBuffer:qt,isPrimitive:Wt,isFunction:Kt,isError:Gt,isDate:zt,isObject:Vt,isRegExp:jt,isUndefined:Bt,isSymbol:Nt,isString:Rt,isNumber:Ht,isNullOrUndefined:Ft,isNull:Ut,isBoolean:Tt,isArray:Pt,inspect:wt,deprecate:It,format:Dt,debuglog:Ot},nn=Ge(i);function an(){if(void 0===en){var e=new ArrayBuffer(2),t=new Uint8Array(e),n=new Uint16Array(e);if(t[0]=1,t[1]=2,258===n[0])en="BE";else{if(513!==n[0])throw new Error("unable to figure out endianess");en="LE"}}return en}function rn(){return void 0!==n.g.location?n.g.location.hostname:""}function on(){return[]}function sn(){return 0}function cn(){return Number.MAX_VALUE}function dn(){return Number.MAX_VALUE}function ln(){return[]}function un(){return"Browser"}function fn(){return void 0!==n.g.navigator?n.g.navigator.appVersion:""}function pn(){}function mn(){}function _n(){return"javascript"}function hn(){return"browser"}function bn(){return"/tmp"}var gn,vn,yn,Sn,Dn,In=bn,xn="\n",Cn={EOL:"\n",tmpdir:In,tmpDir:bn,networkInterfaces:pn,getNetworkInterfaces:mn,release:fn,type:un,cpus:ln,totalmem:dn,freemem:cn,uptime:sn,loadavg:on,hostname:rn,endianness:an},On=Ge(r);"undefined"==typeof process||"renderer"===process.type||!0===process.browser||process.__nwjs?Ne.exports=(Re||(Re=1,function(e,t){t.formatArgs=function(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+e.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;t.splice(1,0,n,"color: inherit");let a=0,i=0;t[0].replace(/%[a-zA-Z%]/g,e=>{"%%"!==e&&(a++,"%c"===e&&(i=a))}),t.splice(i,0,n)},t.save=function(e){try{e?t.storage.setItem("debug",e):t.storage.removeItem("debug")}catch(e){}},t.load=function(){let e;try{e=t.storage.getItem("debug")}catch(e){}return!e&&"undefined"!=typeof process&&"env"in process&&(e={NODE_ENV:"production"}.DEBUG),e},t.useColors=function(){return!("undefined"==typeof window||!window.process||"renderer"!==window.process.type&&!window.process.__nwjs)||("undefined"==typeof navigator||!navigator.userAgent||!navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))&&("undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/))},t.storage=function(){try{return localStorage}catch(e){}}(),t.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),t.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],t.log=console.debug||console.log||(()=>{}),e.exports=Ve()(t);const{formatters:n}=e.exports;n.j=function(e){try{return JSON.stringify(e)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}}(Be,Be.exports)),Be.exports):Ne.exports=(Dn||(Dn=1,function(e,t){const n=Ye,a=nn;t.init=function(e){e.inspectOpts={};const n=Object.keys(t.inspectOpts);for(let a=0;a<n.length;a++)e.inspectOpts[n[a]]=t.inspectOpts[n[a]]},t.log=function(...e){return process.stderr.write(a.formatWithOptions(t.inspectOpts,...e)+"\n")},t.formatArgs=function(n){const{namespace:a,useColors:i}=this;if(i){const t=this.color,i="[3"+(t<8?t:"8;5;"+t),r=` ${i};1m${a} [0m`;n[0]=r+n[0].split("\n").join("\n"+r),n.push(i+"m+"+e.exports.humanize(this.diff)+"[0m")}else n[0]=(t.inspectOpts.hideDate?"":(new Date).toISOString()+" ")+a+" "+n[0]},t.save=function(e){e||delete{NODE_ENV:"production"}.DEBUG},t.load=function(){return{NODE_ENV:"production"}.DEBUG},t.useColors=function(){return"colors"in t.inspectOpts?Boolean(t.inspectOpts.colors):n.isatty(process.stderr.fd)},t.destroy=a.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{const e=function(){if(Sn)return yn;Sn=1;const e=On,t=Ye,n=vn?gn:(vn=1,gn=(e,t=process.argv)=>{const n=e.startsWith("-")?"":1===e.length?"-":"--",a=t.indexOf(n+e),i=t.indexOf("--");return-1!==a&&(-1===i||a<i)}),{env:a}=process;let i;function r(e){return 0!==e&&{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function o(t,r){if(0===i)return 0;if(n("color=16m")||n("color=full")||n("color=truecolor"))return 3;if(n("color=256"))return 2;if(t&&!r&&void 0===i)return 0;const o=i||0;if("dumb"===a.TERM)return o;if("win32"===process.platform){const t=e.release().split(".");return Number(t[0])>=10&&Number(t[2])>=10586?Number(t[2])>=14931?3:2:1}if("CI"in a)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(e=>e in a)||"codeship"===a.CI_NAME?1:o;if("TEAMCITY_VERSION"in a)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(a.TEAMCITY_VERSION)?1:0;if("truecolor"===a.COLORTERM)return 3;if("TERM_PROGRAM"in a){const e=parseInt((a.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(a.TERM_PROGRAM){case"iTerm.app":return e>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(a.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(a.TERM)||"COLORTERM"in a?1:o}return n("no-color")||n("no-colors")||n("color=false")||n("color=never")?i=0:(n("color")||n("colors")||n("color=true")||n("color=always"))&&(i=1),"FORCE_COLOR"in a&&(i="true"===a.FORCE_COLOR?1:"false"===a.FORCE_COLOR?0:0===a.FORCE_COLOR.length?1:Math.min(parseInt(a.FORCE_COLOR,10),3)),yn={supportsColor:function(e){return r(o(e,e&&e.isTTY))},stdout:r(o(!0,t.isatty(1))),stderr:r(o(!0,t.isatty(2)))}}();e&&(e.stderr||e).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch(e){}t.inspectOpts=Object.keys({NODE_ENV:"production"}).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{const n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(e,t)=>t.toUpperCase());let a={NODE_ENV:"production"}[t];return a=!!/^(yes|on|true|enabled)$/i.test(a)||!/^(no|off|false|disabled)$/i.test(a)&&("null"===a?null:Number(a)),e[n]=a,e},{}),e.exports=Ve()(t);const{formatters:i}=e.exports;i.o=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts).split("\n").map(e=>e.trim()).join(" ")},i.O=function(e){return this.inspectOpts.colors=this.useColors,a.inspect(e,this.inspectOpts)}}(ze,ze.exports)),ze.exports);var wn=Ne.exports,En=[],An=[],Ln="undefined"!=typeof Uint8Array?Uint8Array:Array,kn=!1;function Mn(){kn=!0;for(var e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",t=0;t<64;++t)En[t]=e[t],An[e.charCodeAt(t)]=t;An["-".charCodeAt(0)]=62,An["_".charCodeAt(0)]=63}function Pn(e,t,n){for(var a,i,r=[],o=t;o<n;o+=3)a=(e[o]<<16)+(e[o+1]<<8)+e[o+2],r.push(En[(i=a)>>18&63]+En[i>>12&63]+En[i>>6&63]+En[63&i]);return r.join("")}function Tn(e){var t;kn||Mn();for(var n=e.length,a=n%3,i="",r=[],o=16383,s=0,c=n-a;s<c;s+=o)r.push(Pn(e,s,s+o>c?c:s+o));return 1===a?(t=e[n-1],i+=En[t>>2],i+=En[t<<4&63],i+="=="):2===a&&(t=(e[n-2]<<8)+e[n-1],i+=En[t>>10],i+=En[t>>4&63],i+=En[t<<2&63],i+="="),r.push(i),r.join("")}function Un(e,t,n,a,i){var r,o,s=8*i-a-1,c=(1<<s)-1,d=c>>1,l=-7,u=n?i-1:0,f=n?-1:1,p=e[t+u];for(u+=f,r=p&(1<<-l)-1,p>>=-l,l+=s;l>0;r=256*r+e[t+u],u+=f,l-=8);for(o=r&(1<<-l)-1,r>>=-l,l+=a;l>0;o=256*o+e[t+u],u+=f,l-=8);if(0===r)r=1-d;else{if(r===c)return o?NaN:1/0*(p?-1:1);o+=Math.pow(2,a),r-=d}return(p?-1:1)*o*Math.pow(2,r-a)}function Fn(e,t,n,a,i,r){var o,s,c,d=8*r-i-1,l=(1<<d)-1,u=l>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,p=a?0:r-1,m=a?1:-1,_=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(s=isNaN(t)?1:0,o=l):(o=Math.floor(Math.log(t)/Math.LN2),t*(c=Math.pow(2,-o))<1&&(o--,c*=2),(t+=o+u>=1?f/c:f*Math.pow(2,1-u))*c>=2&&(o++,c/=2),o+u>=l?(s=0,o=l):o+u>=1?(s=(t*c-1)*Math.pow(2,i),o+=u):(s=t*Math.pow(2,u-1)*Math.pow(2,i),o=0));i>=8;e[n+p]=255&s,p+=m,s/=256,i-=8);for(o=o<<i|s,d+=i;d>0;e[n+p]=255&o,p+=m,o/=256,d-=8);e[n+p-m]|=128*_}var Hn={}.toString,Rn=Array.isArray||function(e){return"[object Array]"==Hn.call(e)};function Nn(){return jn.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function Bn(e,t){if(Nn()<t)throw new RangeError("Invalid typed array length");return jn.TYPED_ARRAY_SUPPORT?(e=new Uint8Array(t)).__proto__=jn.prototype:(null===e&&(e=new jn(t)),e.length=t),e}function jn(e,t,n){if(!(jn.TYPED_ARRAY_SUPPORT||this instanceof jn))return new jn(e,t,n);if("number"==typeof e){if("string"==typeof t)throw new Error("If encoding is specified then the first argument must be a string");return Gn(this,e)}return Vn(this,e,t,n)}function Vn(e,t,n,a){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return"undefined"!=typeof ArrayBuffer&&t instanceof ArrayBuffer?function(e,t,n,a){if(t.byteLength,n<0||t.byteLength<n)throw new RangeError("'offset' is out of bounds");if(t.byteLength<n+(a||0))throw new RangeError("'length' is out of bounds");return t=void 0===n&&void 0===a?new Uint8Array(t):void 0===a?new Uint8Array(t,n):new Uint8Array(t,n,a),jn.TYPED_ARRAY_SUPPORT?(e=t).__proto__=jn.prototype:e=Kn(e,t),e}(e,t,n,a):"string"==typeof t?function(e,t,n){if("string"==typeof n&&""!==n||(n="utf8"),!jn.isEncoding(n))throw new TypeError('"encoding" must be a valid string encoding');var a=0|Qn(t,n),i=(e=Bn(e,a)).write(t,n);return i!==a&&(e=e.slice(0,i)),e}(e,t,n):function(e,t){if(qn(t)){var n=0|Wn(t.length);return 0===(e=Bn(e,n)).length||t.copy(e,0,0,n),e}if(t){if("undefined"!=typeof ArrayBuffer&&t.buffer instanceof ArrayBuffer||"length"in t)return"number"!=typeof t.length||(a=t.length)!=a?Bn(e,0):Kn(e,t);if("Buffer"===t.type&&Rn(t.data))return Kn(e,t.data)}var a;throw new TypeError("First argument must be a string, Buffer, ArrayBuffer, Array, or array-like object.")}(e,t)}function zn(e){if("number"!=typeof e)throw new TypeError('"size" argument must be a number');if(e<0)throw new RangeError('"size" argument must not be negative')}function Gn(e,t){if(zn(t),e=Bn(e,t<0?0:0|Wn(t)),!jn.TYPED_ARRAY_SUPPORT)for(var n=0;n<t;++n)e[n]=0;return e}function Kn(e,t){var n=t.length<0?0:0|Wn(t.length);e=Bn(e,n);for(var a=0;a<n;a+=1)e[a]=255&t[a];return e}function Wn(e){if(e>=Nn())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Nn().toString(16)+" bytes");return 0|e}function qn(e){return!(null==e||!e._isBuffer)}function Qn(e,t){if(qn(e))return e.length;if("undefined"!=typeof ArrayBuffer&&"function"==typeof ArrayBuffer.isView&&(ArrayBuffer.isView(e)||e instanceof ArrayBuffer))return e.byteLength;"string"!=typeof e&&(e=""+e);var n=e.length;if(0===n)return 0;for(var a=!1;;)switch(t){case"ascii":case"latin1":case"binary":return n;case"utf8":case"utf-8":case void 0:return Ra(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*n;case"hex":return n>>>1;case"base64":return Na(e).length;default:if(a)return Ra(e).length;t=(""+t).toLowerCase(),a=!0}}function Yn(e,t,n){var a=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===n||n>this.length)&&(n=this.length),n<=0)return"";if((n>>>=0)<=(t>>>=0))return"";for(e||(e="utf8");;)switch(e){case"hex":return la(this,t,n);case"utf8":case"utf-8":return oa(this,t,n);case"ascii":return ca(this,t,n);case"latin1":case"binary":return da(this,t,n);case"base64":return ra(this,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ua(this,t,n);default:if(a)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),a=!0}}function Jn(e,t,n){var a=e[t];e[t]=e[n],e[n]=a}function Xn(e,t,n,a,i){if(0===e.length)return-1;if("string"==typeof n?(a=n,n=0):n>2147483647?n=2147483647:n<-2147483648&&(n=-2147483648),n=+n,isNaN(n)&&(n=i?0:e.length-1),n<0&&(n=e.length+n),n>=e.length){if(i)return-1;n=e.length-1}else if(n<0){if(!i)return-1;n=0}if("string"==typeof t&&(t=jn.from(t,a)),qn(t))return 0===t.length?-1:Zn(e,t,n,a,i);if("number"==typeof t)return t&=255,jn.TYPED_ARRAY_SUPPORT&&"function"==typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,n):Uint8Array.prototype.lastIndexOf.call(e,t,n):Zn(e,[t],n,a,i);throw new TypeError("val must be string, number or Buffer")}function Zn(e,t,n,a,i){var r,o=1,s=e.length,c=t.length;if(void 0!==a&&("ucs2"===(a=String(a).toLowerCase())||"ucs-2"===a||"utf16le"===a||"utf-16le"===a)){if(e.length<2||t.length<2)return-1;o=2,s/=2,c/=2,n/=2}function d(e,t){return 1===o?e[t]:e.readUInt16BE(t*o)}if(i){var l=-1;for(r=n;r<s;r++)if(d(e,r)===d(t,-1===l?0:r-l)){if(-1===l&&(l=r),r-l+1===c)return l*o}else-1!==l&&(r-=r-l),l=-1}else for(n+c>s&&(n=s-c),r=n;r>=0;r--){for(var u=!0,f=0;f<c;f++)if(d(e,r+f)!==d(t,f)){u=!1;break}if(u)return r}return-1}function $n(e,t,n,a){n=Number(n)||0;var i=e.length-n;a?(a=Number(a))>i&&(a=i):a=i;var r=t.length;if(r%2!=0)throw new TypeError("Invalid hex string");a>r/2&&(a=r/2);for(var o=0;o<a;++o){var s=parseInt(t.substr(2*o,2),16);if(isNaN(s))return o;e[n+o]=s}return o}function ea(e,t,n,a){return Ba(Ra(t,e.length-n),e,n,a)}function ta(e,t,n,a){return Ba(function(e){for(var t=[],n=0;n<e.length;++n)t.push(255&e.charCodeAt(n));return t}(t),e,n,a)}function na(e,t,n,a){return ta(e,t,n,a)}function aa(e,t,n,a){return Ba(Na(t),e,n,a)}function ia(e,t,n,a){return Ba(function(e,t){for(var n,a,i,r=[],o=0;o<e.length&&!((t-=2)<0);++o)a=(n=e.charCodeAt(o))>>8,i=n%256,r.push(i),r.push(a);return r}(t,e.length-n),e,n,a)}function ra(e,t,n){return 0===t&&n===e.length?Tn(e):Tn(e.slice(t,n))}function oa(e,t,n){n=Math.min(e.length,n);for(var a=[],i=t;i<n;){var r,o,s,c,d=e[i],l=null,u=d>239?4:d>223?3:d>191?2:1;if(i+u<=n)switch(u){case 1:d<128&&(l=d);break;case 2:128==(192&(r=e[i+1]))&&(c=(31&d)<<6|63&r)>127&&(l=c);break;case 3:r=e[i+1],o=e[i+2],128==(192&r)&&128==(192&o)&&(c=(15&d)<<12|(63&r)<<6|63&o)>2047&&(c<55296||c>57343)&&(l=c);break;case 4:r=e[i+1],o=e[i+2],s=e[i+3],128==(192&r)&&128==(192&o)&&128==(192&s)&&(c=(15&d)<<18|(63&r)<<12|(63&o)<<6|63&s)>65535&&c<1114112&&(l=c)}null===l?(l=65533,u=1):l>65535&&(l-=65536,a.push(l>>>10&1023|55296),l=56320|1023&l),a.push(l),i+=u}return function(e){var t=e.length;if(t<=sa)return String.fromCharCode.apply(String,e);for(var n="",a=0;a<t;)n+=String.fromCharCode.apply(String,e.slice(a,a+=sa));return n}(a)}jn.TYPED_ARRAY_SUPPORT=void 0===n.g.TYPED_ARRAY_SUPPORT||n.g.TYPED_ARRAY_SUPPORT,Nn(),jn.poolSize=8192,jn._augment=function(e){return e.__proto__=jn.prototype,e},jn.from=function(e,t,n){return Vn(null,e,t,n)},jn.TYPED_ARRAY_SUPPORT&&(jn.prototype.__proto__=Uint8Array.prototype,jn.__proto__=Uint8Array),jn.alloc=function(e,t,n){return function(e,t,n,a){return zn(t),t<=0?Bn(e,t):void 0!==n?"string"==typeof a?Bn(e,t).fill(n,a):Bn(e,t).fill(n):Bn(e,t)}(null,e,t,n)},jn.allocUnsafe=function(e){return Gn(null,e)},jn.allocUnsafeSlow=function(e){return Gn(null,e)},jn.isBuffer=function(e){return null!=e&&(!!e._isBuffer||ja(e)||function(e){return"function"==typeof e.readFloatLE&&"function"==typeof e.slice&&ja(e.slice(0,0))}(e))},jn.compare=function(e,t){if(!qn(e)||!qn(t))throw new TypeError("Arguments must be Buffers");if(e===t)return 0;for(var n=e.length,a=t.length,i=0,r=Math.min(n,a);i<r;++i)if(e[i]!==t[i]){n=e[i],a=t[i];break}return n<a?-1:a<n?1:0},jn.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},jn.concat=function(e,t){if(!Rn(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return jn.alloc(0);var n;if(void 0===t)for(t=0,n=0;n<e.length;++n)t+=e[n].length;var a=jn.allocUnsafe(t),i=0;for(n=0;n<e.length;++n){var r=e[n];if(!qn(r))throw new TypeError('"list" argument must be an Array of Buffers');r.copy(a,i),i+=r.length}return a},jn.byteLength=Qn,jn.prototype._isBuffer=!0,jn.prototype.swap16=function(){var e=this.length;if(e%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)Jn(this,t,t+1);return this},jn.prototype.swap32=function(){var e=this.length;if(e%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)Jn(this,t,t+3),Jn(this,t+1,t+2);return this},jn.prototype.swap64=function(){var e=this.length;if(e%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)Jn(this,t,t+7),Jn(this,t+1,t+6),Jn(this,t+2,t+5),Jn(this,t+3,t+4);return this},jn.prototype.toString=function(){var e=0|this.length;return 0===e?"":0===arguments.length?oa(this,0,e):Yn.apply(this,arguments)},jn.prototype.equals=function(e){if(!qn(e))throw new TypeError("Argument must be a Buffer");return this===e||0===jn.compare(this,e)},jn.prototype.inspect=function(){var e="";return this.length>0&&(e=this.toString("hex",0,50).match(/.{2}/g).join(" "),this.length>50&&(e+=" ... ")),"<Buffer "+e+">"},jn.prototype.compare=function(e,t,n,a,i){if(!qn(e))throw new TypeError("Argument must be a Buffer");if(void 0===t&&(t=0),void 0===n&&(n=e?e.length:0),void 0===a&&(a=0),void 0===i&&(i=this.length),t<0||n>e.length||a<0||i>this.length)throw new RangeError("out of range index");if(a>=i&&t>=n)return 0;if(a>=i)return-1;if(t>=n)return 1;if(this===e)return 0;for(var r=(i>>>=0)-(a>>>=0),o=(n>>>=0)-(t>>>=0),s=Math.min(r,o),c=this.slice(a,i),d=e.slice(t,n),l=0;l<s;++l)if(c[l]!==d[l]){r=c[l],o=d[l];break}return r<o?-1:o<r?1:0},jn.prototype.includes=function(e,t,n){return-1!==this.indexOf(e,t,n)},jn.prototype.indexOf=function(e,t,n){return Xn(this,e,t,n,!0)},jn.prototype.lastIndexOf=function(e,t,n){return Xn(this,e,t,n,!1)},jn.prototype.write=function(e,t,n,a){if(void 0===t)a="utf8",n=this.length,t=0;else if(void 0===n&&"string"==typeof t)a=t,n=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t|=0,isFinite(n)?(n|=0,void 0===a&&(a="utf8")):(a=n,n=void 0)}var i=this.length-t;if((void 0===n||n>i)&&(n=i),e.length>0&&(n<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");a||(a="utf8");for(var r=!1;;)switch(a){case"hex":return $n(this,e,t,n);case"utf8":case"utf-8":return ea(this,e,t,n);case"ascii":return ta(this,e,t,n);case"latin1":case"binary":return na(this,e,t,n);case"base64":return aa(this,e,t,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return ia(this,e,t,n);default:if(r)throw new TypeError("Unknown encoding: "+a);a=(""+a).toLowerCase(),r=!0}},jn.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var sa=4096;function ca(e,t,n){var a="";n=Math.min(e.length,n);for(var i=t;i<n;++i)a+=String.fromCharCode(127&e[i]);return a}function da(e,t,n){var a="";n=Math.min(e.length,n);for(var i=t;i<n;++i)a+=String.fromCharCode(e[i]);return a}function la(e,t,n){var a=e.length;(!t||t<0)&&(t=0),(!n||n<0||n>a)&&(n=a);for(var i="",r=t;r<n;++r)i+=Ha(e[r]);return i}function ua(e,t,n){for(var a=e.slice(t,n),i="",r=0;r<a.length;r+=2)i+=String.fromCharCode(a[r]+256*a[r+1]);return i}function fa(e,t,n){if(e%1!=0||e<0)throw new RangeError("offset is not uint");if(e+t>n)throw new RangeError("Trying to access beyond buffer length")}function pa(e,t,n,a,i,r){if(!qn(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<r)throw new RangeError('"value" argument is out of bounds');if(n+a>e.length)throw new RangeError("Index out of range")}function ma(e,t,n,a){t<0&&(t=65535+t+1);for(var i=0,r=Math.min(e.length-n,2);i<r;++i)e[n+i]=(t&255<<8*(a?i:1-i))>>>8*(a?i:1-i)}function _a(e,t,n,a){t<0&&(t=4294967295+t+1);for(var i=0,r=Math.min(e.length-n,4);i<r;++i)e[n+i]=t>>>8*(a?i:3-i)&255}function ha(e,t,n,a,i,r){if(n+a>e.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("Index out of range")}function ba(e,t,n,a,i){return i||ha(e,0,n,4),Fn(e,t,n,a,23,4),n+4}function ga(e,t,n,a,i){return i||ha(e,0,n,8),Fn(e,t,n,a,52,8),n+8}jn.prototype.slice=function(e,t){var n,a=this.length;if((e=~~e)<0?(e+=a)<0&&(e=0):e>a&&(e=a),(t=void 0===t?a:~~t)<0?(t+=a)<0&&(t=0):t>a&&(t=a),t<e&&(t=e),jn.TYPED_ARRAY_SUPPORT)(n=this.subarray(e,t)).__proto__=jn.prototype;else{var i=t-e;n=new jn(i,void 0);for(var r=0;r<i;++r)n[r]=this[r+e]}return n},jn.prototype.readUIntLE=function(e,t,n){e|=0,t|=0,n||fa(e,t,this.length);for(var a=this[e],i=1,r=0;++r<t&&(i*=256);)a+=this[e+r]*i;return a},jn.prototype.readUIntBE=function(e,t,n){e|=0,t|=0,n||fa(e,t,this.length);for(var a=this[e+--t],i=1;t>0&&(i*=256);)a+=this[e+--t]*i;return a},jn.prototype.readUInt8=function(e,t){return t||fa(e,1,this.length),this[e]},jn.prototype.readUInt16LE=function(e,t){return t||fa(e,2,this.length),this[e]|this[e+1]<<8},jn.prototype.readUInt16BE=function(e,t){return t||fa(e,2,this.length),this[e]<<8|this[e+1]},jn.prototype.readUInt32LE=function(e,t){return t||fa(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},jn.prototype.readUInt32BE=function(e,t){return t||fa(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},jn.prototype.readIntLE=function(e,t,n){e|=0,t|=0,n||fa(e,t,this.length);for(var a=this[e],i=1,r=0;++r<t&&(i*=256);)a+=this[e+r]*i;return a>=(i*=128)&&(a-=Math.pow(2,8*t)),a},jn.prototype.readIntBE=function(e,t,n){e|=0,t|=0,n||fa(e,t,this.length);for(var a=t,i=1,r=this[e+--a];a>0&&(i*=256);)r+=this[e+--a]*i;return r>=(i*=128)&&(r-=Math.pow(2,8*t)),r},jn.prototype.readInt8=function(e,t){return t||fa(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},jn.prototype.readInt16LE=function(e,t){t||fa(e,2,this.length);var n=this[e]|this[e+1]<<8;return 32768&n?4294901760|n:n},jn.prototype.readInt16BE=function(e,t){t||fa(e,2,this.length);var n=this[e+1]|this[e]<<8;return 32768&n?4294901760|n:n},jn.prototype.readInt32LE=function(e,t){return t||fa(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},jn.prototype.readInt32BE=function(e,t){return t||fa(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},jn.prototype.readFloatLE=function(e,t){return t||fa(e,4,this.length),Un(this,e,!0,23,4)},jn.prototype.readFloatBE=function(e,t){return t||fa(e,4,this.length),Un(this,e,!1,23,4)},jn.prototype.readDoubleLE=function(e,t){return t||fa(e,8,this.length),Un(this,e,!0,52,8)},jn.prototype.readDoubleBE=function(e,t){return t||fa(e,8,this.length),Un(this,e,!1,52,8)},jn.prototype.writeUIntLE=function(e,t,n,a){e=+e,t|=0,n|=0,a||pa(this,e,t,n,Math.pow(2,8*n)-1,0);var i=1,r=0;for(this[t]=255&e;++r<n&&(i*=256);)this[t+r]=e/i&255;return t+n},jn.prototype.writeUIntBE=function(e,t,n,a){e=+e,t|=0,n|=0,a||pa(this,e,t,n,Math.pow(2,8*n)-1,0);var i=n-1,r=1;for(this[t+i]=255&e;--i>=0&&(r*=256);)this[t+i]=e/r&255;return t+n},jn.prototype.writeUInt8=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,1,255,0),jn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),this[t]=255&e,t+1},jn.prototype.writeUInt16LE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,2,65535,0),jn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ma(this,e,t,!0),t+2},jn.prototype.writeUInt16BE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,2,65535,0),jn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ma(this,e,t,!1),t+2},jn.prototype.writeUInt32LE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,4,4294967295,0),jn.TYPED_ARRAY_SUPPORT?(this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e):_a(this,e,t,!0),t+4},jn.prototype.writeUInt32BE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,4,4294967295,0),jn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_a(this,e,t,!1),t+4},jn.prototype.writeIntLE=function(e,t,n,a){if(e=+e,t|=0,!a){var i=Math.pow(2,8*n-1);pa(this,e,t,n,i-1,-i)}var r=0,o=1,s=0;for(this[t]=255&e;++r<n&&(o*=256);)e<0&&0===s&&0!==this[t+r-1]&&(s=1),this[t+r]=(e/o|0)-s&255;return t+n},jn.prototype.writeIntBE=function(e,t,n,a){if(e=+e,t|=0,!a){var i=Math.pow(2,8*n-1);pa(this,e,t,n,i-1,-i)}var r=n-1,o=1,s=0;for(this[t+r]=255&e;--r>=0&&(o*=256);)e<0&&0===s&&0!==this[t+r+1]&&(s=1),this[t+r]=(e/o|0)-s&255;return t+n},jn.prototype.writeInt8=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,1,127,-128),jn.TYPED_ARRAY_SUPPORT||(e=Math.floor(e)),e<0&&(e=255+e+1),this[t]=255&e,t+1},jn.prototype.writeInt16LE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,2,32767,-32768),jn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8):ma(this,e,t,!0),t+2},jn.prototype.writeInt16BE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,2,32767,-32768),jn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>8,this[t+1]=255&e):ma(this,e,t,!1),t+2},jn.prototype.writeInt32LE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,4,2147483647,-2147483648),jn.TYPED_ARRAY_SUPPORT?(this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24):_a(this,e,t,!0),t+4},jn.prototype.writeInt32BE=function(e,t,n){return e=+e,t|=0,n||pa(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),jn.TYPED_ARRAY_SUPPORT?(this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e):_a(this,e,t,!1),t+4},jn.prototype.writeFloatLE=function(e,t,n){return ba(this,e,t,!0,n)},jn.prototype.writeFloatBE=function(e,t,n){return ba(this,e,t,!1,n)},jn.prototype.writeDoubleLE=function(e,t,n){return ga(this,e,t,!0,n)},jn.prototype.writeDoubleBE=function(e,t,n){return ga(this,e,t,!1,n)},jn.prototype.copy=function(e,t,n,a){if(n||(n=0),a||0===a||(a=this.length),t>=e.length&&(t=e.length),t||(t=0),a>0&&a<n&&(a=n),a===n)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(n<0||n>=this.length)throw new RangeError("sourceStart out of bounds");if(a<0)throw new RangeError("sourceEnd out of bounds");a>this.length&&(a=this.length),e.length-t<a-n&&(a=e.length-t+n);var i,r=a-n;if(this===e&&n<t&&t<a)for(i=r-1;i>=0;--i)e[i+t]=this[i+n];else if(r<1e3||!jn.TYPED_ARRAY_SUPPORT)for(i=0;i<r;++i)e[i+t]=this[i+n];else Uint8Array.prototype.set.call(e,this.subarray(n,n+r),t);return r},jn.prototype.fill=function(e,t,n,a){if("string"==typeof e){if("string"==typeof t?(a=t,t=0,n=this.length):"string"==typeof n&&(a=n,n=this.length),1===e.length){var i=e.charCodeAt(0);i<256&&(e=i)}if(void 0!==a&&"string"!=typeof a)throw new TypeError("encoding must be a string");if("string"==typeof a&&!jn.isEncoding(a))throw new TypeError("Unknown encoding: "+a)}else"number"==typeof e&&(e&=255);if(t<0||this.length<t||this.length<n)throw new RangeError("Out of range index");if(n<=t)return this;var r;if(t>>>=0,n=void 0===n?this.length:n>>>0,e||(e=0),"number"==typeof e)for(r=t;r<n;++r)this[r]=e;else{var o=qn(e)?e:Ra(new jn(e,a).toString()),s=o.length;for(r=0;r<n-t;++r)this[r+t]=o[r%s]}return this};var va,ya,Sa,Da,Ia,xa,Ca,Oa,wa,Ea,Aa,La,ka,Ma,Pa,Ta,Ua,Fa=/[^+\/0-9A-Za-z-_]/g;function Ha(e){return e<16?"0"+e.toString(16):e.toString(16)}function Ra(e,t){var n;t=t||1/0;for(var a=e.length,i=null,r=[],o=0;o<a;++o){if((n=e.charCodeAt(o))>55295&&n<57344){if(!i){if(n>56319){(t-=3)>-1&&r.push(239,191,189);continue}if(o+1===a){(t-=3)>-1&&r.push(239,191,189);continue}i=n;continue}if(n<56320){(t-=3)>-1&&r.push(239,191,189),i=n;continue}n=65536+(i-55296<<10|n-56320)}else i&&(t-=3)>-1&&r.push(239,191,189);if(i=null,n<128){if((t-=1)<0)break;r.push(n)}else if(n<2048){if((t-=2)<0)break;r.push(n>>6|192,63&n|128)}else if(n<65536){if((t-=3)<0)break;r.push(n>>12|224,n>>6&63|128,63&n|128)}else{if(!(n<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;r.push(n>>18|240,n>>12&63|128,n>>6&63|128,63&n|128)}}return r}function Na(e){return function(e){var t,n,a,i,r,o;kn||Mn();var s=e.length;if(s%4>0)throw new Error("Invalid string. Length must be a multiple of 4");r="="===e[s-2]?2:"="===e[s-1]?1:0,o=new Ln(3*s/4-r),a=r>0?s-4:s;var c=0;for(t=0,n=0;t<a;t+=4,n+=3)i=An[e.charCodeAt(t)]<<18|An[e.charCodeAt(t+1)]<<12|An[e.charCodeAt(t+2)]<<6|An[e.charCodeAt(t+3)],o[c++]=i>>16&255,o[c++]=i>>8&255,o[c++]=255&i;return 2===r?(i=An[e.charCodeAt(t)]<<2|An[e.charCodeAt(t+1)]>>4,o[c++]=255&i):1===r&&(i=An[e.charCodeAt(t)]<<10|An[e.charCodeAt(t+1)]<<4|An[e.charCodeAt(t+2)]>>2,o[c++]=i>>8&255,o[c++]=255&i),o}(function(e){if((e=function(e){return e.trim?e.trim():e.replace(/^\s+|\s+$/g,"")}(e).replace(Fa,"")).length<2)return"";for(;e.length%4!=0;)e+="=";return e}(e))}function Ba(e,t,n,a){for(var i=0;i<a&&!(i+n>=t.length||i>=e.length);++i)t[i+n]=e[i];return i}function ja(e){return!!e.constructor&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)}function Va(e){return void 0!==(null==e?void 0:e.errorCode)}!function(e){e.Inline="inline",e.Desktop="desktop",e.Web="web"}(va||(va={})),function(e){e.M365Content="m365content"}(ya||(ya={})),function(e){e.DriveId="driveId",e.GroupId="groupId",e.SiteId="siteId",e.UserId="userId"}(Sa||(Sa={})),function(e){e[e.NOT_SUPPORTED_ON_PLATFORM=100]="NOT_SUPPORTED_ON_PLATFORM",e[e.INTERNAL_ERROR=500]="INTERNAL_ERROR",e[e.NOT_SUPPORTED_IN_CURRENT_CONTEXT=501]="NOT_SUPPORTED_IN_CURRENT_CONTEXT",e[e.PERMISSION_DENIED=1e3]="PERMISSION_DENIED",e[e.NETWORK_ERROR=2e3]="NETWORK_ERROR",e[e.NO_HW_SUPPORT=3e3]="NO_HW_SUPPORT",e[e.INVALID_ARGUMENTS=4e3]="INVALID_ARGUMENTS",e[e.UNAUTHORIZED_USER_OPERATION=5e3]="UNAUTHORIZED_USER_OPERATION",e[e.INSUFFICIENT_RESOURCES=6e3]="INSUFFICIENT_RESOURCES",e[e.THROTTLE=7e3]="THROTTLE",e[e.USER_ABORT=8e3]="USER_ABORT",e[e.OPERATION_TIMED_OUT=8001]="OPERATION_TIMED_OUT",e[e.OLD_PLATFORM=9e3]="OLD_PLATFORM",e[e.FILE_NOT_FOUND=404]="FILE_NOT_FOUND",e[e.SIZE_EXCEEDED=1e4]="SIZE_EXCEEDED"}(Da||(Da={})),function(e){e.GeoLocation="geolocation",e.Media="media"}(Ia||(Ia={})),function(e){e.BCAIS="bcais",e.BCWAF="bcwaf",e.BCWBF="bcwbf"}(xa||(xa={})),function(e){e.Faculty="faculty",e.Student="student",e.Other="other"}(Ca||(Ca={})),function(e){e.Adult="adult",e.MinorNoParentalConsentRequired="minorNoParentalConsentRequired",e.MinorWithoutParentalConsent="minorWithoutParentalConsent",e.MinorWithParentalConsent="minorWithParentalConsent",e.NonAdult="nonAdult"}(Oa||(Oa={})),function(e){e.HigherEducation="higherEducation",e.K12="k12",e.Other="other"}(wa||(wa={})),function(e){e.TextPlain="text/plain",e.TextHtml="text/html",e.ImagePNG="image/png",e.ImageJPEG="image/jpeg"}(Ea||(Ea={})),function(e){e.desktop="desktop",e.web="web",e.android="android",e.ios="ios",e.ipados="ipados",e.macos="macos",e.rigel="rigel",e.surfaceHub="surfaceHub",e.teamsRoomsWindows="teamsRoomsWindows",e.teamsRoomsAndroid="teamsRoomsAndroid",e.teamsPhones="teamsPhones",e.teamsDisplays="teamsDisplays"}(Aa||(Aa={})),function(e){e.office="Office",e.outlook="Outlook",e.outlookWin32="OutlookWin32",e.orange="Orange",e.places="Places",e.teams="Teams",e.teamsModern="TeamsModern"}(La||(La={})),function(e){e.settings="settings",e.content="content",e.authentication="authentication",e.remove="remove",e.task="task",e.sidePanel="sidePanel",e.stage="stage",e.meetingStage="meetingStage"}(ka||(ka={})),function(e){e[e.Standard=0]="Standard",e[e.Edu=1]="Edu",e[e.Class=2]="Class",e[e.Plc=3]="Plc",e[e.Staff=4]="Staff"}(Ma||(Ma={})),function(e){e[e.Admin=0]="Admin",e[e.User=1]="User",e[e.Guest=2]="Guest"}(Pa||(Pa={})),function(e){e.Large="large",e.Medium="medium",e.Small="small"}(Ta||(Ta={})),function(e){e.Regular="Regular",e.Private="Private",e.Shared="Shared"}(Ua||(Ua={}));const za={errorCode:Da.NOT_SUPPORTED_ON_PLATFORM},Ga={adaptiveCardSchemaVersion:{majorVersion:1,minorVersion:5}},Ka=new Error("Invalid input count: Must supply a valid image count (limit of 10)."),Wa=new Error("Invalid response: Received more images than the specified max limit in the response.");var qa={randomUUID:"undefined"!=typeof crypto&&crypto.randomUUID&&crypto.randomUUID.bind(crypto)};let Qa;const Ya=new Uint8Array(16);function Ja(){if(!Qa&&(Qa="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Qa))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Qa(Ya)}const Xa=[];for(let e=0;e<256;++e)Xa.push((e+256).toString(16).slice(1));function Za(e,t,n){if(qa.randomUUID&&!t&&!e)return qa.randomUUID();const a=(e=e||{}).random||(e.rng||Ja)();return a[6]=15&a[6]|64,a[8]=63&a[8]|128,function(e,t=0){return Xa[e[t+0]]+Xa[e[t+1]]+Xa[e[t+2]]+Xa[e[t+3]]+"-"+Xa[e[t+4]]+Xa[e[t+5]]+"-"+Xa[e[t+6]]+Xa[e[t+7]]+"-"+Xa[e[t+8]]+Xa[e[t+9]]+"-"+Xa[e[t+10]]+Xa[e[t+11]]+Xa[e[t+12]]+Xa[e[t+13]]+Xa[e[t+14]]+Xa[e[t+15]]}(a)}var $a=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;function ei(e){return"string"==typeof e&&$a.test(e)}function ti(e){return(e,t)=>{if(!e)throw new Error(t)}}function ni(e,t){if("string"!=typeof e||"string"!=typeof t)return NaN;const n=e.split("."),a=t.split(".");function i(e){return/^\d+$/.test(e)}if(!n.every(i)||!a.every(i))return NaN;for(;n.length<a.length;)n.push("0");for(;a.length<n.length;)a.push("0");for(let e=0;e<n.length;++e)if(Number(n[e])!=Number(a[e]))return Number(n[e])>Number(a[e])?1:-1;return 0}function ai(){return Za()}function ii(e){return Object.keys(e).forEach(t=>{null!==e[t]&&void 0!==e[t]&&"object"==typeof e[t]&&ii(e[t])}),Object.freeze(e)}function ri(e,t,...n){const a=e(...n);return a.then(()=>{t&&t(null)}).catch(e=>{t&&t(e)}),a}function oi(e){return!(ni(`${e.majorVersion}.${e.minorVersion}`,"1.5")>=0)}function si(e){return"https:"===e.protocol}function ci(){if(di())throw new Error("window object undefined at SSR check");return window}function di(){return"undefined"==typeof window}function li(e,t){if(pi(e)||!function(e){return e.length<256&&e.length>4}(e)||!function(e){for(let t=0;t<e.length;t++){const n=e.charCodeAt(t);if(n<32||n>126)return!1}return!0}(e))throw t||new Error("id is not valid.")}function ui(e,t){const n=e.toString().toLocaleLowerCase();if(pi(n))throw new Error("Invalid Url");if(n.length>2048)throw new Error("Url exceeds the maximum size of 2048 characters");if(!si(e))throw new Error("Url should be a valid https url")}function fi(e){const t=document.createElement("a");return t.href=e,new URL(t.href)}function pi(e){return new RegExp(`${/<script[^>]*>|<script[^&]*>|%3Cscript[^%]*%3E/gi.source}|${/<\/script[^>]*>|<\/script[^&]*>|%3C\/script[^%]*%3E/gi.source}`,"gi").test(e)}const mi=!!performance&&"now"in performance;function _i(){return mi?performance.now()+performance.timeOrigin:void 0}function hi(e,t=0){return!(t>1e3)&&(void 0===e||"boolean"==typeof e||"number"==typeof e||"bigint"==typeof e||"string"==typeof e||null===e||(Array.isArray(e)?e.every(e=>hi(e,t+1)):!("object"!=typeof e||"[object Object]"!==Object.prototype.toString.call(e)||Object.getPrototypeOf(e)!==Object.prototype&&null!==Object.getPrototypeOf(e))&&Object.keys(e).every(n=>hi(e[n],t+1))))}class bi{constructor(e=ai()){this.uuid=e,function(e){if(!e)throw new Error("id must not be empty");if(!1===ei(e))throw new Error("id must be a valid UUID")}(e)}toString(){return this.uuid}}const gi=new bi,vi=wn.debug.formatArgs;wn.debug.formatArgs=function(e){e[0]=`(${(new Date).toISOString()}): ${e[0]} [${gi.toString()}]`,vi.call(this,e)};const yi=wn.debug("teamsJs");function Si(e){return yi.extend(e)}function Di(e,t){return`${e}_${t}`}function Ii(e){return/^v\d+_[\w.]+$/.test(e)}const xi="2.0.3",Ci="1.9.0",Oi="1.8.0",wi=["teams.microsoft.com","teams.microsoft.us","gov.teams.microsoft.us","dod.teams.microsoft.us","int.teams.microsoft.com","outlook.office.com","outlook-sdf.office.com","outlook.office365.com","outlook-sdf.office365.com","outlook.live.com","outlook-sdf.live.com","teams.live.com","local.teams.live.com","local.teams.live.com:8080","local.teams.office.com","local.teams.office.com:8080","devspaces.skype.com","*.www.office.com","www.office.com","word.office.com","excel.office.com","powerpoint.office.com","www.officeppe.com","*.www.microsoft365.com","www.microsoft365.com","bing.com","edgeservices.bing.com","work.bing.com","www.bing.com","www.staging-bing-int.com","*.cloud.microsoft","*.m365.cloud.microsoft","chatuxmanager.svc.cloud.microsoft","copilot.microsoft.com","windows.msn.com","fa000000125.resources.office.net","fa000000129.resources.office.net","fa000000124.resources.office.net","fa000000128.resources.office.net","fa000000136.resources.office.net"],Ei=new URL("https://res.cdn.office.net/teams-js/validDomains/json/validDomains.json"),Ai=/^https:\/\//,Li="teams.microsoft.com",ki="The library has not yet been initialized";class Mi{}Mi.initializeCalled=!1,Mi.initializeCompleted=!1,Mi.additionalValidOrigins=[],Mi.initializePromise=void 0,Mi.isFramelessWindow=!1,Mi.frameContext=void 0,Mi.hostClientType=void 0,Mi.printCapabilityEnabled=!1;const Pi=Si("runtime");function Ti(e){return 4===e.apiVersion}let Ui={apiVersion:-1,supports:{}};const Fi={apiVersion:4,isNAAChannelRecommended:!1,hostVersionsInfo:Ga,isLegacyTeams:!0,supports:{appInstallDialog:{},appEntity:{},call:{},chat:{},conversations:{},dialog:{card:{bot:{}},url:{bot:{},parentCommunication:{}},update:{}},interactive:{},logs:{},meetingRoom:{},menus:{},monetization:{},notifications:{},pages:{config:{},backStack:{},fullTrust:{}},remoteCamera:{},teams:{fullTrust:{}},teamsCore:{},video:{sharedFrame:{}}}},Hi=[Aa.desktop,Aa.web,Aa.rigel,Aa.surfaceHub,Aa.teamsRoomsWindows,Aa.teamsRoomsAndroid,Aa.teamsPhones,Aa.teamsDisplays],Ri=[Aa.android,Aa.ios,Aa.ipados],Ni=[...Hi,...Ri],Bi=[{versionToUpgradeFrom:1,upgradeToNextVersion:e=>{var t;return{apiVersion:2,hostVersionsInfo:void 0,isLegacyTeams:e.isLegacyTeams,supports:Object.assign(Object.assign({},e.supports),{dialog:e.supports.dialog?{card:void 0,url:e.supports.dialog,update:null===(t=e.supports.dialog)||void 0===t?void 0:t.update}:void 0})}}},{versionToUpgradeFrom:2,upgradeToNextVersion:e=>{const t=Me(e.supports,["appNotification"]);return Object.assign(Object.assign({},e),{apiVersion:3,supports:t})}},{versionToUpgradeFrom:3,upgradeToNextVersion:e=>{var t,n,a,i,r;return{apiVersion:4,hostVersionsInfo:e.hostVersionsInfo,isNAAChannelRecommended:e.isNAAChannelRecommended,isLegacyTeams:e.isLegacyTeams,supports:Object.assign(Object.assign({},e.supports),{dialog:e.supports.dialog?{card:null===(t=e.supports.dialog)||void 0===t?void 0:t.card,url:{bot:null===(a=null===(n=e.supports.dialog)||void 0===n?void 0:n.url)||void 0===a?void 0:a.bot,parentCommunication:(null===(i=e.supports.dialog)||void 0===i?void 0:i.url)?{}:void 0},update:null===(r=e.supports.dialog)||void 0===r?void 0:r.update}:void 0})}}}],ji={"1.0.0":[{capability:{pages:{appButton:{},tabs:{}},stageView:{}},hostClientTypes:Hi}],"1.9.0":[{capability:{location:{}},hostClientTypes:Ni}],"2.0.0":[{capability:{people:{}},hostClientTypes:Ni},{capability:{sharing:{}},hostClientTypes:[Aa.desktop,Aa.web]}],"2.0.1":[{capability:{teams:{fullTrust:{joinedTeams:{}}}},hostClientTypes:[Aa.android,Aa.desktop,Aa.ios,Aa.teamsRoomsAndroid,Aa.teamsPhones,Aa.teamsDisplays,Aa.web]},{capability:{webStorage:{}},hostClientTypes:[Aa.desktop]}],"2.0.5":[{capability:{webStorage:{}},hostClientTypes:[Aa.android,Aa.ios]}],"2.0.8":[{capability:{sharing:{}},hostClientTypes:[Aa.android,Aa.ios]}],"2.1.1":[{capability:{nestedAppAuth:{}},hostClientTypes:[Aa.android,Aa.ios,Aa.ipados]}]},Vi=Pi.extend("generateBackCompatRuntimeConfig");function zi(e,t){const n=Object.assign({},e);for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&("object"!=typeof t[a]||Array.isArray(t[a])?a in e||(n[a]=t[a]):n[a]=zi(e[a]||{},t[a]));return n}function Gi(e,t,n){Vi("generating back compat runtime config for %s",e);let a=Object.assign({},t.supports);Vi("Supported capabilities in config before updating based on highestSupportedVersion: %o",a),Object.keys(n).forEach(t=>{ni(e,t)>=0&&n[t].forEach(e=>{void 0!==Mi.hostClientType&&e.hostClientTypes.includes(Mi.hostClientType)&&(a=zi(a,e.capability))})});const i={apiVersion:4,hostVersionsInfo:Ga,isLegacyTeams:!0,supports:a};return Vi("Runtime config after updating based on highestSupportedVersion: %o",i),i}const Ki=Pi.extend("applyRuntimeConfig");function Wi(e){"string"==typeof e.apiVersion&&(Ki("Trying to apply runtime with string apiVersion, processing as v1: %o",e),e=Object.assign(Object.assign({},e),{apiVersion:1})),Ki("Fast-forwarding runtime %o",e);const t=function(e){let t=e;if(t.apiVersion<4&&Bi.forEach(e=>{t.apiVersion===e.versionToUpgradeFrom&&(t=e.upgradeToNextVersion(t))}),Ti(t))return t;throw new Error("Received a runtime that could not be upgraded to the latest version")}(e);Ki("Applying runtime %o",t),Ui=ii(t)}const qi="2.32.0",Qi=Si("internal"),Yi=Qi.extend("ensureInitializeCalled"),Ji=Qi.extend("ensureInitialized");function Xi(){if(!Mi.initializeCalled)throw Yi(ki),new Error(ki)}function Zi(e,...t){if(!Mi.initializeCompleted)throw Ji("%s. initializeCalled: %s",ki,Mi.initializeCalled.toString()),new Error(ki);if(t&&t.length>0){let e=!1;for(let n=0;n<t.length;n++)if(t[n]===Mi.frameContext){e=!0;break}if(!e)throw new Error(`This call is only allowed in following contexts: ${JSON.stringify(t)}. Current context: "${Mi.frameContext}".`)}return function(e){if(Ti(e))return!0;throw-1===e.apiVersion?new Error("The runtime has not yet been initialized"):new Error("The runtime version is not supported")}(e)}function $i(e="2.0.1"){const t=ni(Mi.clientSupportedSDKVersion,e);return!isNaN(t)&&t>=0}function er(e="2.0.1"){if(Mi.hostClientType!=Aa.android&&Mi.hostClientType!=Aa.ios&&Mi.hostClientType!=Aa.ipados)throw{errorCode:Da.NOT_SUPPORTED_ON_PLATFORM};if(!$i(e))throw{errorCode:Da.OLD_PLATFORM}}function tr(e){return null==e}class nr{constructor(e){this.appIdAsString=e,function(e){if(pi(e))throw new Error(`Potential app id (${e}) is invalid; it contains script tags.`);if(!function(e){return e.length<256&&e.length>4}(e))throw new Error(`Potential app id (${e}) is invalid; its length ${e.length} is not within the length limits (4-256).`);if(function(e){return[...e].some(e=>{const t=e.charCodeAt(0);return t<32||t>126})}(e))throw new Error(`Potential app id (${e}) is invalid; it contains non-printable characters.`)}(e)}serialize(){return this.toString()}toString(){return this.appIdAsString}}let ar=[];const ir=Si("validateOrigin");function rr(){return Pe(this,void 0,void 0,function*(){yield or()})}function or(){return Pe(this,void 0,void 0,function*(){return 0!==ar.length?ar:di()?(ar=wi,wi):fetch(Ei).then(e=>{if(!e.ok)throw new Error("Invalid Response from Fetch Call");return e.json().then(e=>{if(function(e){let t=JSON.parse(e);try{t=JSON.parse(e)}catch(e){return!1}if(!t.validOrigins)return!1;for(const e of t.validOrigins)try{new URL("https://"+e)}catch(t){return ir("isValidOriginsFromCDN call failed to validate origin: %s",e),!1}return!0}(JSON.stringify(e)))return ar=e.validOrigins,ar;throw new Error("Valid Origins List Is Invalid")})}).catch(e=>(ir("validOrigins fetch call to CDN failed with error: %s. Defaulting to fallback list",e),ar=wi,ar))})}function sr(e,t){if("*."===e.substring(0,2)){const n=e.substring(1);if(t.length>n.length&&t.split(".").length===n.split(".").length&&t.substring(t.length-n.length)===n)return!0}else if(e===t)return!0;return!1}function cr(e){if(!e)throw new Error("[app.lifecycle.registerBeforeSuspendOrTerminateHandler] Handler cannot be null");Zi(Ui),function(e){cc.beforeSuspendOrTerminateHandler=e,!tr(e)&&Fc(Di("v2","registerBeforeSuspendOrTerminateHandler"),"registerHandler",["beforeUnload"])}(e)}function dr(e){if(!e)throw new Error("[app.lifecycle.registerOnResumeHandler] Handler cannot be null");Zi(Ui),function(e){cc.resumeHandler=e,!tr(e)&&Fc(Di("v2","registerOnResumeHandler"),"registerHandler",["load"])}(e)}let lr;const ur=Si("messageChannels.telemetry");function fr(){return Pe(this,void 0,void 0,function*(){if(lr)return ur("Returning telemetry port from cache"),lr;if(!pr())throw za;return lr=yield Uc(Di("v1","messageChannels.telemetry.getTelemetryPort"),"messageChannels.telemetry.getTelemetryPort"),lr})}function pr(){var e;return!(!Zi(Ui)||!(null===(e=Ui.supports.messageChannels)||void 0===e?void 0:e.telemetry))}function mr(){lr=void 0}let _r;const hr=Si("messageChannels.dataLayer");function br(){return Pe(this,void 0,void 0,function*(){if(_r)return hr("Returning dataLayer port from cache"),_r;if(!gr())throw za;return _r=yield Uc(Di("v1","messageChannels.dataLayer.getDataLayerPort"),"messageChannels.dataLayer.getDataLayerPort"),_r})}function gr(){var e;return!(!Zi(Ui)||!(null===(e=Ui.supports.messageChannels)||void 0===e?void 0:e.dataLayer))}function vr(){_r=void 0}const yr="v2",Sr=Si("app"),Dr={AppLoaded:"appInitialization.appLoaded",Success:"appInitialization.success",Failure:"appInitialization.failure",ExpectedFailure:"appInitialization.expectedFailure"};var Ir,xr;function Cr(){return Mi.initializeCompleted}function Or(){return Mi.frameContext}function wr(e){return rr(),cs(Di(yr,"app.initialize"),e)}function Er(e){Cc.currentWindow=e}function Ar(){Mi.initializeCalled&&(cc.uninitializeHandlers(),Mi.initializeCalled=!1,Mi.initializeCompleted=!1,Mi.initializePromise=void 0,Mi.additionalValidOrigins=[],Mi.frameContext=void 0,Mi.hostClientType=void 0,Mi.isFramelessWindow=!1,mr(),vr(),Cc.currentWindow&&Cc.currentWindow.removeEventListener("message",Oc.messageListener,!1),Cc.currentWindow=null,Cc.parentWindow=null,Cc.parentOrigin=null,Cc.childWindow=null,Cc.childOrigin=null,Oc.parentMessageQueue=[],Oc.childMessageQueue=[],Oc.nextMessageId=0,Oc.callbacks.clear(),Oc.promiseCallbacks.clear(),Oc.portCallbacks.clear(),Oc.legacyMessageIdsToUuidMap={},vc.clearMessages())}function Lr(){return new Promise(e=>{Xi(),e(wc(Di(yr,"app.getContext"),"getContext"))}).then(e=>function(e){var t;return{actionInfo:e.actionInfo,app:{locale:e.locale,sessionId:e.appSessionId?e.appSessionId:"",theme:e.theme?e.theme:"default",iconPositionVertical:e.appIconPosition,osLocaleInfo:e.osLocaleInfo,parentMessageId:e.parentMessageId,userClickTime:e.userClickTime,userClickTimeV2:e.userClickTimeV2,userFileOpenPreference:e.userFileOpenPreference,host:{name:e.hostName?e.hostName:La.teams,clientType:e.hostClientType?e.hostClientType:Aa.web,sessionId:e.sessionId?e.sessionId:"",ringId:e.ringId},appLaunchId:e.appLaunchId},page:{id:e.entityId,frameContext:e.frameContext?e.frameContext:Mi.frameContext,subPageId:e.subEntityId,isFullScreen:e.isFullScreen,isMultiWindow:e.isMultiWindow,isBackgroundLoad:e.isBackgroundLoad,sourceOrigin:e.sourceOrigin},user:{id:null!==(t=e.userObjectId)&&void 0!==t?t:"",displayName:e.userDisplayName,isCallingAllowed:e.isCallingAllowed,isPSTNCallingAllowed:e.isPSTNCallingAllowed,licenseType:e.userLicenseType,loginHint:e.loginHint,userPrincipalName:e.userPrincipalName,tenant:e.tid?{id:e.tid,teamsSku:e.tenantSKU}:void 0},channel:e.channelId?{id:e.channelId,displayName:e.channelName,relativeUrl:e.channelRelativeUrl,membershipType:e.channelType,defaultOneNoteSectionId:e.defaultOneNoteSectionId,ownerGroupId:e.hostTeamGroupId,ownerTenantId:e.hostTeamTenantId}:void 0,chat:e.chatId?{id:e.chatId}:void 0,meeting:e.meetingId?{id:e.meetingId}:void 0,sharepoint:e.sharepoint,team:e.teamId?{internalId:e.teamId,displayName:e.teamName,type:e.teamType,groupId:e.groupId,templateId:e.teamTemplateId,isArchived:e.isTeamArchived,userRole:e.userTeamRole}:void 0,sharePointSite:e.teamSiteUrl||e.teamSiteDomain||e.teamSitePath||e.mySitePath||e.mySiteDomain?{teamSiteUrl:e.teamSiteUrl,teamSiteDomain:e.teamSiteDomain,teamSitePath:e.teamSitePath,teamSiteId:e.teamSiteId,mySitePath:e.mySitePath,mySiteDomain:e.mySiteDomain}:void 0,dialogParameters:e.dialogParameters||{}}}(e))}function kr(){Xi(),ds(Di(yr,"app.notifyAppLoaded"))}function Mr(){return function(e){return Pe(this,void 0,void 0,function*(){if(Mi.initializeCompleted)return fs(e);if(!Mi.initializePromise)throw new Error(ki);return Mi.initializePromise.then(()=>fs(e))})}(Di(yr,"app.notifySuccess"))}function Pr(e){Xi(),us(Di(yr,"app.notifyFailure"),e)}function Tr(e){Xi(),ls(Di(yr,"app.notifyExpectedFailure"),e)}function Ur(e){ms(Di(yr,"app.registerOnThemeChangeHandler"),e)}function Fr(e){!function(e){cc.hostToAppPerformanceMetricsHandler=e}(e)}function Hr(e){return _s(Di(yr,"app.openLink"),e)}!function(e){e.AuthFailed="AuthFailed",e.Timeout="Timeout",e.Other="Other"}(Ir||(Ir={})),function(e){e.PermissionError="PermissionError",e.NotFound="NotFound",e.Throttling="Throttling",e.Offline="Offline",e.Other="Other"}(xr||(xr={})),Sr("teamsjs instance is version %s, starting at %s UTC (%s local)",qi,(new Date).toISOString(),(new Date).toLocaleString()),function(){if(di())return;const e=document.getElementsByTagName("script"),t=e&&e[e.length-1]&&e[e.length-1].src,n="Today, teamsjs can only be used from a single script or you may see undefined behavior. This log line is used to help detect cases where teamsjs is loaded multiple times -- it is always written. The presence of the log itself does not indicate a multi-load situation, but multiples of these log lines will. If you would like to use teamjs from more than one script at the same time, please open an issue at https://github.com/OfficeDev/microsoft-teams-library-js/issues";t&&0!==t.length?Sr("teamsjs is being used from %s. %s",t,n):Sr("teamsjs is being used from a script tag embedded directly in your html. %s",n)}();const Rr="v1",Nr="v2";let Br,jr,Vr;function zr(){uc(Di(Rr,"authentication.registerAuthenticateSuccessHandler"),"authentication.authenticate.success",Zr,!1),uc(Di(Rr,"authentication.registerAuthenticateFailureHandler"),"authentication.authenticate.failure",$r,!1)}function Gr(e){Vr=e}function Kr(e){const t=void 0!==e,n=t?e:Vr;if(!n)throw new Error("No parameters are provided for authentication");return Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.remove,ka.task,ka.stage,ka.meetingStage),function(e,t){return new Promise((n,a)=>{if(Mi.hostClientType!==Aa.web){const a=fi(t.url);ui(a),n(kc(e,"authentication.authenticate",[a.href,t.width,t.height,t.isExternal]).then(([e,t])=>{if(e)return t;throw new Error(t)}))}else Br={success:n,fail:a},function(e){Qr();let t=e.width||600,n=e.height||400;t=Math.min(t,Cc.currentWindow.outerWidth-400),n=Math.min(n,Cc.currentWindow.outerHeight-200);const a=fi(e.url.replace("{oauthRedirectMethod}","web"));ui(a);let i=void 0!==Cc.currentWindow.screenLeft?Cc.currentWindow.screenLeft:Cc.currentWindow.screenX,r=void 0!==Cc.currentWindow.screenTop?Cc.currentWindow.screenTop:Cc.currentWindow.screenY;i+=Cc.currentWindow.outerWidth/2-t/2,r+=Cc.currentWindow.outerHeight/2-n/2,Cc.childWindow=Cc.currentWindow.open(a.href,"_blank","toolbar=no, location=yes, status=no, menubar=no, scrollbars=yes, top="+r+", left="+i+", width="+t+", height="+n),Cc.childWindow?(Yr(),jr=Cc.currentWindow.setInterval(()=>{if(!Cc.childWindow||Cc.childWindow.closed)$r("CancelledByUser");else{const e=Cc.childOrigin;try{Cc.childOrigin="*",sd("ping")}finally{Cc.childOrigin=e}}},100),uc(Di(Rr,"authentication.authenticationWindow.registerInitializeHandler"),"initialize",()=>[ka.authentication,Mi.hostClientType]),uc(Di(Rr,"authentication.authenticationWindow.registerNavigateCrossDomainHandler"),"navigateCrossDomain",()=>!1)):$r("FailedToOpenWindow")}(t)})}(n.successCallback||n.failureCallback?Di(Rr,"authentication.authenticate"):Di(Nr,"authentication.authenticate"),n).then(e=>{try{return n&&n.successCallback?(n.successCallback(e),""):e}finally{t||(Vr=void 0)}}).catch(e=>{try{if(n&&n.failureCallback)return n.failureCallback(e.message),"";throw e}finally{t||(Vr=void 0)}})}function Wr(e){return Xi(),function(e,t){return new Promise(n=>{n(kc(e,"authentication.getAuthToken",[null==t?void 0:t.resources,null==t?void 0:t.claims,null==t?void 0:t.silent,null==t?void 0:t.tenantId]))}).then(([e,t])=>{if(e)return t;throw new Error(t)})}(e&&(e.successCallback||e.failureCallback)?Di(Rr,"authentication.getAuthToken"):Di(Nr,"authentication.getAuthToken"),e).then(t=>e&&e.successCallback?(e.successCallback(t),""):t).catch(t=>{if(e&&e.failureCallback)return e.failureCallback(t.message),"";throw t})}function qr(e){return Xi(),function(e){return new Promise(t=>{t(kc(e,"authentication.getUser"))}).then(([e,t])=>{if(e)return t;throw t})}(e&&(e.successCallback||e.failureCallback)?Di(Rr,"authentication.getUser"):Di(Nr,"authentication.getUser")).then(t=>e&&e.successCallback?(e.successCallback(t),null):t).catch(t=>{const n=`Error returned, code = ${t.errorCode}, message = ${t.message}`;if(e&&e.failureCallback)return e.failureCallback(n),null;throw new Error(n)})}function Qr(){Yr();try{Cc.childWindow&&Cc.childWindow.close()}finally{Cc.childWindow=null,Cc.childOrigin=null}}function Yr(){jr&&(clearInterval(jr),jr=0),fc("initialize"),fc("navigateCrossDomain")}function Jr(e,t){Zi(Ui,ka.authentication),Fc(Di(t?Rr:Nr,"authentication.notifySuccess"),"authentication.authenticate.success",[e]),rd(Cc.parentWindow,()=>setTimeout(()=>Cc.currentWindow.close(),200))}function Xr(e,t){Zi(Ui,ka.authentication),Fc(Di(t?Rr:Nr,"authentication.notifyFailure"),"authentication.authenticate.failure",[e]),rd(Cc.parentWindow,()=>setTimeout(()=>Cc.currentWindow.close(),200))}function Zr(e){try{Br&&Br.success(e)}finally{Br=void 0,Qr()}}function $r(e){try{Br&&Br.fail(new Error(e))}finally{Br=void 0,Qr()}}var eo;function to(e){ho(Di(_o,"dialog.update.resize"),e)}function no(){return!(!Zi(Ui)||!Ui.supports.dialog||!Ui.supports.dialog.update)}function ao(e,t,n){go(Di(_o,"dialog.url.bot.open"),e,t,n)}function io(){return Zi(Ui)&&void 0!==(Ui.supports.dialog&&Ui.supports.dialog.url&&Ui.supports.dialog.url.bot)}function ro(e){if(Zi(Ui,ka.task),!co())throw za;Fc(Di(_o,"dialog.url.parentCommunication.sendMessageToParentFromDialog"),"messageForParent",[e])}function oo(e){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!co())throw za;Fc(Di(_o,"dialog.url.parentCommunication.sendMessageToDialog"),"messageForChild",[e])}function so(e){if(Zi(Ui,ka.task),!co())throw za;for(fc("messageForChild"),uc(Di(_o,"dialog.url.parentCommunication.registerMessageForChildHandler"),"messageForChild",e),So.reverse();So.length>0;)e(So.pop())}function co(){var e,t;return Zi(Ui)&&!!(null===(t=null===(e=Ui.supports.dialog)||void 0===e?void 0:e.url)||void 0===t?void 0:t.parentCommunication)}function lo(e,t,n){bo(Di(_o,"dialog.url.open"),e,t,n)}function uo(e,t){vo(Di(_o,"dialog.url.submit"),e,t)}function fo(){return Zi(Ui)&&void 0!==(Ui.supports.dialog&&Ui.supports.dialog.url)}function po(e){return{url:e.url,height:e.size?e.size.height:Ta.Small,width:e.size?e.size.width:Ta.Small,title:e.title,fallbackUrl:e.fallbackUrl}}function mo(e){const t=po(e);return t.completionBotId=e.completionBotId,t}!function(e){e.Public="public",e.EUDB="eudb",e.Other="other"}(eo||(eo={}));const _o="v2";function ho(e,t){if(Zi(Ui,ka.content,ka.sidePanel,ka.task,ka.meetingStage),!no())throw za;Fc(e,"tasks.updateTask",[t])}function bo(e,t,n,a){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!fo())throw za;a&&uc(Di(_o,"dialog.url.registerMessageForParentHandler"),"messageForParent",a),Fc(e,"tasks.startTask",[po(t)],(e,t)=>{null==n||n({err:e,result:t}),fc("messageForParent")})}function go(e,t,n,a){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!io())throw za;a&&uc(Di(_o,"dialog.url.bot.registerMessageForParentHandler"),"messageForParent",a),Fc(e,"tasks.startTask",[mo(t)],(e,t)=>{null==n||n({err:e,result:t}),fc("messageForParent")})}function vo(e,t,n){if(Zi(Ui,ka.task),!fo())throw za;Fc(e,"tasks.completeTask",[t,n?Array.isArray(n)?n:[n]:[]])}function yo(e){return{card:e.card,height:e.size?e.size.height:Ta.Small,width:e.size?e.size.width:Ta.Small,title:e.title}}const So=[];function Do(e){Mi.frameContext&&(Mi.frameContext===ka.task?So.push(e):fc("messageForChild"))}function Io(e,t){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!xo())throw za;const n=function(e){const t=yo(e);return t.completionBotId=e.completionBotId,t}(e);Fc(Di(_o,"dialog.adaptiveCard.bot.open"),"tasks.startTask",[n],(e,n)=>{null==t||t({err:e,result:n})})}function xo(){const e=Ui.hostVersionsInfo&&Ui.hostVersionsInfo.adaptiveCardSchemaVersion&&!oi(Ui.hostVersionsInfo.adaptiveCardSchemaVersion);return Zi(Ui)&&void 0!==(e&&Ui.supports.dialog&&Ui.supports.dialog.card&&Ui.supports.dialog.card.bot)}function Co(e,t){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!Oo())throw za;const n=yo(e);Fc(Di(_o,"dialog.adaptiveCard.open"),"tasks.startTask",[n],(e,n)=>{null==t||t({err:e,result:n})})}function Oo(){const e=Ui.hostVersionsInfo&&Ui.hostVersionsInfo.adaptiveCardSchemaVersion&&!oi(Ui.hostVersionsInfo.adaptiveCardSchemaVersion);return Zi(Ui)&&void 0!==(e&&Ui.supports.dialog&&Ui.supports.dialog.card)}function wo(){uc(Di(_o,"dialog.registerMessageForChildHandler"),"messageForChild",Do,!1)}function Eo(){return!(!Zi(Ui)||!Ui.supports.dialog)}const Ao="v2";var Lo,ko;!function(e){e[e.ifRoom=0]="ifRoom",e[e.overflowOnly=1]="overflowOnly"}(Lo||(Lo={}));class Mo{constructor(){this.enabled=!0,this.selected=!1}}let Po,To,Uo,Fo,Ho;function Ro(){uc(Di(Ao,"menus.registerNavBarMenuItemPressHandler"),"navBarMenuItemPress",Vo,!1),uc(Di(Ao,"menus.registerActionMenuItemPressHandler"),"actionMenuItemPress",Go,!1),uc(Di(Ao,"menus.registerSetModuleViewHandler"),"setModuleView",Bo,!1)}function No(e,t){if(Zi(Ui),!Ko())throw za;Uo=t,Fc(Di(Ao,"menus.setUpViews"),"setUpViews",[e])}function Bo(e){Uo&&Uo(e)||(Zi(Ui),Fc(Di(Ao,"menus.handleViewConfigItemPress"),"viewConfigItemPress",[e]))}function jo(e,t){if(Zi(Ui),!Ko())throw za;Po=t,Fc(Di(Ao,"menus.setNavBarMenu"),"setNavBarMenu",[e])}function Vo(e){Po&&Po(e)||(Zi(Ui),Fc(Di(Ao,"menus.handleNavBarMenuItemPress"),"handleNavBarMenuItemPress",[e]))}function zo(e,t){if(Zi(Ui),!Ko())throw za;To=t,Fc(Di(Ao,"menus.showActionMenu"),"showActionMenu",[e])}function Go(e){To&&To(e)||(Zi(Ui),Fc(Di(Ao,"menus.handleActionMenuItemPress"),"handleActionMenuItemPress",[e]))}function Ko(){return!(!Zi(Ui)||!Ui.supports.menus)}!function(e){e.dropDown="dropDown",e.popOver="popOver"}(ko||(ko={}));class Wo{}class qo extends Wo{validate(e){return!0}deserialize(e){return e}}function Qo(){uc(Di(Vs,"pages.config.registerSettingsSaveHandler"),"settings.save",ts,!1),uc(Di(Vs,"pages.config.registerSettingsRemoveHandler"),"settings.remove",is,!1)}function Yo(e){return Js(Di(Vs,"pages.config.setValidityState"),e)}function Jo(e){return Zs(Di(Vs,"pages.config.setConfig"),e)}function Xo(e){Zo(Di(Vs,"pages.config.registerOnSaveHandler"),e,()=>{if(!tr(e)&&!os())throw za})}function Zo(e,t,n){!tr(t)&&Zi(Ui,ka.settings),n&&n(),Fo=t,!tr(t)&&Fc(e,"registerHandler",["save"])}function $o(e){es(Di(Vs,"pages.config.registerOnRemoveHandler"),e,()=>{if(!tr(e)&&!os())throw za})}function es(e,t,n){!tr(t)&&Zi(Ui,ka.remove,ka.settings),n&&n(),Ho=t,!tr(t)&&Fc(e,"registerHandler",["remove"])}function ts(e){const t=new as(e);Fo?Fo(t):Cc.childWindow?sd("settings.save",[e]):t.notifySuccess()}function ns(e){mc(Di(Vs,"pages.config.registerChangeConfigHandler"),"changeSettings",e,[ka.content],()=>{if(!os())throw za})}class as{constructor(e){this.notified=!1,this.result=e||{}}notifySuccess(){this.ensureNotNotified(),Fc(Di(Vs,"pages.saveEvent.notifySuccess"),"settings.save.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),Fc(Di(Vs,"pages.saveEvent.notifyFailure"),"settings.save.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The SaveEvent may only notify success or failure once.")}}function is(){const e=new rs;Ho?Ho(e):Cc.childWindow?sd("settings.remove",[]):e.notifySuccess()}class rs{constructor(){this.notified=!1}notifySuccess(){this.ensureNotNotified(),Fc(Di(Vs,"pages.removeEvent.notifySuccess"),"settings.remove.success"),this.notified=!0}notifyFailure(e){this.ensureNotNotified(),Fc(Di(Vs,"pages.removeEvent.notifyFailure"),"settings.remove.failure",[e]),this.notified=!0}ensureNotNotified(){if(this.notified)throw new Error("The removeEventType may only notify success or failure once.")}}function os(){return!(!Zi(Ui)||!Ui.supports.pages||!Ui.supports.pages.config)}const ss=Si("app");function cs(e,t){return di()?(ss.extend("initialize")("window object undefined at initialization"),Promise.resolve()):function(e,t,n){return new Promise((t,a)=>{const i=setTimeout(a,6e4,n);e().then(e=>{clearTimeout(i),t(e)}).catch(e=>{clearTimeout(i),a(e)})})}(()=>function(e,t){return new Promise(n=>{Mi.initializeCalled||(Mi.initializeCalled=!0,cc.initializeHandlers(),Mi.initializePromise=function(e,t){if(Oc.messageListener=e=>function(e){return Pe(this,void 0,void 0,function*(){if(!e||!e.data||"object"!=typeof e.data)return void zc("Unrecognized message format received by app, message being ignored. Message: %o",e);const t=e.source||e.originalEvent&&e.originalEvent.source,n=e.origin||e.originalEvent&&e.originalEvent.origin;return qc(t,n).then(a=>{a?(function(e,t){Mi.isFramelessWindow||Cc.parentWindow&&!Cc.parentWindow.closed&&e!==Cc.parentWindow?Cc.childWindow&&!Cc.childWindow.closed&&e!==Cc.childWindow||(Cc.childWindow=e,Cc.childOrigin=t):(Cc.parentWindow=e,Cc.parentOrigin=t),Cc.parentWindow&&Cc.parentWindow.closed&&(Cc.parentWindow=null,Cc.parentOrigin=null),Cc.childWindow&&Cc.childWindow.closed&&(Cc.childWindow=null,Cc.childOrigin=null),id(Cc.parentWindow),id(Cc.childWindow)}(t,n),t===Cc.parentWindow?Xc(e):t===Cc.childWindow&&function(e){if("id"in e.data&&"func"in e.data){const t=(e=>{const{uuidAsString:t}=e,n=Me(e,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:t?new bi(t):void 0})})(e.data),[n,a]=lc(t.func,t.args);n&&void 0!==a?(Zc("Returning message %s from child back to child, action: %s.",cd(t),t.func),od(t.id,t.uuid,Array.isArray(a)?a:[a])):(Zc("Relaying message %s from child to parent, action: %s. Relayed message will have a new id.",cd(t),t.func),Fc(Di("v2","tasks.startTask"),t.func,t.args,(...e)=>{if(Cc.childWindow){const n=e.pop();Zc("Message from parent being relayed to child, id: %s",cd(t)),od(t.id,t.uuid,e,n)}}))}}(e)):zc("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin, message: %o, source: %o, origin: %o",e,t,n)})})}(e),Cc.currentWindow=Cc.currentWindow||ci(),Cc.parentWindow=Cc.currentWindow.parent!==Cc.currentWindow.self?Cc.currentWindow.parent:Cc.currentWindow.opener,Cc.topWindow=Cc.currentWindow.top,(Cc.parentWindow||e)&&Cc.currentWindow.addEventListener("message",Oc.messageListener,!1),!Cc.parentWindow){const e=Cc.currentWindow;if(!e.nativeInterface)return Promise.reject(new Error("Initialization Failed. No Parent window found."));Mi.isFramelessWindow=!0,e.onNativeMessage=Xc}try{return Cc.parentOrigin="*",kc(t,"initialize",[qi,4,e]).then(([e,t,n,a])=>(function(e,t,n){var a;const i=Dc;if(Mi.isFramelessWindow)return void i("Cannot polyfill nestedAppAuthBridge as current window is frameless");if(!t)return void i("Cannot polyfill nestedAppAuthBridge as current window does not exist");const r=(()=>{try{return JSON.parse(e)}catch(e){return null}})();if(!r||!(null===(a=r.supports)||void 0===a?void 0:a.nestedAppAuth))return void i("Cannot polyfill nestedAppAuthBridge as current hub does not support nested app auth");const o=t;if(o.nestedAppAuthBridge)return void i("nestedAppAuthBridge already exists on current window, skipping polyfill");const s=function(e,t){const n=Ic;if(!e)return n("nestedAppAuthBridge cannot be created as current window does not exist"),null;const{onMessage:a,sendPostMessage:i}=t,r=e=>t=>a(t,e);return{addEventListener:(t,a)=>{"message"===t?e.addEventListener(t,r(a)):n(`Event ${t} is not supported by nestedAppAuthBridge`)},postMessage:e=>{const t=(()=>{try{return JSON.parse(e)}catch(e){return null}})();t&&"object"==typeof t&&"NestedAppAuthRequest"===t.messageType?i(e):n("Unrecognized data format received by app, message being ignored. Message: %o",e)},removeEventListener:(t,n)=>{e.removeEventListener(t,r(n))}}}(o,n);s&&(o.nestedAppAuthBridge=s)}(a,Cc.currentWindow,{onMessage:Kc,sendPostMessage:Rc}),{context:e,clientType:t,runtimeConfig:n,clientSupportedSDKVersion:a}))}finally{Cc.parentOrigin=null}}(t,e).then(({context:e,clientType:t,runtimeConfig:n,clientSupportedSDKVersion:a="2.0.1"})=>{Mi.frameContext=e,Mi.hostClientType=t,Mi.clientSupportedSDKVersion=a;try{ps("Parsing %s",n);const e=JSON.parse(n);if(ps("Checking if %o is a valid runtime object",null!=e?e:"null"),!e||!e.apiVersion)throw new Error("Received runtime config is invalid");n&&Wi(e)}catch(e){if(!(e instanceof SyntaxError))throw e;try{ps("Attempting to parse %s as an SDK version",n),isNaN(ni(n,"2.0.1"))||(Mi.clientSupportedSDKVersion=n);const e=JSON.parse(a);if(ps("givenRuntimeConfig parsed to %o",null!=e?e:"null"),!e)throw new Error("givenRuntimeConfig string was successfully parsed. However, it parsed to value of null");Wi(e)}catch(e){if(!(e instanceof SyntaxError))throw e;Wi(Gi(Mi.clientSupportedSDKVersion,Fi,ji))}}Mi.initializeCompleted=!0}),zr(),Ro(),Qo(),wo()),Array.isArray(t)&&function(e){let t=Mi.additionalValidOrigins.concat(e.filter(e=>"string"==typeof e&&Ai.test(e)));const n={};t=t.filter(e=>!n[e]&&(n[e]=!0,!0)),Mi.additionalValidOrigins=t}(t),void 0!==Mi.initializePromise?n(Mi.initializePromise):ps("GlobalVars.initializePromise is unexpectedly undefined")})}(e,t),0,new Error("SDK initialization timed out."))}function ds(e){Fc(e,Dr.AppLoaded,[qi])}function ls(e,t){Fc(e,Dr.ExpectedFailure,[t.reason,t.message])}function us(e,t){Fc(e,Dr.Failure,[t.reason,t.message])}function fs(e){return Pe(this,void 0,void 0,function*(){return Zi(Ui)&&(null===(t=Ui.supports.app)||void 0===t?void 0:t.notifySuccessResponse)?Pc(Dr.Success,[qi],new qo,e).then(()=>({hasFinishedSuccessfully:!0})):(Fc(e,Dr.Success,[qi]),{hasFinishedSuccessfully:"unknown"});var t})}const ps=ss.extend("initializeHelper");function ms(e,t){!tr(t)&&Xi(),function(e,t){cc.themeChangeHandler=t,!tr(t)&&Fc(e,"registerHandler",["themeChange"])}(e,t)}function _s(e,t){return new Promise(n=>{Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.task,ka.stage,ka.meetingStage),n(Ec(e,"executeDeepLink",t))})}function hs(e){mc(Di(Vs,"pages.appButton.onClick"),"appButtonClick",e,[ka.content],()=>{if(!vs())throw za})}function bs(e){mc(Di(Vs,"pages.appButton.onHoverEnter"),"appButtonHoverEnter",e,[ka.content],()=>{if(!vs())throw za})}function gs(e){mc(Di(Vs,"pages.appButton.onHoverLeave"),"appButtonHoverLeave",e,[ka.content],()=>{if(!vs())throw za})}function vs(){return!(!Zi(Ui)||!Ui.supports.pages||!Ui.supports.pages.appButton)}function ys(e){return new Promise(t=>{if(Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.task,ka.stage,ka.meetingStage),!Ds())throw za;t(Lc(Di(Vs,"pages.currentApp.navigateTo"),"pages.currentApp.navigateTo",e))})}function Ss(){return new Promise(e=>{if(Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.task,ka.stage,ka.meetingStage),!Ds())throw za;e(Lc(Di(Vs,"pages.currentApp.navigateToDefaultPage"),"pages.currentApp.navigateToDefaultPage"))})}function Ds(){return!(!Zi(Ui)||!Ui.supports.pages||!Ui.supports.pages.currentApp)}function Is(){if(Zi(Ui,ka.content),!Cs())throw za;Fc(Di(Vs,"pages.fullTrust.enterFullscreen"),"enterFullscreen",[])}function xs(){if(Zi(Ui,ka.content),!Cs())throw za;Fc(Di(Vs,"pages.fullTrust.exitFullscreen"),"exitFullscreen",[])}function Cs(){return!(!Zi(Ui)||!Ui.supports.pages||!Ui.supports.pages.fullTrust)}function Os(e){return Ks(Di(Vs,"pages.tabs.navigateToTab"),e)}function ws(e){return Ws(Di(Vs,"pages.tabs.getTabInstances"),e)}function Es(e){return qs(Di(Vs,"pages.tabs.getMruTabInstances"),e)}function As(){return!(!Zi(Ui)||!Ui.supports.pages||!Ui.supports.pages.tabs)}var Ls,ks;function Ms(e){const t=Di(Vs,"pages.returnFocus");if(Zi(Ui),!js())throw za;if(void 0===e&&Fc(t,"returnFocus",[!1]),"boolean"==typeof e)Fc(t,"returnFocus",[e]);else switch(e){case ks.PreviousLandmark:case ks.GoToActivityFeed:Fc(t,"returnFocus",[!1,e]);break;case ks.NextLandmark:Fc(t,"returnFocus",[!0,e])}}function Ps(e){mc(Di(Vs,"pages.registerFocusEnterHandler"),"focusEnter",e,[],()=>{if(!js())throw za})}function Ts(e){Ys(Di(Vs,"pages.setCurrentFrame"),e)}function Us(e,t,n){rr(),cs(Di(Vs,"pages.initializeWithFrameContext"),n).then(()=>t&&t()),Ts(e)}function Fs(){return Xs(Di(Vs,"pages.getConfig."))}function Hs(e){return zs(Di(Vs,"pages.navigateCrossDomain"),e)}function Rs(e){return new Promise(t=>{if(Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.task,ka.stage,ka.meetingStage),!js())throw za;const n=Di(Vs,"pages.navigateToApp");if(Ui.isLegacyTeams){const a=$s(e)?e:function(e){return Object.assign(Object.assign({},e),{appId:new nr(e.appId),webUrl:e.webUrl?new URL(e.webUrl):void 0})}(e);t(Ec(n,"executeDeepLink",function(e){const t=new URL("https://teams.microsoft.com/l/entity/"+encodeURIComponent(e.appId.toString())+"/"+encodeURIComponent(e.pageId));return e.webUrl&&t.searchParams.append("webUrl",e.webUrl.toString()),(e.chatId||e.channelId||e.subPageId)&&t.searchParams.append("context",JSON.stringify({chatId:e.chatId,channelId:e.channelId,subEntityId:e.subPageId})),t.toString()}(a)))}else{const a=$s(e)?function(e){return Object.assign(Object.assign({},e),{appId:e.appId.toString(),webUrl:e.webUrl?e.webUrl.toString():void 0})}(e):e;t(Ec(n,"pages.navigateToApp",a))}})}function Ns(e){return Qs(Di(Vs,"pages.shareDeepLink"),e)}function Bs(e){mc(Di(Vs,"pages.registerFullScreenHandler"),"fullScreenChange",e,[],()=>{if(!tr(e)&&!js())throw za})}function js(){return!(!Zi(Ui)||!Ui.supports.pages)}!function(e){e[e.PreviousLandmark=0]="PreviousLandmark",e[e.NextLandmark=1]="NextLandmark",e[e.Read=2]="Read",e[e.Compose=3]="Compose"}(Ls||(Ls={})),function(e){e[e.PreviousLandmark=0]="PreviousLandmark",e[e.NextLandmark=1]="NextLandmark",e[e.GoToActivityFeed=2]="GoToActivityFeed"}(ks||(ks={}));const Vs="v2";function zs(e,t){return new Promise(n=>{if(Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.remove,ka.task,ka.stage,ka.meetingStage),!js())throw za;n(Ac(e,"navigateCrossDomain","Cross-origin navigation is only supported for URLs matching the pattern registered in the manifest.",t))})}function Gs(e){return new Promise(t=>{if(Zi(Ui),!oc())throw za;t(Ac(e,"navigateBack","Back navigation is not supported in the current client or context."))})}function Ks(e,t){return new Promise(n=>{if(Zi(Ui),!As())throw za;n(Ac(e,"navigateToTab","Invalid internalTabInstanceId and/or channelId were/was provided",t))})}function Ws(e,t){return new Promise(n=>{if(Zi(Ui),!As())throw za;n(wc(e,"getTabInstances",t))})}function qs(e,t){return new Promise(n=>{if(Zi(Ui),!As())throw za;n(wc(e,"getMruTabInstances",t))})}function Qs(e,t){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!js())throw za;Fc(e,"shareDeepLink",[t.subPageId,t.subPageLabel,t.subPageWebUrl])}function Ys(e,t){if(Zi(Ui,ka.content),!js())throw za;Fc(e,"setFrameContext",[t])}function Js(e,t){if(Zi(Ui,ka.settings,ka.remove),!os())throw za;Fc(e,"settings.setValidityState",[t])}function Xs(e){return new Promise(t=>{if(Zi(Ui,ka.content,ka.settings,ka.remove,ka.sidePanel),!js())throw za;t(wc(e,"settings.getSettings"))})}function Zs(e,t){return new Promise(n=>{if(Zi(Ui,ka.content,ka.settings,ka.sidePanel),!os())throw za;n(Ec(e,"settings.setSettings",t))})}function $s(e){return e.appId instanceof nr}let ec;function tc(){uc(Di(Vs,"pages.backStack.registerBackButtonPressHandler"),"backButtonPress",rc,!1)}function nc(){return Gs(Di(Vs,"pages.backStack.navigateBack"))}function ac(e){ic(Di(Vs,"pages.backStack.registerBackButtonHandler"),e,()=>{if(!tr(e)&&!oc())throw za})}function ic(e,t,n){!tr(t)&&Zi(Ui),n&&n(),ec=t,!tr(t)&&Fc(e,"registerHandler",["backButton"])}function rc(){ec&&ec()||(Cc.childWindow?sd("backButtonPress",[]):nc())}function oc(){return!(!Zi(Ui)||!Ui.supports.pages||!Ui.supports.pages.backStack)}const sc=Si("handlers");class cc{static initializeHandlers(){cc.handlers.themeChange=_c,cc.handlers.load=bc,cc.handlers.beforeUnload=gc,tc()}static uninitializeHandlers(){cc.handlers={},cc.themeChangeHandler=null,cc.loadHandler=null,cc.beforeUnloadHandler=null,cc.beforeSuspendOrTerminateHandler=null,cc.resumeHandler=null}}cc.handlers={},cc.themeChangeHandler=null,cc.loadHandler=null,cc.beforeUnloadHandler=null,cc.beforeSuspendOrTerminateHandler=null,cc.resumeHandler=null,cc.hostToAppPerformanceMetricsHandler=null;const dc=sc.extend("callHandler");function lc(e,t){const n=cc.handlers[e];return n?(dc("Invoking the registered handler for message %s with arguments %o",e,t),[!0,n.apply(this,t)]):Cc.childWindow?(sd(e,t),[!1,void 0]):(dc("Handler for action message %s not found.",e),[!1,void 0])}function uc(e,t,n,a=!0,i=[]){n?(cc.handlers[t]=n,a&&Fc(e,"registerHandler",[t,...i])):delete cc.handlers[t]}function fc(e){delete cc.handlers[e]}function pc(e){return null!=cc.handlers[e]}function mc(e,t,n,a,i){n&&Zi(Ui,...a),i&&i(),uc(e,t,n)}function _c(e){cc.themeChangeHandler&&cc.themeChangeHandler(e),Cc.childWindow&&sd("themeChange",[e])}function hc(e){cc.hostToAppPerformanceMetricsHandler&&cc.hostToAppPerformanceMetricsHandler(e)}function bc(e){const t={entityId:(n=e).entityId,contentUrl:new URL(n.contentUrl)};var n;cc.resumeHandler?(cc.resumeHandler(t),Cc.childWindow&&sd("load",[t])):cc.loadHandler&&(cc.loadHandler(e),Cc.childWindow&&sd("load",[e]))}function gc(){return Pe(this,void 0,void 0,function*(){const e=()=>{Fc(Di("v2","handleBeforeUnload"),"readyToUnload",[])};cc.beforeSuspendOrTerminateHandler?(yield cc.beforeSuspendOrTerminateHandler(),Cc.childWindow?sd("beforeUnload"):e()):cc.beforeUnloadHandler&&cc.beforeUnloadHandler(e)||(Cc.childWindow?sd("beforeUnload"):e())})}class vc{static storeCallbackInformation(e,t){vc.callbackInformation.set(e,t)}static clearMessages(){vc.callbackInformation.clear()}static deleteMessageInformation(e){vc.callbackInformation.delete(e)}static handleOneWayPerformanceMetrics(e,t,n){const a=e.monotonicTimestamp;a&&n?hc({actionName:e.func,messageDelay:n-a,requestStartedAt:a}):t("Unable to send performance metrics for event %s",e.func)}static handlePerformanceMetrics(e,t,n,a){const i=vc.callbackInformation.get(e);i&&t.monotonicTimestamp&&a?(hc({actionName:i.name,messageDelay:a-t.monotonicTimestamp,requestStartedAt:i.calledAt}),vc.deleteMessageInformation(e)):n("Unable to send performance metrics for callback %s with arguments %o",e.toString(),t.args)}}vc.callbackInformation=new Map;const yc=e=>{const{uuid:t}=e,n=Me(e,["uuid"]),a=null==t?void 0:t.toString();return Object.assign(Object.assign({},n),{uuidAsString:a})},Sc=Si("nestedAppAuthUtils"),Dc=Sc.extend("tryPolyfillWithNestedAppAuthBridge"),Ic=Sc.extend("createNestedAppAuthBridge"),xc=Si("communication");class Cc{}class Oc{}function wc(e,t,...n){return kc(e,t,n).then(([e])=>e)}function Ec(e,t,...n){return kc(e,t,n).then(([e,t])=>{if(!e)throw new Error(t)})}function Ac(e,t,n,...a){return kc(e,t,a).then(([e,t])=>{if(!e)throw new Error(t||n)})}function Lc(e,t,...n){return kc(e,t,n).then(([e,t])=>{if(e)throw e;return t})}function kc(e,t,n){if(!Ii(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);return new Promise(a=>{const i=Vc(e,t,n);var r;a((r=i.uuid,new Promise(e=>{Oc.promiseCallbacks.set(r,e)})))})}function Mc(e){return e.map(e=>function(e){return null!=e&&void 0!==e.serialize&&"function"==typeof e.serialize}(e)?e.serialize():e)}function Pc(e,t,n,a,i){var r;return Pe(this,void 0,void 0,function*(){const o=Mc(t),[s]=yield kc(a,e,o);if(i&&i(s)||!i&&Va(s))throw new Error(`${s.errorCode}, message: ${null!==(r=s.message)&&void 0!==r?r:"None"}`);if(n.validate(s))return n.deserialize(s);throw new Error(`${Da.INTERNAL_ERROR}, message: Invalid response from host - ${JSON.stringify(s)}`)})}function Tc(e,t,n,a){var i;return Pe(this,void 0,void 0,function*(){const r=Mc(t),[o]=yield kc(n,e,r);if(a&&a(o)||!a&&Va(o))throw new Error(`${o.errorCode}, message: ${null!==(i=o.message)&&void 0!==i?i:"None"}`);if(void 0!==o)throw new Error(`${Da.INTERNAL_ERROR}, message: Invalid response from host`)})}function Uc(e,t,n){if(!Ii(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const a=Vc(e,t,n);return i=a.uuid,new Promise((e,t)=>{Oc.portCallbacks.set(i,(n,a)=>{n instanceof MessagePort?e(n):t(a&&a.length>0?a[0]:new Error("Host responded without port or error details."))})});var i}function Fc(e,t,n,a){let i;if(n instanceof Function?a=n:n instanceof Array&&(i=n),!Ii(e))throw Error(`apiVersionTag: ${e} passed in doesn't follow the pattern starting with 'v' followed by digits, then underscore with words, please check.`);const r=Vc(e,t,i);a&&Oc.callbacks.set(r.uuid,a)}Oc.parentMessageQueue=[],Oc.childMessageQueue=[],Oc.topMessageQueue=[],Oc.nextMessageId=0,Oc.callbacks=new Map,Oc.promiseCallbacks=new Map,Oc.portCallbacks=new Map,Oc.legacyMessageIdsToUuidMap={};const Hc=xc.extend("sendNestedAuthRequestToTopWindow");function Rc(e){const t=Hc,n=Cc.topWindow,a=function(e){const t=Oc.nextMessageId++,n=new bi;return Oc.legacyMessageIdsToUuidMap[t]=n,{id:t,uuid:n,func:"nestedAppAuth.execute",timestamp:Date.now(),monotonicTimestamp:_i(),args:[],data:e}}(e);return t("Message %s information: %o",cd(a),{actionName:a.func}),Bc(n,a)}const Nc=xc.extend("sendRequestToTargetWindowHelper");function Bc(e,t){const n=Nc,a=nd(e),i=yc(t);if(Mi.isFramelessWindow)Cc.currentWindow&&Cc.currentWindow.nativeInterface&&(n("Sending message %s to %s via framelessPostMessage interface",cd(i),a),Cc.currentWindow.nativeInterface.framelessPostMessage(JSON.stringify(i)));else{const r=td(e);e&&r?(n("Sending message %s to %s via postMessage",cd(i),a),e.postMessage(i,r)):(n("Adding message %s to %s message queue",cd(i),a),ed(e).push(t))}return t}const jc=xc.extend("sendMessageToParentHelper");function Vc(e,t,n){const a=jc,i=Cc.parentWindow,r=function(e,t,n){const a=Oc.nextMessageId++,i=new bi;return Oc.legacyMessageIdsToUuidMap[a]=i,{id:a,uuid:i,func:t,timestamp:Date.now(),monotonicTimestamp:_i(),args:n||[],apiVersionTag:e}}(e,t,n);return vc.storeCallbackInformation(r.uuid,{name:t,calledAt:r.timestamp}),a("Message %s information: %o",cd(r),{actionName:t,args:n}),Bc(i,r)}const zc=xc.extend("processIncomingMessage"),Gc=xc.extend("processAuthBridgeMessage");function Kc(e,t){var n,a;const i=Gc;if(!e||!e.data||"object"!=typeof e.data)return void i("Unrecognized message format received by app, message being ignored. Message: %o",e);const{args:r}=e.data,[,o]=null!=r?r:[],s=(()=>{try{return JSON.parse(o)}catch(e){return null}})();if(!s||"object"!=typeof s||"NestedAppAuthResponse"!==s.messageType)return void i("Unrecognized data format received by app, message being ignored. Message: %o",e);const c=e.source||(null===(n=null==e?void 0:e.originalEvent)||void 0===n?void 0:n.source),d=e.origin||(null===(a=null==e?void 0:e.originalEvent)||void 0===a?void 0:a.origin);c?qc(c,d)?(Cc.topWindow&&!Cc.topWindow.closed&&c!==Cc.topWindow||(Cc.topWindow=c,Cc.topOrigin=d),Cc.topWindow&&Cc.topWindow.closed&&(Cc.topWindow=null,Cc.topOrigin=null),id(Cc.topWindow),t(o)):i("Message being ignored by app because it is either coming from the current window or a different window with an invalid origin"):i("Message being ignored by app because it is coming for a target that is null")}const Wc=xc.extend("shouldProcessIncomingMessage");function qc(e,t){return Pe(this,void 0,void 0,function*(){if(Cc.currentWindow&&e===Cc.currentWindow)return Wc("Should not process message because it is coming from the current window"),!1;if(Cc.currentWindow&&Cc.currentWindow.location&&t&&t===Cc.currentWindow.location.origin)return!0;{let e;try{e=new URL(t)}catch(e){return Wc("Message has an invalid origin of %s",t),!1}const n=yield function(e){return or().then(t=>{if(!si(e))return ir("Origin %s is invalid because it is not using https protocol. Protocol being used: %s",e,e.protocol),!1;const n=e.host;if(t.some(e=>sr(e,n)))return!0;for(const e of Mi.additionalValidOrigins)if(sr("https://"===e.substring(0,8)?e.substring(8):e,n))return!0;return ir("Origin %s is invalid because it is not an origin approved by this library or included in the call to app.initialize.\nOrigins approved by this library: %o\nOrigins included in app.initialize: %o",e,t,Mi.additionalValidOrigins),!1})}(e);return n||Wc("Message has an invalid origin of %s",t),n}})}const Qc=xc.extend("handleIncomingMessageFromParent");function Yc(e,t){if(t){const n=[...e].find(([e,n])=>e.toString()===t.toString());if(n)return n[0]}}function Jc(e,t){const n=Yc(t,e.uuid);n&&t.delete(n),e.uuid?Oc.legacyMessageIdsToUuidMap={}:delete Oc.legacyMessageIdsToUuidMap[e.id]}function Xc(e){const t=Qc,n=_i();if("id"in e.data&&"number"==typeof e.data.id){const a=(e=>{const{uuidAsString:t}=e,n=Me(e,["uuidAsString"]);return Object.assign(Object.assign({},n),{uuid:t?new bi(t):void 0})})(e.data),i=function(e){const t=Qc;if(!e.uuid)return Oc.legacyMessageIdsToUuidMap[e.id];{const t=e.uuid,n=Yc(Oc.callbacks,t);if(n)return n;const a=Yc(Oc.promiseCallbacks,t);if(a)return a;const i=Yc(Oc.portCallbacks,t);if(i)return i}t("Received message %s that failed to produce a callbackId",cd(e))}(a);if(i){const r=Oc.callbacks.get(i);t("Received a response from parent for message %s",i.toString()),vc.handlePerformanceMetrics(i,a,t,n),r&&(t("Invoking the registered callback for message %s with arguments %o",i.toString(),a.args),r.apply(null,[...a.args,a.isPartialResponse]),function(e){return!0===e.data.isPartialResponse}(e)||(t("Removing registered callback for message %s",i.toString()),Jc(a,Oc.callbacks)));const o=Oc.promiseCallbacks.get(i);o&&(t("Invoking the registered promise callback for message %s with arguments %o",i.toString(),a.args),o(a.args),t("Removing registered promise callback for message %s",i.toString()),Jc(a,Oc.promiseCallbacks));const s=Oc.portCallbacks.get(i);if(s){let n;t("Invoking the registered port callback for message %s with arguments %o",i.toString(),a.args),e.ports&&e.ports[0]instanceof MessagePort&&(n=e.ports[0]),s(n,a.args),t("Removing registered port callback for message %s",i.toString()),Jc(a,Oc.portCallbacks)}a.uuid&&(Oc.legacyMessageIdsToUuidMap={})}}else if("func"in e.data&&"string"==typeof e.data.func){const a=e.data;vc.handleOneWayPerformanceMetrics(a,t,n),t('Received a message from parent %s, action: "%s"',cd(a),a.func),lc(a.func,a.args)}else t("Received an unknown message: %O",e)}const Zc=xc.extend("handleIncomingMessageFromChild");function $c(){return Cc.topWindow!==Cc.parentWindow}function ed(e){return e===Cc.topWindow&&$c()?Oc.topMessageQueue:e===Cc.parentWindow?Oc.parentMessageQueue:e===Cc.childWindow?Oc.childMessageQueue:[]}function td(e){return e===Cc.topWindow&&$c()?Cc.topOrigin:e===Cc.parentWindow?Cc.parentOrigin:e===Cc.childWindow?Cc.childOrigin:null}function nd(e){return e===Cc.topWindow&&$c()?"top":e===Cc.parentWindow?"parent":e===Cc.childWindow?"child":null}const ad=xc.extend("flushMessageQueue");function id(e){const t=td(e),n=ed(e),a=nd(e);for(;e&&t&&n.length>0;){const i=n.shift();if(i){const n=yc(i);ad("Flushing message %s from %s message queue via postMessage.",cd(n),a),e.postMessage(n,t)}}}function rd(e,t){let n;n=Cc.currentWindow.setInterval(()=>{0===ed(e).length&&(clearInterval(n),t())},100)}function od(e,t,n,a){const i=Cc.childWindow,r=function(e,t,n,a){return{id:e,uuid:t,args:n||[],isPartialResponse:a}}(e,t,n,a),o=(e=>{const{uuid:t}=e,n=Me(e,["uuid"]),a=null==t?void 0:t.toString();return Object.assign(Object.assign({},n),{uuidAsString:a})})(r),s=td(i);i&&s&&i.postMessage(o,s)}function sd(e,t){const n=Cc.childWindow,a=function(e,t){return{func:e,args:t||[]}}(e,t),i=td(n);n&&i?n.postMessage(a,i):ed(n).push(a)}function cd(e){return"uuidAsString"in e?`${e.uuidAsString} (legacy id: ${e.id})`:"uuid"in e&&void 0!==e.uuid?`${e.uuid.toString()} (legacy id: ${e.id})`:`legacy id: ${e.id} (no uuid)`}const dd="v1";function ld(e,t){Zi(Ui),Fc(Di(dd,"uploadCustomApp"),"uploadCustomApp",[e],t||ti())}function ud(e,t,n){Zi(Ui),Fc(Di(dd,"sendCustomMessage"),e,t,n)}function fd(e,t){if(Zi(Ui),!Cc.childWindow)throw new Error("The child window has not yet been initialized or is not present");sd(e,t)}function pd(e,t){Zi(Ui),uc(Di(dd,"registerCustomHandler"),e,(...e)=>t.apply(this,e))}function md(e,t){Zi(Ui),uc(Di(dd,"registerUserSettingsChangeHandler"),"userSettingsChange",t,!0,[e])}function _d(e){Zi(Ui,ka.content,ka.task);const t=[e.entityId,e.title,e.description,e.type,e.objectUrl,e.downloadUrl,e.webPreviewUrl,e.webEditUrl,e.baseUrl,e.editFile,e.subEntityId,e.viewerAction,e.fileOpenPreference,e.conversationId,e.sizeInBytes];Fc(Di(dd,"openFilePreview"),"openFilePreview",t)}function hd(e){if(!tr(e)&&Zi(Ui),!tr(e)&&!bd())throw za;e?uc(Di("v1","log.request"),"log.request",()=>{const t=e();Fc(Di("v1","log.receive"),"log.receive",[t])}):fc("log.request")}function bd(){return!(!Zi(Ui)||!Ui.supports.logs)}const gd="v1";function vd(e){return new Promise(t=>{if(Zi(Ui,ka.content),!Dd())throw za;const n=Ec(Di(gd,"conversations.openConversation"),"conversations.openConversation",{title:e.title,subEntityId:e.subEntityId,conversationId:e.conversationId,channelId:e.channelId,entityId:e.entityId});e.onStartConversation&&uc(Di(gd,"conversations.registerStartConversationHandler"),"startConversation",(t,n,a,i)=>{var r;return null===(r=e.onStartConversation)||void 0===r?void 0:r.call(e,{subEntityId:t,conversationId:n,channelId:a,entityId:i})}),e.onCloseConversation&&uc(Di(gd,"conversations.registerCloseConversationHandler"),"closeConversation",(t,n,a,i)=>{var r;return null===(r=e.onCloseConversation)||void 0===r?void 0:r.call(e,{subEntityId:t,conversationId:n,channelId:a,entityId:i})}),t(n)})}function yd(){if(Zi(Ui,ka.content),!Dd())throw za;Fc(Di(gd,"conversations.closeConversation"),"conversations.closeConversation"),fc("startConversation"),fc("closeConversation")}function Sd(){return new Promise(e=>{if(Zi(Ui),!Dd())throw za;e(wc(Di(gd,"conversations.getChatMember"),"getChatMembers"))})}function Dd(){return!(!Zi(Ui)||!Ui.supports.conversations)}const Id=Si("copilot");function xd(){var e,t;return Zi(Ui)&&(!!(null===(e=Ui.hostVersionsInfo)||void 0===e?void 0:e.appEligibilityInformation)||!!(null===(t=Ui.supports.copilot)||void 0===t?void 0:t.eligibility))}function Cd(){var e,t;return Pe(this,void 0,void 0,function*(){if(Zi(Ui),!xd())throw new Error(`Error code: ${za.errorCode}, message: Not supported on platform`);if(null===(e=Ui.hostVersionsInfo)||void 0===e?void 0:e.appEligibilityInformation)return Id("Eligibility information is already available on runtime."),Ui.hostVersionsInfo.appEligibilityInformation;Id("Eligibility information is not available on runtime. Requesting from host.");const n=yield wc(Di("v2","copilot.eligibility.getEligibilityInfo"),"copilot.eligibility.getEligibilityInfo");if(Va(n))throw new Error(`Error code: ${n.errorCode}, message: ${null!==(t=n.message)&&void 0!==t?t:"Failed to get eligibility information from the host."}`);if(!function(e){return void 0!==e.ageGroup&&void 0!==e.cohort&&void 0!==e.userClassification&&void 0!==e.isCopilotEligible&&void 0!==e.isCopilotEnabledRegion&&void 0!==e.isOptedOutByAdmin&&(!e.featureSet||void 0!==e.featureSet.serverFeatures&&void 0!==e.featureSet.uxFeatures)}(n))throw new Error("Error deserializing eligibility information");return n})}const Od="v2";class wd{constructor(e){this.invokeRequest=e}serialize(){return this.invokeRequest}}function Ed(e){const t=e;return t.responseType===kd.ActionExecuteInvokeResponse&&void 0!==t.value&&void 0!==t.statusCode&&void 0!==t.type}const Ad="Action.Execute";var Ld,kd,Md;!function(e){e.ActionExecuteInvokeRequest="ActionExecuteInvokeRequest",e.QueryMessageExtensionRequest="QueryMessageExtensionRequest"}(Ld||(Ld={})),function(e){e.ActionExecuteInvokeResponse="ActionExecuteInvokeResponse",e.QueryMessageExtensionResponse="QueryMessageExtensionResponse"}(kd||(kd={}));class Pd extends Wo{validate(e){return Ed(e)}deserialize(e){return e}}function Td(e){if("object"!=typeof e||null===e)return!1;const t=e;return Object.values(Md).includes(t.errorCode)&&(void 0===t.message||"string"==typeof t.message)}function Ud(e){e.requestType===Ld.ActionExecuteInvokeRequest?Fd(e):e.requestType===Ld.QueryMessageExtensionRequest&&function(e){if(e.commandId.length>64)throw new Error("originalRequestInfo.commandId exceeds the maximum size of 64 characters");if(e.parameters.length>5)throw new Error("originalRequestInfo.parameters exceeds the maximum size of 5");for(const t of e.parameters){if(t.name.length>64)throw new Error("originalRequestInfo.parameters.name exceeds the maximum size of 64 characters");if(t.value.length>512)throw new Error("originalRequestInfo.parameters.value exceeds the maximum size of 512 characters")}}(e)}function Fd(e){if(e.type!==Ad)throw{errorCode:Md.INTERNAL_ERROR,message:`Invalid action type ${e.type}. Action type must be "${Ad}"`};if(!hi(e.data))throw{errorCode:Md.INTERNAL_ERROR,message:`Invalid data type ${typeof e.data}. Data must be a primitive or a plain object.`}}function Hd(e,t,n){if(Zi(Ui,ka.content),!Vd())throw za;const a=new nr(e);return Ud(n),kc(Di(Od,"externalAppAuthentication.authenticateAndResendRequest"),"externalAppAuthentication.authenticateAndResendRequest",[a.toString(),n,t.url.href,t.width,t.height,t.isExternal]).then(([e,t])=>{if(e&&null!=t.responseType)return t;throw t})}function Rd(e,t){if(Zi(Ui,ka.content),!Vd())throw za;const n=new nr(e);return kc(Di(Od,"externalAppAuthentication.authenticateWithSSO"),"externalAppAuthentication.authenticateWithSSO",[n.toString(),t.claims,t.silent]).then(([e,t])=>{if(!e)throw t})}function Nd(e,t,n){if(Zi(Ui,ka.content),!Vd())throw za;const a=new nr(e);return Ud(n),kc(Di(Od,"externalAppAuthentication.authenticateWithSSOAndResendRequest"),"externalAppAuthentication.authenticateWithSSOAndResendRequest",[a.toString(),n,t.claims,t.silent]).then(([e,t])=>{if(e&&null!=t.responseType)return t;throw t})}function Bd(e,t,n){if(Zi(Ui,ka.content),!Vd())throw za;return li(e,new Error("titleId is Invalid.")),li(t,new Error("oauthConfigId is Invalid.")),kc(Di(Od,"externalAppAuthentication.authenticateWithOauth2"),"externalAppAuthentication.authenticateWithOauth2",[e,t,n.width,n.height,n.isExternal]).then(([e,t])=>{if(!e)throw t})}function jd(e,t,n){if(Zi(Ui,ka.content),!Vd())throw za;return li(e,new Error("titleId is Invalid.")),t&&ui(t),kc(Di(Od,"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins"),"externalAppAuthentication.authenticateWithPowerPlatformConnectorPlugins",[e,null==t?void 0:t.toString(),null==n?void 0:n.width,null==n?void 0:n.height,null==n?void 0:n.isExternal]).then(([e,t])=>{if(!e)throw t})}function Vd(){return!(!Zi(Ui)||!Ui.supports.externalAppAuthentication)}!function(e){e.INTERNAL_ERROR="INTERNAL_ERROR"}(Md||(Md={}));const zd="v2";function Gd(e,t,n){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!Qd())throw za;return Yd(e,t),Tc("externalAppAuthenticationForCEA.authenticateWithSSO",[e,t,n.claims,n.silent],Di(zd,"externalAppAuthenticationForCEA.authenticateWithSSO"),Td)})}function Kd(e,t,n){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!Qd())throw za;return Yd(e,t),Tc("externalAppAuthenticationForCEA.authenticateWithOauth",[e,t,n.url.href,n.width,n.height,n.isExternal],Di(zd,"externalAppAuthenticationForCEA.authenticateWithOauth"),Td)})}function Wd(e,t,n,a){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!Qd())throw za;return Yd(e,t),Fd(a),Pc("externalAppAuthenticationForCEA.authenticateAndResendRequest",[e,t,new wd(a),n.url.href,n.width,n.height,n.isExternal],new Pd,Di(zd,"externalAppAuthenticationForCEA.authenticateAndResendRequest"),Td)})}function qd(e,t,n,a){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!Qd())throw za;return Yd(e,t),Fd(a),Pc("externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest",[e,t,new wd(a),n.claims,n.silent],new Pd,Di(zd,"externalAppAuthenticationForCEA.authenticateWithSSOAndResendRequest"),Td)})}function Qd(){return!(!Zi(Ui)||!Ui.supports.externalAppAuthenticationForCEA)}function Yd(e,t){li(t,new Error("conversation id is not valid.")),function(e){if(!(e instanceof nr))throw new Error(`Potential app id (${e}) is invalid; it is not an instance of AppId class.`)}(e)}var Jd,Xd;function Zd(e,t){if(Zi(Ui,ka.content),!el())throw za;const n=new nr(e);return kc(Di("v2","externalAppCardActions.processActionSubmit"),"externalAppCardActions.processActionSubmit",[n.toString(),t]).then(([e,t])=>{if(!e)throw t})}function $d(e,t,n){if(Zi(Ui,ka.content),!el())throw za;const a=new nr(e);return kc(Di("v2","externalAppCardActions.processActionOpenUrl"),"externalAppCardActions.processActionOpenUrl",[a.toString(),t.href,n]).then(([e,t])=>{if(e)throw e;return t})}function el(){return!(!Zi(Ui)||!Ui.supports.externalAppCardActions)}function tl(e,t,n){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!al())throw za;Yd(e,t);const[a,i]=yield kc(Di("v2","externalAppCardActionsForCEA.processActionOpenUrl"),"externalAppCardActionsForCEA.processActionOpenUrl",[e.toString(),t,n.href]);if(a)throw a;return i})}function nl(e,t,n){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!al())throw za;Yd(e,t);const a=yield wc(Di("v2","externalAppCardActionsForCEA.processActionSubmit"),"externalAppCardActionsForCEA.processActionSubmit",e.toString(),t,n);if(a)throw a})}function al(){return!(!Zi(Ui)||!Ui.supports.externalAppCardActionsForCEA)}function il(e,t,n){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content),!rl())throw za;const a=new nr(e),[i,r]=yield kc(Di("v2","externalAppCommands.processActionCommand"),"externalAppCommands.processActionCommand",[a.toString(),t,n]);if(i)throw i;return r})}function rl(){return!(!Zi(Ui)||!Ui.supports.externalAppCommands)}!function(e){e.DeepLinkDialog="DeepLinkDialog",e.DeepLinkOther="DeepLinkOther",e.DeepLinkStageView="DeepLinkStageView",e.GenericUrl="GenericUrl"}(Jd||(Jd={})),function(e){e.INTERNAL_ERROR="INTERNAL_ERROR",e.INVALID_LINK="INVALID_LINK",e.NOT_SUPPORTED="NOT_SUPPORTED"}(Xd||(Xd={}));const ol="v1";var sl,cl,dl,ll,ul,fl;function pl(e,t){if(Zi(Ui,ka.content),!e||0===e.length)throw new Error("[files.getCloudStorageFolders] channelId name cannot be null or empty");if(!t)throw new Error("[files.getCloudStorageFolders] Callback cannot be null");Fc(Di(ol,"files.getCloudStorageFolders"),"files.getCloudStorageFolders",[e],t)}function ml(e,t){if(Zi(Ui,ka.content),!e||0===e.length)throw new Error("[files.addCloudStorageFolder] channelId name cannot be null or empty");if(!t)throw new Error("[files.addCloudStorageFolder] Callback cannot be null");Fc(Di(ol,"files.addCloudStorageFolder"),"files.addCloudStorageFolder",[e],t)}function _l(e,t,n){if(Zi(Ui,ka.content),!e)throw new Error("[files.deleteCloudStorageFolder] channelId name cannot be null or empty");if(!t)throw new Error("[files.deleteCloudStorageFolder] folderToDelete cannot be null or empty");if(!n)throw new Error("[files.deleteCloudStorageFolder] Callback cannot be null");Fc(Di(ol,"files.deleteCloudStorageFolder"),"files.deleteCloudStorageFolder",[e,t],n)}function hl(e,t,n){if(Zi(Ui,ka.content),!e||!t)throw new Error("[files.getCloudStorageFolderContents] folder/providerCode name cannot be null or empty");if(!n)throw new Error("[files.getCloudStorageFolderContents] Callback cannot be null");if("isSubdirectory"in e&&!e.isSubdirectory)throw new Error("[files.getCloudStorageFolderContents] provided folder is not a subDirectory");Fc(Di(ol,"files.getCloudStorageFolderContents"),"files.getCloudStorageFolderContents",[e,t],n)}function bl(e,t,n){if(Zi(Ui,ka.content),!e||!t)throw new Error("[files.openCloudStorageFile] file/providerCode cannot be null or empty");if(e.isSubdirectory)throw new Error("[files.openCloudStorageFile] provided file is a subDirectory");Fc(Di(ol,"files.openCloudStorageFile"),"files.openCloudStorageFile",[e,t,n])}function gl(e=!1,t){if(Zi(Ui,ka.content),!t)throw new Error("[files.getExternalProviders] Callback cannot be null");Fc(Di(ol,"files.getExternalProviders"),"files.getExternalProviders",[e],t)}function vl(e,t,n,a,i=!1,r){if(Zi(Ui,ka.content),!e||0===e.length)throw new Error("[files.copyMoveFiles] selectedFiles cannot be null or empty");if(!t)throw new Error("[files.copyMoveFiles] providerCode cannot be null or empty");if(!n)throw new Error("[files.copyMoveFiles] destinationFolder cannot be null or empty");if(!a)throw new Error("[files.copyMoveFiles] destinationProviderCode cannot be null or empty");if(!r)throw new Error("[files.copyMoveFiles] callback cannot be null");Fc(Di(ol,"files.copyMoveFiles"),"files.copyMoveFiles",[e,t,n,a,i],r)}function yl(e){if(Zi(Ui,ka.content),!e)throw new Error("[files.getFileDownloads] Callback cannot be null");Fc(Di(ol,"files.getFileDownloads"),"files.getFileDownloads",[],e)}function Sl(e,t){if(Zi(Ui,ka.content),!t)throw new Error("[files.openDownloadFolder] Callback cannot be null");Fc(Di(ol,"files.openDownloadFolder"),"files.openDownloadFolder",[e],t)}function Dl(e){if(Zi(Ui,ka.content),!e)throw kl(Da.INVALID_ARGUMENTS,"[files.addCloudStorageProvider] callback cannot be null");Fc(Di(ol,"files.addCloudStorageProvider"),"files.addCloudStorageProvider",[],e)}function Il(e,t){if(Zi(Ui,ka.content),!t)throw kl(Da.INVALID_ARGUMENTS,"[files.removeCloudStorageProvider] callback cannot be null");if(!e||!e.content)throw kl(Da.INVALID_ARGUMENTS,"[files.removeCloudStorageProvider] 3P cloud storage provider request content is missing");Fc(Di(ol,"files.removeCloudStorageProvider"),"files.removeCloudStorageProvider",[e],t)}function xl(e,t){if(Zi(Ui,ka.content),!t)throw kl(Da.INVALID_ARGUMENTS,"[files.addCloudStorageProviderFile] callback cannot be null");if(!e||!e.content)throw kl(Da.INVALID_ARGUMENTS,"[files.addCloudStorageProviderFile] 3P cloud storage provider request content is missing");Fc(Di(ol,"files.addCloudStorageProviderFile"),"files.addCloudStorageProviderFile",[e],t)}function Cl(e,t){if(Zi(Ui,ka.content),!t)throw kl(Da.INVALID_ARGUMENTS,"[files.renameCloudStorageProviderFile] callback cannot be null");if(!e||!e.content)throw kl(Da.INVALID_ARGUMENTS,"[files.renameCloudStorageProviderFile] 3P cloud storage provider request content is missing");Fc(Di(ol,"files.renameCloudStorageProviderFile"),"files.renameCloudStorageProviderFile",[e],t)}function Ol(e,t){if(Zi(Ui,ka.content),!t)throw kl(Da.INVALID_ARGUMENTS,"[files.deleteCloudStorageProviderFile] callback cannot be null");if(!(e&&e.content&&e.content.itemList&&e.content.itemList.length>0))throw kl(Da.INVALID_ARGUMENTS,"[files.deleteCloudStorageProviderFile] 3P cloud storage provider request content details are missing");Fc(Di(ol,"files.deleteCloudStorageProviderFile"),"files.deleteCloudStorageProviderFile",[e],t)}function wl(e,t){if(Zi(Ui,ka.content),!t)throw kl(Da.INVALID_ARGUMENTS,"[files.downloadCloudStorageProviderFile] callback cannot be null");if(!(e&&e.content&&e.content.itemList&&e.content.itemList.length>0))throw kl(Da.INVALID_ARGUMENTS,"[files.downloadCloudStorageProviderFile] 3P cloud storage provider request content details are missing");Fc(Di(ol,"files.downloadCloudStorageProviderFile"),"files.downloadCloudStorageProviderFile",[e],t)}function El(e,t){if(Zi(Ui,ka.content),!t)throw kl(Da.INVALID_ARGUMENTS,"[files.uploadCloudStorageProviderFile] callback cannot be null");if(!(e&&e.content&&e.content.itemList&&e.content.itemList.length>0))throw kl(Da.INVALID_ARGUMENTS,"[files.uploadCloudStorageProviderFile] 3P cloud storage provider request content details are missing");if(!e.content.destinationFolder)throw kl(Da.INVALID_ARGUMENTS,"[files.uploadCloudStorageProviderFile] Invalid destination folder details");Fc(Di(ol,"files.uploadCloudStorageProviderFile"),"files.uploadCloudStorageProviderFile",[e],t)}function Al(e){if(Zi(Ui),!e)throw new Error("[registerCloudStorageProviderListChangeHandler] Handler cannot be null");uc(Di(ol,"files.registerCloudStorageProviderListChangeHandler"),"files.cloudStorageProviderListChange",e)}function Ll(e){if(Zi(Ui),!e)throw new Error("[registerCloudStorageProviderContentChangeHandler] Handler cannot be null");uc(Di(ol,"files.registerCloudStorageProviderContentChangeHandler"),"files.cloudStorageProviderContentChange",e)}function kl(e,t){return{errorCode:e,message:t}}!function(e){e.Dropbox="DROPBOX",e.Box="BOX",e.Sharefile="SHAREFILE",e.GoogleDrive="GOOGLEDRIVE",e.Egnyte="EGNYTE",e.SharePoint="SharePoint"}(sl||(sl={})),function(e){e[e.Sharepoint=0]="Sharepoint",e[e.WopiIntegration=1]="WopiIntegration",e[e.Google=2]="Google",e[e.OneDrive=3]="OneDrive",e[e.Recent=4]="Recent",e[e.Aggregate=5]="Aggregate",e[e.FileSystem=6]="FileSystem",e[e.Search=7]="Search",e[e.AllFiles=8]="AllFiles",e[e.SharedWithMe=9]="SharedWithMe"}(cl||(cl={})),function(e){e.ClassMaterials="classMaterials"}(dl||(dl={})),function(e){e.Readonly="readonly"}(ll||(ll={})),function(e){e.Downloaded="Downloaded",e.Downloading="Downloading",e.Failed="Failed"}(ul||(ul={})),function(e){e.Download="DOWNLOAD",e.Upload="UPLOAD",e.Delete="DELETE"}(fl||(fl={}));const Ml="v1";function Pl(){return new Promise(e=>{if(Zi(Ui),!Hl())throw za;e(Lc(Di(Ml,"meetingRoom.getPairedMeetingRoomInfo"),"meetingRoom.getPairedMeetingRoomInfo"))})}function Tl(e){return new Promise(t=>{if(!e||0==e.length)throw new Error("[meetingRoom.sendCommandToPairedMeetingRoom] Command name cannot be null or empty");if(Zi(Ui),!Hl())throw za;t(Lc(Di(Ml,"meetingRoom.sendCommandToPairedMeetingRoom"),"meetingRoom.sendCommandToPairedMeetingRoom",e))})}function Ul(e){if(!e)throw new Error("[meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler] Handler cannot be null");if(Zi(Ui),!Hl())throw za;uc(Di(Ml,"meetingRoom.registerMeetingRoomCapabilitiesUpdateHandler"),"meetingRoom.meetingRoomCapabilitiesUpdate",t=>{Zi(Ui),e(t)})}function Fl(e){if(!e)throw new Error("[meetingRoom.registerMeetingRoomStatesUpdateHandler] Handler cannot be null");if(Zi(Ui),!Hl())throw za;uc(Di(Ml,"meetingRoom.registerMeetingRoomStatesUpdateHandler"),"meetingRoom.meetingRoomStatesUpdate",t=>{Zi(Ui),e(t)})}function Hl(){return!(!Zi(Ui)||!Ui.supports.meetingRoom)}function Rl(){return!(!Zi(Ui)||!Ui.supports.messageChannels)}function Nl(e){if(Zi(Ui,ka.content),!Bl())throw za;Fc(Di("v1","notifications.showNotification"),"notifications.showNotification",[e])}function Bl(){return!(!Zi(Ui)||!Ui.supports.notifications)}const jl="v2";function Vl(e){if(!Kl())throw new Error(Da.NOT_SUPPORTED_ON_PLATFORM.toString());if(tr(e))throw new Error(Da.INVALID_ARGUMENTS.toString());uc(Di(jl,"otherApp.install"),"otherApp.install",e)}function zl(){if(!Kl())throw new Error(Da.NOT_SUPPORTED_ON_PLATFORM.toString());Fc(Di(jl,"otherApp.unregisterInstall"),"otherApp.unregisterInstall"),fc("otherApp.install")}function Gl(e){if(!Kl())throw new Error(Da.NOT_SUPPORTED_ON_PLATFORM.toString());return Tc("otherApp.notifyInstallCompleted",[e.toString()],Di(jl,"otherApp.notifyInstallCompleted"))}function Kl(){return!(!Zi(Ui)||!Ui.supports.otherAppStateChange)}const Wl="v1";var ql,Ql,Yl,Jl;function Xl(e){if(!e)throw new Error("[remoteCamera.getCapableParticipants] Callback cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;Fc(Di(Wl,"remoteCamera.getCapableParticipants"),"remoteCamera.getCapableParticipants",e)}function Zl(e,t){if(!e)throw new Error("[remoteCamera.requestControl] Participant cannot be null");if(!t)throw new Error("[remoteCamera.requestControl] Callback cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;Fc(Di(Wl,"remoteCamera.requestControl"),"remoteCamera.requestControl",[e],t)}function $l(e,t){if(!e)throw new Error("[remoteCamera.sendControlCommand] ControlCommand cannot be null");if(!t)throw new Error("[remoteCamera.sendControlCommand] Callback cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;Fc(Di(Wl,"remoteCamera.sendControlCommand"),"remoteCamera.sendControlCommand",[e],t)}function eu(e){if(!e)throw new Error("[remoteCamera.terminateSession] Callback cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;Fc(Di(Wl,"remoteCamera.terminateSession"),"remoteCamera.terminateSession",e)}function tu(e){if(!e)throw new Error("[remoteCamera.registerOnCapableParticipantsChangeHandler] Handler cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;uc(Di(Wl,"remoteCamera.registerOnCapableParticipantsChangeHandler"),"remoteCamera.capableParticipantsChange",e)}function nu(e){if(!e)throw new Error("[remoteCamera.registerOnErrorHandler] Handler cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;uc(Di(Wl,"remoteCamera.registerOnErrorHandler"),"remoteCamera.handlerError",e)}function au(e){if(!e)throw new Error("[remoteCamera.registerOnDeviceStateChangeHandler] Handler cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;uc(Di(Wl,"remoteCamera.registerOnDeviceStateChangeHandler"),"remoteCamera.deviceStateChange",e)}function iu(e){if(!e)throw new Error("[remoteCamera.registerOnSessionStatusChangeHandler] Handler cannot be null");if(Zi(Ui,ka.sidePanel),!ru())throw za;uc(Di(Wl,"remoteCamera.registerOnSessionStatusChangeHandler"),"remoteCamera.sessionStatusChange",e)}function ru(){return!(!Zi(Ui)||!Ui.supports.remoteCamera)}function ou(e,t,n,a){if(Zi(Ui,ka.content),!su())throw za;if(!e||0==e.length)throw new Error("[appEntity.selectAppEntity] threadId name cannot be null or empty");if(!a)throw new Error("[appEntity.selectAppEntity] Callback cannot be null");Fc(Di("v1","appEntity.selectAppEntity"),"appEntity.selectAppEntity",[e,t,n],a)}function su(){return!(!Zi(Ui)||!Ui.supports.appEntity)}function cu(e){return new Promise(t=>{if(Zi(Ui),!du())throw za;if((Mi.hostClientType===Aa.android||Mi.hostClientType===Aa.teamsRoomsAndroid||Mi.hostClientType===Aa.teamsPhones||Mi.hostClientType===Aa.teamsDisplays)&&!$i("2.0.1")){const e={errorCode:Da.OLD_PLATFORM};throw new Error(JSON.stringify(e))}t(wc(Di("v1","teams.fullTrust.joinedTeams.getUserJoinedTeams"),"getUserJoinedTeams",e))})}function du(){return!!(Zi(Ui)&&Ui.supports.teams&&Ui.supports.teams.fullTrust&&Ui.supports.teams.fullTrust.joinedTeams)}function lu(e){return new Promise(t=>{if(Zi(Ui),!uu())throw za;t(wc(Di("v1","teams.fullTrust.getConfigSetting"),"getConfigSetting",e))})}function uu(){return!(!Zi(Ui)||!Ui.supports.teams||!Ui.supports.teams.fullTrust)}function fu(e,t){if(Zi(Ui,ka.content),!mu())throw za;if(!e)throw new Error("[teams.getTeamChannels] groupId cannot be null or empty");if(!t)throw new Error("[teams.getTeamChannels] Callback cannot be null");Fc(Di("v1","teams.getTeamChannels"),"teams.getTeamChannels",[e],t)}function pu(e,t){if(Zi(Ui),!mu())throw za;if(!e)throw new Error("[teams.refreshSiteUrl] threadId cannot be null or empty");if(!t)throw new Error("[teams.refreshSiteUrl] Callback cannot be null");Fc(Di("v1","teams.refreshSiteUrl"),"teams.refreshSiteUrl",[e],t)}function mu(){return!(!Zi(Ui)||!Ui.supports.teams)}!function(e){e.Reset="Reset",e.ZoomIn="ZoomIn",e.ZoomOut="ZoomOut",e.PanLeft="PanLeft",e.PanRight="PanRight",e.TiltUp="TiltUp",e.TiltDown="TiltDown"}(ql||(ql={})),function(e){e[e.CommandResetError=0]="CommandResetError",e[e.CommandZoomInError=1]="CommandZoomInError",e[e.CommandZoomOutError=2]="CommandZoomOutError",e[e.CommandPanLeftError=3]="CommandPanLeftError",e[e.CommandPanRightError=4]="CommandPanRightError",e[e.CommandTiltUpError=5]="CommandTiltUpError",e[e.CommandTiltDownError=6]="CommandTiltDownError",e[e.SendDataError=7]="SendDataError"}(Ql||(Ql={})),function(e){e[e.None=0]="None",e[e.ControlDenied=1]="ControlDenied",e[e.ControlNoResponse=2]="ControlNoResponse",e[e.ControlBusy=3]="ControlBusy",e[e.AckTimeout=4]="AckTimeout",e[e.ControlTerminated=5]="ControlTerminated",e[e.ControllerTerminated=6]="ControllerTerminated",e[e.DataChannelError=7]="DataChannelError",e[e.ControllerCancelled=8]="ControllerCancelled",e[e.ControlDisabled=9]="ControlDisabled",e[e.ControlTerminatedToAllowOtherController=10]="ControlTerminatedToAllowOtherController"}(Yl||(Yl={})),function(e){e[e.Regular=0]="Regular",e[e.Private=1]="Private",e[e.Shared=2]="Shared"}(Jl||(Jl={}));class _u{static setTimeout(e,t){const n=performance.now(),a=ai();return _u.setTimeoutCallbacks[a]={callback:e,timeoutInMs:t,startedAtInMs:n},a}static clearTimeout(e){delete _u.setTimeoutCallbacks[e]}static setInterval(e,t){_u.setTimeout(function n(){e(),_u.setTimeout(n,t)},t)}static tick(){const e=performance.now(),t=[];for(const n in _u.setTimeoutCallbacks){const a=_u.setTimeoutCallbacks[n];e-a.startedAtInMs>=a.timeoutInMs&&t.push(n)}for(const e of t)_u.setTimeoutCallbacks[e].callback(),delete _u.setTimeoutCallbacks[e]}}_u.setTimeoutCallbacks={};class hu{constructor(e,t){this.reportStatisticsResult=t,this.sampleCount=0,this.distributionBins=new Uint32Array(e)}processStarts(e,t,n,a){_u.tick(),this.suitableForThisSession(e,t,n,a)||this.reportAndResetSession(this.getStatistics(),e,a,t,n),this.start()}processEnds(){const e=performance.now()-this.frameProcessingStartedAt,t=Math.floor(Math.max(0,Math.min(this.distributionBins.length-1,e)));this.distributionBins[t]+=1,this.sampleCount+=1}getStatistics(){return this.currentSession?{effectId:this.currentSession.effectId,effectParam:this.currentSession.effectParam,frameHeight:this.currentSession.frameHeight,frameWidth:this.currentSession.frameWidth,duration:performance.now()-this.currentSession.startedAtInMs,sampleCount:this.sampleCount,distributionBins:this.distributionBins.slice()}:null}start(){this.frameProcessingStartedAt=performance.now()}suitableForThisSession(e,t,n,a){return this.currentSession&&this.currentSession.effectId===e&&this.currentSession.effectParam===a&&this.currentSession.frameWidth===t&&this.currentSession.frameHeight===n}reportAndResetSession(e,t,n,a,i){e&&this.reportStatisticsResult(e),this.resetCurrentSession(this.getNextTimeout(t,this.currentSession),t,n,a,i),this.timeoutId&&_u.clearTimeout(this.timeoutId),this.timeoutId=_u.setTimeout((()=>this.reportAndResetSession(this.getStatistics(),t,n,a,i)).bind(this),this.currentSession.timeoutInMs)}resetCurrentSession(e,t,n,a,i){this.currentSession={startedAtInMs:performance.now(),timeoutInMs:e,effectId:t,effectParam:n,frameWidth:a,frameHeight:i},this.sampleCount=0,this.distributionBins.fill(0)}getNextTimeout(e,t){return t&&t.effectId===e?Math.min(hu.maxSessionTimeoutInMs,2*t.timeoutInMs):hu.initialSessionTimeoutInMs}}hu.initialSessionTimeoutInMs=1e3,hu.maxSessionTimeoutInMs=3e4;const bu="v2";class gu{constructor(e){this.reportPerformanceEvent=e,this.isFirstFrameProcessed=!1,this.frameProcessTimeLimit=100,this.frameProcessingStartedAt=0,this.frameProcessingTimeCost=0,this.processedFrameCount=0,this.performanceStatistics=new hu(gu.distributionBinSize,e=>this.reportPerformanceEvent(Di(bu,"videoPerformanceMonitor.performanceDataGenerated"),"video.performance.performanceDataGenerated",[e]))}startMonitorSlowFrameProcessing(){_u.setInterval(()=>{if(0===this.processedFrameCount)return;const e=this.frameProcessingTimeCost/this.processedFrameCount;e>this.frameProcessTimeLimit&&this.reportPerformanceEvent(Di(bu,"videoPerformanceMonitor.startMonitorSlowFrameProcessing"),"video.performance.frameProcessingSlow",[e]),this.frameProcessingTimeCost=0,this.processedFrameCount=0},gu.calculateFPSInterval)}setFrameProcessTimeLimit(e){this.frameProcessTimeLimit=e}reportApplyingVideoEffect(e,t){var n,a;(null===(n=this.applyingEffect)||void 0===n?void 0:n.effectId)===e&&(null===(a=this.applyingEffect)||void 0===a?void 0:a.effectParam)===t||(this.applyingEffect={effectId:e,effectParam:t},this.appliedEffect=void 0)}reportVideoEffectChanged(e,t){void 0===this.applyingEffect||this.applyingEffect.effectId!==e&&this.applyingEffect.effectParam!==t||(this.appliedEffect={effectId:e,effectParam:t},this.applyingEffect=void 0,this.isFirstFrameProcessed=!1)}reportStartFrameProcessing(e,t){_u.tick(),this.appliedEffect&&(this.frameProcessingStartedAt=performance.now(),this.performanceStatistics.processStarts(this.appliedEffect.effectId,e,t,this.appliedEffect.effectParam))}reportFrameProcessed(){var e;this.appliedEffect&&(this.processedFrameCount++,this.frameProcessingTimeCost+=performance.now()-this.frameProcessingStartedAt,this.performanceStatistics.processEnds(),this.isFirstFrameProcessed||(this.isFirstFrameProcessed=!0,this.reportPerformanceEvent(Di(bu,"videoPerformanceMonitor.reportFrameProcessed"),"video.performance.firstFrameProcessed",[Date.now(),this.appliedEffect.effectId,null===(e=this.appliedEffect)||void 0===e?void 0:e.effectParam])))}reportGettingTextureStream(e){this.gettingTextureStreamStartedAt=performance.now(),this.currentStreamId=e}reportTextureStreamAcquired(){if(void 0!==this.gettingTextureStreamStartedAt){const e=performance.now()-this.gettingTextureStreamStartedAt;this.reportPerformanceEvent(Di(bu,"videoPerformanceMonitor.reportTextureStreamAcquired"),"video.performance.textureStreamAcquired",[this.currentStreamId,e])}}}gu.distributionBinSize=1e3,gu.calculateFPSInterval=1e3;const vu="v2",yu=di()?void 0:new gu(Fc);var Su,Du,Iu;function xu(e){if(Zi(Ui,ka.sidePanel),!Eu())throw za;if(!e.videoFrameHandler||!e.videoBufferHandler)throw new Error("Both videoFrameHandler and videoBufferHandler must be provided");if(uc(Di(vu,"videoEffects.setFrameProcessTimeLimitHandler"),"video.setFrameProcessTimeLimit",e=>null==yu?void 0:yu.setFrameProcessTimeLimit(e.timeLimit),!1),Au())!function(e,t){if(Zi(Ui,ka.sidePanel),!Eu()||!Au())throw za;uc(Di(vu,"videoEffects.startVideoExtensibilityVideoStreamHandler"),"video.startVideoExtensibilityVideoStream",t=>Pe(this,void 0,void 0,function*(){const{streamId:n}=t,a=function(e,t){return n=>Pe(this,void 0,void 0,function*(){const a=n.videoFrame;null==t||t.reportStartFrameProcessing(a.codedWidth,a.codedHeight);const i=yield e(n);return null==t||t.reportFrameProcessed(),i})}(e,yu);yield Mu(n,a,wu,yu)}),!1),Fc(Di(vu,"videoEffects.mediaStream.registerForVideoFrame"),"video.mediaStream.registerForVideoFrame",[t])}(e.videoFrameHandler,e.config);else{if(!Lu())throw za;!function(e,t){if(Zi(Ui,ka.sidePanel),!Eu()||!Lu())throw za;uc(Di(vu,"videoEffects.registerForVideoBufferHandler"),"video.newVideoFrame",t=>{if(t){const n=t.timestamp;null==yu||yu.reportStartFrameProcessing(t.width,t.height),e(function(e){if("videoFrameBuffer"in e)return e;{const{data:t}=e,n=Me(e,["data"]);return Object.assign(Object.assign({},n),{videoFrameBuffer:t})}}(t),()=>{null==yu||yu.reportFrameProcessed(),function(e){Fc(Di(vu,"videoEffects.notifyVideoFrameProcessed"),"video.videoFrameProcessed",[e])}(n)},wu)}},!1),Fc(Di(vu,"videoEffects.registerForVideoFrame"),"video.registerForVideoFrame",[t])}(e.videoBufferHandler,e.config)}null==yu||yu.startMonitorSlowFrameProcessing()}function Cu(e,t){if(Zi(Ui,ka.sidePanel),!Eu())throw za;Fc(Di(vu,"videoEffects.notifySelectedVideoEffectChanged"),"video.videoEffectChanged",[e,t])}function Ou(e){if(Zi(Ui,ka.sidePanel),!Eu())throw za;uc(Di(vu,"videoEffects.registerEffectParameterChangeHandler"),"video.effectParameterChange",Bu(e,yu),!1),Fc(Di(vu,"videoEffects.registerForVideoEffect"),"video.registerForVideoEffect")}function wu(e){Fc(Di(vu,"videoEffects.notifyError"),"video.notifyError",[e])}function Eu(){return Zi(Ui)&&!!Ui.supports.video&&(!!Ui.supports.video.mediaStream||!!Ui.supports.video.sharedFrame)}function Au(){var e;return Zi(Ui,ka.sidePanel)&&function(){var e,t,n,a;return!(!(null===(t=null===(e=ci().chrome)||void 0===e?void 0:e.webview)||void 0===t?void 0:t.getTextureStream)||!(null===(a=null===(n=ci().chrome)||void 0===n?void 0:n.webview)||void 0===a?void 0:a.registerTextureStream))}()&&!!(null===(e=Ui.supports.video)||void 0===e?void 0:e.mediaStream)}function Lu(){var e;return Zi(Ui,ka.sidePanel)&&!!(null===(e=Ui.supports.video)||void 0===e?void 0:e.sharedFrame)}!function(e){e.NV12="NV12"}(Su||(Su={})),function(e){e.EffectChanged="EffectChanged",e.EffectDisabled="EffectDisabled"}(Du||(Du={})),function(e){e.InvalidEffectId="InvalidEffectId",e.InitializationFailure="InitializationFailure"}(Iu||(Iu={}));const ku="v2";function Mu(e,t,n,a){var i,r;return Pe(this,void 0,void 0,function*(){const o=Tu();!di()&&(null===(r=null===(i=window.chrome)||void 0===i?void 0:i.webview)||void 0===r||r.registerTextureStream(e,o)),Uu(yield Pu(e,n,a),new Fu(n,t),o.writable)})}function Pu(e,t,n){return Pe(this,void 0,void 0,function*(){if(di())throw za;const a=ci().chrome;try{null==n||n.reportGettingTextureStream(e);const t=(yield a.webview.getTextureStream(e)).getVideoTracks();if(0===t.length)throw new Error(`No video track in stream ${e}`);return null==n||n.reportTextureStreamAcquired(),t[0]}catch(a){throw t(`Failed to get video track from stream ${e}, error: ${a}`),new Error(`Internal error: can't get video track from stream ${e}`)}})}function Tu(){if(di())throw za;const e=window.MediaStreamTrackGenerator;if(!e)throw za;return new e({kind:"video"})}function Uu(e,t,n){new(0,ci().MediaStreamTrackProcessor)({track:e}).readable.pipeThrough(new TransformStream(t)).pipeTo(n)}class Fu{constructor(e,t){this.notifyError=e,this.videoFrameHandler=t,this.transform=(e,t)=>Pe(this,void 0,void 0,function*(){const n=e.timestamp;if(null!==n)try{const a=yield this.videoFrameHandler({videoFrame:e}),i=new VideoFrame(a,{timestamp:n});t.enqueue(i),e.close(),a.close()}catch(n){e.close(),this.notifyError(n)}else this.notifyError("timestamp of the original video frame is null")})}}class Hu{constructor(e,t){if(this.headerBuffer=e,this.notifyError=t,this.ONE_TEXTURE_INPUT_ID=1869900081,this.INVALID_HEADER_ERROR="Invalid video frame header",this.UNSUPPORTED_LAYOUT_ERROR="Unsupported texture layout",this.headerDataView=new Uint32Array(e),this.headerDataView.length<8)throw this.notifyError(this.INVALID_HEADER_ERROR),new Error(this.INVALID_HEADER_ERROR);if(this.headerDataView[0]!==this.ONE_TEXTURE_INPUT_ID)throw this.notifyError(this.UNSUPPORTED_LAYOUT_ERROR),new Error(this.UNSUPPORTED_LAYOUT_ERROR)}get oneTextureLayoutId(){return this.headerDataView[0]}get version(){return this.headerDataView[1]}get frameRowOffset(){return this.headerDataView[2]}get frameFormat(){return this.headerDataView[3]}get frameWidth(){return this.headerDataView[4]}get frameHeight(){return this.headerDataView[5]}get multiStreamHeaderRowOffset(){return this.headerDataView[6]}get multiStreamCount(){return this.headerDataView[7]}}class Ru{constructor(e,t){this.metadataMap=new Map,this.AUDIO_INFERENCE_RESULT_STREAM_ID=828664161,this.ATTRIBUTE_ID_MAP_STREAM_ID=1296320833;const n=new Uint32Array(e);for(let a=0,i=0;a<t;a++){const t=n[i++],a=n[i++],r=n[i++],o=new Uint8Array(e,a,r);this.metadataMap.set(t,o)}}get audioInferenceResult(){return this.metadataMap.get(this.AUDIO_INFERENCE_RESULT_STREAM_ID)}get attributes(){const e=this.metadataMap.get(this.ATTRIBUTE_ID_MAP_STREAM_ID);if(void 0===e)return;const t=new Map,n=new TextDecoder("utf-8");let a=0;const i=e[a]+(e[++a]<<8)+(e[++a]<<16)+(e[++a]<<24);for(let r=0;r<i&&a<e.length-1;r++){const i=e[++a]+(e[++a]<<8)+(e[++a]<<16)+(e[++a]<<24),r=e.findIndex((e,t,n)=>0==e&&t>a),o=n.decode(e.slice(++a,r)),s=this.metadataMap.get(i);void 0!==s&&t.set(o,s),a=r+(4-(r-a)%4-1)}return t}}class Nu{constructor(e,t){this.notifyError=e,this.videoFrameHandler=t,this.shouldDiscardAudioInferenceResult=!1,this.transform=(e,t)=>Pe(this,void 0,void 0,function*(){const n=e.timestamp;if(null!==n)try{const{videoFrame:a,metadata:{audioInferenceResult:i,attributes:r}={}}=yield this.extractVideoFrameAndMetadata(e),o=yield this.videoFrameHandler({videoFrame:a,audioInferenceResult:i,attributes:r}),s=new VideoFrame(o,{timestamp:n});t.enqueue(s),a.close(),e.close(),o.close()}catch(n){e.close(),this.notifyError(n)}else this.notifyError("timestamp of the original video frame is null")}),this.extractVideoFrameAndMetadata=e=>Pe(this,void 0,void 0,function*(){if(di())throw za;if("NV12"!==e.format)throw this.notifyError("Unsupported video frame pixel format"),new Error("Unsupported video frame pixel format");const t={x:0,y:0,width:e.codedWidth,height:2},n=new ArrayBuffer(t.width*t.height*3/2);yield e.copyTo(n,{rect:t});const a=new Hu(n,this.notifyError),i={x:0,y:a.multiStreamHeaderRowOffset,width:e.codedWidth,height:e.codedHeight-a.multiStreamHeaderRowOffset},r=new ArrayBuffer(i.width*i.height*3/2);yield e.copyTo(r,{rect:i});const o=new Ru(r,a.multiStreamCount);return{videoFrame:new VideoFrame(e,{timestamp:e.timestamp,visibleRect:{x:0,y:a.frameRowOffset,width:a.frameWidth,height:a.frameHeight}}),metadata:{audioInferenceResult:this.shouldDiscardAudioInferenceResult?void 0:o.audioInferenceResult,attributes:o.attributes}}}),uc(Di(ku,"videoEffectsUtils.transformerWithMetadata.constructor"),"video.mediaStream.audioInferenceDiscardStatusChange",({discardAudioInferenceResult:e})=>{this.shouldDiscardAudioInferenceResult=e})}}function Bu(e,t){return(n,a)=>{null==t||t.reportApplyingVideoEffect(n||"",a),e(n,a).then(()=>{null==t||t.reportVideoEffectChanged(n||"",a),Fc(Di(ku,"videoEffectsUtils.reportVideoEffectChanged"),"video.videoEffectReadiness",[!0,n,void 0,a])}).catch(e=>{const t=e in Iu?e:Iu.InitializationFailure;Fc(Di(ku,"videoEffectsUtils.effectFailure"),"video.videoEffectReadiness",[!1,n,t,a])})}}const ju="v2",Vu=2e3,zu=di()?void 0:new gu(Fc);var Gu;function Ku(e){var t,n;if(!Ju())throw za;if(!e.videoFrameHandler||!e.videoBufferHandler)throw new Error("Both videoFrameHandler and videoBufferHandler must be provided");if(Zi(Ui,ka.sidePanel)){if(uc(Di(ju,"videoEffectsEX.registerSetFrameProcessTimeLimitHandler"),"video.setFrameProcessTimeLimit",e=>null==zu?void 0:zu.setFrameProcessTimeLimit(e),!1),null===(t=Ui.supports.video)||void 0===t?void 0:t.mediaStream)uc(Di(ju,"videoEffectsEX.registerStartVideoExtensibilityVideoStreamHandler"),"video.startVideoExtensibilityVideoStream",t=>Pe(this,void 0,void 0,function*(){const{streamId:n,metadataInTexture:a}=t,i=zu?function(e,t){return n=>Pe(this,void 0,void 0,function*(){const a=n.videoFrame;t.reportStartFrameProcessing(a.codedWidth,a.codedHeight);const i=Wu(),r=yield e(n);return i(),t.reportFrameProcessed(),r})}(e.videoFrameHandler,zu):e.videoFrameHandler;a?yield function(e,t,n,a){var i,r;return Pe(this,void 0,void 0,function*(){const o=Tu();!di()&&(null===(r=null===(i=window.chrome)||void 0===i?void 0:i.webview)||void 0===r||r.registerTextureStream(e,o)),Uu(yield Pu(e,n,a),new Nu(n,t),o.writable)})}(n,i,Xu,zu):yield Mu(n,i,Xu,zu)}),!1),Fc(Di(ju,"videoEffectsEX.mediaStream.registerForVideoFrame"),"video.mediaStream.registerForVideoFrame",[e.config]);else{if(!(null===(n=Ui.supports.video)||void 0===n?void 0:n.sharedFrame))throw za;uc(Di(ju,"videoEffectsEx.registerNewVideoFrameHandler"),"video.newVideoFrame",t=>{if(t){null==zu||zu.reportStartFrameProcessing(t.width,t.height);const n=Wu(),a=t.timestamp;e.videoBufferHandler(function(e){return e.videoFrameBuffer=e.videoFrameBuffer||e.data,delete e.data,e}(t),()=>{n(),null==zu||zu.reportFrameProcessed(),function(e){Fc(Di(ju,"videoEffectsEx.notifyVideoFrameProcessed"),"video.videoFrameProcessed",[e])}(a)},Xu)}},!1),Fc(Di(ju,"videoEffectsEx.registerForVideoFrame"),"video.registerForVideoFrame",[e.config])}null==zu||zu.startMonitorSlowFrameProcessing()}}function Wu(){const e=setTimeout(()=>{Xu(`Frame not processed in ${Vu}ms`,Gu.Warn)},Vu);return function(){clearTimeout(e)}}function qu(e,t,n){if(Zi(Ui,ka.sidePanel),!Ju())throw za;Fc(Di(ju,"videoEffectsEx.notifySelectedVideoEffectChanged"),"video.videoEffectChanged",[e,t,n])}function Qu(e){if(Zi(Ui,ka.sidePanel),!Ju())throw za;uc(Di(ju,"videoEffectsEx.registerEffectParamterChangeHandler"),"video.effectParameterChange",Bu(e,zu),!1),Fc(Di(ju,"videoEffectsEx.registerForVideoEffect"),"video.registerForVideoEffect")}function Yu(e){if(Zi(Ui,ka.sidePanel),!Eu())throw za;Fc(Di(ju,"videoEffectsEx.updatePersonalizedEffects"),"video.personalizedEffectsChanged",[e])}function Ju(){return Zi(Ui),Eu()}function Xu(e,t=Gu.Warn){Fc(Di(ju,"videoEffectsEx.notifyError"),"video.notifyError",[e,t])}function Zu(e){if(Zi(Ui),!Eu())throw za;Xu(e,Gu.Fatal)}!function(e){e.Fatal="fatal",e.Warn="warn"}(Gu||(Gu={}));const $u="v2";class ef extends Wo{validate(e){return"ConfigurableTab"===e.tabType}deserialize(e){return e}}class tf{constructor(e){this.configurableTabInstance=e}serialize(){return this.configurableTabInstance}}class nf{constructor(e){this.hostEntityId=e}serialize(){return this.hostEntityId}}class af extends Wo{validate(e){return"ConfigurableTab"===e.tabType||"StaticTab"===e.tabType}deserialize(e){return e}}class rf{constructor(e){this.hostEntityTabInstance=e}serialize(){return this.hostEntityTabInstance}}class of extends Wo{validate(e){return e.allTabs&&e.allTabs.forEach(e=>{}),!0}deserialize(e){return e}}function sf(e,t){if(Zi(Ui),!ff())throw new Error(`Error code: ${Da.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);if(pf(e.threadId),t&&0===t.length)throw new Error(`Error code: ${Da.INVALID_ARGUMENTS}, message: App types cannot be an empty array`);return Pc("hostEntity.tab.addAndConfigure",[new nf(e),t],new af,Di($u,"hostEntity.tab.addAndConfigure"))}function cf(e){if(Zi(Ui),!ff())throw new Error(`Error code: ${Da.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return pf(e.threadId),Pc("hostEntity.tab.getAll",[new nf(e)],new of,Di($u,"hostEntity.tab.getAll"))}function df(e,t){if(Zi(Ui),!ff())throw new Error(`Error code: ${Da.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return mf(e),pf(t.threadId),Pc("hostEntity.tab.reconfigure",[new tf(e),new nf(t)],new ef,Di($u,"hostEntity.tab.reconfigure"))}function lf(e,t){if(Zi(Ui),!ff())throw new Error(`Error code: ${Da.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return mf(e),pf(t.threadId),Pc("hostEntity.tab.rename",[new tf(e),new nf(t)],new ef,Di($u,"hostEntity.tab.rename"))}function uf(e,t){if(Zi(Ui),!ff())throw new Error(`Error code: ${Da.NOT_SUPPORTED_ON_PLATFORM}, message: Not supported on platform`);return pf(t.threadId),mf(e),Pc("hostEntity.tab.remove",[new rf(e),new nf(t)],new qo,Di($u,"hostEntity.tab.remove"))}function ff(){var e;return!!(Zi(Ui)&&bf()&&(null===(e=Ui.supports.hostEntity)||void 0===e?void 0:e.tab))}function pf(e){if(!e||0==e.length)throw new Error(`Error code: ${Da.INVALID_ARGUMENTS}, message: ThreadId cannot be null or empty`)}function mf(e){if(!(null==e?void 0:e.internalTabInstanceId)||0===e.internalTabInstanceId.length)throw new Error(`Error code: ${Da.INVALID_ARGUMENTS}, message: TabId cannot be null or empty`)}var _f,hf;function bf(){return!(!Zi(Ui)||!Ui.supports.hostEntity)}!function(e){e.edu="EDU"}(_f||(_f={})),function(e){e.FullStore="fullstore",e.SpecificStore="specificstore",e.InContextStore="ics",e.AppDetail="appdetail"}(hf||(hf={}));const gf="Invalid store dialog type, but type needed to specify store to open",vf="No App Id present, but AppId needed to open AppDetail store",yf="No Collection Id present, but CollectionId needed to open a store specific to a collection";function Sf(e){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),!Df())throw za;if(void 0===e||!Object.values(hf).includes(e.dialogType))throw new Error(gf);if(e.dialogType===hf.AppDetail&&!(e.appId instanceof nr))throw new Error(vf);if(e.dialogType===hf.SpecificStore&&!e.collectionId)throw new Error(yf);return Tc("store.open",[e.dialogType,e.appId,e.collectionId],Di("v2","store.open"))})}function Df(){return Zi(Ui)&&!!Ui.supports.store}class If{constructor(e){this.val=e,function(e){const t=!e||e.length<=0,n=null==e?void 0:e.indexOf("@"),a=null==e?void 0:e.indexOf(".",n);if(t||-1===n||-1===a)throw new Error("Input email address does not have the correct format.")}(e)}toString(){return this.val}}function xf(){return Ui.hostVersionsInfo?Ui.hostVersionsInfo.adaptiveCardSchemaVersion:void 0}const Cf="v1";class Of{postMessage(e,t){Zi(Ui),Fc(Di(Cf,"appWindow.childAppWindow.postMessage"),"messageForChild",[e],t||ti())}addEventListener(e,t){Zi(Ui),"message"===e&&uc(Di(Cf,"appWindow.childAppWindow.addEventListener"),"messageForParent",t)}}class wf{static get Instance(){return this._instance||(this._instance=new this)}postMessage(e,t){Zi(Ui,ka.task),Fc(Di(Cf,"appWindow.parentAppWindow.postMessage"),"messageForParent",[e],t||ti())}addEventListener(e,t){Zi(Ui,ka.task),"message"===e&&uc(Di(Cf,"appWindow.parentAppWindow.addEventListener"),"messageForChild",t)}}function Ef(){if(!Mi.printCapabilityEnabled){if(Zi(Ui),!Tf())throw za;Mi.printCapabilityEnabled=!0,document.addEventListener("keydown",e=>{(e.ctrlKey||e.metaKey)&&80===e.keyCode&&(Af(),e.cancelBubble=!0,e.preventDefault(),e.stopImmediatePropagation())})}}function Af(){ci().print()}function Lf(e){kf(Di("v2","teamsAPIs_registerOnLoadHandler"),e,()=>{if(!tr(e)&&!Tf())throw za})}function kf(e,t,n){!tr(t)&&Zi(Ui),!tr(t)&&n&&n(),function(e,t){cc.loadHandler=t,!tr(t)&&Fc(e,"registerHandler",["load"])}(e,t)}function Mf(e){Pf(Di("v2","teamsAPIs_registerBeforeUnloadHandler"),e,()=>{if(!tr(e)&&!Tf())throw za})}function Pf(e,t,n){!tr(t)&&Zi(Ui),!tr(t)&&n&&n(),function(e,t){cc.beforeUnloadHandler=t,!tr(t)&&Fc(e,"registerHandler",["beforeUnload"])}(e,t)}function Tf(){return!(!Zi(Ui)||!Ui.supports.teamsCore)}const Uf="v1";function Ff(e,t){cs(Di(Uf,"initialize"),t).then(()=>{e&&e()})}function Hf(){Ef()}function Rf(){Af()}function Nf(e){Xi(),Fc(Di(Uf,"getContext"),"getContext",t=>{t.frameContext||(t.frameContext=Mi.frameContext),e(t)})}function Bf(e){ms(Di(Uf,"registerOnThemeChangeHandlerHelper"),e)}function jf(e){mc(Di(Uf,"registerFullScreenHandler"),"fullScreenChange",e,[])}function Vf(e){mc(Di(Uf,"registerAppButtonClickHandler"),"appButtonClick",e,[ka.content])}function zf(e){mc(Di(Uf,"registerAppButtonHoverEnterHandler"),"appButtonHoverEnter",e,[ka.content])}function Gf(e){mc(Di(Uf,"registerAppButtonHoverLeaveHandler"),"appButtonHoverLeave",e,[ka.content])}function Kf(e){ic(Di(Uf,"registerBackButtonHandler"),e)}function Wf(e){kf(Di(Uf,"registerOnLoadHandler"),e)}function qf(e){Pf(Di(Uf,"registerBeforeUnloadHandler"),e)}function Qf(e){mc(Di(Uf,"registerFocusEnterHandler"),"focusEnter",e,[])}function Yf(e){mc(Di(Uf,"registerChangeSettingsHandler"),"changeSettings",e,[ka.content])}function Jf(e,t){Zi(Ui),Ws(Di(Uf,"getTabInstances"),t).then(t=>{e(t)})}function Xf(e,t){Zi(Ui),qs(Di(Uf,"getMruTabInstances"),t).then(t=>{e(t)})}function Zf(e){Qs(Di(Uf,"shareDeepLink"),{subPageId:e.subEntityId,subPageLabel:e.subEntityLabel,subPageWebUrl:e.subEntityWebUrl})}function $f(e,t){Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.task,ka.stage,ka.meetingStage);const n=null!=t?t:ti();_s(Di(Uf,"executeDeepLink"),e).then(()=>{n(!0)}).catch(e=>{n(!1,e.message)})}function ep(e){Ys(Di(Uf,"setFrameContext"),e)}function tp(e,t,n){cs(Di(Uf,"initializeWithFrameContext"),n).then(()=>t&&t()),Ys(Di(Uf,"setFrameContext"),e)}const np="v1";function ap(e){!function(e,t){if(Zi(Ui),!js())throw za;Fc(e,"returnFocus",[t])}(Di(np,"navigation.returnFocus"),e)}function ip(e,t){Zi(Ui);const n=null!=t?t:ti();Ks(Di(np,"navigation.navigateToTab"),e).then(()=>{n(!0)}).catch(e=>{n(!1,e.message)})}function rp(e,t){Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.remove,ka.task,ka.stage,ka.meetingStage);const n=null!=t?t:ti();zs(Di(np,"navigation.navigateCrossDomain"),e).then(()=>{n(!0)}).catch(e=>{n(!1,e.message)})}function op(e){Zi(Ui);const t=null!=e?e:ti();Gs(Di(np,"navigation.navigateBack")).then(()=>{t(!0)}).catch(e=>{t(!1,e.message)})}const sp="v2";var cp,dp;function lp(){return!(!Zi(Ui,ka.meetingStage,ka.sidePanel,ka.content)||!Ui.supports.interactive)}!function(e){e.guest="Guest",e.attendee="Attendee",e.presenter="Presenter",e.organizer="Organizer"}(cp||(cp={})),function(e){e.added="Added",e.alreadyExists="AlreadyExists",e.conflict="Conflict",e.notFound="NotFound"}(dp||(dp={}));class up{getFluidTenantInfo(){return fp(),new Promise(e=>{e(Lc(Di(sp,"interactive.getFluidTenantInfo"),"interactive.getFluidTenantInfo"))})}getFluidToken(e){return fp(),new Promise(t=>{t(Lc(Di(sp,"interactive.getFluidToken"),"interactive.getFluidToken",e))})}getFluidContainerId(){return fp(),new Promise(e=>{e(Lc(Di(sp,"interactive.getFluidContainerId"),"interactive.getFluidContainerId"))})}setFluidContainerId(e){return fp(),new Promise(t=>{t(Lc(Di(sp,"interactive.setFluidContainerId"),"interactive.setFluidContainerId",e))})}getNtpTime(){return fp(),new Promise(e=>{e(Lc(Di(sp,"interactive.getNtpTime"),"interactive.getNtpTime"))})}registerClientId(e){return fp(),new Promise(t=>{t(Lc(Di(sp,"interactive.registerClientId"),"interactive.registerClientId",e))})}getClientRoles(e){return fp(),new Promise(t=>{t(Lc(Di(sp,"interactive.getClientRoles"),"interactive.getClientRoles",e))})}getClientInfo(e){return fp(),new Promise(t=>{t(Lc(Di(sp,"interactive.getClientInfo"),"interactive.getClientInfo",e))})}static create(){return fp(),new up}}function fp(){if(!lp())throw new Error("LiveShareHost Not supported")}function pp(e,t,n){if(0===e.length)throw new Error("Must have at least one user when creating a chat deep link");const a="users="+e.map(e=>encodeURIComponent(e)).join(","),i=void 0===t?"":`&topicName=${encodeURIComponent(t)}`,r=void 0===n?"":`&message=${encodeURIComponent(n)}`;return`https://${Li}/l/chat/0/0?${a}${i}${r}`}function mp(e){return new Promise(t=>{if(Zi(Ui,ka.content,ka.sidePanel,ka.settings,ka.task,ka.stage,ka.meetingStage),!_p())throw new Error("Not supported");const n=Di("v1","appInstallDialog.openAppInstallDialog");Ui.isLegacyTeams?t(Ec(n,"executeDeepLink",function(e){if(!e)throw new Error("App ID must be set when creating an app install dialog deep link");return`https://${Li}/l/app/${encodeURIComponent(e)}`}(e.appId))):(Fc(n,"appInstallDialog.openAppInstallDialog",[e]),t())})}function _p(){return!(!Zi(Ui)||!Ui.supports.appInstallDialog)}const hp="v1",bp=Si("media");var gp,vp,yp,Sp,Dp,Ip,xp;!function(e){e.Base64="base64",e.ID="id"}(gp||(gp={}));class Cp{}function Op(e){if(!e)throw new Error("[captureImage] Callback cannot be null");Zi(Ui,ka.content,ka.task),Mi.isFramelessWindow?$i("1.7.0")?Fc(Di(hp,"media.captureImage"),"captureImage",e):e({errorCode:Da.OLD_PLATFORM},[]):e({errorCode:Da.NOT_SUPPORTED_ON_PLATFORM},[])}function wp(){if(Zi(Ui,ka.content,ka.task),!Ap())throw za;const e=Ia.Media;return new Promise(t=>{t(Lc(Di(hp,"media.hasPermission"),"permissions.has",e))})}function Ep(){if(Zi(Ui,ka.content,ka.task),!Ap())throw za;const e=Ia.Media;return new Promise(t=>{t(Lc(Di(hp,"media.requestPermission"),"permissions.request",e))})}function Ap(){return!(!Zi(Ui)||!Ui.supports.permissions)}class Lp extends Cp{constructor(e){super(),e&&(this.content=e.content,this.format=e.format,this.mimeType=e.mimeType,this.name=e.name,this.preview=e.preview,this.size=e.size)}getMedia(e){if(!e)throw new Error("[get Media] Callback cannot be null");Zi(Ui,ka.content,ka.task),$i(Oi)?function(e,t,n){return null!=e&&null!=t&&t==gp.ID&&null!=n}(this.mimeType,this.format,this.content)?$i("2.0.0")?this.getMediaViaCallback(e):this.getMediaViaHandler(e):e({errorCode:Da.INVALID_ARGUMENTS},new Blob):e({errorCode:Da.OLD_PLATFORM},new Blob)}getMediaViaCallback(e){const t={mediaMimeType:this.mimeType,assembleAttachment:[]},n=[this.content];Fc(Di(hp,"media.getMedia"),"getMedia",n,function(n){if(e)if(n&&n.error)e(n.error,new Blob);else if(n&&n.mediaChunk)if(n.mediaChunk.chunkSequence<=0){const a=Up(t.assembleAttachment,t.mediaMimeType);e(n.error,null!=a?a:new Blob)}else{const e=Fp(n.mediaChunk,t.mediaMimeType);e?t.assembleAttachment.push(e):bp(`Received a null assemble attachment for when decoding chunk sequence ${n.mediaChunk.chunkSequence}; not including the chunk in the assembled file.`)}else e({errorCode:Da.INTERNAL_ERROR,message:"data received is null"},new Blob)})}getMediaViaHandler(e){const t=ai(),n={mediaMimeType:this.mimeType,assembleAttachment:[]},a=[t,this.content];this.content&&!tr(e)&&Fc(Di(hp,"media.getMedia"),"getMedia",a),uc(Di(hp,"media.registerGetMediaRequestHandler"),"getMedia"+t,function(a){if(e){const i=JSON.parse(a);if(i.error)e(i.error,new Blob),fc("getMedia"+t);else if(i.mediaChunk)if(i.mediaChunk.chunkSequence<=0){const a=Up(n.assembleAttachment,n.mediaMimeType);e(i.error,null!=a?a:new Blob),fc("getMedia"+t)}else{const e=Fp(i.mediaChunk,n.mediaMimeType);e&&n.assembleAttachment.push(e)}else e({errorCode:Da.INTERNAL_ERROR,message:"data received is null"},new Blob),fc("getMedia"+t)}})}}class kp extends class{constructor(e){this.controllerCallback=e}notifyEventToHost(e,t){Zi(Ui,ka.content,ka.task);try{er(xi)}catch(e){return void(t&&t(e))}const n={mediaType:this.getMediaType(),mediaControllerEvent:e};Fc(Di(hp,"media.controller"),"media.controller",[n],e=>{t&&t(e)})}stop(e){this.notifyEventToHost(vp.StopRecording,e)}}{getMediaType(){return Dp.Video}notifyEventToApp(e){if(this.controllerCallback)switch(e){case vp.StartRecording:if(this.controllerCallback.onRecordingStarted){this.controllerCallback.onRecordingStarted();break}}}}function Mp(e,t){if(!t)throw new Error("[select Media] Callback cannot be null");if(Zi(Ui,ka.content,ka.task),!$i(Oi)){const e={errorCode:Da.OLD_PLATFORM};return void t(e,[])}try{!function(e){!function(e){return!(!e||e.mediaType!=Dp.VideoAndImage&&!e.videoAndImageProps)}(e)?function(e){return!(!e||e.mediaType!=Dp.Video||!e.videoProps||e.videoProps.isFullScreenMode)}(e)?er(xi):function(e){var t;return!((null==e?void 0:e.mediaType)!=Dp.Image||!(null===(t=null==e?void 0:e.imageProps)||void 0===t?void 0:t.imageOutputFormats))}(e)&&er("2.0.4"):er("2.0.2")}(e)}catch(e){return void t(e,[])}if(!function(e){return!(null==e||e.maxMediaCount>10)}(e)){const e={errorCode:Da.INVALID_ARGUMENTS};return void t(e,[])}const n=[e];Fc(Di(hp,"media.selectMedia"),"selectMedia",n,(n,a,i)=>{var r,o;if(i)return void(function(e){return!(e.mediaType!=Dp.Video||!e.videoProps||!e.videoProps.videoController)}(e)&&(null===(o=null===(r=null==e?void 0:e.videoProps)||void 0===r?void 0:r.videoController)||void 0===o||o.notifyEventToApp(i)));if(!a)return void t(n,[]);const s=[];for(const e of a)s.push(new Lp(e));t(n,s)})}function Pp(e,t){if(!t)throw new Error("[view images] Callback cannot be null");if(Zi(Ui,ka.content,ka.task),!$i(Oi))return void t({errorCode:Da.OLD_PLATFORM});if(!function(e){return!(null==e||e.length<=0||e.length>10)}(e))return void t({errorCode:Da.INVALID_ARGUMENTS});const n=[e];Fc(Di(hp,"media.viewImages"),"viewImages",n,t)}function Tp(e,t){if(!e)throw new Error("[media.scanBarCode] Callback cannot be null");Zi(Ui,ka.content,ka.task),Mi.hostClientType!==Aa.desktop&&Mi.hostClientType!==Aa.web&&Mi.hostClientType!==Aa.rigel&&Mi.hostClientType!==Aa.teamsRoomsWindows&&Mi.hostClientType!==Aa.teamsRoomsAndroid&&Mi.hostClientType!==Aa.teamsPhones&&Mi.hostClientType!==Aa.teamsDisplays?$i("1.9.0")?Hp(t)?Fc(Di(hp,"media.scanBarCode"),"media.scanBarCode",[t],e):e({errorCode:Da.INVALID_ARGUMENTS},""):e({errorCode:Da.OLD_PLATFORM},""):e({errorCode:Da.NOT_SUPPORTED_ON_PLATFORM},"")}function Up(e,t){if(null==e||null==t||e.length<=0)return null;let n=null,a=1;return e.sort((e,t)=>e.sequence>t.sequence?1:-1),e.forEach(e=>{e.sequence==a&&(n=n?new Blob([n,e.file],{type:t}):new Blob([e.file],{type:t}),a++)}),n}function Fp(e,t){if(null==e||null==t)return null;const n=atob(e.chunk),a=new Array(n.length);for(let e=0;e<n.length;e++)a[e]=n.charCodeAt(e);const i=new Uint8Array(a),r=new Blob([i],{type:t});return{sequence:e.chunkSequence,file:r}}function Hp(e){return!e||!(null===e.timeOutIntervalInSec||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec<=0||null!=e.timeOutIntervalInSec&&e.timeOutIntervalInSec>60)}!function(e){e[e.StartRecording=1]="StartRecording",e[e.StopRecording=2]="StopRecording"}(vp||(vp={})),function(e){e[e.Photo=1]="Photo",e[e.Document=2]="Document",e[e.Whiteboard=3]="Whiteboard",e[e.BusinessCard=4]="BusinessCard"}(yp||(yp={})),function(e){e[e.Camera=1]="Camera",e[e.Gallery=2]="Gallery"}(Sp||(Sp={})),function(e){e[e.Image=1]="Image",e[e.Video=2]="Video",e[e.VideoAndImage=3]="VideoAndImage",e[e.Audio=4]="Audio"}(Dp||(Dp={})),function(e){e[e.ID=1]="ID",e[e.URL=2]="URL"}(Ip||(Ip={})),function(e){e[e.IMAGE=1]="IMAGE",e[e.PDF=2]="PDF"}(xp||(xp={}));const Rp="v2";function Np(e){return new Promise(t=>{if(Zi(Ui,ka.content,ka.task),!Vp())throw za;if(!Hp(e))throw{errorCode:Da.INVALID_ARGUMENTS};t(Lc(Di(Rp,"barCode.scanBarCode"),"media.scanBarCode",e))})}function Bp(){if(Zi(Ui,ka.content,ka.task),!Vp())throw za;const e=Ia.Media;return new Promise(t=>{t(Lc(Di(Rp,"barCode.hasPermission"),"permissions.has",e))})}function jp(){if(Zi(Ui,ka.content,ka.task),!Vp())throw za;const e=Ia.Media;return new Promise(t=>{t(Lc(Di(Rp,"barCode.requestPermission"),"permissions.request",e))})}function Vp(){return!!(Zi(Ui)&&Ui.supports.barCode&&Ui.supports.permissions)}function zp(e){return Gp(Di("v2","chat.openChat"),e)}function Gp(e,t){return new Promise(n=>{if(Zi(Ui,ka.content,ka.task),!Wp())throw za;Ui.isLegacyTeams?n(Ec(e,"executeDeepLink",pp([t.user],void 0,t.message))):n(Ec(e,"chat.openChat",{members:[t.user],message:t.message}))})}function Kp(e){const t=Di("v2","chat.openGroupChat");return new Promise(n=>{if(e.users.length<1)throw Error("OpenGroupChat Failed: No users specified");if(1===e.users.length){const a={user:e.users[0],message:e.message};n(Gp(t,a))}else{if(Zi(Ui,ka.content,ka.task),!Wp())throw za;Ui.isLegacyTeams?n(Ec(t,"executeDeepLink",pp(e.users,e.topic,e.message))):n(Ec(t,"chat.openChat",{members:e.users,message:e.message,topic:e.topic}))}})}function Wp(){return!(!Zi(Ui)||!Ui.supports.chat)}function qp(e){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.content,ka.meetingStage,ka.task,ka.settings,ka.stage,ka.sidePanel),!Yp())throw za;if(!e.type||!Object.values(Ea).includes(e.type))throw new Error(`Blob type ${e.type} is not supported. Supported blob types are ${Object.values(Ea)}`);const t=yield function(e){return new Promise((t,n)=>{0===e.size&&n(new Error("Blob cannot be empty."));const a=new FileReader;a.onloadend=()=>{a.result?t(a.result.toString().split(",")[1]):n(new Error("Failed to read the blob"))},a.onerror=()=>{n(a.error)},a.readAsDataURL(e)})}(e),n={mimeType:e.type,content:t};return Lc(Di("v2","clipboard.write"),"clipboard.writeToClipboard",n)})}function Qp(){return Pe(this,void 0,void 0,function*(){Zi(Ui,ka.content,ka.meetingStage,ka.task,ka.settings,ka.stage,ka.sidePanel);const e=Di("v2","clipboard.read");if(!Yp())throw za;const t=yield Lc(e,"clipboard.readFromClipboard");if("string"==typeof t){const e=JSON.parse(t);return function(e,t){return new Promise((n,a)=>{if(e||a("MimeType cannot be null or empty."),t||a("Base64 string cannot be null or empty."),e.startsWith("image/")){const a=atob(t),i=new Uint8Array(a.length);for(let e=0;e<a.length;e++)i[e]=a.charCodeAt(e);n(new Blob([i],{type:e}))}const i=jn.from(t,"base64").toString();n(new Blob([i],{type:e}))})}(e.mimeType,e.content)}return t})}function Yp(){return Mi.isFramelessWindow?!(!Zi(Ui)||!Ui.supports.clipboard):!!(Zi(Ui)&&navigator&&navigator.clipboard&&Ui.supports.clipboard)}function Jp(){var e;return null!==(e=Zi(Ui)&&(Ui.isNAAChannelRecommended||!(!Zi(Ui)||Mi.hostClientType!==Aa.android&&Mi.hostClientType!==Aa.ios&&Mi.hostClientType!==Aa.ipados||!Ui.isLegacyTeams||!Ui.supports.nestedAppAuth)))&&void 0!==e&&e}function Xp(){if(Zi(Ui,ka.content,ka.task),!$p())throw za;return Lc(Di("v2","geoLocation.map.chooseLocation"),"location.getLocation",{allowChooseLocation:!0,showMap:!0})}function Zp(e){if(Zi(Ui,ka.content,ka.task),!$p())throw za;if(!e)throw{errorCode:Da.INVALID_ARGUMENTS};return Lc(Di("v2","geoLocation.showLocation"),"location.showLocation",e)}function $p(){return!!(Zi(Ui)&&Ui.supports.geoLocation&&Ui.supports.geoLocation.map&&Ui.supports.permissions)}const em="v2";function tm(){if(Zi(Ui,ka.content,ka.task),!im())throw za;return Lc(Di(em,"geoLocation.getCurrentLocation"),"location.getLocation",{allowChooseLocation:!1,showMap:!1})}function nm(){if(Zi(Ui,ka.content,ka.task),!im())throw za;const e=Ia.GeoLocation;return new Promise(t=>{t(Lc(Di(em,"geoLocation.hasPermission"),"permissions.has",e))})}function am(){if(Zi(Ui,ka.content,ka.task),!im())throw za;const e=Ia.GeoLocation;return new Promise(t=>{t(Lc(Di(em,"geoLocation.requestPermission"),"permissions.request",e))})}function im(){return!!(Zi(Ui)&&Ui.supports.geoLocation&&Ui.supports.permissions)}function rm(e){if(Zi(Ui,ka.content),!om())throw za;if(!e||!si(e))throw{errorCode:Da.INVALID_ARGUMENTS,message:"Invalid Url: Only https URL is allowed"};return Lc(Di("v2","secondaryBrowser.openUrl"),"secondaryBrowser.open",e.toString())}function om(){return!(!Zi(Ui)||!Ui.supports.secondaryBrowser)}function sm(e,t){if(!t)throw new Error("[location.getLocation] Callback cannot be null");if(Zi(Ui,ka.content,ka.task),!$i(Ci))throw{errorCode:Da.OLD_PLATFORM};if(!e)throw{errorCode:Da.INVALID_ARGUMENTS};if(!dm())throw za;Fc(Di("v1","location.getLocation"),"location.getLocation",[e],t)}function cm(e,t){if(!t)throw new Error("[location.showLocation] Callback cannot be null");if(Zi(Ui,ka.content,ka.task),!$i(Ci))throw{errorCode:Da.OLD_PLATFORM};if(!e)throw{errorCode:Da.INVALID_ARGUMENTS};if(!dm())throw za;Fc(Di("v1","location.showLocation"),"location.showLocation",[e],t)}function dm(){return!(!Zi(Ui)||!Ui.supports.location)}function lm(e){Zi(Ui,ka.sidePanel),e.contentUrl&&new URL(e.contentUrl),Fc(Di("v1","meeting.appShareButton.setOptions"),"meeting.appShareButton.setOptions",[e])}const um="v1";var fm,pm,mm,_m,hm,bm,gm;function vm(e){if(!e)throw new Error("[get incoming client audio state] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.getIncomingClientAudioState"),"getIncomingClientAudioState",e)}function ym(e){if(!e)throw new Error("[toggle incoming client audio] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.toggleIncomingClientAudio"),"toggleIncomingClientAudio",e)}function Sm(e){if(!e)throw new Error("[get meeting details] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage,ka.settings,ka.content),Fc(Di(um,"meeting.getMeetingDetails"),"meeting.getMeetingDetails",e)}function Dm(){var e,t,n;return Pe(this,void 0,void 0,function*(){let a;Zi(Ui,ka.sidePanel,ka.meetingStage,ka.settings,ka.content);try{const e=!0;a=yield Lc(Di("v2","meeting.getMeetingDetailsVerbose"),"meeting.getMeetingDetails",e)}catch(a){throw new Error(null===(e=null==a?void 0:a.errorCode)||void 0===e?void 0:e.toString())}if(((null===(t=a.details)||void 0===t?void 0:t.type)==_m.GroupCall||(null===(n=a.details)||void 0===n?void 0:n.type)==_m.OneOnOneCall)&&!a.details.originalCallerInfo)throw new Error(Da.NOT_SUPPORTED_ON_PLATFORM.toString());return a})}function Im(e){if(!e)throw new Error("[get Authentication Token For AnonymousUser] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage,ka.task),Fc(Di(um,"meeting.getAuthenticationTokenForAnonymousUser"),"meeting.getAuthenticationTokenForAnonymousUser",e)}function xm(e){if(!e)throw new Error("[get live stream state] Callback cannot be null");Zi(Ui,ka.sidePanel),Fc(Di(um,"meeting.getLiveStreamState"),"meeting.getLiveStreamState",e)}function Cm(e,t,n){if(!e)throw new Error("[request start live streaming] Callback cannot be null");Zi(Ui,ka.sidePanel),Fc(Di(um,"meeting.requestStartLiveStreaming"),"meeting.requestStartLiveStreaming",[t,n],e)}function Om(e){if(!e)throw new Error("[request stop live streaming] Callback cannot be null");Zi(Ui,ka.sidePanel),Fc(Di(um,"meeting.requestStopLiveStreaming"),"meeting.requestStopLiveStreaming",e)}function wm(e){if(!e)throw new Error("[register live stream changed handler] Handler cannot be null");Zi(Ui,ka.sidePanel),uc(Di(um,"meeting.registerLiveStreamChangedHandler"),"meeting.liveStreamChanged",e)}function Em(e,t,n={sharingProtocol:hm.Collaborative}){if(!e)throw new Error("[share app content to stage] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.shareAppContentToStage"),"meeting.shareAppContentToStage",[t,n],e)}function Am(e){if(!e)throw new Error("[get app content stage sharing capabilities] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.getAppContentStageSharingCapabilities"),"meeting.getAppContentStageSharingCapabilities",e)}function Lm(e){if(!e)throw new Error("[stop sharing app content to stage] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.stopSharingAppContentToStage"),"meeting.stopSharingAppContentToStage",e)}function km(e){if(!e)throw new Error("[get app content stage sharing state] Callback cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.getAppContentStageSharingState"),"meeting.getAppContentStageSharingState",e)}function Mm(e){if(!e)throw new Error("[registerSpeakingStateChangeHandler] Handler cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),uc(Di(um,"meeting.registerSpeakingStateChangeHandler"),"meeting.speakingStateChanged",e)}function Pm(e){if(!e)throw new Error("[registerRaiseHandStateChangedHandler] Handler cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),uc(Di(um,"meeting.registerRaiseHandStateChangedHandler"),"meeting.raiseHandStateChanged",e)}function Tm(e){if(!e)throw new Error("[registerMeetingReactionReceivedHandler] Handler cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),uc(Di(um,"meeting.registerMeetingReactionReceivedHandler"),"meeting.meetingReactionReceived",e)}function Um(e){if(void 0===(null==e?void 0:e.joinWebUrl)||null===(null==e?void 0:e.joinWebUrl))return Promise.reject(new Error("Invalid joinMeetingParams"));Zi(Ui);const t={joinWebUrl:e.joinWebUrl.href,source:e.source||bm.Other};return Lc(Di("v2","meeting.joinMeeting"),"meeting.joinMeeting",t)}function Fm(e,t){if(!t)throw new Error("[requestAppAudioHandling] Callback response cannot be null");if(!e.micMuteStateChangedCallback)throw new Error("[requestAppAudioHandling] Callback Mic mute state handler cannot be null");Zi(Ui,ka.sidePanel,ka.meetingStage),e.isAppHandlingAudio?function(e,t){Fc(Di(um,"meeting.requestAppAudioHandling"),"meeting.requestAppAudioHandling",[e.isAppHandlingAudio],(n,a)=>{if(n&&null!=a)throw new Error("[requestAppAudioHandling] Callback response - both parameters cannot be set");if(n)throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${n.errorCode} ${n.message}`);if("boolean"!=typeof a)throw new Error("[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean");uc(Di(um,"meeting.registerMicStateChangeHandler"),"meeting.micStateChanged",t=>Pe(this,void 0,void 0,function*(){try{const n=yield e.micMuteStateChangedCallback(t);Rm(n,n.isMicMuted===t.isMicMuted?fm.HostInitiated:fm.AppDeclinedToChange)}catch(e){Rm(t,fm.AppFailedToChange)}})),uc(Di(um,"meeting.registerAudioDeviceSelectionChangedHandler"),"meeting.audioDeviceSelectionChanged",t=>{var n;null===(n=e.audioDeviceSelectionChangedCallback)||void 0===n||n.call(e,t)}),t(a)})}(e,t):function(e,t){Fc(Di(um,"meeting.requestAppAudioHandling"),"meeting.requestAppAudioHandling",[e.isAppHandlingAudio],(e,n)=>{if(e&&null!=n)throw new Error("[requestAppAudioHandling] Callback response - both parameters cannot be set");if(e)throw new Error(`[requestAppAudioHandling] Callback response - SDK error ${e.errorCode} ${e.message}`);if("boolean"!=typeof n)throw new Error("[requestAppAudioHandling] Callback response - isHostAudioless must be a boolean");pc("meeting.micStateChanged")&&fc("meeting.micStateChanged"),pc("meeting.audioDeviceSelectionChanged")&&fc("meeting.audioDeviceSelectionChanged"),t(n)})}(e,t)}function Hm(e){Rm(e,fm.AppInitiated)}function Rm(e,t){Zi(Ui,ka.sidePanel,ka.meetingStage),Fc(Di(um,"meeting.setMicStateWithReason"),"meeting.updateMicState",[e,t])}function Nm(e,t){let n,a,i="";return"function"==typeof e?(n=e,a=t,i=Di("v1","monetization.openPurchaseExperience")):(a=e,i=Di("v2","monetization.openPurchaseExperience")),Zi(Ui,ka.content),function(e,t,...n){const a=e();return a.then(e=>{t&&t(null,e)}).catch(e=>{t&&t(e,null)}),a}(()=>new Promise(e=>{if(!Bm())throw za;e(Lc(i,"monetization.openPurchaseExperience",a))}),n)}function Bm(){return!(!Zi(Ui)||!Ui.supports.monetization)}function jm(e){return new Promise(t=>{if(Zi(Ui,ka.content),!zm())throw new Error("Not supported");if(!e.itemId||!e.itemId.trim())throw new Error("Must supply an itemId to openCalendarItem");t(Ec(Di("v2","calendar.openCalendarItem"),"calendar.openCalendarItem",e))})}function Vm(e){return new Promise(t=>{if(Zi(Ui,ka.content),!zm())throw new Error("Not supported");const n=Di("v2","calendar.composeMeeting");Ui.isLegacyTeams?t(Ec(n,"executeDeepLink",function(e,t,n,a,i){const r=void 0===e?"":"attendees="+e.map(e=>encodeURIComponent(e)).join(","),o=void 0===t?"":`&startTime=${encodeURIComponent(t)}`,s=void 0===n?"":`&endTime=${encodeURIComponent(n)}`,c=void 0===a?"":`&subject=${encodeURIComponent(a)}`,d=void 0===i?"":`&content=${encodeURIComponent(i)}`;return`https://${Li}/l/meeting/new?${r}${o}${s}${c}${d}`}(e.attendees,e.startTime,e.endTime,e.subject,e.content))):t(Ec(n,"calendar.composeMeeting",e))})}function zm(){return!(!Zi(Ui)||!Ui.supports.calendar)}function Gm(e){return new Promise(t=>{if(Zi(Ui,ka.content),!Wm())throw new Error("Not supported");if(!e.itemId||!e.itemId.trim())throw new Error("Must supply an itemId to openMailItem");t(Ec(Di("v2","mail.openMailItem"),"mail.openMailItem",e))})}function Km(e){return new Promise(t=>{if(Zi(Ui,ka.content),!Wm())throw new Error("Not supported");t(Ec(Di("v2","mail.composeMail"),"mail.composeMail",e))})}function Wm(){return!(!Zi(Ui)||!Ui.supports.mail)}function qm(e,t){let n,a;Zi(Ui,ka.content,ka.task,ka.settings);let i="";return"function"==typeof e?([n,a]=[e,t],i=Di("v1","people.selectPeople")):(a=e,i=Di("v2","people.selectPeople")),function(e,t,...n){const a=e(...n);return a.then(e=>{t&&t(void 0,e)}).catch(e=>{t&&t(e)}),a}(Qm,n,i,a)}function Qm(e,t){return new Promise(n=>{if(!$i("2.0.0"))throw{errorCode:Da.OLD_PLATFORM};if(!function(e){if(e){if(e.title&&"string"!=typeof e.title)return!1;if(e.setSelected&&"object"!=typeof e.setSelected)return!1;if(e.openOrgWideSearchInChatOrChannel&&"boolean"!=typeof e.openOrgWideSearchInChatOrChannel)return!1;if(e.singleSelect&&"boolean"!=typeof e.singleSelect)return!1}return!0}(t))throw{errorCode:Da.INVALID_ARGUMENTS};if(!Ym())throw za;n(Lc(e,"people.selectPeople",t))})}function Ym(){return!(!Zi(Ui)||!Ui.supports.people)}function Jm(e){return Zi(Ui,ka.content),new Promise(t=>{const[n,a]=function(e){return e?e.modality&&"string"!=typeof e.modality?[!1,"modality must be a string"]:e.targetElementBoundingRect&&"object"==typeof e.targetElementBoundingRect?e.triggerType&&"string"==typeof e.triggerType?function(e){return e?e.displayName&&"string"!=typeof e.displayName?[!1,"displayName must be a string"]:e.identifiers&&"object"==typeof e.identifiers?e.identifiers.AadObjectId||e.identifiers.Smtp||e.identifiers.Upn?e.identifiers.AadObjectId&&"string"!=typeof e.identifiers.AadObjectId?[!1,"AadObjectId identifier must be a string"]:e.identifiers.Smtp&&"string"!=typeof e.identifiers.Smtp?[!1,"Smtp identifier must be a string"]:e.identifiers.Upn&&"string"!=typeof e.identifiers.Upn?[!1,"Upn identifier must be a string"]:[!0,void 0]:[!1,"at least one valid identifier must be provided"]:[!1,"persona identifiers object must be provided"]:[!1,"persona object must be provided"]}(e.persona):[!1,"triggerType must be a valid string"]:[!1,"targetElementBoundingRect must be a DOMRect"]:[!1,"A request object is required"]}(e);if(!n)throw{errorCode:Da.INVALID_ARGUMENTS,message:a};const i={modality:e.modality,persona:e.persona,triggerType:e.triggerType,targetRectangle:{x:e.targetElementBoundingRect.x,y:e.targetElementBoundingRect.y,width:e.targetElementBoundingRect.width,height:e.targetElementBoundingRect.height}};t(Lc(Di("v2","profile.showProfile"),"profile.showProfile",i))})}function Xm(){return!(!Zi(Ui)||!Ui.supports.profile)}!function(e){e[e.HostInitiated=0]="HostInitiated",e[e.AppInitiated=1]="AppInitiated",e[e.AppDeclinedToChange=2]="AppDeclinedToChange",e[e.AppFailedToChange=3]="AppFailedToChange"}(fm||(fm={})),function(e){e.like="like",e.heart="heart",e.laugh="laugh",e.surprised="surprised",e.applause="applause"}(pm||(pm={})),function(e){e.Unknown="Unknown",e.Adhoc="Adhoc",e.Scheduled="Scheduled",e.Recurring="Recurring",e.Broadcast="Broadcast",e.MeetNow="MeetNow"}(mm||(mm={})),function(e){e.OneOnOneCall="oneOnOneCall",e.GroupCall="groupCall"}(_m||(_m={})),function(e){e.Collaborative="Collaborative",e.ScreenShare="ScreenShare"}(hm||(hm={})),function(e){e.M365CalendarGridContextMenu="m365_calendar_grid_context_menu",e.M365CalendarGridPeek="m365_calendar_grid_peek",e.M365CalendarGridEventCardJoinButton="m365_calendar_grid_event_card_join_button",e.M365CalendarFormRibbonJoinButton="m365_calendar_form_ribbon_join_button",e.M365CalendarFormJoinTeamsMeetingButton="m365_calendar_form_join_teams_meeting_button",e.Other="other"}(bm||(bm={})),function(e){e.New="new",e.Reply="reply",e.ReplyAll="replyAll",e.Forward="forward"}(gm||(gm={}));const Zm="v2",$m="search.queryChange",e_="search.queryClose",t_="search.queryExecute";function n_(e,t,n){if(Zi(Ui,ka.content),!i_())throw za;uc(Di(Zm,"search.registerOnClosedHandler"),e_,e),uc(Di(Zm,"search.registerOnExecutedHandler"),t_,t),n&&uc(Di(Zm,"search.registerOnChangeHandler"),$m,n)}function a_(){if(Zi(Ui,ka.content),!i_())throw za;Fc(Di(Zm,"search.unregisterHandlers"),"search.unregister"),fc($m),fc(e_),fc(t_)}function i_(){return!(!Zi(Ui)||!Ui.supports.search)}function r_(){return new Promise(e=>{if(Zi(Ui,ka.content),!i_())throw new Error("Not supported");e(Ec(Di(Zm,"search.closeSearch"),"search.closeSearch"))})}function o_(){return Pe(this,void 0,void 0,function*(){if(Zi(Ui,ka.sidePanel,ka.meetingStage),!s_())throw za;return yield Lc(Di("v2","sharing.history.getContent"),"sharing.history.getContent")})}function s_(){var e;return Zi(Ui)&&void 0!==(null===(e=Ui.supports.sharing)||void 0===e?void 0:e.history)}const c_={shareWebContent:"sharing.shareWebContent"};function d_(e,t){try{!function(e){if(!(e&&e.content&&e.content.length))throw{errorCode:Da.INVALID_ARGUMENTS,message:"Shared content is missing"}}(e),function(e){let t;if(e.content.some(e=>!e.type))throw t={errorCode:Da.INVALID_ARGUMENTS,message:"Shared content type cannot be undefined"},t;if(e.content.some(t=>t.type!==e.content[0].type))throw t={errorCode:Da.INVALID_ARGUMENTS,message:"Shared content must be of the same type"},t}(e),function(e){let t;if("URL"!==e.content[0].type)throw t={errorCode:Da.INVALID_ARGUMENTS,message:"Content type is unsupported"},t;if(e.content.some(e=>!e.url))throw t={errorCode:Da.INVALID_ARGUMENTS,message:"URLs are required for URL content types"},t}(e)}catch(e){return ri(()=>Promise.reject(e),t)}return Zi(Ui,ka.content,ka.sidePanel,ka.task,ka.stage,ka.meetingStage),ri(l_,t,Di(t?"v1":"v2","sharing.shareWebContent"),e)}function l_(e,t){return new Promise(n=>{if(!u_())throw za;n(Lc(e,c_.shareWebContent,t))})}function u_(){return!(!Zi(Ui)||!Ui.supports.sharing)}function f_(){return new Promise(e=>{if(Zi(Ui,ka.content),!p_())throw za;e(Lc(Di("v2","stageView.self.close"),"stageView.self.close"))})}function p_(){var e;return Zi(Ui)&&void 0!==(null===(e=Ui.supports.stageView)||void 0===e?void 0:e.self)}var m_,__,h_;function b_(e){return new Promise(t=>{if(Zi(Ui,ka.content),!g_())throw za;if(!e)throw new Error("[stageView.open] Stage view params cannot be null");t(Lc(Di("v2","stageView.open"),"stageView.open",e))})}function g_(){return!(!Zi(Ui)||!Ui.supports.stageView)}function v_(e){return Pe(this,void 0,void 0,function*(){Zi(Ui,ka.content,ka.task),D_(),I_(e);const t=yield Lc(Di("v2","visualMedia.image.captureImages"),"visualMedia.image.captureImages",e);return x_(e.maxVisualMediaCount,t),t})}function y_(e){return Pe(this,void 0,void 0,function*(){Zi(Ui,ka.content,ka.task),D_(),I_(e);const t=yield Lc(Di("v2","visualMedia.image.retrieveImages"),"visualMedia.image.retrieveImages",e);return x_(e.maxVisualMediaCount,t),t})}function S_(){return!!(Zi(Ui)&&Ui.supports.visualMedia&&Ui.supports.visualMedia.image&&Ui.supports.permissions)}function D_(){if(!S_())throw za}function I_(e){if(!e||e.maxVisualMediaCount>10||e.maxVisualMediaCount<1)throw Ka}function x_(e,t){if(t.length>e)throw Wa}function C_(){if(Zi(Ui,ka.content,ka.task),!S_())throw za;const e=Ia.Media;return Lc(Di("v2","visualMedia.hasPermission"),"permissions.has",e)}function O_(){if(Zi(Ui,ka.content,ka.task),!S_())throw za;const e=Ia.Media;return Lc(Di("v2","visualMedia.requestPermission"),"permissions.request",e)}!function(e){e.modal="modal",e.popout="popout",e.popoutWithChat="popoutWithChat"}(m_||(m_={})),function(e){e[e.FrontOrRear=1]="FrontOrRear",e[e.FrontOnly=2]="FrontOnly",e[e.RearOnly=3]="RearOnly"}(__||(__={})),function(e){e[e.Camera=1]="Camera",e[e.Gallery=2]="Gallery"}(h_||(h_={}));let w_=null;function E_(){return Pe(this,void 0,void 0,function*(){if(Zi(Ui),!A_())throw za;return!(!Ui.isLegacyTeams||Mi.hostClientType!==Aa.android&&Mi.hostClientType!==Aa.ios&&Mi.hostClientType!==Aa.ipados||(yield function(){return Pe(this,void 0,void 0,function*(){return function(){return Pe(this,void 0,void 0,function*(){return null===w_&&(w_=(yield Lr()).app.host.name),w_})}()})}())!==La.teams)||(yield wc(Di("v2","webStorage.isWebStorageClearedOnUserLogOut"),"webStorage.isWebStorageClearedOnUserLogOut"))})}function A_(){return Zi(Ui)&&void 0!==Ui.supports.webStorage}var L_;function k_(e){const t=Di("v2","call.startCall");return new Promise(n=>{var a;if(Zi(Ui,ka.content,ka.task),!M_())throw za;if(!Ui.isLegacyTeams)return Fc(t,"call.startCall",[e],n);n(wc(t,"executeDeepLink",function(e,t,n){if(0===e.length)throw new Error("Must have at least one target when creating a call deep link");const a="users="+e.map(e=>encodeURIComponent(e)).join(","),i=void 0===t?"":`&withVideo=${encodeURIComponent(t)}`,r=void 0===n?"":`&source=${encodeURIComponent(n)}`;return`https://${Li}/l/call/0/0?${a}${i}${r}`}(e.targets,null===(a=e.requestedModalities)||void 0===a?void 0:a.includes(L_.Video),e.source)).then(e=>{if(!e)throw new Error("The call was not properly started");return e}))})}function M_(){return!(!Zi(Ui)||!Ui.supports.call)}!function(e){e.Unknown="unknown",e.Audio="audio",e.Video="video",e.VideoBasedScreenSharing="videoBasedScreenSharing",e.Data="data"}(L_||(L_={}));const P_="v1";function T_(){ds(Di(P_,"appInitialization.notifyAppLoaded"))}function U_(){Fc(Di(P_,"appInitialization.notifySuccess"),Dr.Success,[qi])}function F_(e){us(Di(P_,"appInitialization.notifyFailure"),e)}function H_(e){ls(Di(P_,"appInitialization.notifyExpectedFailure"),e)}const R_=Si("thirdPartyCloudStorage");class N_{constructor(e,t){this.fileType=e,this.assembleAttachment=t}}let B_=[],j_=null,V_=!0,z_=null;function G_(e,t){if(!t)throw new Error("[getDragAndDropFiles] Callback cannot be null");if(e&&""!==e){if(Zi(Ui,ka.content,ka.task),!W_())throw za;if(z_)throw z_=null,new Error("getDragAndDropFiles cannot be called twice");z_=t,V_=!0,Fc(Di("v2","thirdPartyCloudStorage.getDragAndDropFiles"),"thirdPartyCloudStorage.getDragAndDropFiles",[e],K_)}else t([],{errorCode:Da.INVALID_ARGUMENTS})}function K_(e){if(z_)if(e&&e.error)z_([],e.error),z_=null;else if(e&&e.fileChunk)try{V_||0!==e.fileChunk.chunkSequence||(R_("Last chunk is not received or 'endOfFile' value for previous chunk was not set to true"),V_=!0,z_([],{errorCode:Da.INTERNAL_ERROR,message:"error occurred while receiving data"}),B_=[],z_=null);const t=Fp(e.fileChunk,e.fileType);if(t?(j_||(j_=new N_(e.fileType,[])),j_.assembleAttachment.push(t)):(R_(`Received a null assemble attachment for when decoding chunk sequence ${e.fileChunk.chunkSequence}; not including the chunk in the assembled file.`),z_?z_([],{errorCode:Da.INTERNAL_ERROR,message:"error occurred while receiving data"}):z_=null,B_=[],z_=null,V_=!0),V_=e.fileChunk.endOfFile,e.fileChunk.endOfFile&&j_){const t=Up(j_.assembleAttachment,j_.fileType);if(t){const n=new File([t],e.fileName,{type:t.type});B_.push(n)}e.isLastFile&&z_&&(z_(B_,e.error),B_=[],z_=null,V_=!0),j_=null}}catch(e){z_&&(z_([],{errorCode:Da.INTERNAL_ERROR,message:e}),B_=[],z_=null,V_=!0)}else z_([],{errorCode:Da.INTERNAL_ERROR,message:"data received is null"}),B_=[],z_=null,V_=!0}function W_(){return!(!Zi(Ui)||!Ui.supports.thirdPartyCloudStorage)}const q_="v1";function Q_(e){Js(Di(q_,"settings.setValidityState"),e)}function Y_(e){Zi(Ui,ka.content,ka.settings,ka.remove,ka.sidePanel),Xs(Di(q_,"settings.getSettings")).then(t=>{e(t)})}function J_(e,t){Zi(Ui,ka.content,ka.settings,ka.sidePanel);const n=null!=t?t:ti();Zs(Di(q_,"settings.setSettings"),e).then(()=>{n(!0)}).catch(e=>{n(!1,e.message)})}function X_(e){Zo(Di(q_,"settings.registerOnSaveHandler"),e)}function Z_(e){es(Di(q_,"settings.registerOnRemoveHandler"),e)}const $_="v1";function eh(e,t){const n=Di($_,"tasks.startTask"),a=t?e=>{var n,a;return t(null!==(n=e.err)&&void 0!==n?n:"",null!==(a=e.result)&&void 0!==a?a:"")}:void 0;return void 0===e.card&&void 0===e.url||e.card?(Zi(Ui,ka.content,ka.sidePanel,ka.meetingStage),Fc(n,"tasks.startTask",[e],t)):void 0!==e.completionBotId?go(n,function(e){if(void 0===e.url||void 0===e.completionBotId)throw new Error(`Both url ${e.url} and completionBotId ${e.completionBotId} are required for bot url dialog. At least one is undefined.`);return{url:e.url,size:{height:e.height?e.height:Ta.Small,width:e.width?e.width:Ta.Small},title:e.title,fallbackUrl:e.fallbackUrl,completionBotId:e.completionBotId}}(e),a):bo(n,function(e){if(void 0===e.url)throw new Error("url property of taskInfo object can't be undefined");return{url:e.url,size:{height:e.height?e.height:Ta.Small,width:e.width?e.width:Ta.Small},title:e.title,fallbackUrl:e.fallbackUrl}}(e),a),new Of}function th(e){const t=Me(e=ah(e),["width","height"]);if(Object.keys(t).length)throw new Error("resize requires a TaskInfo argument containing only width and height");ho(Di($_,"tasks.updateTask"),e)}function nh(e,t){vo(Di($_,"tasks.submitTask"),e,t)}function ah(e){return e.height=e.height?e.height:Ta.Small,e.width=e.width?e.width:Ta.Small,e}function ih(e){try{return e.cartItems=rh(e.cartItems),e}catch(e){throw new Error("Error deserializing cart")}}function rh(e){return e.map(e=>{if(e.imageURL){const t=new URL(e.imageURL);e.imageURL=t}return e.accessories&&(e.accessories=rh(e.accessories)),e})}const oh=e=>{try{return e.map(e=>{const{imageURL:t,accessories:n}=e,a=Me(e,["imageURL","accessories"]),i=Object.assign({},a);return t&&(i.imageURL=t.href),n&&(i.accessories=oh(n)),i})}catch(e){throw new Error("Error serializing cart items")}};function sh(e){if(null!=e){if(!Array.isArray(e)||0===e.length)throw new Error("CartItem.accessories must be a non-empty array");for(const t of e){if(t.accessories)throw new Error("Item in CartItem.accessories cannot have accessories");ch(t)}}}function ch(e){if(!e.id)throw new Error("cartItem.id must not be empty");if(!e.name)throw new Error("cartItem.name must not be empty");(function(e){if("number"!=typeof e||e<0)throw new Error(`price ${e} must be a number not less than 0`);if(parseFloat(e.toFixed(3))!==e)throw new Error(`price ${e} must have at most 3 decimal places`)})(e.price),function(e){if("number"!=typeof e||e<=0||parseInt(e.toString())!==e)throw new Error(`quantity ${e} must be an integer greater than 0`)}(e.quantity)}function dh(e){if(null!=e){if(!e)throw new Error("id must not be empty");if(!1===ei(e))throw new Error("id must be a valid UUID")}}const lh="v2",uh={majorVersion:1,minorVersion:1};var fh,ph;function mh(){if(Zi(Ui,ka.content,ka.task),!gh())throw za;return Lc(Di(lh,"marketplace.getCart"),"marketplace.getCart",uh).then(ih)}function _h(e){if(Zi(Ui,ka.content,ka.task),!gh())throw za;if(!e)throw new Error("addOrUpdateCartItemsParams must be provided");return dh(null==e?void 0:e.cartId),function(e){if(!Array.isArray(e)||0===e.length)throw new Error("cartItems must be a non-empty array");for(const t of e)ch(t),sh(t.accessories)}(null==e?void 0:e.cartItems),Lc(Di(lh,"marketplace.addOrUpdateCartItems"),"marketplace.addOrUpdateCartItems",Object.assign(Object.assign({},e),{cartItems:oh(e.cartItems),cartVersion:uh})).then(ih)}function hh(e){if(Zi(Ui,ka.content,ka.task),!gh())throw za;if(!e)throw new Error("removeCartItemsParams must be provided");if(dh(null==e?void 0:e.cartId),!Array.isArray(null==e?void 0:e.cartItemIds)||0===(null==e?void 0:e.cartItemIds.length))throw new Error("cartItemIds must be a non-empty array");return Lc(Di(lh,"marketplace.removeCartItems"),"marketplace.removeCartItems",Object.assign(Object.assign({},e),{cartVersion:uh})).then(ih)}function bh(e){if(Zi(Ui,ka.content,ka.task),!gh())throw za;if(!e)throw new Error("updateCartStatusParams must be provided");return dh(null==e?void 0:e.cartId),function(e){if(!Object.values(ph).includes(e))throw new Error(`cartStatus ${e} is not valid`)}(null==e?void 0:e.cartStatus),Lc(Di(lh,"marketplace.updateCartStatus"),"marketplace.updateCartStatus",Object.assign(Object.assign({},e),{cartVersion:uh})).then(ih)}function gh(){return!(!Zi(Ui)||!Ui.supports.marketplace)}!function(e){e.TACAdminUser="TACAdminUser",e.TeamsAdminUser="TeamsAdminUser",e.TeamsEndUser="TeamsEndUser"}(fh||(fh={})),function(e){e.Open="Open",e.Processing="Processing",e.Processed="Processed",e.Closed="Closed",e.Error="Error"}(ph||(ph={}))}
}]);