1import{s as N,n as P,d as f,a as U,i as p,b as h,q as k,c as y,e as w,f as S,g as v,h as L,t as A,j as E,r as J,T as B,l as g,I as D,J as H}from"../chunks/lJGyfUpT.js";import{S as V,i as j,t as I,a as _,g as M,c as R,f as z,d as F,m as G,b as K,e as O}from"../chunks/DtEKhg4c.js";import{s as Q}from"../chunks/C7HFuLPy.js";import{f as W}from"../chunks/BZ6bC0yE.js";import{u as X}from"../chunks/Blt4otpC.js";import{g as Y}from"../chunks/DHzvdz9D.js";import{l as Z}from"../chunks/BzP-x6t8.js";import{m as $}from"../chunks/B3w1mFLc.js";const C=["localhost:5500","localhost:5501","localhost:3000","tgds-schoolyard.lan","jmbox.local"];function T(i){let a,t;return{c(){a=L("span"),t=A(i[0]),this.h()},l(e){a=y(e,"SPAN",{class:!0});var s=w(a);t=S(s,i[0]),s.forEach(f),this.h()},h(){k(a,"class","text-white ml-2 font-normal")},m(e,s){p(e,a,s),h(a,t)},p(e,s){s&1&&U(t,e[0])},d(e){e&&f(a)}}}function x(i){var b;let a,t,e,s=((b=i[1])==null?void 0:b.userId)+"",n,o,r,l,c=i[0]&&T(i);return{c(){a=L("div"),t=L("span"),e=A("Logging In As "),n=A(s),o=E(),r=L("i"),l=E(),c&&c.c(),this.h()},l(u){a=y(u,"DIV",{class:!0});var d=w(a);t=y(d,"SPAN",{class:!0});var m=w(t);e=S(m,"Logging In As "),n=S(m,s),o=v(m),r=y(m,"I",{class:!0}),w(r).forEach(f),m.forEach(f),l=v(d),c&&c.l(d),d.forEach(f),this.h()},h(){k(r,"class","fa fa-spinner animate fa-spin ml-2"),k(t,"class","italic bg-gray-300 font-normal text-gray-700 px-4 py-2 rounded"),k(a,"class","p-8")},m(u,d){p(u,a,d),h(a,t),h(t,e),h(t,n),h(t,o),h(t,r),h(a,l),c&&c.m(a,null)},p(u,[d]){var m;d&2&&s!==(s=((m=u[1])==null?void 0:m.userId)+"")&&U(n,s),u[0]?c?c.p(u,d):(c=T(u),c.c(),c.m(a,null)):c&&(c.d(1),c=null)},i:P,o:P,d(u){u&&f(a),c&&c.d()}}}function ee(i,a,t){let{search:e,message:s}=a;const n=()=>{e!=null&&e.userId&&C.includes(window.location.host)&&W({},{action:"login_as",userId:e.userId}).then(async o=>{const r=o.response,l=(r==null?void 0:r.userId)||(r==null?void 0:r.id);l&&await $(l).catch(()=>{}),X.update(()=>r),Z.setItem("tgds-user",r).then(()=>{r!=null&&r.isVerified||t(0,s="This student has no active course."),r!=null&&r.isVerified&&Y()})})};return J(()=>{n()}),i.$$set=o=>{"search"in o&&t(1,e=o.search),"message"in o&&t(0,s=o.message)},[s,e]}class se extends V{constructor(a){super(),j(this,a,ee,x,N,{search:1,message:0})}}function ae(i){let a,t,e=te(i);return{c(){e&&e.c(),a=g()},l(s){e&&e.l(s),a=g()},m(s,n){e&&e.m(s,n),p(s,a,n),t=!0},p(s,n){e.p(s,n)},i(s){t||(_(e),t=!0)},o(s){I(e),t=!1},d(s){s&&f(a),e&&e.d(s)}}}function te(i){let a,t,e=i[0]&&q(i);return{c(){e&&e.c(),a=g()},l(s){e&&e.l(s),a=g()},m(s,n){e&&e.m(s,n),p(s,a,n),t=!0},p(s,n){s[0]?e?(e.p(s,n),n&1&&_(e,1)):(e=q(s),e.c(),_(e,1),e.m(a.parentNode,a)):e&&(M(),I(e,1,1,()=>{e=null}),R())},i(s){t||(_(e),t=!0)},o(s){I(e),t=!1},d(s){s&&f(a),e&&e.d(s)}}}function q(i){let a,t,e;function s(o){i[2](o)}let n={};return i[0]!==void 0&&(n.search=i[0]),a=new se({props:n}),D.push(()=>z(a,"search",s)),{c(){O(a.$$.fragment)},l(o){K(a.$$.fragment,o)},m(o,r){G(a,o,r),e=!0},p(o,r){const l={};!t&&r&1&&(t=!0,l.search=o[0],H(()=>t=!1)),a.$set(l)},i(o){e||(_(a.$$.fragment,o),e=!0)},o(o){I(a.$$.fragment,o),e=!1},d(o){F(a,o)}}}function oe(i){var r;let a,t,e=C.includes(window.location.host),s,n;document.title=a=((r=i[0])!=null&&r.userId?`Login as #${i[0].userId}`:"Login as Schoolyard User")+" | The Schoolyard";let o=e&&ae(i);return{c(){t=E(),o&&o.c(),s=g()},l(l){B("svelte-w2q7yi",document.head).forEach(f),t=v(l),o&&o.l(l),s=g()},m(l,c){p(l,t,c),o&&o.m(l,c),p(l,s,c),n=!0},p(l,[c]){var b;(!n||c&1)&&a!==(a=((b=l[0])!=null&&b.userId?`Login as #${l[0].userId}`:"Login as Schoolyard User")+" | The Schoolyard")&&(document.title=a),e&&o.p(l,c)},i(l){n||(_(o),n=!0)},o(l){I(o),n=!1},d(l){l&&(f(t),f(s)),o&&o.d(l)}}}function ne(i,a,t){let{params:e={}}=a,s;function n(o){s=o,t(0,s)}return i.$$set=o=>{"params"in o&&t(1,e=o.params)},i.$$.update=()=>{i.$$.dirty&1&&(t(0,s=window.location.search.substring(1)),t(0,s=Q('{"'+decodeURI(s).replace(/"/g,'\\"').replace(/&/g,'","').replace(/=/g,'":"')+'"}')))},[s,e,n]}
1class he extends V{constructor(a){super(),j(this,a,ne,oe,N,{params:1})}}export{he as component};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.