"use strict";(this.webpackChunk_msteams_react_web_client=this.webpackChunk_msteams_react_web_client||[]).push([[439411],{842787:(e,t,r)=>{r.r(t),r.d(t,{SHAREPOINT_SCENARIO_HEADER_FOR_THUMBNAIL_API_PREFIX:()=>R.e,SharePointPreferHeaders:()=>R.Y2,SharepointRestClient:()=>_,SharepointScenario:()=>R.eu,SharepointScenarioType:()=>R.CK,SharepointSharingMode:()=>R.vV,createSimpleRequest:()=>T.K,simpleRequestSender:()=>T.X});var n=r(8683),s=r(564695),a=r(401368),o=r(182635),i=r(461167),c=r(480354),u=r(135449),h=r(506456);const p=(e,t)=>({...e,serviceName:u.p.Sharepoint,headers:t}),d=({authenticationResources:e})=>{const t=$,r=(0,h.e)(t,{});return{serviceName:u.p.Sharepoint,authResource:e.authorizeByUrl,models:{rawRequest:r(p).withTransform(l)}}};function $(e){return Promise.resolve({constructRequest:e,rejectHttpError:!0})}const l=async e=>e,m=(e,t)=>({rawRequest:y(e,t)}),y=(e,t)=>async(r,n)=>{const s=p(r,n);return e(s,t)};class _{constructor(e,t,r,i){this._aad=e,this._clientType=t.config.clientType,this._sender=(e,t)=>{let r=(0,o.aU)(e.url);r=this.updateResourceScope(r);const{allowBadgerAuth:s}=i.get(a.w.Files);s&&(t=function(e){return async t=>(t.authOptions&&"badgerToken"in t.authOptions&&t.authOptions.badgerToken&&(t.headers={...t.headers,Authorization:`Badger ${t.authOptions.badgerToken}`}),e(t))}(t));const c=this._aad.authorize(t,r);return(0,n.A)(c)(e)},this.transport=((e,t,r,n)=>{const{enableEndpointsManagerOnSharepointRestClientService:s}=n.get(a.w.Files);return s?r.createApi(d):m(e,t)})(this._sender,s.t,r,i)}async post(e){const t={...e,method:"POST"},{body:r}=await this._rawRequest(t);return r.json()}async put(e){const t={...e,method:"PUT"},{body:r}=await this._rawRequest(t);return r.json()}async get(e){const t={...e,method:"GET"},{body:r}=await this._rawRequest(t);return"application/octet-stream"===e.headers?.accept?r.blob():r.json()}async getResponse(e){const t={...e,method:"GET"};return await this._rawRequest(t)}async delete(e){const t={...e,method:"DELETE"},{body:r}=await this._rawRequest(t);return r}async _rawRequest(e){const{headers:t}=e,r={Accept:"application/json",Application:`Teams_${(0,c.upperFirst)(this._clientType)}`,...t};return this.transport.rawRequest(e,r)}updateResourceScope(e){return e===i.GU?`${e}${i.AY}`:e}}var R=r(305755),T=r(628969)},628969:(e,t,r)=>{r.d(t,{X:()=>o,K:()=>i});var n=r(845097);const s="\r\n",a="ump=1",o=e=>async t=>e(i(t)),i=e=>{const t=(0,n.v4)();return{...e,url:c(e.url),headers:{"Content-Type":`multipart/form-data;boundary=${t}`},body:u(e,t),method:"POST"}},c=e=>e.match(/[?]/)?`${e}&${a}`:`${e}?${a}`,u=(e,t)=>{const r=`--${t}${s}`,n=`--${t}--`,a=`Content-Disposition: form-data;name=data${s}`,o=`Content-Type: application/json${s}`,i="POST"!==e.method?`X-HTTP-Method-Override: ${e.method}${s}`:"",c=h(e),u=e.body?`${e.body}${s}`:`{}${s}`;return`${r}${a}${o}${c}${i}${s}${u}${n}`},h=e=>{const t=e.headers;return t?Object.keys(t).map((e=>"Content-Type"===e?"":`${e}: ${t[e]}${s}`)).join(""):""}}}]);
//# sourceMappingURL=https://local.teams.office.com/sourcemaps/hashed-assets/services-sharepoint-client-8866047f818b9778.js.map