PageSourceSearch

https://digitalbehandling.se/assets/PresenterMirror-B9uGza7R.js

js digitalbehandling.se collected 2026-09-30 08:26:44 UTC 3,467 bytes, 1 lines download raw bytes

1import{u as D,r as i,s as o,j as e,_ as E,e as L}from"./index-CobRY8C4.js";import{u as F}from"./usePDFSignedUrl-Ci_4HX7F.js";import{u as v,a as O}from"./useEffectivePageList-CbH3XlNY.js";import{c as q,a as C,M as V}from"./presenterMirrorWindowBridge-OMeY-ggi.js";import"./useProgramStepOverrides-CDPnPK9l.js";const H=()=>{const{programId:c}=D(),[t,w]=i.useState(null),[j,l]=i.useState(!1),[b,u]=i.useState(!1),n=i.useRef(!1);i.useEffect(()=>{if(!c)return;const r=q(c),s=C(c),f=async({access_token:a,refresh_token:M})=>{if(u(!1),n.current){l(!0);return}const{data:U}=await o.auth.getSession();U.session||await o.auth.setSession({access_token:a,refresh_token:M}),n.current=!0,l(!0)},x=a=>{u(!1),w(a)},R=r.subscribe(x),A=r.onAuth(f),T=s.onState(x),I=s.onAuth(f);r.requestSync(),s.announceReady(),o.auth.getSession().then(({data:a})=>{a.session&&(n.current=!0,l(!0))});let h=0;const g=window.setInterval(()=>{if(h+=1,h>40){window.clearInterval(g);return}r.requestSync(),s.announceReady()},1500),B=window.setTimeout(()=>{n.current||u(!0)},12e3);return()=>{window.clearTimeout(B),window.clearInterval(g),R(),A(),T(),I(),r.close(),s.close()}},[c]);const y=(t==null?void 0:t.activeStepStoragePath)??void 0,d=(t==null?void 0:t.currentPage)??1,{url:m}=F(j?y:void 0),S=v(m,d),{effectivePages:N}=O((t==null?void 0:t.activeStepId)??null,S.docNumPages),P=async r=>{const{data:s}=await o.storage.from("program-content").createSignedUrl(r,3600);return(s==null?void 0:s.signedUrl)??null},{canvasRef:k,pdfRendering:p}=v(m,d,{effectivePages:N,getReplacementUrl:P});return b&&!n.current?e.jsxs("div",{className:"h-screen flex flex-col items-center justify-center bg-black text-white gap-3 px-8 text-center",children:[e.jsx(E,{className:"w-10 h-10 text-amber-400"}),e.jsx("div",{className:"text-lg",children:"Väntar fortfarande på presenter-vyn…"}),e.jsx("div",{className:"text-sm opacity-70 max-w-md",children:"Projektorfönstret fortsätter försöka koppla automatiskt. Öppna presenter-vyn i det andra fönstret — så ansluter denna skärm av sig själv."}),e.jsx("div",{className:"text-xs opacity-50 max-w-md",children:'Om inget händer: stäng fönstret, gå till presenter-vyn och klicka på "Öppna projektor" igen. Kontrollera även att popup-blockerare är avstängd för denna sida.'})]}):t?e.jsxs("div",{className:"h-screen w-screen bg-black flex flex-col",children:[e.jsxs("div",{className:"absolute top-3 left-4 text-white/70 text-sm pointer-events-none select-none",children:[t.programName,t.contextLabel?` — ${t.contextLabel}`:"",t.activeStepTitle?` · ${t.activeStepTitle}`:""]}),e.jsxs("div",{className:"flex-1 flex items-center justify-center overflow-hidden",children:[p&&e.jsx(L,{className:"w-8 h-8 animate-spin text-white/60 absolute"}),m?e.jsx("canvas",{ref:k,className:"max-h-full max-w-full object-contain",style:{visibility:p?"hidden":"visible"}}):e.jsx("div",{className:"text-white/60 text-sm",children:"Ingen PDF för aktuellt steg."})]}),e.jsxs("div",{className:"absolute bottom-3 right-4 text-white/50 text-xs select-none",children:["Sida ",d]})]}):e.jsxs("div",{className:"h-screen flex flex-col items-center justify-center bg-black text-white gap-3",children:[e.jsx(V,{className:"w-10 h-10 opacity-60"}),e.jsx("div",{className:"text-lg",children:"Väntar på presenter…"}),e.jsx("div",{className:"text-sm opacity-60",children:"Öppna projektorn från presenter-vyn. Detta fönster ska visas på den externa skärmen."})]})};export{H as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.