@deephaven/code-studio 0.37.1-logout.13 → 0.37.1-logout.15
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/assets/{AppRoot-5de935b1.js → AppRoot-c8448674.js} +4 -4
- package/build/assets/{AppRoot-5de935b1.js.map → AppRoot-c8448674.js.map} +1 -1
- package/build/assets/{index-2113daad.js → index-35c18da1.js} +2 -2
- package/build/assets/{index-2113daad.js.map → index-35c18da1.js.map} +1 -1
- package/build/assets/{index-fc7868b1.js → index-bf15c1c2.js} +2 -2
- package/build/assets/{index-fc7868b1.js.map → index-bf15c1c2.js.map} +1 -1
- package/build/assets/{useConnection-2b92105d.js → useConnection-42b98437.js} +2 -2
- package/build/assets/{useConnection-2b92105d.js.map → useConnection-42b98437.js.map} +1 -1
- package/build/index.html +2 -2
- package/package.json +31 -31
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{H as ae,A as t,K as W,C as n,aG as S,F as ie,D as re}from"./vendor-6baa757f.js";import{T as j,L as N,B as R,c as le}from"./index-2113daad.js";import{a as ue,u as O,C as ce,i as ee,h as ne,r as de,L as fe,j as ge,k as he,B as me,n as pe,o as Ce,m as xe,p as Le,P as we,q as Ae,d as Ee,s as Pe,t as ve,v as Se,w as Te}from"./useConnection-2b92105d.js";import{x as xn,R as Ln,D as wn,F as An,l as En,z as Pn,y as vn,A as Sn,e as Tn,f as kn}from"./useConnection-2b92105d.js";import"./helpers-042e6b4d.js";import"./monaco-a26f85af.js";const ke=.025,be=.9,ye=.1,je=.618,D=j["primary-dark"],q=80,Ne=j["gray-800"],Re=j["gray-900"],P={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},A=18,Oe=250,Ie=60*1e3,_e=ae.memo(()=>{const e=t.useRef(null),s=t.useRef(null),[o,a]=t.useState(!1),u=window.devicePixelRatio;let i,m,d,c,g,f=null,h=[];function L(){s.current!=null&&(d=s.current.offsetWidth,c=s.current.offsetHeight),e.current!=null&&(e.current.style.width=`${d}px`,e.current.style.height=`${c}px`,e.current.width=d*u,e.current.height=c*u),i?.scale(u,u)}function I(){const l=document.createElement("canvas");l.width=P.SIZE,l.height=P.SIZE;const r=l.getContext("2d");return r!=null&&(r.fillStyle=D,r.fillRect(0,0,P.DOT_SIZE,P.DOT_SIZE),r.fillStyle=D+Math.round(255*P.FILL_OPACITY).toString(16).padStart(2,"0"),r.fillRect(0,0,P.SIZE,P.SIZE)),r?.createPattern(l,"repeat")}function w(l){const r=Math.random()-.5;let C=ke*r;return l<ye?C=Math.abs(C):l>be&&(C=-Math.abs(C)),l+C}function k(){const l=[];let r=je;for(let C=0;C<d+A;C+=1)r=w(r),l.push(r);return l}function b(){for(;h.length>=d+A;)h.pop();for(;h.length<d+A;)h.push(w(h[h.length-1]))}function _(l,r){r.beginPath(),r.moveTo(-1,c+1),r.lineTo(-1,c*l[0]);for(let C=0;C<l.length;C+=1)r.lineTo(C,c*l[C]);r.lineTo(d+A,c*l[l.length-1]),r.lineTo(d+A,c+1),r.closePath()}function F(l){l.beginPath();for(let r=1;r<d;r+=q)l.moveTo(r,0),l.lineTo(r,c);for(let r=1;r<c;r+=q)l.moveTo(0,r),l.lineTo(d,r)}function p(l){f=f??l,ue(i),i.fillStyle=Re,i.fillRect(0,0,d,c),F(i),i.lineWidth=1,i.strokeStyle=Ne,i.stroke();const r=((f??0)-(l??0))/(1e3/A);if(i.translate(r,0),_(h,i),i.lineWidth=2,i.strokeStyle=D,i.stroke(),i.translate(-r,0),m!=null&&(i.fillStyle=m),i.fill(),i.setTransform(u,0,0,u,0,0),(l??0)-(f??0)>1e3/A){const C=Math.floor(((l??0)-(f??0))/(1e3/A));for(let Z=0;Z<C;Z+=1)h.shift(),h.push(w(h[h.length-1]));f=l}g!=null&&cancelAnimationFrame(g),g=requestAnimationFrame(p)}const v=W(()=>{g=requestAnimationFrame(l=>{L(),b(),a(!1),p(l)})},Oe,{leading:!0});function x(){a(!0),g!=null&&cancelAnimationFrame(g),g=null,f=null}const E=W(()=>{x()},Ie);function M(){g==null&&(a(!1),L(),b(),g=requestAnimationFrame(p)),E()}function y(){document.hasFocus()&&M()}function K(){g!=null&&cancelAnimationFrame(g),E(),v()}return t.useEffect(()=>(i=e.current?.getContext("2d",{alpha:!1}),L(),h=k(),m=I(),p(),E(),window.addEventListener("resize",K),window.addEventListener("focus",M),window.addEventListener("blur",x),window.addEventListener("mousemove",y),window.addEventListener("keydown",y),()=>{g!=null&&cancelAnimationFrame(g),window.removeEventListener("resize",K),window.removeEventListener("focus",M),window.removeEventListener("blur",x),window.removeEventListener("mousemove",y),window.removeEventListener("keydown",y),E.cancel(),v.cancel()}),[]),n.jsx("div",{className:"random-area-plot-animation-container",ref:s,children:n.jsx("canvas",{ref:e,className:o?"shade":""})})}),Fe=_e,Me="io.deephaven.auth.AnonymousAuthenticationHandler",z=N.module("AuthPluginBase");function te({children:e,getLoginOptions:s}){const o=O(),[a,u]=t.useState(),[i,m]=t.useState(!1);return t.useEffect(()=>{let d=!1;function c(){if(d)throw new ce("Login canceled.")}async function g(){try{const f=await s();c(),z.info("Logging in..."),await o.login(f),c(),m(!0)}catch(f){d||(z.error("Unable to login:",f),u(f),m(!1))}}return g(),()=>{d=!0}},[o,s]),i?n.jsx(n.Fragment,{children:e}):n.jsx(R,{"data-testid":"auth-base-loading",isLoading:a==null,isLoaded:!1,errorMessage:a!=null?`${a}`:null})}const De={canLogout:!1};function $e({children:e}){const s=ee(),o=t.useCallback(async()=>({type:s.CoreClient.LOGIN_TYPE_ANONYMOUS}),[s]);return n.jsx(te,{getLoginOptions:o,children:n.jsx(ne.Provider,{value:De,children:e})})}const Ue={Component:$e,isAvailable:e=>e.includes(Me)},Be=Ue,He=N.module("AuthPluginParent"),Ye={canLogout:!1};function Ge(){return He.info("Logging in by delegating to parent window..."),de(fe)}function Ke(){return new URLSearchParams(window.location.search).get("authProvider")??""}function Ze({children:e}){return n.jsx(te,{getLoginOptions:Ge,children:n.jsx(ne.Provider,{value:Ye,children:e})})}const We={Component:Ze,isAvailable:()=>window.opener!=null&&Ke()==="parent"},qe=We,V=N.module("useBroadcastChannel");function Y(e=he,s=me){const o=t.useMemo(()=>new BroadcastChannel(s),[s]);return t.useEffect(()=>()=>{o.close()},[o]),t.useEffect(()=>{o.onmessage=a=>{const{data:u}=a;if(!ge(u)){V.debug("Ignoring non-deephaven message",u);return}V.debug("event received",u),e(a)}},[o,e]),o}function G(e,s){const o=t.useCallback(a=>{pe(a.data)?e?.(a.data):Ce(a.data)&&s?.(a.data)},[e,s]);Y(o)}const U="io.deephaven.web.client.auth.refreshToken",ze=t.createContext(null);function J(){const e=S.get(U);return e!=null?JSON.parse(e):null}function Q(e){if(e!=null){const s=JSON.stringify({bytes:e.bytes,expiry:e.expiry}),o=new Date(e.expiry);S.set(U,s,{secure:!0,sameSite:"strict",expires:o})}else S.remove(U)}function Ve({children:e}){const s=ee(),o=O(),a=Y(),[u,i]=t.useState(J());t.useEffect(function(){return o.addEventListener(s.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,f=>{const{detail:h}=f;Q(h),i(h)})},[s,a,o,u]);const m=t.useCallback(()=>{i(J())},[]),d=t.useCallback(()=>{Q(null),i(null)},[]);return G(m,d),n.jsx(ze.Provider,{value:u,children:e})}function Je({children:e,errorMessage:s,isLoggingIn:o=!1,onSubmit:a}){return n.jsxs("form",{className:"login-form",onSubmit:u=>{u.preventDefault(),u.stopPropagation(),a?.(u)},children:[n.jsx("div",{className:"flex-spacer"}),n.jsxs("div",{className:"flex-wrapper",children:[n.jsx("fieldset",{disabled:o,className:"container-fluid",children:e}),n.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:n.jsxs("button",{type:"submit",className:ie("btn btn-primary",{"btn-spinner":o},{"btn-cancelable":o}),"data-testid":"btn-login",children:[o&&n.jsxs("span",{children:[n.jsx(le,{}),n.jsx("span",{className:"btn-normal-content",children:"Logging in"}),n.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!o&&"Login"]})})]}),n.jsx("div",{className:"flex-spacer",children:s!=null&&n.jsx("p",{className:"error-message mb-0",role:"alert",children:`${s}`})})]})}function Qe({children:e}){return n.jsxs("div",{className:"login-container",children:[n.jsx(Fe,{}),n.jsxs("div",{className:"login-box",children:[n.jsx("div",{className:"logo",children:n.jsx("img",{src:"/logo",alt:"Deephaven Data Labs"})}),e,n.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}const B="io.deephaven.authentication.psk.PskAuthenticationHandler",se="psk",H="io.deephaven.web.client.auth.psk.token",T=N.module("AuthPluginPsk");function Xe(){return new URLSearchParams(window.location.search).get(se)}function en(){T.debug2("clearWindowToken");const e=new URLSearchParams(window.location.search);e.delete(se);let s=`${e}`;s.length>0&&(s=`?${s}`);const o=`${window.location.pathname}${s}${window.location.hash}`;window.history.replaceState(null,"",o)}function X(){return S.get(H)??null}function $(e){T.debug2("Storing token in cookie",e),e!=null?S.set(H,e,{secure:!0,sameSite:"strict"}):S.remove(H)}function nn({children:e}){const s=O(),o=t.useRef(null),a=t.useRef(null),[u,i]=t.useState(),[m,d]=t.useState(!1),[c,g]=t.useState(!1),[f,h]=t.useState(!1),[L,I]=t.useState(""),w=t.useCallback(async(p,v=!0)=>{T.info("Logging in..."),h(!0);let x=null;try{if(x=s.login({type:B,token:p}),a.current=x,await x,T.info("Logged in successfully"),a.current!==x)return;$(p),g(!0)}catch(E){if(a.current!==x)return;d(!0),v&&i(E?.detail??"Unable to login: Verify credentials.")}h(!1)},[s]),k=t.useCallback(()=>{a.current=null,h(!1)},[]),b=t.useCallback(async()=>{T.debug("onLogin");const p=X();c||f||p==null||w(p,!1)},[c,f,w]),_=t.useCallback(()=>{$(null)},[]);G(b,_),t.useEffect(()=>{let p=!1;async function v(){const x=Xe()??X();if(en(),x==null){d(!0);return}h(!0);try{await s.login({type:B,token:x}),p||($(x),g(!0),h(!1))}catch{p||(d(!0),h(!1))}}return v(),()=>{p=!0}},[s]);const F=t.useCallback(()=>{f?k():w(L)},[k,f,w,L]);return t.useEffect(function(){o.current?.focus()},[o,m]),n.jsxs(n.Fragment,{children:[c&&e,m&&n.jsx(re,{in:!c,timeout:j.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:n.jsx(Qe,{children:n.jsx(Je,{errorMessage:u!=null?`${u}`:void 0,isLoggingIn:f,onSubmit:F,children:n.jsxs("div",{className:"form-group",children:[n.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),n.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:o,value:L,onChange:p=>{i(void 0),I(p.target.value)}})]})})})}),n.jsx(R,{"data-testid":"auth-psk-loading",isLoaded:c||m,isLoading:!c&&!m})]})}const tn={Component:nn,isAvailable:e=>e.includes(B)},sn=tn,oe=t.createContext(!1);function on({fontClassNames:e=["fira-sans-regular","fira-sans-bold","fira-mono"],children:s}){const[o,a]=t.useState(!1);return t.useEffect(function(){document.fonts.ready.then(()=>{a(!0)})},[]),n.jsxs(n.Fragment,{children:[n.jsx(oe.Provider,{value:o,children:s}),n.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(u=>n.jsx("p",{className:u,children:"preload"},u))})]})}function an(){const e=Y();return t.useEffect(function(){e.postMessage(xe(Le))},[e]),null}const rn=new Map([["@deephaven/auth-plugins.AuthPluginPsk",sn],["@deephaven/auth-plugins.AuthPluginParent",qe],["@deephaven/auth-plugins.AuthPluginAnonymous",Be]]);function ln({children:e}){const s=O(),o=t.useContext(we),[a,u]=t.useState(),[i,m]=t.useState();t.useEffect(function(){let f=!1;async function h(){try{const L=await s.getAuthConfigValues();f||u(new Map(L))}catch(L){f||m(L)}}return h(),()=>{f=!0}},[s]);const d=t.useMemo(()=>{if(!(o==null||a==null))try{return Ae(o,a,rn)}catch(g){m(g)}},[a,o]),c=d==null||a==null;return c||i!=null?n.jsx(R,{isLoading:c,errorMessage:i!=null?`${i}`:void 0}):n.jsx(d,{authConfigValues:a,children:n.jsxs(n.Fragment,{children:[n.jsx(an,{}),e]})})}function un({children:e}){return t.useContext(oe)?n.jsx(n.Fragment,{children:e}):n.jsx(R,{"data-testid":"fonts-loaded-loading"})}function mn({apiUrl:e,fontClassNames:s,pluginsUrl:o,children:a}){const u=Ee(e).origin,i=t.useMemo(()=>Pe(),[]),[m,d]=t.useState(0),c=t.useCallback(()=>{},[]),g=t.useCallback(()=>{d(f=>f+1)},[]);return G(c,g),n.jsx(on,{fontClassNames:s,children:n.jsx(ve,{pluginsUrl:o,children:n.jsx(Se,{serverUrl:u,options:i,children:n.jsx(Ve,{children:n.jsx(ln,{children:n.jsx(Te,{children:n.jsx(un,{children:a})})})})},m)})})}export{mn as AppBootstrap,ln as AuthBootstrap,Te as ConnectionBootstrap,xn as ConnectionContext,on as FontBootstrap,un as FontsLoaded,oe as FontsLoadedContext,ve as PluginsBootstrap,we as PluginsContext,Ln as RemoteComponent,wn as getAuthHandlers,Ae as getAuthPluginComponent,Ee as getBaseUrl,Pe as getConnectOptions,An as getEnvoyPrefix,En as loadComponentPlugin,Pn as loadJson,vn as loadModulePlugin,Sn as loadModulePlugins,Tn as useConnection,kn as usePlugins};
|
|
2
|
-
//# sourceMappingURL=index-
|
|
1
|
+
import{H as ae,A as t,K as W,C as n,aG as S,F as ie,D as re}from"./vendor-6baa757f.js";import{T as j,L as N,B as R,c as le}from"./index-35c18da1.js";import{a as ue,u as O,C as ce,i as ee,h as ne,r as de,L as fe,j as ge,k as he,B as me,n as pe,o as Ce,m as xe,p as Le,P as we,q as Ae,d as Ee,s as Pe,t as ve,v as Se,w as Te}from"./useConnection-42b98437.js";import{x as xn,R as Ln,D as wn,F as An,l as En,z as Pn,y as vn,A as Sn,e as Tn,f as kn}from"./useConnection-42b98437.js";import"./helpers-042e6b4d.js";import"./monaco-a26f85af.js";const ke=.025,be=.9,ye=.1,je=.618,D=j["primary-dark"],q=80,Ne=j["gray-800"],Re=j["gray-900"],P={SIZE:8,DOT_SIZE:2,FILL_OPACITY:.25},A=18,Oe=250,Ie=60*1e3,_e=ae.memo(()=>{const e=t.useRef(null),s=t.useRef(null),[o,a]=t.useState(!1),u=window.devicePixelRatio;let i,m,d,c,g,f=null,h=[];function L(){s.current!=null&&(d=s.current.offsetWidth,c=s.current.offsetHeight),e.current!=null&&(e.current.style.width=`${d}px`,e.current.style.height=`${c}px`,e.current.width=d*u,e.current.height=c*u),i?.scale(u,u)}function I(){const l=document.createElement("canvas");l.width=P.SIZE,l.height=P.SIZE;const r=l.getContext("2d");return r!=null&&(r.fillStyle=D,r.fillRect(0,0,P.DOT_SIZE,P.DOT_SIZE),r.fillStyle=D+Math.round(255*P.FILL_OPACITY).toString(16).padStart(2,"0"),r.fillRect(0,0,P.SIZE,P.SIZE)),r?.createPattern(l,"repeat")}function w(l){const r=Math.random()-.5;let C=ke*r;return l<ye?C=Math.abs(C):l>be&&(C=-Math.abs(C)),l+C}function k(){const l=[];let r=je;for(let C=0;C<d+A;C+=1)r=w(r),l.push(r);return l}function b(){for(;h.length>=d+A;)h.pop();for(;h.length<d+A;)h.push(w(h[h.length-1]))}function _(l,r){r.beginPath(),r.moveTo(-1,c+1),r.lineTo(-1,c*l[0]);for(let C=0;C<l.length;C+=1)r.lineTo(C,c*l[C]);r.lineTo(d+A,c*l[l.length-1]),r.lineTo(d+A,c+1),r.closePath()}function F(l){l.beginPath();for(let r=1;r<d;r+=q)l.moveTo(r,0),l.lineTo(r,c);for(let r=1;r<c;r+=q)l.moveTo(0,r),l.lineTo(d,r)}function p(l){f=f??l,ue(i),i.fillStyle=Re,i.fillRect(0,0,d,c),F(i),i.lineWidth=1,i.strokeStyle=Ne,i.stroke();const r=((f??0)-(l??0))/(1e3/A);if(i.translate(r,0),_(h,i),i.lineWidth=2,i.strokeStyle=D,i.stroke(),i.translate(-r,0),m!=null&&(i.fillStyle=m),i.fill(),i.setTransform(u,0,0,u,0,0),(l??0)-(f??0)>1e3/A){const C=Math.floor(((l??0)-(f??0))/(1e3/A));for(let Z=0;Z<C;Z+=1)h.shift(),h.push(w(h[h.length-1]));f=l}g!=null&&cancelAnimationFrame(g),g=requestAnimationFrame(p)}const v=W(()=>{g=requestAnimationFrame(l=>{L(),b(),a(!1),p(l)})},Oe,{leading:!0});function x(){a(!0),g!=null&&cancelAnimationFrame(g),g=null,f=null}const E=W(()=>{x()},Ie);function M(){g==null&&(a(!1),L(),b(),g=requestAnimationFrame(p)),E()}function y(){document.hasFocus()&&M()}function K(){g!=null&&cancelAnimationFrame(g),E(),v()}return t.useEffect(()=>(i=e.current?.getContext("2d",{alpha:!1}),L(),h=k(),m=I(),p(),E(),window.addEventListener("resize",K),window.addEventListener("focus",M),window.addEventListener("blur",x),window.addEventListener("mousemove",y),window.addEventListener("keydown",y),()=>{g!=null&&cancelAnimationFrame(g),window.removeEventListener("resize",K),window.removeEventListener("focus",M),window.removeEventListener("blur",x),window.removeEventListener("mousemove",y),window.removeEventListener("keydown",y),E.cancel(),v.cancel()}),[]),n.jsx("div",{className:"random-area-plot-animation-container",ref:s,children:n.jsx("canvas",{ref:e,className:o?"shade":""})})}),Fe=_e,Me="io.deephaven.auth.AnonymousAuthenticationHandler",z=N.module("AuthPluginBase");function te({children:e,getLoginOptions:s}){const o=O(),[a,u]=t.useState(),[i,m]=t.useState(!1);return t.useEffect(()=>{let d=!1;function c(){if(d)throw new ce("Login canceled.")}async function g(){try{const f=await s();c(),z.info("Logging in..."),await o.login(f),c(),m(!0)}catch(f){d||(z.error("Unable to login:",f),u(f),m(!1))}}return g(),()=>{d=!0}},[o,s]),i?n.jsx(n.Fragment,{children:e}):n.jsx(R,{"data-testid":"auth-base-loading",isLoading:a==null,isLoaded:!1,errorMessage:a!=null?`${a}`:null})}const De={canLogout:!1};function $e({children:e}){const s=ee(),o=t.useCallback(async()=>({type:s.CoreClient.LOGIN_TYPE_ANONYMOUS}),[s]);return n.jsx(te,{getLoginOptions:o,children:n.jsx(ne.Provider,{value:De,children:e})})}const Ue={Component:$e,isAvailable:e=>e.includes(Me)},Be=Ue,He=N.module("AuthPluginParent"),Ye={canLogout:!1};function Ge(){return He.info("Logging in by delegating to parent window..."),de(fe)}function Ke(){return new URLSearchParams(window.location.search).get("authProvider")??""}function Ze({children:e}){return n.jsx(te,{getLoginOptions:Ge,children:n.jsx(ne.Provider,{value:Ye,children:e})})}const We={Component:Ze,isAvailable:()=>window.opener!=null&&Ke()==="parent"},qe=We,V=N.module("useBroadcastChannel");function Y(e=he,s=me){const o=t.useMemo(()=>new BroadcastChannel(s),[s]);return t.useEffect(()=>()=>{o.close()},[o]),t.useEffect(()=>{o.onmessage=a=>{const{data:u}=a;if(!ge(u)){V.debug("Ignoring non-deephaven message",u);return}V.debug("event received",u),e(a)}},[o,e]),o}function G(e,s){const o=t.useCallback(a=>{pe(a.data)?e?.(a.data):Ce(a.data)&&s?.(a.data)},[e,s]);Y(o)}const U="io.deephaven.web.client.auth.refreshToken",ze=t.createContext(null);function J(){const e=S.get(U);return e!=null?JSON.parse(e):null}function Q(e){if(e!=null){const s=JSON.stringify({bytes:e.bytes,expiry:e.expiry}),o=new Date(e.expiry);S.set(U,s,{secure:!0,sameSite:"strict",expires:o})}else S.remove(U)}function Ve({children:e}){const s=ee(),o=O(),a=Y(),[u,i]=t.useState(J());t.useEffect(function(){return o.addEventListener(s.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,f=>{const{detail:h}=f;Q(h),i(h)})},[s,a,o,u]);const m=t.useCallback(()=>{i(J())},[]),d=t.useCallback(()=>{Q(null),i(null)},[]);return G(m,d),n.jsx(ze.Provider,{value:u,children:e})}function Je({children:e,errorMessage:s,isLoggingIn:o=!1,onSubmit:a}){return n.jsxs("form",{className:"login-form",onSubmit:u=>{u.preventDefault(),u.stopPropagation(),a?.(u)},children:[n.jsx("div",{className:"flex-spacer"}),n.jsxs("div",{className:"flex-wrapper",children:[n.jsx("fieldset",{disabled:o,className:"container-fluid",children:e}),n.jsx("div",{className:"form-group d-flex justify-content-end align-items-center mb-0",children:n.jsxs("button",{type:"submit",className:ie("btn btn-primary",{"btn-spinner":o},{"btn-cancelable":o}),"data-testid":"btn-login",children:[o&&n.jsxs("span",{children:[n.jsx(le,{}),n.jsx("span",{className:"btn-normal-content",children:"Logging in"}),n.jsx("span",{className:"btn-hover-content",children:"Cancel"})]}),!o&&"Login"]})})]}),n.jsx("div",{className:"flex-spacer",children:s!=null&&n.jsx("p",{className:"error-message mb-0",role:"alert",children:`${s}`})})]})}function Qe({children:e}){return n.jsxs("div",{className:"login-container",children:[n.jsx(Fe,{}),n.jsxs("div",{className:"login-box",children:[n.jsx("div",{className:"logo",children:n.jsx("img",{src:"/logo",alt:"Deephaven Data Labs"})}),e,n.jsxs("p",{className:"footer",children:["© 2016-",new Date().getFullYear()," Deephaven Data Labs LLC. Patent Pending."]})]})]})}const B="io.deephaven.authentication.psk.PskAuthenticationHandler",se="psk",H="io.deephaven.web.client.auth.psk.token",T=N.module("AuthPluginPsk");function Xe(){return new URLSearchParams(window.location.search).get(se)}function en(){T.debug2("clearWindowToken");const e=new URLSearchParams(window.location.search);e.delete(se);let s=`${e}`;s.length>0&&(s=`?${s}`);const o=`${window.location.pathname}${s}${window.location.hash}`;window.history.replaceState(null,"",o)}function X(){return S.get(H)??null}function $(e){T.debug2("Storing token in cookie",e),e!=null?S.set(H,e,{secure:!0,sameSite:"strict"}):S.remove(H)}function nn({children:e}){const s=O(),o=t.useRef(null),a=t.useRef(null),[u,i]=t.useState(),[m,d]=t.useState(!1),[c,g]=t.useState(!1),[f,h]=t.useState(!1),[L,I]=t.useState(""),w=t.useCallback(async(p,v=!0)=>{T.info("Logging in..."),h(!0);let x=null;try{if(x=s.login({type:B,token:p}),a.current=x,await x,T.info("Logged in successfully"),a.current!==x)return;$(p),g(!0)}catch(E){if(a.current!==x)return;d(!0),v&&i(E?.detail??"Unable to login: Verify credentials.")}h(!1)},[s]),k=t.useCallback(()=>{a.current=null,h(!1)},[]),b=t.useCallback(async()=>{T.debug("onLogin");const p=X();c||f||p==null||w(p,!1)},[c,f,w]),_=t.useCallback(()=>{$(null)},[]);G(b,_),t.useEffect(()=>{let p=!1;async function v(){const x=Xe()??X();if(en(),x==null){d(!0);return}h(!0);try{await s.login({type:B,token:x}),p||($(x),g(!0),h(!1))}catch{p||(d(!0),h(!1))}}return v(),()=>{p=!0}},[s]);const F=t.useCallback(()=>{f?k():w(L)},[k,f,w,L]);return t.useEffect(function(){o.current?.focus()},[o,m]),n.jsxs(n.Fragment,{children:[c&&e,m&&n.jsx(re,{in:!c,timeout:j.transitionMs,classNames:"fade",mountOnEnter:!0,unmountOnExit:!0,children:n.jsx(Qe,{children:n.jsx(Je,{errorMessage:u!=null?`${u}`:void 0,isLoggingIn:f,onSubmit:F,children:n.jsxs("div",{className:"form-group",children:[n.jsx("label",{htmlFor:"auth-psk-token-input",children:"Token"}),n.jsx("input",{id:"auth-psk-token-input",name:"token",className:"input-token form-control",type:"text",autoComplete:"username",autoCapitalize:"none",autoCorrect:"off",spellCheck:"false",ref:o,value:L,onChange:p=>{i(void 0),I(p.target.value)}})]})})})}),n.jsx(R,{"data-testid":"auth-psk-loading",isLoaded:c||m,isLoading:!c&&!m})]})}const tn={Component:nn,isAvailable:e=>e.includes(B)},sn=tn,oe=t.createContext(!1);function on({fontClassNames:e=["fira-sans-regular","fira-sans-bold","fira-mono"],children:s}){const[o,a]=t.useState(!1);return t.useEffect(function(){document.fonts.ready.then(()=>{a(!0)})},[]),n.jsxs(n.Fragment,{children:[n.jsx(oe.Provider,{value:o,children:s}),n.jsx("div",{id:"preload-fonts",style:{visibility:"hidden",position:"absolute",top:-1e4},children:e.map(u=>n.jsx("p",{className:u,children:"preload"},u))})]})}function an(){const e=Y();return t.useEffect(function(){e.postMessage(xe(Le))},[e]),null}const rn=new Map([["@deephaven/auth-plugins.AuthPluginPsk",sn],["@deephaven/auth-plugins.AuthPluginParent",qe],["@deephaven/auth-plugins.AuthPluginAnonymous",Be]]);function ln({children:e}){const s=O(),o=t.useContext(we),[a,u]=t.useState(),[i,m]=t.useState();t.useEffect(function(){let f=!1;async function h(){try{const L=await s.getAuthConfigValues();f||u(new Map(L))}catch(L){f||m(L)}}return h(),()=>{f=!0}},[s]);const d=t.useMemo(()=>{if(!(o==null||a==null))try{return Ae(o,a,rn)}catch(g){m(g)}},[a,o]),c=d==null||a==null;return c||i!=null?n.jsx(R,{isLoading:c,errorMessage:i!=null?`${i}`:void 0}):n.jsx(d,{authConfigValues:a,children:n.jsxs(n.Fragment,{children:[n.jsx(an,{}),e]})})}function un({children:e}){return t.useContext(oe)?n.jsx(n.Fragment,{children:e}):n.jsx(R,{"data-testid":"fonts-loaded-loading"})}function mn({apiUrl:e,fontClassNames:s,pluginsUrl:o,children:a}){const u=Ee(e).origin,i=t.useMemo(()=>Pe(),[]),[m,d]=t.useState(0),c=t.useCallback(()=>{},[]),g=t.useCallback(()=>{d(f=>f+1)},[]);return G(c,g),n.jsx(on,{fontClassNames:s,children:n.jsx(ve,{pluginsUrl:o,children:n.jsx(Se,{serverUrl:u,options:i,children:n.jsx(Ve,{children:n.jsx(ln,{children:n.jsx(Te,{children:n.jsx(un,{children:a})})})})},m)})})}export{mn as AppBootstrap,ln as AuthBootstrap,Te as ConnectionBootstrap,xn as ConnectionContext,on as FontBootstrap,un as FontsLoaded,oe as FontsLoadedContext,ve as PluginsBootstrap,we as PluginsContext,Ln as RemoteComponent,wn as getAuthHandlers,Ae as getAuthPluginComponent,Ee as getBaseUrl,Pe as getConnectOptions,An as getEnvoyPrefix,En as loadComponentPlugin,Pn as loadJson,vn as loadModulePlugin,Sn as loadModulePlugins,Tn as useConnection,kn as usePlugins};
|
|
2
|
+
//# sourceMappingURL=index-bf15c1c2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-fc7868b1.js","sources":["../../../components/src/RandomAreaPlotAnimation.tsx","../../../auth-plugins/src/AuthHandlerTypes.ts","../../../auth-plugins/src/AuthPluginBase.tsx","../../../auth-plugins/src/AuthPluginAnonymous.tsx","../../../auth-plugins/src/AuthPluginParent.tsx","../../../jsapi-components/src/useBroadcastChannel.ts","../../../jsapi-components/src/useBroadcastLoginListener.ts","../../../jsapi-components/src/RefreshTokenUtils.ts","../../../jsapi-components/src/RefreshTokenBootstrap.tsx","../../../auth-plugins/src/LoginForm.tsx","../../../auth-plugins/src/Login.tsx","../../../auth-plugins/src/AuthPluginPsk.tsx","../../../app-utils/src/components/FontBootstrap.tsx","../../../app-utils/src/components/LoginNotifier.tsx","../../../app-utils/src/components/AuthBootstrap.tsx","../../../app-utils/src/components/FontsLoaded.tsx","../../../app-utils/src/components/AppBootstrap.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable react/display-name */\n\nimport React, { useEffect, useState, useRef } from 'react';\nimport debounce from 'lodash.debounce';\nimport { assertNotNull } from '@deephaven/utils';\nimport './RandomAreaPlotAnimation.scss';\nimport ThemeExport from './ThemeExport';\n\nconst VOLATILITY = 0.025; // how spikey the data gets\nconst LOW = 0.9;\nconst HIGH = 0.1;\nconst START_Y = 0.618;\nconst FOREGROUND = ThemeExport['primary-dark'];\nconst GRID_SIZE = 80;\nconst GRID_COLOR = ThemeExport['gray-800'];\nconst BACKGROUND = ThemeExport['gray-900'];\nconst PATTERN = { SIZE: 8, DOT_SIZE: 2, FILL_OPACITY: 0.25 };\nconst PX_PER_SECOND = 18;\nconst RESIZE_DEBOUNCE = 250;\nconst INTERACTION_TIMEOUT = 60 * 1000;\n\n// Draw a background canvas, paint it with a fun chart looking animation\nconst RandomAreaPlotAnimation = React.memo(() => {\n const canvas = useRef<HTMLCanvasElement>(null);\n const container = useRef<HTMLDivElement>(null);\n const [shade, setShade] = useState(false);\n const scale = window.devicePixelRatio;\n\n let ctx: CanvasRenderingContext2D | null | undefined;\n let pattern: CanvasPattern | null | undefined;\n let width: number;\n let height: number;\n let rAF: number | null;\n\n let lastTimestamp: DOMHighResTimeStamp | null | undefined = null;\n let data: number[] = [];\n\n function setCanvasSize() {\n // Set canvas size to fill screen\n if (container.current != null) {\n width = container.current.offsetWidth;\n height = container.current.offsetHeight;\n }\n\n if (canvas.current != null) {\n canvas.current.style.width = `${width}px`;\n canvas.current.style.height = `${height}px`;\n\n canvas.current.width = width * scale;\n canvas.current.height = height * scale;\n }\n\n ctx?.scale(scale, scale);\n }\n\n // Returns the background fill create offscreen as pattern\n function createPatternFill() {\n // create the off-screen canvas\n const canvasPattern = document.createElement('canvas');\n canvasPattern.width = PATTERN.SIZE;\n canvasPattern.height = PATTERN.SIZE;\n const contextPattern = canvasPattern.getContext('2d');\n\n // draw pattern to off-screen context\n if (contextPattern != null) {\n contextPattern.fillStyle = FOREGROUND;\n contextPattern.fillRect(0, 0, PATTERN.DOT_SIZE, PATTERN.DOT_SIZE);\n\n // add an overlay fill\n contextPattern.fillStyle =\n FOREGROUND +\n Math.round(255 * PATTERN.FILL_OPACITY)\n .toString(16)\n .padStart(2, '0'); // adds opacity in hex to color\n contextPattern.fillRect(0, 0, PATTERN.SIZE, PATTERN.SIZE);\n }\n return contextPattern?.createPattern(canvasPattern, 'repeat');\n }\n\n /**\n * Generates a step in a random walk between LOW - HIGH given a previous value\n * data is always in 0-1 data space so its scaleable\n * data space is converted to screen space inside draw functions\n * @param prev previous random walk step\n * @return new random walk step\n */\n function randomWalk(prev: number): number {\n const rand = Math.random() - 0.5; // give it directionality\n let change = VOLATILITY * rand; // scale by volatity constant\n\n // ensure directional bounce off approaching edges\n if (prev < HIGH) {\n change = Math.abs(change);\n } else if (prev > LOW) {\n change = -Math.abs(change);\n }\n\n return prev + change;\n }\n\n function initData() {\n const startingData = [];\n let y = START_Y; // always start towards the bottom of the screen\n for (let x = 0; x < width + PX_PER_SECOND; x += 1) {\n y = randomWalk(y);\n startingData.push(y);\n }\n return startingData;\n }\n\n function setDataSize() {\n while (data.length >= width + PX_PER_SECOND) {\n data.pop();\n }\n while (data.length < width + PX_PER_SECOND) {\n data.push(randomWalk(data[data.length - 1]));\n }\n }\n\n function drawAreaLine(path: number[], context: CanvasRenderingContext2D) {\n context.beginPath();\n // start offscreen\n context.moveTo(-1, height + 1);\n context.lineTo(-1, height * path[0]);\n\n // draw the line\n for (let i = 0; i < path.length; i += 1) {\n context.lineTo(i, height * path[i]);\n }\n\n // close offscreen\n context.lineTo(width + PX_PER_SECOND, height * path[path.length - 1]);\n context.lineTo(width + PX_PER_SECOND, height + 1);\n context.closePath();\n }\n\n function drawGridLines(context: CanvasRenderingContext2D) {\n context.beginPath();\n // draw verticals\n for (let x = 1; x < width; x += GRID_SIZE) {\n context.moveTo(x, 0);\n context.lineTo(x, height);\n }\n // draw horizontals\n for (let y = 1; y < height; y += GRID_SIZE) {\n context.moveTo(0, y);\n context.lineTo(width, y);\n }\n }\n\n /**\n * Main draw loop for where the animation happens\n * all the styling happens within drawCanvas from paths generated by other functions\n * @param timestamp passed in callback from requestAnimationFrame\n */\n function drawCanvas(timestamp?: DOMHighResTimeStamp) {\n lastTimestamp = lastTimestamp ?? timestamp;\n\n assertNotNull(ctx);\n // clear the canvas\n ctx.fillStyle = BACKGROUND;\n ctx.fillRect(0, 0, width, height);\n\n drawGridLines(ctx);\n ctx.lineWidth = 1;\n ctx.strokeStyle = GRID_COLOR;\n ctx.stroke();\n\n // for speeds less then 60 px per second, subpixel motion is required to look smooth\n const subPixelMotion =\n ((lastTimestamp ?? 0) - (timestamp ?? 0)) / (1000 / PX_PER_SECOND);\n ctx.translate(subPixelMotion, 0);\n\n drawAreaLine(data, ctx);\n ctx.lineWidth = 2;\n ctx.strokeStyle = FOREGROUND;\n ctx.stroke();\n\n ctx.translate(-subPixelMotion, 0); // we don't pattern to shift however\n if (pattern != null) {\n ctx.fillStyle = pattern;\n }\n ctx.fill();\n ctx.setTransform(scale, 0, 0, scale, 0, 0); // reset the translate matrix to normal\n\n // generate new data points\n if ((timestamp ?? 0) - (lastTimestamp ?? 0) > 1000 / PX_PER_SECOND) {\n // number of points to add since last update\n const numberOfPoints = Math.floor(\n ((timestamp ?? 0) - (lastTimestamp ?? 0)) / (1000 / PX_PER_SECOND)\n );\n for (let i = 0; i < numberOfPoints; i += 1) {\n data.shift();\n data.push(randomWalk(data[data.length - 1]));\n }\n lastTimestamp = timestamp;\n }\n\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = requestAnimationFrame(drawCanvas);\n }\n\n // debounce the resize so its not overly aggresive\n const debouncedHandleResize = debounce(\n () => {\n rAF = requestAnimationFrame(timestamp => {\n setCanvasSize(); // setCanvas can cause lag if not debounced\n\n // fill or remove extra data points\n setDataSize();\n\n // opening devtools triggers a blur then resize,\n // need to reset shade as we are restarting animation\n setShade(false);\n drawCanvas(timestamp);\n });\n },\n RESIZE_DEBOUNCE,\n { leading: true } // resize immediately, once.\n );\n\n function pauseAnimation() {\n // pause animation when browser window is blurred to conserve CPU usage\n setShade(true);\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = null;\n lastTimestamp = null;\n }\n\n // when timeout expires, pause animation\n const resetIdleTimeout = debounce(() => {\n pauseAnimation();\n }, INTERACTION_TIMEOUT);\n\n function startAnimation() {\n // can fire multiple times, check if rAF is null first\n // restart animation loop, and fade back in\n if (rAF == null) {\n setShade(false);\n setCanvasSize();\n setDataSize();\n rAF = requestAnimationFrame(drawCanvas);\n }\n resetIdleTimeout();\n }\n\n function handleActivity() {\n if (document.hasFocus()) {\n // only if document has focus (mousemove can fire on non-focused tabs)\n startAnimation();\n }\n }\n\n function handleResize() {\n // pause and debounce animation during resize for better resizing performance\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n resetIdleTimeout(); // treat resizing as a form of activity\n debouncedHandleResize();\n }\n\n // react mount/unmount hooks\n useEffect(() => {\n ctx = canvas.current?.getContext('2d', { alpha: false });\n setCanvasSize();\n data = initData();\n pattern = createPatternFill();\n\n // start draw loop\n drawCanvas();\n resetIdleTimeout();\n\n window.addEventListener('resize', handleResize);\n\n window.addEventListener('focus', startAnimation);\n window.addEventListener('blur', pauseAnimation);\n\n // don't burn cpu if the user is \"idle\", start a timer that resets\n // on any user activity, and on timeout expiry pause the animation\n window.addEventListener('mousemove', handleActivity);\n window.addEventListener('keydown', handleActivity);\n\n return () => {\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n window.removeEventListener('resize', handleResize);\n window.removeEventListener('focus', startAnimation);\n window.removeEventListener('blur', pauseAnimation);\n\n window.removeEventListener('mousemove', handleActivity);\n window.removeEventListener('keydown', handleActivity);\n\n resetIdleTimeout.cancel();\n debouncedHandleResize.cancel();\n };\n }, []);\n\n return (\n <div className=\"random-area-plot-animation-container\" ref={container}>\n <canvas ref={canvas} className={shade ? 'shade' : ''} />\n </div>\n );\n});\n\nexport default RandomAreaPlotAnimation;\n","export const AUTH_HANDLER_TYPE_ANONYMOUS =\n 'io.deephaven.auth.AnonymousAuthenticationHandler';\n\nexport const AUTH_HANDLER_TYPE_PSK =\n 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n","import React, { useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport Log from '@deephaven/log';\nimport { LoginOptions } from '@deephaven/jsapi-types';\nimport { CanceledPromiseError } from '@deephaven/utils';\n\nconst log = Log.module('AuthPluginBase');\n\nexport type AuthPluginBaseProps = {\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n\n /**\n * Retrieve the login options for logging in to the client\n * @returns A promise for the login options\n */\n getLoginOptions: () => Promise<LoginOptions>;\n};\n\n/**\n * Base AuthPlugin that gets passed a function for retrieving the login options, and then attempting to login with them.\n * @param getLoginOptions Function that returns a promise for the login options\n */\nfunction AuthPluginBase({\n children,\n getLoginOptions,\n}: AuthPluginBaseProps): JSX.Element {\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n\n useEffect(() => {\n let isCanceled = false;\n function verifyNotCanceled() {\n if (isCanceled) {\n throw new CanceledPromiseError('Login canceled.');\n }\n }\n async function login() {\n try {\n const loginOptions = await getLoginOptions();\n verifyNotCanceled();\n\n log.info('Logging in...');\n await client.login(loginOptions);\n verifyNotCanceled();\n\n setIsLoggedIn(true);\n } catch (e) {\n if (!isCanceled) {\n log.error('Unable to login:', e);\n setError(e);\n setIsLoggedIn(false);\n }\n }\n }\n login();\n return () => {\n isCanceled = true;\n };\n }, [client, getLoginOptions]);\n\n if (!isLoggedIn) {\n return (\n <LoadingOverlay\n data-testid=\"auth-base-loading\"\n isLoading={error == null}\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default AuthPluginBase;\n","import React, { useCallback } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { AUTH_HANDLER_TYPE_ANONYMOUS } from './AuthHandlerTypes';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\nimport AuthPluginBase from './AuthPluginBase';\nimport {\n UserPermissionsOverride,\n UserPermissionsOverrideContext,\n} from './UserContexts';\n\nconst permissionsOverrides: UserPermissionsOverride = { canLogout: false };\n\n/**\n * AuthPlugin that tries to login anonymously. Fails if anonymous login fails\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n const dh = useApi();\n\n const getLoginOptions = useCallback(\n async () => ({ type: dh.CoreClient.LOGIN_TYPE_ANONYMOUS }),\n [dh]\n );\n\n return (\n <AuthPluginBase getLoginOptions={getLoginOptions}>\n <UserPermissionsOverrideContext.Provider value={permissionsOverrides}>\n {children}\n </UserPermissionsOverrideContext.Provider>\n </AuthPluginBase>\n );\n}\n\nconst AuthPluginAnonymous: AuthPlugin = {\n Component,\n isAvailable: authHandlers =>\n authHandlers.includes(AUTH_HANDLER_TYPE_ANONYMOUS),\n};\n\nexport default AuthPluginAnonymous;\n","import React from 'react';\nimport { LoginOptions } from '@deephaven/jsapi-types';\nimport {\n LOGIN_OPTIONS_REQUEST,\n requestParentResponse,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\nimport AuthPluginBase from './AuthPluginBase';\nimport {\n UserPermissionsOverride,\n UserPermissionsOverrideContext,\n} from './UserContexts';\n\nconst log = Log.module('AuthPluginParent');\n\nconst permissionsOverrides: UserPermissionsOverride = { canLogout: false };\n\nfunction getLoginOptions(): Promise<LoginOptions> {\n log.info('Logging in by delegating to parent window...');\n return requestParentResponse<LoginOptions>(LOGIN_OPTIONS_REQUEST);\n}\n\nfunction getWindowAuthProvider(): string {\n return new URLSearchParams(window.location.search).get('authProvider') ?? '';\n}\n\n/**\n * AuthPlugin that tries to delegate to the parent window for authentication. Fails if there is no parent window.\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n return (\n <AuthPluginBase getLoginOptions={getLoginOptions}>\n <UserPermissionsOverrideContext.Provider value={permissionsOverrides}>\n {children}\n </UserPermissionsOverrideContext.Provider>\n </AuthPluginBase>\n );\n}\n\nconst AuthPluginParent: AuthPlugin = {\n Component,\n isAvailable: () =>\n window.opener != null && getWindowAuthProvider() === 'parent',\n};\n\nexport default AuthPluginParent;\n","import {\n BROADCAST_CHANNEL_NAME,\n isMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport { useEffect, useMemo } from 'react';\n\nconst log = Log.module('useBroadcastChannel');\n\nexport function useBroadcastChannel(\n onEvent: (event: MessageEvent<Message<unknown>>) => void = EMPTY_FUNCTION,\n name = BROADCAST_CHANNEL_NAME\n) {\n const channel = useMemo(() => new BroadcastChannel(name), [name]);\n useEffect(\n () => () => {\n channel.close();\n },\n [channel]\n );\n\n useEffect(() => {\n channel.onmessage = (event: MessageEvent) => {\n const { data } = event;\n if (!isMessage(data)) {\n log.debug('Ignoring non-deephaven message', data);\n return;\n }\n log.debug('event received', data);\n onEvent(event);\n };\n }, [channel, onEvent]);\n\n return channel;\n}\n\nexport default useBroadcastChannel;\n","import {\n BroadcastLoginMessage,\n BroadcastLogoutMessage,\n isBroadcastLoginMessage,\n isBroadcastLogoutMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport { useCallback } from 'react';\nimport useBroadcastChannel from './useBroadcastChannel';\n\nexport function useBroadcastLoginListener(\n onLogin?: (message: BroadcastLoginMessage) => void,\n onLogout?: (message: BroadcastLogoutMessage) => void\n) {\n const onMessage = useCallback(\n (event: MessageEvent<Message<unknown>>) => {\n if (isBroadcastLoginMessage(event.data)) {\n onLogin?.(event.data);\n } else if (isBroadcastLogoutMessage(event.data)) {\n onLogout?.(event.data);\n }\n },\n [onLogin, onLogout]\n );\n\n useBroadcastChannel(onMessage);\n}\n\nexport default useBroadcastLoginListener;\n","import { createContext } from 'react';\nimport Cookies from 'js-cookie';\n\nexport const REFRESH_TOKEN_KEY = 'io.deephaven.web.client.auth.refreshToken';\n\nexport type RefreshToken = { bytes: string; expiry: number };\n\nexport const RefreshTokenContext = createContext<RefreshToken | null>(null);\n\n/**\n * Read the refresh token from our cookie store\n * @returns RefreshToken if it exists, null otherwise\n */\nexport function readRefreshToken(): RefreshToken | null {\n const cookieToken = Cookies.get(REFRESH_TOKEN_KEY);\n return cookieToken != null ? JSON.parse(cookieToken) : null;\n}\n\n/**\n * Store the provided refresh token as a cookie\n * @param token The refresh token to store\n */\nexport function storeRefreshToken(token: RefreshToken | null) {\n if (token != null) {\n const cookieToken = JSON.stringify({\n bytes: token.bytes,\n expiry: token.expiry,\n });\n const expires = new Date(token.expiry);\n\n Cookies.set(REFRESH_TOKEN_KEY, cookieToken, {\n secure: true,\n sameSite: 'strict',\n expires,\n });\n } else {\n Cookies.remove(REFRESH_TOKEN_KEY);\n }\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport useBroadcastChannel from './useBroadcastChannel';\nimport useBroadcastLoginListener from './useBroadcastLoginListener';\nimport {\n readRefreshToken,\n RefreshTokenContext,\n storeRefreshToken,\n} from './RefreshTokenUtils';\n\nexport type RefreshTokenBootstrapProps = {\n /**\n * The children to render wrapped with the RefreshTokenContext.\n */\n children: React.ReactNode;\n};\n\n/**\n * RefreshTokenBootstrap component. Handles storing and reading the refresh token.\n */\nexport function RefreshTokenBootstrap({\n children,\n}: RefreshTokenBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const channel = useBroadcastChannel();\n const [token, setToken] = useState(readRefreshToken());\n\n useEffect(\n function listenForTokenUpdates() {\n const cleanup = client.addEventListener(\n api.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,\n (event: CustomEvent) => {\n const { detail: newToken } = event;\n storeRefreshToken(newToken);\n setToken(newToken);\n }\n );\n return cleanup;\n },\n [api, channel, client, token]\n );\n\n const onLogin = useCallback(() => {\n setToken(readRefreshToken());\n }, []);\n\n const onLogout = useCallback(() => {\n storeRefreshToken(null);\n setToken(null);\n }, []);\n\n useBroadcastLoginListener(onLogin, onLogout);\n\n return (\n <RefreshTokenContext.Provider value={token}>\n {children}\n </RefreshTokenContext.Provider>\n );\n}\n\nexport default RefreshTokenBootstrap;\n","import { LoadingSpinner } from '@deephaven/components';\nimport classNames from 'classnames';\nimport React, { FormEventHandler } from 'react';\nimport './LoginForm.scss';\n\nexport interface LoginFormProps {\n /** What to display inside the form */\n children: React.ReactNode;\n\n /** Error message to display */\n errorMessage?: string;\n\n /** Whether currently logging in */\n isLoggingIn?: boolean;\n\n /** Triggered when the form is submitting */\n onSubmit?: FormEventHandler;\n}\n\nexport function LoginForm({\n children,\n errorMessage,\n isLoggingIn = false,\n onSubmit,\n}: LoginFormProps) {\n return (\n <form\n className=\"login-form\"\n onSubmit={event => {\n event.preventDefault();\n event.stopPropagation();\n onSubmit?.(event);\n }}\n >\n <div className=\"flex-spacer\" />\n <div className=\"flex-wrapper\">\n <fieldset disabled={isLoggingIn} className=\"container-fluid\">\n {children}\n </fieldset>\n <div className=\"form-group d-flex justify-content-end align-items-center mb-0\">\n <button\n type=\"submit\"\n className={classNames(\n 'btn btn-primary',\n { 'btn-spinner': isLoggingIn },\n { 'btn-cancelable': isLoggingIn }\n )}\n data-testid=\"btn-login\"\n >\n {isLoggingIn && (\n <span>\n <LoadingSpinner />\n <span className=\"btn-normal-content\">Logging in</span>\n <span className=\"btn-hover-content\">Cancel</span>\n </span>\n )}\n {!isLoggingIn && 'Login'}\n </button>\n </div>\n </div>\n <div className=\"flex-spacer\">\n {errorMessage != null && (\n <p className=\"error-message mb-0\" role=\"alert\">{`${errorMessage}`}</p>\n )}\n </div>\n </form>\n );\n}\n\nexport default LoginForm;\n","import React from 'react';\nimport { RandomAreaPlotAnimation } from '@deephaven/components';\nimport './Login.scss';\n\ninterface LoginProps {\n /** What to show in the login input part of the login form. */\n children: React.ReactNode;\n}\n\nexport function Login({ children }: LoginProps) {\n return (\n <div className=\"login-container\">\n <RandomAreaPlotAnimation />\n <div className=\"login-box\">\n <div className=\"logo\">\n <img src=\"/logo\" alt=\"Deephaven Data Labs\" />\n </div>\n {children}\n <p className=\"footer\">\n © 2016-{new Date().getFullYear()} Deephaven Data Labs LLC. Patent\n Pending.\n </p>\n </div>\n </div>\n );\n}\n\nexport default Login;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport { LoadingOverlay, ThemeExport } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { useBroadcastLoginListener } from '@deephaven/jsapi-components';\nimport Log from '@deephaven/log';\nimport Cookies from 'js-cookie';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\nimport LoginForm from './LoginForm';\nimport Login from './Login';\n\nconst AUTH_TYPE = 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n\nconst PSK_QUERY_PARAM_KEY = 'psk';\n\nconst PSK_TOKEN_KEY = 'io.deephaven.web.client.auth.psk.token';\n\nconst log = Log.module('AuthPluginPsk');\n\nfunction getWindowToken(): string | null {\n return new URLSearchParams(window.location.search).get(PSK_QUERY_PARAM_KEY);\n}\n\nfunction clearWindowToken() {\n log.debug2('clearWindowToken');\n const params = new URLSearchParams(window.location.search);\n params.delete(PSK_QUERY_PARAM_KEY);\n\n let queryString = `${params}`;\n if (queryString.length > 0) {\n queryString = `?${queryString}`;\n }\n const newPath = `${window.location.pathname}${queryString}${window.location.hash}`;\n window.history.replaceState(null, '', newPath);\n}\n\nfunction readCookieToken(): string | null {\n return Cookies.get(PSK_TOKEN_KEY) ?? null;\n}\n\nfunction storeCookieToken(token: string | null): void {\n log.debug2('Storing token in cookie', token);\n if (token != null) {\n Cookies.set(PSK_TOKEN_KEY, token, { secure: true, sameSite: 'strict' });\n } else {\n Cookies.remove(PSK_TOKEN_KEY);\n }\n}\n\n/**\n * AuthPlugin that tries to login using a pre-shared key.\n * Add the `psk=<token>` parameter to your URL string to set the token.\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n const client = useClient();\n const inputField = useRef<HTMLInputElement>(null);\n const loginPromise = useRef<Promise<void> | null>(null);\n const [error, setError] = useState<unknown>();\n const [isInputRequired, setIsInputRequired] = useState(false);\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [isLoggingIn, setIsLoggingIn] = useState(false);\n const [token, setToken] = useState('');\n\n const login = useCallback(\n // eslint-disable-next-line @typescript-eslint/no-inferrable-types\n async (loginToken: string, showError: boolean = true) => {\n log.info('Logging in...');\n setIsLoggingIn(true);\n let newLoginPromise: Promise<void> | null = null;\n try {\n newLoginPromise = client.login({ type: AUTH_TYPE, token: loginToken });\n loginPromise.current = newLoginPromise;\n await newLoginPromise;\n\n log.info('Logged in successfully');\n if (loginPromise.current !== newLoginPromise) {\n return;\n }\n storeCookieToken(loginToken);\n setIsLoggedIn(true);\n } catch (e) {\n if (loginPromise.current !== newLoginPromise) {\n return;\n }\n setIsInputRequired(true);\n if (showError) {\n setError(\n (e as CustomEvent)?.detail ?? 'Unable to login: Verify credentials.'\n );\n }\n }\n setIsLoggingIn(false);\n },\n [client]\n );\n\n const cancelLogin = useCallback(() => {\n loginPromise.current = null;\n setIsLoggingIn(false);\n }, []);\n\n const onLogin = useCallback(async () => {\n log.debug('onLogin');\n\n // User logged in successfully in another tab, we should be able to read the token from the cookie and login\n const newToken = readCookieToken();\n if (isLoggedIn || isLoggingIn || newToken == null) {\n return;\n }\n\n login(newToken, false);\n }, [isLoggedIn, isLoggingIn, login]);\n const onLogout = useCallback(() => {\n storeCookieToken(null);\n }, []);\n useBroadcastLoginListener(onLogin, onLogout);\n\n useEffect(() => {\n let isCanceled = false;\n async function initialLogin() {\n const initialToken = getWindowToken() ?? readCookieToken();\n clearWindowToken();\n\n if (initialToken == null) {\n setIsInputRequired(true);\n return;\n }\n\n setIsLoggingIn(true);\n try {\n await client.login({ type: AUTH_TYPE, token: initialToken });\n if (!isCanceled) {\n storeCookieToken(initialToken);\n setIsLoggedIn(true);\n setIsLoggingIn(false);\n }\n } catch (e) {\n if (!isCanceled) {\n setIsInputRequired(true);\n setIsLoggingIn(false);\n }\n }\n }\n initialLogin();\n return () => {\n isCanceled = true;\n };\n }, [client]);\n\n const handleSubmit = useCallback(() => {\n if (!isLoggingIn) {\n login(token);\n } else {\n cancelLogin();\n }\n }, [cancelLogin, isLoggingIn, login, token]);\n\n useEffect(\n function autoFocusInput() {\n inputField.current?.focus();\n },\n [inputField, isInputRequired]\n );\n\n return (\n <>\n {isLoggedIn && children}\n {isInputRequired && (\n <CSSTransition\n in={!isLoggedIn}\n timeout={ThemeExport.transitionMs}\n classNames=\"fade\"\n mountOnEnter\n unmountOnExit\n >\n <Login>\n <LoginForm\n errorMessage={error != null ? `${error}` : undefined}\n isLoggingIn={isLoggingIn}\n onSubmit={handleSubmit}\n >\n <div className=\"form-group\">\n <label htmlFor=\"auth-psk-token-input\">Token</label>\n <input\n id=\"auth-psk-token-input\"\n name=\"token\"\n className=\"input-token form-control\"\n type=\"text\"\n autoComplete=\"username\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck=\"false\"\n ref={inputField}\n value={token}\n onChange={event => {\n setError(undefined);\n setToken(event.target.value);\n }}\n />\n </div>\n </LoginForm>\n </Login>\n </CSSTransition>\n )}\n <LoadingOverlay\n data-testid=\"auth-psk-loading\"\n isLoaded={isLoggedIn || isInputRequired}\n isLoading={!isLoggedIn && !isInputRequired}\n />\n </>\n );\n}\n\nconst AuthPluginPsk: AuthPlugin = {\n Component,\n isAvailable: authHandlers => authHandlers.includes(AUTH_TYPE),\n};\n\nexport default AuthPluginPsk;\n","import React, { createContext, useEffect, useState } from 'react';\nimport 'fira';\n\nexport const FontsLoadedContext = createContext<boolean>(false);\n\nexport type FontBootstrapProps = {\n /**\n * Class names of the font elements to pre load\n */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped with the FontsLoadedContext.\n * Note that it renders the children even if the fonts aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * FontBootstrap component. Handles preloading fonts.\n */\nexport function FontBootstrap({\n fontClassNames = ['fira-sans-regular', 'fira-sans-bold', 'fira-mono'],\n children,\n}: FontBootstrapProps) {\n const [isLoaded, setIsLoaded] = useState(false);\n useEffect(function initFonts() {\n document.fonts.ready.then(() => {\n setIsLoaded(true);\n });\n }, []);\n\n return (\n <>\n <FontsLoadedContext.Provider value={isLoaded}>\n {children}\n </FontsLoadedContext.Provider>\n {/*\n Need to preload any monaco and Deephaven grid fonts.\n We hide text with all the fonts we need on the root app.jsx page\n Load the Fira Mono font so that Monaco calculates word wrapping properly.\n This element doesn't need to be visible, just load the font and stay hidden.\n https://github.com/microsoft/vscode/issues/88689\n Can be replaced with a rel=\"preload\" when firefox adds support\n https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content\n */}\n <div\n id=\"preload-fonts\"\n style={{ visibility: 'hidden', position: 'absolute', top: -10000 }}\n >\n {/* trigger loading of fonts needed by monaco and iris grid */}\n {fontClassNames.map(className => (\n <p key={className} className={className}>\n preload\n </p>\n ))}\n </div>\n </>\n );\n}\n\nexport default FontBootstrap;\n","import { useBroadcastChannel } from '@deephaven/jsapi-components';\nimport { BROADCAST_LOGIN_MESSAGE, makeMessage } from '@deephaven/jsapi-utils';\nimport { useEffect } from 'react';\n\n/**\n * Component that broadcasts a message when mounted. Should be mounted after the user has logged in.\n */\nexport function LoginNotifier() {\n const channel = useBroadcastChannel();\n useEffect(\n function notifyLogin() {\n channel.postMessage(makeMessage(BROADCAST_LOGIN_MESSAGE));\n },\n [channel]\n );\n return null;\n}\n\nexport default LoginNotifier;\n","import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport {\n AuthConfigMap,\n AuthPluginAnonymous,\n AuthPluginParent,\n AuthPluginPsk,\n} from '@deephaven/auth-plugins';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { PluginsContext } from './PluginsBootstrap';\nimport { getAuthPluginComponent } from '../plugins';\nimport LoginNotifier from './LoginNotifier';\n\nexport type AuthBootstrapProps = {\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n};\n\n/** Core auth plugins that are always loaded */\nconst CORE_AUTH_PLUGINS = new Map([\n ['@deephaven/auth-plugins.AuthPluginPsk', AuthPluginPsk],\n ['@deephaven/auth-plugins.AuthPluginParent', AuthPluginParent],\n ['@deephaven/auth-plugins.AuthPluginAnonymous', AuthPluginAnonymous],\n]);\n\n/**\n * AuthBootstrap component. Handles displaying the auth plugin and authenticating.\n */\nexport function AuthBootstrap({ children }: AuthBootstrapProps) {\n const client = useClient();\n // `useContext` instead of `usePlugins` so that we don't have to wait for the plugins to load\n // We want to load the auth config values in parallel with the plugins\n const plugins = useContext(PluginsContext);\n const [authConfig, setAuthConfig] = useState<AuthConfigMap>();\n const [error, setError] = useState<unknown>();\n\n useEffect(\n function initAuthConfigValues() {\n let isCanceled = false;\n async function loadAuthConfigValues() {\n try {\n const newAuthConfigValues = await client.getAuthConfigValues();\n if (!isCanceled) {\n setAuthConfig(new Map(newAuthConfigValues));\n }\n } catch (e) {\n if (!isCanceled) {\n setError(e);\n }\n }\n }\n loadAuthConfigValues();\n return () => {\n isCanceled = true;\n };\n },\n [client]\n );\n\n const AuthComponent = useMemo(() => {\n if (plugins == null || authConfig == null) {\n return undefined;\n }\n\n try {\n return getAuthPluginComponent(plugins, authConfig, CORE_AUTH_PLUGINS);\n } catch (e) {\n setError(e);\n }\n }, [authConfig, plugins]);\n\n const isLoading = AuthComponent == null || authConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading}\n errorMessage={error != null ? `${error}` : undefined}\n />\n );\n }\n return (\n <AuthComponent authConfigValues={authConfig}>\n <>\n <LoginNotifier />\n {children}\n </>\n </AuthComponent>\n );\n}\n\nexport default AuthBootstrap;\n","import React, { useContext } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { FontsLoadedContext } from './FontBootstrap';\n\nexport type FontsLoadedProps = {\n /** Children to show when the fonts have completed loading */\n children: React.ReactNode;\n};\n\nexport function FontsLoaded({ children }: FontsLoadedProps) {\n const isFontsLoaded = useContext(FontsLoadedContext);\n\n if (!isFontsLoaded) {\n return <LoadingOverlay data-testid=\"fonts-loaded-loading\" />;\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default FontsLoaded;\n","import React, { useCallback, useMemo, useState } from 'react';\nimport '@deephaven/components/scss/BaseStyleSheet.scss';\nimport { ClientBootstrap } from '@deephaven/jsapi-bootstrap';\nimport {\n RefreshTokenBootstrap,\n useBroadcastLoginListener,\n} from '@deephaven/jsapi-components';\nimport FontBootstrap from './FontBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getBaseUrl, getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\n\nexport type AppBootstrapProps = {\n /** URL of the API to load. */\n apiUrl: string;\n\n /** URL of the plugins to load. */\n pluginsUrl: string;\n\n /** Font class names to load. */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped when everything is loaded and authenticated.\n */\n children: React.ReactNode;\n};\n\n/**\n * AppBootstrap component. Handles loading the fonts, client, and authentication.\n * Will display the children when everything is loaded and authenticated.\n */\nexport function AppBootstrap({\n apiUrl,\n fontClassNames,\n pluginsUrl,\n children,\n}: AppBootstrapProps) {\n const serverUrl = getBaseUrl(apiUrl).origin;\n const clientOptions = useMemo(() => getConnectOptions(), []);\n\n // On logout, we reset the client and have user login again\n const [logoutCount, setLogoutCount] = useState(0);\n const onLogin = useCallback(() => undefined, []);\n const onLogout = useCallback(() => {\n setLogoutCount(value => value + 1);\n }, []);\n useBroadcastLoginListener(onLogin, onLogout);\n return (\n <FontBootstrap fontClassNames={fontClassNames}>\n <PluginsBootstrap pluginsUrl={pluginsUrl}>\n <ClientBootstrap\n serverUrl={serverUrl}\n options={clientOptions}\n key={logoutCount}\n >\n <RefreshTokenBootstrap>\n <AuthBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </AuthBootstrap>\n </RefreshTokenBootstrap>\n </ClientBootstrap>\n </PluginsBootstrap>\n </FontBootstrap>\n );\n}\n\nexport default AppBootstrap;\n"],"names":["VOLATILITY","LOW","HIGH","START_Y","FOREGROUND","ThemeExport","GRID_SIZE","GRID_COLOR","BACKGROUND","PATTERN","PX_PER_SECOND","RESIZE_DEBOUNCE","INTERACTION_TIMEOUT","RandomAreaPlotAnimation","React","canvas","useRef","container","shade","setShade","useState","scale","ctx","pattern","width","height","rAF","lastTimestamp","data","setCanvasSize","createPatternFill","canvasPattern","contextPattern","randomWalk","prev","rand","change","initData","startingData","y","x","setDataSize","drawAreaLine","path","context","i","drawGridLines","drawCanvas","timestamp","assertNotNull","subPixelMotion","numberOfPoints","debouncedHandleResize","debounce","pauseAnimation","resetIdleTimeout","startAnimation","handleActivity","handleResize","useEffect","jsx","RandomAreaPlotAnimation$1","AUTH_HANDLER_TYPE_ANONYMOUS","log","Log","AuthPluginBase","children","getLoginOptions","client","useClient","error","setError","isLoggedIn","setIsLoggedIn","isCanceled","verifyNotCanceled","CanceledPromiseError","login","loginOptions","e","LoadingOverlay","permissionsOverrides","Component","dh","useApi","useCallback","UserPermissionsOverrideContext","AuthPluginAnonymous","authHandlers","AuthPluginAnonymous$1","requestParentResponse","LOGIN_OPTIONS_REQUEST","getWindowAuthProvider","AuthPluginParent","AuthPluginParent$1","useBroadcastChannel","onEvent","EMPTY_FUNCTION","name","BROADCAST_CHANNEL_NAME","channel","useMemo","event","isMessage","useBroadcastLoginListener","onLogin","onLogout","onMessage","isBroadcastLoginMessage","isBroadcastLogoutMessage","REFRESH_TOKEN_KEY","RefreshTokenContext","createContext","readRefreshToken","cookieToken","Cookies","storeRefreshToken","token","expires","RefreshTokenBootstrap","api","setToken","newToken","LoginForm","errorMessage","isLoggingIn","onSubmit","jsxs","classNames","LoadingSpinner","Login","AUTH_TYPE","PSK_QUERY_PARAM_KEY","PSK_TOKEN_KEY","getWindowToken","clearWindowToken","params","queryString","newPath","readCookieToken","storeCookieToken","inputField","loginPromise","isInputRequired","setIsInputRequired","setIsLoggingIn","loginToken","showError","newLoginPromise","cancelLogin","initialLogin","initialToken","handleSubmit","Fragment","CSSTransition","AuthPluginPsk","AuthPluginPsk$1","FontsLoadedContext","FontBootstrap","fontClassNames","isLoaded","setIsLoaded","className","LoginNotifier","makeMessage","BROADCAST_LOGIN_MESSAGE","CORE_AUTH_PLUGINS","AuthBootstrap","plugins","useContext","PluginsContext","authConfig","setAuthConfig","loadAuthConfigValues","newAuthConfigValues","AuthComponent","getAuthPluginComponent","isLoading","FontsLoaded","AppBootstrap","apiUrl","pluginsUrl","serverUrl","getBaseUrl","clientOptions","getConnectOptions","logoutCount","setLogoutCount","value","PluginsBootstrap","ClientBootstrap","ConnectionBootstrap"],"mappings":"yhBASA,MAAMA,GAAa,KACb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CAAA,EACzCqB,EAAWrB,EAAAA,YAAY,IAAM,CAClBsG,EAAAC,GAASA,EAAQ,CAAC,CACnC,EAAG,CAAE,CAAA,EACL,OAAApF,EAA0BC,EAASC,CAAQ,EAExC9C,EAAA,IAAAkG,GAAA,CAAc,eAAAC,EACb,SAAAnG,EAAA,IAACiI,IAAiB,WAAAR,EAChB,SAAAzH,EAAA,IAACkI,GAAA,CACC,UAAAR,EACA,QAASE,EAGT,SAAA5H,EAAAA,IAAC2D,GACC,CAAA,SAAA3D,EAAAA,IAAC2G,GACC,CAAA,SAAA3G,EAAA,IAACmI,GACC,CAAA,SAAAnI,EAAA,IAACsH,GAAa,CAAA,SAAAhH,CAAA,CAAS,CACzB,CAAA,CACF,CAAA,EACF,CAAA,EARKwH,CAAA,CAUT,CAAA,CACF,CAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"index-bf15c1c2.js","sources":["../../../components/src/RandomAreaPlotAnimation.tsx","../../../auth-plugins/src/AuthHandlerTypes.ts","../../../auth-plugins/src/AuthPluginBase.tsx","../../../auth-plugins/src/AuthPluginAnonymous.tsx","../../../auth-plugins/src/AuthPluginParent.tsx","../../../jsapi-components/src/useBroadcastChannel.ts","../../../jsapi-components/src/useBroadcastLoginListener.ts","../../../jsapi-components/src/RefreshTokenUtils.ts","../../../jsapi-components/src/RefreshTokenBootstrap.tsx","../../../auth-plugins/src/LoginForm.tsx","../../../auth-plugins/src/Login.tsx","../../../auth-plugins/src/AuthPluginPsk.tsx","../../../app-utils/src/components/FontBootstrap.tsx","../../../app-utils/src/components/LoginNotifier.tsx","../../../app-utils/src/components/AuthBootstrap.tsx","../../../app-utils/src/components/FontsLoaded.tsx","../../../app-utils/src/components/AppBootstrap.tsx"],"sourcesContent":["/* eslint-disable react-hooks/exhaustive-deps */\n/* eslint-disable react/display-name */\n\nimport React, { useEffect, useState, useRef } from 'react';\nimport debounce from 'lodash.debounce';\nimport { assertNotNull } from '@deephaven/utils';\nimport './RandomAreaPlotAnimation.scss';\nimport ThemeExport from './ThemeExport';\n\nconst VOLATILITY = 0.025; // how spikey the data gets\nconst LOW = 0.9;\nconst HIGH = 0.1;\nconst START_Y = 0.618;\nconst FOREGROUND = ThemeExport['primary-dark'];\nconst GRID_SIZE = 80;\nconst GRID_COLOR = ThemeExport['gray-800'];\nconst BACKGROUND = ThemeExport['gray-900'];\nconst PATTERN = { SIZE: 8, DOT_SIZE: 2, FILL_OPACITY: 0.25 };\nconst PX_PER_SECOND = 18;\nconst RESIZE_DEBOUNCE = 250;\nconst INTERACTION_TIMEOUT = 60 * 1000;\n\n// Draw a background canvas, paint it with a fun chart looking animation\nconst RandomAreaPlotAnimation = React.memo(() => {\n const canvas = useRef<HTMLCanvasElement>(null);\n const container = useRef<HTMLDivElement>(null);\n const [shade, setShade] = useState(false);\n const scale = window.devicePixelRatio;\n\n let ctx: CanvasRenderingContext2D | null | undefined;\n let pattern: CanvasPattern | null | undefined;\n let width: number;\n let height: number;\n let rAF: number | null;\n\n let lastTimestamp: DOMHighResTimeStamp | null | undefined = null;\n let data: number[] = [];\n\n function setCanvasSize() {\n // Set canvas size to fill screen\n if (container.current != null) {\n width = container.current.offsetWidth;\n height = container.current.offsetHeight;\n }\n\n if (canvas.current != null) {\n canvas.current.style.width = `${width}px`;\n canvas.current.style.height = `${height}px`;\n\n canvas.current.width = width * scale;\n canvas.current.height = height * scale;\n }\n\n ctx?.scale(scale, scale);\n }\n\n // Returns the background fill create offscreen as pattern\n function createPatternFill() {\n // create the off-screen canvas\n const canvasPattern = document.createElement('canvas');\n canvasPattern.width = PATTERN.SIZE;\n canvasPattern.height = PATTERN.SIZE;\n const contextPattern = canvasPattern.getContext('2d');\n\n // draw pattern to off-screen context\n if (contextPattern != null) {\n contextPattern.fillStyle = FOREGROUND;\n contextPattern.fillRect(0, 0, PATTERN.DOT_SIZE, PATTERN.DOT_SIZE);\n\n // add an overlay fill\n contextPattern.fillStyle =\n FOREGROUND +\n Math.round(255 * PATTERN.FILL_OPACITY)\n .toString(16)\n .padStart(2, '0'); // adds opacity in hex to color\n contextPattern.fillRect(0, 0, PATTERN.SIZE, PATTERN.SIZE);\n }\n return contextPattern?.createPattern(canvasPattern, 'repeat');\n }\n\n /**\n * Generates a step in a random walk between LOW - HIGH given a previous value\n * data is always in 0-1 data space so its scaleable\n * data space is converted to screen space inside draw functions\n * @param prev previous random walk step\n * @return new random walk step\n */\n function randomWalk(prev: number): number {\n const rand = Math.random() - 0.5; // give it directionality\n let change = VOLATILITY * rand; // scale by volatity constant\n\n // ensure directional bounce off approaching edges\n if (prev < HIGH) {\n change = Math.abs(change);\n } else if (prev > LOW) {\n change = -Math.abs(change);\n }\n\n return prev + change;\n }\n\n function initData() {\n const startingData = [];\n let y = START_Y; // always start towards the bottom of the screen\n for (let x = 0; x < width + PX_PER_SECOND; x += 1) {\n y = randomWalk(y);\n startingData.push(y);\n }\n return startingData;\n }\n\n function setDataSize() {\n while (data.length >= width + PX_PER_SECOND) {\n data.pop();\n }\n while (data.length < width + PX_PER_SECOND) {\n data.push(randomWalk(data[data.length - 1]));\n }\n }\n\n function drawAreaLine(path: number[], context: CanvasRenderingContext2D) {\n context.beginPath();\n // start offscreen\n context.moveTo(-1, height + 1);\n context.lineTo(-1, height * path[0]);\n\n // draw the line\n for (let i = 0; i < path.length; i += 1) {\n context.lineTo(i, height * path[i]);\n }\n\n // close offscreen\n context.lineTo(width + PX_PER_SECOND, height * path[path.length - 1]);\n context.lineTo(width + PX_PER_SECOND, height + 1);\n context.closePath();\n }\n\n function drawGridLines(context: CanvasRenderingContext2D) {\n context.beginPath();\n // draw verticals\n for (let x = 1; x < width; x += GRID_SIZE) {\n context.moveTo(x, 0);\n context.lineTo(x, height);\n }\n // draw horizontals\n for (let y = 1; y < height; y += GRID_SIZE) {\n context.moveTo(0, y);\n context.lineTo(width, y);\n }\n }\n\n /**\n * Main draw loop for where the animation happens\n * all the styling happens within drawCanvas from paths generated by other functions\n * @param timestamp passed in callback from requestAnimationFrame\n */\n function drawCanvas(timestamp?: DOMHighResTimeStamp) {\n lastTimestamp = lastTimestamp ?? timestamp;\n\n assertNotNull(ctx);\n // clear the canvas\n ctx.fillStyle = BACKGROUND;\n ctx.fillRect(0, 0, width, height);\n\n drawGridLines(ctx);\n ctx.lineWidth = 1;\n ctx.strokeStyle = GRID_COLOR;\n ctx.stroke();\n\n // for speeds less then 60 px per second, subpixel motion is required to look smooth\n const subPixelMotion =\n ((lastTimestamp ?? 0) - (timestamp ?? 0)) / (1000 / PX_PER_SECOND);\n ctx.translate(subPixelMotion, 0);\n\n drawAreaLine(data, ctx);\n ctx.lineWidth = 2;\n ctx.strokeStyle = FOREGROUND;\n ctx.stroke();\n\n ctx.translate(-subPixelMotion, 0); // we don't pattern to shift however\n if (pattern != null) {\n ctx.fillStyle = pattern;\n }\n ctx.fill();\n ctx.setTransform(scale, 0, 0, scale, 0, 0); // reset the translate matrix to normal\n\n // generate new data points\n if ((timestamp ?? 0) - (lastTimestamp ?? 0) > 1000 / PX_PER_SECOND) {\n // number of points to add since last update\n const numberOfPoints = Math.floor(\n ((timestamp ?? 0) - (lastTimestamp ?? 0)) / (1000 / PX_PER_SECOND)\n );\n for (let i = 0; i < numberOfPoints; i += 1) {\n data.shift();\n data.push(randomWalk(data[data.length - 1]));\n }\n lastTimestamp = timestamp;\n }\n\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = requestAnimationFrame(drawCanvas);\n }\n\n // debounce the resize so its not overly aggresive\n const debouncedHandleResize = debounce(\n () => {\n rAF = requestAnimationFrame(timestamp => {\n setCanvasSize(); // setCanvas can cause lag if not debounced\n\n // fill or remove extra data points\n setDataSize();\n\n // opening devtools triggers a blur then resize,\n // need to reset shade as we are restarting animation\n setShade(false);\n drawCanvas(timestamp);\n });\n },\n RESIZE_DEBOUNCE,\n { leading: true } // resize immediately, once.\n );\n\n function pauseAnimation() {\n // pause animation when browser window is blurred to conserve CPU usage\n setShade(true);\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n rAF = null;\n lastTimestamp = null;\n }\n\n // when timeout expires, pause animation\n const resetIdleTimeout = debounce(() => {\n pauseAnimation();\n }, INTERACTION_TIMEOUT);\n\n function startAnimation() {\n // can fire multiple times, check if rAF is null first\n // restart animation loop, and fade back in\n if (rAF == null) {\n setShade(false);\n setCanvasSize();\n setDataSize();\n rAF = requestAnimationFrame(drawCanvas);\n }\n resetIdleTimeout();\n }\n\n function handleActivity() {\n if (document.hasFocus()) {\n // only if document has focus (mousemove can fire on non-focused tabs)\n startAnimation();\n }\n }\n\n function handleResize() {\n // pause and debounce animation during resize for better resizing performance\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n resetIdleTimeout(); // treat resizing as a form of activity\n debouncedHandleResize();\n }\n\n // react mount/unmount hooks\n useEffect(() => {\n ctx = canvas.current?.getContext('2d', { alpha: false });\n setCanvasSize();\n data = initData();\n pattern = createPatternFill();\n\n // start draw loop\n drawCanvas();\n resetIdleTimeout();\n\n window.addEventListener('resize', handleResize);\n\n window.addEventListener('focus', startAnimation);\n window.addEventListener('blur', pauseAnimation);\n\n // don't burn cpu if the user is \"idle\", start a timer that resets\n // on any user activity, and on timeout expiry pause the animation\n window.addEventListener('mousemove', handleActivity);\n window.addEventListener('keydown', handleActivity);\n\n return () => {\n if (rAF != null) {\n cancelAnimationFrame(rAF);\n }\n window.removeEventListener('resize', handleResize);\n window.removeEventListener('focus', startAnimation);\n window.removeEventListener('blur', pauseAnimation);\n\n window.removeEventListener('mousemove', handleActivity);\n window.removeEventListener('keydown', handleActivity);\n\n resetIdleTimeout.cancel();\n debouncedHandleResize.cancel();\n };\n }, []);\n\n return (\n <div className=\"random-area-plot-animation-container\" ref={container}>\n <canvas ref={canvas} className={shade ? 'shade' : ''} />\n </div>\n );\n});\n\nexport default RandomAreaPlotAnimation;\n","export const AUTH_HANDLER_TYPE_ANONYMOUS =\n 'io.deephaven.auth.AnonymousAuthenticationHandler';\n\nexport const AUTH_HANDLER_TYPE_PSK =\n 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n","import React, { useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport Log from '@deephaven/log';\nimport { LoginOptions } from '@deephaven/jsapi-types';\nimport { CanceledPromiseError } from '@deephaven/utils';\n\nconst log = Log.module('AuthPluginBase');\n\nexport type AuthPluginBaseProps = {\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n\n /**\n * Retrieve the login options for logging in to the client\n * @returns A promise for the login options\n */\n getLoginOptions: () => Promise<LoginOptions>;\n};\n\n/**\n * Base AuthPlugin that gets passed a function for retrieving the login options, and then attempting to login with them.\n * @param getLoginOptions Function that returns a promise for the login options\n */\nfunction AuthPluginBase({\n children,\n getLoginOptions,\n}: AuthPluginBaseProps): JSX.Element {\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n\n useEffect(() => {\n let isCanceled = false;\n function verifyNotCanceled() {\n if (isCanceled) {\n throw new CanceledPromiseError('Login canceled.');\n }\n }\n async function login() {\n try {\n const loginOptions = await getLoginOptions();\n verifyNotCanceled();\n\n log.info('Logging in...');\n await client.login(loginOptions);\n verifyNotCanceled();\n\n setIsLoggedIn(true);\n } catch (e) {\n if (!isCanceled) {\n log.error('Unable to login:', e);\n setError(e);\n setIsLoggedIn(false);\n }\n }\n }\n login();\n return () => {\n isCanceled = true;\n };\n }, [client, getLoginOptions]);\n\n if (!isLoggedIn) {\n return (\n <LoadingOverlay\n data-testid=\"auth-base-loading\"\n isLoading={error == null}\n isLoaded={false}\n errorMessage={error != null ? `${error}` : null}\n />\n );\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default AuthPluginBase;\n","import React, { useCallback } from 'react';\nimport { useApi } from '@deephaven/jsapi-bootstrap';\nimport { AUTH_HANDLER_TYPE_ANONYMOUS } from './AuthHandlerTypes';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\nimport AuthPluginBase from './AuthPluginBase';\nimport {\n UserPermissionsOverride,\n UserPermissionsOverrideContext,\n} from './UserContexts';\n\nconst permissionsOverrides: UserPermissionsOverride = { canLogout: false };\n\n/**\n * AuthPlugin that tries to login anonymously. Fails if anonymous login fails\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n const dh = useApi();\n\n const getLoginOptions = useCallback(\n async () => ({ type: dh.CoreClient.LOGIN_TYPE_ANONYMOUS }),\n [dh]\n );\n\n return (\n <AuthPluginBase getLoginOptions={getLoginOptions}>\n <UserPermissionsOverrideContext.Provider value={permissionsOverrides}>\n {children}\n </UserPermissionsOverrideContext.Provider>\n </AuthPluginBase>\n );\n}\n\nconst AuthPluginAnonymous: AuthPlugin = {\n Component,\n isAvailable: authHandlers =>\n authHandlers.includes(AUTH_HANDLER_TYPE_ANONYMOUS),\n};\n\nexport default AuthPluginAnonymous;\n","import React from 'react';\nimport { LoginOptions } from '@deephaven/jsapi-types';\nimport {\n LOGIN_OPTIONS_REQUEST,\n requestParentResponse,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\nimport AuthPluginBase from './AuthPluginBase';\nimport {\n UserPermissionsOverride,\n UserPermissionsOverrideContext,\n} from './UserContexts';\n\nconst log = Log.module('AuthPluginParent');\n\nconst permissionsOverrides: UserPermissionsOverride = { canLogout: false };\n\nfunction getLoginOptions(): Promise<LoginOptions> {\n log.info('Logging in by delegating to parent window...');\n return requestParentResponse<LoginOptions>(LOGIN_OPTIONS_REQUEST);\n}\n\nfunction getWindowAuthProvider(): string {\n return new URLSearchParams(window.location.search).get('authProvider') ?? '';\n}\n\n/**\n * AuthPlugin that tries to delegate to the parent window for authentication. Fails if there is no parent window.\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n return (\n <AuthPluginBase getLoginOptions={getLoginOptions}>\n <UserPermissionsOverrideContext.Provider value={permissionsOverrides}>\n {children}\n </UserPermissionsOverrideContext.Provider>\n </AuthPluginBase>\n );\n}\n\nconst AuthPluginParent: AuthPlugin = {\n Component,\n isAvailable: () =>\n window.opener != null && getWindowAuthProvider() === 'parent',\n};\n\nexport default AuthPluginParent;\n","import {\n BROADCAST_CHANNEL_NAME,\n isMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport Log from '@deephaven/log';\nimport { EMPTY_FUNCTION } from '@deephaven/utils';\nimport { useEffect, useMemo } from 'react';\n\nconst log = Log.module('useBroadcastChannel');\n\nexport function useBroadcastChannel(\n onEvent: (event: MessageEvent<Message<unknown>>) => void = EMPTY_FUNCTION,\n name = BROADCAST_CHANNEL_NAME\n) {\n const channel = useMemo(() => new BroadcastChannel(name), [name]);\n useEffect(\n () => () => {\n channel.close();\n },\n [channel]\n );\n\n useEffect(() => {\n channel.onmessage = (event: MessageEvent) => {\n const { data } = event;\n if (!isMessage(data)) {\n log.debug('Ignoring non-deephaven message', data);\n return;\n }\n log.debug('event received', data);\n onEvent(event);\n };\n }, [channel, onEvent]);\n\n return channel;\n}\n\nexport default useBroadcastChannel;\n","import {\n BroadcastLoginMessage,\n BroadcastLogoutMessage,\n isBroadcastLoginMessage,\n isBroadcastLogoutMessage,\n Message,\n} from '@deephaven/jsapi-utils';\nimport { useCallback } from 'react';\nimport useBroadcastChannel from './useBroadcastChannel';\n\nexport function useBroadcastLoginListener(\n onLogin?: (message: BroadcastLoginMessage) => void,\n onLogout?: (message: BroadcastLogoutMessage) => void\n) {\n const onMessage = useCallback(\n (event: MessageEvent<Message<unknown>>) => {\n if (isBroadcastLoginMessage(event.data)) {\n onLogin?.(event.data);\n } else if (isBroadcastLogoutMessage(event.data)) {\n onLogout?.(event.data);\n }\n },\n [onLogin, onLogout]\n );\n\n useBroadcastChannel(onMessage);\n}\n\nexport default useBroadcastLoginListener;\n","import { createContext } from 'react';\nimport Cookies from 'js-cookie';\n\nexport const REFRESH_TOKEN_KEY = 'io.deephaven.web.client.auth.refreshToken';\n\nexport type RefreshToken = { bytes: string; expiry: number };\n\nexport const RefreshTokenContext = createContext<RefreshToken | null>(null);\n\n/**\n * Read the refresh token from our cookie store\n * @returns RefreshToken if it exists, null otherwise\n */\nexport function readRefreshToken(): RefreshToken | null {\n const cookieToken = Cookies.get(REFRESH_TOKEN_KEY);\n return cookieToken != null ? JSON.parse(cookieToken) : null;\n}\n\n/**\n * Store the provided refresh token as a cookie\n * @param token The refresh token to store\n */\nexport function storeRefreshToken(token: RefreshToken | null) {\n if (token != null) {\n const cookieToken = JSON.stringify({\n bytes: token.bytes,\n expiry: token.expiry,\n });\n const expires = new Date(token.expiry);\n\n Cookies.set(REFRESH_TOKEN_KEY, cookieToken, {\n secure: true,\n sameSite: 'strict',\n expires,\n });\n } else {\n Cookies.remove(REFRESH_TOKEN_KEY);\n }\n}\n","import React, { useCallback, useEffect, useState } from 'react';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport useBroadcastChannel from './useBroadcastChannel';\nimport useBroadcastLoginListener from './useBroadcastLoginListener';\nimport {\n readRefreshToken,\n RefreshTokenContext,\n storeRefreshToken,\n} from './RefreshTokenUtils';\n\nexport type RefreshTokenBootstrapProps = {\n /**\n * The children to render wrapped with the RefreshTokenContext.\n */\n children: React.ReactNode;\n};\n\n/**\n * RefreshTokenBootstrap component. Handles storing and reading the refresh token.\n */\nexport function RefreshTokenBootstrap({\n children,\n}: RefreshTokenBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const channel = useBroadcastChannel();\n const [token, setToken] = useState(readRefreshToken());\n\n useEffect(\n function listenForTokenUpdates() {\n const cleanup = client.addEventListener(\n api.CoreClient.EVENT_REFRESH_TOKEN_UPDATED,\n (event: CustomEvent) => {\n const { detail: newToken } = event;\n storeRefreshToken(newToken);\n setToken(newToken);\n }\n );\n return cleanup;\n },\n [api, channel, client, token]\n );\n\n const onLogin = useCallback(() => {\n setToken(readRefreshToken());\n }, []);\n\n const onLogout = useCallback(() => {\n storeRefreshToken(null);\n setToken(null);\n }, []);\n\n useBroadcastLoginListener(onLogin, onLogout);\n\n return (\n <RefreshTokenContext.Provider value={token}>\n {children}\n </RefreshTokenContext.Provider>\n );\n}\n\nexport default RefreshTokenBootstrap;\n","import { LoadingSpinner } from '@deephaven/components';\nimport classNames from 'classnames';\nimport React, { FormEventHandler } from 'react';\nimport './LoginForm.scss';\n\nexport interface LoginFormProps {\n /** What to display inside the form */\n children: React.ReactNode;\n\n /** Error message to display */\n errorMessage?: string;\n\n /** Whether currently logging in */\n isLoggingIn?: boolean;\n\n /** Triggered when the form is submitting */\n onSubmit?: FormEventHandler;\n}\n\nexport function LoginForm({\n children,\n errorMessage,\n isLoggingIn = false,\n onSubmit,\n}: LoginFormProps) {\n return (\n <form\n className=\"login-form\"\n onSubmit={event => {\n event.preventDefault();\n event.stopPropagation();\n onSubmit?.(event);\n }}\n >\n <div className=\"flex-spacer\" />\n <div className=\"flex-wrapper\">\n <fieldset disabled={isLoggingIn} className=\"container-fluid\">\n {children}\n </fieldset>\n <div className=\"form-group d-flex justify-content-end align-items-center mb-0\">\n <button\n type=\"submit\"\n className={classNames(\n 'btn btn-primary',\n { 'btn-spinner': isLoggingIn },\n { 'btn-cancelable': isLoggingIn }\n )}\n data-testid=\"btn-login\"\n >\n {isLoggingIn && (\n <span>\n <LoadingSpinner />\n <span className=\"btn-normal-content\">Logging in</span>\n <span className=\"btn-hover-content\">Cancel</span>\n </span>\n )}\n {!isLoggingIn && 'Login'}\n </button>\n </div>\n </div>\n <div className=\"flex-spacer\">\n {errorMessage != null && (\n <p className=\"error-message mb-0\" role=\"alert\">{`${errorMessage}`}</p>\n )}\n </div>\n </form>\n );\n}\n\nexport default LoginForm;\n","import React from 'react';\nimport { RandomAreaPlotAnimation } from '@deephaven/components';\nimport './Login.scss';\n\ninterface LoginProps {\n /** What to show in the login input part of the login form. */\n children: React.ReactNode;\n}\n\nexport function Login({ children }: LoginProps) {\n return (\n <div className=\"login-container\">\n <RandomAreaPlotAnimation />\n <div className=\"login-box\">\n <div className=\"logo\">\n <img src=\"/logo\" alt=\"Deephaven Data Labs\" />\n </div>\n {children}\n <p className=\"footer\">\n © 2016-{new Date().getFullYear()} Deephaven Data Labs LLC. Patent\n Pending.\n </p>\n </div>\n </div>\n );\n}\n\nexport default Login;\n","import React, { useCallback, useEffect, useRef, useState } from 'react';\nimport { CSSTransition } from 'react-transition-group';\nimport { LoadingOverlay, ThemeExport } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { useBroadcastLoginListener } from '@deephaven/jsapi-components';\nimport Log from '@deephaven/log';\nimport Cookies from 'js-cookie';\nimport { AuthPlugin, AuthPluginProps } from './AuthPlugin';\nimport LoginForm from './LoginForm';\nimport Login from './Login';\n\nconst AUTH_TYPE = 'io.deephaven.authentication.psk.PskAuthenticationHandler';\n\nconst PSK_QUERY_PARAM_KEY = 'psk';\n\nconst PSK_TOKEN_KEY = 'io.deephaven.web.client.auth.psk.token';\n\nconst log = Log.module('AuthPluginPsk');\n\nfunction getWindowToken(): string | null {\n return new URLSearchParams(window.location.search).get(PSK_QUERY_PARAM_KEY);\n}\n\nfunction clearWindowToken() {\n log.debug2('clearWindowToken');\n const params = new URLSearchParams(window.location.search);\n params.delete(PSK_QUERY_PARAM_KEY);\n\n let queryString = `${params}`;\n if (queryString.length > 0) {\n queryString = `?${queryString}`;\n }\n const newPath = `${window.location.pathname}${queryString}${window.location.hash}`;\n window.history.replaceState(null, '', newPath);\n}\n\nfunction readCookieToken(): string | null {\n return Cookies.get(PSK_TOKEN_KEY) ?? null;\n}\n\nfunction storeCookieToken(token: string | null): void {\n log.debug2('Storing token in cookie', token);\n if (token != null) {\n Cookies.set(PSK_TOKEN_KEY, token, { secure: true, sameSite: 'strict' });\n } else {\n Cookies.remove(PSK_TOKEN_KEY);\n }\n}\n\n/**\n * AuthPlugin that tries to login using a pre-shared key.\n * Add the `psk=<token>` parameter to your URL string to set the token.\n */\nfunction Component({ children }: AuthPluginProps): JSX.Element {\n const client = useClient();\n const inputField = useRef<HTMLInputElement>(null);\n const loginPromise = useRef<Promise<void> | null>(null);\n const [error, setError] = useState<unknown>();\n const [isInputRequired, setIsInputRequired] = useState(false);\n const [isLoggedIn, setIsLoggedIn] = useState(false);\n const [isLoggingIn, setIsLoggingIn] = useState(false);\n const [token, setToken] = useState('');\n\n const login = useCallback(\n // eslint-disable-next-line @typescript-eslint/no-inferrable-types\n async (loginToken: string, showError: boolean = true) => {\n log.info('Logging in...');\n setIsLoggingIn(true);\n let newLoginPromise: Promise<void> | null = null;\n try {\n newLoginPromise = client.login({ type: AUTH_TYPE, token: loginToken });\n loginPromise.current = newLoginPromise;\n await newLoginPromise;\n\n log.info('Logged in successfully');\n if (loginPromise.current !== newLoginPromise) {\n return;\n }\n storeCookieToken(loginToken);\n setIsLoggedIn(true);\n } catch (e) {\n if (loginPromise.current !== newLoginPromise) {\n return;\n }\n setIsInputRequired(true);\n if (showError) {\n setError(\n (e as CustomEvent)?.detail ?? 'Unable to login: Verify credentials.'\n );\n }\n }\n setIsLoggingIn(false);\n },\n [client]\n );\n\n const cancelLogin = useCallback(() => {\n loginPromise.current = null;\n setIsLoggingIn(false);\n }, []);\n\n const onLogin = useCallback(async () => {\n log.debug('onLogin');\n\n // User logged in successfully in another tab, we should be able to read the token from the cookie and login\n const newToken = readCookieToken();\n if (isLoggedIn || isLoggingIn || newToken == null) {\n return;\n }\n\n login(newToken, false);\n }, [isLoggedIn, isLoggingIn, login]);\n const onLogout = useCallback(() => {\n storeCookieToken(null);\n }, []);\n useBroadcastLoginListener(onLogin, onLogout);\n\n useEffect(() => {\n let isCanceled = false;\n async function initialLogin() {\n const initialToken = getWindowToken() ?? readCookieToken();\n clearWindowToken();\n\n if (initialToken == null) {\n setIsInputRequired(true);\n return;\n }\n\n setIsLoggingIn(true);\n try {\n await client.login({ type: AUTH_TYPE, token: initialToken });\n if (!isCanceled) {\n storeCookieToken(initialToken);\n setIsLoggedIn(true);\n setIsLoggingIn(false);\n }\n } catch (e) {\n if (!isCanceled) {\n setIsInputRequired(true);\n setIsLoggingIn(false);\n }\n }\n }\n initialLogin();\n return () => {\n isCanceled = true;\n };\n }, [client]);\n\n const handleSubmit = useCallback(() => {\n if (!isLoggingIn) {\n login(token);\n } else {\n cancelLogin();\n }\n }, [cancelLogin, isLoggingIn, login, token]);\n\n useEffect(\n function autoFocusInput() {\n inputField.current?.focus();\n },\n [inputField, isInputRequired]\n );\n\n return (\n <>\n {isLoggedIn && children}\n {isInputRequired && (\n <CSSTransition\n in={!isLoggedIn}\n timeout={ThemeExport.transitionMs}\n classNames=\"fade\"\n mountOnEnter\n unmountOnExit\n >\n <Login>\n <LoginForm\n errorMessage={error != null ? `${error}` : undefined}\n isLoggingIn={isLoggingIn}\n onSubmit={handleSubmit}\n >\n <div className=\"form-group\">\n <label htmlFor=\"auth-psk-token-input\">Token</label>\n <input\n id=\"auth-psk-token-input\"\n name=\"token\"\n className=\"input-token form-control\"\n type=\"text\"\n autoComplete=\"username\"\n autoCapitalize=\"none\"\n autoCorrect=\"off\"\n spellCheck=\"false\"\n ref={inputField}\n value={token}\n onChange={event => {\n setError(undefined);\n setToken(event.target.value);\n }}\n />\n </div>\n </LoginForm>\n </Login>\n </CSSTransition>\n )}\n <LoadingOverlay\n data-testid=\"auth-psk-loading\"\n isLoaded={isLoggedIn || isInputRequired}\n isLoading={!isLoggedIn && !isInputRequired}\n />\n </>\n );\n}\n\nconst AuthPluginPsk: AuthPlugin = {\n Component,\n isAvailable: authHandlers => authHandlers.includes(AUTH_TYPE),\n};\n\nexport default AuthPluginPsk;\n","import React, { createContext, useEffect, useState } from 'react';\nimport 'fira';\n\nexport const FontsLoadedContext = createContext<boolean>(false);\n\nexport type FontBootstrapProps = {\n /**\n * Class names of the font elements to pre load\n */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped with the FontsLoadedContext.\n * Note that it renders the children even if the fonts aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * FontBootstrap component. Handles preloading fonts.\n */\nexport function FontBootstrap({\n fontClassNames = ['fira-sans-regular', 'fira-sans-bold', 'fira-mono'],\n children,\n}: FontBootstrapProps) {\n const [isLoaded, setIsLoaded] = useState(false);\n useEffect(function initFonts() {\n document.fonts.ready.then(() => {\n setIsLoaded(true);\n });\n }, []);\n\n return (\n <>\n <FontsLoadedContext.Provider value={isLoaded}>\n {children}\n </FontsLoadedContext.Provider>\n {/*\n Need to preload any monaco and Deephaven grid fonts.\n We hide text with all the fonts we need on the root app.jsx page\n Load the Fira Mono font so that Monaco calculates word wrapping properly.\n This element doesn't need to be visible, just load the font and stay hidden.\n https://github.com/microsoft/vscode/issues/88689\n Can be replaced with a rel=\"preload\" when firefox adds support\n https://developer.mozilla.org/en-US/docs/Web/HTML/Preloading_content\n */}\n <div\n id=\"preload-fonts\"\n style={{ visibility: 'hidden', position: 'absolute', top: -10000 }}\n >\n {/* trigger loading of fonts needed by monaco and iris grid */}\n {fontClassNames.map(className => (\n <p key={className} className={className}>\n preload\n </p>\n ))}\n </div>\n </>\n );\n}\n\nexport default FontBootstrap;\n","import { useBroadcastChannel } from '@deephaven/jsapi-components';\nimport { BROADCAST_LOGIN_MESSAGE, makeMessage } from '@deephaven/jsapi-utils';\nimport { useEffect } from 'react';\n\n/**\n * Component that broadcasts a message when mounted. Should be mounted after the user has logged in.\n */\nexport function LoginNotifier() {\n const channel = useBroadcastChannel();\n useEffect(\n function notifyLogin() {\n channel.postMessage(makeMessage(BROADCAST_LOGIN_MESSAGE));\n },\n [channel]\n );\n return null;\n}\n\nexport default LoginNotifier;\n","import React, { useContext, useEffect, useMemo, useState } from 'react';\nimport {\n AuthConfigMap,\n AuthPluginAnonymous,\n AuthPluginParent,\n AuthPluginPsk,\n} from '@deephaven/auth-plugins';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useClient } from '@deephaven/jsapi-bootstrap';\nimport { PluginsContext } from './PluginsBootstrap';\nimport { getAuthPluginComponent } from '../plugins';\nimport LoginNotifier from './LoginNotifier';\n\nexport type AuthBootstrapProps = {\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n};\n\n/** Core auth plugins that are always loaded */\nconst CORE_AUTH_PLUGINS = new Map([\n ['@deephaven/auth-plugins.AuthPluginPsk', AuthPluginPsk],\n ['@deephaven/auth-plugins.AuthPluginParent', AuthPluginParent],\n ['@deephaven/auth-plugins.AuthPluginAnonymous', AuthPluginAnonymous],\n]);\n\n/**\n * AuthBootstrap component. Handles displaying the auth plugin and authenticating.\n */\nexport function AuthBootstrap({ children }: AuthBootstrapProps) {\n const client = useClient();\n // `useContext` instead of `usePlugins` so that we don't have to wait for the plugins to load\n // We want to load the auth config values in parallel with the plugins\n const plugins = useContext(PluginsContext);\n const [authConfig, setAuthConfig] = useState<AuthConfigMap>();\n const [error, setError] = useState<unknown>();\n\n useEffect(\n function initAuthConfigValues() {\n let isCanceled = false;\n async function loadAuthConfigValues() {\n try {\n const newAuthConfigValues = await client.getAuthConfigValues();\n if (!isCanceled) {\n setAuthConfig(new Map(newAuthConfigValues));\n }\n } catch (e) {\n if (!isCanceled) {\n setError(e);\n }\n }\n }\n loadAuthConfigValues();\n return () => {\n isCanceled = true;\n };\n },\n [client]\n );\n\n const AuthComponent = useMemo(() => {\n if (plugins == null || authConfig == null) {\n return undefined;\n }\n\n try {\n return getAuthPluginComponent(plugins, authConfig, CORE_AUTH_PLUGINS);\n } catch (e) {\n setError(e);\n }\n }, [authConfig, plugins]);\n\n const isLoading = AuthComponent == null || authConfig == null;\n\n if (isLoading || error != null) {\n return (\n <LoadingOverlay\n isLoading={isLoading}\n errorMessage={error != null ? `${error}` : undefined}\n />\n );\n }\n return (\n <AuthComponent authConfigValues={authConfig}>\n <>\n <LoginNotifier />\n {children}\n </>\n </AuthComponent>\n );\n}\n\nexport default AuthBootstrap;\n","import React, { useContext } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { FontsLoadedContext } from './FontBootstrap';\n\nexport type FontsLoadedProps = {\n /** Children to show when the fonts have completed loading */\n children: React.ReactNode;\n};\n\nexport function FontsLoaded({ children }: FontsLoadedProps) {\n const isFontsLoaded = useContext(FontsLoadedContext);\n\n if (!isFontsLoaded) {\n return <LoadingOverlay data-testid=\"fonts-loaded-loading\" />;\n }\n\n // eslint-disable-next-line react/jsx-no-useless-fragment\n return <>{children}</>;\n}\n\nexport default FontsLoaded;\n","import React, { useCallback, useMemo, useState } from 'react';\nimport '@deephaven/components/scss/BaseStyleSheet.scss';\nimport { ClientBootstrap } from '@deephaven/jsapi-bootstrap';\nimport {\n RefreshTokenBootstrap,\n useBroadcastLoginListener,\n} from '@deephaven/jsapi-components';\nimport FontBootstrap from './FontBootstrap';\nimport PluginsBootstrap from './PluginsBootstrap';\nimport AuthBootstrap from './AuthBootstrap';\nimport ConnectionBootstrap from './ConnectionBootstrap';\nimport { getBaseUrl, getConnectOptions } from '../utils';\nimport FontsLoaded from './FontsLoaded';\n\nexport type AppBootstrapProps = {\n /** URL of the API to load. */\n apiUrl: string;\n\n /** URL of the plugins to load. */\n pluginsUrl: string;\n\n /** Font class names to load. */\n fontClassNames?: string[];\n\n /**\n * The children to render wrapped when everything is loaded and authenticated.\n */\n children: React.ReactNode;\n};\n\n/**\n * AppBootstrap component. Handles loading the fonts, client, and authentication.\n * Will display the children when everything is loaded and authenticated.\n */\nexport function AppBootstrap({\n apiUrl,\n fontClassNames,\n pluginsUrl,\n children,\n}: AppBootstrapProps) {\n const serverUrl = getBaseUrl(apiUrl).origin;\n const clientOptions = useMemo(() => getConnectOptions(), []);\n\n // On logout, we reset the client and have user login again\n const [logoutCount, setLogoutCount] = useState(0);\n const onLogin = useCallback(() => undefined, []);\n const onLogout = useCallback(() => {\n setLogoutCount(value => value + 1);\n }, []);\n useBroadcastLoginListener(onLogin, onLogout);\n return (\n <FontBootstrap fontClassNames={fontClassNames}>\n <PluginsBootstrap pluginsUrl={pluginsUrl}>\n <ClientBootstrap\n serverUrl={serverUrl}\n options={clientOptions}\n key={logoutCount}\n >\n <RefreshTokenBootstrap>\n <AuthBootstrap>\n <ConnectionBootstrap>\n <FontsLoaded>{children}</FontsLoaded>\n </ConnectionBootstrap>\n </AuthBootstrap>\n </RefreshTokenBootstrap>\n </ClientBootstrap>\n </PluginsBootstrap>\n </FontBootstrap>\n );\n}\n\nexport default AppBootstrap;\n"],"names":["VOLATILITY","LOW","HIGH","START_Y","FOREGROUND","ThemeExport","GRID_SIZE","GRID_COLOR","BACKGROUND","PATTERN","PX_PER_SECOND","RESIZE_DEBOUNCE","INTERACTION_TIMEOUT","RandomAreaPlotAnimation","React","canvas","useRef","container","shade","setShade","useState","scale","ctx","pattern","width","height","rAF","lastTimestamp","data","setCanvasSize","createPatternFill","canvasPattern","contextPattern","randomWalk","prev","rand","change","initData","startingData","y","x","setDataSize","drawAreaLine","path","context","i","drawGridLines","drawCanvas","timestamp","assertNotNull","subPixelMotion","numberOfPoints","debouncedHandleResize","debounce","pauseAnimation","resetIdleTimeout","startAnimation","handleActivity","handleResize","useEffect","jsx","RandomAreaPlotAnimation$1","AUTH_HANDLER_TYPE_ANONYMOUS","log","Log","AuthPluginBase","children","getLoginOptions","client","useClient","error","setError","isLoggedIn","setIsLoggedIn","isCanceled","verifyNotCanceled","CanceledPromiseError","login","loginOptions","e","LoadingOverlay","permissionsOverrides","Component","dh","useApi","useCallback","UserPermissionsOverrideContext","AuthPluginAnonymous","authHandlers","AuthPluginAnonymous$1","requestParentResponse","LOGIN_OPTIONS_REQUEST","getWindowAuthProvider","AuthPluginParent","AuthPluginParent$1","useBroadcastChannel","onEvent","EMPTY_FUNCTION","name","BROADCAST_CHANNEL_NAME","channel","useMemo","event","isMessage","useBroadcastLoginListener","onLogin","onLogout","onMessage","isBroadcastLoginMessage","isBroadcastLogoutMessage","REFRESH_TOKEN_KEY","RefreshTokenContext","createContext","readRefreshToken","cookieToken","Cookies","storeRefreshToken","token","expires","RefreshTokenBootstrap","api","setToken","newToken","LoginForm","errorMessage","isLoggingIn","onSubmit","jsxs","classNames","LoadingSpinner","Login","AUTH_TYPE","PSK_QUERY_PARAM_KEY","PSK_TOKEN_KEY","getWindowToken","clearWindowToken","params","queryString","newPath","readCookieToken","storeCookieToken","inputField","loginPromise","isInputRequired","setIsInputRequired","setIsLoggingIn","loginToken","showError","newLoginPromise","cancelLogin","initialLogin","initialToken","handleSubmit","Fragment","CSSTransition","AuthPluginPsk","AuthPluginPsk$1","FontsLoadedContext","FontBootstrap","fontClassNames","isLoaded","setIsLoaded","className","LoginNotifier","makeMessage","BROADCAST_LOGIN_MESSAGE","CORE_AUTH_PLUGINS","AuthBootstrap","plugins","useContext","PluginsContext","authConfig","setAuthConfig","loadAuthConfigValues","newAuthConfigValues","AuthComponent","getAuthPluginComponent","isLoading","FontsLoaded","AppBootstrap","apiUrl","pluginsUrl","serverUrl","getBaseUrl","clientOptions","getConnectOptions","logoutCount","setLogoutCount","value","PluginsBootstrap","ClientBootstrap","ConnectionBootstrap"],"mappings":"yhBASA,MAAMA,GAAa,KACbC,GAAM,GACNC,GAAO,GACPC,GAAU,KACVC,EAAaC,EAAY,cAAc,EACvCC,EAAY,GACZC,GAAaF,EAAY,UAAU,EACnCG,GAAaH,EAAY,UAAU,EACnCI,EAAU,CAAE,KAAM,EAAG,SAAU,EAAG,aAAc,KAChDC,EAAgB,GAChBC,GAAkB,IAClBC,GAAsB,GAAK,IAG3BC,GAA0BC,GAAM,KAAK,IAAM,CACzC,MAAAC,EAASC,SAA0B,IAAI,EACvCC,EAAYD,SAAuB,IAAI,EACvC,CAACE,EAAOC,CAAQ,EAAIC,WAAS,EAAK,EAClCC,EAAQ,OAAO,iBAEjB,IAAAC,EACAC,EACAC,EACAC,EACAC,EAEAC,EAAwD,KACxDC,EAAiB,CAAA,EAErB,SAASC,GAAgB,CAEnBZ,EAAU,SAAW,OACvBO,EAAQP,EAAU,QAAQ,YAC1BQ,EAASR,EAAU,QAAQ,cAGzBF,EAAO,SAAW,OACbA,EAAA,QAAQ,MAAM,MAAQ,GAAGS,MACz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or-6baa757f.js";import{a_ as T,L as w,B as b}from"./index-
|
|
2
|
-
//# sourceMappingURL=useConnection-
|
|
1
|
+
import{A as l,C as d,I as h,H as v,R as y,aH as L,aI as N,aJ as P,aK as O,aL as $}from"./vendor-6baa757f.js";import{a_ as T,L as w,B as b}from"./index-35c18da1.js";const se=Object.freeze([]),re=new Map,ie=()=>{};class U extends Error{isCanceled=!0}const ae=U;class B extends Error{isTimeout=!0}const I=B;function ue(e){if(e==null)throw new Error("Value is null or undefined")}function le(e,n,o=void 0){const s=e.get(n)??o;if(s!==void 0)return s;throw new Error(`Missing value for key ${n}`)}function p(e,n="No value available in context. Was code wrapped in a provider?"){const o=l.useContext(e);if(o==null)throw new Error(n);return o}function E(){return p(T,"No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?")}function _(e,n){const o=E(),s=l.useMemo(()=>new o.CoreClient(e,n),[o,e,n]);return l.useEffect(()=>()=>{s.disconnect()},[s]),s}const x=l.createContext(null);function ce({serverUrl:e,options:n,children:o}){const s=_(e,n);return d.jsx(x.Provider,{value:s,children:o})}function j(){return p(x,"No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?")}const m=w.module("MessageUtils"),de="io.deephaven.message.LoginOptions.request",ge="io.deephaven.message.SessionDetails.request",fe="io.deephaven.broadcast",q="io.deephaven.broadcast.Login",D="io.deephaven.broadcast.Logout";function A(e){const n=e;return n!=null&&typeof n.id=="string"&&typeof n.message=="string"}function pe(e){return A(e)&&e.message===q}function me(e){return A(e)&&e.message===D}function H(e){const n=e;return n!=null&&typeof n.id=="string"}function W(e,n=h(),o){return{message:e,id:n,payload:o}}async function we(e,n=3e4){if(window.opener==null)throw new Error("window.opener is null, unable to send request.");return new Promise((o,s)=>{let a;const t=h(),i=u=>{const{data:r}=u;if(!H(r)){m.debug("Ignoring non-deephaven response",r);return}if(m.debug("Received message",r),r?.id!==t){m.debug("Ignore message, id doesn't match",r);return}window.clearTimeout(a),window.removeEventListener("message",i),o(r.payload)};window.addEventListener("message",i),a=window.setTimeout(()=>{window.removeEventListener("message",i),s(new I("Request timed out"))},n),window.opener.postMessage(W(e,t),"*")})}function F(e){if(e==null)return!1;const n=e;return n.Component!==void 0&&typeof n.isAvailable=="function"}const Ce=l.createContext({}),he=l.createContext({}),M={react:v,"react-dom":y,redux:L,"react-redux":N},G=P.createRequires(()=>M),J=P.createRemoteComponent({requires:G}),k=J,Y=O.createRequires(M),z=$({requires:Y}),Q=z,c=w.module("@deephaven/app-utils.PluginUtils");function ve(e,n){const o=new URL(`${n}.js`,e),s=v.forwardRef((a,t)=>d.jsx(k,{url:o.href,render:({err:i,Component:u})=>{if(i!=null&&i!==""){const r=`Error loading plugin ${n} from ${o} due to ${i}`;return c.error(r),d.jsx("div",{className:"error-message",children:`${r}`})}return d.jsx(u,{ref:t,...a})}}));return s.pluginName=n,s.displayName="Plugin",s}async function K(e){return await Q(e)}async function V(e){const n=await fetch(e);if(!n.ok)throw new Error(n.statusText);try{return await n.json()}catch{throw new Error("Could not be parsed as JSON")}}async function X(e){c.debug("Loading plugins...");try{const n=await V(`${e}/manifest.json`);if(!Array.isArray(n.plugins))throw new Error("Plugin manifest JSON does not contain plugins array");c.debug("Plugin manifest loaded:",n);const o=[];for(let t=0;t<n.plugins.length;t+=1){const{name:i,main:u}=n.plugins[t],r=`${e}/${i}/${u}`;o.push(K(r))}const s=await Promise.allSettled(o),a=new Map;for(let t=0;t<s.length;t+=1){const i=s[t],{name:u}=n.plugins[t];i.status==="fulfilled"?a.set(u,i.value):c.error(`Unable to load plugin ${u}`,i.reason)}return c.info("Plugins loaded:",a),a}catch(n){return c.error("Unable to load plugins:",n),new Map}}function Z(e){return e.get("AuthHandlers")?.split(",")??[]}function Pe(e,n,o){const s=Z(n),a=[...e.entries()].filter(([,r])=>F(r.AuthPlugin)).map(([r,g])=>[r,g.AuthPlugin]);a.push(...o??[]);const t=a.filter(([r,g])=>g.isAvailable(s,n));if(t.length===0)throw new Error(`No login plugins found, please register a login plugin for auth handlers: ${s}`);t.length>1&&c.warn("More than one login plugin available, will use the first one: ",t.map(([r])=>r).join(", "));const[i,u]=t[0];return c.info("Using LoginPlugin",i),u.Component}const R=l.createContext(null);function Ee({pluginsUrl:e,children:n}){const[o,s]=l.useState(null);return l.useEffect(function(){let t=!1;async function i(){const u=await X(e);t||s(u)}return i(),()=>{t=!0}},[e]),d.jsx(R.Provider,{value:o,children:n})}const ee=w.module("@deephaven/jsapi-components.ConnectionBootstrap"),S=l.createContext(null);function xe({children:e}){const n=E(),o=j(),[s,a]=l.useState(),[t,i]=l.useState();return l.useEffect(function(){let r=!1;async function g(){try{const f=await o.getAsIdeConnection();if(r)return;i(f)}catch(f){if(r)return;a(f)}}return g(),()=>{r=!0}},[n,o]),l.useEffect(function(){if(t==null)return;function r(f){const{detail:C}=f;ee.info("Shutdown",`${JSON.stringify(C)}`),a(`Server shutdown: ${C??"Unknown reason"}`)}return t.addEventListener(n.IdeConnection.EVENT_SHUTDOWN,r)},[n,t]),t==null||s!=null?d.jsx(b,{"data-testid":"connection-bootstrap-loading",isLoading:t==null,errorMessage:s!=null?`${s}`:void 0}):d.jsx(S.Provider,{value:t,children:e})}function Ae(e){return new URL(e,`${window.location}`)}function ne(){return new URLSearchParams(window.location.search).get("envoyPrefix")}function Me(){const e=ne();return e!=null?{headers:{"envoy-prefix":e}}:{headers:{}}}function Re(){return p(R,"No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?")}function Se(){return p(S,"No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?")}export{X as A,fe as B,ae as C,Z as D,se as E,ne as F,de as L,R as P,k as R,ge as S,I as T,Ce as U,ue as a,re as b,D as c,Ae as d,Se as e,Re as f,le as g,he as h,E as i,A as j,ie as k,ve as l,W as m,pe as n,me as o,q as p,Pe as q,we as r,Me as s,Ee as t,j as u,ce as v,xe as w,S as x,K as y,V as z};
|
|
2
|
+
//# sourceMappingURL=useConnection-42b98437.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useConnection-2b92105d.js","sources":["../../../utils/src/DataUtils.ts","../../../utils/src/CanceledPromiseError.ts","../../../utils/src/TimeoutError.ts","../../../utils/src/Asserts.ts","../../../react-hooks/src/useContextOrThrow.ts","../../../jsapi-bootstrap/src/useApi.ts","../../../jsapi-bootstrap/src/useCreateClient.ts","../../../jsapi-bootstrap/src/ClientBootstrap.tsx","../../../jsapi-bootstrap/src/useClient.ts","../../../jsapi-utils/src/MessageUtils.ts","../../../auth-plugins/src/AuthPlugin.ts","../../../auth-plugins/src/UserContexts.ts","../../../app-utils/src/plugins/remote-component.config.ts","../../../app-utils/src/plugins/RemoteComponent.ts","../../../app-utils/src/plugins/loadRemoteModule.ts","../../../app-utils/src/plugins/PluginUtils.tsx","../../../app-utils/src/components/PluginsBootstrap.tsx","../../../app-utils/src/components/ConnectionBootstrap.tsx","../../../app-utils/src/utils/ConnectUtils.ts","../../../app-utils/src/components/usePlugins.ts","../../../app-utils/src/components/useConnection.ts"],"sourcesContent":["export const EMPTY_ARRAY = Object.freeze([]);\n\nexport const EMPTY_MAP: ReadonlyMap<never, never> = new Map<never, never>();\n\nexport const EMPTY_FUNCTION = () => undefined;\n","class CanceledPromiseError extends Error {\n isCanceled = true;\n}\n\nexport default CanceledPromiseError;\n","class TimeoutError extends Error {\n isTimeout = true;\n}\n\nexport default TimeoutError;\n","// eslint-disable-next-line import/prefer-default-export\nexport function assertNotNull<T>(\n value: T | null | undefined\n): asserts value is T {\n if (value == null) throw new Error('Value is null or undefined');\n}\n\n/**\n * Retrieve a value from a map. If the value is not found and no default value is provided, throw.\n * Use when the value _must_ be present\n * @param map The map to get the value from\n * @param key The key to fetch the value for\n * @param defaultValue A default value to set if the key is not present\n * @returns The value set for that key\n */\nexport function getOrThrow<K, V>(\n map: Map<K, V>,\n key: K,\n defaultValue: V | undefined = undefined\n): V {\n const value = map.get(key) ?? defaultValue;\n if (value !== undefined) {\n return value;\n }\n\n throw new Error(`Missing value for key ${key}`);\n}\n","import React, { useContext } from 'react';\n\n/**\n * Fetch a given context or throw an error if it is null.\n * @param context Context to use\n * @param message Message to throw if context is null\n * @returns Context, or throws\n */\nexport function useContextOrThrow<T>(\n context: React.Context<T>,\n message = 'No value available in context. Was code wrapped in a provider?'\n): NonNullable<T> {\n const value = useContext(context);\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\n\nexport default useContextOrThrow;\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ApiContext } from './ApiBootstrap';\n\nexport function useApi() {\n return useContextOrThrow(\n ApiContext,\n 'No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?'\n );\n}\n\nexport default useApi;\n","import { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\nimport { useEffect, useMemo } from 'react';\nimport useApi from './useApi';\n\nexport function useCreateClient(\n serverUrl: string,\n options?: ConnectOptions\n): CoreClient {\n const api = useApi();\n const client = useMemo(() => new api.CoreClient(serverUrl, options), [\n api,\n serverUrl,\n options,\n ]);\n useEffect(\n () => () => {\n client.disconnect();\n },\n [client]\n );\n return client;\n}\n\nexport default useCreateClient;\n","import React, { createContext } from 'react';\nimport { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\nimport useCreateClient from './useCreateClient';\n\nexport const ClientContext = createContext<CoreClient | null>(null);\n\nexport type ClientBootstrapProps = {\n /** URL of the server to connect to */\n serverUrl: string;\n\n /** Connection options to pass to CoreClient when connecting */\n options?: ConnectOptions;\n\n /**\n * The children to render wrapped with the ClientContext.\n * Will not render children until the client is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ClientBootstrap component. Handles creating the client.\n */\nexport function ClientBootstrap({\n serverUrl,\n options,\n children,\n}: ClientBootstrapProps) {\n const client = useCreateClient(serverUrl, options);\n return (\n <ClientContext.Provider value={client}>{children}</ClientContext.Provider>\n );\n}\n\nexport default ClientBootstrap;\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ClientContext } from './ClientBootstrap';\n\nexport function useClient() {\n return useContextOrThrow(\n ClientContext,\n 'No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?'\n );\n}\n\nexport default useClient;\n","import shortid from 'shortid';\nimport Log from '@deephaven/log';\nimport { TimeoutError } from '@deephaven/utils';\n\nconst log = Log.module('MessageUtils');\n\nexport const LOGIN_OPTIONS_REQUEST =\n 'io.deephaven.message.LoginOptions.request';\n\nexport const SESSION_DETAILS_REQUEST =\n 'io.deephaven.message.SessionDetails.request';\n\n/**\n * Use a BroadcastChannel for sending messages between tabs, such as when the user logs out.\n * Something that isn't clear from the docs - for inter-browser communication, you must use `postMessage` and `onmessage`.\n * `BroadcastChannel` is an `EventTarget`, and does support `addEventListener`/`dispatchEvent` etc... but that's only within the same instance of that object!\n * https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API\n */\nexport const BROADCAST_CHANNEL_NAME = 'io.deephaven.broadcast';\n\n/**\n * Event emitted when the user has logged in successfully\n */\nexport const BROADCAST_LOGIN_MESSAGE = 'io.deephaven.broadcast.Login';\n\n/**\n * Event emitted when the user has logged out\n */\nexport const BROADCAST_LOGOUT_MESSAGE = 'io.deephaven.broadcast.Logout';\n\nexport interface Message<T> {\n id: string;\n message: string;\n payload?: T;\n}\n\nexport interface BroadcastLoginMessage extends Message<void> {\n message: typeof BROADCAST_LOGIN_MESSAGE;\n}\n\nexport interface BroadcastLogoutMessage extends Message<void> {\n message: typeof BROADCAST_LOGOUT_MESSAGE;\n}\n\nexport interface Response<T> {\n id: string;\n payload: T;\n}\n\nexport function isMessage<T>(obj: unknown): obj is Message<T> {\n const message = obj as Message<T>;\n return (\n message != null &&\n typeof message.id === 'string' &&\n typeof message.message === 'string'\n );\n}\n\nexport function isBroadcastLoginMessage(\n obj: unknown\n): obj is BroadcastLoginMessage {\n return isMessage(obj) && obj.message === BROADCAST_LOGIN_MESSAGE;\n}\n\nexport function isBroadcastLogoutMessage(\n obj: unknown\n): obj is BroadcastLogoutMessage {\n return isMessage(obj) && obj.message === BROADCAST_LOGOUT_MESSAGE;\n}\n\nexport function isResponse<T>(obj: unknown): obj is Response<T> {\n const response = obj as Response<T>;\n return response != null && typeof response.id === 'string';\n}\n\n/**\n * Make message object with optional payload\n * @param message Message string\n * @param id Unique message id\n * @param payload Payload to send\n * @returns Message\n */\nexport function makeMessage<T>(\n message: string,\n id = shortid(),\n payload?: T\n): Message<T> {\n return { message, id, payload };\n}\n\n/**\n * Make response object for given message id\n * @param messageId Id of the request message to respond to\n * @param payload Payload to respond with\n * @returns Response\n */\nexport function makeResponse<T>(messageId: string, payload: T): Response<T> {\n return { id: messageId, payload };\n}\n\n/**\n * Request data from the parent window and wait for response\n * @param request Request message to send to the parent window\n * @param timeout Timeout in ms\n * @returns Payload of the given type, or undefined\n */\nexport async function requestParentResponse<T>(\n request: string,\n timeout = 30000\n): Promise<T> {\n if (window.opener == null) {\n throw new Error('window.opener is null, unable to send request.');\n }\n return new Promise((resolve, reject) => {\n let timeoutId: number;\n const id = shortid();\n const listener = (event: MessageEvent) => {\n const { data } = event;\n if (!isResponse<T>(data)) {\n log.debug('Ignoring non-deephaven response', data);\n return;\n }\n log.debug('Received message', data);\n if (data?.id !== id) {\n log.debug(\"Ignore message, id doesn't match\", data);\n return;\n }\n window.clearTimeout(timeoutId);\n window.removeEventListener('message', listener);\n resolve(data.payload);\n };\n window.addEventListener('message', listener);\n timeoutId = window.setTimeout(() => {\n window.removeEventListener('message', listener);\n reject(new TimeoutError('Request timed out'));\n }, timeout);\n window.opener.postMessage(makeMessage(request, id), '*');\n });\n}\n","import React from 'react';\n\n/**\n * Map from auth config keys to their values\n * E.g. Map { AuthHandlers → \"io.deephaven.auth.AnonymousAuthenticationHandler\" }\n */\nexport type AuthConfigMap = Map<string, string>;\n\n/**\n * Props for the auth plugin component to render\n */\nexport type AuthPluginProps = {\n /** Map from config keys to their values */\n authConfigValues: AuthConfigMap;\n\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n};\n\nexport type AuthPluginComponent = React.FunctionComponent<AuthPluginProps>;\n\n/**\n * Whether the auth plugin is available given the current configuration\n */\nexport type AuthPluginIsAvailableFunction = (\n authHandlers: string[],\n authConfig: AuthConfigMap\n) => boolean;\n\nexport type AuthPlugin = {\n Component: AuthPluginComponent;\n isAvailable: AuthPluginIsAvailableFunction;\n};\n\nexport function isAuthPlugin(plugin?: unknown): plugin is AuthPlugin {\n if (plugin == null) return false;\n const authPlugin = plugin as AuthPlugin;\n return (\n authPlugin.Component !== undefined &&\n typeof authPlugin.isAvailable === 'function'\n );\n}\n","import { createContext } from 'react';\nimport { User, UserPermissions } from '@deephaven/redux';\n\nexport type UserOverride = Partial<Omit<User, 'permissions'>>;\n\nexport type UserPermissionsOverride = Partial<UserPermissions>;\n\nexport const UserOverrideContext = createContext<UserOverride>({});\n\nexport const UserPermissionsOverrideContext = createContext<UserPermissionsOverride>(\n {}\n);\n","/* eslint-disable global-require */\n/**\n * remote-component.config.js\n *\n * Dependencies for Remote Components\n */\nimport react from 'react';\nimport * as redux from 'redux';\nimport * as reactRedux from 'react-redux';\nimport ReactDOM from 'react-dom';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const resolve = {\n react,\n 'react-dom': ReactDOM,\n redux,\n 'react-redux': reactRedux,\n};\n","import {\n createRemoteComponent,\n createRequires,\n} from '@paciolan/remote-component';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(() => resolve);\n\nexport const RemoteComponent = createRemoteComponent({ requires });\nexport default RemoteComponent;\n","import createLoadRemoteModule, {\n createRequires,\n} from '@paciolan/remote-module-loader';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(resolve);\n\nexport const loadRemoteModule: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (url: string): Promise<any>;\n} = createLoadRemoteModule({\n requires,\n});\n\nexport default loadRemoteModule;\n","import React, { ForwardRefExoticComponent } from 'react';\nimport {\n AuthPlugin,\n AuthPluginComponent,\n isAuthPlugin,\n} from '@deephaven/auth-plugins';\nimport Log from '@deephaven/log';\nimport RemoteComponent from './RemoteComponent';\nimport loadRemoteModule from './loadRemoteModule';\n\nconst log = Log.module('@deephaven/app-utils.PluginUtils');\n\n// A PluginModule. This interface should have new fields added to it from different levels of plugins.\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface PluginModule {}\n\nexport type PluginModuleMap = Map<string, PluginModule>;\n\n/**\n * Load a component plugin from the server.\n * @param baseURL Base URL of the plugin server\n * @param pluginName Name of the component plugin to load\n * @returns A lazily loaded JSX.Element from the plugin\n */\nexport function loadComponentPlugin(\n baseURL: URL,\n pluginName: string\n): ForwardRefExoticComponent<React.RefAttributes<unknown>> {\n const pluginUrl = new URL(`${pluginName}.js`, baseURL);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const Plugin: any = React.forwardRef((props, ref) => (\n <RemoteComponent\n url={pluginUrl.href}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n render={({ err, Component }: { err: unknown; Component: any }) => {\n if (err != null && err !== '') {\n const errorMessage = `Error loading plugin ${pluginName} from ${pluginUrl} due to ${err}`;\n log.error(errorMessage);\n return <div className=\"error-message\">{`${errorMessage}`}</div>;\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <Component ref={ref} {...props} />;\n }}\n />\n ));\n Plugin.pluginName = pluginName;\n Plugin.displayName = 'Plugin';\n return Plugin;\n}\n\n/**\n * Imports a commonjs plugin module from the provided URL\n * @param pluginUrl The URL of the plugin to load\n * @returns The loaded module\n */\nexport async function loadModulePlugin(pluginUrl: string): Promise<unknown> {\n const myModule = await loadRemoteModule(pluginUrl);\n return myModule;\n}\n\n/**\n * Loads a JSON file and returns the JSON object\n * @param jsonUrl The URL of the JSON file to load\n * @returns The JSON object of the manifest file\n */\nexport async function loadJson(\n jsonUrl: string\n): Promise<{ plugins: { name: string; main: string }[] }> {\n const res = await fetch(jsonUrl);\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n try {\n return await res.json();\n } catch {\n throw new Error('Could not be parsed as JSON');\n }\n}\n\n/**\n * Load all plugin modules available.\n * @param modulePluginsUrl The base URL of the module plugins to load\n * @returns A map from the name of the plugin to the plugin module that was loaded\n */\nexport async function loadModulePlugins(\n modulePluginsUrl: string\n): Promise<PluginModuleMap> {\n log.debug('Loading plugins...');\n try {\n const manifest = await loadJson(`${modulePluginsUrl}/manifest.json`);\n\n if (!Array.isArray(manifest.plugins)) {\n throw new Error('Plugin manifest JSON does not contain plugins array');\n }\n\n log.debug('Plugin manifest loaded:', manifest);\n const pluginPromises: Promise<unknown>[] = [];\n for (let i = 0; i < manifest.plugins.length; i += 1) {\n const { name, main } = manifest.plugins[i];\n const pluginMainUrl = `${modulePluginsUrl}/${name}/${main}`;\n pluginPromises.push(loadModulePlugin(pluginMainUrl));\n }\n const pluginModules = await Promise.allSettled(pluginPromises);\n\n const pluginMap: PluginModuleMap = new Map();\n for (let i = 0; i < pluginModules.length; i += 1) {\n const module = pluginModules[i];\n const { name } = manifest.plugins[i];\n if (module.status === 'fulfilled') {\n pluginMap.set(name, module.value as PluginModule);\n } else {\n log.error(`Unable to load plugin ${name}`, module.reason);\n }\n }\n log.info('Plugins loaded:', pluginMap);\n\n return pluginMap;\n } catch (e) {\n log.error('Unable to load plugins:', e);\n return new Map();\n }\n}\n\nexport function getAuthHandlers(\n authConfigValues: Map<string, string>\n): string[] {\n return authConfigValues.get('AuthHandlers')?.split(',') ?? [];\n}\n\n/**\n * Get the auth plugin component from the plugin map and current configuration\n * Throws if no auth plugin is available\n *\n * @param pluginMap Map of plugins loaded from the server\n * @param authConfigValues Auth config values from the server\n * @param corePlugins Map of core auth plugins to include in the list. They are added after the loaded plugins\n * @returns The auth plugin component to render\n */\nexport function getAuthPluginComponent(\n pluginMap: PluginModuleMap,\n authConfigValues: Map<string, string>,\n corePlugins?: Map<string, AuthPlugin>\n): AuthPluginComponent {\n const authHandlers = getAuthHandlers(authConfigValues);\n // Filter out all the plugins that are auth plugins, and then map them to [pluginName, AuthPlugin] pairs\n // Uses some pretty disgusting casting, because TypeScript wants to treat it as an (string | AuthPlugin)[] array instead\n const authPlugins = ([\n ...pluginMap.entries(),\n ].filter(([, plugin]: [string, { AuthPlugin?: AuthPlugin }]) =>\n isAuthPlugin(plugin.AuthPlugin)\n ) as [string, { AuthPlugin: AuthPlugin }][]).map(([name, plugin]) => [\n name,\n plugin.AuthPlugin,\n ]) as [string, AuthPlugin][];\n\n // Add all the core plugins in priority\n authPlugins.push(...(corePlugins ?? []));\n\n // Filter the available auth plugins\n\n const availableAuthPlugins = authPlugins.filter(([name, authPlugin]) =>\n authPlugin.isAvailable(authHandlers, authConfigValues)\n );\n\n if (availableAuthPlugins.length === 0) {\n throw new Error(\n `No login plugins found, please register a login plugin for auth handlers: ${authHandlers}`\n );\n } else if (availableAuthPlugins.length > 1) {\n log.warn(\n 'More than one login plugin available, will use the first one: ',\n availableAuthPlugins.map(([name]) => name).join(', ')\n );\n }\n\n const [loginPluginName, NewLoginPlugin] = availableAuthPlugins[0];\n log.info('Using LoginPlugin', loginPluginName);\n\n return NewLoginPlugin.Component;\n}\n","import React, { createContext, useEffect, useState } from 'react';\nimport { PluginModuleMap, loadModulePlugins } from '../plugins';\n\nexport const PluginsContext = createContext<PluginModuleMap | null>(null);\n\nexport type PluginsBootstrapProps = {\n /**\n * Base URL of the plugins to load.\n */\n pluginsUrl: string;\n\n /**\n * The children to render wrapped with the PluginsContext.\n * Note that it renders the children even if the plugins aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * PluginsBootstrap component. Handles loading the plugins.\n */\nexport function PluginsBootstrap({\n pluginsUrl,\n children,\n}: PluginsBootstrapProps) {\n const [plugins, setPlugins] = useState<PluginModuleMap | null>(null);\n useEffect(\n function initPlugins() {\n let isCanceled = false;\n async function loadPlugins() {\n const pluginModules = await loadModulePlugins(pluginsUrl);\n if (!isCanceled) {\n setPlugins(pluginModules);\n }\n }\n loadPlugins();\n return () => {\n isCanceled = true;\n };\n },\n [pluginsUrl]\n );\n\n return (\n <PluginsContext.Provider value={plugins}>\n {children}\n </PluginsContext.Provider>\n );\n}\n\nexport default PluginsBootstrap;\n","import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport { IdeConnection } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');\n\nexport const ConnectionContext = createContext<IdeConnection | null>(null);\n\nexport type ConnectionBootstrapProps = {\n /**\n * The children to render wrapped with the ConnectionContext.\n * Will not render children until the connection is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ConnectionBootstrap component. Handles initializing the connection.\n */\nexport function ConnectionBootstrap({ children }: ConnectionBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [connection, setConnection] = useState<IdeConnection>();\n useEffect(\n function initConnection() {\n let isCanceled = false;\n async function loadConnection() {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCanceled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCanceled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCanceled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent) {\n const { detail } = event;\n log.info('Shutdown', `${JSON.stringify(detail)}`);\n setError(`Server shutdown: ${detail ?? 'Unknown reason'}`);\n }\n\n const removerFn = connection.addEventListener(\n api.IdeConnection.EVENT_SHUTDOWN,\n handleShutdown\n );\n return removerFn;\n },\n [api, connection]\n );\n\n if (connection == null || error != null) {\n return (\n <LoadingOverlay\n data-testid=\"connection-bootstrap-loading\"\n isLoading={connection == null}\n errorMessage={error != null ? `${error}` : undefined}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n","import { ConnectOptions } from '@deephaven/jsapi-types';\n\n/**\n * Get the base URL of the API\n * @param apiUrl API URL\n * @returns URL for the base of the API\n */\nexport function getBaseUrl(apiUrl: string): URL {\n return new URL(apiUrl, `${window.location}`);\n}\n\n/**\n * Get the Envoy prefix header value\n * @returns Envoy prefix header value\n */\nexport function getEnvoyPrefix(): string | null {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get('envoyPrefix');\n}\n\nexport function getConnectOptions(): ConnectOptions {\n const envoyPrefix = getEnvoyPrefix();\n return envoyPrefix != null\n ? { headers: { 'envoy-prefix': envoyPrefix } }\n : { headers: {} };\n}\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport function usePlugins() {\n return useContextOrThrow(\n PluginsContext,\n 'No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?'\n );\n}\n\nexport default usePlugins;\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ConnectionContext } from './ConnectionBootstrap';\n\nexport function useConnection() {\n return useContextOrThrow(\n ConnectionContext,\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?'\n );\n}\n\nexport default useConnection;\n"],"names":["EMPTY_ARRAY","EMPTY_MAP","EMPTY_FUNCTION","CanceledPromiseError","CanceledPromiseError$1","TimeoutError","TimeoutError$1","assertNotNull","value","getOrThrow","map","key","defaultValue","useContextOrThrow","context","message","useContext","useApi","ApiContext","useCreateClient","serverUrl","options","api","client","useMemo","useEffect","ClientContext","createContext","ClientBootstrap","children","useClient","log","Log","LOGIN_OPTIONS_REQUEST","SESSION_DETAILS_REQUEST","BROADCAST_CHANNEL_NAME","BROADCAST_LOGIN_MESSAGE","BROADCAST_LOGOUT_MESSAGE","isMessage","obj","isBroadcastLoginMessage","isBroadcastLogoutMessage","isResponse","response","makeMessage","id","shortid","payload","requestParentResponse","request","timeout","resolve","reject","timeoutId","listener","event","data","isAuthPlugin","plugin","authPlugin","UserOverrideContext","UserPermissionsOverrideContext","react","ReactDOM","redux","reactRedux","requires","createRequires","RemoteComponent","createRemoteComponent","RemoteComponent$1","loadRemoteModule","createLoadRemoteModule","loadRemoteModule$1","loadComponentPlugin","baseURL","pluginName","pluginUrl","Plugin","React","props","ref","jsx","err","Component","errorMessage","loadModulePlugin","loadJson","jsonUrl","res","loadModulePlugins","modulePluginsUrl","manifest","pluginPromises","i","name","main","pluginMainUrl","pluginModules","pluginMap","module","e","getAuthHandlers","authConfigValues","getAuthPluginComponent","corePlugins","authHandlers","authPlugins","availableAuthPlugins","loginPluginName","NewLoginPlugin","PluginsContext","PluginsBootstrap","pluginsUrl","plugins","setPlugins","useState","isCanceled","loadPlugins","ConnectionContext","ConnectionBootstrap","error","setError","connection","setConnection","loadConnection","newConnection","handleShutdown","detail","LoadingOverlay","getBaseUrl","apiUrl","getEnvoyPrefix","getConnectOptions","envoyPrefix","usePlugins","useConnection"],"mappings":"oKAAO,MAAMA,GAAc,OAAO,OAAO,EAAE,EAE9BC,OAA2C,IAE3CC,GAAiB,IAAA,GCJ9B,MAAMC,UAA6B,KAAM,CACvC,WAAa,EACf,CAEA,MAAAC,GAAeD,ECJf,MAAME,UAAqB,KAAM,CAC/B,UAAY,EACd,CAEA,MAAAC,EAAeD,ECHR,SAASE,GACdC,EACoB,CACpB,GAAIA,GAAS,KAAY,MAAA,IAAI,MAAM,4BAA4B,CACjE,CAUO,SAASC,GACdC,EACAC,EACAC,EAA8B,OAC3B,CACH,MAAMJ,EAAQE,EAAI,IAAIC,CAAG,GAAKC,EAC9B,GAAIJ,IAAU,OACL,OAAAA,EAGH,MAAA,IAAI,MAAM,yBAAyBG,GAAK,CAChD,CClBgB,SAAAE,EACdC,EACAC,EAAU,iEACM,CACV,MAAAP,EAAQQ,aAAWF,CAAO,EAChC,GAAIN,GAAS,KACL,MAAA,IAAI,MAAMO,CAAO,EAElB,OAAAP,CACT,CCdO,SAASS,GAAS,CAChB,OAAAJ,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CAAW,EAAAzE,EACnBxB,GAAI,KAAK,WAAY,GAAG,KAAK,UAAUiG,CAAM,GAAG,EACvCN,EAAA,oBAAoBM,GAAU,kBAAkB,CAC3D,CAMO,OAJWL,EAAW,iBAC3BrG,EAAI,cAAc,eAClByG,CAAA,CAGJ,EACA,CAACzG,EAAKqG,CAAU,CAAA,EAGdA,GAAc,MAAQF,GAAS,KAE/BvC,EAAA,IAAC+C,EAAA,CACC,cAAY,+BACZ,UAAWN,GAAc,KACzB,aAAcF,GAAS,KAAO,GAAGA,IAAU,MAAA,CAAA,QAM9CF,EAAkB,SAAlB,CAA2B,MAAOI,EAChC,SAAA9F,CACH,CAAA,CAEJ,CC9EO,SAASqG,GAAWC,EAAqB,CAC9C,OAAO,IAAI,IAAIA,EAAQ,GAAG,OAAO,UAAU,CAC7C,CAMO,SAASC,IAAgC,CAEvC,OADc,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC3C,IAAI,aAAa,CACvC,CAEO,SAASC,IAAoC,CAClD,MAAMC,EAAcF,KACpB,OAAOE,GAAe,KAClB,CAAE,QAAS,CAAE,eAAgBA,CAAY,GACzC,CAAE,QAAS,CAAA,EACjB,CCtBO,SAASC,IAAa,CACpB,OAAA1H,EACLkG,EACA,sGAAA,CAEJ,CCLO,SAASyB,IAAgB,CACvB,OAAA3H,EACL0G,EACA,qHAAA,CAEJ"}
|
|
1
|
+
{"version":3,"file":"useConnection-42b98437.js","sources":["../../../utils/src/DataUtils.ts","../../../utils/src/CanceledPromiseError.ts","../../../utils/src/TimeoutError.ts","../../../utils/src/Asserts.ts","../../../react-hooks/src/useContextOrThrow.ts","../../../jsapi-bootstrap/src/useApi.ts","../../../jsapi-bootstrap/src/useCreateClient.ts","../../../jsapi-bootstrap/src/ClientBootstrap.tsx","../../../jsapi-bootstrap/src/useClient.ts","../../../jsapi-utils/src/MessageUtils.ts","../../../auth-plugins/src/AuthPlugin.ts","../../../auth-plugins/src/UserContexts.ts","../../../app-utils/src/plugins/remote-component.config.ts","../../../app-utils/src/plugins/RemoteComponent.ts","../../../app-utils/src/plugins/loadRemoteModule.ts","../../../app-utils/src/plugins/PluginUtils.tsx","../../../app-utils/src/components/PluginsBootstrap.tsx","../../../app-utils/src/components/ConnectionBootstrap.tsx","../../../app-utils/src/utils/ConnectUtils.ts","../../../app-utils/src/components/usePlugins.ts","../../../app-utils/src/components/useConnection.ts"],"sourcesContent":["export const EMPTY_ARRAY = Object.freeze([]);\n\nexport const EMPTY_MAP: ReadonlyMap<never, never> = new Map<never, never>();\n\nexport const EMPTY_FUNCTION = () => undefined;\n","class CanceledPromiseError extends Error {\n isCanceled = true;\n}\n\nexport default CanceledPromiseError;\n","class TimeoutError extends Error {\n isTimeout = true;\n}\n\nexport default TimeoutError;\n","// eslint-disable-next-line import/prefer-default-export\nexport function assertNotNull<T>(\n value: T | null | undefined\n): asserts value is T {\n if (value == null) throw new Error('Value is null or undefined');\n}\n\n/**\n * Retrieve a value from a map. If the value is not found and no default value is provided, throw.\n * Use when the value _must_ be present\n * @param map The map to get the value from\n * @param key The key to fetch the value for\n * @param defaultValue A default value to set if the key is not present\n * @returns The value set for that key\n */\nexport function getOrThrow<K, V>(\n map: Map<K, V>,\n key: K,\n defaultValue: V | undefined = undefined\n): V {\n const value = map.get(key) ?? defaultValue;\n if (value !== undefined) {\n return value;\n }\n\n throw new Error(`Missing value for key ${key}`);\n}\n","import React, { useContext } from 'react';\n\n/**\n * Fetch a given context or throw an error if it is null.\n * @param context Context to use\n * @param message Message to throw if context is null\n * @returns Context, or throws\n */\nexport function useContextOrThrow<T>(\n context: React.Context<T>,\n message = 'No value available in context. Was code wrapped in a provider?'\n): NonNullable<T> {\n const value = useContext(context);\n if (value == null) {\n throw new Error(message);\n }\n return value;\n}\n\nexport default useContextOrThrow;\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ApiContext } from './ApiBootstrap';\n\nexport function useApi() {\n return useContextOrThrow(\n ApiContext,\n 'No API available in useApi. Was code wrapped in ApiBootstrap or ApiContext.Provider?'\n );\n}\n\nexport default useApi;\n","import { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\nimport { useEffect, useMemo } from 'react';\nimport useApi from './useApi';\n\nexport function useCreateClient(\n serverUrl: string,\n options?: ConnectOptions\n): CoreClient {\n const api = useApi();\n const client = useMemo(() => new api.CoreClient(serverUrl, options), [\n api,\n serverUrl,\n options,\n ]);\n useEffect(\n () => () => {\n client.disconnect();\n },\n [client]\n );\n return client;\n}\n\nexport default useCreateClient;\n","import React, { createContext } from 'react';\nimport { ConnectOptions, CoreClient } from '@deephaven/jsapi-types';\nimport useCreateClient from './useCreateClient';\n\nexport const ClientContext = createContext<CoreClient | null>(null);\n\nexport type ClientBootstrapProps = {\n /** URL of the server to connect to */\n serverUrl: string;\n\n /** Connection options to pass to CoreClient when connecting */\n options?: ConnectOptions;\n\n /**\n * The children to render wrapped with the ClientContext.\n * Will not render children until the client is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ClientBootstrap component. Handles creating the client.\n */\nexport function ClientBootstrap({\n serverUrl,\n options,\n children,\n}: ClientBootstrapProps) {\n const client = useCreateClient(serverUrl, options);\n return (\n <ClientContext.Provider value={client}>{children}</ClientContext.Provider>\n );\n}\n\nexport default ClientBootstrap;\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ClientContext } from './ClientBootstrap';\n\nexport function useClient() {\n return useContextOrThrow(\n ClientContext,\n 'No Client available in useClient. Was code wrapped in ClientBootstrap or ClientContext.Provider?'\n );\n}\n\nexport default useClient;\n","import shortid from 'shortid';\nimport Log from '@deephaven/log';\nimport { TimeoutError } from '@deephaven/utils';\n\nconst log = Log.module('MessageUtils');\n\nexport const LOGIN_OPTIONS_REQUEST =\n 'io.deephaven.message.LoginOptions.request';\n\nexport const SESSION_DETAILS_REQUEST =\n 'io.deephaven.message.SessionDetails.request';\n\n/**\n * Use a BroadcastChannel for sending messages between tabs, such as when the user logs out.\n * Something that isn't clear from the docs - for inter-browser communication, you must use `postMessage` and `onmessage`.\n * `BroadcastChannel` is an `EventTarget`, and does support `addEventListener`/`dispatchEvent` etc... but that's only within the same instance of that object!\n * https://developer.mozilla.org/en-US/docs/Web/API/Broadcast_Channel_API\n */\nexport const BROADCAST_CHANNEL_NAME = 'io.deephaven.broadcast';\n\n/**\n * Event emitted when the user has logged in successfully\n */\nexport const BROADCAST_LOGIN_MESSAGE = 'io.deephaven.broadcast.Login';\n\n/**\n * Event emitted when the user has logged out\n */\nexport const BROADCAST_LOGOUT_MESSAGE = 'io.deephaven.broadcast.Logout';\n\nexport interface Message<T> {\n id: string;\n message: string;\n payload?: T;\n}\n\nexport interface BroadcastLoginMessage extends Message<void> {\n message: typeof BROADCAST_LOGIN_MESSAGE;\n}\n\nexport interface BroadcastLogoutMessage extends Message<void> {\n message: typeof BROADCAST_LOGOUT_MESSAGE;\n}\n\nexport interface Response<T> {\n id: string;\n payload: T;\n}\n\nexport function isMessage<T>(obj: unknown): obj is Message<T> {\n const message = obj as Message<T>;\n return (\n message != null &&\n typeof message.id === 'string' &&\n typeof message.message === 'string'\n );\n}\n\nexport function isBroadcastLoginMessage(\n obj: unknown\n): obj is BroadcastLoginMessage {\n return isMessage(obj) && obj.message === BROADCAST_LOGIN_MESSAGE;\n}\n\nexport function isBroadcastLogoutMessage(\n obj: unknown\n): obj is BroadcastLogoutMessage {\n return isMessage(obj) && obj.message === BROADCAST_LOGOUT_MESSAGE;\n}\n\nexport function isResponse<T>(obj: unknown): obj is Response<T> {\n const response = obj as Response<T>;\n return response != null && typeof response.id === 'string';\n}\n\n/**\n * Make message object with optional payload\n * @param message Message string\n * @param id Unique message id\n * @param payload Payload to send\n * @returns Message\n */\nexport function makeMessage<T>(\n message: string,\n id = shortid(),\n payload?: T\n): Message<T> {\n return { message, id, payload };\n}\n\n/**\n * Make response object for given message id\n * @param messageId Id of the request message to respond to\n * @param payload Payload to respond with\n * @returns Response\n */\nexport function makeResponse<T>(messageId: string, payload: T): Response<T> {\n return { id: messageId, payload };\n}\n\n/**\n * Request data from the parent window and wait for response\n * @param request Request message to send to the parent window\n * @param timeout Timeout in ms\n * @returns Payload of the given type, or undefined\n */\nexport async function requestParentResponse<T>(\n request: string,\n timeout = 30000\n): Promise<T> {\n if (window.opener == null) {\n throw new Error('window.opener is null, unable to send request.');\n }\n return new Promise((resolve, reject) => {\n let timeoutId: number;\n const id = shortid();\n const listener = (event: MessageEvent) => {\n const { data } = event;\n if (!isResponse<T>(data)) {\n log.debug('Ignoring non-deephaven response', data);\n return;\n }\n log.debug('Received message', data);\n if (data?.id !== id) {\n log.debug(\"Ignore message, id doesn't match\", data);\n return;\n }\n window.clearTimeout(timeoutId);\n window.removeEventListener('message', listener);\n resolve(data.payload);\n };\n window.addEventListener('message', listener);\n timeoutId = window.setTimeout(() => {\n window.removeEventListener('message', listener);\n reject(new TimeoutError('Request timed out'));\n }, timeout);\n window.opener.postMessage(makeMessage(request, id), '*');\n });\n}\n","import React from 'react';\n\n/**\n * Map from auth config keys to their values\n * E.g. Map { AuthHandlers → \"io.deephaven.auth.AnonymousAuthenticationHandler\" }\n */\nexport type AuthConfigMap = Map<string, string>;\n\n/**\n * Props for the auth plugin component to render\n */\nexport type AuthPluginProps = {\n /** Map from config keys to their values */\n authConfigValues: AuthConfigMap;\n\n /**\n * The children to render after authentication is completed.\n */\n children: React.ReactNode;\n};\n\nexport type AuthPluginComponent = React.FunctionComponent<AuthPluginProps>;\n\n/**\n * Whether the auth plugin is available given the current configuration\n */\nexport type AuthPluginIsAvailableFunction = (\n authHandlers: string[],\n authConfig: AuthConfigMap\n) => boolean;\n\nexport type AuthPlugin = {\n Component: AuthPluginComponent;\n isAvailable: AuthPluginIsAvailableFunction;\n};\n\nexport function isAuthPlugin(plugin?: unknown): plugin is AuthPlugin {\n if (plugin == null) return false;\n const authPlugin = plugin as AuthPlugin;\n return (\n authPlugin.Component !== undefined &&\n typeof authPlugin.isAvailable === 'function'\n );\n}\n","import { createContext } from 'react';\nimport { User, UserPermissions } from '@deephaven/redux';\n\nexport type UserOverride = Partial<Omit<User, 'permissions'>>;\n\nexport type UserPermissionsOverride = Partial<UserPermissions>;\n\nexport const UserOverrideContext = createContext<UserOverride>({});\n\nexport const UserPermissionsOverrideContext = createContext<UserPermissionsOverride>(\n {}\n);\n","/* eslint-disable global-require */\n/**\n * remote-component.config.js\n *\n * Dependencies for Remote Components\n */\nimport react from 'react';\nimport * as redux from 'redux';\nimport * as reactRedux from 'react-redux';\nimport ReactDOM from 'react-dom';\n\n// eslint-disable-next-line import/prefer-default-export\nexport const resolve = {\n react,\n 'react-dom': ReactDOM,\n redux,\n 'react-redux': reactRedux,\n};\n","import {\n createRemoteComponent,\n createRequires,\n} from '@paciolan/remote-component';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(() => resolve);\n\nexport const RemoteComponent = createRemoteComponent({ requires });\nexport default RemoteComponent;\n","import createLoadRemoteModule, {\n createRequires,\n} from '@paciolan/remote-module-loader';\nimport { resolve } from './remote-component.config';\n\nconst requires = createRequires(resolve);\n\nexport const loadRemoteModule: {\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (url: string): Promise<any>;\n} = createLoadRemoteModule({\n requires,\n});\n\nexport default loadRemoteModule;\n","import React, { ForwardRefExoticComponent } from 'react';\nimport {\n AuthPlugin,\n AuthPluginComponent,\n isAuthPlugin,\n} from '@deephaven/auth-plugins';\nimport Log from '@deephaven/log';\nimport RemoteComponent from './RemoteComponent';\nimport loadRemoteModule from './loadRemoteModule';\n\nconst log = Log.module('@deephaven/app-utils.PluginUtils');\n\n// A PluginModule. This interface should have new fields added to it from different levels of plugins.\n// eslint-disable-next-line @typescript-eslint/no-empty-interface\nexport interface PluginModule {}\n\nexport type PluginModuleMap = Map<string, PluginModule>;\n\n/**\n * Load a component plugin from the server.\n * @param baseURL Base URL of the plugin server\n * @param pluginName Name of the component plugin to load\n * @returns A lazily loaded JSX.Element from the plugin\n */\nexport function loadComponentPlugin(\n baseURL: URL,\n pluginName: string\n): ForwardRefExoticComponent<React.RefAttributes<unknown>> {\n const pluginUrl = new URL(`${pluginName}.js`, baseURL);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const Plugin: any = React.forwardRef((props, ref) => (\n <RemoteComponent\n url={pluginUrl.href}\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n render={({ err, Component }: { err: unknown; Component: any }) => {\n if (err != null && err !== '') {\n const errorMessage = `Error loading plugin ${pluginName} from ${pluginUrl} due to ${err}`;\n log.error(errorMessage);\n return <div className=\"error-message\">{`${errorMessage}`}</div>;\n }\n // eslint-disable-next-line react/jsx-props-no-spreading\n return <Component ref={ref} {...props} />;\n }}\n />\n ));\n Plugin.pluginName = pluginName;\n Plugin.displayName = 'Plugin';\n return Plugin;\n}\n\n/**\n * Imports a commonjs plugin module from the provided URL\n * @param pluginUrl The URL of the plugin to load\n * @returns The loaded module\n */\nexport async function loadModulePlugin(pluginUrl: string): Promise<unknown> {\n const myModule = await loadRemoteModule(pluginUrl);\n return myModule;\n}\n\n/**\n * Loads a JSON file and returns the JSON object\n * @param jsonUrl The URL of the JSON file to load\n * @returns The JSON object of the manifest file\n */\nexport async function loadJson(\n jsonUrl: string\n): Promise<{ plugins: { name: string; main: string }[] }> {\n const res = await fetch(jsonUrl);\n if (!res.ok) {\n throw new Error(res.statusText);\n }\n try {\n return await res.json();\n } catch {\n throw new Error('Could not be parsed as JSON');\n }\n}\n\n/**\n * Load all plugin modules available.\n * @param modulePluginsUrl The base URL of the module plugins to load\n * @returns A map from the name of the plugin to the plugin module that was loaded\n */\nexport async function loadModulePlugins(\n modulePluginsUrl: string\n): Promise<PluginModuleMap> {\n log.debug('Loading plugins...');\n try {\n const manifest = await loadJson(`${modulePluginsUrl}/manifest.json`);\n\n if (!Array.isArray(manifest.plugins)) {\n throw new Error('Plugin manifest JSON does not contain plugins array');\n }\n\n log.debug('Plugin manifest loaded:', manifest);\n const pluginPromises: Promise<unknown>[] = [];\n for (let i = 0; i < manifest.plugins.length; i += 1) {\n const { name, main } = manifest.plugins[i];\n const pluginMainUrl = `${modulePluginsUrl}/${name}/${main}`;\n pluginPromises.push(loadModulePlugin(pluginMainUrl));\n }\n const pluginModules = await Promise.allSettled(pluginPromises);\n\n const pluginMap: PluginModuleMap = new Map();\n for (let i = 0; i < pluginModules.length; i += 1) {\n const module = pluginModules[i];\n const { name } = manifest.plugins[i];\n if (module.status === 'fulfilled') {\n pluginMap.set(name, module.value as PluginModule);\n } else {\n log.error(`Unable to load plugin ${name}`, module.reason);\n }\n }\n log.info('Plugins loaded:', pluginMap);\n\n return pluginMap;\n } catch (e) {\n log.error('Unable to load plugins:', e);\n return new Map();\n }\n}\n\nexport function getAuthHandlers(\n authConfigValues: Map<string, string>\n): string[] {\n return authConfigValues.get('AuthHandlers')?.split(',') ?? [];\n}\n\n/**\n * Get the auth plugin component from the plugin map and current configuration\n * Throws if no auth plugin is available\n *\n * @param pluginMap Map of plugins loaded from the server\n * @param authConfigValues Auth config values from the server\n * @param corePlugins Map of core auth plugins to include in the list. They are added after the loaded plugins\n * @returns The auth plugin component to render\n */\nexport function getAuthPluginComponent(\n pluginMap: PluginModuleMap,\n authConfigValues: Map<string, string>,\n corePlugins?: Map<string, AuthPlugin>\n): AuthPluginComponent {\n const authHandlers = getAuthHandlers(authConfigValues);\n // Filter out all the plugins that are auth plugins, and then map them to [pluginName, AuthPlugin] pairs\n // Uses some pretty disgusting casting, because TypeScript wants to treat it as an (string | AuthPlugin)[] array instead\n const authPlugins = ([\n ...pluginMap.entries(),\n ].filter(([, plugin]: [string, { AuthPlugin?: AuthPlugin }]) =>\n isAuthPlugin(plugin.AuthPlugin)\n ) as [string, { AuthPlugin: AuthPlugin }][]).map(([name, plugin]) => [\n name,\n plugin.AuthPlugin,\n ]) as [string, AuthPlugin][];\n\n // Add all the core plugins in priority\n authPlugins.push(...(corePlugins ?? []));\n\n // Filter the available auth plugins\n\n const availableAuthPlugins = authPlugins.filter(([name, authPlugin]) =>\n authPlugin.isAvailable(authHandlers, authConfigValues)\n );\n\n if (availableAuthPlugins.length === 0) {\n throw new Error(\n `No login plugins found, please register a login plugin for auth handlers: ${authHandlers}`\n );\n } else if (availableAuthPlugins.length > 1) {\n log.warn(\n 'More than one login plugin available, will use the first one: ',\n availableAuthPlugins.map(([name]) => name).join(', ')\n );\n }\n\n const [loginPluginName, NewLoginPlugin] = availableAuthPlugins[0];\n log.info('Using LoginPlugin', loginPluginName);\n\n return NewLoginPlugin.Component;\n}\n","import React, { createContext, useEffect, useState } from 'react';\nimport { PluginModuleMap, loadModulePlugins } from '../plugins';\n\nexport const PluginsContext = createContext<PluginModuleMap | null>(null);\n\nexport type PluginsBootstrapProps = {\n /**\n * Base URL of the plugins to load.\n */\n pluginsUrl: string;\n\n /**\n * The children to render wrapped with the PluginsContext.\n * Note that it renders the children even if the plugins aren't loaded yet.\n */\n children: React.ReactNode;\n};\n\n/**\n * PluginsBootstrap component. Handles loading the plugins.\n */\nexport function PluginsBootstrap({\n pluginsUrl,\n children,\n}: PluginsBootstrapProps) {\n const [plugins, setPlugins] = useState<PluginModuleMap | null>(null);\n useEffect(\n function initPlugins() {\n let isCanceled = false;\n async function loadPlugins() {\n const pluginModules = await loadModulePlugins(pluginsUrl);\n if (!isCanceled) {\n setPlugins(pluginModules);\n }\n }\n loadPlugins();\n return () => {\n isCanceled = true;\n };\n },\n [pluginsUrl]\n );\n\n return (\n <PluginsContext.Provider value={plugins}>\n {children}\n </PluginsContext.Provider>\n );\n}\n\nexport default PluginsBootstrap;\n","import React, { createContext, useEffect, useState } from 'react';\nimport { LoadingOverlay } from '@deephaven/components';\nimport { useApi, useClient } from '@deephaven/jsapi-bootstrap';\nimport { IdeConnection } from '@deephaven/jsapi-types';\nimport Log from '@deephaven/log';\n\nconst log = Log.module('@deephaven/jsapi-components.ConnectionBootstrap');\n\nexport const ConnectionContext = createContext<IdeConnection | null>(null);\n\nexport type ConnectionBootstrapProps = {\n /**\n * The children to render wrapped with the ConnectionContext.\n * Will not render children until the connection is created.\n */\n children: React.ReactNode;\n};\n\n/**\n * ConnectionBootstrap component. Handles initializing the connection.\n */\nexport function ConnectionBootstrap({ children }: ConnectionBootstrapProps) {\n const api = useApi();\n const client = useClient();\n const [error, setError] = useState<unknown>();\n const [connection, setConnection] = useState<IdeConnection>();\n useEffect(\n function initConnection() {\n let isCanceled = false;\n async function loadConnection() {\n try {\n const newConnection = await client.getAsIdeConnection();\n if (isCanceled) {\n return;\n }\n setConnection(newConnection);\n } catch (e) {\n if (isCanceled) {\n return;\n }\n setError(e);\n }\n }\n loadConnection();\n return () => {\n isCanceled = true;\n };\n },\n [api, client]\n );\n\n useEffect(\n function listenForShutdown() {\n if (connection == null) return;\n\n function handleShutdown(event: CustomEvent) {\n const { detail } = event;\n log.info('Shutdown', `${JSON.stringify(detail)}`);\n setError(`Server shutdown: ${detail ?? 'Unknown reason'}`);\n }\n\n const removerFn = connection.addEventListener(\n api.IdeConnection.EVENT_SHUTDOWN,\n handleShutdown\n );\n return removerFn;\n },\n [api, connection]\n );\n\n if (connection == null || error != null) {\n return (\n <LoadingOverlay\n data-testid=\"connection-bootstrap-loading\"\n isLoading={connection == null}\n errorMessage={error != null ? `${error}` : undefined}\n />\n );\n }\n\n return (\n <ConnectionContext.Provider value={connection}>\n {children}\n </ConnectionContext.Provider>\n );\n}\n\nexport default ConnectionBootstrap;\n","import { ConnectOptions } from '@deephaven/jsapi-types';\n\n/**\n * Get the base URL of the API\n * @param apiUrl API URL\n * @returns URL for the base of the API\n */\nexport function getBaseUrl(apiUrl: string): URL {\n return new URL(apiUrl, `${window.location}`);\n}\n\n/**\n * Get the Envoy prefix header value\n * @returns Envoy prefix header value\n */\nexport function getEnvoyPrefix(): string | null {\n const searchParams = new URLSearchParams(window.location.search);\n return searchParams.get('envoyPrefix');\n}\n\nexport function getConnectOptions(): ConnectOptions {\n const envoyPrefix = getEnvoyPrefix();\n return envoyPrefix != null\n ? { headers: { 'envoy-prefix': envoyPrefix } }\n : { headers: {} };\n}\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { PluginsContext } from './PluginsBootstrap';\n\nexport function usePlugins() {\n return useContextOrThrow(\n PluginsContext,\n 'No Plugins available in usePlugins. Was code wrapped in PluginsBootstrap or PluginsContext.Provider?'\n );\n}\n\nexport default usePlugins;\n","import { useContextOrThrow } from '@deephaven/react-hooks';\nimport { ConnectionContext } from './ConnectionBootstrap';\n\nexport function useConnection() {\n return useContextOrThrow(\n ConnectionContext,\n 'No IdeConnection available in useConnection. Was code wrapped in ConnectionBootstrap or ConnectionContext.Provider?'\n );\n}\n\nexport default useConnection;\n"],"names":["EMPTY_ARRAY","EMPTY_MAP","EMPTY_FUNCTION","CanceledPromiseError","CanceledPromiseError$1","TimeoutError","TimeoutError$1","assertNotNull","value","getOrThrow","map","key","defaultValue","useContextOrThrow","context","message","useContext","useApi","ApiContext","useCreateClient","serverUrl","options","api","client","useMemo","useEffect","ClientContext","createContext","ClientBootstrap","children","useClient","log","Log","LOGIN_OPTIONS_REQUEST","SESSION_DETAILS_REQUEST","BROADCAST_CHANNEL_NAME","BROADCAST_LOGIN_MESSAGE","BROADCAST_LOGOUT_MESSAGE","isMessage","obj","isBroadcastLoginMessage","isBroadcastLogoutMessage","isResponse","response","makeMessage","id","shortid","payload","requestParentResponse","request","timeout","resolve","reject","timeoutId","listener","event","data","isAuthPlugin","plugin","authPlugin","UserOverrideContext","UserPermissionsOverrideContext","react","ReactDOM","redux","reactRedux","requires","createRequires","RemoteComponent","createRemoteComponent","RemoteComponent$1","loadRemoteModule","createLoadRemoteModule","loadRemoteModule$1","loadComponentPlugin","baseURL","pluginName","pluginUrl","Plugin","React","props","ref","jsx","err","Component","errorMessage","loadModulePlugin","loadJson","jsonUrl","res","loadModulePlugins","modulePluginsUrl","manifest","pluginPromises","i","name","main","pluginMainUrl","pluginModules","pluginMap","module","e","getAuthHandlers","authConfigValues","getAuthPluginComponent","corePlugins","authHandlers","authPlugins","availableAuthPlugins","loginPluginName","NewLoginPlugin","PluginsContext","PluginsBootstrap","pluginsUrl","plugins","setPlugins","useState","isCanceled","loadPlugins","ConnectionContext","ConnectionBootstrap","error","setError","connection","setConnection","loadConnection","newConnection","handleShutdown","detail","LoadingOverlay","getBaseUrl","apiUrl","getEnvoyPrefix","getConnectOptions","envoyPrefix","usePlugins","useConnection"],"mappings":"oKAAO,MAAMA,GAAc,OAAO,OAAO,EAAE,EAE9BC,OAA2C,IAE3CC,GAAiB,IAAA,GCJ9B,MAAMC,UAA6B,KAAM,CACvC,WAAa,EACf,CAEA,MAAAC,GAAeD,ECJf,MAAME,UAAqB,KAAM,CAC/B,UAAY,EACd,CAEA,MAAAC,EAAeD,ECHR,SAASE,GACdC,EACoB,CACpB,GAAIA,GAAS,KAAY,MAAA,IAAI,MAAM,4BAA4B,CACjE,CAUO,SAASC,GACdC,EACAC,EACAC,EAA8B,OAC3B,CACH,MAAMJ,EAAQE,EAAI,IAAIC,CAAG,GAAKC,EAC9B,GAAIJ,IAAU,OACL,OAAAA,EAGH,MAAA,IAAI,MAAM,yBAAyBG,GAAK,CAChD,CClBgB,SAAAE,EACdC,EACAC,EAAU,iEACM,CACV,MAAAP,EAAQQ,aAAWF,CAAO,EAChC,GAAIN,GAAS,KACL,MAAA,IAAI,MAAMO,CAAO,EAElB,OAAAP,CACT,CCdO,SAASS,GAAS,CAChB,OAAAJ,EACLK,EACA,sFAAA,CAEJ,CCJgB,SAAAC,EACdC,EACAC,EACY,CACZ,MAAMC,EAAML,IACNM,EAASC,EAAAA,QAAQ,IAAM,IAAIF,EAAI,WAAWF,EAAWC,CAAO,EAAG,CACnEC,EACAF,EACAC,CAAA,CACD,EACDI,OAAAA,EAAA,UACE,IAAM,IAAM,CACVF,EAAO,WAAW,CACpB,EACA,CAACA,CAAM,CAAA,EAEFA,CACT,CCjBa,MAAAG,EAAgBC,EAAAA,cAAiC,IAAI,EAmB3D,SAASC,GAAgB,CAC9B,UAAAR,EACA,QAAAC,EACA,SAAAQ,CACF,EAAyB,CACjB,MAAAN,EAASJ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CAAA,CAEJ,CC9EO,SAASqG,GAAWC,EAAqB,CAC9C,OAAO,IAAI,IAAIA,EAAQ,GAAG,OAAO,UAAU,CAC7C,CAMO,SAASC,IAAgC,CAEvC,OADc,IAAI,gBAAgB,OAAO,SAAS,MAAM,EAC3C,IAAI,aAAa,CACvC,CAEO,SAASC,IAAoC,CAClD,MAAMC,EAAcF,KACpB,OAAOE,GAAe,KAClB,CAAE,QAAS,CAAE,eAAgBA,CAAY,GACzC,CAAE,QAAS,CAAA,EACjB,CCtBO,SAASC,IAAa,CACpB,OAAA1H,EACLkG,EACA,sGAAA,CAEJ,CCLO,SAASyB,IAAgB,CACvB,OAAA3H,EACL0G,EACA,qHAAA,CAEJ"}
|
package/build/index.html
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<!DOCTYPE html>
|
|
2
2
|
<html lang="en">
|
|
3
3
|
<head>
|
|
4
|
-
<meta name="ui-version" content="v0.37.
|
|
4
|
+
<meta name="ui-version" content="v0.37.3" />
|
|
5
5
|
<meta charset="utf-8" />
|
|
6
6
|
<meta
|
|
7
7
|
name="viewport"
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
<link rel="manifest" href="/ide/manifest.json" />
|
|
16
16
|
<link rel="icon" href="/ide/favicon-cc-app.svg" />
|
|
17
17
|
<title>Deephaven</title>
|
|
18
|
-
<script type="module" crossorigin src="/ide/assets/index-
|
|
18
|
+
<script type="module" crossorigin src="/ide/assets/index-35c18da1.js"></script>
|
|
19
19
|
<link rel="modulepreload" crossorigin href="/ide/assets/monaco-a26f85af.js">
|
|
20
20
|
<link rel="modulepreload" crossorigin href="/ide/assets/helpers-042e6b4d.js">
|
|
21
21
|
<link rel="modulepreload" crossorigin href="/ide/assets/vendor-6baa757f.js">
|