diff --git a/_app/immutable/chunks/Footer.9e69ab6e.js b/_app/immutable/chunks/Footer.093d42c6.js similarity index 98% rename from _app/immutable/chunks/Footer.9e69ab6e.js rename to _app/immutable/chunks/Footer.093d42c6.js index 148061f..030b6c0 100644 --- a/_app/immutable/chunks/Footer.9e69ab6e.js +++ b/_app/immutable/chunks/Footer.093d42c6.js @@ -1,2 +1,2 @@ -import{s as A,p as U,n as I,f as M,h as T}from"./scheduler.9d2a5e30.js";import{S as D,i as S,g as u,h as d,k as l,a as V,f as p,r as j,s as w,j as $,u as q,c as C,z as k,x as c,v as F,d as z,t as P,w as O}from"./index.0b718437.js";import{b as v}from"./paths.1ccbe8f3.js";function G(f){let e,r;return{c(){e=u("img"),this.h()},l(t){e=d(t,"IMG",{src:!0,class:!0,alt:!0}),this.h()},h(){U(e.src,r=v+"/favicon.png")||l(e,"src",r),l(e,"class","h-9 rounded-full"),l(e,"alt","Logo")},m(t,n){V(t,e,n)},p:I,i:I,o:I,d(t){t&&p(e)}}}class R extends D{constructor(e){super(),S(this,e,null,G,A,{})}}function N(f){let e,r,t,n,i,y,m,g="Stavanger HEMA - Allheim",_,o,H=``,x,h;return i=new R({}),{c(){e=u("div"),r=u("div"),t=u("div"),n=u("a"),j(i.$$.fragment),y=w(),m=u("p"),m.textContent=g,_=w(),o=u("div"),o.innerHTML=H,this.h()},l(a){e=d(a,"DIV",{class:!0});var s=$(e);r=d(s,"DIV",{class:!0});var b=$(r);t=d(b,"DIV",{class:!0});var L=$(t);n=d(L,"A",{class:!0,href:!0});var E=$(n);q(i.$$.fragment,E),y=C(E),m=d(E,"P",{class:!0,"data-svelte-h":!0}),k(m)!=="svelte-1jfgoo8"&&(m.textContent=g),E.forEach(p),_=C(L),o=d(L,"DIV",{class:!0,"data-svelte-h":!0}),k(o)!=="svelte-h4lqfq"&&(o.innerHTML=H),L.forEach(p),b.forEach(p),s.forEach(p),this.h()},h(){l(m,"class","invisible pt-0.5 text-lg font-bold lg:visible"),l(n,"class","flex overflow-hidden px-3 gap-3 justify-center"),l(n,"href",v+"/"),l(o,"class","flex items-center ml-auto"),l(t,"class","flex relative items-center md:px-10 lg:px-20 xl:px-40 px-auto md:px-auto"),l(r,"class","py-4 mx-5 border-b border-secondary/10"),l(e,"class",x=f[0].class+" fixed top-0 z-40 flex-none w-full transition-colors duration-500 backdrop-blur bg-primary-container/5 text-primary-container-on")},m(a,s){V(a,e,s),c(e,r),c(r,t),c(t,n),F(i,n,null),c(n,y),c(n,m),c(t,_),c(t,o),h=!0},p(a,[s]){(!h||s&1&&x!==(x=a[0].class+" fixed top-0 z-40 flex-none w-full transition-colors duration-500 backdrop-blur bg-primary-container/5 text-primary-container-on"))&&l(e,"class",x)},i(a){h||(z(i.$$.fragment,a),h=!0)},o(a){P(i.$$.fragment,a),h=!1},d(a){a&&p(e),O(i)}}}function B(f,e,r){return f.$$set=t=>{r(0,e=M(M({},e),T(t)))},e=T(e),[e]}class Y extends D{constructor(e){super(),S(this,e,B,N,A,{})}}function J(f){let e,r,t,n,i,y=`
  • Calendar
  • `,m,g,_,o,H=`Unpublished © 2023 +import{s as A,p as U,n as I,f as M,h as T}from"./scheduler.9d2a5e30.js";import{S as D,i as S,g as u,h as d,k as l,a as V,f as p,r as j,s as w,j as $,u as q,c as C,z as k,x as c,v as F,d as z,t as P,w as O}from"./index.0b718437.js";import{b as v}from"./paths.81e709fc.js";function G(f){let e,r;return{c(){e=u("img"),this.h()},l(t){e=d(t,"IMG",{src:!0,class:!0,alt:!0}),this.h()},h(){U(e.src,r=v+"/favicon.png")||l(e,"src",r),l(e,"class","h-9 rounded-full"),l(e,"alt","Logo")},m(t,n){V(t,e,n)},p:I,i:I,o:I,d(t){t&&p(e)}}}class R extends D{constructor(e){super(),S(this,e,null,G,A,{})}}function N(f){let e,r,t,n,i,y,m,g="Stavanger HEMA - Allheim",_,o,H=``,x,h;return i=new R({}),{c(){e=u("div"),r=u("div"),t=u("div"),n=u("a"),j(i.$$.fragment),y=w(),m=u("p"),m.textContent=g,_=w(),o=u("div"),o.innerHTML=H,this.h()},l(a){e=d(a,"DIV",{class:!0});var s=$(e);r=d(s,"DIV",{class:!0});var b=$(r);t=d(b,"DIV",{class:!0});var L=$(t);n=d(L,"A",{class:!0,href:!0});var E=$(n);q(i.$$.fragment,E),y=C(E),m=d(E,"P",{class:!0,"data-svelte-h":!0}),k(m)!=="svelte-1jfgoo8"&&(m.textContent=g),E.forEach(p),_=C(L),o=d(L,"DIV",{class:!0,"data-svelte-h":!0}),k(o)!=="svelte-h4lqfq"&&(o.innerHTML=H),L.forEach(p),b.forEach(p),s.forEach(p),this.h()},h(){l(m,"class","invisible pt-0.5 text-lg font-bold lg:visible"),l(n,"class","flex overflow-hidden px-3 gap-3 justify-center"),l(n,"href",v+"/"),l(o,"class","flex items-center ml-auto"),l(t,"class","flex relative items-center md:px-10 lg:px-20 xl:px-40 px-auto md:px-auto"),l(r,"class","py-4 mx-5 border-b border-secondary/10"),l(e,"class",x=f[0].class+" fixed top-0 z-40 flex-none w-full transition-colors duration-500 backdrop-blur bg-primary-container/5 text-primary-container-on")},m(a,s){V(a,e,s),c(e,r),c(r,t),c(t,n),F(i,n,null),c(n,y),c(n,m),c(t,_),c(t,o),h=!0},p(a,[s]){(!h||s&1&&x!==(x=a[0].class+" fixed top-0 z-40 flex-none w-full transition-colors duration-500 backdrop-blur bg-primary-container/5 text-primary-container-on"))&&l(e,"class",x)},i(a){h||(z(i.$$.fragment,a),h=!0)},o(a){P(i.$$.fragment,a),h=!1},d(a){a&&p(e),O(i)}}}function B(f,e,r){return f.$$set=t=>{r(0,e=M(M({},e),T(t)))},e=T(e),[e]}class Y extends D{constructor(e){super(),S(this,e,B,N,A,{})}}function J(f){let e,r,t,n,i,y=`
  • Calendar
  • `,m,g,_,o,H=`Unpublished © 2023 Futino™`,x,h;return t=new R({}),{c(){e=u("footer"),r=u("div"),j(t.$$.fragment),n=w(),i=u("ul"),i.innerHTML=y,m=w(),g=u("hr"),_=w(),o=u("span"),o.innerHTML=H,this.h()},l(a){e=d(a,"FOOTER",{class:!0});var s=$(e);r=d(s,"DIV",{class:!0});var b=$(r);q(t.$$.fragment,b),n=C(b),i=d(b,"UL",{class:!0,"data-svelte-h":!0}),k(i)!=="svelte-1weuhu2"&&(i.innerHTML=y),b.forEach(p),m=C(s),g=d(s,"HR",{class:!0}),_=C(s),o=d(s,"SPAN",{class:!0,"data-svelte-h":!0}),k(o)!=="svelte-1smm1ir"&&(o.innerHTML=H),s.forEach(p),this.h()},h(){l(i,"class","flex flex-wrap items-center mb-6 space-x-6 text-sm sm:mb-0 text-background-on"),l(r,"class","sm:flex sm:justify-between sm:items-center md:px-10 lg:px-20 xl:px-40 px-auto md:px-auto"),l(g,"class","my-6 sm:mx-auto lg:my-8 border-secondary/10"),l(o,"class","block text-sm sm:text-center text-background-on"),l(e,"class",x=f[0].class+" pt-20 p-6 border-t border-secondary/10")},m(a,s){V(a,e,s),c(e,r),F(t,r,null),c(r,n),c(r,i),c(e,m),c(e,g),c(e,_),c(e,o),h=!0},p(a,[s]){(!h||s&1&&x!==(x=a[0].class+" pt-20 p-6 border-t border-secondary/10"))&&l(e,"class",x)},i(a){h||(z(t.$$.fragment,a),h=!0)},o(a){P(t.$$.fragment,a),h=!1},d(a){a&&p(e),O(t)}}}function K(f,e,r){return f.$$set=t=>{r(0,e=M(M({},e),T(t)))},e=T(e),[e]}class Z extends D{constructor(e){super(),S(this,e,K,J,A,{})}}export{Z as F,Y as H}; diff --git a/_app/immutable/chunks/paths.1ccbe8f3.js b/_app/immutable/chunks/paths.1ccbe8f3.js deleted file mode 100644 index b9bcb10..0000000 --- a/_app/immutable/chunks/paths.1ccbe8f3.js +++ /dev/null @@ -1 +0,0 @@ -var s;const e=((s=globalThis.__sveltekit_skaipm)==null?void 0:s.base)??"";var a;const t=((a=globalThis.__sveltekit_skaipm)==null?void 0:a.assets)??e;export{t as a,e as b}; diff --git a/_app/immutable/chunks/paths.81e709fc.js b/_app/immutable/chunks/paths.81e709fc.js new file mode 100644 index 0000000..db6c259 --- /dev/null +++ b/_app/immutable/chunks/paths.81e709fc.js @@ -0,0 +1 @@ +var s;const e=((s=globalThis.__sveltekit_1jxoyla)==null?void 0:s.base)??"";var a;const t=((a=globalThis.__sveltekit_1jxoyla)==null?void 0:a.assets)??e;export{t as a,e as b}; diff --git a/_app/immutable/chunks/singletons.10a67dd9.js b/_app/immutable/chunks/singletons.bc47e716.js similarity index 95% rename from _app/immutable/chunks/singletons.10a67dd9.js rename to _app/immutable/chunks/singletons.bc47e716.js index 211d47a..bddfcea 100644 --- a/_app/immutable/chunks/singletons.10a67dd9.js +++ b/_app/immutable/chunks/singletons.bc47e716.js @@ -1 +1 @@ -import{n as d,s as m}from"./scheduler.9d2a5e30.js";import{a as k}from"./paths.1ccbe8f3.js";const u=[];function p(e,t=d){let n;const o=new Set;function r(s){if(m(e,s)&&(e=s,n)){const c=!u.length;for(const i of o)i[1](),u.push(i,e);if(c){for(let i=0;i{o.delete(i),o.size===0&&n&&(n(),n=null)}}return{set:r,update:l,subscribe:a}}const E="1702883705684",S="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",_={tap:1,hover:2,viewport:3,eager:4,off:-1};function T(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function f(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const b={..._,"":_.hover};function h(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=h(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||w(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===location.origin&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=f(s,"preload-code")),r===null&&(r=f(s,"preload-data")),t===null&&(t=f(s,"keepfocus")),n===null&&(n=f(s,"noscroll")),l===null&&(l=f(s,"reload")),a===null&&(a=f(s,"replacestate")),s=h(s);function c(i){switch(i){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:b[o??"off"],preload_data:b[r??"off"],keep_focus:c(t),noscroll:c(n),reload:c(l),replace_state:c(a)}}function g(e){const t=p(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:l}}function v(){const{set:e,subscribe:t}=p(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${k}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==E;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function w(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:g({}),page:g({}),navigating:p(null),updated:v()};export{I,_ as P,y as S,S as a,U as b,L as c,P as d,N as e,O as f,T as g,w as i,x as s}; +import{n as d,s as m}from"./scheduler.9d2a5e30.js";import{a as k}from"./paths.81e709fc.js";const u=[];function p(e,t=d){let n;const o=new Set;function r(s){if(m(e,s)&&(e=s,n)){const c=!u.length;for(const i of o)i[1](),u.push(i,e);if(c){for(let i=0;i{o.delete(i),o.size===0&&n&&(n(),n=null)}}return{set:r,update:l,subscribe:a}}const E="1702928004495",S="sveltekit:snapshot",y="sveltekit:scroll",I="sveltekit:index",_={tap:1,hover:2,viewport:3,eager:4,off:-1};function T(e){let t=e.baseURI;if(!t){const n=e.getElementsByTagName("base");t=n.length?n[0].href:e.URL}return t}function x(){return{x:pageXOffset,y:pageYOffset}}function f(e,t){return e.getAttribute(`data-sveltekit-${t}`)}const b={..._,"":_.hover};function h(e){let t=e.assignedSlot??e.parentNode;return(t==null?void 0:t.nodeType)===11&&(t=t.host),t}function O(e,t){for(;e&&e!==t;){if(e.nodeName.toUpperCase()==="A"&&e.hasAttribute("href"))return e;e=h(e)}}function U(e,t){let n;try{n=new URL(e instanceof SVGAElement?e.href.baseVal:e.href,document.baseURI)}catch{}const o=e instanceof SVGAElement?e.target.baseVal:e.target,r=!n||!!o||w(n,t)||(e.getAttribute("rel")||"").split(/\s+/).includes("external"),l=(n==null?void 0:n.origin)===location.origin&&e.hasAttribute("download");return{url:n,external:r,target:o,download:l}}function L(e){let t=null,n=null,o=null,r=null,l=null,a=null,s=e;for(;s&&s!==document.documentElement;)o===null&&(o=f(s,"preload-code")),r===null&&(r=f(s,"preload-data")),t===null&&(t=f(s,"keepfocus")),n===null&&(n=f(s,"noscroll")),l===null&&(l=f(s,"reload")),a===null&&(a=f(s,"replacestate")),s=h(s);function c(i){switch(i){case"":case"true":return!0;case"off":case"false":return!1;default:return null}}return{preload_code:b[o??"off"],preload_data:b[r??"off"],keep_focus:c(t),noscroll:c(n),reload:c(l),replace_state:c(a)}}function g(e){const t=p(e);let n=!0;function o(){n=!0,t.update(a=>a)}function r(a){n=!1,t.set(a)}function l(a){let s;return t.subscribe(c=>{(s===void 0||n&&c!==s)&&a(s=c)})}return{notify:o,set:r,subscribe:l}}function v(){const{set:e,subscribe:t}=p(!1);let n;async function o(){clearTimeout(n);try{const r=await fetch(`${k}/_app/version.json`,{headers:{pragma:"no-cache","cache-control":"no-cache"}});if(!r.ok)return!1;const a=(await r.json()).version!==E;return a&&(e(!0),clearTimeout(n)),a}catch{return!1}}return{subscribe:t,check:o}}function w(e,t){return e.origin!==location.origin||!e.pathname.startsWith(t)}function N(e){e.client}const P={url:g({}),page:g({}),navigating:p(null),updated:v()};export{I,_ as P,y as S,S as a,U as b,L as c,P as d,N as e,O as f,T as g,w as i,x as s}; diff --git a/_app/immutable/entry/app.4c8380ad.js b/_app/immutable/entry/app.11cb2c94.js similarity index 81% rename from _app/immutable/entry/app.4c8380ad.js rename to _app/immutable/entry/app.11cb2c94.js index 49ae50a..df08196 100644 --- a/_app/immutable/entry/app.4c8380ad.js +++ b/_app/immutable/entry/app.11cb2c94.js @@ -1 +1 @@ -import{_ as w}from"../chunks/preload-helper.a4192956.js";import{s as S,a as j,o as C,t as M,b as V}from"../chunks/scheduler.9d2a5e30.js";import{S as U,i as z,s as B,e as p,c as F,a as b,t as d,b as P,d as h,f as g,g as G,h as H,j as J,k as A,l as m,m as K,n as Q,o as W,p as R,q as E,r as v,u as L,v as D,w as I}from"../chunks/index.0b718437.js";const it={};function X(o){let t,n,i;var s=o[1][0];function c(e,r){return{props:{data:e[3],form:e[2]}}}return s&&(t=E(s,c(o)),o[12](t)),{c(){t&&v(t.$$.fragment),n=p()},l(e){t&&L(t.$$.fragment,e),n=p()},m(e,r){t&&D(t,e,r),b(e,n,r),i=!0},p(e,r){if(r&2&&s!==(s=e[1][0])){if(t){R();const a=t;d(a.$$.fragment,1,0,()=>{I(a,1)}),P()}s?(t=E(s,c(e)),e[12](t),v(t.$$.fragment),h(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}else if(s){const a={};r&8&&(a.data=e[3]),r&4&&(a.form=e[2]),t.$set(a)}},i(e){i||(t&&h(t.$$.fragment,e),i=!0)},o(e){t&&d(t.$$.fragment,e),i=!1},d(e){e&&g(n),o[12](null),t&&I(t,e)}}}function Y(o){let t,n,i;var s=o[1][0];function c(e,r){return{props:{data:e[3],$$slots:{default:[Z]},$$scope:{ctx:e}}}}return s&&(t=E(s,c(o)),o[11](t)),{c(){t&&v(t.$$.fragment),n=p()},l(e){t&&L(t.$$.fragment,e),n=p()},m(e,r){t&&D(t,e,r),b(e,n,r),i=!0},p(e,r){if(r&2&&s!==(s=e[1][0])){if(t){R();const a=t;d(a.$$.fragment,1,0,()=>{I(a,1)}),P()}s?(t=E(s,c(e)),e[11](t),v(t.$$.fragment),h(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}else if(s){const a={};r&8&&(a.data=e[3]),r&8215&&(a.$$scope={dirty:r,ctx:e}),t.$set(a)}},i(e){i||(t&&h(t.$$.fragment,e),i=!0)},o(e){t&&d(t.$$.fragment,e),i=!1},d(e){e&&g(n),o[11](null),t&&I(t,e)}}}function Z(o){let t,n,i;var s=o[1][1];function c(e,r){return{props:{data:e[4],form:e[2]}}}return s&&(t=E(s,c(o)),o[10](t)),{c(){t&&v(t.$$.fragment),n=p()},l(e){t&&L(t.$$.fragment,e),n=p()},m(e,r){t&&D(t,e,r),b(e,n,r),i=!0},p(e,r){if(r&2&&s!==(s=e[1][1])){if(t){R();const a=t;d(a.$$.fragment,1,0,()=>{I(a,1)}),P()}s?(t=E(s,c(e)),e[10](t),v(t.$$.fragment),h(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}else if(s){const a={};r&16&&(a.data=e[4]),r&4&&(a.form=e[2]),t.$set(a)}},i(e){i||(t&&h(t.$$.fragment,e),i=!0)},o(e){t&&d(t.$$.fragment,e),i=!1},d(e){e&&g(n),o[10](null),t&&I(t,e)}}}function O(o){let t,n=o[6]&&T(o);return{c(){t=G("div"),n&&n.c(),this.h()},l(i){t=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(t);n&&n.l(s),s.forEach(g),this.h()},h(){A(t,"id","svelte-announcer"),A(t,"aria-live","assertive"),A(t,"aria-atomic","true"),m(t,"position","absolute"),m(t,"left","0"),m(t,"top","0"),m(t,"clip","rect(0 0 0 0)"),m(t,"clip-path","inset(50%)"),m(t,"overflow","hidden"),m(t,"white-space","nowrap"),m(t,"width","1px"),m(t,"height","1px")},m(i,s){b(i,t,s),n&&n.m(t,null)},p(i,s){i[6]?n?n.p(i,s):(n=T(i),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},d(i){i&&g(t),n&&n.d()}}}function T(o){let t;return{c(){t=K(o[7])},l(n){t=Q(n,o[7])},m(n,i){b(n,t,i)},p(n,i){i&128&&W(t,n[7])},d(n){n&&g(t)}}}function $(o){let t,n,i,s,c;const e=[Y,X],r=[];function a(f,u){return f[1][1]?0:1}t=a(o),n=r[t]=e[t](o);let l=o[5]&&O(o);return{c(){n.c(),i=B(),l&&l.c(),s=p()},l(f){n.l(f),i=F(f),l&&l.l(f),s=p()},m(f,u){r[t].m(f,u),b(f,i,u),l&&l.m(f,u),b(f,s,u),c=!0},p(f,[u]){let k=t;t=a(f),t===k?r[t].p(f,u):(R(),d(r[k],1,1,()=>{r[k]=null}),P(),n=r[t],n?n.p(f,u):(n=r[t]=e[t](f),n.c()),h(n,1),n.m(i.parentNode,i)),f[5]?l?l.p(f,u):(l=O(f),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},i(f){c||(h(n),c=!0)},o(f){d(n),c=!1},d(f){f&&(g(i),g(s)),r[t].d(f),l&&l.d(f)}}}function x(o,t,n){let{stores:i}=t,{page:s}=t,{constructors:c}=t,{components:e=[]}=t,{form:r}=t,{data_0:a=null}=t,{data_1:l=null}=t;j(i.page.notify);let f=!1,u=!1,k=null;C(()=>{const _=i.page.subscribe(()=>{f&&(n(6,u=!0),M().then(()=>{n(7,k=document.title||"untitled page")}))});return n(5,f=!0),_});function y(_){V[_?"unshift":"push"](()=>{e[1]=_,n(0,e)})}function N(_){V[_?"unshift":"push"](()=>{e[0]=_,n(0,e)})}function q(_){V[_?"unshift":"push"](()=>{e[0]=_,n(0,e)})}return o.$$set=_=>{"stores"in _&&n(8,i=_.stores),"page"in _&&n(9,s=_.page),"constructors"in _&&n(1,c=_.constructors),"components"in _&&n(0,e=_.components),"form"in _&&n(2,r=_.form),"data_0"in _&&n(3,a=_.data_0),"data_1"in _&&n(4,l=_.data_1)},o.$$.update=()=>{o.$$.dirty&768&&i.page.set(s)},[e,c,r,a,l,f,u,k,i,s,y,N,q]}class st extends U{constructor(t){super(),z(this,t,x,$,S,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const rt=[()=>w(()=>import("../nodes/0.f552dc22.js"),["../nodes/0.f552dc22.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../assets/0.deaca8bb.css"],import.meta.url),()=>w(()=>import("../nodes/1.acf89147.js"),["../nodes/1.acf89147.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/singletons.10a67dd9.js","../chunks/paths.1ccbe8f3.js"],import.meta.url),()=>w(()=>import("../nodes/2.1323a0f2.js"),["../nodes/2.1323a0f2.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.1ccbe8f3.js","../chunks/Footer.9e69ab6e.js"],import.meta.url),()=>w(()=>import("../nodes/3.15d4e47e.js"),["../nodes/3.15d4e47e.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.1ccbe8f3.js","../chunks/Footer.9e69ab6e.js"],import.meta.url),()=>w(()=>import("../nodes/4.15d4e47e.js"),["../nodes/4.15d4e47e.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.1ccbe8f3.js","../chunks/Footer.9e69ab6e.js"],import.meta.url),()=>w(()=>import("../nodes/5.469ce401.js"),["../nodes/5.469ce401.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.1ccbe8f3.js","../chunks/Footer.9e69ab6e.js"],import.meta.url),()=>w(()=>import("../nodes/6.677dde31.js"),["../nodes/6.677dde31.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/Footer.9e69ab6e.js","../chunks/paths.1ccbe8f3.js","../chunks/preload-helper.a4192956.js"],import.meta.url)],ot=[],at={"/":[2],"/about":[3],"/contact":[4],"/pricing":[5],"/schedule":[6]},ft={handleError:({error:o})=>{console.error(o)}};export{at as dictionary,ft as hooks,it as matchers,rt as nodes,st as root,ot as server_loads}; +import{_ as w}from"../chunks/preload-helper.a4192956.js";import{s as S,a as j,o as C,t as M,b as V}from"../chunks/scheduler.9d2a5e30.js";import{S as U,i as z,s as B,e as p,c as F,a as b,t as d,b as P,d as h,f as g,g as G,h as H,j as J,k as A,l as m,m as K,n as Q,o as W,p as R,q as E,r as v,u as L,v as D,w as I}from"../chunks/index.0b718437.js";const it={};function X(o){let t,n,i;var s=o[1][0];function c(e,r){return{props:{data:e[3],form:e[2]}}}return s&&(t=E(s,c(o)),o[12](t)),{c(){t&&v(t.$$.fragment),n=p()},l(e){t&&L(t.$$.fragment,e),n=p()},m(e,r){t&&D(t,e,r),b(e,n,r),i=!0},p(e,r){if(r&2&&s!==(s=e[1][0])){if(t){R();const a=t;d(a.$$.fragment,1,0,()=>{I(a,1)}),P()}s?(t=E(s,c(e)),e[12](t),v(t.$$.fragment),h(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}else if(s){const a={};r&8&&(a.data=e[3]),r&4&&(a.form=e[2]),t.$set(a)}},i(e){i||(t&&h(t.$$.fragment,e),i=!0)},o(e){t&&d(t.$$.fragment,e),i=!1},d(e){e&&g(n),o[12](null),t&&I(t,e)}}}function Y(o){let t,n,i;var s=o[1][0];function c(e,r){return{props:{data:e[3],$$slots:{default:[Z]},$$scope:{ctx:e}}}}return s&&(t=E(s,c(o)),o[11](t)),{c(){t&&v(t.$$.fragment),n=p()},l(e){t&&L(t.$$.fragment,e),n=p()},m(e,r){t&&D(t,e,r),b(e,n,r),i=!0},p(e,r){if(r&2&&s!==(s=e[1][0])){if(t){R();const a=t;d(a.$$.fragment,1,0,()=>{I(a,1)}),P()}s?(t=E(s,c(e)),e[11](t),v(t.$$.fragment),h(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}else if(s){const a={};r&8&&(a.data=e[3]),r&8215&&(a.$$scope={dirty:r,ctx:e}),t.$set(a)}},i(e){i||(t&&h(t.$$.fragment,e),i=!0)},o(e){t&&d(t.$$.fragment,e),i=!1},d(e){e&&g(n),o[11](null),t&&I(t,e)}}}function Z(o){let t,n,i;var s=o[1][1];function c(e,r){return{props:{data:e[4],form:e[2]}}}return s&&(t=E(s,c(o)),o[10](t)),{c(){t&&v(t.$$.fragment),n=p()},l(e){t&&L(t.$$.fragment,e),n=p()},m(e,r){t&&D(t,e,r),b(e,n,r),i=!0},p(e,r){if(r&2&&s!==(s=e[1][1])){if(t){R();const a=t;d(a.$$.fragment,1,0,()=>{I(a,1)}),P()}s?(t=E(s,c(e)),e[10](t),v(t.$$.fragment),h(t.$$.fragment,1),D(t,n.parentNode,n)):t=null}else if(s){const a={};r&16&&(a.data=e[4]),r&4&&(a.form=e[2]),t.$set(a)}},i(e){i||(t&&h(t.$$.fragment,e),i=!0)},o(e){t&&d(t.$$.fragment,e),i=!1},d(e){e&&g(n),o[10](null),t&&I(t,e)}}}function O(o){let t,n=o[6]&&T(o);return{c(){t=G("div"),n&&n.c(),this.h()},l(i){t=H(i,"DIV",{id:!0,"aria-live":!0,"aria-atomic":!0,style:!0});var s=J(t);n&&n.l(s),s.forEach(g),this.h()},h(){A(t,"id","svelte-announcer"),A(t,"aria-live","assertive"),A(t,"aria-atomic","true"),m(t,"position","absolute"),m(t,"left","0"),m(t,"top","0"),m(t,"clip","rect(0 0 0 0)"),m(t,"clip-path","inset(50%)"),m(t,"overflow","hidden"),m(t,"white-space","nowrap"),m(t,"width","1px"),m(t,"height","1px")},m(i,s){b(i,t,s),n&&n.m(t,null)},p(i,s){i[6]?n?n.p(i,s):(n=T(i),n.c(),n.m(t,null)):n&&(n.d(1),n=null)},d(i){i&&g(t),n&&n.d()}}}function T(o){let t;return{c(){t=K(o[7])},l(n){t=Q(n,o[7])},m(n,i){b(n,t,i)},p(n,i){i&128&&W(t,n[7])},d(n){n&&g(t)}}}function $(o){let t,n,i,s,c;const e=[Y,X],r=[];function a(f,u){return f[1][1]?0:1}t=a(o),n=r[t]=e[t](o);let l=o[5]&&O(o);return{c(){n.c(),i=B(),l&&l.c(),s=p()},l(f){n.l(f),i=F(f),l&&l.l(f),s=p()},m(f,u){r[t].m(f,u),b(f,i,u),l&&l.m(f,u),b(f,s,u),c=!0},p(f,[u]){let k=t;t=a(f),t===k?r[t].p(f,u):(R(),d(r[k],1,1,()=>{r[k]=null}),P(),n=r[t],n?n.p(f,u):(n=r[t]=e[t](f),n.c()),h(n,1),n.m(i.parentNode,i)),f[5]?l?l.p(f,u):(l=O(f),l.c(),l.m(s.parentNode,s)):l&&(l.d(1),l=null)},i(f){c||(h(n),c=!0)},o(f){d(n),c=!1},d(f){f&&(g(i),g(s)),r[t].d(f),l&&l.d(f)}}}function x(o,t,n){let{stores:i}=t,{page:s}=t,{constructors:c}=t,{components:e=[]}=t,{form:r}=t,{data_0:a=null}=t,{data_1:l=null}=t;j(i.page.notify);let f=!1,u=!1,k=null;C(()=>{const _=i.page.subscribe(()=>{f&&(n(6,u=!0),M().then(()=>{n(7,k=document.title||"untitled page")}))});return n(5,f=!0),_});function y(_){V[_?"unshift":"push"](()=>{e[1]=_,n(0,e)})}function N(_){V[_?"unshift":"push"](()=>{e[0]=_,n(0,e)})}function q(_){V[_?"unshift":"push"](()=>{e[0]=_,n(0,e)})}return o.$$set=_=>{"stores"in _&&n(8,i=_.stores),"page"in _&&n(9,s=_.page),"constructors"in _&&n(1,c=_.constructors),"components"in _&&n(0,e=_.components),"form"in _&&n(2,r=_.form),"data_0"in _&&n(3,a=_.data_0),"data_1"in _&&n(4,l=_.data_1)},o.$$.update=()=>{o.$$.dirty&768&&i.page.set(s)},[e,c,r,a,l,f,u,k,i,s,y,N,q]}class st extends U{constructor(t){super(),z(this,t,x,$,S,{stores:8,page:9,constructors:1,components:0,form:2,data_0:3,data_1:4})}}const rt=[()=>w(()=>import("../nodes/0.f552dc22.js"),["../nodes/0.f552dc22.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../assets/0.deaca8bb.css"],import.meta.url),()=>w(()=>import("../nodes/1.7f1ec37a.js"),["../nodes/1.7f1ec37a.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/singletons.bc47e716.js","../chunks/paths.81e709fc.js"],import.meta.url),()=>w(()=>import("../nodes/2.50de5c68.js"),["../nodes/2.50de5c68.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.81e709fc.js","../chunks/Footer.093d42c6.js"],import.meta.url),()=>w(()=>import("../nodes/3.bde1f63d.js"),["../nodes/3.bde1f63d.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.81e709fc.js","../chunks/Footer.093d42c6.js"],import.meta.url),()=>w(()=>import("../nodes/4.bde1f63d.js"),["../nodes/4.bde1f63d.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.81e709fc.js","../chunks/Footer.093d42c6.js"],import.meta.url),()=>w(()=>import("../nodes/5.0fbde3c0.js"),["../nodes/5.0fbde3c0.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/paths.81e709fc.js","../chunks/Footer.093d42c6.js"],import.meta.url),()=>w(()=>import("../nodes/6.6c744caa.js"),["../nodes/6.6c744caa.js","../chunks/scheduler.9d2a5e30.js","../chunks/index.0b718437.js","../chunks/Footer.093d42c6.js","../chunks/paths.81e709fc.js","../chunks/preload-helper.a4192956.js"],import.meta.url)],ot=[],at={"/":[2],"/about":[3],"/contact":[4],"/pricing":[5],"/schedule":[6]},ft={handleError:({error:o})=>{console.error(o)}};export{at as dictionary,ft as hooks,it as matchers,rt as nodes,st as root,ot as server_loads}; diff --git a/_app/immutable/entry/start.05395714.js b/_app/immutable/entry/start.e742dfde.js similarity index 99% rename from _app/immutable/entry/start.05395714.js rename to _app/immutable/entry/start.e742dfde.js index bdb096f..f26bc66 100644 --- a/_app/immutable/entry/start.05395714.js +++ b/_app/immutable/entry/start.e742dfde.js @@ -1,3 +1,3 @@ -import{o as me,t as we}from"../chunks/scheduler.9d2a5e30.js";import{S as Be,a as Ge,I as M,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as F,P as Me,e as Xe}from"../chunks/singletons.10a67dd9.js";import{b as J}from"../chunks/paths.1ccbe8f3.js";function Ze(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function Qe(t){return t.split("%25").map(decodeURI).join("%25")}function et(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const tt=["href","pathname","search","searchParams","toString","toJSON"];function nt(t,r){const f=new URL(t);for(const s of tt)Object.defineProperty(f,s,{get(){return r(),t[s]},enumerable:!0,configurable:!0});return at(f),f}function at(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const rt="/__data.json";function ot(t){return t.replace(/\/$/,"")+rt}function it(...t){let r=5381;for(const f of t)if(typeof f=="string"){let s=f.length;for(;s;)r=r*33^f.charCodeAt(--s)}else if(ArrayBuffer.isView(f)){const s=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let d=s.length;for(;d;)r=r*33^s[--d]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Je=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Je(t,r));const ae=new Map;function st(t,r){const f=Se(t,r),s=document.querySelector(f);if(s!=null&&s.textContent){const{body:d,...u}=JSON.parse(s.textContent),E=s.getAttribute("data-ttl");return E&&ae.set(f,{body:d,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(d,u))}return window.fetch(t,r)}function ct(t,r,f){if(ae.size>0){const s=Se(t,f),d=ae.get(s);if(d){if(performance.now(){const d=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(s);if(d)return r.push({name:d[1],matcher:d[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(s);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!s)return;const E=s.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const h=lt.exec(g);if(!h)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,x,j,k,N]=h;return r.push({name:k,matcher:N,optional:!!x,rest:!!j,chained:j?m===1&&E[0]==="":!1}),j?"(.*?)":x?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function ut(t){return!/^\([^)]+\)$/.test(t)}function dt(t){return t.slice(1).split("/").filter(ut)}function pt(t,r,f){const s={},d=t.slice(1),u=d.filter(l=>l!==void 0);let E=0;for(let l=0;lh).join("/"),E=0),m===void 0){g.rest&&(s[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){s[g.name]=m;const h=r[l+1],x=d[l+1];h&&!h.rest&&h.optional&&x&&g.chained&&(E=0),!h&&!x&&Object.keys(s).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return s}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function ht({nodes:t,server_loads:r,dictionary:f,matchers:s}){const d=new Set(r);return Object.entries(f).map(([l,[g,m,h]])=>{const{pattern:x,params:j}=ft(l),k={id:l,exec:N=>{const U=x.exec(N);if(U)return pt(U,j,s)},errors:[1,...h||[]].map(N=>t[N]),layouts:[0,...m||[]].map(E),leaf:u(g)};return k.errors.length=k.layouts.length=Math.max(k.errors.length,k.layouts.length),k});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[d.has(l),t[l]]}}function Ke(t){try{return JSON.parse(sessionStorage[t])}catch{}}function Ve(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const gt=-1,mt=-2,wt=-3,_t=-4,yt=-5,vt=-6;function bt(t,r){if(typeof t=="number")return d(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,s=Array(f.length);function d(u,E=!1){if(u===gt)return;if(u===wt)return NaN;if(u===_t)return 1/0;if(u===yt)return-1/0;if(u===vt)return-0;if(E)throw new Error("Invalid input");if(u in s)return s[u];const l=f[u];if(!l||typeof l!="object")s[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return s[u]=m(d(l[1]));switch(g){case"Date":s[u]=new Date(l[1]);break;case"Set":const h=new Set;s[u]=h;for(let k=1;kr!=null)}const ze=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ze];const St=new Set([...ze]);[...St];async function kt(t){var r;for(const f in t)if(typeof((r=t[f])==null?void 0:r.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([s,d])=>[s,await d])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class qe{constructor(r,f){this.status=r,this.location=f}}const Rt="x-sveltekit-invalidated",At="x-sveltekit-trailing-slash",K=Ke(Be)??{},ee=Ke(Ge)??{};function be(t){K[t]=te()}function It(t,r){var Ne;const f=ht(t),s=t.nodes[0],d=t.nodes[1];s(),d();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let h={branch:[],error:null,url:null},x=!1,j=!1,k=!0,N=!1,U=!1,H=!1,B=!1,V,D=(Ne=history.state)==null?void 0:Ne[M];D||(D=Date.now(),history.replaceState({...history.state,[M]:D},"",location.href));const fe=K[D];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let q,z,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),i=Z(e,!0);g=null;const n=z={},o=i&&await pe(i);if(n===z&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(q=o.props.page),V.$set(o.props)}}function Re(e){l.some(i=>i==null?void 0:i.snapshot)&&(ee[e]=l.map(i=>{var n;return(n=i==null?void 0:i.snapshot)==null?void 0:n.capture()}))}function Ae(e){var i;(i=ee[e])==null||i.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(D),Ve(Be,K),Re(D),Ve(Ge,ee)}async function re(e,{noScroll:i=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:i?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(B=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(i=>(i.type==="loaded"&&i.state.error&&(g=null),i))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;h=e.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),q=e.props.page,V=new t.root({target:r,props:{...e.props,stores:F,components:l},hydrate:!0}),Ae(D);const n={from:null,to:{params:h.params,route:{id:((o=h.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),j=!0}async function X({url:e,params:i,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Ze(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:i,branch:n,error:a,route:c},props:{constructors:Et(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!q,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:nt(n,()=>{v.url=!0}),async fetch(w,O){let $;w instanceof Request?($=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):$=w;const C=new URL($,n);return P(C.href),C.origin===n.origin&&($=C.href.slice(n.origin.length)),j?ct($,C.href,O):st($,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,i()}};p=await b.universal.load.call(null,_)??null,p=p?await kt(p):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,i,n,o,a){if(B)return!0;if(!o)return!1;if(o.parent&&e||o.route&&i||o.url&&n)return!0;for(const c of o.params)if(a[c]!==h.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,i){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?i??null:null}async function pe({id:e,invalidating:i,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=h.url?e!==h.url.pathname+h.url.search:!1,A=h.route?a.id!==h.route.id:!1;let P=!1;const _=b.map((S,I)=>{var G;const R=h.branch[I],T=!!(S!=null&&S[0])&&((R==null?void 0:R.loader)!==S[1]||Oe(P,A,L,(G=R.server)==null?void 0:G.uses,o));return T&&(P=!0),T});if(_.some(Boolean)){try{y=await Fe(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const $=b.map(async(S,I)=>{var he;if(!S)return;const R=h.branch[I],T=w==null?void 0:w[I];if((!T||T.type==="skip")&&S[1]===(R==null?void 0:R.loader)&&!Oe(O,A,L,(he=R.universal)==null?void 0:he.uses,o))return R;if(O=!0,(T==null?void 0:T.type)==="error")throw T;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const C=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await d(),loader:d,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:i,route:null})}function Z(e,i){if(ye(e,J))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:i,route:o,params:et(a),url:e}}}function se(e){return Qe(e.pathname.slice(J.length)||"/")}function xe({url:e,type:i,intent:n,delta:o}){let a=!1;const c=He(h,n,e,i);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:i,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var $,C,S;const L=Z(e,!1),A=xe({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=D;b(),U=!0,j&&F.navigating.set(A.navigation),z=v;let _=L&&await pe(L);if(!_){if(ye(e,J))return await W(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,z!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else(($=_.props.page)==null?void 0:$.status)>=400&&await F.updated.check()&&await W(e);if(E.length=0,B=!1,N=!0,be(P),Re(P),(C=_.props.page)!=null&&C.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[M]=D+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let R=D+1;for(;ee[R]||K[R];)delete ee[R],delete K[R],R+=1}}if(g=null,j){h=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(R=>R(A.navigation)))).filter(R=>typeof R=="function");if(I.length>0){let R=function(){m.after_navigate=m.after_navigate.filter(T=>!I.includes(T))};I.push(R),m.after_navigate.push(...I)}V.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),k){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));i?scrollTo(i.x,i.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),k=!0,_.props.page&&(q=_.props.page),U=!1,c==="popstate"&&Ae(D),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),F.navigating.set(null),N=!1}async function je(e,i,n,o){return e.origin===location.origin&&e.pathname===location.pathname&&!x?await ie({status:o,error:n,url:e,route:i}):await W(e)}function W(e){return location.href=e.href,new Promise(()=>{})}function Ye(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function i(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",i),u.addEventListener("touchstart",i,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,J);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,J);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Me.viewport&&n.observe(c),y.preload_code===Me.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,i){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:i})??{message:i.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const i=m.after_navigate.indexOf(e);m.after_navigate.splice(i,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const i=m.before_navigate.indexOf(e);m.before_navigate.splice(i,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const i=m.on_navigate.indexOf(e);m.on_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(N||!j)&&(k=!1)},goto:(e,i={})=>re(e,i,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:i}=new URL(e,location.href);E.push(n=>n.href===i)}return ke()},invalidate_all:()=>(B=!0,ke()),preload_data:async e=>{const i=new URL(e,De(document)),n=Z(i,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${i}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const i=new URL(location.href),{branch:n,route:o}=h;if(!o)return;const a=await Ue(h.branch.length,n,o.errors);if(a){const c=await X({url:i,params:h.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});h=c.state,V.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(V.$set({form:null,page:{...q,form:e.data,status:e.status}}),await we(),V.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var i;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=He(h,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(i=navigator.connection)!=null&&i.saveData||Ye(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,J);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){xe({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(h.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(H=!0,be(D),e(a),!b.replace_state)return;H=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,J))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(z={},(o=n.state)!=null&&o[M]){if(n.state[M]===D)return;const a=K[n.state[M]],c=new URL(location.href);if(h.url.href.split("#")[0]===location.href.split("#")[0]){e(c),K[D]=te(),D=n.state[M],scrollTo(a.x,a.y);return}const p=n.state[M]-D;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{D=n.state[M]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:z})}else if(!H){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{H&&(H=!1,history.replaceState({...history.state,[M]:++D},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&F.navigating.set(null)});function e(n){h.url=n,F.page.set({...q,url:n}),F.page.notify()}},_hydrate:async({status:e=200,error:i,node_ids:n,params:o,route:a,data:c,form:p})=>{x=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=We(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let $=0;$<_;$+=1)Object.assign(O,(await y[$]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_d?"1":"0").join(""));const s=await Je(f.href);if(!s.ok)throw new ne(s.status,await s.json());return new Promise(async d=>{var h;const u=new Map,E=s.body.getReader(),l=new TextDecoder;function g(x){return bt(x,{Promise:j=>new Promise((k,N)=>{u.set(j,{fulfil:k,reject:N})})})}let m="";for(;;){const{done:x,value:j}=await E.read();if(x&&!m)break;for(m+=!j&&m?` +import{o as me,t as we}from"../chunks/scheduler.9d2a5e30.js";import{S as Be,a as Ge,I as M,g as De,f as Ce,b as _e,c as le,s as te,i as ye,d as F,P as Me,e as Xe}from"../chunks/singletons.bc47e716.js";import{b as J}from"../chunks/paths.81e709fc.js";function Ze(t,r){return t==="/"||r==="ignore"?t:r==="never"?t.endsWith("/")?t.slice(0,-1):t:r==="always"&&!t.endsWith("/")?t+"/":t}function Qe(t){return t.split("%25").map(decodeURI).join("%25")}function et(t){for(const r in t)t[r]=decodeURIComponent(t[r]);return t}const tt=["href","pathname","search","searchParams","toString","toJSON"];function nt(t,r){const f=new URL(t);for(const s of tt)Object.defineProperty(f,s,{get(){return r(),t[s]},enumerable:!0,configurable:!0});return at(f),f}function at(t){Object.defineProperty(t,"hash",{get(){throw new Error("Cannot access event.url.hash. Consider using `$page.url.hash` inside a component instead")}})}const rt="/__data.json";function ot(t){return t.replace(/\/$/,"")+rt}function it(...t){let r=5381;for(const f of t)if(typeof f=="string"){let s=f.length;for(;s;)r=r*33^f.charCodeAt(--s)}else if(ArrayBuffer.isView(f)){const s=new Uint8Array(f.buffer,f.byteOffset,f.byteLength);let d=s.length;for(;d;)r=r*33^s[--d]}else throw new TypeError("value must be a string or TypedArray");return(r>>>0).toString(36)}const Je=window.fetch;window.fetch=(t,r)=>((t instanceof Request?t.method:(r==null?void 0:r.method)||"GET")!=="GET"&&ae.delete(Se(t)),Je(t,r));const ae=new Map;function st(t,r){const f=Se(t,r),s=document.querySelector(f);if(s!=null&&s.textContent){const{body:d,...u}=JSON.parse(s.textContent),E=s.getAttribute("data-ttl");return E&&ae.set(f,{body:d,init:u,ttl:1e3*Number(E)}),Promise.resolve(new Response(d,u))}return window.fetch(t,r)}function ct(t,r,f){if(ae.size>0){const s=Se(t,f),d=ae.get(s);if(d){if(performance.now(){const d=/^\[\.\.\.(\w+)(?:=(\w+))?\]$/.exec(s);if(d)return r.push({name:d[1],matcher:d[2],optional:!1,rest:!0,chained:!0}),"(?:/(.*))?";const u=/^\[\[(\w+)(?:=(\w+))?\]\]$/.exec(s);if(u)return r.push({name:u[1],matcher:u[2],optional:!0,rest:!1,chained:!0}),"(?:/([^/]+))?";if(!s)return;const E=s.split(/\[(.+?)\](?!\])/);return"/"+E.map((g,m)=>{if(m%2){if(g.startsWith("x+"))return ve(String.fromCharCode(parseInt(g.slice(2),16)));if(g.startsWith("u+"))return ve(String.fromCharCode(...g.slice(2).split("-").map(U=>parseInt(U,16))));const h=lt.exec(g);if(!h)throw new Error(`Invalid param: ${g}. Params and matcher names can only have underscores and alphanumeric characters.`);const[,x,j,k,N]=h;return r.push({name:k,matcher:N,optional:!!x,rest:!!j,chained:j?m===1&&E[0]==="":!1}),j?"(.*?)":x?"([^/]*)?":"([^/]+?)"}return ve(g)}).join("")}).join("")}/?$`),params:r}}function ut(t){return!/^\([^)]+\)$/.test(t)}function dt(t){return t.slice(1).split("/").filter(ut)}function pt(t,r,f){const s={},d=t.slice(1),u=d.filter(l=>l!==void 0);let E=0;for(let l=0;lh).join("/"),E=0),m===void 0){g.rest&&(s[g.name]="");continue}if(!g.matcher||f[g.matcher](m)){s[g.name]=m;const h=r[l+1],x=d[l+1];h&&!h.rest&&h.optional&&x&&g.chained&&(E=0),!h&&!x&&Object.keys(s).length===u.length&&(E=0);continue}if(g.optional&&g.chained){E++;continue}return}if(!E)return s}function ve(t){return t.normalize().replace(/[[\]]/g,"\\$&").replace(/%/g,"%25").replace(/\//g,"%2[Ff]").replace(/\?/g,"%3[Ff]").replace(/#/g,"%23").replace(/[.*+?^${}()|\\]/g,"\\$&")}function ht({nodes:t,server_loads:r,dictionary:f,matchers:s}){const d=new Set(r);return Object.entries(f).map(([l,[g,m,h]])=>{const{pattern:x,params:j}=ft(l),k={id:l,exec:N=>{const U=x.exec(N);if(U)return pt(U,j,s)},errors:[1,...h||[]].map(N=>t[N]),layouts:[0,...m||[]].map(E),leaf:u(g)};return k.errors.length=k.layouts.length=Math.max(k.errors.length,k.layouts.length),k});function u(l){const g=l<0;return g&&(l=~l),[g,t[l]]}function E(l){return l===void 0?l:[d.has(l),t[l]]}}function Ke(t){try{return JSON.parse(sessionStorage[t])}catch{}}function Ve(t,r){const f=JSON.stringify(r);try{sessionStorage[t]=f}catch{}}const gt=-1,mt=-2,wt=-3,_t=-4,yt=-5,vt=-6;function bt(t,r){if(typeof t=="number")return d(t,!0);if(!Array.isArray(t)||t.length===0)throw new Error("Invalid input");const f=t,s=Array(f.length);function d(u,E=!1){if(u===gt)return;if(u===wt)return NaN;if(u===_t)return 1/0;if(u===yt)return-1/0;if(u===vt)return-0;if(E)throw new Error("Invalid input");if(u in s)return s[u];const l=f[u];if(!l||typeof l!="object")s[u]=l;else if(Array.isArray(l))if(typeof l[0]=="string"){const g=l[0],m=r==null?void 0:r[g];if(m)return s[u]=m(d(l[1]));switch(g){case"Date":s[u]=new Date(l[1]);break;case"Set":const h=new Set;s[u]=h;for(let k=1;kr!=null)}const ze=new Set(["load","prerender","csr","ssr","trailingSlash","config"]);[...ze];const St=new Set([...ze]);[...St];async function kt(t){var r;for(const f in t)if(typeof((r=t[f])==null?void 0:r.then)=="function")return Object.fromEntries(await Promise.all(Object.entries(t).map(async([s,d])=>[s,await d])));return t}class ne{constructor(r,f){this.status=r,typeof f=="string"?this.body={message:f}:f?this.body=f:this.body={message:`Error: ${r}`}}toString(){return JSON.stringify(this.body)}}class qe{constructor(r,f){this.status=r,this.location=f}}const Rt="x-sveltekit-invalidated",At="x-sveltekit-trailing-slash",K=Ke(Be)??{},ee=Ke(Ge)??{};function be(t){K[t]=te()}function It(t,r){var Ne;const f=ht(t),s=t.nodes[0],d=t.nodes[1];s(),d();const u=document.documentElement,E=[],l=[];let g=null;const m={before_navigate:[],on_navigate:[],after_navigate:[]};let h={branch:[],error:null,url:null},x=!1,j=!1,k=!0,N=!1,U=!1,H=!1,B=!1,V,D=(Ne=history.state)==null?void 0:Ne[M];D||(D=Date.now(),history.replaceState({...history.state,[M]:D},"",location.href));const fe=K[D];fe&&(history.scrollRestoration="manual",scrollTo(fe.x,fe.y));let q,z,Y;async function ke(){if(Y=Y||Promise.resolve(),await Y,!Y)return;Y=null;const e=new URL(location.href),i=Z(e,!0);g=null;const n=z={},o=i&&await pe(i);if(n===z&&o){if(o.type==="redirect")return re(new URL(o.location,e).href,{},1,n);o.props.page!==void 0&&(q=o.props.page),V.$set(o.props)}}function Re(e){l.some(i=>i==null?void 0:i.snapshot)&&(ee[e]=l.map(i=>{var n;return(n=i==null?void 0:i.snapshot)==null?void 0:n.capture()}))}function Ae(e){var i;(i=ee[e])==null||i.forEach((n,o)=>{var a,c;(c=(a=l[o])==null?void 0:a.snapshot)==null||c.restore(n)})}function Ie(){be(D),Ve(Be,K),Re(D),Ve(Ge,ee)}async function re(e,{noScroll:i=!1,replaceState:n=!1,keepFocus:o=!1,state:a={},invalidateAll:c=!1},p,v){return typeof e=="string"&&(e=new URL(e,De(document))),ce({url:e,scroll:i?te():null,keepfocus:o,redirect_count:p,details:{state:a,replaceState:n},nav_token:v,accepted:()=>{c&&(B=!0)},blocked:()=>{},type:"goto"})}async function Le(e){return g={id:e.id,promise:pe(e).then(i=>(i.type==="loaded"&&i.state.error&&(g=null),i))},g.promise}async function oe(...e){const n=f.filter(o=>e.some(a=>o.exec(a))).map(o=>Promise.all([...o.layouts,o.leaf].map(a=>a==null?void 0:a[1]())));await Promise.all(n)}function Pe(e){var o;h=e.state;const i=document.querySelector("style[data-sveltekit]");i&&i.remove(),q=e.props.page,V=new t.root({target:r,props:{...e.props,stores:F,components:l},hydrate:!0}),Ae(D);const n={from:null,to:{params:h.params,route:{id:((o=h.route)==null?void 0:o.id)??null},url:new URL(location.href)},willUnload:!1,type:"enter",complete:Promise.resolve()};m.after_navigate.forEach(a=>a(n)),j=!0}async function X({url:e,params:i,branch:n,status:o,error:a,route:c,form:p}){let v="never";for(const _ of n)(_==null?void 0:_.slash)!==void 0&&(v=_.slash);e.pathname=Ze(e.pathname,v),e.search=e.search;const b={type:"loaded",state:{url:e,params:i,branch:n,error:a,route:c},props:{constructors:Et(n).map(_=>_.node.component)}};p!==void 0&&(b.props.form=p);let y={},L=!q,A=0;for(let _=0;_(v.route=!0,w[O])}),params:new Proxy(o,{get:(w,O)=>(v.params.add(O),w[O])}),data:(c==null?void 0:c.data)??null,url:nt(n,()=>{v.url=!0}),async fetch(w,O){let $;w instanceof Request?($=w.url,O={body:w.method==="GET"||w.method==="HEAD"?void 0:await w.blob(),cache:w.cache,credentials:w.credentials,headers:w.headers,integrity:w.integrity,keepalive:w.keepalive,method:w.method,mode:w.mode,redirect:w.redirect,referrer:w.referrer,referrerPolicy:w.referrerPolicy,signal:w.signal,...O}):$=w;const C=new URL($,n);return P(C.href),C.origin===n.origin&&($=C.href.slice(n.origin.length)),j?ct($,C.href,O):st($,O)},setHeaders:()=>{},depends:P,parent(){return v.parent=!0,i()}};p=await b.universal.load.call(null,_)??null,p=p?await kt(p):null}return{node:b,loader:e,server:c,universal:(L=b.universal)!=null&&L.load?{type:"data",data:p,uses:v}:null,data:p??(c==null?void 0:c.data)??null,slash:((A=b.universal)==null?void 0:A.trailingSlash)??(c==null?void 0:c.slash)}}function Oe(e,i,n,o,a){if(B)return!0;if(!o)return!1;if(o.parent&&e||o.route&&i||o.url&&n)return!0;for(const c of o.params)if(a[c]!==h.params[c])return!0;for(const c of o.dependencies)if(E.some(p=>p(new URL(c))))return!0;return!1}function de(e,i){return(e==null?void 0:e.type)==="data"?e:(e==null?void 0:e.type)==="skip"?i??null:null}async function pe({id:e,invalidating:i,url:n,params:o,route:a}){if((g==null?void 0:g.id)===e)return g.promise;const{errors:c,layouts:p,leaf:v}=a,b=[...p,v];c.forEach(S=>S==null?void 0:S().catch(()=>{})),b.forEach(S=>S==null?void 0:S[1]().catch(()=>{}));let y=null;const L=h.url?e!==h.url.pathname+h.url.search:!1,A=h.route?a.id!==h.route.id:!1;let P=!1;const _=b.map((S,I)=>{var G;const R=h.branch[I],T=!!(S!=null&&S[0])&&((R==null?void 0:R.loader)!==S[1]||Oe(P,A,L,(G=R.server)==null?void 0:G.uses,o));return T&&(P=!0),T});if(_.some(Boolean)){try{y=await Fe(n,_)}catch(S){return ie({status:S instanceof ne?S.status:500,error:await Q(S,{url:n,params:o,route:{id:a.id}}),url:n,route:a})}if(y.type==="redirect")return y}const w=y==null?void 0:y.nodes;let O=!1;const $=b.map(async(S,I)=>{var he;if(!S)return;const R=h.branch[I],T=w==null?void 0:w[I];if((!T||T.type==="skip")&&S[1]===(R==null?void 0:R.loader)&&!Oe(O,A,L,(he=R.universal)==null?void 0:he.uses,o))return R;if(O=!0,(T==null?void 0:T.type)==="error")throw T;return ue({loader:S[1],url:n,params:o,route:a,parent:async()=>{var Te;const $e={};for(let ge=0;ge{});const C=[];for(let S=0;SPromise.resolve({}),server_data_node:de(c)}),b={node:await d(),loader:d,universal:null,server:null,data:null};return await X({url:n,params:a,branch:[v,b],status:e,error:i,route:null})}function Z(e,i){if(ye(e,J))return;const n=se(e);for(const o of f){const a=o.exec(n);if(a)return{id:e.pathname+e.search,invalidating:i,route:o,params:et(a),url:e}}}function se(e){return Qe(e.pathname.slice(J.length)||"/")}function xe({url:e,type:i,intent:n,delta:o}){let a=!1;const c=He(h,n,e,i);o!==void 0&&(c.navigation.delta=o);const p={...c.navigation,cancel:()=>{a=!0,c.reject(new Error("navigation was cancelled"))}};return U||m.before_navigate.forEach(v=>v(p)),a?null:c}async function ce({url:e,scroll:i,keepfocus:n,redirect_count:o,details:a,type:c,delta:p,nav_token:v={},accepted:b,blocked:y}){var $,C,S;const L=Z(e,!1),A=xe({url:e,type:c,delta:p,intent:L});if(!A){y();return}const P=D;b(),U=!0,j&&F.navigating.set(A.navigation),z=v;let _=L&&await pe(L);if(!_){if(ye(e,J))return await W(e);_=await je(e,{id:null},await Q(new Error(`Not found: ${e.pathname}`),{url:e,params:{},route:{id:null}}),404)}if(e=(L==null?void 0:L.url)||e,z!==v)return A.reject(new Error("navigation was aborted")),!1;if(_.type==="redirect")if(o>=20)_=await ie({status:500,error:await Q(new Error("Redirect loop"),{url:e,params:{},route:{id:null}}),url:e,route:{id:null}});else return re(new URL(_.location,e).href,{},o+1,v),!1;else(($=_.props.page)==null?void 0:$.status)>=400&&await F.updated.check()&&await W(e);if(E.length=0,B=!1,N=!0,be(P),Re(P),(C=_.props.page)!=null&&C.url&&_.props.page.url.pathname!==e.pathname&&(e.pathname=(S=_.props.page)==null?void 0:S.url.pathname),a){const I=a.replaceState?0:1;if(a.state[M]=D+=I,history[a.replaceState?"replaceState":"pushState"](a.state,"",e),!a.replaceState){let R=D+1;for(;ee[R]||K[R];)delete ee[R],delete K[R],R+=1}}if(g=null,j){h=_.state,_.props.page&&(_.props.page.url=e);const I=(await Promise.all(m.on_navigate.map(R=>R(A.navigation)))).filter(R=>typeof R=="function");if(I.length>0){let R=function(){m.after_navigate=m.after_navigate.filter(T=>!I.includes(T))};I.push(R),m.after_navigate.push(...I)}V.$set(_.props)}else Pe(_);const{activeElement:w}=document;if(await we(),k){const I=e.hash&&document.getElementById(decodeURIComponent(e.hash.slice(1)));i?scrollTo(i.x,i.y):I?I.scrollIntoView():scrollTo(0,0)}const O=document.activeElement!==w&&document.activeElement!==document.body;!n&&!O&&Ee(),k=!0,_.props.page&&(q=_.props.page),U=!1,c==="popstate"&&Ae(D),A.fulfil(void 0),m.after_navigate.forEach(I=>I(A.navigation)),F.navigating.set(null),N=!1}async function je(e,i,n,o){return e.origin===location.origin&&e.pathname===location.pathname&&!x?await ie({status:o,error:n,url:e,route:i}):await W(e)}function W(e){return location.href=e.href,new Promise(()=>{})}function Ye(){let e;u.addEventListener("mousemove",c=>{const p=c.target;clearTimeout(e),e=setTimeout(()=>{o(p,2)},20)});function i(c){o(c.composedPath()[0],1)}u.addEventListener("mousedown",i),u.addEventListener("touchstart",i,{passive:!0});const n=new IntersectionObserver(c=>{for(const p of c)p.isIntersecting&&(oe(se(new URL(p.target.href))),n.unobserve(p.target))},{threshold:0});function o(c,p){const v=Ce(c,u);if(!v)return;const{url:b,external:y,download:L}=_e(v,J);if(y||L)return;const A=le(v);if(!A.reload)if(p<=A.preload_data){const P=Z(b,!1);P&&Le(P)}else p<=A.preload_code&&oe(se(b))}function a(){n.disconnect();for(const c of u.querySelectorAll("a")){const{url:p,external:v,download:b}=_e(c,J);if(v||b)continue;const y=le(c);y.reload||(y.preload_code===Me.viewport&&n.observe(c),y.preload_code===Me.eager&&oe(se(p)))}}m.after_navigate.push(a),a()}function Q(e,i){return e instanceof ne?e.body:t.hooks.handleError({error:e,event:i})??{message:i.route.id!=null?"Internal Error":"Not Found"}}return{after_navigate:e=>{me(()=>(m.after_navigate.push(e),()=>{const i=m.after_navigate.indexOf(e);m.after_navigate.splice(i,1)}))},before_navigate:e=>{me(()=>(m.before_navigate.push(e),()=>{const i=m.before_navigate.indexOf(e);m.before_navigate.splice(i,1)}))},on_navigate:e=>{me(()=>(m.on_navigate.push(e),()=>{const i=m.on_navigate.indexOf(e);m.on_navigate.splice(i,1)}))},disable_scroll_handling:()=>{(N||!j)&&(k=!1)},goto:(e,i={})=>re(e,i,0),invalidate:e=>{if(typeof e=="function")E.push(e);else{const{href:i}=new URL(e,location.href);E.push(n=>n.href===i)}return ke()},invalidate_all:()=>(B=!0,ke()),preload_data:async e=>{const i=new URL(e,De(document)),n=Z(i,!1);if(!n)throw new Error(`Attempted to preload a URL that does not belong to this app: ${i}`);await Le(n)},preload_code:oe,apply_action:async e=>{if(e.type==="error"){const i=new URL(location.href),{branch:n,route:o}=h;if(!o)return;const a=await Ue(h.branch.length,n,o.errors);if(a){const c=await X({url:i,params:h.params,branch:n.slice(0,a.idx).concat(a.node),status:e.status??500,error:e.error,route:o});h=c.state,V.$set(c.props),we().then(Ee)}}else e.type==="redirect"?re(e.location,{invalidateAll:!0},0):(V.$set({form:null,page:{...q,form:e.data,status:e.status}}),await we(),V.$set({form:e.data}),e.type==="success"&&Ee())},_start_router:()=>{var i;history.scrollRestoration="manual",addEventListener("beforeunload",n=>{let o=!1;if(Ie(),!U){const a=He(h,void 0,null,"leave"),c={...a.navigation,cancel:()=>{o=!0,a.reject(new Error("navigation was cancelled"))}};m.before_navigate.forEach(p=>p(c))}o?(n.preventDefault(),n.returnValue=""):history.scrollRestoration="auto"}),addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&Ie()}),(i=navigator.connection)!=null&&i.saveData||Ye(),u.addEventListener("click",n=>{var P;if(n.button||n.which!==1||n.metaKey||n.ctrlKey||n.shiftKey||n.altKey||n.defaultPrevented)return;const o=Ce(n.composedPath()[0],u);if(!o)return;const{url:a,external:c,target:p,download:v}=_e(o,J);if(!a)return;if(p==="_parent"||p==="_top"){if(window.parent!==window)return}else if(p&&p!=="_self")return;const b=le(o);if(!(o instanceof SVGAElement)&&a.protocol!==location.protocol&&!(a.protocol==="https:"||a.protocol==="http:")||v)return;if(c||b.reload){xe({url:a,type:"link"})?U=!0:n.preventDefault();return}const[L,A]=a.href.split("#");if(A!==void 0&&L===location.href.split("#")[0]){if(h.url.hash===a.hash){n.preventDefault(),(P=o.ownerDocument.getElementById(A))==null||P.scrollIntoView();return}if(H=!0,be(D),e(a),!b.replace_state)return;H=!1,n.preventDefault()}ce({url:a,scroll:b.noscroll?te():null,keepfocus:b.keep_focus??!1,redirect_count:0,details:{state:{},replaceState:b.replace_state??a.href===location.href},accepted:()=>n.preventDefault(),blocked:()=>n.preventDefault(),type:"link"})}),u.addEventListener("submit",n=>{if(n.defaultPrevented)return;const o=HTMLFormElement.prototype.cloneNode.call(n.target),a=n.submitter;if(((a==null?void 0:a.formMethod)||o.method)!=="get")return;const p=new URL((a==null?void 0:a.hasAttribute("formaction"))&&(a==null?void 0:a.formAction)||o.action);if(ye(p,J))return;const v=n.target,{keep_focus:b,noscroll:y,reload:L,replace_state:A}=le(v);if(L)return;n.preventDefault(),n.stopPropagation();const P=new FormData(v),_=a==null?void 0:a.getAttribute("name");_&&P.append(_,(a==null?void 0:a.getAttribute("value"))??""),p.search=new URLSearchParams(P).toString(),ce({url:p,scroll:y?te():null,keepfocus:b??!1,redirect_count:0,details:{state:{},replaceState:A??p.href===location.href},nav_token:{},accepted:()=>{},blocked:()=>{},type:"form"})}),addEventListener("popstate",async n=>{var o;if(z={},(o=n.state)!=null&&o[M]){if(n.state[M]===D)return;const a=K[n.state[M]],c=new URL(location.href);if(h.url.href.split("#")[0]===location.href.split("#")[0]){e(c),K[D]=te(),D=n.state[M],scrollTo(a.x,a.y);return}const p=n.state[M]-D;await ce({url:c,scroll:a,keepfocus:!1,redirect_count:0,details:null,accepted:()=>{D=n.state[M]},blocked:()=>{history.go(-p)},type:"popstate",delta:p,nav_token:z})}else if(!H){const a=new URL(location.href);e(a)}}),addEventListener("hashchange",()=>{H&&(H=!1,history.replaceState({...history.state,[M]:++D},"",location.href))});for(const n of document.querySelectorAll("link"))n.rel==="icon"&&(n.href=n.href);addEventListener("pageshow",n=>{n.persisted&&F.navigating.set(null)});function e(n){h.url=n,F.page.set({...q,url:n}),F.page.notify()}},_hydrate:async({status:e=200,error:i,node_ids:n,params:o,route:a,data:c,form:p})=>{x=!0;const v=new URL(location.href);({params:o={},route:a={id:null}}=Z(v,!1)||{});let b;try{const y=n.map(async(P,_)=>{const w=c[_];return w!=null&&w.uses&&(w.uses=We(w.uses)),ue({loader:t.nodes[P],url:v,params:o,route:a,parent:async()=>{const O={};for(let $=0;$<_;$+=1)Object.assign(O,(await y[$]).data);return O},server_data_node:de(w)})}),L=await Promise.all(y),A=f.find(({id:P})=>P===a.id);if(A){const P=A.layouts;for(let _=0;_d?"1":"0").join(""));const s=await Je(f.href);if(!s.ok)throw new ne(s.status,await s.json());return new Promise(async d=>{var h;const u=new Map,E=s.body.getReader(),l=new TextDecoder;function g(x){return bt(x,{Promise:j=>new Promise((k,N)=>{u.set(j,{fulfil:k,reject:N})})})}let m="";for(;;){const{done:x,value:j}=await E.read();if(x&&!m)break;for(m+=!j&&m?` `:l.decode(j);;){const k=m.indexOf(` `);if(k===-1)break;const N=JSON.parse(m.slice(0,k));if(m=m.slice(k+1),N.type==="redirect")return d(N);if(N.type==="data")(h=N.nodes)==null||h.forEach(U=>{(U==null?void 0:U.type)==="data"&&(U.uses=We(U.uses),U.data=g(U.data))}),d(N);else if(N.type==="chunk"){const{id:U,data:H,error:B}=N,V=u.get(U);u.delete(U),B?V.reject(g(B)):V.fulfil(g(H))}}}})}function We(t){return{dependencies:new Set((t==null?void 0:t.dependencies)??[]),params:new Set((t==null?void 0:t.params)??[]),parent:!!(t!=null&&t.parent),route:!!(t!=null&&t.route),url:!!(t!=null&&t.url)}}function Ee(){const t=document.querySelector("[autofocus]");if(t)t.focus();else{const r=document.body,f=r.getAttribute("tabindex");r.tabIndex=-1,r.focus({preventScroll:!0,focusVisible:!1}),f!==null?r.setAttribute("tabindex",f):r.removeAttribute("tabindex");const s=getSelection();if(s&&s.type!=="None"){const d=[];for(let u=0;u{if(s.rangeCount===d.length){for(let u=0;u{d=h,u=x});return E.catch(()=>{}),{navigation:{from:{params:t.params,route:{id:((g=t.route)==null?void 0:g.id)??null},url:t.url},to:f&&{params:(r==null?void 0:r.params)??null,route:{id:((m=r==null?void 0:r.route)==null?void 0:m.id)??null},url:f},willUnload:!r,type:s,complete:E},fulfil:d,reject:u}}async function Ut(t,r,f){const s=It(t,r);Xe({client:s}),f?await s._hydrate(f):s.goto(location.href,{replaceState:!0}),s._start_router()}export{Ut as start}; diff --git a/_app/immutable/nodes/1.acf89147.js b/_app/immutable/nodes/1.7f1ec37a.js similarity index 93% rename from _app/immutable/nodes/1.acf89147.js rename to _app/immutable/nodes/1.7f1ec37a.js index 9df3c18..24ac764 100644 --- a/_app/immutable/nodes/1.acf89147.js +++ b/_app/immutable/nodes/1.7f1ec37a.js @@ -1 +1 @@ -import{s as x,n as _,e as S}from"../chunks/scheduler.9d2a5e30.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.0b718437.js";import{d as H}from"../chunks/singletons.10a67dd9.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component}; +import{s as x,n as _,e as S}from"../chunks/scheduler.9d2a5e30.js";import{S as j,i as q,g as f,m as d,s as y,h as g,j as h,n as v,f as u,c as C,a as m,x as $,o as E}from"../chunks/index.0b718437.js";import{d as H}from"../chunks/singletons.bc47e716.js";const P=()=>{const s=H;return{page:{subscribe:s.page.subscribe},navigating:{subscribe:s.navigating.subscribe},updated:s.updated}},k={subscribe(s){return P().page.subscribe(s)}};function w(s){var b;let t,r=s[0].status+"",o,n,i,c=((b=s[0].error)==null?void 0:b.message)+"",l;return{c(){t=f("h1"),o=d(r),n=y(),i=f("p"),l=d(c)},l(e){t=g(e,"H1",{});var a=h(t);o=v(a,r),a.forEach(u),n=C(e),i=g(e,"P",{});var p=h(i);l=v(p,c),p.forEach(u)},m(e,a){m(e,t,a),$(t,o),m(e,n,a),m(e,i,a),$(i,l)},p(e,[a]){var p;a&1&&r!==(r=e[0].status+"")&&E(o,r),a&1&&c!==(c=((p=e[0].error)==null?void 0:p.message)+"")&&E(l,c)},i:_,o:_,d(e){e&&(u(t),u(n),u(i))}}}function z(s,t,r){let o;return S(s,k,n=>r(0,o=n)),[o]}let F=class extends j{constructor(t){super(),q(this,t,z,w,x,{})}};export{F as component}; diff --git a/_app/immutable/nodes/2.1323a0f2.js b/_app/immutable/nodes/2.50de5c68.js similarity index 96% rename from _app/immutable/nodes/2.1323a0f2.js rename to _app/immutable/nodes/2.50de5c68.js index 0fbc764..3df4d04 100644 --- a/_app/immutable/nodes/2.1323a0f2.js +++ b/_app/immutable/nodes/2.50de5c68.js @@ -1 +1 @@ -import{s as Y,c as L,i as Q,u as X,g as Z,d as tt,f as z,h as O,n as G}from"../chunks/scheduler.9d2a5e30.js";import{S as J,i as K,g as p,s as A,h,j as x,f as c,c as P,k as $,a as N,x as d,y as et,d as j,t as k,r as V,u as q,z as F,v as B,w as D}from"../chunks/index.0b718437.js";import{b as R}from"../chunks/paths.1ccbe8f3.js";import{H as st,F as at}from"../chunks/Footer.9e69ab6e.js";function nt(n){let t,o,s,a,u,g,y,f,H,S;const _=n[2].default,l=L(_,n,n[1],null);return{c(){t=p("button"),o=p("span"),s=A(),a=p("span"),u=A(),g=p("span"),l&&l.c(),this.h()},l(r){t=h(r,"BUTTON",{class:!0});var i=x(t);o=h(i,"SPAN",{class:!0}),x(o).forEach(c),s=P(i),a=h(i,"SPAN",{class:!0}),x(a).forEach(c),u=P(i),g=h(i,"SPAN",{class:!0});var v=x(g);l&&l.l(v),v.forEach(c),i.forEach(c),this.h()},h(){$(o,"class","absolute inset-0 w-full h-full bg-gradient-to-br from-primary to-secondary opacity-100 transition duration-300 ease-out group-hover:opacity-0"),$(a,"class","absolute inset-0 w-full h-full bg-gradient-to-br opacity-0 transition duration-300 ease-out group-hover:opacity-100"),$(g,"class","relative"),$(t,"class",y=n[0].class+" inline-flex overflow-hidden relative justify-center items-center py-3 px-6 font-bold rounded-md shadow-2xl group text-primary-on hover:text-secondary")},m(r,i){N(r,t,i),d(t,o),d(t,s),d(t,a),d(t,u),d(t,g),l&&l.m(g,null),f=!0,H||(S=et(t,"click",function(){Q(n[0].click)&&n[0].click.apply(this,arguments)}),H=!0)},p(r,[i]){n=r,l&&l.p&&(!f||i&2)&&X(l,_,n,n[1],f?tt(_,n[1],i,null):Z(n[1]),null),(!f||i&1&&y!==(y=n[0].class+" inline-flex overflow-hidden relative justify-center items-center py-3 px-6 font-bold rounded-md shadow-2xl group text-primary-on hover:text-secondary"))&&$(t,"class",y)},i(r){f||(j(l,r),f=!0)},o(r){k(l,r),f=!1},d(r){r&&c(t),l&&l.d(r),H=!1,S()}}}function rt(n,t,o){let{$$slots:s={},$$scope:a}=t;return n.$$set=u=>{o(0,t=z(z({},t),O(u))),"$$scope"in u&&o(1,a=u.$$scope)},t=O(t),[t,a,s]}class U extends J{constructor(t){super(),K(this,t,rt,nt,Y,{})}}function lt(n){let t,o="Plan Your Visits!";return{c(){t=p("p"),t.textContent=o},l(s){t=h(s,"P",{"data-svelte-h":!0}),F(t)!=="svelte-1va10y5"&&(t.textContent=o)},m(s,a){N(s,t,a)},p:G,d(s){s&&c(t)}}}function ot(n){let t,o="Who Are We?";return{c(){t=p("p"),t.textContent=o},l(s){t=h(s,"P",{"data-svelte-h":!0}),F(t)!=="svelte-sqfrbb"&&(t.textContent=o)},m(s,a){N(s,t,a)},p:G,d(s){s&&c(t)}}}function it(n){let t,o,s,a,u,g="Stavanger HEMA - Allheim",y,f,H="Rogalands most consistent HEMA club!",S,_,l,r,i,v,C,I,E,M;return t=new st({}),r=new U({props:{$$slots:{default:[lt]},$$scope:{ctx:n}}}),C=new U({props:{$$slots:{default:[ot]},$$scope:{ctx:n}}}),E=new at({}),{c(){V(t.$$.fragment),o=A(),s=p("main"),a=p("div"),u=p("h1"),u.textContent=g,y=A(),f=p("h2"),f.textContent=H,S=A(),_=p("div"),l=p("a"),V(r.$$.fragment),i=A(),v=p("a"),V(C.$$.fragment),I=A(),V(E.$$.fragment),this.h()},l(e){q(t.$$.fragment,e),o=P(e),s=h(e,"MAIN",{class:!0});var m=x(s);a=h(m,"DIV",{class:!0});var b=x(a);u=h(b,"H1",{class:!0,"data-svelte-h":!0}),F(u)!=="svelte-inl1xa"&&(u.textContent=g),y=P(b),f=h(b,"H2",{class:!0,"data-svelte-h":!0}),F(f)!=="svelte-12udr1n"&&(f.textContent=H),S=P(b),_=h(b,"DIV",{class:!0});var w=x(_);l=h(w,"A",{href:!0});var T=x(l);q(r.$$.fragment,T),T.forEach(c),i=P(w),v=h(w,"A",{href:!0});var W=x(v);q(C.$$.fragment,W),W.forEach(c),w.forEach(c),b.forEach(c),m.forEach(c),I=P(e),q(E.$$.fragment,e),this.h()},h(){$(u,"class","display-large"),$(f,"class","headline-large"),$(l,"href",R+"/schedule"),$(v,"href",R+"/about"),$(_,"class","space-x-6"),$(a,"class","grid justify-items-center space-y-12 mx-auto"),$(s,"class","py-40 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40")},m(e,m){B(t,e,m),N(e,o,m),N(e,s,m),d(s,a),d(a,u),d(a,y),d(a,f),d(a,S),d(a,_),d(_,l),B(r,l,null),d(_,i),d(_,v),B(C,v,null),N(e,I,m),B(E,e,m),M=!0},p(e,[m]){const b={};m&1&&(b.$$scope={dirty:m,ctx:e}),r.$set(b);const w={};m&1&&(w.$$scope={dirty:m,ctx:e}),C.$set(w)},i(e){M||(j(t.$$.fragment,e),j(r.$$.fragment,e),j(C.$$.fragment,e),j(E.$$.fragment,e),M=!0)},o(e){k(t.$$.fragment,e),k(r.$$.fragment,e),k(C.$$.fragment,e),k(E.$$.fragment,e),M=!1},d(e){e&&(c(o),c(s),c(I)),D(t,e),D(r),D(C),D(E,e)}}}class mt extends J{constructor(t){super(),K(this,t,null,it,Y,{})}}export{mt as component}; +import{s as Y,c as L,i as Q,u as X,g as Z,d as tt,f as z,h as O,n as G}from"../chunks/scheduler.9d2a5e30.js";import{S as J,i as K,g as p,s as A,h,j as x,f as c,c as P,k as $,a as N,x as d,y as et,d as j,t as k,r as V,u as q,z as F,v as B,w as D}from"../chunks/index.0b718437.js";import{b as R}from"../chunks/paths.81e709fc.js";import{H as st,F as at}from"../chunks/Footer.093d42c6.js";function nt(n){let t,o,s,a,u,g,y,f,H,S;const _=n[2].default,l=L(_,n,n[1],null);return{c(){t=p("button"),o=p("span"),s=A(),a=p("span"),u=A(),g=p("span"),l&&l.c(),this.h()},l(r){t=h(r,"BUTTON",{class:!0});var i=x(t);o=h(i,"SPAN",{class:!0}),x(o).forEach(c),s=P(i),a=h(i,"SPAN",{class:!0}),x(a).forEach(c),u=P(i),g=h(i,"SPAN",{class:!0});var v=x(g);l&&l.l(v),v.forEach(c),i.forEach(c),this.h()},h(){$(o,"class","absolute inset-0 w-full h-full bg-gradient-to-br from-primary to-secondary opacity-100 transition duration-300 ease-out group-hover:opacity-0"),$(a,"class","absolute inset-0 w-full h-full bg-gradient-to-br opacity-0 transition duration-300 ease-out group-hover:opacity-100"),$(g,"class","relative"),$(t,"class",y=n[0].class+" inline-flex overflow-hidden relative justify-center items-center py-3 px-6 font-bold rounded-md shadow-2xl group text-primary-on hover:text-secondary")},m(r,i){N(r,t,i),d(t,o),d(t,s),d(t,a),d(t,u),d(t,g),l&&l.m(g,null),f=!0,H||(S=et(t,"click",function(){Q(n[0].click)&&n[0].click.apply(this,arguments)}),H=!0)},p(r,[i]){n=r,l&&l.p&&(!f||i&2)&&X(l,_,n,n[1],f?tt(_,n[1],i,null):Z(n[1]),null),(!f||i&1&&y!==(y=n[0].class+" inline-flex overflow-hidden relative justify-center items-center py-3 px-6 font-bold rounded-md shadow-2xl group text-primary-on hover:text-secondary"))&&$(t,"class",y)},i(r){f||(j(l,r),f=!0)},o(r){k(l,r),f=!1},d(r){r&&c(t),l&&l.d(r),H=!1,S()}}}function rt(n,t,o){let{$$slots:s={},$$scope:a}=t;return n.$$set=u=>{o(0,t=z(z({},t),O(u))),"$$scope"in u&&o(1,a=u.$$scope)},t=O(t),[t,a,s]}class U extends J{constructor(t){super(),K(this,t,rt,nt,Y,{})}}function lt(n){let t,o="Plan Your Visits!";return{c(){t=p("p"),t.textContent=o},l(s){t=h(s,"P",{"data-svelte-h":!0}),F(t)!=="svelte-1va10y5"&&(t.textContent=o)},m(s,a){N(s,t,a)},p:G,d(s){s&&c(t)}}}function ot(n){let t,o="Who Are We?";return{c(){t=p("p"),t.textContent=o},l(s){t=h(s,"P",{"data-svelte-h":!0}),F(t)!=="svelte-sqfrbb"&&(t.textContent=o)},m(s,a){N(s,t,a)},p:G,d(s){s&&c(t)}}}function it(n){let t,o,s,a,u,g="Stavanger HEMA - Allheim",y,f,H="Rogalands most consistent HEMA club!",S,_,l,r,i,v,C,I,E,M;return t=new st({}),r=new U({props:{$$slots:{default:[lt]},$$scope:{ctx:n}}}),C=new U({props:{$$slots:{default:[ot]},$$scope:{ctx:n}}}),E=new at({}),{c(){V(t.$$.fragment),o=A(),s=p("main"),a=p("div"),u=p("h1"),u.textContent=g,y=A(),f=p("h2"),f.textContent=H,S=A(),_=p("div"),l=p("a"),V(r.$$.fragment),i=A(),v=p("a"),V(C.$$.fragment),I=A(),V(E.$$.fragment),this.h()},l(e){q(t.$$.fragment,e),o=P(e),s=h(e,"MAIN",{class:!0});var m=x(s);a=h(m,"DIV",{class:!0});var b=x(a);u=h(b,"H1",{class:!0,"data-svelte-h":!0}),F(u)!=="svelte-inl1xa"&&(u.textContent=g),y=P(b),f=h(b,"H2",{class:!0,"data-svelte-h":!0}),F(f)!=="svelte-12udr1n"&&(f.textContent=H),S=P(b),_=h(b,"DIV",{class:!0});var w=x(_);l=h(w,"A",{href:!0});var T=x(l);q(r.$$.fragment,T),T.forEach(c),i=P(w),v=h(w,"A",{href:!0});var W=x(v);q(C.$$.fragment,W),W.forEach(c),w.forEach(c),b.forEach(c),m.forEach(c),I=P(e),q(E.$$.fragment,e),this.h()},h(){$(u,"class","display-large"),$(f,"class","headline-large"),$(l,"href",R+"/schedule"),$(v,"href",R+"/about"),$(_,"class","space-x-6"),$(a,"class","grid justify-items-center space-y-12 mx-auto"),$(s,"class","py-40 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40")},m(e,m){B(t,e,m),N(e,o,m),N(e,s,m),d(s,a),d(a,u),d(a,y),d(a,f),d(a,S),d(a,_),d(_,l),B(r,l,null),d(_,i),d(_,v),B(C,v,null),N(e,I,m),B(E,e,m),M=!0},p(e,[m]){const b={};m&1&&(b.$$scope={dirty:m,ctx:e}),r.$set(b);const w={};m&1&&(w.$$scope={dirty:m,ctx:e}),C.$set(w)},i(e){M||(j(t.$$.fragment,e),j(r.$$.fragment,e),j(C.$$.fragment,e),j(E.$$.fragment,e),M=!0)},o(e){k(t.$$.fragment,e),k(r.$$.fragment,e),k(C.$$.fragment,e),k(E.$$.fragment,e),M=!1},d(e){e&&(c(o),c(s),c(I)),D(t,e),D(r),D(C),D(E,e)}}}class mt extends J{constructor(t){super(),K(this,t,null,it,Y,{})}}export{mt as component}; diff --git a/_app/immutable/nodes/3.15d4e47e.js b/_app/immutable/nodes/3.bde1f63d.js similarity index 89% rename from _app/immutable/nodes/3.15d4e47e.js rename to _app/immutable/nodes/3.bde1f63d.js index 90c01f9..8c6865d 100644 --- a/_app/immutable/nodes/3.15d4e47e.js +++ b/_app/immutable/nodes/3.bde1f63d.js @@ -1 +1 @@ -import{s as v,n as y}from"../chunks/scheduler.9d2a5e30.js";import{S as H,i as M,r as c,s as f,g as b,u,c as $,h as w,z as A,k as S,v as d,a as o,d as _,t as h,f as l,w as g}from"../chunks/index.0b718437.js";import"../chunks/paths.1ccbe8f3.js";import{H as C,F as E}from"../chunks/Footer.9e69ab6e.js";function F(x){let t,r,a,p='

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    ',m,s,i;return t=new C({}),s=new E({}),{c(){c(t.$$.fragment),r=f(),a=b("main"),a.innerHTML=p,m=f(),c(s.$$.fragment),this.h()},l(e){u(t.$$.fragment,e),r=$(e),a=w(e,"MAIN",{class:!0,"data-svelte-h":!0}),A(a)!=="svelte-1xmiutx"&&(a.innerHTML=p),m=$(e),u(s.$$.fragment,e),this.h()},h(){S(a,"class","py-40 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40")},m(e,n){d(t,e,n),o(e,r,n),o(e,a,n),o(e,m,n),d(s,e,n),i=!0},p:y,i(e){i||(_(t.$$.fragment,e),_(s.$$.fragment,e),i=!0)},o(e){h(t.$$.fragment,e),h(s.$$.fragment,e),i=!1},d(e){e&&(l(r),l(a),l(m)),g(t,e),g(s,e)}}}class q extends H{constructor(t){super(),M(this,t,null,F,v,{})}}export{q as component}; +import{s as v,n as y}from"../chunks/scheduler.9d2a5e30.js";import{S as H,i as M,r as c,s as f,g as b,u,c as $,h as w,z as A,k as S,v as d,a as o,d as _,t as h,f as l,w as g}from"../chunks/index.0b718437.js";import"../chunks/paths.81e709fc.js";import{H as C,F as E}from"../chunks/Footer.093d42c6.js";function F(x){let t,r,a,p='

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    ',m,s,i;return t=new C({}),s=new E({}),{c(){c(t.$$.fragment),r=f(),a=b("main"),a.innerHTML=p,m=f(),c(s.$$.fragment),this.h()},l(e){u(t.$$.fragment,e),r=$(e),a=w(e,"MAIN",{class:!0,"data-svelte-h":!0}),A(a)!=="svelte-1xmiutx"&&(a.innerHTML=p),m=$(e),u(s.$$.fragment,e),this.h()},h(){S(a,"class","py-40 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40")},m(e,n){d(t,e,n),o(e,r,n),o(e,a,n),o(e,m,n),d(s,e,n),i=!0},p:y,i(e){i||(_(t.$$.fragment,e),_(s.$$.fragment,e),i=!0)},o(e){h(t.$$.fragment,e),h(s.$$.fragment,e),i=!1},d(e){e&&(l(r),l(a),l(m)),g(t,e),g(s,e)}}}class q extends H{constructor(t){super(),M(this,t,null,F,v,{})}}export{q as component}; diff --git a/_app/immutable/nodes/4.15d4e47e.js b/_app/immutable/nodes/4.bde1f63d.js similarity index 89% rename from _app/immutable/nodes/4.15d4e47e.js rename to _app/immutable/nodes/4.bde1f63d.js index 90c01f9..8c6865d 100644 --- a/_app/immutable/nodes/4.15d4e47e.js +++ b/_app/immutable/nodes/4.bde1f63d.js @@ -1 +1 @@ -import{s as v,n as y}from"../chunks/scheduler.9d2a5e30.js";import{S as H,i as M,r as c,s as f,g as b,u,c as $,h as w,z as A,k as S,v as d,a as o,d as _,t as h,f as l,w as g}from"../chunks/index.0b718437.js";import"../chunks/paths.1ccbe8f3.js";import{H as C,F as E}from"../chunks/Footer.9e69ab6e.js";function F(x){let t,r,a,p='

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    ',m,s,i;return t=new C({}),s=new E({}),{c(){c(t.$$.fragment),r=f(),a=b("main"),a.innerHTML=p,m=f(),c(s.$$.fragment),this.h()},l(e){u(t.$$.fragment,e),r=$(e),a=w(e,"MAIN",{class:!0,"data-svelte-h":!0}),A(a)!=="svelte-1xmiutx"&&(a.innerHTML=p),m=$(e),u(s.$$.fragment,e),this.h()},h(){S(a,"class","py-40 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40")},m(e,n){d(t,e,n),o(e,r,n),o(e,a,n),o(e,m,n),d(s,e,n),i=!0},p:y,i(e){i||(_(t.$$.fragment,e),_(s.$$.fragment,e),i=!0)},o(e){h(t.$$.fragment,e),h(s.$$.fragment,e),i=!1},d(e){e&&(l(r),l(a),l(m)),g(t,e),g(s,e)}}}class q extends H{constructor(t){super(),M(this,t,null,F,v,{})}}export{q as component}; +import{s as v,n as y}from"../chunks/scheduler.9d2a5e30.js";import{S as H,i as M,r as c,s as f,g as b,u,c as $,h as w,z as A,k as S,v as d,a as o,d as _,t as h,f as l,w as g}from"../chunks/index.0b718437.js";import"../chunks/paths.81e709fc.js";import{H as C,F as E}from"../chunks/Footer.093d42c6.js";function F(x){let t,r,a,p='

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    ',m,s,i;return t=new C({}),s=new E({}),{c(){c(t.$$.fragment),r=f(),a=b("main"),a.innerHTML=p,m=f(),c(s.$$.fragment),this.h()},l(e){u(t.$$.fragment,e),r=$(e),a=w(e,"MAIN",{class:!0,"data-svelte-h":!0}),A(a)!=="svelte-1xmiutx"&&(a.innerHTML=p),m=$(e),u(s.$$.fragment,e),this.h()},h(){S(a,"class","py-40 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40")},m(e,n){d(t,e,n),o(e,r,n),o(e,a,n),o(e,m,n),d(s,e,n),i=!0},p:y,i(e){i||(_(t.$$.fragment,e),_(s.$$.fragment,e),i=!0)},o(e){h(t.$$.fragment,e),h(s.$$.fragment,e),i=!1},d(e){e&&(l(r),l(a),l(m)),g(t,e),g(s,e)}}}class q extends H{constructor(t){super(),M(this,t,null,F,v,{})}}export{q as component}; diff --git a/_app/immutable/nodes/5.469ce401.js b/_app/immutable/nodes/5.0fbde3c0.js similarity index 91% rename from _app/immutable/nodes/5.469ce401.js rename to _app/immutable/nodes/5.0fbde3c0.js index aa27b12..a69508f 100644 --- a/_app/immutable/nodes/5.469ce401.js +++ b/_app/immutable/nodes/5.0fbde3c0.js @@ -1 +1 @@ -import{s as T,n as j}from"../chunks/scheduler.9d2a5e30.js";import{S as A,i as C,r as $,s as f,g as _,u as g,c as u,h as v,z as x,k as y,v as w,a as l,d as H,t as b,f as i,w as M}from"../chunks/index.0b718437.js";import"../chunks/paths.1ccbe8f3.js";import{H as S,F as k}from"../chunks/Footer.9e69ab6e.js";function F(L){let t,m,s,d='

    Pricing

    Stavanger HEMA - Allheim

    ',o,a,h='

    1 500.- / 6 months

    ',p,r,c;return t=new S({}),r=new k({}),{c(){$(t.$$.fragment),m=f(),s=_("main"),s.innerHTML=d,o=f(),a=_("div"),a.innerHTML=h,p=f(),$(r.$$.fragment),this.h()},l(e){g(t.$$.fragment,e),m=u(e),s=v(e,"MAIN",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-joobe1"&&(s.innerHTML=d),o=u(e),a=v(e,"DIV",{class:!0,"data-svelte-h":!0}),x(a)!=="svelte-1cs5l1p"&&(a.innerHTML=h),p=u(e),g(r.$$.fragment,e),this.h()},h(){y(s,"class","py-20 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40"),y(a,"class","grid h-full w-full justify-center place-items-center")},m(e,n){w(t,e,n),l(e,m,n),l(e,s,n),l(e,o,n),l(e,a,n),l(e,p,n),w(r,e,n),c=!0},p:j,i(e){c||(H(t.$$.fragment,e),H(r.$$.fragment,e),c=!0)},o(e){b(t.$$.fragment,e),b(r.$$.fragment,e),c=!1},d(e){e&&(i(m),i(s),i(o),i(a),i(p)),M(t,e),M(r,e)}}}class D extends A{constructor(t){super(),C(this,t,null,F,T,{})}}export{D as component}; +import{s as T,n as j}from"../chunks/scheduler.9d2a5e30.js";import{S as A,i as C,r as $,s as f,g as _,u as g,c as u,h as v,z as x,k as y,v as w,a as l,d as H,t as b,f as i,w as M}from"../chunks/index.0b718437.js";import"../chunks/paths.81e709fc.js";import{H as S,F as k}from"../chunks/Footer.093d42c6.js";function F(L){let t,m,s,d='

    Pricing

    Stavanger HEMA - Allheim

    ',o,a,h='

    1 500.- / 6 months

    ',p,r,c;return t=new S({}),r=new k({}),{c(){$(t.$$.fragment),m=f(),s=_("main"),s.innerHTML=d,o=f(),a=_("div"),a.innerHTML=h,p=f(),$(r.$$.fragment),this.h()},l(e){g(t.$$.fragment,e),m=u(e),s=v(e,"MAIN",{class:!0,"data-svelte-h":!0}),x(s)!=="svelte-joobe1"&&(s.innerHTML=d),o=u(e),a=v(e,"DIV",{class:!0,"data-svelte-h":!0}),x(a)!=="svelte-1cs5l1p"&&(a.innerHTML=h),p=u(e),g(r.$$.fragment,e),this.h()},h(){y(s,"class","py-20 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40"),y(a,"class","grid h-full w-full justify-center place-items-center")},m(e,n){w(t,e,n),l(e,m,n),l(e,s,n),l(e,o,n),l(e,a,n),l(e,p,n),w(r,e,n),c=!0},p:j,i(e){c||(H(t.$$.fragment,e),H(r.$$.fragment,e),c=!0)},o(e){b(t.$$.fragment,e),b(r.$$.fragment,e),c=!1},d(e){e&&(i(m),i(s),i(o),i(a),i(p)),M(t,e),M(r,e)}}}class D extends A{constructor(t){super(),C(this,t,null,F,T,{})}}export{D as component}; diff --git a/_app/immutable/nodes/6.677dde31.js b/_app/immutable/nodes/6.6c744caa.js similarity index 99% rename from _app/immutable/nodes/6.677dde31.js rename to _app/immutable/nodes/6.6c744caa.js index 93d15a0..7824788 100644 --- a/_app/immutable/nodes/6.677dde31.js +++ b/_app/immutable/nodes/6.6c744caa.js @@ -1,2 +1,2 @@ -import{j as It,k as Lt,l as be,m as Dt,r as bt,s as Ut,o as Nt,n as N}from"../chunks/scheduler.9d2a5e30.js";import{p as Ft,t as Ae,b as qt,d as Te,S as Mt,i as Jt,r as Ge,s as q,g as A,m as X,u as Ke,c as M,h as I,z as ue,j as B,f as O,n as Q,k as x,v as Ve,a as P,x as j,y as We,w as Xe,e as K,A as Bt}from"../chunks/index.0b718437.js";import{H as zt,F as Ht}from"../chunks/Footer.9e69ab6e.js";import{_ as me}from"../chunks/preload-helper.a4192956.js";function Gt(i,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function wt(i,e){const t=e.token={};function s(r,n,o,a){if(e.token!==t)return;e.resolved=a;let l=e.ctx;o!==void 0&&(l=l.slice(),l[o]=a);const c=r&&(e.current=r)(l);let h=!1;e.block&&(e.blocks?e.blocks.forEach((d,u)=>{u!==n&&d&&(Ft(),Ae(d,1,1,()=>{e.blocks[u]===d&&(e.blocks[u]=null)}),qt())}):e.block.d(1),c.c(),Te(c,1),c.m(e.mount(),e.anchor),h=!0),e.block=c,e.blocks&&(e.blocks[n]=c),h&&Dt()}if(It(i)){const r=Lt();if(i.then(n=>{be(r),s(e.then,1,e.value,n),be(null)},n=>{if(be(r),s(e.catch,2,e.error,n),be(null),!e.hasCatch)throw n}),e.current!==e.pending)return s(e.pending,0),!0}else{if(e.current!==e.then)return s(e.then,1,e.value,i),!0;e.resolved=i}}function kt(i,e,t){const s=e.slice(),{resolved:r}=i;i.current===i.then&&(s[i.value]=r),i.current===i.catch&&(s[i.error]=r),i.block.p(s,t)}function ne(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function St(i,e){i.d(1),e.delete(i.key)}function Tt(i,e,t,s,r,n,o,a,l,c,h,d){let u=i.length,f=n.length,g=u;const p={};for(;g--;)p[i[g].key]=g;const _=[],S=new Map,k=new Map,E=[];for(g=f;g--;){const y=d(r,n,g),R=t(y);let L=o.get(R);L?s&&E.push(()=>L.p(y,e)):(L=c(R,y),L.c()),S.set(R,_[g]=L),R in p&&k.set(R,Math.abs(g-p[R]))}const v=new Set,$=new Set;function m(y){Te(y,1),y.m(a,h),o.set(y.key,y),h=y.first,f--}for(;u&&f;){const y=_[f-1],R=i[u-1],L=y.key,ye=R.key;y===R?(h=y.first,u--,f--):S.has(ye)?!o.has(L)||v.has(L)?m(y):$.has(ye)?u--:k.get(L)>k.get(ye)?($.add(L),m(y)):(v.add(ye),u--):(l(R,o),u--)}for(;u--;){const y=i[u];S.has(y.key)||l(y,o)}for(;f;)m(_[f-1]);return bt(E),_}const Kt=i=>{let e;return i?e=i:typeof fetch>"u"?e=(...t)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)};class Fe extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class Vt extends Fe{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Wt extends Fe{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Xt extends Fe{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Qt=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};class Yt{constructor(e,{headers:t={},customFetch:s}={}){this.url=e,this.headers=t,this.fetch=Kt(s)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s;return Qt(this,void 0,void 0,function*(){try{const{headers:r,method:n,body:o}=t;let a={},l;o&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",l=o):typeof o=="string"?(a["Content-Type"]="text/plain",l=o):typeof FormData<"u"&&o instanceof FormData?l=o:(a["Content-Type"]="application/json",l=JSON.stringify(o)));const c=yield this.fetch(`${this.url}/${e}`,{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),r),body:l}).catch(f=>{throw new Vt(f)}),h=c.headers.get("x-relay-error");if(h&&h==="true")throw new Wt(c);if(!c.ok)throw new Xt(c);let d=((s=c.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),u;return d==="application/json"?u=yield c.json():d==="application/octet-stream"?u=yield c.blob():d==="multipart/form-data"?u=yield c.formData():u=yield c.text(),{data:u,error:null}}catch(r){return{data:null,error:r}}})}}var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ie={exports:{}};(function(i,e){var t=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof Qe<"u")return Qe;throw new Error("unable to locate global object")},s=t();i.exports=e=s.fetch,s.fetch&&(e.default=s.fetch.bind(s)),e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response})(Ie,Ie.exports);var qe=Ie.exports;const Me=Zt(qe),ve=Gt({__proto__:null,default:Me},[qe]);class es{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=Me:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const s=this.fetch;let r=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{var o,a,l;let c=null,h=null,d=null,u=n.status,f=n.statusText;if(n.ok){if(this.method!=="HEAD"){const S=await n.text();S===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?h=S:h=JSON.parse(S))}const p=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),_=(a=n.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");p&&_&&_.length>1&&(d=parseInt(_[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(c={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,d=null,u=406,f="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{const p=await n.text();try{c=JSON.parse(p),Array.isArray(c)&&n.status===404&&(h=[],c=null,u=200,f="OK")}catch{n.status===404&&p===""?(u=204,f="No Content"):c={message:p}}if(c&&this.isMaybeSingle&&(!((l=c==null?void 0:c.details)===null||l===void 0)&&l.includes("0 rows"))&&(c=null,u=200,f="OK"),c&&this.shouldThrowOnError)throw c}return{error:c,data:h,count:d,status:u,statusText:f}});return this.shouldThrowOnError||(r=r.catch(n=>{var o,a,l;return{error:{message:`${(o=n==null?void 0:n.name)!==null&&o!==void 0?o:"FetchError"}: ${n==null?void 0:n.message}`,details:`${(a=n==null?void 0:n.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(l=n==null?void 0:n.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),r.then(e,t)}}class ts extends es{select(e){let t=!1;const s=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",s),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:s,foreignTable:r}={}){const n=r?`${r}.order`:"order",o=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){const s=typeof t>"u"?"limit":`${t}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:s}={}){const r=typeof s>"u"?"offset":`${s}.offset`,n=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(r,`${e}`),this.url.searchParams.set(n,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:s=!1,buffers:r=!1,wal:n=!1,format:o="text"}={}){const a=[e?"analyze":null,t?"verbose":null,s?"settings":null,r?"buffers":null,n?"wal":null].filter(Boolean).join("|"),l=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${l}"; options=${a};`,o==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class ie extends ts{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const s=t.map(r=>typeof r=="string"&&new RegExp("[,()]").test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${s})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:s,type:r}={}){let n="";r==="plain"?n="pl":r==="phrase"?n="ph":r==="websearch"&&(n="w");const o=s===void 0?"":`(${s})`;return this.url.searchParams.append(e,`${n}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,s])=>{this.url.searchParams.append(t,`eq.${s}`)}),this}not(e,t,s){return this.url.searchParams.append(e,`not.${t}.${s}`),this}or(e,{foreignTable:t}={}){const s=t?`${t}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,s){return this.url.searchParams.append(e,`${t}.${s}`),this}}class ss{constructor(e,{headers:t={},schema:s,fetch:r}){this.url=e,this.headers=t,this.schema=s,this.fetch=r}select(e,{head:t=!1,count:s}={}){const r=t?"HEAD":"GET";let n=!1;const o=(e??"*").split("").map(a=>/\s/.test(a)&&!n?"":(a==='"'&&(n=!n),a)).join("");return this.url.searchParams.set("select",o),s&&(this.headers.Prefer=`count=${s}`),new ie({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:s=!0}={}){const r="POST",n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),t&&n.push(`count=${t}`),s||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(e)){const o=e.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>0){const a=[...new Set(o)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new ie({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:s=!1,count:r,defaultToNull:n=!0}={}){const o="POST",a=[`resolution=${s?"ignore":"merge"}-duplicates`];if(t!==void 0&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&a.push(this.headers.Prefer),r&&a.push(`count=${r}`),n||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){const l=e.reduce((c,h)=>c.concat(Object.keys(h)),[]);if(l.length>0){const c=[...new Set(l)].map(h=>`"${h}"`);this.url.searchParams.set("columns",c.join(","))}}return new ie({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){const s="PATCH",r=[];return this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),this.headers.Prefer=r.join(","),new ie({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const t="DELETE",s=[];return e&&s.push(`count=${e}`),this.headers.Prefer&&s.unshift(this.headers.Prefer),this.headers.Prefer=s.join(","),new ie({method:t,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}const rs="1.8.5",is={"X-Client-Info":`postgrest-js/${rs}`};class Je{constructor(e,{headers:t={},schema:s,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},is),t),this.schemaName=s,this.fetch=r}from(e){const t=new URL(`${this.url}/${e}`);return new ss(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new Je(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:s=!1,count:r}={}){let n;const o=new URL(`${this.url}/rpc/${e}`);let a;s?(n="HEAD",Object.entries(t).forEach(([c,h])=>{o.searchParams.append(c,`${h}`)})):(n="POST",a=t);const l=Object.assign({},this.headers);return r&&(l.Prefer=`count=${r}`),new ie({method:n,url:o,headers:l,schema:this.schemaName,body:a,fetch:this.fetch,allowEmpty:!1})}}var $e,Ye;function ns(){if(Ye)return $e;Ye=1;var i=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return $e=function(){if(this)return this;if(typeof globalThis=="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return i()}try{return __global__||i()}finally{delete Object.prototype.__global__}}(),$e}const os="websocket",as="Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",ls=["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],cs="Brian McKelvey (https://github.com/theturtle32)",hs=["Iñaki Baz Castillo (http://dev.sipdoc.net)"],us="1.0.34",ds={type:"git",url:"https://github.com/theturtle32/WebSocket-Node.git"},fs="https://github.com/theturtle32/WebSocket-Node",gs={node:">=4.0.0"},ps={bufferutil:"^4.0.1",debug:"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2",yaeti:"^0.0.6"},_s={"buffer-equal":"^1.0.0",gulp:"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1",jshint:"^2.0.0",tape:"^4.9.1"},ms={verbose:!1},vs={test:"tape test/unit/*.js",gulp:"gulp"},ys="index",bs={lib:"./lib"},ws="lib/browser.js",ks="Apache-2.0",Ss={name:os,description:as,keywords:ls,author:cs,contributors:hs,version:us,repository:ds,homepage:fs,engines:gs,dependencies:ps,devDependencies:_s,config:ms,scripts:vs,main:ys,directories:bs,browser:ws,license:ks};var Ts=Ss.version,Y;if(typeof globalThis=="object")Y=globalThis;else try{Y=ns()}catch{}finally{if(!Y&&typeof window<"u"&&(Y=window),!Y)throw new Error("Could not determine global this")}var pe=Y.WebSocket||Y.MozWebSocket,Os=Ts;function Ot(i,e){var t;return e?t=new pe(i,e):t=new pe(i),t}pe&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(i){Object.defineProperty(Ot,i,{get:function(){return pe[i]}})});var Es={w3cwebsocket:pe?Ot:null,version:Os};const $s="2.8.1",js={"X-Client-Info":`realtime-js/${$s}`},Ps="1.0.0",Et=1e4,Cs=1e3;var de;(function(i){i[i.connecting=0]="connecting",i[i.open=1]="open",i[i.closing=2]="closing",i[i.closed=3]="closed"})(de||(de={}));var D;(function(i){i.closed="closed",i.errored="errored",i.joined="joined",i.joining="joining",i.leaving="leaving"})(D||(D={}));var F;(function(i){i.close="phx_close",i.error="phx_error",i.join="phx_join",i.reply="phx_reply",i.leave="phx_leave",i.access_token="access_token"})(F||(F={}));var Le;(function(i){i.websocket="websocket"})(Le||(Le={}));var Z;(function(i){i.Connecting="connecting",i.Open="open",i.Closing="closing",i.Closed="closed"})(Z||(Z={}));class $t{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}class xs{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),s=new TextDecoder;return this._decodeBroadcast(e,t,s)}_decodeBroadcast(e,t,s){const r=t.getUint8(1),n=t.getUint8(2);let o=this.HEADER_LENGTH+2;const a=s.decode(e.slice(o,o+r));o=o+r;const l=s.decode(e.slice(o,o+n));o=o+n;const c=JSON.parse(s.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:l,payload:c}}}class je{constructor(e,t,s={},r=Et){this.channel=e,this.event=t,this.payload=s,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null,this.rateLimited=!1}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){if(this._hasReceived("timeout"))return;this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()})==="rate limited"&&(this.rateLimited=!0)}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var s;return this._hasReceived(e)&&t((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Ze;(function(i){i.SYNC="sync",i.JOIN="join",i.LEAVE="leave"})(Ze||(Ze={}));class fe{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},r=>{const{onJoin:n,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=fe.syncState(this.state,r,n,o),this.pendingDiffs.forEach(l=>{this.state=fe.syncDiff(this.state,l,n,o)}),this.pendingDiffs=[],a()}),this.channel._on(s.diff,{},r=>{const{onJoin:n,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(r):(this.state=fe.syncDiff(this.state,r,n,o),a())}),this.onJoin((r,n,o)=>{this.channel._trigger("presence",{event:"join",key:r,currentPresences:n,newPresences:o})}),this.onLeave((r,n,o)=>{this.channel._trigger("presence",{event:"leave",key:r,currentPresences:n,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,s,r){const n=this.cloneDeep(e),o=this.transformState(t),a={},l={};return this.map(n,(c,h)=>{o[c]||(l[c]=h)}),this.map(o,(c,h)=>{const d=n[c];if(d){const u=h.map(_=>_.presence_ref),f=d.map(_=>_.presence_ref),g=h.filter(_=>f.indexOf(_.presence_ref)<0),p=d.filter(_=>u.indexOf(_.presence_ref)<0);g.length>0&&(a[c]=g),p.length>0&&(l[c]=p)}else a[c]=h}),this.syncDiff(n,{joins:a,leaves:l},s,r)}static syncDiff(e,t,s,r){const{joins:n,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(n,(a,l)=>{var c;const h=(c=e[a])!==null&&c!==void 0?c:[];if(e[a]=this.cloneDeep(l),h.length>0){const d=e[a].map(f=>f.presence_ref),u=h.filter(f=>d.indexOf(f.presence_ref)<0);e[a].unshift(...u)}s(a,h,l)}),this.map(o,(a,l)=>{let c=e[a];if(!c)return;const h=l.map(d=>d.presence_ref);c=c.filter(d=>h.indexOf(d.presence_ref)<0),e[a]=c,r(a,c,l),c.length===0&&delete e[a]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(s=>t(s,e[s]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,s)=>{const r=e[s];return"metas"in r?t[s]=r.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):t[s]=r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var T;(function(i){i.abstime="abstime",i.bool="bool",i.date="date",i.daterange="daterange",i.float4="float4",i.float8="float8",i.int2="int2",i.int4="int4",i.int4range="int4range",i.int8="int8",i.int8range="int8range",i.json="json",i.jsonb="jsonb",i.money="money",i.numeric="numeric",i.oid="oid",i.reltime="reltime",i.text="text",i.time="time",i.timestamp="timestamp",i.timestamptz="timestamptz",i.timetz="timetz",i.tsrange="tsrange",i.tstzrange="tstzrange"})(T||(T={}));const et=(i,e,t={})=>{var s;const r=(s=t.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(e).reduce((n,o)=>(n[o]=Rs(o,i,e,r),n),{})},Rs=(i,e,t,s)=>{const r=e.find(a=>a.name===i),n=r==null?void 0:r.type,o=t[i];return n&&!s.includes(n)?jt(n,o):De(o)},jt=(i,e)=>{if(i.charAt(0)==="_"){const t=i.slice(1,i.length);return Ds(e,t)}switch(i){case T.bool:return As(e);case T.float4:case T.float8:case T.int2:case T.int4:case T.int8:case T.numeric:case T.oid:return Is(e);case T.json:case T.jsonb:return Ls(e);case T.timestamp:return Us(e);case T.abstime:case T.date:case T.daterange:case T.int4range:case T.int8range:case T.money:case T.reltime:case T.text:case T.time:case T.timestamptz:case T.timetz:case T.tsrange:case T.tstzrange:return De(e);default:return De(e)}},De=i=>i,As=i=>{switch(i){case"t":return!0;case"f":return!1;default:return i}},Is=i=>{if(typeof i=="string"){const e=parseFloat(i);if(!Number.isNaN(e))return e}return i},Ls=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch(e){return console.log(`JSON parse error: ${e}`),i}return i},Ds=(i,e)=>{if(typeof i!="string")return i;const t=i.length-1,s=i[t];if(i[0]==="{"&&s==="}"){let n;const o=i.slice(1,t);try{n=JSON.parse("["+o+"]")}catch{n=o?o.split(","):[]}return n.map(a=>jt(e,a))}return i},Us=i=>typeof i=="string"?i.replace(" ","T"):i;var tt;(function(i){i.ALL="*",i.INSERT="INSERT",i.UPDATE="UPDATE",i.DELETE="DELETE"})(tt||(tt={}));var st;(function(i){i.BROADCAST="broadcast",i.PRESENCE="presence",i.POSTGRES_CHANGES="postgres_changes"})(st||(st={}));var rt;(function(i){i.SUBSCRIBED="SUBSCRIBED",i.TIMED_OUT="TIMED_OUT",i.CLOSED="CLOSED",i.CHANNEL_ERROR="CHANNEL_ERROR"})(rt||(rt={}));class Be{constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=D.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new je(this,F.join,this.params,this.timeout),this.rejoinTimer=new $t(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=D.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=D.closed,this.socket._remove(this)}),this._onError(r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=D.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=D.errored,this.rejoinTimer.scheduleTimeout())}),this._on(F.reply,{},(r,n)=>{this._trigger(this._replyEventName(n),r)}),this.presence=new fe(this),this.broadcastEndpointURL=this._broadcastEndpointURL()}subscribe(e,t=this.timeout){var s,r;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:n,presence:o}}=this.params;this._onError(c=>e&&e("CHANNEL_ERROR",c)),this._onClose(()=>e&&e("CLOSED"));const a={},l={broadcast:n,presence:o,postgres_changes:(r=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(c=>c.filter))!==null&&r!==void 0?r:[]};this.socket.accessToken&&(a.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:l},a)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:c})=>{var h;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),c===void 0){e&&e("SUBSCRIBED");return}else{const d=this.bindings.postgres_changes,u=(h=d==null?void 0:d.length)!==null&&h!==void 0?h:0,f=[];for(let g=0;g{e&&e("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(c).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,s){return this._on(e,t,s)}async send(e,t={}){var s,r;if(!this._canPush()&&e.type==="broadcast"){const{event:n,payload:o}=e,a={method:"POST",headers:{apikey:(s=this.socket.accessToken)!==null&&s!==void 0?s:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:o}]})};try{return(await this._fetchWithTimeout(this.broadcastEndpointURL,a,(r=t.timeout)!==null&&r!==void 0?r:this.timeout)).ok?"ok":"error"}catch(l){return l.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var o,a,l;const c=this._push(e.type,e,t.timeout||this.timeout);c.rateLimited&&n("rate limited"),e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),c.receive("ok",()=>n("ok")),c.receive("timeout",()=>n("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=D.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(F.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(s=>{const r=new je(this,F.leave,{},e);r.receive("ok",()=>{t(),s("ok")}).receive("timeout",()=>{t(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})})}_broadcastEndpointURL(){let e=this.socket.endPoint;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"}async _fetchWithTimeout(e,t,s){const r=new AbortController,n=setTimeout(()=>r.abort(),s),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(n),o}_push(e,t,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new je(this,e,t,s);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,s){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,s){var r,n;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:c,join:h}=F;if(s&&[a,l,c,h].indexOf(o)>=0&&s!==this._joinRef())return;let u=this._onMessage(o,t,s);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(r=this.bindings.postgres_changes)===null||r===void 0||r.filter(f=>{var g,p,_;return((g=f.filter)===null||g===void 0?void 0:g.event)==="*"||((_=(p=f.filter)===null||p===void 0?void 0:p.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===o}).map(f=>f.callback(u,s)):(n=this.bindings[o])===null||n===void 0||n.filter(f=>{var g,p,_,S,k,E;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const v=f.id,$=(g=f.filter)===null||g===void 0?void 0:g.event;return v&&((p=t.ids)===null||p===void 0?void 0:p.includes(v))&&($==="*"||($==null?void 0:$.toLocaleLowerCase())===((_=t.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const v=(k=(S=f==null?void 0:f.filter)===null||S===void 0?void 0:S.event)===null||k===void 0?void 0:k.toLocaleLowerCase();return v==="*"||v===((E=t==null?void 0:t.event)===null||E===void 0?void 0:E.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof u=="object"&&"ids"in u){const g=u.data,{schema:p,table:_,commit_timestamp:S,type:k,errors:E}=g;u=Object.assign(Object.assign({},{schema:p,table:_,commit_timestamp:S,eventType:k,new:{},old:{},errors:E}),this._getPayloadRecords(g))}f.callback(u,s)})}_isClosed(){return this.state===D.closed}_isJoined(){return this.state===D.joined}_isJoining(){return this.state===D.joining}_isLeaving(){return this.state===D.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,s){const r=e.toLocaleLowerCase(),n={type:r,filter:t,callback:s};return this.bindings[r]?this.bindings[r].push(n):this.bindings[r]=[n],this}_off(e,t){const s=e.toLocaleLowerCase();return this.bindings[s]=this.bindings[s].filter(r=>{var n;return!(((n=r.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===s&&Be.isEqual(r.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(F.close,{},e)}_onError(e){this._on(F.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=D.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=et(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=et(e.columns,e.old_record)),t}}const Ns=()=>{};class Fs{constructor(e,t){var s,r;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=js,this.params={},this.timeout=Et,this.transport=Es.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Ns,this.conn=null,this.sendBuffer=[],this.serializer=new xs,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this._resolveFetch=a=>{let l;return a?l=a:typeof fetch>"u"?l=(...c)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:h})=>h(...c)):l=fetch,(...c)=>l(...c)},this.endPoint=`${e}/${Le.websocket}`,t!=null&&t.params&&(this.params=t.params),t!=null&&t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t!=null&&t.timeout&&(this.timeout=t.timeout),t!=null&&t.logger&&(this.logger=t.logger),t!=null&&t.transport&&(this.transport=t.transport),t!=null&&t.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const n=(s=t==null?void 0:t.params)===null||s===void 0?void 0:s.eventsPerSecond;n&&(this.eventsPerSecondLimitMs=Math.floor(1e3/n));const o=(r=t==null?void 0:t.params)===null||r===void 0?void 0:r.apikey;o&&(this.accessToken=o),this.reconnectAfterMs=t!=null&&t.reconnectAfterMs?t.reconnectAfterMs:a=>[1e3,2e3,5e3,1e4][a-1]||1e4,this.encode=t!=null&&t.encode?t.encode:(a,l)=>l(JSON.stringify(a)),this.decode=t!=null&&t.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new $t(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t==null?void 0:t.fetch)}connect(){this.conn||(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,t??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case de.connecting:return Z.Connecting;case de.open:return Z.Open;case de.closing:return Z.Closing;default:return Z.Closed}}isConnected(){return this.connectionState()===Z.Open}channel(e,t={config:{}}){const s=new Be(`realtime:${e}`,t,this);return this.channels.push(s),s}push(e){const{topic:t,event:s,payload:r,ref:n}=e;let o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};if(this.log("push",`${t} ${s} (${n})`,r),this.isConnected())if(["broadcast","presence","postgres_changes"].includes(s)){if(this._throttle(o)())return"rate limited"}else o();else this.sendBuffer.push(o)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(F.access_token,{access_token:e})})}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(s=>s.topic===e&&(s._isJoined()||s._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Ps}))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:s,event:r,payload:n,ref:o}=t;(o&&o===this.pendingHeartbeatRef||r===(n==null?void 0:n.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${n.status||""} ${s} ${r} ${o&&"("+o+")"||""}`,n),this.channels.filter(a=>a._isMember(s)).forEach(a=>a._trigger(r,n,o)),this.stateChangeCallbacks.message.forEach(a=>a(t))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(F.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const s=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${s}${r}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(Cs,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_throttle(e,t=this.eventsPerSecondLimitMs){return()=>this.inThrottle?!0:(e(),t>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},t)),!1)}}class ze extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function C(i){return typeof i=="object"&&i!==null&&"__isStorageError"in i}class qs extends ze{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class it extends ze{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var Ms=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Pt=i=>{let e;return i?e=i:typeof fetch>"u"?e=(...t)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},Js=()=>Ms(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url)).Response:Response});var oe=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Pe=i=>i.msg||i.message||i.error_description||i.error||JSON.stringify(i),Bs=(i,e)=>oe(void 0,void 0,void 0,function*(){const t=yield Js();i instanceof t?i.json().then(s=>{e(new qs(Pe(s),i.status||500))}).catch(s=>{e(new it(Pe(s),s))}):e(new it(Pe(i),i))}),zs=(i,e,t,s)=>{const r={method:i,headers:(e==null?void 0:e.headers)||{}};return i==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};function Oe(i,e,t,s,r,n){return oe(this,void 0,void 0,function*(){return new Promise((o,a)=>{i(t,zs(e,s,r,n)).then(l=>{if(!l.ok)throw l;return s!=null&&s.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>Bs(l,a))})})}function Ue(i,e,t,s){return oe(this,void 0,void 0,function*(){return Oe(i,"GET",e,t,s)})}function H(i,e,t,s,r){return oe(this,void 0,void 0,function*(){return Oe(i,"POST",e,s,r,t)})}function Hs(i,e,t,s,r){return oe(this,void 0,void 0,function*(){return Oe(i,"PUT",e,s,r,t)})}function Ct(i,e,t,s,r){return oe(this,void 0,void 0,function*(){return Oe(i,"DELETE",e,s,r,t)})}var U=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Gs={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nt={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Ks{constructor(e,t={},s,r){this.url=e,this.headers=t,this.bucketId=s,this.fetch=Pt(r)}uploadOrUpdate(e,t,s,r){return U(this,void 0,void 0,function*(){try{let n;const o=Object.assign(Object.assign({},nt),r),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});typeof Blob<"u"&&s instanceof Blob?(n=new FormData,n.append("cacheControl",o.cacheControl),n.append("",s)):typeof FormData<"u"&&s instanceof FormData?(n=s,n.append("cacheControl",o.cacheControl)):(n=s,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType);const l=this._removeEmptyFolders(t),c=this._getFinalPath(l),h=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:n,headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return h.ok?{data:{path:l},error:null}:{data:null,error:yield h.json()}}catch(n){if(C(n))return{data:null,error:n};throw n}})}upload(e,t,s){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,s)})}uploadToSignedUrl(e,t,s,r){return U(this,void 0,void 0,function*(){const n=this._removeEmptyFolders(e),o=this._getFinalPath(n),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let l;const c=Object.assign({upsert:nt.upsert},r),h=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&s instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",s)):typeof FormData<"u"&&s instanceof FormData?(l=s,l.append("cacheControl",c.cacheControl)):(l=s,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType);const d=yield this.fetch(a.toString(),{method:"PUT",body:l,headers:h});return d.ok?{data:{path:n},error:null}:{data:null,error:yield d.json()}}catch(l){if(C(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e){return U(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e);const s=yield H(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),r=new URL(this.url+s.url),n=r.searchParams.get("token");if(!n)throw new ze("No token returned by API");return{data:{signedUrl:r.toString(),path:e,token:n},error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}update(e,t,s){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,s)})}move(e,t){return U(this,void 0,void 0,function*(){try{return{data:yield H(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}copy(e,t){return U(this,void 0,void 0,function*(){try{return{data:{path:(yield H(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers})).Key},error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}createSignedUrl(e,t,s){return U(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),n=yield H(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},s!=null&&s.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return n={signedUrl:encodeURI(`${this.url}${n.signedURL}${o}`)},{data:n,error:null}}catch(r){if(C(r))return{data:null,error:r};throw r}})}createSignedUrls(e,t,s){return U(this,void 0,void 0,function*(){try{const r=yield H(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),n=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return{data:r.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${n}`):null})),error:null}}catch(r){if(C(r))return{data:null,error:r};throw r}})}download(e,t){return U(this,void 0,void 0,function*(){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),o=n?`?${n}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield Ue(this.fetch,`${this.url}/${r}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(C(a))return{data:null,error:a};throw a}})}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],n=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";n!==""&&r.push(n);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});l!==""&&r.push(l);let c=r.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${s}${c}`)}}}remove(e){return U(this,void 0,void 0,function*(){try{return{data:yield Ct(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}list(e,t,s){return U(this,void 0,void 0,function*(){try{const r=Object.assign(Object.assign(Object.assign({},Gs),t),{prefix:e||""});return{data:yield H(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(r){if(C(r))return{data:null,error:r};throw r}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const Vs="2.5.4",Ws={"X-Client-Info":`storage-js/${Vs}`};var ee=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};class Xs{constructor(e,t={},s){this.url=e,this.headers=Object.assign(Object.assign({},Ws),t),this.fetch=Pt(s)}listBuckets(){return ee(this,void 0,void 0,function*(){try{return{data:yield Ue(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(C(e))return{data:null,error:e};throw e}})}getBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield Ue(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return ee(this,void 0,void 0,function*(){try{return{data:yield H(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}updateBucket(e,t){return ee(this,void 0,void 0,function*(){try{return{data:yield Hs(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}emptyBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield H(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}deleteBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield Ct(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}}class Qs extends Xs{constructor(e,t={},s){super(e,t,s)}from(e){return new Ks(this.url,this.headers,e,this.fetch)}}const Ys="2.38.2";let ce="";typeof Deno<"u"?ce="deno":typeof document<"u"?ce="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ce="react-native":ce="node";const Zs={"X-Client-Info":`supabase-js-${ce}/${Ys}`};var er=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const tr=i=>{let e;return i?e=i:typeof fetch>"u"?e=Me:e=fetch,(...t)=>e(...t)},sr=()=>typeof Headers>"u"?qe.Headers:Headers,rr=(i,e,t)=>{const s=tr(t),r=sr();return(n,o)=>er(void 0,void 0,void 0,function*(){var a;const l=(a=yield e())!==null&&a!==void 0?a:i;let c=new r(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",i),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),s(n,Object.assign(Object.assign({},o),{headers:c}))})};function ir(i){return i.replace(/\/$/,"")}function nr(i,e){const{db:t,auth:s,realtime:r,global:n}=i,{db:o,auth:a,realtime:l,global:c}=e;return{db:Object.assign(Object.assign({},o),t),auth:Object.assign(Object.assign({},a),s),realtime:Object.assign(Object.assign({},l),r),global:Object.assign(Object.assign({},c),n)}}function or(i){return Math.round(Date.now()/1e3)+i}function ar(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i=="x"?e:e&3|8).toString(16)})}const J=()=>typeof document<"u",V={tested:!1,writable:!1},ge=()=>{if(!J())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(V.tested)return V.writable;const i=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(i,i),globalThis.localStorage.removeItem(i),V.tested=!0,V.writable=!0}catch{V.tested=!0,V.writable=!1}return V.writable};function Ce(i){const e={},t=new URL(i);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((r,n)=>{e[n]=r})}catch{}return t.searchParams.forEach((s,r)=>{e[r]=s}),e}const xt=i=>{let e;return i?e=i:typeof fetch>"u"?e=(...t)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},lr=i=>typeof i=="object"&&i!==null&&"status"in i&&"ok"in i&&"json"in i&&typeof i.json=="function",W=async(i,e,t)=>{await i.setItem(e,JSON.stringify(t))},we=async(i,e)=>{const t=await i.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},xe=async(i,e)=>{await i.removeItem(e)};function cr(i){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",s,r,n,o,a,l,c,h=0;for(i=i.replace("-","+").replace("_","/");h>4,r=(a&15)<<4|l>>2,n=(l&3)<<6|c,t=t+String.fromCharCode(s),l!=64&&r!=0&&(t=t+String.fromCharCode(r)),c!=64&&n!=0&&(t=t+String.fromCharCode(n));return t}class Ee{constructor(){this.promise=new Ee.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Ee.promiseConstructor=Promise;function ot(i){const e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,t=i.split(".");if(t.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=t[1];return JSON.parse(cr(s))}async function hr(i){return await new Promise(e=>{setTimeout(()=>e(null),i)})}function ur(i,e){return new Promise((s,r)=>{(async()=>{for(let n=0;n<1/0;n++)try{const o=await i(n);if(!e(n,null,o)){s(o);return}}catch(o){if(!e(n,o)){r(o);return}}})()})}function dr(i){return("0"+i.toString(16)).substr(-2)}function te(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=t.length;let r="";for(let n=0;n<56;n++)r+=t.charAt(Math.floor(Math.random()*s));return r}return crypto.getRandomValues(e),Array.from(e,dr).join("")}async function fr(i){const t=new TextEncoder().encode(i),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map(n=>String.fromCharCode(n)).join("")}function gr(i){return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function se(i){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),i;const t=await fr(i);return gr(t)}class He extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function b(i){return typeof i=="object"&&i!==null&&"__isAuthError"in i}class pr extends He{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}function _r(i){return b(i)&&i.name==="AuthApiError"}class Rt extends He{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class ae extends He{constructor(e,t,s){super(e),this.name=t,this.status=s}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class re extends ae{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class Re extends ae{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class ke extends ae{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class Se extends ae{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class at extends ae{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Ne extends ae{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function lt(i){return b(i)&&i.name==="AuthRetryableFetchError"}var mr=globalThis&&globalThis.__rest||function(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(i);ri.msg||i.message||i.error_description||i.error||JSON.stringify(i),vr=[502,503,504];async function ct(i){if(!lr(i))throw new Ne(he(i),0);if(vr.includes(i.status))throw new Ne(he(i),i.status);let e;try{e=await i.json()}catch(t){throw new Rt(he(t),t)}throw new pr(he(e),i.status||500)}const yr=(i,e,t,s)=>{const r={method:i,headers:(e==null?void 0:e.headers)||{}};return i==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};async function w(i,e,t,s){var r;const n=Object.assign({},s==null?void 0:s.headers);s!=null&&s.jwt&&(n.Authorization=`Bearer ${s.jwt}`);const o=(r=s==null?void 0:s.query)!==null&&r!==void 0?r:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await br(i,e,t+a,{headers:n,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(l):{data:Object.assign({},l),error:null}}async function br(i,e,t,s,r,n){const o=yr(e,s,r,n);let a;try{a=await i(t,o)}catch(l){throw console.error(l),new Ne(he(l),0)}if(a.ok||await ct(a),s!=null&&s.noResolveJson)return a;try{return await a.json()}catch(l){await ct(l)}}function z(i){var e;let t=null;Tr(i)&&(t=Object.assign({},i),i.expires_at||(t.expires_at=or(i.expires_in)));const s=(e=i.user)!==null&&e!==void 0?e:i;return{data:{session:t,user:s},error:null}}function G(i){var e;return{data:{user:(e=i.user)!==null&&e!==void 0?e:i},error:null}}function wr(i){return{data:i,error:null}}function kr(i){const{action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:n}=i,o=mr(i,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:n},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function Sr(i){return i}function Tr(i){return i.access_token&&i.refresh_token&&i.expires_in}var Or=globalThis&&globalThis.__rest||function(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(i);r0&&(f.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(g.split(";")[1].split("=")[1]);c[`${_}Page`]=p}),c.total=parseInt(u)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(b(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await w(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:G})}catch(t){if(b(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await w(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:G})}catch(s){if(b(s))return{data:{user:null},error:s};throw s}}async deleteUser(e,t=!1){try{return await w(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:G})}catch(s){if(b(s))return{data:{user:null},error:s};throw s}}async _listFactors(e){try{const{data:t,error:s}=await w(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:r=>({data:{factors:r},error:null})});return{data:t,error:s}}catch(t){if(b(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await w(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}}}const At="2.57.0",$r="http://localhost:9999",jr="supabase.auth.token",Pr={"X-Client-Info":`gotrue-js/${At}`},ht=10,Cr={getItem:i=>ge()?globalThis.localStorage.getItem(i):null,setItem:(i,e)=>{ge()&&globalThis.localStorage.setItem(i,e)},removeItem:i=>{ge()&&globalThis.localStorage.removeItem(i)}};function ut(i={}){return{getItem:e=>i[e]||null,setItem:(e,t)=>{i[e]=t},removeItem:e=>{delete i[e]}}}function xr(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}globalThis&&ge()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class Rr extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}xr();const Ar={url:$r,storageKey:jr,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Pr,flowType:"implicit",debug:!1},le=30*1e3,dt=3;async function Ir(i,e,t){return await t()}class _e{constructor(e){var t;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=_e.nextInstanceID,_e.nextInstanceID+=1,this.instanceID>0&&J()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const s=Object.assign(Object.assign({},Ar),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new Er({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=xt(s.fetch),this.lock=s.lock||Ir,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?s.storage?this.storage=s.storage:ge()?this.storage=Cr:(this.memoryStorage={},this.storage=ut(this.memoryStorage)):(this.memoryStorage={},this.storage=ut(this.memoryStorage)),J()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(r){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",r)}(t=this.broadcastChannel)===null||t===void 0||t.addEventListener("message",async r=>{this._debug("received broadcast notification from other tab or client",r),await this._notifyAllSubscribers(r.data.event,r.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${At}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{const e=J()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:t,error:s}=await this._getSessionFromURL(e);if(s)return this._debug("#_initialize()","error detecting session from URL",s),await this._removeSession(),{error:s};const{session:r,redirectType:n}=t;return this._debug("#_initialize()","detected session in URL",r,"redirect type",n),await this._saveSession(r),setTimeout(async()=>{n==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",r):await this._notifyAllSubscribers("SIGNED_IN",r)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return b(e)?{error:e}:{error:new Rt("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(e){var t,s,r;try{await this._removeSession();let n;if("email"in e){const{email:h,password:d,options:u}=e;let f=null,g=null;if(this.flowType==="pkce"){const p=te();await W(this.storage,`${this.storageKey}-code-verifier`,p),f=await se(p),g=p===f?"plain":"s256"}n=await w(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:u==null?void 0:u.emailRedirectTo,body:{email:h,password:d,data:(t=u==null?void 0:u.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:f,code_challenge_method:g},xform:z})}else if("phone"in e){const{phone:h,password:d,options:u}=e;n=await w(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:d,data:(s=u==null?void 0:u.data)!==null&&s!==void 0?s:{},channel:(r=u==null?void 0:u.channel)!==null&&r!==void 0?r:"sms",gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:z})}else throw new ke("You must provide either an email or phone number and a password");const{data:o,error:a}=n;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(n){if(b(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithPassword(e){try{await this._removeSession();let t;if("email"in e){const{email:n,password:o,options:a}=e;t=await w(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:z})}else if("phone"in e){const{phone:n,password:o,options:a}=e;t=await w(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:z})}else throw new ke("You must provide either an email or phone number and a password");const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new Re}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:{user:s.user,session:s.session},error:r})}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,s,r,n;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(r=e.options)===null||r===void 0?void 0:r.queryParams,skipBrowserRedirect:(n=e.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const t=await we(this.storage,`${this.storageKey}-code-verifier`),{data:s,error:r}=await w(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:z});return await xe(this.storage,`${this.storageKey}-code-verifier`),r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new Re}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:s,error:r})}async signInWithIdToken(e){await this._removeSession();try{const{options:t,provider:s,token:r,access_token:n,nonce:o}=e,a=await w(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:n,nonce:o,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:z}),{data:l,error:c}=a;return c?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Re}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,s,r,n,o;try{if(await this._removeSession(),"email"in e){const{email:a,options:l}=e;let c=null,h=null;if(this.flowType==="pkce"){const u=te();await W(this.storage,`${this.storageKey}-code-verifier`,u),c=await se(u),h=u===c?"plain":"s256"}const{error:d}=await w(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=l==null?void 0:l.data)!==null&&t!==void 0?t:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:h},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in e){const{phone:a,options:l}=e,{data:c,error:h}=await w(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:h}}throw new ke("You must provide either an email or phone number.")}catch(a){if(b(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,s;try{e.type!=="email_change"&&e.type!=="phone_change"&&await this._removeSession();let r,n;"options"in e&&(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo,n=(s=e.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:a}=await w(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:r,xform:z});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(r){if(b(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithSSO(e){var t,s,r;try{await this._removeSession();let n=null,o=null;if(this.flowType==="pkce"){const a=te();await W(this.storage,`${this.storageKey}-code-verifier`,a),n=await se(a),o=a===n?"plain":"s256"}return await w(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&s!==void 0?s:void 0}),!((r=e==null?void 0:e.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:o}),headers:this.headers,xform:wr})}catch(n){if(b(n))return{data:null,error:n};throw n}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:s}=e;if(s)throw s;if(!t)throw new re;const{error:r}=await w(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}})}catch(e){if(b(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{e.type!="email_change"&&e.type!="phone_change"&&await this._removeSession();const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:n}=e,{error:o}=await w(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},redirectTo:n==null?void 0:n.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:s,type:r,options:n}=e,{data:o,error:a}=await w(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new ke("You must provide either an email or phone number and a type")}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await s,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch{}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=t();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const r=[...this.pendingInLock];await Promise.all(r),this.pendingInLock.splice(0,r.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await we(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const s=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s)return{data:{session:e},error:null};const{session:r,error:n}=await this._callRefreshToken(e.refresh_token);return n?{data:{session:null},error:n}:{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await w(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:G}):await this._useSession(async t=>{var s,r;const{data:n,error:o}=t;if(o)throw o;return await w(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(r=(s=n.session)===null||s===void 0?void 0:s.access_token)!==null&&r!==void 0?r:void 0,xform:G})})}catch(t){if(b(t))return{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async s=>{const{data:r,error:n}=s;if(n)throw n;if(!r.session)throw new re;const o=r.session;let a=null,l=null;if(this.flowType==="pkce"&&e.email!=null){const d=te();await W(this.storage,`${this.storageKey}-code-verifier`,d),a=await se(d),l=d===a?"plain":"s256"}const{data:c,error:h}=await w(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:G});if(h)throw h;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(b(s))return{data:{user:null},error:s};throw s}}_decodeJWT(e){return ot(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new re;const t=Date.now()/1e3;let s=t,r=!0,n=null;const o=ot(e.access_token);if(o.exp&&(s=o.exp,r=s<=t),r){const{session:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!a)return{data:{user:null,session:null},error:null};n=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)throw l;n={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:s-t,expires_at:s},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return{data:{user:n.user,session:n},error:null}}catch(t){if(b(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var s;if(!e){const{data:o,error:a}=t;if(a)throw a;e=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(e!=null&&e.refresh_token))throw new re;const{session:r,error:n}=await this._callRefreshToken(e.refresh_token);return n?{data:{user:null,session:null},error:n}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e){try{if(!J())throw new Se("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Se("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new at("Not a valid PKCE flow url.");const t=Ce(window.location.href);if(e){if(!t.code)throw new at("No code detected.");const{data:k,error:E}=await this._exchangeCodeForSession(t.code);if(E)throw E;const v=new URL(window.location.href);return v.searchParams.delete("code"),window.history.replaceState(window.history.state,"",v.toString()),{data:{session:k.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new Se(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});const{provider_token:s,provider_refresh_token:r,access_token:n,refresh_token:o,expires_in:a,expires_at:l,token_type:c}=t;if(!n||!a||!o||!c)throw new Se("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(a);let u=h+d;l&&(u=parseInt(l));const f=u-h;f*1e3<=le&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${d}s`);const g=u-d;h-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,u,h):h-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",g,u,h);const{data:p,error:_}=await this._getUser(n);if(_)throw _;const S={provider_token:s,provider_refresh_token:r,access_token:n,expires_in:d,expires_at:u,refresh_token:o,token_type:c,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:S,redirectType:t.type},error:null}}catch(t){if(b(t))return{data:{session:null,redirectType:null},error:t};throw t}}_isImplicitGrantFlow(){const e=Ce(window.location.href);return!!(J()&&(e.access_token||e.error_description))}async _isPKCEFlow(){const e=Ce(window.location.href),t=await we(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var s;const{data:r,error:n}=t;if(n)return{error:n};const o=(s=r.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(_r(a)&&(a.status===404||a.status===401)))return{error:a}}return e!=="others"&&(await this._removeSession(),await xe(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){const t=ar(),s={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession(async t=>{var s,r;try{const{data:{session:n},error:o}=t;if(o)throw o;await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(n){await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",n),console.error(n)}})}async resetPasswordForEmail(e,t={}){let s=null,r=null;if(this.flowType==="pkce"){const n=te();await W(this.storage,`${this.storageKey}-code-verifier`,n),s=await se(n),r=n===s?"plain":"s256"}try{return await w(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(n){if(b(n))return{data:null,error:n};throw n}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await ur(async r=>(await hr(r*200),this._debug(t,"refreshing attempt",r),await w(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:z})),(r,n,o)=>o&&o.error&<(o.error)&&Date.now()+(r+1)*200-s{try{await a.callback(e,t)}catch(l){n.push(l)}});if(await Promise.all(o),n.length>0){for(let a=0;athis._autoRefreshTokenTick(),le);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:s}}=t;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const r=Math.floor((s.expires_at*1e3-e)/le);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${le}ms, refresh threshold is ${dt} ticks`),r<=dt&&await this._callRefreshToken(s.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Rr)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!J()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t){const s=[`provider=${encodeURIComponent(e)}`];if(t!=null&&t.redirectTo&&s.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),t!=null&&t.scopes&&s.push(`scopes=${encodeURIComponent(t.scopes)}`),this.flowType==="pkce"){const r=te();await W(this.storage,`${this.storageKey}-code-verifier`,r);const n=await se(r),o=r===n?"plain":"s256";this._debug("PKCE","code verifier",`${r.substring(0,5)}...`,"code challenge",n,"method",o);const a=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(t!=null&&t.queryParams){const r=new URLSearchParams(t.queryParams);s.push(r.toString())}return`${this.url}/authorize?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var s;const{data:r,error:n}=t;return n?{data:null,error:n}:await w(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(b(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var s,r;const{data:n,error:o}=t;if(o)return{data:null,error:o};const{data:a,error:l}=await w(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:(s=n==null?void 0:n.session)===null||s===void 0?void 0:s.access_token});return l?{data:null,error:l}:(!((r=a==null?void 0:a.totp)===null||r===void 0)&&r.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),{data:a,error:null})})}catch(t){if(b(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var s;const{data:r,error:n}=t;if(n)return{data:null,error:n};const{data:o,error:a}=await w(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(b(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var s;const{data:r,error:n}=t;return n?{data:null,error:n}:await w(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(b(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){const{data:t,error:s}=await this._challenge({factorId:e.factorId});return s?{data:null,error:s}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const s=(e==null?void 0:e.factors)||[],r=s.filter(n=>n.factor_type==="totp"&&n.status==="verified");return{data:{all:s,totp:r},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,s;const{data:{session:r},error:n}=e;if(n)return{data:null,error:n};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const o=this._decodeJWT(r.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((s=(t=r.user.factors)===null||t===void 0?void 0:t.filter(d=>d.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(l="aal2");const h=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:h},error:null}}))}}_e.nextInstanceID=0;class Lr extends _e{constructor(e){super(e)}}var Dr=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Ur={headers:Zs},Nr={schema:"public"},Fr={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qr={};class Mr{constructor(e,t,s){var r,n,o,a,l,c,h,d;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const u=ir(e);this.realtimeUrl=`${u}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${u}/auth/v1`,this.storageUrl=`${u}/storage/v1`,this.functionsUrl=`${u}/functions/v1`;const f=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,g={db:Nr,realtime:qr,auth:Object.assign(Object.assign({},Fr),{storageKey:f}),global:Ur},p=nr(s??{},g);this.storageKey=(n=(r=p.auth)===null||r===void 0?void 0:r.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=(o=p.global)===null||o===void 0?void 0:o.headers)!==null&&a!==void 0?a:{},this.auth=this._initSupabaseAuthClient((l=p.auth)!==null&&l!==void 0?l:{},this.headers,(c=p.global)===null||c===void 0?void 0:c.fetch),this.fetch=rr(t,this._getAccessToken.bind(this),(h=p.global)===null||h===void 0?void 0:h.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},p.realtime)),this.rest=new Je(`${u}/rest/v1`,{headers:this.headers,schema:(d=p.db)===null||d===void 0?void 0:d.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new Yt(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Qs(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},s){return this.rest.rpc(e,t,s)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return Dr(this,void 0,void 0,function*(){const{data:s}=yield this.auth.getSession();return(t=(e=s.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,storageKey:n,flowType:o,debug:a},l,c){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Lr({url:this.authUrl,headers:Object.assign(Object.assign({},h),l),storageKey:n,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,flowType:o,debug:a,fetch:c})}_initRealtimeClient(e){return new Fs(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,s)=>{this._handleTokenChanged(t,"CLIENT",s==null?void 0:s.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?(this.realtime.setAuth(s??null),this.changedAccessToken=s):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Jr=(i,e,t)=>new Mr(i,e,t);function ft(i,e,t){const s=i.slice();return s[13]=e[t],s[15]=t,s}function gt(i,e,t){const s=i.slice();return s[16]=e[t].day,s[17]=e[t].month,s[18]=e[t].date,s}function pt(i,e,t){const s=i.slice();return s[22]=e[t],s[15]=t,s}function Br(i){return{c:N,l:N,m:N,p:N,d:N}}function zr(i){let e,t=i[12].data&&Hr(i);return{c(){t&&t.c(),e=K()},l(s){t&&t.l(s),e=K()},m(s,r){t&&t.m(s,r),P(s,e,r)},p(s,r){s[12].data&&t.p(s,r)},d(s){s&&O(e),t&&t.d(s)}}}function Hr(i){let e=[],t=new Map,s,r=ne(i[2]);const n=o=>o[15];for(let o=0;oo[15];for(let o=0;oe,k.anchor=null},p(E,v){i=E,kt(k,i,v)},d(E){E&&O(e),k.block.d(),k.token=null,k=null}}}function vt(i,e){let t,s,r=ne(e[13]),n=[];for(let o=0;o

    Schedule

    Please enter your name and select sessions.
    +import{j as It,k as Lt,l as be,m as Dt,r as bt,s as Ut,o as Nt,n as N}from"../chunks/scheduler.9d2a5e30.js";import{p as Ft,t as Ae,b as qt,d as Te,S as Mt,i as Jt,r as Ge,s as q,g as A,m as X,u as Ke,c as M,h as I,z as ue,j as B,f as O,n as Q,k as x,v as Ve,a as P,x as j,y as We,w as Xe,e as K,A as Bt}from"../chunks/index.0b718437.js";import{H as zt,F as Ht}from"../chunks/Footer.093d42c6.js";import{_ as me}from"../chunks/preload-helper.a4192956.js";function Gt(i,e){for(var t=0;ts[r]})}}}return Object.freeze(Object.defineProperty(i,Symbol.toStringTag,{value:"Module"}))}function wt(i,e){const t=e.token={};function s(r,n,o,a){if(e.token!==t)return;e.resolved=a;let l=e.ctx;o!==void 0&&(l=l.slice(),l[o]=a);const c=r&&(e.current=r)(l);let h=!1;e.block&&(e.blocks?e.blocks.forEach((d,u)=>{u!==n&&d&&(Ft(),Ae(d,1,1,()=>{e.blocks[u]===d&&(e.blocks[u]=null)}),qt())}):e.block.d(1),c.c(),Te(c,1),c.m(e.mount(),e.anchor),h=!0),e.block=c,e.blocks&&(e.blocks[n]=c),h&&Dt()}if(It(i)){const r=Lt();if(i.then(n=>{be(r),s(e.then,1,e.value,n),be(null)},n=>{if(be(r),s(e.catch,2,e.error,n),be(null),!e.hasCatch)throw n}),e.current!==e.pending)return s(e.pending,0),!0}else{if(e.current!==e.then)return s(e.then,1,e.value,i),!0;e.resolved=i}}function kt(i,e,t){const s=e.slice(),{resolved:r}=i;i.current===i.then&&(s[i.value]=r),i.current===i.catch&&(s[i.error]=r),i.block.p(s,t)}function ne(i){return(i==null?void 0:i.length)!==void 0?i:Array.from(i)}function St(i,e){i.d(1),e.delete(i.key)}function Tt(i,e,t,s,r,n,o,a,l,c,h,d){let u=i.length,f=n.length,g=u;const p={};for(;g--;)p[i[g].key]=g;const _=[],S=new Map,k=new Map,E=[];for(g=f;g--;){const y=d(r,n,g),R=t(y);let L=o.get(R);L?s&&E.push(()=>L.p(y,e)):(L=c(R,y),L.c()),S.set(R,_[g]=L),R in p&&k.set(R,Math.abs(g-p[R]))}const v=new Set,$=new Set;function m(y){Te(y,1),y.m(a,h),o.set(y.key,y),h=y.first,f--}for(;u&&f;){const y=_[f-1],R=i[u-1],L=y.key,ye=R.key;y===R?(h=y.first,u--,f--):S.has(ye)?!o.has(L)||v.has(L)?m(y):$.has(ye)?u--:k.get(L)>k.get(ye)?($.add(L),m(y)):(v.add(ye),u--):(l(R,o),u--)}for(;u--;){const y=i[u];S.has(y.key)||l(y,o)}for(;f;)m(_[f-1]);return bt(E),_}const Kt=i=>{let e;return i?e=i:typeof fetch>"u"?e=(...t)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)};class Fe extends Error{constructor(e,t="FunctionsError",s){super(e),this.name=t,this.context=s}}class Vt extends Fe{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class Wt extends Fe{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class Xt extends Fe{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}var Qt=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};class Yt{constructor(e,{headers:t={},customFetch:s}={}){this.url=e,this.headers=t,this.fetch=Kt(s)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var s;return Qt(this,void 0,void 0,function*(){try{const{headers:r,method:n,body:o}=t;let a={},l;o&&(r&&!Object.prototype.hasOwnProperty.call(r,"Content-Type")||!r)&&(typeof Blob<"u"&&o instanceof Blob||o instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",l=o):typeof o=="string"?(a["Content-Type"]="text/plain",l=o):typeof FormData<"u"&&o instanceof FormData?l=o:(a["Content-Type"]="application/json",l=JSON.stringify(o)));const c=yield this.fetch(`${this.url}/${e}`,{method:n||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),r),body:l}).catch(f=>{throw new Vt(f)}),h=c.headers.get("x-relay-error");if(h&&h==="true")throw new Wt(c);if(!c.ok)throw new Xt(c);let d=((s=c.headers.get("Content-Type"))!==null&&s!==void 0?s:"text/plain").split(";")[0].trim(),u;return d==="application/json"?u=yield c.json():d==="application/octet-stream"?u=yield c.blob():d==="multipart/form-data"?u=yield c.formData():u=yield c.text(),{data:u,error:null}}catch(r){return{data:null,error:r}}})}}var Qe=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Zt(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var Ie={exports:{}};(function(i,e){var t=function(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof Qe<"u")return Qe;throw new Error("unable to locate global object")},s=t();i.exports=e=s.fetch,s.fetch&&(e.default=s.fetch.bind(s)),e.Headers=s.Headers,e.Request=s.Request,e.Response=s.Response})(Ie,Ie.exports);var qe=Ie.exports;const Me=Zt(qe),ve=Gt({__proto__:null,default:Me},[qe]);class es{constructor(e){this.shouldThrowOnError=!1,this.method=e.method,this.url=e.url,this.headers=e.headers,this.schema=e.schema,this.body=e.body,this.shouldThrowOnError=e.shouldThrowOnError,this.signal=e.signal,this.isMaybeSingle=e.isMaybeSingle,e.fetch?this.fetch=e.fetch:typeof fetch>"u"?this.fetch=Me:this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){this.schema===void 0||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),this.method!=="GET"&&this.method!=="HEAD"&&(this.headers["Content-Type"]="application/json");const s=this.fetch;let r=s(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async n=>{var o,a,l;let c=null,h=null,d=null,u=n.status,f=n.statusText;if(n.ok){if(this.method!=="HEAD"){const S=await n.text();S===""||(this.headers.Accept==="text/csv"||this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?h=S:h=JSON.parse(S))}const p=(o=this.headers.Prefer)===null||o===void 0?void 0:o.match(/count=(exact|planned|estimated)/),_=(a=n.headers.get("content-range"))===null||a===void 0?void 0:a.split("/");p&&_&&_.length>1&&(d=parseInt(_[1])),this.isMaybeSingle&&this.method==="GET"&&Array.isArray(h)&&(h.length>1?(c={code:"PGRST116",details:`Results contain ${h.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},h=null,d=null,u=406,f="Not Acceptable"):h.length===1?h=h[0]:h=null)}else{const p=await n.text();try{c=JSON.parse(p),Array.isArray(c)&&n.status===404&&(h=[],c=null,u=200,f="OK")}catch{n.status===404&&p===""?(u=204,f="No Content"):c={message:p}}if(c&&this.isMaybeSingle&&(!((l=c==null?void 0:c.details)===null||l===void 0)&&l.includes("0 rows"))&&(c=null,u=200,f="OK"),c&&this.shouldThrowOnError)throw c}return{error:c,data:h,count:d,status:u,statusText:f}});return this.shouldThrowOnError||(r=r.catch(n=>{var o,a,l;return{error:{message:`${(o=n==null?void 0:n.name)!==null&&o!==void 0?o:"FetchError"}: ${n==null?void 0:n.message}`,details:`${(a=n==null?void 0:n.stack)!==null&&a!==void 0?a:""}`,hint:"",code:`${(l=n==null?void 0:n.code)!==null&&l!==void 0?l:""}`},data:null,count:null,status:0,statusText:""}})),r.then(e,t)}}class ts extends es{select(e){let t=!1;const s=(e??"*").split("").map(r=>/\s/.test(r)&&!t?"":(r==='"'&&(t=!t),r)).join("");return this.url.searchParams.set("select",s),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:s,foreignTable:r}={}){const n=r?`${r}.order`:"order",o=this.url.searchParams.get(n);return this.url.searchParams.set(n,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${s===void 0?"":s?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){const s=typeof t>"u"?"limit":`${t}.limit`;return this.url.searchParams.set(s,`${e}`),this}range(e,t,{foreignTable:s}={}){const r=typeof s>"u"?"offset":`${s}.offset`,n=typeof s>"u"?"limit":`${s}.limit`;return this.url.searchParams.set(r,`${e}`),this.url.searchParams.set(n,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return this.method==="GET"?this.headers.Accept="application/json":this.headers.Accept="application/vnd.pgrst.object+json",this.isMaybeSingle=!0,this}csv(){return this.headers.Accept="text/csv",this}geojson(){return this.headers.Accept="application/geo+json",this}explain({analyze:e=!1,verbose:t=!1,settings:s=!1,buffers:r=!1,wal:n=!1,format:o="text"}={}){const a=[e?"analyze":null,t?"verbose":null,s?"settings":null,r?"buffers":null,n?"wal":null].filter(Boolean).join("|"),l=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${l}"; options=${a};`,o==="json"?this:this}rollback(){var e;return((e=this.headers.Prefer)!==null&&e!==void 0?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class ie extends ts{eq(e,t){return this.url.searchParams.append(e,`eq.${t}`),this}neq(e,t){return this.url.searchParams.append(e,`neq.${t}`),this}gt(e,t){return this.url.searchParams.append(e,`gt.${t}`),this}gte(e,t){return this.url.searchParams.append(e,`gte.${t}`),this}lt(e,t){return this.url.searchParams.append(e,`lt.${t}`),this}lte(e,t){return this.url.searchParams.append(e,`lte.${t}`),this}like(e,t){return this.url.searchParams.append(e,`like.${t}`),this}likeAllOf(e,t){return this.url.searchParams.append(e,`like(all).{${t.join(",")}}`),this}likeAnyOf(e,t){return this.url.searchParams.append(e,`like(any).{${t.join(",")}}`),this}ilike(e,t){return this.url.searchParams.append(e,`ilike.${t}`),this}ilikeAllOf(e,t){return this.url.searchParams.append(e,`ilike(all).{${t.join(",")}}`),this}ilikeAnyOf(e,t){return this.url.searchParams.append(e,`ilike(any).{${t.join(",")}}`),this}is(e,t){return this.url.searchParams.append(e,`is.${t}`),this}in(e,t){const s=t.map(r=>typeof r=="string"&&new RegExp("[,()]").test(r)?`"${r}"`:`${r}`).join(",");return this.url.searchParams.append(e,`in.(${s})`),this}contains(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cs.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cs.{${t.join(",")}}`):this.url.searchParams.append(e,`cs.${JSON.stringify(t)}`),this}containedBy(e,t){return typeof t=="string"?this.url.searchParams.append(e,`cd.${t}`):Array.isArray(t)?this.url.searchParams.append(e,`cd.{${t.join(",")}}`):this.url.searchParams.append(e,`cd.${JSON.stringify(t)}`),this}rangeGt(e,t){return this.url.searchParams.append(e,`sr.${t}`),this}rangeGte(e,t){return this.url.searchParams.append(e,`nxl.${t}`),this}rangeLt(e,t){return this.url.searchParams.append(e,`sl.${t}`),this}rangeLte(e,t){return this.url.searchParams.append(e,`nxr.${t}`),this}rangeAdjacent(e,t){return this.url.searchParams.append(e,`adj.${t}`),this}overlaps(e,t){return typeof t=="string"?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:s,type:r}={}){let n="";r==="plain"?n="pl":r==="phrase"?n="ph":r==="websearch"&&(n="w");const o=s===void 0?"":`(${s})`;return this.url.searchParams.append(e,`${n}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([t,s])=>{this.url.searchParams.append(t,`eq.${s}`)}),this}not(e,t,s){return this.url.searchParams.append(e,`not.${t}.${s}`),this}or(e,{foreignTable:t}={}){const s=t?`${t}.or`:"or";return this.url.searchParams.append(s,`(${e})`),this}filter(e,t,s){return this.url.searchParams.append(e,`${t}.${s}`),this}}class ss{constructor(e,{headers:t={},schema:s,fetch:r}){this.url=e,this.headers=t,this.schema=s,this.fetch=r}select(e,{head:t=!1,count:s}={}){const r=t?"HEAD":"GET";let n=!1;const o=(e??"*").split("").map(a=>/\s/.test(a)&&!n?"":(a==='"'&&(n=!n),a)).join("");return this.url.searchParams.set("select",o),s&&(this.headers.Prefer=`count=${s}`),new ie({method:r,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:s=!0}={}){const r="POST",n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),t&&n.push(`count=${t}`),s||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(e)){const o=e.reduce((a,l)=>a.concat(Object.keys(l)),[]);if(o.length>0){const a=[...new Set(o)].map(l=>`"${l}"`);this.url.searchParams.set("columns",a.join(","))}}return new ie({method:r,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:s=!1,count:r,defaultToNull:n=!0}={}){const o="POST",a=[`resolution=${s?"ignore":"merge"}-duplicates`];if(t!==void 0&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&a.push(this.headers.Prefer),r&&a.push(`count=${r}`),n||a.push("missing=default"),this.headers.Prefer=a.join(","),Array.isArray(e)){const l=e.reduce((c,h)=>c.concat(Object.keys(h)),[]);if(l.length>0){const c=[...new Set(l)].map(h=>`"${h}"`);this.url.searchParams.set("columns",c.join(","))}}return new ie({method:o,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){const s="PATCH",r=[];return this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),this.headers.Prefer=r.join(","),new ie({method:s,url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){const t="DELETE",s=[];return e&&s.push(`count=${e}`),this.headers.Prefer&&s.unshift(this.headers.Prefer),this.headers.Prefer=s.join(","),new ie({method:t,url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}const rs="1.8.5",is={"X-Client-Info":`postgrest-js/${rs}`};class Je{constructor(e,{headers:t={},schema:s,fetch:r}={}){this.url=e,this.headers=Object.assign(Object.assign({},is),t),this.schemaName=s,this.fetch=r}from(e){const t=new URL(`${this.url}/${e}`);return new ss(t,{headers:Object.assign({},this.headers),schema:this.schemaName,fetch:this.fetch})}schema(e){return new Je(this.url,{headers:this.headers,schema:e,fetch:this.fetch})}rpc(e,t={},{head:s=!1,count:r}={}){let n;const o=new URL(`${this.url}/rpc/${e}`);let a;s?(n="HEAD",Object.entries(t).forEach(([c,h])=>{o.searchParams.append(c,`${h}`)})):(n="POST",a=t);const l=Object.assign({},this.headers);return r&&(l.Prefer=`count=${r}`),new ie({method:n,url:o,headers:l,schema:this.schemaName,body:a,fetch:this.fetch,allowEmpty:!1})}}var $e,Ye;function ns(){if(Ye)return $e;Ye=1;var i=function(){if(typeof self=="object"&&self)return self;if(typeof window=="object"&&window)return window;throw new Error("Unable to resolve global `this`")};return $e=function(){if(this)return this;if(typeof globalThis=="object"&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch{return i()}try{return __global__||i()}finally{delete Object.prototype.__global__}}(),$e}const os="websocket",as="Websocket Client & Server Library implementing the WebSocket protocol as specified in RFC 6455.",ls=["websocket","websockets","socket","networking","comet","push","RFC-6455","realtime","server","client"],cs="Brian McKelvey (https://github.com/theturtle32)",hs=["Iñaki Baz Castillo (http://dev.sipdoc.net)"],us="1.0.34",ds={type:"git",url:"https://github.com/theturtle32/WebSocket-Node.git"},fs="https://github.com/theturtle32/WebSocket-Node",gs={node:">=4.0.0"},ps={bufferutil:"^4.0.1",debug:"^2.2.0","es5-ext":"^0.10.50","typedarray-to-buffer":"^3.1.5","utf-8-validate":"^5.0.2",yaeti:"^0.0.6"},_s={"buffer-equal":"^1.0.0",gulp:"^4.0.2","gulp-jshint":"^2.0.4","jshint-stylish":"^2.2.1",jshint:"^2.0.0",tape:"^4.9.1"},ms={verbose:!1},vs={test:"tape test/unit/*.js",gulp:"gulp"},ys="index",bs={lib:"./lib"},ws="lib/browser.js",ks="Apache-2.0",Ss={name:os,description:as,keywords:ls,author:cs,contributors:hs,version:us,repository:ds,homepage:fs,engines:gs,dependencies:ps,devDependencies:_s,config:ms,scripts:vs,main:ys,directories:bs,browser:ws,license:ks};var Ts=Ss.version,Y;if(typeof globalThis=="object")Y=globalThis;else try{Y=ns()}catch{}finally{if(!Y&&typeof window<"u"&&(Y=window),!Y)throw new Error("Could not determine global this")}var pe=Y.WebSocket||Y.MozWebSocket,Os=Ts;function Ot(i,e){var t;return e?t=new pe(i,e):t=new pe(i),t}pe&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(i){Object.defineProperty(Ot,i,{get:function(){return pe[i]}})});var Es={w3cwebsocket:pe?Ot:null,version:Os};const $s="2.8.1",js={"X-Client-Info":`realtime-js/${$s}`},Ps="1.0.0",Et=1e4,Cs=1e3;var de;(function(i){i[i.connecting=0]="connecting",i[i.open=1]="open",i[i.closing=2]="closing",i[i.closed=3]="closed"})(de||(de={}));var D;(function(i){i.closed="closed",i.errored="errored",i.joined="joined",i.joining="joining",i.leaving="leaving"})(D||(D={}));var F;(function(i){i.close="phx_close",i.error="phx_error",i.join="phx_join",i.reply="phx_reply",i.leave="phx_leave",i.access_token="access_token"})(F||(F={}));var Le;(function(i){i.websocket="websocket"})(Le||(Le={}));var Z;(function(i){i.Connecting="connecting",i.Open="open",i.Closing="closing",i.Closed="closed"})(Z||(Z={}));class $t{constructor(e,t){this.callback=e,this.timerCalc=t,this.timer=void 0,this.tries=0,this.callback=e,this.timerCalc=t}reset(){this.tries=0,clearTimeout(this.timer)}scheduleTimeout(){clearTimeout(this.timer),this.timer=setTimeout(()=>{this.tries=this.tries+1,this.callback()},this.timerCalc(this.tries+1))}}class xs{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):t(typeof e=="string"?JSON.parse(e):{})}_binaryDecode(e){const t=new DataView(e),s=new TextDecoder;return this._decodeBroadcast(e,t,s)}_decodeBroadcast(e,t,s){const r=t.getUint8(1),n=t.getUint8(2);let o=this.HEADER_LENGTH+2;const a=s.decode(e.slice(o,o+r));o=o+r;const l=s.decode(e.slice(o,o+n));o=o+n;const c=JSON.parse(s.decode(e.slice(o,e.byteLength)));return{ref:null,topic:a,event:l,payload:c}}}class je{constructor(e,t,s={},r=Et){this.channel=e,this.event=t,this.payload=s,this.timeout=r,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHooks=[],this.refEvent=null,this.rateLimited=!1}resend(e){this.timeout=e,this._cancelRefEvent(),this.ref="",this.refEvent=null,this.receivedResp=null,this.sent=!1,this.send()}send(){if(this._hasReceived("timeout"))return;this.startTimeout(),this.sent=!0,this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()})==="rate limited"&&(this.rateLimited=!0)}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var s;return this._hasReceived(e)&&t((s=this.receivedResp)===null||s===void 0?void 0:s.response),this.recHooks.push({status:e,callback:t}),this}startTimeout(){if(this.timeoutTimer)return;this.ref=this.channel.socket._makeRef(),this.refEvent=this.channel._replyEventName(this.ref);const e=t=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=t,this._matchReceive(t)};this.channel._on(this.refEvent,{},e),this.timeoutTimer=setTimeout(()=>{this.trigger("timeout",{})},this.timeout)}trigger(e,t){this.refEvent&&this.channel._trigger(this.refEvent,{status:e,response:t})}destroy(){this._cancelRefEvent(),this._cancelTimeout()}_cancelRefEvent(){this.refEvent&&this.channel._off(this.refEvent,{})}_cancelTimeout(){clearTimeout(this.timeoutTimer),this.timeoutTimer=void 0}_matchReceive({status:e,response:t}){this.recHooks.filter(s=>s.status===e).forEach(s=>s.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}var Ze;(function(i){i.SYNC="sync",i.JOIN="join",i.LEAVE="leave"})(Ze||(Ze={}));class fe{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};const s=(t==null?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(s.state,{},r=>{const{onJoin:n,onLeave:o,onSync:a}=this.caller;this.joinRef=this.channel._joinRef(),this.state=fe.syncState(this.state,r,n,o),this.pendingDiffs.forEach(l=>{this.state=fe.syncDiff(this.state,l,n,o)}),this.pendingDiffs=[],a()}),this.channel._on(s.diff,{},r=>{const{onJoin:n,onLeave:o,onSync:a}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(r):(this.state=fe.syncDiff(this.state,r,n,o),a())}),this.onJoin((r,n,o)=>{this.channel._trigger("presence",{event:"join",key:r,currentPresences:n,newPresences:o})}),this.onLeave((r,n,o)=>{this.channel._trigger("presence",{event:"leave",key:r,currentPresences:n,leftPresences:o})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,s,r){const n=this.cloneDeep(e),o=this.transformState(t),a={},l={};return this.map(n,(c,h)=>{o[c]||(l[c]=h)}),this.map(o,(c,h)=>{const d=n[c];if(d){const u=h.map(_=>_.presence_ref),f=d.map(_=>_.presence_ref),g=h.filter(_=>f.indexOf(_.presence_ref)<0),p=d.filter(_=>u.indexOf(_.presence_ref)<0);g.length>0&&(a[c]=g),p.length>0&&(l[c]=p)}else a[c]=h}),this.syncDiff(n,{joins:a,leaves:l},s,r)}static syncDiff(e,t,s,r){const{joins:n,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return s||(s=()=>{}),r||(r=()=>{}),this.map(n,(a,l)=>{var c;const h=(c=e[a])!==null&&c!==void 0?c:[];if(e[a]=this.cloneDeep(l),h.length>0){const d=e[a].map(f=>f.presence_ref),u=h.filter(f=>d.indexOf(f.presence_ref)<0);e[a].unshift(...u)}s(a,h,l)}),this.map(o,(a,l)=>{let c=e[a];if(!c)return;const h=l.map(d=>d.presence_ref);c=c.filter(d=>h.indexOf(d.presence_ref)<0),e[a]=c,r(a,c,l),c.length===0&&delete e[a]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(s=>t(s,e[s]))}static transformState(e){return e=this.cloneDeep(e),Object.getOwnPropertyNames(e).reduce((t,s)=>{const r=e[s];return"metas"in r?t[s]=r.metas.map(n=>(n.presence_ref=n.phx_ref,delete n.phx_ref,delete n.phx_ref_prev,n)):t[s]=r,t},{})}static cloneDeep(e){return JSON.parse(JSON.stringify(e))}onJoin(e){this.caller.onJoin=e}onLeave(e){this.caller.onLeave=e}onSync(e){this.caller.onSync=e}inPendingSyncState(){return!this.joinRef||this.joinRef!==this.channel._joinRef()}}var T;(function(i){i.abstime="abstime",i.bool="bool",i.date="date",i.daterange="daterange",i.float4="float4",i.float8="float8",i.int2="int2",i.int4="int4",i.int4range="int4range",i.int8="int8",i.int8range="int8range",i.json="json",i.jsonb="jsonb",i.money="money",i.numeric="numeric",i.oid="oid",i.reltime="reltime",i.text="text",i.time="time",i.timestamp="timestamp",i.timestamptz="timestamptz",i.timetz="timetz",i.tsrange="tsrange",i.tstzrange="tstzrange"})(T||(T={}));const et=(i,e,t={})=>{var s;const r=(s=t.skipTypes)!==null&&s!==void 0?s:[];return Object.keys(e).reduce((n,o)=>(n[o]=Rs(o,i,e,r),n),{})},Rs=(i,e,t,s)=>{const r=e.find(a=>a.name===i),n=r==null?void 0:r.type,o=t[i];return n&&!s.includes(n)?jt(n,o):De(o)},jt=(i,e)=>{if(i.charAt(0)==="_"){const t=i.slice(1,i.length);return Ds(e,t)}switch(i){case T.bool:return As(e);case T.float4:case T.float8:case T.int2:case T.int4:case T.int8:case T.numeric:case T.oid:return Is(e);case T.json:case T.jsonb:return Ls(e);case T.timestamp:return Us(e);case T.abstime:case T.date:case T.daterange:case T.int4range:case T.int8range:case T.money:case T.reltime:case T.text:case T.time:case T.timestamptz:case T.timetz:case T.tsrange:case T.tstzrange:return De(e);default:return De(e)}},De=i=>i,As=i=>{switch(i){case"t":return!0;case"f":return!1;default:return i}},Is=i=>{if(typeof i=="string"){const e=parseFloat(i);if(!Number.isNaN(e))return e}return i},Ls=i=>{if(typeof i=="string")try{return JSON.parse(i)}catch(e){return console.log(`JSON parse error: ${e}`),i}return i},Ds=(i,e)=>{if(typeof i!="string")return i;const t=i.length-1,s=i[t];if(i[0]==="{"&&s==="}"){let n;const o=i.slice(1,t);try{n=JSON.parse("["+o+"]")}catch{n=o?o.split(","):[]}return n.map(a=>jt(e,a))}return i},Us=i=>typeof i=="string"?i.replace(" ","T"):i;var tt;(function(i){i.ALL="*",i.INSERT="INSERT",i.UPDATE="UPDATE",i.DELETE="DELETE"})(tt||(tt={}));var st;(function(i){i.BROADCAST="broadcast",i.PRESENCE="presence",i.POSTGRES_CHANGES="postgres_changes"})(st||(st={}));var rt;(function(i){i.SUBSCRIBED="SUBSCRIBED",i.TIMED_OUT="TIMED_OUT",i.CLOSED="CLOSED",i.CHANNEL_ERROR="CHANNEL_ERROR"})(rt||(rt={}));class Be{constructor(e,t={config:{}},s){this.topic=e,this.params=t,this.socket=s,this.bindings={},this.state=D.closed,this.joinedOnce=!1,this.pushBuffer=[],this.subTopic=e.replace(/^realtime:/i,""),this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new je(this,F.join,this.params,this.timeout),this.rejoinTimer=new $t(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=D.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(r=>r.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=D.closed,this.socket._remove(this)}),this._onError(r=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,r),this.state=D.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=D.errored,this.rejoinTimer.scheduleTimeout())}),this._on(F.reply,{},(r,n)=>{this._trigger(this._replyEventName(n),r)}),this.presence=new fe(this),this.broadcastEndpointURL=this._broadcastEndpointURL()}subscribe(e,t=this.timeout){var s,r;if(this.socket.isConnected()||this.socket.connect(),this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{const{config:{broadcast:n,presence:o}}=this.params;this._onError(c=>e&&e("CHANNEL_ERROR",c)),this._onClose(()=>e&&e("CLOSED"));const a={},l={broadcast:n,presence:o,postgres_changes:(r=(s=this.bindings.postgres_changes)===null||s===void 0?void 0:s.map(c=>c.filter))!==null&&r!==void 0?r:[]};this.socket.accessToken&&(a.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:l},a)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:c})=>{var h;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),c===void 0){e&&e("SUBSCRIBED");return}else{const d=this.bindings.postgres_changes,u=(h=d==null?void 0:d.length)!==null&&h!==void 0?h:0,f=[];for(let g=0;g{e&&e("CHANNEL_ERROR",new Error(JSON.stringify(Object.values(c).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}async track(e,t={}){return await this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)}async untrack(e={}){return await this.send({type:"presence",event:"untrack"},e)}on(e,t,s){return this._on(e,t,s)}async send(e,t={}){var s,r;if(!this._canPush()&&e.type==="broadcast"){const{event:n,payload:o}=e,a={method:"POST",headers:{apikey:(s=this.socket.accessToken)!==null&&s!==void 0?s:"","Content-Type":"application/json"},body:JSON.stringify({messages:[{topic:this.subTopic,event:n,payload:o}]})};try{return(await this._fetchWithTimeout(this.broadcastEndpointURL,a,(r=t.timeout)!==null&&r!==void 0?r:this.timeout)).ok?"ok":"error"}catch(l){return l.name==="AbortError"?"timed out":"error"}}else return new Promise(n=>{var o,a,l;const c=this._push(e.type,e,t.timeout||this.timeout);c.rateLimited&&n("rate limited"),e.type==="broadcast"&&!(!((l=(a=(o=this.params)===null||o===void 0?void 0:o.config)===null||a===void 0?void 0:a.broadcast)===null||l===void 0)&&l.ack)&&n("ok"),c.receive("ok",()=>n("ok")),c.receive("timeout",()=>n("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=D.leaving;const t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(F.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(s=>{const r=new je(this,F.leave,{},e);r.receive("ok",()=>{t(),s("ok")}).receive("timeout",()=>{t(),s("timed out")}).receive("error",()=>{s("error")}),r.send(),this._canPush()||r.trigger("ok",{})})}_broadcastEndpointURL(){let e=this.socket.endPoint;return e=e.replace(/^ws/i,"http"),e=e.replace(/(\/socket\/websocket|\/socket|\/websocket)\/?$/i,""),e.replace(/\/+$/,"")+"/api/broadcast"}async _fetchWithTimeout(e,t,s){const r=new AbortController,n=setTimeout(()=>r.abort(),s),o=await this.socket.fetch(e,Object.assign(Object.assign({},t),{signal:r.signal}));return clearTimeout(n),o}_push(e,t,s=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let r=new je(this,e,t,s);return this._canPush()?r.send():(r.startTimeout(),this.pushBuffer.push(r)),r}_onMessage(e,t,s){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,s){var r,n;const o=e.toLocaleLowerCase(),{close:a,error:l,leave:c,join:h}=F;if(s&&[a,l,c,h].indexOf(o)>=0&&s!==this._joinRef())return;let u=this._onMessage(o,t,s);if(t&&!u)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?(r=this.bindings.postgres_changes)===null||r===void 0||r.filter(f=>{var g,p,_;return((g=f.filter)===null||g===void 0?void 0:g.event)==="*"||((_=(p=f.filter)===null||p===void 0?void 0:p.event)===null||_===void 0?void 0:_.toLocaleLowerCase())===o}).map(f=>f.callback(u,s)):(n=this.bindings[o])===null||n===void 0||n.filter(f=>{var g,p,_,S,k,E;if(["broadcast","presence","postgres_changes"].includes(o))if("id"in f){const v=f.id,$=(g=f.filter)===null||g===void 0?void 0:g.event;return v&&((p=t.ids)===null||p===void 0?void 0:p.includes(v))&&($==="*"||($==null?void 0:$.toLocaleLowerCase())===((_=t.data)===null||_===void 0?void 0:_.type.toLocaleLowerCase()))}else{const v=(k=(S=f==null?void 0:f.filter)===null||S===void 0?void 0:S.event)===null||k===void 0?void 0:k.toLocaleLowerCase();return v==="*"||v===((E=t==null?void 0:t.event)===null||E===void 0?void 0:E.toLocaleLowerCase())}else return f.type.toLocaleLowerCase()===o}).map(f=>{if(typeof u=="object"&&"ids"in u){const g=u.data,{schema:p,table:_,commit_timestamp:S,type:k,errors:E}=g;u=Object.assign(Object.assign({},{schema:p,table:_,commit_timestamp:S,eventType:k,new:{},old:{},errors:E}),this._getPayloadRecords(g))}f.callback(u,s)})}_isClosed(){return this.state===D.closed}_isJoined(){return this.state===D.joined}_isJoining(){return this.state===D.joining}_isLeaving(){return this.state===D.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,s){const r=e.toLocaleLowerCase(),n={type:r,filter:t,callback:s};return this.bindings[r]?this.bindings[r].push(n):this.bindings[r]=[n],this}_off(e,t){const s=e.toLocaleLowerCase();return this.bindings[s]=this.bindings[s].filter(r=>{var n;return!(((n=r.type)===null||n===void 0?void 0:n.toLocaleLowerCase())===s&&Be.isEqual(r.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(const s in e)if(e[s]!==t[s])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(F.close,{},e)}_onError(e){this._on(F.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=D.joining,this.joinPush.resend(e))}_getPayloadRecords(e){const t={new:{},old:{}};return(e.type==="INSERT"||e.type==="UPDATE")&&(t.new=et(e.columns,e.record)),(e.type==="UPDATE"||e.type==="DELETE")&&(t.old=et(e.columns,e.old_record)),t}}const Ns=()=>{};class Fs{constructor(e,t){var s,r;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=js,this.params={},this.timeout=Et,this.transport=Es.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=Ns,this.conn=null,this.sendBuffer=[],this.serializer=new xs,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this._resolveFetch=a=>{let l;return a?l=a:typeof fetch>"u"?l=(...c)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:h})=>h(...c)):l=fetch,(...c)=>l(...c)},this.endPoint=`${e}/${Le.websocket}`,t!=null&&t.params&&(this.params=t.params),t!=null&&t.headers&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),t!=null&&t.timeout&&(this.timeout=t.timeout),t!=null&&t.logger&&(this.logger=t.logger),t!=null&&t.transport&&(this.transport=t.transport),t!=null&&t.heartbeatIntervalMs&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);const n=(s=t==null?void 0:t.params)===null||s===void 0?void 0:s.eventsPerSecond;n&&(this.eventsPerSecondLimitMs=Math.floor(1e3/n));const o=(r=t==null?void 0:t.params)===null||r===void 0?void 0:r.apikey;o&&(this.accessToken=o),this.reconnectAfterMs=t!=null&&t.reconnectAfterMs?t.reconnectAfterMs:a=>[1e3,2e3,5e3,1e4][a-1]||1e4,this.encode=t!=null&&t.encode?t.encode:(a,l)=>l(JSON.stringify(a)),this.decode=t!=null&&t.decode?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new $t(async()=>{this.disconnect(),this.connect()},this.reconnectAfterMs),this.fetch=this._resolveFetch(t==null?void 0:t.fetch)}connect(){this.conn||(this.conn=new this.transport(this._endPointURL(),[],null,this.headers),this.conn&&(this.conn.binaryType="arraybuffer",this.conn.onopen=()=>this._onConnOpen(),this.conn.onerror=e=>this._onConnError(e),this.conn.onmessage=e=>this._onConnMessage(e),this.conn.onclose=e=>this._onConnClose(e)))}disconnect(e,t){this.conn&&(this.conn.onclose=function(){},e?this.conn.close(e,t??""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}async removeChannel(e){const t=await e.unsubscribe();return this.channels.length===0&&this.disconnect(),t}async removeAllChannels(){const e=await Promise.all(this.channels.map(t=>t.unsubscribe()));return this.disconnect(),e}log(e,t,s){this.logger(e,t,s)}connectionState(){switch(this.conn&&this.conn.readyState){case de.connecting:return Z.Connecting;case de.open:return Z.Open;case de.closing:return Z.Closing;default:return Z.Closed}}isConnected(){return this.connectionState()===Z.Open}channel(e,t={config:{}}){const s=new Be(`realtime:${e}`,t,this);return this.channels.push(s),s}push(e){const{topic:t,event:s,payload:r,ref:n}=e;let o=()=>{this.encode(e,a=>{var l;(l=this.conn)===null||l===void 0||l.send(a)})};if(this.log("push",`${t} ${s} (${n})`,r),this.isConnected())if(["broadcast","presence","postgres_changes"].includes(s)){if(this._throttle(o)())return"rate limited"}else o();else this.sendBuffer.push(o)}setAuth(e){this.accessToken=e,this.channels.forEach(t=>{e&&t.updateJoinPayload({access_token:e}),t.joinedOnce&&t._isJoined()&&t._push(F.access_token,{access_token:e})})}_makeRef(){let e=this.ref+1;return e===this.ref?this.ref=0:this.ref=e,this.ref.toString()}_leaveOpenTopic(e){let t=this.channels.find(s=>s.topic===e&&(s._isJoined()||s._isJoining()));t&&(this.log("transport",`leaving duplicate topic "${e}"`),t.unsubscribe())}_remove(e){this.channels=this.channels.filter(t=>t._joinRef()!==e._joinRef())}_endPointURL(){return this._appendParams(this.endPoint,Object.assign({},this.params,{vsn:Ps}))}_onConnMessage(e){this.decode(e.data,t=>{let{topic:s,event:r,payload:n,ref:o}=t;(o&&o===this.pendingHeartbeatRef||r===(n==null?void 0:n.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${n.status||""} ${s} ${r} ${o&&"("+o+")"||""}`,n),this.channels.filter(a=>a._isMember(s)).forEach(a=>a._trigger(r,n,o)),this.stateChangeCallbacks.message.forEach(a=>a(t))})}_onConnOpen(){this.log("transport",`connected to ${this._endPointURL()}`),this._flushSendBuffer(),this.reconnectTimer.reset(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.heartbeatTimer=setInterval(()=>this._sendHeartbeat(),this.heartbeatIntervalMs),this.stateChangeCallbacks.open.forEach(e=>e())}_onConnClose(e){this.log("transport","close",e),this._triggerChanError(),this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.scheduleTimeout(),this.stateChangeCallbacks.close.forEach(t=>t(e))}_onConnError(e){this.log("transport",e.message),this._triggerChanError(),this.stateChangeCallbacks.error.forEach(t=>t(e))}_triggerChanError(){this.channels.forEach(e=>e._trigger(F.error))}_appendParams(e,t){if(Object.keys(t).length===0)return e;const s=e.match(/\?/)?"&":"?",r=new URLSearchParams(t);return`${e}${s}${r}`}_flushSendBuffer(){this.isConnected()&&this.sendBuffer.length>0&&(this.sendBuffer.forEach(e=>e()),this.sendBuffer=[])}_sendHeartbeat(){var e;if(this.isConnected()){if(this.pendingHeartbeatRef){this.pendingHeartbeatRef=null,this.log("transport","heartbeat timeout. Attempting to re-establish connection"),(e=this.conn)===null||e===void 0||e.close(Cs,"hearbeat timeout");return}this.pendingHeartbeatRef=this._makeRef(),this.push({topic:"phoenix",event:"heartbeat",payload:{},ref:this.pendingHeartbeatRef}),this.setAuth(this.accessToken)}}_throttle(e,t=this.eventsPerSecondLimitMs){return()=>this.inThrottle?!0:(e(),t>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},t)),!1)}}class ze extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function C(i){return typeof i=="object"&&i!==null&&"__isStorageError"in i}class qs extends ze{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class it extends ze{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var Ms=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Pt=i=>{let e;return i?e=i:typeof fetch>"u"?e=(...t)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},Js=()=>Ms(void 0,void 0,void 0,function*(){return typeof Response>"u"?(yield me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url)).Response:Response});var oe=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Pe=i=>i.msg||i.message||i.error_description||i.error||JSON.stringify(i),Bs=(i,e)=>oe(void 0,void 0,void 0,function*(){const t=yield Js();i instanceof t?i.json().then(s=>{e(new qs(Pe(s),i.status||500))}).catch(s=>{e(new it(Pe(s),s))}):e(new it(Pe(i),i))}),zs=(i,e,t,s)=>{const r={method:i,headers:(e==null?void 0:e.headers)||{}};return i==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json"},e==null?void 0:e.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};function Oe(i,e,t,s,r,n){return oe(this,void 0,void 0,function*(){return new Promise((o,a)=>{i(t,zs(e,s,r,n)).then(l=>{if(!l.ok)throw l;return s!=null&&s.noResolveJson?l:l.json()}).then(l=>o(l)).catch(l=>Bs(l,a))})})}function Ue(i,e,t,s){return oe(this,void 0,void 0,function*(){return Oe(i,"GET",e,t,s)})}function H(i,e,t,s,r){return oe(this,void 0,void 0,function*(){return Oe(i,"POST",e,s,r,t)})}function Hs(i,e,t,s,r){return oe(this,void 0,void 0,function*(){return Oe(i,"PUT",e,s,r,t)})}function Ct(i,e,t,s,r){return oe(this,void 0,void 0,function*(){return Oe(i,"DELETE",e,s,r,t)})}var U=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Gs={limit:100,offset:0,sortBy:{column:"name",order:"asc"}},nt={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class Ks{constructor(e,t={},s,r){this.url=e,this.headers=t,this.bucketId=s,this.fetch=Pt(r)}uploadOrUpdate(e,t,s,r){return U(this,void 0,void 0,function*(){try{let n;const o=Object.assign(Object.assign({},nt),r),a=Object.assign(Object.assign({},this.headers),e==="POST"&&{"x-upsert":String(o.upsert)});typeof Blob<"u"&&s instanceof Blob?(n=new FormData,n.append("cacheControl",o.cacheControl),n.append("",s)):typeof FormData<"u"&&s instanceof FormData?(n=s,n.append("cacheControl",o.cacheControl)):(n=s,a["cache-control"]=`max-age=${o.cacheControl}`,a["content-type"]=o.contentType);const l=this._removeEmptyFolders(t),c=this._getFinalPath(l),h=yield this.fetch(`${this.url}/object/${c}`,Object.assign({method:e,body:n,headers:a},o!=null&&o.duplex?{duplex:o.duplex}:{}));return h.ok?{data:{path:l},error:null}:{data:null,error:yield h.json()}}catch(n){if(C(n))return{data:null,error:n};throw n}})}upload(e,t,s){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,s)})}uploadToSignedUrl(e,t,s,r){return U(this,void 0,void 0,function*(){const n=this._removeEmptyFolders(e),o=this._getFinalPath(n),a=new URL(this.url+`/object/upload/sign/${o}`);a.searchParams.set("token",t);try{let l;const c=Object.assign({upsert:nt.upsert},r),h=Object.assign(Object.assign({},this.headers),{"x-upsert":String(c.upsert)});typeof Blob<"u"&&s instanceof Blob?(l=new FormData,l.append("cacheControl",c.cacheControl),l.append("",s)):typeof FormData<"u"&&s instanceof FormData?(l=s,l.append("cacheControl",c.cacheControl)):(l=s,h["cache-control"]=`max-age=${c.cacheControl}`,h["content-type"]=c.contentType);const d=yield this.fetch(a.toString(),{method:"PUT",body:l,headers:h});return d.ok?{data:{path:n},error:null}:{data:null,error:yield d.json()}}catch(l){if(C(l))return{data:null,error:l};throw l}})}createSignedUploadUrl(e){return U(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e);const s=yield H(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),r=new URL(this.url+s.url),n=r.searchParams.get("token");if(!n)throw new ze("No token returned by API");return{data:{signedUrl:r.toString(),path:e,token:n},error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}update(e,t,s){return U(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,s)})}move(e,t){return U(this,void 0,void 0,function*(){try{return{data:yield H(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers}),error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}copy(e,t){return U(this,void 0,void 0,function*(){try{return{data:{path:(yield H(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers})).Key},error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}createSignedUrl(e,t,s){return U(this,void 0,void 0,function*(){try{let r=this._getFinalPath(e),n=yield H(this.fetch,`${this.url}/object/sign/${r}`,Object.assign({expiresIn:t},s!=null&&s.transform?{transform:s.transform}:{}),{headers:this.headers});const o=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return n={signedUrl:encodeURI(`${this.url}${n.signedURL}${o}`)},{data:n,error:null}}catch(r){if(C(r))return{data:null,error:r};throw r}})}createSignedUrls(e,t,s){return U(this,void 0,void 0,function*(){try{const r=yield H(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),n=s!=null&&s.download?`&download=${s.download===!0?"":s.download}`:"";return{data:r.map(o=>Object.assign(Object.assign({},o),{signedUrl:o.signedURL?encodeURI(`${this.url}${o.signedURL}${n}`):null})),error:null}}catch(r){if(C(r))return{data:null,error:r};throw r}})}download(e,t){return U(this,void 0,void 0,function*(){const r=typeof(t==null?void 0:t.transform)<"u"?"render/image/authenticated":"object",n=this.transformOptsToQueryString((t==null?void 0:t.transform)||{}),o=n?`?${n}`:"";try{const a=this._getFinalPath(e);return{data:yield(yield Ue(this.fetch,`${this.url}/${r}/${a}${o}`,{headers:this.headers,noResolveJson:!0})).blob(),error:null}}catch(a){if(C(a))return{data:null,error:a};throw a}})}getPublicUrl(e,t){const s=this._getFinalPath(e),r=[],n=t!=null&&t.download?`download=${t.download===!0?"":t.download}`:"";n!==""&&r.push(n);const a=typeof(t==null?void 0:t.transform)<"u"?"render/image":"object",l=this.transformOptsToQueryString((t==null?void 0:t.transform)||{});l!==""&&r.push(l);let c=r.join("&");return c!==""&&(c=`?${c}`),{data:{publicUrl:encodeURI(`${this.url}/${a}/public/${s}${c}`)}}}remove(e){return U(this,void 0,void 0,function*(){try{return{data:yield Ct(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}list(e,t,s){return U(this,void 0,void 0,function*(){try{const r=Object.assign(Object.assign(Object.assign({},Gs),t),{prefix:e||""});return{data:yield H(this.fetch,`${this.url}/object/list/${this.bucketId}`,r,{headers:this.headers},s),error:null}}catch(r){if(C(r))return{data:null,error:r};throw r}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){const t=[];return e.width&&t.push(`width=${e.width}`),e.height&&t.push(`height=${e.height}`),e.resize&&t.push(`resize=${e.resize}`),e.format&&t.push(`format=${e.format}`),e.quality&&t.push(`quality=${e.quality}`),t.join("&")}}const Vs="2.5.4",Ws={"X-Client-Info":`storage-js/${Vs}`};var ee=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};class Xs{constructor(e,t={},s){this.url=e,this.headers=Object.assign(Object.assign({},Ws),t),this.fetch=Pt(s)}listBuckets(){return ee(this,void 0,void 0,function*(){try{return{data:yield Ue(this.fetch,`${this.url}/bucket`,{headers:this.headers}),error:null}}catch(e){if(C(e))return{data:null,error:e};throw e}})}getBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield Ue(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}createBucket(e,t={public:!1}){return ee(this,void 0,void 0,function*(){try{return{data:yield H(this.fetch,`${this.url}/bucket`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}updateBucket(e,t){return ee(this,void 0,void 0,function*(){try{return{data:yield Hs(this.fetch,`${this.url}/bucket/${e}`,{id:e,name:e,public:t.public,file_size_limit:t.fileSizeLimit,allowed_mime_types:t.allowedMimeTypes},{headers:this.headers}),error:null}}catch(s){if(C(s))return{data:null,error:s};throw s}})}emptyBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield H(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}deleteBucket(e){return ee(this,void 0,void 0,function*(){try{return{data:yield Ct(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers}),error:null}}catch(t){if(C(t))return{data:null,error:t};throw t}})}}class Qs extends Xs{constructor(e,t={},s){super(e,t,s)}from(e){return new Ks(this.url,this.headers,e,this.fetch)}}const Ys="2.38.2";let ce="";typeof Deno<"u"?ce="deno":typeof document<"u"?ce="web":typeof navigator<"u"&&navigator.product==="ReactNative"?ce="react-native":ce="node";const Zs={"X-Client-Info":`supabase-js-${ce}/${Ys}`};var er=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const tr=i=>{let e;return i?e=i:typeof fetch>"u"?e=Me:e=fetch,(...t)=>e(...t)},sr=()=>typeof Headers>"u"?qe.Headers:Headers,rr=(i,e,t)=>{const s=tr(t),r=sr();return(n,o)=>er(void 0,void 0,void 0,function*(){var a;const l=(a=yield e())!==null&&a!==void 0?a:i;let c=new r(o==null?void 0:o.headers);return c.has("apikey")||c.set("apikey",i),c.has("Authorization")||c.set("Authorization",`Bearer ${l}`),s(n,Object.assign(Object.assign({},o),{headers:c}))})};function ir(i){return i.replace(/\/$/,"")}function nr(i,e){const{db:t,auth:s,realtime:r,global:n}=i,{db:o,auth:a,realtime:l,global:c}=e;return{db:Object.assign(Object.assign({},o),t),auth:Object.assign(Object.assign({},a),s),realtime:Object.assign(Object.assign({},l),r),global:Object.assign(Object.assign({},c),n)}}function or(i){return Math.round(Date.now()/1e3)+i}function ar(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(i){const e=Math.random()*16|0;return(i=="x"?e:e&3|8).toString(16)})}const J=()=>typeof document<"u",V={tested:!1,writable:!1},ge=()=>{if(!J())return!1;try{if(typeof globalThis.localStorage!="object")return!1}catch{return!1}if(V.tested)return V.writable;const i=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(i,i),globalThis.localStorage.removeItem(i),V.tested=!0,V.writable=!0}catch{V.tested=!0,V.writable=!1}return V.writable};function Ce(i){const e={},t=new URL(i);if(t.hash&&t.hash[0]==="#")try{new URLSearchParams(t.hash.substring(1)).forEach((r,n)=>{e[n]=r})}catch{}return t.searchParams.forEach((s,r)=>{e[r]=s}),e}const xt=i=>{let e;return i?e=i:typeof fetch>"u"?e=(...t)=>me(()=>Promise.resolve().then(()=>ve),void 0,import.meta.url).then(({default:s})=>s(...t)):e=fetch,(...t)=>e(...t)},lr=i=>typeof i=="object"&&i!==null&&"status"in i&&"ok"in i&&"json"in i&&typeof i.json=="function",W=async(i,e,t)=>{await i.setItem(e,JSON.stringify(t))},we=async(i,e)=>{const t=await i.getItem(e);if(!t)return null;try{return JSON.parse(t)}catch{return t}},xe=async(i,e)=>{await i.removeItem(e)};function cr(i){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let t="",s,r,n,o,a,l,c,h=0;for(i=i.replace("-","+").replace("_","/");h>4,r=(a&15)<<4|l>>2,n=(l&3)<<6|c,t=t+String.fromCharCode(s),l!=64&&r!=0&&(t=t+String.fromCharCode(r)),c!=64&&n!=0&&(t=t+String.fromCharCode(n));return t}class Ee{constructor(){this.promise=new Ee.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}Ee.promiseConstructor=Promise;function ot(i){const e=/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i,t=i.split(".");if(t.length!==3)throw new Error("JWT is not valid: not a JWT structure");if(!e.test(t[1]))throw new Error("JWT is not valid: payload is not in base64url format");const s=t[1];return JSON.parse(cr(s))}async function hr(i){return await new Promise(e=>{setTimeout(()=>e(null),i)})}function ur(i,e){return new Promise((s,r)=>{(async()=>{for(let n=0;n<1/0;n++)try{const o=await i(n);if(!e(n,null,o)){s(o);return}}catch(o){if(!e(n,o)){r(o);return}}})()})}function dr(i){return("0"+i.toString(16)).substr(-2)}function te(){const e=new Uint32Array(56);if(typeof crypto>"u"){const t="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",s=t.length;let r="";for(let n=0;n<56;n++)r+=t.charAt(Math.floor(Math.random()*s));return r}return crypto.getRandomValues(e),Array.from(e,dr).join("")}async function fr(i){const t=new TextEncoder().encode(i),s=await crypto.subtle.digest("SHA-256",t),r=new Uint8Array(s);return Array.from(r).map(n=>String.fromCharCode(n)).join("")}function gr(i){return btoa(i).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}async function se(i){if(!(typeof crypto<"u"&&typeof crypto.subtle<"u"&&typeof TextEncoder<"u"))return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),i;const t=await fr(i);return gr(t)}class He extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function b(i){return typeof i=="object"&&i!==null&&"__isAuthError"in i}class pr extends He{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}function _r(i){return b(i)&&i.name==="AuthApiError"}class Rt extends He{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class ae extends He{constructor(e,t,s){super(e),this.name=t,this.status=s}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class re extends ae{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class Re extends ae{constructor(){super("Auth session or user missing","AuthInvalidTokenResponseError",500)}}class ke extends ae{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class Se extends ae{constructor(e,t=null){super(e,"AuthImplicitGrantRedirectError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class at extends ae{constructor(e,t=null){super(e,"AuthPKCEGrantCodeExchangeError",500),this.details=null,this.details=t}toJSON(){return{name:this.name,message:this.message,status:this.status,details:this.details}}}class Ne extends ae{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function lt(i){return b(i)&&i.name==="AuthRetryableFetchError"}var mr=globalThis&&globalThis.__rest||function(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(i);ri.msg||i.message||i.error_description||i.error||JSON.stringify(i),vr=[502,503,504];async function ct(i){if(!lr(i))throw new Ne(he(i),0);if(vr.includes(i.status))throw new Ne(he(i),i.status);let e;try{e=await i.json()}catch(t){throw new Rt(he(t),t)}throw new pr(he(e),i.status||500)}const yr=(i,e,t,s)=>{const r={method:i,headers:(e==null?void 0:e.headers)||{}};return i==="GET"?r:(r.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},e==null?void 0:e.headers),r.body=JSON.stringify(s),Object.assign(Object.assign({},r),t))};async function w(i,e,t,s){var r;const n=Object.assign({},s==null?void 0:s.headers);s!=null&&s.jwt&&(n.Authorization=`Bearer ${s.jwt}`);const o=(r=s==null?void 0:s.query)!==null&&r!==void 0?r:{};s!=null&&s.redirectTo&&(o.redirect_to=s.redirectTo);const a=Object.keys(o).length?"?"+new URLSearchParams(o).toString():"",l=await br(i,e,t+a,{headers:n,noResolveJson:s==null?void 0:s.noResolveJson},{},s==null?void 0:s.body);return s!=null&&s.xform?s==null?void 0:s.xform(l):{data:Object.assign({},l),error:null}}async function br(i,e,t,s,r,n){const o=yr(e,s,r,n);let a;try{a=await i(t,o)}catch(l){throw console.error(l),new Ne(he(l),0)}if(a.ok||await ct(a),s!=null&&s.noResolveJson)return a;try{return await a.json()}catch(l){await ct(l)}}function z(i){var e;let t=null;Tr(i)&&(t=Object.assign({},i),i.expires_at||(t.expires_at=or(i.expires_in)));const s=(e=i.user)!==null&&e!==void 0?e:i;return{data:{session:t,user:s},error:null}}function G(i){var e;return{data:{user:(e=i.user)!==null&&e!==void 0?e:i},error:null}}function wr(i){return{data:i,error:null}}function kr(i){const{action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:n}=i,o=mr(i,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a={action_link:e,email_otp:t,hashed_token:s,redirect_to:r,verification_type:n},l=Object.assign({},o);return{data:{properties:a,user:l},error:null}}function Sr(i){return i}function Tr(i){return i.access_token&&i.refresh_token&&i.expires_in}var Or=globalThis&&globalThis.__rest||function(i,e){var t={};for(var s in i)Object.prototype.hasOwnProperty.call(i,s)&&e.indexOf(s)<0&&(t[s]=i[s]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var r=0,s=Object.getOwnPropertySymbols(i);r0&&(f.forEach(g=>{const p=parseInt(g.split(";")[0].split("=")[1].substring(0,1)),_=JSON.parse(g.split(";")[1].split("=")[1]);c[`${_}Page`]=p}),c.total=parseInt(u)),{data:Object.assign(Object.assign({},d),c),error:null}}catch(c){if(b(c))return{data:{users:[]},error:c};throw c}}async getUserById(e){try{return await w(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:G})}catch(t){if(b(t))return{data:{user:null},error:t};throw t}}async updateUserById(e,t){try{return await w(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:G})}catch(s){if(b(s))return{data:{user:null},error:s};throw s}}async deleteUser(e,t=!1){try{return await w(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:G})}catch(s){if(b(s))return{data:{user:null},error:s};throw s}}async _listFactors(e){try{const{data:t,error:s}=await w(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:r=>({data:{factors:r},error:null})});return{data:t,error:s}}catch(t){if(b(t))return{data:null,error:t};throw t}}async _deleteFactor(e){try{return{data:await w(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers}),error:null}}catch(t){if(b(t))return{data:null,error:t};throw t}}}const At="2.57.0",$r="http://localhost:9999",jr="supabase.auth.token",Pr={"X-Client-Info":`gotrue-js/${At}`},ht=10,Cr={getItem:i=>ge()?globalThis.localStorage.getItem(i):null,setItem:(i,e)=>{ge()&&globalThis.localStorage.setItem(i,e)},removeItem:i=>{ge()&&globalThis.localStorage.removeItem(i)}};function ut(i={}){return{getItem:e=>i[e]||null,setItem:(e,t)=>{i[e]=t},removeItem:e=>{delete i[e]}}}function xr(){if(typeof globalThis!="object")try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch{typeof self<"u"&&(self.globalThis=self)}}globalThis&&ge()&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class Rr extends Error{constructor(e){super(e),this.isAcquireTimeout=!0}}xr();const Ar={url:$r,storageKey:jr,autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:Pr,flowType:"implicit",debug:!1},le=30*1e3,dt=3;async function Ir(i,e,t){return await t()}class _e{constructor(e){var t;this.memoryStorage=null,this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.lockAcquired=!1,this.pendingInLock=[],this.broadcastChannel=null,this.logger=console.log,this.instanceID=_e.nextInstanceID,_e.nextInstanceID+=1,this.instanceID>0&&J()&&console.warn("Multiple GoTrueClient instances detected in the same browser context. It is not an error, but this should be avoided as it may produce undefined behavior when used concurrently under the same storage key.");const s=Object.assign(Object.assign({},Ar),e);if(this.logDebugMessages=!!s.debug,typeof s.debug=="function"&&(this.logger=s.debug),this.persistSession=s.persistSession,this.storageKey=s.storageKey,this.autoRefreshToken=s.autoRefreshToken,this.admin=new Er({url:s.url,headers:s.headers,fetch:s.fetch}),this.url=s.url,this.headers=s.headers,this.fetch=xt(s.fetch),this.lock=s.lock||Ir,this.detectSessionInUrl=s.detectSessionInUrl,this.flowType=s.flowType,this.mfa={verify:this._verify.bind(this),enroll:this._enroll.bind(this),unenroll:this._unenroll.bind(this),challenge:this._challenge.bind(this),listFactors:this._listFactors.bind(this),challengeAndVerify:this._challengeAndVerify.bind(this),getAuthenticatorAssuranceLevel:this._getAuthenticatorAssuranceLevel.bind(this)},this.persistSession?s.storage?this.storage=s.storage:ge()?this.storage=Cr:(this.memoryStorage={},this.storage=ut(this.memoryStorage)):(this.memoryStorage={},this.storage=ut(this.memoryStorage)),J()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(r){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",r)}(t=this.broadcastChannel)===null||t===void 0||t.addEventListener("message",async r=>{this._debug("received broadcast notification from other tab or client",r),await this._notifyAllSubscribers(r.data.event,r.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&this.logger(`GoTrueClient@${this.instanceID} (${At}) ${new Date().toISOString()}`,...e),this}async initialize(){return this.initializePromise?await this.initializePromise:(this.initializePromise=(async()=>await this._acquireLock(-1,async()=>await this._initialize()))(),await this.initializePromise)}async _initialize(){try{const e=J()?await this._isPKCEFlow():!1;if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){const{data:t,error:s}=await this._getSessionFromURL(e);if(s)return this._debug("#_initialize()","error detecting session from URL",s),await this._removeSession(),{error:s};const{session:r,redirectType:n}=t;return this._debug("#_initialize()","detected session in URL",r,"redirect type",n),await this._saveSession(r),setTimeout(async()=>{n==="recovery"?await this._notifyAllSubscribers("PASSWORD_RECOVERY",r):await this._notifyAllSubscribers("SIGNED_IN",r)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){return b(e)?{error:e}:{error:new Rt("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}}async signUp(e){var t,s,r;try{await this._removeSession();let n;if("email"in e){const{email:h,password:d,options:u}=e;let f=null,g=null;if(this.flowType==="pkce"){const p=te();await W(this.storage,`${this.storageKey}-code-verifier`,p),f=await se(p),g=p===f?"plain":"s256"}n=await w(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:u==null?void 0:u.emailRedirectTo,body:{email:h,password:d,data:(t=u==null?void 0:u.data)!==null&&t!==void 0?t:{},gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken},code_challenge:f,code_challenge_method:g},xform:z})}else if("phone"in e){const{phone:h,password:d,options:u}=e;n=await w(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:h,password:d,data:(s=u==null?void 0:u.data)!==null&&s!==void 0?s:{},channel:(r=u==null?void 0:u.channel)!==null&&r!==void 0?r:"sms",gotrue_meta_security:{captcha_token:u==null?void 0:u.captchaToken}},xform:z})}else throw new ke("You must provide either an email or phone number and a password");const{data:o,error:a}=n;if(a||!o)return{data:{user:null,session:null},error:a};const l=o.session,c=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(n){if(b(n))return{data:{user:null,session:null},error:n};throw n}}async signInWithPassword(e){try{await this._removeSession();let t;if("email"in e){const{email:n,password:o,options:a}=e;t=await w(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:n,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:z})}else if("phone"in e){const{phone:n,password:o,options:a}=e;t=await w(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:n,password:o,gotrue_meta_security:{captcha_token:a==null?void 0:a.captchaToken}},xform:z})}else throw new ke("You must provide either an email or phone number and a password");const{data:s,error:r}=t;return r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new Re}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:{user:s.user,session:s.session},error:r})}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOAuth(e){var t,s,r,n;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:(t=e.options)===null||t===void 0?void 0:t.redirectTo,scopes:(s=e.options)===null||s===void 0?void 0:s.scopes,queryParams:(r=e.options)===null||r===void 0?void 0:r.queryParams,skipBrowserRedirect:(n=e.options)===null||n===void 0?void 0:n.skipBrowserRedirect})}async exchangeCodeForSession(e){return await this.initializePromise,this._acquireLock(-1,async()=>this._exchangeCodeForSession(e))}async _exchangeCodeForSession(e){const t=await we(this.storage,`${this.storageKey}-code-verifier`),{data:s,error:r}=await w(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:z});return await xe(this.storage,`${this.storageKey}-code-verifier`),r?{data:{user:null,session:null},error:r}:!s||!s.session||!s.user?{data:{user:null,session:null},error:new Re}:(s.session&&(await this._saveSession(s.session),await this._notifyAllSubscribers("SIGNED_IN",s.session)),{data:s,error:r})}async signInWithIdToken(e){await this._removeSession();try{const{options:t,provider:s,token:r,access_token:n,nonce:o}=e,a=await w(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:s,id_token:r,access_token:n,nonce:o,gotrue_meta_security:{captcha_token:t==null?void 0:t.captchaToken}},xform:z}),{data:l,error:c}=a;return c?{data:{user:null,session:null},error:c}:!l||!l.session||!l.user?{data:{user:null,session:null},error:new Re}:(l.session&&(await this._saveSession(l.session),await this._notifyAllSubscribers("SIGNED_IN",l.session)),{data:l,error:c})}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async signInWithOtp(e){var t,s,r,n,o;try{if(await this._removeSession(),"email"in e){const{email:a,options:l}=e;let c=null,h=null;if(this.flowType==="pkce"){const u=te();await W(this.storage,`${this.storageKey}-code-verifier`,u),c=await se(u),h=u===c?"plain":"s256"}const{error:d}=await w(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:a,data:(t=l==null?void 0:l.data)!==null&&t!==void 0?t:{},create_user:(s=l==null?void 0:l.shouldCreateUser)!==null&&s!==void 0?s:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},code_challenge:c,code_challenge_method:h},redirectTo:l==null?void 0:l.emailRedirectTo});return{data:{user:null,session:null},error:d}}if("phone"in e){const{phone:a,options:l}=e,{data:c,error:h}=await w(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:a,data:(r=l==null?void 0:l.data)!==null&&r!==void 0?r:{},create_user:(n=l==null?void 0:l.shouldCreateUser)!==null&&n!==void 0?n:!0,gotrue_meta_security:{captcha_token:l==null?void 0:l.captchaToken},channel:(o=l==null?void 0:l.channel)!==null&&o!==void 0?o:"sms"}});return{data:{user:null,session:null,messageId:c==null?void 0:c.message_id},error:h}}throw new ke("You must provide either an email or phone number.")}catch(a){if(b(a))return{data:{user:null,session:null},error:a};throw a}}async verifyOtp(e){var t,s;try{e.type!=="email_change"&&e.type!=="phone_change"&&await this._removeSession();let r,n;"options"in e&&(r=(t=e.options)===null||t===void 0?void 0:t.redirectTo,n=(s=e.options)===null||s===void 0?void 0:s.captchaToken);const{data:o,error:a}=await w(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:n}}),redirectTo:r,xform:z});if(a)throw a;if(!o)throw new Error("An error occurred on token verification.");const l=o.session,c=o.user;return l!=null&&l.access_token&&(await this._saveSession(l),await this._notifyAllSubscribers("SIGNED_IN",l)),{data:{user:c,session:l},error:null}}catch(r){if(b(r))return{data:{user:null,session:null},error:r};throw r}}async signInWithSSO(e){var t,s,r;try{await this._removeSession();let n=null,o=null;if(this.flowType==="pkce"){const a=te();await W(this.storage,`${this.storageKey}-code-verifier`,a),n=await se(a),o=a===n?"plain":"s256"}return await w(this.fetch,"POST",`${this.url}/sso`,{body:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({},"providerId"in e?{provider_id:e.providerId}:null),"domain"in e?{domain:e.domain}:null),{redirect_to:(s=(t=e.options)===null||t===void 0?void 0:t.redirectTo)!==null&&s!==void 0?s:void 0}),!((r=e==null?void 0:e.options)===null||r===void 0)&&r.captchaToken?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0,code_challenge:n,code_challenge_method:o}),headers:this.headers,xform:wr})}catch(n){if(b(n))return{data:null,error:n};throw n}}async reauthenticate(){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._reauthenticate())}async _reauthenticate(){try{return await this._useSession(async e=>{const{data:{session:t},error:s}=e;if(s)throw s;if(!t)throw new re;const{error:r}=await w(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:r}})}catch(e){if(b(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{e.type!="email_change"&&e.type!="phone_change"&&await this._removeSession();const t=`${this.url}/resend`;if("email"in e){const{email:s,type:r,options:n}=e,{error:o}=await w(this.fetch,"POST",t,{headers:this.headers,body:{email:s,type:r,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}},redirectTo:n==null?void 0:n.emailRedirectTo});return{data:{user:null,session:null},error:o}}else if("phone"in e){const{phone:s,type:r,options:n}=e,{data:o,error:a}=await w(this.fetch,"POST",t,{headers:this.headers,body:{phone:s,type:r,gotrue_meta_security:{captcha_token:n==null?void 0:n.captchaToken}}});return{data:{user:null,session:null,messageId:o==null?void 0:o.message_id},error:a}}throw new ke("You must provide either an email or phone number and a type")}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async getSession(){return await this.initializePromise,this._acquireLock(-1,async()=>this._useSession(async e=>e))}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(this.lockAcquired){const s=this.pendingInLock.length?this.pendingInLock[this.pendingInLock.length-1]:Promise.resolve(),r=(async()=>(await s,await t()))();return this.pendingInLock.push((async()=>{try{await r}catch{}})()),r}return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{this.lockAcquired=!0;const s=t();for(this.pendingInLock.push((async()=>{try{await s}catch{}})()),await s;this.pendingInLock.length;){const r=[...this.pendingInLock];await Promise.all(r),this.pendingInLock.splice(0,r.length)}return await s}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey),this.lockAcquired=!1}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");try{const t=await this.__loadSession();return await e(t)}finally{this._debug("#_useSession","end")}}async __loadSession(){this._debug("#__loadSession()","begin"),this.lockAcquired||this._debug("#__loadSession()","used outside of an acquired lock!",new Error().stack);try{let e=null;const t=await we(this.storage,this.storageKey);if(this._debug("#getSession()","session from storage",t),t!==null&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession())),!e)return{data:{session:null},error:null};const s=e.expires_at?e.expires_at<=Date.now()/1e3:!1;if(this._debug("#__loadSession()",`session has${s?"":" not"} expired`,"expires_at",e.expires_at),!s)return{data:{session:e},error:null};const{session:r,error:n}=await this._callRefreshToken(e.refresh_token);return n?{data:{session:null},error:n}:{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){return e?await this._getUser(e):(await this.initializePromise,this._acquireLock(-1,async()=>await this._getUser()))}async _getUser(e){try{return e?await w(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:G}):await this._useSession(async t=>{var s,r;const{data:n,error:o}=t;if(o)throw o;return await w(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:(r=(s=n.session)===null||s===void 0?void 0:s.access_token)!==null&&r!==void 0?r:void 0,xform:G})})}catch(t){if(b(t))return{data:{user:null},error:t};throw t}}async updateUser(e,t={}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._updateUser(e,t))}async _updateUser(e,t={}){try{return await this._useSession(async s=>{const{data:r,error:n}=s;if(n)throw n;if(!r.session)throw new re;const o=r.session;let a=null,l=null;if(this.flowType==="pkce"&&e.email!=null){const d=te();await W(this.storage,`${this.storageKey}-code-verifier`,d),a=await se(d),l=d===a?"plain":"s256"}const{data:c,error:h}=await w(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:t==null?void 0:t.emailRedirectTo,body:Object.assign(Object.assign({},e),{code_challenge:a,code_challenge_method:l}),jwt:o.access_token,xform:G});if(h)throw h;return o.user=c.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(s){if(b(s))return{data:{user:null},error:s};throw s}}_decodeJWT(e){return ot(e)}async setSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._setSession(e))}async _setSession(e){try{if(!e.access_token||!e.refresh_token)throw new re;const t=Date.now()/1e3;let s=t,r=!0,n=null;const o=ot(e.access_token);if(o.exp&&(s=o.exp,r=s<=t),r){const{session:a,error:l}=await this._callRefreshToken(e.refresh_token);if(l)return{data:{user:null,session:null},error:l};if(!a)return{data:{user:null,session:null},error:null};n=a}else{const{data:a,error:l}=await this._getUser(e.access_token);if(l)throw l;n={access_token:e.access_token,refresh_token:e.refresh_token,user:a.user,token_type:"bearer",expires_in:s-t,expires_at:s},await this._saveSession(n),await this._notifyAllSubscribers("SIGNED_IN",n)}return{data:{user:n.user,session:n},error:null}}catch(t){if(b(t))return{data:{session:null,user:null},error:t};throw t}}async refreshSession(e){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._refreshSession(e))}async _refreshSession(e){try{return await this._useSession(async t=>{var s;if(!e){const{data:o,error:a}=t;if(a)throw a;e=(s=o.session)!==null&&s!==void 0?s:void 0}if(!(e!=null&&e.refresh_token))throw new re;const{session:r,error:n}=await this._callRefreshToken(e.refresh_token);return n?{data:{user:null,session:null},error:n}:r?{data:{user:r.user,session:r},error:null}:{data:{user:null,session:null},error:null}})}catch(t){if(b(t))return{data:{user:null,session:null},error:t};throw t}}async _getSessionFromURL(e){try{if(!J())throw new Se("No browser detected.");if(this.flowType==="implicit"&&!this._isImplicitGrantFlow())throw new Se("Not a valid implicit grant flow url.");if(this.flowType=="pkce"&&!e)throw new at("Not a valid PKCE flow url.");const t=Ce(window.location.href);if(e){if(!t.code)throw new at("No code detected.");const{data:k,error:E}=await this._exchangeCodeForSession(t.code);if(E)throw E;const v=new URL(window.location.href);return v.searchParams.delete("code"),window.history.replaceState(window.history.state,"",v.toString()),{data:{session:k.session,redirectType:null},error:null}}if(t.error||t.error_description||t.error_code)throw new Se(t.error_description||"Error in URL with unspecified error_description",{error:t.error||"unspecified_error",code:t.error_code||"unspecified_code"});const{provider_token:s,provider_refresh_token:r,access_token:n,refresh_token:o,expires_in:a,expires_at:l,token_type:c}=t;if(!n||!a||!o||!c)throw new Se("No session defined in URL");const h=Math.round(Date.now()/1e3),d=parseInt(a);let u=h+d;l&&(u=parseInt(l));const f=u-h;f*1e3<=le&&console.warn(`@supabase/gotrue-js: Session as retrieved from URL expires in ${f}s, should have been closer to ${d}s`);const g=u-d;h-g>=120?console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued over 120s ago, URL could be stale",g,u,h):h-g<0&&console.warn("@supabase/gotrue-js: Session as retrieved from URL was issued in the future? Check the device clok for skew",g,u,h);const{data:p,error:_}=await this._getUser(n);if(_)throw _;const S={provider_token:s,provider_refresh_token:r,access_token:n,expires_in:d,expires_at:u,refresh_token:o,token_type:c,user:p.user};return window.location.hash="",this._debug("#_getSessionFromURL()","clearing window.location.hash"),{data:{session:S,redirectType:t.type},error:null}}catch(t){if(b(t))return{data:{session:null,redirectType:null},error:t};throw t}}_isImplicitGrantFlow(){const e=Ce(window.location.href);return!!(J()&&(e.access_token||e.error_description))}async _isPKCEFlow(){const e=Ce(window.location.href),t=await we(this.storage,`${this.storageKey}-code-verifier`);return!!(e.code&&t)}async signOut(e={scope:"global"}){return await this.initializePromise,await this._acquireLock(-1,async()=>await this._signOut(e))}async _signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var s;const{data:r,error:n}=t;if(n)return{error:n};const o=(s=r.session)===null||s===void 0?void 0:s.access_token;if(o){const{error:a}=await this.admin.signOut(o,e);if(a&&!(_r(a)&&(a.status===404||a.status===401)))return{error:a}}return e!=="others"&&(await this._removeSession(),await xe(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){const t=ar(),s={id:t,callback:e,unsubscribe:()=>{this._debug("#unsubscribe()","state change callback with id removed",t),this.stateChangeEmitters.delete(t)}};return this._debug("#onAuthStateChange()","registered callback with id",t),this.stateChangeEmitters.set(t,s),(async()=>(await this.initializePromise,await this._acquireLock(-1,async()=>{this._emitInitialSession(t)})))(),{data:{subscription:s}}}async _emitInitialSession(e){return await this._useSession(async t=>{var s,r;try{const{data:{session:n},error:o}=t;if(o)throw o;await((s=this.stateChangeEmitters.get(e))===null||s===void 0?void 0:s.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(n){await((r=this.stateChangeEmitters.get(e))===null||r===void 0?void 0:r.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",n),console.error(n)}})}async resetPasswordForEmail(e,t={}){let s=null,r=null;if(this.flowType==="pkce"){const n=te();await W(this.storage,`${this.storageKey}-code-verifier`,n),s=await se(n),r=n===s?"plain":"s256"}try{return await w(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:s,code_challenge_method:r,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(n){if(b(n))return{data:null,error:n};throw n}}async _refreshAccessToken(e){const t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{const s=Date.now();return await ur(async r=>(await hr(r*200),this._debug(t,"refreshing attempt",r),await w(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:z})),(r,n,o)=>o&&o.error&<(o.error)&&Date.now()+(r+1)*200-s{try{await a.callback(e,t)}catch(l){n.push(l)}});if(await Promise.all(o),n.length>0){for(let a=0;athis._autoRefreshTokenTick(),le);this.autoRefreshTicker=e,e&&typeof e=="object"&&typeof e.unref=="function"?e.unref():typeof Deno<"u"&&typeof Deno.unrefTimer=="function"&&Deno.unrefTimer(e),setTimeout(async()=>{await this.initializePromise,await this._autoRefreshTokenTick()},0)}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");const e=this.autoRefreshTicker;this.autoRefreshTicker=null,e&&clearInterval(e)}async startAutoRefresh(){this._removeVisibilityChangedCallback(),await this._startAutoRefresh()}async stopAutoRefresh(){this._removeVisibilityChangedCallback(),await this._stopAutoRefresh()}async _autoRefreshTokenTick(){this._debug("#_autoRefreshTokenTick()","begin");try{await this._acquireLock(0,async()=>{try{const e=Date.now();try{return await this._useSession(async t=>{const{data:{session:s}}=t;if(!s||!s.refresh_token||!s.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}const r=Math.floor((s.expires_at*1e3-e)/le);this._debug("#_autoRefreshTokenTick()",`access token expires in ${r} ticks, a tick lasts ${le}ms, refresh threshold is ${dt} ticks`),r<=dt&&await this._callRefreshToken(s.refresh_token)})}catch(t){console.error("Auto refresh tick failed with error. This is likely a transient error.",t)}}finally{this._debug("#_autoRefreshTokenTick()","end")}})}catch(e){if(e.isAcquireTimeout||e instanceof Rr)this._debug("auto refresh token tick lock not available");else throw e}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!J()||!(window!=null&&window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),window==null||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){const t=`#_onVisibilityChanged(${e})`;this._debug(t,"visibilityState",document.visibilityState),document.visibilityState==="visible"?(this.autoRefreshToken&&this._startAutoRefresh(),e||(await this.initializePromise,await this._acquireLock(-1,async()=>{if(document.visibilityState!=="visible"){this._debug(t,"acquired the lock to recover the session, but the browser visibilityState is no longer visible, aborting");return}await this._recoverAndRefresh()}))):document.visibilityState==="hidden"&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t){const s=[`provider=${encodeURIComponent(e)}`];if(t!=null&&t.redirectTo&&s.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),t!=null&&t.scopes&&s.push(`scopes=${encodeURIComponent(t.scopes)}`),this.flowType==="pkce"){const r=te();await W(this.storage,`${this.storageKey}-code-verifier`,r);const n=await se(r),o=r===n?"plain":"s256";this._debug("PKCE","code verifier",`${r.substring(0,5)}...`,"code challenge",n,"method",o);const a=new URLSearchParams({code_challenge:`${encodeURIComponent(n)}`,code_challenge_method:`${encodeURIComponent(o)}`});s.push(a.toString())}if(t!=null&&t.queryParams){const r=new URLSearchParams(t.queryParams);s.push(r.toString())}return`${this.url}/authorize?${s.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var s;const{data:r,error:n}=t;return n?{data:null,error:n}:await w(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(b(t))return{data:null,error:t};throw t}}async _enroll(e){try{return await this._useSession(async t=>{var s,r;const{data:n,error:o}=t;if(o)return{data:null,error:o};const{data:a,error:l}=await w(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:(s=n==null?void 0:n.session)===null||s===void 0?void 0:s.access_token});return l?{data:null,error:l}:(!((r=a==null?void 0:a.totp)===null||r===void 0)&&r.qr_code&&(a.totp.qr_code=`data:image/svg+xml;utf-8,${a.totp.qr_code}`),{data:a,error:null})})}catch(t){if(b(t))return{data:null,error:t};throw t}}async _verify(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var s;const{data:r,error:n}=t;if(n)return{data:null,error:n};const{data:o,error:a}=await w(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token});return a?{data:null,error:a}:(await this._saveSession(Object.assign({expires_at:Math.round(Date.now()/1e3)+o.expires_in},o)),await this._notifyAllSubscribers("MFA_CHALLENGE_VERIFIED",o),{data:o,error:a})})}catch(t){if(b(t))return{data:null,error:t};throw t}})}async _challenge(e){return this._acquireLock(-1,async()=>{try{return await this._useSession(async t=>{var s;const{data:r,error:n}=t;return n?{data:null,error:n}:await w(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:(s=r==null?void 0:r.session)===null||s===void 0?void 0:s.access_token})})}catch(t){if(b(t))return{data:null,error:t};throw t}})}async _challengeAndVerify(e){const{data:t,error:s}=await this._challenge({factorId:e.factorId});return s?{data:null,error:s}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){const{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};const s=(e==null?void 0:e.factors)||[],r=s.filter(n=>n.factor_type==="totp"&&n.status==="verified");return{data:{all:s,totp:r},error:null}}async _getAuthenticatorAssuranceLevel(){return this._acquireLock(-1,async()=>await this._useSession(async e=>{var t,s;const{data:{session:r},error:n}=e;if(n)return{data:null,error:n};if(!r)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};const o=this._decodeJWT(r.access_token);let a=null;o.aal&&(a=o.aal);let l=a;((s=(t=r.user.factors)===null||t===void 0?void 0:t.filter(d=>d.status==="verified"))!==null&&s!==void 0?s:[]).length>0&&(l="aal2");const h=o.amr||[];return{data:{currentLevel:a,nextLevel:l,currentAuthenticationMethods:h},error:null}}))}}_e.nextInstanceID=0;class Lr extends _e{constructor(e){super(e)}}var Dr=globalThis&&globalThis.__awaiter||function(i,e,t,s){function r(n){return n instanceof t?n:new t(function(o){o(n)})}return new(t||(t=Promise))(function(n,o){function a(h){try{c(s.next(h))}catch(d){o(d)}}function l(h){try{c(s.throw(h))}catch(d){o(d)}}function c(h){h.done?n(h.value):r(h.value).then(a,l)}c((s=s.apply(i,e||[])).next())})};const Ur={headers:Zs},Nr={schema:"public"},Fr={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},qr={};class Mr{constructor(e,t,s){var r,n,o,a,l,c,h,d;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw new Error("supabaseUrl is required.");if(!t)throw new Error("supabaseKey is required.");const u=ir(e);this.realtimeUrl=`${u}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${u}/auth/v1`,this.storageUrl=`${u}/storage/v1`,this.functionsUrl=`${u}/functions/v1`;const f=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,g={db:Nr,realtime:qr,auth:Object.assign(Object.assign({},Fr),{storageKey:f}),global:Ur},p=nr(s??{},g);this.storageKey=(n=(r=p.auth)===null||r===void 0?void 0:r.storageKey)!==null&&n!==void 0?n:"",this.headers=(a=(o=p.global)===null||o===void 0?void 0:o.headers)!==null&&a!==void 0?a:{},this.auth=this._initSupabaseAuthClient((l=p.auth)!==null&&l!==void 0?l:{},this.headers,(c=p.global)===null||c===void 0?void 0:c.fetch),this.fetch=rr(t,this._getAccessToken.bind(this),(h=p.global)===null||h===void 0?void 0:h.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},p.realtime)),this.rest=new Je(`${u}/rest/v1`,{headers:this.headers,schema:(d=p.db)===null||d===void 0?void 0:d.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new Yt(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new Qs(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}schema(e){return this.rest.schema(e)}rpc(e,t={},s){return this.rest.rpc(e,t,s)}channel(e,t={config:{}}){return this.realtime.channel(e,t)}getChannels(){return this.realtime.getChannels()}removeChannel(e){return this.realtime.removeChannel(e)}removeAllChannels(){return this.realtime.removeAllChannels()}_getAccessToken(){var e,t;return Dr(this,void 0,void 0,function*(){const{data:s}=yield this.auth.getSession();return(t=(e=s.session)===null||e===void 0?void 0:e.access_token)!==null&&t!==void 0?t:null})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,storageKey:n,flowType:o,debug:a},l,c){const h={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new Lr({url:this.authUrl,headers:Object.assign(Object.assign({},h),l),storageKey:n,autoRefreshToken:e,persistSession:t,detectSessionInUrl:s,storage:r,flowType:o,debug:a,fetch:c})}_initRealtimeClient(e){return new Fs(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},e==null?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((t,s)=>{this._handleTokenChanged(t,"CLIENT",s==null?void 0:s.access_token)})}_handleTokenChanged(e,t,s){(e==="TOKEN_REFRESHED"||e==="SIGNED_IN")&&this.changedAccessToken!==s?(this.realtime.setAuth(s??null),this.changedAccessToken=s):e==="SIGNED_OUT"&&(this.realtime.setAuth(this.supabaseKey),t=="STORAGE"&&this.auth.signOut(),this.changedAccessToken=void 0)}}const Jr=(i,e,t)=>new Mr(i,e,t);function ft(i,e,t){const s=i.slice();return s[13]=e[t],s[15]=t,s}function gt(i,e,t){const s=i.slice();return s[16]=e[t].day,s[17]=e[t].month,s[18]=e[t].date,s}function pt(i,e,t){const s=i.slice();return s[22]=e[t],s[15]=t,s}function Br(i){return{c:N,l:N,m:N,p:N,d:N}}function zr(i){let e,t=i[12].data&&Hr(i);return{c(){t&&t.c(),e=K()},l(s){t&&t.l(s),e=K()},m(s,r){t&&t.m(s,r),P(s,e,r)},p(s,r){s[12].data&&t.p(s,r)},d(s){s&&O(e),t&&t.d(s)}}}function Hr(i){let e=[],t=new Map,s,r=ne(i[2]);const n=o=>o[15];for(let o=0;oo[15];for(let o=0;oe,k.anchor=null},p(E,v){i=E,kt(k,i,v)},d(E){E&&O(e),k.block.d(),k.token=null,k=null}}}function vt(i,e){let t,s,r=ne(e[13]),n=[];for(let o=0;o

    Schedule

    Please enter your name and select sessions.
    After that click the "Register" button or click "Unregister" to unregister from them.

    `,n,o,a,l,c="Register",h,d,u="Unregister",f,g,p,_,S,k,E,v;e=new zt({});let $={ctx:i,current:null,token:null,hasCatch:!1,pending:Xr,then:zr,catch:Br,value:12};return wt(i[0].from("Attendance").select("*"),$),_=new Ht({}),{c(){Ge(e.$$.fragment),t=q(),s=A("section"),s.innerHTML=r,n=q(),o=A("section"),a=A("div"),l=A("button"),l.textContent=c,h=q(),d=A("button"),d.textContent=u,f=q(),g=A("section"),$.block.c(),p=q(),Ge(_.$$.fragment),S=X(";"),this.h()},l(m){Ke(e.$$.fragment,m),t=M(m),s=I(m,"SECTION",{class:!0,"data-svelte-h":!0}),ue(s)!=="svelte-kcx1mb"&&(s.innerHTML=r),n=M(m),o=I(m,"SECTION",{class:!0});var y=B(o);a=I(y,"DIV",{class:!0});var R=B(a);l=I(R,"BUTTON",{id:!0,class:!0,"data-svelte-h":!0}),ue(l)!=="svelte-n2hczi"&&(l.textContent=c),h=M(R),d=I(R,"BUTTON",{id:!0,class:!0,"data-svelte-h":!0}),ue(d)!=="svelte-18no8w1"&&(d.textContent=u),R.forEach(O),y.forEach(O),f=M(m),g=I(m,"SECTION",{class:!0});var L=B(g);$.block.l(L),L.forEach(O),p=M(m),Ke(_.$$.fragment,m),S=Q(m,";"),this.h()},h(){x(s,"class","py-20 px-4 border-b shadow-2xl sm:px-6 md:px-8 border-primary/40"),x(l,"id","register"),x(l,"class","p-5 shadow-lg rounded-lg text-center bg-secondary text-secondary-on display-small"),x(d,"id","unregister"),x(d,"class","p-5 shadow-lg rounded-lg text-center bg-secondary text-secondary-on display-small"),x(a,"class","grid grid-cols-2 justify-items-center"),x(o,"class","py-5 px-4 shadow-2xl sm:px-6 md:px-8"),x(g,"class","w-full h-full grid gap-y-5 gap-x-12 lg:grid-cols-2 2xl:grid-cols-3 justify-center place-items-center p-12 xl:px-20 2xl:px-30")},m(m,y){Ve(e,m,y),P(m,t,y),P(m,s,y),P(m,n,y),P(m,o,y),j(o,a),j(a,l),j(a,h),j(a,d),P(m,f,y),P(m,g,y),$.block.m(g,$.anchor=null),$.mount=()=>g,$.anchor=null,P(m,p,y),Ve(_,m,y),P(m,S,y),k=!0,E||(v=[We(l,"click",i[3]),We(d,"click",i[4])],E=!0)},p(m,[y]){i=m,kt($,i,y)},i(m){k||(Te(e.$$.fragment,m),Te(_.$$.fragment,m),k=!0)},o(m){Ae(e.$$.fragment,m),Ae(_.$$.fragment,m),k=!1},d(m){m&&(O(t),O(s),O(n),O(o),O(f),O(g),O(p),O(S)),Xe(e,m),$.block.d(),$.token=null,$=null,Xe(_,m),E=!1,bt(v)}}}const Yr=12,yt="19:00 - 21:00";async function Zr(i,e,t){if(!i)return null;let s=[];for(let r=0;r{o=localStorage.getItem("name")?localStorage.getItem("name"):o,document.getElementById("name").value=o});function a(u){localStorage.setItem("name",u),o=u,document.getElementById("name").value=o}function l(){let u=document.getElementById("name").value;return u?(a(u),!0):(alert("Please enter a valid name."),!1)}for(let u=0;u + - - - Stavanger HEMA - Allheim - - + + + Stavanger HEMA - Allheim + + - - - + + + - + - + - - - + + + - - - - -
    -

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!


    Unpublished © 2023 + + + + +
    +

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    -
    - +
    + diff --git a/contact.html b/contact.html index 7dd6cbb..e39fca6 100644 --- a/contact.html +++ b/contact.html @@ -1,41 +1,42 @@ - + - - - Stavanger HEMA - Allheim - - + + + Stavanger HEMA - Allheim + + - - - + + + - + - + - - - + + + - - - - -
    -

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!


    Unpublished © 2023 + + + + +
    +

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    -
    - +
    + diff --git a/index.html b/index.html index f310fd5..316fb1d 100644 --- a/index.html +++ b/index.html @@ -1,41 +1,42 @@ - + - - - Stavanger HEMA - Allheim - - + + + Stavanger HEMA - Allheim + + - - - + + + - + - + - - - + + + - - - - -
    -

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!


    Unpublished © 2023 + + + + +
    +

    Stavanger HEMA - Allheim

    Rogalands most consistent HEMA club!

    -
    - +
    + diff --git a/pricing.html b/pricing.html index d9eac66..bee1262 100644 --- a/pricing.html +++ b/pricing.html @@ -1,41 +1,42 @@ - + - - - Stavanger HEMA - Allheim - - + + + Stavanger HEMA - Allheim + + - - - + + + - + - + - - - + + + - - - - -
    -

    Pricing

    Stavanger HEMA - Allheim

    1 500.- / 6 months


    Unpublished © 2023 + + + + +
    +

    Pricing

    Stavanger HEMA - Allheim

    1 500.- / 6 months

    -
    - +
    + diff --git a/schedule.html b/schedule.html index 5aa94b0..0401175 100644 --- a/schedule.html +++ b/schedule.html @@ -1,42 +1,43 @@ - + - - - Stavanger HEMA - Allheim - - + + + Stavanger HEMA - Allheim + + - - - + + + - + - + - - - + + + - - - - -
    -

    Schedule

    Please enter your name and select sessions.
    + + + + +
    +

    Schedule

    Please enter your name and select sessions.
    After that click the "Register" button or click "Unregister" to unregister from them.

    Loading...

    ;
    -
    - +

    +