PageSourceSearch

https://aioftheday.com/_next/static/chunks/pages/_app-abede2e146a9f284.js

js aioftheday.com collected 2026-10-05 19:44:46 UTC 266,922 bytes, 191 lines download raw bytes

1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[888],{3848:function(e,t){"use strict";var r="undefined"!=typeof window,n=[],i=function(){(!r||window.splitbee)&&(s.track=window.splitbee.track,s.user=window.splitbee.user,s.enableCookie=window.splitbee.enableCookie,s.reset=window.splitbee.reset,n.forEach(function(e){"track"===e.type?window.splitbee.track.apply(null,e.payload):"user"===e.type?window.splitbee.user.set.apply(null,e.payload):"enableCookie"===e.type?window.splitbee.enableCookie.apply(null,e.payload):"reset"===e.type&&window.splitbee.reset()}),n=[])},o=function(e){return function(){try{for(var t=arguments.length,o=Array(t),s=0;s<t;s++)o[s]=arguments[s];return n.push({type:e,payload:o}),r&&window.splitbee&&i(),Promise.resolve()}catch(e){return Promise.reject(e)}}},s={track:o("track"),user:{set:o("user")},init:function(e){if(r&&!window.splitbee){var t=window.document,n=null!=e&&e.scriptUrl?e.scriptUrl:"https://cdn.splitbee.io/sb.js",o=t.querySelector("script[src='"+n+"']");if(o){o.onload=i;return}var s=t.createElement("script");s.src=n,s.async=!0,e&&(e.apiUrl&&(s.dataset.api=e.apiUrl),e.token&&(s.dataset.token=e.token),e.disableCookie&&(s.dataset.noCookie="1")),s.onload=i,t.head.appendChild(s)}},enableCookie:o("enableCookie"),reset:o("reset")};t.Z=s},4184:function(e,t){var r;/*!
2	Copyright (c) 2018 Jed Watson.
3	Licensed under the MIT License (MIT), see
4	http://jedwatson.github.io/classnames
5*/!function(){"use strict";var n={}.hasOwnProperty;function i(){for(var e=[],t=0;t<arguments.length;t++){var r=arguments[t];if(r){var o=typeof r;if("string"===o||"number"===o)e.push(r);else if(Array.isArray(r)){if(r.length){var s=i.apply(null,r);s&&e.push(s)}}else if("object"===o){if(r.toString!==Object.prototype.toString&&!r.toString.toString().includes("[native code]")){e.push(r.toString());continue}for(var a in r)n.call(r,a)&&r[a]&&e.push(a)}}}return e.join(" ")}e.exports?(i.default=i,e.exports=i):void 0!==(r=(function(){return i}).apply(t,[]))&&(e.exports=r)}()},2350:function(){},4098:function(e,t){var r,n="undefined"!=typeof self?self:this,i=function(){function e(){this.fetch=!1,this.DOMException=n.DOMException}return e.prototype=n,new e}();r=i,function(e){var t={searchParams:"URLSearchParams"in r,iterable:"Symbol"in r&&"iterator"in Symbol,blob:"FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in r,arrayBuffer:"ArrayBuffer"in r};if(t.arrayBuffer)var n=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],i=ArrayBuffer.isView||function(e){return e&&n.indexOf(Object.prototype.toString.call(e))>-1};function o(e){if("string"!=typeof e&&(e=String(e)),/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(e))throw TypeError("Invalid character in header field name");return e.toLowerCase()}function s(e){return"string"!=typeof e&&(e=String(e)),e}function a(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return t.iterable&&(r[Symbol.iterator]=function(){return r}),r}function l(e){this.map={},e instanceof l?e.forEach(function(e,t){this.append(t,e)},this):Array.isArray(e)?e.forEach(function(e){this.append(e[0],e[1])},this):e&&Object.getOwnPropertyNames(e).forEach(function(t){this.append(t,e[t])},this)}function u(e){if(e.bodyUsed)return Promise.reject(TypeError("Already read"));e.bodyUsed=!0}function c(e){return new Promise(function(t,r){e.onload=function(){t(e.result)},e.onerror=function(){r(e.error)}})}function h(e){var t=new FileReader,r=c(t);return t.readAsArrayBuffer(e),r}function d(e){if(e.slice)return e.slice(0);var t=new Uint8Array(e.byteLength);return t.set(new Uint8Array(e)),t.buffer}function f(){return this.bodyUsed=!1,this._initBody=function(e){if(this._bodyInit=e,e){if("string"==typeof e)this._bodyText=e;else if(t.blob&&Blob.prototype.isPrototypeOf(e))this._bodyBlob=e;else if(t.formData&&FormData.prototype.isPrototypeOf(e))this._bodyFormData=e;else if(t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e))this._bodyText=e.toString();else{var r;t.arrayBuffer&&t.blob&&(r=e)&&DataView.prototype.isPrototypeOf(r)?(this._bodyArrayBuffer=d(e.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):t.arrayBuffer&&(ArrayBuffer.prototype.isPrototypeOf(e)||i(e))?this._bodyArrayBuffer=d(e):this._bodyText=e=Object.prototype.toString.call(e)}}else this._bodyText="";!this.headers.get("content-type")&&("string"==typeof e?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):t.searchParams&&URLSearchParams.prototype.isPrototypeOf(e)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},t.blob&&(this.blob=function(){var e=u(this);if(e)return e;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(!this._bodyFormData)return Promise.resolve(new Blob([this._bodyText]));throw Error("could not read FormData body as blob")},this.arrayBuffer=function(){return this._bodyArrayBuffer?u(this)||Promise.resolve(this._bodyArrayBuffer):this.blob().then(h)}),this.text=function(){var e,t,r,n=u(this);if(n)return n;if(this._bodyBlob)return e=this._bodyBlob,r=c(t=new FileReader),t.readAsText(e),r;if(this._bodyArrayBuffer)return Promise.resolve(function(e){for(var t=new Uint8Array(e),r=Array(t.length),n=0;n<t.length;n++)r[n]=String.fromCharCode(t[n]);return r.join("")}(this._bodyArrayBuffer));if(!this._bodyFormData)return Promise.resolve(this._bodyText);throw Error("could not read FormData body as text")},t.formData&&(this.formData=function(){return this.text().then(y)}),this.json=function(){return this.text().then(JSON.parse)},this}l.prototype.append=function(e,t){e=o(e),t=s(t);var r=this.map[e];this.map[e]=r?r+", "+t:t},l.prototype.delete=function(e){delete this.map[o(e)]},l.prototype.get=function(e){return e=o(e),this.has(e)?this.map[e]:null},l.prototype.has=function(e){return this.map.hasOwnProperty(o(e))},l.prototype.set=function(e,t){this.map[o(e)]=s(t)},l.prototype.forEach=function(e,t){for(var r in this.map)this.map.hasOwnProperty(r)&&e.call(t,this.map[r],r,this)},l.prototype.keys=function(){var e=[];return this.forEach(function(t,r){e.push(r)}),a(e)},l.prototype.values=function(){var e=[];return this.forEach(function(t){e.push(t)}),a(e)},l.prototype.entries=function(){var e=[];return this.forEach(function(t,r){e.push([r,t])}),a(e)},t.iterable&&(l.prototype[Symbol.iterator]=l.prototype.entries);
5var p=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];function v(e,t){var r,n,i=(t=t||{}).body;if(e instanceof v){if(e.bodyUsed)throw TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new l(e.headers)),this.method=e.method,this.mode=e.mode,this.signal=e.signal,i||null==e._bodyInit||(i=e._bodyInit,e.bodyUsed=!0)}else this.url=String(e);if(this.credentials=t.credentials||this.credentials||"same-origin",(t.headers||!this.headers)&&(this.headers=new l(t.headers)),this.method=(n=(r=t.method||this.method||"GET").toUpperCase(),p.indexOf(n)>-1?n:r),this.mode=t.mode||this.mode||null,this.signal=t.signal||this.signal,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw TypeError("Body not allowed for GET or HEAD requests");this._initBody(i)}function y(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var r=e.split("="),n=r.shift().replace(/\+/g," "),i=r.join("=").replace(/\+/g," ");t.append(decodeURIComponent(n),decodeURIComponent(i))}}),t}function m(e,t){t||(t={}),this.type="default",this.status=void 0===t.status?200:t.status,this.ok=this.status>=200&&this.status<300,this.statusText="statusText"in t?t.statusText:"OK",this.headers=new l(t.headers),this.url=t.url||"",this._initBody(e)}v.prototype.clone=function(){return new v(this,{body:this._bodyInit})},f.call(v.prototype),f.call(m.prototype),m.prototype.clone=function(){return new m(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new l(this.headers),url:this.url})},m.error=function(){var e=new m(null,{status:0,statusText:""});return e.type="error",e};var g=[301,302,303,307,308];m.redirect=function(e,t){if(-1===g.indexOf(t))throw RangeError("Invalid status code");return new m(null,{status:t,headers:{location:e}})},e.DOMException=r.DOMException;try{new e.DOMException}catch(t){e.DOMException=function(e,t){this.message=e,this.name=t;var r=Error(e);this.stack=r.stack},e.DOMException.prototype=Object.create(Error.prototype),e.DOMException.prototype.constructor=e.DOMException}function _(r,n){return new Promise(function(i,o){var s=new v(r,n);if(s.signal&&s.signal.aborted)return o(new e.DOMException("Aborted","AbortError"));var a=new XMLHttpRequest;function u(){a.abort()}a.onload=function(){var e,t,r={status:a.status,statusText:a.statusText,headers:(e=a.getAllResponseHeaders()||"",t=new l,e.replace(/\r?\n[\t ]+/g," ").split(/\r?\n/).forEach(function(e){var r=e.split(":"),n=r.shift().trim();if(n){var i=r.join(":").trim();t.append(n,i)}}),t)};r.url="responseURL"in a?a.responseURL:r.headers.get("X-Request-URL");var n="response"in a?a.response:a.responseText;i(new m(n,r))},a.onerror=function(){o(TypeError("Network request failed"))},a.ontimeout=function(){o(TypeError("Network request failed"))},a.onabort=function(){o(new e.DOMException("Aborted","AbortError"))},a.open(s.method,s.url,!0),"include"===s.credentials?a.withCredentials=!0:"omit"===s.credentials&&(a.withCredentials=!1),"responseType"in a&&t.blob&&(a.responseType="blob"),s.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),s.signal&&(s.signal.addEventListener("abort",u),a.onreadystatechange=function(){4===a.readyState&&s.signal.removeEventListener("abort",u)}),a.send(void 0===s._bodyInit?null:s._bodyInit)})}_.polyfill=!0,r.fetch||(r.fetch=_,r.Headers=l,r.Request=v,r.Response=m),e.Headers=l,e.Request=v,e.Response=m,e.fetch=_,Object.defineProperty(e,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill,(t=i.fetch).default=i.fetch,t.fetch=i.fetch,t.Headers=i.Headers,t.Request=i.Request,t.Response=i.Response,e.exports=t},284:function(e){var t=function(){if("object"==typeof self&&self)return self;if("object"==typeof window&&window)return window;throw Error("Unable to resolve global `this`")};e.exports=function(){if(this)return this;if("object"==typeof globalThis&&globalThis)return globalThis;try{Object.defineProperty(Object.prototype,"__global__",{get:function(){return this},configurable:!0})}catch(e){return t()}try{if(!__global__)return t();return __global__}finally{delete Object.prototype.__global__}}()},8679:function(e,t,r){"use strict";var n=r(9864),i={childContextTypes:!0,contextType:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,getDerivedStateFromError:!0,getDerivedStateFromProps:!0,mixins:!0,propTypes:!0,type:!0},o={name:!0,length:!0,prototype:!0,caller:!0,callee:!0,arguments:!0,arity:!0},s={$$typeof:!0,compare:!0,defaultProps:!0,displayName:!0,propTypes:!0,type:!0},a={};function l(e){return n.isMemo(e)?s:a[e.$$typeof]||i}a[n.ForwardRef]={$$typeof:!0,render:!0,defaultProps:!0,displayName:!0,propTypes:!0},a[n.Memo]=s;var u=Object.defineProperty,c=Object.getOwnPropertyNames,h=Object.getOwnPropertySymbols,d=Object.getOwnPropertyDescriptor,f=Object.getPrototypeOf,p=Object.prototype;e.exports=function e(t,r,n){if("string"!=typeof r){if(p){var i=f(r);i&&i!==p&&e(t,i,n)}var s=c(r);h&&(s=s.concat(h(r)));for(var a=l(t),v=l(r),y=0;y<s.length;++y){var m=s[y];if(!o[m]&&!(n&&n[m])&&!(v&&v[m])&&!(a&&a[m])){var g=d(r,m);try{u(t,m,g)}catch(e){}}}}return t}},9548:function(e,t,r){"use strict";var n=r(4836);
5Object.defineProperty(t,"__esModule",{value:!0}),t.BroadcastChannel=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"nextauth.message";return{receive:function(t){var r=function(r){if(r.key===e){var n,i=JSON.parse(null!==(n=r.newValue)&&void 0!==n?n:"{}");(null==i?void 0:i.event)==="session"&&null!=i&&i.data&&t(i)}};return window.addEventListener("storage",r),function(){return window.removeEventListener("storage",r)}},post:function(t){if("undefined"!=typeof window)try{localStorage.setItem(e,JSON.stringify(l(l({},t),{},{timestamp:h()})))}catch(e){}}}},t.apiBaseUrl=c,t.fetchData=function(e,t,r){return u.apply(this,arguments)},t.now=h;var i=n(r(4687)),o=n(r(8416)),s=n(r(7156));function a(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a(Object(r),!0).forEach(function(t){(0,o.default)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function u(){return(u=(0,s.default)(i.default.mark(function e(t,r,n){var o,s,a,u,h,d,f,p,v,y=arguments;return i.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=(o=y.length>3&&void 0!==y[3]?y[3]:{}).ctx,u=void 0===(a=o.req)?null==s?void 0:s.req:a,h="".concat(c(r),"/").concat(t),e.prev=2,f={headers:l({"Content-Type":"application/json"},null!=u&&null!==(d=u.headers)&&void 0!==d&&d.cookie?{cookie:u.headers.cookie}:{})},null!=u&&u.body&&(f.body=JSON.stringify(u.body),f.method="POST"),e.next=7,fetch(h,f);case 7:return p=e.sent,e.next=10,p.json();case 10:if(v=e.sent,p.ok){e.next=13;break}throw v;case 13:return e.abrupt("return",Object.keys(v).length>0?v:null);case 16:return e.prev=16,e.t0=e.catch(2),n.error("CLIENT_FETCH_ERROR",{error:e.t0,url:h}),e.abrupt("return",null);case 20:case"end":return e.stop()}},e,null,[[2,16]])}))).apply(this,arguments)}function c(e){return"undefined"==typeof window?"".concat(e.baseUrlServer).concat(e.basePathServer):e.basePath}function h(){return Math.floor(Date.now()/1e3)}},6925:function(e,t,r){"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.UnsupportedStrategy=t.UnknownError=t.OAuthCallbackError=t.MissingSecret=t.MissingAuthorize=t.MissingAdapterMethods=t.MissingAdapter=t.MissingAPIRoute=t.InvalidCallbackUrl=t.AccountNotLinkedError=void 0,t.adapterErrorHandler=function(e,t){if(e)return Object.keys(e).reduce(function(r,n){return r[n]=(0,o.default)(i.default.mark(function r(){var o,s,a,l,u,c=arguments;return i.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:for(r.prev=0,s=Array(o=c.length),a=0;a<o;a++)s[a]=c[a];return t.debug("adapter_".concat(n),{args:s}),l=e[n],r.next=6,l.apply(void 0,s);case 6:return r.abrupt("return",r.sent);case 9:throw r.prev=9,r.t0=r.catch(0),t.error("adapter_error_".concat(n),r.t0),(u=new p(r.t0)).name="".concat(E(n),"Error"),u;case 15:case"end":return r.stop()}},r,null,[[0,9]])})),r},{})},t.capitalize=E,t.eventsErrorHandler=function(e,t){return Object.keys(e).reduce(function(r,n){return r[n]=(0,o.default)(i.default.mark(function r(){var o,s=arguments;return i.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,o=e[n],r.next=4,o.apply(void 0,s);case 4:return r.abrupt("return",r.sent);case 7:r.prev=7,r.t0=r.catch(0),t.error("".concat(T(n),"_EVENT_ERROR"),r.t0);case 10:case"end":return r.stop()}},r,null,[[0,7]])})),r},{})},t.upperSnake=T;var i=n(r(4687)),o=n(r(7156)),s=n(r(6115)),a=n(r(8416)),l=n(r(6690)),u=n(r(9728)),c=n(r(1655)),h=n(r(4993)),d=n(r(3808));function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,n=(0,d.default)(e);if(t){var i=(0,d.default)(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return(0,h.default)(this,r)}}var p=function(e){(0,c.default)(r,e);var t=f(r);function r(e){var n,i;return(0,l.default)(this,r),(i=t.call(this,null!==(n=null==e?void 0:e.message)&&void 0!==n?n:e)).name="UnknownError",i.code=e.code,e instanceof Error&&(i.stack=e.stack),i}return(0,u.default)(r,[{key:"toJSON",value:function(){return{name:this.name,message:this.message,stack:this.stack}}}]),r}((0,n(r(3496)).default)(Error));t.UnknownError=p;var v=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","OAuthCallbackError"),e}return(0,u.default)(r)}(p);t.OAuthCallbackError=v;var y=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","AccountNotLinkedError"),e}return(0,u.default)(r)}(p);t.AccountNotLinkedError=y;var m=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","MissingAPIRouteError"),(0,a.default)((0,s.default)(e),"code","MISSING_NEXTAUTH_API_ROUTE_ERROR"),e}return(0,u.default)(r)}(p);t.MissingAPIRoute=m;var g=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","MissingSecretError"),(0,a.default)((0,s.default)(e),"code","NO_SECRET"),e}return(0,u.default)(r)}(p);t.MissingSecret=g;var _=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","MissingAuthorizeError"),(0,a.default)((0,s.default)(e),"code","CALLBACK_CREDENTIALS_HANDLER_ERROR"),e}return(0,u.default)(r)}(p);t.MissingAuthorize=_;var b=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","MissingAdapterError"),(0,a.default)((0,s.default)(e),"code","
5EMAIL_REQUIRES_ADAPTER_ERROR"),e}return(0,u.default)(r)}(p);t.MissingAdapter=b;var w=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","MissingAdapterMethodsError"),(0,a.default)((0,s.default)(e),"code","MISSING_ADAPTER_METHODS_ERROR"),e}return(0,u.default)(r)}(p);t.MissingAdapterMethods=w;var S=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","UnsupportedStrategyError"),(0,a.default)((0,s.default)(e),"code","CALLBACK_CREDENTIALS_JWT_ERROR"),e}return(0,u.default)(r)}(p);t.UnsupportedStrategy=S;var x=function(e){(0,c.default)(r,e);var t=f(r);function r(){var e;(0,l.default)(this,r);for(var n=arguments.length,i=Array(n),o=0;o<n;o++)i[o]=arguments[o];return e=t.call.apply(t,[this].concat(i)),(0,a.default)((0,s.default)(e),"name","InvalidCallbackUrl"),(0,a.default)((0,s.default)(e),"code","INVALID_CALLBACK_URL_ERROR"),e}return(0,u.default)(r)}(p);function T(e){return e.replace(/([A-Z])/g,"_$1").toUpperCase()}function E(e){return"".concat(e[0].toUpperCase()).concat(e.slice(1))}t.InvalidCallbackUrl=x},3299:function(e,t,r){"use strict";var n,i,o,s,a,l=r(3454),u=r(4836),c=r(8698);Object.defineProperty(t,"__esModule",{value:!0});var h={SessionContext:!0,useSession:!0,getSession:!0,getCsrfToken:!0,getProviders:!0,signIn:!0,signOut:!0,SessionProvider:!0};t.SessionContext=void 0,t.SessionProvider=function(e){if(!O)throw Error("React Context is unavailable in Server Components");var t,r,n,i,o,s,a=e.children,l=e.basePath,u=e.refetchInterval,c=e.refetchWhenOffline;l&&(k.basePath=l);var h=void 0!==e.session;k._lastSync=h?(0,_.now)():0;var f=y.useState(function(){return h&&(k._session=e.session),e.session}),m=(0,v.default)(f,2),g=m[0],w=m[1],S=y.useState(!h),x=(0,v.default)(S,2),T=x[0],E=x[1];y.useEffect(function(){return k._getSession=(0,p.default)(d.default.mark(function e(){var t,r,n=arguments;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=(n.length>0&&void 0!==n[0]?n[0]:{}).event,e.prev=1,!((r="storage"===t)||void 0===k._session)){e.next=10;break}return k._lastSync=(0,_.now)(),e.next=7,j({broadcast:!r});case 7:return k._session=e.sent,w(k._session),e.abrupt("return");case 10:if(!(!t||null===k._session||(0,_.now)()<k._lastSync)){e.next=12;break}return e.abrupt("return");case 12:return k._lastSync=(0,_.now)(),e.next=15,j();case 15:k._session=e.sent,w(k._session),e.next=22;break;case 19:e.prev=19,e.t0=e.catch(1),A.error("CLIENT_SESSION_ERROR",e.t0);case 22:return e.prev=22,E(!1),e.finish(22);case 25:case"end":return e.stop()}},e,null,[[1,19,22,25]])})),k._getSession(),function(){k._lastSync=0,k._session=void 0,k._getSession=function(){}}},[]),y.useEffect(function(){var e=R.receive(function(){return k._getSession({event:"storage"})});return function(){return e()}},[]),y.useEffect(function(){var t=e.refetchOnWindowFocus,r=void 0===t||t,n=function(){r&&"visible"===document.visibilityState&&k._getSession({event:"visibilitychange"})};return document.addEventListener("visibilitychange",n,!1),function(){return document.removeEventListener("visibilitychange",n,!1)}},[e.refetchOnWindowFocus]);var C=(t=y.useState("undefined"!=typeof navigator&&navigator.onLine),n=(r=(0,v.default)(t,2))[0],i=r[1],o=function(){return i(!0)},s=function(){return i(!1)},y.useEffect(function(){return window.addEventListener("online",o),window.addEventListener("offline",s),function(){window.removeEventListener("online",o),window.removeEventListener("offline",s)}},[]),n),N=!1!==c||C;y.useEffect(function(){if(u&&N){var e=setInterval(function(){k._session&&k._getSession({event:"poll"})},1e3*u);return function(){return clearInterval(e)}}},[u,N]);var L=y.useMemo(function(){return{data:g,status:T?"loading":g?"authenticated":"unauthenticated",update:function(e){return(0,p.default)(d.default.mark(function t(){var r;return d.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if(!(T||!g)){t.next=2;break}return t.abrupt("return");case 2:return E(!0),t.t0=_.fetchData,t.t1=k,t.t2=A,t.next=8,P();case 8:return t.t3=t.sent,t.t4=e,t.t5={csrfToken:t.t3,data:t.t4},t.t6={body:t.t5},t.t7={req:t.t6},t.next=15,(0,t.t0)("session",t.t1,t.t2,t.t7);case 15:return r=t.sent,E(!1),r&&(w(r),R.post({event:"session",data:{trigger:"getSession"}})),t.abrupt("return",r);case 19:case"end":return t.stop()}},t)}))()}}},[g,T]);return(0,b.jsx)(O.Provider,{value:L,children:a})},t.getCsrfToken=P,t.getProviders=L,t.getSession=j,t.signIn=function(e,t,r){return M.apply(this,arguments)},t.signOut=function(e){return U.apply(this,arguments)},t.useSession=function(e){if(!O)throw Error("React Context is unavailable in Server Components");var t=y.useContext(O),r=null!=e?e:{},n=r.required,i=r.onUnauthenticated,o=n&&"unauthenticated"===t.status;return(y.useEffect(function(){if(o){var e="/api/auth/signin?".concat(new 
5URLSearchParams({error:"SessionRequired",callbackUrl:window.location.href}));i?i():window.location.href=e}},[o,i]),o)?{data:t.data,update:t.update,status:"loading"}:t};var d=u(r(4687)),f=u(r(8416)),p=u(r(7156)),v=u(r(7424)),y=x(r(7294)),m=x(r(6553)),g=u(r(762)),_=r(9548),b=r(5893),w=r(527);function S(e){if("function"!=typeof WeakMap)return null;var t=new WeakMap,r=new WeakMap;return(S=function(e){return e?r:t})(e)}function x(e,t){if(!t&&e&&e.__esModule)return e;if(null===e||"object"!==c(e)&&"function"!=typeof e)return{default:e};var r=S(t);if(r&&r.has(e))return r.get(e);var n={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var o in e)if("default"!==o&&Object.prototype.hasOwnProperty.call(e,o)){var s=i?Object.getOwnPropertyDescriptor(e,o):null;s&&(s.get||s.set)?Object.defineProperty(n,o,s):n[o]=e[o]}return n.default=e,r&&r.set(e,n),n}function T(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function E(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?T(Object(r),!0).forEach(function(t){(0,f.default)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):T(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}
5Object.keys(w).forEach(function(e){!("default"===e||"__esModule"===e||Object.prototype.hasOwnProperty.call(h,e))&&(e in t&&t[e]===w[e]||Object.defineProperty(t,e,{enumerable:!0,get:function(){return w[e]}}))});var k={baseUrl:(0,g.default)(null!==(n=l.env.NEXTAUTH_URL)&&void 0!==n?n:l.env.VERCEL_URL).origin,basePath:(0,g.default)(l.env.NEXTAUTH_URL).path,baseUrlServer:(0,g.default)(null!==(i=null!==(o=l.env.NEXTAUTH_URL_INTERNAL)&&void 0!==o?o:l.env.NEXTAUTH_URL)&&void 0!==i?i:l.env.VERCEL_URL).origin,basePathServer:(0,g.default)(null!==(s=l.env.NEXTAUTH_URL_INTERNAL)&&void 0!==s?s:l.env.NEXTAUTH_URL).path,_lastSync:0,_session:void 0,_getSession:function(){}},R=(0,_.BroadcastChannel)(),A=(0,m.proxyLogger)(m.default,k.basePath),O=null===(a=y.createContext)||void 0===a?void 0:a.call(y,void 0);function j(e){return C.apply(this,arguments)}function C(){return(C=(0,p.default)(d.default.mark(function e(t){var r,n;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.fetchData)("session",k,A,t);case 2:return n=e.sent,(null===(r=null==t?void 0:t.broadcast)||void 0===r||r)&&R.post({event:"session",data:{trigger:"getSession"}}),e.abrupt("return",n);case 5:case"end":return e.stop()}},e)}))).apply(this,arguments)}function P(e){return N.apply(this,arguments)}function N(){return(N=(0,p.default)(d.default.mark(function e(t){var r;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.fetchData)("csrf",k,A,t);case 2:return r=e.sent,e.abrupt("return",null==r?void 0:r.csrfToken);case 4:case"end":return e.stop()}},e)}))).apply(this,arguments)}function L(){return I.apply(this,arguments)}function I(){return(I=(0,p.default)(d.default.mark(function e(){return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,_.fetchData)("providers",k,A);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}},e)}))).apply(this,arguments)}function M(){return(M=(0,p.default)(d.default.mark(function e(t,r,n){var i,o,s,a,l,u,c,h,f,p,v,y,m,g,b,w,S;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return s=void 0===(o=(i=null!=r?r:{}).callbackUrl)?window.location.href:o,l=void 0===(a=i.redirect)||a,u=(0,_.apiBaseUrl)(k),e.next=4,L();case 4:if(c=e.sent){e.next=8;break}return window.location.href="".concat(u,"/error"),e.abrupt("return");case 8:if(!(!t||!(t in c))){e.next=11;break}return window.location.href="".concat(u,"/signin?").concat(new URLSearchParams({callbackUrl:s})),e.abrupt("return");case 11:return h="credentials"===c[t].type,f="email"===c[t].type,p=h||f,v="".concat(u,"/").concat(h?"callback":"signin","/").concat(t),y="".concat(v,"?").concat(new URLSearchParams(n)),e.t0=fetch,e.t1=y,e.t2={"Content-Type":"application/x-www-form-urlencoded"},e.t3=URLSearchParams,e.t4=E,e.t5=E({},r),e.t6={},e.next=25,P();case 25:return e.t7=e.sent,e.t8=s,e.t9={csrfToken:e.t7,callbackUrl:e.t8,json:!0},e.t10=(0,e.t4)(e.t5,e.t6,e.t9),e.t11=new e.t3(e.t10),e.t12={method:"post",headers:e.t2,body:e.t11},e.next=33,(0,e.t0)(e.t1,e.t12);case 33:return m=e.sent,e.next=36,m.json();case 36:if(g=e.sent,!(l||!p)){e.next=42;break}return w=null!==(b=g.url)&&void 0!==b?b:s,window.location.href=w,w.includes("#")&&window.location.reload(),e.abrupt("return");case 42:if(S=new URL(g.url).searchParams.get("error"),!m.ok){e.next=46;break}return e.next=46,k._getSession({event:"storage"});case 46:return e.abrupt("return",{error:S,status:m.status,ok:m.ok,url:S?null:g.url});case 47:case"end":return e.stop()}},e)}))).apply(this,arguments)}function U(){return(U=(0,p.default)(d.default.mark(function e(t){var r,n,i,o,s,a,l,u,c;return d.default.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return i=void 0===(n=(null!=t?t:{}).callbackUrl)?window.location.href:n,o=(0,_.apiBaseUrl)(k),e.t0={"Content-Type":"application/x-www-form-urlencoded"},e.t1=URLSearchParams,e.next=6,P();case 6:return e.t2=e.sent,e.t3=i,e.t4={csrfToken:e.t2,callbackUrl:e.t3,json:!0},e.t5=new e.t1(e.t4),s={method:"post",headers:e.t0,body:e.t5},e.next=13,fetch("".concat(o,"/signout"),s);case 13:return a=e.sent,e.next=16,a.json();case 16:if(l=e.sent,R.post({event:"session",data:{trigger:"signout"}}),!(null===(r=null==t?void 0:t.redirect)||void 0===r||r)){e.next=23;break}return c=null!==(u=l.url)&&void 0!==u?u:i,window.location.href=c,c.includes("#")&&window.location.reload(),e.abrupt("return");case 23:return e.next=25,k._getSession({event:"storage"});case 25:return e.abrupt("return",l);case 26:case"end":return e.stop()}},e)}))).apply(this,arguments)}t.SessionContext=O},527:function(e,t){"use strict";
5Object.defineProperty(t,"__esModule",{value:!0})},6553:function(e,t,r){"use strict";var n=r(4836);Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0,t.proxyLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:l,t=arguments.length>1?arguments[1]:void 0;try{if("undefined"==typeof window)return e;var r={},n=function(e){r[e]=function(r,n){l[e](r,n),"error"===e&&(n=a(n)),n.client=!0;var o="".concat(t,"/_log"),u=new URLSearchParams(function(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?s(Object(r),!0).forEach(function(t){(0,i.default)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):s(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}({level:e,code:r},n));return navigator.sendBeacon?navigator.sendBeacon(o,u):fetch(o,{method:"POST",body:u,keepalive:!0})}};for(var o in e)n(o);return r}catch(e){return l}},t.setLogger=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=arguments.length>1?arguments[1]:void 0;t||(l.debug=function(){}),e.error&&(l.error=e.error),e.warn&&(l.warn=e.warn),e.debug&&(l.debug=e.debug)};var i=n(r(8416)),o=r(6925);function s(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function a(e){var t;return e instanceof Error&&!(e instanceof o.UnknownError)?{message:e.message,stack:e.stack,name:e.name}:(null!=e&&e.error&&(e.error=a(e.error),e.message=null!==(t=e.message)&&void 0!==t?t:e.error.message),e)}var l={error:function(e,t){t=a(t),console.error("[next-auth][error][".concat(e,"]"),"\nhttps://next-auth.js.org/errors#".concat(e.toLowerCase()),t.message,t)},warn:function(e){console.warn("[next-auth][warn][".concat(e,"]"),"\nhttps://next-auth.js.org/warnings#".concat(e.toLowerCase()))},debug:function(e,t){console.log("[next-auth][debug][".concat(e,"]"),t)}};t.default=l},762:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){var t;let r=new URL("http://localhost:3000/api/auth");e&&!e.startsWith("http")&&(e=`https://${e}`);let n=new URL(null!==(t=e)&&void 0!==t?t:r),i=("/"===n.pathname?r.pathname:n.pathname).replace(/\/$/,""),o=`${n.origin}${i}`;return{origin:n.origin,host:n.host,path:i,base:o,toString:()=>o}}},3454:function(e,t,r){"use strict";var n,i;e.exports=(null==(n=r.g.process)?void 0:n.env)&&"object"==typeof(null==(i=r.g.process)?void 0:i.env)?r.g.process:r(7663)},1118:function(e,t,r){(window.__NEXT_P=window.__NEXT_P||[]).push(["/_app",function(){return r(9924)}])},1210:function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.getDomainLocale=function(e,t,r,n){return!1},("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},8418:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=r(2648).Z,i=r(7273).Z,o=n(r(7294)),s=r(3297),a=r(4634),l=r(4611),u=r(3794),c=r(2725),h=r(3462),d=r(1018),f=r(7190),p=r(1210),v=r(8684);let y=new Set;function m(e,t,r,n,i){if(i||a.isLocalURL(t)){if(!n.bypassPrefetchedCheck){let i=void 0!==n.locale?n.locale:"locale"in e?e.locale:void 0,o=t+"%"+r+"%"+i;if(y.has(o))return;y.add(o)}Promise.resolve(e.prefetch(t,r,n)).catch(e=>{})}}function g(e){return"string"==typeof e?e:l.formatUrl(e)}let _=o.default.forwardRef(function(e,t){let r,n;let{href:l,as:y,children:_,prefetch:b,passHref:w,replace:S,shallow:x,scroll:T,locale:E,onClick:k,onMouseEnter:R,onTouchStart:A,legacyBehavior:O=!1}=e,j=i(e,["href","as","children","prefetch","passHref","replace","shallow","scroll","locale","onClick","onMouseEnter","onTouchStart","legacyBehavior"]);r=_,O&&("string"==typeof r||"number"==typeof r)&&(r=o.default.createElement("a",null,r));let C=!1!==b,P=o.default.useContext(h.RouterContext),N=o.default.useContext(d.AppRouterContext),L=null!=P?P:N,I=!P,{href:M,as:U}=o.default.useMemo(()=>
5{if(!P){let e=g(l);return{href:e,as:y?g(y):e}}let[e,t]=s.resolveHref(P,l,!0);return{href:e,as:y?s.resolveHref(P,y):t||e}},[P,l,y]),$=o.default.useRef(M),D=o.default.useRef(U);O&&(n=o.default.Children.only(r));let B=O?n&&"object"==typeof n&&n.ref:t,[V,z,F]=f.useIntersection({rootMargin:"200px"}),q=o.default.useCallback(e=>{(D.current!==U||$.current!==M)&&(F(),D.current=U,$.current=M),V(e),B&&("function"==typeof B?B(e):"object"==typeof B&&(B.current=e))},[U,B,M,F,V]);o.default.useEffect(()=>{L&&z&&C&&m(L,M,U,{locale:E},I)},[U,M,z,E,C,null==P?void 0:P.locale,L,I]);let H={ref:q,onClick(e){O||"function"!=typeof k||k(e),O&&n.props&&"function"==typeof n.props.onClick&&n.props.onClick(e),L&&!e.defaultPrevented&&function(e,t,r,n,i,s,l,u,c,h){let{nodeName:d}=e.currentTarget,f="A"===d.toUpperCase();if(f&&(function(e){let t=e.currentTarget,r=t.getAttribute("target");return r&&"_self"!==r||e.metaKey||e.ctrlKey||e.shiftKey||e.altKey||e.nativeEvent&&2===e.nativeEvent.which}(e)||!c&&!a.isLocalURL(r)))return;e.preventDefault();let p=()=>{"beforePopState"in t?t[i?"replace":"push"](r,n,{shallow:s,locale:u,scroll:l}):t[i?"replace":"push"](n||r,{forceOptimisticNavigation:!h})};c?o.default.startTransition(p):p()}(e,L,M,U,S,x,T,E,I,C)},onMouseEnter(e){O||"function"!=typeof R||R(e),O&&n.props&&"function"==typeof n.props.onMouseEnter&&n.props.onMouseEnter(e),L&&(C||!I)&&m(L,M,U,{locale:E,priority:!0,bypassPrefetchedCheck:!0},I)},onTouchStart(e){O||"function"!=typeof A||A(e),O&&n.props&&"function"==typeof n.props.onTouchStart&&n.props.onTouchStart(e),L&&(C||!I)&&m(L,M,U,{locale:E,priority:!0,bypassPrefetchedCheck:!0},I)}};if(u.isAbsoluteUrl(U))H.href=U;else if(!O||w||"a"===n.type&&!("href"in n.props)){let e=void 0!==E?E:null==P?void 0:P.locale,t=(null==P?void 0:P.isLocaleDomain)&&p.getDomainLocale(U,e,null==P?void 0:P.locales,null==P?void 0:P.domainLocales);H.href=t||v.addBasePath(c.addLocale(U,e,null==P?void 0:P.defaultLocale))}return O?o.default.cloneElement(n,H):o.default.createElement("a",Object.assign({},j,H),r)});t.default=_,("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},7190:function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.useIntersection=function(e){let{rootRef:t,rootMargin:r,disabled:l}=e,u=l||!o,[c,h]=n.useState(!1),d=n.useRef(null),f=n.useCallback(e=>{d.current=e},[]);n.useEffect(()=>{if(o){if(u||c)return;let e=d.current;if(e&&e.tagName){let n=function(e,t,r){let{id:n,observer:i,elements:o}=function(e){let t;let r={root:e.root||null,margin:e.rootMargin||""},n=a.find(e=>e.root===r.root&&e.margin===r.margin);if(n&&(t=s.get(n)))return t;let i=new Map,o=new IntersectionObserver(e=>{e.forEach(e=>{let t=i.get(e.target),r=e.isIntersecting||e.intersectionRatio>0;t&&r&&t(r)})},e);return t={id:r,observer:o,elements:i},a.push(r),s.set(r,t),t}(r);return o.set(e,t),i.observe(e),function(){if(o.delete(e),i.unobserve(e),0===o.size){i.disconnect(),s.delete(n);let e=a.findIndex(e=>e.root===n.root&&e.margin===n.margin);e>-1&&a.splice(e,1)}}}(e,e=>e&&h(e),{root:null==t?void 0:t.current,rootMargin:r});return n}}else if(!c){let e=i.requestIdleCallback(()=>h(!0));return()=>i.cancelIdleCallback(e)}},[u,r,t,c,d.current]);let p=n.useCallback(()=>{h(!1)},[]);return[f,c,p]};var n=r(7294),i=r(9311);let o="function"==typeof IntersectionObserver,s=new Map,a=[];("function"==typeof t.default||"object"==typeof t.default&&null!==t.default)&&void 0===t.default.__esModule&&(Object.defineProperty(t.default,"__esModule",{value:!0}),Object.assign(t.default,t),e.exports=t.default)},1045:function(e,t,r){var n=r(3454);r(2350);var i=r(7294),o=i&&"object"==typeof i&&"default"in i?i:{default:i};function s(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}var a=void 0!==n&&n.env&&!0,l=function(e){return"[object String]"===Object.prototype.toString.call(e)},u=function(){function e(e){var t=void 0===e?{}:e,r=t.name,n=void 0===r?"stylesheet":r,i=t.optimizeForSpeed,o=void 0===i?a:i;c(l(n),"`name` must be a string"),this._name=n,this._deletedRulePlaceholder="#"+n+"-deleted-rule____{}",c("boolean"==typeof o,"`optimizeForSpeed` must be a boolean"),this._optimizeForSpeed=o,this._serverSheet=void 0,this._tags=[],this._injected=!1,this._rulesCount=0;var s=document.querySelector('meta[property="csp-nonce"]');this._nonce=s?s.getAttribute("content"):null}var t,r=e.prototype;return r.setOptimizeForSpeed=function(e){c("boolean"==typeof e,"`setOptimizeForSpeed` accepts a boolean"),c(0===this._rulesCount,"optimizeForSpeed cannot be when rules have already been inserted"),this.flush(),this._optimizeForSpeed=e,this.inject()},r.isOptimizeForSpeed=function(){return this._optimizeForSpeed},r.inject=function(){var e=this;if(c(!this._injected,"sheet already injected"),this._injected=!0,this._optimizeForSpeed){this._tags[0]=this.makeStyleTag(this._name),this._optimizeForSpeed="insertRule"in this.get
5Sheet(),this._optimizeForSpeed||(a||console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode."),this.flush(),this._injected=!0);return}this._serverSheet={cssRules:[],insertRule:function(t,r){return"number"==typeof r?e._serverSheet.cssRules[r]={cssText:t}:e._serverSheet.cssRules.push({cssText:t}),r},deleteRule:function(t){e._serverSheet.cssRules[t]=null}}},r.getSheetForTag=function(e){if(e.sheet)return e.sheet;for(var t=0;t<document.styleSheets.length;t++)if(document.styleSheets[t].ownerNode===e)return document.styleSheets[t]},r.getSheet=function(){return this.getSheetForTag(this._tags[this._tags.length-1])},r.insertRule=function(e,t){if(c(l(e),"`insertRule` accepts only strings"),this._optimizeForSpeed){var r=this.getSheet();"number"!=typeof t&&(t=r.cssRules.length);try{r.insertRule(e,t)}catch(t){return a||console.warn("StyleSheet: illegal rule: \n\n"+e+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),-1}}else{var n=this._tags[t];this._tags.push(this.makeStyleTag(this._name,e,n))}return this._rulesCount++},r.replaceRule=function(e,t){if(this._optimizeForSpeed){var r=this.getSheet();if(t.trim()||(t=this._deletedRulePlaceholder),!r.cssRules[e])return e;r.deleteRule(e);try{r.insertRule(t,e)}catch(n){a||console.warn("StyleSheet: illegal rule: \n\n"+t+"\n\nSee https://stackoverflow.com/q/20007992 for more info"),r.insertRule(this._deletedRulePlaceholder,e)}}else{var n=this._tags[e];c(n,"old rule at index `"+e+"` not found"),n.textContent=t}return e},r.deleteRule=function(e){if(this._optimizeForSpeed)this.replaceRule(e,"");else{var t=this._tags[e];c(t,"rule at index `"+e+"` not found"),t.parentNode.removeChild(t),this._tags[e]=null}},r.flush=function(){this._injected=!1,this._rulesCount=0,this._tags.forEac
5h(function(e){return e&&e.parentNode.removeChild(e)}),this._tags=[]},r.cssRules=function(){var e=this;return this._tags.reduce(function(t,r){return r?t=t.concat(Array.prototype.map.call(e.getSheetForTag(r).cssRules,function(t){return t.cssText===e._deletedRulePlaceholder?null:t})):t.push(null),t},[])},r.makeStyleTag=function(e,t,r){t&&c(l(t),"makeStyleTag accepts only strings as second parameter");var n=document.createElement("style");this._nonce&&n.setAttribute("nonce",this._nonce),n.type="text/css",n.setAttribute("data-"+e,""),t&&n.appendChild(document.createTextNode(t));var i=document.head||document.getElementsByTagName("head")[0];return r?i.insertBefore(n,r):i.appendChild(n),n},s(e.prototype,[{key:"length",get:function(){return this._rulesCount}}]),t&&s(e,t),e}();function c(e,t){if(!e)throw Error("StyleSheet: "+t+".")}var h=function(e){for(var t=5381,r=e.length;r;)t=33*t^e.charCodeAt(--r);return t>>>0},d={};function f(e,t){if(!t)return"jsx-"+e;var r=String(t),n=e+r;return d[n]||(d[n]="jsx-"+h(e+"-"+r)),d[n]}function p(e,t){var r=e+t;return d[r]||(d[r]=t.replace(/__jsx-style-dynamic-selector/g,e)),d[r]}var v=function(){function e(e){var t=void 0===e?{}:e,r=t.styleSheet,n=void 0===r?null:r,i=t.optimizeForSpeed,o=void 0!==i&&i;this._sheet=n||new u({name:"styled-jsx",optimizeForSpeed:o}),this._sheet.inject(),n&&"boolean"==typeof o&&(this._sheet.setOptimizeForSpeed(o),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer=void 0,this._indices={},this._instancesCounts={}}var t=e.prototype;return t.add=function(e){var t=this;void 0===this._optimizeForSpeed&&(this._optimizeForSpeed=Array.isArray(e.children),this._sheet.setOptimizeForSpeed(this._optimizeForSpeed),this._optimizeForSpeed=this._sheet.isOptimizeForSpeed()),this._fromServer||(this._fromServer=this.selectFromServer(),this._instancesCounts=Object.keys(this._fromServer).reduce(function(e,t){return e[t]=0,e},{}));var r=this.getIdAndRules(e),n=r.styleId,i=r.rules;if(n in this._instancesCounts){this._instancesCounts[n]+=1;return}var o=i.map(function(e){return t._sheet.insertRule(e)}).filter(function(e){return -1!==e});this._indices[n]=o,this._instancesCounts[n]=1},t.remove=function(e){var t=this,r=this.getIdAndRules(e).styleId;if(function(e,t){if(!e)throw Error("StyleSheetRegistry: "+t+".")}(r in this._instancesCounts,"styleId: `"+r+"` not found"),this._instancesCounts[r]-=1,this._instancesCounts[r]<1){var n=this._fromServer&&this._fromServer[r];n?(n.parentNode.removeChild(n),delete this._fromServer[r]):(this._indices[r].forEach(function(e){return t._sheet.deleteRule(e)}),delete this._indices[r]),delete this._instancesCounts[r]}},t.update=function(e,t){this.add(t),this.remove(e)},t.flush=function(){this._sheet.flush(),this._sheet.inject(),this._fromServer=void 0,this._indices={},this._instancesCounts={}},t.cssRules=function(){var e=this,t=this._fromServer?Object.keys(this._fromServer).map(function(t){return[t,e._fromServer[t]]}):[],r=this._sheet.cssRules();return t.concat(Object.keys(this._indices).map(function(t){return[t,e._indices[t].map(function(e){return r[e].cssText}).join(e._optimizeForSpeed?"":"\n")]}).filter(function(e){return Boolean(e[1])}))},t.styles=function(e){var t,r;return t=this.cssRules(),void 0===(r=e)&&(r={}),t.map(function(e){var t=e[0],n=e[1];return o.default.createElement("style",{id:"__"+t,key:"__"+t,nonce:r.nonce?r.nonce:void 0,dangerouslySetInnerHTML:{__html:n}})})},t.getIdAndRules=function(e){var t=e.children,r=e.dynamic,n=e.id;if(r){var i=f(n,r);return{styleId:i,rules:Array.isArray(t)?t.map(function(e){return p(i,e)}):[p(i,t)]}}return{styleId:f(n),rules:Array.isArray(t)?t:[t]}},t.selectFromServer=function(){return Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]')).reduce(function(e,t){return e[t.id.slice(2)]=t,e},{})},e}(),y=i.createContext(null);y.displayName="StyleSheetContext";var m=o.default.useInsertionEffect||o.default.useLayoutEffect,g=new v;function _(e){var t=g||i.useContext(y);return t&&m(function(){return t.add(e),function(){t.remove(e)}},[e.id,String(e.dynamic)]),null}_.dynamic=function(e){return e.map(function(e){return f(e[0],e[1])}).join(" ")},t.style=_},357:function(e,t,r){"use strict";e.exports=r(1045).style},2255:function(e,t,r){"use strict";r.d(t,{ET:function(){return p},Es:function(){return i},FB:function(){return h},Fc:function(){return f},Ho:function(){return y},MP:function(){return u},Ne:function(){return a},X$:function(){return d},Zm:function(){return l},_8:function(){return o},aA:function(){return c},jJ:function(){return s},pA:function(){return v}});var n=r(5893);let i=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"icon icon-tabler icon-tabler-chevrons-up",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{d:"M7 11l5-5 5 5M7 17l5-5 5 5"})]}),o=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",x:"0",y:"0",viewBox:"0 0 48 48",children:[(0,n.jsx)("path",{fill:"#FFC107",d:"M43.611 20.083H42V20H24v8h11.303c-1.649 4.657-6.08 8-11.303 8-6.627 0-12-5.373-12-12s5.373-12 12-12c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 12.955 4 4 12.955 4 24s8.955 20 20 20 20-8.955 20-20c0-1.341-.138-2.65-.389-3.917z"}),(0,n.jsx)("path",{fill:"#FF3D00",d:"M6.306 14.691l6.571 4.819C14.655 15.108 18.961 12 24 
512c3.059 0 5.842 1.154 7.961 3.039l5.657-5.657C34.046 6.053 29.268 4 24 4 16.318 4 9.656 8.337 6.306 14.691z"}),(0,n.jsx)("path",{fill:"#4CAF50",d:"M24 44c5.166 0 9.86-1.977 13.409-5.192l-6.19-5.238A11.91 11.91 0 0124 36c-5.202 0-9.619-3.317-11.283-7.946l-6.522 5.025C9.505 39.556 16.227 44 24 44z"}),(0,n.jsx)("path",{fill:"#1976D2",d:"M43.611 20.083H42V20H24v8h11.303a12.04 12.04 0 01-4.087 5.571l.003-.002 6.19 5.238C36.971 39.205 44 34 44 24c0-1.341-.138-2.65-.389-3.917z"})]}),s=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"icon icon-tabler icon-tabler-arrow-narrow-left text-primary",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{d:"M5 12h14M5 12l4 4M5 12l4-4"})]}),a=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"icon icon-tabler icon-tabler-arrow-narrow-right text-primary",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{d:"M5 12h14M15 16l4-4M15 8l4 4"})]}),l=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{fill:"rgba(29,161,242,1)",d:"M22.162 5.656a8.384 8.384 0 01-2.402.658A4.196 4.196 0 0021.6 4c-.82.488-1.719.83-2.656 1.015a4.182 4.182 0 00-7.126 3.814 11.874 11.874 0 01-8.62-4.37 4.168 4.168 0 00-.566 2.103c0 1.45.738 2.731 1.86 3.481a4.168 4.168 0 01-1.894-.523v.052a4.185 4.185 0 003.355 4.101 4.21 4.21 0 01-1.89.072A4.185 4.185 0 007.97 16.65a8.394 8.394 0 01-6.191 1.732 11.83 11.83 0 006.41 1.88c7.693 0 11.9-6.373 11.9-11.9 0-.18-.005-.362-.013-.54a8.496 8.496 0 002.087-2.165z"})]}),u=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{fill:"rgba(255,69,0,1)",d:"M12 22C6.477 22 2 17.523 2 12S6.477 2 12 2s10 4.477 10 10-4.477 10-10 10zm6.67-10a1.46 1.46 0 00-2.47-1 7.12 7.12 0 00-3.85-1.23L13 6.65l2.14.45a1 1 0 10.13-.61L12.82 6a.31.31 0 00-.37.24l-.74 3.47a7.14 7.14 0 00-3.9 1.23 1.46 1.46 0 10-1.61 2.39 2.87 2.87 0 000 .44c0 2.24 2.61 4.06 5.83 4.06s5.83-1.82 5.83-4.06a2.87 2.87 0 000-.44 1.46 1.46 0 00.81-1.33zm-10 1a1 1 0 112 0 1 1 0 01-2 0zm5.81 2.75a3.84 3.84 0 01-2.47.77 3.84 3.84 0 01-2.47-.77.27.27 0 01.38-.38A3.27 3.27 0 0012 16a3.28 3.28 0 002.09-.61.28.28 0 11.39.4v-.04zm-.18-1.71a1 1 0 111-1 1 1 0 01-1.01 1.04l.01-.04z"})]}),c=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{d:"M13.576 17.271l-5.11-2.787a3.5 3.5 0 110-4.968l5.11-2.787a3.5 3.5 0 11.958 1.755l-5.11 2.787a3.514 3.514 0 010 1.458l5.11 2.787a3.5 3.5 0 11-.958 1.755z"})]}),h=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",className:"icon icon-tabler icon-tabler-circle-x",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{d:"M3 12a9 9 0 1018 0 9 9 0 10-18 0M10 10l4 4m0-4l-4 4"})]}),d=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"20",height:"20",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",className:"icon icon-tabler icon-tabler-point text-primary",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{stroke:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{d:"M8 12a4 4 0 108 0 4 4 0 10-8 0"})]}),f=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"none",viewBox:"0 0 33 23",children:[(0,n.jsx)("path",{fill:"red",d:"M31.526 3.924a4.005 4.005 0 00-2.827-2.827C26.847.382 8.913.032 3.71 1.117A4.005 4.005 0 00.884 3.945c-.836 3.667-.9 11.593.02 15.341a4.005 4.005 0 002.827 2.827c3.666.844 21.097.963 24.989 0a4.005 4.005 0 002.826-2.826c.891-3.995.955-11.43-.02-15.362z"}),(0,n.jsx)("path",{fill:"#fff",d:"M21.49 11.605l-8.358-4.793v9.585l8.357-4.792z"})]}),p=()=>(0,n.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"32",height:"32",fill:"#333",viewBox:"0 0 496 512",children:(0,n.jsx)("path",{stroke:"#fff",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"1.5",d:"M165.9 397.4c0 2-2.3 3.6-5.2 3.6-3.3.3-5.6-1.3-5.6-3.6 0-2 2.3-3.6 5.2-3.6 3-.3 5.6 1.3 5.6 3.6zm-31.1-4.5c-.7 2 1.3 4.3 4.3 4.9 2.6 1 5.6 0 6.2-2s-1.3-4.3-4.3-5.2c-2.6-.7-5.5.3-6.2 2.3zm44.2-1.7c-2.9.7-4.9 2.6-4.6 4.9.3 2 2.9 3.3 5.9 2.6 2.9-.7 4.9-2.6 4.6-4.6-.3-1.9-3-3.2-5.9-2.9zM244.8 8C106.1 8 0 113.3 0 252c0 110.9 69.8 205.8 169.5 239.2 12.8 2.3 17.3-5.6 17.3-12.1 0-6.2-.3-40.4-.3-61.4 0 0-70 15-84.7-29.8 0 0-11.4-29.1-27.8-36.6 0 0-22.9-15.7 1.6-15.4 0 0 24.9 2 38.6 25.8 21.9 38.6 58.6 27.5 72.9 20.9 2.3-16 8.8-27.1 16-33.7-55.9-6.2-112.3-14.3-112.3-110.5 0-27.5 7.6-41.3 23.6-58.9-2.6-6.5-11.1-33.3 2.6-67.9 20.9-6.5 69 27 69 27 20-5.6 41.5-8.5 62.8-8.5s42.8 2.9 62.8 8.5c0 0 48.1-33.6 69-27 13.7 34.7 5.2 61.4 2.6 67.9 16 17.7 25.8 31.5 25.8 58.9 0 96.5-58.9 104.2-114.8 110.5 9.2 7.9 17 22.9 17 46.4 0 33.7-.3 75.4-.3 83.6 0 6.5 4.6 14.4 17.3 12.1C428.2 457.8 496 362.9 496 252 496 113.3 383.5 8 244.8 8zM97.2 352.9c-1.3 1-1 3.3.7 5.2 1.6 1.6 3.9 2.3 5.2 1 1.3-1 1-3.3-.7-5.2-1.6-1.6-3.9-2.3-5.2-1zm-10.8-8.1c-.7 1.3.3 2.9 2.3 3.9 1.6 1 3.6.7 4.3-.7.7-1.3-.3-2.9-2.3-3.9-2-.6-3.6-.3-4.3.7zm32.4 35.6c-1.6 1.3-1 4.3 1.3 6.2 2.3 2.3 5.2 2.6 6.5 1 1.3-1.3.7-4.3-1.3-6.2-2.2-2.3-5.2-2.6-6.5-1zm-11.4-14.7c-1.6 1-1.6 3.6 0 5.9 1.6 2.3 4.3 3.3 5.6 2.3 1.6-1.3 1.6-3.9 0-6.2-1.4-2.3-4-3.3-5.6-2z"})}),v=()=>(0,n.jsxs)("svg",{xmlns:"http://www.w3.org/2000/svg",width:"36",height:"36",viewBox:"0 0 24 24",children:[(0,n.jsx)("path",{fill:"none",d:"M0 0h24v24H0z"}),(0,n.jsx)("path",{fill:"rgba(0,119,181,1)",d:"M18.335 18.339H15.67v-4.177c0-.996-.02-2.278-1.39-2.278-1.389 0-1.601 1.084-1.601 2.205v4.25h-2.666V9.75h2.56v1.17h.035c.358-.674 1.228-1.387 2.528-1.387 2.7 0 3.2 1.778 3.2 4.091v4.715zM7.003 8.575a1.546 1.546 0 01-1.548-1.549 1.548 1.548 0 111.547 1.549zm1.336 9.764H5.666V9.75H8.34v8.589zM19.67 3H4.329C3.593 3 3 3.58 3 4.297v15.406C3 20.42 3.594 21 4.328 21h15.338C20.4 21 21 20.42 21 19.703V4.297C21 3.58 20.4 3 19.666 3h.003z"})]}),y=()=>(0,n.jsxs)("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-primary",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,n.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,n.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v1a7 7 0 00-7 7h1z"})]})},9873:function(e,t,r){"use strict";let n;r.d(t,{a5:function(){return tV},Ic:function(){return tz},Z9:function(){return tB},U5:function(){return tD},ZR:function(){return tL},PT:function(){return tI},Xn:function(){return tM},u9:function(){return tU},g1:function(){return t$}});var i,o,s,a,l,u,c,h,d,f,p,v,y,m,g,_,b,w,S,x=r(5893),T=r(7294),E=r(2255),k=r(4184),R=r.n(k),A=r(1664),O=r.n(A),j=r(1163),C=r(3299),P=r(3957);r(4480),r(7989);var N=r(6501);r(3848);let L=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>{var t,n,i,o;return t=void 0,n=void 0,i=void 0,o=function*(){return yield(yield Promise.resolve().then(r.t.bind(r,4098,23))).fetch(...e)}
5,new(i||(i=Promise))(function(e,r){function s(e){try{l(o.next(e))}catch(e){r(e)}}function a(e){try{l(o.throw(e))}catch(e){r(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(s,a)}l((o=o.apply(t,n||[])).next())})}:fetch),(...e)=>t(...e)};class I extends Error{constructor(e,t="FunctionsError",r){super(e),super.name=t,this.context=r}}class M extends I{constructor(e){super("Failed to send a request to the Edge Function","FunctionsFetchError",e)}}class U extends I{constructor(e){super("Relay Error invoking the Edge Function","FunctionsRelayError",e)}}class $ extends I{constructor(e){super("Edge Function returned a non-2xx status code","FunctionsHttpError",e)}}class D{constructor(e,{headers:t={},customFetch:r}={}){this.url=e,this.headers=t,this.fetch=L(r)}setAuth(e){this.headers.Authorization=`Bearer ${e}`}invoke(e,t={}){var r,n,i,o,s;return n=this,i=void 0,o=void 0,s=function*(){try{let n;let{headers:i,method:o,body:s}=t,a={};s&&(i&&!Object.prototype.hasOwnProperty.call(i,"Content-Type")||!i)&&("undefined"!=typeof Blob&&s instanceof Blob||s instanceof ArrayBuffer?(a["Content-Type"]="application/octet-stream",n=s):"string"==typeof s?(a["Content-Type"]="text/plain",n=s):"undefined"!=typeof FormData&&s instanceof FormData?n=s:(a["Content-Type"]="application/json",n=JSON.stringify(s)));let l=yield this.fetch(`${this.url}/${e}`,{method:o||"POST",headers:Object.assign(Object.assign(Object.assign({},a),this.headers),i),body:n}).catch(e=>{throw new M(e)}),u=l.headers.get("x-relay-error");if(u&&"true"===u)throw new U(l);if(!l.ok)throw new $(l);let c=(null!==(r=l.headers.get("Content-Type"))&&void 0!==r?r:"text/plain").split(";")[0].trim();return{data:"application/json"===c?yield l.json():"application/octet-stream"===c?yield l.blob():"multipart/form-data"===c?yield l.formData():yield l.text(),error:null}}catch(e){return{data:null,error:e}}},new(o||(o=Promise))(function(e,t){function r(e){try{l(s.next(e))}catch(e){t(e)}}function a(e){try{l(s.throw(e))}catch(e){t(e)}}function l(t){var n;t.done?e(t.value):((n=t.value)instanceof o?n:new o(function(e){e(n)})).then(r,a)}l((s=s.apply(n,i||[])).next())})}}var B=r(4098),V=r.n(B);class z{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:"undefined"==typeof fetch?this.fetch=V():this.fetch=fetch}throwOnError(){return this.shouldThrowOnError=!0,this}then(e,t){void 0===this.schema||(["GET","HEAD"].includes(this.method)?this.headers["Accept-Profile"]=this.schema:this.headers["Content-Profile"]=this.schema),"GET"!==this.method&&"HEAD"!==this.method&&(this.headers["Content-Type"]="application/json");let r=this.fetch,n=r(this.url.toString(),{method:this.method,headers:this.headers,body:JSON.stringify(this.body),signal:this.signal}).then(async e=>{var t,r,n;let i=null,o=null,s=null,a=e.status,l=e.statusText;if(e.ok){if("HEAD"!==this.method){let t=await e.text();""===t||(o="text/csv"===this.headers.Accept?t:this.headers.Accept&&this.headers.Accept.includes("application/vnd.pgrst.plan+text")?t:JSON.parse(t))}let n=null===(t=this.headers.Prefer)||void 0===t?void 0:t.match(/count=(exact|planned|estimated)/),u=null===(r=e.headers.get("content-range"))||void 0===r?void 0:r.split("/");n&&u&&u.length>1&&(s=parseInt(u[1])),this.isMaybeSingle&&"GET"===this.method&&Array.isArray(o)&&(o.length>1?(i={code:"PGRST116",details:`Results contain ${o.length} rows, application/vnd.pgrst.object+json requires 1 row`,hint:null,message:"JSON object requested, multiple (or no) rows returned"},o=null,s=null,a=406,l="Not Acceptable"):o=1===o.length?o[0]:null)}else{let t=await e.text();try{i=JSON.parse(t),Array.isArray(i)&&404===e.status&&(o=[],i=null,a=200,l="OK")}catch(r){404===e.status&&""===t?(a=204,l="No Content"):i={message:t}}if(i&&this.isMaybeSingle&&(null===(n=null==i?void 0:i.details)||void 0===n?void 0:n.includes("Results contain 0 rows"))&&(i=null,a=200,l="OK"),i&&this.shouldThrowOnError)throw i}let u={error:i,data:o,count:s,status:a,statusText:l};return u});return this.shouldThrowOnError||(n=n.catch(e=>{var t,r,n;return{error:{message:`${null!==(t=null==e?void 0:e.name)&&void 0!==t?t:"FetchError"}: ${null==e?void 0:e.message}`,details:`${null!==(r=null==e?void 0:e.stack)&&void 0!==r?r:""}`,hint:"",code:`${null!==(n=null==e?void 0:e.code)&&void 0!==n?n:""}`},data:null,count:null,status:0,statusText:""}}
5)),n.then(e,t)}}class F extends z{select(e){let t=!1,r=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!t?"":('"'===e&&(t=!t),e)).join("");return this.url.searchParams.set("select",r),this.headers.Prefer&&(this.headers.Prefer+=","),this.headers.Prefer+="return=representation",this}order(e,{ascending:t=!0,nullsFirst:r,foreignTable:n}={}){let i=n?`${n}.order`:"order",o=this.url.searchParams.get(i);return this.url.searchParams.set(i,`${o?`${o},`:""}${e}.${t?"asc":"desc"}${void 0===r?"":r?".nullsfirst":".nullslast"}`),this}limit(e,{foreignTable:t}={}){let r=void 0===t?"limit":`${t}.limit`;return this.url.searchParams.set(r,`${e}`),this}range(e,t,{foreignTable:r}={}){let n=void 0===r?"offset":`${r}.offset`,i=void 0===r?"limit":`${r}.limit`;return this.url.searchParams.set(n,`${e}`),this.url.searchParams.set(i,`${t-e+1}`),this}abortSignal(e){return this.signal=e,this}single(){return this.headers.Accept="application/vnd.pgrst.object+json",this}maybeSingle(){return"GET"===this.method?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:r=!1,buffers:n=!1,wal:i=!1,format:o="text"}={}){let s=[e?"analyze":null,t?"verbose":null,r?"settings":null,n?"buffers":null,i?"wal":null].filter(Boolean).join("|"),a=this.headers.Accept;return this.headers.Accept=`application/vnd.pgrst.plan+${o}; for="${a}"; options=${s};`,this}rollback(){var e;return(null!==(e=this.headers.Prefer)&&void 0!==e?e:"").trim().length>0?this.headers.Prefer+=",tx=rollback":this.headers.Prefer="tx=rollback",this}returns(){return this}}class q extends F{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){let r=t.map(e=>"string"==typeof e&&RegExp("[,()]").test(e)?`"${e}"`:`${e}`).join(",");return this.url.searchParams.append(e,`in.(${r})`),this}contains(e,t){return"string"==typeof t?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"string"==typeof t?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"string"==typeof t?this.url.searchParams.append(e,`ov.${t}`):this.url.searchParams.append(e,`ov.{${t.join(",")}}`),this}textSearch(e,t,{config:r,type:n}={}){let i="";"plain"===n?i="pl":"phrase"===n?i="ph":"websearch"===n&&(i="w");let o=void 0===r?"":`(${r})`;return this.url.searchParams.append(e,`${i}fts${o}.${t}`),this}match(e){return Object.entries(e).forEach(([e,t])=>{this.url.searchParams.append(e,`eq.${t}`)}),this}not(e,t,r){return this.url.searchParams.append(e,`not.${t}.${r}`),this}or(e,{foreignTable:t}={}){let r=t?`${t}.or`:"or";return this.url.searchParams.append(r,`(${e})`),this}filter(e,t,r){return this.url.searchParams.append(e,`${t}.${r}`),this}}class H{constructor(e,{headers:t={},schema:r,fetch:n}){this.url=e,this.headers=t,this.schema=r,this.fetch=n}
5select(e,{head:t=!1,count:r}={}){let n=!1,i=(null!=e?e:"*").split("").map(e=>/\s/.test(e)&&!n?"":('"'===e&&(n=!n),e)).join("");return this.url.searchParams.set("select",i),r&&(this.headers.Prefer=`count=${r}`),new q({method:t?"HEAD":"GET",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}insert(e,{count:t,defaultToNull:r=!0}={}){let n=[];if(this.headers.Prefer&&n.push(this.headers.Prefer),t&&n.push(`count=${t}`),r||n.push("missing=default"),this.headers.Prefer=n.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new q({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}upsert(e,{onConflict:t,ignoreDuplicates:r=!1,count:n,defaultToNull:i=!0}={}){let o=[`resolution=${r?"ignore":"merge"}-duplicates`];if(void 0!==t&&this.url.searchParams.set("on_conflict",t),this.headers.Prefer&&o.push(this.headers.Prefer),n&&o.push(`count=${n}`),i||o.push("missing=default"),this.headers.Prefer=o.join(","),Array.isArray(e)){let t=e.reduce((e,t)=>e.concat(Object.keys(t)),[]);if(t.length>0){let e=[...new Set(t)].map(e=>`"${e}"`);this.url.searchParams.set("columns",e.join(","))}}return new q({method:"POST",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}update(e,{count:t}={}){let r=[];return this.headers.Prefer&&r.push(this.headers.Prefer),t&&r.push(`count=${t}`),this.headers.Prefer=r.join(","),new q({method:"PATCH",url:this.url,headers:this.headers,schema:this.schema,body:e,fetch:this.fetch,allowEmpty:!1})}delete({count:e}={}){let t=[];return e&&t.push(`count=${e}`),this.headers.Prefer&&t.unshift(this.headers.Prefer),this.headers.Prefer=t.join(","),new q({method:"DELETE",url:this.url,headers:this.headers,schema:this.schema,fetch:this.fetch,allowEmpty:!1})}}let G={"X-Client-Info":"postgrest-js/1.7.2"};class K{constructor(e,{headers:t={},schema:r,fetch:n}={}){this.url=e,this.headers=Object.assign(Object.assign({},G),t),this.schema=r,this.fetch=n}from(e){let t=new URL(`${this.url}/${e}`);return new H(t,{headers:Object.assign({},this.headers),schema:this.schema,fetch:this.fetch})}rpc(e,t={},{head:r=!1,count:n}={}){let i,o;let s=new URL(`${this.url}/rpc/${e}`);r?(i="HEAD",Object.entries(t).forEach(([e,t])=>{s.searchParams.append(e,`${t}`)})):(i="POST",o=t);let a=Object.assign({},this.headers);return n&&(a.Prefer=`count=${n}`),new q({method:i,url:s,headers:a,schema:this.schema,body:o,fetch:this.fetch,allowEmpty:!1})}}var J=r(5840);let W={"X-Client-Info":"realtime-js/2.7.3"};(i=f||(f={}))[i.connecting=0]="connecting",i[i.open=1]="open",i[i.closing=2]="closing",i[i.closed=3]="closed",(o=p||(p={})).closed="closed",o.errored="errored",o.joined="joined",o.joining="joining",o.leaving="leaving",(s=v||(v={})).close="phx_close",s.error="phx_error",s.join="phx_join",s.reply="phx_reply",s.leave="phx_leave",s.access_token="access_token",(y||(y={})).websocket="websocket",(a=m||(m={})).Connecting="connecting",a.Open="open",a.Closing="closing",a.Closed="closed";class X{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 Z{constructor(){this.HEADER_LENGTH=1}decode(e,t){return e.constructor===ArrayBuffer?t(this._binaryDecode(e)):"string"==typeof e?t(JSON.parse(e)):t({})}_binaryDecode(e){let t=new DataView(e),r=new TextDecoder;return this._decodeBroadcast(e,t,r)}_decodeBroadcast(e,t,r){let n=t.getUint8(1),i=t.getUint8(2),o=this.HEADER_LENGTH+2,s=r.decode(e.slice(o,o+n));o+=n;let a=r.decode(e.slice(o,o+i));o+=i;let l=JSON.parse(r.decode(e.slice(o,e.byteLength)));return{ref:null,topic:s,event:a,payload:l}}}class Y{constructor(e,t,r={},n=1e4){this.channel=e,this.event=t,this.payload=r,this.timeout=n,this.sent=!1,this.timeoutTimer=void 0,this.ref="",this.receivedResp=null,this.recHo
5oks=[],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;let e=this.channel.socket.push({topic:this.channel.topic,event:this.event,payload:this.payload,ref:this.ref,join_ref:this.channel._joinRef()});"rate limited"===e&&(this.rateLimited=!0)}updatePayload(e){this.payload=Object.assign(Object.assign({},this.payload),e)}receive(e,t){var r;return this._hasReceived(e)&&t(null===(r=this.receivedResp)||void 0===r?void 0:r.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);let e=e=>{this._cancelRefEvent(),this._cancelTimeout(),this.receivedResp=e,this._matchReceive(e)};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(t=>t.status===e).forEach(e=>e.callback(t))}_hasReceived(e){return this.receivedResp&&this.receivedResp.status===e}}(l=g||(g={})).SYNC="sync",l.JOIN="join",l.LEAVE="leave";class Q{constructor(e,t){this.channel=e,this.state={},this.pendingDiffs=[],this.joinRef=null,this.caller={onJoin:()=>{},onLeave:()=>{},onSync:()=>{}};let r=(null==t?void 0:t.events)||{state:"presence_state",diff:"presence_diff"};this.channel._on(r.state,{},e=>{let{onJoin:t,onLeave:r,onSync:n}=this.caller;this.joinRef=this.channel._joinRef(),this.state=Q.syncState(this.state,e,t,r),this.pendingDiffs.forEach(e=>{this.state=Q.syncDiff(this.state,e,t,r)}),this.pendingDiffs=[],n()}),this.channel._on(r.diff,{},e=>{let{onJoin:t,onLeave:r,onSync:n}=this.caller;this.inPendingSyncState()?this.pendingDiffs.push(e):(this.state=Q.syncDiff(this.state,e,t,r),n())}),this.onJoin((e,t,r)=>{this.channel._trigger("presence",{event:"join",key:e,currentPresences:t,newPresences:r})}),this.onLeave((e,t,r)=>{this.channel._trigger("presence",{event:"leave",key:e,currentPresences:t,leftPresences:r})}),this.onSync(()=>{this.channel._trigger("presence",{event:"sync"})})}static syncState(e,t,r,n){let i=this.cloneDeep(e),o=this.transformState(t),s={},a={};return this.map(i,(e,t)=>{o[e]||(a[e]=t)}),this.map(o,(e,t)=>{let r=i[e];if(r){let n=t.map(e=>e.presence_ref),i=r.map(e=>e.presence_ref),o=t.filter(e=>0>i.indexOf(e.presence_ref)),l=r.filter(e=>0>n.indexOf(e.presence_ref));o.length>0&&(s[e]=o),l.length>0&&(a[e]=l)}else s[e]=t}),this.syncDiff(i,{joins:s,leaves:a},r,n)}static syncDiff(e,t,r,n){let{joins:i,leaves:o}={joins:this.transformState(t.joins),leaves:this.transformState(t.leaves)};return r||(r=()=>{}),n||(n=()=>{}),this.map(i,(t,n)=>{var i;let o=null!==(i=e[t])&&void 0!==i?i:[];if(e[t]=this.cloneDeep(n),o.length>0){let r=e[t].map(e=>e.presence_ref),n=o.filter(e=>0>r.indexOf(e.presence_ref));e[t].unshift(...n)}r(t,o,n)}),this.map(o,(t,r)=>{let i=e[t];if(!i)return;let o=r.map(e=>e.presence_ref);i=i.filter(e=>0>o.indexOf(e.presence_ref)),e[t]=i,n(t,i,r),0===i.length&&delete e[t]}),e}static map(e,t){return Object.getOwnPropertyNames(e).map(r=>t(r,e[r]))}static transformState(e){return Object.getOwnPropertyNames(e=this.cloneDeep(e)).reduce((t,r)=>{let n=e[r];return"metas"in n?t[r]=n.metas.map(e=>(e.presence_ref=e.phx_ref,delete e.phx_ref,delete e.phx_ref_prev,e)):t[r]=n,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()}}(u=_||(_={})).abstime="abstime",u.bool="bool",u.date="date",u.daterange="daterange",u.float4="float4",u.float8="float8",u.int2="int2",u.int4="int4",u.int4range="int4range",u.int8="int8",u.int8range="int8range",u.json="json",u.jsonb="jsonb",u.money="money",u.numeric="numeric",u.oid="oid",u.reltime="reltime",u.text="text",u.time="time",u.timestamp="timestamp",u.timestamptz="timestamptz",u.timetz="timetz",u.tsrange="tsrange",u.tstzrange="tstzrange";let ee=(e,t,r={})=>{var n;let i=null!==(n=r.skipTypes)&&void 0!==n?n:[];return Object.keys(t).reduce((r,n)=>(r[n]=et(n,e,t,i),r),{})},et=(e,t,r,n)=>{let i=t.find(t=>t.name===e),o=null==i?void 0:i.type,s=r[e];return o&&!n.includes(o)?er(o,s):en(s)},er=(e,t)=>{if("_"===e.charAt(0)){let r=e.slice(1,e.length);return ea(t,r)}switch(e){case _.bool:return ei(t);case _.float4:case _.float8:case _.int2:case _.int4:case _.int8:case _.numeric:case _.oid:return eo(t);case _.json:case _.jsonb:return es(t);case _.timestamp:return el(t);case _.abstime:case _.date:case _.daterange:case _.int4range:case _.int8range:case _.money:case _.reltime:case _.text:case _.time:case _.timestamptz:case _.timetz:case _.tsrange:case _.tstzrange:default:return en(t)}},en=e=>e,ei=e=>{switch(e){case"t":return!0;case"f":return!1;default:return e}},eo=e=>{if("string"==typeof e){let t=parseFloat(e);
5if(!Number.isNaN(t))return t}return e},es=e=>{if("string"==typeof e)try{return JSON.parse(e)}catch(e){console.log(`JSON parse error: ${e}`)}return e},ea=(e,t)=>{if("string"!=typeof e)return e;let r=e.length-1,n=e[r],i=e[0];if("{"===i&&"}"===n){let n;let i=e.slice(1,r);try{n=JSON.parse("["+i+"]")}catch(e){n=i?i.split(","):[]}return n.map(e=>er(t,e))}return e},el=e=>"string"==typeof e?e.replace(" ","T"):e;var eu=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};(c=b||(b={})).ALL="*",c.INSERT="INSERT",c.UPDATE="UPDATE",c.DELETE="DELETE",(h=w||(w={})).BROADCAST="broadcast",h.PRESENCE="presence",h.POSTGRES_CHANGES="postgres_changes",(d=S||(S={})).SUBSCRIBED="SUBSCRIBED",d.TIMED_OUT="TIMED_OUT",d.CLOSED="CLOSED",d.CHANNEL_ERROR="CHANNEL_ERROR";class ec{constructor(e,t={config:{}},r){this.topic=e,this.params=t,this.socket=r,this.bindings={},this.state=p.closed,this.joinedOnce=!1,this.pushBuffer=[],this.params.config=Object.assign({broadcast:{ack:!1,self:!1},presence:{key:""}},t.config),this.timeout=this.socket.timeout,this.joinPush=new Y(this,v.join,this.params,this.timeout),this.rejoinTimer=new X(()=>this._rejoinUntilConnected(),this.socket.reconnectAfterMs),this.joinPush.receive("ok",()=>{this.state=p.joined,this.rejoinTimer.reset(),this.pushBuffer.forEach(e=>e.send()),this.pushBuffer=[]}),this._onClose(()=>{this.rejoinTimer.reset(),this.socket.log("channel",`close ${this.topic} ${this._joinRef()}`),this.state=p.closed,this.socket._remove(this)}),this._onError(e=>{this._isLeaving()||this._isClosed()||(this.socket.log("channel",`error ${this.topic}`,e),this.state=p.errored,this.rejoinTimer.scheduleTimeout())}),this.joinPush.receive("timeout",()=>{this._isJoining()&&(this.socket.log("channel",`timeout ${this.topic}`,this.joinPush.timeout),this.state=p.errored,this.rejoinTimer.scheduleTimeout())}),this._on(v.reply,{},(e,t)=>{this._trigger(this._replyEventName(t),e)}),this.presence=new Q(this)}subscribe(e,t=this.timeout){var r,n;if(this.joinedOnce)throw"tried to subscribe multiple times. 'subscribe' can only be called a single time per channel instance";{let{config:{broadcast:i,presence:o}}=this.params;this._onError(t=>e&&e("CHANNEL_ERROR",t)),this._onClose(()=>e&&e("CLOSED"));let s={},a={broadcast:i,presence:o,postgres_changes:null!==(n=null===(r=this.bindings.postgres_changes)||void 0===r?void 0:r.map(e=>e.filter))&&void 0!==n?n:[]};this.socket.accessToken&&(s.access_token=this.socket.accessToken),this.updateJoinPayload(Object.assign({config:a},s)),this.joinedOnce=!0,this._rejoin(t),this.joinPush.receive("ok",({postgres_changes:t})=>{var r;if(this.socket.accessToken&&this.socket.setAuth(this.socket.accessToken),void 0===t){e&&e("SUBSCRIBED");return}{let n=this.bindings.postgres_changes,i=null!==(r=null==n?void 0:n.length)&&void 0!==r?r:0,o=[];for(let r=0;r<i;r++){let i=n[r],{filter:{event:s,schema:a,table:l,filter:u}}=i,c=t&&t[r];if(c&&c.event===s&&c.schema===a&&c.table===l&&c.filter===u)o.push(Object.assign(Object.assign({},i),{id:c.id}));else{this.unsubscribe(),e&&e("CHANNEL_ERROR",Error("mismatch between server and client bindings for postgres changes"));return}}this.bindings.postgres_changes=o,e&&e("SUBSCRIBED");return}}).receive("error",t=>{e&&e("CHANNEL_ERROR",Error(JSON.stringify(Object.values(t).join(", ")||"error")))}).receive("timeout",()=>{e&&e("TIMED_OUT")})}return this}presenceState(){return this.presence.state}track(e,t={}){return eu(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"track",payload:e},t.timeout||this.timeout)})}untrack(e={}){return eu(this,void 0,void 0,function*(){return yield this.send({type:"presence",event:"untrack"},e)})}on(e,t,r){return this._on(e,t,r)}send(e,t={}){return new Promise(r=>{var n,i,o;let s=this._push(e.type,e,t.timeout||this.timeout);s.rateLimited&&r("rate limited"),"broadcast"!==e.type||(null===(o=null===(i=null===(n=this.params)||void 0===n?void 0:n.config)||void 0===i?void 0:i.broadcast)||void 0===o?void 0:o.ack)||r("ok"),s.receive("ok",()=>r("ok")),s.receive("timeout",()=>r("timed out"))})}updateJoinPayload(e){this.joinPush.updatePayload(e)}unsubscribe(e=this.timeout){this.state=p.leaving;let t=()=>{this.socket.log("channel",`leave ${this.topic}`),this._trigger(v.close,"leave",this._joinRef())};return this.rejoinTimer.reset(),this.joinPush.destroy(),new Promise(r=>{let n=new Y(this,v.leave,{},e);n.receive("ok",()=>{t(),r("ok")}).receive("timeout",()=>{t(),r("timed out")}).receive("error",()=>{r("error")}),n.send(),this._canPush()||n.trigger("ok",{})})}_push(e,t,r=this.timeout){if(!this.joinedOnce)throw`tried to push '${e}' to '${this.topic}' before joining. Use channel.subscribe() before pushing events`;let n=new Y(this,e,t,r);return this._canPush()?n.send():(n.startTimeout(),this.pushBuffer.push(n)),n}_onMessage(e,t,r){return t}_isMember(e){return this.topic===e}_joinRef(){return this.joinPush.ref}_trigger(e,t,r){var n,i;let o=e.toLocaleLowerCase(),{close:s,error:a,leave:l,join:u}=v;if(r&&[s,a,l,u].indexOf(o)>=0&&r!==this._joinRef())return;let c=this._onMessage(o,t,r);if(t&&!c)throw"channel onMessage callbacks must return the payload, modified or unmodified";["insert","update","delete"].includes(o)?null===(n=this.bindings.postgres_changes)||void 0===n||n.filter(e=>{var t,r,n;return(null===(t=e.filter)||void 0===t?void 0:t.event)==="*"||(null===(n=null===(r=e.filter)||void 0===r?void 0:r.event)||void 0===n?void 0:n.toLocaleLowerCase())===o}).map(e=>e.callback(c,r)):null===(i=this.bindings[o])||void 0===i||i.filter(e=>{var r,n,i,s,a,l;if(!["broadcast","presence","postgres_changes"].includes(o))return e.type.toLocaleLowerCase()===o;if("id"in e){let o=e.id,s=null===(r=e.filter)||void 0===r?void 0:r.event;return o&&(null===(n=t.ids)||void 0===n?void 0:n.includes(o))&&("*"===s||(null==s?void 0:s.toLocaleLowerCase())===(null===(i=t.data)||void 0===i?void 0:i.type.toLocaleLowerCase()))}{let r=null===(a=null===(s=null==e?void 0:e.filter)||void 0===s?void 0:s.event)||void 0===a?void 0:a.toLocaleLowerCase();return"*"===r||r===(null===(l=null==t?void 0:t.event)||void 0===l?void 0:l.toLocaleLowerCase())}}).map(e=>{if("object"==typeof c&&"ids"in c){let e=c.data,{schema:t,table:r,commit_timestamp:n,type:i,errors:o}=e;c=Object.assign(Object.assign({},{schema:t,table:r,commit_timestamp:n,eventType:i,new:{},old:{},errors:o}),this._getPayloadRecords(e))}e.callback(c,r)})}_isClosed(){return this.state===p.closed}_isJoined(){return this.state===p.joined}_isJoining(){return this.state===p.joining}_isLeaving(){return this.state===p.leaving}_replyEventName(e){return`chan_reply_${e}`}_on(e,t,r){let n=e.toLocaleLowerCase(),i={type:n,filter:t,callback:r};return this.bindings[n]?this.bindings[n].push(i):this.bindings[n]=[i],this}_off(e,t){let r=e.toLocaleLowerCase();return this.bindings[r]=this.bindings[r].filter(e=>{var n;return!((null===(n=e.type)||void 0===n?void 0:n.toLocaleLowerCase())===r&&ec.isEqual(e.filter,t))}),this}static isEqual(e,t){if(Object.keys(e).length!==Object.keys(t).length)return!1;for(let r in e)if(e[r]!==t[r])return!1;return!0}_rejoinUntilConnected(){this.rejoinTimer.scheduleTimeout(),this.socket.isConnected()&&this._rejoin()}_onClose(e){this._on(v.close,{},e)}_onError(e){this._on(v.error,{},t=>e(t))}_canPush(){return this.socket.isConnected()&&this._isJoined()}_rejoin(e=this.timeout){this._isLeaving()||(this.socket._leaveOpenTopic(this.topic),this.state=p.joining,this.joinPush.resend(e))}_getPayloadRecords(e){let t={new:{},old:{}};return("INSERT"===e.type||"UPDATE"===e.type)&&(t.new=ee(e.columns,e.record)),("UPDATE"===e.type||"DELET
5E"===e.type)&&(t.old=ee(e.columns,e.old_record)),t}}var eh=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let ed=()=>{};class ef{constructor(e,t){var r;this.accessToken=null,this.channels=[],this.endPoint="",this.headers=W,this.params={},this.timeout=1e4,this.transport=J.w3cwebsocket,this.heartbeatIntervalMs=3e4,this.heartbeatTimer=void 0,this.pendingHeartbeatRef=null,this.ref=0,this.logger=ed,this.conn=null,this.sendBuffer=[],this.serializer=new Z,this.stateChangeCallbacks={open:[],close:[],error:[],message:[]},this.eventsPerSecondLimitMs=100,this.inThrottle=!1,this.endPoint=`${e}/${y.websocket}`,(null==t?void 0:t.params)&&(this.params=t.params),(null==t?void 0:t.headers)&&(this.headers=Object.assign(Object.assign({},this.headers),t.headers)),(null==t?void 0:t.timeout)&&(this.timeout=t.timeout),(null==t?void 0:t.logger)&&(this.logger=t.logger),(null==t?void 0:t.transport)&&(this.transport=t.transport),(null==t?void 0:t.heartbeatIntervalMs)&&(this.heartbeatIntervalMs=t.heartbeatIntervalMs);let n=null===(r=null==t?void 0:t.params)||void 0===r?void 0:r.eventsPerSecond;n&&(this.eventsPerSecondLimitMs=Math.floor(1e3/n)),this.reconnectAfterMs=(null==t?void 0:t.reconnectAfterMs)?t.reconnectAfterMs:e=>[1e3,2e3,5e3,1e4][e-1]||1e4,this.encode=(null==t?void 0:t.encode)?t.encode:(e,t)=>t(JSON.stringify(e)),this.decode=(null==t?void 0:t.decode)?t.decode:this.serializer.decode.bind(this.serializer),this.reconnectTimer=new X(()=>eh(this,void 0,void 0,function*(){this.disconnect(),this.connect()}),this.reconnectAfterMs)}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,null!=t?t:""):this.conn.close(),this.conn=null,this.heartbeatTimer&&clearInterval(this.heartbeatTimer),this.reconnectTimer.reset())}getChannels(){return this.channels}removeChannel(e){return eh(this,void 0,void 0,function*(){let t=yield e.unsubscribe();return 0===this.channels.length&&this.disconnect(),t})}removeAllChannels(){return eh(this,void 0,void 0,function*(){let e=yield Promise.all(this.channels.map(e=>e.unsubscribe()));return this.disconnect(),e})}log(e,t,r){this.logger(e,t,r)}connectionState(){switch(this.conn&&this.conn.readyState){case f.connecting:return m.Connecting;case f.open:return m.Open;case f.closing:return m.Closing;default:return m.Closed}}isConnected(){return this.connectionState()===m.Open}channel(e,t={config:{}}){this.isConnected()||this.connect();let r=new ec(`realtime:${e}`,t,this);return this.channels.push(r),r}push(e){let{topic:t,event:r,payload:n,ref:i}=e,o=()=>{this.encode(e,e=>{var t;null===(t=this.conn)||void 0===t||t.send(e)})};if(this.log("push",`${t} ${r} (${i})`,n),this.isConnected()){if(["broadcast","presence","postgres_changes"].includes(r)){let e=this._throttle(o)();if(e)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(v.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(t=>t.topic===e&&(t._isJoined()||t._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:"1.0.0"}))}_onConnMessage(e){this.decode(e.data,e=>{let{topic:t,event:r,payload:n,ref:i}=e;(i&&i===this.pendingHeartbeatRef||r===(null==n?void 0:n.type))&&(this.pendingHeartbeatRef=null),this.log("receive",`${n.status||""} ${t} ${r} ${i&&"("+i+")"||""}`,n),this.channels.filter(e=>
5e._isMember(t)).forEach(e=>e._trigger(r,n,i)),this.stateChangeCallbacks.message.forEach(t=>t(e))})}_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(v.error))}_appendParams(e,t){if(0===Object.keys(t).length)return e;let r=e.match(/\?/)?"&":"?",n=new URLSearchParams(t);return`${e}${r}${n}`}_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"),null===(e=this.conn)||void 0===e||e.close(1e3,"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||(e(),t>0&&(this.inThrottle=!0,setTimeout(()=>{this.inThrottle=!1},t)),!1)}}class ep extends Error{constructor(e){super(e),this.__isStorageError=!0,this.name="StorageError"}}function ev(e){return"object"==typeof e&&null!==e&&"__isStorageError"in e}class ey extends ep{constructor(e,t){super(e),this.name="StorageApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class em extends ep{constructor(e,t){super(e),this.name="StorageUnknownError",this.originalError=t}}var eg=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let e_=e=>{let t;return t=e||("undefined"==typeof fetch?(...e)=>eg(void 0,void 0,void 0,function*(){return yield(yield Promise.resolve().then(r.t.bind(r,4098,23))).fetch(...e)}):fetch),(...e)=>t(...e)},eb=()=>eg(void 0,void 0,void 0,function*(){return"undefined"==typeof Response?(yield Promise.resolve().then(r.t.bind(r,4098,23))).Response:Response});var ew=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let eS=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),ex=(e,t)=>ew(void 0,void 0,void 0,function*(){let r=yield eb();e instanceof r?e.json().then(r=>{t(new ey(eS(r),e.status||500))}).catch(e=>{t(new em(eS(e),e))}):t(new em(eS(e),e))}),eT=(e,t,r,n)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json"},null==t?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};function eE(e,t,r,n,i,o){return ew(this,void 0,void 0,function*(){return new Promise((s,a)=>{e(r,eT(t,n,i,o)).then(e=>{if(!e.ok)throw e;return(null==n?void 0:n.noResolveJson)?e:e.json()}).then(e=>s(e)).catch(e=>ex(e,a))})})}function ek(e,t,r,n){return ew(this,void 0,void 0,function*(){return eE(e,"GET",t,r,n)})}function eR(e,t,r,n,i){return ew(this,void 0,void 0,function*(){return eE(e,"POST",t,n,i,r)})}function eA(e,t,r,n,i){return ew(this,void 0,void 0,function*(){return eE(e,"DELETE",t,n,i,r)})}var eO=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};let ej={limit:100,offset:0,sortBy:{column:"name",order:"asc"}}
5,eC={cacheControl:"3600",contentType:"text/plain;charset=UTF-8",upsert:!1};class eP{constructor(e,t={},r,n){this.url=e,this.headers=t,this.bucketId=r,this.fetch=e_(n)}uploadOrUpdate(e,t,r,n){return eO(this,void 0,void 0,function*(){try{let i;let o=Object.assign(Object.assign({},eC),n),s=Object.assign(Object.assign({},this.headers),"POST"===e&&{"x-upsert":String(o.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((i=new FormData).append("cacheControl",o.cacheControl),i.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(i=r).append("cacheControl",o.cacheControl):(i=r,s["cache-control"]=`max-age=${o.cacheControl}`,s["content-type"]=o.contentType);let a=this._removeEmptyFolders(t),l=this._getFinalPath(a),u=yield this.fetch(`${this.url}/object/${l}`,Object.assign({method:e,body:i,headers:s},(null==o?void 0:o.duplex)?{duplex:o.duplex}:{}));if(u.ok)return{data:{path:a},error:null};{let e=yield u.json();return{data:null,error:e}}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}upload(e,t,r){return eO(this,void 0,void 0,function*(){return this.uploadOrUpdate("POST",e,t,r)})}uploadToSignedUrl(e,t,r,n){return eO(this,void 0,void 0,function*(){let i=this._removeEmptyFolders(e),o=this._getFinalPath(i),s=new URL(this.url+`/object/upload/sign/${o}`);s.searchParams.set("token",t);try{let e;let t=Object.assign({upsert:eC.upsert},n),o=Object.assign(Object.assign({},this.headers),{"x-upsert":String(t.upsert)});"undefined"!=typeof Blob&&r instanceof Blob?((e=new FormData).append("cacheControl",t.cacheControl),e.append("",r)):"undefined"!=typeof FormData&&r instanceof FormData?(e=r).append("cacheControl",t.cacheControl):(e=r,o["cache-control"]=`max-age=${t.cacheControl}`,o["content-type"]=t.contentType);let a=yield this.fetch(s.toString(),{method:"PUT",body:e,headers:o});if(a.ok)return{data:{path:i},error:null};{let e=yield a.json();return{data:null,error:e}}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}createSignedUploadUrl(e){return eO(this,void 0,void 0,function*(){try{let t=this._getFinalPath(e),r=yield eR(this.fetch,`${this.url}/object/upload/sign/${t}`,{},{headers:this.headers}),n=new URL(this.url+r.url),i=n.searchParams.get("token");if(!i)throw new ep("No token returned by API");return{data:{signedUrl:n.toString(),path:e,token:i},error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}update(e,t,r){return eO(this,void 0,void 0,function*(){return this.uploadOrUpdate("PUT",e,t,r)})}move(e,t){return eO(this,void 0,void 0,function*(){try{let r=yield eR(this.fetch,`${this.url}/object/move`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:r,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}copy(e,t){return eO(this,void 0,void 0,function*(){try{let r=yield eR(this.fetch,`${this.url}/object/copy`,{bucketId:this.bucketId,sourceKey:e,destinationKey:t},{headers:this.headers});return{data:{path:r.Key},error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}createSignedUrl(e,t,r){return eO(this,void 0,void 0,function*(){try{let n=this._getFinalPath(e),i=yield eR(this.fetch,`${this.url}/object/sign/${n}`,Object.assign({expiresIn:t},(null==r?void 0:r.transform)?{transform:r.transform}:{}),{headers:this.headers}),o=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"",s=encodeURI(`${this.url}${i.signedURL}${o}`);return{data:i={signedUrl:s},error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}createSignedUrls(e,t,r){return eO(this,void 0,void 0,function*(){try{let n=yield eR(this.fetch,`${this.url}/object/sign/${this.bucketId}`,{expiresIn:t,paths:e},{headers:this.headers}),i=(null==r?void 0:r.download)?`&download=${!0===r.download?"":r.download}`:"";return{data:n.map(e=>Object.assign(Object.assign({},e),{signedUrl:e.signedURL?encodeURI(`${this.url}${e.signedURL}${i}`):null})),error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}download(e,t){return eO(this,void 0,void 0,function*(){let r=void 0!==(null==t?void 0:t.transform),n=this.transformOptsToQueryString((null==t?void 0:t.transform)||{}),i=n?`?${n}`:"";try{let t=this._getFinalPath(e),n=yield ek(this.fetch,`${this.url}/${r?"render/image/authenticated":"object"}/${t}${i}`,{headers:this.headers,noResolveJson:!0}),o=yield n.blob();return{data:o,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}getPublicUrl(e,t){let r=this._getFinalPath(e),n=[],i=(null==t?void 0:t.download)?`download=${!0===t.download?"":t.download}`:"";""!==i&&n.push(i);let o=void 0!==(null==t?void 0:t.transform),s=this.transformOptsToQueryString((null==t?void 0:t.transform)||{});""!==s&&n.push(s);let a=n.join("&");return""!==a&&(a=`?${a}`),{data:{publicUrl:encodeURI(`${this.url}/${o?"render/image":"object"}/public/${r}${a}`)}}}remove(e){return eO(this,void 0,void 0,function*(){try{let t=yield eA(this.fetch,`${this.url}/object/${this.bucketId}`,{prefixes:e},{headers:this.headers});return{data:t,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}list(e,t,r){return eO(this,void 0,void 0,function*(){try{let n=Object.assign(Object.assign(Object.assign({},ej),t),{prefix:e||""}),i=yield eR(this.fetch,`${this.url}/object/list/${this.bucketId}`,n,{headers:this.headers},r);return{data:i,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}_getFinalPath(e){return`${this.bucketId}/${e}`}_removeEmptyFolders(e){return e.replace(/^\/|\/$/g,"").replace(/\/+/g,"/")}transformOptsToQueryString(e){let 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("&")}}let eN={"X-Client-Info":"storage-js/2.5.1"};var eL=function(e,t,r,n){return new(r||(r=Promise))(function(i,o){function s(e){try{l(n.next(e))}catch(e){o(e)}}function a(e){try{l(n.throw(e))}catch(e){o(e)}}function l(e){var t;e.done?i(e.value):((t=e.value)instanceof r?t:new r(function(e){e(t)})).then(s,a)}l((n=n.apply(e,t||[])).next())})};class eI{constructor(e,t={},r){this.url=e,this.headers=Object.assign(Object.assign({},eN),t),this.fetch=e_(r)}listBuckets(){return eL(this,void 0,void 0,function*(){try{let e=yield ek(this.fetch,`${this.url}/bucket`,{headers:this.headers});return{data:e,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}getBucket(e){return eL(this,void 0,void 0,function*(){try{let t=yield ek(this.fetch,`${this.url}/bucket/${e}`,{headers:this.headers});return{data:t,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}createBucket(e,t={public:!1}){return eL(this,void 0,void 0,function*(){try{let r=yield eR(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});return{data:r,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}updateBucket(e,t){return eL(this,void 0,void 0,function*(){try{let r=yield function(e,t,r,n,i){return ew(this,void 0,void 0,function*(){return eE(e,"PUT",t,n,void 0,r)})}(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});return{data:r,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}emptyBucket(e){return eL(this,void 0,void 0,function*(){try{let t=yield eR(this.fetch,`${this.url}/bucket/${e}/empty`,{},{headers:this.headers});return{data:t,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}deleteBucket(e){return eL(this,void 0,void 0,function*(){try{let t=yield eA(this.fetch,`${this.url}/bucket/${e}`,{},{headers:this.headers});return{data:t,error:null}}catch(e){if(ev(e))return{data:null,error:e};throw e}})}}class eM extends eI{constructor(e,t={},r){super(e,t,r)}from(e){return new eP(this.url,this.headers,e,this.fetch)}}let eU=e=>{let t;return t=e||("undefined"==typeof fetch?V():fetch),(...e)=>t(...e)},e$=()=>"undefined"==typeof Headers?B.Headers:Headers,eD=(e,t,r)=>{let n=eU(r),i=e$();return(r,o)=>{var s,a,l,u;return s=void 0,a=void 0,l=void 0,u=function*(){var s;let a=null!==(s=yield t())&&void 0!==s?s:e,l=new i(null==o?void 0:o.headers);return l.has("apikey")||l.set("apikey",e),l.has("Authorization")||l.set("Authorization",`Bearer ${a}`),n(r,Object.assign(Object.assign({},o),{headers:l}))},new(l||(l=Promise))(function(e,t){function r(e){try{i(u.next(e))}catch(e){t(e)}}function n(e){try{i(u.throw(e))}catch(e){t(e)}}function i(t){var i;t.done?e(t.value):((i=t.value)instanceof l?i:new l(function(e){e(i)})).then(r,n)}i((u=u.apply(s,a||[])).next())})}},eB=()=>"undefined"!=typeof document,eV={tested:!1,writable:!1},ez=()=>{if(!eB())return!1;try{if("object"!=typeof globalThis.localStorage)return!1}catch(e){return!1}if(eV.tested)return eV.writable;let e=`lswt-${Math.random()}${Math.random()}`;try{globalThis.localStorage.setItem(e,e),globalThis.localStorage.removeItem(e),eV.tested=!0,eV.writable=!0}catch(e){eV.tested=!0,eV.writable=!1}return eV.writable};function eF(e,t){var r;t||(t=(null===(r=null==window?void 0:window.location)||void 0===r?void 0:r.href)||""),e=e.replace(/[\[\]]/g,"\\$&");let n=RegExp("[?&#]"+e+"(=([^&#]*)|&|#|$)"),i=n.exec(t);
5return i?i[2]?decodeURIComponent(i[2].replace(/\+/g," ")):"":null}let eq=e=>{let t;return t=e||("undefined"==typeof fetch?async(...e)=>await (await Promise.resolve().then(r.t.bind(r,4098,23))).fetch(...e):fetch),(...e)=>t(...e)},eH=e=>"object"==typeof e&&null!==e&&"status"in e&&"ok"in e&&"json"in e&&"function"==typeof e.json,eG=async(e,t,r)=>{await e.setItem(t,JSON.stringify(r))},eK=async(e,t)=>{let r=await e.getItem(t);if(!r)return null;try{return JSON.parse(r)}catch(e){return r}},eJ=async(e,t)=>{await e.removeItem(t)};class eW{constructor(){this.promise=new eW.promiseConstructor((e,t)=>{this.resolve=e,this.reject=t})}}function eX(e){let t=e.split(".");if(3!==t.length)throw Error("JWT is not valid: not a JWT structure");if(!/^([a-z0-9_-]{4})*($|[a-z0-9_-]{3}=?$|[a-z0-9_-]{2}(==)?$)$/i.test(t[1]))throw Error("JWT is not valid: payload is not in base64url format");let r=t[1];return JSON.parse(function(e){let t,r,n,i,o,s,a;let l="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",u="",c=0;for(e=e.replace("-","+").replace("_","/");c<e.length;)i=l.indexOf(e.charAt(c++)),o=l.indexOf(e.charAt(c++)),s=l.indexOf(e.charAt(c++)),a=l.indexOf(e.charAt(c++)),t=i<<2|o>>4,r=(15&o)<<4|s>>2,n=(3&s)<<6|a,u+=String.fromCharCode(t),64!=s&&0!=r&&(u+=String.fromCharCode(r)),64!=a&&0!=n&&(u+=String.fromCharCode(n));return u}(r))}function eZ(e){return("0"+e.toString(16)).substr(-2)}function eY(){let e=new Uint32Array(56);if("undefined"==typeof crypto){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",t=e.length,r="";for(let n=0;n<56;n++)r+=e.charAt(Math.floor(Math.random()*t));return r}return crypto.getRandomValues(e),Array.from(e,eZ).join("")}async function eQ(e){let t=new TextEncoder,r=t.encode(e),n=await crypto.subtle.digest("SHA-256",r),i=new Uint8Array(n);return Array.from(i).map(e=>String.fromCharCode(e)).join("")}async function e0(e){if("undefined"==typeof crypto)return console.warn("WebCrypto API is not supported. Code challenge method will default to use plain instead of sha256."),e;let t=await eQ(e);return btoa(t).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}eW.promiseConstructor=Promise;let e1=/__stack_guard__([a-zA-Z0-9_-]+)__/,e2=!1;function e3(e){var t,r;let i;n();try{throw Error()}catch(e){i=e}let o=null!==(r=null===(t=i.stack)||void 0===t?void 0:t.split("\n"))&&void 0!==r?r:[];for(let t=0;t<o.length;t+=1){let r=o[t],n=r.match(e1);if(n&&n[1]===e)return!0}return!1}async function e4(e,t){await n();let r=`__stack_guard__${e}__`;return await ({[r]:async()=>await t()})[r]()}n=async()=>{e2||(e2=!0,await e4("ENV_CHECK",async()=>{let e=e3("ENV_CHECK");return e||console.warn("@supabase/gotrue-js: Stack guards not supported in this environment. Generally not an issue but may point to a very conservative transpilation environment (use ES2017 or above) that implements async/await with generators, or this is a JavaScript engine that does not support async/await stack traces."),e}))};class e5 extends Error{constructor(e,t){super(e),this.__isAuthError=!0,this.name="AuthError",this.status=t}}function e6(e){return"object"==typeof e&&null!==e&&"__isAuthError"in e}class e8 extends e5{constructor(e,t){super(e,t),this.name="AuthApiError",this.status=t}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class e9 extends e5{constructor(e,t){super(e),this.name="AuthUnknownError",this.originalError=t}}class e7 extends e5{constructor(e,t,r){super(e),this.name=t,this.status=r}toJSON(){return{name:this.name,message:this.message,status:this.status}}}class te extends e7{constructor(){super("Auth session missing!","AuthSessionMissingError",400)}}class tt extends e7{constructor(){super("Auth session or user missing","AuthInvalidToken
5ResponseError",500)}}class tr extends e7{constructor(e){super(e,"AuthInvalidCredentialsError",400)}}class tn extends e7{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 ti extends e7{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 to extends e7{constructor(e,t){super(e,"AuthRetryableFetchError",t)}}function ts(e){return e6(e)&&"AuthRetryableFetchError"===e.name}var ta=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};let tl=e=>e.msg||e.message||e.error_description||e.error||JSON.stringify(e),tu=[502,503,504];async function tc(e){let t;if(!eH(e))throw new to(tl(e),0);if(tu.includes(e.status))throw new to(tl(e),e.status);try{t=await e.json()}catch(e){throw new e9(tl(e),e)}throw new e8(tl(t),e.status||500)}let th=(e,t,r,n)=>{let i={method:e,headers:(null==t?void 0:t.headers)||{}};return"GET"===e?i:(i.headers=Object.assign({"Content-Type":"application/json;charset=UTF-8"},null==t?void 0:t.headers),i.body=JSON.stringify(n),Object.assign(Object.assign({},i),r))};async function td(e,t,r,n){var i;let o=Object.assign({},null==n?void 0:n.headers);(null==n?void 0:n.jwt)&&(o.Authorization=`Bearer ${n.jwt}`);let s=null!==(i=null==n?void 0:n.query)&&void 0!==i?i:{};(null==n?void 0:n.redirectTo)&&(s.redirect_to=n.redirectTo);let a=Object.keys(s).length?"?"+new URLSearchParams(s).toString():"",l=await tf(e,t,r+a,{headers:o,noResolveJson:null==n?void 0:n.noResolveJson},{},null==n?void 0:n.body);return(null==n?void 0:n.xform)?null==n?void 0:n.xform(l):{data:Object.assign({},l),error:null}}async function tf(e,t,r,n,i,o){let s;let a=th(t,n,i,o);try{s=await e(r,a)}catch(e){throw console.error(e),new to(tl(e),0)}if(s.ok||await tc(s),null==n?void 0:n.noResolveJson)return s;try{return await s.json()}catch(e){await tc(e)}}function tp(e){var t;let r=null;e.access_token&&e.refresh_token&&e.expires_in&&((r=Object.assign({},e)).expires_at=function(e){let t=Math.round(Date.now()/1e3);return t+e}(e.expires_in));let n=null!==(t=e.user)&&void 0!==t?t:e;return{data:{session:r,user:n},error:null}}function tv(e){var t;let r=null!==(t=e.user)&&void 0!==t?t:e;return{data:{user:r},error:null}}function ty(e){return{data:e,error:null}}function tm(e){let{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o}=e,s=ta(e,["action_link","email_otp","hashed_token","redirect_to","verification_type"]),a=Object.assign({},s);return{data:{properties:{action_link:t,email_otp:r,hashed_token:n,redirect_to:i,verification_type:o},user:a},error:null}}function tg(e){return e}var t_=function(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&0>t.indexOf(n)&&(r[n]=e[n]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols)for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)0>t.indexOf(n[i])&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r};class tb{constructor({url:e="",headers:t={},fetch:r}){this.url=e,this.headers=t,this.fetch=eq(r),this.mfa={listFactors:this._listFactors.bind(this),deleteFactor:this._deleteFactor.bind(this)}}async signOut(e,t="global"){try{return await td(this.fetch,"POST",`${this.url}/logout?scope=${t}`,{headers:this.headers,jwt:e,noResolveJson:!0}),{data:null,error:null}}catch(e){if(e6(e))return{data:null,error:e};throw e}}async inviteUserByEmail(e,t={}){try{return await td(this.fetch,"POST",`${this.url}/invite`,{body:{email:e,data:t.data},headers:this.headers,redirectTo:t.redirectTo,xform:tv})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}async generateLink(e){try{let{options:t}=e,r=t_(e,["options"]),n=Object.assign(Object.assign({},r),t);return"newEmail"in r&&(n.new_email=null==r?void 0:r.newEmail,delete n.newEmail),await td(this.fetch,"POST",`${this.url}/admin/generate_link`,{body:n,headers:this.headers,xform:tm,redirectTo:null==t?void 0:t.redirectTo})}catch(e){if(e6(e))return{data:{properties:null,user:null},error:e};throw e}}async createUser(e){try{return await td(this.fetch,"POST",`${this.url}/admin/users`,{body:e,headers:this.headers,xform:tv})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}async listUsers(e){var t,r,n,i,o,s,a;try{let l={nextPage:null,lastPage:0,total:0},u=await td(this.fetch,"GET",`${this.url}/admin/users`,{headers:this.headers,noResolveJson:!0,query:{page:null!==(r=null===(t=null==e?void 0:e.page)||void 0===t?void 0:t.toString())&&void 0!==r?r:"",per_page:null!==(i=null===(n=null==e?void 0:e.perPage)||void 0===n?void 0:n.toString())&&void 0!==i?i:""},xform:tg});if(u.error)throw u.error;let c=await u.json(),h=null!==(o=u.headers.get("x-total-count"))&&void 0!==o?o:0,d=null!==(a=null===(s=u.headers.get("link"))||void 0===s?void 0:s.split(","))&&void 0!==a?a:[];return d.length>
50&&(d.forEach(e=>{let t=parseInt(e.split(";")[0].split("=")[1].substring(0,1)),r=JSON.parse(e.split(";")[1].split("=")[1]);l[`${r}Page`]=t}),l.total=parseInt(h)),{data:Object.assign(Object.assign({},c),l),error:null}}catch(e){if(e6(e))return{data:{users:[]},error:e};throw e}}async getUserById(e){try{return await td(this.fetch,"GET",`${this.url}/admin/users/${e}`,{headers:this.headers,xform:tv})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}async updateUserById(e,t){try{return await td(this.fetch,"PUT",`${this.url}/admin/users/${e}`,{body:t,headers:this.headers,xform:tv})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}async deleteUser(e,t=!1){try{return await td(this.fetch,"DELETE",`${this.url}/admin/users/${e}`,{headers:this.headers,body:{should_soft_delete:t},xform:tv})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}async _listFactors(e){try{let{data:t,error:r}=await td(this.fetch,"GET",`${this.url}/admin/users/${e.userId}/factors`,{headers:this.headers,xform:e=>({data:{factors:e},error:null})});return{data:t,error:r}}catch(e){if(e6(e))return{data:null,error:e};throw e}}async _deleteFactor(e){try{let t=await td(this.fetch,"DELETE",`${this.url}/admin/users/${e.userId}/factors/${e.id}`,{headers:this.headers});return{data:t,error:null}}catch(e){if(e6(e))return{data:null,error:e};throw e}}}var tw={getItem:e=>ez()?globalThis.localStorage.getItem(e):null,setItem:(e,t)=>{ez()&&globalThis.localStorage.setItem(e,t)},removeItem:e=>{ez()&&globalThis.localStorage.removeItem(e)}};!function(){if("object"!=typeof globalThis)try{Object.defineProperty(Object.prototype,"__magic__",{get:function(){return this},configurable:!0}),__magic__.globalThis=__magic__,delete Object.prototype.__magic__}catch(e){"undefined"!=typeof self&&(self.globalThis=self)}}();let tS={url:"http://localhost:9999",storageKey:"supabase.auth.token",autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,headers:{"X-Client-Info":"gotrue-js/2.44.1"},flowType:"implicit",debug:!1};async function tx(e,t,r){return await r()}class tT{constructor(e){var t;this.stateChangeEmitters=new Map,this.autoRefreshTicker=null,this.visibilityChangedCallback=null,this.refreshingDeferred=null,this.initializePromise=null,this.detectSessionInUrl=!0,this.broadcastChannel=null,this.instanceID=tT.nextInstanceID,tT.nextInstanceID+=1,this.instanceID>0&&eB()&&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.");let r=Object.assign(Object.assign({},tS),e);if(this.logDebugMessages=r.debug,this.inMemorySession=null,this.storageKey=r.storageKey,this.autoRefreshToken=r.autoRefreshToken,this.persistSession=r.persistSession,this.storage=r.storage||tw,this.admin=new tb({url:r.url,headers:r.headers,fetch:r.fetch}),this.url=r.url,this.headers=r.headers,this.fetch=eq(r.fetch),this.lock=r.lock||tx,this.detectSessionInUrl=r.detectSessionInUrl,this.flowType=r.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&&this.storage===tw&&!ez()&&console.warn(`No storage option exists to persist the session, which may result in unexpected behavior when using auth.
6        If you want to set persistSession to true, please provide a storage option or you may set persistSession to false to disable this warning.`),eB()&&globalThis.BroadcastChannel&&this.persistSession&&this.storageKey){try{this.broadcastChannel=new globalThis.BroadcastChannel(this.storageKey)}catch(e){console.error("Failed to create a new BroadcastChannel, multi-tab state changes will not be available",e)}null===(t=this.broadcastChannel)||void 0===t||t.addEventListener("message",async e=>{this._debug("received broadcast notification from other tab or client",e),await this._notifyAllSubscribers(e.data.event,e.data.session,!1)})}this.initialize()}_debug(...e){return this.logDebugMessages&&console.log(`GoTrueClient@${this.instanceID} ${new Date().toISOString()}`,...e),this}initialize(){return this.initializePromise?this.initializePromise:this._initialize()}async _initialize(){if(this.initializePromise)throw Error("Double call of #_initialize()");return this.initializePromise=this._acquireLock(-1,async()=>await e4("_initialize",async()=>{try{let e=!!eB()&&await this._isPKCEFlow();if(this._debug("#_initialize()","begin","is PKCE flow",e),e||this.detectSessionInUrl&&this._isImplicitGrantFlow()){let{data:t,error:r}=await this._getSessionFromUrl(e);if(r)return this._debug("#_initialize()","error detecting session from URL",r),await this._removeSession(),{error:r};let{session:n,redirectType:i}=t;return this._debug("#_initialize()","detected session in URL",n,"redirect type",i),await this._saveSession(n),setTimeout(async()=>{"recovery"===i?await this._notifyAllSubscribers("PASSWORD_RECOVERY",n):await this._notifyAllSubscribers("SIGNED_IN",n)},0),{error:null}}return await this._recoverAndRefresh(),{error:null}}catch(e){if(e6(e))return{error:e};return{error:new e9("Unexpected error during initialization",e)}}finally{await this._handleVisibilityChange(),this._debug("#_initialize()","end")}})),await this.initializePromise}async signUp(e){var t,r,n;try{let i;if(await this._removeSession(),"email"in e){let{email:r,password:n,options:o}=e,s=null,a=null;if("pkce"===this.flowType){let e=eY();await eG(this.storage,`${this.storageKey}-code-verifier`,e),s=await e0(e),a=e===s?"plain":"s256"}i=await td(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,redirectTo:null==o?void 0:o.emailRedirectTo,body:{email:r,password:n,data:null!==(t=null==o?void 0:o.data)&&void 0!==t?t:{},gotrue_meta_security:{captcha_token:null==o?void 0:o.captchaToken},code_challenge:s,code_challenge_method:a},xform:tp})}else if("phone"in e){let{phone:t,password:o,options:s}=e;i=await td(this.fetch,"POST",`${this.url}/signup`,{headers:this.headers,body:{phone:t,password:o,data:null!==(r=null==s?void 0:s.data)&&void 0!==r?r:{},channel:null!==(n=null==s?void 0:s.channel)&&void 0!==n?n:"sms",gotrue_meta_security:{captcha_token:null==s?void 0:s.captchaToken}},xform:tp})}else throw new tr("You must provide either an email or phone number and a password");let{data:o,error:s}=i;if(s||!o)return{data:{user:null,session:null},error:s};let a=o.session,l=o.user;return o.session&&(await this._saveSession(o.session),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:l,session:a},error:null}}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithPassword(e){try{let t;if(await this._removeSession(),"email"in e){let{email:r,password:n,options:i}=e;t=await td(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{email:r,password:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:tp})}else if("phone"in e){let{phone:r,password:n,options:i}=e;t=await td(this.fetch,"POST",`${this.url}/token?grant_type=password`,{headers:this.headers,body:{phone:r,password:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},xform:tp})}else throw new tr("You must provide either an email or phone number and a password");let{data:r,error:n}=t;if(n)return{data:{user:null,session:null},error:n};if(!r||!r.session||!r.user)return{data:{user:null,session:null},error:new tt};return r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:{user:r.user,session:r.session},error:n}}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOAuth(e){var t,r,n,i;return await this._removeSession(),await this._handleProviderSignIn(e.provider,{redirectTo:null===(t=e.options)||void 0===t?void 0:t.redirectTo,scopes:null===(r=e.options)||void 0===r?void 0:r.scopes,queryParams:null===(n=e.options)||void 0===n?void 0:n.queryParams,skipBrowserRedirect:null===(i=e.options)||void 0===i?void 0:i.skipBrowserRedirect})}async exchangeCodeForSession(e){let t=await eK(this.storage,`${this.storageKey}-code-verifier`),{data:r,error:n}=await td(this.fetch,"POST",`${this.url}/token?grant_type=pkce`,{headers:this.headers,body:{auth_code:e,code_verifier:t},xform:tp});return(await eJ(this.storage,`${this.storageKey}-code-verifier`),n)?{data:{user:null,session:null},error:n}:r&&r.session&&r.user?(r.session&&(await this._saveSession(r.session),await this._notifyAllSubscribers("SIGNED_IN",r.session)),{data:r,error:n}):{data:{user:null,session:null},error:new tt}}async signInWithIdToken(e){await this._removeSession();try{let{options:t,provider:r,token:n,access_token:i,nonce:o}=e,s=await td(this.fetch,"POST",`${this.url}/token?grant_type=id_token`,{headers:this.headers,body:{provider:r,id_token:n,access_token:i,nonce:o,gotrue_meta_security:{captcha_token:null==t?void 0:t.captchaToken}},xform:tp}),{data:a,error:l}=s;if(l)return{data:{user:null,session:null},error:l};if(!a||!a.session||!a.user)return{data:{user:null,session:null},error:new tt};return a.session&&(await this._saveSession(a.session),await this._notifyAllSubscribers("SIGNED_IN",a.session)),{data:a,error:l}}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithOtp(e){var t,r,n,i,o;try{if(await this._removeSession(),"email"in e){let{email:n,options:i}=e,o=null,s=null;if("pkce"===this.flowType){let e=eY();await eG(this.storage,`${this.storageKey}-code-verifier`,e),o=await e0(e),s=e===o?"plain":"s256"}let{error:a}=await td(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{email:n,data:null!==(t=null==i?void 0:i.data)&&void 0!==t?t:{}
6,create_user:null===(r=null==i?void 0:i.shouldCreateUser)||void 0===r||r,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken},code_challenge:o,code_challenge_method:s},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:a}}if("phone"in e){let{phone:t,options:r}=e,{data:s,error:a}=await td(this.fetch,"POST",`${this.url}/otp`,{headers:this.headers,body:{phone:t,data:null!==(n=null==r?void 0:r.data)&&void 0!==n?n:{},create_user:null===(i=null==r?void 0:r.shouldCreateUser)||void 0===i||i,gotrue_meta_security:{captcha_token:null==r?void 0:r.captchaToken},channel:null!==(o=null==r?void 0:r.channel)&&void 0!==o?o:"sms"}});return{data:{user:null,session:null,messageId:null==s?void 0:s.message_id},error:a}}throw new tr("You must provide either an email or phone number.")}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async verifyOtp(e){var t,r;try{let n,i;"email_change"!==e.type&&"phone_change"!==e.type&&await this._removeSession(),"options"in e&&(n=null===(t=e.options)||void 0===t?void 0:t.redirectTo,i=null===(r=e.options)||void 0===r?void 0:r.captchaToken);let{data:o,error:s}=await td(this.fetch,"POST",`${this.url}/verify`,{headers:this.headers,body:Object.assign(Object.assign({},e),{gotrue_meta_security:{captcha_token:i}}),redirectTo:n,xform:tp});if(s)throw s;if(!o)throw Error("An error occurred on token verification.");let a=o.session,l=o.user;return(null==a?void 0:a.access_token)&&(await this._saveSession(a),await this._notifyAllSubscribers("SIGNED_IN",a)),{data:{user:l,session:a},error:null}}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async signInWithSSO(e){var t,r,n;try{return await this._removeSession(),await td(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:null!==(r=null===(t=e.options)||void 0===t?void 0:t.redirectTo)&&void 0!==r?r:void 0}),(null===(n=null==e?void 0:e.options)||void 0===n?void 0:n.captchaToken)?{gotrue_meta_security:{captcha_token:e.options.captchaToken}}:null),{skip_http_redirect:!0}),headers:this.headers,xform:ty})}catch(e){if(e6(e))return{data:null,error:e};throw e}}async reauthenticate(){try{return await this._useSession(async e=>{let{data:{session:t},error:r}=e;if(r)throw r;if(!t)throw new te;let{error:n}=await td(this.fetch,"GET",`${this.url}/reauthenticate`,{headers:this.headers,jwt:t.access_token});return{data:{user:null,session:null},error:n}})}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async resend(e){try{"email_change"!=e.type&&"phone_change"!=e.type&&await this._removeSession();let t=`${this.url}/resend`;if("email"in e){let{email:r,type:n,options:i}=e,{error:o}=await td(this.fetch,"POST",t,{headers:this.headers,body:{email:r,type:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}},redirectTo:null==i?void 0:i.emailRedirectTo});return{data:{user:null,session:null},error:o}}if("phone"in e){let{phone:r,type:n,options:i}=e,{data:o,error:s}=await td(this.fetch,"POST",t,{headers:this.headers,body:{phone:r,type:n,gotrue_meta_security:{captcha_token:null==i?void 0:i.captchaToken}}});return{data:{user:null,session:null,messageId:null==o?void 0:o.message_id},error:s}}throw new tr("You must provide either an email or phone number and a type")}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async getSession(){return this._useSession(async e=>e)}async _acquireLock(e,t){this._debug("#_acquireLock","begin",e);try{if(e3("_acquireLock"))return this._debug("#_acquireLock","recursive call"),await t();return await this.lock(`lock:${this.storageKey}`,e,async()=>{this._debug("#_acquireLock","lock acquired for storage key",this.storageKey);try{return await e4("_acquireLock",async()=>await t())}finally{this._debug("#_acquireLock","lock released for storage key",this.storageKey)}})}finally{this._debug("#_acquireLock","end")}}async _useSession(e){this._debug("#_useSession","begin");
6try{if(e3("_useSession")){this._debug("#_useSession","recursive call");let t=await this.__loadSession();return await e(t)}return await this._acquireLock(-1,async()=>await e4("_useSession",async()=>{let t=await this.__loadSession();return await e(t)}))}finally{this._debug("#_useSession","end")}}async __loadSession(){if(this._debug("#__loadSession()","begin"),this.logDebugMessages&&!e3("_useSession"))throw Error("Please use #_useSession()");e3("_initialize")||await this.initializePromise;try{let e=null;if(this.persistSession){let t=await eK(this.storage,this.storageKey);this._debug("#getSession()","session from storage",t),null!==t&&(this._isValidSession(t)?e=t:(this._debug("#getSession()","session from storage is not valid"),await this._removeSession()))}else e=this.inMemorySession,this._debug("#getSession()","session from memory",e);if(!e)return{data:{session:null},error:null};let t=!!e.expires_at&&e.expires_at<=Date.now()/1e3;if(this._debug("#__loadSession()",`session has${t?"":" not"} expired`,"expires_at",e.expires_at),!t)return{data:{session:e},error:null};let{session:r,error:n}=await this._callRefreshToken(e.refresh_token);if(n)return{data:{session:null},error:n};return{data:{session:r},error:null}}finally{this._debug("#__loadSession()","end")}}async getUser(e){try{return await this._useSession(async t=>{var r,n;if(!e){let{data:i,error:o}=t;if(o)throw o;e=null!==(n=null===(r=i.session)||void 0===r?void 0:r.access_token)&&void 0!==n?n:void 0}return await td(this.fetch,"GET",`${this.url}/user`,{headers:this.headers,jwt:e,xform:tv})})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}async updateUser(e,t={}){try{return await this._useSession(async r=>{let{data:n,error:i}=r;if(i)throw i;if(!n.session)throw new te;let o=n.session,{data:s,error:a}=await td(this.fetch,"PUT",`${this.url}/user`,{headers:this.headers,redirectTo:null==t?void 0:t.emailRedirectTo,body:e,jwt:o.access_token,xform:tv});if(a)throw a;return o.user=s.user,await this._saveSession(o),await this._notifyAllSubscribers("USER_UPDATED",o),{data:{user:o.user},error:null}})}catch(e){if(e6(e))return{data:{user:null},error:e};throw e}}_decodeJWT(e){return eX(e)}async setSession(e){try{if(!e.access_token||!e.refresh_token)throw new te;let t=Date.now()/1e3,r=t,n=!0,i=null,o=eX(e.access_token);if(o.exp&&(n=(r=o.exp)<=t),n){let{session:t,error:r}=await this._callRefreshToken(e.refresh_token);if(r)return{data:{user:null,session:null},error:r};if(!t)return{data:{user:null,session:null},error:null};i=t}else{let{data:n,error:o}=await this.getUser(e.access_token);if(o)throw o;i={access_token:e.access_token,refresh_token:e.refresh_token,user:n.user,token_type:"bearer",expires_in:r-t,expires_at:r},await this._saveSession(i),await this._notifyAllSubscribers("SIGNED_IN",i)}return{data:{user:i.user,session:i},error:null}}catch(e){if(e6(e))return{data:{session:null,user:null},error:e};throw e}}async refreshSession(e){try{return await this._useSession(async t=>{var r;if(!e){let{data:n,error:i}=t;if(i)throw i;e=null!==(r=n.session)&&void 0!==r?r:void 0}if(!(null==e?void 0:e.refresh_token))throw new te;let{session:n,error:i}=await this._callRefreshToken(e.refresh_token);return i?{data:{user:null,session:null},error:i}:n?{data:{user:n.user,session:n},error:null}:{data:{user:null,session:null},error:null}})}catch(e){if(e6(e))return{data:{user:null,session:null},error:e};throw e}}async _getSessionFromUrl(e){try{if(!eB())throw new tn("No browser detected.");if("implicit"!==this.flowType||this._isImplicitGrantFlow()){if("pkce"==this.flowType&&!e)throw new ti("Not a valid PKCE flow url.")}else throw new tn("Not a valid implicit grant flow url.");if(e){let e=eF("code");if(!e)throw new ti("No code detected.");let{data:t,error:r}=await this.exchangeCodeForSession(e);if(r)throw r;if(!t.session)throw new ti("No session detected.");let n=new URL(window.location.href);return n.searchParams.delete("code"),window.history.replaceState(window.history.state,"",n.toString()),{data:{session:t.session,redirectType:null},error:null}}let t=eF("error_description");if(t){let e=eF("error_code");if(!e)throw new tn("No error_code detected.");let r=eF("error");
6if(!r)throw new tn("No error detected.");throw new tn(t,{error:r,code:e})}let r=eF("provider_token"),n=eF("provider_refresh_token"),i=eF("access_token");if(!i)throw new tn("No access_token detected.");let o=eF("expires_in");if(!o)throw new tn("No expires_in detected.");let s=eF("refresh_token");if(!s)throw new tn("No refresh_token detected.");let a=eF("token_type");if(!a)throw new tn("No token_type detected.");let l=Math.round(Date.now()/1e3),u=l+parseInt(o),{data:c,error:h}=await this.getUser(i);if(h)throw h;let d=c.user,f={provider_token:r,provider_refresh_token:n,access_token:i,expires_in:parseInt(o),expires_at:u,refresh_token:s,token_type:a,user:d},p=eF("type");return window.location.hash="",this._debug("#_getSessionFromUrl()","clearing window.location.hash"),{data:{session:f,redirectType:p},error:null}}catch(e){if(e6(e))return{data:{session:null,redirectType:null},error:e};throw e}}_isImplicitGrantFlow(){return eB()&&(Boolean(eF("access_token"))||Boolean(eF("error_description")))}async _isPKCEFlow(){let e=await eK(this.storage,`${this.storageKey}-code-verifier`);return Boolean(eF("code"))&&Boolean(e)}async signOut({scope:e}={scope:"global"}){return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return{error:i};let o=null===(r=n.session)||void 0===r?void 0:r.access_token;if(o){let{error:t}=await this.admin.signOut(o,e);if(t&&!(e6(t)&&"AuthApiError"===t.name&&(404===t.status||401===t.status)))return{error:t}}return"others"!==e&&(await this._removeSession(),await eJ(this.storage,`${this.storageKey}-code-verifier`),await this._notifyAllSubscribers("SIGNED_OUT",null)),{error:null}})}onAuthStateChange(e){let t="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){let t=16*Math.random()|0;return("x"==e?t:3&t|8).toString(16)}),r={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,r),this._emitInitialSession(t),{data:{subscription:r}}}async _emitInitialSession(e){return await this._useSession(async t=>{var r,n;try{let{data:{session:n},error:i}=t;if(i)throw i;await (null===(r=this.stateChangeEmitters.get(e))||void 0===r?void 0:r.callback("INITIAL_SESSION",n)),this._debug("INITIAL_SESSION","callback id",e,"session",n)}catch(t){await (null===(n=this.stateChangeEmitters.get(e))||void 0===n?void 0:n.callback("INITIAL_SESSION",null)),this._debug("INITIAL_SESSION","callback id",e,"error",t),console.error(t)}})}async resetPasswordForEmail(e,t={}){let r=null,n=null;if("pkce"===this.flowType){let e=eY();await eG(this.storage,`${this.storageKey}-code-verifier`,e),r=await e0(e),n=e===r?"plain":"s256"}try{return await td(this.fetch,"POST",`${this.url}/recover`,{body:{email:e,code_challenge:r,code_challenge_method:n,gotrue_meta_security:{captcha_token:t.captchaToken}},headers:this.headers,redirectTo:t.redirectTo})}catch(e){if(e6(e))return{data:null,error:e};throw e}}async _refreshAccessToken(e){let t=`#_refreshAccessToken(${e.substring(0,5)}...)`;this._debug(t,"begin");try{let r=Date.now();return await function(e,t){let r=new Promise((r,n)=>{(async()=>{for(let i=0;i<1/0;i++)try{let n=await e(i);if(!t(i,null,n)){r(n);return}}catch(e){if(!t(i,e)){n(e);return}}})()});return r}(async r=>{var n;return await (n=200*r,new Promise(e=>{setTimeout(()=>e(null),n)})),this._debug(t,"refreshing attempt",r),await td(this.fetch,"POST",`${this.url}/token?grant_type=refresh_token`,{body:{refresh_token:e},headers:this.headers,xform:tp})},(e,t,n)=>n&&n.error&&ts(n.error)&&Date.now()+(e+1)*200-r<3e4)}catch(e){if(this._debug(t,"error",e),e6(e))return{data:{session:null,user:null},error:e};throw e}finally{this._debug(t,"end")}}_isValidSession(e){return"object"==typeof e&&null!==e&&"access_token"in e&&"refresh_token"in e&&"expires_at"in e}async _handleProviderSignIn(e,t){let r=await this._getUrlForProvider(e,{redirectTo:t.redirectTo,scopes:t.scopes,queryParams:t.queryParams});return this._debug("#_handleProviderSignIn()","provider",e,"options",t,"url",r),eB()&&
6!t.skipBrowserRedirect&&window.location.assign(r),{data:{provider:e,url:r},error:null}}async _recoverAndRefresh(){var e;let t="#_recoverAndRefresh()";this._debug(t,"begin");try{let r=await eK(this.storage,this.storageKey);if(this._debug(t,"session from storage",r),!this._isValidSession(r)){this._debug(t,"session is not valid"),null!==r&&await this._removeSession();return}let n=Math.round(Date.now()/1e3),i=(null!==(e=r.expires_at)&&void 0!==e?e:1/0)<n+10;if(this._debug(t,`session has${i?"":" not"} expired with margin of 10s`),i){if(this.autoRefreshToken&&r.refresh_token){let{error:e}=await this._callRefreshToken(r.refresh_token);e&&(console.error(e),ts(e)||(this._debug(t,"refresh failed with a non-retryable error, removing the session",e),await this._removeSession()))}}else await this._notifyAllSubscribers("SIGNED_IN",r)}catch(e){this._debug(t,"error",e),console.error(e);return}finally{this._debug(t,"end")}}async _callRefreshToken(e){var t,r;if(!e)throw new te;if(this.refreshingDeferred)return this.refreshingDeferred.promise;let n=`#_callRefreshToken(${e.substring(0,5)}...)`;this._debug(n,"begin");try{this.refreshingDeferred=new eW;let{data:t,error:r}=await this._refreshAccessToken(e);if(r)throw r;if(!t.session)throw new te;await this._saveSession(t.session),await this._notifyAllSubscribers("TOKEN_REFRESHED",t.session);let n={session:t.session,error:null};return this.refreshingDeferred.resolve(n),n}catch(e){if(this._debug(n,"error",e),e6(e)){let r={session:null,error:e};return null===(t=this.refreshingDeferred)||void 0===t||t.resolve(r),r}throw null===(r=this.refreshingDeferred)||void 0===r||r.reject(e),e}finally{this.refreshingDeferred=null,this._debug(n,"end")}}async _notifyAllSubscribers(e,t,r=!0){let n=`#_notifyAllSubscribers(${e})`;this._debug(n,"begin",t,`broadcast = ${r}`);try{this.broadcastChannel&&r&&this.broadcastChannel.postMessage({event:e,session:t});let n=[],i=Array.from(this.stateChangeEmitters.values()).map(async r=>{try{await r.callback(e,t)}catch(e){n.push(e)}});if(await Promise.all(i),n.length>0){for(let e=0;e<n.length;e+=1)console.error(n[e]);throw n[0]}}finally{this._debug(n,"end")}}async _saveSession(e){this._debug("#_saveSession()",e),this.persistSession||(this.inMemorySession=e),this.persistSession&&e.expires_at&&await this._persistSession(e)}_persistSession(e){return this._debug("#_persistSession()",e),eG(this.storage,this.storageKey,e)}async _removeSession(){this._debug("#_removeSession()"),this.persistSession?await eJ(this.storage,this.storageKey):this.inMemorySession=null}_removeVisibilityChangedCallback(){this._debug("#_removeVisibilityChangedCallback()");let e=this.visibilityChangedCallback;this.visibilityChangedCallback=null;try{e&&eB()&&(null==window?void 0:window.removeEventListener)&&window.removeEventListener("visibilitychange",e)}catch(e){console.error("removing visibilitychange callback failed",e)}}async _startAutoRefresh(){await this._stopAutoRefresh(),this._debug("#_startAutoRefresh()");let e=setInterval(()=>this._autoRefreshTokenTick(),3e4);this.autoRefreshTicker=e,e&&"object"==typeof e&&"function"==typeof e.unref?e.unref():"undefined"!=typeof Deno&&"function"==typeof Deno.unrefTimer&&Deno.unrefTimer(e),await this._autoRefreshTokenTick()}async _stopAutoRefresh(){this._debug("#_stopAutoRefresh()");let 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{let e=Date.now();try{return await this._useSession(async t=>{let{data:{session:r}}=t;if(!r||!r.refresh_token||!r.expires_at){this._debug("#_autoRefreshTokenTick()","no session");return}let n=Math.floor((1e3*r.expires_at-e)/3e4);this._debug("#_autoRefreshTokenTick()",`access token expires in ${n} ticks, a tick lasts 30000ms, refresh threshold is 3 ticks`),n<=3&&await this._callRefreshToken(r.refresh_token)})}catch(e){console.error("Auto refresh tick failed with error. This is likely a transient error.",e)}}finally{this._debug("#_autoRefreshTokenTick()","end")}}async _handleVisibilityChange(){if(this._debug("#_handleVisibilityChange()"),!eB()||!(null==window?void 0:window.addEventListener))return this.autoRefreshToken&&this.startAutoRefresh(),!1;try{this.visibilityChangedCallback=async()=>await this._onVisibilityChanged(!1),null==window||window.addEventListener("visibilitychange",this.visibilityChangedCallback),await this._onVisibilityChanged(!0)}catch(e){console.error("_handleVisibilityChange",e)}}async _onVisibilityChanged(e){this._debug(`#_onVisibilityChanged(${e})`,"visibilityState",document.visibilityState),"visible"===document.visibilityState?(e||(await this.initializePromise,await this._recoverAndRefresh(),this._debug("#_onVisibilityChanged()","finished waiting for initialize, _recoverAndRefresh")),this.autoRefreshToken&&this._startAutoRefresh()):"hidden"===document.visibilityState&&this.autoRefreshToken&&this._stopAutoRefresh()}async _getUrlForProvider(e,t){let r=[`provider=${encodeURIComponent(e)}`];if((null==t?void 0:t.redirectTo)&&r.push(`redirect_to=${encodeURIComponent(t.redirectTo)}`),(null==t?void 0:t.scopes)&&r.push(`scopes=${encodeURIComponent(t.scopes)}`),"pkce"===this.flowType){let e=eY();await eG(this.storage,`${this.storageKey}-code-verifier`,e);let t=await e0(e),n=e===t?"plain":"s256";this._debug("PKCE","code verifier",`${e.substring(0,5)}...`,"code challenge",t,"method",n);let i=new URLSearchParams({code_challenge:`${encodeURIComponent(t)}`,code_challenge_method:`${encodeURIComponent(n)}`});
6r.push(i.toString())}if(null==t?void 0:t.queryParams){let e=new URLSearchParams(t.queryParams);r.push(e.toString())}return`${this.url}/authorize?${r.join("&")}`}async _unenroll(e){try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;return i?{data:null,error:i}:await td(this.fetch,"DELETE",`${this.url}/factors/${e.factorId}`,{headers:this.headers,jwt:null===(r=null==n?void 0:n.session)||void 0===r?void 0:r.access_token})})}catch(e){if(e6(e))return{data:null,error:e};throw e}}async _enroll(e){try{return await this._useSession(async t=>{var r,n;let{data:i,error:o}=t;if(o)return{data:null,error:o};let{data:s,error:a}=await td(this.fetch,"POST",`${this.url}/factors`,{body:{friendly_name:e.friendlyName,factor_type:e.factorType,issuer:e.issuer},headers:this.headers,jwt:null===(r=null==i?void 0:i.session)||void 0===r?void 0:r.access_token});return a?{data:null,error:a}:((null===(n=null==s?void 0:s.totp)||void 0===n?void 0:n.qr_code)&&(s.totp.qr_code=`data:image/svg+xml;utf-8,${s.totp.qr_code}`),{data:s,error:null})})}catch(e){if(e6(e))return{data:null,error:e};throw e}}async _verify(e){try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;if(i)return{data:null,error:i};let{data:o,error:s}=await td(this.fetch,"POST",`${this.url}/factors/${e.factorId}/verify`,{body:{code:e.code,challenge_id:e.challengeId},headers:this.headers,jwt:null===(r=null==n?void 0:n.session)||void 0===r?void 0:r.access_token});return s?{data:null,error:s}:(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:s})})}catch(e){if(e6(e))return{data:null,error:e};throw e}}async _challenge(e){try{return await this._useSession(async t=>{var r;let{data:n,error:i}=t;return i?{data:null,error:i}:await td(this.fetch,"POST",`${this.url}/factors/${e.factorId}/challenge`,{headers:this.headers,jwt:null===(r=null==n?void 0:n.session)||void 0===r?void 0:r.access_token})})}catch(e){if(e6(e))return{data:null,error:e};throw e}}async _challengeAndVerify(e){let{data:t,error:r}=await this._challenge({factorId:e.factorId});return r?{data:null,error:r}:await this._verify({factorId:e.factorId,challengeId:t.id,code:e.code})}async _listFactors(){let{data:{user:e},error:t}=await this.getUser();if(t)return{data:null,error:t};let r=(null==e?void 0:e.factors)||[],n=r.filter(e=>"totp"===e.factor_type&&"verified"===e.status);return{data:{all:r,totp:n},error:null}}async _getAuthenticatorAssuranceLevel(){return await this._useSession(async e=>{var t,r;let{data:{session:n},error:i}=e;if(i)return{data:null,error:i};if(!n)return{data:{currentLevel:null,nextLevel:null,currentAuthenticationMethods:[]},error:null};let o=this._decodeJWT(n.access_token),s=null;o.aal&&(s=o.aal);let a=s,l=null!==(r=null===(t=n.user.factors)||void 0===t?void 0:t.filter(e=>"verified"===e.status))&&void 0!==r?r:[];l.length>0&&(a="aal2");let u=o.amr||[];return{data:{currentLevel:s,nextLevel:a,currentAuthenticationMethods:u},error:null}})}}tT.nextInstanceID=0,globalThis&&globalThis.localStorage&&globalThis.localStorage.getItem("supabase.gotrue-js.locks.debug");class tE extends tT{constructor(e){super(e)}}let tk={headers:{"X-Client-Info":"supabase-js/2.26.0"}},tR={schema:"public"},tA={autoRefreshToken:!0,persistSession:!0,detectSessionInUrl:!0,flowType:"implicit"},tO={};class tj{constructor(e,t,r){var n,i,o,s,a,l,u,c;if(this.supabaseUrl=e,this.supabaseKey=t,!e)throw Error("supabaseUrl is required.");if(!t)throw Error("supabaseKey is required.");let h=e.replace(/\/$/,"");this.realtimeUrl=`${h}/realtime/v1`.replace(/^http/i,"ws"),this.authUrl=`${h}/auth/v1`,this.storageUrl=`${h}/storage/v1`,this.functionsUrl=`${h}/functions/v1`;let d=`sb-${new URL(this.authUrl).hostname.split(".")[0]}-auth-token`,f={db:tR,realtime:tO,auth:Object.assign(Object.assign({},tA),{storageKey:d}),global:tk},p=function(e,t){let{db:r,auth:n,realtime:i,global:o}=e,{db:s,auth:a,realtime:l,global:u}=t;return{db:Object.assign(Object.assign({},s),r),auth:Object.assign(Object.assign({},a),n),realtime:Object.assign(Object.assign({},l),i),global:Object.assign(Object.assign({},u),o)}}(null!=r?r:{},f);this.storageKey=null!==(i=null===(n=p.auth)||void 0===n?void 0:n.storageKey)&&void 0!==i?i:"",this.headers=null!==(s=null===(o=p.global)||void 0===o?void 0:o.headers)&&void 0!==s?s:{},this.auth=this._initSupabaseAuthClient(null!==(a=p.auth)&&void 0!==a?a:{},this.headers,null===(l=p.global)||void 0===l?void 0:l.fetch),this.fetch=eD(t,this._getAccessToken.bind(this),null===(u=p.global)||void 0===u?void 0:u.fetch),this.realtime=this._initRealtimeClient(Object.assign({headers:this.headers},p.realtime)),this.rest=new K(`${h}/rest/v1`,{headers:this.headers,schema:null===(c=p.db)||void 0===c?void 0:c.schema,fetch:this.fetch}),this._listenForAuthEvents()}get functions(){return new D(this.functionsUrl,{headers:this.headers,customFetch:this.fetch})}get storage(){return new eM(this.storageUrl,this.headers,this.fetch)}from(e){return this.rest.from(e)}rpc(e,t={},r){return this.rest.rpc(e,t,r)}
6channel(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,r,n,i,o;return r=this,n=void 0,i=void 0,o=function*(){let{data:r}=yield this.auth.getSession();return null!==(t=null===(e=r.session)||void 0===e?void 0:e.access_token)&&void 0!==t?t:null},new(i||(i=Promise))(function(e,t){function s(e){try{l(o.next(e))}catch(e){t(e)}}function a(e){try{l(o.throw(e))}catch(e){t(e)}}function l(t){var r;t.done?e(t.value):((r=t.value)instanceof i?r:new i(function(e){e(r)})).then(s,a)}l((o=o.apply(r,n||[])).next())})}_initSupabaseAuthClient({autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,storageKey:i,flowType:o},s,a){let l={Authorization:`Bearer ${this.supabaseKey}`,apikey:`${this.supabaseKey}`};return new tE({url:this.authUrl,headers:Object.assign(Object.assign({},l),s),storageKey:i,autoRefreshToken:e,persistSession:t,detectSessionInUrl:r,storage:n,flowType:o,fetch:a})}_initRealtimeClient(e){return new ef(this.realtimeUrl,Object.assign(Object.assign({},e),{params:Object.assign({apikey:this.supabaseKey},null==e?void 0:e.params)}))}_listenForAuthEvents(){return this.auth.onAuthStateChange((e,t)=>{this._handleTokenChanged(e,"CLIENT",null==t?void 0:t.access_token)})}_handleTokenChanged(e,t,r){("TOKEN_REFRESHED"===e||"SIGNED_IN"===e)&&this.changedAccessToken!==r?(this.realtime.setAuth(null!=r?r:null),this.changedAccessToken=r):"SIGNED_OUT"===e&&(this.realtime.setAuth(this.supabaseKey),"STORAGE"==t&&this.auth.signOut(),this.changedAccessToken=void 0)}}let tC=(e,t,r)=>new tj(e,t,r),tP=tC("https://yzimtyzqawfvxprudphl.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inl6aW10eXpxYXdmdnhwcnVkcGhsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODIxOTE3NjQsImV4cCI6MTk5Nzc2Nzc2NH0.g5geBgPnRehD_XD6zCQrsNFjSSOtjakpB8hEyFghN4s"),tN=e=>tC("https://yzimtyzqawfvxprudphl.supabase.co","eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Inl6aW10eXpxYXdmdnhwcnVkcGhsIiwicm9sZSI6ImFub24iLCJpYXQiOjE2ODIxOTE3NjQsImV4cCI6MTk5Nzc2Nzc2NH0.g5geBgPnRehD_XD6zCQrsNFjSSOtjakpB8hEyFghN4s",{global:{headers:{Authorization:"Bearer ".concat(e)}}}),tL=e=>{let{toolId:t,upstacks:r}=e,{data:n}=(0,C.useSession)(),{isLoginModalOpen:i,setIsLoginModalOpen:o}=(0,T.useContext)(P.a);(0,j.useRouter)();let[s,a]=(0,T.useState)(0),[l,u]=(0,T.useState)(!1);(0,T.useEffect)(()=>{let e=async()=>{let{data:e,count:r,error:n}=await tP.from("upstacks").select("tool_id",{count:"exact",head:!0}).eq("tool_id",t);n?console.log(n):a(r)};e()},[t,n]),(0,T.useEffect)(()=>{let e=async()=>{if(n){var e;o(!1);let{data:r,count:i,error:s}=await tP.from("upstacks").select("tool_id",{count:"exact",head:!0}).eq("tool_id",t).eq("user_id",null==n?void 0:null===(e=n.user)||void 0===e?void 0:e.id);s?console.log(s):1===i?u(!0):u(!1)}};e()},[t,n,i,o]),(0,T.useEffect)(e=>{e&&o(!1)},[n,o]);let c=async()=>{if(n){var e,r;if(l){let{data:r,error:i}=await tN(null==n?void 0:n.supabaseAccessToken).from("upstacks").delete().eq("tool_id",t).eq("user_id",null==n?void 0:null===(e=n.user)||void 0===e?void 0:e.id);i?console.log(i):(u(!1),a(e=>e-1))}else{let{data:e,error:i}=await tN(null==n?void 0:n.supabaseAccessToken).from("upstacks").insert([{tool_id:t,user_id:null==n?void 0:null===(r=n.user)||void 0===r?void 0:r.id}]);i?console.log(i):(u(!0),a(e=>e+1))}}else o(!0)};return(0,x.jsxs)("button",{className:R()("flex justify-center items-center flex-col","text-primary font-semibold rounded border-2 px-2","md:px-4 py-1 md:py-2 gap-2 md:gap-3 md:flex-row",l?"border-primary shadow-inner":null),onClick:c,children:[(0,x.jsx)(N.x7,{}),(0,x.jsx)(E.Es,{}),(0,x.jsx)("span",{className:"text-xs md:text-sm",children:s})]})},tI=e=>{let{toolId:t,upstacks:r}=e,{data:n}=(0,C.useSession)(),{isLoginModalOpen:i,setIsLoginModalOpen:o}=(0,T.useContext)(P.a);(0,j.useRouter)();let[s,a]=(0,T.useState)(0),[l,u]=(0,T.useState)(!1);(0,T.useEffect)(()=>{let e=async()=>{let{data:e,count:r,error:n}=await tP.from("upstacks").select("tool_id",{count:"exact",head:!0}).eq("tool_id",t);n?console.log(n):a(r)};e()},[t,n]),(0,T.useEffect)(()=>{let e=async()=>
6{if(n){var e;o(!1);let{data:r,count:i,error:s}=await tP.from("upstacks").select("tool_id",{count:"exact",head:!0}).eq("tool_id",t).eq("user_id",null==n?void 0:null===(e=n.user)||void 0===e?void 0:e.id);s?console.log(s):1===i?u(!0):u(!1)}};e()},[t,n,i,o]),(0,T.useEffect)(e=>{e&&o(!1)},[n,o]);let c=async()=>{if(n){var e,r;if(l){let{data:r,error:i}=await tN(null==n?void 0:n.supabaseAccessToken).from("upstacks").delete().eq("tool_id",t).eq("user_id",null==n?void 0:null===(e=n.user)||void 0===e?void 0:e.id);i?console.log(i):(u(!1),a(e=>e-1))}else{let{data:e,error:i}=await tN(null==n?void 0:n.supabaseAccessToken).from("upstacks").insert([{tool_id:t,user_id:null==n?void 0:null===(r=n.user)||void 0===r?void 0:r.id}]);i?console.log(i):(u(!0),a(e=>e+1))}}else o(!0)};return(0,x.jsxs)("button",{className:"flex justify-center items-center border-2 ".concat(l?"bg-primary shadow-inner text-white":"text-primary  border-primary","  font-semibold rounded px-2 md:px-4 lg:px-6 py-2 md:py-3 lg:py-4 gap-1 md:gap-3"),onClick:c,children:[(0,x.jsx)(N.x7,{}),(0,x.jsx)(E.Es,{}),(0,x.jsx)("span",{className:"text-xs md:text-sm lg:text-base font-normal md:font-semibold ".concat(l?"text-white":"text-primary"),children:l?"upstacked":"upstack"}),(0,x.jsx)("span",{className:"rounded-full text-sm md:text-base font-normal md:font-semibold px-2 md:px-3 ".concat(i?"bg-white text-primary":"bg-primary text-white "),children:s})]})},tM=e=>{let{url:t}=e;return(0,x.jsx)(O(),{href:t.includes("?")?t:"".concat(t,"?ref=aioftheday&utm_source=aioftheday"),target:"_blank",className:"px-4 py-2 border rounded","data-splitbee-event":"Tool Click","data-splitbee-event-website":"".concat(t,"?ref=aioftheday&utm_source=aioftheday"),children:"Visit"})},tU=e=>{let{url:t}=e;return(0,x.jsx)(O(),{href:t.includes("?")?t:"".concat(t,"?ref=aioftheday&utm_source=aioftheday"),target:"_blank",className:"px-4 py-2 font-medium border-2 border-black rounded md:py-3 lg:py-4","data-splitbee-event":"Tool Click","data-splitbee-event-website":"".concat(t,"?ref=aioftheday&utm_source=aioftheday"),children:"Visit"})},t$=e=>{let{handleYesterdayClick:t}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"hidden md:block",children:(0,x.jsxs)("button",{className:"flex gap-2 hover:font-medium",onClick:t,children:[(0,x.jsx)(E.jJ,{}),"Yesterday"]})}),(0,x.jsx)("div",{className:"block md:hidden",onClick:t,children:(0,x.jsx)("button",{children:(0,x.jsx)(E.jJ,{})})})]})},tD=e=>{let{handleTomorrowClick:t}=e;return(0,x.jsxs)(x.Fragment,{children:[(0,x.jsx)("div",{className:"hidden md:block",children:(0,x.jsxs)("button",{className:"flex gap-2 hover:font-medium",onClick:t,children:["Tomorrow",(0,x.jsx)(E.Ne,{})]})}),(0,x.jsx)("div",{className:"block md:hidden",onClick:t,children:(0,x.jsx)("button",{children:(0,x.jsx)(E.Ne,{})})})]})},tB=e=>{let{handleTodayClick:t}=e;return(0,x.jsx)("button",{className:"flex gap-2 font-bold",onClick:t,children:"Today's Trending AI Tools \uD83D\uDC47"})},tV=()=>{let e=(0,j.useRouter)();return(0,x.jsx)("div",{className:"flex items-center h-full py-3 md:py-5",children:(0,x.jsxs)("button",{className:"flex items-center h-full gap-2 font-medium",onClick:()=>e.back(),children:[(0,x.jsx)("span",{children:(0,x.jsx)("svg",{xmlns:"http://www.w3.org/2000/svg",className:"w-5 h-5 fill-primary",viewBox:"0 0 512 512",children:(0,x.jsx)("path",{d:"M109.3 288L480 288c17.7 0 32-14.3 32-32s-14.3-32-32-32l-370.7 0 73.4-73.4c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0l-128 128c-12.5 12.5-12.5 32.8 0 45.3l128 128c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L109.3 288z"})})}),"Back"]})})},tz=()=>{(0,j.useRouter)();let e=(e,t)=>{var r,n,i,o,s,a;let l=null!==(r=window.screenLeft)&&void 0!==r?r:window.screenX,u=null!==(n=window.screenTop)&&void 0!==n?n:window.screenY,c=null!==(o=null!==(i=window.innerWidth)&&void 0!==i?i:document.documentElement.clientWidth)&&void 0!==o?o:screen.width,h=null!==(a=null!==(s=window.innerHeight)&&void 0!==s?s:document.documentElement.clientHeight)&&void 0!==a?a:screen.height,d=c/window.screen.availWidth,f=window.open(e,t,"width=".concat(500/d,",height=").concat(550/d,",top=").concat((h-550)/2/d+u,",left=").concat((c-500)/2/d+l));
6null==f||f.focus()};return(0,x.jsxs)("button",{className:"flex items-center justify-center gap-2 px-4 py-2 font-semibold border rounded w-fit md:py-3 lg:py-4",onClick:()=>{e("/google-signin","Google Sign In")},children:[(0,x.jsx)(E._8,{}),"Sign in with Google"]})}},9924:function(e,t,r){"use strict";let n;r.r(t),r.d(t,{default:function(){return L}});var i=r(5893),o=r(3299),s=r(1163),a=r(7294),l=r(4480),u=r(3957),c=r(2255),h=r(9873);let d=()=>{let{data:e,status:t}=(0,o.useSession)(),{isLoginModalOpen:r,setIsLoginModalOpen:n}=(0,a.useContext)(u.a);return(0,i.jsx)(i.Fragment,{children:r?(0,i.jsx)(i.Fragment,{children:(0,i.jsx)("div",{className:"fixed w-full inset-x-0 top-0 mx-auto bg-black bg-opacity-50 h-full p-3 z-[99999999999]",children:(0,i.jsx)("div",{className:"md:w-[60vw] lg:w-[40vw] mx-auto flex justify-center items-center text-center border bg-white rounded ",children:(0,i.jsxs)("div",{children:[(0,i.jsx)("div",{className:"flex justify-end items-center p-2 lg:p-3",children:(0,i.jsx)("button",{onClick:()=>n(!1),children:(0,i.jsx)(c.FB,{})})}),(0,i.jsxs)("div",{className:"p-5 md:p-10",children:[(0,i.jsx)("h1",{className:"text-2xl md:text-3xl font-bold md:text-center pb-3 md:pb-5 ",children:"Sign up on aioftheday"}),(0,i.jsxs)("div",{className:"flex justify-center items-center flex-col gap-5 text-slate-600 text-sm md:text-base mb-5",children:[(0,i.jsx)("p",{children:"Sign up and share your creation with thousands of ai enthusiasts."}),(0,i.jsx)(h.Ic,{}),(0,i.jsx)("p",{children:"By signing up, you agree to receive emails from us."})]})]})]})})})}):null})};var f=r(4298),p=r.n(f);r(6737);var v=r(357),y=r.n(v),m=r(7462);r(8679);var g=function(e,t,r){return e=(e=e<=r?e:r)>=t?e:t},_=function(){var e=!1,t=[],r=function r(){e=!0;var n=t.shift();if(n)return n(r);e=!1};return{clear:function(){e=!1,t=[]},enqueue:function(n){t.push(n),e||1!==t.length||r()}}},b=function(){var e;return{cancel:function(){e&&window.cancelAnimationFrame(e)},schedule:function(t,r){var n;e=window.requestAnimationFrame(function i(o){if(n=n||o,o-n>r){t();return}e=window.requestAnimationFrame(i)})}}},w=function(e){var t=0;return e>=0&&e<.2?t=.1:e>=.2&&e<.5?t=.04:e>=.5&&e<.8?t=.02:e>=.8&&e<.99&&(t=.005),g(e+t,0,.994)},S=function(e){(0,a.useEffect)(e,[])},x=function(e){return++e%1e6},T=function(){var e=(0,a.useState)(0)[1];return(0,a.useCallback)(function(){return e(x)},[])},E=function(e){void 0===e&&(e={});var t=T(),r=(0,a.useRef)((0,m.Z)({},e));return[(0,a.useCallback)(function(){return r.current},[]),(0,a.useCallback)(function(e){e&&(Object.assign(r.current,e),t())},[])]},k=function(){var e=(0,a.useRef)(!0);return e.current?(e.current=!1,!0):e.current},R=function(e,t){var r=k();(0,a.useEffect)(function(){if(!r)return e()},t)},A=function(){},O={isFinished:!0,progress:0,sideEffect:A},j=function(e){var t=void 0===e?{}:e,r=t.animationDuration,n=void 0===r?200:r,i=t.incrementDuration,o=void 0===i?800:i,s=t.isAnimating,l=void 0!==s&&s,u=t.minimum,c=void 0===u?.08:u,h=E(O),d=h[0],f=h[1],p=(0,a.useRef)(null),v=(0,a.useRef)(null);S(function(){p.current=_(),v.current=b()});var y=(0,a.useCallback)(function(){var e,t;null==(e=v.current)||e.cancel(),null==(t=p.current)||t.clear()},[]),x=(0,a.useCallback)(function(e){var t,r,i;if(1===(e=g(e,c,1))){y(),null==(r=p.current)||r.enqueue(function(t){f({progress:e,sideEffect:function(){var e;return null==(e=v.current)?void 0:e.schedule(t,n)}})}),null==(i=p.current)||i.enqueue(function(){f({isFinished:!0,sideEffect:y})});return}null==(t=p.current)||t.enqueue(function(t){f({isFinished:!1,progress:e,sideEffect:function(){var e;return null==(e=v.current)?void 0:e.schedule(t,n)}})})},[n,y,c,p,f,v]),T=(0,a.useCallback)(function(){x(w(d().progress))},[d,x]),k=(0,a.useCallback)(function(){!function e(){var t;T(),null==(t=p.current)||t.enqueue(function(t){var r;null==(r=v.current)||r.schedule(function(){e(),t()},o)})}()},[o,p,v,T]),j=(0,a.useRef)(A),C=d().sideEffect;return(0,a.useEffect)(function(){j.current=T}),S(function(){return l&&k(),y}),R(function(){d().sideEffect()},[d,C]),R(function(){l?f((0,m.Z)({},O,{sideEffect:k})):x(1)},[l,x,f,k]),{animationDuration:n,isFinished:d().isFinished,progress:d().progress}};let C=e=>{let{isRouteChanging:t}=e,{animationDuration:r,isFinished:n,progress:o}=j({isAnimating:t});return(0,i.jsxs)(i.Fragment,{children:[(0,i.jsx)(y(),{id:"fc4fcb9e46388b3b",dynamic:[n?0:1,r,(-1+o)*100,r],children:".np-container.__jsx-style-dynamic-selector{opacity:".concat(n?0:1,";pointer-events:none;-webkit-transition:opacity ").concat(r,"ms linear;-moz-transition:opacity ").concat(r,"ms linear;-o-transition:opacity ").concat(r,"ms linear;transition:opacity ").concat(r,"ms linear}.bar.__jsx-style-dynamic-selector{background:var(--color-primary);height:2px;left:0;margin-left:").concat((-1+o)*100,"%;position:fixed;top:0;-webkit-transition:margin-left ").concat(r,"ms linear;-moz-transition:margin-left ").concat(r,"ms linear;-o-transition:margin-left ").concat(r,"ms linear;transition:margin-left ").concat(r,"ms linear;width:100%;z-index:1031}.spinner.__jsx-style-dynamic-selector{-webkit-box-shadow:0 0 10px var(--color-primary),0 0 5px var(--color-primary);-moz-box-shadow:0 0 10px var(--color-primary),0 0 5px var(--color-primary);box-shadow:0 0 10px var(--color-primary),0 0 5px var(--color-primary);display:block;height:100%;opacity:1;position:absolute;right:0;-webkit-transform:rotate(3deg)translate(0px,-4px);
6-moz-transform:rotate(3deg)translate(0px,-4px);-ms-transform:rotate(3deg)translate(0px,-4px);-o-transform:rotate(3deg)translate(0px,-4px);transform:rotate(3deg)translate(0px,-4px);width:100px}")}),(0,i.jsx)("div",{className:y().dynamic([["fc4fcb9e46388b3b",[n?0:1,r,(-1+o)*100,r]]])+" np-container",children:(0,i.jsx)("div",{className:y().dynamic([["fc4fcb9e46388b3b",[n?0:1,r,(-1+o)*100,r]]])+" bar",children:(0,i.jsx)("div",{className:y().dynamic([["fc4fcb9e46388b3b",[n?0:1,r,(-1+o)*100,r]]])+" spinner"})})})]})};var P=r(3848);n=r(1767).default;let N=e=>{let{Component:t,pageProps:{session:r,...c}}=e,h=(0,s.useRouter)(),[f,v]=(0,a.useState)(!1),[y,m]=(0,a.useState)({isRouteChanging:!1,loadingKey:0}),g=(0,a.useMemo)(()=>({isLoginModalOpen:f,setIsLoginModalOpen:v}),[f]);return(0,a.useEffect)(()=>{let e=()=>{m(e=>({...e,isRouteChanging:!0,loadingKey:1^e.loadingKey}))},t=()=>{m(e=>({...e,isRouteChanging:!1}))};return h.events.on("routeChangeStart",e),h.events.on("routeChangeComplete",t),h.events.on("routeChangeError",t),()=>{h.events.off("routeChangeStart",e),h.events.off("routeChangeComplete",t),h.events.off("routeChangeError",t)}},[h.events]),(0,a.useEffect)(()=>{P.Z.init({scriptUrl:"/bee.js",apiUrl:"/_hive"}),n.init("257892063613851",{autoConfig:!0,debug:!1}),n.pageView()},[]),(0,i.jsxs)(o.SessionProvider,{session:r,children:[(0,i.jsx)(p(),{strategy:"afterInteractive",src:"https://www.googletagmanager.com/gtag/js?id=G-JZKRKVXWD4"}),(0,i.jsx)(p(),{id:"google-analytics",strategy:"afterInteractive",dangerouslySetInnerHTML:{__html:"\n          window.dataLayer = window.dataLayer || [];\n          function gtag(){dataLayer.push(arguments);}\n          gtag('js', new Date());\n          gtag('config', 'G-JZKRKVXWD4');\n        "}}),(0,i.jsx)(l.Wh,{children:(0,i.jsxs)(u.a.Provider,{value:g,children:[(0,i.jsx)(C,{isRouteChanging:y.isRouteChanging}),(0,i.jsx)(t,{...c}),(0,i.jsx)(d,{})]})})]})};var L=N},3957:function(e,t,r){"use strict";r.d(t,{a:function(){return i}});var n=r(7294);let i=(0,n.createContext)()},7989:function(e,t,r){"use strict";r.d(t,{T:function(){return i}});var n=r(4480);let i=(0,n.cn)({key:"loggedInUserState",default:{id:null,upstackedTools:[]}})},6737:function(){},7663:function(e){!function(){var t={229:function(e){var t,r,n,i=e.exports={};function o(){throw Error("setTimeout has not been defined")}function s(){throw Error("clearTimeout has not been defined")}function a(e){if(t===setTimeout)return setTimeout(e,0);if((t===o||!t)&&setTimeout)return t=setTimeout,setTimeout(e,0);try{return t(e,0)}catch(r){try{return t.call(null,e,0)}catch(r){return t.call(this,e,0)}}}!function(){try{t="function"==typeof setTimeout?setTimeout:o}catch(e){t=o}try{r="function"==typeof clearTimeout?clearTimeout:s}catch(e){r=s}}();var l=[],u=!1,c=-1;function h(){u&&n&&(u=!1,n.length?l=n.concat(l):c=-1,l.length&&d())}function d(){if(!u){var e=a(h);u=!0;for(var t=l.length;t;){for(n=l,l=[];++c<t;)n&&n[c].run();c=-1,t=l.length}n=null,u=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===s||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function f(e,t){this.fun=e,this.array=t}function p(){}i.nextTick=function(e){var t=Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)t[r-1]=arguments[r];l.push(new f(e,t)),1!==l.length||u||a(d)},f.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=p,i.addListener=p,i.once=p,i.off=p,i.removeListener=p,i.removeAllListeners=p,i.emit=p,i.prependListener=p,i.prependOnceListener=p,i.listeners=function(e){return[]},i.binding=function(e){throw Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(e){throw Error("process.chdir is not supported")},i.umask=function(){return 0}}},r={};function n(e){var i=r[e];if(void 0!==i)return i.exports;var o=r[e]={exports:{}},s=!0;try{t[e](o,o.exports,n),s=!1}finally{s&&delete r[e]}return o.exports}n.ab="//";var i=n(229);e.exports=i}()},1664:function(e,t,r){e.exports=r(8418)},1163:function(e,t,r){e.exports=r(387)},4298:function(e,t,r){e.exports=r(699)},1767:function(e){window,e.exports=function(e){var t={};function r(n){if(t[n])return t[n].exports;var i=t[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,r),i.l=!0,i.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}
6),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t||4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var i in e)r.d(n,i,(function(t){return e[t]}).bind(null,i));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=0)}([function(e,t,r){e.exports=r(1)},function(e,t,r){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw TypeError("Invalid attempt to spread non-iterable instance")}()}r.r(t);var i=!!window.fbq,o=!1,s=function(){var e;if(o){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];(e=console).info.apply(e,n(["[react-facebook-pixel]"].concat(r)))}},a=function(){var e;if(o){for(var t=arguments.length,r=Array(t),i=0;i<t;i++)r[i]=arguments[i];(e=console).info.apply(e,n(["[react-facebook-pixel]"].concat(r)))}},l=function(){return i||s("Pixel not initialized before using call ReactPixel.init with required params"),i},u={autoConfig:!0,debug:!1};t.default={init:function(e){var t,r,n,a,l,c,h=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=arguments.length>2&&void 0!==arguments[2]?arguments[2]:u;t=window,r=document,n="script",t.fbq||(a=t.fbq=function(){a.callMethod?a.callMethod.apply(a,arguments):a.queue.push(arguments)},t._fbq||(t._fbq=a),a.push=a,a.loaded=!0,a.version="2.0",a.queue=[],(l=r.createElement(n)).async=!0,l.src="https://connect.facebook.net/en_US/fbevents.js",(c=r.getElementsByTagName(n)[0]).parentNode.insertBefore(l,c)),e?(!1===d.autoConfig&&fbq("set","autoConfig",!1,e),fbq("init",e,h),i=!0,o=d.debug):s("Please insert pixel id for initializing")},pageView:function(){l()&&(fbq("track","PageView"),o&&a("called fbq('track', 'PageView');"))},track:function(e,t){l()&&(fbq("track",e,t),o&&(a("called fbq('track', '".concat(e,"');")),t&&a("with data",t)))},trackSingle:function(e,t,r){l()&&(fbq("trackSingle",e,t,r),o&&(a("called fbq('trackSingle', '".concat(e,"', '").concat(t,"');")),r&&a("with data",r)))},trackCustom:function(e,t){l()&&(fbq("trackCustom",e,t),o&&(a("called fbq('trackCustom', '".concat(e,"');")),t&&a("with data",t)))},trackSingleCustom:function(e,t,r){l()&&(fbq("trackSingle",e,t,r),o&&(a("called fbq('trackSingleCustom', '".concat(e,"', '").concat(t,"');")),r&&a("with data",r)))},grantConsent:function(){l()&&(fbq("consent","grant"),o&&a("called fbq('consent', 'grant');"))},revokeConsent:function(){l()&&(fbq("consent","revoke"),o&&a("called fbq('consent', 'revoke');"))},fbq:function(e){function t(){return e.apply(this,arguments)}return t.toString=function(){return e.toString()},t}(function(){if(l()){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];fbq.apply(void 0,t),o&&(a("called fbq('".concat(t.slice(0,2).join("', '"),"')")),t[2]&&a("with data",t[2]))}})}}])},9921:function(e,t){"use strict";/** @license React v16.13.1
7 * react-is.production.min.js
8 *
9 * Copyright (c) Facebook, Inc. and its affiliates.
10 *
11 * This source code is licensed under the MIT license found in the
12 * LICENSE file in the root directory of this source tree.
13 */var r="function"==typeof Symbol&&Symbol.for,n=r?Symbol.for("react.element"):60103,i=r?Symbol.for("react.portal"):60106,o=r?Symbol.for("react.fragment"):60107,s=r?Symbol.for("react.strict_mode"):60108,a=r?Symbol.for("react.profiler"):60114,l=r?Symbol.for("react.provider"):60109,u=r?Symbol.for("react.context"):60110,c=r?Symbol.for("react.async_mode"):60111,h=r?Symbol.for("react.concurrent_mode"):60111,d=r?Symbol.for("react.forward_ref"):60112,f=r?Symbol.for("react.suspense"):60113,p=r?Symbol.for("react.suspense_list"):60120,v=r?Symbol.for("react.memo"):60115,y=r?Symbol.for("react.lazy"):60116,m=r?Symbol.for("react.block"):60121,g=r?Symbol.for("react.fundamental"):60117,_=r?Symbol.for("react.responder"):60118,b=r?Symbol.for("react.scope"):60119;function w(e){if("object"==typeof e&&null!==e){var t=e.$$typeof;switch(t){case n:switch(e=e.type){case c:case h:case o:case a:case s:case f:return e;default:switch(e=e&&e.$$typeof){case u:case d:case y:case v:case l:return e;default:return t}}case i:return t}}}function S(e){return w(e)===h}t.AsyncMode=c,t.ConcurrentMode=h,t.ContextConsumer=u,t.ContextProvider=l,t.Element=n,t.ForwardRef=d,t.Fragment=o,t.Lazy=y,t.Memo=v,t.Portal=i,t.Profiler=a,t.StrictMode=s,t.Suspense=f,t.isAsyncMode=function(e){return S(e)||w(e)===c},t.isConcurrentMode=S,t.isContextConsumer=function(e){return w(e)===u},t.isContextProvider=function(e){return w(e)===l},t.isElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===n},t.isForwardRef=function(e){return w(e)===d},t.isFragment=function(e){return w(e)===o},t.isLazy=function(e){return w(e)===y},t.isMemo=function(e){return w(e)===v},t.isPortal=function(e){return w(e)===i},t.isProfiler=function(e){return w(e)===a},t.isStrictMode=function(e){return w(e)===s},t.isSuspense=function(e){return w(e)===f},t.isValidElementType=function(e){return"string"==typeof e||"function"==typeof e||e===o||e===h||e===a||e===s||e===f||e===p||"object"==typeof e&&null!==e&&(e.$$typeof===y||e.$$typeof===v||e.$$typeof===l||e.$$typeof===u||e.$$typeof===d||e.$$typeof===g||e.$$typeof===_||e.$$typeof===b||e.$$typeof===m)},t.typeOf=w},9864:function(e,t,r){"use strict";e.exports=r(9921)},4480:function(e,t,r){"use strict";let n;r.d(t,{FV:function(){return oM},Wh:function(){return oL},cn:function(){return oI}});var i,o,s,a,l=r(7294),u=r(3935),c=r(3454),h=function(e){let t=Error(e);
13if(void 0===t.stack)try{throw t}catch(e){}return t},d=function(e){return!!e&&"function"==typeof e.then},f=function(e,t){if(null!=e)return e;throw h(null!=t?t:"Got unexpected null or undefined")};function p(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}class v{getValue(){throw h("BaseLoadable")}toPromise(){throw h("BaseLoadable")}valueMaybe(){throw h("BaseLoadable")}valueOrThrow(){throw h(`Loadable expected value, but in "${this.state}" state`)}promiseMaybe(){throw h("BaseLoadable")}promiseOrThrow(){throw h(`Loadable expected promise, but in "${this.state}" state`)}errorMaybe(){throw h("BaseLoadable")}errorOrThrow(){throw h(`Loadable expected error, but in "${this.state}" state`)}is(e){return e.state===this.state&&e.contents===this.contents}map(e){throw h("BaseLoadable")}}class y extends v{constructor(e){super(),p(this,"state","hasValue"),p(this,"contents",void 0),this.contents=e}getValue(){return this.contents}toPromise(){return Promise.resolve(this.contents)}valueMaybe(){return this.contents}valueOrThrow(){return this.contents}promiseMaybe(){}errorMaybe(){}map(e){try{let t=e(this.contents);return d(t)?w(t):T(t)?t:_(t)}catch(t){return d(t)?w(t.next(()=>this.map(e))):b(t)}}}class m extends v{constructor(e){super(),p(this,"state","hasError"),p(this,"contents",void 0),this.contents=e}getValue(){throw this.contents}toPromise(){return Promise.reject(this.contents)}valueMaybe(){}promiseMaybe(){}errorMaybe(){return this.contents}errorOrThrow(){return this.contents}map(e){return this}}class g extends v{constructor(e){super(),p(this,"state","loading"),p(this,"contents",void 0),this.contents=e}getValue(){throw this.contents}toPromise(){return this.contents}valueMaybe(){}promiseMaybe(){return this.contents}promiseOrThrow(){return this.contents}errorMaybe(){}map(e){return w(this.contents.then(t=>{let r=e(t);if(T(r))switch(r.state){case"hasValue":case"loading":return r.contents;case"hasError":throw r.contents}return r}).catch(t=>{if(d(t))return t.then(()=>this.map(e).contents);throw t}))}}function _(e){return Object.freeze(new y(e))}function b(e){return Object.freeze(new m(e))}function w(e){return Object.freeze(new g(e))}function S(){return Object.freeze(new g(new Promise(()=>{})))}function x(e){let t=Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t]),r=t.map(e=>T(e)?e:d(e)?w(e):_(e)),n=r.every(e=>"hasValue"===e.state)?_(r.map(e=>e.contents)):r.some(e=>"hasError"===e.state)?b(f(r.find(e=>"hasError"===e.state),"Invalid loadable passed to loadableAll").contents):w(Promise.all(r.map(e=>e.contents)));return Array.isArray(e)?n:n.map(t=>Object.getOwnPropertyNames(e).reduce((e,r,n)=>({...e,[r]:t[n]}),{}))}function T(e){return e instanceof v}var E={loadableWithValue:_,loadableWithError:b,loadableWithPromise:w,loadableLoading:S,loadableAll:
13x,isLoadable:T,RecoilLoadable:{of:e=>d(e)?w(e):T(e)?e:_(e),error:e=>b(e),loading:()=>S(),all:x,isLoadable:T}},k=Object.freeze({__proto__:null,loadableWithValue:E.loadableWithValue,loadableWithError:E.loadableWithError,loadableWithPromise:E.loadableWithPromise,loadableLoading:E.loadableLoading,loadableAll:E.loadableAll,isLoadable:E.isLoadable,RecoilLoadable:E.RecoilLoadable});let R={RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED:!0,RECOIL_GKS_ENABLED:new Set(["recoil_hamt_2020","recoil_sync_external_store","recoil_suppress_rerender_in_callback","recoil_memory_managament_2020"])};function A(e){return R.RECOIL_GKS_ENABLED.has(e)}void 0!==c&&(null==c?void 0:c.env)!=null&&(function(e,t){var r,n;let i=null===(r=c.env[e])||void 0===r?void 0:null===(n=r.toLowerCase())||void 0===n?void 0:n.trim();if(null!=i&&""!==i){if(!["true","false"].includes(i))throw h(`process.env.${e} value must be 'true', 'false', or empty: ${i}`);t("true"===i)}}("RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED",e=>{R.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED=e}),function(e,t){var r;let n=null===(r=c.env[e])||void 0===r?void 0:r.trim();null!=n&&""!==n&&t(n.split(/\s*,\s*|\s+/))}("RECOIL_GKS_ENABLED",e=>{e.forEach(e=>{R.RECOIL_GKS_ENABLED.add(e)})})),A.setPass=e=>{R.RECOIL_GKS_ENABLED.add(e)},A.setFail=e=>{R.RECOIL_GKS_ENABLED.delete(e)},A.clear=()=>{R.RECOIL_GKS_ENABLED.clear()};var O=function(e,t,{error:r}={}){return null};let j=null!==(o=l.createMutableSource)&&void 0!==o?o:l.unstable_createMutableSource,C=null!==(s=l.useMutableSource)&&void 0!==s?s:l.unstable_useMutableSource,P=null!==(a=l.useSyncExternalStore)&&void 0!==a?a:l.unstable_useSyncExternalStore,N=!1;var L={createMutableSource:j,useMutableSource:C,useSyncExternalStore:P,currentRendererSupportsUseSyncExternalStore:function(){var e;let{ReactCurrentDispatcher:t,ReactCurrentOwner:r}=l.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,n=null!==(e=null==t?void 0:t.current)&&void 0!==e?e:r.currentDispatcher,i=null!=n.useSyncExternalStore;return!P||i||N||(N=!0,O("A React renderer without React 18+ API support is being used with React 18+.")),i},reactMode:function(){return A("recoil_transition_support")?{mode:"TRANSITION_SUPPORT",early:!0,concurrent:!0}:A("recoil_sync_external_store")&&null!=P?{mode:"SYNC_EXTERNAL_STORE",early:!0,concurrent:!1}:A("recoil_mutable_source")&&null!=C&&"undefined"!=typeof window&&!window.$disableRecoilValueMutableSource_TEMP_HACK_DO_NOT_USE?A("recoil_suppress_rerender_in_callback")?{mode:"MUTABLE_SOURCE",early:!0,concurrent:!0}:{mode:"MUTABLE_SOURCE",early:!1,concurrent:!1}:A("recoil_suppress_rerender_in_callback")?{mode:"LEGACY",early:!0,concurrent:!1}:{mode:"LEGACY",early:!1,concurrent:!1}},isFastRefreshEnabled:function(){return!1}};class I{constructor(e){p(this,"key",void 0),this.key=e}toJSON(){return{key:this.key}}}class M extends I{}class U extends I{}var $={AbstractRecoilValue:I,RecoilState:M,RecoilValueReadOnly:U,isRecoilValue:function(e){return e instanceof M||e instanceof U}},D=Object.freeze({__proto__:null,AbstractRecoilValue:$.AbstractRecoilValue,RecoilState:$.RecoilState,RecoilValueReadOnly:$.RecoilValueReadOnly,isRecoilValue:$.isRecoilValue}),B=function(e,...t){},V=function(e,t){return function*(){let r=0;for(let n of e)yield t(n,r++)}()};let{isFastRefreshEnabled:z}=L;class F{}let q=new F,H=new Map,G=new Map;class K extends Error{}let J=new Map;function W(e){return J.get(e)}var X={nodes:H,recoilValues:G,registerNode:function(e){R.RECOIL_DUPLICATE_ATOM_KEY_CHECKING_ENABLED&&function(e){if(H.has(e)){let t=`Duplicate atom key "${e}". This is a FATAL ERROR in
14      production. But it is safe to ignore this warning if it occurred because of
15      hot module replacement.`;console.warn(t)}}(e.key),H.set(e.key,e);let t=null==e.set?new D.RecoilValueReadOnly(e.key):new D.RecoilState(e.key);return G.set(e.key,t),t},getNode:function(e){let t=H.get(e);if(null==t)throw new K(`Missing definition for RecoilValue: "${e}""`);return t},getNodeMaybe:function(e){return H.get(e)},deleteNodeConfigIfPossible:function(e){var t,r;if(!A("recoil_memory_managament_2020"))return;let n=H.get(e);null!=n&&null!==(t=n.shouldDeleteConfigOnRelease)&&void 0!==t&&t.call(n)&&(H.delete(e),null===(r=W(e))||void 0===r||r(),J.delete(e))}
15,setConfigDeletionHandler:function(e,t){A("recoil_memory_managament_2020")&&(void 0===t?J.delete(e):J.set(e,t))},getConfigDeletionHandler:W,recoilValuesForKeys:function(e){return V(e,e=>f(G.get(e)))},NodeMissingError:K,DefaultValue:F,DEFAULT_VALUE:q},Z={enqueueExecution:function(e,t){t()}},Y=(function(e){var t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},r={},n={},i=function(e){return function(){return e}},o=r.hash=function(e){var r=void 0===e?"undefined":t(e);if("number"===r)return e;"string"!==r&&(e+="");for(var n=0,i=0,o=e.length;i<o;++i)n=(n<<5)-n+e.charCodeAt(i)|0;return n},s=function(e,t){return t>>>e&31},a=function(e){return 1<<e},l=function(e,t){var r;return r=e&t-1,r-=r>>1&1431655765,r=(r=(858993459&r)+(r>>2&858993459))+(r>>4)&252645135,r+=r>>8,127&(r+=r>>16)},u=function(e,t,r,n){var i=n;if(!e){var o=n.length;i=Array(o);for(var s=0;s<o;++s)i[s]=n[s]}return i[t]=r,i},c=function(e,t,r){var n=r.length-1,i=0,o=0,s=r;if(e)i=o=t;else for(s=Array(n);i<t;)s[o++]=r[i++];for(++i;i<=n;)s[o++]=r[i++];return e&&(s.length=n),s},h=function(e,t,r,n){var i=n.length;if(e){for(var o=i;o>=t;)n[o--]=n[o];return n[t]=r,n}for(var s=0,a=0,l=Array(i+1);s<t;)l[a++]=n[s++];for(l[t]=r;s<i;)l[++a]=n[s++];return l},d={__hamt_isEmpty:!0},f=function(e){return e===d||e&&e.__hamt_isEmpty},p=function(e,t,r,n){return{type:1,edit:e,hash:t,key:r,value:n,_modify:x}},v=function(e,t,r){return{type:2,edit:e,hash:t,children:r,_modify:T}},y=function(e,t,r){return{type:3,edit:e,mask:t,children:r,_modify:E}},m=function(e,t,r){return{type:4,edit:e,size:t,children:r,_modify:k}},g=function(e,t,r,n,i){for(var o=[],s=n,a=0,l=0;s;++l)1&s&&(o[l]=i[a++]),s>>>=1;return o[t]=r,m(e,a+1,o)},_=function(e,t,r,n){for(var i=Array(t-1),o=0,s=0,a=0,l=n.length;a<l;++a)if(a!==r){var u=n[a];u&&!f(u)&&(i[o++]=u,s|=1<<a)}return y(e,s,i)},b=function e(t,r,n,i,o,l){if(n===o)return v(t,n,[l,i]);var u=s(r,n),c=s(r,o);return y(t,a(u)|a(c),u===c?[e(t,r+5,n,i,o,l)]:u<c?[i,l]:[l,i])},w=function(e,t,r,i,o,s,a,l){for(var h=o.length,d=0;d<h;++d){var f=o[d];if(r(a,f.key)){var v=f.value,y=s(v);if(y===v)return o;if(y===n)return--l.value,c(e,d,o);return u(e,d,p(t,i,a,y),o)}}var m=s();return m===n?o:(++l.value,u(e,h,p(t,i,a,m),o))},S=function(e,t){return e===t.edit},x=function(e,t,r,i,o,s,a){if(t(s,this.key)){var l=i(this.value);return l===this.value?this:l===n?(--a.value,d):S(e,this)?(this.value=l,this):p(e,o,s,l)}var u=i();return u===n?this:(++a.value,b(e,r,this.hash,this,o,p(e,o,s,u)))},T=function(e,t,r,i,o,s,a){if(o===this.hash){var l=w(S(e,this),e,t,this.hash,this.children,i,s,a);return l===this.children?this:l.length>1?v(e,this.hash,l):l[0]}var u=i();return u===n?this:(++a.value,b(e,r,this.hash,this,o,p(e,o,s,u)))},E=function(e,t,r,n,i,o,p){var v,m=this.mask,_=this.children,b=s(r,i),w=a(b),x=l(m,w),T=m&w,E=T?_[x]:d,k=E._modify(e,t,r+5,n,i,o,p);if(E===k)return this;var R=S(e,this),A=m,O=void 0;if(T&&f(k)){if(!(A&=~w))return d;if(_.length<=2&&((v=_[1^x])===d||1===v.type||2===v.type))return _[1^x];O=c(R,x,_)}else if(T||f(k))O=u(R,x,k,_);else{if(_.length>=16)return g(e,b,k,m,_);A|=w,O=h(R,x,k,_)}return R?(this.mask=A,this.children=O,this):y(e,A,O)},k=function(e,t,r,n,i,o,a){var l=this.size,c=this.children,h=s(r,i),p=c[h],v=(p||d)._modify(e,t,r+5,n,i,o,a);if(p===v)return this;var y=S(e,this),g=void 0;if(f(p)&&!f(v))++l,g=u(y,h,v,c);else if(!f(p)&&f(v)){if(--l<=8)return _(e,l,h,c);g=u(y,h,d,c)}else g=u(y,h,v,c);return y?(this.size=l,this.children=g,this):m(e,l,g)};function R(e,t,r,n,i){this._editable=e,this._edit=t,this._config=r,this._root=n,this._size=i}d._modify=function(e,t,r,i,o,s,a){var l=i();return l===n?d:(++a.value,p(e,o,s,l))},R.prototype.setTree=function(e,t){return this._editable?(this._root=e,this._size=t,this):e===this._root?this:new R(this._editable,this._edit,this._config,e,t)};var A=r.tryGetHash=function(e,t,r,n){for(var i=n._root,o=0,u=n._config.keyEq;;)switch(i.type){case 1:return u(r,i.key)?i.value:e;case 2:if(t===i.hash)for(var c=i.children,h=0,d=c.length;h<d;++h){var f=c[h];
15if(u(r,f.key))return f.value}return e;case 3:var p=a(s(o,t));if(i.mask&p){i=i.children[l(i.mask,p)],o+=5;break}return e;case 4:if(i=i.children[s(o,t)]){o+=5;break}return e;default:return e}};R.prototype.tryGetHash=function(e,t,r){return A(e,t,r,this)};var O=r.tryGet=function(e,t,r){return A(e,r._config.hash(t),t,r)};R.prototype.tryGet=function(e,t){return O(e,t,this)};var j=r.getHash=function(e,t,r){return A(void 0,e,t,r)};R.prototype.getHash=function(e,t){return j(e,t,this)},r.get=function(e,t){return A(void 0,t._config.hash(e),e,t)},R.prototype.get=function(e,t){return O(t,e,this)};var C=r.has=function(e,t,r){return A(n,e,t,r)!==n};R.prototype.hasHash=function(e,t){return C(e,t,this)};var P=r.has=function(e,t){return C(t._config.hash(e),e,t)};R.prototype.has=function(e){return P(e,this)};var N=function(e,t){return e===t};r.make=function(e){return new R(0,0,{keyEq:e&&e.keyEq||N,hash:e&&e.hash||o},d,0)},r.empty=r.make();var L=r.isEmpty=function(e){return e&&!!f(e._root)};R.prototype.isEmpty=function(){return L(this)};var I=r.modifyHash=function(e,t,r,n){var i={value:n._size},o=n._root._modify(n._editable?n._edit:NaN,n._config.keyEq,0,e,t,r,i);return n.setTree(o,i.value)};R.prototype.modifyHash=function(e,t,r){return I(r,e,t,this)};var M=r.modify=function(e,t,r){return I(e,r._config.hash(t),t,r)};R.prototype.modify=function(e,t){return M(t,e,this)};var U=r.setHash=function(e,t,r,n){return I(i(r),e,t,n)};R.prototype.setHash=function(e,t,r){return U(e,t,r,this)};var $=r.set=function(e,t,r){return U(r._config.hash(e),e,t,r)};R.prototype.set=function(e,t){return $(e,t,this)};var D=i(n),B=r.removeHash=function(e,t,r){return I(D,e,t,r)};R.prototype.removeHash=R.prototype.deleteHash=function(e,t){return B(e,t,this)};var V=r.remove=function(e,t){return B(t._config.hash(e),e,t)};R.prototype.remove=R.prototype.delete=function(e){return V(e,this)};var z=r.beginMutation=function(e){return new R(e._editable+1,e._edit+1,e._config,e._root,e._size)};R.prototype.beginMutation=function(){return z(this)};var F=r.endMutation=function(e){return e._editable=e._editable&&e._editable-1,e};R.prototype.endMutation=function(){return F(this)};var q=r.mutate=function(e,t){var r=z(t);return e(r),F(r)};R.prototype.mutate=function(e){return q(e,this)};var H=function(e){return e&&G(e[0],e[1],e[2],e[3],e[4])},G=function(e,t,r,n,i){for(;r<e;){var o=t[r++];if(o&&!f(o))return K(o,n,[e,t,r,n,i])}return H(i)},K=function(e,t,r){switch(e.type){case 1:return{value:t(e),rest:r};case 2:case 4:case 3:var n=e.children;return G(n.length,n,0,t,r);default:return H(r)}},J={done:!0};function W(e){this.v=e}W.prototype.next=function(){if(!this.v)return J;var e=this.v;return this.v=H(e.rest),e},W.prototype[Symbol.iterator]=function(){return this};var X=function(e,t){return new W(K(e._root,t))},Z=function(e){return[e.key,e.value]},Y=r.entries=function(e){return X(e,Z)};R.prototype.entries=R.prototype[Symbol.iterator]=function(){return Y(this)};var Q=function(e){return e.key},ee=r.keys=function(e){return X(e,Q)};R.prototype.keys=function(){return ee(this)};var et=function(e){return e.value},er=r.values=R.prototype.values=function(e){return X(e,et)};R.prototype.values=function(){return er(this)};var en=r.fold=function(e,t,r){var n=r._root;if(1===n.type)return e(t,n.value,n.key);for(var i=[n.children],o=void 0;o=i.pop();)for(var s=0,a=o.length;s<a;){var l=o[s++];l&&l.type&&(1===l.type?t=e(t,l.value,l.key):i.push(l.children))}return t};R.prototype.fold=function(e,t){return en(e,t,this)};var ei=r.forEach=function(e,t){return en(function(r,n,i){return e(n,i,t)},null,t)};R.prototype.forEach=function(e){return ei(e,this)};var eo=r.count=function(e){return e._size};R.prototype.count=function(){return eo(this)},Object.defineProperty(R.prototype,"size",{get:R.prototype.count}),e.exports?e.exports=r:undefined.hamt=r}(i={exports:{}},i.exports),i.exports);class Q{constructor(e){p(this,"_map",void 0),this._map=new Map(null==e?void 0:e.entries())}keys(){return this._map.keys()}entries(){return this._map.entries()}get(e){return this._map.get(e)}has(e){return this._map.has(e)}set(e,t){return this._map.set(e,t),this}delete(e){return this._map.delete(e),this}clone(){return et(this)}toMap(){return new Map(this._map)}}class ee{constructor(e){if(p(this,"_hamt",Y.empty.beginMutation()),e instanceof ee){let t=e._hamt.endMutation();e._hamt=t.beginMutation(),this._hamt=t.beginMutation()}else if(e)for(let[t,r]of e.entries())this._hamt.set(t,r)}keys(){return this._hamt.keys()}entries(){return this._hamt.entries()}get(e){return this._hamt.get(e)}has(e){return this._hamt.has(e)}set(e,t){return this._hamt.set(e,t),this}delete(e){return this._hamt.delete(e),this}clone(){return et(this)}toMap(){return new Map(this._hamt)}}function et(e){return A("recoil_hamt_2020")?new ee(e):new Q(e)}var er=Object.freeze({__proto__:null,persistentMap:{persistentMap:et}.persistentMap}),en=function(e,...t){let r=new Set;e:for(let n of e){for(let e of t)if(e.has(n))continue e;r.add(n)}return r},ei=function(e,t){let r=new Map;return e.forEach((e,n)=>{r.set(n,t(e,n))}),r};function eo(e,t,r,n){let{nodeDeps:i,nodeToNodeSubscriptions:o}=r,s=i.get(e);if(s&&n&&s!==n.nodeDeps.get(e))return;i.set(e,t);let a=null==s?t:en(t,s);for(let t of a){o.has(t)||o.set(t,new Set);let r=f(o.get(t));r.add(e)}if(s){let r=en(s,t);for(let t of r){if(!o.has(t))return;let r=f(o.get(t));r.delete(e),0===r.size&&o.delete(t)}}}var es={cloneGraph:function(e){return{nodeDeps:ei(e.nodeDeps,e=>new Set(e)),nodeToNodeSubscriptions:ei(e.nodeToNodeSubscriptions,e=>new Set(e))}},graph:function(){return{nodeDeps:new Map,nodeToNodeSubscriptions:new Map}},saveDepsToStore:function(e,t,r,n){var i,o,s,a,l;let u=r.getState();n===u.currentTree.version||n===(null===(i=u.nextTree)||void 0===i?void 0:i.version)||n===(null===(o=u.previousTree)||void 0===o?void 0:o.version)||O("Tried to save dependencies to a discarded tree");let c=r.getGraph(n);if(eo(e,t,c),n===(null===(s=u.previousTree)||void 0===s?void 0:s.version)){let n=r.getGraph(u.currentTree.version);eo(e,t,n,c)}if(n===(null===(a=u.previousTree)||void 0===a?void 0:a.version)||n===u.currentTree.version){let n=null===(l=u.nextTree)||void 0===l?void 0:l.version;if(void 0!==n){let i=r.getGraph(n);eo(e,t,i,c)}}}};let ea=0,el=()=>ea++,eu=0,ec=()=>eu++,eh=0,ed=()=>eh++;var ef={getNextTreeStateVersion:el,getNextStoreID:ec,getNextComponentID:ed};let{persistentMap:ep}=er,{graph:ev}=es,{getNextTreeStateVersion:ey}=ef;function em(){let e=ey();return{version:e,stateID:e,transactionMetadata:{},dirtyAtoms:new Set,atomValues:ep(),nonvalidatedAtoms:ep()}}var eg={makeEmptyTreeState:em,makeEmptyStoreState:function(){let e=em();return{currentTree:e,nextTree:null,previousTree:null,commitDepth:0,knownAtoms:new Set,knownSelectors:new Set,transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(e.version,ev()),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map}},getNextTreeStateVersion:ey};class e_{}var eb={RetentionZone:e_,retentionZone:function(){return new e_}},ew={setByAddingToSet:function(e,t){let r=new Set(e);return r.add(t),r},setByDeletingFromSet:function(e,t){let r=new Set(e);return r.delete(t),r},mapBySettingInMap:function(e,t,r){let n=new Map(e);return n.set(t,r),n},mapByUpdatingInMap:function(e,t,r){let n=new Map(e);return n.set(t,r(n.get(t))),n},mapByDeletingFromMap:function(e,t){let r=new Map(e);return r.delete(t),r},mapByDeletingMultipleFromMap:function(e,t){let r=new Map(e);
15return t.forEach(e=>r.delete(e)),r}},eS=function*(e,t){let r=0;for(let n of e)t(n,r++)&&(yield n)},ex=function(e,t){let r=new Proxy(e,{get:(e,r)=>(!(r in e)&&r in t&&(e[r]=t[r]()),e[r]),ownKeys:e=>Object.keys(e)});return r};let{getNode:eT,getNodeMaybe:eE,recoilValuesForKeys:ek}=X,{RetentionZone:eR}=eb,{setByAddingToSet:eA}=ew,eO=Object.freeze(new Set);class ej extends Error{}function eC(e,t,r,n){let i=e.getState();if(i.nodeCleanupFunctions.has(r))return;let o=eT(r),s=function(e,t,r){if(!A("recoil_memory_managament_2020"))return()=>void 0;let{nodesRetainedByZone:n}=e.getState().retention;function i(e){let r=n.get(e);r||n.set(e,r=new Set),r.add(t)}if(r instanceof eR)i(r);else if(Array.isArray(r))for(let e of r)i(e);return()=>{if(!A("recoil_memory_managament_2020"))return;let{retention:n}=e.getState();function i(e){let r=n.nodesRetainedByZone.get(e);null==r||r.delete(t),r&&0===r.size&&n.nodesRetainedByZone.delete(e)}if(r instanceof eR)i(r);else if(Array.isArray(r))for(let e of r)i(e)}}(e,r,o.retainedBy),a=o.init(e,t,n);i.nodeCleanupFunctions.set(r,()=>{a(),s()})}function eP(e,t,r){return eT(r).peek(e,t)}function eN(e,t,r){let n=new Set,i=Array.from(r),o=e.getGraph(t.version);for(let e=i.pop();e;e=i.pop()){var s;n.add(e);let t=null!==(s=o.nodeToNodeSubscriptions.get(e))&&void 0!==s?s:eO;for(let e of t)n.has(e)||i.push(e)}return n}var eL={getNodeLoadable:function(e,t,r){return eC(e,t,r,"get"),eT(r).get(e,t)},peekNodeLoadable:eP,setNodeValue:function(e,t,r,n){let i=eT(r);if(null==i.set)throw new ej(`Attempt to set read-only RecoilValue: ${r}`);let o=i.set;return eC(e,t,r,"set"),o(e,t,n)},initializeNode:function(e,t,r){eC(e,e.getState().currentTree,t,r)},cleanUpNode:function(e,t){var r;let n=e.getState();null===(r=n.nodeCleanupFunctions.get(t))||void 0===r||r(),n.nodeCleanupFunctions.delete(t)},setUnvalidatedAtomValue_DEPRECATED:function(e,t,r){var n;let i=eE(t);return null==i||null===(n=i.invalidate)||void 0===n||n.call(i,e),{...e,atomValues:e.atomValues.clone().delete(t),nonvalidatedAtoms:e.nonvalidatedAtoms.clone().set(t,r),dirtyAtoms:eA(e.dirtyAtoms,t)}},peekNodeInfo:function(e,t,r){let n=e.getState(),i=e.getGraph(t.version),o=eT(r).nodeType;return ex({type:o},{loadable:()=>eP(e,t,r),isActive:()=>n.knownAtoms.has(r)||n.knownSelectors.has(r),isSet:()=>"selector"!==o&&t.atomValues.has(r),isModified:()=>t.dirtyAtoms.has(r),deps:()=>{var e;return ek(null!==(e=i.nodeDeps.get(r))&&void 0!==e?e:[])},subscribers:()=>{var i,o;return{nodes:ek(eS(eN(e,t,new Set([r])),e=>e!==r)),components:V(null!==(i=null===(o=n.nodeToComponentSubscriptions.get(r))||void 0===o?void 0:o.values())&&void 0!==i?i:[],([e])=>({name:e}))}}})},getDownstreamNodes:eN};let eI=null;var eM={setInvalidateMemoizedSnapshot:function(e){eI=e},invalidateMemoizedSnapshot:function(){var e;null===(e=eI)||void 0===e||e()}};let{getDownstreamNodes:eU,getNodeLoadable:e$,setNodeValue:eD}=eL,{getNextComponentID:eB}=ef,{getNode:eV,getNodeMaybe:ez}=X,{DefaultValue:eF}=X,{reactMode:eq}=L,{AbstractRecoilValue:eH,RecoilState:eG,RecoilValueReadOnly:eK,isRecoilValue:eJ}=D,{invalidateMemoizedSnapshot:eW}=eM;function eX(e,t,r){"hasValue"===r.state&&r.contents instanceof eF?e.atomValues.delete(t):e.atomValues.set(t,r),e.dirtyAtoms.add(t),e.nonvalidatedAtoms.delete(t)}function eZ(e,t){e.replaceState(r=>{let n=e0(r);for(let r of t)!function(e,t,r){if("set"===r.type){let{recoilValue:n,valueOrUpdater:i}=r,o=function(e,t,{key:r},n){if("function"!=typeof n)return n;{let i=e$(e,t,r);if("loading"===i.state){let e=`Tried to set atom or selector "${r}" using an updater function while the current state is pending, this is not currently supported.`;throw O(e),h(e)}if("hasError"===i.state)throw i.contents;return n(i.contents)}}(e,t,n,i),s=eD(e,t,n.key,o);for(let[e,r]of s.entries())eX(t,e,r)}else if("setLoadable"===r.type){let{recoilValue:{key:e},loadable:n}=r;eX(t,e,n)}else if("markModified"===r.type){let{recoilValue:{key:e}}=r;t.dirtyAtoms.add(e)}else if("setUnvalidated"===r.type){var n;let{recoilValue:{key:e},unvalidatedValue:i}=r,o=ez(e);null==o||null===(n=o.invalidate)||void 0===n||n.call(o,t),t.atomValues.delete(e),t.nonvali
15datedAtoms.set(e,i),t.dirtyAtoms.add(e)}else O(`Unknown action ${r.type}`)}(e,n,r);return e1(e,n),eW(),n})}function eY(e,t){if(eQ.length){let r=eQ[eQ.length-1],n=r.get(e);n||r.set(e,n=[]),n.push(t)}else eZ(e,[t])}let eQ=[];function e0(e){return{...e,atomValues:e.atomValues.clone(),nonvalidatedAtoms:e.nonvalidatedAtoms.clone(),dirtyAtoms:new Set(e.dirtyAtoms)}}function e1(e,t){let r=eU(e,t,t.dirtyAtoms);for(let e of r){var n,i;null===(n=ez(e))||void 0===n||null===(i=n.invalidate)||void 0===i||i.call(n,t)}}function e2(e,t,r){eY(e,{type:"set",recoilValue:t,valueOrUpdater:r})}var e3={RecoilValueReadOnly:eK,AbstractRecoilValue:eH,RecoilState:eG,getRecoilValueAsLoadable:function(e,{key:t},r=e.getState().currentTree){var n,i;let o=e.getState();r.version===o.currentTree.version||r.version===(null===(n=o.nextTree)||void 0===n?void 0:n.version)||r.version===(null===(i=o.previousTree)||void 0===i?void 0:i.version)||O("Tried to read from a discarded tree");let s=e$(e,r,t);return"loading"===s.state&&s.contents.catch(()=>{}),s}
15,setRecoilValue:e2,setRecoilValueLoadable:function(e,t,r){if(r instanceof eF)return e2(e,t,r);eY(e,{type:"setLoadable",recoilValue:t,loadable:r})},markRecoilValueModified:function(e,t){eY(e,{type:"markModified",recoilValue:t})},setUnvalidatedRecoilValue:function(e,t,r){eY(e,{type:"setUnvalidated",recoilValue:t,unvalidatedValue:r})},subscribeToRecoilValue:function(e,{key:t},r,n=null){let i=eB(),o=e.getState();o.nodeToComponentSubscriptions.has(t)||o.nodeToComponentSubscriptions.set(t,new Map),f(o.nodeToComponentSubscriptions.get(t)).set(i,[null!=n?n:"<not captured>",r]);let s=eq();if(s.early&&("LEGACY"===s.mode||"MUTABLE_SOURCE"===s.mode)){let n=e.getState().nextTree;n&&n.dirtyAtoms.has(t)&&r(n)}return{release:()=>{let r=e.getState(),n=r.nodeToComponentSubscriptions.get(t);if(void 0===n||!n.has(i)){O(`Subscription missing at release time for atom ${t}. This is a bug in Recoil.`);return}n.delete(i),0===n.size&&r.nodeToComponentSubscriptions.delete(t)}}},isRecoilValue:eJ,applyAtomValueWrites:function(e,t){let r=e.clone();return t.forEach((e,t)=>{"hasValue"===e.state&&e.contents instanceof eF?r.delete(t):r.set(t,e)}),r},batchStart:function(){let e=new Map;return eQ.push(e),()=>{for(let[t,r]of e)eZ(t,r);let t=eQ.pop();t!==e&&O("Incorrect order of batch popping")}},writeLoadableToTreeState:eX,invalidateDownstreams:e1,copyTreeState:e0,refreshRecoilValue:function(e,t){var r;let{currentTree:n}=e.getState(),i=eV(t.key);null===(r=i.clearCache)||void 0===r||r.call(i,e,n)}},e4=function(e,t,r){let n=e.entries(),i=n.next();for(;!i.done;){let o=i.value;if(t.call(r,o[1],o[0],e))return!0;i=n.next()}return!1};let{cleanUpNode:e5}=eL,{deleteNodeConfigIfPossible:e6,getNode:e8}=X,{RetentionZone:e9}=eb,e7=new Set;function te(e,t){let r=e.getState(),n=r.currentTree;if(r.nextTree){O("releaseNodesNowOnCurrentTree should only be called at the end of a batch");return}let i=new Set;for(let e of t)if(e instanceof e9)for(let t of function(e,t){var r;return null!==(r=e.retention.nodesRetainedByZone.get(t))&&void 0!==r?r:e7}(r,e))i.add(t);else i.add(e);let o=function(e,t){let r=e.getState(),n=r.currentTree,i=e.getGraph(n.version),o=new Set,s=new Set;return function t(a){var l,u;let c=new Set,h=function(e,t,r,n,i){let o=e.getGraph(t.version),s=[],a=new Set;for(;r.size>0;)(function e(t){if(n.has(t)||i.has(t)){r.delete(t);return}if(a.has(t))return;let l=o.nodeToNodeSubscriptions.get(t);if(l)for(let t of l)e(t);a.add(t),r.delete(t),s.push(t)})(f(r.values().next().value));return s}(e,n,a,o,s);for(let e of h){if("recoilRoot"===e8(e).retainedBy||(null!==(l=r.retention.referenceCounts.get(e))&&void 0!==l?l:0)>0||tt(e).some(e=>r.retention.referenceCounts.get(e))){s.add(e);continue}let t=i.nodeToNodeSubscriptions.get(e);if(t&&e4(t,e=>s.has(e))){s.add(e);continue}o.add(e),c.add(e)}let d=new Set;for(let e of c)for(let t of null!==(u=i.nodeDeps.get(e))&&void 0!==u?u:e7)o.has(t)||d.add(t);d.size&&t(d)}(t),o}(e,i);for(let t of o)!function(e,t,r){var n,i;if(!A("recoil_memory_managament_2020"))return;e5(e,r);let o=e.getState();o.knownAtoms.delete(r),o.knownSelectors.delete(r),o.nodeTransactionSubscriptions.delete(r),o.retention.referenceCounts.delete(r);let s=tt(r);for(let e of s)null===(n=o.retention.nodesRetainedByZone.get(e))||void 0===n||n.delete(r);t.atomValues.delete(r),t.dirtyAtoms.delete(r),t.nonvalidatedAtoms.delete(r);let a=o.graphsByVersion.get(t.version);if(a){let e=a.nodeDeps.get(r);if(void 0!==e)for(let t of(a.nodeDeps.delete(r),e))null===(i=a.nodeToNodeSubscriptions.get(t))||void 0===i||i.delete(r);a.nodeToNodeSubscriptions.delete(r)}e6(r)}(e,n,t)}function tt(e){let t=e8(e).retainedBy;return void 0===t||"components"===t||"recoilRoot"===t?[]:t instanceof e9?[t]:t}function tr(e,t){if(!A("recoil_memory_managament_2020"))return;let r=e.getState().retention.referenceCounts;r.delete(t),function(e,t){let r=e.getState();r.nextTree?r.retention.retainablesToCheckForRelease.add(t):te(e,new Set([t]))}(e,t)}var tn={SUSPENSE_TIMEOUT_MS:12e4,updateRetainCount:function(e,t,r){var n;if(!A("recoil_memory_managament_2020"))return;let i=e.getState().retention.referenceCounts,o=(null!==(n=i.get(t))&&void 0!==n?n:0)+r;0===o?tr(e,t):i.set(t,o)},updateRetainCountToZero:tr,releaseScheduledRetainablesNow:function(e){if(!A("recoil_memory_managament_2020"))return;let t=e.getState();te(e,t.retention.retainablesToCheckForRelease),t.retention.retainablesToCheckForRelease.clear()},retainedByOptionWithDefault:function(e){return void 0===e?"recoilRoot":e}};let{unstable_batchedUpdates:ti}=u,{unstable_batchedUpdates:to}={unstable_batchedUpdates:ti},{batchStart:ts}=e3,{unstable_batchedUpdates:ta}={unstable_batchedUpdates:to},tl=ta||(e=>e()),tu=e=>{tl=e},tc=e=>{tl(()=>{let t=()=>void 0;try{t=ts(),e()}finally{t()}})};var th={getBatcher:()=>tl,setBatcher:tu,batchUpdates:tc},td=function*(e){for(let t of e)for(let e of t)yield e};let tf="undefined"==typeof Window||"undefined"==typeof window,tp="undefined"!=typeof navigator&&"ReactNative"===navigator.product;var tv={isSSR:tf,isReactNative:tp,isWindow:e=>!tf&&(e===window||e instanceof Window)};let{batchUpdates:ty}=th,{initializeNode:tm,peekNodeInfo:tg}=eL,{graph:t_}=es,{getNextStoreID:tb}=ef,{DEFAULT_VALUE:tw,recoilValues:tS,recoilValuesForKeys:tx}=X,{AbstractRecoilValue:tT,getRecoilValueAsLoadable:tE,setRecoilValue:tk,setUnvalidatedRecoilValue:tR}=e3,{updateRetainCount:tA}=tn,{setInvalidateMemoizedSnapshot:tO}=eM,{getNextTreeStateVersion:tj,makeEmptyStoreState:tC}=eg,{isSSR:tP}=tv,{memoizeOneWithArgsHashAndInvalidation:tN}={memoizeWithArgsHash:function(e,t){let r;return(...n)=>{r||(r={});let i=t(...n);return Object.hasOwnProperty.call(r,i)||(r[i]=e(...n)),r[i]}},memoizeOneWithArgsHash:function(e,t){let r,n;return(...i)=>{let o=t(...i);
15return r===o?n:(r=o,n=e(...i))}},memoizeOneWithArgsHashAndInvalidation:function(e,t){let r,n;let i=(...i)=>{let o=t(...i);return r===o?n:(r=o,n=e(...i))},o=()=>{r=null};return[i,o]}};class tL{constructor(e,t){for(let r of(p(this,"_store",void 0),p(this,"_refCount",1),p(this,"getLoadable",e=>(this.checkRefCount_INTERNAL(),tE(this._store,e))),p(this,"getPromise",e=>(this.checkRefCount_INTERNAL(),this.getLoadable(e).toPromise())),p(this,"getNodes_UNSTABLE",e=>{if(this.checkRefCount_INTERNAL(),(null==e?void 0:e.isModified)===!0){if((null==e?void 0:e.isInitialized)===!1)return[];let t=this._store.getState().currentTree;return tx(t.dirtyAtoms)}let t=this._store.getState().knownAtoms,r=this._store.getState().knownSelectors;return(null==e?void 0:e.isInitialized)==null?tS.values():!0===e.isInitialized?tx(td([t,r])):eS(tS.values(),({key:e})=>!t.has(e)&&!r.has(e))}),p(this,"getInfo_UNSTABLE",({key:e})=>(this.checkRefCount_INTERNAL(),tg(this._store,this._store.getState().currentTree,e))),p(this,"map",e=>{this.checkRefCount_INTERNAL();let t=new t$(this,ty);return e(t),t}),p(this,"asyncMap",async e=>{this.checkRefCount_INTERNAL();let t=new t$(this,ty);return t.retain(),await e(t),t.autoRelease_INTERNAL(),t}),this._store={storeID:tb(),parentStoreID:t,getState:()=>e,replaceState:t=>{e.currentTree=t(e.currentTree)},getGraph:t=>{let r=e.graphsByVersion;if(r.has(t))return f(r.get(t));let n=t_();return r.set(t,n),n},subscribeToTransactions:()=>({release:()=>{}}),addTransactionMetadata:()=>{throw h("Cannot subscribe to Snapshots")}},this._store.getState().knownAtoms))tm(this._store,r,"get"),tA(this._store,r,1);this.autoRelease_INTERNAL()}retain(){this._refCount<=0&&O("Attempt to retain() Snapshot that was already released."),this._refCount++;let e=!1;return()=>{e||(e=!0,this._release())}}autoRelease_INTERNAL(){tP||window.setTimeout(()=>this._release(),10)}_release(){if(this._refCount--,0===this._refCount){if(this._store.getState().nodeCleanupFunctions.forEach(e=>e()),this._store.getState().nodeCleanupFunctions.clear(),!A("recoil_memory_managament_2020"))return}else this._refCount}isRetained(){return this._refCount>0}checkRefCount_INTERNAL(){A("recoil_memory_managament_2020")&&this._refCount}getStore_INTERNAL(){return this.checkRefCount_INTERNAL(),this._store}getID(){return this.checkRefCount_INTERNAL(),this._store.getState().currentTree.stateID}getStoreID(){return this.checkRefCount_INTERNAL(),this._store.storeID}}function tI(e,t,r=!1){let n=e.getState(),i=r?tj():t.version;return{currentTree:{version:r?i:t.version,stateID:r?i:t.stateID,transactionMetadata:{...t.transactionMetadata},dirtyAtoms:new Set(t.dirtyAtoms),atomValues:t.atomValues.clone(),nonvalidatedAtoms:t.nonvalidatedAtoms.clone()},commitDepth:0,nextTree:null,previousTree:null,knownAtoms:new Set(n.knownAtoms),knownSelectors:new Set(n.knownSelectors),transactionSubscriptions:new Map,nodeTransactionSubscriptions:new Map,nodeToComponentSubscriptions:new Map,queuedComponentCallbacks_DEPRECATED:[],suspendedComponentResolvers:new Set,graphsByVersion:new Map().set(i,e.getGraph(t.version)),retention:{referenceCounts:new Map,nodesRetainedByZone:new Map,retainablesToCheckForRelease:new Set},nodeCleanupFunctions:new Map(V(n.nodeCleanupFunctions.entries(),([e])=>[e,()=>{}]))}}let[tM,tU]=tN((e,t)=>{var r;let n=e.getState(),i="latest"===t?null!==(r=n.nextTree)&&void 0!==r?r:n.currentTree:f(n.previousTree);return new tL(tI(e,i),e.storeID)},(e,t)=>{var r,n;return String(t)+String(e.storeID)+String(null===(r=e.getState().nextTree)||void 0===r?void 0:r.version)+String(e.getState().currentTree.version)+String(null===(n=e.getState().previousTree)||void 0===n?void 0:n.version)});tO(tU);class t$ extends tL{constructor(e,t){super(tI(e.getStore_INTERNAL(),e.getStore_INTERNAL().getState().currentTree,!0),e.getStoreID()),p(this,"_batch",void 0),p(this,"set",(e,t)=>{this.checkRefCount_INTERNAL();let r=this.getStore_INTERNAL();this._batch(()=>{tA(r,e.key,1),tk(this.getStore_INTERNAL(),e,t)})}),p(this,"reset",e=>{this.checkRefCount_INTERNAL();let t=this.getStore_INTERNAL();this._batch(()=>{tA(t,e.key,1),tk(this.getStore_INTERNAL(),e,tw)})}),p(this,"setUnvalidatedAtomValues_DEPRECATED",e=>{this.checkRefCount_INTERNAL();let t=this.getStore_INTERNAL();ty(()=>{for(let[r,n]of e.entries())tA(t,r,1),tR(t,new tT(r),n)})}),this._batch=t}}var tD={Snapshot:tL,MutableSnapshot:t$,freshSnapshot:function(e){let t=new tL(tC());return null!=e?t.map(e):t},cloneSnapshot:function(e,t="latest"){let r=tM(e,t);return r.isRetained()?r:(tU(),tM(e,t))}},tB=Object.freeze({__proto__:null,Snapshot:tD.Snapshot,MutableSnapshot:tD.MutableSnapshot,freshSnapshot:tD.freshSnapshot,cloneSnapshot:tD.cloneSnapshot}),tV=function(...e){let t=new Set;for(let r of e)for(let e of r)t.add(e);return t};
15let{useRef:tz}=l;var tF=function(e){let t=tz(e);return t.current===e&&"function"==typeof e&&(t.current=e()),t};let{getNextTreeStateVersion:tq,makeEmptyStoreState:tH}=eg,{cleanUpNode:tG,getDownstreamNodes:tK,initializeNode:tJ,setNodeValue:tW,setUnvalidatedAtomValue_DEPRECATED:tX}=eL,{graph:tZ}=es,{cloneGraph:tY}=es,{getNextStoreID:tQ}=ef,{createMutableSource:t0,reactMode:t1}=L,{applyAtomValueWrites:t2}=e3,{releaseScheduledRetainablesNow:t3}=tn,{freshSnapshot:t4}=tB,{useCallback:t5,useContext:t6,useEffect:t8,useMemo:t9,useRef:t7,useState:re}=l;function rt(){throw h("This component must be used inside a <RecoilRoot> component.")}let rr=Object.freeze({storeID:tQ(),getState:rt,replaceState:rt,getGraph:rt,subscribeToTransactions:rt,addTransactionMetadata:rt}),rn=!1;function ri(e){if(rn)throw h("An atom update was triggered within the execution of a state updater function. State updater functions provided to Recoil must be pure functions.");let t=e.getState();if(null===t.nextTree){A("recoil_memory_managament_2020")&&A("recoil_release_on_cascading_update_killswitch_2021")&&t.commitDepth>0&&t3(e);let r=t.currentTree.version,n=tq();t.nextTree={...t.currentTree,version:n,stateID:n,dirtyAtoms:new Set,transactionMetadata:{}},t.graphsByVersion.set(n,tY(f(t.graphsByVersion.get(r))))}}let ro=l.createContext({current:rr}),rs=()=>t6(ro),ra=l.createContext(null);function rl(e,t,r){let n=tK(e,r,r.dirtyAtoms);for(let e of n){let n=t.nodeToComponentSubscriptions.get(e);if(n)for(let[e,[t,i]]of n)i(r)}}function ru(e){let t=e.getState(),r=t.currentTree,n=r.dirtyAtoms;if(n.size){for(let[r,i]of t.nodeTransactionSubscriptions)if(n.has(r))for(let[t,r]of i)r(e);for(let[r,n]of t.transactionSubscriptions)n(e);(!t1().early||t.suspendedComponentResolvers.size>0)&&(rl(e,t,r),t.suspendedComponentResolvers.forEach(e=>e()),t.suspendedComponentResolvers.clear())}t.queuedComponentCallbacks_DEPRECATED.forEach(e=>e(r)),t.queuedComponentCallbacks_DEPRECATED.splice(0,t.queuedComponentCallbacks_DEPRECATED.length)}function rc({setNotifyBatcherOfChange:e}){let t=rs(),[,r]=re([]);return e(()=>r({})),t8(()=>(e(()=>r({})),()=>{e(()=>{})}),[e]),t8(()=>{Z.enqueueExecution("Batcher",()=>{!function(e){let t=e.getState();t.commitDepth++;try{let{nextTree:r}=t;if(null==r)return;t.previousTree=t.currentTree,t.currentTree=r,t.nextTree=null,ru(e),null!=t.previousTree?t.graphsByVersion.delete(t.previousTree.version):O("Ended batch with no previous state, which is unexpected","recoil"),t.previousTree=null,A("recoil_memory_managament_2020")&&null==r&&t3(e)}finally{t.commitDepth--}}(t.current)})}),null}let rh=0;function rd({initializeState_DEPRECATED:e,initializeState:t,store_INTERNAL:r,children:n}){let i;let o=e=>{let t=i.current.graphsByVersion;if(t.has(e))return f(t.get(e));let r=tZ();return t.set(e,r),r},s=(e,t)=>{if(null==t){let{transactionSubscriptions:t}=d.current.getState(),r=rh++;return t.set(r,e),{release:()=>{t.delete(r)}}}{let{nodeTransactionSubscriptions:r}=d.current.getState();r.has(t)||r.set(t,new Map);let n=rh++;return f(r.get(t)).set(n,e),{release:()=>{let e=r.get(t);e&&(e.delete(n),0===e.size&&r.delete(t))}}}},a=e=>{for(let t of(ri(d.current),Object.keys(e)))f(d.current.getState().nextTree).transactionMetadata[t]=e[t]},u=e=>{let t;ri(d.current);let r=f(i.current.nextTree);try{rn=!0,t=e(r)}finally{rn=!1}t!==r&&(i.current.nextTree=t,t1().early&&rl(d.current,i.current,t),f(c.current)())},c=t7(null),h=t5(e=>{c.current=e},[c]),d=tF(()=>null!=r?r:{storeID:tQ(),getState:()=>i.current,replaceState:u,getGraph:o,subscribeToTransactions:s,addTransactionMetadata:a});null!=r&&(d.current=r),i=tF(()=>null!=e?function(e,t){let r=tH();return t({set:(t,n)=>{let i=r.currentTree,o=tW(e,i,t.key,n),s=new Set(o.keys()),a=i.nonvalidatedAtoms.clone();for(let e of s)a.delete(e);r.currentTree={...i,dirtyAtoms:tV(i.dirtyAtoms,s),atomValues:t2(i.atomValues,o),nonvalidatedAtoms:a}},setUnvalidatedAtomValues:e=>{e.forEach((e,t)=>{r.currentTree=tX(r.currentTree,t,e)})}}),r}(d.current,e):null!=t?function(e){let t=t4(e),r=t.getStore_INTERNAL().getState();
15return t.retain(),r.nodeCleanupFunctions.forEach(e=>e()),r.nodeCleanupFunctions.clear(),r}(t):tH());let p=t9(()=>null==t0?void 0:t0(i,()=>i.current.currentTree.version),[i]);return t8(()=>{let e=d.current;for(let t of new Set(e.getState().knownAtoms))tJ(e,t,"get");return()=>{for(let t of e.getState().knownAtoms)tG(e,t)}},[d]),l.createElement(ro.Provider,{value:d},l.createElement(ra.Provider,{value:p},l.createElement(rc,{setNotifyBatcherOfChange:h}),n))}var rf={RecoilRoot:function(e){let{override:t,...r}=e,n=rs();return!1===t&&n.current!==rr?e.children:l.createElement(rd,r)},useStoreRef:rs,useRecoilMutableSource:function(){let e=t6(ra);return null==e&&B("Attempted to use a Recoil hook outside of a <RecoilRoot>. <RecoilRoot> must be an ancestor of any component that uses Recoil hooks."),e},useRecoilStoreID:function(){return rs().current.storeID},notifyComponents_FOR_TESTING:rl,sendEndOfBatchNotifications_FOR_TESTING:ru},rp=function(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let r=0,n=e.length;r<n;r++)if(e[r]!==t[r])return!1;return!0};let{useEffect:rv,useRef:ry}=l;var rm=function(e){let t=ry();return rv(()=>{t.current=e}),t.current};let{useStoreRef:rg}=rf,{SUSPENSE_TIMEOUT_MS:r_}=tn,{updateRetainCount:rb}=tn,{RetentionZone:rw}=eb,{useEffect:rS,useRef:rx}=l,{isSSR:rT}=tv;var rE=function(e){if(A("recoil_memory_managament_2020"))return function(e){let t=Array.isArray(e)?e:[e],r=t.map(e=>e instanceof rw?e:e.key),n=rg();rS(()=>{if(!A("recoil_memory_managament_2020"))return;let e=n.current;if(i.current&&!rT)window.clearTimeout(i.current),i.current=null;else for(let t of r)rb(e,t,1);return()=>{for(let t of r)rb(e,t,-1)}},[n,...r]);let i=rx(),o=rm(r);if(!rT&&(void 0===o||!rp(o,r))){let e=n.current;for(let t of r)rb(e,t,1);if(o)for(let t of o)rb(e,t,-1);i.current&&window.clearTimeout(i.current),i.current=window.setTimeout(()=>{for(let t of(i.current=null,r))rb(e,t,-1)},r_)}}(e)},rk=function(){return"<component name not available>"};let{batchUpdates:rR}=th,{DEFAULT_VALUE:rA}=X,{currentRendererSupportsUseSyncExternalStore:rO,reactMode:rj,useMutableSource:rC,useSyncExternalStore:rP}=L,{useRecoilMutableSource:rN,useStoreRef:rL}=rf,{isRecoilValue:rI}=D,{AbstractRecoilValue:rM,getRecoilValueAsLoadable:rU,setRecoilValue:r$,setUnvalidatedRecoilValue:rD,subscribeToRecoilValue:rB}=e3,{useCallback:rV,useEffect:rz,useMemo:rF,useRef:rq,useState:rH}=l,{setByAddingToSet:rG}=ew,{isSSR:rK}=tv;function rJ(e,t,r){if("hasValue"===e.state)return e.contents;if("loading"===e.state){let t=new Promise(t=>{let n=r.current.getState().suspendedComponentResolvers;n.add(t),rK&&d(e.contents)&&e.contents.finally(()=>{n.delete(t)})});throw t}if("hasError"===e.state)throw e.contents;throw h(`Invalid value of loadable atom "${t.key}"`)}function rW(e){let t=rL(),r=rk(),n=rV(()=>{var r;let n=t.current,i=n.getState(),o=rj().early&&null!==(r=i.nextTree)&&void 0!==r?r:i.currentTree,s=rU(n,e,o);return{loadable:s,key:e.key}},[t,e]),i=rV(e=>{let t;return()=>{var r,n;let i=e();return null!==(r=t)&&void 0!==r&&r.loadable.is(i.loadable)&&(null===(n=t)||void 0===n?void 0:n.key)===i.key?t:(t=i,i)}},[]),o=rF(()=>i(n),[n,i]),s=rV(n=>{let i=t.current,o=rB(i,e,n,r);return o.release},[t,e,r]);return rP(s,o,o).loadable}function rX(e){let t=rL(),r=rV(()=>{var r;let n=t.current,i=n.getState(),o=rj().early&&null!==(r=i.nextTree)&&void 0!==r?r:i.currentTree;return rU(n,e,o)},[t,e]),n=rV(()=>r(),[r]),i=rk(),o=rV((n,o)=>{let s=t.current,a=rB(s,e,()=>{if(!A("recoil_suppress_rerender_in_callback"))return o();let e=r();l.current.is(e)||o(),l.current=e},i);return a.release},[t,e,i,r]),s=rN();if(null==s)throw h("Recoil hooks must be used in components contained within a <RecoilRoot> component.");let a=rC(s,n,o),l=rq(a);return rz(()=>{l.current=a}),a}function rZ(e){let t=rL(),r=rk(),n=rV(()=>{var r;let n=t.current,i=n.getState(),o=rj().early&&null!==(r=i.nextTree)&&void 0!==r?r:i.currentTree;return rU(n,e,o)},[t,e]),i=rV(()=>({loadable:n(),key:e.key}),[n,e.key]),o=rV(e=>{let t=i();return e.loadable.is(t.loadable)&&e.key===t.key?e:t},[i]);rz(()=>{let n=rB(t.current,e,e=>{a(o)},r);return a(o),n.release},[r,e,t,o]);let[s,a]=rH(i);
15return s.key!==e.key?i().loadable:s.loadable}function rY(e){let t=rL(),[,r]=rH([]),n=rk(),i=rV(()=>{var r;let n=t.current,i=n.getState(),o=rj().early&&null!==(r=i.nextTree)&&void 0!==r?r:i.currentTree;return rU(n,e,o)},[t,e]),o=i(),s=rq(o);return rz(()=>{s.current=o}),rz(()=>{let o=t.current,a=o.getState(),l=rB(o,e,e=>{var t;if(!A("recoil_suppress_rerender_in_callback"))return r([]);let n=i();null!==(t=s.current)&&void 0!==t&&t.is(n)||r(n),s.current=n},n);if(a.nextTree)o.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{s.current=null,r([])});else{var u;if(!A("recoil_suppress_rerender_in_callback"))return r([]);let e=i();null!==(u=s.current)&&void 0!==u&&u.is(e)||r(e),s.current=e}return l.release},[n,i,e,t]),o}function rQ(e){return A("recoil_memory_managament_2020")&&rE(e),({TRANSITION_SUPPORT:rZ,SYNC_EXTERNAL_STORE:rO()?rW:rZ,MUTABLE_SOURCE:rX,LEGACY:rY})[rj().mode](e)}function r0(e){let t=rL(),r=rQ(e);return rJ(r,e,t)}function r1(e){let t=rL();return rV(r=>{r$(t.current,e,r)},[t,e])}function r2(e){return A("recoil_memory_managament_2020")&&rE(e),rZ(e)}function r3(e){let t=rL(),r=r2(e);return rJ(r,e,t)}var r4=function(e,t){let r=new Map;for(let[n,i]of e)t(i,n)&&r.set(n,i);return r},r5=function(e,t){let r=new Set;for(let n of e)t(n)&&r.add(n);return r},r6=function(...e){let t=new Map;for(let r=0;r<e.length;r++){let n;let i=e[r].keys();for(;!(n=i.next()).done;)t.set(n.value,e[r].get(n.value))}return t};let{batchUpdates:r8}=th,{DEFAULT_VALUE:r9,getNode:r7,nodes:ne}=X,{useStoreRef:nt}
15=rf,{AbstractRecoilValue:nr,setRecoilValueLoadable:nn}=e3,{SUSPENSE_TIMEOUT_MS:ni}=tn,{cloneSnapshot:no}=tB,{useCallback:ns,useEffect:na,useRef:nl,useState:nu}=l,{isSSR:nc}=tv;function nh(e){let t=nt();na(()=>{let r=t.current.subscribeToTransactions(e);return r.release},[e,t])}function nd(e){let t=e.atomValues.toMap(),r=ei(r4(t,(e,t)=>{let r=r7(t),n=r.persistence_UNSTABLE;return null!=n&&"none"!==n.type&&"hasValue"===e.state}),e=>e.contents);return r6(e.nonvalidatedAtoms.toMap(),r)}function nf(e,t){var r;let n=e.getState(),i=null!==(r=n.nextTree)&&void 0!==r?r:n.currentTree,o=t.getStore_INTERNAL().getState().currentTree;r8(()=>{let r=new Set;for(let e of[i.atomValues.keys(),o.atomValues.keys()])for(let t of e){var n,s;(null===(n=i.atomValues.get(t))||void 0===n?void 0:n.contents)!==(null===(s=o.atomValues.get(t))||void 0===s?void 0:s.contents)&&r7(t).shouldRestoreFromSnapshots&&r.add(t)}r.forEach(t=>{nn(e,new nr(t),o.atomValues.has(t)?f(o.atomValues.get(t)):r9)}),e.replaceState(e=>({...e,stateID:t.getID()}))})}var np={useRecoilSnapshot:function(){let e=nt(),[t,r]=nu(()=>no(e.current)),n=rm(t),i=nl(),o=nl();if(nh(ns(e=>r(no(e)),[])),na(()=>{let e=t.retain();if(i.current&&!nc){var r;window.clearTimeout(i.current),i.current=null,null===(r=o.current)||void 0===r||r.call(o),o.current=null}return()=>{window.setTimeout(e,10)}},[t]),n!==t&&!nc){if(i.current){var s;window.clearTimeout(i.current),i.current=null,null===(s=o.current)||void 0===s||s.call(o),o.current=null}o.current=t.retain(),i.current=window.setTimeout(()=>{var e;i.current=null,null===(e=o.current)||void 0===e||e.call(o),o.current=null},ni)}return t},gotoSnapshot:nf,useGotoRecoilSnapshot:function(){let e=nt();return ns(t=>nf(e.current,t),[e])},useRecoilTransactionObserver:function(e){nh(ns(t=>{let r=no(t,"latest"),n=no(t,"previous");e({snapshot:r,previousSnapshot:n})},[e]))},useTransactionObservation_DEPRECATED:function(e){nh(ns(t=>{let r=t.getState().previousTree,n=t.getState().currentTree;r||(O("Transaction subscribers notified without a previous tree being present -- this is a bug in Recoil"),r=t.getState().currentTree);let i=nd(n),o=nd(r),s=ei(ne,e=>{var t,r,n,i;return{persistence_UNSTABLE:{type:null!==(t=null===(r=e.persistence_UNSTABLE)||void 0===r?void 0:r.type)&&void 0!==t?t:"none",backButton:null!==(n=null===(i=e.persistence_UNSTABLE)||void 0===i?void 0:i.backButton)&&void 0!==n&&n}}}),a=r5(n.dirtyAtoms,e=>i.has(e)||o.has(e));e({atomValues:i,previousAtomValues:o,atomInfo:s,modifiedAtoms:a,transactionMetadata:{...n.transactionMetadata}})},[e]))},useTransactionSubscription_DEPRECATED:nh};let{peekNodeInfo:nv}=eL,{useStoreRef:ny}=rf,{reactMode:nm}=L,{RecoilRoot:ng,useStoreRef:n_}=rf,{useMemo:nb}=l,{loadableWithValue:nw}=k,{initializeNode:nS}=eL,{DEFAULT_VALUE:nx,getNode:nT}=X,{copyTreeState:nE,getRecoilValueAsLoadable:nk,invalidateDownstreams:nR,writeLoadableToTreeState:nA}=e3;function nO(e){return"atom"===nT(e.key).nodeType}class nj{constructor(e,t){p(this,"_store",void 0),p(this,"_treeState",void 0),p(this,"_changes",void 0),p(this,"get",e=>{if(this._changes.has(e.key))return this._changes.get(e.key);if(!nO(e))throw h("Reading selectors within atomicUpdate is not supported");let t=nk(this._store,e,this._treeState);if("hasValue"===t.state)return t.contents;if("hasError"===t.state)throw t.contents;throw h(`Expected Recoil atom ${e.key} to have a value, but it is in a loading state.`)}),p(this,"set",(e,t)=>{if(!nO(e))throw h("Setting selectors within atomicUpdate is not supported");if("function"==typeof t){let r=this.get(e);this._changes.set(e.key,t(r))}else nS(this._store,e.key,"set"),this._changes.set(e.key,t)}),p(this,"reset",e=>{this.set(e,nx)}),this._store=e,this._treeState=t,this._changes=new Map}newTreeState_INTERNAL(){if(0===this._changes.size)return this._treeState;let e=nE(this._treeState);for(let[t,r]of this._changes)nA(e,t,nw(r));return nR(this._store,e),e}}var nC=Object.freeze({__proto__:null,atomicUpdater:function(e){return t=>{e.replaceState(r=>{let n=new nj(e,r);return t(n),n.newTreeState_INTERNAL()})}}}),nP=function(e,t){if(!e)throw Error(t)};let{atomicUpdater:nN}=nC,{batchUpdates:nL}=th,{DEFAULT_VALUE:nI}=X,{useStoreRef:nM}=rf,{refreshRecoilValue:nU,setRecoilValue:n$}=e3,{cloneSnapshot:nD}=tB,{gotoSnapshot:nB}=np,{useCallback:nV}=l;class nz{}let nF=new nz;function nq(e,t,r,n){let i,o=nF;if(nL(()=>{let s="useRecoilCallback() expects a function that returns a function: it accepts a function of the type (RecoilInterface) => (Args) => ReturnType and returns a callback function (Args) => ReturnType, where RecoilInterface is an object {snapshot, set, ...} and Args and ReturnType are the argument and return types of the callback y
15ou want to create.  Please see the docs at recoiljs.org for details.";if("function"!=typeof t)throw h(s);let a=ex({...null!=n?n:{},set:(t,r)=>n$(e,t,r),reset:t=>n$(e,t,nI),refresh:t=>nU(e,t),gotoSnapshot:t=>nB(e,t),transact_UNSTABLE:t=>nN(e)(t)},{snapshot:()=>{let t=nD(e);return i=t.retain(),t}}),l=t(a);if("function"!=typeof l)throw h(s);o=l(...r)}),o instanceof nz&&nP(!1),d(o))o=o.finally(()=>{var e;null===(e=i)||void 0===e||e()});else{var s;null===(s=i)||void 0===s||s()}return o}var nH={recoilCallback:nq,useRecoilCallback:function(e,t){let r=nM();return nV((...t)=>nq(r.current,e,t),null!=t?[...t,r]:void 0)}};let{useStoreRef:nG}=rf,{refreshRecoilValue:nK}=e3,{useCallback:nJ}=l,{atomicUpdater:nW}=nC,{useStoreRef:nX}=rf,{useMemo:nZ}=l;var nY=Object.freeze({__proto__:null,WrappedValue:{WrappedValue:class{constructor(e){p(this,"value",void 0),this.value=e}}}.WrappedValue});let{isFastRefreshEnabled:nQ}=L;class n0 extends Error{}var n1=Object.freeze({__proto__:null,TreeCache:{TreeCache:class{constructor(e){var t,r,n;p(this,"_name",void 0),p(this,"_numLeafs",void 0),p(this,"_root",void 0),p(this,"_onHit",void 0),p(this,"_onSet",void 0),p(this,"_mapNodeValue",void 0),this._name=null==e?void 0:e.name,this._numLeafs=0,this._root=null,this._onHit=null!==(t=null==e?void 0:e.onHit)&&void 0!==t?t:()=>{},this._onSet=null!==(r=null==e?void 0:e.onSet)&&void 0!==r?r:()=>{},this._mapNodeValue=null!==(n=null==e?void 0:e.mapNodeValue)&&void 0!==n?n:e=>e}size(){return this._numLeafs}root(){return this._root}get(e,t){var r;return null===(r=this.getLeafNode(e,t))||void 0===r?void 0:r.value}getLeafNode(e,t){if(null==this._root)return;let r=this._root;for(;r;){if(null==t||t.onNodeVisit(r),"leaf"===r.type)return this._onHit(r),r;let n=this._mapNodeValue(e(r.nodeKey));r=r.branches.get(n)}}set(e,t,r){let n=()=>{var n,i,o,s,a,l,u;let c,h;for(let[t,n]of e){let e=this._root;if((null==e?void 0:e.type)==="leaf")throw this.invalidCacheError();let i=c;if("branch"!==(c=null!==(a=c=i?i.branches.get(h):e)&&void 0!==a?a:{type:"branch",nodeKey:t,parent:i,branches:new Map,branchKey:h}).type||c.nodeKey!==t)throw this.invalidCacheError();null==i||i.branches.set(h,c),null==r||null===(l=r.onNodeVisit)||void 0===l||l.call(r,c),h=this._mapNodeValue(n),this._root=null!==(u=this._root)&&void 0!==u?u:c}let d=c?null===(n=c)||void 0===n?void 0:n.branches.get(h):this._root;if(null!=d&&("leaf"!==d.type||d.branchKey!==h))throw this.invalidCacheError();let f={type:"leaf",value:t,parent:c,branchKey:h};null===(i=c)||void 0===i||i.branches.set(h,f),this._root=null!==(o=this._root)&&void 0!==o?o:f,this._numLeafs++,this._onSet(f),null==r||null===(s=r.onNodeVisit)||void 0===s||s.call(r,f)};try{n()}catch(e){if(e instanceof n0)this.clear(),n();else throw e}}delete(e){let t=this.root();if(!t)return!1;if(e===t)return this._root=null,this._numLeafs=0,!0;let r=e.parent,n=e.branchKey;for(;r;){var i;if(r.branches.delete(n),r===t)return 0===r.branches.size?(this._root=null,this._numLeafs=0):this._numLeafs--,!0;if(r.branches.size>0)break;n=null===(i=r)||void 0===i?void 0:i.branchKey,r=r.parent}for(;r!==t;r=r.parent)if(null==r)return!1;return this._numLeafs--,!0}clear(){this._numLeafs=0,this._root=null}invalidCacheError(){let e=nQ()?"Possible Fast Refresh module reload detected.  This may also be caused by an selector returning inconsistent values. Resetting cache.":"Invalid cache values.  This happens when selectors do not return consistent values for the same input dependency values.  That may also be caused when using Fast Refresh to change a selector implementation.  Resetting cache.";throw O(e+(null!=this._name?` - ${this._name}`:"")),new n0}}}.TreeCache}),n2=Object.freeze({__proto__:null,LRUCache:{LRUCache:class{constructor(e){var t;p(this,"_maxSize",void 0),p(this,"_size",void 0),p(this,"_head",void 0),p(this,"_tail",void 0),p(this,"_map",void 0),p(this,"_keyMapper",void 0),this._maxSize=e.maxSize,this._size=0,this._head=null,this._tail=null,this._map=new Map,this._keyMapper=null!==(t=e.mapKey)&&void 0!==t?t:e=>e}head(){return this._head}tail(){return this._tail}size(){return this._size}maxSize(){return this._maxSize}has(e){return this._map.has(this._keyMapper(e))}get(e){let t=this._keyMapper(e),r=this._map.get(t);if(r)return this.set(e,r.value),r.value}set(e,t){let r=this._keyMapper(e),n=this._map.get(r);n&&this.delete(e);let i=this.head(),o={key:e,right:i,left:null,value:t};i?i.left=o:this._tail=o,this._map.set(r,o),this._head=o,this._size++,this._maybeDeleteLRU()}_maybeDeleteLRU(){this.size()>this.maxSize()&&this.deleteLru()}deleteLru(){let e=this.tail();e&&this.delete(e.key)}delete(e){let t=this._keyMapper(e);if(!this._size||!this._map.has(t))return;let r=f(this._map.get(t)),n=r.right,i=r.left;
15n&&(n.left=r.left),i&&(i.right=r.right),r===this.head()&&(this._head=n),r===this.tail()&&(this._tail=i),this._map.delete(t),this._size--}clear(){this._size=0,this._head=null,this._tail=null,this._map=new Map}}}.LRUCache});let{LRUCache:n3}=n2,{TreeCache:n4}=n1;var n5=function({name:e,maxSize:t,mapNodeValue:r=e=>e}){let n=new n3({maxSize:t}),i=new n4({name:e,mapNodeValue:r,onHit:e=>{n.set(e,!0)},onSet:e=>{let r=n.tail();n.set(e,!0),r&&i.size()>t&&i.delete(r.key)}});return i};function n6(e,t,r){if("string"==typeof e&&!e.includes('"')&&!e.includes("\\"))return`"${e}"`;switch(typeof e){case"undefined":return"";case"boolean":return e?"true":"false";case"number":case"symbol":return String(e);case"string":return JSON.stringify(e);case"function":if((null==t?void 0:t.allowFunctions)!==!0)throw h("Attempt to serialize function in a Recoil cache key");return`__FUNCTION(${e.name})__`}if(null===e)return"null";if("object"!=typeof e){var n;return null!==(n=JSON.stringify(e))&&void 0!==n?n:""}if(d(e))return"__PROMISE__";if(Array.isArray(e))return`[${e.map((e,r)=>n6(e,t,r.toString()))}]`;if("function"==typeof e.toJSON)return n6(e.toJSON(r),t,r);if(e instanceof Map){let n={};for(let[r,i]of e)n["string"==typeof r?r:n6(r,t)]=i;return n6(n,t,r)}return e instanceof Set?n6(Array.from(e).sort((e,r)=>n6(e,t).localeCompare(n6(r,t))),t,r):void 0!==Symbol&&null!=e[Symbol.iterator]&&"function"==typeof e[Symbol.iterator]?n6(Array.from(e),t,r):`{${Object.keys(e).filter(t=>void 0!==e[t]).sort().map(r=>`${n6(r,t)}:${n6(e[r],t,r)}`).join(",")}}`}var n8=function(e,t={allowFunctions:!1}){return n6(e,t)};let{TreeCache:n9}=n1,n7={equality:"reference",eviction:"keep-all",maxSize:1/0};var ie=function({equality:e=n7.equality,eviction:t=n7.eviction,maxSize:r=n7.maxSize}=n7,n){let i=function(e){switch(e){case"reference":return e=>e;case"value":return e=>n8(e)}throw h(`Unrecognized equality policy ${e}`)}(e);return function(e,t,r,n){switch(e){case"keep-all":return new n9({name:n,mapNodeValue:r});case"lru":return n5({name:n,maxSize:f(t),mapNodeValue:r});case"most-recent":return n5({name:n,maxSize:1,mapNodeValue:r})}throw h(`Unrecognized eviction policy ${e}`)}(t,r,i,n)};let{isReactNative:it,isWindow:ir}=tv,{isLoadable:ii,loadableWithError:io,loadableWithPromise:is,loadableWithValue:ia}=k,{WrappedValue:il}=nY,{getNodeLoadable:iu,peekNodeLoadable:ic,setNodeValue:ih}=eL,{saveDepsToStore:id}=es,{DEFAULT_VALUE:ip,getConfigDeletionHandler:iv,getNode:iy,registerNode:im}=X,{isRecoilValue:ig}=D,{markRecoilValueModified:i_}=e3,{retainedByOptionWithDefault:ib}=tn,{recoilCallback:iw}=nH,{startPerfBlock:iS}={startPerfBlock:function(e){return()=>null}};class ix{}let iT=new ix,iE=[],ik=new Map,iR=(n=0,()=>n++);function iA(e){let t=null,{key:r,get:n,cachePolicy_UNSTABLE:i}=e,o=null!=e.set?e.set:void 0,s=new Set,a=ie(null!=i?i:{equality:"reference",eviction:"keep-all"},r),l=ib(e.retainedBy_UNSTABLE),u=new Map,c=0;function p(){return!A("recoil_memory_managament_2020")||c>0}function v(e){return e.getState().knownSelectors.add(r),c++,()=>{c--}}function y(){return void 0!==iv(r)&&!p()}function m(e,t){R(e,t)&&k(e),g(t,!0)}function g(e,r){let n=ik.get(e);if(null!=n){for(let e of n)i_(e,f(t));r&&ik.delete(e)}}function _(e,t){let r=ik.get(t);null==r&&ik.set(t,r=new Set),r.add(e)}function b(e,t,r,n,i,o){return t.then(n=>{if(!p())throw k(e),iT;null!=o.loadingDepKey&&o.loadingDepPromise===t?r.atomValues.set(o.loadingDepKey,ia(n)):e.getState().knownSelectors.forEach(e=>{r.atomValues.delete(e)});let s=x(e,r);if(s&&"loading"!==s.state){if((R(e,i)||null==E(e))&&m(e,i),"hasValue"===s.state)return s.contents;throw s.contents}if(!R(e,i)){let t=T(e,r);if(null!=t)return t.loadingLoadable.contents}let[a,l]=S(e,r,i);if("loading"!==a.state&&(j(r,a,l),m(e,i)),"hasError"===a.state)throw a.contents;return a.contents}).catch(t=>{if(t instanceof ix)throw iT;if(!p())throw k(e),iT;let o=io(t);throw j(r,o,n),m(e,i),t})}function w(e,t,n,i){var o,a,l,u,c,h,d;for(let f of((R(e,i)||t.version===(null===(o=e.getState())||void 0===o?void 0:null===(a=o.currentTree)||void 0===a?void 0:a.version)||t.version===(null===(l=e.getState())||void 0===l?void 0:null===(u=l.nextTree)||void 0===u?void 0:u.version))&&id(r,n,e,null!==(c=null===(h=e.getState())||void 0===h?void 0:null===(d=h.nextTree)||void 0===d?void 0:d.version)&&void 0!==c?c:e.getState().currentTree.version),n))s.add(f)}function S(e,i,o){let s,a;let l=iS(r),u=!0,c=!0,v=()=>{l(),c=!1},y=!1,_={loadingDepKey:null,loadingDepPromise:null},S=new Map;function x({key:t}){let r=iu(e,i,t);switch(S.set(t,r),u||(w(e,i,new Set(S.keys()),o),function(e,t){if(R(e,t)){let r=f(E(e));r.stateVersions.clear(),g(t,!1)}}(e,o)),r.state){case"hasValue":return r.contents;case"hasError":throw r.contents;case"loading":throw _.loadingDepKey=t,_.loadingDepPromise=r.contents,r.contents}throw h("Invalid Loadable state")}let T=r=>(...n)=>{if(c)throw h("Callbacks from getCallback() should only be called asynchronously after the selector is evalutated.  It c
15an be used for selectors to return objects with callbacks that can work with Recoil state without a subscription.");return null!=t||nP(!1),iw(e,r,n,{node:t})};try{(s=n({get:x,getCallback:T}),s=ig(s)?x(s):s,ii(s)&&("hasError"===s.state&&(y=!0),s=s.contents),d(s))?s=s.then(t=>{if(!p())throw k(e),iT;let r=ia(t);return j(i,r,S),m(e,o),t}).catch(t=>{if(!p())throw k(e),iT;if(d(t))return b(e,t,i,S,o,_);let r=io(t);throw j(i,r,S),m(e,o),t}).finally(v):v(),s=s instanceof il?s.value:s}catch(t){d(s=t)?s=b(e,s,i,S,o,_).finally(v):(y=!0,v())}return a=y?io(s):d(s)?is(s):ia(s),u=!1,function(e,t,r){if(R(e,t)){let t=E(e);null!=t&&(t.depValuesDiscoveredSoFarDuringAsyncWork=r)}}(e,o,S),w(e,i,new Set(S.keys()),o),[a,S]}function x(e,t){let n=t.atomValues.get(r);if(null!=n)return n;let i=new Set;try{n=a.get(r=>("string"!=typeof r&&nP(!1),iu(e,t,r).contents),{onNodeVisit:e=>{"branch"===e.type&&e.nodeKey!==r&&i.add(e.nodeKey)}})}catch(e){throw h(`Problem with cache lookup for selector "${r}": ${e.message}`)}if(n){var o;t.atomValues.set(r,n),w(e,t,i,null===(o=E(e))||void 0===o?void 0:o.executionID)}return n}function T(e,t){let r=td([u.has(e)?[f(u.get(e))]:[],V(eS(u,([t])=>t!==e),([,e])=>e)]);for(let n of r){if(n.stateVersions.get(t.version)||!function(r){for(let[n,i]of r)if(!iu(e,t,n).is(i))return!0;return!1}(n.depValuesDiscoveredSoFarDuringAsyncWork))return n.stateVersions.set(t.version,!0),n;n.stateVersions.set(t.version,!1)}}function E(e){return u.get(e)}function k(e){u.delete(e)}function R(e,t){var r;return t===(null===(r=E(e))||void 0===r?void 0:r.executionID)}function j(e,t,n){e.atomValues.set(r,t);try{a.set(Array.from(n.entries()).map(([e,t])=>[e,t.contents]),t)}catch(e){throw h(`Problem with setting cache for selector "${r}": ${e.message}`)}}function C(e,t){let n=t.atomValues.get(r);return null!=n?n:a.get(r=>{var n;return"string"!=typeof r&&nP(!1),null===(n=ic(e,t,r))||void 0===n?void 0:n.contents})}function P(e,t){return function(e){if(iE.includes(r)){let e=`Recoil selector has circular dependencies: ${iE.slice(iE.indexOf(r)).join(" → ")}`;return io(h(e))}iE.push(r);try{return e()}finally{iE.pop()}}(()=>(function(e,t){var r;let n=x(e,t);if(null!=n)return k(e),n;let i=T(e,t);if(null!=i)return(null===(r=i.loadingLoadable)||void 0===r?void 0:r.state)==="loading"&&_(e,i.executionID),i.loadingLoadable;let o=iR(),[s,a]=S(e,t,o);return"loading"===s.state?(u.set(e,{depValuesDiscoveredSoFarDuringAsyncWork:a,executionID:o,loadingLoadable:s,stateVersions:new Map([[t.version,!0]])}),_(e,o)):(k(e),j(t,s,a)),s})(e,t))}function N(e){e.atomValues.delete(r)}function L(e,r){for(let i of(null!=t||nP(!1),s)){var n;let t=iy(i);null===(n=t.clearCache)||void 0===n||n.call(t,e,r)}s.clear(),N(r),a.clear(),i_(e,t)}if(null==o)return t=im({key:r,nodeType:"selector",peek:C,get:P,init:v,invalidate:N,clearCache:L,shouldDeleteConfigOnRelease:y,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l});{let n=(e,t,n)=>{let i=!1,s=new Map;function a({key:n}){if(i)throw h("Recoil: Async selector sets are not currently supported.");let o=iu(e,t,n);if("hasValue"===o.state)return o.contents;if("loading"===o.state){let e=`Getting value of asynchronous atom or selector "${n}" in a pending state while setting selector "${r}" is not yet supported.`;throw O(e),h(e)}throw o.contents}function l(r,n){if(i){let e="Recoil: Async selector sets are not currently supported.";throw O(e),h(e)}let o="function"==typeof n?n(a(r)):n,l=ih(e,t,r.key,o);l.forEach((e,t)=>s.set(t,e))}let u=o({set:l,get:a,reset:function(e){l(e,ip)}},n);if(void 0!==u)throw d(u)?h("Recoil: Async selector sets are not currently supported."):h("Recoil: selector set should be a void function.");return i=!0,s};return t=im({key:r,nodeType:"selector",peek:C,get:P,set:n,init:v,invalidate:N,clearCache:L,shouldDeleteConfigOnRelease:y,dangerouslyAllowMutability:e.dangerouslyAllowMutability,shouldRestoreFromSnapshots:!1,retainedBy:l})}}iA.value=e=>new il(e);let{isLoadable:iO,loadableWithError:ij,loadableWithPromise:iC,loadableWithValue:iP}=k,{WrappedValue:iN}=nY,{peekNodeInfo:iL}
15=eL,{DEFAULT_VALUE:iI,DefaultValue:iM,getConfigDeletionHandler:iU,registerNode:i$,setConfigDeletionHandler:iD}=X,{isRecoilValue:iB}=D,{getRecoilValueAsLoadable:iV,markRecoilValueModified:iz,setRecoilValue:iF,setRecoilValueLoadable:iq}=e3,{retainedByOptionWithDefault:iH}=tn,iG=e=>e instanceof iN?e.value:e;function iK(e){let{...t}=e,r="default"in e?e.default:new Promise(()=>{});return iB(r)?function(e){let t=iK({...e,default:iI,persistence_UNSTABLE:void 0===e.persistence_UNSTABLE?void 0:{...e.persistence_UNSTABLE,validator:t=>t instanceof iM?t:f(e.persistence_UNSTABLE).validator(t,iI)},effects:e.effects,effects_UNSTABLE:e.effects_UNSTABLE}),r=iA({key:`${e.key}__withFallback`,get:({get:r})=>{let n=r(t);return n instanceof iM?e.default:n},set:({set:e},r)=>e(t,r),cachePolicy_UNSTABLE:{eviction:"most-recent"},dangerouslyAllowMutability:e.dangerouslyAllowMutability});return iD(r.key,iU(e.key)),r}({...t,default:r}):function(e){var t;let r;let{key:n,persistence_UNSTABLE:i}=e,o=iH(e.retainedBy_UNSTABLE),s=0;function a(e){return iC(e.then(e=>(l=iP(e),e)).catch(e=>{throw l=ij(e),e}))}let l=d(e.default)?a(e.default):iO(e.default)?"loading"===e.default.state?a(e.default.contents):e.default:iP(iG(e.default));l.contents;let u=new Map;function c(e,t){var i,o;return null!==(i=null!==(o=t.atomValues.get(n))&&void 0!==o?o:r)&&void 0!==i?i:l}let p=i$({key:n,nodeType:"atom",peek:c,get:function(e,t){if(t.atomValues.has(n))return f(t.atomValues.get(n));if(!t.nonvalidatedAtoms.has(n))return l;{if(null!=r)return r;if(null==i)return B(`Tried to restore a persisted value for atom ${n} but it has no persistence settings.`),l;let e=t.nonvalidatedAtoms.get(n),o=i.validator(e,iI),s=o instanceof iM?l:iP(o);return r=s}},set:function(e,t,i){if(t.atomValues.has(n)){let e=f(t.atomValues.get(n));if("hasValue"===e.state&&i===e.contents)return new Map}else if(!t.nonvalidatedAtoms.has(n)&&i instanceof iM)return new Map;return r=void 0,new Map().set(n,iP(i))},init:function(t,r,i){var o,a,f;s++;let v=()=>{var e;s--,null===(e=u.get(t))||void 0===e||e.forEach(e=>e()),u.delete(t)};if(t.getState().knownAtoms.add(n),"loading"===l.state){let e=()=>{var e;let r=null!==(e=t.getState().nextTree)&&void 0!==e?e:t.getState().currentTree;r.atomValues.has(n)||iz(t,p)};l.contents.finally(e)}let y=null!==(o=e.effects)&&void 0!==o?o:e.effects_UNSTABLE;if(null!=y){let e=iI,o=!0,s=!1,v=null;function m(i){if(o&&i.key===n){let n=e;return n instanceof iM?c(t,r):d(n)?iC(n.then(e=>e instanceof iM?l.toPromise():e)):iP(n)}return iV(t,i)}function g(e){return m(e).toPromise()}function _(r){var i;let s=iL(t,null!==(i=t.getState().nextTree)&&void 0!==i?i:t.getState().currentTree,r.key);return!o||r.key!==n||e instanceof iM?s:{...s,isSet:!0,loadable:m(r)}}let b=r=>n=>{if(o){let t=m(p),i="hasValue"===t.state?t.contents:iI;d(e="function"==typeof n?n(i):n)&&(e=e.then(e=>(v={effect:r,value:e},e)))}else{if(d(n))throw h("Setting atoms to async values is not implemented.");"function"!=typeof n&&(v={effect:r,value:iG(n)}),iF(t,p,"function"==typeof n?e=>{let t=iG(n(e));return v={effect:r,value:t},t}:iG(n))}},w=e=>()=>b(e)(iI),S=e=>r=>{var i;let{release:o}=t.subscribeToTransactions(t=>{var i,o,s,a,u;let{currentTree:c,previousTree:h}=t.getState();h||(O("Transaction subscribers notified without a next tree being present -- this is a bug in Recoil"),h=c);let d=null!==(i=c.atomValues.get(n))&&void 0!==i?i:l;if("hasValue"===d.state){let t=d.contents,i=null!==(o=h.atomValues.get(n))&&void 0!==o?o:l,f="hasValue"===i.state?i.contents:iI;(null===(s=v)||void 0===s?void 0:s.effect)!==e||(null===(a=v)||void 0===a?void 0:a.value)!==t?r(t,f,!c.atomValues.has(n)):(null===(u=v)||void 0===u?void 0:u.effect)===e&&(v=null)}},n);u.set(t,[...null!==(i=u.get(t))&&void 0!==i?i:[],o])};for(let r of y)try{let e=r({node:p,storeID:t.storeID,parentStoreID_UNSTABLE:t.parentStoreID,trigger:i,setSelf:b(r),resetSelf:w(r),onSet:S(r),getPromise:g,getLoadable:m,getInfo_UNSTABLE:_});null!=e&&u.set(t,[...null!==(a=u.get(t))&&void 0!==a?a:[],e])}catch(t){e=t,s=!0}if(o=!1,!(e instanceof iM)){let i=s?ij(e):d(e)?iC(function(e,t){let r=t.then(t=>{var i,o;let s=null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree;return(null===(o=s.atomValues.get(n))||void 0===o?void 0:o.contents)===r&&iF(e,p,t),t}).catch(t=>{var i,o;let s=null!==(i=e.getState().nextTree)&&void 0!==i?i:e.getState().currentTree;throw(null===(o=s.atomValues.get(n))||void 0===o?void 0:o.contents)===r&&iq(e,p,ij(t)),t});return r}(t,e)):iP(iG(e));i.contents,r.atomValues.set(n,i),null===(f=t.getState().nextTree)||void 0===f||f.atomValues.set(n,i)}}return v},invalidate:function(){r=void 0},shouldDeleteConfigOnRelease:function(){return void 0!==iU(n)&&s<=0},dangerouslyAllowMutability:e.dangerouslyAllowMutability,persistence_UNSTABLE:e.persistence_UNSTABLE?{type:e.persistence_UNSTABLE.type,backButton:e.persistence_UNSTABLE.backButton}:void 0,shouldRestoreFromSnapshots:!0,retainedBy:o});return p}({...t,default:r})}iK.value=e=>new iN(e);var iJ=Object.freeze({__proto__:null,MapCache:{MapCache:class{constructor(e){var t;p(this,"_map",void 0),p(this,"_keyMapper",void 0),this._map=new Map,this._keyMapper=null!==(t=null==e?void 0:e.mapKey)&&void 0!==t?t:e=>e}size(){return this._map.size}has(e){return this._map.has(this._keyMapper(e))}get(e){return this._map.get(this._keyMapper(e))}set(e,t){this._map.set(this._keyMapper(e),t)}delete(e){this._map.delete(this._keyMapper(e))}clear(){this._map.clear()}}}.MapCache});let{LRUCache:iW}=n2,{MapCache:iX}=iJ,iZ={equality:"reference",eviction:"none",maxSize:1/0};var iY=function({equality:e=iZ.equality,eviction:t=iZ.eviction,maxSize:r=iZ.maxSize}=iZ){let n=function(e){switch(e){case"reference":return e=>e;case"value":return e=>n8(e)}throw h(`Unrecognized equality policy ${e}`)}(e),i=function(e,t,r){switch(e){case"keep-all":return new iX({mapKey:r});case"lru":return new iW({mapKey:r,maxSize:f(t)});case"most-recent":return new iW({mapKey:r,maxSize:1})}throw h(`Unrecognized eviction policy ${e}`)}(t,r,n);return i};
15let{setConfigDeletionHandler:iQ}=X,{setConfigDeletionHandler:i0}=X,i1=0;var i2=function(e){var t,r;let n=iY({equality:null!==(t=null===(r=e.cachePolicyForParams_UNSTABLE)||void 0===r?void 0:r.equality)&&void 0!==t?t:"value",eviction:"keep-all"});return t=>{var r;let i,o;try{i=n.get(t)}catch(t){throw h(`Problem with cache lookup for selector ${e.key}: ${t.message}`)}if(null!=i)return i;let s=`${e.key}__selectorFamily/${null!==(r=n8(t,{allowFunctions:!0}))&&void 0!==r?r:"void"}/${i1++}`,a=r=>e.get(t)(r),l=e.cachePolicy_UNSTABLE,u="function"==typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE;if(null!=e.set){let r=e.set,n=(e,n)=>r(t)(e,n);o=iA({key:s,get:a,set:n,cachePolicy_UNSTABLE:l,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:u})}else o=iA({key:s,get:a,cachePolicy_UNSTABLE:l,dangerouslyAllowMutability:e.dangerouslyAllowMutability,retainedBy_UNSTABLE:u});return n.set(t,o),i0(o.key,()=>{n.delete(t)}),o}};let i3=i2({key:"__constant",get:e=>()=>e,cachePolicyForParams_UNSTABLE:{equality:"reference"}}),i4=i2({key:"__error",get:e=>()=>{throw h(e)},cachePolicyForParams_UNSTABLE:{equality:"reference"}}),{loadableWithError:i5,loadableWithPromise:i6,loadableWithValue:i8}=k;function i9(e,t){let r=Array(t.length).fill(void 0),n=Array(t.length).fill(void 0);for(let[i,o]of t.entries())try{r[i]=e(o)}catch(e){n[i]=e}return[r,n]}function i7(e){return null!=e&&!d(e)}function oe(e){return Array.isArray(e)?e:Object.getOwnPropertyNames(e).map(t=>e[t])}function ot(e,t){return Array.isArray(e)?t:Object.getOwnPropertyNames(e).reduce((e,r,n)=>({...e,[r]:t[n]}),{})}function or(e,t,r){let n=r.map((e,r)=>null==e?i8(t[r]):d(e)?i6(e):i5(e));return ot(e,n)}let on=i2({key:"__waitForNone",get:e=>({get:t})=>{let r=oe(e),[n,i]=i9(t,r);return or(e,n,i)},dangerouslyAllowMutability:!0}),oi=i2({key:"__waitForAny",get:e=>({get:t})=>{let r=oe(e),[n,i]=i9(t,r);return i.some(e=>!d(e))?or(e,n,i):new Promise(t=>{for(let[r,o]of i.entries())d(o)&&o.then(o=>{n[r]=o,i[r]=void 0,t(or(e,n,i))}).catch(o=>{i[r]=o,t(or(e,n,i))})})},dangerouslyAllowMutability:!0}),oo=i2({key:"__waitForAll",get:e=>({get:t})=>{let r=oe(e),[n,i]=i9(t,r);if(i.every(e=>null==e))return ot(e,n);let o=i.find(i7);if(null!=o)throw o;return Promise.all(i).then(t=>ot(e,t.map((e,t)=>void 0===e?n[t]:e)))},dangerouslyAllowMutability:!0}),os=i2({key:"__waitForAllSettled",get:e=>({get:t})=>{let r=oe(e),[n,i]=i9(t,r);return i.every(e=>!d(e))?or(e,n,i):Promise.all(i.map((e,t)=>d(e)?e.then(e=>{n[t]=e,i[t]=void 0}).catch(e=>{n[t]=void 0,i[t]=e}):null)).then(()=>or(e,n,i))},dangerouslyAllowMutability:!0}),oa=i2({key:"__noWait",get:e=>({get:t})=>{try{return iA.value(i8(t(e)))}catch(e){return iA.value(d(e)?i6(e):i5(e))}},dangerouslyAllowMutability:!0}),{RecoilLoadable:ol}=k,{DefaultValue:ou}=X,{RecoilRoot:oc,useRecoilStoreID:oh}=rf,{isRecoilValue:od}=D,{retentionZone:of}=eb,{freshSnapshot:op}=tB,{useRecoilState:ov,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:oy,useRecoilStateLoadable:om,useRecoilValue:og,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:o_,useRecoilValueLo
15adable:ob,useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:ow,useResetRecoilState:oS,useSetRecoilState:ox}={recoilComponentGetRecoilValueCount_FOR_TESTING:{current:0},useRecoilInterface:function(){let e=rk(),t=rL(),[,r]=rH([]),n=rq(new Set);n.current=new Set;let i=rq(new Set),o=rq(new Map),s=rV(e=>{let t=o.current.get(e);t&&(t.release(),o.current.delete(e))},[o]),a=rV((e,t)=>{o.current.has(t)&&r([])},[]);return rz(()=>{let r=t.current;en(n.current,i.current).forEach(t=>{if(o.current.has(t)){B(`Double subscription to RecoilValue "${t}"`);return}let n=rB(r,new rM(t),e=>a(e,t),e);o.current.set(t,n);let i=r.getState();i.nextTree?r.getState().queuedComponentCallbacks_DEPRECATED.push(()=>{a(r.getState(),t)}):a(r.getState(),t)}),en(i.current,n.current).forEach(e=>{s(e)}),i.current=n.current}),rz(()=>{let r=o.current;return en(n.current,new Set(r.keys())).forEach(n=>{let i=rB(t.current,new rM(n),e=>a(e,n),e);r.set(n,i)}),()=>r.forEach((e,t)=>s(t))},[e,t,s,a]),rF(()=>{function e(e){return r=>{r$(t.current,e,r)}}function r(e){var r;n.current.has(e.key)||(n.current=rG(n.current,e.key));let i=t.current.getState();return rU(t.current,e,rj().early&&null!==(r=i.nextTree)&&void 0!==r?r:i.currentTree)}function i(e){let n=r(e);return rJ(n,e,t)}
15return{getRecoilValue:i,getRecoilValueLoadable:r,getRecoilState:function(t){return[i(t),e(t)]},getRecoilStateLoadable:function(t){return[r(t),e(t)]},getSetRecoilState:e,getResetRecoilState:function(e){return()=>r$(t.current,e,rA)}}},[n,t])},useRecoilState:function(e){return[r0(e),r1(e)]},useRecoilStateLoadable:function(e){return[rQ(e),r1(e)]},useRecoilValue:r0,useRecoilValueLoadable:rQ,useResetRecoilState:function(e){let t=rL();return rV(()=>{r$(t.current,e,rA)},[t,e])},useSetRecoilState:r1,useSetUnvalidatedAtomValues:function(){let e=rL();return(t,r={})=>{rR(()=>{e.current.addTransactionMetadata(r),t.forEach((t,r)=>rD(e.current,new rM(r),t))})}},useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:r2,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:r3,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:function(e){return[r3(e),r1(e)]}},{useGotoRecoilSnapshot:oT,useRecoilSnapshot:oE,useRecoilTransactionObserver:ok}=np,{useRecoilCallback:oR}=nH,{noWait:oA,waitForAll:oO,waitForAllSettled:oj,waitForAny:oC,waitForNone:oP}={waitForNone:on,waitForAny:oi,waitForAll:oo,waitForAllSettled:os,noWait:oa};var oN={DefaultValue:ou,isRecoilValue:od,RecoilLoadable:ol,RecoilEnv:R,RecoilRoot:oc,useRecoilStoreID:oh,useRecoilBridgeAcrossReactRoots_UNSTABLE:function(){"MUTABLE_SOURCE"===nm().mode&&console.warn("Warning: There are known issues using useRecoilBridgeAcrossReactRoots() in recoil_mutable_source rendering mode.  Please consider upgrading to recoil_sync_external_store mode.");let e=n_().current;return nb(()=>function({children:t}){return l.createElement(ng,{store_INTERNAL:e},t)},[e])},atom:iK,selector:iA,atomFamily:function(e){var t,r;let n=iY({equality:null!==(t=null===(r=e.cachePolicyForParams_UNSTABLE)||void 0===r?void 0:r.equality)&&void 0!==t?t:"value",eviction:"keep-all"});return t=>{var r,i;let o=n.get(t);if(null!=o)return o;let{cachePolicyForParams_UNSTABLE:s,...a}=e,l="default"in e?e.default:new Promise(()=>{}),u=iK({...a,key:`${e.key}__${null!==(r=n8(t))&&void 0!==r?r:"void"}`,default:"function"==typeof l?l(t):l,retainedBy_UNSTABLE:"function"==typeof e.retainedBy_UNSTABLE?e.retainedBy_UNSTABLE(t):e.retainedBy_UNSTABLE,effects:"function"==typeof e.effects?e.effects(t):"function"==typeof e.effects_UNSTABLE?e.effects_UNSTABLE(t):null!==(i=e.effects)&&void 0!==i?i:e.effects_UNSTABLE});return n.set(t,u),iQ(u.key,()=>{n.delete(t)}),u}},selectorFamily:i2,constSelector:function(e){return i3(e)},errorSelector:function(e){return i4(e)},readOnlySelector:function(e){return e},noWait:oA,waitForNone:oP,waitForAny:oC,waitForAll:oO,waitForAllSettled:oj,useRecoilValue:og,useRecoilValueLo
15adable:ob,useRecoilState:ov,useRecoilStateLoadable:om,useSetRecoilState:ox,useResetRecoilState:oS,useGetRecoilValueInfo_UNSTABLE:function(){let e=ny();return({key:t})=>nv(e.current,e.current.getState().currentTree,t)},useRecoilRefresher_UNSTABLE:function(e){let t=nG();return nJ(()=>{let r=t.current;nK(r,e)},[e,t])},useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE:ow,useRecoilValue_TRANSITION_SUPPORT_UNSTABLE:o_,useRecoilState_TRANSITION_SUPPORT_UNSTABLE:oy,useRecoilCallback:oR,useRecoilTransaction_UNSTABLE:function(e,t){let r=nX();return nZ(()=>(...t)=>{let n=nW(r.current);n(r=>{e(r)(...t)})},null!=t?[...t,r]:void 0)},useGotoRecoilSnapshot:oT,useRecoilSnapshot:oE,useRecoilTransactionObserver_UNSTABLE:ok,snapshot_UNSTABLE:op,useRetain:rE,retentionZone:of};oN.DefaultValue,oN.isRecoilValue,oN.RecoilLoadable,oN.RecoilEnv;var oL=oN.RecoilRoot;oN.useRecoilStoreID,oN.useRecoilBridgeAcrossReactRoots_UNSTABLE;var oI=oN.atom;oN.selector,oN.atomFamily,oN.selectorFamily,oN.constSelector,oN.errorSelector,oN.readOnlySelector,oN.noWait,oN.waitForNone,oN.waitForAny,oN.waitForAll,oN.waitForAllSettled,oN.useRecoilValue,oN.useRecoilValueLo
15adable;var oM=oN.useRecoilState;oN.useRecoilStateLoadable,oN.useSetRecoilState,oN.useResetRecoilState,oN.useGetRecoilValueInfo_UNSTABLE,oN.useRecoilRefresher_UNSTABLE,oN.useRecoilValueLoadable_TRANSITION_SUPPORT_UNSTABLE,oN.useRecoilValue_TRANSITION_SUPPORT_UNSTABLE,oN.useRecoilState_TRANSITION_SUPPORT_UNSTABLE,oN.useRecoilCallback,oN.useRecoilTransaction_UNSTABLE,oN.useGotoRecoilSnapshot,oN.useRecoilSnapshot,oN.useRecoilTransactionObserver_UNSTABLE,oN.snapshot_UNSTABLE,oN.useRetain,oN.retentionZone},5840:function(e,t,r){if("object"==typeof globalThis)n=globalThis;else try{n=r(284)}catch(e){}finally{if(n||"undefined"==typeof window||(n=window),!n)throw Error("Could not determine global this")}var n,i=n.WebSocket||n.MozWebSocket,o=r(9387);function s(e,t){return t?new i(e,t):new i(e)}i&&["CONNECTING","OPEN","CLOSING","CLOSED"].forEach(function(e){Object.defineProperty(s,e,{get:function(){return i[e]}})}),e.exports={w3cwebsocket:i?s:null,version:o}},9387:function(e,t,r){e.exports=r(9794).version},3897:function(e){e.exports=function(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=Array(t);r<t;r++)n[r]=e[r];return n},e.exports.__esModule=!0,e.exports.default=e.exports},5372:function(e){e.exports=function(e){if(Array.isArray(e))return e},e.exports.__esModule=!0,e.exports.default=e.exports},6115:function(e){e.exports=function(e){if(void 0===e)throw ReferenceError("this hasn't been initialised - super() hasn't been called");return e},e.exports.__esModule=!0,e.exports.default=e.exports},7156:function(e){function t(e,t,r,n,i,o,s){try{var a=e[o](s),l=a.value}catch(e){r(e);return}a.done?t(l):Promise.resolve(l).then(n,i)}e.exports=function(e){return function(){var r=this,n=arguments;return new Promise(function(i,o){var s=e.apply(r,n);function a(e){t(s,i,o,a,l,"next",e)}function l(e){t(s,i,o,a,l,"throw",e)}a(void 0)})}},e.exports.__esModule=!0,e.exports.default=e.exports},6690:function(e){e.exports=function(e,t){if(!(e instanceof t))throw TypeError("Cannot call a class as a function")},e.exports.__esModule=!0,e.exports.default=e.exports},3515:function(e,t,r){var n=r(6015),i=r(9617);function o(t,r,s){return i()?(e.exports=o=Reflect.construct.bind(),e.exports.__esModule=!0,e.exports.default=e.exports):(e.exports=o=function(e,t,r){var i=[null];i.push.apply(i,t);var o=new(Function.bind.apply(e,i));return r&&n(o,r.prototype),o},e.exports.__esModule=!0,e.exports.default=e.exports),o.apply(null,arguments)}e.exports=o,e.exports.__esModule=!0,e.exports.default=e.exports},9728:function(e,t,r){var n=r(4062);function i(e,t){for(var r=0;r<t.length;r++){var i=t[r];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(e,n(i.key),i)}}e.exports=function(e,t,r){return t&&i(e.prototype,t),r&&i(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e},e.exports.__esModule=!0,e.exports.default=e.exports},8416:function(e,t,r){var n=r(4062);e.exports=function(e,t,r){return(t=n(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e},e.exports.__esModule=!0,e.exports.default=e.exports},3808:function(e){function t(r){return e.exports=t=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},1655:function(e,t,r){var n=r(6015);e.exports=function(e,t){if("function"!=typeof t&&null!==t)throw TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&n(e,t)},e.exports.__esModule=!0,e.exports.default=e.exports},4836:function(e){e.exports=function(e){return e&&e.__esModule?e:{default:e}},e.exports.__esModule=!0,e.exports.default=e.exports},6035:function(e){e.exports=function(e){return -1!==Function.toString.call(e).indexOf("[native code]")},e.exports.__esModule=!0,e.exports.default=e.exports},9617:function(e){e.exports=function(){if("undefined"==typeof Reflect||!Reflect.construct||Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}},e.exports.__esModule=!0,e.exports.default=e.exports},8872:function(e){e.exports=function(e,t){var r=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null!=r){var n,i,o,s,a=[],l=!0,u=!1;try{if(o=(r=r.call(e)).next,0===t){if(Object(r)!==r)return;l=!1}else for(;!(l=(n=o.call(r)).done)&&(a.push(n.value),a.length!==t);l=!0);}catch(e){u=!0,i=e}
vendor: 5,498 bytes, line 15
15finally{try{if(!l&&null!=r.return&&(s=r.return(),Object(s)!==s))return}finally{if(u)throw i}}return a}},e.exports.__esModule=!0,e.exports.default=e.exports},2218:function(e){e.exports=function(){throw TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},e.exports.__esModule=!0,e.exports.default=e.exports},4993:function(e,t,r){var n=r(8698).default,i=r(6115);e.exports=function(e,t){if(t&&("object"===n(t)||"function"==typeof t))return t;if(void 0!==t)throw TypeError("Derived constructors may only return object or undefined");return i(e)},e.exports.__esModule=!0,e.exports.default=e.exports},7061:function(e,t,r){var n=r(8698).default;function i(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */e.exports=i=function(){return t},e.exports.__esModule=!0,e.exports.default=e.exports;var t={},r=Object.prototype,o=r.hasOwnProperty,s=Object.defineProperty||function(e,t,r){e[t]=r.value},a="function"==typeof Symbol?Symbol:{},l=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function h(e,t,r){return Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{h({},"")}catch(e){h=function(e,t,r){return e[t]=r}}function d(e,t,r,n){var i,o,a=Object.create((t&&t.prototype instanceof v?t:v).prototype);return s(a,"_invoke",{value:(i=new k(n||[]),o="suspendedStart",function(t,n){if("executing"===o)throw Error("Generator is already running");if("completed"===o){if("throw"===t)throw n;return A()}for(i.method=t,i.arg=n;;){var s=i.delegate;if(s){var a=function e(t,r){var n=r.method,i=t.iterator[n];if(void 0===i)return r.delegate=null,"throw"===n&&t.iterator.return&&(r.method="return",r.arg=void 0,e(t,r),"throw"===r.method)||"return"!==n&&(r.method="throw",r.arg=TypeError("The iterator does not provide a '"+n+"' method")),p;var o=f(i,t.iterator,r.arg);if("throw"===o.type)return r.method="throw",r.arg=o.arg,r.delegate=null,p;var s=o.arg;return s?s.done?(r[t.resultName]=s.value,r.next=t.nextLoc,"return"!==r.method&&(r.method="next",r.arg=void 0),r.delegate=null,p):s:(r.method="throw",r.arg=TypeError("iterator result is not an object"),r.delegate=null,p)}(s,i);if(a){if(a===p)continue;return a}}if("next"===i.method)i.sent=i._sent=i.arg;else if("throw"===i.method){if("suspendedStart"===o)throw o="completed",i.arg;i.dispatchException(i.arg)}else"return"===i.method&&i.abrupt("return",i.arg);o="executing";var l=f(e,r,i);if("normal"===l.type){if(o=i.done?"completed":"suspendedYield",l.arg===p)continue;return{value:l.arg,done:i.done}}"throw"===l.type&&(o="completed",i.method="throw",i.arg=l.arg)}})}),a}function f(e,t,r){try{return{type:"normal",arg:e.call(t,r)}}catch(e){return{type:"throw",arg:e}}}t.wrap=d;var p={};function v(){}function y(){}function m(){}var g={};h(g,l,function(){return this});var _=Object.getPrototypeOf,b=_&&_(_(R([])));b&&b!==r&&o.call(b,l)&&(g=b);var w=m.prototype=v.prototype=Object.create(g);function S(e){["next","throw","return"].forEach(function(t){h(e,t,function(e){return this._invoke(t,e)})})}function x(e,t){var r;s(this,"_invoke",{value:function(i,s){function a(){return new t(function(r,a){!function r(i,s,a,l){var u=f(e[i],e,s);if("throw"!==u.type){var c=u.arg,h=c.value;return h&&"object"==n(h)&&o.call(h,"__await")?t.resolve(h.__await).then(function(e){r("next",e,a,l)},function(e){r("throw",e,a,l)}):t.resolve(h).then(function(e){c.value=e,a(c)},function(e){return r("throw",e,a,l)})}l(u.arg)}(i,s,r,a)})}return r=r?r.then(a,a):a()}})}function T(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function E(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function k(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(T,this),this.reset(!0)}function R(e){if(e){var t=e[l];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,n=function t(){for(;++r<e.length;)if(o.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return n.next=n}}return{next:A}}function A(){return{value:void 0,done:!0}}return y.prototype=m,s(w,"constructor",{value:m,configurable:!0}),s(m,"constructor",{value:y,configurable:!0}),y.displayName=h(m,c,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===y||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,m):(e.__proto__=m,h(e,c,"GeneratorFunction")),e.prototype=Object.create(w),e},t.awrap=function(e){return{__await:e}},S(x.prototype),h(x.prototype,u,function(){return this}),t.AsyncIterator=x,t.async=function(e,r,n,i,o){void 0===o&&(o=Promise);var s=new x(d(e,r,n,i),o);return t.isGeneratorFunction(r)?s:s.next().then(function(e){return e.done?e.value:s.next()})},S(w),h(w,c,"Generator"),h(w,l,function(){return this}),h(w,"toString",function(){return"[object Generator]"}),t.keys=function(e){var t=Object(e),r=[];for(var n in t)r.push(n);return r.reverse(),function e(){for(;r.length;){var n=r.pop();if(n in t)return e.value=n,e.done=!1,e}return e.done=!0,e}},t.values=R,k.prototype={constructor:k,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEac
vendor: 4,748 bytes, line 15
15h(E),!e)for(var t in this)"t"===t.charAt(0)&&o.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function r(r,n){return s.type="throw",s.arg=e,t.next=r,n&&(t.method="next",t.arg=void 0),!!n}for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n],s=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var a=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(a&&l){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(a){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===e||"continue"===e)&&i.tryLoc<=t&&t<=i.finallyLoc&&(i=null);var s=i?i.completion:{};return s.type=e,s.arg=t,i?(this.method="next",this.next=i.finallyLoc,p):this.complete(s)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),p},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.finallyLoc===e)return this.complete(r.completion,r.afterLoc),E(r),p}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var r=this.tryEntries[t];if(r.tryLoc===e){var n=r.completion;if("throw"===n.type){var i=n.arg;E(r)}return i}}throw Error("illegal catch attempt")},delegateYield:function(e,t,r){return this.delegate={iterator:R(e),resultName:t,nextLoc:r},"next"===this.method&&(this.arg=void 0),p}},t}e.exports=i,e.exports.__esModule=!0,e.exports.default=e.exports},6015:function(e){function t(r,n){return e.exports=t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r,n)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},7424:function(e,t,r){var n=r(5372),i=r(8872),o=r(6116),s=r(2218);e.exports=function(e,t){return n(e)||i(e,t)||o(e,t)||s()},e.exports.__esModule=!0,e.exports.default=e.exports},5036:function(e,t,r){var n=r(8698).default;e.exports=function(e,t){if("object"!==n(e)||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var i=r.call(e,t||"default");if("object"!==n(i))return i;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)},e.exports.__esModule=!0,e.exports.default=e.exports},4062:function(e,t,r){var n=r(8698).default,i=r(5036);e.exports=function(e){var t=i(e,"string");return"symbol"===n(t)?t:String(t)},e.exports.__esModule=!0,e.exports.default=e.exports},8698:function(e){function t(r){return e.exports=t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e.exports.__esModule=!0,e.exports.default=e.exports,t(r)}e.exports=t,e.exports.__esModule=!0,e.exports.default=e.exports},6116:function(e,t,r){var n=r(3897);e.exports=function(e,t){if(e){if("string"==typeof e)return n(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);if("Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r)return Array.from(e);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return n(e,t)}},e.exports.__esModule=!0,e.exports.default=e.exports},3496:function(e,t,r){var n=r(3808),i=r(6015),o=r(6035),s=r(3515);function a(t){var r="function"==typeof Map?new Map:void 0;return e.exports=a=function(e){if(null===e||!o(e))return e;if("function"!=typeof e)throw TypeError("Super expression must either be null or a function");if(void 0!==r){if(r.has(e))return r.get(e);r.set(e,t)}function t(){return s(e,arguments,n(this).constructor)}return t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}),i(t,e)},e.exports.__esModule=!0,e.exports.default=e.exports,a(t)}e.exports=a,e.exports.__esModule=!0,e.exports.default=e.exports},4687:function(e,t,r){var n=r(7061)();e.exports=n;try{regeneratorRuntime=n}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}},7462:function(e,t,r){"use strict";function n(){return(n=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];
15for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e}).apply(this,arguments)}r.d(t,{Z:function(){return n}})},6501:function(e,t,r){"use strict";let n,i;r.d(t,{x7:function(){return ei},ZP:function(){return eo}});var o,s=r(7294);let a={data:""},l=e=>"object"==typeof window?((e?e.querySelector("#_goober"):window._goober)||Object.assign((e||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:e||a,u=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,c=/\/\*[^]*?\*\/|  +/g,h=/\n+/g,d=(e,t)=>{let r="",n="",i="";for(let o in e){let s=e[o];"@"==o[0]?"i"==o[1]?r=o+" "+s+";":n+="f"==o[1]?d(s,o):o+"{"+d(s,"k"==o[1]?"":t)+"}":"object"==typeof s?n+=d(s,t?t.replace(/([^,])+/g,e=>o.replace(/(^:.*)|([^,])+/g,t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)):o):null!=s&&(o=/^--/.test(o)?o:o.replace(/[A-Z]/g,"-$&").toLowerCase(),i+=d.p?d.p(o,s):o+":"+s+";")}return r+(t&&i?t+"{"+i+"}":i)+n},f={},p=e=>{if("object"==typeof e){let t="";for(let r in e)t+=r+p(e[r]);return t}return e},v=(e,t,r,n,i)=>{var o,s;let a=p(e),l=f[a]||(f[a]=(e=>{let t=0,r=11;for(;t<e.length;)r=101*r+e.charCodeAt(t++)>>>0;return"go"+r})(a));if(!f[l]){let t=a!==e?e:(e=>{let t,r,n=[{}];for(;t=u.exec(e.replace(c,""));)t[4]?n.shift():t[3]?(r=t[3].replace(h," ").trim(),n.unshift(n[0][r]=n[0][r]||{})):n[0][t[1]]=t[2].replace(h," ").trim();return n[0]})(e);f[l]=d(i?{["@keyframes "+l]:t}:t,r?"":"."+l)}let v=r&&f.g?f.g:null;return r&&(f.g=f[l]),o=f[l],s=t,v?s.data=s.data.replace(v,o):-1===s.data.indexOf(o)&&(s.data=n?o+s.data:s.data+o),l},y=(e,t,r)=>e.reduce((e,n,i)=>{let o=t[i];if(o&&o.call){let e=o(r),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;o=t?"."+t:e&&"object"==typeof e?e.props?"":d(e,""):!1===e?"":e}return e+n+(null==o?"":o)},"");function m(e){let t=this||{},r=e.call?e(t.p):e;return v(r.unshift?r.raw?y(r,[].slice.call(arguments,1),t.p):r.reduce((e,r)=>Object.assign(e,r&&r.call?r(t.p):r),{}):r,l(t.target),t.g,t.o,t.k)}m.bind({g:1});let g,_,b,w=m.bind({k:1});function S(e,t){let r=this||{};return function(){let n=arguments;function i(o,s){let a=Object.assign({},o),l=a.className||i.className;r.p=Object.assign({theme:_&&_()},a),r.o=/ *go\d+/.test(l),a.className=m.apply(r,n)+(l?" "+l:""),t&&(a.ref=s);let u=e;return e[0]&&(u=a.as||e,delete a.as),b&&u[0]&&b(a),g(u,a)}return t?t(i):i}}var x=e=>"function"==typeof e,T=(e,t)=>x(e)?e(t):e,E=(n=0,()=>(++n).toString()),k=()=>{if(void 0===i&&"u">typeof window){let e=matchMedia("(prefers-reduced-motion: reduce)");i=!e||e.matches}return i},R=new Map,A=e=>{if(R.has(e))return;let t=setTimeout(()=>{R.delete(e),N({type:4,toastId:e})},1e3);R.set(e,t)},O=e=>{let t=R.get(e);t&&clearTimeout(t)},j=(e,t)=>{switch(t.type){case 0:return{...e,toasts:[t.toast,...e.toasts].slice(0,20)};case 1:return t.toast.id&&O(t.toast.id),{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case 2:let{toast:r}=t;return e.toasts.find(e=>e.id===r.id)?j(e,{type:1,toast:r}):j(e,{type:0,toast:r});case 3:let{toastId:n}=t;return n?A(n):e.toasts.forEach(e=>{A(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||void 0===n?{...e,visible:!1}:e)};case 4:return void 0===t.toastId?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)};case 5:return{...e,pausedAt:t.time};case 6:let i=t.time-(e.pausedAt||0);return{...e,pausedAt:void 0,toasts:e.toasts.map(e=>({...e,pauseDuration:e.pauseDuration+i}))}}},C=[],P={toasts:[],pausedAt:void 0},N=e=>{P=j(P,e),C.forEach(e=>{e(P)})},L={blank:4e3,error:4e3,success:2e3,loading:1/0,custom:4e3},I=(e={})=>{let[t,r]=(0,s.useState)(P);(0,s.useEffect)(()=>(C.push(r),()=>{let e=C.indexOf(r);e>-1&&C.splice(e,1)}),[t]);let n=t.toasts.map(t=>{var r,n;return{...e,...e[t.type],...t,duration:t.duration||(null==(r=e[t.type])?void 0:r.duration)||(null==e?void 0:e.duration)||L[t.type],style:{...e.style,...null==(n=e[t.type])?void 0:n.style,...t.style}}});return{...t,toasts:n}},M=(e,t="blank",r)=>({createdAt:Date.now(),visible:!0,type:t,ariaProps:{role:"status","aria-live":"polite"},message:e,pauseDuration:0,...r,id:(null==r?void 0:r.id)||E()}),U=e=>(t,r)=>{let n=M(t,e,r);return N({type:2,toast:n}),n.id},$=(e,t)=>U("blank")(e,t);$.error=U("error"),$.success=U("success"),$.loading=U("loading"),$.custom=U("custom"),$.dismiss=e=>{N({type:3,toastId:e})},$.remove=e=>N({type:4,toastId:e}),$.promise=(e,t,r)=>{let n=$.loading(t.loading,{...r,...null==r?void 0:r.loading});return e.then(e=>($.success(T(t.success,e),{id:n,...r,...null==r?void 0:r.success}),e)).catch(e=>{$.error(T(t.error,e),{id:n,...r,...null==r?void 0:r.error})}),e};var D=(e,t)=>{N({type:1,toast:{id:e,height:t}})},B=()=>{N({type:5,time:Date.now()})},V=e=>{let{toasts:t,pausedAt:r}=I(e);(0,s.useEffect)(()=>
15{if(r)return;let e=Date.now(),n=t.map(t=>{if(t.duration===1/0)return;let r=(t.duration||0)+t.pauseDuration-(e-t.createdAt);if(r<0){t.visible&&$.dismiss(t.id);return}return setTimeout(()=>$.dismiss(t.id),r)});return()=>{n.forEach(e=>e&&clearTimeout(e))}},[t,r]);let n=(0,s.useCallback)(()=>{r&&N({type:6,time:Date.now()})},[r]),i=(0,s.useCallback)((e,r)=>{let{reverseOrder:n=!1,gutter:i=8,defaultPosition:o}=r||{},s=t.filter(t=>(t.position||o)===(e.position||o)&&t.height),a=s.findIndex(t=>t.id===e.id),l=s.filter((e,t)=>t<a&&e.visible).length;return s.filter(e=>e.visible).slice(...n?[l+1]:[0,l]).reduce((e,t)=>e+(t.height||0)+i,0)},[t]);return{toasts:t,handlers:{updateHeight:D,startPause:B,endPause:n,calculateOffset:i}}},z=S("div")`
16  width: 20px;
17  opacity: 0;
18  height: 20px;
19  border-radius: 10px;
20  background: ${e=>e.primary||"#ff4b4b"};
21  position: relative;
22  transform: rotate(45deg);
23
24  animation: ${w`
25from {
26  transform: scale(0) rotate(45deg);
27	opacity: 0;
28}
29to {
30 transform: scale(1) rotate(45deg);
31  opacity: 1;
32}`} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
33    forwards;
34  animation-delay: 100ms;
35
36  &:after,
37  &:before {
38    content: '';
39    animation: ${w`
40from {
41  transform: scale(0);
42  opacity: 0;
43}
44to {
45  transform: scale(1);
46  opacity: 1;
47}`} 0.15s ease-out forwards;
48    animation-delay: 150ms;
49    position: absolute;
50    border-radius: 3px;
51    opacity: 0;
52    background: ${e=>e.secondary||"#fff"};
53    bottom: 9px;
54    left: 4px;
55    height: 2px;
56    width: 12px;
57  }
58
59  &:before {
60    animation: ${w`
61from {
62  transform: scale(0) rotate(90deg);
63	opacity: 0;
64}
65to {
66  transform: scale(1) rotate(90deg);
67	opacity: 1;
68}`} 0.15s ease-out forwards;
69    animation-delay: 180ms;
70    transform: rotate(90deg);
71  }
72`,F=S("div")`
73  width: 12px;
74  height: 12px;
75  box-sizing: border-box;
76  border: 2px solid;
77  border-radius: 100%;
78  border-color: ${e=>e.secondary||"#e0e0e0"};
79  border-right-color: ${e=>e.primary||"#616161"};
80  animation: ${w`
81  from {
82    transform: rotate(0deg);
83  }
84  to {
85    transform: rotate(360deg);
86  }
87`} 1s linear infinite;
88`,q=S("div")`
89  width: 20px;
90  opacity: 0;
91  height: 20px;
92  border-radius: 10px;
93  background: ${e=>e.primary||"#61d345"};
94  position: relative;
95  transform: rotate(45deg);
96
97  animation: ${w`
98from {
99  transform: scale(0) rotate(45deg);
100	opacity: 0;
101}
102to {
103  transform: scale(1) rotate(45deg);
104	opacity: 1;
105}`} 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275)
106    forwards;
107  animation-delay: 100ms;
108  &:after {
109    content: '';
110    box-sizing: border-box;
111    animation: ${w`
1120% {
113	height: 0;
114	width: 0;
115	opacity: 0;
116}
11740% {
118  height: 0;
119	width: 6px;
120	opacity: 1;
121}
122100% {
123  opacity: 1;
124  height: 10px;
125}`} 0.2s ease-out forwards;
126    opacity: 0;
127    animation-delay: 200ms;
128    position: absolute;
129    border-right: 2px solid;
130    border-bottom: 2px solid;
131    border-color: ${e=>e.secondary||"#fff"};
132    bottom: 6px;
133    left: 6px;
134    height: 10px;
135    width: 6px;
136  }
137`,H=S("div")`
138  position: absolute;
139`,G=S("div")`
140  position: relative;
141  display: flex;
142  justify-content: center;
143  align-items: center;
144  min-width: 20px;
145  min-height: 20px;
146`,K=S("div")`
147  position: relative;
148  transform: scale(0.6);
149  opacity: 0.4;
150  min-width: 20px;
151  animation: ${w`
152from {
153  transform: scale(0.6);
154  opacity: 0.4;
155}
156to {
157  transform: scale(1);
158  opacity: 1;
159}`} 0.3s 0.12s cubic-bezier(0.175, 0.885, 0.32, 1.275)
160    forwards;
161`,J=({toast:e})=>{let{icon:t,type:r,iconTheme:n}=e;return void 0!==t?"string"==typeof t?s.createElement(K,null,t):t:"blank"===r?null:s.createElement(G,null,s.createElement(F,{...n}),"loading"!==r&&s.createElement(H,null,"error"===r?s.createElement(z,{...n}):s.createElement(q,{...n})))},W=e=>`
1620% {transform: translate3d(0,${-200*e}%,0) scale(.6); opacity:.5;}
163100% {transform: translate3d(0,0,0) scale(1); opacity:1;}
164`,X=e=>`
1650% {transform: translate3d(0,0,-1px) scale(1); opacity:1;}
166100% {transform: translate3d(0,${-150*e}%,-1px) scale(.6); opacity:0;}
167`,Z=S("div")`
168  display: flex;
169  align-items: center;
170  background: #fff;
171  color: #363636;
172  line-height: 1.3;
173  will-change: transform;
174  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1), 0 3px 3px rgba(0, 0, 0, 0.05);
175  max-width: 350px;
176  pointer-events: auto;
177  padding: 8px 10px;
178  border-radius: 8px;
179`,Y=S("div")`
180  display: flex;
181  justify-content: center;
182  margin: 4px 10px;
183  color: inherit;
184  flex: 1 1 auto;
185  white-space: pre-line;
186`,Q=(e,t)=>{let r=e.includes("top")?1:-1,[n,i]=k()?["0%{opacity:0;} 100%{opacity:1;}","0%{opacity:1;} 100%{opacity:0;}"]:[W(r),X(r)];return{animation:t?`${w(n)} 0.35s cubic-bezier(.21,1.02,.73,1) forwards`:`${w(i)} 0.4s forwards cubic-bezier(.06,.71,.55,1)`}},ee=s.memo(({toast:e,position:t,style:r,children:n})=>
186{let i=e.height?Q(e.position||t||"top-center",e.visible):{opacity:0},o=s.createElement(J,{toast:e}),a=s.createElement(Y,{...e.ariaProps},T(e.message,e));return s.createElement(Z,{className:e.className,style:{...i,...r,...e.style}},"function"==typeof n?n({icon:o,message:a}):s.createElement(s.Fragment,null,o,a))});o=s.createElement,d.p=void 0,g=o,_=void 0,b=void 0;var et=({id:e,className:t,style:r,onHeightUpdate:n,children:i})=>{let o=s.useCallback(t=>{if(t){let r=()=>{n(e,t.getBoundingClientRect().height)};r(),new MutationObserver(r).observe(t,{subtree:!0,childList:!0,characterData:!0})}},[e,n]);return s.createElement("div",{ref:o,className:t,style:r},i)},er=(e,t)=>{let r=e.includes("top"),n=e.includes("center")?{justifyContent:"center"}:e.includes("right")?{justifyContent:"flex-end"}:{};return{left:0,right:0,display:"flex",position:"absolute",transition:k()?void 0:"all 230ms cubic-bezier(.21,1.02,.73,1)",transform:`translateY(${t*(r?1:-1)}px)`,...r?{top:0}:{bottom:0},...n}},en=m`
187  z-index: 9999;
188  > * {
189    pointer-events: auto;
190  }
191`,ei=({reverseOrder:e,position:t="top-center",toastOptions:r,gutter:n,children:i,containerStyle:o,containerClassName:a})=>{let{toasts:l,handlers:u}=V(r);return s.createElement("div",{style:{position:"fixed",zIndex:9999,top:16,left:16,right:16,bottom:16,pointerEvents:"none",...o},className:a,onMouseEnter:u.startPause,onMouseLeave:u.endPause},l.map(r=>{let o=r.position||t,a=er(o,u.calculateOffset(r,{reverseOrder:e,gutter:n,defaultPosition:t}));return s.createElement(et,{id:r.id,key:r.id,onHeightUpdate:u.updateHeight,className:r.visible?en:"",style:a},"custom"===r.type?T(r.message,r):i?i(r):s.createElement(ee,{toast:r,position:o}))}))},eo=$},9794:function(e){"use strict";e.exports={version:"1.0.34"}}},function(e){var t=function(t){return e(e.s=t)};e.O(0,[774,179],function(){return t(1118),t(387)}),_N_E=e.O()}]);

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