Files
sm-bm-plugin/public/assets/presentations-CkEsPiie.js

2 lines
1.3 KiB
JavaScript

import{aR as i,aA as o}from"./index-CcttGF2j.js";const m="X-Cast-Ticket",t="/_presentations/api/v1",p={publicDeck:e=>o.request(`${t}/public/${encodeURIComponent(e)}`,{auth:!1}),mine:()=>o.request(`${t}/mine`),speaker:e=>o.request(`${t}/mine/${encodeURIComponent(e)}`),deleteMine:e=>o.request(`${t}/mine/${encodeURIComponent(e)}`,{method:"DELETE"}),speakerImage:(e,n)=>o.blob(`${t}/mine/${encodeURIComponent(e)}/images/${encodeURIComponent(n)}`),remote:(e,n)=>o.request(`${t}/mine/${encodeURIComponent(e)}/remote`,{method:"POST",body:n}),castMint:e=>o.request(`${t}/mine/${encodeURIComponent(e)}/cast`,{method:"POST"}),castRevoke:(e,n)=>o.request(`${t}/mine/${encodeURIComponent(e)}/cast`,{method:"DELETE",headers:{[m]:n}}),remoteState:(e,n)=>o.request(`${t}/mine/${encodeURIComponent(e)}/remote/state`,{method:"POST",body:n}),remoteStateBeacon(e,n){const s={Accept:"application/json","Content-Type":"application/json"},c=i.get();c&&(s.Authorization=`Bearer ${c}`);try{fetch(`${t}/mine/${encodeURIComponent(e)}/remote/state`,{method:"POST",headers:s,body:JSON.stringify(n),keepalive:!0}).catch(()=>{})}catch{}}};function a(e){return{auth:!1,headers:{[m]:e}}}const d={deck:e=>o.request(`${t}/cast/deck`,a(e)),image:(e,n)=>o.blob(`${t}/cast/images/${encodeURIComponent(n)}`,a(e)),realtime:e=>o.request(`${t}/cast/realtime`,a(e))};export{d as c,p};