fansunited-management-components 1.50.12 → 1.50.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/index.es.js +29361 -4617
- package/index.umd.js +325 -157
- package/package.json +1 -1
- package/src/constants/components.d.ts +395 -4
- package/src/constants/components.d.ts.map +1 -1
- package/src/context/ComponentContext.d.ts +2 -5
- package/src/context/ComponentContext.d.ts.map +1 -1
- package/src/hooks/useComponentContext.d.ts +8 -1
- package/src/hooks/useComponentContext.d.ts.map +1 -1
- package/src/index.d.ts +3 -1
- package/src/index.d.ts.map +1 -1
- package/style.css +6 -0
package/index.umd.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(be,w){typeof exports=="object"&&typeof module!="undefined"?w(exports,require("react"),require("fansunited-sdk-esm"),require("react-dom"),require("@emotion/styled"),require("@emotion/react"),require("react-quill"),require("@mui/joy"),require("@mui/icons-material")):typeof define=="function"&&define.amd?define(["exports","react","fansunited-sdk-esm","react-dom","@emotion/styled","@emotion/react","react-quill","@mui/joy","@mui/icons-material"],w):(be=typeof globalThis!="undefined"?globalThis:be||self,w(be.FansUnitedComponents={},be.React,be.FansUnitedSDK,be.ReactDOM,be.EmotionStyled,be.EmotionReact,be.ReactQuill,be.MaterialUIJoy,be.MaterialUIIcons))})(this,function(be,w,ze,pt,bi,pe,yi,b,ke){"use strict";var DF=Object.defineProperty,OF=Object.defineProperties;var RF=Object.getOwnPropertyDescriptors;var $s=Object.getOwnPropertySymbols,LF=Object.getPrototypeOf,wb=Object.prototype.hasOwnProperty,Ib=Object.prototype.propertyIsEnumerable,MF=Reflect.get;var vi=Math.pow,Fu=(be,w,ze)=>w in be?DF(be,w,{enumerable:!0,configurable:!0,writable:!0,value:ze}):be[w]=ze,N=(be,w)=>{for(var ze in w||(w={}))wb.call(w,ze)&&Fu(be,ze,w[ze]);if($s)for(var ze of $s(w))Ib.call(w,ze)&&Fu(be,ze,w[ze]);return be},Q=(be,w)=>OF(be,RF(w));var Ns=be=>typeof be=="symbol"?be:be+"",We=(be,w)=>{var ze={};for(var pt in be)wb.call(be,pt)&&w.indexOf(pt)<0&&(ze[pt]=be[pt]);if(be!=null&&$s)for(var pt of $s(be))w.indexOf(pt)<0&&Ib.call(be,pt)&&(ze[pt]=be[pt]);return ze};var te=(be,w,ze)=>Fu(be,typeof w!="symbol"?w+"":w,ze);var Ar=(be,w,ze)=>MF(LF(be),ze,w);var k=(be,w,ze)=>new Promise((pt,bi)=>{var pe=ke=>{try{b(ze.next(ke))}catch(xi){bi(xi)}},yi=ke=>{try{b(ze.throw(ke))}catch(xi){bi(xi)}},b=ke=>ke.done?pt(ke.value):Promise.resolve(ke.value).then(pe,yi);b((ze=ze.apply(be,w)).next())});function xi(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const n in e)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(t,n,r.get?r:{enumerable:!0,get:()=>e[n]})}}return t.default=e,Object.freeze(t)}const W=xi(w);var Bt=typeof globalThis!="undefined"?globalThis:typeof window!="undefined"?window:typeof global!="undefined"?global:typeof self!="undefined"?self:{};function fn(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function zu(e){if(e.__esModule)return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var ju={exports:{}},Eo={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.min.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var
|
|
9
|
+
*/var Sb=w,Ab=Symbol.for("react.element"),Tb=Symbol.for("react.fragment"),Eb=Object.prototype.hasOwnProperty,kb=Sb.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,_b={key:!0,ref:!0,__self:!0,__source:!0};function Uu(e,t,n){var r,i={},o=null,a=null;n!==void 0&&(o=""+n),t.key!==void 0&&(o=""+t.key),t.ref!==void 0&&(a=t.ref);for(r in t)Eb.call(t,r)&&!_b.hasOwnProperty(r)&&(i[r]=t[r]);if(e&&e.defaultProps)for(r in t=e.defaultProps,t)i[r]===void 0&&(i[r]=t[r]);return{$$typeof:Ab,type:e,key:o,ref:a,props:i,_owner:kb.current}}Eo.Fragment=Tb,Eo.jsx=Uu,Eo.jsxs=Uu,ju.exports=Eo;var u=ju.exports;/**
|
|
10
10
|
* @license
|
|
11
11
|
* Copyright 2017 Google LLC
|
|
12
12
|
*
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
37
37
|
* See the License for the specific language governing permissions and
|
|
38
38
|
* limitations under the License.
|
|
39
|
-
*/const
|
|
39
|
+
*/const Vu=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++){let i=e.charCodeAt(r);i<128?t[n++]=i:i<2048?(t[n++]=i>>6|192,t[n++]=i&63|128):(i&64512)===55296&&r+1<e.length&&(e.charCodeAt(r+1)&64512)===56320?(i=65536+((i&1023)<<10)+(e.charCodeAt(++r)&1023),t[n++]=i>>18|240,t[n++]=i>>12&63|128,t[n++]=i>>6&63|128,t[n++]=i&63|128):(t[n++]=i>>12|224,t[n++]=i>>6&63|128,t[n++]=i&63|128)}return t},Pb=function(e){const t=[];let n=0,r=0;for(;n<e.length;){const i=e[n++];if(i<128)t[r++]=String.fromCharCode(i);else if(i>191&&i<224){const o=e[n++];t[r++]=String.fromCharCode((i&31)<<6|o&63)}else if(i>239&&i<365){const o=e[n++],a=e[n++],s=e[n++],l=((i&7)<<18|(o&63)<<12|(a&63)<<6|s&63)-65536;t[r++]=String.fromCharCode(55296+(l>>10)),t[r++]=String.fromCharCode(56320+(l&1023))}else{const o=e[n++],a=e[n++];t[r++]=String.fromCharCode((i&15)<<12|(o&63)<<6|a&63)}}return t.join("")},Hu={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(e,t){if(!Array.isArray(e))throw Error("encodeByteArray takes an array as a parameter");this.init_();const n=t?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let i=0;i<e.length;i+=3){const o=e[i],a=i+1<e.length,s=a?e[i+1]:0,l=i+2<e.length,c=l?e[i+2]:0,d=o>>2,f=(o&3)<<4|s>>4;let h=(s&15)<<2|c>>6,p=c&63;l||(p=64,a||(h=64)),r.push(n[d],n[f],n[h],n[p])}return r.join("")},encodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?btoa(e):this.encodeByteArray(Vu(e),t)},decodeString(e,t){return this.HAS_NATIVE_SUPPORT&&!t?atob(e):Pb(this.decodeStringToByteArray(e,t))},decodeStringToByteArray(e,t){this.init_();const n=t?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let i=0;i<e.length;){const o=n[e.charAt(i++)],s=i<e.length?n[e.charAt(i)]:0;++i;const c=i<e.length?n[e.charAt(i)]:64;++i;const f=i<e.length?n[e.charAt(i)]:64;if(++i,o==null||s==null||c==null||f==null)throw new Db;const h=o<<2|s>>4;if(r.push(h),c!==64){const p=s<<4&240|c>>2;if(r.push(p),f!==64){const m=c<<6&192|f;r.push(m)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let e=0;e<this.ENCODED_VALS.length;e++)this.byteToCharMap_[e]=this.ENCODED_VALS.charAt(e),this.charToByteMap_[this.byteToCharMap_[e]]=e,this.byteToCharMapWebSafe_[e]=this.ENCODED_VALS_WEBSAFE.charAt(e),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[e]]=e,e>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(e)]=e,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(e)]=e)}}};class Db extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const Ob=function(e){const t=Vu(e);return Hu.encodeByteArray(t,!0)},Wu=function(e){return Ob(e).replace(/\./g,"")},Gu=function(e){try{return Hu.decodeString(e,!0)}catch(t){console.error("base64Decode failed: ",t)}return null};function ko(e,t){if(!(t instanceof Object))return t;switch(t.constructor){case Date:const n=t;return new Date(n.getTime());case Object:e===void 0&&(e={});break;case Array:e=[];break;default:return t}for(const n in t)!t.hasOwnProperty(n)||!Rb(n)||(e[n]=ko(e[n],t[n]));return e}function Rb(e){return e!=="__proto__"}/**
|
|
40
40
|
* @license
|
|
41
41
|
* Copyright 2022 Google LLC
|
|
42
42
|
*
|
|
@@ -51,7 +51,7 @@
|
|
|
51
51
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
52
52
|
* See the License for the specific language governing permissions and
|
|
53
53
|
* limitations under the License.
|
|
54
|
-
*/function
|
|
54
|
+
*/function Yu(){if(typeof self!="undefined")return self;if(typeof window!="undefined")return window;if(typeof global!="undefined")return global;throw new Error("Unable to locate global object.")}/**
|
|
55
55
|
* @license
|
|
56
56
|
* Copyright 2022 Google LLC
|
|
57
57
|
*
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
67
67
|
* See the License for the specific language governing permissions and
|
|
68
68
|
* limitations under the License.
|
|
69
|
-
*/const
|
|
69
|
+
*/const Lb=()=>Yu().__FIREBASE_DEFAULTS__,Mb=()=>{if(typeof process=="undefined"||typeof process.env=="undefined")return;const e=process.env.__FIREBASE_DEFAULTS__;if(e)return JSON.parse(e)},Bb=()=>{if(typeof document=="undefined")return;let e;try{e=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch(n){return}const t=e&&Gu(e[1]);return t&&JSON.parse(t)},_o=()=>{try{return Lb()||Mb()||Bb()}catch(e){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${e}`);return}},$b=e=>{var t,n;return(n=(t=_o())===null||t===void 0?void 0:t.emulatorHosts)===null||n===void 0?void 0:n[e]},Ku=()=>{var e;return(e=_o())===null||e===void 0?void 0:e.config},qu=e=>{var t;return(t=_o())===null||t===void 0?void 0:t[`_${e}`]};/**
|
|
70
70
|
* @license
|
|
71
71
|
* Copyright 2017 Google LLC
|
|
72
72
|
*
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
82
82
|
* See the License for the specific language governing permissions and
|
|
83
83
|
* limitations under the License.
|
|
84
|
-
*/class
|
|
84
|
+
*/class Nb{constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((t,n)=>{this.resolve=t,this.reject=n})}wrapCallback(t){return(n,r)=>{n?this.reject(n):this.resolve(r),typeof t=="function"&&(this.promise.catch(()=>{}),t.length===1?t(n):t(n,r))}}}/**
|
|
85
85
|
* @license
|
|
86
86
|
* Copyright 2017 Google LLC
|
|
87
87
|
*
|
|
@@ -96,7 +96,7 @@
|
|
|
96
96
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
97
97
|
* See the License for the specific language governing permissions and
|
|
98
98
|
* limitations under the License.
|
|
99
|
-
*/function
|
|
99
|
+
*/function gt(){return typeof navigator!="undefined"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function Fb(){return typeof window!="undefined"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(gt())}function Qu(){var e;const t=(e=_o())===null||e===void 0?void 0:e.forceEnvironment;if(t==="node")return!0;if(t==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch(n){return!1}}function zb(){return typeof window!="undefined"||Ju()}function Ju(){return typeof WorkerGlobalScope!="undefined"&&typeof self!="undefined"&&self instanceof WorkerGlobalScope}function Xu(){const e=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof e=="object"&&e.id!==void 0}function zs(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function Zu(){const e=gt();return e.indexOf("MSIE ")>=0||e.indexOf("Trident/")>=0}function Po(){try{return typeof indexedDB=="object"}catch(e){return!1}}function jb(){return new Promise((e,t)=>{try{let n=!0;const r="validate-browser-context-for-indexeddb-analytics-module",i=self.indexedDB.open(r);i.onsuccess=()=>{i.result.close(),n||self.indexedDB.deleteDatabase(r),e(!0)},i.onupgradeneeded=()=>{n=!1},i.onerror=()=>{var o;t(((o=i.error)===null||o===void 0?void 0:o.message)||"")}}catch(n){t(n)}})}/**
|
|
100
100
|
* @license
|
|
101
101
|
* Copyright 2017 Google LLC
|
|
102
102
|
*
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
112
112
|
* See the License for the specific language governing permissions and
|
|
113
113
|
* limitations under the License.
|
|
114
|
-
*/const
|
|
114
|
+
*/const Ub="FirebaseError";class $t extends Error{constructor(t,n,r){super(n),this.code=t,this.customData=r,this.name=Ub,Object.setPrototypeOf(this,$t.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,ar.prototype.create)}}class ar{constructor(t,n,r){this.service=t,this.serviceName=n,this.errors=r}create(t,...n){const r=n[0]||{},i=`${this.service}/${t}`,o=this.errors[t],a=o?Vb(o,r):"Error",s=`${this.serviceName}: ${a} (${i}).`;return new $t(i,s,r)}}function Vb(e,t){return e.replace(Hb,(n,r)=>{const i=t[r];return i!=null?String(i):`<${r}?>`})}const Hb=/\{\$([^}]+)}/g;/**
|
|
115
115
|
* @license
|
|
116
116
|
* Copyright 2017 Google LLC
|
|
117
117
|
*
|
|
@@ -126,7 +126,7 @@
|
|
|
126
126
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
127
127
|
* See the License for the specific language governing permissions and
|
|
128
128
|
* limitations under the License.
|
|
129
|
-
*/function
|
|
129
|
+
*/function ed(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Wb(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function Do(e,t){if(e===t)return!0;const n=Object.keys(e),r=Object.keys(t);for(const i of n){if(!r.includes(i))return!1;const o=e[i],a=t[i];if(td(o)&&td(a)){if(!Do(o,a))return!1}else if(o!==a)return!1}for(const i of r)if(!n.includes(i))return!1;return!0}function td(e){return e!==null&&typeof e=="object"}/**
|
|
130
130
|
* @license
|
|
131
131
|
* Copyright 2017 Google LLC
|
|
132
132
|
*
|
|
@@ -141,7 +141,7 @@
|
|
|
141
141
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
142
142
|
* See the License for the specific language governing permissions and
|
|
143
143
|
* limitations under the License.
|
|
144
|
-
*/function
|
|
144
|
+
*/function Tr(e){const t=[];for(const[n,r]of Object.entries(e))Array.isArray(r)?r.forEach(i=>{t.push(encodeURIComponent(n)+"="+encodeURIComponent(i))}):t.push(encodeURIComponent(n)+"="+encodeURIComponent(r));return t.length?"&"+t.join("&"):""}function Er(e){const t={};return e.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[i,o]=r.split("=");t[decodeURIComponent(i)]=decodeURIComponent(o)}}),t}function Ci(e){const t=e.indexOf("?");if(!t)return"";const n=e.indexOf("#",t);return e.substring(t,n>0?n:void 0)}function nd(e,t){const n=new Gb(e,t);return n.subscribe.bind(n)}class Gb{constructor(t,n){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=n,this.task.then(()=>{t(this)}).catch(r=>{this.error(r)})}next(t){this.forEachObserver(n=>{n.next(t)})}error(t){this.forEachObserver(n=>{n.error(t)}),this.close(t)}complete(){this.forEachObserver(t=>{t.complete()}),this.close()}subscribe(t,n,r){let i;if(t===void 0&&n===void 0&&r===void 0)throw new Error("Missing Observer.");Yb(t,["next","error","complete"])?i=t:i={next:t,error:n,complete:r},i.next===void 0&&(i.next=js),i.error===void 0&&(i.error=js),i.complete===void 0&&(i.complete=js);const o=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?i.error(this.finalError):i.complete()}catch(a){}}),this.observers.push(i),o}unsubscribeOne(t){this.observers===void 0||this.observers[t]===void 0||(delete this.observers[t],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(t){if(!this.finalized)for(let n=0;n<this.observers.length;n++)this.sendOne(n,t)}sendOne(t,n){this.task.then(()=>{if(this.observers!==void 0&&this.observers[t]!==void 0)try{n(this.observers[t])}catch(r){typeof console!="undefined"&&console.error&&console.error(r)}})}close(t){this.finalized||(this.finalized=!0,t!==void 0&&(this.finalError=t),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function Yb(e,t){if(typeof e!="object"||e===null)return!1;for(const n of t)if(n in e&&typeof e[n]=="function")return!0;return!1}function js(){}/**
|
|
145
145
|
* @license
|
|
146
146
|
* Copyright 2021 Google LLC
|
|
147
147
|
*
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
157
157
|
* See the License for the specific language governing permissions and
|
|
158
158
|
* limitations under the License.
|
|
159
|
-
*/function
|
|
159
|
+
*/function De(e){return e&&e._delegate?e._delegate:e}class Hn{constructor(t,n,r){this.name=t,this.instanceFactory=n,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(t){return this.instantiationMode=t,this}setMultipleInstances(t){return this.multipleInstances=t,this}setServiceProps(t){return this.serviceProps=t,this}setInstanceCreatedCallback(t){return this.onInstanceCreated=t,this}}/**
|
|
160
160
|
* @license
|
|
161
161
|
* Copyright 2019 Google LLC
|
|
162
162
|
*
|
|
@@ -171,7 +171,7 @@
|
|
|
171
171
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
172
172
|
* See the License for the specific language governing permissions and
|
|
173
173
|
* limitations under the License.
|
|
174
|
-
*/const
|
|
174
|
+
*/const sr="[DEFAULT]";/**
|
|
175
175
|
* @license
|
|
176
176
|
* Copyright 2019 Google LLC
|
|
177
177
|
*
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
187
187
|
* See the License for the specific language governing permissions and
|
|
188
188
|
* limitations under the License.
|
|
189
|
-
*/class
|
|
189
|
+
*/class Kb{constructor(t,n){this.name=t,this.container=n,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(t){const n=this.normalizeInstanceIdentifier(t);if(!this.instancesDeferred.has(n)){const r=new Nb;if(this.instancesDeferred.set(n,r),this.isInitialized(n)||this.shouldAutoInitialize())try{const i=this.getOrInitializeService({instanceIdentifier:n});i&&r.resolve(i)}catch(i){}}return this.instancesDeferred.get(n).promise}getImmediate(t){var n;const r=this.normalizeInstanceIdentifier(t==null?void 0:t.identifier),i=(n=t==null?void 0:t.optional)!==null&&n!==void 0?n:!1;if(this.isInitialized(r)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:r})}catch(o){if(i)return null;throw o}else{if(i)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(t){if(t.name!==this.name)throw Error(`Mismatching Component ${t.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=t,!!this.shouldAutoInitialize()){if(Qb(t))try{this.getOrInitializeService({instanceIdentifier:sr})}catch(n){}for(const[n,r]of this.instancesDeferred.entries()){const i=this.normalizeInstanceIdentifier(n);try{const o=this.getOrInitializeService({instanceIdentifier:i});r.resolve(o)}catch(o){}}}}clearInstance(t=sr){this.instancesDeferred.delete(t),this.instancesOptions.delete(t),this.instances.delete(t)}delete(){return k(this,null,function*(){const t=Array.from(this.instances.values());yield Promise.all([...t.filter(n=>"INTERNAL"in n).map(n=>n.INTERNAL.delete()),...t.filter(n=>"_delete"in n).map(n=>n._delete())])})}isComponentSet(){return this.component!=null}isInitialized(t=sr){return this.instances.has(t)}getOptions(t=sr){return this.instancesOptions.get(t)||{}}initialize(t={}){const{options:n={}}=t,r=this.normalizeInstanceIdentifier(t.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const i=this.getOrInitializeService({instanceIdentifier:r,options:n});for(const[o,a]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(o);r===s&&a.resolve(i)}return i}onInit(t,n){var r;const i=this.normalizeInstanceIdentifier(n),o=(r=this.onInitCallbacks.get(i))!==null&&r!==void 0?r:new Set;o.add(t),this.onInitCallbacks.set(i,o);const a=this.instances.get(i);return a&&t(a,i),()=>{o.delete(t)}}invokeOnInitCallbacks(t,n){const r=this.onInitCallbacks.get(n);if(r)for(const i of r)try{i(t,n)}catch(o){}}getOrInitializeService({instanceIdentifier:t,options:n={}}){let r=this.instances.get(t);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:qb(t),options:n}),this.instances.set(t,r),this.instancesOptions.set(t,n),this.invokeOnInitCallbacks(r,t),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,t,r)}catch(i){}return r||null}normalizeInstanceIdentifier(t=sr){return this.component?this.component.multipleInstances?t:sr:t}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}}function qb(e){return e===sr?void 0:e}function Qb(e){return e.instantiationMode==="EAGER"}/**
|
|
190
190
|
* @license
|
|
191
191
|
* Copyright 2019 Google LLC
|
|
192
192
|
*
|
|
@@ -201,7 +201,7 @@
|
|
|
201
201
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
202
|
* See the License for the specific language governing permissions and
|
|
203
203
|
* limitations under the License.
|
|
204
|
-
*/class
|
|
204
|
+
*/class rd{constructor(t){this.name=t,this.providers=new Map}addComponent(t){const n=this.getProvider(t.name);if(n.isComponentSet())throw new Error(`Component ${t.name} has already been registered with ${this.name}`);n.setComponent(t)}addOrOverwriteComponent(t){this.getProvider(t.name).isComponentSet()&&this.providers.delete(t.name),this.addComponent(t)}getProvider(t){if(this.providers.has(t))return this.providers.get(t);const n=new Kb(t,this);return this.providers.set(t,n),n}getProviders(){return Array.from(this.providers.values())}}/**
|
|
205
205
|
* @license
|
|
206
206
|
* Copyright 2017 Google LLC
|
|
207
207
|
*
|
|
@@ -216,7 +216,7 @@
|
|
|
216
216
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
217
217
|
* See the License for the specific language governing permissions and
|
|
218
218
|
* limitations under the License.
|
|
219
|
-
*/const
|
|
219
|
+
*/const Us=[];var Me;(function(e){e[e.DEBUG=0]="DEBUG",e[e.VERBOSE=1]="VERBOSE",e[e.INFO=2]="INFO",e[e.WARN=3]="WARN",e[e.ERROR=4]="ERROR",e[e.SILENT=5]="SILENT"})(Me||(Me={}));const id={debug:Me.DEBUG,verbose:Me.VERBOSE,info:Me.INFO,warn:Me.WARN,error:Me.ERROR,silent:Me.SILENT},Jb=Me.INFO,Xb={[Me.DEBUG]:"log",[Me.VERBOSE]:"log",[Me.INFO]:"info",[Me.WARN]:"warn",[Me.ERROR]:"error"},Zb=(e,t,...n)=>{if(t<e.logLevel)return;const r=new Date().toISOString(),i=Xb[t];if(i)console[i](`[${r}] ${e.name}:`,...n);else throw new Error(`Attempted to log a message with an invalid logType (value: ${t})`)};class Vs{constructor(t){this.name=t,this._logLevel=Jb,this._logHandler=Zb,this._userLogHandler=null,Us.push(this)}get logLevel(){return this._logLevel}set logLevel(t){if(!(t in Me))throw new TypeError(`Invalid value "${t}" assigned to \`logLevel\``);this._logLevel=t}setLogLevel(t){this._logLevel=typeof t=="string"?id[t]:t}get logHandler(){return this._logHandler}set logHandler(t){if(typeof t!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=t}get userLogHandler(){return this._userLogHandler}set userLogHandler(t){this._userLogHandler=t}debug(...t){this._userLogHandler&&this._userLogHandler(this,Me.DEBUG,...t),this._logHandler(this,Me.DEBUG,...t)}log(...t){this._userLogHandler&&this._userLogHandler(this,Me.VERBOSE,...t),this._logHandler(this,Me.VERBOSE,...t)}info(...t){this._userLogHandler&&this._userLogHandler(this,Me.INFO,...t),this._logHandler(this,Me.INFO,...t)}warn(...t){this._userLogHandler&&this._userLogHandler(this,Me.WARN,...t),this._logHandler(this,Me.WARN,...t)}error(...t){this._userLogHandler&&this._userLogHandler(this,Me.ERROR,...t),this._logHandler(this,Me.ERROR,...t)}}function e0(e){Us.forEach(t=>{t.setLogLevel(e)})}function t0(e,t){for(const n of Us){let r=null;t&&t.level&&(r=id[t.level]),e===null?n.userLogHandler=null:n.userLogHandler=(i,o,...a)=>{const s=a.map(l=>{if(l==null)return null;if(typeof l=="string")return l;if(typeof l=="number"||typeof l=="boolean")return l.toString();if(l instanceof Error)return l.message;try{return JSON.stringify(l)}catch(c){return null}}).filter(l=>l).join(" ");o>=(r!=null?r:i.logLevel)&&e({level:Me[o].toLowerCase(),message:s,args:a,type:i.name})}}}const n0=(e,t)=>t.some(n=>e instanceof n);let od,ad;function r0(){return od||(od=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function i0(){return ad||(ad=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const sd=new WeakMap,Hs=new WeakMap,ld=new WeakMap,Ws=new WeakMap,Gs=new WeakMap;function o0(e){const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("success",o),e.removeEventListener("error",a)},o=()=>{n(Wn(e.result)),i()},a=()=>{r(e.error),i()};e.addEventListener("success",o),e.addEventListener("error",a)});return t.then(n=>{n instanceof IDBCursor&&sd.set(n,e)}).catch(()=>{}),Gs.set(t,e),t}function a0(e){if(Hs.has(e))return;const t=new Promise((n,r)=>{const i=()=>{e.removeEventListener("complete",o),e.removeEventListener("error",a),e.removeEventListener("abort",a)},o=()=>{n(),i()},a=()=>{r(e.error||new DOMException("AbortError","AbortError")),i()};e.addEventListener("complete",o),e.addEventListener("error",a),e.addEventListener("abort",a)});Hs.set(e,t)}let Ys={get(e,t,n){if(e instanceof IDBTransaction){if(t==="done")return Hs.get(e);if(t==="objectStoreNames")return e.objectStoreNames||ld.get(e);if(t==="store")return n.objectStoreNames[1]?void 0:n.objectStore(n.objectStoreNames[0])}return Wn(e[t])},set(e,t,n){return e[t]=n,!0},has(e,t){return e instanceof IDBTransaction&&(t==="done"||t==="store")?!0:t in e}};function s0(e){Ys=e(Ys)}function l0(e){return e===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(t,...n){const r=e.call(Ks(this),t,...n);return ld.set(r,t.sort?t.sort():[t]),Wn(r)}:i0().includes(e)?function(...t){return e.apply(Ks(this),t),Wn(sd.get(this))}:function(...t){return Wn(e.apply(Ks(this),t))}}function c0(e){return typeof e=="function"?l0(e):(e instanceof IDBTransaction&&a0(e),n0(e,r0())?new Proxy(e,Ys):e)}function Wn(e){if(e instanceof IDBRequest)return o0(e);if(Ws.has(e))return Ws.get(e);const t=c0(e);return t!==e&&(Ws.set(e,t),Gs.set(t,e)),t}const Ks=e=>Gs.get(e);function u0(e,t,{blocked:n,upgrade:r,blocking:i,terminated:o}={}){const a=indexedDB.open(e,t),s=Wn(a);return r&&a.addEventListener("upgradeneeded",l=>{r(Wn(a.result),l.oldVersion,l.newVersion,Wn(a.transaction),l)}),n&&a.addEventListener("blocked",l=>n(l.oldVersion,l.newVersion,l)),s.then(l=>{o&&l.addEventListener("close",()=>o()),i&&l.addEventListener("versionchange",c=>i(c.oldVersion,c.newVersion,c))}).catch(()=>{}),s}const d0=["get","getKey","getAll","getAllKeys","count"],f0=["put","add","delete","clear"],qs=new Map;function cd(e,t){if(!(e instanceof IDBDatabase&&!(t in e)&&typeof t=="string"))return;if(qs.get(t))return qs.get(t);const n=t.replace(/FromIndex$/,""),r=t!==n,i=f0.includes(n);if(!(n in(r?IDBIndex:IDBObjectStore).prototype)||!(i||d0.includes(n)))return;const o=function(a,...s){return k(this,null,function*(){const l=this.transaction(a,i?"readwrite":"readonly");let c=l.store;return r&&(c=c.index(s.shift())),(yield Promise.all([c[n](...s),i&&l.done]))[0]})};return qs.set(t,o),o}s0(e=>Q(N({},e),{get:(t,n,r)=>cd(t,n)||e.get(t,n,r),has:(t,n)=>!!cd(t,n)||e.has(t,n)}));/**
|
|
220
220
|
* @license
|
|
221
221
|
* Copyright 2019 Google LLC
|
|
222
222
|
*
|
|
@@ -231,7 +231,7 @@
|
|
|
231
231
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
232
232
|
* See the License for the specific language governing permissions and
|
|
233
233
|
* limitations under the License.
|
|
234
|
-
*/class
|
|
234
|
+
*/class h0{constructor(t){this.container=t}getPlatformInfoString(){return this.container.getProviders().map(n=>{if(p0(n)){const r=n.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(n=>n).join(" ")}}function p0(e){const t=e.getComponent();return(t==null?void 0:t.type)==="VERSION"}const Oo="@firebase/app",Qs="0.10.9";/**
|
|
235
235
|
* @license
|
|
236
236
|
* Copyright 2019 Google LLC
|
|
237
237
|
*
|
|
@@ -246,7 +246,7 @@
|
|
|
246
246
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
247
247
|
* See the License for the specific language governing permissions and
|
|
248
248
|
* limitations under the License.
|
|
249
|
-
*/const
|
|
249
|
+
*/const An=new Vs("@firebase/app"),g0="@firebase/app-compat",m0="@firebase/analytics-compat",v0="@firebase/analytics",b0="@firebase/app-check-compat",y0="@firebase/app-check",x0="@firebase/auth",C0="@firebase/auth-compat",w0="@firebase/database",I0="@firebase/database-compat",S0="@firebase/functions",A0="@firebase/functions-compat",T0="@firebase/installations",E0="@firebase/installations-compat",k0="@firebase/messaging",_0="@firebase/messaging-compat",P0="@firebase/performance",D0="@firebase/performance-compat",O0="@firebase/remote-config",R0="@firebase/remote-config-compat",L0="@firebase/storage",M0="@firebase/storage-compat",B0="@firebase/firestore",$0="@firebase/vertexai-preview",N0="@firebase/firestore-compat",F0="firebase",z0="10.13.0";/**
|
|
250
250
|
* @license
|
|
251
251
|
* Copyright 2019 Google LLC
|
|
252
252
|
*
|
|
@@ -261,7 +261,7 @@
|
|
|
261
261
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
262
262
|
* See the License for the specific language governing permissions and
|
|
263
263
|
* limitations under the License.
|
|
264
|
-
*/const
|
|
264
|
+
*/const Gn="[DEFAULT]",j0={[Oo]:"fire-core",[g0]:"fire-core-compat",[v0]:"fire-analytics",[m0]:"fire-analytics-compat",[y0]:"fire-app-check",[b0]:"fire-app-check-compat",[x0]:"fire-auth",[C0]:"fire-auth-compat",[w0]:"fire-rtdb",[I0]:"fire-rtdb-compat",[S0]:"fire-fn",[A0]:"fire-fn-compat",[T0]:"fire-iid",[E0]:"fire-iid-compat",[k0]:"fire-fcm",[_0]:"fire-fcm-compat",[P0]:"fire-perf",[D0]:"fire-perf-compat",[O0]:"fire-rc",[R0]:"fire-rc-compat",[L0]:"fire-gcs",[M0]:"fire-gcs-compat",[B0]:"fire-fst",[N0]:"fire-fst-compat",[$0]:"fire-vertex","fire-js":"fire-js",[F0]:"fire-js-all"};/**
|
|
265
265
|
* @license
|
|
266
266
|
* Copyright 2019 Google LLC
|
|
267
267
|
*
|
|
@@ -276,7 +276,7 @@
|
|
|
276
276
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
277
277
|
* See the License for the specific language governing permissions and
|
|
278
278
|
* limitations under the License.
|
|
279
|
-
*/const
|
|
279
|
+
*/const Yn=new Map,kr=new Map,_r=new Map;function wi(e,t){try{e.container.addComponent(t)}catch(n){An.debug(`Component ${t.name} failed to register with FirebaseApp ${e.name}`,n)}}function ud(e,t){e.container.addOrOverwriteComponent(t)}function lr(e){const t=e.name;if(_r.has(t))return An.debug(`There were multiple attempts to register component ${t}.`),!1;_r.set(t,e);for(const n of Yn.values())wi(n,e);for(const n of kr.values())wi(n,e);return!0}function Ro(e,t){const n=e.container.getProvider("heartbeat").getImmediate({optional:!0});return n&&n.triggerHeartbeat(),e.container.getProvider(t)}function U0(e,t,n=Gn){Ro(e,t).clearInstance(n)}function dd(e){return e.options!==void 0}function Ge(e){return e.settings!==void 0}function V0(){_r.clear()}/**
|
|
280
280
|
* @license
|
|
281
281
|
* Copyright 2019 Google LLC
|
|
282
282
|
*
|
|
@@ -291,7 +291,7 @@
|
|
|
291
291
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
292
292
|
* See the License for the specific language governing permissions and
|
|
293
293
|
* limitations under the License.
|
|
294
|
-
*/const
|
|
294
|
+
*/const H0={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different options or config","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invalid-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},Qt=new ar("app","Firebase",H0);/**
|
|
295
295
|
* @license
|
|
296
296
|
* Copyright 2019 Google LLC
|
|
297
297
|
*
|
|
@@ -306,7 +306,7 @@
|
|
|
306
306
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
307
307
|
* See the License for the specific language governing permissions and
|
|
308
308
|
* limitations under the License.
|
|
309
|
-
*/let
|
|
309
|
+
*/let fd=class{constructor(t,n,r){this._isDeleted=!1,this._options=Object.assign({},t),this._config=Object.assign({},n),this._name=n.name,this._automaticDataCollectionEnabled=n.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new Hn("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this.checkDestroyed(),this._automaticDataCollectionEnabled=t}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(t){this._isDeleted=t}checkDestroyed(){if(this.isDeleted)throw Qt.create("app-deleted",{appName:this._name})}};/**
|
|
310
310
|
* @license
|
|
311
311
|
* Copyright 2023 Google LLC
|
|
312
312
|
*
|
|
@@ -321,7 +321,7 @@
|
|
|
321
321
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
322
322
|
* See the License for the specific language governing permissions and
|
|
323
323
|
* limitations under the License.
|
|
324
|
-
*/class
|
|
324
|
+
*/class W0 extends fd{constructor(t,n,r,i){const o=n.automaticDataCollectionEnabled!==void 0?n.automaticDataCollectionEnabled:!1,a={name:r,automaticDataCollectionEnabled:o};if(t.apiKey!==void 0)super(t,a,i);else{const s=t;super(s.options,a,i)}this._serverConfig=Object.assign({automaticDataCollectionEnabled:o},n),this._finalizationRegistry=null,typeof FinalizationRegistry!="undefined"&&(this._finalizationRegistry=new FinalizationRegistry(()=>{this.automaticCleanup()})),this._refCount=0,this.incRefCount(this._serverConfig.releaseOnDeref),this._serverConfig.releaseOnDeref=void 0,n.releaseOnDeref=void 0,Tn(Oo,Qs,"serverapp")}toJSON(){}get refCount(){return this._refCount}incRefCount(t){this.isDeleted||(this._refCount++,t!==void 0&&this._finalizationRegistry!==null&&this._finalizationRegistry.register(t,this))}decRefCount(){return this.isDeleted?0:--this._refCount}automaticCleanup(){Xs(this)}get settings(){return this.checkDestroyed(),this._serverConfig}checkDestroyed(){if(this.isDeleted)throw Qt.create("server-app-deleted")}}/**
|
|
325
325
|
* @license
|
|
326
326
|
* Copyright 2019 Google LLC
|
|
327
327
|
*
|
|
@@ -336,7 +336,7 @@
|
|
|
336
336
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
337
337
|
* See the License for the specific language governing permissions and
|
|
338
338
|
* limitations under the License.
|
|
339
|
-
*/const
|
|
339
|
+
*/const cr=z0;function Js(e,t={}){let n=e;typeof t!="object"&&(t={name:t});const r=Object.assign({name:Gn,automaticDataCollectionEnabled:!1},t),i=r.name;if(typeof i!="string"||!i)throw Qt.create("bad-app-name",{appName:String(i)});if(n||(n=Ku()),!n)throw Qt.create("no-options");const o=Yn.get(i);if(o){if(Do(n,o.options)&&Do(r,o.config))return o;throw Qt.create("duplicate-app",{appName:i})}const a=new rd(i);for(const l of _r.values())a.addComponent(l);const s=new fd(n,r,a);return Yn.set(i,s),s}function G0(e,t){if(zb()&&!Ju())throw Qt.create("invalid-server-app-environment");t.automaticDataCollectionEnabled===void 0&&(t.automaticDataCollectionEnabled=!1);let n;dd(e)?n=e.options:n=e;const r=Object.assign(Object.assign({},t),n);r.releaseOnDeref!==void 0&&delete r.releaseOnDeref;const i=c=>[...c].reduce((d,f)=>Math.imul(31,d)+f.charCodeAt(0)|0,0);if(t.releaseOnDeref!==void 0&&typeof FinalizationRegistry=="undefined")throw Qt.create("finalization-registry-not-supported",{});const o=""+i(JSON.stringify(r)),a=kr.get(o);if(a)return a.incRefCount(t.releaseOnDeref),a;const s=new rd(o);for(const c of _r.values())s.addComponent(c);const l=new W0(n,t,o,s);return kr.set(o,l),l}function hd(e=Gn){const t=Yn.get(e);if(!t&&e===Gn&&Ku())return Js();if(!t)throw Qt.create("no-app",{appName:e});return t}function Y0(){return Array.from(Yn.values())}function Xs(e){return k(this,null,function*(){let t=!1;const n=e.name;Yn.has(n)?(t=!0,Yn.delete(n)):kr.has(n)&&e.decRefCount()<=0&&(kr.delete(n),t=!0),t&&(yield Promise.all(e.container.getProviders().map(r=>r.delete())),e.isDeleted=!0)})}function Tn(e,t,n){var r;let i=(r=j0[e])!==null&&r!==void 0?r:e;n&&(i+=`-${n}`);const o=i.match(/\s|\//),a=t.match(/\s|\//);if(o||a){const s=[`Unable to register library "${i}" with version "${t}":`];o&&s.push(`library name "${i}" contains illegal characters (whitespace or "/")`),o&&a&&s.push("and"),a&&s.push(`version name "${t}" contains illegal characters (whitespace or "/")`),An.warn(s.join(" "));return}lr(new Hn(`${i}-version`,()=>({library:i,version:t}),"VERSION"))}function pd(e,t){if(e!==null&&typeof e!="function")throw Qt.create("invalid-log-argument");t0(e,t)}function gd(e){e0(e)}/**
|
|
340
340
|
* @license
|
|
341
341
|
* Copyright 2021 Google LLC
|
|
342
342
|
*
|
|
@@ -351,7 +351,7 @@
|
|
|
351
351
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
352
352
|
* See the License for the specific language governing permissions and
|
|
353
353
|
* limitations under the License.
|
|
354
|
-
*/const
|
|
354
|
+
*/const K0="firebase-heartbeat-database",q0=1,Ii="firebase-heartbeat-store";let Zs=null;function md(){return Zs||(Zs=u0(K0,q0,{upgrade:(e,t)=>{switch(t){case 0:try{e.createObjectStore(Ii)}catch(n){console.warn(n)}}}}).catch(e=>{throw Qt.create("idb-open",{originalErrorMessage:e.message})})),Zs}function Q0(e){return k(this,null,function*(){try{const n=(yield md()).transaction(Ii),r=yield n.objectStore(Ii).get(bd(e));return yield n.done,r}catch(t){if(t instanceof $t)An.warn(t.message);else{const n=Qt.create("idb-get",{originalErrorMessage:t==null?void 0:t.message});An.warn(n.message)}}})}function vd(e,t){return k(this,null,function*(){try{const r=(yield md()).transaction(Ii,"readwrite");yield r.objectStore(Ii).put(t,bd(e)),yield r.done}catch(n){if(n instanceof $t)An.warn(n.message);else{const r=Qt.create("idb-set",{originalErrorMessage:n==null?void 0:n.message});An.warn(r.message)}}})}function bd(e){return`${e.name}!${e.options.appId}`}/**
|
|
355
355
|
* @license
|
|
356
356
|
* Copyright 2021 Google LLC
|
|
357
357
|
*
|
|
@@ -366,7 +366,7 @@
|
|
|
366
366
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
367
367
|
* See the License for the specific language governing permissions and
|
|
368
368
|
* limitations under the License.
|
|
369
|
-
*/const
|
|
369
|
+
*/const J0=1024,X0=30*24*60*60*1e3;class Z0{constructor(t){this.container=t,this._heartbeatsCache=null;const n=this.container.getProvider("app").getImmediate();this._storage=new ty(n),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}triggerHeartbeat(){return k(this,null,function*(){var t,n,r;try{const o=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=yd();return console.log("heartbeats",(t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats),((n=this._heartbeatsCache)===null||n===void 0?void 0:n.heartbeats)==null&&(this._heartbeatsCache=yield this._heartbeatsCachePromise,((r=this._heartbeatsCache)===null||r===void 0?void 0:r.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(s=>s.date===a)?void 0:(this._heartbeatsCache.heartbeats.push({date:a,agent:o}),this._heartbeatsCache.heartbeats=this._heartbeatsCache.heartbeats.filter(s=>{const l=new Date(s.date).valueOf();return Date.now()-l<=X0}),this._storage.overwrite(this._heartbeatsCache))}catch(i){An.warn(i)}})}getHeartbeatsHeader(){return k(this,null,function*(){var t;try{if(this._heartbeatsCache===null&&(yield this._heartbeatsCachePromise),((t=this._heartbeatsCache)===null||t===void 0?void 0:t.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const n=yd(),{heartbeatsToSend:r,unsentEntries:i}=ey(this._heartbeatsCache.heartbeats),o=Wu(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=n,i.length>0?(this._heartbeatsCache.heartbeats=i,yield this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),o}catch(n){return An.warn(n),""}})}}function yd(){return new Date().toISOString().substring(0,10)}function ey(e,t=J0){const n=[];let r=e.slice();for(const i of e){const o=n.find(a=>a.agent===i.agent);if(o){if(o.dates.push(i.date),xd(n)>t){o.dates.pop();break}}else if(n.push({agent:i.agent,dates:[i.date]}),xd(n)>t){n.pop();break}r=r.slice(1)}return{heartbeatsToSend:n,unsentEntries:r}}class ty{constructor(t){this.app=t,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}runIndexedDBEnvironmentCheck(){return k(this,null,function*(){return Po()?jb().then(()=>!0).catch(()=>!1):!1})}read(){return k(this,null,function*(){if(yield this._canUseIndexedDBPromise){const n=yield Q0(this.app);return n!=null&&n.heartbeats?n:{heartbeats:[]}}else return{heartbeats:[]}})}overwrite(t){return k(this,null,function*(){var n;if(yield this._canUseIndexedDBPromise){const i=yield this.read();return vd(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:t.heartbeats})}else return})}add(t){return k(this,null,function*(){var n;if(yield this._canUseIndexedDBPromise){const i=yield this.read();return vd(this.app,{lastSentHeartbeatDate:(n=t.lastSentHeartbeatDate)!==null&&n!==void 0?n:i.lastSentHeartbeatDate,heartbeats:[...i.heartbeats,...t.heartbeats]})}else return})}}function xd(e){return Wu(JSON.stringify({version:2,heartbeats:e})).length}/**
|
|
370
370
|
* @license
|
|
371
371
|
* Copyright 2019 Google LLC
|
|
372
372
|
*
|
|
@@ -381,7 +381,7 @@
|
|
|
381
381
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
382
382
|
* See the License for the specific language governing permissions and
|
|
383
383
|
* limitations under the License.
|
|
384
|
-
*/function
|
|
384
|
+
*/function ny(e){lr(new Hn("platform-logger",t=>new h0(t),"PRIVATE")),lr(new Hn("heartbeat",t=>new Z0(t),"PRIVATE")),Tn(Oo,Qs,e),Tn(Oo,Qs,"esm2017"),Tn("fire-js","")}ny("");const ry=Object.freeze(Object.defineProperty({__proto__:null,FirebaseError:$t,SDK_VERSION:cr,_DEFAULT_ENTRY_NAME:Gn,_addComponent:wi,_addOrOverwriteComponent:ud,_apps:Yn,_clearComponents:V0,_components:_r,_getProvider:Ro,_isFirebaseApp:dd,_isFirebaseServerApp:Ge,_registerComponent:lr,_removeServiceInstance:U0,_serverApps:kr,deleteApp:Xs,getApp:hd,getApps:Y0,initializeApp:Js,initializeServerApp:G0,onLog:pd,registerVersion:Tn,setLogLevel:gd},Symbol.toStringTag,{value:"Module"}));/**
|
|
385
385
|
* @license
|
|
386
386
|
* Copyright 2020 Google LLC
|
|
387
387
|
*
|
|
@@ -396,7 +396,7 @@
|
|
|
396
396
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
397
397
|
* See the License for the specific language governing permissions and
|
|
398
398
|
* limitations under the License.
|
|
399
|
-
*/class
|
|
399
|
+
*/class iy{constructor(t,n){this._delegate=t,this.firebase=n,wi(t,new Hn("app-compat",()=>this,"PUBLIC")),this.container=t.container}get automaticDataCollectionEnabled(){return this._delegate.automaticDataCollectionEnabled}set automaticDataCollectionEnabled(t){this._delegate.automaticDataCollectionEnabled=t}get name(){return this._delegate.name}get options(){return this._delegate.options}delete(){return new Promise(t=>{this._delegate.checkDestroyed(),t()}).then(()=>(this.firebase.INTERNAL.removeApp(this.name),Xs(this._delegate)))}_getService(t,n=Gn){var r;this._delegate.checkDestroyed();const i=this._delegate.container.getProvider(t);return!i.isInitialized()&&((r=i.getComponent())===null||r===void 0?void 0:r.instantiationMode)==="EXPLICIT"&&i.initialize(),i.getImmediate({identifier:n})}_removeServiceInstance(t,n=Gn){this._delegate.container.getProvider(t).clearInstance(n)}_addComponent(t){wi(this._delegate,t)}_addOrOverwriteComponent(t){ud(this._delegate,t)}toJSON(){return{name:this.name,automaticDataCollectionEnabled:this.automaticDataCollectionEnabled,options:this.options}}}/**
|
|
400
400
|
* @license
|
|
401
401
|
* Copyright 2019 Google LLC
|
|
402
402
|
*
|
|
@@ -411,7 +411,7 @@
|
|
|
411
411
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
412
412
|
* See the License for the specific language governing permissions and
|
|
413
413
|
* limitations under the License.
|
|
414
|
-
*/const
|
|
414
|
+
*/const oy={"no-app":"No Firebase App '{$appName}' has been created - call Firebase App.initializeApp()","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance."},Cd=new ar("app-compat","Firebase",oy);/**
|
|
415
415
|
* @license
|
|
416
416
|
* Copyright 2019 Google LLC
|
|
417
417
|
*
|
|
@@ -426,7 +426,7 @@
|
|
|
426
426
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
427
427
|
* See the License for the specific language governing permissions and
|
|
428
428
|
* limitations under the License.
|
|
429
|
-
*/function
|
|
429
|
+
*/function ay(e){const t={},n={__esModule:!0,initializeApp:o,app:i,registerVersion:Tn,setLogLevel:gd,onLog:pd,apps:null,SDK_VERSION:cr,INTERNAL:{registerComponent:s,removeApp:r,useAsService:l,modularAPIs:ry}};n.default=n,Object.defineProperty(n,"apps",{get:a});function r(c){delete t[c]}function i(c){if(c=c||Gn,!ed(t,c))throw Cd.create("no-app",{appName:c});return t[c]}i.App=e;function o(c,d={}){const f=Js(c,d);if(ed(t,f.name))return t[f.name];const h=new e(f,n);return t[f.name]=h,h}function a(){return Object.keys(t).map(c=>t[c])}function s(c){const d=c.name,f=d.replace("-compat","");if(lr(c)&&c.type==="PUBLIC"){const h=(p=i())=>{if(typeof p[f]!="function")throw Cd.create("invalid-app-argument",{appName:d});return p[f]()};c.serviceProps!==void 0&&ko(h,c.serviceProps),n[f]=h,e.prototype[f]=function(...p){return this._getService.bind(this,d).apply(this,c.multipleInstances?p:[])}}return c.type==="PUBLIC"?n[f]:null}function l(c,d){return d==="serverAuth"?null:d}return n}/**
|
|
430
430
|
* @license
|
|
431
431
|
* Copyright 2019 Google LLC
|
|
432
432
|
*
|
|
@@ -441,7 +441,7 @@
|
|
|
441
441
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
442
442
|
* See the License for the specific language governing permissions and
|
|
443
443
|
* limitations under the License.
|
|
444
|
-
*/function
|
|
444
|
+
*/function wd(){const e=ay(iy);e.INTERNAL=Object.assign(Object.assign({},e.INTERNAL),{createFirebaseNamespace:wd,extendNamespace:t,createSubscribe:nd,ErrorFactory:ar,deepExtend:ko});function t(n){ko(e,n)}return e}const sy=wd();/**
|
|
445
445
|
* @license
|
|
446
446
|
* Copyright 2019 Google LLC
|
|
447
447
|
*
|
|
@@ -456,7 +456,7 @@
|
|
|
456
456
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
457
457
|
* See the License for the specific language governing permissions and
|
|
458
458
|
* limitations under the License.
|
|
459
|
-
*/const
|
|
459
|
+
*/const Id=new Vs("@firebase/app-compat"),ly="@firebase/app-compat",cy="0.2.39";/**
|
|
460
460
|
* @license
|
|
461
461
|
* Copyright 2019 Google LLC
|
|
462
462
|
*
|
|
@@ -471,7 +471,7 @@
|
|
|
471
471
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
472
472
|
* See the License for the specific language governing permissions and
|
|
473
473
|
* limitations under the License.
|
|
474
|
-
*/function
|
|
474
|
+
*/function uy(e){Tn(ly,cy,e)}/**
|
|
475
475
|
* @license
|
|
476
476
|
* Copyright 2020 Google LLC
|
|
477
477
|
*
|
|
@@ -486,13 +486,13 @@
|
|
|
486
486
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
487
487
|
* See the License for the specific language governing permissions and
|
|
488
488
|
* limitations under the License.
|
|
489
|
-
*/try{const
|
|
489
|
+
*/try{const e=Yu();if(e.firebase!==void 0){Id.warn(`
|
|
490
490
|
Warning: Firebase is already defined in the global scope. Please make sure
|
|
491
491
|
Firebase library is only loaded once.
|
|
492
|
-
`);const e
|
|
492
|
+
`);const t=e.firebase.SDK_VERSION;t&&t.indexOf("LITE")>=0&&Id.warn(`
|
|
493
493
|
Warning: You are trying to load Firebase while using Firebase Performance standalone script.
|
|
494
494
|
You should load Firebase Performance with this instance of Firebase to avoid loading duplicate code.
|
|
495
|
-
`)}}catch(
|
|
495
|
+
`)}}catch(e){}const Kn=sy;uy();var dy="firebase",fy="10.13.0";/**
|
|
496
496
|
* @license
|
|
497
497
|
* Copyright 2020 Google LLC
|
|
498
498
|
*
|
|
@@ -507,7 +507,7 @@
|
|
|
507
507
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
508
508
|
* See the License for the specific language governing permissions and
|
|
509
509
|
* limitations under the License.
|
|
510
|
-
*/
|
|
510
|
+
*/Kn.registerVersion(dy,fy,"app-compat");var el=function(e,t){return el=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,r){n.__proto__=r}||function(n,r){for(var i in r)Object.prototype.hasOwnProperty.call(r,i)&&(n[i]=r[i])},el(e,t)};function hy(e,t){if(typeof t!="function"&&t!==null)throw new TypeError("Class extends value "+String(t)+" is not a constructor or null");el(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var Tt=function(){return Tt=Object.assign||function(t){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o])}return t},Tt.apply(this,arguments)};function tl(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}typeof SuppressedError=="function"&&SuppressedError;const Si={FACEBOOK:"facebook.com",GITHUB:"github.com",GOOGLE:"google.com",PASSWORD:"password",PHONE:"phone",TWITTER:"twitter.com"},Pr={EMAIL_SIGNIN:"EMAIL_SIGNIN",PASSWORD_RESET:"PASSWORD_RESET",RECOVER_EMAIL:"RECOVER_EMAIL",REVERT_SECOND_FACTOR_ADDITION:"REVERT_SECOND_FACTOR_ADDITION",VERIFY_AND_CHANGE_EMAIL:"VERIFY_AND_CHANGE_EMAIL",VERIFY_EMAIL:"VERIFY_EMAIL"};/**
|
|
511
511
|
* @license
|
|
512
512
|
* Copyright 2020 Google LLC
|
|
513
513
|
*
|
|
@@ -522,7 +522,7 @@
|
|
|
522
522
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
523
523
|
* See the License for the specific language governing permissions and
|
|
524
524
|
* limitations under the License.
|
|
525
|
-
*/function Ka(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements."}}function ki(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Ja=Ka,Qa=ki,Pi=new ue("auth","Firebase",ki());/**
|
|
525
|
+
*/function py(){return{"admin-restricted-operation":"This operation is restricted to administrators only.","argument-error":"","app-not-authorized":"This app, identified by the domain where it's hosted, is not authorized to use Firebase Authentication with the provided API key. Review your key configuration in the Google API console.","app-not-installed":"The requested mobile application corresponding to the identifier (Android package name or iOS bundle ID) provided is not installed on this device.","captcha-check-failed":"The reCAPTCHA response token provided is either invalid, expired, already used or the domain associated with it does not match the list of whitelisted domains.","code-expired":"The SMS code has expired. Please re-send the verification code to try again.","cordova-not-ready":"Cordova framework is not ready.","cors-unsupported":"This browser is not supported.","credential-already-in-use":"This credential is already associated with a different user account.","custom-token-mismatch":"The custom token corresponds to a different audience.","requires-recent-login":"This operation is sensitive and requires recent authentication. Log in again before retrying this request.","dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK.","dynamic-link-not-activated":"Please activate Dynamic Links in the Firebase Console and agree to the terms and conditions.","email-change-needs-verification":"Multi-factor users must always have a verified email.","email-already-in-use":"The email address is already in use by another account.","emulator-config-failed":'Auth instance has already been used to make a network call. Auth can no longer be configured to use the emulator. Try calling "connectAuthEmulator()" sooner.',"expired-action-code":"The action code has expired.","cancelled-popup-request":"This operation has been cancelled due to another conflicting popup being opened.","internal-error":"An internal AuthError has occurred.","invalid-app-credential":"The phone verification request contains an invalid application verifier. The reCAPTCHA token response is either invalid or expired.","invalid-app-id":"The mobile app identifier is not registered for the current project.","invalid-user-token":"This user's credential isn't valid for this project. This can happen if the user's token has been tampered with, or if the user isn't for the project associated with this API key.","invalid-auth-event":"An internal AuthError has occurred.","invalid-verification-code":"The SMS verification code used to create the phone auth credential is invalid. Please resend the verification code sms and be sure to use the verification code provided by the user.","invalid-continue-uri":"The continue URL provided in the request is invalid.","invalid-cordova-configuration":"The following Cordova plugins must be installed to enable OAuth sign-in: cordova-plugin-buildinfo, cordova-universal-links-plugin, cordova-plugin-browsertab, cordova-plugin-inappbrowser and cordova-plugin-customurlscheme.","invalid-custom-token":"The custom token format is incorrect. Please check the documentation.","invalid-dynamic-link-domain":"The provided dynamic link domain is not configured or authorized for the current project.","invalid-email":"The email address is badly formatted.","invalid-emulator-scheme":"Emulator URL must start with a valid scheme (http:// or https://).","invalid-api-key":"Your API key is invalid, please check you have copied it correctly.","invalid-cert-hash":"The SHA-1 certificate hash provided is invalid.","invalid-credential":"The supplied auth credential is incorrect, malformed or has expired.","invalid-message-payload":"The email template corresponding to this action contains invalid characters in its message. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-multi-factor-session":"The request does not contain a valid proof of first factor successful sign-in.","invalid-oauth-provider":"EmailAuthProvider is not supported for this operation. This operation only supports OAuth providers.","invalid-oauth-client-id":"The OAuth client ID provided is either invalid or does not match the specified API key.","unauthorized-domain":"This domain is not authorized for OAuth operations for your Firebase project. Edit the list of authorized domains from the Firebase console.","invalid-action-code":"The action code is invalid. This can happen if the code is malformed, expired, or has already been used.","wrong-password":"The password is invalid or the user does not have a password.","invalid-persistence-type":"The specified persistence type is invalid. It can only be local, session or none.","invalid-phone-number":"The format of the phone number provided is incorrect. Please enter the phone number in a format that can be parsed into E.164 format. E.164 phone numbers are written in the format [+][country code][subscriber number including area code].","invalid-provider-id":"The specified provider ID is invalid.","invalid-recipient-email":"The email corresponding to this action failed to send as the provided recipient email address is invalid.","invalid-sender":"The email template corresponding to this action contains an invalid sender email or name. Please fix by going to the Auth email templates section in the Firebase Console.","invalid-verification-id":"The verification ID used to create the phone auth credential is invalid.","invalid-tenant-id":"The Auth instance's tenant ID is invalid.","login-blocked":"Login blocked by user-provided method: {$originalMessage}","missing-android-pkg-name":"An Android Package Name must be provided if the Android App is required to be installed.","auth-domain-config-required":"Be sure to include authDomain when calling firebase.initializeApp(), by following the instructions in the Firebase console.","missing-app-credential":"The phone verification request is missing an application verifier assertion. A reCAPTCHA response token needs to be provided.","missing-verification-code":"The phone auth credential was created with an empty SMS verification code.","missing-continue-uri":"A continue URL must be provided in the request.","missing-iframe-start":"An internal AuthError has occurred.","missing-ios-bundle-id":"An iOS Bundle ID must be provided if an App Store ID is provided.","missing-or-invalid-nonce":"The request does not contain a valid nonce. This can occur if the SHA-256 hash of the provided raw nonce does not match the hashed nonce in the ID token payload.","missing-password":"A non-empty password must be provided","missing-multi-factor-info":"No second factor identifier is provided.","missing-multi-factor-session":"The request is missing proof of first factor successful sign-in.","missing-phone-number":"To send verification codes, provide a phone number for the recipient.","missing-verification-id":"The phone auth credential was created with an empty verification ID.","app-deleted":"This instance of FirebaseApp has been deleted.","multi-factor-info-not-found":"The user does not have a second factor matching the identifier provided.","multi-factor-auth-required":"Proof of ownership of a second factor is required to complete sign-in.","account-exists-with-different-credential":"An account already exists with the same email address but different sign-in credentials. Sign in using a provider associated with this email address.","network-request-failed":"A network AuthError (such as timeout, interrupted connection or unreachable host) has occurred.","no-auth-event":"An internal AuthError has occurred.","no-such-provider":"User was not linked to an account with the given provider.","null-user":"A null user object was provided as the argument for an operation which requires a non-null user object.","operation-not-allowed":"The given sign-in provider is disabled for this Firebase project. Enable it in the Firebase console, under the sign-in method tab of the Auth section.","operation-not-supported-in-this-environment":'This operation is not supported in the environment this application is running on. "location.protocol" must be http, https or chrome-extension and web storage must be enabled.',"popup-blocked":"Unable to establish a connection with the popup. It may have been blocked by the browser.","popup-closed-by-user":"The popup has been closed by the user before finalizing the operation.","provider-already-linked":"User can only be linked to one identity for the given provider.","quota-exceeded":"The project's quota for this operation has been exceeded.","redirect-cancelled-by-user":"The redirect operation has been cancelled by the user before finalizing.","redirect-operation-pending":"A redirect sign-in operation is already pending.","rejected-credential":"The request contains malformed or mismatching credentials.","second-factor-already-in-use":"The second factor is already enrolled on this account.","maximum-second-factor-count-exceeded":"The maximum allowed number of second factors on a user has been exceeded.","tenant-id-mismatch":"The provided tenant ID does not match the Auth instance's tenant ID",timeout:"The operation has timed out.","user-token-expired":"The user's credential is no longer valid. The user must sign in again.","too-many-requests":"We have blocked all requests from this device due to unusual activity. Try again later.","unauthorized-continue-uri":"The domain of the continue URL is not whitelisted. Please whitelist the domain in the Firebase console.","unsupported-first-factor":"Enrolling a second factor or signing in with a multi-factor account requires sign-in with a supported first factor.","unsupported-persistence-type":"The current environment does not support the specified persistence type.","unsupported-tenant-operation":"This operation is not supported in a multi-tenant context.","unverified-email":"The operation requires a verified email.","user-cancelled":"The user did not grant your application the permissions it requested.","user-not-found":"There is no user record corresponding to this identifier. The user may have been deleted.","user-disabled":"The user account has been disabled by an administrator.","user-mismatch":"The supplied credentials do not correspond to the previously signed in user.","user-signed-out":"","weak-password":"The password must be 6 characters long or more.","web-storage-unsupported":"This browser is not supported or 3rd party cookies and data may be disabled.","already-initialized":"initializeAuth() has already been called with different options. To avoid this error, call initializeAuth() with the same options as when it was originally called, or call getAuth() to return the already initialized instance.","missing-recaptcha-token":"The reCAPTCHA token is missing when sending request to the backend.","invalid-recaptcha-token":"The reCAPTCHA token is invalid when sending request to the backend.","invalid-recaptcha-action":"The reCAPTCHA action is invalid when sending request to the backend.","recaptcha-not-enabled":"reCAPTCHA Enterprise integration is not enabled for this project.","missing-client-type":"The reCAPTCHA client type is missing when sending request to the backend.","missing-recaptcha-version":"The reCAPTCHA version is missing when sending request to the backend.","invalid-req-type":"Invalid request parameters.","invalid-recaptcha-version":"The reCAPTCHA version is invalid when sending request to the backend.","unsupported-password-policy-schema-version":"The password policy received from the backend uses a schema version that is not supported by this version of the Firebase SDK.","password-does-not-meet-requirements":"The password does not meet the requirements."}}function Sd(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const gy=py,my=Sd,Ad=new ar("auth","Firebase",Sd());/**
|
|
526
526
|
* @license
|
|
527
527
|
* Copyright 2020 Google LLC
|
|
528
528
|
*
|
|
@@ -537,7 +537,7 @@
|
|
|
537
537
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
538
538
|
* See the License for the specific language governing permissions and
|
|
539
539
|
* limitations under the License.
|
|
540
|
-
*/const
|
|
540
|
+
*/const Lo=new Vs("@firebase/auth");function vy(e,...t){Lo.logLevel<=Me.WARN&&Lo.warn(`Auth (${cr}): ${e}`,...t)}function Mo(e,...t){Lo.logLevel<=Me.ERROR&&Lo.error(`Auth (${cr}): ${e}`,...t)}/**
|
|
541
541
|
* @license
|
|
542
542
|
* Copyright 2020 Google LLC
|
|
543
543
|
*
|
|
@@ -552,7 +552,7 @@
|
|
|
552
552
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
553
553
|
* See the License for the specific language governing permissions and
|
|
554
554
|
* limitations under the License.
|
|
555
|
-
*/function
|
|
555
|
+
*/function bt(e,...t){throw rl(e,...t)}function mt(e,...t){return rl(e,...t)}function nl(e,t,n){const r=Object.assign(Object.assign({},my()),{[t]:n});return new ar("auth","Firebase",r).create(t,{appName:e.name})}function yt(e){return nl(e,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Dr(e,t,n){const r=n;if(!(t instanceof r))throw r.name!==t.constructor.name&&bt(e,"argument-error"),nl(e,"argument-error",`Type of ${t.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function rl(e,...t){if(typeof e!="string"){const n=t[0],r=[...t.slice(1)];return r[0]&&(r[0].appName=e.name),e._errorFactory.create(n,...r)}return Ad.create(e,...t)}function oe(e,t,...n){if(!e)throw rl(t,...n)}function hn(e){const t="INTERNAL ASSERTION FAILED: "+e;throw Mo(t),new Error(t)}function an(e,t){e||hn(t)}/**
|
|
556
556
|
* @license
|
|
557
557
|
* Copyright 2020 Google LLC
|
|
558
558
|
*
|
|
@@ -567,7 +567,7 @@
|
|
|
567
567
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
568
568
|
* See the License for the specific language governing permissions and
|
|
569
569
|
* limitations under the License.
|
|
570
|
-
*/function
|
|
570
|
+
*/function Ai(){var e;return typeof self!="undefined"&&((e=self.location)===null||e===void 0?void 0:e.href)||""}function il(){return Td()==="http:"||Td()==="https:"}function Td(){var e;return typeof self!="undefined"&&((e=self.location)===null||e===void 0?void 0:e.protocol)||null}/**
|
|
571
571
|
* @license
|
|
572
572
|
* Copyright 2020 Google LLC
|
|
573
573
|
*
|
|
@@ -582,7 +582,7 @@
|
|
|
582
582
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
583
583
|
* See the License for the specific language governing permissions and
|
|
584
584
|
* limitations under the License.
|
|
585
|
-
*/function
|
|
585
|
+
*/function by(){return typeof navigator!="undefined"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(il()||Xu()||"connection"in navigator)?navigator.onLine:!0}function yy(){if(typeof navigator=="undefined")return null;const e=navigator;return e.languages&&e.languages[0]||e.language||null}/**
|
|
586
586
|
* @license
|
|
587
587
|
* Copyright 2020 Google LLC
|
|
588
588
|
*
|
|
@@ -597,7 +597,7 @@
|
|
|
597
597
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
598
598
|
* See the License for the specific language governing permissions and
|
|
599
599
|
* limitations under the License.
|
|
600
|
-
*/class
|
|
600
|
+
*/class Ti{constructor(t,n){this.shortDelay=t,this.longDelay=n,an(n>t,"Short delay should be less than long delay!"),this.isMobile=Fb()||zs()}get(){return by()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
|
|
601
601
|
* @license
|
|
602
602
|
* Copyright 2020 Google LLC
|
|
603
603
|
*
|
|
@@ -612,7 +612,7 @@
|
|
|
612
612
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
613
613
|
* See the License for the specific language governing permissions and
|
|
614
614
|
* limitations under the License.
|
|
615
|
-
*/function
|
|
615
|
+
*/function ol(e,t){an(e.emulator,"Emulator should always be set here");const{url:n}=e.emulator;return t?`${n}${t.startsWith("/")?t.slice(1):t}`:n}/**
|
|
616
616
|
* @license
|
|
617
617
|
* Copyright 2020 Google LLC
|
|
618
618
|
*
|
|
@@ -627,7 +627,7 @@
|
|
|
627
627
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
628
628
|
* See the License for the specific language governing permissions and
|
|
629
629
|
* limitations under the License.
|
|
630
|
-
*/class
|
|
630
|
+
*/class Ed{static initialize(t,n,r){this.fetchImpl=t,n&&(this.headersImpl=n),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self!="undefined"&&"fetch"in self)return self.fetch;if(typeof globalThis!="undefined"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch!="undefined")return fetch;hn("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self!="undefined"&&"Headers"in self)return self.Headers;if(typeof globalThis!="undefined"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers!="undefined")return Headers;hn("Could not find Headers implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self!="undefined"&&"Response"in self)return self.Response;if(typeof globalThis!="undefined"&&globalThis.Response)return globalThis.Response;if(typeof Response!="undefined")return Response;hn("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
|
|
631
631
|
* @license
|
|
632
632
|
* Copyright 2020 Google LLC
|
|
633
633
|
*
|
|
@@ -642,7 +642,7 @@
|
|
|
642
642
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
643
643
|
* See the License for the specific language governing permissions and
|
|
644
644
|
* limitations under the License.
|
|
645
|
-
*/const
|
|
645
|
+
*/const xy={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
|
|
646
646
|
* @license
|
|
647
647
|
* Copyright 2020 Google LLC
|
|
648
648
|
*
|
|
@@ -657,7 +657,7 @@
|
|
|
657
657
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
658
658
|
* See the License for the specific language governing permissions and
|
|
659
659
|
* limitations under the License.
|
|
660
|
-
*/const
|
|
660
|
+
*/const Cy=new Ti(3e4,6e4);function Ye(e,t){return e.tenantId&&!t.tenantId?Object.assign(Object.assign({},t),{tenantId:e.tenantId}):t}function Ke(o,a,s,l){return k(this,arguments,function*(e,t,n,r,i={}){return kd(e,i,()=>k(this,null,function*(){let c={},d={};r&&(t==="GET"?d=r:c={body:JSON.stringify(r)});const f=Tr(Object.assign({key:e.config.apiKey},d)).slice(1),h=yield e._getAdditionalHeaders();return h["Content-Type"]="application/json",e.languageCode&&(h["X-Firebase-Locale"]=e.languageCode),Ed.fetch()(_d(e,e.config.apiHost,n,f),Object.assign({method:t,headers:h,referrerPolicy:"no-referrer"},c))}))})}function kd(e,t,n){return k(this,null,function*(){e._canInitEmulator=!1;const r=Object.assign(Object.assign({},xy),t);try{const i=new Iy(e),o=yield Promise.race([n(),i.promise]);i.clearNetworkTimeout();const a=yield o.json();if("needConfirmation"in a)throw Ei(e,"account-exists-with-different-credential",a);if(o.ok&&!("errorMessage"in a))return a;{const s=o.ok?a.errorMessage:a.error.message,[l,c]=s.split(" : ");if(l==="FEDERATED_USER_ID_ALREADY_LINKED")throw Ei(e,"credential-already-in-use",a);if(l==="EMAIL_EXISTS")throw Ei(e,"email-already-in-use",a);if(l==="USER_DISABLED")throw Ei(e,"user-disabled",a);const d=r[l]||l.toLowerCase().replace(/[_\s]+/g,"-");if(c)throw nl(e,d,c);bt(e,d)}}catch(i){if(i instanceof $t)throw i;bt(e,"network-request-failed",{message:String(i)})}})}function En(o,a,s,l){return k(this,arguments,function*(e,t,n,r,i={}){const c=yield Ke(e,t,n,r,i);return"mfaPendingCredential"in c&&bt(e,"multi-factor-auth-required",{_serverResponse:c}),c})}function _d(e,t,n,r){const i=`${t}${n}?${r}`;return e.config.emulator?ol(e.config,i):`${e.config.apiScheme}://${i}`}function wy(e){switch(e){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Iy{constructor(t){this.auth=t,this.timer=null,this.promise=new Promise((n,r)=>{this.timer=setTimeout(()=>r(mt(this.auth,"network-request-failed")),Cy.get())})}clearNetworkTimeout(){clearTimeout(this.timer)}}function Ei(e,t,n){const r={appName:e.name};n.email&&(r.email=n.email),n.phoneNumber&&(r.phoneNumber=n.phoneNumber);const i=mt(e,t,r);return i.customData._tokenResponse=n,i}/**
|
|
661
661
|
* @license
|
|
662
662
|
* Copyright 2020 Google LLC
|
|
663
663
|
*
|
|
@@ -672,7 +672,7 @@
|
|
|
672
672
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
673
673
|
* See the License for the specific language governing permissions and
|
|
674
674
|
* limitations under the License.
|
|
675
|
-
*/function
|
|
675
|
+
*/function Pd(e){return e!==void 0&&e.getResponse!==void 0}function Dd(e){return e!==void 0&&e.enterprise!==void 0}class Sy{constructor(t){if(this.siteKey="",this.recaptchaEnforcementState=[],t.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=t.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=t.recaptchaEnforcementState}getProviderEnforcementState(t){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const n of this.recaptchaEnforcementState)if(n.provider&&n.provider===t)return wy(n.enforcementState);return null}isProviderEnabled(t){return this.getProviderEnforcementState(t)==="ENFORCE"||this.getProviderEnforcementState(t)==="AUDIT"}}/**
|
|
676
676
|
* @license
|
|
677
677
|
* Copyright 2020 Google LLC
|
|
678
678
|
*
|
|
@@ -687,7 +687,7 @@
|
|
|
687
687
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
688
688
|
* See the License for the specific language governing permissions and
|
|
689
689
|
* limitations under the License.
|
|
690
|
-
*/function
|
|
690
|
+
*/function Ay(e){return k(this,null,function*(){return(yield Ke(e,"GET","/v1/recaptchaParams")).recaptchaSiteKey||""})}function Ty(e,t){return k(this,null,function*(){return Ke(e,"GET","/v2/recaptchaConfig",Ye(e,t))})}/**
|
|
691
691
|
* @license
|
|
692
692
|
* Copyright 2020 Google LLC
|
|
693
693
|
*
|
|
@@ -702,7 +702,7 @@
|
|
|
702
702
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
703
703
|
* See the License for the specific language governing permissions and
|
|
704
704
|
* limitations under the License.
|
|
705
|
-
*/function
|
|
705
|
+
*/function Ey(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:delete",t)})}function ky(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:update",t)})}function Od(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:lookup",t)})}/**
|
|
706
706
|
* @license
|
|
707
707
|
* Copyright 2020 Google LLC
|
|
708
708
|
*
|
|
@@ -717,7 +717,7 @@
|
|
|
717
717
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
718
718
|
* See the License for the specific language governing permissions and
|
|
719
719
|
* limitations under the License.
|
|
720
|
-
*/function
|
|
720
|
+
*/function ki(e){if(e)try{const t=new Date(Number(e));if(!isNaN(t.getTime()))return t.toUTCString()}catch(t){}}function _y(e,t=!1){return k(this,null,function*(){const n=De(e),r=yield n.getIdToken(t),i=Bo(r);oe(i&&i.exp&&i.auth_time&&i.iat,n.auth,"internal-error");const o=typeof i.firebase=="object"?i.firebase:void 0,a=o==null?void 0:o.sign_in_provider;return{claims:i,token:r,authTime:ki(al(i.auth_time)),issuedAtTime:ki(al(i.iat)),expirationTime:ki(al(i.exp)),signInProvider:a||null,signInSecondFactor:(o==null?void 0:o.sign_in_second_factor)||null}})}function al(e){return Number(e)*1e3}function Bo(e){const[t,n,r]=e.split(".");if(t===void 0||n===void 0||r===void 0)return Mo("JWT malformed, contained fewer than 3 sections"),null;try{const i=Gu(n);return i?JSON.parse(i):(Mo("Failed to decode base64 JWT payload"),null)}catch(i){return Mo("Caught error parsing JWT payload as JSON",i==null?void 0:i.toString()),null}}function Rd(e){const t=Bo(e);return oe(t,"internal-error"),oe(typeof t.exp!="undefined","internal-error"),oe(typeof t.iat!="undefined","internal-error"),Number(t.exp)-Number(t.iat)}/**
|
|
721
721
|
* @license
|
|
722
722
|
* Copyright 2020 Google LLC
|
|
723
723
|
*
|
|
@@ -732,7 +732,7 @@
|
|
|
732
732
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
733
733
|
* See the License for the specific language governing permissions and
|
|
734
734
|
* limitations under the License.
|
|
735
|
-
*/function
|
|
735
|
+
*/function kn(e,t,n=!1){return k(this,null,function*(){if(n)return t;try{return yield t}catch(r){throw r instanceof $t&&Py(r)&&e.auth.currentUser===e&&(yield e.auth.signOut()),r}})}function Py({code:e}){return e==="auth/user-disabled"||e==="auth/user-token-expired"}/**
|
|
736
736
|
* @license
|
|
737
737
|
* Copyright 2020 Google LLC
|
|
738
738
|
*
|
|
@@ -747,7 +747,7 @@
|
|
|
747
747
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
748
748
|
* See the License for the specific language governing permissions and
|
|
749
749
|
* limitations under the License.
|
|
750
|
-
*/class
|
|
750
|
+
*/class Dy{constructor(t){this.user=t,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(t){var n;if(t){const r=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),r}else{this.errorBackoff=3e4;const i=((n=this.user.stsTokenManager.expirationTime)!==null&&n!==void 0?n:0)-Date.now()-3e5;return Math.max(0,i)}}schedule(t=!1){if(!this.isRunning)return;const n=this.getInterval(t);this.timerId=setTimeout(()=>k(this,null,function*(){yield this.iteration()}),n)}iteration(){return k(this,null,function*(){try{yield this.user.getIdToken(!0)}catch(t){(t==null?void 0:t.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()})}}/**
|
|
751
751
|
* @license
|
|
752
752
|
* Copyright 2020 Google LLC
|
|
753
753
|
*
|
|
@@ -762,7 +762,7 @@
|
|
|
762
762
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
763
763
|
* See the License for the specific language governing permissions and
|
|
764
764
|
* limitations under the License.
|
|
765
|
-
*/class
|
|
765
|
+
*/class sl{constructor(t,n){this.createdAt=t,this.lastLoginAt=n,this._initializeTime()}_initializeTime(){this.lastSignInTime=ki(this.lastLoginAt),this.creationTime=ki(this.createdAt)}_copy(t){this.createdAt=t.createdAt,this.lastLoginAt=t.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
|
|
766
766
|
* @license
|
|
767
767
|
* Copyright 2019 Google LLC
|
|
768
768
|
*
|
|
@@ -777,7 +777,7 @@
|
|
|
777
777
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
778
778
|
* See the License for the specific language governing permissions and
|
|
779
779
|
* limitations under the License.
|
|
780
|
-
*/function
|
|
780
|
+
*/function _i(e){return k(this,null,function*(){var t;const n=e.auth,r=yield e.getIdToken(),i=yield kn(e,Od(n,{idToken:r}));oe(i==null?void 0:i.users.length,n,"internal-error");const o=i.users[0];e._notifyReloadListener(o);const a=!((t=o.providerUserInfo)===null||t===void 0)&&t.length?Ld(o.providerUserInfo):[],s=Ry(e.providerData,a),l=e.isAnonymous,c=!(e.email&&o.passwordHash)&&!(s!=null&&s.length),d=l?c:!1,f={uid:o.localId,displayName:o.displayName||null,photoURL:o.photoUrl||null,email:o.email||null,emailVerified:o.emailVerified||!1,phoneNumber:o.phoneNumber||null,tenantId:o.tenantId||null,providerData:s,metadata:new sl(o.createdAt,o.lastLoginAt),isAnonymous:d};Object.assign(e,f)})}function Oy(e){return k(this,null,function*(){const t=De(e);yield _i(t),yield t.auth._persistUserIfCurrent(t),t.auth._notifyListenersIfCurrent(t)})}function Ry(e,t){return[...e.filter(r=>!t.some(i=>i.providerId===r.providerId)),...t]}function Ld(e){return e.map(t=>{var{providerId:n}=t,r=tl(t,["providerId"]);return{providerId:n,uid:r.rawId||"",displayName:r.displayName||null,email:r.email||null,phoneNumber:r.phoneNumber||null,photoURL:r.photoUrl||null}})}/**
|
|
781
781
|
* @license
|
|
782
782
|
* Copyright 2020 Google LLC
|
|
783
783
|
*
|
|
@@ -792,7 +792,7 @@
|
|
|
792
792
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
793
793
|
* See the License for the specific language governing permissions and
|
|
794
794
|
* limitations under the License.
|
|
795
|
-
*/function
|
|
795
|
+
*/function Ly(e,t){return k(this,null,function*(){const n=yield kd(e,{},()=>k(this,null,function*(){const r=Tr({grant_type:"refresh_token",refresh_token:t}).slice(1),{tokenApiHost:i,apiKey:o}=e.config,a=_d(e,i,"/v1/token",`key=${o}`),s=yield e._getAdditionalHeaders();return s["Content-Type"]="application/x-www-form-urlencoded",Ed.fetch()(a,{method:"POST",headers:s,body:r})}));return{accessToken:n.access_token,expiresIn:n.expires_in,refreshToken:n.refresh_token}})}function My(e,t){return k(this,null,function*(){return Ke(e,"POST","/v2/accounts:revokeToken",Ye(e,t))})}/**
|
|
796
796
|
* @license
|
|
797
797
|
* Copyright 2020 Google LLC
|
|
798
798
|
*
|
|
@@ -807,7 +807,7 @@
|
|
|
807
807
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
808
808
|
* See the License for the specific language governing permissions and
|
|
809
809
|
* limitations under the License.
|
|
810
|
-
*/class
|
|
810
|
+
*/class Or{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(t){oe(t.idToken,"internal-error"),oe(typeof t.idToken!="undefined","internal-error"),oe(typeof t.refreshToken!="undefined","internal-error");const n="expiresIn"in t&&typeof t.expiresIn!="undefined"?Number(t.expiresIn):Rd(t.idToken);this.updateTokensAndExpiration(t.idToken,t.refreshToken,n)}updateFromIdToken(t){oe(t.length!==0,"internal-error");const n=Rd(t);this.updateTokensAndExpiration(t,null,n)}getToken(t,n=!1){return k(this,null,function*(){return!n&&this.accessToken&&!this.isExpired?this.accessToken:(oe(this.refreshToken,t,"user-token-expired"),this.refreshToken?(yield this.refresh(t,this.refreshToken),this.accessToken):null)})}clearRefreshToken(){this.refreshToken=null}refresh(t,n){return k(this,null,function*(){const{accessToken:r,refreshToken:i,expiresIn:o}=yield Ly(t,n);this.updateTokensAndExpiration(r,i,Number(o))})}updateTokensAndExpiration(t,n,r){this.refreshToken=n||null,this.accessToken=t||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(t,n){const{refreshToken:r,accessToken:i,expirationTime:o}=n,a=new Or;return r&&(oe(typeof r=="string","internal-error",{appName:t}),a.refreshToken=r),i&&(oe(typeof i=="string","internal-error",{appName:t}),a.accessToken=i),o&&(oe(typeof o=="number","internal-error",{appName:t}),a.expirationTime=o),a}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(t){this.accessToken=t.accessToken,this.refreshToken=t.refreshToken,this.expirationTime=t.expirationTime}_clone(){return Object.assign(new Or,this.toJSON())}_performRefresh(){return hn("not implemented")}}/**
|
|
811
811
|
* @license
|
|
812
812
|
* Copyright 2020 Google LLC
|
|
813
813
|
*
|
|
@@ -822,7 +822,7 @@
|
|
|
822
822
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
823
823
|
* See the License for the specific language governing permissions and
|
|
824
824
|
* limitations under the License.
|
|
825
|
-
*/function
|
|
825
|
+
*/function qn(e,t){oe(typeof e=="string"||typeof e=="undefined","internal-error",{appName:t})}class _n{constructor(t){var{uid:n,auth:r,stsTokenManager:i}=t,o=tl(t,["uid","auth","stsTokenManager"]);this.providerId="firebase",this.proactiveRefresh=new Dy(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=n,this.auth=r,this.stsTokenManager=i,this.accessToken=i.accessToken,this.displayName=o.displayName||null,this.email=o.email||null,this.emailVerified=o.emailVerified||!1,this.phoneNumber=o.phoneNumber||null,this.photoURL=o.photoURL||null,this.isAnonymous=o.isAnonymous||!1,this.tenantId=o.tenantId||null,this.providerData=o.providerData?[...o.providerData]:[],this.metadata=new sl(o.createdAt||void 0,o.lastLoginAt||void 0)}getIdToken(t){return k(this,null,function*(){const n=yield kn(this,this.stsTokenManager.getToken(this.auth,t));return oe(n,this.auth,"internal-error"),this.accessToken!==n&&(this.accessToken=n,yield this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),n})}getIdTokenResult(t){return _y(this,t)}reload(){return Oy(this)}_assign(t){this!==t&&(oe(this.uid===t.uid,this.auth,"internal-error"),this.displayName=t.displayName,this.photoURL=t.photoURL,this.email=t.email,this.emailVerified=t.emailVerified,this.phoneNumber=t.phoneNumber,this.isAnonymous=t.isAnonymous,this.tenantId=t.tenantId,this.providerData=t.providerData.map(n=>Object.assign({},n)),this.metadata._copy(t.metadata),this.stsTokenManager._assign(t.stsTokenManager))}_clone(t){const n=new _n(Object.assign(Object.assign({},this),{auth:t,stsTokenManager:this.stsTokenManager._clone()}));return n.metadata._copy(this.metadata),n}_onReload(t){oe(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=t,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(t){this.reloadListener?this.reloadListener(t):this.reloadUserInfo=t}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}_updateTokensIfNecessary(t,n=!1){return k(this,null,function*(){let r=!1;t.idToken&&t.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(t),r=!0),n&&(yield _i(this)),yield this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)})}delete(){return k(this,null,function*(){if(Ge(this.auth.app))return Promise.reject(yt(this.auth));const t=yield this.getIdToken();return yield kn(this,Ey(this.auth,{idToken:t})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()})}toJSON(){return Object.assign(Object.assign({uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(t=>Object.assign({},t)),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId},this.metadata.toJSON()),{apiKey:this.auth.config.apiKey,appName:this.auth.name})}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(t,n){var r,i,o,a,s,l,c,d;const f=(r=n.displayName)!==null&&r!==void 0?r:void 0,h=(i=n.email)!==null&&i!==void 0?i:void 0,p=(o=n.phoneNumber)!==null&&o!==void 0?o:void 0,m=(a=n.photoURL)!==null&&a!==void 0?a:void 0,g=(s=n.tenantId)!==null&&s!==void 0?s:void 0,v=(l=n._redirectEventId)!==null&&l!==void 0?l:void 0,S=(c=n.createdAt)!==null&&c!==void 0?c:void 0,I=(d=n.lastLoginAt)!==null&&d!==void 0?d:void 0,{uid:x,emailVerified:C,isAnonymous:y,providerData:A,stsTokenManager:E}=n;oe(x&&E,t,"internal-error");const _=Or.fromJSON(this.name,E);oe(typeof x=="string",t,"internal-error"),qn(f,t.name),qn(h,t.name),oe(typeof C=="boolean",t,"internal-error"),oe(typeof y=="boolean",t,"internal-error"),qn(p,t.name),qn(m,t.name),qn(g,t.name),qn(v,t.name),qn(S,t.name),qn(I,t.name);const D=new _n({uid:x,auth:t,email:h,emailVerified:C,displayName:f,isAnonymous:y,photoURL:m,phoneNumber:p,tenantId:g,stsTokenManager:_,createdAt:S,lastLoginAt:I});return A&&Array.isArray(A)&&(D.providerData=A.map(G=>Object.assign({},G))),v&&(D._redirectEventId=v),D}static _fromIdTokenResponse(t,n,r=!1){return k(this,null,function*(){const i=new Or;i.updateFromServerResponse(n);const o=new _n({uid:n.localId,auth:t,stsTokenManager:i,isAnonymous:r});return yield _i(o),o})}static _fromGetAccountInfoResponse(t,n,r){return k(this,null,function*(){const i=n.users[0];oe(i.localId!==void 0,"internal-error");const o=i.providerUserInfo!==void 0?Ld(i.providerUserInfo):[],a=!(i.email&&i.passwordHash)&&!(o!=null&&o.length),s=new Or;s.updateFromIdToken(r);const l=new _n({uid:i.localId,auth:t,stsTokenManager:s,isAnonymous:a}),c={uid:i.localId,displayName:i.displayName||null,photoURL:i.photoUrl||null,email:i.email||null,emailVerified:i.emailVerified||!1,phoneNumber:i.phoneNumber||null,tenantId:i.tenantId||null,providerData:o,metadata:new sl(i.createdAt,i.lastLoginAt),isAnonymous:!(i.email&&i.passwordHash)&&!(o!=null&&o.length)};return Object.assign(l,c),l})}}/**
|
|
826
826
|
* @license
|
|
827
827
|
* Copyright 2020 Google LLC
|
|
828
828
|
*
|
|
@@ -837,7 +837,7 @@
|
|
|
837
837
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
838
838
|
* See the License for the specific language governing permissions and
|
|
839
839
|
* limitations under the License.
|
|
840
|
-
*/const
|
|
840
|
+
*/const Md=new Map;function Ut(e){an(e instanceof Function,"Expected a class definition");let t=Md.get(e);return t?(an(t instanceof e,"Instance stored in cache mismatched with class"),t):(t=new e,Md.set(e,t),t)}/**
|
|
841
841
|
* @license
|
|
842
842
|
* Copyright 2019 Google LLC
|
|
843
843
|
*
|
|
@@ -852,7 +852,7 @@
|
|
|
852
852
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
853
853
|
* See the License for the specific language governing permissions and
|
|
854
854
|
* limitations under the License.
|
|
855
|
-
*/class
|
|
855
|
+
*/class Bd{constructor(){this.type="NONE",this.storage={}}_isAvailable(){return k(this,null,function*(){return!0})}_set(t,n){return k(this,null,function*(){this.storage[t]=n})}_get(t){return k(this,null,function*(){const n=this.storage[t];return n===void 0?null:n})}_remove(t){return k(this,null,function*(){delete this.storage[t]})}_addListener(t,n){}_removeListener(t,n){}}Bd.type="NONE";const Rr=Bd;/**
|
|
856
856
|
* @license
|
|
857
857
|
* Copyright 2019 Google LLC
|
|
858
858
|
*
|
|
@@ -867,7 +867,7 @@
|
|
|
867
867
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
868
868
|
* See the License for the specific language governing permissions and
|
|
869
869
|
* limitations under the License.
|
|
870
|
-
*/function
|
|
870
|
+
*/function ur(e,t,n){return`firebase:${e}:${t}:${n}`}class Lr{constructor(t,n,r){this.persistence=t,this.auth=n,this.userKey=r;const{config:i,name:o}=this.auth;this.fullUserKey=ur(this.userKey,i.apiKey,o),this.fullPersistenceKey=ur("persistence",i.apiKey,o),this.boundEventHandler=n._onStorageEvent.bind(n),this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}setCurrentUser(t){return this.persistence._set(this.fullUserKey,t.toJSON())}getCurrentUser(){return k(this,null,function*(){const t=yield this.persistence._get(this.fullUserKey);return t?_n._fromJSON(this.auth,t):null})}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}setPersistence(t){return k(this,null,function*(){if(this.persistence===t)return;const n=yield this.getCurrentUser();if(yield this.removeCurrentUser(),this.persistence=t,n)return this.setCurrentUser(n)})}delete(){this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}static create(t,n,r="authUser"){return k(this,null,function*(){if(!n.length)return new Lr(Ut(Rr),t,r);const i=(yield Promise.all(n.map(c=>k(this,null,function*(){if(yield c._isAvailable())return c})))).filter(c=>c);let o=i[0]||Ut(Rr);const a=ur(r,t.config.apiKey,t.name);let s=null;for(const c of n)try{const d=yield c._get(a);if(d){const f=_n._fromJSON(t,d);c!==o&&(s=f),o=c;break}}catch(d){}const l=i.filter(c=>c._shouldAllowMigration);return!o._shouldAllowMigration||!l.length?new Lr(o,t,r):(o=l[0],s&&(yield o._set(a,s.toJSON())),yield Promise.all(n.map(c=>k(this,null,function*(){if(c!==o)try{yield c._remove(a)}catch(d){}}))),new Lr(o,t,r))})}}/**
|
|
871
871
|
* @license
|
|
872
872
|
* Copyright 2020 Google LLC
|
|
873
873
|
*
|
|
@@ -882,7 +882,7 @@
|
|
|
882
882
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
883
883
|
* See the License for the specific language governing permissions and
|
|
884
884
|
* limitations under the License.
|
|
885
|
-
*/function
|
|
885
|
+
*/function $d(e){const t=e.toLowerCase();if(t.includes("opera/")||t.includes("opr/")||t.includes("opios/"))return"Opera";if(jd(t))return"IEMobile";if(t.includes("msie")||t.includes("trident/"))return"IE";if(t.includes("edge/"))return"Edge";if(Nd(t))return"Firefox";if(t.includes("silk/"))return"Silk";if(Ud(t))return"Blackberry";if(Vd(t))return"Webos";if(Fd(t))return"Safari";if((t.includes("chrome/")||zd(t))&&!t.includes("edge/"))return"Chrome";if(Pi(t))return"Android";{const n=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=e.match(n);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function Nd(e=gt()){return/firefox\//i.test(e)}function Fd(e=gt()){const t=e.toLowerCase();return t.includes("safari/")&&!t.includes("chrome/")&&!t.includes("crios/")&&!t.includes("android")}function zd(e=gt()){return/crios\//i.test(e)}function jd(e=gt()){return/iemobile/i.test(e)}function Pi(e=gt()){return/android/i.test(e)}function Ud(e=gt()){return/blackberry/i.test(e)}function Vd(e=gt()){return/webos/i.test(e)}function Di(e=gt()){return/iphone|ipad|ipod/i.test(e)||/macintosh/i.test(e)&&/mobile/i.test(e)}function By(e=gt()){return/(iPad|iPhone|iPod).*OS 7_\d/i.test(e)||/(iPad|iPhone|iPod).*OS 8_\d/i.test(e)}function $y(e=gt()){var t;return Di(e)&&!!(!((t=window.navigator)===null||t===void 0)&&t.standalone)}function Ny(){return Zu()&&document.documentMode===10}function Hd(e=gt()){return Di(e)||Pi(e)||Vd(e)||Ud(e)||/windows phone/i.test(e)||jd(e)}/**
|
|
886
886
|
* @license
|
|
887
887
|
* Copyright 2020 Google LLC
|
|
888
888
|
*
|
|
@@ -897,7 +897,7 @@
|
|
|
897
897
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
898
898
|
* See the License for the specific language governing permissions and
|
|
899
899
|
* limitations under the License.
|
|
900
|
-
*/function
|
|
900
|
+
*/function Wd(e,t=[]){let n;switch(e){case"Browser":n=$d(gt());break;case"Worker":n=`${$d(gt())}-${e}`;break;default:n=e}const r=t.length?t.join(","):"FirebaseCore-web";return`${n}/JsCore/${cr}/${r}`}/**
|
|
901
901
|
* @license
|
|
902
902
|
* Copyright 2022 Google LLC
|
|
903
903
|
*
|
|
@@ -912,7 +912,7 @@
|
|
|
912
912
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
913
913
|
* See the License for the specific language governing permissions and
|
|
914
914
|
* limitations under the License.
|
|
915
|
-
*/class
|
|
915
|
+
*/class Fy{constructor(t){this.auth=t,this.queue=[]}pushCallback(t,n){const r=o=>new Promise((a,s)=>{try{const l=t(o);a(l)}catch(l){s(l)}});r.onAbort=n,this.queue.push(r);const i=this.queue.length-1;return()=>{this.queue[i]=()=>Promise.resolve()}}runMiddleware(t){return k(this,null,function*(){if(this.auth.currentUser===t)return;const n=[];try{for(const r of this.queue)yield r(t),r.onAbort&&n.push(r.onAbort)}catch(r){n.reverse();for(const i of n)try{i()}catch(o){}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}})}}/**
|
|
916
916
|
* @license
|
|
917
917
|
* Copyright 2023 Google LLC
|
|
918
918
|
*
|
|
@@ -927,7 +927,7 @@
|
|
|
927
927
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
928
928
|
* See the License for the specific language governing permissions and
|
|
929
929
|
* limitations under the License.
|
|
930
|
-
*/function
|
|
930
|
+
*/function zy(n){return k(this,arguments,function*(e,t={}){return Ke(e,"GET","/v2/passwordPolicy",Ye(e,t))})}/**
|
|
931
931
|
* @license
|
|
932
932
|
* Copyright 2023 Google LLC
|
|
933
933
|
*
|
|
@@ -942,7 +942,7 @@
|
|
|
942
942
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
943
943
|
* See the License for the specific language governing permissions and
|
|
944
944
|
* limitations under the License.
|
|
945
|
-
*/const
|
|
945
|
+
*/const jy=6;class Uy{constructor(t){var n,r,i,o;const a=t.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=(n=a.minPasswordLength)!==null&&n!==void 0?n:jy,a.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=a.maxPasswordLength),a.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=a.containsLowercaseCharacter),a.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=a.containsUppercaseCharacter),a.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=a.containsNumericCharacter),a.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=a.containsNonAlphanumericCharacter),this.enforcementState=t.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=(i=(r=t.allowedNonAlphanumericCharacters)===null||r===void 0?void 0:r.join(""))!==null&&i!==void 0?i:"",this.forceUpgradeOnSignin=(o=t.forceUpgradeOnSignin)!==null&&o!==void 0?o:!1,this.schemaVersion=t.schemaVersion}validatePassword(t){var n,r,i,o,a,s;const l={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(t,l),this.validatePasswordCharacterOptions(t,l),l.isValid&&(l.isValid=(n=l.meetsMinPasswordLength)!==null&&n!==void 0?n:!0),l.isValid&&(l.isValid=(r=l.meetsMaxPasswordLength)!==null&&r!==void 0?r:!0),l.isValid&&(l.isValid=(i=l.containsLowercaseLetter)!==null&&i!==void 0?i:!0),l.isValid&&(l.isValid=(o=l.containsUppercaseLetter)!==null&&o!==void 0?o:!0),l.isValid&&(l.isValid=(a=l.containsNumericCharacter)!==null&&a!==void 0?a:!0),l.isValid&&(l.isValid=(s=l.containsNonAlphanumericCharacter)!==null&&s!==void 0?s:!0),l}validatePasswordLengthOptions(t,n){const r=this.customStrengthOptions.minPasswordLength,i=this.customStrengthOptions.maxPasswordLength;r&&(n.meetsMinPasswordLength=t.length>=r),i&&(n.meetsMaxPasswordLength=t.length<=i)}validatePasswordCharacterOptions(t,n){this.updatePasswordCharacterOptionsStatuses(n,!1,!1,!1,!1);let r;for(let i=0;i<t.length;i++)r=t.charAt(i),this.updatePasswordCharacterOptionsStatuses(n,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(t,n,r,i,o){this.customStrengthOptions.containsLowercaseLetter&&(t.containsLowercaseLetter||(t.containsLowercaseLetter=n)),this.customStrengthOptions.containsUppercaseLetter&&(t.containsUppercaseLetter||(t.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(t.containsNumericCharacter||(t.containsNumericCharacter=i)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(t.containsNonAlphanumericCharacter||(t.containsNonAlphanumericCharacter=o))}}/**
|
|
946
946
|
* @license
|
|
947
947
|
* Copyright 2020 Google LLC
|
|
948
948
|
*
|
|
@@ -957,7 +957,7 @@
|
|
|
957
957
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
958
958
|
* See the License for the specific language governing permissions and
|
|
959
959
|
* limitations under the License.
|
|
960
|
-
*/class To{constructor(e,t,i,r){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=i,this.config=r,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Gi(this),this.idTokenSubscription=new Gi(this),this.beforeStateQueue=new wo(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Pi,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=r.sdkClientVersion}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=D(t)),this._initializationPromise=this.queue(()=>o(this,null,function*(){var i,r;if(!this._deleted&&(this.persistenceManager=yield Ne.create(this,e),!this._deleted)){if(!((i=this._popupRedirectResolver)===null||i===void 0)&&i._shouldInitProactively)try{yield this._popupRedirectResolver._initialize(this)}catch(s){}yield this.initializeCurrentUser(t),this.lastNotifiedUid=((r=this.currentUser)===null||r===void 0?void 0:r.uid)||null,!this._deleted&&(this._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){return o(this,null,function*(){if(this._deleted)return;const e=yield this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),yield this.currentUser.getIdToken();return}yield this._updateCurrentUser(e,!0)}})}initializeCurrentUserFromIdToken(e){return o(this,null,function*(){try{const t=yield Li(this,{idToken:e}),i=yield Y._fromGetAccountInfoResponse(this,t,e);yield this.directlySetCurrentUser(i)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),yield this.directlySetCurrentUser(null)}})}initializeCurrentUser(e){return o(this,null,function*(){var t;if(b(this.app)){const a=this.app.settings.authIdToken;return a?new Promise(c=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(a).then(c,c))}):this.directlySetCurrentUser(null)}const i=yield this.assertedPersistence.getCurrentUser();let r=i,s=!1;if(e&&this.config.authDomain){yield this.getOrInitRedirectPersistenceManager();const a=(t=this.redirectUser)===null||t===void 0?void 0:t._redirectEventId,c=r==null?void 0:r._redirectEventId,l=yield this.tryRedirectSignIn(e);(!a||a===c)&&(l!=null&&l.user)&&(r=l.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{yield this.beforeStateQueue.runMiddleware(r)}catch(a){r=i,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(a))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return h(this._popupRedirectResolver,this,"argument-error"),yield this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)})}tryRedirectSignIn(e){return o(this,null,function*(){let t=null;try{t=yield this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch(i){yield this._setRedirectUser(null)}return t})}reloadAndSetCurrentUserOrClear(e){return o(this,null,function*(){try{yield Xe(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)})}useDeviceLanguage(){this.languageCode=Za()}_delete(){return o(this,null,function*(){this._deleted=!0})}updateCurrentUser(e){return o(this,null,function*(){if(b(this.app))return Promise.reject(O(this));const t=e?_(e):null;return t&&h(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))})}_updateCurrentUser(e,t=!1){return o(this,null,function*(){if(!this._deleted)return e&&h(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||(yield this.beforeStateQueue.runMiddleware(e)),this.queue(()=>o(this,null,function*(){yield this.directlySetCurrentUser(e),this.notifyAuthListeners()}))})}signOut(){return o(this,null,function*(){return b(this.app)?Promise.reject(O(this)):(yield this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&(yield this._setRedirectUser(null)),this._updateCurrentUser(null,!0))})}setPersistence(e){return b(this.app)?Promise.reject(O(this)):this.queue(()=>o(this,null,function*(){yield this.assertedPersistence.setPersistence(D(e))}))}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(e){return o(this,null,function*(){this._getPasswordPolicyInternal()||(yield this._updatePasswordPolicy());const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)})}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){return o(this,null,function*(){const e=yield Io(this),t=new Eo(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(e){this._errorFactory=new ue("auth","Firebase",e())}onAuthStateChanged(e,t,i){return this.registerStateListener(this.authStateSubscription,e,t,i)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,i){return this.registerStateListener(this.idTokenSubscription,e,t,i)}authStateReady(){return new Promise((e,t)=>{if(this.currentUser)e();else{const i=this.onAuthStateChanged(()=>{i(),e()},t)}})}revokeAccessToken(e){return o(this,null,function*(){if(this.currentUser){const t=yield this.currentUser.getIdToken(),i={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(i.tenantId=this.tenantId),yield go(this,i)}})}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)===null||e===void 0?void 0:e.toJSON()}}_setRedirectUser(e,t){return o(this,null,function*(){const i=yield this.getOrInitRedirectPersistenceManager(t);return e===null?i.removeCurrentUser():i.setCurrentUser(e)})}getOrInitRedirectPersistenceManager(e){return o(this,null,function*(){if(!this.redirectPersistenceManager){const t=e&&D(e)||this._popupRedirectResolver;h(t,this,"argument-error"),this.redirectPersistenceManager=yield Ne.create(this,[D(t._redirectPersistence)],"redirectUser"),this.redirectUser=yield this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager})}_redirectUserForId(e){return o(this,null,function*(){var t,i;return this._isInitialized&&(yield this.queue(()=>o(this,null,function*(){}))),((t=this._currentUser)===null||t===void 0?void 0:t._redirectEventId)===e?this._currentUser:((i=this.redirectUser)===null||i===void 0?void 0:i._redirectEventId)===e?this.redirectUser:null})}_persistUserIfCurrent(e){return o(this,null,function*(){if(e===this.currentUser)return this.queue(()=>o(this,null,function*(){return this.directlySetCurrentUser(e)}))})}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var e,t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const i=(t=(e=this.currentUser)===null||e===void 0?void 0:e.uid)!==null&&t!==void 0?t:null;this.lastNotifiedUid!==i&&(this.lastNotifiedUid=i,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,i,r){if(this._deleted)return()=>{};const s=typeof t=="function"?t:t.next.bind(t);let a=!1;const c=this._isInitialized?Promise.resolve():this._initializationPromise;if(h(c,this,"internal-error"),c.then(()=>{a||s(this.currentUser)}),typeof t=="function"){const l=e.addObserver(t,i,r);return()=>{a=!0,l()}}else{const l=e.addObserver(t);return()=>{a=!0,l()}}}directlySetCurrentUser(e){return o(this,null,function*(){this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,e?yield this.assertedPersistence.setCurrentUser(e):yield this.assertedPersistence.removeCurrentUser()})}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return h(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=qi(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){return o(this,null,function*(){var e;const t={"X-Client-Version":this.clientVersion};this.app.options.appId&&(t["X-Firebase-gmpid"]=this.app.options.appId);const i=yield(e=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getHeartbeatsHeader();i&&(t["X-Firebase-Client"]=i);const r=yield this._getAppCheckToken();return r&&(t["X-Firebase-AppCheck"]=r),t})}_getAppCheckToken(){return o(this,null,function*(){var e;const t=yield(e=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||e===void 0?void 0:e.getToken();return t!=null&&t.error&&Ya(`Error while retrieving App Check token: ${t.error}`),t==null?void 0:t.token})}}function k(n){return _(n)}class Gi{constructor(e){this.auth=e,this.observer=null,this.addObserver=ii(t=>this.observer=t)}get next(){return h(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
960
|
+
*/class Vy{constructor(t,n,r,i){this.app=t,this.heartbeatServiceProvider=n,this.appCheckServiceProvider=r,this.config=i,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new Gd(this),this.idTokenSubscription=new Gd(this),this.beforeStateQueue=new Fy(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=Ad,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=t.name,this.clientVersion=i.sdkClientVersion}_initializeWithPersistence(t,n){return n&&(this._popupRedirectResolver=Ut(n)),this._initializationPromise=this.queue(()=>k(this,null,function*(){var r,i;if(!this._deleted&&(this.persistenceManager=yield Lr.create(this,t),!this._deleted)){if(!((r=this._popupRedirectResolver)===null||r===void 0)&&r._shouldInitProactively)try{yield this._popupRedirectResolver._initialize(this)}catch(o){}yield this.initializeCurrentUser(n),this.lastNotifiedUid=((i=this.currentUser)===null||i===void 0?void 0:i.uid)||null,!this._deleted&&(this._isInitialized=!0)}})),this._initializationPromise}_onStorageEvent(){return k(this,null,function*(){if(this._deleted)return;const t=yield this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!t)){if(this.currentUser&&t&&this.currentUser.uid===t.uid){this._currentUser._assign(t),yield this.currentUser.getIdToken();return}yield this._updateCurrentUser(t,!0)}})}initializeCurrentUserFromIdToken(t){return k(this,null,function*(){try{const n=yield Od(this,{idToken:t}),r=yield _n._fromGetAccountInfoResponse(this,n,t);yield this.directlySetCurrentUser(r)}catch(n){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",n),yield this.directlySetCurrentUser(null)}})}initializeCurrentUser(t){return k(this,null,function*(){var n;if(Ge(this.app)){const a=this.app.settings.authIdToken;return a?new Promise(s=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(a).then(s,s))}):this.directlySetCurrentUser(null)}const r=yield this.assertedPersistence.getCurrentUser();let i=r,o=!1;if(t&&this.config.authDomain){yield this.getOrInitRedirectPersistenceManager();const a=(n=this.redirectUser)===null||n===void 0?void 0:n._redirectEventId,s=i==null?void 0:i._redirectEventId,l=yield this.tryRedirectSignIn(t);(!a||a===s)&&(l!=null&&l.user)&&(i=l.user,o=!0)}if(!i)return this.directlySetCurrentUser(null);if(!i._redirectEventId){if(o)try{yield this.beforeStateQueue.runMiddleware(i)}catch(a){i=r,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(a))}return i?this.reloadAndSetCurrentUserOrClear(i):this.directlySetCurrentUser(null)}return oe(this._popupRedirectResolver,this,"argument-error"),yield this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===i._redirectEventId?this.directlySetCurrentUser(i):this.reloadAndSetCurrentUserOrClear(i)})}tryRedirectSignIn(t){return k(this,null,function*(){let n=null;try{n=yield this._popupRedirectResolver._completeRedirectFn(this,t,!0)}catch(r){yield this._setRedirectUser(null)}return n})}reloadAndSetCurrentUserOrClear(t){return k(this,null,function*(){try{yield _i(t)}catch(n){if((n==null?void 0:n.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(t)})}useDeviceLanguage(){this.languageCode=yy()}_delete(){return k(this,null,function*(){this._deleted=!0})}updateCurrentUser(t){return k(this,null,function*(){if(Ge(this.app))return Promise.reject(yt(this));const n=t?De(t):null;return n&&oe(n.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(n&&n._clone(this))})}_updateCurrentUser(t,n=!1){return k(this,null,function*(){if(!this._deleted)return t&&oe(this.tenantId===t.tenantId,this,"tenant-id-mismatch"),n||(yield this.beforeStateQueue.runMiddleware(t)),this.queue(()=>k(this,null,function*(){yield this.directlySetCurrentUser(t),this.notifyAuthListeners()}))})}signOut(){return k(this,null,function*(){return Ge(this.app)?Promise.reject(yt(this)):(yield this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&(yield this._setRedirectUser(null)),this._updateCurrentUser(null,!0))})}setPersistence(t){return Ge(this.app)?Promise.reject(yt(this)):this.queue(()=>k(this,null,function*(){yield this.assertedPersistence.setPersistence(Ut(t))}))}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}validatePassword(t){return k(this,null,function*(){this._getPasswordPolicyInternal()||(yield this._updatePasswordPolicy());const n=this._getPasswordPolicyInternal();return n.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):n.validatePassword(t)})}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}_updatePasswordPolicy(){return k(this,null,function*(){const t=yield zy(this),n=new Uy(t);this.tenantId===null?this._projectPasswordPolicy=n:this._tenantPasswordPolicies[this.tenantId]=n})}_getPersistence(){return this.assertedPersistence.persistence.type}_updateErrorMap(t){this._errorFactory=new ar("auth","Firebase",t())}onAuthStateChanged(t,n,r){return this.registerStateListener(this.authStateSubscription,t,n,r)}beforeAuthStateChanged(t,n){return this.beforeStateQueue.pushCallback(t,n)}onIdTokenChanged(t,n,r){return this.registerStateListener(this.idTokenSubscription,t,n,r)}authStateReady(){return new Promise((t,n)=>{if(this.currentUser)t();else{const r=this.onAuthStateChanged(()=>{r(),t()},n)}})}revokeAccessToken(t){return k(this,null,function*(){if(this.currentUser){const n=yield this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:t,idToken:n};this.tenantId!=null&&(r.tenantId=this.tenantId),yield My(this,r)}})}toJSON(){var t;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(t=this._currentUser)===null||t===void 0?void 0:t.toJSON()}}_setRedirectUser(t,n){return k(this,null,function*(){const r=yield this.getOrInitRedirectPersistenceManager(n);return t===null?r.removeCurrentUser():r.setCurrentUser(t)})}getOrInitRedirectPersistenceManager(t){return k(this,null,function*(){if(!this.redirectPersistenceManager){const n=t&&Ut(t)||this._popupRedirectResolver;oe(n,this,"argument-error"),this.redirectPersistenceManager=yield Lr.create(this,[Ut(n._redirectPersistence)],"redirectUser"),this.redirectUser=yield this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager})}_redirectUserForId(t){return k(this,null,function*(){var n,r;return this._isInitialized&&(yield this.queue(()=>k(this,null,function*(){}))),((n=this._currentUser)===null||n===void 0?void 0:n._redirectEventId)===t?this._currentUser:((r=this.redirectUser)===null||r===void 0?void 0:r._redirectEventId)===t?this.redirectUser:null})}_persistUserIfCurrent(t){return k(this,null,function*(){if(t===this.currentUser)return this.queue(()=>k(this,null,function*(){return this.directlySetCurrentUser(t)}))})}_notifyListenersIfCurrent(t){t===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t,n;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const r=(n=(t=this.currentUser)===null||t===void 0?void 0:t.uid)!==null&&n!==void 0?n:null;this.lastNotifiedUid!==r&&(this.lastNotifiedUid=r,this.authStateSubscription.next(this.currentUser))}registerStateListener(t,n,r,i){if(this._deleted)return()=>{};const o=typeof n=="function"?n:n.next.bind(n);let a=!1;const s=this._isInitialized?Promise.resolve():this._initializationPromise;if(oe(s,this,"internal-error"),s.then(()=>{a||o(this.currentUser)}),typeof n=="function"){const l=t.addObserver(n,r,i);return()=>{a=!0,l()}}else{const l=t.addObserver(n);return()=>{a=!0,l()}}}directlySetCurrentUser(t){return k(this,null,function*(){this.currentUser&&this.currentUser!==t&&this._currentUser._stopProactiveRefresh(),t&&this.isProactiveRefreshEnabled&&t._startProactiveRefresh(),this.currentUser=t,t?yield this.assertedPersistence.setCurrentUser(t):yield this.assertedPersistence.removeCurrentUser()})}queue(t){return this.operations=this.operations.then(t,t),this.operations}get assertedPersistence(){return oe(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(t){!t||this.frameworks.includes(t)||(this.frameworks.push(t),this.frameworks.sort(),this.clientVersion=Wd(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}_getAdditionalHeaders(){return k(this,null,function*(){var t;const n={"X-Client-Version":this.clientVersion};this.app.options.appId&&(n["X-Firebase-gmpid"]=this.app.options.appId);const r=yield(t=this.heartbeatServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getHeartbeatsHeader();r&&(n["X-Firebase-Client"]=r);const i=yield this._getAppCheckToken();return i&&(n["X-Firebase-AppCheck"]=i),n})}_getAppCheckToken(){return k(this,null,function*(){var t;const n=yield(t=this.appCheckServiceProvider.getImmediate({optional:!0}))===null||t===void 0?void 0:t.getToken();return n!=null&&n.error&&vy(`Error while retrieving App Check token: ${n.error}`),n==null?void 0:n.token})}}function qe(e){return De(e)}class Gd{constructor(t){this.auth=t,this.observer=null,this.addObserver=nd(n=>this.observer=n)}get next(){return oe(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
|
|
961
961
|
* @license
|
|
962
962
|
* Copyright 2020 Google LLC
|
|
963
963
|
*
|
|
@@ -972,7 +972,7 @@
|
|
|
972
972
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
973
973
|
* See the License for the specific language governing permissions and
|
|
974
974
|
* limitations under the License.
|
|
975
|
-
*/let
|
|
975
|
+
*/let Oi={loadJS(){return k(this,null,function*(){throw new Error("Unable to load external scripts")})},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function Hy(e){Oi=e}function ll(e){return Oi.loadJS(e)}function Wy(){return Oi.recaptchaV2Script}function Gy(){return Oi.recaptchaEnterpriseScript}function Yy(){return Oi.gapiScript}function Yd(e){return`__${e}${Math.floor(Math.random()*1e6)}`}const Ky="recaptcha-enterprise",qy="NO_RECAPTCHA";class Qy{constructor(t){this.type=Ky,this.auth=qe(t)}verify(t="verify",n=!1){return k(this,null,function*(){function r(o){return k(this,null,function*(){if(!n){if(o.tenantId==null&&o._agentRecaptchaConfig!=null)return o._agentRecaptchaConfig.siteKey;if(o.tenantId!=null&&o._tenantRecaptchaConfigs[o.tenantId]!==void 0)return o._tenantRecaptchaConfigs[o.tenantId].siteKey}return new Promise((a,s)=>k(this,null,function*(){Ty(o,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(l=>{if(l.recaptchaKey===void 0)s(new Error("recaptcha Enterprise site key undefined"));else{const c=new Sy(l);return o.tenantId==null?o._agentRecaptchaConfig=c:o._tenantRecaptchaConfigs[o.tenantId]=c,a(c.siteKey)}}).catch(l=>{s(l)})}))})}function i(o,a,s){const l=window.grecaptcha;Dd(l)?l.enterprise.ready(()=>{l.enterprise.execute(o,{action:t}).then(c=>{a(c)}).catch(()=>{a(qy)})}):s(Error("No reCAPTCHA enterprise script loaded."))}return new Promise((o,a)=>{r(this.auth).then(s=>{if(!n&&Dd(window.grecaptcha))i(s,o,a);else{if(typeof window=="undefined"){a(new Error("RecaptchaVerifier is only supported in browser"));return}let l=Gy();l.length!==0&&(l+=s),ll(l).then(()=>{i(s,o,a)}).catch(c=>{a(c)})}}).catch(s=>{a(s)})})})}}function Kd(e,t,n,r=!1){return k(this,null,function*(){const i=new Qy(e);let o;try{o=yield i.verify(n)}catch(s){o=yield i.verify(n,!0)}const a=Object.assign({},t);return r?Object.assign(a,{captchaResp:o}):Object.assign(a,{captchaResponse:o}),Object.assign(a,{clientType:"CLIENT_TYPE_WEB"}),Object.assign(a,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),a})}function Ri(e,t,n,r){return k(this,null,function*(){var i;if(!((i=e._getRecaptchaConfig())===null||i===void 0)&&i.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=yield Kd(e,t,n,n==="getOobCode");return r(e,o)}else return r(e,t).catch(o=>k(this,null,function*(){if(o.code==="auth/missing-recaptcha-token"){console.log(`${n} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const a=yield Kd(e,t,n,n==="getOobCode");return r(e,a)}else return Promise.reject(o)}))})}/**
|
|
976
976
|
* @license
|
|
977
977
|
* Copyright 2020 Google LLC
|
|
978
978
|
*
|
|
@@ -987,7 +987,7 @@
|
|
|
987
987
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
988
988
|
* See the License for the specific language governing permissions and
|
|
989
989
|
* limitations under the License.
|
|
990
|
-
*/function
|
|
990
|
+
*/function Jy(e,t){const n=Ro(e,"auth");if(n.isInitialized()){const i=n.getImmediate(),o=n.getOptions();if(Do(o,t!=null?t:{}))return i;bt(i,"already-initialized")}return n.initialize({options:t})}function Xy(e,t){const n=(t==null?void 0:t.persistence)||[],r=(Array.isArray(n)?n:[n]).map(Ut);t!=null&&t.errorMap&&e._updateErrorMap(t.errorMap),e._initializeWithPersistence(r,t==null?void 0:t.popupRedirectResolver)}function cl(e,t,n){const r=qe(e);oe(r._canInitEmulator,r,"emulator-config-failed"),oe(/^https?:\/\//.test(t),r,"invalid-emulator-scheme");const i=!!(n!=null&&n.disableWarnings),o=qd(t),{host:a,port:s}=Zy(t),l=s===null?"":`:${s}`;r.config.emulator={url:`${o}//${a}${l}/`},r.settings.appVerificationDisabledForTesting=!0,r.emulatorConfig=Object.freeze({host:a,port:s,protocol:o.replace(":",""),options:Object.freeze({disableWarnings:i})}),i||ex()}function qd(e){const t=e.indexOf(":");return t<0?"":e.substr(0,t+1)}function Zy(e){const t=qd(e),n=/(\/\/)?([^?#/]+)/.exec(e.substr(t.length));if(!n)return{host:"",port:null};const r=n[2].split("@").pop()||"",i=/^(\[[^\]]+\])(:|$)/.exec(r);if(i){const o=i[1];return{host:o,port:Qd(r.substr(o.length+1))}}else{const[o,a]=r.split(":");return{host:o,port:Qd(a)}}}function Qd(e){if(!e)return null;const t=Number(e);return isNaN(t)?null:t}function ex(){function e(){const t=document.createElement("p"),n=t.style;t.innerText="Running in emulator mode. Do not use with production credentials.",n.position="fixed",n.width="100%",n.backgroundColor="#ffffff",n.border=".1em solid #000000",n.color="#b50000",n.bottom="0px",n.left="0px",n.margin="0px",n.zIndex="10000",n.textAlign="center",t.classList.add("firebase-emulator-warning"),document.body.appendChild(t)}typeof console!="undefined"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only. Do not use with production credentials."),typeof window!="undefined"&&typeof document!="undefined"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",e):e())}/**
|
|
991
991
|
* @license
|
|
992
992
|
* Copyright 2020 Google LLC
|
|
993
993
|
*
|
|
@@ -1002,7 +1002,7 @@
|
|
|
1002
1002
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1003
1003
|
* See the License for the specific language governing permissions and
|
|
1004
1004
|
* limitations under the License.
|
|
1005
|
-
*/class
|
|
1005
|
+
*/class Mr{constructor(t,n){this.providerId=t,this.signInMethod=n}toJSON(){return hn("not implemented")}_getIdTokenResponse(t){return hn("not implemented")}_linkToIdToken(t,n){return hn("not implemented")}_getReauthenticationResolver(t){return hn("not implemented")}}/**
|
|
1006
1006
|
* @license
|
|
1007
1007
|
* Copyright 2020 Google LLC
|
|
1008
1008
|
*
|
|
@@ -1017,7 +1017,7 @@
|
|
|
1017
1017
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1018
1018
|
* See the License for the specific language governing permissions and
|
|
1019
1019
|
* limitations under the License.
|
|
1020
|
-
*/function
|
|
1020
|
+
*/function Jd(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:resetPassword",Ye(e,t))})}function tx(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:update",t)})}function nx(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:signUp",t)})}function rx(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:update",Ye(e,t))})}/**
|
|
1021
1021
|
* @license
|
|
1022
1022
|
* Copyright 2020 Google LLC
|
|
1023
1023
|
*
|
|
@@ -1032,7 +1032,7 @@
|
|
|
1032
1032
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1033
1033
|
* See the License for the specific language governing permissions and
|
|
1034
1034
|
* limitations under the License.
|
|
1035
|
-
*/function
|
|
1035
|
+
*/function ix(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signInWithPassword",Ye(e,t))})}function $o(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:sendOobCode",Ye(e,t))})}function ox(e,t){return k(this,null,function*(){return $o(e,t)})}function ax(e,t){return k(this,null,function*(){return $o(e,t)})}function sx(e,t){return k(this,null,function*(){return $o(e,t)})}function lx(e,t){return k(this,null,function*(){return $o(e,t)})}/**
|
|
1036
1036
|
* @license
|
|
1037
1037
|
* Copyright 2020 Google LLC
|
|
1038
1038
|
*
|
|
@@ -1047,7 +1047,7 @@
|
|
|
1047
1047
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1048
1048
|
* See the License for the specific language governing permissions and
|
|
1049
1049
|
* limitations under the License.
|
|
1050
|
-
*/function
|
|
1050
|
+
*/function cx(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signInWithEmailLink",Ye(e,t))})}function ux(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signInWithEmailLink",Ye(e,t))})}/**
|
|
1051
1051
|
* @license
|
|
1052
1052
|
* Copyright 2020 Google LLC
|
|
1053
1053
|
*
|
|
@@ -1062,7 +1062,7 @@
|
|
|
1062
1062
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1063
1063
|
* See the License for the specific language governing permissions and
|
|
1064
1064
|
* limitations under the License.
|
|
1065
|
-
*/class
|
|
1065
|
+
*/class Li extends Mr{constructor(t,n,r,i=null){super("password",r),this._email=t,this._password=n,this._tenantId=i}static _fromEmailAndPassword(t,n){return new Li(t,n,"password")}static _fromEmailAndCode(t,n,r=null){return new Li(t,n,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t;if(n!=null&&n.email&&(n!=null&&n.password)){if(n.signInMethod==="password")return this._fromEmailAndPassword(n.email,n.password);if(n.signInMethod==="emailLink")return this._fromEmailAndCode(n.email,n.password,n.tenantId)}return null}_getIdTokenResponse(t){return k(this,null,function*(){switch(this.signInMethod){case"password":const n={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Ri(t,n,"signInWithPassword",ix);case"emailLink":return cx(t,{email:this._email,oobCode:this._password});default:bt(t,"internal-error")}})}_linkToIdToken(t,n){return k(this,null,function*(){switch(this.signInMethod){case"password":const r={idToken:n,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return Ri(t,r,"signUpPassword",nx);case"emailLink":return ux(t,{idToken:n,email:this._email,oobCode:this._password});default:bt(t,"internal-error")}})}_getReauthenticationResolver(t){return this._getIdTokenResponse(t)}}/**
|
|
1066
1066
|
* @license
|
|
1067
1067
|
* Copyright 2020 Google LLC
|
|
1068
1068
|
*
|
|
@@ -1077,7 +1077,7 @@
|
|
|
1077
1077
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1078
1078
|
* See the License for the specific language governing permissions and
|
|
1079
1079
|
* limitations under the License.
|
|
1080
|
-
*/function
|
|
1080
|
+
*/function Pn(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signInWithIdp",Ye(e,t))})}/**
|
|
1081
1081
|
* @license
|
|
1082
1082
|
* Copyright 2020 Google LLC
|
|
1083
1083
|
*
|
|
@@ -1092,7 +1092,7 @@
|
|
|
1092
1092
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1093
1093
|
* See the License for the specific language governing permissions and
|
|
1094
1094
|
* limitations under the License.
|
|
1095
|
-
*/const
|
|
1095
|
+
*/const dx="http://localhost";class pn extends Mr{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(t){const n=new pn(t.providerId,t.signInMethod);return t.idToken||t.accessToken?(t.idToken&&(n.idToken=t.idToken),t.accessToken&&(n.accessToken=t.accessToken),t.nonce&&!t.pendingToken&&(n.nonce=t.nonce),t.pendingToken&&(n.pendingToken=t.pendingToken)):t.oauthToken&&t.oauthTokenSecret?(n.accessToken=t.oauthToken,n.secret=t.oauthTokenSecret):bt("argument-error"),n}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,nonce:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:i}=n,o=tl(n,["providerId","signInMethod"]);if(!r||!i)return null;const a=new pn(r,i);return a.idToken=o.idToken||void 0,a.accessToken=o.accessToken||void 0,a.secret=o.secret,a.nonce=o.nonce,a.pendingToken=o.pendingToken||null,a}_getIdTokenResponse(t){const n=this.buildRequest();return Pn(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Pn(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Pn(t,n)}buildRequest(){const t={requestUri:dx,returnSecureToken:!0};if(this.pendingToken)t.pendingToken=this.pendingToken;else{const n={};this.idToken&&(n.id_token=this.idToken),this.accessToken&&(n.access_token=this.accessToken),this.secret&&(n.oauth_token_secret=this.secret),n.providerId=this.providerId,this.nonce&&!this.pendingToken&&(n.nonce=this.nonce),t.postBody=Tr(n)}return t}}/**
|
|
1096
1096
|
* @license
|
|
1097
1097
|
* Copyright 2020 Google LLC
|
|
1098
1098
|
*
|
|
@@ -1107,7 +1107,7 @@
|
|
|
1107
1107
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1108
1108
|
* See the License for the specific language governing permissions and
|
|
1109
1109
|
* limitations under the License.
|
|
1110
|
-
*/function
|
|
1110
|
+
*/function fx(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:sendVerificationCode",Ye(e,t))})}function hx(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signInWithPhoneNumber",Ye(e,t))})}function px(e,t){return k(this,null,function*(){const n=yield En(e,"POST","/v1/accounts:signInWithPhoneNumber",Ye(e,t));if(n.temporaryProof)throw Ei(e,"account-exists-with-different-credential",n);return n})}const gx={USER_NOT_FOUND:"user-not-found"};function mx(e,t){return k(this,null,function*(){const n=Object.assign(Object.assign({},t),{operation:"REAUTH"});return En(e,"POST","/v1/accounts:signInWithPhoneNumber",Ye(e,n),gx)})}/**
|
|
1111
1111
|
* @license
|
|
1112
1112
|
* Copyright 2020 Google LLC
|
|
1113
1113
|
*
|
|
@@ -1122,7 +1122,7 @@
|
|
|
1122
1122
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1123
1123
|
* See the License for the specific language governing permissions and
|
|
1124
1124
|
* limitations under the License.
|
|
1125
|
-
*/class
|
|
1125
|
+
*/class dr extends Mr{constructor(t){super("phone","phone"),this.params=t}static _fromVerification(t,n){return new dr({verificationId:t,verificationCode:n})}static _fromTokenResponse(t,n){return new dr({phoneNumber:t,temporaryProof:n})}_getIdTokenResponse(t){return hx(t,this._makeVerificationRequest())}_linkToIdToken(t,n){return px(t,Object.assign({idToken:n},this._makeVerificationRequest()))}_getReauthenticationResolver(t){return mx(t,this._makeVerificationRequest())}_makeVerificationRequest(){const{temporaryProof:t,phoneNumber:n,verificationId:r,verificationCode:i}=this.params;return t&&n?{temporaryProof:t,phoneNumber:n}:{sessionInfo:r,code:i}}toJSON(){const t={providerId:this.providerId};return this.params.phoneNumber&&(t.phoneNumber=this.params.phoneNumber),this.params.temporaryProof&&(t.temporaryProof=this.params.temporaryProof),this.params.verificationCode&&(t.verificationCode=this.params.verificationCode),this.params.verificationId&&(t.verificationId=this.params.verificationId),t}static fromJSON(t){typeof t=="string"&&(t=JSON.parse(t));const{verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:o}=t;return!r&&!n&&!i&&!o?null:new dr({verificationId:n,verificationCode:r,phoneNumber:i,temporaryProof:o})}}/**
|
|
1126
1126
|
* @license
|
|
1127
1127
|
* Copyright 2020 Google LLC
|
|
1128
1128
|
*
|
|
@@ -1137,7 +1137,7 @@
|
|
|
1137
1137
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1138
1138
|
* See the License for the specific language governing permissions and
|
|
1139
1139
|
* limitations under the License.
|
|
1140
|
-
*/function
|
|
1140
|
+
*/function vx(e){switch(e){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function bx(e){const t=Er(Ci(e)).link,n=t?Er(Ci(t)).deep_link_id:null,r=Er(Ci(e)).deep_link_id;return(r?Er(Ci(r)).link:null)||r||n||t||e}class No{constructor(t){var n,r,i,o,a,s;const l=Er(Ci(t)),c=(n=l.apiKey)!==null&&n!==void 0?n:null,d=(r=l.oobCode)!==null&&r!==void 0?r:null,f=vx((i=l.mode)!==null&&i!==void 0?i:null);oe(c&&d&&f,"argument-error"),this.apiKey=c,this.operation=f,this.code=d,this.continueUrl=(o=l.continueUrl)!==null&&o!==void 0?o:null,this.languageCode=(a=l.languageCode)!==null&&a!==void 0?a:null,this.tenantId=(s=l.tenantId)!==null&&s!==void 0?s:null}static parseLink(t){const n=bx(t);try{return new No(n)}catch(r){return null}}}/**
|
|
1141
1141
|
* @license
|
|
1142
1142
|
* Copyright 2020 Google LLC
|
|
1143
1143
|
*
|
|
@@ -1152,7 +1152,7 @@
|
|
|
1152
1152
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1153
1153
|
* See the License for the specific language governing permissions and
|
|
1154
1154
|
* limitations under the License.
|
|
1155
|
-
*/class
|
|
1155
|
+
*/class Qn{constructor(){this.providerId=Qn.PROVIDER_ID}static credential(t,n){return Li._fromEmailAndPassword(t,n)}static credentialWithLink(t,n){const r=No.parseLink(n);return oe(r,"argument-error"),Li._fromEmailAndCode(t,r.code,r.tenantId)}}Qn.PROVIDER_ID="password",Qn.EMAIL_PASSWORD_SIGN_IN_METHOD="password",Qn.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
|
|
1156
1156
|
* @license
|
|
1157
1157
|
* Copyright 2020 Google LLC
|
|
1158
1158
|
*
|
|
@@ -1167,7 +1167,7 @@
|
|
|
1167
1167
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1168
1168
|
* See the License for the specific language governing permissions and
|
|
1169
1169
|
* limitations under the License.
|
|
1170
|
-
*/class
|
|
1170
|
+
*/class Dn{constructor(t){this.providerId=t,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(t){this.defaultLanguageCode=t}setCustomParameters(t){return this.customParameters=t,this}getCustomParameters(){return this.customParameters}}/**
|
|
1171
1171
|
* @license
|
|
1172
1172
|
* Copyright 2019 Google LLC
|
|
1173
1173
|
*
|
|
@@ -1182,7 +1182,7 @@
|
|
|
1182
1182
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1183
1183
|
* See the License for the specific language governing permissions and
|
|
1184
1184
|
* limitations under the License.
|
|
1185
|
-
*/class
|
|
1185
|
+
*/class Br extends Dn{constructor(){super(...arguments),this.scopes=[]}addScope(t){return this.scopes.includes(t)||this.scopes.push(t),this}getScopes(){return[...this.scopes]}}class $r extends Br{static credentialFromJSON(t){const n=typeof t=="string"?JSON.parse(t):t;return oe("providerId"in n&&"signInMethod"in n,"argument-error"),pn._fromParams(n)}credential(t){return this._credential(Object.assign(Object.assign({},t),{nonce:t.rawNonce}))}_credential(t){return oe(t.idToken||t.accessToken,"argument-error"),pn._fromParams(Object.assign(Object.assign({},t),{providerId:this.providerId,signInMethod:this.providerId}))}static credentialFromResult(t){return $r.oauthCredentialFromTaggedObject(t)}static credentialFromError(t){return $r.oauthCredentialFromTaggedObject(t.customData||{})}static oauthCredentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r,oauthTokenSecret:i,pendingToken:o,nonce:a,providerId:s}=t;if(!r&&!i&&!n&&!o||!s)return null;try{return new $r(s)._credential({idToken:n,accessToken:r,nonce:a,pendingToken:o})}catch(l){return null}}}/**
|
|
1186
1186
|
* @license
|
|
1187
1187
|
* Copyright 2020 Google LLC
|
|
1188
1188
|
*
|
|
@@ -1197,7 +1197,7 @@
|
|
|
1197
1197
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1198
1198
|
* See the License for the specific language governing permissions and
|
|
1199
1199
|
* limitations under the License.
|
|
1200
|
-
*/class
|
|
1200
|
+
*/class gn extends Br{constructor(){super("facebook.com")}static credential(t){return pn._fromParams({providerId:gn.PROVIDER_ID,signInMethod:gn.FACEBOOK_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return gn.credentialFromTaggedObject(t)}static credentialFromError(t){return gn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return gn.credential(t.oauthAccessToken)}catch(n){return null}}}gn.FACEBOOK_SIGN_IN_METHOD="facebook.com",gn.PROVIDER_ID="facebook.com";/**
|
|
1201
1201
|
* @license
|
|
1202
1202
|
* Copyright 2020 Google LLC
|
|
1203
1203
|
*
|
|
@@ -1212,7 +1212,7 @@
|
|
|
1212
1212
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1213
1213
|
* See the License for the specific language governing permissions and
|
|
1214
1214
|
* limitations under the License.
|
|
1215
|
-
*/class
|
|
1215
|
+
*/class mn extends Br{constructor(){super("google.com"),this.addScope("profile")}static credential(t,n){return pn._fromParams({providerId:mn.PROVIDER_ID,signInMethod:mn.GOOGLE_SIGN_IN_METHOD,idToken:t,accessToken:n})}static credentialFromResult(t){return mn.credentialFromTaggedObject(t)}static credentialFromError(t){return mn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthIdToken:n,oauthAccessToken:r}=t;if(!n&&!r)return null;try{return mn.credential(n,r)}catch(i){return null}}}mn.GOOGLE_SIGN_IN_METHOD="google.com",mn.PROVIDER_ID="google.com";/**
|
|
1216
1216
|
* @license
|
|
1217
1217
|
* Copyright 2020 Google LLC
|
|
1218
1218
|
*
|
|
@@ -1227,7 +1227,7 @@
|
|
|
1227
1227
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1228
1228
|
* See the License for the specific language governing permissions and
|
|
1229
1229
|
* limitations under the License.
|
|
1230
|
-
*/class
|
|
1230
|
+
*/class vn extends Br{constructor(){super("github.com")}static credential(t){return pn._fromParams({providerId:vn.PROVIDER_ID,signInMethod:vn.GITHUB_SIGN_IN_METHOD,accessToken:t})}static credentialFromResult(t){return vn.credentialFromTaggedObject(t)}static credentialFromError(t){return vn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t||!("oauthAccessToken"in t)||!t.oauthAccessToken)return null;try{return vn.credential(t.oauthAccessToken)}catch(n){return null}}}vn.GITHUB_SIGN_IN_METHOD="github.com",vn.PROVIDER_ID="github.com";/**
|
|
1231
1231
|
* @license
|
|
1232
1232
|
* Copyright 2020 Google LLC
|
|
1233
1233
|
*
|
|
@@ -1242,7 +1242,7 @@
|
|
|
1242
1242
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1243
1243
|
* See the License for the specific language governing permissions and
|
|
1244
1244
|
* limitations under the License.
|
|
1245
|
-
*/const
|
|
1245
|
+
*/const yx="http://localhost";class Nr extends Mr{constructor(t,n){super(t,t),this.pendingToken=n}_getIdTokenResponse(t){const n=this.buildRequest();return Pn(t,n)}_linkToIdToken(t,n){const r=this.buildRequest();return r.idToken=n,Pn(t,r)}_getReauthenticationResolver(t){const n=this.buildRequest();return n.autoCreate=!1,Pn(t,n)}toJSON(){return{signInMethod:this.signInMethod,providerId:this.providerId,pendingToken:this.pendingToken}}static fromJSON(t){const n=typeof t=="string"?JSON.parse(t):t,{providerId:r,signInMethod:i,pendingToken:o}=n;return!r||!i||!o||r!==i?null:new Nr(r,o)}static _create(t,n){return new Nr(t,n)}buildRequest(){return{requestUri:yx,returnSecureToken:!0,pendingToken:this.pendingToken}}}/**
|
|
1246
1246
|
* @license
|
|
1247
1247
|
* Copyright 2020 Google LLC
|
|
1248
1248
|
*
|
|
@@ -1257,7 +1257,7 @@
|
|
|
1257
1257
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1258
1258
|
* See the License for the specific language governing permissions and
|
|
1259
1259
|
* limitations under the License.
|
|
1260
|
-
*/const
|
|
1260
|
+
*/const xx="saml.";class Fo extends Dn{constructor(t){oe(t.startsWith(xx),"argument-error"),super(t)}static credentialFromResult(t){return Fo.samlCredentialFromTaggedObject(t)}static credentialFromError(t){return Fo.samlCredentialFromTaggedObject(t.customData||{})}static credentialFromJSON(t){const n=Nr.fromJSON(t);return oe(n,"argument-error"),n}static samlCredentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{pendingToken:n,providerId:r}=t;if(!n||!r)return null;try{return Nr._create(r,n)}catch(i){return null}}}/**
|
|
1261
1261
|
* @license
|
|
1262
1262
|
* Copyright 2020 Google LLC
|
|
1263
1263
|
*
|
|
@@ -1272,7 +1272,7 @@
|
|
|
1272
1272
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1273
1273
|
* See the License for the specific language governing permissions and
|
|
1274
1274
|
* limitations under the License.
|
|
1275
|
-
*/class
|
|
1275
|
+
*/class bn extends Br{constructor(){super("twitter.com")}static credential(t,n){return pn._fromParams({providerId:bn.PROVIDER_ID,signInMethod:bn.TWITTER_SIGN_IN_METHOD,oauthToken:t,oauthTokenSecret:n})}static credentialFromResult(t){return bn.credentialFromTaggedObject(t)}static credentialFromError(t){return bn.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{oauthAccessToken:n,oauthTokenSecret:r}=t;if(!n||!r)return null;try{return bn.credential(n,r)}catch(i){return null}}}bn.TWITTER_SIGN_IN_METHOD="twitter.com",bn.PROVIDER_ID="twitter.com";/**
|
|
1276
1276
|
* @license
|
|
1277
1277
|
* Copyright 2020 Google LLC
|
|
1278
1278
|
*
|
|
@@ -1287,7 +1287,7 @@
|
|
|
1287
1287
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1288
1288
|
* See the License for the specific language governing permissions and
|
|
1289
1289
|
* limitations under the License.
|
|
1290
|
-
*/function
|
|
1290
|
+
*/function Xd(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signUp",Ye(e,t))})}/**
|
|
1291
1291
|
* @license
|
|
1292
1292
|
* Copyright 2020 Google LLC
|
|
1293
1293
|
*
|
|
@@ -1302,7 +1302,7 @@
|
|
|
1302
1302
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1303
1303
|
* See the License for the specific language governing permissions and
|
|
1304
1304
|
* limitations under the License.
|
|
1305
|
-
*/class
|
|
1305
|
+
*/class Jt{constructor(t){this.user=t.user,this.providerId=t.providerId,this._tokenResponse=t._tokenResponse,this.operationType=t.operationType}static _fromIdTokenResponse(t,n,r,i=!1){return k(this,null,function*(){const o=yield _n._fromIdTokenResponse(t,r,i),a=Zd(r);return new Jt({user:o,providerId:a,_tokenResponse:r,operationType:n})})}static _forOperation(t,n,r){return k(this,null,function*(){yield t._updateTokensIfNecessary(r,!0);const i=Zd(r);return new Jt({user:t,providerId:i,_tokenResponse:r,operationType:n})})}}function Zd(e){return e.providerId?e.providerId:"phoneNumber"in e?"phone":null}/**
|
|
1306
1306
|
* @license
|
|
1307
1307
|
* Copyright 2020 Google LLC
|
|
1308
1308
|
*
|
|
@@ -1317,7 +1317,7 @@
|
|
|
1317
1317
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1318
1318
|
* See the License for the specific language governing permissions and
|
|
1319
1319
|
* limitations under the License.
|
|
1320
|
-
*/function
|
|
1320
|
+
*/function Cx(e){return k(this,null,function*(){var t;if(Ge(e.app))return Promise.reject(yt(e));const n=qe(e);if(yield n._initializationPromise,!((t=n.currentUser)===null||t===void 0)&&t.isAnonymous)return new Jt({user:n.currentUser,providerId:null,operationType:"signIn"});const r=yield Xd(n,{returnSecureToken:!0}),i=yield Jt._fromIdTokenResponse(n,"signIn",r,!0);return yield n._updateCurrentUser(i.user),i})}/**
|
|
1321
1321
|
* @license
|
|
1322
1322
|
* Copyright 2020 Google LLC
|
|
1323
1323
|
*
|
|
@@ -1332,7 +1332,7 @@
|
|
|
1332
1332
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1333
1333
|
* See the License for the specific language governing permissions and
|
|
1334
1334
|
* limitations under the License.
|
|
1335
|
-
*/class
|
|
1335
|
+
*/class zo extends $t{constructor(t,n,r,i){var o;super(n.code,n.message),this.operationType=r,this.user=i,Object.setPrototypeOf(this,zo.prototype),this.customData={appName:t.name,tenantId:(o=t.tenantId)!==null&&o!==void 0?o:void 0,_serverResponse:n.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(t,n,r,i){return new zo(t,n,r,i)}}function ef(e,t,n,r){return(t==="reauthenticate"?n._getReauthenticationResolver(e):n._getIdTokenResponse(e)).catch(o=>{throw o.code==="auth/multi-factor-auth-required"?zo._fromErrorAndOperation(e,o,t,r):o})}/**
|
|
1336
1336
|
* @license
|
|
1337
1337
|
* Copyright 2020 Google LLC
|
|
1338
1338
|
*
|
|
@@ -1347,7 +1347,7 @@
|
|
|
1347
1347
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1348
1348
|
* See the License for the specific language governing permissions and
|
|
1349
1349
|
* limitations under the License.
|
|
1350
|
-
*/function
|
|
1350
|
+
*/function tf(e){return new Set(e.map(({providerId:t})=>t).filter(t=>!!t))}/**
|
|
1351
1351
|
* @license
|
|
1352
1352
|
* Copyright 2019 Google LLC
|
|
1353
1353
|
*
|
|
@@ -1362,7 +1362,7 @@
|
|
|
1362
1362
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1363
1363
|
* See the License for the specific language governing permissions and
|
|
1364
1364
|
* limitations under the License.
|
|
1365
|
-
*/function
|
|
1365
|
+
*/function wx(e,t){return k(this,null,function*(){const n=De(e);yield jo(!0,n,t);const{providerUserInfo:r}=yield ky(n.auth,{idToken:yield n.getIdToken(),deleteProvider:[t]}),i=tf(r||[]);return n.providerData=n.providerData.filter(o=>i.has(o.providerId)),i.has("phone")||(n.phoneNumber=null),yield n.auth._persistUserIfCurrent(n),n})}function ul(e,t,n=!1){return k(this,null,function*(){const r=yield kn(e,t._linkToIdToken(e.auth,yield e.getIdToken()),n);return Jt._forOperation(e,"link",r)})}function jo(e,t,n){return k(this,null,function*(){yield _i(t);const r=tf(t.providerData),i=e===!1?"provider-already-linked":"no-such-provider";oe(r.has(n)===e,t.auth,i)})}/**
|
|
1366
1366
|
* @license
|
|
1367
1367
|
* Copyright 2019 Google LLC
|
|
1368
1368
|
*
|
|
@@ -1377,7 +1377,7 @@
|
|
|
1377
1377
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1378
1378
|
* See the License for the specific language governing permissions and
|
|
1379
1379
|
* limitations under the License.
|
|
1380
|
-
*/function
|
|
1380
|
+
*/function nf(e,t,n=!1){return k(this,null,function*(){const{auth:r}=e;if(Ge(r.app))return Promise.reject(yt(r));const i="reauthenticate";try{const o=yield kn(e,ef(r,i,t,e),n);oe(o.idToken,r,"internal-error");const a=Bo(o.idToken);oe(a,r,"internal-error");const{sub:s}=a;return oe(e.uid===s,r,"user-mismatch"),Jt._forOperation(e,i,o)}catch(o){throw(o==null?void 0:o.code)==="auth/user-not-found"&&bt(r,"user-mismatch"),o}})}/**
|
|
1381
1381
|
* @license
|
|
1382
1382
|
* Copyright 2020 Google LLC
|
|
1383
1383
|
*
|
|
@@ -1392,7 +1392,7 @@
|
|
|
1392
1392
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1393
1393
|
* See the License for the specific language governing permissions and
|
|
1394
1394
|
* limitations under the License.
|
|
1395
|
-
*/function
|
|
1395
|
+
*/function rf(e,t,n=!1){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const r="signIn",i=yield ef(e,r,t),o=yield Jt._fromIdTokenResponse(e,r,i);return n||(yield e._updateCurrentUser(o.user)),o})}function Uo(e,t){return k(this,null,function*(){return rf(qe(e),t)})}function of(e,t){return k(this,null,function*(){const n=De(e);return yield jo(!1,n,t.providerId),ul(n,t)})}function af(e,t){return k(this,null,function*(){return nf(De(e),t)})}/**
|
|
1396
1396
|
* @license
|
|
1397
1397
|
* Copyright 2020 Google LLC
|
|
1398
1398
|
*
|
|
@@ -1407,7 +1407,7 @@
|
|
|
1407
1407
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1408
1408
|
* See the License for the specific language governing permissions and
|
|
1409
1409
|
* limitations under the License.
|
|
1410
|
-
*/function
|
|
1410
|
+
*/function Ix(e,t){return k(this,null,function*(){return En(e,"POST","/v1/accounts:signInWithCustomToken",Ye(e,t))})}/**
|
|
1411
1411
|
* @license
|
|
1412
1412
|
* Copyright 2020 Google LLC
|
|
1413
1413
|
*
|
|
@@ -1422,7 +1422,7 @@
|
|
|
1422
1422
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1423
1423
|
* See the License for the specific language governing permissions and
|
|
1424
1424
|
* limitations under the License.
|
|
1425
|
-
*/function
|
|
1425
|
+
*/function Sx(e,t){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const n=qe(e),r=yield Ix(n,{token:t,returnSecureToken:!0}),i=yield Jt._fromIdTokenResponse(n,"signIn",r);return yield n._updateCurrentUser(i.user),i})}/**
|
|
1426
1426
|
* @license
|
|
1427
1427
|
* Copyright 2020 Google LLC
|
|
1428
1428
|
*
|
|
@@ -1437,7 +1437,7 @@
|
|
|
1437
1437
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1438
1438
|
* See the License for the specific language governing permissions and
|
|
1439
1439
|
* limitations under the License.
|
|
1440
|
-
*/class
|
|
1440
|
+
*/class Mi{constructor(t,n){this.factorId=t,this.uid=n.mfaEnrollmentId,this.enrollmentTime=new Date(n.enrolledAt).toUTCString(),this.displayName=n.displayName}static _fromServerResponse(t,n){return"phoneInfo"in n?dl._fromServerResponse(t,n):"totpInfo"in n?fl._fromServerResponse(t,n):bt(t,"internal-error")}}class dl extends Mi{constructor(t){super("phone",t),this.phoneNumber=t.phoneInfo}static _fromServerResponse(t,n){return new dl(n)}}class fl extends Mi{constructor(t){super("totp",t)}static _fromServerResponse(t,n){return new fl(n)}}/**
|
|
1441
1441
|
* @license
|
|
1442
1442
|
* Copyright 2020 Google LLC
|
|
1443
1443
|
*
|
|
@@ -1452,7 +1452,7 @@
|
|
|
1452
1452
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1453
1453
|
* See the License for the specific language governing permissions and
|
|
1454
1454
|
* limitations under the License.
|
|
1455
|
-
*/function
|
|
1455
|
+
*/function Vo(e,t,n){var r;oe(((r=n.url)===null||r===void 0?void 0:r.length)>0,e,"invalid-continue-uri"),oe(typeof n.dynamicLinkDomain=="undefined"||n.dynamicLinkDomain.length>0,e,"invalid-dynamic-link-domain"),t.continueUrl=n.url,t.dynamicLinkDomain=n.dynamicLinkDomain,t.canHandleCodeInApp=n.handleCodeInApp,n.iOS&&(oe(n.iOS.bundleId.length>0,e,"missing-ios-bundle-id"),t.iOSBundleId=n.iOS.bundleId),n.android&&(oe(n.android.packageName.length>0,e,"missing-android-pkg-name"),t.androidInstallApp=n.android.installApp,t.androidMinimumVersionCode=n.android.minimumVersion,t.androidPackageName=n.android.packageName)}/**
|
|
1456
1456
|
* @license
|
|
1457
1457
|
* Copyright 2020 Google LLC
|
|
1458
1458
|
*
|
|
@@ -1467,7 +1467,7 @@
|
|
|
1467
1467
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1468
1468
|
* See the License for the specific language governing permissions and
|
|
1469
1469
|
* limitations under the License.
|
|
1470
|
-
*/function
|
|
1470
|
+
*/function hl(e){return k(this,null,function*(){const t=qe(e);t._getPasswordPolicyInternal()&&(yield t._updatePasswordPolicy())})}function Ax(e,t,n){return k(this,null,function*(){const r=qe(e),i={requestType:"PASSWORD_RESET",email:t,clientType:"CLIENT_TYPE_WEB"};n&&Vo(r,i,n),yield Ri(r,i,"getOobCode",ax)})}function Tx(e,t,n){return k(this,null,function*(){yield Jd(De(e),{oobCode:t,newPassword:n}).catch(r=>k(this,null,function*(){throw r.code==="auth/password-does-not-meet-requirements"&&hl(e),r}))})}function Ex(e,t){return k(this,null,function*(){yield rx(De(e),{oobCode:t})})}function sf(e,t){return k(this,null,function*(){const n=De(e),r=yield Jd(n,{oobCode:t}),i=r.requestType;switch(oe(i,n,"internal-error"),i){case"EMAIL_SIGNIN":break;case"VERIFY_AND_CHANGE_EMAIL":oe(r.newEmail,n,"internal-error");break;case"REVERT_SECOND_FACTOR_ADDITION":oe(r.mfaInfo,n,"internal-error");default:oe(r.email,n,"internal-error")}let o=null;return r.mfaInfo&&(o=Mi._fromServerResponse(qe(n),r.mfaInfo)),{data:{email:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.newEmail:r.email)||null,previousEmail:(r.requestType==="VERIFY_AND_CHANGE_EMAIL"?r.email:r.newEmail)||null,multiFactorInfo:o},operation:i}})}function kx(e,t){return k(this,null,function*(){const{data:n}=yield sf(De(e),t);return n.email})}function _x(e,t,n){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const r=qe(e),a=yield Ri(r,{returnSecureToken:!0,email:t,password:n,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Xd).catch(l=>{throw l.code==="auth/password-does-not-meet-requirements"&&hl(e),l}),s=yield Jt._fromIdTokenResponse(r,"signIn",a);return yield r._updateCurrentUser(s.user),s})}function Px(e,t,n){return Ge(e.app)?Promise.reject(yt(e)):Uo(De(e),Qn.credential(t,n)).catch(r=>k(this,null,function*(){throw r.code==="auth/password-does-not-meet-requirements"&&hl(e),r}))}/**
|
|
1471
1471
|
* @license
|
|
1472
1472
|
* Copyright 2020 Google LLC
|
|
1473
1473
|
*
|
|
@@ -1482,7 +1482,7 @@
|
|
|
1482
1482
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1483
1483
|
* See the License for the specific language governing permissions and
|
|
1484
1484
|
* limitations under the License.
|
|
1485
|
-
*/function
|
|
1485
|
+
*/function Dx(e,t,n){return k(this,null,function*(){const r=qe(e),i={requestType:"EMAIL_SIGNIN",email:t,clientType:"CLIENT_TYPE_WEB"};function o(a,s){oe(s.handleCodeInApp,r,"argument-error"),s&&Vo(r,a,s)}o(i,n),yield Ri(r,i,"getOobCode",sx)})}function Ox(e,t){const n=No.parseLink(t);return(n==null?void 0:n.operation)==="EMAIL_SIGNIN"}function Rx(e,t,n){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const r=De(e),i=Qn.credentialWithLink(t,n||Ai());return oe(i._tenantId===(r.tenantId||null),r,"tenant-id-mismatch"),Uo(r,i)})}/**
|
|
1486
1486
|
* @license
|
|
1487
1487
|
* Copyright 2020 Google LLC
|
|
1488
1488
|
*
|
|
@@ -1497,7 +1497,7 @@
|
|
|
1497
1497
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1498
1498
|
* See the License for the specific language governing permissions and
|
|
1499
1499
|
* limitations under the License.
|
|
1500
|
-
*/function
|
|
1500
|
+
*/function Lx(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:createAuthUri",Ye(e,t))})}/**
|
|
1501
1501
|
* @license
|
|
1502
1502
|
* Copyright 2020 Google LLC
|
|
1503
1503
|
*
|
|
@@ -1512,7 +1512,7 @@
|
|
|
1512
1512
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1513
1513
|
* See the License for the specific language governing permissions and
|
|
1514
1514
|
* limitations under the License.
|
|
1515
|
-
*/function
|
|
1515
|
+
*/function Mx(e,t){return k(this,null,function*(){const n=il()?Ai():"http://localhost",r={identifier:t,continueUri:n},{signinMethods:i}=yield Lx(De(e),r);return i||[]})}function Bx(e,t){return k(this,null,function*(){const n=De(e),i={requestType:"VERIFY_EMAIL",idToken:yield e.getIdToken()};t&&Vo(n.auth,i,t);const{email:o}=yield ox(n.auth,i);o!==e.email&&(yield e.reload())})}function $x(e,t,n){return k(this,null,function*(){const r=De(e),o={requestType:"VERIFY_AND_CHANGE_EMAIL",idToken:yield e.getIdToken(),newEmail:t};n&&Vo(r.auth,o,n);const{email:a}=yield lx(r.auth,o);a!==e.email&&(yield e.reload())})}/**
|
|
1516
1516
|
* @license
|
|
1517
1517
|
* Copyright 2020 Google LLC
|
|
1518
1518
|
*
|
|
@@ -1527,7 +1527,7 @@
|
|
|
1527
1527
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1528
1528
|
* See the License for the specific language governing permissions and
|
|
1529
1529
|
* limitations under the License.
|
|
1530
|
-
*/function
|
|
1530
|
+
*/function Nx(e,t){return k(this,null,function*(){return Ke(e,"POST","/v1/accounts:update",t)})}/**
|
|
1531
1531
|
* @license
|
|
1532
1532
|
* Copyright 2020 Google LLC
|
|
1533
1533
|
*
|
|
@@ -1542,7 +1542,7 @@
|
|
|
1542
1542
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1543
1543
|
* See the License for the specific language governing permissions and
|
|
1544
1544
|
* limitations under the License.
|
|
1545
|
-
*/function
|
|
1545
|
+
*/function Fx(r,i){return k(this,arguments,function*(e,{displayName:t,photoURL:n}){if(t===void 0&&n===void 0)return;const o=De(e),s={idToken:yield o.getIdToken(),displayName:t,photoUrl:n,returnSecureToken:!0},l=yield kn(o,Nx(o.auth,s));o.displayName=l.displayName||null,o.photoURL=l.photoUrl||null;const c=o.providerData.find(({providerId:d})=>d==="password");c&&(c.displayName=o.displayName,c.photoURL=o.photoURL),yield o._updateTokensIfNecessary(l)})}function zx(e,t){const n=De(e);return Ge(n.auth.app)?Promise.reject(yt(n.auth)):lf(n,t,null)}function jx(e,t){return lf(De(e),null,t)}function lf(e,t,n){return k(this,null,function*(){const{auth:r}=e,o={idToken:yield e.getIdToken(),returnSecureToken:!0};t&&(o.email=t),n&&(o.password=n);const a=yield kn(e,tx(r,o));yield e._updateTokensIfNecessary(a,!0)})}/**
|
|
1546
1546
|
* @license
|
|
1547
1547
|
* Copyright 2019 Google LLC
|
|
1548
1548
|
*
|
|
@@ -1557,7 +1557,7 @@
|
|
|
1557
1557
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1558
1558
|
* See the License for the specific language governing permissions and
|
|
1559
1559
|
* limitations under the License.
|
|
1560
|
-
*/function
|
|
1560
|
+
*/function Ux(e){var t,n;if(!e)return null;const{providerId:r}=e,i=e.rawUserInfo?JSON.parse(e.rawUserInfo):{},o=e.isNewUser||e.kind==="identitytoolkit#SignupNewUserResponse";if(!r&&(e!=null&&e.idToken)){const a=(n=(t=Bo(e.idToken))===null||t===void 0?void 0:t.firebase)===null||n===void 0?void 0:n.sign_in_provider;if(a){const s=a!=="anonymous"&&a!=="custom"?a:null;return new Fr(o,s)}}if(!r)return null;switch(r){case"facebook.com":return new Vx(o,i);case"github.com":return new Hx(o,i);case"google.com":return new Wx(o,i);case"twitter.com":return new Gx(o,i,e.screenName||null);case"custom":case"anonymous":return new Fr(o,null);default:return new Fr(o,r,i)}}class Fr{constructor(t,n,r={}){this.isNewUser=t,this.providerId=n,this.profile=r}}class cf extends Fr{constructor(t,n,r,i){super(t,n,r),this.username=i}}class Vx extends Fr{constructor(t,n){super(t,"facebook.com",n)}}class Hx extends cf{constructor(t,n){super(t,"github.com",n,typeof(n==null?void 0:n.login)=="string"?n==null?void 0:n.login:null)}}class Wx extends Fr{constructor(t,n){super(t,"google.com",n)}}class Gx extends cf{constructor(t,n,r){super(t,"twitter.com",n,r)}}function Yx(e){const{user:t,_tokenResponse:n}=e;return t.isAnonymous&&!n?{providerId:null,isNewUser:!1,profile:null}:Ux(n)}function Kx(e,t,n,r){return De(e).onIdTokenChanged(t,n,r)}function qx(e,t,n){return De(e).beforeAuthStateChanged(t,n)}/**
|
|
1561
1561
|
* @license
|
|
1562
1562
|
* Copyright 2020 Google LLC
|
|
1563
1563
|
*
|
|
@@ -1572,7 +1572,7 @@
|
|
|
1572
1572
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1573
1573
|
* See the License for the specific language governing permissions and
|
|
1574
1574
|
* limitations under the License.
|
|
1575
|
-
*/class
|
|
1575
|
+
*/class fr{constructor(t,n,r){this.type=t,this.credential=n,this.user=r}static _fromIdtoken(t,n){return new fr("enroll",t,n)}static _fromMfaPendingCredential(t){return new fr("signin",t)}toJSON(){return{multiFactorSession:{[this.type==="enroll"?"idToken":"pendingCredential"]:this.credential}}}static fromJSON(t){var n,r;if(t!=null&&t.multiFactorSession){if(!((n=t.multiFactorSession)===null||n===void 0)&&n.pendingCredential)return fr._fromMfaPendingCredential(t.multiFactorSession.pendingCredential);if(!((r=t.multiFactorSession)===null||r===void 0)&&r.idToken)return fr._fromIdtoken(t.multiFactorSession.idToken)}return null}}/**
|
|
1576
1576
|
* @license
|
|
1577
1577
|
* Copyright 2020 Google LLC
|
|
1578
1578
|
*
|
|
@@ -1587,7 +1587,7 @@
|
|
|
1587
1587
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1588
1588
|
* See the License for the specific language governing permissions and
|
|
1589
1589
|
* limitations under the License.
|
|
1590
|
-
*/class
|
|
1590
|
+
*/class pl{constructor(t,n,r){this.session=t,this.hints=n,this.signInResolver=r}static _fromError(t,n){const r=qe(t),i=n.customData._serverResponse,o=(i.mfaInfo||[]).map(s=>Mi._fromServerResponse(r,s));oe(i.mfaPendingCredential,r,"internal-error");const a=fr._fromMfaPendingCredential(i.mfaPendingCredential);return new pl(a,o,s=>k(this,null,function*(){const l=yield s._process(r,a);delete i.mfaInfo,delete i.mfaPendingCredential;const c=Object.assign(Object.assign({},i),{idToken:l.idToken,refreshToken:l.refreshToken});switch(n.operationType){case"signIn":const d=yield Jt._fromIdTokenResponse(r,n.operationType,c);return yield r._updateCurrentUser(d.user),d;case"reauthenticate":return oe(n.user,r,"internal-error"),Jt._forOperation(n.user,n.operationType,c);default:bt(r,"internal-error")}}))}resolveSignIn(t){return k(this,null,function*(){const n=t;return this.signInResolver(n)})}}function Qx(e,t){var n;const r=De(e),i=t;return oe(t.customData.operationType,r,"argument-error"),oe((n=i.customData._serverResponse)===null||n===void 0?void 0:n.mfaPendingCredential,r,"argument-error"),pl._fromError(r,i)}/**
|
|
1591
1591
|
* @license
|
|
1592
1592
|
* Copyright 2020 Google LLC
|
|
1593
1593
|
*
|
|
@@ -1602,7 +1602,7 @@
|
|
|
1602
1602
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1603
1603
|
* See the License for the specific language governing permissions and
|
|
1604
1604
|
* limitations under the License.
|
|
1605
|
-
*/function
|
|
1605
|
+
*/function Jx(e,t){return Ke(e,"POST","/v2/accounts/mfaEnrollment:start",Ye(e,t))}function Xx(e,t){return Ke(e,"POST","/v2/accounts/mfaEnrollment:finalize",Ye(e,t))}function Zx(e,t){return Ke(e,"POST","/v2/accounts/mfaEnrollment:withdraw",Ye(e,t))}class gl{constructor(t){this.user=t,this.enrolledFactors=[],t._onReload(n=>{n.mfaInfo&&(this.enrolledFactors=n.mfaInfo.map(r=>Mi._fromServerResponse(t.auth,r)))})}static _fromUser(t){return new gl(t)}getSession(){return k(this,null,function*(){return fr._fromIdtoken(yield this.user.getIdToken(),this.user)})}enroll(t,n){return k(this,null,function*(){const r=t,i=yield this.getSession(),o=yield kn(this.user,r._process(this.user.auth,i,n));return yield this.user._updateTokensIfNecessary(o),this.user.reload()})}unenroll(t){return k(this,null,function*(){const n=typeof t=="string"?t:t.uid,r=yield this.user.getIdToken();try{const i=yield kn(this.user,Zx(this.user.auth,{idToken:r,mfaEnrollmentId:n}));this.enrolledFactors=this.enrolledFactors.filter(({uid:o})=>o!==n),yield this.user._updateTokensIfNecessary(i),yield this.user.reload()}catch(i){throw i}})}}const ml=new WeakMap;function eC(e){const t=De(e);return ml.has(t)||ml.set(t,gl._fromUser(t)),ml.get(t)}const Ho="__sak";/**
|
|
1606
1606
|
* @license
|
|
1607
1607
|
* Copyright 2019 Google LLC
|
|
1608
1608
|
*
|
|
@@ -1617,7 +1617,7 @@
|
|
|
1617
1617
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1618
1618
|
* See the License for the specific language governing permissions and
|
|
1619
1619
|
* limitations under the License.
|
|
1620
|
-
*/class
|
|
1620
|
+
*/class uf{constructor(t,n){this.storageRetriever=t,this.type=n}_isAvailable(){try{return this.storage?(this.storage.setItem(Ho,"1"),this.storage.removeItem(Ho),Promise.resolve(!0)):Promise.resolve(!1)}catch(t){return Promise.resolve(!1)}}_set(t,n){return this.storage.setItem(t,JSON.stringify(n)),Promise.resolve()}_get(t){const n=this.storage.getItem(t);return Promise.resolve(n?JSON.parse(n):null)}_remove(t){return this.storage.removeItem(t),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
|
|
1621
1621
|
* @license
|
|
1622
1622
|
* Copyright 2020 Google LLC
|
|
1623
1623
|
*
|
|
@@ -1632,7 +1632,7 @@
|
|
|
1632
1632
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1633
1633
|
* See the License for the specific language governing permissions and
|
|
1634
1634
|
* limitations under the License.
|
|
1635
|
-
*/const
|
|
1635
|
+
*/const tC=1e3,nC=10;class zr extends uf{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(t,n)=>this.onStorageEvent(t,n),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=Hd(),this._shouldAllowMigration=!0}forAllChangedKeys(t){for(const n of Object.keys(this.listeners)){const r=this.storage.getItem(n),i=this.localCache[n];r!==i&&t(n,i,r)}}onStorageEvent(t,n=!1){if(!t.key){this.forAllChangedKeys((a,s,l)=>{this.notifyListeners(a,l)});return}const r=t.key;n?this.detachListener():this.stopPolling();const i=()=>{const a=this.storage.getItem(r);!n&&this.localCache[r]===a||this.notifyListeners(r,a)},o=this.storage.getItem(r);Ny()&&o!==t.newValue&&t.newValue!==t.oldValue?setTimeout(i,nC):i()}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n&&JSON.parse(n))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((t,n,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:t,oldValue:n,newValue:r}),!0)})},tC)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(t,n){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[t]||(this.listeners[t]=new Set,this.localCache[t]=this.storage.getItem(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}_set(t,n){return k(this,null,function*(){yield Ar(zr.prototype,this,"_set").call(this,t,n),this.localCache[t]=JSON.stringify(n)})}_get(t){return k(this,null,function*(){const n=yield Ar(zr.prototype,this,"_get").call(this,t);return this.localCache[t]=JSON.stringify(n),n})}_remove(t){return k(this,null,function*(){yield Ar(zr.prototype,this,"_remove").call(this,t),delete this.localCache[t]})}}zr.type="LOCAL";const Wo=zr;/**
|
|
1636
1636
|
* @license
|
|
1637
1637
|
* Copyright 2020 Google LLC
|
|
1638
1638
|
*
|
|
@@ -1647,7 +1647,7 @@
|
|
|
1647
1647
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1648
1648
|
* See the License for the specific language governing permissions and
|
|
1649
1649
|
* limitations under the License.
|
|
1650
|
-
*/class
|
|
1650
|
+
*/class df extends uf{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(t,n){}_removeListener(t,n){}}df.type="SESSION";const Jn=df;/**
|
|
1651
1651
|
* @license
|
|
1652
1652
|
* Copyright 2019 Google LLC
|
|
1653
1653
|
*
|
|
@@ -1662,7 +1662,7 @@
|
|
|
1662
1662
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1663
1663
|
* See the License for the specific language governing permissions and
|
|
1664
1664
|
* limitations under the License.
|
|
1665
|
-
*/function
|
|
1665
|
+
*/function rC(e){return Promise.all(e.map(t=>k(this,null,function*(){try{return{fulfilled:!0,value:yield t}}catch(n){return{fulfilled:!1,reason:n}}})))}/**
|
|
1666
1666
|
* @license
|
|
1667
1667
|
* Copyright 2019 Google LLC
|
|
1668
1668
|
*
|
|
@@ -1677,7 +1677,7 @@
|
|
|
1677
1677
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1678
1678
|
* See the License for the specific language governing permissions and
|
|
1679
1679
|
* limitations under the License.
|
|
1680
|
-
*/class
|
|
1680
|
+
*/class Go{constructor(t){this.eventTarget=t,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(t){const n=this.receivers.find(i=>i.isListeningto(t));if(n)return n;const r=new Go(t);return this.receivers.push(r),r}isListeningto(t){return this.eventTarget===t}handleEvent(t){return k(this,null,function*(){const n=t,{eventId:r,eventType:i,data:o}=n.data,a=this.handlersMap[i];if(!(a!=null&&a.size))return;n.ports[0].postMessage({status:"ack",eventId:r,eventType:i});const s=Array.from(a).map(c=>k(this,null,function*(){return c(n.origin,o)})),l=yield rC(s);n.ports[0].postMessage({status:"done",eventId:r,eventType:i,response:l})})}_subscribe(t,n){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[t]||(this.handlersMap[t]=new Set),this.handlersMap[t].add(n)}_unsubscribe(t,n){this.handlersMap[t]&&n&&this.handlersMap[t].delete(n),(!n||this.handlersMap[t].size===0)&&delete this.handlersMap[t],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}Go.receivers=[];/**
|
|
1681
1681
|
* @license
|
|
1682
1682
|
* Copyright 2020 Google LLC
|
|
1683
1683
|
*
|
|
@@ -1692,7 +1692,7 @@
|
|
|
1692
1692
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1693
1693
|
* See the License for the specific language governing permissions and
|
|
1694
1694
|
* limitations under the License.
|
|
1695
|
-
*/function
|
|
1695
|
+
*/function Bi(e="",t=10){let n="";for(let r=0;r<t;r++)n+=Math.floor(Math.random()*10);return e+n}/**
|
|
1696
1696
|
* @license
|
|
1697
1697
|
* Copyright 2019 Google LLC
|
|
1698
1698
|
*
|
|
@@ -1707,7 +1707,7 @@
|
|
|
1707
1707
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1708
1708
|
* See the License for the specific language governing permissions and
|
|
1709
1709
|
* limitations under the License.
|
|
1710
|
-
*/class
|
|
1710
|
+
*/class iC{constructor(t){this.target=t,this.handlers=new Set}removeMessageHandler(t){t.messageChannel&&(t.messageChannel.port1.removeEventListener("message",t.onMessage),t.messageChannel.port1.close()),this.handlers.delete(t)}_send(t,n,r=50){return k(this,null,function*(){const i=typeof MessageChannel!="undefined"?new MessageChannel:null;if(!i)throw new Error("connection_unavailable");let o,a;return new Promise((s,l)=>{const c=Bi("",20);i.port1.start();const d=setTimeout(()=>{l(new Error("unsupported_event"))},r);a={messageChannel:i,onMessage(f){const h=f;if(h.data.eventId===c)switch(h.data.status){case"ack":clearTimeout(d),o=setTimeout(()=>{l(new Error("timeout"))},3e3);break;case"done":clearTimeout(o),s(h.data.response);break;default:clearTimeout(d),clearTimeout(o),l(new Error("invalid_response"));break}}},this.handlers.add(a),i.port1.addEventListener("message",a.onMessage),this.target.postMessage({eventType:t,eventId:c,data:n},[i.port2])}).finally(()=>{a&&this.removeMessageHandler(a)})})}}/**
|
|
1711
1711
|
* @license
|
|
1712
1712
|
* Copyright 2020 Google LLC
|
|
1713
1713
|
*
|
|
@@ -1722,7 +1722,7 @@
|
|
|
1722
1722
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1723
1723
|
* See the License for the specific language governing permissions and
|
|
1724
1724
|
* limitations under the License.
|
|
1725
|
-
*/function
|
|
1725
|
+
*/function ut(){return window}function oC(e){ut().location.href=e}/**
|
|
1726
1726
|
* @license
|
|
1727
1727
|
* Copyright 2020 Google LLC.
|
|
1728
1728
|
*
|
|
@@ -1737,7 +1737,7 @@
|
|
|
1737
1737
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1738
1738
|
* See the License for the specific language governing permissions and
|
|
1739
1739
|
* limitations under the License.
|
|
1740
|
-
*/function
|
|
1740
|
+
*/function vl(){return typeof ut().WorkerGlobalScope!="undefined"&&typeof ut().importScripts=="function"}function aC(){return k(this,null,function*(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(yield navigator.serviceWorker.ready).active}catch(e){return null}})}function sC(){var e;return((e=navigator==null?void 0:navigator.serviceWorker)===null||e===void 0?void 0:e.controller)||null}function lC(){return vl()?self:null}/**
|
|
1741
1741
|
* @license
|
|
1742
1742
|
* Copyright 2019 Google LLC
|
|
1743
1743
|
*
|
|
@@ -1752,7 +1752,7 @@
|
|
|
1752
1752
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1753
1753
|
* See the License for the specific language governing permissions and
|
|
1754
1754
|
* limitations under the License.
|
|
1755
|
-
*/const
|
|
1755
|
+
*/const ff="firebaseLocalStorageDb",cC=1,Yo="firebaseLocalStorage",hf="fbase_key";class $i{constructor(t){this.request=t}toPromise(){return new Promise((t,n)=>{this.request.addEventListener("success",()=>{t(this.request.result)}),this.request.addEventListener("error",()=>{n(this.request.error)})})}}function Ko(e,t){return e.transaction([Yo],t?"readwrite":"readonly").objectStore(Yo)}function uC(){const e=indexedDB.deleteDatabase(ff);return new $i(e).toPromise()}function bl(){const e=indexedDB.open(ff,cC);return new Promise((t,n)=>{e.addEventListener("error",()=>{n(e.error)}),e.addEventListener("upgradeneeded",()=>{const r=e.result;try{r.createObjectStore(Yo,{keyPath:hf})}catch(i){n(i)}}),e.addEventListener("success",()=>k(this,null,function*(){const r=e.result;r.objectStoreNames.contains(Yo)?t(r):(r.close(),yield uC(),t(yield bl()))}))})}function pf(e,t,n){return k(this,null,function*(){const r=Ko(e,!0).put({[hf]:t,value:n});return new $i(r).toPromise()})}function dC(e,t){return k(this,null,function*(){const n=Ko(e,!1).get(t),r=yield new $i(n).toPromise();return r===void 0?null:r.value})}function gf(e,t){const n=Ko(e,!0).delete(t);return new $i(n).toPromise()}const fC=800,hC=3;class mf{constructor(){this.type="LOCAL",this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}_openDb(){return k(this,null,function*(){return this.db?this.db:(this.db=yield bl(),this.db)})}_withRetries(t){return k(this,null,function*(){let n=0;for(;;)try{const r=yield this._openDb();return yield t(r)}catch(r){if(n++>hC)throw r;this.db&&(this.db.close(),this.db=void 0)}})}initializeServiceWorkerMessaging(){return k(this,null,function*(){return vl()?this.initializeReceiver():this.initializeSender()})}initializeReceiver(){return k(this,null,function*(){this.receiver=Go._getInstance(lC()),this.receiver._subscribe("keyChanged",(t,n)=>k(this,null,function*(){return{keyProcessed:(yield this._poll()).includes(n.key)}})),this.receiver._subscribe("ping",(t,n)=>k(this,null,function*(){return["keyChanged"]}))})}initializeSender(){return k(this,null,function*(){var t,n;if(this.activeServiceWorker=yield aC(),!this.activeServiceWorker)return;this.sender=new iC(this.activeServiceWorker);const r=yield this.sender._send("ping",{},800);r&&!((t=r[0])===null||t===void 0)&&t.fulfilled&&!((n=r[0])===null||n===void 0)&&n.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)})}notifyServiceWorker(t){return k(this,null,function*(){if(!(!this.sender||!this.activeServiceWorker||sC()!==this.activeServiceWorker))try{yield this.sender._send("keyChanged",{key:t},this.serviceWorkerReceiverAvailable?800:50)}catch(n){}})}_isAvailable(){return k(this,null,function*(){try{if(!indexedDB)return!1;const t=yield bl();return yield pf(t,Ho,"1"),yield gf(t,Ho),!0}catch(t){}return!1})}_withPendingWrite(t){return k(this,null,function*(){this.pendingWrites++;try{yield t()}finally{this.pendingWrites--}})}_set(t,n){return k(this,null,function*(){return this._withPendingWrite(()=>k(this,null,function*(){return yield this._withRetries(r=>pf(r,t,n)),this.localCache[t]=n,this.notifyServiceWorker(t)}))})}_get(t){return k(this,null,function*(){const n=yield this._withRetries(r=>dC(r,t));return this.localCache[t]=n,n})}_remove(t){return k(this,null,function*(){return this._withPendingWrite(()=>k(this,null,function*(){return yield this._withRetries(n=>gf(n,t)),delete this.localCache[t],this.notifyServiceWorker(t)}))})}_poll(){return k(this,null,function*(){const t=yield this._withRetries(i=>{const o=Ko(i,!1).getAll();return new $i(o).toPromise()});if(!t)return[];if(this.pendingWrites!==0)return[];const n=[],r=new Set;if(t.length!==0)for(const{fbase_key:i,value:o}of t)r.add(i),JSON.stringify(this.localCache[i])!==JSON.stringify(o)&&(this.notifyListeners(i,o),n.push(i));for(const i of Object.keys(this.localCache))this.localCache[i]&&!r.has(i)&&(this.notifyListeners(i,null),n.push(i));return n})}notifyListeners(t,n){this.localCache[t]=n;const r=this.listeners[t];if(r)for(const i of Array.from(r))i(n)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>k(this,null,function*(){return this._poll()}),fC)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(t,n){Object.keys(this.listeners).length===0&&this.startPolling(),this.listeners[t]||(this.listeners[t]=new Set,this._get(t)),this.listeners[t].add(n)}_removeListener(t,n){this.listeners[t]&&(this.listeners[t].delete(n),this.listeners[t].size===0&&delete this.listeners[t]),Object.keys(this.listeners).length===0&&this.stopPolling()}}mf.type="LOCAL";const jr=mf;/**
|
|
1756
1756
|
* @license
|
|
1757
1757
|
* Copyright 2020 Google LLC
|
|
1758
1758
|
*
|
|
@@ -1767,7 +1767,7 @@
|
|
|
1767
1767
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1768
1768
|
* See the License for the specific language governing permissions and
|
|
1769
1769
|
* limitations under the License.
|
|
1770
|
-
*/function
|
|
1770
|
+
*/function pC(e,t){return Ke(e,"POST","/v2/accounts/mfaSignIn:start",Ye(e,t))}function gC(e,t){return Ke(e,"POST","/v2/accounts/mfaSignIn:finalize",Ye(e,t))}/**
|
|
1771
1771
|
* @license
|
|
1772
1772
|
* Copyright 2020 Google LLC
|
|
1773
1773
|
*
|
|
@@ -1782,7 +1782,7 @@
|
|
|
1782
1782
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1783
1783
|
* See the License for the specific language governing permissions and
|
|
1784
1784
|
* limitations under the License.
|
|
1785
|
-
*/const
|
|
1785
|
+
*/const mC=500,vC=6e4,qo=1e12;class bC{constructor(t){this.auth=t,this.counter=qo,this._widgets=new Map}render(t,n){const r=this.counter;return this._widgets.set(r,new yC(t,this.auth.name,n||{})),this.counter++,r}reset(t){var n;const r=t||qo;(n=this._widgets.get(r))===null||n===void 0||n.delete(),this._widgets.delete(r)}getResponse(t){var n;const r=t||qo;return((n=this._widgets.get(r))===null||n===void 0?void 0:n.getResponse())||""}execute(t){return k(this,null,function*(){var n;const r=t||qo;return(n=this._widgets.get(r))===null||n===void 0||n.execute(),""})}}class yC{constructor(t,n,r){this.params=r,this.timerId=null,this.deleted=!1,this.responseToken=null,this.clickHandler=()=>{this.execute()};const i=typeof t=="string"?document.getElementById(t):t;oe(i,"argument-error",{appName:n}),this.container=i,this.isVisible=this.params.size!=="invisible",this.isVisible?this.execute():this.container.addEventListener("click",this.clickHandler)}getResponse(){return this.checkIfDeleted(),this.responseToken}delete(){this.checkIfDeleted(),this.deleted=!0,this.timerId&&(clearTimeout(this.timerId),this.timerId=null),this.container.removeEventListener("click",this.clickHandler)}execute(){this.checkIfDeleted(),!this.timerId&&(this.timerId=window.setTimeout(()=>{this.responseToken=xC(50);const{callback:t,"expired-callback":n}=this.params;if(t)try{t(this.responseToken)}catch(r){}this.timerId=window.setTimeout(()=>{if(this.timerId=null,this.responseToken=null,n)try{n()}catch(r){}this.isVisible&&this.execute()},vC)},mC))}checkIfDeleted(){if(this.deleted)throw new Error("reCAPTCHA mock was already deleted!")}}function xC(e){const t=[],n="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let r=0;r<e;r++)t.push(n.charAt(Math.floor(Math.random()*n.length)));return t.join("")}/**
|
|
1786
1786
|
* @license
|
|
1787
1787
|
* Copyright 2020 Google LLC
|
|
1788
1788
|
*
|
|
@@ -1797,7 +1797,7 @@
|
|
|
1797
1797
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1798
1798
|
* See the License for the specific language governing permissions and
|
|
1799
1799
|
* limitations under the License.
|
|
1800
|
-
*/const
|
|
1800
|
+
*/const yl=Yd("rcb"),CC=new Ti(3e4,6e4);class wC{constructor(){var t;this.hostLanguage="",this.counter=0,this.librarySeparatelyLoaded=!!(!((t=ut().grecaptcha)===null||t===void 0)&&t.render)}load(t,n=""){return oe(IC(n),t,"argument-error"),this.shouldResolveImmediately(n)&&Pd(ut().grecaptcha)?Promise.resolve(ut().grecaptcha):new Promise((r,i)=>{const o=ut().setTimeout(()=>{i(mt(t,"network-request-failed"))},CC.get());ut()[yl]=()=>{ut().clearTimeout(o),delete ut()[yl];const s=ut().grecaptcha;if(!s||!Pd(s)){i(mt(t,"internal-error"));return}const l=s.render;s.render=(c,d)=>{const f=l(c,d);return this.counter++,f},this.hostLanguage=n,r(s)};const a=`${Wy()}?${Tr({onload:yl,render:"explicit",hl:n})}`;ll(a).catch(()=>{clearTimeout(o),i(mt(t,"internal-error"))})})}clearedOneInstance(){this.counter--}shouldResolveImmediately(t){var n;return!!(!((n=ut().grecaptcha)===null||n===void 0)&&n.render)&&(t===this.hostLanguage||this.counter>0||this.librarySeparatelyLoaded)}}function IC(e){return e.length<=6&&/^\s*[a-zA-Z0-9\-]*\s*$/.test(e)}class SC{load(t){return k(this,null,function*(){return new bC(t)})}clearedOneInstance(){}}/**
|
|
1801
1801
|
* @license
|
|
1802
1802
|
* Copyright 2020 Google LLC
|
|
1803
1803
|
*
|
|
@@ -1812,7 +1812,7 @@
|
|
|
1812
1812
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1813
1813
|
* See the License for the specific language governing permissions and
|
|
1814
1814
|
* limitations under the License.
|
|
1815
|
-
*/const
|
|
1815
|
+
*/const vf="recaptcha",AC={theme:"light",type:"image"};let TC=class{constructor(t,n,r=Object.assign({},AC)){this.parameters=r,this.type=vf,this.destroyed=!1,this.widgetId=null,this.tokenChangeListeners=new Set,this.renderPromise=null,this.recaptcha=null,this.auth=qe(t),this.isInvisible=this.parameters.size==="invisible",oe(typeof document!="undefined",this.auth,"operation-not-supported-in-this-environment");const i=typeof n=="string"?document.getElementById(n):n;oe(i,this.auth,"argument-error"),this.container=i,this.parameters.callback=this.makeTokenCallback(this.parameters.callback),this._recaptchaLoader=this.auth.settings.appVerificationDisabledForTesting?new SC:new wC,this.validateStartingState()}verify(){return k(this,null,function*(){this.assertNotDestroyed();const t=yield this.render(),n=this.getAssertedRecaptcha(),r=n.getResponse(t);return r||new Promise(i=>{const o=a=>{a&&(this.tokenChangeListeners.delete(o),i(a))};this.tokenChangeListeners.add(o),this.isInvisible&&n.execute(t)})})}render(){try{this.assertNotDestroyed()}catch(t){return Promise.reject(t)}return this.renderPromise?this.renderPromise:(this.renderPromise=this.makeRenderPromise().catch(t=>{throw this.renderPromise=null,t}),this.renderPromise)}_reset(){this.assertNotDestroyed(),this.widgetId!==null&&this.getAssertedRecaptcha().reset(this.widgetId)}clear(){this.assertNotDestroyed(),this.destroyed=!0,this._recaptchaLoader.clearedOneInstance(),this.isInvisible||this.container.childNodes.forEach(t=>{this.container.removeChild(t)})}validateStartingState(){oe(!this.parameters.sitekey,this.auth,"argument-error"),oe(this.isInvisible||!this.container.hasChildNodes(),this.auth,"argument-error"),oe(typeof document!="undefined",this.auth,"operation-not-supported-in-this-environment")}makeTokenCallback(t){return n=>{if(this.tokenChangeListeners.forEach(r=>r(n)),typeof t=="function")t(n);else if(typeof t=="string"){const r=ut()[t];typeof r=="function"&&r(n)}}}assertNotDestroyed(){oe(!this.destroyed,this.auth,"internal-error")}makeRenderPromise(){return k(this,null,function*(){if(yield this.init(),!this.widgetId){let t=this.container;if(!this.isInvisible){const n=document.createElement("div");t.appendChild(n),t=n}this.widgetId=this.getAssertedRecaptcha().render(t,this.parameters)}return this.widgetId})}init(){return k(this,null,function*(){oe(il()&&!vl(),this.auth,"internal-error"),yield EC(),this.recaptcha=yield this._recaptchaLoader.load(this.auth,this.auth.languageCode||void 0);const t=yield Ay(this.auth);oe(t,this.auth,"internal-error"),this.parameters.sitekey=t})}getAssertedRecaptcha(){return oe(this.recaptcha,this.auth,"internal-error"),this.recaptcha}};function EC(){let e=null;return new Promise(t=>{if(document.readyState==="complete"){t();return}e=()=>t(),window.addEventListener("load",e)}).catch(t=>{throw e&&window.removeEventListener("load",e),t})}/**
|
|
1816
1816
|
* @license
|
|
1817
1817
|
* Copyright 2020 Google LLC
|
|
1818
1818
|
*
|
|
@@ -1827,7 +1827,7 @@
|
|
|
1827
1827
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1828
1828
|
* See the License for the specific language governing permissions and
|
|
1829
1829
|
* limitations under the License.
|
|
1830
|
-
*/class
|
|
1830
|
+
*/class xl{constructor(t,n){this.verificationId=t,this.onConfirmation=n}confirm(t){const n=dr._fromVerification(this.verificationId,t);return this.onConfirmation(n)}}function kC(e,t,n){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const r=qe(e),i=yield Qo(r,t,De(n));return new xl(i,o=>Uo(r,o))})}function _C(e,t,n){return k(this,null,function*(){const r=De(e);yield jo(!1,r,"phone");const i=yield Qo(r.auth,t,De(n));return new xl(i,o=>of(r,o))})}function PC(e,t,n){return k(this,null,function*(){const r=De(e);if(Ge(r.auth.app))return Promise.reject(yt(r.auth));const i=yield Qo(r.auth,t,De(n));return new xl(i,o=>af(r,o))})}function Qo(e,t,n){return k(this,null,function*(){var r;const i=yield n.verify();try{oe(typeof i=="string",e,"argument-error"),oe(n.type===vf,e,"argument-error");let o;if(typeof t=="string"?o={phoneNumber:t}:o=t,"session"in o){const a=o.session;if("phoneNumber"in o)return oe(a.type==="enroll",e,"internal-error"),(yield Jx(e,{idToken:a.credential,phoneEnrollmentInfo:{phoneNumber:o.phoneNumber,recaptchaToken:i}})).phoneSessionInfo.sessionInfo;{oe(a.type==="signin",e,"internal-error");const s=((r=o.multiFactorHint)===null||r===void 0?void 0:r.uid)||o.multiFactorUid;return oe(s,e,"missing-multi-factor-info"),(yield pC(e,{mfaPendingCredential:a.credential,mfaEnrollmentId:s,phoneSignInInfo:{recaptchaToken:i}})).phoneResponseInfo.sessionInfo}}else{const{sessionInfo:a}=yield fx(e,{phoneNumber:o.phoneNumber,recaptchaToken:i});return a}}finally{n._reset()}})}function DC(e,t){return k(this,null,function*(){const n=De(e);if(Ge(n.auth.app))return Promise.reject(yt(n.auth));yield ul(n,t)})}/**
|
|
1831
1831
|
* @license
|
|
1832
1832
|
* Copyright 2020 Google LLC
|
|
1833
1833
|
*
|
|
@@ -1842,7 +1842,7 @@
|
|
|
1842
1842
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1843
1843
|
* See the License for the specific language governing permissions and
|
|
1844
1844
|
* limitations under the License.
|
|
1845
|
-
*/let
|
|
1845
|
+
*/let hr=class Fs{constructor(t){this.providerId=Fs.PROVIDER_ID,this.auth=qe(t)}verifyPhoneNumber(t,n){return Qo(this.auth,t,De(n))}static credential(t,n){return dr._fromVerification(t,n)}static credentialFromResult(t){const n=t;return Fs.credentialFromTaggedObject(n)}static credentialFromError(t){return Fs.credentialFromTaggedObject(t.customData||{})}static credentialFromTaggedObject({_tokenResponse:t}){if(!t)return null;const{phoneNumber:n,temporaryProof:r}=t;return n&&r?dr._fromTokenResponse(n,r):null}};hr.PROVIDER_ID="phone",hr.PHONE_SIGN_IN_METHOD="phone";/**
|
|
1846
1846
|
* @license
|
|
1847
1847
|
* Copyright 2021 Google LLC
|
|
1848
1848
|
*
|
|
@@ -1857,7 +1857,7 @@
|
|
|
1857
1857
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1858
1858
|
* See the License for the specific language governing permissions and
|
|
1859
1859
|
* limitations under the License.
|
|
1860
|
-
*/function
|
|
1860
|
+
*/function pr(e,t){return t?Ut(t):(oe(e._popupRedirectResolver,e,"argument-error"),e._popupRedirectResolver)}/**
|
|
1861
1861
|
* @license
|
|
1862
1862
|
* Copyright 2019 Google LLC
|
|
1863
1863
|
*
|
|
@@ -1872,7 +1872,7 @@
|
|
|
1872
1872
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1873
1873
|
* See the License for the specific language governing permissions and
|
|
1874
1874
|
* limitations under the License.
|
|
1875
|
-
*/class
|
|
1875
|
+
*/class Cl extends Mr{constructor(t){super("custom","custom"),this.params=t}_getIdTokenResponse(t){return Pn(t,this._buildIdpRequest())}_linkToIdToken(t,n){return Pn(t,this._buildIdpRequest(n))}_getReauthenticationResolver(t){return Pn(t,this._buildIdpRequest())}_buildIdpRequest(t){const n={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return t&&(n.idToken=t),n}}function OC(e){return rf(e.auth,new Cl(e),e.bypassAuthState)}function RC(e){const{auth:t,user:n}=e;return oe(n,t,"internal-error"),nf(n,new Cl(e),e.bypassAuthState)}function LC(e){return k(this,null,function*(){const{auth:t,user:n}=e;return oe(n,t,"internal-error"),ul(n,new Cl(e),e.bypassAuthState)})}/**
|
|
1876
1876
|
* @license
|
|
1877
1877
|
* Copyright 2020 Google LLC
|
|
1878
1878
|
*
|
|
@@ -1887,7 +1887,7 @@
|
|
|
1887
1887
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1888
1888
|
* See the License for the specific language governing permissions and
|
|
1889
1889
|
* limitations under the License.
|
|
1890
|
-
*/class
|
|
1890
|
+
*/class bf{constructor(t,n,r,i,o=!1){this.auth=t,this.resolver=r,this.user=i,this.bypassAuthState=o,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(n)?n:[n]}execute(){return new Promise((t,n)=>k(this,null,function*(){this.pendingPromise={resolve:t,reject:n};try{this.eventManager=yield this.resolver._initialize(this.auth),yield this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}}))}onAuthEvent(t){return k(this,null,function*(){const{urlResponse:n,sessionId:r,postBody:i,tenantId:o,error:a,type:s}=t;if(a){this.reject(a);return}const l={auth:this.auth,requestUri:n,sessionId:r,tenantId:o||void 0,postBody:i||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(yield this.getIdpTask(s)(l))}catch(c){this.reject(c)}})}onError(t){this.reject(t)}getIdpTask(t){switch(t){case"signInViaPopup":case"signInViaRedirect":return OC;case"linkViaPopup":case"linkViaRedirect":return LC;case"reauthViaPopup":case"reauthViaRedirect":return RC;default:bt(this.auth,"internal-error")}}resolve(t){an(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(t),this.unregisterAndCleanUp()}reject(t){an(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(t),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
|
|
1891
1891
|
* @license
|
|
1892
1892
|
* Copyright 2020 Google LLC
|
|
1893
1893
|
*
|
|
@@ -1902,7 +1902,7 @@
|
|
|
1902
1902
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1903
1903
|
* See the License for the specific language governing permissions and
|
|
1904
1904
|
* limitations under the License.
|
|
1905
|
-
*/const
|
|
1905
|
+
*/const MC=new Ti(2e3,1e4);function BC(e,t,n){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(mt(e,"operation-not-supported-in-this-environment"));const r=qe(e);Dr(e,t,Dn);const i=pr(r,n);return new On(r,"signInViaPopup",t,i).executeNotNull()})}function $C(e,t,n){return k(this,null,function*(){const r=De(e);if(Ge(r.auth.app))return Promise.reject(mt(r.auth,"operation-not-supported-in-this-environment"));Dr(r.auth,t,Dn);const i=pr(r.auth,n);return new On(r.auth,"reauthViaPopup",t,i,r).executeNotNull()})}function NC(e,t,n){return k(this,null,function*(){const r=De(e);Dr(r.auth,t,Dn);const i=pr(r.auth,n);return new On(r.auth,"linkViaPopup",t,i,r).executeNotNull()})}class On extends bf{constructor(t,n,r,i,o){super(t,n,i,o),this.provider=r,this.authWindow=null,this.pollId=null,On.currentPopupAction&&On.currentPopupAction.cancel(),On.currentPopupAction=this}executeNotNull(){return k(this,null,function*(){const t=yield this.execute();return oe(t,this.auth,"internal-error"),t})}onExecution(){return k(this,null,function*(){an(this.filter.length===1,"Popup operations only handle one event");const t=Bi();this.authWindow=yield this.resolver._openPopup(this.auth,this.provider,this.filter[0],t),this.authWindow.associatedEvent=t,this.resolver._originValidation(this.auth).catch(n=>{this.reject(n)}),this.resolver._isIframeWebStorageSupported(this.auth,n=>{n||this.reject(mt(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()})}get eventId(){var t;return((t=this.authWindow)===null||t===void 0?void 0:t.associatedEvent)||null}cancel(){this.reject(mt(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,On.currentPopupAction=null}pollUserCancellation(){const t=()=>{var n,r;if(!((r=(n=this.authWindow)===null||n===void 0?void 0:n.window)===null||r===void 0)&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(mt(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(t,MC.get())};t()}}On.currentPopupAction=null;/**
|
|
1906
1906
|
* @license
|
|
1907
1907
|
* Copyright 2020 Google LLC
|
|
1908
1908
|
*
|
|
@@ -1917,7 +1917,7 @@
|
|
|
1917
1917
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1918
1918
|
* See the License for the specific language governing permissions and
|
|
1919
1919
|
* limitations under the License.
|
|
1920
|
-
*/const
|
|
1920
|
+
*/const FC="pendingRedirect",Ni=new Map;class Fi extends bf{constructor(t,n,r=!1){super(t,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],n,void 0,r),this.eventId=null}execute(){return k(this,null,function*(){let t=Ni.get(this.auth._key());if(!t){try{const r=(yield zC(this.resolver,this.auth))?yield Ar(Fi.prototype,this,"execute").call(this):null;t=()=>Promise.resolve(r)}catch(n){t=()=>Promise.reject(n)}Ni.set(this.auth._key(),t)}return this.bypassAuthState||Ni.set(this.auth._key(),()=>Promise.resolve(null)),t()})}onAuthEvent(t){return k(this,null,function*(){if(t.type==="signInViaRedirect")return Ar(Fi.prototype,this,"onAuthEvent").call(this,t);if(t.type==="unknown"){this.resolve(null);return}if(t.eventId){const n=yield this.auth._redirectUserForId(t.eventId);if(n)return this.user=n,Ar(Fi.prototype,this,"onAuthEvent").call(this,t);this.resolve(null)}})}onExecution(){return k(this,null,function*(){})}cleanUp(){}}function zC(e,t){return k(this,null,function*(){const n=xf(t),r=yf(e);if(!(yield r._isAvailable()))return!1;const i=(yield r._get(n))==="true";return yield r._remove(n),i})}function wl(e,t){return k(this,null,function*(){return yf(e)._set(xf(t),"true")})}function jC(){Ni.clear()}function Il(e,t){Ni.set(e._key(),t)}function yf(e){return Ut(e._redirectPersistence)}function xf(e){return ur(FC,e.config.apiKey,e.name)}/**
|
|
1921
1921
|
* @license
|
|
1922
1922
|
* Copyright 2020 Google LLC
|
|
1923
1923
|
*
|
|
@@ -1932,7 +1932,7 @@
|
|
|
1932
1932
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1933
1933
|
* See the License for the specific language governing permissions and
|
|
1934
1934
|
* limitations under the License.
|
|
1935
|
-
*/function
|
|
1935
|
+
*/function UC(e,t,n){return VC(e,t,n)}function VC(e,t,n){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const r=qe(e);Dr(e,t,Dn),yield r._initializationPromise;const i=pr(r,n);return yield wl(i,r),i._openRedirect(r,t,"signInViaRedirect")})}function HC(e,t,n){return WC(e,t,n)}function WC(e,t,n){return k(this,null,function*(){const r=De(e);if(Dr(r.auth,t,Dn),Ge(r.auth.app))return Promise.reject(yt(r.auth));yield r.auth._initializationPromise;const i=pr(r.auth,n);yield wl(i,r.auth);const o=yield Cf(r);return i._openRedirect(r.auth,t,"reauthViaRedirect",o)})}function GC(e,t,n){return YC(e,t,n)}function YC(e,t,n){return k(this,null,function*(){const r=De(e);Dr(r.auth,t,Dn),yield r.auth._initializationPromise;const i=pr(r.auth,n);yield jo(!1,r,t.providerId),yield wl(i,r.auth);const o=yield Cf(r);return i._openRedirect(r.auth,t,"linkViaRedirect",o)})}function KC(e,t){return k(this,null,function*(){return yield qe(e)._initializationPromise,Jo(e,t,!1)})}function Jo(e,t,n=!1){return k(this,null,function*(){if(Ge(e.app))return Promise.reject(yt(e));const r=qe(e),i=pr(r,t),a=yield new Fi(r,i,n).execute();return a&&!n&&(delete a.user._redirectEventId,yield r._persistUserIfCurrent(a.user),yield r._setRedirectUser(null,t)),a})}function Cf(e){return k(this,null,function*(){const t=Bi(`${e.uid}:::`);return e._redirectEventId=t,yield e.auth._setRedirectUser(e),yield e.auth._persistUserIfCurrent(e),t})}/**
|
|
1936
1936
|
* @license
|
|
1937
1937
|
* Copyright 2020 Google LLC
|
|
1938
1938
|
*
|
|
@@ -1947,7 +1947,7 @@
|
|
|
1947
1947
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1948
1948
|
* See the License for the specific language governing permissions and
|
|
1949
1949
|
* limitations under the License.
|
|
1950
|
-
*/const
|
|
1950
|
+
*/const qC=10*60*1e3;class wf{constructor(t){this.auth=t,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(t){this.consumers.add(t),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,t)&&(this.sendToConsumer(this.queuedRedirectEvent,t),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(t){this.consumers.delete(t)}onEvent(t){if(this.hasEventBeenHandled(t))return!1;let n=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(t,r)&&(n=!0,this.sendToConsumer(t,r),this.saveEventToCache(t))}),this.hasHandledPotentialRedirect||!QC(t)||(this.hasHandledPotentialRedirect=!0,n||(this.queuedRedirectEvent=t,n=!0)),n}sendToConsumer(t,n){var r;if(t.error&&!Sf(t)){const i=((r=t.error.code)===null||r===void 0?void 0:r.split("auth/")[1])||"internal-error";n.onError(mt(this.auth,i))}else n.onAuthEvent(t)}isEventForConsumer(t,n){const r=n.eventId===null||!!t.eventId&&t.eventId===n.eventId;return n.filter.includes(t.type)&&r}hasEventBeenHandled(t){return Date.now()-this.lastProcessedEventTime>=qC&&this.cachedEventUids.clear(),this.cachedEventUids.has(If(t))}saveEventToCache(t){this.cachedEventUids.add(If(t)),this.lastProcessedEventTime=Date.now()}}function If(e){return[e.type,e.eventId,e.sessionId,e.tenantId].filter(t=>t).join("-")}function Sf({type:e,error:t}){return e==="unknown"&&(t==null?void 0:t.code)==="auth/no-auth-event"}function QC(e){switch(e.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return Sf(e);default:return!1}}/**
|
|
1951
1951
|
* @license
|
|
1952
1952
|
* Copyright 2020 Google LLC
|
|
1953
1953
|
*
|
|
@@ -1962,7 +1962,7 @@
|
|
|
1962
1962
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1963
1963
|
* See the License for the specific language governing permissions and
|
|
1964
1964
|
* limitations under the License.
|
|
1965
|
-
*/function
|
|
1965
|
+
*/function Af(n){return k(this,arguments,function*(e,t={}){return Ke(e,"GET","/v1/projects",t)})}/**
|
|
1966
1966
|
* @license
|
|
1967
1967
|
* Copyright 2020 Google LLC
|
|
1968
1968
|
*
|
|
@@ -1977,7 +1977,7 @@
|
|
|
1977
1977
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1978
1978
|
* See the License for the specific language governing permissions and
|
|
1979
1979
|
* limitations under the License.
|
|
1980
|
-
*/const
|
|
1980
|
+
*/const JC=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,XC=/^https?/;function ZC(e){return k(this,null,function*(){if(e.config.emulator)return;const{authorizedDomains:t}=yield Af(e);for(const n of t)try{if(ew(n))return}catch(r){}bt(e,"unauthorized-domain")})}function ew(e){const t=Ai(),{protocol:n,hostname:r}=new URL(t);if(e.startsWith("chrome-extension://")){const a=new URL(e);return a.hostname===""&&r===""?n==="chrome-extension:"&&e.replace("chrome-extension://","")===t.replace("chrome-extension://",""):n==="chrome-extension:"&&a.hostname===r}if(!XC.test(n))return!1;if(JC.test(e))return r===e;const i=e.replace(/\./g,"\\.");return new RegExp("^(.+\\."+i+"|"+i+")$","i").test(r)}/**
|
|
1981
1981
|
* @license
|
|
1982
1982
|
* Copyright 2020 Google LLC.
|
|
1983
1983
|
*
|
|
@@ -1992,7 +1992,7 @@
|
|
|
1992
1992
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
1993
1993
|
* See the License for the specific language governing permissions and
|
|
1994
1994
|
* limitations under the License.
|
|
1995
|
-
*/const
|
|
1995
|
+
*/const tw=new Ti(3e4,6e4);function Tf(){const e=ut().___jsl;if(e!=null&&e.H){for(const t of Object.keys(e.H))if(e.H[t].r=e.H[t].r||[],e.H[t].L=e.H[t].L||[],e.H[t].r=[...e.H[t].L],e.CP)for(let n=0;n<e.CP.length;n++)e.CP[n]=null}}function nw(e){return new Promise((t,n)=>{var r,i,o;function a(){Tf(),gapi.load("gapi.iframes",{callback:()=>{t(gapi.iframes.getContext())},ontimeout:()=>{Tf(),n(mt(e,"network-request-failed"))},timeout:tw.get()})}if(!((i=(r=ut().gapi)===null||r===void 0?void 0:r.iframes)===null||i===void 0)&&i.Iframe)t(gapi.iframes.getContext());else if(!((o=ut().gapi)===null||o===void 0)&&o.load)a();else{const s=Yd("iframefcb");return ut()[s]=()=>{gapi.load?a():n(mt(e,"network-request-failed"))},ll(`${Yy()}?onload=${s}`).catch(l=>n(l))}}).catch(t=>{throw Xo=null,t})}let Xo=null;function rw(e){return Xo=Xo||nw(e),Xo}/**
|
|
1996
1996
|
* @license
|
|
1997
1997
|
* Copyright 2020 Google LLC.
|
|
1998
1998
|
*
|
|
@@ -2007,7 +2007,7 @@
|
|
|
2007
2007
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2008
2008
|
* See the License for the specific language governing permissions and
|
|
2009
2009
|
* limitations under the License.
|
|
2010
|
-
*/const
|
|
2010
|
+
*/const iw=new Ti(5e3,15e3),ow="__/auth/iframe",aw="emulator/auth/iframe",sw={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},lw=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function cw(e){const t=e.config;oe(t.authDomain,e,"auth-domain-config-required");const n=t.emulator?ol(t,aw):`https://${e.config.authDomain}/${ow}`,r={apiKey:t.apiKey,appName:e.name,v:cr},i=lw.get(e.config.apiHost);i&&(r.eid=i);const o=e._getFrameworks();return o.length&&(r.fw=o.join(",")),`${n}?${Tr(r).slice(1)}`}function uw(e){return k(this,null,function*(){const t=yield rw(e),n=ut().gapi;return oe(n,e,"internal-error"),t.open({where:document.body,url:cw(e),messageHandlersFilter:n.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:sw,dontclear:!0},r=>new Promise((i,o)=>k(this,null,function*(){yield r.restyle({setHideOnLeave:!1});const a=mt(e,"network-request-failed"),s=ut().setTimeout(()=>{o(a)},iw.get());function l(){ut().clearTimeout(s),i(r)}r.ping(l).then(l,()=>{o(a)})})))})}/**
|
|
2011
2011
|
* @license
|
|
2012
2012
|
* Copyright 2020 Google LLC.
|
|
2013
2013
|
*
|
|
@@ -2022,7 +2022,7 @@
|
|
|
2022
2022
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2023
2023
|
* See the License for the specific language governing permissions and
|
|
2024
2024
|
* limitations under the License.
|
|
2025
|
-
*/const
|
|
2025
|
+
*/const dw={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},fw=500,hw=600,pw="_blank",gw="http://localhost";class Ef{constructor(t){this.window=t,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch(t){}}}function mw(e,t,n,r=fw,i=hw){const o=Math.max((window.screen.availHeight-i)/2,0).toString(),a=Math.max((window.screen.availWidth-r)/2,0).toString();let s="";const l=Object.assign(Object.assign({},dw),{width:r.toString(),height:i.toString(),top:o,left:a}),c=gt().toLowerCase();n&&(s=zd(c)?pw:n),Nd(c)&&(t=t||gw,l.scrollbars="yes");const d=Object.entries(l).reduce((h,[p,m])=>`${h}${p}=${m},`,"");if($y(c)&&s!=="_self")return vw(t||"",s),new Ef(null);const f=window.open(t||"",s,d);oe(f,e,"popup-blocked");try{f.focus()}catch(h){}return new Ef(f)}function vw(e,t){const n=document.createElement("a");n.href=e,n.target=t;const r=document.createEvent("MouseEvent");r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),n.dispatchEvent(r)}/**
|
|
2026
2026
|
* @license
|
|
2027
2027
|
* Copyright 2021 Google LLC
|
|
2028
2028
|
*
|
|
@@ -2037,7 +2037,7 @@
|
|
|
2037
2037
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2038
2038
|
* See the License for the specific language governing permissions and
|
|
2039
2039
|
* limitations under the License.
|
|
2040
|
-
*/const
|
|
2040
|
+
*/const bw="__/auth/handler",yw="emulator/auth/handler",xw=encodeURIComponent("fac");function Sl(e,t,n,r,i,o){return k(this,null,function*(){oe(e.config.authDomain,e,"auth-domain-config-required"),oe(e.config.apiKey,e,"invalid-api-key");const a={apiKey:e.config.apiKey,appName:e.name,authType:n,redirectUrl:r,v:cr,eventId:i};if(t instanceof Dn){t.setDefaultLanguage(e.languageCode),a.providerId=t.providerId||"",Wb(t.getCustomParameters())||(a.customParameters=JSON.stringify(t.getCustomParameters()));for(const[d,f]of Object.entries(o||{}))a[d]=f}if(t instanceof Br){const d=t.getScopes().filter(f=>f!=="");d.length>0&&(a.scopes=d.join(","))}e.tenantId&&(a.tid=e.tenantId);const s=a;for(const d of Object.keys(s))s[d]===void 0&&delete s[d];const l=yield e._getAppCheckToken(),c=l?`#${xw}=${encodeURIComponent(l)}`:"";return`${Cw(e)}?${Tr(s).slice(1)}${c}`})}function Cw({config:e}){return e.emulator?ol(e,yw):`https://${e.authDomain}/${bw}`}/**
|
|
2041
2041
|
* @license
|
|
2042
2042
|
* Copyright 2020 Google LLC
|
|
2043
2043
|
*
|
|
@@ -2052,7 +2052,7 @@
|
|
|
2052
2052
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2053
2053
|
* See the License for the specific language governing permissions and
|
|
2054
2054
|
* limitations under the License.
|
|
2055
|
-
*/const
|
|
2055
|
+
*/const Al="webStorageSupport";class ww{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=Jn,this._completeRedirectFn=Jo,this._overrideRedirectResult=Il}_openPopup(t,n,r,i){return k(this,null,function*(){var o;an((o=this.eventManagers[t._key()])===null||o===void 0?void 0:o.manager,"_initialize() not called before _openPopup()");const a=yield Sl(t,n,r,Ai(),i);return mw(t,a,Bi())})}_openRedirect(t,n,r,i){return k(this,null,function*(){yield this._originValidation(t);const o=yield Sl(t,n,r,Ai(),i);return oC(o),new Promise(()=>{})})}_initialize(t){const n=t._key();if(this.eventManagers[n]){const{manager:i,promise:o}=this.eventManagers[n];return i?Promise.resolve(i):(an(o,"If manager is not set, promise should be"),o)}const r=this.initAndGetManager(t);return this.eventManagers[n]={promise:r},r.catch(()=>{delete this.eventManagers[n]}),r}initAndGetManager(t){return k(this,null,function*(){const n=yield uw(t),r=new wf(t);return n.register("authEvent",i=>(oe(i==null?void 0:i.authEvent,t,"invalid-auth-event"),{status:r.onEvent(i.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[t._key()]={manager:r},this.iframes[t._key()]=n,r})}_isIframeWebStorageSupported(t,n){this.iframes[t._key()].send(Al,{type:Al},i=>{var o;const a=(o=i==null?void 0:i[0])===null||o===void 0?void 0:o[Al];a!==void 0&&n(!!a),bt(t,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=ZC(t)),this.originValidationPromises[n]}get _shouldInitProactively(){return Hd()||Fd()||Di()}}const kf=ww;class Iw{constructor(t){this.factorId=t}_process(t,n,r){switch(n.type){case"enroll":return this._finalizeEnroll(t,n.credential,r);case"signin":return this._finalizeSignIn(t,n.credential);default:return hn("unexpected MultiFactorSessionType")}}}class Tl extends Iw{constructor(t){super("phone"),this.credential=t}static _fromCredential(t){return new Tl(t)}_finalizeEnroll(t,n,r){return Xx(t,{idToken:n,displayName:r,phoneVerificationInfo:this.credential._makeVerificationRequest()})}_finalizeSignIn(t,n){return gC(t,{mfaPendingCredential:n,phoneVerificationInfo:this.credential._makeVerificationRequest()})}}class _f{constructor(){}static assertion(t){return Tl._fromCredential(t)}}_f.FACTOR_ID="phone";var Pf="@firebase/auth",Df="1.7.7";/**
|
|
2056
2056
|
* @license
|
|
2057
2057
|
* Copyright 2020 Google LLC
|
|
2058
2058
|
*
|
|
@@ -2067,7 +2067,7 @@
|
|
|
2067
2067
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2068
2068
|
* See the License for the specific language governing permissions and
|
|
2069
2069
|
* limitations under the License.
|
|
2070
|
-
*/class
|
|
2070
|
+
*/class Sw{constructor(t){this.auth=t,this.internalListeners=new Map}getUid(){var t;return this.assertAuthConfigured(),((t=this.auth.currentUser)===null||t===void 0?void 0:t.uid)||null}getToken(t){return k(this,null,function*(){return this.assertAuthConfigured(),yield this.auth._initializationPromise,this.auth.currentUser?{accessToken:yield this.auth.currentUser.getIdToken(t)}:null})}addAuthTokenListener(t){if(this.assertAuthConfigured(),this.internalListeners.has(t))return;const n=this.auth.onIdTokenChanged(r=>{t((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(t,n),this.updateProactiveRefresh()}removeAuthTokenListener(t){this.assertAuthConfigured();const n=this.internalListeners.get(t);n&&(this.internalListeners.delete(t),n(),this.updateProactiveRefresh())}assertAuthConfigured(){oe(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
|
|
2071
2071
|
* @license
|
|
2072
2072
|
* Copyright 2020 Google LLC
|
|
2073
2073
|
*
|
|
@@ -2082,7 +2082,7 @@
|
|
|
2082
2082
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2083
2083
|
* See the License for the specific language governing permissions and
|
|
2084
2084
|
* limitations under the License.
|
|
2085
|
-
*/function
|
|
2085
|
+
*/function Aw(e){switch(e){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Tw(e){lr(new Hn("auth",(t,{options:n})=>{const r=t.getProvider("app").getImmediate(),i=t.getProvider("heartbeat"),o=t.getProvider("app-check-internal"),{apiKey:a,authDomain:s}=r.options;oe(a&&!a.includes(":"),"invalid-api-key",{appName:r.name});const l={apiKey:a,authDomain:s,clientPlatform:e,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:Wd(e)},c=new Vy(r,i,o,l);return Xy(c,n),c},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((t,n,r)=>{t.getProvider("auth-internal").initialize()})),lr(new Hn("auth-internal",t=>{const n=qe(t.getProvider("auth").getImmediate());return(r=>new Sw(r))(n)},"PRIVATE").setInstantiationMode("EXPLICIT")),Tn(Pf,Df,Aw(e)),Tn(Pf,Df,"esm2017")}/**
|
|
2086
2086
|
* @license
|
|
2087
2087
|
* Copyright 2021 Google LLC
|
|
2088
2088
|
*
|
|
@@ -2097,7 +2097,7 @@
|
|
|
2097
2097
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2098
2098
|
* See the License for the specific language governing permissions and
|
|
2099
2099
|
* limitations under the License.
|
|
2100
|
-
*/const
|
|
2100
|
+
*/const Ew=5*60,kw=qu("authIdTokenMaxAge")||Ew;let Of=null;const _w=e=>t=>k(this,null,function*(){const n=t&&(yield t.getIdTokenResult()),r=n&&(new Date().getTime()-Date.parse(n.issuedAtTime))/1e3;if(r&&r>kw)return;const i=n==null?void 0:n.token;Of!==i&&(Of=i,yield fetch(e,{method:i?"POST":"DELETE",headers:i?{Authorization:`Bearer ${i}`}:{}}))});function Pw(e=hd()){const t=Ro(e,"auth");if(t.isInitialized())return t.getImmediate();const n=Jy(e,{popupRedirectResolver:kf,persistence:[jr,Wo,Jn]}),r=qu("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const o=new URL(r,location.origin);if(location.origin===o.origin){const a=_w(o.toString());qx(n,a,()=>a(n.currentUser)),Kx(n,s=>a(s))}}const i=$b("auth");return i&&cl(n,`http://${i}`),n}function Dw(){var e,t;return(t=(e=document.getElementsByTagName("head"))===null||e===void 0?void 0:e[0])!==null&&t!==void 0?t:document}Hy({loadJS(e){return new Promise((t,n)=>{const r=document.createElement("script");r.setAttribute("src",e),r.onload=t,r.onerror=i=>{const o=mt("internal-error");o.customData=i,n(o)},r.type="text/javascript",r.charset="UTF-8",Dw().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="}),Tw("Browser");/**
|
|
2101
2101
|
* @license
|
|
2102
2102
|
* Copyright 2021 Google LLC
|
|
2103
2103
|
*
|
|
@@ -2112,7 +2112,7 @@
|
|
|
2112
2112
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2113
2113
|
* See the License for the specific language governing permissions and
|
|
2114
2114
|
* limitations under the License.
|
|
2115
|
-
*/function
|
|
2115
|
+
*/function gr(){return window}/**
|
|
2116
2116
|
* @license
|
|
2117
2117
|
* Copyright 2020 Google LLC
|
|
2118
2118
|
*
|
|
@@ -2127,7 +2127,7 @@
|
|
|
2127
2127
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2128
2128
|
* See the License for the specific language governing permissions and
|
|
2129
2129
|
* limitations under the License.
|
|
2130
|
-
*/const
|
|
2130
|
+
*/const Ow=2e3;function Rw(e,t,n){return k(this,null,function*(){var r;const{BuildInfo:i}=gr();an(t.sessionId,"AuthEvent did not contain a session ID");const o=yield Nw(t.sessionId),a={};return Di()?a.ibi=i.packageName:Pi()?a.apn=i.packageName:bt(e,"operation-not-supported-in-this-environment"),i.displayName&&(a.appDisplayName=i.displayName),a.sessionId=o,Sl(e,n,t.type,void 0,(r=t.eventId)!==null&&r!==void 0?r:void 0,a)})}function Lw(e){return k(this,null,function*(){const{BuildInfo:t}=gr(),n={};Di()?n.iosBundleId=t.packageName:Pi()?n.androidPackageName=t.packageName:bt(e,"operation-not-supported-in-this-environment"),yield Af(e,n)})}function Mw(e){const{cordova:t}=gr();return new Promise(n=>{t.plugins.browsertab.isAvailable(r=>{let i=null;r?t.plugins.browsertab.openUrl(e):i=t.InAppBrowser.open(e,By()?"_blank":"_system","location=yes"),n(i)})})}function Bw(e,t,n){return k(this,null,function*(){const{cordova:r}=gr();let i=()=>{};try{yield new Promise((o,a)=>{let s=null;function l(){var f;o();const h=(f=r.plugins.browsertab)===null||f===void 0?void 0:f.close;typeof h=="function"&&h(),typeof(n==null?void 0:n.close)=="function"&&n.close()}function c(){s||(s=window.setTimeout(()=>{a(mt(e,"redirect-cancelled-by-user"))},Ow))}function d(){(document==null?void 0:document.visibilityState)==="visible"&&c()}t.addPassiveListener(l),document.addEventListener("resume",c,!1),Pi()&&document.addEventListener("visibilitychange",d,!1),i=()=>{t.removePassiveListener(l),document.removeEventListener("resume",c,!1),document.removeEventListener("visibilitychange",d,!1),s&&window.clearTimeout(s)}})}finally{i()}})}function $w(e){var t,n,r,i,o,a,s,l,c,d;const f=gr();oe(typeof((t=f==null?void 0:f.universalLinks)===null||t===void 0?void 0:t.subscribe)=="function",e,"invalid-cordova-configuration",{missingPlugin:"cordova-universal-links-plugin-fix"}),oe(typeof((n=f==null?void 0:f.BuildInfo)===null||n===void 0?void 0:n.packageName)!="undefined",e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-buildInfo"}),oe(typeof((o=(i=(r=f==null?void 0:f.cordova)===null||r===void 0?void 0:r.plugins)===null||i===void 0?void 0:i.browsertab)===null||o===void 0?void 0:o.openUrl)=="function",e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),oe(typeof((l=(s=(a=f==null?void 0:f.cordova)===null||a===void 0?void 0:a.plugins)===null||s===void 0?void 0:s.browsertab)===null||l===void 0?void 0:l.isAvailable)=="function",e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-browsertab"}),oe(typeof((d=(c=f==null?void 0:f.cordova)===null||c===void 0?void 0:c.InAppBrowser)===null||d===void 0?void 0:d.open)=="function",e,"invalid-cordova-configuration",{missingPlugin:"cordova-plugin-inappbrowser"})}function Nw(e){return k(this,null,function*(){const t=Fw(e),n=yield crypto.subtle.digest("SHA-256",t);return Array.from(new Uint8Array(n)).map(i=>i.toString(16).padStart(2,"0")).join("")})}function Fw(e){if(an(/[0-9a-zA-Z]+/.test(e),"Can only convert alpha-numeric strings"),typeof TextEncoder!="undefined")return new TextEncoder().encode(e);const t=new ArrayBuffer(e.length),n=new Uint8Array(t);for(let r=0;r<e.length;r++)n[r]=e.charCodeAt(r);return n}/**
|
|
2131
2131
|
* @license
|
|
2132
2132
|
* Copyright 2020 Google LLC
|
|
2133
2133
|
*
|
|
@@ -2142,7 +2142,7 @@
|
|
|
2142
2142
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2143
2143
|
* See the License for the specific language governing permissions and
|
|
2144
2144
|
* limitations under the License.
|
|
2145
|
-
*/const
|
|
2145
|
+
*/const zw=20;class jw extends wf{constructor(){super(...arguments),this.passiveListeners=new Set,this.initPromise=new Promise(t=>{this.resolveInitialized=t})}addPassiveListener(t){this.passiveListeners.add(t)}removePassiveListener(t){this.passiveListeners.delete(t)}resetRedirect(){this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1}onEvent(t){return this.resolveInitialized(),this.passiveListeners.forEach(n=>n(t)),super.onEvent(t)}initialized(){return k(this,null,function*(){yield this.initPromise})}}function Uw(e,t,n=null){return{type:t,eventId:n,urlResponse:null,sessionId:Ww(),postBody:null,tenantId:e.tenantId,error:mt(e,"no-auth-event")}}function Vw(e,t){return El()._set(kl(e),t)}function Rf(e){return k(this,null,function*(){const t=yield El()._get(kl(e));return t&&(yield El()._remove(kl(e))),t})}function Hw(e,t){var n,r;const i=Yw(t);if(i.includes("/__/auth/callback")){const o=Zo(i),a=o.firebaseError?Gw(decodeURIComponent(o.firebaseError)):null,s=(r=(n=a==null?void 0:a.code)===null||n===void 0?void 0:n.split("auth/"))===null||r===void 0?void 0:r[1],l=s?mt(s):null;return l?{type:e.type,eventId:e.eventId,tenantId:e.tenantId,error:l,urlResponse:null,sessionId:null,postBody:null}:{type:e.type,eventId:e.eventId,tenantId:e.tenantId,sessionId:e.sessionId,urlResponse:i,postBody:null}}return null}function Ww(){const e=[],t="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";for(let n=0;n<zw;n++){const r=Math.floor(Math.random()*t.length);e.push(t.charAt(r))}return e.join("")}function El(){return Ut(Wo)}function kl(e){return ur("authEvent",e.config.apiKey,e.name)}function Gw(e){try{return JSON.parse(e)}catch(t){return null}}function Yw(e){const t=Zo(e),n=t.link?decodeURIComponent(t.link):void 0,r=Zo(n).link,i=t.deep_link_id?decodeURIComponent(t.deep_link_id):void 0;return Zo(i).link||i||r||n||e}function Zo(e){if(!(e!=null&&e.includes("?")))return{};const[t,...n]=e.split("?");return Er(n.join("?"))}/**
|
|
2146
2146
|
* @license
|
|
2147
2147
|
* Copyright 2021 Google LLC
|
|
2148
2148
|
*
|
|
@@ -2157,7 +2157,7 @@
|
|
|
2157
2157
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2158
2158
|
* See the License for the specific language governing permissions and
|
|
2159
2159
|
* limitations under the License.
|
|
2160
|
-
*/const
|
|
2160
|
+
*/const Kw=500;class qw{constructor(){this._redirectPersistence=Jn,this._shouldInitProactively=!0,this.eventManagers=new Map,this.originValidationPromises={},this._completeRedirectFn=Jo,this._overrideRedirectResult=Il}_initialize(t){return k(this,null,function*(){const n=t._key();let r=this.eventManagers.get(n);return r||(r=new jw(t),this.eventManagers.set(n,r),this.attachCallbackListeners(t,r)),r})}_openPopup(t){bt(t,"operation-not-supported-in-this-environment")}_openRedirect(t,n,r,i){return k(this,null,function*(){$w(t);const o=yield this._initialize(t);yield o.initialized(),o.resetRedirect(),jC(),yield this._originValidation(t);const a=Uw(t,r,i);yield Vw(t,a);const s=yield Rw(t,a,n),l=yield Mw(s);return Bw(t,o,l)})}_isIframeWebStorageSupported(t,n){throw new Error("Method not implemented.")}_originValidation(t){const n=t._key();return this.originValidationPromises[n]||(this.originValidationPromises[n]=Lw(t)),this.originValidationPromises[n]}attachCallbackListeners(t,n){const{universalLinks:r,handleOpenURL:i,BuildInfo:o}=gr(),a=setTimeout(()=>k(this,null,function*(){yield Rf(t),n.onEvent(Lf())}),Kw),s=d=>k(this,null,function*(){clearTimeout(a);const f=yield Rf(t);let h=null;f&&(d!=null&&d.url)&&(h=Hw(f,d.url)),n.onEvent(h||Lf())});typeof r!="undefined"&&typeof r.subscribe=="function"&&r.subscribe(null,s);const l=i,c=`${o.packageName.toLowerCase()}://`;gr().handleOpenURL=d=>k(this,null,function*(){if(d.toLowerCase().startsWith(c)&&s({url:d}),typeof l=="function")try{l(d)}catch(f){console.error(f)}})}}const Qw=qw;function Lf(){return{type:"unknown",eventId:null,sessionId:null,urlResponse:null,postBody:null,tenantId:null,error:mt("no-auth-event")}}/**
|
|
2161
2161
|
* @license
|
|
2162
2162
|
* Copyright 2017 Google LLC
|
|
2163
2163
|
*
|
|
@@ -2172,7 +2172,7 @@
|
|
|
2172
2172
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2173
2173
|
* See the License for the specific language governing permissions and
|
|
2174
2174
|
* limitations under the License.
|
|
2175
|
-
*/function
|
|
2175
|
+
*/function Jw(e,t){qe(e)._logFramework(t)}var Xw="@firebase/auth-compat",Zw="0.5.12";/**
|
|
2176
2176
|
* @license
|
|
2177
2177
|
* Copyright 2020 Google LLC
|
|
2178
2178
|
*
|
|
@@ -2187,7 +2187,7 @@
|
|
|
2187
2187
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2188
2188
|
* See the License for the specific language governing permissions and
|
|
2189
2189
|
* limitations under the License.
|
|
2190
|
-
*/const
|
|
2190
|
+
*/const eI=1e3;function zi(){var e;return((e=self==null?void 0:self.location)===null||e===void 0?void 0:e.protocol)||null}function tI(){return zi()==="http:"||zi()==="https:"}function Mf(e=gt()){return!!((zi()==="file:"||zi()==="ionic:"||zi()==="capacitor:")&&e.toLowerCase().match(/iphone|ipad|ipod|android/))}function nI(){return zs()||Qu()}function rI(){return Zu()&&(document==null?void 0:document.documentMode)===11}function iI(e=gt()){return/Edge\/\d+/.test(e)}function oI(e=gt()){return rI()||iI(e)}function Bf(){try{const e=self.localStorage,t=Bi();if(e)return e.setItem(t,"1"),e.removeItem(t),oI()?Po():!0}catch(e){return _l()&&Po()}return!1}function _l(){return typeof global!="undefined"&&"WorkerGlobalScope"in global&&"importScripts"in global}function Pl(){return(tI()||Xu()||Mf())&&!nI()&&Bf()&&!_l()}function $f(){return Mf()&&typeof document!="undefined"}function aI(){return k(this,null,function*(){return $f()?new Promise(e=>{const t=setTimeout(()=>{e(!1)},eI);document.addEventListener("deviceready",()=>{clearTimeout(t),e(!0)})}):!1})}function sI(){return typeof window!="undefined"?window:null}/**
|
|
2191
2191
|
* @license
|
|
2192
2192
|
* Copyright 2020 Google LLC
|
|
2193
2193
|
*
|
|
@@ -2202,7 +2202,7 @@
|
|
|
2202
2202
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2203
2203
|
* See the License for the specific language governing permissions and
|
|
2204
2204
|
* limitations under the License.
|
|
2205
|
-
*/const
|
|
2205
|
+
*/const Vt={LOCAL:"local",NONE:"none",SESSION:"session"},ji=oe,Nf="persistence";function lI(e,t){if(ji(Object.values(Vt).includes(t),e,"invalid-persistence-type"),zs()){ji(t!==Vt.SESSION,e,"unsupported-persistence-type");return}if(Qu()){ji(t===Vt.NONE,e,"unsupported-persistence-type");return}if(_l()){ji(t===Vt.NONE||t===Vt.LOCAL&&Po(),e,"unsupported-persistence-type");return}ji(t===Vt.NONE||Bf(),e,"unsupported-persistence-type")}function Dl(e){return k(this,null,function*(){yield e._initializationPromise;const t=Ff(),n=ur(Nf,e.config.apiKey,e.name);t&&t.setItem(n,e._getPersistence())})}function cI(e,t){const n=Ff();if(!n)return[];const r=ur(Nf,e,t);switch(n.getItem(r)){case Vt.NONE:return[Rr];case Vt.LOCAL:return[jr,Jn];case Vt.SESSION:return[Jn];default:return[]}}function Ff(){var e;try{return((e=sI())===null||e===void 0?void 0:e.sessionStorage)||null}catch(t){return null}}/**
|
|
2206
2206
|
* @license
|
|
2207
2207
|
* Copyright 2020 Google LLC
|
|
2208
2208
|
*
|
|
@@ -2217,7 +2217,7 @@
|
|
|
2217
2217
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2218
2218
|
* See the License for the specific language governing permissions and
|
|
2219
2219
|
* limitations under the License.
|
|
2220
|
-
*/const
|
|
2220
|
+
*/const uI=oe;class Xn{constructor(){this.browserResolver=Ut(kf),this.cordovaResolver=Ut(Qw),this.underlyingResolver=null,this._redirectPersistence=Jn,this._completeRedirectFn=Jo,this._overrideRedirectResult=Il}_initialize(t){return k(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._initialize(t)})}_openPopup(t,n,r,i){return k(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openPopup(t,n,r,i)})}_openRedirect(t,n,r,i){return k(this,null,function*(){return yield this.selectUnderlyingResolver(),this.assertedUnderlyingResolver._openRedirect(t,n,r,i)})}_isIframeWebStorageSupported(t,n){this.assertedUnderlyingResolver._isIframeWebStorageSupported(t,n)}_originValidation(t){return this.assertedUnderlyingResolver._originValidation(t)}get _shouldInitProactively(){return $f()||this.browserResolver._shouldInitProactively}get assertedUnderlyingResolver(){return uI(this.underlyingResolver,"internal-error"),this.underlyingResolver}selectUnderlyingResolver(){return k(this,null,function*(){if(this.underlyingResolver)return;const t=yield aI();this.underlyingResolver=t?this.cordovaResolver:this.browserResolver})}}/**
|
|
2221
2221
|
* @license
|
|
2222
2222
|
* Copyright 2020 Google LLC
|
|
2223
2223
|
*
|
|
@@ -2232,7 +2232,7 @@
|
|
|
2232
2232
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2233
2233
|
* See the License for the specific language governing permissions and
|
|
2234
2234
|
* limitations under the License.
|
|
2235
|
-
*/function
|
|
2235
|
+
*/function zf(e){return e.unwrap()}function dI(e){return e.wrapped()}/**
|
|
2236
2236
|
* @license
|
|
2237
2237
|
* Copyright 2020 Google LLC
|
|
2238
2238
|
*
|
|
@@ -2247,7 +2247,7 @@
|
|
|
2247
2247
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2248
2248
|
* See the License for the specific language governing permissions and
|
|
2249
2249
|
* limitations under the License.
|
|
2250
|
-
*/function
|
|
2250
|
+
*/function fI(e){return jf(e)}function hI(e,t){var n;const r=(n=t.customData)===null||n===void 0?void 0:n._tokenResponse;if((t==null?void 0:t.code)==="auth/multi-factor-auth-required"){const i=t;i.resolver=new pI(e,Qx(e,t))}else if(r){const i=jf(t),o=t;i&&(o.credential=i,o.tenantId=r.tenantId||void 0,o.email=r.email||void 0,o.phoneNumber=r.phoneNumber||void 0)}}function jf(e){const{_tokenResponse:t}=e instanceof $t?e.customData:e;if(!t)return null;if(!(e instanceof $t)&&"temporaryProof"in t&&"phoneNumber"in t)return hr.credentialFromResult(e);const n=t.providerId;if(!n||n===Si.PASSWORD)return null;let r;switch(n){case Si.GOOGLE:r=mn;break;case Si.FACEBOOK:r=gn;break;case Si.GITHUB:r=vn;break;case Si.TWITTER:r=bn;break;default:const{oauthIdToken:i,oauthAccessToken:o,oauthTokenSecret:a,pendingToken:s,nonce:l}=t;return!o&&!a&&!i&&!s?null:s?n.startsWith("saml.")?Nr._create(n,s):pn._fromParams({providerId:n,signInMethod:n,pendingToken:s,idToken:i,accessToken:o}):new $r(n).credential({idToken:i,accessToken:o,rawNonce:l})}return e instanceof $t?r.credentialFromError(e):r.credentialFromResult(e)}function Nt(e,t){return t.catch(n=>{throw n instanceof $t&&hI(e,n),n}).then(n=>{const r=n.operationType,i=n.user;return{operationType:r,credential:fI(n),additionalUserInfo:Yx(n),user:Rn.getOrCreate(i)}})}function Ol(e,t){return k(this,null,function*(){const n=yield t;return{verificationId:n.verificationId,confirm:r=>Nt(e,n.confirm(r))}})}class pI{constructor(t,n){this.resolver=n,this.auth=dI(t)}get session(){return this.resolver.session}get hints(){return this.resolver.hints}resolveSignIn(t){return Nt(zf(this.auth),this.resolver.resolveSignIn(t))}}/**
|
|
2251
2251
|
* @license
|
|
2252
2252
|
* Copyright 2020 Google LLC
|
|
2253
2253
|
*
|
|
@@ -2262,7 +2262,7 @@
|
|
|
2262
2262
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2263
2263
|
* See the License for the specific language governing permissions and
|
|
2264
2264
|
* limitations under the License.
|
|
2265
|
-
*/class
|
|
2265
|
+
*/class Rn{constructor(t){this._delegate=t,this.multiFactor=eC(t)}static getOrCreate(t){return Rn.USER_MAP.has(t)||Rn.USER_MAP.set(t,new Rn(t)),Rn.USER_MAP.get(t)}delete(){return this._delegate.delete()}reload(){return this._delegate.reload()}toJSON(){return this._delegate.toJSON()}getIdTokenResult(t){return this._delegate.getIdTokenResult(t)}getIdToken(t){return this._delegate.getIdToken(t)}linkAndRetrieveDataWithCredential(t){return this.linkWithCredential(t)}linkWithCredential(t){return k(this,null,function*(){return Nt(this.auth,of(this._delegate,t))})}linkWithPhoneNumber(t,n){return k(this,null,function*(){return Ol(this.auth,_C(this._delegate,t,n))})}linkWithPopup(t){return k(this,null,function*(){return Nt(this.auth,NC(this._delegate,t,Xn))})}linkWithRedirect(t){return k(this,null,function*(){return yield Dl(qe(this.auth)),GC(this._delegate,t,Xn)})}reauthenticateAndRetrieveDataWithCredential(t){return this.reauthenticateWithCredential(t)}reauthenticateWithCredential(t){return k(this,null,function*(){return Nt(this.auth,af(this._delegate,t))})}reauthenticateWithPhoneNumber(t,n){return Ol(this.auth,PC(this._delegate,t,n))}reauthenticateWithPopup(t){return Nt(this.auth,$C(this._delegate,t,Xn))}reauthenticateWithRedirect(t){return k(this,null,function*(){return yield Dl(qe(this.auth)),HC(this._delegate,t,Xn)})}sendEmailVerification(t){return Bx(this._delegate,t)}unlink(t){return k(this,null,function*(){return yield wx(this._delegate,t),this})}updateEmail(t){return zx(this._delegate,t)}updatePassword(t){return jx(this._delegate,t)}updatePhoneNumber(t){return DC(this._delegate,t)}updateProfile(t){return Fx(this._delegate,t)}verifyBeforeUpdateEmail(t,n){return $x(this._delegate,t,n)}get emailVerified(){return this._delegate.emailVerified}get isAnonymous(){return this._delegate.isAnonymous}get metadata(){return this._delegate.metadata}get phoneNumber(){return this._delegate.phoneNumber}get providerData(){return this._delegate.providerData}get refreshToken(){return this._delegate.refreshToken}get tenantId(){return this._delegate.tenantId}get displayName(){return this._delegate.displayName}get email(){return this._delegate.email}get photoURL(){return this._delegate.photoURL}get providerId(){return this._delegate.providerId}get uid(){return this._delegate.uid}get auth(){return this._delegate.auth}}Rn.USER_MAP=new WeakMap;/**
|
|
2266
2266
|
* @license
|
|
2267
2267
|
* Copyright 2020 Google LLC
|
|
2268
2268
|
*
|
|
@@ -2277,7 +2277,7 @@
|
|
|
2277
2277
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2278
2278
|
* See the License for the specific language governing permissions and
|
|
2279
2279
|
* limitations under the License.
|
|
2280
|
-
*/const
|
|
2280
|
+
*/const Ui=oe;class Rl{constructor(t,n){if(this.app=t,n.isInitialized()){this._delegate=n.getImmediate(),this.linkUnderlyingAuth();return}const{apiKey:r}=t.options;Ui(r,"invalid-api-key",{appName:t.name}),Ui(r,"invalid-api-key",{appName:t.name});const i=typeof window!="undefined"?Xn:void 0;this._delegate=n.initialize({options:{persistence:gI(r,t.name),popupRedirectResolver:i}}),this._delegate._updateErrorMap(gy),this.linkUnderlyingAuth()}get emulatorConfig(){return this._delegate.emulatorConfig}get currentUser(){return this._delegate.currentUser?Rn.getOrCreate(this._delegate.currentUser):null}get languageCode(){return this._delegate.languageCode}set languageCode(t){this._delegate.languageCode=t}get settings(){return this._delegate.settings}get tenantId(){return this._delegate.tenantId}set tenantId(t){this._delegate.tenantId=t}useDeviceLanguage(){this._delegate.useDeviceLanguage()}signOut(){return this._delegate.signOut()}useEmulator(t,n){cl(this._delegate,t,n)}applyActionCode(t){return Ex(this._delegate,t)}checkActionCode(t){return sf(this._delegate,t)}confirmPasswordReset(t,n){return Tx(this._delegate,t,n)}createUserWithEmailAndPassword(t,n){return k(this,null,function*(){return Nt(this._delegate,_x(this._delegate,t,n))})}fetchProvidersForEmail(t){return this.fetchSignInMethodsForEmail(t)}fetchSignInMethodsForEmail(t){return Mx(this._delegate,t)}isSignInWithEmailLink(t){return Ox(this._delegate,t)}getRedirectResult(){return k(this,null,function*(){Ui(Pl(),this._delegate,"operation-not-supported-in-this-environment");const t=yield KC(this._delegate,Xn);return t?Nt(this._delegate,Promise.resolve(t)):{credential:null,user:null}})}addFrameworkForLogging(t){Jw(this._delegate,t)}onAuthStateChanged(t,n,r){const{next:i,error:o,complete:a}=Uf(t,n,r);return this._delegate.onAuthStateChanged(i,o,a)}onIdTokenChanged(t,n,r){const{next:i,error:o,complete:a}=Uf(t,n,r);return this._delegate.onIdTokenChanged(i,o,a)}sendSignInLinkToEmail(t,n){return Dx(this._delegate,t,n)}sendPasswordResetEmail(t,n){return Ax(this._delegate,t,n||void 0)}setPersistence(t){return k(this,null,function*(){lI(this._delegate,t);let n;switch(t){case Vt.SESSION:n=Jn;break;case Vt.LOCAL:n=(yield Ut(jr)._isAvailable())?jr:Wo;break;case Vt.NONE:n=Rr;break;default:return bt("argument-error",{appName:this._delegate.name})}return this._delegate.setPersistence(n)})}signInAndRetrieveDataWithCredential(t){return this.signInWithCredential(t)}signInAnonymously(){return Nt(this._delegate,Cx(this._delegate))}signInWithCredential(t){return Nt(this._delegate,Uo(this._delegate,t))}signInWithCustomToken(t){return Nt(this._delegate,Sx(this._delegate,t))}signInWithEmailAndPassword(t,n){return Nt(this._delegate,Px(this._delegate,t,n))}signInWithEmailLink(t,n){return Nt(this._delegate,Rx(this._delegate,t,n))}signInWithPhoneNumber(t,n){return Ol(this._delegate,kC(this._delegate,t,n))}signInWithPopup(t){return k(this,null,function*(){return Ui(Pl(),this._delegate,"operation-not-supported-in-this-environment"),Nt(this._delegate,BC(this._delegate,t,Xn))})}signInWithRedirect(t){return k(this,null,function*(){return Ui(Pl(),this._delegate,"operation-not-supported-in-this-environment"),yield Dl(this._delegate),UC(this._delegate,t,Xn)})}updateCurrentUser(t){return this._delegate.updateCurrentUser(t)}verifyPasswordResetCode(t){return kx(this._delegate,t)}unwrap(){return this._delegate}_delete(){return this._delegate._delete()}linkUnderlyingAuth(){this._delegate.wrapped=()=>this}}Rl.Persistence=Vt;function Uf(e,t,n){let r=e;typeof e!="function"&&({next:r,error:t,complete:n}=e);const i=r;return{next:a=>i(a&&Rn.getOrCreate(a)),error:t,complete:n}}function gI(e,t){const n=cI(e,t);if(typeof self!="undefined"&&!n.includes(jr)&&n.push(jr),typeof window!="undefined")for(const r of[Wo,Jn])n.includes(r)||n.push(r);return n.includes(Rr)||n.push(Rr),n}/**
|
|
2281
2281
|
* @license
|
|
2282
2282
|
* Copyright 2020 Google LLC
|
|
2283
2283
|
*
|
|
@@ -2292,7 +2292,7 @@
|
|
|
2292
2292
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2293
2293
|
* See the License for the specific language governing permissions and
|
|
2294
2294
|
* limitations under the License.
|
|
2295
|
-
*/class
|
|
2295
|
+
*/class Ll{constructor(){this.providerId="phone",this._delegate=new hr(zf(Kn.auth()))}static credential(t,n){return hr.credential(t,n)}verifyPhoneNumber(t,n){return this._delegate.verifyPhoneNumber(t,n)}unwrap(){return this._delegate}}Ll.PHONE_SIGN_IN_METHOD=hr.PHONE_SIGN_IN_METHOD,Ll.PROVIDER_ID=hr.PROVIDER_ID;/**
|
|
2296
2296
|
* @license
|
|
2297
2297
|
* Copyright 2020 Google LLC
|
|
2298
2298
|
*
|
|
@@ -2307,7 +2307,7 @@
|
|
|
2307
2307
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2308
2308
|
* See the License for the specific language governing permissions and
|
|
2309
2309
|
* limitations under the License.
|
|
2310
|
-
*/const
|
|
2310
|
+
*/const mI=oe;class vI{constructor(t,n,r=Kn.app()){var i;mI((i=r.options)===null||i===void 0?void 0:i.apiKey,"invalid-api-key",{appName:r.name}),this._delegate=new TC(r.auth(),t,n),this.type=this._delegate.type}clear(){this._delegate.clear()}render(){return this._delegate.render()}verify(){return this._delegate.verify()}}/**
|
|
2311
2311
|
* @license
|
|
2312
2312
|
* Copyright 2020 Google LLC
|
|
2313
2313
|
*
|
|
@@ -2322,4 +2322,172 @@
|
|
|
2322
2322
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2323
2323
|
* See the License for the specific language governing permissions and
|
|
2324
2324
|
* limitations under the License.
|
|
2325
|
-
*/const Zd="auth-compat";function eu(n){n.INTERNAL.registerComponent(new ne(Zd,e=>{const t=e.getProvider("app-compat").getImmediate(),i=e.getProvider("auth");return new Un(t,i)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:Ae.EMAIL_SIGNIN,PASSWORD_RESET:Ae.PASSWORD_RESET,RECOVER_EMAIL:Ae.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:Ae.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:Ae.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:Ae.VERIFY_EMAIL}},EmailAuthProvider:ce,FacebookAuthProvider:$,GithubAuthProvider:H,GoogleAuthProvider:W,OAuthProvider:De,SAMLAuthProvider:Tt,PhoneAuthProvider:Dn,PhoneMultiFactorGenerator:Rr,RecaptchaVerifier:Xd,TwitterAuthProvider:j,Auth:Un,AuthCredential:Le,Error:N}).setInstantiationMode("LAZY").setMultipleInstances(!1)),n.registerVersion(Ld,Ud)}eu(ae);let Wr=!1;const Hr=n=>{if(Wr)return ae.auth();if(n&&n==="dev"){ae.initializeApp({apiKey:"api_key"});const t=ud();dn(t,"http://localhost:39199")}else{const t={apiKey:n&&n==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:2ee87d5b274e0e7685f5e7",measurementId:"G-RH90B03KJG"};ae.initializeApp(t)}return Wr=!0,ae.auth()},tu=n=>n==="dev"?"http://localhost:8070/v1":n==="staging"?"https://client.fansunitedstagingapi.com/v1":n==="watg"?"https://client.watg.fansunitedapi.com/v1":n==="yolo"?"https://client.yolo.fansunitedapi.com/v1":n==="cska"?"https://client.cska.fansunitedapi.com/v1":"https://client.fansunitedapi.com/v1";class nu{constructor(e,t){u(this,"apiKey","");u(this,"clientId","");u(this,"environment","");u(this,"mainQueryParams",{key:"",client_id:""});u(this,"headers",{"Content-Type":"application/json"});u(this,"clientApiBaseUrl","");u(this,"sportal365ImagesSearchURL","https://content.api.sportal365.com/v2/images/search?");u(this,"sportal365Config",null);u(this,"generateSignedInUrl",e=>o(this,null,function*(){const t=`/clients/${this.clientId}/generate-signed-url?`,i={key:this.apiKey},r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(e)})}));u(this,"storeInBucket",(e,t,i)=>o(this,null,function*(){const r=yield fetch(e,{headers:i,method:"PUT",body:t});if(r.ok)return this.constructAssetsUrl(t.name);const s=yield r.text();this.throwErrorFromXmlResponse(s)}));u(this,"fetchImagesFromSportal365",(e,t,i)=>o(this,null,function*(){if(this.sportal365Config){const r={Project:this.sportal365Config.project,Authorization:this.sportal365Config.authorization};let s={query:e,page:i.toString()};return t&&(t.from&&(s=f(p({},s),{from:t.from})),t.to&&(s=f(p({},s),{to:t.to}))),yield fetch(this.sportal365ImagesSearchURL+new URLSearchParams(s),{headers:r})}}));u(this,"getSchedulersByEntityId",e=>o(this,null,function*(){const t=`/clients/${this.clientId}/scheduler/tasks?`,i={key:this.apiKey,limit:"50",entity_id:e},r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"setSchedulers",(e,t,i)=>o(this,null,function*(){let r="",s="";t==="CREATE"?(r=`/clients/${this.clientId}/scheduler/tasks?`,s="POST"):(r=`/clients/${this.clientId}/scheduler/tasks/${i}?`,s="PUT");const a={key:this.apiKey},c=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+c}),body:JSON.stringify(e),method:s})}));u(this,"deleteScheduledTask",e=>o(this,null,function*(){const t=`/clients/${this.clientId}/scheduler/tasks/${e}?`,i={key:this.apiKey},r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"getLoggedInStaffMember",()=>o(this,null,function*(){const i=(yield this.getToken()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),r=decodeURIComponent(window.atob(i).split("").map(function(s){return"%"+("00"+s.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(r)}));u(this,"constructAssetsUrl",e=>this.environment==="dev"?`https://storage.googleapis.com/client_images_cms_fans-united-dev/${this.clientId}/${e}`:this.environment==="staging"?`https://storage.googleapis.com/client_images_cms_fans-united-stage/${this.clientId}/${e}`:`https://uploads.fansunitedassets.com/${this.clientId}/${e}`);u(this,"throwErrorFromXmlResponse",e=>{const t=new window.DOMParser().parseFromString(e,"text/xml"),i=t.getElementsByTagName("Message")&&t.getElementsByTagName("Code").length>0?t.getElementsByTagName("Message")[0].textContent:"",r=t.getElementsByTagName("Details")&&t.getElementsByTagName("Code").length>0?t.getElementsByTagName("Details")[0].textContent:"";throw new Error(i+" "+r)});u(this,"getToken",()=>o(this,null,function*(){const e=Hr(this.environment).currentUser;return e?yield e.getIdToken():""}));this.apiKey=e.apiKey,this.clientId=e.clientId,this.environment=e.environment,this.mainQueryParams={key:e.apiKey,client_id:e.clientId},this.sportal365Config=t,this.clientApiBaseUrl=tu(this.environment)}}const iu=n=>n==="dev"?"http://localhost:8060/v1":n==="staging"?"https://loyalty.fansunitedstagingapi.com/v1":n==="watg"?"https://loyalty.watg.fansunitedapi.com/v1":n==="yolo"?"https://loyalty.yolo.fansunitedapi.com/v1":n==="cska"?"https://loyalty.cska.fansunitedapi.com/v1":"https://loyalty.fansunitedapi.com/v1",ru=n=>n==="dev"?"http://localhost:8040/v1":n==="staging"?"https://prediction.fansunitedstagingapi.com/v1":n==="watg"?"https://prediction.watg.fansunitedapi.com/v1":n==="yolo"?"https://prediction.yolo.fansunitedapi.com/v1":n==="cska"?"https://prediction.cska.fansunitedapi.com/v1":"https://prediction.fansunitedapi.com/v1",su=n=>n==="dev"?"http://localhost:9040/v1":n==="staging"?"https://mini-games.fansunitedstagingapi.com/v1":n==="watg"?"https://mini-games.watg.fansunitedapi.com/v1":n==="yolo"?"https://mini-games.yolo.fansunitedapi.com/v1":n==="cska"?"https://mini-games.cska.fansunitedapi.com/v1":"https://mini-games.fansunitedapi.com/v1",au=n=>n==="dev"?"http://localhost:8020/v1":n==="staging"?"https://reporting.fansunitedstagingapi.com/v1":n==="watg"?"https://reporting.watg.fansunitedapi.com/v1":n==="yolo"?"https://reporting.yolo.fansunitedapi.com/v1":n==="cska"?"https://reporting.cska.fansunitedapi.com/v1":"https://reporting.fansunitedapi.com/v1",ou=n=>n==="dev"?"http://localhost:9030/v1":n==="staging"?"https://voting.fansunitedstagingapi.com/v1":n==="watg"?"https://voting.watg.fansunitedapi.com/v1":n==="yolo"?"https://voting.yolo.fansunitedapi.com/v1":n==="cska"?"https://voting.cska.fansunitedapi.com/v1":"https://voting.fansunitedapi.com/v1",cu=n=>n==="staging"?"https://custom-games-resolver-131809830171.europe-west1.run.app/v1":n==="watg"?"https://custom-games-resolver-1045682138584.southamerica-east1.run.app/v1":n==="yolo"?"https://custom-games-resolver-1054597592566.europe-west1.run.app/v1":n==="cska"?"https://custom-games-resolver-414330847655.europe-west1.run.app/v1":"https://custom-games-resolver-150199313674.europe-west1.run.app/v1",lu=n=>n==="dev"?"http://localhost:8010/v1":n==="staging"?"https://profile.fansunitedstagingapi.com/v1":n==="watg"?"https://profile.watg.fansunitedapi.com/v1":n==="yolo"?"https://profile.yolo.fansunitedapi.com/v1":n==="cska"?"https://profile.cska.fansunitedapi.com/v1":"https://profile.fansunitedapi.com/v1",du=n=>n==="dev"?"http://localhost:8010/v1":n==="staging"?"https://discussions.fansunitedstagingapi.com/v1":n==="watg"?"https://discussions.watg.fansunitedapi.com/v1":n==="yolo"?"https://discussions.yolo.fansunitedapi.com/v1":n==="cska"?"https://discussions.cska.fansunitedapi.com/v1":"https://discussions.fansunitedapi.com/v1";class uu extends nu{constructor(t,i){super(t,i);u(this,"loyaltyBaseUrl","");u(this,"predictionBaseUrl","");u(this,"miniGamesApiBaseUrl","");u(this,"reportingApiBaseUrl","");u(this,"votingApiBaseUrl","");u(this,"profileApiBaseUrl","");u(this,"customResolverUrl","");u(this,"discussionsApiBaseUrl","");u(this,"getClientById",()=>o(this,null,function*(){const t=`/clients/${this.clientId}?`,i={key:this.apiKey},r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"createTemplate",t=>o(this,null,function*(){const i="/leaderboard/templates?",r=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"editTemplate",(t,i)=>o(this,null,function*(){const r=`/leaderboard/templates/${t}?`,s=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(i)})}));u(this,"deleteTemplate",t=>o(this,null,function*(){const i=`/leaderboard/templates/${t}?`,r=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"setWinners",t=>o(this,null,function*(){const i="/winners?",r=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"exportDetailedLeaderboard",(t,i,r)=>o(this,null,function*(){const s=`/leaderboard/${t}/detailed?`,a=yield this.getToken(),c=p({},this.mainQueryParams);return i&&(c.group_id=i),yield fetch(this.loyaltyBaseUrl+s+new URLSearchParams(f(p({},c),{limit:r.toString()})),{headers:f(p({},this.headers),{Authorization:"Bearer "+a})})}));u(this,"exportDetailedGameLeaderboard",(t,i)=>o(this,null,function*(){const r=`/leaderboard/games/${t}/detailed?`,s=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(f(p({},this.mainQueryParams),{limit:i.toString()})),{headers:f(p({},this.headers),{Authorization:"Bearer "+s})})}));u(this,"createGame",t=>o(this,null,function*(){const i="/games?",r=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"editGame",(t,i)=>o(this,null,function*(){const r=`/games/${t}?`,s=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PATCH",body:JSON.stringify(i)})}));u(this,"getEntityFeature",(t,i)=>o(this,null,function*(){const r=`/clients/${this.clientId}/features/${t}?`,s={key:this.apiKey};return i&&(s.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(s))}));u(this,"getClientFeatures",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/features?`,r={key:this.apiKey};return t&&(r.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(r))}));u(this,"updateEntityFeatures",(t,i)=>o(this,null,function*(){const r=`/clients/${this.clientId}/features/${t}?`,s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PATCH",body:JSON.stringify(i)})}));u(this,"getClassicQuizFeature",()=>o(this,null,function*(){const t=`/clients/${this.clientId}/features/classic_quiz?`,i={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i))}));u(this,"getEitherOrFeature",()=>o(this,null,function*(){const t=`/clients/${this.clientId}/features/either_or?`,i={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i))}));u(this,"getPollFeature",()=>o(this,null,function*(){const t=`/clients/${this.clientId}/features/poll?`,i={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i))}));u(this,"createClassicQuiz",t=>o(this,null,function*(){const i="/classic-quizzes?",r=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"updateClassicQuiz",(t,i)=>o(this,null,function*(){const r=`/classic-quizzes/${t}?`,s=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(i)})}));u(this,"getClassicQuizById",t=>o(this,null,function*(){const i=`/classic-quizzes/${t}/staff?`,r=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"deleteClassicQuiz",t=>o(this,null,function*(){const i=`/classic-quizzes/${t}?`,r=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"calculateQuestionsReport",t=>o(this,null,function*(){const i=`/classic-quizzes/${t}/questions-report?`,r=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST"})}));u(this,"exportUsers",t=>o(this,null,function*(){const i="/exports/users?",r=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"getClassicQuizParticipations",(t,i,r,s)=>o(this,null,function*(){const a="/classic-quizzes/participations?",c=f(p({},this.mainQueryParams),{classic_quiz_ids:t,from_date:i,to_date:r,group_by:s}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+a+new URLSearchParams(c),{headers:f(p({},this.headers),{Authorization:"Bearer "+l})})}));u(this,"getEntityParticipations",(t,i,r)=>o(this,null,function*(){const s=`/participations/${t}/breakdown?`,a=f(p({},this.mainQueryParams),{from_date:i,to_date:r}),c=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+s+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+c})})}));u(this,"createPoll",t=>o(this,null,function*(){const i="/polls?",r=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"updatePoll",(t,i)=>o(this,null,function*(){const r=`/polls/${t}?`,s=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(i)})}));u(this,"deletePoll",t=>o(this,null,function*(){const i=`/polls/${t}?`,r=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"getEitherOrById",(t,i)=>o(this,null,function*(){const r=`/either-or/${t}/staff?`,s=yield this.getToken();let a=null;return i&&(a=f(p({},this.mainQueryParams),{client_id:i})),yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(a||this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s})})}));u(this,"getEitherOrByIdReadOnlyClient",(t,i,r)=>o(this,null,function*(){const s="https://mini-games.fansunitedapi.com/v1",a=`/either-or/${t}/staff?`,c=yield this.getToken(),l={key:i,client_id:r};return yield fetch(s+a+new URLSearchParams(l),{headers:f(p({},this.headers),{Authorization:"Bearer "+c})})}));u(this,"createEitherOr",t=>o(this,null,function*(){const i="/either-or?",r=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"updateEitherOr",(t,i)=>o(this,null,function*(){const r=`/either-or/${t}?`,s=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(i)})}));u(this,"deleteEitherOr",t=>o(this,null,function*(){const i=`/either-or/${t}?`,r=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"getLists",(t,i,r="DESC")=>o(this,null,function*(){const s=`/clients/${this.clientId}/lists?`,a={key:this.apiKey,limit:t.toString(),sort_order:r};i&&(a.start_after=i);const c=yield this.getToken();return yield fetch(this.clientApiBaseUrl+s+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+c})})}));u(this,"getListById",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/lists/${t}?`,r={key:this.apiKey},s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(r),{headers:f(p({},this.headers),{Authorization:"Bearer "+s})})}));u(this,"getListContent",(t,i,r="DESC",s)=>o(this,null,function*(){const a=`/clients/${this.clientId}/lists/${t}/content?`,c={key:this.apiKey,limit:i.toString(),sort_order:r};s&&(c.page=s.toString());const l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+a+new URLSearchParams(c),{headers:f(p({},this.headers),{Authorization:"Bearer "+l})})}));u(this,"createList",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/lists/?`,r={key:this.apiKey},s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(r),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"POST",body:JSON.stringify(t)})}));u(this,"updateList",(t,i)=>o(this,null,function*(){const r=`/clients/${this.clientId}/lists/${t}?`,s={key:this.apiKey},a=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(s),{headers:f(p({},this.headers),{Authorization:"Bearer "+a}),method:"PUT",body:JSON.stringify(i)})}));u(this,"deleteList",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/lists/${t}?`,r={key:this.apiKey},s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(r),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"DELETE"})}));u(this,"getLanguageConfig",()=>o(this,null,function*(){const t=`/clients/${this.clientId}/config/language?`,i={key:this.apiKey},r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"updateLanguageConfig",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/config/language?`,r={key:this.apiKey},s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(r),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(t)})}));u(this,"createBracketGame",t=>o(this,null,function*(){const i="/custom/bracket?",r=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"updateBracketGame",(t,i)=>o(this,null,function*(){const r=`/custom/bracket/${t}?`,s=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(i)})}));u(this,"resolvePredictions",t=>o(this,null,function*(){const i="/custom/bracket/resolve?",s=yield this.getToken();return yield fetch(this.customResolverUrl+i+new URLSearchParams({client_id:this.clientId,game_id:t}),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),signal:AbortSignal.timeout(6e5)})}));u(this,"exportLeadsPerEntity",t=>o(this,null,function*(){const i="/leads/export?",r=f(p({},this.mainQueryParams),{content_id:t}),s=yield this.getToken();return yield fetch(this.profileApiBaseUrl+i+new URLSearchParams(r),{headers:f(p({},this.headers),{Authorization:"Bearer "+s})})}));u(this,"getLeadStatistics",t=>o(this,null,function*(){const i="/leads/statistics?",r=yield this.getToken();let s=null;return t?s=new URLSearchParams(p(p({},this.mainQueryParams),t)):s=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+i+s,{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"exportLeads",t=>o(this,null,function*(){const i="/leads/export?",r=yield this.getToken();let s=null;return t?s=new URLSearchParams(p(p({},this.mainQueryParams),t)):s=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+i+s,{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"createStandingGame",t=>o(this,null,function*(){const i="/custom/standing?",r=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"updateStandingGame",(t,i)=>o(this,null,function*(){const r=`/custom/standing/${t}?`,s=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PUT",body:JSON.stringify(i)})}));u(this,"resolveStandingPredictions",t=>o(this,null,function*(){const i="/custom/standing/resolve?",s=yield this.getToken();return yield fetch(this.customResolverUrl+i+new URLSearchParams({client_id:this.clientId,game_id:t}),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),signal:AbortSignal.timeout(6e5)})}));u(this,"moderateUserPosts",(t,i)=>o(this,null,function*(){const r="/moderation/bulk?",s=yield this.getToken(),a=f(p({},this.mainQueryParams),{user_id:t,reason:i});return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"POST"})}));u(this,"getUserBanStatus",t=>o(this,null,function*(){const i=`/discussions/users/${t}/ban?`,r=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"banUser",(t,i,r)=>o(this,null,function*(){const s=`/discussions/users/${t}/ban?`,a=yield this.getToken(),c={banned_period_in_days:i,banned_reason:r};return yield fetch(this.discussionsApiBaseUrl+s+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(c)})}));u(this,"unbanUser",(t,i)=>o(this,null,function*(){const r=`/discussions/users/${t}/ban?`,s=yield this.getToken(),a={unban_reason:i};return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"DELETE",body:JSON.stringify(a)})}));u(this,"updateUser",(t,i,r)=>o(this,null,function*(){const s=`/profiles/${t}/verify?`,a=yield this.getToken(),c=i==="verify"?{verified:r}:{staff_member:r};return yield fetch(this.profileApiBaseUrl+s+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(c)})}));u(this,"deleteUserProfile",t=>o(this,null,function*(){const i=`/profiles/${t}?`,r=yield this.getToken();return yield fetch(this.profileApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"createDiscussion",t=>o(this,null,function*(){const i="/discussions?",r=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"POST",body:JSON.stringify(t)})}));u(this,"deleteDiscussion",t=>o(this,null,function*(){const i=`/discussions/${t}?`,r=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"DELETE"})}));u(this,"moderatePosts",(...s)=>o(this,[...s],function*(t="",i=[],r){const a="/moderation/bulk?",c=yield this.getToken();let l={};if(i.length>0){const d=i.join(",");l=f(p({},this.mainQueryParams),{post_ids:d,reason:r})}else l=f(p({},this.mainQueryParams),{discussion_id:t,reason:r});return yield fetch(this.discussionsApiBaseUrl+a+new URLSearchParams(l),{headers:f(p({},this.headers),{Authorization:"Bearer "+c}),method:"POST"})}));u(this,"pinDiscussionPosts",(t,i)=>o(this,null,function*(){const r=`/discussions/${t}/pins?`,s=yield this.getToken(),a=f(p({},this.mainQueryParams),{pin_post_ids:i.join(",")});return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"PATCH"})}));u(this,"unpinDiscussionPosts",(t,i)=>o(this,null,function*(){const r=`/discussions/${t}/pins?`,s=yield this.getToken(),a=f(p({},this.mainQueryParams),{pin_post_ids:i.join(",")});return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+s}),method:"DELETE"})}));u(this,"getPostsByStaffMember",t=>o(this,null,function*(){const i="/posts/staff?",r=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(p(p({},this.mainQueryParams),t)),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"getReportedPosts",t=>o(this,null,function*(){const i="/posts/staff/reported?",r=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(p(p({},this.mainQueryParams),t)),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"updateDiscussionsFeature",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/features/discussions?`,r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"PATCH",body:JSON.stringify(t)})}));u(this,"updateProfilePreferences",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/features/profile_preferences?`,r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"PATCH",body:JSON.stringify(t)})}));u(this,"getClientBadges",()=>o(this,null,function*(){const t=`/clients/${this.clientId}/features/loyalty/badges?`,i={key:this.apiKey},r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+t+new URLSearchParams(i),{headers:f(p({},this.headers),{Authorization:"Bearer "+r})})}));u(this,"updateClientBadges",t=>o(this,null,function*(){const i=`/clients/${this.clientId}/features/loyalty/badges?`,r=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:f(p({},this.headers),{Authorization:"Bearer "+r}),method:"PUT",body:JSON.stringify(t)})}));u(this,"getEngagementThroughPredictionsReport",(t,i,r)=>o(this,null,function*(){const s="/predictions/football/engagements?",a=f(p({},this.mainQueryParams),{from_date:i,to_date:r,type:t}),c=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+s+new URLSearchParams(a),{headers:f(p({},this.headers),{Authorization:"Bearer "+c})})}));this.loyaltyBaseUrl=iu(t.environment),this.predictionBaseUrl=ru(t.environment),this.miniGamesApiBaseUrl=su(t.environment),this.reportingApiBaseUrl=au(t.environment),this.votingApiBaseUrl=ou(t.environment),this.profileApiBaseUrl=lu(t.environment),this.customResolverUrl=cu(t.environment),this.discussionsApiBaseUrl=du(t.environment)}}const hu=(n,e)=>!n&&!e?null:!n&&e?(console.warn("'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"),null):{project:n,authorization:`Bearer ${e&&e==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},jr=v.createContext(null),qr=({config:n,children:e})=>{const t={apiKey:n.apiKey,clientId:n.clientId,environment:n.environment,lang:n.language,errorHandlingMode:n.errorHandlingMode,authProvider:{getIdToken:()=>"",logout:()=>{}}},i=hu(n.sportal365Project,n.sportal365Infrastructure),r=P.FansUnitedSDK(t),s=new uu(t,i);return We.jsx(jr.Provider,{value:{sdk:r,https:s},children:e})},Mn=v.createContext(null),Gr=({children:n,environment:e})=>{const[t,i]=v.useState(null),[r,s]=v.useState(!0);return v.useEffect(()=>Hr(e).onAuthStateChanged(c=>{zt.unstable_batchedUpdates(()=>{s(!1),i(c)})}),[e]),We.jsx(Mn.Provider,{value:t,children:!r&&n})},Kr={Spinner:({my:n})=>We.jsx(ze.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",my:n},children:We.jsx(ze.CircularProgress,{variant:"solid",color:"neutral"})})},Bn=v.createContext(null),Jr=({children:n})=>{const e=Kr;return We.jsx(Bn.Provider,{value:e,children:n})},Qr=()=>{const n=v.useContext(jr);if(!n)throw new Error("useAPIContext must be used within a APIProvider");return n},Yr=()=>{const n=v.useContext(Bn);if(!n)throw new Error("useComponentContext must be used within a ComponentProvider");return n},Xr=425,Zr=1024,es=()=>{const[n,e]=v.useState(window.innerWidth<=Zr),[t,i]=v.useState(window.innerWidth<=Xr);return v.useLayoutEffect(()=>{const r=()=>{e(window.innerWidth<=Zr),i(window.innerWidth<=Xr)};return window.addEventListener("resize",r),()=>window.removeEventListener("resize",r)},[]),{isMobile:n,isPhone:t}},pu={APIProvider:qr,AuthProvider:Gr,AuthContext:Mn,ComponentProvider:Jr,useComponentContext:Yr,useAPIContext:Qr,useIsMobile:es};y.APIProvider=qr,y.AuthContext=Mn,y.AuthProvider=Gr,y.ComponentContext=Bn,y.ComponentProvider=Jr,y.components=Kr,y.default=pu,y.useAPIContext=Qr,y.useComponentContext=Yr,y.useIsMobile=es,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2325
|
+
*/const bI="auth-compat";function yI(e){e.INTERNAL.registerComponent(new Hn(bI,t=>{const n=t.getProvider("app-compat").getImmediate(),r=t.getProvider("auth");return new Rl(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:Pr.EMAIL_SIGNIN,PASSWORD_RESET:Pr.PASSWORD_RESET,RECOVER_EMAIL:Pr.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:Pr.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:Pr.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:Pr.VERIFY_EMAIL}},EmailAuthProvider:Qn,FacebookAuthProvider:gn,GithubAuthProvider:vn,GoogleAuthProvider:mn,OAuthProvider:$r,SAMLAuthProvider:Fo,PhoneAuthProvider:Ll,PhoneMultiFactorGenerator:_f,RecaptchaVerifier:vI,TwitterAuthProvider:bn,Auth:Rl,AuthCredential:Mr,Error:$t}).setInstantiationMode("LAZY").setMultipleInstances(!1)),e.registerVersion(Xw,Zw)}yI(Kn);let Vf=!1;const Vi=e=>{if(Vf)return Kn.auth();if(e&&e==="dev"){Kn.initializeApp({apiKey:"api_key"});const n=Pw();cl(n,"http://localhost:39199")}else{const n={apiKey:e&&e==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:2ee87d5b274e0e7685f5e7",measurementId:"G-RH90B03KJG"};Kn.initializeApp(n)}return Vf=!0,Kn.auth()},xI=e=>e==="dev"?"http://localhost:8070/v1":e==="staging"?"https://client.fansunitedstagingapi.com/v1":e==="watg"?"https://client.watg.fansunitedapi.com/v1":e==="yolo"?"https://client.yolo.fansunitedapi.com/v1":e==="cska"?"https://client.cska.fansunitedapi.com/v1":"https://client.fansunitedapi.com/v1";class CI{constructor(t,n){te(this,"apiKey","");te(this,"clientId","");te(this,"environment","");te(this,"mainQueryParams",{key:"",client_id:""});te(this,"headers",{"Content-Type":"application/json"});te(this,"clientApiBaseUrl","");te(this,"sportal365ImagesSearchURL","https://content.api.sportal365.com/v2/images/search?");te(this,"sportal365Config",null);te(this,"generateSignedInUrl",t=>k(this,null,function*(){const n=`/clients/${this.clientId}/generate-signed-url?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(t)})}));te(this,"storeInBucket",(t,n,r)=>k(this,null,function*(){const i=yield fetch(t,{headers:r,method:"PUT",body:n});if(i.ok)return this.constructAssetsUrl(n.name);const o=yield i.text();this.throwErrorFromXmlResponse(o)}));te(this,"fetchImagesFromSportal365",(t,n,r)=>k(this,null,function*(){if(this.sportal365Config){const i={Project:this.sportal365Config.project,Authorization:this.sportal365Config.authorization};let o={query:t,page:r.toString()};return n&&(n.from&&(o=Q(N({},o),{from:n.from})),n.to&&(o=Q(N({},o),{to:n.to}))),yield fetch(this.sportal365ImagesSearchURL+new URLSearchParams(o),{headers:i})}}));te(this,"getSchedulersByEntityId",t=>k(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks?`,r={key:this.apiKey,limit:"50",entity_id:t},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"setSchedulers",(t,n,r)=>k(this,null,function*(){let i="",o="";n==="CREATE"?(i=`/clients/${this.clientId}/scheduler/tasks?`,o="POST"):(i=`/clients/${this.clientId}/scheduler/tasks/${r}?`,o="PUT");const a={key:this.apiKey},s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+s}),body:JSON.stringify(t),method:o})}));te(this,"deleteScheduledTask",t=>k(this,null,function*(){const n=`/clients/${this.clientId}/scheduler/tasks/${t}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"getLoggedInStaffMember",()=>k(this,null,function*(){const r=(yield this.getToken()).split(".")[1].replace(/-/g,"+").replace(/_/g,"/"),i=decodeURIComponent(window.atob(r).split("").map(function(o){return"%"+("00"+o.charCodeAt(0).toString(16)).slice(-2)}).join(""));return JSON.parse(i)}));te(this,"constructAssetsUrl",t=>this.environment==="dev"?`https://storage.googleapis.com/client_images_cms_fans-united-dev/${this.clientId}/${t}`:this.environment==="staging"?`https://storage.googleapis.com/client_images_cms_fans-united-stage/${this.clientId}/${t}`:`https://uploads.fansunitedassets.com/${this.clientId}/${t}`);te(this,"throwErrorFromXmlResponse",t=>{const n=new window.DOMParser().parseFromString(t,"text/xml"),r=n.getElementsByTagName("Message")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Message")[0].textContent:"",i=n.getElementsByTagName("Details")&&n.getElementsByTagName("Code").length>0?n.getElementsByTagName("Details")[0].textContent:"";throw new Error(r+" "+i)});te(this,"getToken",()=>k(this,null,function*(){const t=Vi(this.environment).currentUser;return t?yield t.getIdToken():""}));this.apiKey=t.apiKey,this.clientId=t.clientId,this.environment=t.environment,this.mainQueryParams={key:t.apiKey,client_id:t.clientId},this.sportal365Config=n,this.clientApiBaseUrl=xI(this.environment)}}const wI=e=>e==="dev"?"http://localhost:8060/v1":e==="staging"?"https://loyalty.fansunitedstagingapi.com/v1":e==="watg"?"https://loyalty.watg.fansunitedapi.com/v1":e==="yolo"?"https://loyalty.yolo.fansunitedapi.com/v1":e==="cska"?"https://loyalty.cska.fansunitedapi.com/v1":"https://loyalty.fansunitedapi.com/v1",II=e=>e==="dev"?"http://localhost:8040/v1":e==="staging"?"https://prediction.fansunitedstagingapi.com/v1":e==="watg"?"https://prediction.watg.fansunitedapi.com/v1":e==="yolo"?"https://prediction.yolo.fansunitedapi.com/v1":e==="cska"?"https://prediction.cska.fansunitedapi.com/v1":"https://prediction.fansunitedapi.com/v1",SI=e=>e==="dev"?"http://localhost:9040/v1":e==="staging"?"https://mini-games.fansunitedstagingapi.com/v1":e==="watg"?"https://mini-games.watg.fansunitedapi.com/v1":e==="yolo"?"https://mini-games.yolo.fansunitedapi.com/v1":e==="cska"?"https://mini-games.cska.fansunitedapi.com/v1":"https://mini-games.fansunitedapi.com/v1",AI=e=>e==="dev"?"http://localhost:8020/v1":e==="staging"?"https://reporting.fansunitedstagingapi.com/v1":e==="watg"?"https://reporting.watg.fansunitedapi.com/v1":e==="yolo"?"https://reporting.yolo.fansunitedapi.com/v1":e==="cska"?"https://reporting.cska.fansunitedapi.com/v1":"https://reporting.fansunitedapi.com/v1",TI=e=>e==="dev"?"http://localhost:9030/v1":e==="staging"?"https://voting.fansunitedstagingapi.com/v1":e==="watg"?"https://voting.watg.fansunitedapi.com/v1":e==="yolo"?"https://voting.yolo.fansunitedapi.com/v1":e==="cska"?"https://voting.cska.fansunitedapi.com/v1":"https://voting.fansunitedapi.com/v1",EI=e=>e==="staging"?"https://custom-games-resolver-131809830171.europe-west1.run.app/v1":e==="watg"?"https://custom-games-resolver-1045682138584.southamerica-east1.run.app/v1":e==="yolo"?"https://custom-games-resolver-1054597592566.europe-west1.run.app/v1":e==="cska"?"https://custom-games-resolver-414330847655.europe-west1.run.app/v1":"https://custom-games-resolver-150199313674.europe-west1.run.app/v1",kI=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://profile.fansunitedstagingapi.com/v1":e==="watg"?"https://profile.watg.fansunitedapi.com/v1":e==="yolo"?"https://profile.yolo.fansunitedapi.com/v1":e==="cska"?"https://profile.cska.fansunitedapi.com/v1":"https://profile.fansunitedapi.com/v1",_I=e=>e==="dev"?"http://localhost:8010/v1":e==="staging"?"https://discussions.fansunitedstagingapi.com/v1":e==="watg"?"https://discussions.watg.fansunitedapi.com/v1":e==="yolo"?"https://discussions.yolo.fansunitedapi.com/v1":e==="cska"?"https://discussions.cska.fansunitedapi.com/v1":"https://discussions.fansunitedapi.com/v1";class PI extends CI{constructor(n,r){super(n,r);te(this,"loyaltyBaseUrl","");te(this,"predictionBaseUrl","");te(this,"miniGamesApiBaseUrl","");te(this,"reportingApiBaseUrl","");te(this,"votingApiBaseUrl","");te(this,"profileApiBaseUrl","");te(this,"customResolverUrl","");te(this,"discussionsApiBaseUrl","");te(this,"getClientById",()=>k(this,null,function*(){const n=`/clients/${this.clientId}?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"createTemplate",n=>k(this,null,function*(){const r="/leaderboard/templates?",i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"editTemplate",(n,r)=>k(this,null,function*(){const i=`/leaderboard/templates/${n}?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));te(this,"deleteTemplate",n=>k(this,null,function*(){const r=`/leaderboard/templates/${n}?`,i=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"setWinners",n=>k(this,null,function*(){const r="/winners?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"exportDetailedLeaderboard",(n,r,i)=>k(this,null,function*(){const o=`/leaderboard/${n}/detailed?`,a=yield this.getToken(),s=N({},this.mainQueryParams);return r&&(s.group_id=r),yield fetch(this.loyaltyBaseUrl+o+new URLSearchParams(Q(N({},s),{limit:i.toString()})),{headers:Q(N({},this.headers),{Authorization:"Bearer "+a})})}));te(this,"exportDetailedGameLeaderboard",(n,r)=>k(this,null,function*(){const i=`/leaderboard/games/${n}/detailed?`,o=yield this.getToken();return yield fetch(this.loyaltyBaseUrl+i+new URLSearchParams(Q(N({},this.mainQueryParams),{limit:r.toString()})),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o})})}));te(this,"createGame",n=>k(this,null,function*(){const r="/games?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"editGame",(n,r)=>k(this,null,function*(){const i=`/games/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));te(this,"getEntityFeature",(n,r)=>k(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o={key:this.apiKey};return r&&(o.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o))}));te(this,"getClientFeatures",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/features?`,i={key:this.apiKey};return n&&(i.disable_cache=Date.now().toString()),yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i))}));te(this,"updateEntityFeatures",(n,r)=>k(this,null,function*(){const i=`/clients/${this.clientId}/features/${n}?`,o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams({key:this.apiKey}),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH",body:JSON.stringify(r)})}));te(this,"getClassicQuizFeature",()=>k(this,null,function*(){const n=`/clients/${this.clientId}/features/classic_quiz?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));te(this,"getEitherOrFeature",()=>k(this,null,function*(){const n=`/clients/${this.clientId}/features/either_or?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));te(this,"getPollFeature",()=>k(this,null,function*(){const n=`/clients/${this.clientId}/features/poll?`,r={key:this.apiKey};return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r))}));te(this,"createClassicQuiz",n=>k(this,null,function*(){const r="/classic-quizzes?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"updateClassicQuiz",(n,r)=>k(this,null,function*(){const i=`/classic-quizzes/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));te(this,"getClassicQuizById",n=>k(this,null,function*(){const r=`/classic-quizzes/${n}/staff?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"deleteClassicQuiz",n=>k(this,null,function*(){const r=`/classic-quizzes/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"calculateQuestionsReport",n=>k(this,null,function*(){const r=`/classic-quizzes/${n}/questions-report?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST"})}));te(this,"exportUsers",n=>k(this,null,function*(){const r="/exports/users?",i=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"getClassicQuizParticipations",(n,r,i,o)=>k(this,null,function*(){const a="/classic-quizzes/participations?",s=Q(N({},this.mainQueryParams),{classic_quiz_ids:n,from_date:r,to_date:i,group_by:o}),l=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+a+new URLSearchParams(s),{headers:Q(N({},this.headers),{Authorization:"Bearer "+l})})}));te(this,"getEntityParticipations",(n,r,i)=>k(this,null,function*(){const o=`/participations/${n}/breakdown?`,a=Q(N({},this.mainQueryParams),{from_date:r,to_date:i}),s=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+s})})}));te(this,"createPoll",n=>k(this,null,function*(){const r="/polls?",i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"updatePoll",(n,r)=>k(this,null,function*(){const i=`/polls/${n}?`,o=yield this.getToken();return yield fetch(this.votingApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));te(this,"deletePoll",n=>k(this,null,function*(){const r=`/polls/${n}?`,i=yield this.getToken();return yield fetch(this.votingApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"getEitherOrById",(n,r)=>k(this,null,function*(){const i=`/either-or/${n}/staff?`,o=yield this.getToken();let a=null;return r&&(a=Q(N({},this.mainQueryParams),{client_id:r})),yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(a||this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o})})}));te(this,"getEitherOrByIdReadOnlyClient",(n,r,i)=>k(this,null,function*(){const o="https://mini-games.fansunitedapi.com/v1",a=`/either-or/${n}/staff?`,s=yield this.getToken(),l={key:r,client_id:i};return yield fetch(o+a+new URLSearchParams(l),{headers:Q(N({},this.headers),{Authorization:"Bearer "+s})})}));te(this,"createEitherOr",n=>k(this,null,function*(){const r="/either-or?",i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"updateEitherOr",(n,r)=>k(this,null,function*(){const i=`/either-or/${n}?`,o=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));te(this,"deleteEitherOr",n=>k(this,null,function*(){const r=`/either-or/${n}?`,i=yield this.getToken();return yield fetch(this.miniGamesApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"getLists",(n,r,i="DESC")=>k(this,null,function*(){const o=`/clients/${this.clientId}/lists?`,a={key:this.apiKey,limit:n.toString(),sort_order:i};r&&(a.start_after=r);const s=yield this.getToken();return yield fetch(this.clientApiBaseUrl+o+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+s})})}));te(this,"getListById",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o})})}));te(this,"getListContent",(n,r,i="DESC",o)=>k(this,null,function*(){const a=`/clients/${this.clientId}/lists/${n}/content?`,s={key:this.apiKey,limit:r.toString(),sort_order:i};o&&(s.page=o.toString());const l=yield this.getToken();return yield fetch(this.clientApiBaseUrl+a+new URLSearchParams(s),{headers:Q(N({},this.headers),{Authorization:"Bearer "+l})})}));te(this,"createList",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/lists/?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"POST",body:JSON.stringify(n)})}));te(this,"updateList",(n,r)=>k(this,null,function*(){const i=`/clients/${this.clientId}/lists/${n}?`,o={key:this.apiKey},a=yield this.getToken();return yield fetch(this.clientApiBaseUrl+i+new URLSearchParams(o),{headers:Q(N({},this.headers),{Authorization:"Bearer "+a}),method:"PUT",body:JSON.stringify(r)})}));te(this,"deleteList",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/lists/${n}?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));te(this,"getLanguageConfig",()=>k(this,null,function*(){const n=`/clients/${this.clientId}/config/language?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"updateLanguageConfig",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/config/language?`,i={key:this.apiKey},o=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams(i),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(n)})}));te(this,"createBracketGame",n=>k(this,null,function*(){const r="/custom/bracket?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"updateBracketGame",(n,r)=>k(this,null,function*(){const i=`/custom/bracket/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));te(this,"resolvePredictions",n=>k(this,null,function*(){const r="/custom/bracket/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));te(this,"exportLeadsPerEntity",n=>k(this,null,function*(){const r="/leads/export?",i=Q(N({},this.mainQueryParams),{content_id:n}),o=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(i),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o})})}));te(this,"getLeadStatistics",n=>k(this,null,function*(){const r="/leads/statistics?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(N(N({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"exportLeads",n=>k(this,null,function*(){const r="/leads/export?",i=yield this.getToken();let o=null;return n?o=new URLSearchParams(N(N({},this.mainQueryParams),n)):o=new URLSearchParams(this.mainQueryParams),yield fetch(this.profileApiBaseUrl+r+o,{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"createStandingGame",n=>k(this,null,function*(){const r="/custom/standing?",i=yield this.getToken();return yield fetch(this.predictionBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"updateStandingGame",(n,r)=>k(this,null,function*(){const i=`/custom/standing/${n}?`,o=yield this.getToken();return yield fetch(this.predictionBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PUT",body:JSON.stringify(r)})}));te(this,"resolveStandingPredictions",n=>k(this,null,function*(){const r="/custom/standing/resolve?",o=yield this.getToken();return yield fetch(this.customResolverUrl+r+new URLSearchParams({client_id:this.clientId,game_id:n}),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),signal:AbortSignal.timeout(6e5)})}));te(this,"moderateUserPosts",(n,r)=>k(this,null,function*(){const i="/moderation/bulk?",o=yield this.getToken(),a=Q(N({},this.mainQueryParams),{user_id:n,reason:r});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"POST"})}));te(this,"getUserBanStatus",n=>k(this,null,function*(){const r=`/discussions/users/${n}/ban?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"banUser",(n,r,i)=>k(this,null,function*(){const o=`/discussions/users/${n}/ban?`,a=yield this.getToken(),s={banned_period_in_days:r,banned_reason:i};return yield fetch(this.discussionsApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(s)})}));te(this,"unbanUser",(n,r)=>k(this,null,function*(){const i=`/discussions/users/${n}/ban?`,o=yield this.getToken(),a={unban_reason:r};return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE",body:JSON.stringify(a)})}));te(this,"updateUser",(n,r,i)=>k(this,null,function*(){const o=`/profiles/${n}/verify?`,a=yield this.getToken(),s=r==="verify"?{verified:i}:{staff_member:i};return yield fetch(this.profileApiBaseUrl+o+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+a}),method:"POST",body:JSON.stringify(s)})}));te(this,"deleteUserProfile",n=>k(this,null,function*(){const r=`/profiles/${n}?`,i=yield this.getToken();return yield fetch(this.profileApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"createDiscussion",n=>k(this,null,function*(){const r="/discussions?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"POST",body:JSON.stringify(n)})}));te(this,"deleteDiscussion",n=>k(this,null,function*(){const r=`/discussions/${n}?`,i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(this.mainQueryParams),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"DELETE"})}));te(this,"moderatePosts",(...o)=>k(this,[...o],function*(n="",r=[],i){const a="/moderation/bulk?",s=yield this.getToken();let l={};if(r.length>0){const c=r.join(",");l=Q(N({},this.mainQueryParams),{post_ids:c,reason:i})}else l=Q(N({},this.mainQueryParams),{discussion_id:n,reason:i});return yield fetch(this.discussionsApiBaseUrl+a+new URLSearchParams(l),{headers:Q(N({},this.headers),{Authorization:"Bearer "+s}),method:"POST"})}));te(this,"pinDiscussionPosts",(n,r)=>k(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(N({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"PATCH"})}));te(this,"unpinDiscussionPosts",(n,r)=>k(this,null,function*(){const i=`/discussions/${n}/pins?`,o=yield this.getToken(),a=Q(N({},this.mainQueryParams),{pin_post_ids:r.join(",")});return yield fetch(this.discussionsApiBaseUrl+i+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+o}),method:"DELETE"})}));te(this,"getPostsByStaffMember",n=>k(this,null,function*(){const r="/posts/staff?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(N(N({},this.mainQueryParams),n)),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"getReportedPosts",n=>k(this,null,function*(){const r="/posts/staff/reported?",i=yield this.getToken();return yield fetch(this.discussionsApiBaseUrl+r+new URLSearchParams(N(N({},this.mainQueryParams),n)),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"updateDiscussionsFeature",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/features/discussions?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));te(this,"updateProfilePreferences",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/features/profile_preferences?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"PATCH",body:JSON.stringify(n)})}));te(this,"getClientBadges",()=>k(this,null,function*(){const n=`/clients/${this.clientId}/features/loyalty/badges?`,r={key:this.apiKey},i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+n+new URLSearchParams(r),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i})})}));te(this,"updateClientBadges",n=>k(this,null,function*(){const r=`/clients/${this.clientId}/features/loyalty/badges?`,i=yield this.getToken();return yield fetch(this.clientApiBaseUrl+r+new URLSearchParams({key:this.apiKey}),{headers:Q(N({},this.headers),{Authorization:"Bearer "+i}),method:"PUT",body:JSON.stringify(n)})}));te(this,"getEngagementThroughPredictionsReport",(n,r,i)=>k(this,null,function*(){const o="/predictions/football/engagements?",a=Q(N({},this.mainQueryParams),{from_date:r,to_date:i,type:n}),s=yield this.getToken();return yield fetch(this.reportingApiBaseUrl+o+new URLSearchParams(a),{headers:Q(N({},this.headers),{Authorization:"Bearer "+s})})}));this.loyaltyBaseUrl=wI(n.environment),this.predictionBaseUrl=II(n.environment),this.miniGamesApiBaseUrl=SI(n.environment),this.reportingApiBaseUrl=AI(n.environment),this.votingApiBaseUrl=TI(n.environment),this.profileApiBaseUrl=kI(n.environment),this.customResolverUrl=EI(n.environment),this.discussionsApiBaseUrl=_I(n.environment)}}const DI=(e,t)=>!e&&!t?null:!e&&t?(console.warn("'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"),null):{project:e,authorization:`Bearer ${t&&t==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},ea=w.createContext(null),Hf=({config:e,children:t})=>{const n={apiKey:e.apiKey,clientId:e.clientId,environment:e.environment,lang:e.language,errorHandlingMode:e.errorHandlingMode,authProvider:{getIdToken:()=>"",logout:()=>{}}},r=DI(e.sportal365Project,e.sportal365Infrastructure),i=ze.FansUnitedSDK(n),o=new PI(n,r);return u.jsx(ea.Provider,{value:{sdk:i,https:o},children:t})},Ml=w.createContext(null),Wf=({children:e,environment:t})=>{const[n,r]=w.useState(null),[i,o]=w.useState(!0);return w.useEffect(()=>Vi(t).onAuthStateChanged(s=>{pt.unstable_batchedUpdates(()=>{o(!1),r(s)})}),[t]),u.jsx(Ml.Provider,{value:n,children:!i&&e})};function O(){return O=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},O.apply(null,arguments)}function Te(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.includes(r))continue;n[r]=e[r]}return n}var Gf={exports:{}},OI="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED",RI=OI,LI=RI;function Yf(){}function Kf(){}Kf.resetWarningCache=Yf;var MI=function(){function e(r,i,o,a,s,l){if(l!==LI){var c=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw c.name="Invariant Violation",c}}e.isRequired=e;function t(){return e}var n={array:e,bigint:e,bool:e,func:e,number:e,object:e,string:e,symbol:e,any:e,arrayOf:t,element:e,elementType:e,instanceOf:t,node:e,objectOf:t,oneOf:t,oneOfType:t,shape:t,exact:t,checkPropTypes:Kf,resetWarningCache:Yf};return n.PropTypes=n,n};Gf.exports=MI();var BI=Gf.exports;function $I(e){return typeof e=="string"}function NI(e,t,n){return e===void 0||$I(e)?t:O({},t,{ownerState:O({},t.ownerState,n)})}function qf(e,t,n=(r,i)=>r===i){return e.length===t.length&&e.every((r,i)=>n(r,t[i]))}function Ln(e,t=[]){if(e===void 0)return{};const n={};return Object.keys(e).filter(r=>r.match(/^on[A-Z]/)&&typeof e[r]=="function"&&!t.includes(r)).forEach(r=>{n[r]=e[r]}),n}function FI(e,t,n){return typeof e=="function"?e(t,n):e}function zI(e){const{rootElementName:t="",componentName:n}=e,[r,i]=W.useState(t.toUpperCase()),o=W.useCallback(a=>{var s;i((s=a==null?void 0:a.tagName)!=null?s:"")},[]);return[r,o]}function jI(e,t){typeof e=="function"?e(t):e&&(e.current=t)}function sn(...e){return W.useMemo(()=>e.every(t=>t==null)?null:t=>{e.forEach(n=>{jI(n,t)})},e)}function Qf(e){var t,n,r="";if(typeof e=="string"||typeof e=="number")r+=e;else if(typeof e=="object")if(Array.isArray(e)){var i=e.length;for(t=0;t<i;t++)e[t]&&(n=Qf(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function Mn(){for(var e,t,n=0,r="",i=arguments.length;n<i;n++)(e=arguments[n])&&(t=Qf(e))&&(r&&(r+=" "),r+=t);return r}function Jf(e){if(e===void 0)return{};const t={};return Object.keys(e).filter(n=>!(n.match(/^on[A-Z]/)&&typeof e[n]=="function")).forEach(n=>{t[n]=e[n]}),t}function UI(e){const{getSlotProps:t,additionalProps:n,externalSlotProps:r,externalForwardedProps:i,className:o}=e;if(!t){const p=Mn(n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),m=O({},n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),g=O({},n,i,r);return p.length>0&&(g.className=p),Object.keys(m).length>0&&(g.style=m),{props:g,internalRef:void 0}}const a=Ln(O({},i,r)),s=Jf(r),l=Jf(i),c=t(a),d=Mn(c==null?void 0:c.className,n==null?void 0:n.className,o,i==null?void 0:i.className,r==null?void 0:r.className),f=O({},c==null?void 0:c.style,n==null?void 0:n.style,i==null?void 0:i.style,r==null?void 0:r.style),h=O({},c,n,l,s);return d.length>0&&(h.className=d),Object.keys(f).length>0&&(h.style=f),{props:h,internalRef:c.ref}}function Zn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Xf(e){if(W.isValidElement(e)||!Zn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Xf(e[n])}),t}function Bn(e,t,n={clone:!0}){const r=n.clone?O({},e):e;return Zn(e)&&Zn(t)&&Object.keys(t).forEach(i=>{W.isValidElement(t[i])?r[i]=t[i]:Zn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Zn(e[i])?r[i]=Bn(e[i],t[i],n):n.clone?r[i]=Zn(t[i])?Xf(t[i]):t[i]:r[i]=t[i]}),r}function ta(e){let t="https://mui.com/production-error/?code="+e;for(let n=1;n<arguments.length;n+=1)t+="&args[]="+encodeURIComponent(arguments[n]);return"Minified MUI error #"+e+"; visit "+t+" for the full message."}var Zf={exports:{}},Be={};/**
|
|
2326
|
+
* @license React
|
|
2327
|
+
* react-is.production.js
|
|
2328
|
+
*
|
|
2329
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
2330
|
+
*
|
|
2331
|
+
* This source code is licensed under the MIT license found in the
|
|
2332
|
+
* LICENSE file in the root directory of this source tree.
|
|
2333
|
+
*/var Bl=Symbol.for("react.transitional.element"),$l=Symbol.for("react.portal"),na=Symbol.for("react.fragment"),ra=Symbol.for("react.strict_mode"),ia=Symbol.for("react.profiler"),oa=Symbol.for("react.consumer"),aa=Symbol.for("react.context"),sa=Symbol.for("react.forward_ref"),la=Symbol.for("react.suspense"),ca=Symbol.for("react.suspense_list"),ua=Symbol.for("react.memo"),da=Symbol.for("react.lazy"),VI=Symbol.for("react.offscreen"),HI=Symbol.for("react.client.reference");function Xt(e){if(typeof e=="object"&&e!==null){var t=e.$$typeof;switch(t){case Bl:switch(e=e.type,e){case na:case ia:case ra:case la:case ca:return e;default:switch(e=e&&e.$$typeof,e){case aa:case sa:case da:case ua:return e;case oa:return e;default:return t}}case $l:return t}}}Be.ContextConsumer=oa,Be.ContextProvider=aa,Be.Element=Bl,Be.ForwardRef=sa,Be.Fragment=na,Be.Lazy=da,Be.Memo=ua,Be.Portal=$l,Be.Profiler=ia,Be.StrictMode=ra,Be.Suspense=la,Be.SuspenseList=ca,Be.isContextConsumer=function(e){return Xt(e)===oa},Be.isContextProvider=function(e){return Xt(e)===aa},Be.isElement=function(e){return typeof e=="object"&&e!==null&&e.$$typeof===Bl},Be.isForwardRef=function(e){return Xt(e)===sa},Be.isFragment=function(e){return Xt(e)===na},Be.isLazy=function(e){return Xt(e)===da},Be.isMemo=function(e){return Xt(e)===ua},Be.isPortal=function(e){return Xt(e)===$l},Be.isProfiler=function(e){return Xt(e)===ia},Be.isStrictMode=function(e){return Xt(e)===ra},Be.isSuspense=function(e){return Xt(e)===la},Be.isSuspenseList=function(e){return Xt(e)===ca},Be.isValidElementType=function(e){return typeof e=="string"||typeof e=="function"||e===na||e===ia||e===ra||e===la||e===ca||e===VI||typeof e=="object"&&e!==null&&(e.$$typeof===da||e.$$typeof===ua||e.$$typeof===aa||e.$$typeof===oa||e.$$typeof===sa||e.$$typeof===HI||e.getModuleId!==void 0)},Be.typeOf=Xt,Zf.exports=Be;var eh=Zf.exports;function xe(e){if(typeof e!="string")throw new Error(ta(7));return e.charAt(0).toUpperCase()+e.slice(1)}function th(e,t){var n,r;return W.isValidElement(e)&&t.indexOf((n=e.type.muiName)!=null?n:(r=e.type)==null||(r=r._payload)==null||(r=r.value)==null?void 0:r.muiName)!==-1}const WI=typeof window!="undefined"?W.useLayoutEffect:W.useEffect;let nh=0;function GI(e){const[t,n]=W.useState(e),r=e||t;return W.useEffect(()=>{t==null&&(nh+=1,n(`mui-${nh}`))},[t]),r}const rh=W.useId;function Hi(e){if(rh!==void 0){const t=rh();return e!=null?e:t}return GI(e)}function Nl({controlled:e,default:t,name:n,state:r="value"}){const{current:i}=W.useRef(e!==void 0),[o,a]=W.useState(t),s=i?e:o,l=W.useCallback(c=>{i||a(c)},[]);return[s,l]}class Fl{constructor(){this.currentId=null,this.clear=()=>{this.currentId!==null&&(clearTimeout(this.currentId),this.currentId=null)},this.disposeEffect=()=>this.clear}static create(){return new Fl}start(t,n){this.clear(),this.currentId=setTimeout(()=>{this.currentId=null,n()},t)}}let fa=!0,zl=!1;const YI=new Fl,KI={text:!0,search:!0,url:!0,tel:!0,email:!0,password:!0,number:!0,date:!0,month:!0,week:!0,time:!0,datetime:!0,"datetime-local":!0};function qI(e){const{type:t,tagName:n}=e;return!!(n==="INPUT"&&KI[t]&&!e.readOnly||n==="TEXTAREA"&&!e.readOnly||e.isContentEditable)}function QI(e){e.metaKey||e.altKey||e.ctrlKey||(fa=!0)}function jl(){fa=!1}function JI(){this.visibilityState==="hidden"&&zl&&(fa=!0)}function XI(e){e.addEventListener("keydown",QI,!0),e.addEventListener("mousedown",jl,!0),e.addEventListener("pointerdown",jl,!0),e.addEventListener("touchstart",jl,!0),e.addEventListener("visibilitychange",JI,!0)}function ZI(e){const{target:t}=e;try{return t.matches(":focus-visible")}catch(n){}return fa||qI(t)}function ih(){const e=W.useCallback(i=>{i!=null&&XI(i.ownerDocument)},[]),t=W.useRef(!1);function n(){return t.current?(zl=!0,YI.start(100,()=>{zl=!1}),t.current=!1,!0):!1}function r(i){return ZI(i)?(t.current=!0,!0):!1}return{isFocusVisibleRef:t,onFocus:r,onBlur:n,ref:e}}function oh(e,t){const n=O({},t);return Object.keys(e).forEach(r=>{if(r.toString().match(/^(components|slots)$/))n[r]=O({},e[r],n[r]);else if(r.toString().match(/^(componentsProps|slotProps)$/)){const i=e[r]||{},o=t[r];n[r]={},!o||!Object.keys(o)?n[r]=i:!i||!Object.keys(i)?n[r]=o:(n[r]=O({},o),Object.keys(i).forEach(a=>{n[r][a]=oh(i[a],o[a])}))}else n[r]===void 0&&(n[r]=e[r])}),n}function dt(e,t,n=void 0){const r={};return Object.keys(e).forEach(i=>{r[i]=e[i].reduce((o,a)=>{if(a){const s=t(a);s!==""&&o.push(s),n&&n[a]&&o.push(n[a])}return o},[]).join(" ")}),r}const ah=e=>e,eS=(()=>{let e=ah;return{configure(t){e=t},generate(t){return e(t)},reset(){e=ah}}})(),tS={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function sh(e,t,n="Mui"){const r=tS[t];return r?`${n}-${r}`:`${eS.generate(e)}-${t}`}function nS(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=sh(e,i,n)}),r}function Ul(e={}){const{disabled:t=!1,focusableWhenDisabled:n,href:r,rootRef:i,tabIndex:o,to:a,type:s,rootElementName:l}=e,c=W.useRef(null),[d,f]=W.useState(!1),{isFocusVisibleRef:h,onFocus:p,onBlur:m,ref:g}=ih(),[v,S]=W.useState(!1);t&&!n&&v&&S(!1),W.useEffect(()=>{h.current=v},[v,h]);const[I,x]=zI({rootElementName:l!=null?l:r||a?"a":void 0,componentName:"Button"}),C=z=>$=>{var B;v&&$.preventDefault(),(B=z.onMouseLeave)==null||B.call(z,$)},y=z=>$=>{var B;m($),h.current===!1&&S(!1),(B=z.onBlur)==null||B.call(z,$)},A=z=>$=>{var B;if(c.current||(c.current=$.currentTarget),p($),h.current===!0){var H;S(!0),(H=z.onFocusVisible)==null||H.call(z,$)}(B=z.onFocus)==null||B.call(z,$)},E=()=>{const z=c.current;return I==="BUTTON"||I==="INPUT"&&["button","submit","reset"].includes(z==null?void 0:z.type)||I==="A"&&(z==null?void 0:z.href)},_=z=>$=>{if(!t){var B;(B=z.onClick)==null||B.call(z,$)}},D=z=>$=>{var B;t||(f(!0),document.addEventListener("mouseup",()=>{f(!1)},{once:!0})),(B=z.onMouseDown)==null||B.call(z,$)},G=z=>$=>{var B;if((B=z.onKeyDown)==null||B.call(z,$),!$.defaultMuiPrevented&&($.target===$.currentTarget&&!E()&&$.key===" "&&$.preventDefault(),$.target===$.currentTarget&&$.key===" "&&!t&&f(!0),$.target===$.currentTarget&&!E()&&$.key==="Enter"&&!t)){var H;(H=z.onClick)==null||H.call(z,$),$.preventDefault()}},F=z=>$=>{var B;if($.target===$.currentTarget&&f(!1),(B=z.onKeyUp)==null||B.call(z,$),$.target===$.currentTarget&&!E()&&!t&&$.key===" "&&!$.defaultMuiPrevented){var H;(H=z.onClick)==null||H.call(z,$)}},T=sn(x,i,g,c),j={};return o!==void 0&&(j.tabIndex=o),I==="BUTTON"?(j.type=s!=null?s:"button",n?j["aria-disabled"]=t:j.disabled=t):I==="INPUT"?s&&["button","submit","reset"].includes(s)&&(n?j["aria-disabled"]=t:j.disabled=t):I!==""&&(!r&&!a&&(j.role="button",j.tabIndex=o!=null?o:0),t&&(j["aria-disabled"]=t,j.tabIndex=n?o!=null?o:0:-1)),{getRootProps:(z={})=>{const $=O({},Ln(e),Ln(z)),B=O({type:s},$,j,z,{onBlur:y($),onClick:_($),onFocus:A($),onKeyDown:G($),onKeyUp:F($),onMouseDown:D($),onMouseLeave:C($),ref:T});return delete B.onFocusVisible,B},focusVisible:v,setFocusVisible:S,active:d,rootRef:T}}function rS(e,t){return e===t}const Vl={},lh=()=>{};function Hl(e,t){const n=O({},e);return Object.keys(t).forEach(r=>{t[r]!==void 0&&(n[r]=t[r])}),n}function iS(e){const{nextState:t,initialState:n,stateComparers:r,onStateChange:i,controlledProps:o,lastActionRef:a}=e,s=W.useRef(n);W.useEffect(()=>{if(a.current===null)return;const l=Hl(s.current,o);Object.keys(t).forEach(c=>{var d;const f=(d=r[c])!=null?d:rS,h=t[c],p=l[c];if(p==null&&h!=null||p!=null&&h==null||p!=null&&h!=null&&!f(h,p)){var m,g;i==null||i((m=a.current.event)!=null?m:null,c,h,(g=a.current.type)!=null?g:"",t)}}),s.current=t,a.current=null},[s,t,a,i,r,o])}function oS(e){const t=W.useRef(null),{reducer:n,initialState:r,controlledProps:i=Vl,stateComparers:o=Vl,onStateChange:a=lh,actionContext:s,componentName:l=""}=e;W.useRef(i);const c=W.useCallback((p,m)=>{t.current=m;const g=Hl(p,i);return n(g,m)},[i,n]),[d,f]=W.useReducer(c,r),h=W.useCallback(p=>{f(O({},p,{context:s}))},[s]);return iS({nextState:d,initialState:r,stateComparers:o!=null?o:Vl,onStateChange:a!=null?a:lh,controlledProps:i,lastActionRef:t}),[Hl(d,i),h]}const aS=W.createContext(void 0);function sS(){return W.useContext(aS)}function lS(e={}){const{defaultValue:t,disabled:n=!1,error:r=!1,onBlur:i,onChange:o,onFocus:a,required:s=!1,value:l,inputRef:c}=e,d=sS();let f,h,p,m,g;if(d){var v,S,I;f=void 0,h=(v=d.disabled)!=null?v:!1,p=(S=d.error)!=null?S:!1,m=(I=d.required)!=null?I:!1,g=d.value}else f=t,h=n,p=r,m=s,g=l;const{current:x}=W.useRef(g!=null),C=W.useCallback(z=>{},[]),y=W.useRef(null),A=sn(y,c,C),[E,_]=W.useState(!1);W.useEffect(()=>{!d&&h&&E&&(_(!1),i==null||i())},[d,h,E,i]);const D=z=>$=>{var B;if(d!=null&&d.disabled){$.stopPropagation();return}if((B=z.onFocus)==null||B.call(z,$),d&&d.onFocus){var H;d==null||(H=d.onFocus)==null||H.call(d)}else _(!0)},G=z=>$=>{var B;(B=z.onBlur)==null||B.call(z,$),d&&d.onBlur?d.onBlur():_(!1)},F=z=>($,...B)=>{var H,q;if(!x&&($.target||y.current)==null)throw new Error(ta(17));d==null||(H=d.onChange)==null||H.call(d,$),(q=z.onChange)==null||q.call(z,$,...B)},T=z=>$=>{var B;y.current&&$.currentTarget===$.target&&y.current.focus(),(B=z.onClick)==null||B.call(z,$)};return{disabled:h,error:p,focused:E,formControlContext:d,getInputProps:(z={})=>{const B=O({},{onBlur:i,onChange:o,onFocus:a},Ln(z)),H=O({},B,{onBlur:G(B),onChange:F(B),onFocus:D(B)});return O({},H,{"aria-invalid":p||void 0,defaultValue:f,value:g,required:m,disabled:h},z,{ref:A},H)},getRootProps:(z={})=>{const $=Ln(e,["onBlur","onChange","onFocus"]),B=O({},$,Ln(z));return O({},z,B,{onClick:T(B)})},inputRef:A,required:m,value:g}}const xt={blur:"list:blur",focus:"list:focus",itemClick:"list:itemClick",itemHover:"list:itemHover",itemsChange:"list:itemsChange",keyDown:"list:keyDown",resetHighlight:"list:resetHighlight",highlightLast:"list:highlightLast",textNavigation:"list:textNavigation",clearSelection:"list:clearSelection"};function cS(e,t,n,r,i,o){if(n.length===0||!r&&n.every((s,l)=>i(s,l)))return-1;let a=e;for(;;){if(!o&&t==="next"&&a===n.length||!o&&t==="previous"&&a===-1)return-1;if(r?!1:i(n[a],a))a+=t==="next"?1:-1,o&&(a=(a+n.length)%n.length);else return a}}function Ot(e,t,n){var r;const{items:i,isItemDisabled:o,disableListWrap:a,disabledItemsFocusable:s,itemComparer:l,focusManagement:c}=n,d=c==="DOM"?0:-1,f=i.length-1,h=e==null?-1:i.findIndex(S=>l(S,e));let p,m,g=!a;switch(t){case"reset":if(d===-1)return null;p=0,m="next",g=!1;break;case"start":p=0,m="next",g=!1;break;case"end":p=f,m="previous",g=!1;break;default:{const S=h+t;S<0?!g&&h!==-1||Math.abs(t)>1?(p=0,m="next"):(p=f,m="previous"):S>f?!g||Math.abs(t)>1?(p=f,m="previous"):(p=0,m="next"):(p=S,m=t>=0?"next":"previous")}}const v=cS(p,m,i,s,o,g);return v===-1&&e!==null&&!o(e,h)?e:(r=i[v])!=null?r:null}function uS(e,t,n,r){return n==="none"?[]:n==="single"?r(t[0],e)?t:[e]:t.some(i=>r(i,e))?t.filter(i=>!r(i,e)):[...t,e]}function ch(e,t,n){const{itemComparer:r,isItemDisabled:i,selectionMode:o,items:a}=n,{selectedValues:s}=t,l=a.findIndex(d=>r(e,d));if(i(e,l))return t;const c=uS(e,s,o,r);return O({},t,{selectedValues:c,highlightedValue:e})}function dS(e,t,n){const r=t.highlightedValue,{orientation:i,pageSize:o}=n;switch(e){case"Home":return O({},t,{highlightedValue:Ot(r,"start",n)});case"End":return O({},t,{highlightedValue:Ot(r,"end",n)});case"PageUp":return O({},t,{highlightedValue:Ot(r,-o,n)});case"PageDown":return O({},t,{highlightedValue:Ot(r,o,n)});case"ArrowUp":if(i!=="vertical")break;return O({},t,{highlightedValue:Ot(r,-1,n)});case"ArrowDown":if(i!=="vertical")break;return O({},t,{highlightedValue:Ot(r,1,n)});case"ArrowLeft":{if(i==="vertical")break;return O({},t,{highlightedValue:Ot(r,i==="horizontal-ltr"?-1:1,n)})}case"ArrowRight":{if(i==="vertical")break;return O({},t,{highlightedValue:Ot(r,i==="horizontal-ltr"?1:-1,n)})}case"Enter":case" ":return t.highlightedValue===null?t:ch(t.highlightedValue,t,n)}return t}function fS(e,t){return t.focusManagement==="DOM"?e:O({},e,{highlightedValue:null})}function hS(e,t,n){var r;const i=(r=n(e))==null?void 0:r.trim().toLowerCase();return!i||i.length===0?!1:i.indexOf(t)===0}function pS(e,t,n){const{items:r,isItemDisabled:i,disabledItemsFocusable:o,getItemAsString:a}=n,s=t.length>1;let l=s?e.highlightedValue:Ot(e.highlightedValue,1,n);for(let c=0;c<r.length;c+=1){if(!l||!s&&e.highlightedValue===l)return e;if(hS(l,t,a)&&(!i(l,r.indexOf(l))||o))return O({},e,{highlightedValue:l});l=Ot(l,1,n)}return e}function gS(e,t,n,r){var i;const{itemComparer:o,focusManagement:a}=r;let s=null;if(n.highlightedValue!=null){var l;s=(l=e.find(f=>o(f,n.highlightedValue)))!=null?l:null}else a==="DOM"&&t.length===0&&(s=Ot(null,"reset",r));const d=((i=n.selectedValues)!=null?i:[]).filter(f=>e.some(h=>o(h,f)));return O({},n,{highlightedValue:s,selectedValues:d})}function mS(e,t){return O({},e,{highlightedValue:Ot(null,"reset",t)})}function vS(e,t){return O({},e,{highlightedValue:Ot(null,"end",t)})}function bS(e,t){return O({},e,{selectedValues:[],highlightedValue:Ot(null,"reset",t)})}function uh(e,t){const{type:n,context:r}=t;switch(n){case xt.keyDown:return dS(t.key,e,r);case xt.itemClick:return ch(t.item,e,r);case xt.blur:return fS(e,r);case xt.textNavigation:return pS(e,t.searchString,r);case xt.itemsChange:return gS(t.items,t.previousItems,e,r);case xt.resetHighlight:return mS(e,r);case xt.highlightLast:return vS(e,r);case xt.clearSelection:return bS(e,r);default:return e}}const yS=500;function xS(e){const t=W.useRef({searchString:"",lastTime:null});return W.useCallback(n=>{if(n.key.length===1&&n.key!==" "){const r=t.current,i=n.key.toLowerCase(),o=performance.now();r.searchString.length>0&&r.lastTime&&o-r.lastTime>yS?r.searchString=i:(r.searchString.length!==1||i!==r.searchString)&&(r.searchString+=i),r.lastTime=o,e(r.searchString,n)}},[e])}const dh={},CS=()=>{},wS=(e,t)=>e===t,IS=()=>!1,SS=e=>typeof e=="string"?e:String(e),AS=()=>({highlightedValue:null,selectedValues:[]});function TS(e){const{controlledProps:t=dh,disabledItemsFocusable:n=!1,disableListWrap:r=!1,focusManagement:i="activeDescendant",getInitialState:o=AS,getItemDomElement:a,getItemId:s,isItemDisabled:l=IS,rootRef:c,onStateChange:d=CS,items:f,itemComparer:h=wS,getItemAsString:p=SS,onChange:m,onHighlightChange:g,onItemsChange:v,orientation:S="vertical",pageSize:I=5,reducerActionContext:x=dh,selectionMode:C="single",stateReducer:y,componentName:A="useList"}=e,E=W.useRef(null),_=sn(c,E),D=W.useCallback((ae,X,le)=>{if(g==null||g(ae,X,le),i==="DOM"&&X!=null&&(le===xt.itemClick||le===xt.keyDown||le===xt.textNavigation)){var re;a==null||(re=a(X))==null||re.focus()}},[a,g,i]),G=W.useMemo(()=>({highlightedValue:h,selectedValues:(ae,X)=>qf(ae,X,h)}),[h]),F=W.useCallback((ae,X,le,re,ge)=>{switch(d==null||d(ae,X,le,re,ge),X){case"highlightedValue":D(ae,le,re);break;case"selectedValues":m==null||m(ae,le,re);break}},[D,m,d]),T=W.useMemo(()=>({disabledItemsFocusable:n,disableListWrap:r,focusManagement:i,isItemDisabled:l,itemComparer:h,items:f,getItemAsString:p,onHighlightChange:D,orientation:S,pageSize:I,selectionMode:C,stateComparers:G}),[n,r,i,l,h,f,p,D,S,I,C,G]),j=o(),Y=y!=null?y:uh,z=W.useMemo(()=>O({},x,T),[x,T]),[$,B]=oS({reducer:Y,actionContext:z,initialState:j,controlledProps:t,stateComparers:G,onStateChange:F,componentName:A}),{highlightedValue:H,selectedValues:q}=$,ee=xS((ae,X)=>B({type:xt.textNavigation,event:X,searchString:ae})),R=W.useRef([]);W.useEffect(()=>{qf(R.current,f,h)||(B({type:xt.itemsChange,event:null,items:f,previousItems:R.current}),R.current=f,v==null||v(f))},[f,h,B,v]);const M=ae=>X=>{var le;if((le=ae.onKeyDown)==null||le.call(ae,X),X.defaultMuiPrevented)return;const re=["Home","End","PageUp","PageDown"];S==="vertical"?re.push("ArrowUp","ArrowDown"):re.push("ArrowLeft","ArrowRight"),i==="activeDescendant"&&re.push(" ","Enter"),re.includes(X.key)&&X.preventDefault(),B({type:xt.keyDown,key:X.key,event:X}),ee(X)},U=ae=>X=>{var le,re;(le=ae.onBlur)==null||le.call(ae,X),!X.defaultMuiPrevented&&((re=E.current)!=null&&re.contains(X.relatedTarget)||B({type:xt.blur,event:X}))},V=(ae={})=>{const X=Ln(ae);return O({},ae,{"aria-activedescendant":i==="activeDescendant"&&H!=null?s(H):void 0,tabIndex:i==="DOM"?-1:0,ref:_},X,{onBlur:U(X),onKeyDown:M(X)})},ne=W.useCallback(ae=>{const X=(q!=null?q:[]).some(ge=>ge!=null&&h(ae,ge)),le=H!=null&&h(ae,H);return{focusable:i==="DOM",highlighted:le,selected:X}},[h,q,H,i]),se=W.useMemo(()=>({dispatch:B,getItemState:ne}),[B,ne]);return W.useDebugValue({state:$}),{contextValue:se,dispatch:B,getRootProps:V,rootRef:_,state:$}}const fh=W.createContext(null);function ES(e){const{handlePointerOverEvents:t=!1,item:n}=e,r=W.useContext(fh);if(!r)throw new Error("useListItem must be used within a ListProvider");const{dispatch:i,getItemState:o}=r,{highlighted:a,selected:s,focusable:l}=o(n),c=W.useCallback(p=>m=>{var g;(g=p.onClick)==null||g.call(p,m),!m.defaultPrevented&&i({type:xt.itemClick,item:n,event:m})},[i,n]),d=W.useCallback(p=>m=>{var g;(g=p.onMouseOver)==null||g.call(p,m),!m.defaultPrevented&&i({type:xt.itemHover,item:n,event:m})},[i,n]);let f;return l&&(f=a?0:-1),{getRootProps:(p={})=>{const m=Ln(p);return O({},p,{onClick:c(m),onPointerOver:t?d(m):void 0,tabIndex:f})},highlighted:a,selected:s}}const Wl=W.createContext(null);function kS(e){const t=Array.from(e.keys()).map(n=>{const r=e.get(n);return{key:n,subitem:r}});return t.sort((n,r)=>{const i=n.subitem.ref.current,o=r.subitem.ref.current;return i===null||o===null||i===o?0:i.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_PRECEDING?1:-1}),new Map(t.map(n=>[n.key,n.subitem]))}function hh(){const[e,t]=W.useState(new Map),n=W.useRef(new Set),r=W.useCallback(function(c){n.current.delete(c),t(d=>{const f=new Map(d);return f.delete(c),f})},[]),i=W.useCallback(function(c,d){let f;return typeof c=="function"?f=c(n.current):f=c,n.current.add(f),t(h=>{const p=new Map(h);return p.set(f,d),p}),{id:f,deregister:()=>r(f)}},[r]),o=W.useMemo(()=>kS(e),[e]),a=W.useCallback(function(c){return Array.from(o.keys()).indexOf(c)},[o]);return{contextValue:W.useMemo(()=>({getItemIndex:a,registerItem:i,totalSubitemCount:e.size}),[a,i,e.size]),subitems:o}}function ph(e,t){const n=W.useContext(Wl);if(n===null)throw new Error("useCompoundItem must be used within a useCompoundParent");const{registerItem:r}=n,[i,o]=W.useState(typeof e=="function"?void 0:e);return WI(()=>{const{id:a,deregister:s}=r(e,t);return o(a),s},[r,t,e]),{id:i,index:i!==void 0?n.getItemIndex(i):-1,totalItemCount:n.totalSubitemCount}}function _S(e,t){return function(r={}){const i=O({},r,e(r));return O({},i,t(i))}}const PS=Math.min,DS=Math.max,ha=Math.round,pa=Math.floor,ga=e=>({x:e,y:e});function OS(e){const{x:t,y:n,width:r,height:i}=e;return{width:r,height:i,top:n,left:t,right:t+r,bottom:n+i,x:t,y:n}}function gh(e){return vh(e)?(e.nodeName||"").toLowerCase():"#document"}function $n(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function mh(e){var t;return(t=(vh(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function vh(e){return e instanceof Node||e instanceof $n(e).Node}function RS(e){return e instanceof Element||e instanceof $n(e).Element}function Gl(e){return e instanceof HTMLElement||e instanceof $n(e).HTMLElement}function bh(e){return typeof ShadowRoot=="undefined"?!1:e instanceof ShadowRoot||e instanceof $n(e).ShadowRoot}function yh(e){const{overflow:t,overflowX:n,overflowY:r,display:i}=Yl(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(i)}function LS(){return typeof CSS=="undefined"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}function MS(e){return["html","body","#document"].includes(gh(e))}function Yl(e){return $n(e).getComputedStyle(e)}function BS(e){if(gh(e)==="html")return e;const t=e.assignedSlot||e.parentNode||bh(e)&&e.host||mh(e);return bh(t)?t.host:t}function xh(e){const t=BS(e);return MS(t)?e.ownerDocument?e.ownerDocument.body:e.body:Gl(t)&&yh(t)?t:xh(t)}function ma(e,t,n){var r;t===void 0&&(t=[]),n===void 0&&(n=!0);const i=xh(e),o=i===((r=e.ownerDocument)==null?void 0:r.body),a=$n(i);if(o){const s=Kl(a);return t.concat(a,a.visualViewport||[],yh(i)?i:[],s&&n?ma(s):[])}return t.concat(i,ma(i,[],n))}function Kl(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function $S(e){const t=Yl(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const i=Gl(e),o=i?e.offsetWidth:n,a=i?e.offsetHeight:r,s=ha(n)!==o||ha(r)!==a;return s&&(n=o,r=a),{width:n,height:r,$:s}}function ql(e){return RS(e)?e:e.contextElement}function Ch(e){const t=ql(e);if(!Gl(t))return ga(1);const n=t.getBoundingClientRect(),{width:r,height:i,$:o}=$S(t);let a=(o?ha(n.width):n.width)/r,s=(o?ha(n.height):n.height)/i;return(!a||!Number.isFinite(a))&&(a=1),(!s||!Number.isFinite(s))&&(s=1),{x:a,y:s}}const NS=ga(0);function FS(e){const t=$n(e);return!LS()||!t.visualViewport?NS:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function zS(e,t,n){return!1}function wh(e,t,n,r){t===void 0&&(t=!1);const i=e.getBoundingClientRect(),o=ql(e);let a=ga(1);t&&(a=Ch(e));const s=zS()?FS(o):ga(0);let l=(i.left+s.x)/a.x,c=(i.top+s.y)/a.y,d=i.width/a.x,f=i.height/a.y;if(o){const h=$n(o),p=r;let m=h,g=Kl(m);for(;g&&r&&p!==m;){const v=Ch(g),S=g.getBoundingClientRect(),I=Yl(g),x=S.left+(g.clientLeft+parseFloat(I.paddingLeft))*v.x,C=S.top+(g.clientTop+parseFloat(I.paddingTop))*v.y;l*=v.x,c*=v.y,d*=v.x,f*=v.y,l+=x,c+=C,m=$n(g),g=Kl(m)}}return OS({width:d,height:f,x:l,y:c})}function jS(e,t){let n=null,r;const i=mh(e);function o(){var s;clearTimeout(r),(s=n)==null||s.disconnect(),n=null}function a(s,l){s===void 0&&(s=!1),l===void 0&&(l=1),o();const{left:c,top:d,width:f,height:h}=e.getBoundingClientRect();if(s||t(),!f||!h)return;const p=pa(d),m=pa(i.clientWidth-(c+f)),g=pa(i.clientHeight-(d+h)),v=pa(c),I={rootMargin:-p+"px "+-m+"px "+-g+"px "+-v+"px",threshold:DS(0,PS(1,l))||1};let x=!0;function C(y){const A=y[0].intersectionRatio;if(A!==l){if(!x)return a();A?a(!1,A):r=setTimeout(()=>{a(!1,1e-7)},1e3)}x=!1}try{n=new IntersectionObserver(C,Q(N({},I),{root:i.ownerDocument}))}catch(y){n=new IntersectionObserver(C,I)}n.observe(e)}return a(!0),o}function US(e,t,n,r){r===void 0&&(r={});const{ancestorScroll:i=!0,ancestorResize:o=!0,elementResize:a=typeof ResizeObserver=="function",layoutShift:s=typeof IntersectionObserver=="function",animationFrame:l=!1}=r,c=ql(e),d=i||o?[...c?ma(c):[],...ma(t)]:[];d.forEach(S=>{i&&S.addEventListener("scroll",n,{passive:!0}),o&&S.addEventListener("resize",n)});const f=c&&s?jS(c,n):null;let h=-1,p=null;a&&(p=new ResizeObserver(S=>{let[I]=S;I&&I.target===c&&p&&(p.unobserve(t),cancelAnimationFrame(h),h=requestAnimationFrame(()=>{var x;(x=p)==null||x.observe(t)})),n()}),c&&!l&&p.observe(c),p.observe(t));let m,g=l?wh(e):null;l&&v();function v(){const S=wh(e);g&&(S.x!==g.x||S.y!==g.y||S.width!==g.width||S.height!==g.height)&&n(),g=S,m=requestAnimationFrame(v)}return n(),()=>{var S;d.forEach(I=>{i&&I.removeEventListener("scroll",n),o&&I.removeEventListener("resize",n)}),f==null||f(),(S=p)==null||S.disconnect(),p=null,l&&cancelAnimationFrame(m)}}function VS(e){const{checked:t,defaultChecked:n,disabled:r,onBlur:i,onChange:o,onFocus:a,onFocusVisible:s,readOnly:l,required:c}=e,[d,f]=Nl({controlled:t,default:!!n,name:"Switch",state:"checked"}),h=_=>D=>{var G;D.nativeEvent.defaultPrevented||(f(D.target.checked),o==null||o(D),(G=_.onChange)==null||G.call(_,D))},{isFocusVisibleRef:p,onBlur:m,onFocus:g,ref:v}=ih(),[S,I]=W.useState(!1);r&&S&&I(!1),W.useEffect(()=>{p.current=S},[S,p]);const x=W.useRef(null),C=_=>D=>{var G;x.current||(x.current=D.currentTarget),g(D),p.current===!0&&(I(!0),s==null||s(D)),a==null||a(D),(G=_.onFocus)==null||G.call(_,D)},y=_=>D=>{var G;m(D),p.current===!1&&I(!1),i==null||i(D),(G=_.onBlur)==null||G.call(_,D)},A=sn(v,x);return{checked:d,disabled:!!r,focusVisible:S,getInputProps:(_={})=>O({checked:t,defaultChecked:n,disabled:r,readOnly:l,ref:A,required:c,type:"checkbox",role:"switch","aria-checked":t},_,{onChange:h(_),onFocus:C(_),onBlur:y(_)}),inputRef:A,readOnly:!!l}}function HS(e){const{value:t,defaultValue:n,onChange:r,orientation:i="horizontal",direction:o="ltr",selectionFollowsFocus:a=!1}=e,[s,l]=Nl({controlled:t,default:n,name:"Tabs",state:"value"}),c=W.useCallback((v,S)=>{l(S),r==null||r(v,S)},[r,l]),{subitems:d,contextValue:f}=hh(),h=W.useRef(()=>{}),p=W.useCallback(v=>{var S;return(S=d.get(v))==null?void 0:S.id},[d]),m=W.useCallback(v=>h.current(v),[]),g=W.useCallback(v=>{h.current=v},[]);return{contextValue:O({direction:o,getTabId:m,getTabPanelId:p,onSelected:c,orientation:i,registerTabIdLookup:g,selectionFollowsFocus:a,value:s},f)}}const Ih=W.createContext(null);function va(){const e=W.useContext(Ih);if(e==null)throw new Error("No TabsContext provided");return e}function WS(e){const{value:t,children:n}=e,{direction:r,getItemIndex:i,onSelected:o,orientation:a,registerItem:s,registerTabIdLookup:l,selectionFollowsFocus:c,totalSubitemCount:d,value:f,getTabId:h,getTabPanelId:p}=t,m=W.useMemo(()=>({getItemIndex:i,registerItem:s,totalSubitemCount:d}),[s,i,d]),g=W.useMemo(()=>({direction:r,getTabId:h,getTabPanelId:p,onSelected:o,orientation:a,registerTabIdLookup:l,selectionFollowsFocus:c,value:f}),[r,h,p,o,a,l,c,f]);return u.jsx(Wl.Provider,{value:m,children:u.jsx(Ih.Provider,{value:g,children:n})})}function GS(e){return e.size}function YS(e){const{value:t,id:n,rootRef:r}=e,i=va();if(i===null)throw new Error("No TabContext provided");const{value:o,getTabId:a}=i,s=Hi(n),l=W.useRef(null),c=sn(l,r),d=W.useMemo(()=>({id:s,ref:l}),[s]),{id:f}=ph(t!=null?t:GS,d),h=f!==o,p=f!==void 0?a(f):void 0;return{hidden:h,getRootProps:(g={})=>O({"aria-labelledby":p!=null?p:void 0,hidden:h,id:s!=null?s:void 0},g,{ref:c}),rootRef:c}}const Sh={valueChange:"valueChange"};function KS(e,t){if(t.type===Sh.valueChange)return O({},e,{highlightedValue:t.value});const n=uh(e,t),{context:{selectionFollowsFocus:r}}=t;if(t.type===xt.itemsChange){if(n.selectedValues.length>0)return O({},n,{highlightedValue:n.selectedValues[0]});Ot(null,"reset",t.context)}return r&&n.highlightedValue!=null?O({},n,{selectedValues:[n.highlightedValue]}):n}function qS(e){var t;const{rootRef:n}=e,{direction:r="ltr",onSelected:i,orientation:o="horizontal",value:a,registerTabIdLookup:s,selectionFollowsFocus:l}=va(),{subitems:c,contextValue:d}=hh(),f=W.useCallback(F=>{var T;return(T=c.get(F))==null?void 0:T.id},[c]);s(f);const h=W.useMemo(()=>Array.from(c.keys()),[c]),p=W.useCallback(F=>{var T,j;return F==null?null:(T=(j=c.get(F))==null?void 0:j.ref.current)!=null?T:null},[c]),m=r==="rtl";let g;o==="vertical"?g="vertical":g=m?"horizontal-rtl":"horizontal-ltr";const v=W.useCallback((F,T)=>{var j;i(F,(j=T[0])!=null?j:null)},[i]),S=W.useMemo(()=>a===void 0?{}:a!=null?{selectedValues:[a]}:{selectedValues:[]},[a]),I=W.useCallback(F=>{var T,j;return(T=(j=c.get(F))==null?void 0:j.disabled)!=null?T:!1},[c]),{contextValue:x,dispatch:C,getRootProps:y,state:{highlightedValue:A,selectedValues:E},rootRef:_}=TS({controlledProps:S,disabledItemsFocusable:!l,focusManagement:"DOM",getItemDomElement:p,isItemDisabled:I,items:h,rootRef:n,onChange:v,orientation:g,reducerActionContext:W.useMemo(()=>({selectionFollowsFocus:l||!1}),[l]),selectionMode:"single",stateReducer:KS});W.useEffect(()=>{a!==void 0&&a!=null&&C({type:Sh.valueChange,value:a})},[C,a]);const D=(F={})=>O({},F,y(F),{"aria-orientation":o==="vertical"?"vertical":void 0,role:"tablist"});return{contextValue:W.useMemo(()=>O({},d,x),[d,x]),dispatch:C,getRootProps:D,highlightedValue:A,isRtl:m,orientation:o,rootRef:_,selectedValue:(t=E[0])!=null?t:null}}function QS(e){const{value:t,children:n}=e,{dispatch:r,getItemIndex:i,getItemState:o,registerItem:a,totalSubitemCount:s}=t,l=W.useMemo(()=>({dispatch:r,getItemState:o,getItemIndex:i}),[r,i,o]),c=W.useMemo(()=>({getItemIndex:i,registerItem:a,totalSubitemCount:s}),[a,i,s]);return u.jsx(Wl.Provider,{value:c,children:u.jsx(fh.Provider,{value:l,children:n})})}function JS(e){return e.size}function XS(e){const{value:t,rootRef:n,disabled:r=!1,id:i}=e,o=W.useRef(null),a=Hi(i),{value:s,selectionFollowsFocus:l,getTabPanelId:c}=va(),d=W.useMemo(()=>({disabled:r,ref:o,id:a}),[r,o,a]),{id:f,index:h,totalItemCount:p}=ph(t!=null?t:JS,d),{getRootProps:m,highlighted:g,selected:v}=ES({item:f}),{getRootProps:S,rootRef:I,active:x,focusVisible:C,setFocusVisible:y}=Ul({disabled:r,focusableWhenDisabled:!l,type:"button"}),A=sn(o,n,I),E=f!==void 0?c(f):void 0;return{getRootProps:(D={})=>{const G=Ln(D),F=_S(m,S);return O({},D,F(G),{role:"tab","aria-controls":E,"aria-selected":v,id:a,ref:A})},active:x,focusVisible:C,highlighted:g,index:h,rootRef:A,selected:v||f===s,setFocusVisible:y,totalTabsCount:p}}const Ah="$$joy";function ZS(e){var t=Object.create(null);return function(n){return t[n]===void 0&&(t[n]=e(n)),t[n]}}function eA(e,t){return bi(e,t)}const tA=(e,t)=>{Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))},nA=["values","unit","step"],rA=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>O({},n,{[r.key]:r.val}),{})};function Th(e){const{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=e,i=Te(e,nA),o=rA(t),a=Object.keys(o);function s(h){return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n})`}function l(h){return`@media (max-width:${(typeof t[h]=="number"?t[h]:h)-r/100}${n})`}function c(h,p){const m=a.indexOf(p);return`@media (min-width:${typeof t[h]=="number"?t[h]:h}${n}) and (max-width:${(m!==-1&&typeof t[a[m]]=="number"?t[a[m]]:p)-r/100}${n})`}function d(h){return a.indexOf(h)+1<a.length?c(h,a[a.indexOf(h)+1]):s(h)}function f(h){const p=a.indexOf(h);return p===0?s(a[1]):p===a.length-1?l(a[p]):c(h,a[a.indexOf(h)+1]).replace("@media","@media not all and")}return O({keys:a,values:o,up:s,down:l,between:c,only:d,not:f,unit:n},i)}const iA={borderRadius:4};function Wi(e,t){return t?Bn(e,t,{clone:!1}):e}const Ql={xs:0,sm:600,md:900,lg:1200,xl:1536},Eh={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Ql[e]}px)`};function Nn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Eh;return t.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(t[l]),a),{})}if(typeof t=="object"){const o=r.breakpoints||Eh;return Object.keys(t).reduce((a,s)=>{if(Object.keys(o.values||Ql).indexOf(s)!==-1){const l=o.up(s);a[l]=n(t[s],s)}else{const l=s;a[l]=t[l]}return a},{})}return n(t)}function oA(e={}){var t;return((t=e.keys)==null?void 0:t.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function aA(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function er(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function ba(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=er(e,n)||r,t&&(i=t(i,r,e)),i}function rt(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const s=a[t],l=a.theme,c=er(l,r)||{};return Nn(a,s,f=>{let h=ba(c,i,f);return f===h&&typeof f=="string"&&(h=ba(c,i,`${t}${f==="default"?"":xe(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes={},o.filterProps=[t],o}function sA(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const lA={m:"margin",p:"padding"},cA={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},kh={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},uA=sA(e=>{if(e.length>2)if(kh[e])e=kh[e];else return[e];const[t,n]=e.split(""),r=lA[t],i=cA[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),Jl=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],Xl=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...Jl,...Xl];function Gi(e,t,n,r){var i;const o=(i=er(e,t,!1))!=null?i:n;return typeof o=="number"?a=>typeof a=="string"?a:o*a:Array.isArray(o)?a=>typeof a=="string"?a:o[a]:typeof o=="function"?o:()=>{}}function _h(e){return Gi(e,"spacing",8)}function Yi(e,t){if(typeof t=="string"||t==null)return t;const n=Math.abs(t),r=e(n);return t>=0?r:typeof r=="number"?-r:`-${r}`}function dA(e,t){return n=>e.reduce((r,i)=>(r[i]=Yi(t,n),r),{})}function fA(e,t,n,r){if(t.indexOf(n)===-1)return null;const i=uA(n),o=dA(i,r),a=e[n];return Nn(e,a,o)}function Ph(e,t){const n=_h(e.theme);return Object.keys(e).map(r=>fA(e,t,r,n)).reduce(Wi,{})}function Qe(e){return Ph(e,Jl)}Qe.propTypes={},Qe.filterProps=Jl;function Je(e){return Ph(e,Xl)}Je.propTypes={},Je.filterProps=Xl;function Dh(e=8){if(e.mui)return e;const t=_h({spacing:e}),n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function ya(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?Wi(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function Zt(e){return typeof e!="number"?e:`${e}px solid`}function en(e,t){return rt({prop:e,themeKey:"borders",transform:t})}const hA=en("border",Zt),pA=en("borderTop",Zt),gA=en("borderRight",Zt),mA=en("borderBottom",Zt),vA=en("borderLeft",Zt),bA=en("borderColor"),yA=en("borderTopColor"),xA=en("borderRightColor"),CA=en("borderBottomColor"),wA=en("borderLeftColor"),IA=en("outline",Zt),SA=en("outlineColor"),xa=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Gi(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:Yi(t,r)});return Nn(e,e.borderRadius,n)}return null};xa.propTypes={},xa.filterProps=["borderRadius"],ya(hA,pA,gA,mA,vA,bA,yA,xA,CA,wA,xa,IA,SA);const Ca=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Gi(e.theme,"spacing",8),n=r=>({gap:Yi(t,r)});return Nn(e,e.gap,n)}return null};Ca.propTypes={},Ca.filterProps=["gap"];const wa=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Gi(e.theme,"spacing",8),n=r=>({columnGap:Yi(t,r)});return Nn(e,e.columnGap,n)}return null};wa.propTypes={},wa.filterProps=["columnGap"];const Ia=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Gi(e.theme,"spacing",8),n=r=>({rowGap:Yi(t,r)});return Nn(e,e.rowGap,n)}return null};Ia.propTypes={},Ia.filterProps=["rowGap"];const AA=rt({prop:"gridColumn"}),TA=rt({prop:"gridRow"}),EA=rt({prop:"gridAutoFlow"}),kA=rt({prop:"gridAutoColumns"}),_A=rt({prop:"gridAutoRows"}),PA=rt({prop:"gridTemplateColumns"}),DA=rt({prop:"gridTemplateRows"}),OA=rt({prop:"gridTemplateAreas"}),RA=rt({prop:"gridArea"});ya(Ca,wa,Ia,AA,TA,EA,kA,_A,PA,DA,OA,RA);function Ur(e,t){return t==="grey"?t:e}const LA=rt({prop:"color",themeKey:"palette",transform:Ur}),MA=rt({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Ur}),BA=rt({prop:"backgroundColor",themeKey:"palette",transform:Ur});ya(LA,MA,BA);function Ht(e){return e<=1&&e!==0?`${e*100}%`:e}const $A=rt({prop:"width",transform:Ht}),Zl=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var r,i;const o=((r=e.theme)==null||(r=r.breakpoints)==null||(r=r.values)==null?void 0:r[n])||Ql[n];return o?((i=e.theme)==null||(i=i.breakpoints)==null?void 0:i.unit)!=="px"?{maxWidth:`${o}${e.theme.breakpoints.unit}`}:{maxWidth:o}:{maxWidth:Ht(n)}};return Nn(e,e.maxWidth,t)}return null};Zl.filterProps=["maxWidth"];const NA=rt({prop:"minWidth",transform:Ht}),FA=rt({prop:"height",transform:Ht}),zA=rt({prop:"maxHeight",transform:Ht}),jA=rt({prop:"minHeight",transform:Ht});rt({prop:"size",cssProperty:"width",transform:Ht}),rt({prop:"size",cssProperty:"height",transform:Ht});const UA=rt({prop:"boxSizing"});ya($A,Zl,NA,FA,zA,jA,UA);const Sa={border:{themeKey:"borders",transform:Zt},borderTop:{themeKey:"borders",transform:Zt},borderRight:{themeKey:"borders",transform:Zt},borderBottom:{themeKey:"borders",transform:Zt},borderLeft:{themeKey:"borders",transform:Zt},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:Zt},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:xa},color:{themeKey:"palette",transform:Ur},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Ur},backgroundColor:{themeKey:"palette",transform:Ur},p:{style:Je},pt:{style:Je},pr:{style:Je},pb:{style:Je},pl:{style:Je},px:{style:Je},py:{style:Je},padding:{style:Je},paddingTop:{style:Je},paddingRight:{style:Je},paddingBottom:{style:Je},paddingLeft:{style:Je},paddingX:{style:Je},paddingY:{style:Je},paddingInline:{style:Je},paddingInlineStart:{style:Je},paddingInlineEnd:{style:Je},paddingBlock:{style:Je},paddingBlockStart:{style:Je},paddingBlockEnd:{style:Je},m:{style:Qe},mt:{style:Qe},mr:{style:Qe},mb:{style:Qe},ml:{style:Qe},mx:{style:Qe},my:{style:Qe},margin:{style:Qe},marginTop:{style:Qe},marginRight:{style:Qe},marginBottom:{style:Qe},marginLeft:{style:Qe},marginX:{style:Qe},marginY:{style:Qe},marginInline:{style:Qe},marginInlineStart:{style:Qe},marginInlineEnd:{style:Qe},marginBlock:{style:Qe},marginBlockStart:{style:Qe},marginBlockEnd:{style:Qe},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ca},rowGap:{style:Ia},columnGap:{style:wa},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Ht},maxWidth:{style:Zl},minWidth:{transform:Ht},height:{transform:Ht},maxHeight:{transform:Ht},minHeight:{transform:Ht},boxSizing:{},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function VA(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function HA(e,t){return typeof e=="function"?e(t):e}function WA(){function e(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:d,style:f}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=er(i,c)||{};return f?f(a):Nn(a,r,m=>{let g=ba(h,d,m);return m===g&&typeof m=="string"&&(g=ba(h,d,`${n}${m==="default"?"":xe(m)}`,m)),l===!1?g:{[l]:g}})}function t(n){var r;const{sx:i,theme:o={}}=n||{};if(!i)return null;const a=(r=o.unstable_sxConfig)!=null?r:Sa;function s(l){let c=l;if(typeof l=="function")c=l(o);else if(typeof l!="object")return l;if(!c)return null;const d=oA(o.breakpoints),f=Object.keys(d);let h=d;return Object.keys(c).forEach(p=>{const m=HA(c[p],o);if(m!=null)if(typeof m=="object")if(a[p])h=Wi(h,e(p,m,o,a));else{const g=Nn({theme:o},m,v=>({[p]:v}));VA(g,m)?h[p]=t({sx:m,theme:o}):h=Wi(h,g)}else h=Wi(h,e(p,m,o,a))}),aA(f,h)}return Array.isArray(i)?i.map(s):s(i)}return t}const Aa=WA();Aa.filterProps=["sx"];function Oh(e,t){const n=this;return n.vars&&typeof n.getColorSchemeSelector=="function"?{[n.getColorSchemeSelector(e).replace(/(\[[^\]]+\])/,"*:where($1)")]:t}:n.palette.mode===e?t:{}}const GA=["breakpoints","palette","spacing","shape"];function Rh(e={},...t){const{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=e,a=Te(e,GA),s=Th(n),l=Dh(i);let c=Bn({breakpoints:s,direction:"ltr",components:{},palette:O({mode:"light"},r),spacing:l,shape:O({},iA,o)},a);return c.applyStyles=Oh,c=t.reduce((d,f)=>Bn(d,f),c),c.unstable_sxConfig=O({},Sa,a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(f){return Aa({sx:f,theme:this})},c}function YA(e){return Object.keys(e).length===0}function KA(e=null){const t=W.useContext(pe.ThemeContext);return!t||YA(t)?e:t}const qA=Rh();function QA(e=qA){return KA(e)}const JA=["sx"],XA=e=>{var t,n;const r={systemProps:{},otherProps:{}},i=(t=e==null||(n=e.theme)==null?void 0:n.unstable_sxConfig)!=null?t:Sa;return Object.keys(e).forEach(o=>{i[o]?r.systemProps[o]=e[o]:r.otherProps[o]=e[o]}),r};function ZA(e){const{sx:t}=e,n=Te(e,JA),{systemProps:r,otherProps:i}=XA(n);let o;return Array.isArray(t)?o=[r,...t]:typeof t=="function"?o=(...a)=>{const s=t(...a);return Zn(s)?O({},r,s):r}:o=O({},r,t),O({},i,{sx:o})}const e1=["ownerState"],t1=["variants"],n1=["name","slot","skipVariantsResolver","skipSx","overridesResolver"];function r1(e){return Object.keys(e).length===0}function i1(e){return typeof e=="string"&&e.charCodeAt(0)>96}function ec(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const o1=Rh(),a1=e=>e&&e.charAt(0).toLowerCase()+e.slice(1);function Ta({defaultTheme:e,theme:t,themeId:n}){return r1(t)?e:t[n]||t}function s1(e){return e?(t,n)=>n[e]:null}function Ea(e,t){let{ownerState:n}=t,r=Te(t,e1);const i=typeof e=="function"?e(O({ownerState:n},r)):e;if(Array.isArray(i))return i.flatMap(o=>Ea(o,O({ownerState:n},r)));if(i&&typeof i=="object"&&Array.isArray(i.variants)){const{variants:o=[]}=i;let s=Te(i,t1);return o.forEach(l=>{let c=!0;typeof l.props=="function"?c=l.props(O({ownerState:n},r,n)):Object.keys(l.props).forEach(d=>{(n==null?void 0:n[d])!==l.props[d]&&r[d]!==l.props[d]&&(c=!1)}),c&&(Array.isArray(s)||(s=[s]),s.push(typeof l.style=="function"?l.style(O({ownerState:n},r,n)):l.style))}),s}return i}function l1(e={}){const{themeId:t,defaultTheme:n=o1,rootShouldForwardProp:r=ec,slotShouldForwardProp:i=ec}=e,o=a=>Aa(O({},a,{theme:Ta(O({},a,{defaultTheme:n,themeId:t}))}));return o.__mui_systemSx=!0,(a,s={})=>{tA(a,y=>y.filter(A=>!(A!=null&&A.__mui_systemSx)));const{name:l,slot:c,skipVariantsResolver:d,skipSx:f,overridesResolver:h=s1(a1(c))}=s,p=Te(s,n1),m=d!==void 0?d:c&&c!=="Root"&&c!=="root"||!1,g=f||!1;let v,S=ec;c==="Root"||c==="root"?S=r:c?S=i:i1(a)&&(S=void 0);const I=eA(a,O({shouldForwardProp:S,label:v},p)),x=y=>typeof y=="function"&&y.__emotion_real!==y||Zn(y)?A=>Ea(y,O({},A,{theme:Ta({theme:A.theme,defaultTheme:n,themeId:t})})):y,C=(y,...A)=>{let E=x(y);const _=A?A.map(x):[];l&&h&&_.push(F=>{const T=Ta(O({},F,{defaultTheme:n,themeId:t}));if(!T.components||!T.components[l]||!T.components[l].styleOverrides)return null;const j=T.components[l].styleOverrides,Y={};return Object.entries(j).forEach(([z,$])=>{Y[z]=Ea($,O({},F,{theme:T}))}),h(F,Y)}),l&&!m&&_.push(F=>{var T;const j=Ta(O({},F,{defaultTheme:n,themeId:t})),Y=j==null||(T=j.components)==null||(T=T[l])==null?void 0:T.variants;return Ea({variants:Y},O({},F,{theme:j}))}),g||_.push(o);const D=_.length-A.length;if(Array.isArray(y)&&D>0){const F=new Array(D).fill("");E=[...y,...F],E.raw=[...y.raw,...F]}const G=I(E,..._);return a.muiName&&(G.muiName=a.muiName),G};return I.withConfig&&(C.withConfig=I.withConfig),C}}function c1(e){const{theme:t,name:n,props:r}=e;return!t||!t.components||!t.components[n]||!t.components[n].defaultProps?r:oh(t.components[n].defaultProps,r)}function u1({props:e,name:t,defaultTheme:n,themeId:r}){let i=QA(n);return r&&(i=i[r]||i),c1({theme:i,name:t,props:e})}function d1(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function Lh(e){if(e.type)return e;if(e.charAt(0)==="#")return Lh(d1(e));const t=e.indexOf("("),n=e.substring(0,t);if(["rgb","rgba","hsl","hsla","color"].indexOf(n)===-1)throw new Error(ta(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].indexOf(i)===-1)throw new Error(ta(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const mr=e=>{const t=Lh(e);return t.values.slice(0,3).map((n,r)=>t.type.indexOf("hsl")!==-1&&r!==0?`${n}%`:n).join(" ")};function tc(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const Mh=(e,t,n,r=[])=>{let i=e;t.forEach((o,a)=>{a===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},f1=(e,t,n)=>{function r(i,o=[],a=[]){Object.entries(i).forEach(([s,l])=>{(!n||n&&!n([...o,s]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,s],Array.isArray(l)?[...a,s]:a):t([...o,s],l,a))})}r(e)},h1=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().indexOf("opacity")>=0?t:`${t}px`:t;function nc(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return f1(e,(s,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(s,l))){const d=`--${n?`${n}-`:""}${s.join("-")}`;Object.assign(i,{[d]:h1(s,l)}),Mh(o,s,`var(${d})`,c),Mh(a,s,`var(${d}, ${l})`,c)}},s=>s[0]==="vars"),{css:i,vars:o,varsWithDefaults:a}}function vr(e){"@babel/helpers - typeof";return vr=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},vr(e)}function p1(e,t){if(vr(e)!="object"||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t);if(vr(r)!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}function rc(e){var t=p1(e,"string");return vr(t)=="symbol"?t:t+""}const g1=["colorSchemes","components","defaultColorScheme"];function m1(e,t){const{colorSchemes:n={},defaultColorScheme:r="light"}=e,i=Te(e,g1),{vars:o,css:a,varsWithDefaults:s}=nc(i,t);let l=s;const c={},{[r]:d}=n,f=Te(n,[r].map(rc));if(Object.entries(f||{}).forEach(([p,m])=>{const{vars:g,css:v,varsWithDefaults:S}=nc(m,t);l=Bn(l,S),c[p]={css:v,vars:g}}),d){const{css:p,vars:m,varsWithDefaults:g}=nc(d,t);l=Bn(l,g),c[r]={css:p,vars:m}}return{vars:l,generateCssVars:p=>{var m;if(!p){var g;const S=O({},a);return{css:S,vars:o,selector:(t==null||(g=t.getSelector)==null?void 0:g.call(t,p,S))||":root"}}const v=O({},c[p].css);return{css:v,vars:c[p].vars,selector:(t==null||(m=t.getSelector)==null?void 0:m.call(t,p,v))||":root"}}}}const v1=O({},Sa,{borderRadius:{themeKey:"radius"},boxShadow:{themeKey:"shadow"},fontFamily:{themeKey:"fontFamily"},fontSize:{themeKey:"fontSize"},fontWeight:{themeKey:"fontWeight"},letterSpacing:{themeKey:"letterSpacing"},lineHeight:{themeKey:"lineHeight"}}),Ki={grey:{50:"#FBFCFE",100:"#F0F4F8",200:"#DDE7EE",300:"#CDD7E1",400:"#9FA6AD",500:"#636B74",600:"#555E68",700:"#32383E",800:"#171A1C",900:"#0B0D0E"},blue:{50:"#EDF5FD",100:"#E3EFFB",200:"#C7DFF7",300:"#97C3F0",400:"#4393E4",500:"#0B6BCB",600:"#185EA5",700:"#12467B",800:"#0A2744",900:"#051423"},yellow:{50:"#FEFAF6",100:"#FDF0E1",200:"#FCE1C2",300:"#F3C896",400:"#EA9A3E",500:"#9A5B13",600:"#72430D",700:"#492B08",800:"#2E1B05",900:"#1D1002"},red:{50:"#FEF6F6",100:"#FCE4E4",200:"#F7C5C5",300:"#F09898",400:"#E47474",500:"#C41C1C",600:"#A51818",700:"#7D1212",800:"#430A0A",900:"#240505"},green:{50:"#F6FEF6",100:"#E3FBE3",200:"#C7F7C7",300:"#A1E8A1",400:"#51BC51",500:"#1F7A1F",600:"#136C13",700:"#0A470A",800:"#042F04",900:"#021D02"}};function b1(e){var t;return!!e[0].match(/^(typography|variants|breakpoints)$/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/^(mode)$/))||e[0]==="focus"&&e[1]!=="thickness"}const it=(e,t)=>sh(e,t,"Mui"),Xe=(e,t)=>nS(e,t,"Mui"),y1=e=>e&&typeof e=="object"&&Object.keys(e).some(t=>{var n;return(n=t.match)==null?void 0:n.call(t,/^(plain(Hover|Active|Disabled)?(Color|Bg)|outlined(Hover|Active|Disabled)?(Color|Border|Bg)|soft(Hover|Active|Disabled)?(Color|Bg)|solid(Hover|Active|Disabled)?(Color|Bg))$/)}),Bh=(e,t,n)=>{t.includes("Color")&&(e.color=n),t.includes("Bg")&&(e.backgroundColor=n),t.includes("Border")&&(e.borderColor=n)},$h=(e,t,n)=>{const r={};return Object.entries(t||{}).forEach(([i,o])=>{if(i.match(new RegExp(`${e}(color|bg|border)`,"i"))&&o){const a=n?n(i):o;i.includes("Disabled")&&(r.pointerEvents="none",r.cursor="default",r["--Icon-color"]="currentColor"),i.match(/(Hover|Active|Disabled)/)||(r["--variant-borderWidth"]||(r["--variant-borderWidth"]="0px"),i.includes("Border")&&(r["--variant-borderWidth"]="1px",r.border="var(--variant-borderWidth) solid")),Bh(r,i,a)}}),r},Et=(e,t)=>{let n={};if(t){const{getCssVar:r,palette:i}=t;Object.entries(i).forEach(o=>{const[a,s]=o;y1(s)&&typeof s=="object"&&(n=O({},n,{[a]:$h(e,s,l=>`var(--variant-${l}, ${r(`palette-${a}-${l}`,i[a][l])})`)}))})}return n.context=$h(e,{plainColor:"var(--variant-plainColor)",plainHoverColor:"var(--variant-plainHoverColor)",plainHoverBg:"var(--variant-plainHoverBg)",plainActiveBg:"var(--variant-plainActiveBg)",plainDisabledColor:"var(--variant-plainDisabledColor)",outlinedColor:"var(--variant-outlinedColor)",outlinedBorder:"var(--variant-outlinedBorder)",outlinedHoverColor:"var(--variant-outlinedHoverColor)",outlinedHoverBorder:"var(--variant-outlinedHoverBorder)",outlinedHoverBg:"var(--variant-outlinedHoverBg)",outlinedActiveBg:"var(--variant-outlinedActiveBg)",outlinedDisabledColor:"var(--variant-outlinedDisabledColor)",outlinedDisabledBorder:"var(--variant-outlinedDisabledBorder)",softColor:"var(--variant-softColor)",softBg:"var(--variant-softBg)",softHoverColor:"var(--variant-softHoverColor)",softHoverBg:"var(--variant-softHoverBg)",softActiveBg:"var(--variant-softActiveBg)",softDisabledColor:"var(--variant-softDisabledColor)",softDisabledBg:"var(--variant-softDisabledBg)",solidColor:"var(--variant-solidColor)",solidBg:"var(--variant-solidBg)",solidHoverBg:"var(--variant-solidHoverBg)",solidActiveBg:"var(--variant-solidActiveBg)",solidDisabledColor:"var(--variant-solidDisabledColor)",solidDisabledBg:"var(--variant-solidDisabledBg)"}),n},x1=["cssVarPrefix","breakpoints","spacing","components","variants","shouldSkipGeneratingVar"],C1=["colorSchemes"],w1=(e="joy")=>tc(e);function I1(e){var t,n,r,i,o,a,s,l,c,d;const f={},{cssVarPrefix:h="joy",breakpoints:p,spacing:m,components:g,variants:v,shouldSkipGeneratingVar:S=b1}=f,I=Te(f,x1),x=w1(h),C={primary:Ki.blue,neutral:Ki.grey,danger:Ki.red,success:Ki.green,warning:Ki.yellow,common:{white:"#FFF",black:"#000"}},y=X=>{var le;const re=X.split("-"),ge=re[1],Ae=re[2];return x(X,(le=C[ge])==null?void 0:le[Ae])},A=X=>({plainColor:y(`palette-${X}-500`),plainHoverBg:y(`palette-${X}-100`),plainActiveBg:y(`palette-${X}-200`),plainDisabledColor:y("palette-neutral-400"),outlinedColor:y(`palette-${X}-500`),outlinedBorder:y(`palette-${X}-300`),outlinedHoverBg:y(`palette-${X}-100`),outlinedActiveBg:y(`palette-${X}-200`),outlinedDisabledColor:y("palette-neutral-400"),outlinedDisabledBorder:y("palette-neutral-200"),softColor:y(`palette-${X}-700`),softBg:y(`palette-${X}-100`),softHoverBg:y(`palette-${X}-200`),softActiveColor:y(`palette-${X}-800`),softActiveBg:y(`palette-${X}-300`),softDisabledColor:y("palette-neutral-400"),softDisabledBg:y("palette-neutral-50"),solidColor:y("palette-common-white"),solidBg:y(`palette-${X}-500`),solidHoverBg:y(`palette-${X}-600`),solidActiveBg:y(`palette-${X}-700`),solidDisabledColor:y("palette-neutral-400"),solidDisabledBg:y("palette-neutral-100")}),E=X=>({plainColor:y(`palette-${X}-300`),plainHoverBg:y(`palette-${X}-800`),plainActiveBg:y(`palette-${X}-700`),plainDisabledColor:y("palette-neutral-500"),outlinedColor:y(`palette-${X}-200`),outlinedBorder:y(`palette-${X}-700`),outlinedHoverBg:y(`palette-${X}-800`),outlinedActiveBg:y(`palette-${X}-700`),outlinedDisabledColor:y("palette-neutral-500"),outlinedDisabledBorder:y("palette-neutral-800"),softColor:y(`palette-${X}-200`),softBg:y(`palette-${X}-800`),softHoverBg:y(`palette-${X}-700`),softActiveColor:y(`palette-${X}-100`),softActiveBg:y(`palette-${X}-600`),softDisabledColor:y("palette-neutral-500"),softDisabledBg:y("palette-neutral-800"),solidColor:y("palette-common-white"),solidBg:y(`palette-${X}-500`),solidHoverBg:y(`palette-${X}-600`),solidActiveBg:y(`palette-${X}-700`),solidDisabledColor:y("palette-neutral-500"),solidDisabledBg:y("palette-neutral-800")}),_={palette:{mode:"light",primary:O({},C.primary,A("primary")),neutral:O({},C.neutral,A("neutral"),{plainColor:y("palette-neutral-700"),plainHoverColor:y("palette-neutral-900"),outlinedColor:y("palette-neutral-700")}),danger:O({},C.danger,A("danger")),success:O({},C.success,A("success")),warning:O({},C.warning,A("warning")),common:{white:"#FFF",black:"#000"},text:{primary:y("palette-neutral-800"),secondary:y("palette-neutral-700"),tertiary:y("palette-neutral-600"),icon:y("palette-neutral-500")},background:{body:y("palette-common-white"),surface:y("palette-neutral-50"),popup:y("palette-common-white"),level1:y("palette-neutral-100"),level2:y("palette-neutral-200"),level3:y("palette-neutral-300"),tooltip:y("palette-neutral-500"),backdrop:`rgba(${x("palette-neutral-darkChannel",mr(C.neutral[900]))} / 0.25)`},divider:`rgba(${x("palette-neutral-mainChannel",mr(C.neutral[500]))} / 0.2)`,focusVisible:y("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"21 21 21",shadowOpacity:"0.08"},D={palette:{mode:"dark",primary:O({},C.primary,E("primary")),neutral:O({},C.neutral,E("neutral"),{plainColor:y("palette-neutral-300"),plainHoverColor:y("palette-neutral-300")}),danger:O({},C.danger,E("danger")),success:O({},C.success,E("success")),warning:O({},C.warning,E("warning")),common:{white:"#FFF",black:"#000"},text:{primary:y("palette-neutral-100"),secondary:y("palette-neutral-300"),tertiary:y("palette-neutral-400"),icon:y("palette-neutral-400")},background:{body:y("palette-common-black"),surface:y("palette-neutral-900"),popup:y("palette-common-black"),level1:y("palette-neutral-800"),level2:y("palette-neutral-700"),level3:y("palette-neutral-600"),tooltip:y("palette-neutral-600"),backdrop:`rgba(${x("palette-neutral-darkChannel",mr(C.neutral[50]))} / 0.25)`},divider:`rgba(${x("palette-neutral-mainChannel",mr(C.neutral[500]))} / 0.16)`,focusVisible:y("palette-primary-500")},shadowRing:"0 0 #000",shadowChannel:"0 0 0",shadowOpacity:"0.6"},G='-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"',F=O({body:`"Inter", ${x(`fontFamily-fallback, ${G}`)}`,display:`"Inter", ${x(`fontFamily-fallback, ${G}`)}`,code:"Source Code Pro,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace",fallback:G},I.fontFamily),T=O({sm:300,md:500,lg:600,xl:700},I.fontWeight),j=O({xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",xl:"1.25rem",xl2:"1.5rem",xl3:"1.875rem",xl4:"2.25rem"},I.fontSize),Y=O({xs:"1.33334",sm:"1.42858",md:"1.5",lg:"1.55556",xl:"1.66667"},I.lineHeight),z=(t=(n=I.colorSchemes)==null||(n=n.light)==null?void 0:n.shadowRing)!=null?t:_.shadowRing,$=(r=(i=I.colorSchemes)==null||(i=i.light)==null?void 0:i.shadowChannel)!=null?r:_.shadowChannel,B=(o=(a=I.colorSchemes)==null||(a=a.light)==null?void 0:a.shadowOpacity)!=null?o:_.shadowOpacity,H={colorSchemes:{light:_,dark:D},fontSize:j,fontFamily:F,fontWeight:T,focus:{thickness:"2px",selector:`&.${it("","focusVisible")}, &:focus-visible`,default:{outlineOffset:`var(--focus-outline-offset, ${x("focus-thickness",(s=(l=I.focus)==null?void 0:l.thickness)!=null?s:"2px")})`,outline:`${x("focus-thickness",(c=(d=I.focus)==null?void 0:d.thickness)!=null?c:"2px")} solid ${x("palette-focusVisible",C.primary[500])}`}},lineHeight:Y,radius:{xs:"2px",sm:"6px",md:"8px",lg:"12px",xl:"16px"},shadow:{xs:`${x("shadowRing",z)}, 0px 1px 2px 0px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)})`,sm:`${x("shadowRing",z)}, 0px 1px 2px 0px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)}), 0px 2px 4px 0px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)})`,md:`${x("shadowRing",z)}, 0px 2px 8px -2px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)}), 0px 6px 12px -2px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)})`,lg:`${x("shadowRing",z)}, 0px 2px 8px -2px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)}), 0px 12px 16px -4px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)})`,xl:`${x("shadowRing",z)}, 0px 2px 8px -2px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)}), 0px 20px 24px -4px rgba(${x("shadowChannel",$)} / ${x("shadowOpacity",B)})`},zIndex:{badge:1,table:10,popup:1e3,modal:1300,snackbar:1400,tooltip:1500},typography:{h1:{fontFamily:x(`fontFamily-display, ${F.display}`),fontWeight:x(`fontWeight-xl, ${T.xl}`),fontSize:x(`fontSize-xl4, ${j.xl4}`),lineHeight:x(`lineHeight-xs, ${Y.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${_.palette.text.primary}`)},h2:{fontFamily:x(`fontFamily-display, ${F.display}`),fontWeight:x(`fontWeight-xl, ${T.xl}`),fontSize:x(`fontSize-xl3, ${j.xl3}`),lineHeight:x(`lineHeight-xs, ${Y.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${_.palette.text.primary}`)},h3:{fontFamily:x(`fontFamily-display, ${F.display}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-xl2, ${j.xl2}`),lineHeight:x(`lineHeight-xs, ${Y.xs}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${_.palette.text.primary}`)},h4:{fontFamily:x(`fontFamily-display, ${F.display}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-xl, ${j.xl}`),lineHeight:x(`lineHeight-md, ${Y.md}`),letterSpacing:"-0.025em",color:x(`palette-text-primary, ${_.palette.text.primary}`)},"title-lg":{fontFamily:x(`fontFamily-body, ${F.body}`),fontWeight:x(`fontWeight-lg, ${T.lg}`),fontSize:x(`fontSize-lg, ${j.lg}`),lineHeight:x(`lineHeight-xs, ${Y.xs}`),color:x(`palette-text-primary, ${_.palette.text.primary}`)},"title-md":{fontFamily:x(`fontFamily-body, ${F.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-md, ${j.md}`),lineHeight:x(`lineHeight-md, ${Y.md}`),color:x(`palette-text-primary, ${_.palette.text.primary}`)},"title-sm":{fontFamily:x(`fontFamily-body, ${F.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-sm, ${j.sm}`),lineHeight:x(`lineHeight-sm, ${Y.sm}`),color:x(`palette-text-primary, ${_.palette.text.primary}`)},"body-lg":{fontFamily:x(`fontFamily-body, ${F.body}`),fontSize:x(`fontSize-lg, ${j.lg}`),lineHeight:x(`lineHeight-md, ${Y.md}`),color:x(`palette-text-secondary, ${_.palette.text.secondary}`)},"body-md":{fontFamily:x(`fontFamily-body, ${F.body}`),fontSize:x(`fontSize-md, ${j.md}`),lineHeight:x(`lineHeight-md, ${Y.md}`),color:x(`palette-text-secondary, ${_.palette.text.secondary}`)},"body-sm":{fontFamily:x(`fontFamily-body, ${F.body}`),fontSize:x(`fontSize-sm, ${j.sm}`),lineHeight:x(`lineHeight-md, ${Y.md}`),color:x(`palette-text-tertiary, ${_.palette.text.tertiary}`)},"body-xs":{fontFamily:x(`fontFamily-body, ${F.body}`),fontWeight:x(`fontWeight-md, ${T.md}`),fontSize:x(`fontSize-xs, ${j.xs}`),lineHeight:x(`lineHeight-md, ${Y.md}`),color:x(`palette-text-tertiary, ${_.palette.text.tertiary}`)}}},q=I?Bn(H,I):H,{colorSchemes:ee}=q,R=Te(q,C1),M=O({colorSchemes:ee},R,{breakpoints:Th(p!=null?p:{}),components:Bn({MuiSvgIcon:{defaultProps:{fontSize:"xl2"},styleOverrides:{root:({ownerState:X,theme:le})=>{var re;const ge=X.instanceFontSize;return O({margin:"var(--Icon-margin)"},X.fontSize&&X.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${le.vars.fontSize[X.fontSize]})`},!X.htmlColor&&O({color:`var(--Icon-color, ${M.vars.palette.text.icon})`},X.color&&X.color!=="inherit"&&le.vars.palette[X.color]&&{color:`rgba(${(re=le.vars.palette[X.color])==null?void 0:re.mainChannel} / 1)`}),ge&&ge!=="inherit"&&{"--Icon-fontSize":le.vars.fontSize[ge]})}}}},g),cssVarPrefix:h,getCssVar:x,spacing:Dh(m)});function U(X,le){Object.keys(le).forEach(re=>{const ge={main:"500",light:"200",dark:"700"};X==="dark"&&(ge.main=400),!le[re].mainChannel&&le[re][ge.main]&&(le[re].mainChannel=mr(le[re][ge.main])),!le[re].lightChannel&&le[re][ge.light]&&(le[re].lightChannel=mr(le[re][ge.light])),!le[re].darkChannel&&le[re][ge.dark]&&(le[re].darkChannel=mr(le[re][ge.dark]))})}Object.entries(M.colorSchemes).forEach(([X,le])=>{U(X,le.palette)});const V={prefix:h,shouldSkipGeneratingVar:S},{vars:ne,generateCssVars:se}=m1(O({colorSchemes:ee},R),V);M.vars=ne,M.generateCssVars=se,M.unstable_sxConfig=O({},v1,void 0),M.unstable_sx=function(le){return Aa({sx:le,theme:this})},M.getColorSchemeSelector=X=>X==="light"?"&":`&[data-joy-color-scheme="${X}"], [data-joy-color-scheme="${X}"] &`;const ae={getCssVar:x,palette:M.colorSchemes.light.palette};return M.variants=Bn({plain:Et("plain",ae),plainHover:Et("plainHover",ae),plainActive:Et("plainActive",ae),plainDisabled:Et("plainDisabled",ae),outlined:Et("outlined",ae),outlinedHover:Et("outlinedHover",ae),outlinedActive:Et("outlinedActive",ae),outlinedDisabled:Et("outlinedDisabled",ae),soft:Et("soft",ae),softHover:Et("softHover",ae),softActive:Et("softActive",ae),softDisabled:Et("softDisabled",ae),solid:Et("solid",ae),solidHover:Et("solidHover",ae),solidActive:Et("solidActive",ae),solidDisabled:Et("solidDisabled",ae)},v),M.palette=O({},M.colorSchemes.light.palette,{colorScheme:"light"}),M.shouldSkipGeneratingVar=S,M.applyStyles=Oh,M}const Nh=I1(),ye=l1({defaultTheme:Nh,themeId:Ah});function ft({props:e,name:t}){return u1({props:e,name:t,defaultTheme:O({},Nh,{components:{}}),themeId:Ah})}function S1(e){return it("MuiAccordion",e)}const A1=Xe("MuiAccordion",["root","expanded","disabled"]),T1=["className","elementType","ownerState","externalForwardedProps","getSlotOwnerState","internalForwardedProps"],E1=["component","slots","slotProps"],k1=["component"];function Se(e,t){const{className:n,elementType:r,ownerState:i,externalForwardedProps:o,getSlotOwnerState:a,internalForwardedProps:s}=t,l=Te(t,T1),{component:c,slots:d={[e]:void 0},slotProps:f={[e]:void 0}}=o,h=Te(o,E1),p=d[e]||r,m=FI(f[e],i),g=UI(O({className:n},l,{externalForwardedProps:e==="root"?h:void 0,externalSlotProps:m})),{props:{component:v},internalRef:S}=g,I=Te(g.props,k1),x=sn(S,m==null?void 0:m.ref,t.ref),C=a?a(I):{},y=O({},i,C),A=e==="root"?v||c:v,E=NI(p,O({},e==="root"&&!c&&!d[e]&&s,e!=="root"&&!d[e]&&s,I,A&&{as:A},{ref:x}),y);return Object.keys(C).forEach(_=>{delete E[_]}),[p,E]}const ic=W.createContext({});function _1(e){return it("MuiListItem",e)}const Fh=Xe("MuiListItem",["root","startAction","endAction","nested","nesting","sticky","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantSoft","variantOutlined","variantSolid"]),ka=W.createContext(!1),oc=W.createContext(!1),zh=W.createContext(!1),jh=W.createContext(void 0),P1=W.createContext(void 0),Uh=W.createContext(void 0),D1=["component","className","children","nested","sticky","variant","color","startAction","endAction","role","slots","slotProps"],O1=e=>{const{sticky:t,nested:n,nesting:r,variant:i,color:o}=e,a={root:["root",n&&"nested",r&&"nesting",t&&"sticky",o&&`color${xe(o)}`,i&&`variant${xe(i)}`],startAction:["startAction"],endAction:["endAction"]};return dt(a,_1,{})},ac=ye("li")(({theme:e,ownerState:t})=>{var n;return[!t.nested&&{"--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItemButton-marginBlock":"calc(-1 * var(--ListItem-paddingY))",alignItems:"center",gap:"var(--ListItem-gap)",marginInline:"var(--ListItem-marginInline)"},t.nested&&{"--NestedList-marginRight":"calc(-1 * var(--ListItem-paddingRight))","--NestedList-marginLeft":"calc(-1 * var(--ListItem-paddingLeft))","--NestedListItem-paddingLeft":"calc(var(--ListItem-paddingLeft) + var(--List-nestedInsetStart))","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))","--ListItem-marginInline":"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",flexDirection:"column"},O({"--unstable_actionRadius":"calc(var(--ListItem-radius) - var(--variant-borderWidth, 0px))"},t.startAction&&{"--unstable_startActionWidth":"2rem"},t.endAction&&{"--unstable_endActionWidth":"2.5rem"},{boxSizing:"border-box",borderRadius:"var(--ListItem-radius)",display:"var(--_ListItem-display)","&:not([hidden])":{"--_ListItem-display":"var(--_List-markerDisplay, flex)"},flex:"none",listStyleType:"var(--_List-markerType, disc)",position:"relative",paddingBlockStart:t.nested?0:"var(--ListItem-paddingY)",paddingBlockEnd:t.nested?0:"var(--ListItem-paddingY)",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)"},t["data-first-child"]===void 0&&O({},t.row?{marginInlineStart:"var(--List-gap)"}:{marginBlockStart:"var(--List-gap)"}),t.row&&t.wrap&&{marginInlineStart:"var(--List-gap)",marginBlockStart:"var(--List-gap)"},{minBlockSize:"var(--ListItem-minHeight)"},t.sticky&&{position:"sticky",top:"var(--ListItem-stickyTop, 0px)",zIndex:1,background:`var(--ListItem-stickyBackground, ${e.vars.palette.background.body})`},{[`.${Fh.nested} > &`]:{"--_ListItem-display":"flex"}}),(n=e.variants[t.variant])==null?void 0:n[t.color]]}),R1=ye(ac,{name:"JoyListItem",slot:"Root",overridesResolver:(e,t)=>t.root})({}),L1=ye("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(({ownerState:e})=>({display:"inherit",position:"absolute",top:e.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",left:0,transform:"translate(var(--ListItem-startActionTranslateX), -50%)",zIndex:1})),M1=ye("div",{name:"JoyListItem",slot:"StartAction",overridesResolver:(e,t)=>t.startAction})(({ownerState:e})=>({display:"inherit",position:"absolute",top:e.nested?"calc(var(--ListItem-minHeight) / 2)":"50%",right:0,transform:"translate(var(--ListItem-endActionTranslateX), -50%)"})),Vh=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyListItem"}),i=W.useContext(Uh),o=W.useContext(jh),a=W.useContext(oc),s=W.useContext(zh),l=W.useContext(ka),{component:c,className:d,children:f,nested:h=!1,sticky:p=!1,variant:m="plain",color:g="neutral",startAction:v,endAction:S,role:I,slots:x={},slotProps:C={}}=r,y=Te(r,D1),[A,E]=W.useState(""),[_,D]=(o==null?void 0:o.split(":"))||["",""],G=c||(_&&!_.match(/^(ul|ol|menu)$/)?"div":void 0);let F=i==="menu"?"none":void 0;o&&(F={menu:"none",menubar:"none",group:"presentation"}[D]),I&&(F=I);const T=O({},r,{sticky:p,startAction:v,endAction:S,row:a,wrap:s,variant:m,color:g,nesting:l,nested:h,component:G,role:F}),j=O1(T),Y=O({},y,{component:G,slots:x,slotProps:C}),[z,$]=Se("root",{additionalProps:{role:F},ref:n,className:Mn(j.root,d),elementType:R1,externalForwardedProps:Y,ownerState:T}),[B,H]=Se("startAction",{className:j.startAction,elementType:L1,externalForwardedProps:Y,ownerState:T}),[q,ee]=Se("endAction",{className:j.endAction,elementType:M1,externalForwardedProps:Y,ownerState:T});return u.jsx(P1.Provider,{value:E,children:u.jsx(ka.Provider,{value:h?A||!0:!1,children:u.jsxs(z,O({},$,{children:[v&&u.jsx(B,O({},H,{children:v})),W.Children.map(f,(R,M)=>{var U;return W.isValidElement(R)?W.cloneElement(R,O({},M===0&&{"data-first-child":""},th(R,["ListItem"])&&{component:((U=R.props)==null?void 0:U.component)||"div"})):R}),S&&u.jsx(q,O({},ee,{children:S}))]}))})})});Vh.muiName="ListItem";const Hh=Vh;function B1(e){return it("MuiAccordionDetails",e)}const br=Xe("MuiAccordionDetails",["root","content","expanded"]),$1=["accordionId","component","color","children","defaultExpanded","disabled","expanded","onChange","variant","slots","slotProps"],N1=e=>{const{variant:t,color:n,expanded:r,disabled:i}=e,o={root:["root",r&&"expanded",i&&"disabled",n&&`color${xe(n)}`,t&&`variant${xe(t)}`]};return dt(o,S1,{})},F1=ye(ac,{name:"JoyAccordion",slot:"Root",overridesResolver:(e,t)=>t.root})({borderBottom:"var(--Accordion-borderBottom)","&[data-first-child]":{"--ListItem-radius":"var(--unstable_List-childRadius) var(--unstable_List-childRadius) 0 0"},"&[data-last-child]":{"--ListItem-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)",'& [aria-expanded="true"]':{"--ListItem-radius":"0"},[`& .${br.root}`]:{"--AccordionDetails-radius":"0 0 var(--unstable_List-childRadius) var(--unstable_List-childRadius)"}},"&:not([data-first-child]):not([data-last-child])":{"--ListItem-radius":"0"}}),z1=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyAccordion"}),{accordionId:i,component:o="div",color:a="neutral",children:s,defaultExpanded:l=!1,disabled:c=!1,expanded:d,onChange:f,variant:h="plain",slots:p={},slotProps:m={}}=r,g=Te(r,$1),v=Hi(i),[S,I]=Nl({controlled:d,default:l,name:"Accordion",state:"expanded"}),x=W.useCallback(G=>{I(!S),f&&f(G,!S)},[S,f,I]),C=W.useMemo(()=>({accordionId:v,expanded:S,disabled:c,toggle:x}),[v,S,c,x]),y=O({},g,{component:o,slots:p,slotProps:m}),A=O({},r,{component:o,color:a,variant:h,expanded:S,disabled:c,nested:!0}),E=N1(A),[_,D]=Se("root",{ref:n,className:E.root,elementType:F1,externalForwardedProps:y,ownerState:A});return u.jsx(ic.Provider,{value:C,children:u.jsx(_,O({},D,{children:W.Children.map(s,(G,F)=>W.isValidElement(G)&&F===0?W.cloneElement(G,{"data-first-child":""}):G)}))})});function j1(e){return it("MuiAccordionGroup",e)}Xe("MuiAccordionGroup",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const U1={"--NestedList-marginRight":"0px","--NestedList-marginLeft":"0px","--NestedListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px"};function sc(e){const{children:t,nested:n,row:r=!1,wrap:i=!1}=e,o=u.jsx(oc.Provider,{value:r,children:u.jsx(zh.Provider,{value:i,children:W.Children.map(t,(a,s)=>W.isValidElement(a)?W.cloneElement(a,O({},s===0&&{"data-first-child":""},s===W.Children.count(t)-1&&{"data-last-child":""})):a)})});return n===void 0?o:u.jsx(ka.Provider,{value:n,children:o})}const lc=({theme:e,ownerState:t},n)=>{let r={};function i(o){if(typeof o=="function"){const a=o(e);i(a)}else Array.isArray(o)?o.forEach(a=>{typeof a!="boolean"&&i(a)}):typeof o=="object"&&(r=O({},r,o))}return t.sx&&(i(t.sx),n.forEach(o=>{const a=r[o];if(typeof a=="string"||typeof a=="number")if(o==="borderRadius")if(typeof a=="number")r[o]=`${a}px`;else{var s;r[o]=((s=e.vars)==null?void 0:s.radius[a])||a}else["p","padding","m","margin"].indexOf(o)!==-1&&typeof a=="number"?r[o]=e.spacing(a):r[o]=a;else typeof a=="function"?r[o]=a(e):r[o]=void 0})),r};function V1(e){return it("MuiList",e)}Xe("MuiList",["root","nesting","scoped","sizeSm","sizeMd","sizeLg","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","horizontal","vertical"]);const H1=W.createContext(void 0),W1=["component","className","children","size","orientation","wrap","variant","color","role","slots","slotProps"],G1=e=>{const{variant:t,color:n,size:r,nesting:i,orientation:o,instanceSize:a}=e,s={root:["root",o,t&&`variant${xe(t)}`,n&&`color${xe(n)}`,!a&&!i&&r&&`size${xe(r)}`,a&&`size${xe(a)}`,i&&"nesting"]};return dt(s,V1,{})},cc=ye("ul")(({theme:e,ownerState:t})=>{var n;const{p:r,padding:i,borderRadius:o}=lc({theme:e,ownerState:t},["p","padding","borderRadius"]);function a(s){return s==="sm"?{"--ListDivider-gap":"0.25rem","--ListItem-minHeight":"2rem","--ListItem-paddingY":"3px","--ListItem-paddingX":t.marker?"3px":"0.5rem","--ListItem-gap":"0.5rem","--ListItemDecorator-size":t.orientation==="horizontal"?"1.5rem":"2rem","--Icon-fontSize":e.vars.fontSize.lg}:s==="md"?{"--ListDivider-gap":"0.375rem","--ListItem-minHeight":"2.25rem","--ListItem-paddingY":"0.25rem","--ListItem-paddingX":t.marker?"0.25rem":"0.75rem","--ListItem-gap":"0.625rem","--ListItemDecorator-size":t.orientation==="horizontal"?"1.75rem":"2.5rem","--Icon-fontSize":e.vars.fontSize.xl}:s==="lg"?{"--ListDivider-gap":"0.5rem","--ListItem-minHeight":"2.75rem","--ListItem-paddingY":"0.375rem","--ListItem-paddingX":t.marker?"0.5rem":"1rem","--ListItem-gap":"0.75rem","--ListItemDecorator-size":t.orientation==="horizontal"?"2.25rem":"3rem","--Icon-fontSize":e.vars.fontSize.xl2}:{}}return[t.nesting&&O({},a(t.instanceSize),{"--ListItem-paddingRight":"var(--ListItem-paddingX)","--ListItem-paddingLeft":"var(--NestedListItem-paddingLeft)","--ListItemButton-marginBlock":"0px","--ListItemButton-marginInline":"0px","--ListItem-marginBlock":"0px","--ListItem-marginInline":"0px",padding:0},t.marker&&{paddingInlineStart:"calc(3ch - var(--_List-markerDeduct, 0px))"},{marginInlineStart:"var(--NestedList-marginLeft)",marginInlineEnd:"var(--NestedList-marginRight)",marginBlockStart:"var(--List-gap)",marginBlockEnd:"initial"}),!t.nesting&&O({},a(t.size),{"--List-gap":"0px","--List-nestedInsetStart":"0px","--ListItem-paddingLeft":"var(--ListItem-paddingX)","--ListItem-paddingRight":"var(--ListItem-paddingX)"},t.marker&&{"--_List-markerDeduct":"1ch"},{"--unstable_List-childRadius":"calc(max(var(--List-radius) - var(--List-padding), min(var(--List-padding) / 2, var(--List-radius) / 2)) - var(--variant-borderWidth, 0px))","--ListItem-radius":"var(--unstable_List-childRadius)","--ListItem-startActionTranslateX":"calc(0.5 * var(--ListItem-paddingLeft))","--ListItem-endActionTranslateX":"calc(-0.5 * var(--ListItem-paddingRight))",margin:"initial"},e.typography[`body-${t.size}`],t.orientation==="horizontal"?O({},t.wrap?{padding:"var(--List-padding)",marginInlineStart:"calc(-1 * var(--List-gap))",marginBlockStart:"calc(-1 * var(--List-gap))"}:{paddingInline:"var(--List-padding, var(--ListDivider-gap))",paddingBlock:"var(--List-padding)"}):{paddingBlock:"var(--List-padding, var(--ListDivider-gap))",paddingInline:"var(--List-padding)"},t.marker&&{paddingInlineStart:"3ch"}),O({boxSizing:"border-box",borderRadius:"var(--List-radius)",listStyle:"none",display:"flex",flexDirection:t.orientation==="horizontal"?"row":"column"},t.wrap&&{flexWrap:"wrap"},t.marker&&{"--_List-markerDisplay":"list-item","--_List-markerType":t.marker,lineHeight:"calc(var(--ListItem-minHeight) - 2 * var(--ListItem-paddingY))"},{flexGrow:1,position:"relative"},(n=e.variants[t.variant])==null?void 0:n[t.color],{"--unstable_List-borderWidth":"var(--variant-borderWidth, 0px)"},o!==void 0&&{"--List-radius":o},r!==void 0&&{"--List-padding":r},i!==void 0&&{"--List-padding":i})]}),Y1=ye(cc,{name:"JoyList",slot:"Root",overridesResolver:(e,t)=>t.root})({}),K1=W.forwardRef(function(t,n){var r;const i=W.useContext(ka),o=W.useContext(Uh),a=W.useContext(H1),s=ft({props:t,name:"JoyList"}),{component:l,className:c,children:d,size:f,orientation:h="vertical",wrap:p=!1,variant:m="plain",color:g="neutral",role:v,slots:S={},slotProps:I={}}=s,x=Te(s,W1),C=f||((r=t.size)!=null?r:"md");let y;o&&(y="group"),a&&(y="presentation"),v&&(y=v);const A=O({},s,{instanceSize:t.size,size:C,nesting:i,orientation:h,wrap:p,variant:m,color:g,role:y}),E=G1(A),_=O({},x,{component:l,slots:S,slotProps:I}),[D,G]=Se("root",{ref:n,className:Mn(E.root,c),elementType:Y1,externalForwardedProps:_,ownerState:A,additionalProps:{as:l,role:y,"aria-labelledby":typeof i=="string"?i:void 0}});return u.jsx(D,O({},G,{children:u.jsx(jh.Provider,{value:`${typeof l=="string"?l:""}:${y||""}`,children:u.jsx(sc,{row:h==="horizontal",wrap:p,children:d})})}))}),q1=["component","color","children","disableDivider","variant","transition","size","slots","slotProps"],Q1=e=>{const{variant:t,color:n,size:r}=e,i={root:["root",t&&`variant${xe(t)}`,n&&`color${xe(n)}`,r&&`size${xe(r)}`]};return dt(i,j1,{})},J1=ye(cc,{name:"JoyAccordionGroup",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{let n={};return t.transition&&(typeof t.transition=="string"&&(n={"--AccordionDetails-transition":`grid-template-rows ${t.transition}, padding-block ${t.transition}`}),typeof t.transition=="object"&&(n={"--AccordionDetails-transition":`grid-template-rows ${t.transition.initial}, padding-block ${t.transition.initial}`,[`& .${br.root}.${br.expanded}`]:{"--AccordionDetails-transition":`grid-template-rows ${t.transition.expanded}, padding-block ${t.transition.expanded}`}})),O({"--List-padding":"0px","--ListDivider-gap":"0px"},n,!t.disableDivider&&{[`& .${A1.root}:not([data-last-child])`]:{"--Accordion-borderBottom":`1px solid ${e.vars.palette.divider}`}})}),X1=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyAccordionGroup"}),{component:i="div",color:o="neutral",children:a,disableDivider:s=!1,variant:l="plain",transition:c="0.2s ease",size:d="md",slots:f={},slotProps:h={}}=r,p=Te(r,q1),m=O({},p,{component:i,slots:f,slotProps:h}),g=O({},r,{component:i,color:o,disableDivider:s,variant:l,transition:c,size:d}),v=Q1(g),[S,I]=Se("root",{ref:n,className:v.root,elementType:J1,externalForwardedProps:m,ownerState:g});return u.jsx(S,O({},I,{children:u.jsx(sc,{children:a})}))}),Z1=["component","children","color","variant","slots","slotProps"],eT=e=>{const{expanded:t}=e;return dt({root:["root",t&&"expanded"],content:["content",t&&"expanded"]},B1,{})},tT=ye("div",{name:"JoyAccordionDetails",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n;return O({overflow:"hidden",borderRadius:"var(--AccordionDetails-radius)",display:"grid",gridTemplateRows:"1fr",marginInline:"calc(-1 * var(--ListItem-paddingLeft)) calc(-1 * var(--ListItem-paddingRight))",transition:"var(--AccordionDetails-transition)"},(n=t.variants[e.variant])==null?void 0:n[e.color],{[`&:not(.${br.expanded})`]:{gridTemplateRows:"0fr"}})}),nT=ye("div",{name:"JoyAccordionDetails",slot:"Content",overridesResolver:(e,t)=>t.root})({display:"flex",flexDirection:"column",overflow:"hidden",paddingInlineStart:"var(--ListItem-paddingLeft)",paddingInlineEnd:"var(--ListItem-paddingRight)",paddingBlockStart:"calc(var(--ListItem-paddingY) / 2)",paddingBlockEnd:"calc(2.5 * var(--ListItem-paddingY))",transition:"var(--AccordionDetails-transition)",[`&:not(.${br.expanded})`]:{paddingBlock:0}}),rT=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyAccordionDetails"}),{component:i="div",children:o,color:a="neutral",variant:s="plain",slots:l={},slotProps:c={}}=r,d=Te(r,Z1),{accordionId:f,expanded:h=!1}=W.useContext(ic),p=W.useRef(null),m=sn(p,n);W.useEffect(()=>{p.current&&p.current.querySelectorAll('a, button, input, textarea, select, details, [tabindex]:not([tabindex="-1"])').forEach(E=>{if(h){const _=E.getAttribute("data-prev-tabindex"),D=E.getAttribute("tabindex");D&&_&&(E.setAttribute("tabindex",_),E.removeAttribute("data-prev-tabindex")),!_&&!D&&E.removeAttribute("tabindex")}else E.setAttribute("data-prev-tabindex",E.getAttribute("tabindex")||""),E.setAttribute("tabindex","-1")})},[h]);const g=O({},d,{component:i,slots:l,slotProps:c}),v=O({},r,{component:i,color:a,variant:s,expanded:h,nesting:!0}),S=eT(v),[I,x]=Se("root",{ref:m,className:S.root,elementType:tT,externalForwardedProps:g,additionalProps:{id:`${f}-details`,"aria-labelledby":`${f}-summary`,role:"region",hidden:h?void 0:!0},ownerState:v}),[C,y]=Se("content",{className:S.content,elementType:nT,externalForwardedProps:g,ownerState:v});return u.jsx(I,O({},x,{children:u.jsx(C,O({},y,{children:o}))}))});function iT(e){return it("MuiAccordionSummary",e)}const _a=Xe("MuiAccordionSummary",["root","button","indicator","disabled","expanded"]),Pa=Xe("MuiListItemButton",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","focusVisible","disabled","selected","variantPlain","variantSoft","variantOutlined","variantSolid"]),oT=W.createContext("horizontal"),uc=ye("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,s;return O({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,WebkitTapHighlightColor:"transparent",boxSizing:"border-box",position:"relative",font:"inherit",display:"flex",flexDirection:"row",alignItems:"center",alignSelf:"stretch",gap:"var(--ListItem-gap)"},t.orientation==="vertical"&&{flexDirection:"column",justifyContent:"center"},{textAlign:"initial",textDecoration:"initial",backgroundColor:"initial",cursor:"pointer",marginInline:"var(--ListItemButton-marginInline)",marginBlock:"var(--ListItemButton-marginBlock)"},t["data-first-child"]===void 0&&{marginInlineStart:t.row?"var(--List-gap)":void 0,marginBlockStart:t.row?void 0:"var(--List-gap)"},{paddingBlock:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px))",paddingInlineStart:"calc(var(--ListItem-paddingLeft) + var(--ListItem-startActionWidth, var(--unstable_startActionWidth, 0px)))",paddingInlineEnd:"calc(var(--ListItem-paddingRight) + var(--ListItem-endActionWidth, var(--unstable_endActionWidth, 0px)))",minBlockSize:"var(--ListItem-minHeight)",border:"1px solid transparent",borderRadius:"var(--ListItem-radius)",flex:"var(--unstable_ListItem-flex, none)",fontSize:"inherit",lineHeight:"inherit",minInlineSize:0,[e.focus.selector]:O({},e.focus.default,{zIndex:1})},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:active":(r=e.variants[`${t.variant}Active`])==null?void 0:r[t.color],[`.${Fh.root} > &`]:{"--unstable_ListItem-flex":"1 0 0%"},[`&.${Pa.selected}`]:O({},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],{"--Icon-color":"currentColor"}),[`&:not(.${Pa.selected}, [aria-selected="true"])`]:{"&:hover":(o=e.variants[`${t.variant}Hover`])==null?void 0:o[t.color],"&:active":(a=e.variants[`${t.variant}Active`])==null?void 0:a[t.color]},[`&.${Pa.disabled}`]:O({},(s=e.variants[`${t.variant}Disabled`])==null?void 0:s[t.color])})});ye(uc,{name:"JoyListItemButton",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>O({},!e.row&&{[`&.${Pa.selected}`]:{fontWeight:t.vars.fontWeight.md}}));function aT(e){return it("MuiSvgIcon",e)}Xe("MuiSvgIcon",["root","colorInherit","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","fontSizeInherit","fontSizeXs","fontSizeSm","fontSizeMd","fontSizeLg","fontSizeXl","fontSizeXl2","fontSizeXl3","fontSizeXl4","sizeSm","sizeMd","sizeLg"]);const sT=["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox","size","slots","slotProps"],lT=e=>{const{color:t,size:n,fontSize:r}=e,i={root:["root",t&&t!=="inherit"&&`color${xe(t)}`,n&&`size${xe(n)}`,r&&`fontSize${xe(r)}`]};return dt(i,aT,{})},Wh={sm:"xl",md:"xl2",lg:"xl3"},cT=ye("svg",{name:"JoySvgIcon",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return O({},t.instanceSize&&{"--Icon-fontSize":e.vars.fontSize[Wh[t.instanceSize]]},t.instanceFontSize&&t.instanceFontSize!=="inherit"&&{"--Icon-fontSize":e.vars.fontSize[t.instanceFontSize]},{userSelect:"none",margin:"var(--Icon-margin)",width:"1em",height:"1em",display:"inline-block",fill:t.hasSvgAsChild?void 0:"currentColor",flexShrink:0,fontSize:`var(--Icon-fontSize, ${e.vars.fontSize[Wh[t.size]]||"unset"})`},t.fontSize&&t.fontSize!=="inherit"&&{fontSize:`var(--Icon-fontSize, ${e.fontSize[t.fontSize]})`},!t.htmlColor&&O({color:`var(--Icon-color, ${e.vars.palette.text.icon})`},t.color==="inherit"&&{color:"inherit"},t.color!=="inherit"&&e.vars.palette[t.color]&&{color:`rgba(${(n=e.vars.palette[t.color])==null?void 0:n.mainChannel} / 1)`}))}),Gh=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoySvgIcon"}),{children:i,className:o,color:a,component:s="svg",fontSize:l,htmlColor:c,inheritViewBox:d=!1,titleAccess:f,viewBox:h="0 0 24 24",size:p="md",slots:m={},slotProps:g={}}=r,v=Te(r,sT),S=W.isValidElement(i)&&i.type==="svg",I=O({},r,{color:a,component:s,size:p,instanceSize:t.size,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:h,hasSvgAsChild:S}),x=lT(I),C=O({},v,{component:s,slots:m,slotProps:g}),[y,A]=Se("root",{ref:n,className:Mn(x.root,o),elementType:cT,externalForwardedProps:C,ownerState:I,additionalProps:O({color:c,focusable:!1},f&&{role:"img"},!f&&{"aria-hidden":!0},!d&&{viewBox:h},S&&i.props)});return u.jsxs(y,O({},A,{children:[S?i.props.children:i,f?u.jsx("title",{children:f}):null]}))});function dc(e,t){function n(r,i){return u.jsx(Gh,O({"data-testid":`${t}Icon`,ref:i},r,{children:e}))}return n.muiName=Gh.muiName,W.memo(W.forwardRef(n))}const uT=dc(u.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z"}),"KeyboardArrowDown");var Yh;const dT=["component","color","children","indicator","variant","slots","slotProps"],fT=e=>{const{disabled:t,expanded:n}=e;return dt({root:["root",t&&"disabled",n&&"expanded"],button:["button",t&&"disabled",n&&"expanded"],indicator:["indicator",t&&"disabled",n&&"expanded"]},iT,{})},hT=ye(ac,{name:"JoyAccordionSummary",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({fontWeight:e.vars.fontWeight.md,gap:"calc(var(--ListItem-paddingX, 0.75rem) + 0.25rem)",[`&.${_a.expanded}`]:{"--Icon-color":"currentColor"}})),pT=ye(uc,{name:"JoyAccordionSummary",slot:"Button",overridesResolver:(e,t)=>t.button})({gap:"inherit",fontWeight:"inherit",justifyContent:"space-between",font:"inherit","&:focus-visible":{zIndex:1},[`.${_a.root} &`]:{"--unstable_ListItem-flex":"1 0 0%"}}),gT=ye("span",{name:"JoyAccordionSummary",slot:"Indicator",overridesResolver:(e,t)=>t.indicator})({display:"inline-flex",[`&.${_a.expanded}`]:{transform:"rotate(180deg)"}}),mT=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyAccordionSummary"}),{component:i="div",color:o="neutral",children:a,indicator:s=Yh||(Yh=u.jsx(uT,{})),variant:l="plain",slots:c={},slotProps:d={}}=r,f=Te(r,dT),{accordionId:h,disabled:p=!1,expanded:m=!1,toggle:g}=W.useContext(ic),v=O({},f,{component:i,slots:c,slotProps:d}),S=O({},r,{component:i,color:o,disabled:p,expanded:m,variant:l}),I=G=>{if(g&&g(G),typeof d.button=="function"){var F,T;(F=d.button(S))==null||(T=F.onClick)==null||T.call(F,G)}else{var j,Y;(j=d.button)==null||(Y=j.onClick)==null||Y.call(j,G)}},x=fT(S),[C,y]=Se("root",{ref:n,className:x.root,elementType:hT,externalForwardedProps:v,ownerState:S}),[A,E]=Se("button",{ref:n,className:x.button,elementType:pT,externalForwardedProps:v,additionalProps:{component:"button",id:`${h}-summary`,"aria-expanded":m?"true":"false","aria-controls":`${h}-details`,disabled:p,type:"button",onClick:I},ownerState:S}),[_,D]=Se("indicator",{ref:n,className:x.indicator,elementType:gT,externalForwardedProps:v,ownerState:S});return u.jsx(C,O({},y,{children:u.jsxs(A,O({},E,{children:[a,s&&u.jsx(_,O({},D,{children:s}))]}))}))}),vT=({label:e,disabled:t,children:n})=>(t=t||!1,u.jsx(X1,{variant:"outlined",transition:"0.2s",sx:{borderRadius:"md",overflow:"hidden",[`& .${_a.button}:hover`]:{backgroundColor:"#fff"},[`& .${br.content}`]:{boxShadow:r=>`inset 0 1px ${r.vars.palette.divider}`,[`&.${br.expanded}`]:{paddingBlock:"0.75rem"}},marginBottom:"8px",backgroundColor:"#fff"},children:u.jsxs(z1,{disabled:t,children:[u.jsx(mT,{children:e}),u.jsx(rT,{variant:"soft",children:n})]})})),fc={toolbar:[[{header:[1,2,3,4,5,6,!1]}],["bold","italic","underline","strike","blockquote"],[{list:"ordered"},{list:"bullet"},{indent:"-1"},{indent:"+1"},{align:[]}],["blockquote","code-block"],[{direction:"rtl"}],[{script:"sub"},{script:"super"}],[{color:[]},{background:[]}],[{font:[]}],["link","image","video"],["clean"]]},hc=({label:e,property:t,value:n,defaultValue:r,placeholder:i,description:o,onChange:a})=>{const s=(l,c,d,f)=>{d!=="api"&&(f.getText().trim()===""?a(""):a(l))};return t==="description"?u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:e}),u.jsx(yi,{value:n||r,defaultValue:r,onChange:s,modules:fc,placeholder:i,className:"ql-container ql-toolbar"})]}):t==="mini_games_explanation"?u.jsxs(b.FormControl,{children:[u.jsx(b.FormLabel,{color:"primary",children:e}),u.jsx(yi,{value:n||r,defaultValue:r,onChange:s,modules:fc,placeholder:i,className:"ql-container ql-toolbar"}),u.jsx(b.FormHelperText,{children:o})]}):u.jsx(b.Box,{sx:()=>({marginBottom:"16px"}),children:u.jsx(yi,{value:n||r,defaultValue:r,onChange:s,modules:fc,placeholder:i})})},bT=e=>{const t=n=>{n.persist(),e.onChange(n.target.value)};return u.jsxs(b.Tabs,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[u.jsxs(b.TabList,{sx:{borderRadius:0},tabFlex:"auto",children:[u.jsx(b.Tab,{children:e.labels.richText}),u.jsx(b.Tab,{children:e.labels.plainText})]}),u.jsx(b.TabPanel,{value:0,sx:{px:0},children:u.jsx(hc,{label:"",placeholder:"",defaultValue:e.defaultValue,property:"ad_content",onChange:e.onChange})}),u.jsx(b.TabPanel,{value:1,sx:{px:0},children:u.jsx(b.Textarea,{defaultValue:e.defaultValue,minRows:"7",onChange:t,sx:{marginBottom:"16px",overflow:"auto",resize:"vertical"}})})]})},yT=({label:e,defaultValue:t,values:n,description:r,onChange:i})=>{const o=(a,s)=>{i(s||"")};return u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:e}),u.jsx(b.Select,{defaultValue:t,onChange:o,children:n.map((a,s)=>u.jsx(b.Option,{value:a,children:a},`basic-select-${a}-${s}`))}),r?u.jsx(b.FormHelperText,{children:r}):u.jsx(u.Fragment,{})]})},pc=W.createContext("md");function xT(e){return it("MuiTabs",e)}Xe("MuiTabs",["root","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);const CT=["children","value","defaultValue","orientation","direction","component","onChange","selectionFollowsFocus","variant","color","size","slots","slotProps"],wT=e=>{const{orientation:t,variant:n,color:r,size:i}=e,o={root:["root",t,n&&`variant${xe(n)}`,r&&`color${xe(r)}`,i&&`size${xe(i)}`]};return dt(o,xT,{})},IT=ye("div",{name:"JoyTabs",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r;const i=(n=t.variants[e.variant])==null?void 0:n[e.color],{bgcolor:o,backgroundColor:a,background:s,p:l,padding:c}=lc({theme:t,ownerState:e},["bgcolor","backgroundColor","background","p","padding"]),d=er(t,`palette.${o}`)||o||er(t,`palette.${a}`)||a||s||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||t.vars.palette.background.surface;return O({},e.size==="sm"&&{"--Tabs-spacing":"0.75rem"},e.size==="md"&&{"--Tabs-spacing":"1rem"},e.size==="lg"&&{"--Tabs-spacing":"1.25rem"},{"--Tab-indicatorThickness":"2px","--Icon-color":e.color!=="neutral"||e.variant==="solid"?"currentColor":t.vars.palette.text.icon,"--TabList-stickyBackground":d==="transparent"?"initial":d,display:"flex",flexDirection:"column"},e.orientation==="vertical"&&{flexDirection:"row"},{backgroundColor:t.vars.palette.background.surface,position:"relative"},t.typography[`body-${e.size}`],(r=t.variants[e.variant])==null?void 0:r[e.color],l!==void 0&&{"--Tabs-padding":l},c!==void 0&&{"--Tabs-padding":c})}),Kh=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyTabs"}),{children:i,value:o,defaultValue:a,orientation:s="horizontal",direction:l="ltr",component:c,variant:d="plain",color:f="neutral",size:h="md",slots:p={},slotProps:m={}}=r,g=Te(r,CT),v=a||(o===void 0?0:void 0),{contextValue:S}=HS(O({},r,{orientation:s,defaultValue:v})),I=O({},r,{orientation:s,direction:l,variant:d,color:f,size:h}),x=wT(I),C=O({},g,{component:c,slots:p,slotProps:m}),[y,A]=Se("root",{ref:n,elementType:IT,externalForwardedProps:C,additionalProps:{ref:n,as:c},ownerState:I,className:x.root});return u.jsx(y,O({},A,{children:u.jsx(WS,{value:S,children:u.jsx(pc.Provider,{value:h,children:i})})}))});function ST(e){return it("MuiTabList",e)}Xe("MuiTabList",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","sizeSm","sizeMd","sizeLg"]);function AT(e){return it("MuiTab",e)}const gc=Xe("MuiTab",["root","disabled","focusVisible","selected","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]),TT=["component","children","variant","color","size","disableUnderline","underlinePlacement","tabFlex","sticky","slots","slotProps"],ET=e=>{const{orientation:t,size:n,variant:r,color:i}=e,o={root:["root",t,r&&`variant${xe(r)}`,i&&`color${xe(i)}`,n&&`size${xe(n)}`]};return dt(o,ST,{})},kT=ye(cc,{name:"JoyTabList",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;const r=(n=e.variants[t.variant])==null?void 0:n[t.color];return O({"--List-gap":"0px","--ListDivider-gap":"0px","--ListItem-paddingX":"var(--Tabs-spacing)","--ListItem-gap":"0.375rem","--unstable_TabList-hasUnderline":t.disableUnderline?"var(--unknown,)":"initial"},U1,{flexGrow:"initial",flexDirection:t.orientation==="vertical"?"column":"row",borderRadius:"var(--List-radius, 0px)",padding:"var(--List-padding, 0px)",zIndex:1},t.sticky&&{position:"sticky",top:t.sticky==="top"?"calc(-1 * var(--Tabs-padding, 0px))":"initial",bottom:t.sticky==="bottom"?"calc(-1 * var(--Tabs-padding, 0px))":"initial",backgroundColor:(r==null?void 0:r.backgroundColor)||`var(--TabList-stickyBackground, ${e.vars.palette.background.body})`},!t.disableUnderline&&O({},t.underlinePlacement==="bottom"&&{"--unstable_TabList-underlineBottom":"1px",paddingBottom:1,boxShadow:`inset 0 -1px ${e.vars.palette.divider}`},t.underlinePlacement==="top"&&{"--unstable_TabList-underlineTop":"1px",paddingTop:1,boxShadow:`inset 0 1px ${e.vars.palette.divider}`},t.underlinePlacement==="right"&&{"--unstable_TabList-underlineRight":"1px",paddingRight:1,boxShadow:`inset -1px 0 ${e.vars.palette.divider}`},t.underlinePlacement==="left"&&{"--unstable_TabList-underlineLeft":"1px",paddingLeft:1,boxShadow:`inset 1px 0 ${e.vars.palette.divider}`}),t.tabFlex&&{[`& .${gc.root}`]:{flex:t.tabFlex}})}),qh=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyTabList"}),i=W.useContext(pc),{isRtl:o,orientation:a,getRootProps:s,contextValue:l}=qS({rootRef:n}),{component:c="div",children:d,variant:f="plain",color:h="neutral",size:p,disableUnderline:m=!1,underlinePlacement:g=a==="horizontal"?"bottom":"right",tabFlex:v,sticky:S,slots:I={},slotProps:x={}}=r,C=Te(r,TT),y=p!=null?p:i,A=O({},r,{isRtl:o,orientation:a,variant:f,color:h,size:y,sticky:S,tabFlex:v,nesting:!1,disableUnderline:m,underlinePlacement:g}),E=ET(A),_=O({},C,{component:c,slots:I,slotProps:x}),[D,G]=Se("root",{ref:n,elementType:kT,getSlotProps:s,externalForwardedProps:_,ownerState:A,className:E.root});return u.jsx(D,O({},G,{children:u.jsx(QS,{value:l,children:u.jsx(sc,{row:a==="horizontal",nested:!0,children:d})})}))}),_T=["action","children","value","disabled","onChange","onClick","onFocus","component","orientation","variant","color","disableIndicator","indicatorPlacement","indicatorInset","slots","slotProps"],PT=e=>{const{selected:t,disabled:n,focusVisible:r,variant:i,color:o,orientation:a}=e,s={root:["root",a,n&&"disabled",r&&"focusVisible",t&&"selected",i&&`variant${xe(i)}`,o&&`color${xe(o)}`]};return dt(s,AT,{})},DT=ye(uc,{name:"JoyTab",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e})=>[{flex:"initial",justifyContent:e.row?"center":"initial","--unstable_ListItemDecorator-alignItems":"center","--unstable_offset":"min(calc(-1 * var(--variant-borderWidth, 0px)), -1px)"},!e.disableIndicator&&{'&[aria-selected="true"]':{"--Tab-indicatorColor":"currentColor",zIndex:1},"&::after":{content:'""',display:"block",position:"absolute",margin:"auto",background:"var(--Tab-indicatorColor)",borderRadius:"var(--Tab-indicatorRadius)"}},!e.disableIndicator&&e.indicatorPlacement==="bottom"&&{paddingBottom:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:e.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:e.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",bottom:"calc(-1px - var(--unstable_TabList-underlineBottom, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="top"&&{paddingTop:"calc(var(--ListItem-paddingY) - var(--variant-borderWidth, 0px) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorThickness)",width:"var(--Tab-indicatorSize)",left:e.indicatorInset?"var(--ListItem-paddingLeft)":"var(--unstable_offset)",right:e.indicatorInset?"var(--ListItem-paddingRight)":"var(--unstable_offset)",top:"calc(-1px - var(--unstable_TabList-underlineTop, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="right"&&{paddingRight:"calc(var(--ListItem-paddingRight) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",right:"calc(-1px - var(--unstable_TabList-underlineRight, 0px))"}},!e.disableIndicator&&e.indicatorPlacement==="left"&&{paddingLeft:"calc(var(--ListItem-paddingLeft) + var(--Tab-indicatorThickness) - 1px)","&::after":{height:"var(--Tab-indicatorSize)",width:"var(--Tab-indicatorThickness)",top:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",bottom:e.indicatorInset?"var(--ListItem-paddingY)":"var(--unstable_offset)",left:"calc(-1px - var(--unstable_TabList-underlineLeft, 0px))"}}]),Vr=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyTab"}),i=W.useContext(oc),{action:o,children:a,disabled:s=!1,component:l="button",orientation:c="horizontal",variant:d="plain",color:f="neutral",disableIndicator:h=!1,indicatorPlacement:p=i?"bottom":"right",indicatorInset:m=!1,slots:g={},slotProps:v={}}=r,S=Te(r,_T),I=W.useRef(null),x=sn(I,n),{active:C,focusVisible:y,setFocusVisible:A,selected:E,getRootProps:_}=XS(O({},r,{rootRef:x}));W.useImperativeHandle(o,()=>({focusVisible:()=>{A(!0),I.current.focus()}}),[A]);const D=O({},r,{disableIndicator:h,indicatorPlacement:p,indicatorInset:m,orientation:c,row:i,active:C,focusVisible:y,disabled:s,selected:E,variant:d,color:f}),G=PT(D),F=O({},S,{component:l,slots:g,slotProps:v}),[T,j]=Se("root",{ref:n,elementType:DT,getSlotProps:_,externalForwardedProps:F,ownerState:D,className:G.root});return u.jsx(oT.Provider,{value:c,children:u.jsx(T,O({},j,{children:a}))})});function Fn(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function Qh(e){if(W.isValidElement(e)||eh.isValidElementType(e)||!Fn(e))return e;const t={};return Object.keys(e).forEach(n=>{t[n]=Qh(e[n])}),t}function Wt(e,t,n={clone:!0}){const r=n.clone?N({},e):e;return Fn(e)&&Fn(t)&&Object.keys(t).forEach(i=>{W.isValidElement(t[i])||eh.isValidElementType(t[i])?r[i]=t[i]:Fn(t[i])&&Object.prototype.hasOwnProperty.call(e,i)&&Fn(e[i])?r[i]=Wt(e[i],t[i],n):n.clone?r[i]=Fn(t[i])?Qh(t[i]):t[i]:r[i]=t[i]}),r}function yr(e,...t){const n=new URL(`https://mui.com/production-error/?code=${e}`);return t.forEach(r=>n.searchParams.append("args[]",r)),`Minified MUI error #${e}; visit ${n} for the full message.`}function Hr(e){if(typeof e!="string")throw new Error(yr(7));return e.charAt(0).toUpperCase()+e.slice(1)}function mc(e,t){const n=N({},t);for(const r in e)if(Object.prototype.hasOwnProperty.call(e,r)){const i=r;if(i==="components"||i==="slots")n[i]=N(N({},e[i]),n[i]);else if(i==="componentsProps"||i==="slotProps"){const o=e[i],a=t[i];if(!a)n[i]=o||{};else if(!o)n[i]=a;else{n[i]=N({},a);for(const s in o)if(Object.prototype.hasOwnProperty.call(o,s)){const l=s;n[i][l]=mc(o[l],a[l])}}}else n[i]===void 0&&(n[i]=e[i])}return n}function OT(e,t,n=void 0){const r={};for(const i in e){const o=e[i];let a="",s=!0;for(let l=0;l<o.length;l+=1){const c=o[l];c&&(a+=(s===!0?"":" ")+t(c),s=!1,n&&n[c]&&(a+=" "+n[c]))}r[i]=a}return r}const Jh=e=>e,RT=(()=>{let e=Jh;return{configure(t){e=t},generate(t){return e(t)},reset(){e=Jh}}})(),LT={active:"active",checked:"checked",completed:"completed",disabled:"disabled",error:"error",expanded:"expanded",focused:"focused",focusVisible:"focusVisible",open:"open",readOnly:"readOnly",required:"required",selected:"selected"};function Xh(e,t,n="Mui"){const r=LT[t];return r?`${n}-${r}`:`${RT.generate(e)}-${t}`}function MT(e,t,n="Mui"){const r={};return t.forEach(i=>{r[i]=Xh(e,i,n)}),r}function BT(e,t=Number.MIN_SAFE_INTEGER,n=Number.MAX_SAFE_INTEGER){return Math.max(t,Math.min(e,n))}function qi(e,t){return t?Wt(e,t,{clone:!1}):e}function $T(e,t){if(!e.containerQueries)return t;const n=Object.keys(t).filter(r=>r.startsWith("@container")).sort((r,i)=>{var a,s;const o=/min-width:\s*([0-9.]+)/;return+(((a=r.match(o))==null?void 0:a[1])||0)-+(((s=i.match(o))==null?void 0:s[1])||0)});return n.length?n.reduce((r,i)=>{const o=t[i];return delete r[i],r[i]=o,r},N({},t)):t}function NT(e,t){return t==="@"||t.startsWith("@")&&(e.some(n=>t.startsWith(`@${n}`))||!!t.match(/^@\d/))}function FT(e,t){const n=t.match(/^@([^/]+)?\/?(.+)?$/);if(!n)return null;const[,r,i]=n,o=Number.isNaN(+r)?r||0:+r;return e.containerQueries(i).up(o)}function zT(e){const t=(o,a)=>o.replace("@media",a?`@container ${a}`:"@container");function n(o,a){o.up=(...s)=>t(e.breakpoints.up(...s),a),o.down=(...s)=>t(e.breakpoints.down(...s),a),o.between=(...s)=>t(e.breakpoints.between(...s),a),o.only=(...s)=>t(e.breakpoints.only(...s),a),o.not=(...s)=>{const l=t(e.breakpoints.not(...s),a);return l.includes("not all and")?l.replace("not all and ","").replace("min-width:","width<").replace("max-width:","width>").replace("and","or"):l}}const r={},i=o=>(n(r,o),r);return n(i),Q(N({},e),{containerQueries:i})}const Da={xs:0,sm:600,md:900,lg:1200,xl:1536},Zh={keys:["xs","sm","md","lg","xl"],up:e=>`@media (min-width:${Da[e]}px)`},jT={containerQueries:e=>({up:t=>{let n=typeof t=="number"?t:Da[t]||t;return typeof n=="number"&&(n=`${n}px`),e?`@container ${e} (min-width:${n})`:`@container (min-width:${n})`}})};function zn(e,t,n){const r=e.theme||{};if(Array.isArray(t)){const o=r.breakpoints||Zh;return t.reduce((a,s,l)=>(a[o.up(o.keys[l])]=n(t[l]),a),{})}if(typeof t=="object"){const o=r.breakpoints||Zh;return Object.keys(t).reduce((a,s)=>{if(NT(o.keys,s)){const l=FT(r.containerQueries?r:jT,s);l&&(a[l]=n(t[s],s))}else if(Object.keys(o.values||Da).includes(s)){const l=o.up(s);a[l]=n(t[s],s)}else{const l=s;a[l]=t[l]}return a},{})}return n(t)}function UT(e={}){var n;return((n=e.keys)==null?void 0:n.reduce((r,i)=>{const o=e.up(i);return r[o]={},r},{}))||{}}function VT(e,t){return e.reduce((n,r)=>{const i=n[r];return(!i||Object.keys(i).length===0)&&delete n[r],n},t)}function Oa(e,t,n=!0){if(!t||typeof t!="string")return null;if(e&&e.vars&&n){const r=`vars.${t}`.split(".").reduce((i,o)=>i&&i[o]?i[o]:null,e);if(r!=null)return r}return t.split(".").reduce((r,i)=>r&&r[i]!=null?r[i]:null,e)}function Ra(e,t,n,r=n){let i;return typeof e=="function"?i=e(n):Array.isArray(e)?i=e[n]||r:i=Oa(e,n)||r,t&&(i=t(i,r,e)),i}function ot(e){const{prop:t,cssProperty:n=e.prop,themeKey:r,transform:i}=e,o=a=>{if(a[t]==null)return null;const s=a[t],l=a.theme,c=Oa(l,r)||{};return zn(a,s,f=>{let h=Ra(c,i,f);return f===h&&typeof f=="string"&&(h=Ra(c,i,`${t}${f==="default"?"":Hr(f)}`,f)),n===!1?h:{[n]:h}})};return o.propTypes={},o.filterProps=[t],o}function HT(e){const t={};return n=>(t[n]===void 0&&(t[n]=e(n)),t[n])}const WT={m:"margin",p:"padding"},GT={t:"Top",r:"Right",b:"Bottom",l:"Left",x:["Left","Right"],y:["Top","Bottom"]},ep={marginX:"mx",marginY:"my",paddingX:"px",paddingY:"py"},YT=HT(e=>{if(e.length>2)if(ep[e])e=ep[e];else return[e];const[t,n]=e.split(""),r=WT[t],i=GT[n]||"";return Array.isArray(i)?i.map(o=>r+o):[r+i]}),vc=["m","mt","mr","mb","ml","mx","my","margin","marginTop","marginRight","marginBottom","marginLeft","marginX","marginY","marginInline","marginInlineStart","marginInlineEnd","marginBlock","marginBlockStart","marginBlockEnd"],bc=["p","pt","pr","pb","pl","px","py","padding","paddingTop","paddingRight","paddingBottom","paddingLeft","paddingX","paddingY","paddingInline","paddingInlineStart","paddingInlineEnd","paddingBlock","paddingBlockStart","paddingBlockEnd"];[...vc,...bc];function Qi(e,t,n,r){var o;const i=(o=Oa(e,t,!0))!=null?o:n;return typeof i=="number"||typeof i=="string"?a=>typeof a=="string"?a:typeof i=="string"?`calc(${a} * ${i})`:i*a:Array.isArray(i)?a=>{if(typeof a=="string")return a;const s=Math.abs(a),l=i[s];return a>=0?l:typeof l=="number"?-l:`-${l}`}:typeof i=="function"?i:()=>{}}function yc(e){return Qi(e,"spacing",8)}function Ji(e,t){return typeof t=="string"||t==null?t:e(t)}function KT(e,t){return n=>e.reduce((r,i)=>(r[i]=Ji(t,n),r),{})}function qT(e,t,n,r){if(!t.includes(n))return null;const i=YT(n),o=KT(i,r),a=e[n];return zn(e,a,o)}function tp(e,t){const n=yc(e.theme);return Object.keys(e).map(r=>qT(e,t,r,n)).reduce(qi,{})}function Ze(e){return tp(e,vc)}Ze.propTypes={},Ze.filterProps=vc;function et(e){return tp(e,bc)}et.propTypes={},et.filterProps=bc;function La(...e){const t=e.reduce((r,i)=>(i.filterProps.forEach(o=>{r[o]=i}),r),{}),n=r=>Object.keys(r).reduce((i,o)=>t[o]?qi(i,t[o](r)):i,{});return n.propTypes={},n.filterProps=e.reduce((r,i)=>r.concat(i.filterProps),[]),n}function tn(e){return typeof e!="number"?e:`${e}px solid`}function nn(e,t){return ot({prop:e,themeKey:"borders",transform:t})}const QT=nn("border",tn),JT=nn("borderTop",tn),XT=nn("borderRight",tn),ZT=nn("borderBottom",tn),eE=nn("borderLeft",tn),tE=nn("borderColor"),nE=nn("borderTopColor"),rE=nn("borderRightColor"),iE=nn("borderBottomColor"),oE=nn("borderLeftColor"),aE=nn("outline",tn),sE=nn("outlineColor"),Ma=e=>{if(e.borderRadius!==void 0&&e.borderRadius!==null){const t=Qi(e.theme,"shape.borderRadius",4),n=r=>({borderRadius:Ji(t,r)});return zn(e,e.borderRadius,n)}return null};Ma.propTypes={},Ma.filterProps=["borderRadius"],La(QT,JT,XT,ZT,eE,tE,nE,rE,iE,oE,Ma,aE,sE);const Ba=e=>{if(e.gap!==void 0&&e.gap!==null){const t=Qi(e.theme,"spacing",8),n=r=>({gap:Ji(t,r)});return zn(e,e.gap,n)}return null};Ba.propTypes={},Ba.filterProps=["gap"];const $a=e=>{if(e.columnGap!==void 0&&e.columnGap!==null){const t=Qi(e.theme,"spacing",8),n=r=>({columnGap:Ji(t,r)});return zn(e,e.columnGap,n)}return null};$a.propTypes={},$a.filterProps=["columnGap"];const Na=e=>{if(e.rowGap!==void 0&&e.rowGap!==null){const t=Qi(e.theme,"spacing",8),n=r=>({rowGap:Ji(t,r)});return zn(e,e.rowGap,n)}return null};Na.propTypes={},Na.filterProps=["rowGap"];const lE=ot({prop:"gridColumn"}),cE=ot({prop:"gridRow"}),uE=ot({prop:"gridAutoFlow"}),dE=ot({prop:"gridAutoColumns"}),fE=ot({prop:"gridAutoRows"}),hE=ot({prop:"gridTemplateColumns"}),pE=ot({prop:"gridTemplateRows"}),gE=ot({prop:"gridTemplateAreas"}),mE=ot({prop:"gridArea"});La(Ba,$a,Na,lE,cE,uE,dE,fE,hE,pE,gE,mE);function Wr(e,t){return t==="grey"?t:e}const vE=ot({prop:"color",themeKey:"palette",transform:Wr}),bE=ot({prop:"bgcolor",cssProperty:"backgroundColor",themeKey:"palette",transform:Wr}),yE=ot({prop:"backgroundColor",themeKey:"palette",transform:Wr});La(vE,bE,yE);function Gt(e){return e<=1&&e!==0?`${e*100}%`:e}const xE=ot({prop:"width",transform:Gt}),xc=e=>{if(e.maxWidth!==void 0&&e.maxWidth!==null){const t=n=>{var i,o,a,s,l;const r=((a=(o=(i=e.theme)==null?void 0:i.breakpoints)==null?void 0:o.values)==null?void 0:a[n])||Da[n];return r?((l=(s=e.theme)==null?void 0:s.breakpoints)==null?void 0:l.unit)!=="px"?{maxWidth:`${r}${e.theme.breakpoints.unit}`}:{maxWidth:r}:{maxWidth:Gt(n)}};return zn(e,e.maxWidth,t)}return null};xc.filterProps=["maxWidth"];const CE=ot({prop:"minWidth",transform:Gt}),wE=ot({prop:"height",transform:Gt}),IE=ot({prop:"maxHeight",transform:Gt}),SE=ot({prop:"minHeight",transform:Gt});ot({prop:"size",cssProperty:"width",transform:Gt}),ot({prop:"size",cssProperty:"height",transform:Gt});const AE=ot({prop:"boxSizing"});La(xE,xc,CE,wE,IE,SE,AE);const Fa={border:{themeKey:"borders",transform:tn},borderTop:{themeKey:"borders",transform:tn},borderRight:{themeKey:"borders",transform:tn},borderBottom:{themeKey:"borders",transform:tn},borderLeft:{themeKey:"borders",transform:tn},borderColor:{themeKey:"palette"},borderTopColor:{themeKey:"palette"},borderRightColor:{themeKey:"palette"},borderBottomColor:{themeKey:"palette"},borderLeftColor:{themeKey:"palette"},outline:{themeKey:"borders",transform:tn},outlineColor:{themeKey:"palette"},borderRadius:{themeKey:"shape.borderRadius",style:Ma},color:{themeKey:"palette",transform:Wr},bgcolor:{themeKey:"palette",cssProperty:"backgroundColor",transform:Wr},backgroundColor:{themeKey:"palette",transform:Wr},p:{style:et},pt:{style:et},pr:{style:et},pb:{style:et},pl:{style:et},px:{style:et},py:{style:et},padding:{style:et},paddingTop:{style:et},paddingRight:{style:et},paddingBottom:{style:et},paddingLeft:{style:et},paddingX:{style:et},paddingY:{style:et},paddingInline:{style:et},paddingInlineStart:{style:et},paddingInlineEnd:{style:et},paddingBlock:{style:et},paddingBlockStart:{style:et},paddingBlockEnd:{style:et},m:{style:Ze},mt:{style:Ze},mr:{style:Ze},mb:{style:Ze},ml:{style:Ze},mx:{style:Ze},my:{style:Ze},margin:{style:Ze},marginTop:{style:Ze},marginRight:{style:Ze},marginBottom:{style:Ze},marginLeft:{style:Ze},marginX:{style:Ze},marginY:{style:Ze},marginInline:{style:Ze},marginInlineStart:{style:Ze},marginInlineEnd:{style:Ze},marginBlock:{style:Ze},marginBlockStart:{style:Ze},marginBlockEnd:{style:Ze},displayPrint:{cssProperty:!1,transform:e=>({"@media print":{display:e}})},display:{},overflow:{},textOverflow:{},visibility:{},whiteSpace:{},flexBasis:{},flexDirection:{},flexWrap:{},justifyContent:{},alignItems:{},alignContent:{},order:{},flex:{},flexGrow:{},flexShrink:{},alignSelf:{},justifyItems:{},justifySelf:{},gap:{style:Ba},rowGap:{style:Na},columnGap:{style:$a},gridColumn:{},gridRow:{},gridAutoFlow:{},gridAutoColumns:{},gridAutoRows:{},gridTemplateColumns:{},gridTemplateRows:{},gridTemplateAreas:{},gridArea:{},position:{},zIndex:{themeKey:"zIndex"},top:{},right:{},bottom:{},left:{},boxShadow:{themeKey:"shadows"},width:{transform:Gt},maxWidth:{style:xc},minWidth:{transform:Gt},height:{transform:Gt},maxHeight:{transform:Gt},minHeight:{transform:Gt},boxSizing:{},font:{themeKey:"font"},fontFamily:{themeKey:"typography"},fontSize:{themeKey:"typography"},fontStyle:{themeKey:"typography"},fontWeight:{themeKey:"typography"},letterSpacing:{},textTransform:{},lineHeight:{},textAlign:{},typography:{cssProperty:!1,themeKey:"typography"}};function TE(...e){const t=e.reduce((r,i)=>r.concat(Object.keys(i)),[]),n=new Set(t);return e.every(r=>n.size===Object.keys(r).length)}function EE(e,t){return typeof e=="function"?e(t):e}function kE(){function e(n,r,i,o){const a={[n]:r,theme:i},s=o[n];if(!s)return{[n]:r};const{cssProperty:l=n,themeKey:c,transform:d,style:f}=s;if(r==null)return null;if(c==="typography"&&r==="inherit")return{[n]:r};const h=Oa(i,c)||{};return f?f(a):zn(a,r,m=>{let g=Ra(h,d,m);return m===g&&typeof m=="string"&&(g=Ra(h,d,`${n}${m==="default"?"":Hr(m)}`,m)),l===!1?g:{[l]:g}})}function t(n){var s;const{sx:r,theme:i={}}=n||{};if(!r)return null;const o=(s=i.unstable_sxConfig)!=null?s:Fa;function a(l){let c=l;if(typeof l=="function")c=l(i);else if(typeof l!="object")return l;if(!c)return null;const d=UT(i.breakpoints),f=Object.keys(d);let h=d;return Object.keys(c).forEach(p=>{const m=EE(c[p],i);if(m!=null)if(typeof m=="object")if(o[p])h=qi(h,e(p,m,i,o));else{const g=zn({theme:i},m,v=>({[p]:v}));TE(g,m)?h[p]=t({sx:m,theme:i}):h=qi(h,g)}else h=qi(h,e(p,m,i,o))}),$T(i,VT(f,h))}return Array.isArray(r)?r.map(a):a(r)}return t}const Gr=kE();Gr.filterProps=["sx"];function _E(e){for(var t=0,n,r=0,i=e.length;i>=4;++r,i-=4)n=e.charCodeAt(r)&255|(e.charCodeAt(++r)&255)<<8|(e.charCodeAt(++r)&255)<<16|(e.charCodeAt(++r)&255)<<24,n=(n&65535)*1540483477+((n>>>16)*59797<<16),n^=n>>>24,t=(n&65535)*1540483477+((n>>>16)*59797<<16)^(t&65535)*1540483477+((t>>>16)*59797<<16);switch(i){case 3:t^=(e.charCodeAt(r+2)&255)<<16;case 2:t^=(e.charCodeAt(r+1)&255)<<8;case 1:t^=e.charCodeAt(r)&255,t=(t&65535)*1540483477+((t>>>16)*59797<<16)}return t^=t>>>13,t=(t&65535)*1540483477+((t>>>16)*59797<<16),((t^t>>>15)>>>0).toString(36)}var PE={animationIterationCount:1,aspectRatio:1,borderImageOutset:1,borderImageSlice:1,borderImageWidth:1,boxFlex:1,boxFlexGroup:1,boxOrdinalGroup:1,columnCount:1,columns:1,flex:1,flexGrow:1,flexPositive:1,flexShrink:1,flexNegative:1,flexOrder:1,gridRow:1,gridRowEnd:1,gridRowSpan:1,gridRowStart:1,gridColumn:1,gridColumnEnd:1,gridColumnSpan:1,gridColumnStart:1,msGridRow:1,msGridRowSpan:1,msGridColumn:1,msGridColumnSpan:1,fontWeight:1,lineHeight:1,opacity:1,order:1,orphans:1,scale:1,tabSize:1,widows:1,zIndex:1,zoom:1,WebkitLineClamp:1,fillOpacity:1,floodOpacity:1,stopOpacity:1,strokeDasharray:1,strokeDashoffset:1,strokeMiterlimit:1,strokeOpacity:1,strokeWidth:1},DE=!1,OE=/[A-Z]|^ms/g,RE=/_EMO_([^_]+?)_([^]*?)_EMO_/g,np=function(t){return t.charCodeAt(1)===45},rp=function(t){return t!=null&&typeof t!="boolean"},Cc=ZS(function(e){return np(e)?e:e.replace(OE,"-$&").toLowerCase()}),ip=function(t,n){switch(t){case"animation":case"animationName":if(typeof n=="string")return n.replace(RE,function(r,i,o){return tr={name:i,styles:o,next:tr},i})}return PE[t]!==1&&!np(t)&&typeof n=="number"&&n!==0?n+"px":n},LE="Component selectors can only be used in conjunction with @emotion/babel-plugin, the swc Emotion plugin, or another Emotion-aware compiler transform.";function za(e,t,n){if(n==null)return"";var r=n;if(r.__emotion_styles!==void 0)return r;switch(typeof n){case"boolean":return"";case"object":{var i=n;if(i.anim===1)return tr={name:i.name,styles:i.styles,next:tr},i.name;var o=n;if(o.styles!==void 0){var a=o.next;if(a!==void 0)for(;a!==void 0;)tr={name:a.name,styles:a.styles,next:tr},a=a.next;var s=o.styles+";";return s}return ME(e,t,n)}}var l=n;return l}function ME(e,t,n){var r="";if(Array.isArray(n))for(var i=0;i<n.length;i++)r+=za(e,t,n[i])+";";else for(var o in n){var a=n[o];if(typeof a!="object"){var s=a;rp(s)&&(r+=Cc(o)+":"+ip(o,s)+";")}else{if(o==="NO_COMPONENT_SELECTOR"&&DE)throw new Error(LE);if(Array.isArray(a)&&typeof a[0]=="string"&&t==null)for(var l=0;l<a.length;l++)rp(a[l])&&(r+=Cc(o)+":"+ip(o,a[l])+";");else{var c=za(e,t,a);switch(o){case"animation":case"animationName":{r+=Cc(o)+":"+c+";";break}default:r+=o+"{"+c+"}"}}}}return r}var op=/label:\s*([^\s;{]+)\s*(;|$)/g,tr;function BE(e,t,n){if(e.length===1&&typeof e[0]=="object"&&e[0]!==null&&e[0].styles!==void 0)return e[0];var r=!0,i="";tr=void 0;var o=e[0];if(o==null||o.raw===void 0)r=!1,i+=za(n,t,o);else{var a=o;i+=a[0]}for(var s=1;s<e.length;s++)if(i+=za(n,t,e[s]),r){var l=o;i+=l[s]}op.lastIndex=0;for(var c="",d;(d=op.exec(i))!==null;)c+="-"+d[1];var f=_E(i)+c;return{name:f,styles:i,next:tr}}/**
|
|
2334
|
+
* @mui/styled-engine v6.4.0
|
|
2335
|
+
*
|
|
2336
|
+
* @license MIT
|
|
2337
|
+
* This source code is licensed under the MIT license found in the
|
|
2338
|
+
* LICENSE file in the root directory of this source tree.
|
|
2339
|
+
*/function $E(e,t){return bi(e,t)}function NE(e,t){Array.isArray(e.__emotion_styles)&&(e.__emotion_styles=t(e.__emotion_styles))}const ap=[];function sp(e){return ap[0]=e,BE(ap)}const FE=e=>{const t=Object.keys(e).map(n=>({key:n,val:e[n]}))||[];return t.sort((n,r)=>n.val-r.val),t.reduce((n,r)=>Q(N({},n),{[r.key]:r.val}),{})};function zE(e){const h=e,{values:t={xs:0,sm:600,md:900,lg:1200,xl:1536},unit:n="px",step:r=5}=h,i=We(h,["values","unit","step"]),o=FE(t),a=Object.keys(o);function s(p){return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n})`}function l(p){return`@media (max-width:${(typeof t[p]=="number"?t[p]:p)-r/100}${n})`}function c(p,m){const g=a.indexOf(m);return`@media (min-width:${typeof t[p]=="number"?t[p]:p}${n}) and (max-width:${(g!==-1&&typeof t[a[g]]=="number"?t[a[g]]:m)-r/100}${n})`}function d(p){return a.indexOf(p)+1<a.length?c(p,a[a.indexOf(p)+1]):s(p)}function f(p){const m=a.indexOf(p);return m===0?s(a[1]):m===a.length-1?l(a[m]):c(p,a[a.indexOf(p)+1]).replace("@media","@media not all and")}return N({keys:a,values:o,up:s,down:l,between:c,only:d,not:f,unit:n},i)}const jE={borderRadius:4};function lp(e=8,t=yc({spacing:e})){if(e.mui)return e;const n=(...r)=>(r.length===0?[1]:r).map(o=>{const a=t(o);return typeof a=="number"?`${a}px`:a}).join(" ");return n.mui=!0,n}function UE(e,t){var r;const n=this;if(n.vars){if(!((r=n.colorSchemes)!=null&&r[e])||typeof n.getColorSchemeSelector!="function")return{};let i=n.getColorSchemeSelector(e);return i==="&"?t:((i.includes("data-")||i.includes("."))&&(i=`*:where(${i.replace(/\s*&$/,"")}) &`),{[i]:t})}return n.palette.mode===e?t:{}}function cp(e={},...t){const d=e,{breakpoints:n={},palette:r={},spacing:i,shape:o={}}=d,a=We(d,["breakpoints","palette","spacing","shape"]),s=zE(n),l=lp(i);let c=Wt({breakpoints:s,direction:"ltr",components:{},palette:N({mode:"light"},r),spacing:l,shape:N(N({},jE),o)},a);return c=zT(c),c.applyStyles=UE,c=t.reduce((f,h)=>Wt(f,h),c),c.unstable_sxConfig=N(N({},Fa),a==null?void 0:a.unstable_sxConfig),c.unstable_sx=function(h){return Gr({sx:h,theme:this})},c}function up(e){const i=e,{variants:t}=i,n=We(i,["variants"]),r={variants:t,style:sp(n),isProcessed:!0};return r.style===n||t&&t.forEach(o=>{typeof o.style!="function"&&(o.style=sp(o.style))}),r}const VE=cp();function wc(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}function HE(e){return e?(t,n)=>n[e]:null}function WE(e,t,n){e.theme=KE(e.theme)?n:e.theme[t]||e.theme}function ja(e,t){const n=typeof t=="function"?t(e):t;if(Array.isArray(n))return n.flatMap(i=>ja(e,i));if(Array.isArray(n==null?void 0:n.variants)){let i;if(n.isProcessed)i=n.style;else{const r=n,{variants:o}=r;i=We(r,["variants"])}return dp(e,n.variants,[i])}return n!=null&&n.isProcessed?n.style:n}function dp(e,t,n=[]){var i;let r;e:for(let o=0;o<t.length;o+=1){const a=t[o];if(typeof a.props=="function"){if(r!=null||(r=Q(N(N({},e),e.ownerState),{ownerState:e.ownerState})),!a.props(r))continue}else for(const s in a.props)if(e[s]!==a.props[s]&&((i=e.ownerState)==null?void 0:i[s])!==a.props[s])continue e;typeof a.style=="function"?(r!=null||(r=Q(N(N({},e),e.ownerState),{ownerState:e.ownerState})),n.push(a.style(r))):n.push(a.style)}return n}function GE(e={}){const{themeId:t,defaultTheme:n=VE,rootShouldForwardProp:r=wc,slotShouldForwardProp:i=wc}=e;function o(s){WE(s,t,n)}return(s,l={})=>{NE(s,A=>A.filter(E=>E!==Gr));const y=l,{name:c,slot:d,skipVariantsResolver:f,skipSx:h,overridesResolver:p=HE(QE(d))}=y,m=We(y,["name","slot","skipVariantsResolver","skipSx","overridesResolver"]),g=f!==void 0?f:d&&d!=="Root"&&d!=="root"||!1,v=h||!1;let S=wc;d==="Root"||d==="root"?S=r:d?S=i:qE(s)&&(S=void 0);const I=$E(s,N({shouldForwardProp:S,label:YE()},m)),x=A=>{if(typeof A=="function"&&A.__emotion_real!==A)return function(_){return ja(_,A)};if(Fn(A)){const E=up(A);return E.variants?function(D){return ja(D,E)}:E.style}return A},C=(...A)=>{const E=[],_=A.map(x),D=[];if(E.push(o),c&&p&&D.push(function(j){var B,H;const z=(H=(B=j.theme.components)==null?void 0:B[c])==null?void 0:H.styleOverrides;if(!z)return null;const $={};for(const q in z)$[q]=ja(j,z[q]);return p(j,$)}),c&&!g&&D.push(function(j){var $,B;const Y=j.theme,z=(B=($=Y==null?void 0:Y.components)==null?void 0:$[c])==null?void 0:B.variants;return z?dp(j,z):null}),v||D.push(Gr),Array.isArray(_[0])){const T=_.shift(),j=new Array(E.length).fill(""),Y=new Array(D.length).fill("");let z;z=[...j,...T,...Y],z.raw=[...j,...T.raw,...Y],E.unshift(z)}const G=[...E,..._,...D],F=I(...G);return s.muiName&&(F.muiName=s.muiName),F};return I.withConfig&&(C.withConfig=I.withConfig),C}}function YE(e,t){return void 0}function KE(e){for(const t in e)return!1;return!0}function qE(e){return typeof e=="string"&&e.charCodeAt(0)>96}function QE(e){return e&&e.charAt(0).toLowerCase()+e.slice(1)}function Ic(e,t=0,n=1){return BT(e,t,n)}function JE(e){e=e.slice(1);const t=new RegExp(`.{1,${e.length>=6?2:1}}`,"g");let n=e.match(t);return n&&n[0].length===1&&(n=n.map(r=>r+r)),n?`rgb${n.length===4?"a":""}(${n.map((r,i)=>i<3?parseInt(r,16):Math.round(parseInt(r,16)/255*1e3)/1e3).join(", ")})`:""}function nr(e){if(e.type)return e;if(e.charAt(0)==="#")return nr(JE(e));const t=e.indexOf("("),n=e.substring(0,t);if(!["rgb","rgba","hsl","hsla","color"].includes(n))throw new Error(yr(9,e));let r=e.substring(t+1,e.length-1),i;if(n==="color"){if(r=r.split(" "),i=r.shift(),r.length===4&&r[3].charAt(0)==="/"&&(r[3]=r[3].slice(1)),!["srgb","display-p3","a98-rgb","prophoto-rgb","rec-2020"].includes(i))throw new Error(yr(10,i))}else r=r.split(",");return r=r.map(o=>parseFloat(o)),{type:n,values:r,colorSpace:i}}const XE=e=>{const t=nr(e);return t.values.slice(0,3).map((n,r)=>t.type.includes("hsl")&&r!==0?`${n}%`:n).join(" ")},Xi=(e,t)=>{try{return XE(e)}catch(n){return e}};function Ua(e){const{type:t,colorSpace:n}=e;let{values:r}=e;return t.includes("rgb")?r=r.map((i,o)=>o<3?parseInt(i,10):i):t.includes("hsl")&&(r[1]=`${r[1]}%`,r[2]=`${r[2]}%`),t.includes("color")?r=`${n} ${r.join(" ")}`:r=`${r.join(", ")}`,`${t}(${r})`}function fp(e){e=nr(e);const{values:t}=e,n=t[0],r=t[1]/100,i=t[2]/100,o=r*Math.min(i,1-i),a=(c,d=(c+n/30)%12)=>i-o*Math.max(Math.min(d-3,9-d,1),-1);let s="rgb";const l=[Math.round(a(0)*255),Math.round(a(8)*255),Math.round(a(4)*255)];return e.type==="hsla"&&(s+="a",l.push(t[3])),Ua({type:s,values:l})}function Sc(e){e=nr(e);let t=e.type==="hsl"||e.type==="hsla"?nr(fp(e)).values:e.values;return t=t.map(n=>(e.type!=="color"&&(n/=255),n<=.03928?n/12.92:vi((n+.055)/1.055,2.4))),Number((.2126*t[0]+.7152*t[1]+.0722*t[2]).toFixed(3))}function ZE(e,t){const n=Sc(e),r=Sc(t);return(Math.max(n,r)+.05)/(Math.min(n,r)+.05)}function ek(e,t){return e=nr(e),t=Ic(t),(e.type==="rgb"||e.type==="hsl")&&(e.type+="a"),e.type==="color"?e.values[3]=`/${t}`:e.values[3]=t,Ua(e)}function Va(e,t,n){try{return ek(e,t)}catch(r){return e}}function Ac(e,t){if(e=nr(e),t=Ic(t),e.type.includes("hsl"))e.values[2]*=1-t;else if(e.type.includes("rgb")||e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]*=1-t;return Ua(e)}function $e(e,t,n){try{return Ac(e,t)}catch(r){return e}}function Tc(e,t){if(e=nr(e),t=Ic(t),e.type.includes("hsl"))e.values[2]+=(100-e.values[2])*t;else if(e.type.includes("rgb"))for(let n=0;n<3;n+=1)e.values[n]+=(255-e.values[n])*t;else if(e.type.includes("color"))for(let n=0;n<3;n+=1)e.values[n]+=(1-e.values[n])*t;return Ua(e)}function Ne(e,t,n){try{return Tc(e,t)}catch(r){return e}}function tk(e,t=.15){return Sc(e)>.5?Ac(e,t):Tc(e,t)}function Ha(e,t,n){try{return tk(e,t)}catch(r){return e}}const nk=W.createContext(void 0);function rk(e){const{theme:t,name:n,props:r}=e;if(!t||!t.components||!t.components[n])return r;const i=t.components[n];return i.defaultProps?mc(i.defaultProps,r):!i.styleOverrides&&!i.variants?mc(i,r):r}function ik({props:e,name:t}){const n=W.useContext(nk);return rk({props:e,name:t,theme:{components:n}})}const hp={theme:void 0};function ok(e){let t,n;return function(i){let o=t;return(o===void 0||i.theme!==n)&&(hp.theme=i.theme,o=up(e(hp)),t=o,n=i.theme),o}}function ak(e=""){function t(...r){if(!r.length)return"";const i=r[0];return typeof i=="string"&&!i.match(/(#|\(|\)|(-?(\d*\.)?\d+)(px|em|%|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc))|^(-?(\d*\.)?\d+)$|(\d+ \d+ \d+)/)?`, var(--${e?`${e}-`:""}${i}${t(...r.slice(1))})`:`, ${i}`}return(r,...i)=>`var(--${e?`${e}-`:""}${r}${t(...i)})`}const pp=(e,t,n,r=[])=>{let i=e;t.forEach((o,a)=>{a===t.length-1?Array.isArray(i)?i[Number(o)]=n:i&&typeof i=="object"&&(i[o]=n):i&&typeof i=="object"&&(i[o]||(i[o]=r.includes(o)?[]:{}),i=i[o])})},sk=(e,t,n)=>{function r(i,o=[],a=[]){Object.entries(i).forEach(([s,l])=>{(!n||n&&!n([...o,s]))&&l!=null&&(typeof l=="object"&&Object.keys(l).length>0?r(l,[...o,s],Array.isArray(l)?[...a,s]:a):t([...o,s],l,a))})}r(e)},lk=(e,t)=>typeof t=="number"?["lineHeight","fontWeight","opacity","zIndex"].some(r=>e.includes(r))||e[e.length-1].toLowerCase().includes("opacity")?t:`${t}px`:t;function Ec(e,t){const{prefix:n,shouldSkipGeneratingVar:r}=t||{},i={},o={},a={};return sk(e,(s,l,c)=>{if((typeof l=="string"||typeof l=="number")&&(!r||!r(s,l))){const d=`--${n?`${n}-`:""}${s.join("-")}`,f=lk(s,l);Object.assign(i,{[d]:f}),pp(o,s,`var(${d})`,c),pp(a,s,`var(${d}, ${f})`,c)}},s=>s[0]==="vars"),{css:i,vars:o,varsWithDefaults:a}}function ck(e,t={}){const{getSelector:n=v,disableCssColorScheme:r,colorSchemeSelector:i}=t,x=e,{colorSchemes:o={},components:a,defaultColorScheme:s="light"}=x,l=We(x,["colorSchemes","components","defaultColorScheme"]),{vars:c,css:d,varsWithDefaults:f}=Ec(l,t);let h=f;const p={},C=o,{[s]:m}=C,g=We(C,[Ns(s)]);if(Object.entries(g||{}).forEach(([y,A])=>{const{vars:E,css:_,varsWithDefaults:D}=Ec(A,t);h=Wt(h,D),p[y]={css:_,vars:E}}),m){const{css:y,vars:A,varsWithDefaults:E}=Ec(m,t);h=Wt(h,E),p[s]={css:y,vars:A}}function v(y,A){var _,D;let E=i;if(i==="class"&&(E=".%s"),i==="data"&&(E="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(E=`[${i}="%s"]`),y){if(E==="media")return e.defaultColorScheme===y?":root":{[`@media (prefers-color-scheme: ${((D=(_=o[y])==null?void 0:_.palette)==null?void 0:D.mode)||y})`]:{":root":A}};if(E)return e.defaultColorScheme===y?`:root, ${E.replace("%s",String(y))}`:E.replace("%s",String(y))}return":root"}return{vars:h,generateThemeVars:()=>{let y=N({},c);return Object.entries(p).forEach(([,{vars:A}])=>{y=Wt(y,A)}),y},generateStyleSheets:()=>{var F,T;const y=[],A=e.defaultColorScheme||"light";function E(j,Y){Object.keys(Y).length&&y.push(typeof j=="string"?{[j]:N({},Y)}:j)}E(n(void 0,N({},d)),d);const G=p,{[A]:_}=G,D=We(G,[Ns(A)]);if(_){const{css:j}=_,Y=(T=(F=o[A])==null?void 0:F.palette)==null?void 0:T.mode,z=N(!r&&Y?{colorScheme:Y}:{},j);E(n(A,N({},z)),z)}return Object.entries(D).forEach(([j,{css:Y}])=>{var B,H;const z=(H=(B=o[j])==null?void 0:B.palette)==null?void 0:H.mode,$=N(!r&&z?{colorScheme:z}:{},Y);E(n(j,N({},$)),$)}),y}}}function uk(e){return function(n){return e==="media"?`@media (prefers-color-scheme: ${n})`:e?e.startsWith("data-")&&!e.includes("%s")?`[${e}="${n}"] &`:e==="class"?`.${n} &`:e==="data"?`[data-${n}] &`:`${e.replace("%s",n)} &`:"&"}}const Zi={black:"#000",white:"#fff"},dk={50:"#fafafa",100:"#f5f5f5",200:"#eeeeee",300:"#e0e0e0",400:"#bdbdbd",500:"#9e9e9e",600:"#757575",700:"#616161",800:"#424242",900:"#212121",A100:"#f5f5f5",A200:"#eeeeee",A400:"#bdbdbd",A700:"#616161"},Yr={50:"#f3e5f5",100:"#e1bee7",200:"#ce93d8",300:"#ba68c8",400:"#ab47bc",500:"#9c27b0",600:"#8e24aa",700:"#7b1fa2",800:"#6a1b9a",900:"#4a148c",A100:"#ea80fc",A200:"#e040fb",A400:"#d500f9",A700:"#aa00ff"},Kr={50:"#ffebee",100:"#ffcdd2",200:"#ef9a9a",300:"#e57373",400:"#ef5350",500:"#f44336",600:"#e53935",700:"#d32f2f",800:"#c62828",900:"#b71c1c",A100:"#ff8a80",A200:"#ff5252",A400:"#ff1744",A700:"#d50000"},eo={50:"#fff3e0",100:"#ffe0b2",200:"#ffcc80",300:"#ffb74d",400:"#ffa726",500:"#ff9800",600:"#fb8c00",700:"#f57c00",800:"#ef6c00",900:"#e65100",A100:"#ffd180",A200:"#ffab40",A400:"#ff9100",A700:"#ff6d00"},qr={50:"#e3f2fd",100:"#bbdefb",200:"#90caf9",300:"#64b5f6",400:"#42a5f5",500:"#2196f3",600:"#1e88e5",700:"#1976d2",800:"#1565c0",900:"#0d47a1",A100:"#82b1ff",A200:"#448aff",A400:"#2979ff",A700:"#2962ff"},Qr={50:"#e1f5fe",100:"#b3e5fc",200:"#81d4fa",300:"#4fc3f7",400:"#29b6f6",500:"#03a9f4",600:"#039be5",700:"#0288d1",800:"#0277bd",900:"#01579b",A100:"#80d8ff",A200:"#40c4ff",A400:"#00b0ff",A700:"#0091ea"},Jr={50:"#e8f5e9",100:"#c8e6c9",200:"#a5d6a7",300:"#81c784",400:"#66bb6a",500:"#4caf50",600:"#43a047",700:"#388e3c",800:"#2e7d32",900:"#1b5e20",A100:"#b9f6ca",A200:"#69f0ae",A400:"#00e676",A700:"#00c853"};function gp(){return{text:{primary:"rgba(0, 0, 0, 0.87)",secondary:"rgba(0, 0, 0, 0.6)",disabled:"rgba(0, 0, 0, 0.38)"},divider:"rgba(0, 0, 0, 0.12)",background:{paper:Zi.white,default:Zi.white},action:{active:"rgba(0, 0, 0, 0.54)",hover:"rgba(0, 0, 0, 0.04)",hoverOpacity:.04,selected:"rgba(0, 0, 0, 0.08)",selectedOpacity:.08,disabled:"rgba(0, 0, 0, 0.26)",disabledBackground:"rgba(0, 0, 0, 0.12)",disabledOpacity:.38,focus:"rgba(0, 0, 0, 0.12)",focusOpacity:.12,activatedOpacity:.12}}}const fk=gp();function mp(){return{text:{primary:Zi.white,secondary:"rgba(255, 255, 255, 0.7)",disabled:"rgba(255, 255, 255, 0.5)",icon:"rgba(255, 255, 255, 0.5)"},divider:"rgba(255, 255, 255, 0.12)",background:{paper:"#121212",default:"#121212"},action:{active:Zi.white,hover:"rgba(255, 255, 255, 0.08)",hoverOpacity:.08,selected:"rgba(255, 255, 255, 0.16)",selectedOpacity:.16,disabled:"rgba(255, 255, 255, 0.3)",disabledBackground:"rgba(255, 255, 255, 0.12)",disabledOpacity:.38,focus:"rgba(255, 255, 255, 0.12)",focusOpacity:.12,activatedOpacity:.24}}}const vp=mp();function bp(e,t,n,r){const i=r.light||r,o=r.dark||r*1.5;e[t]||(e.hasOwnProperty(n)?e[t]=e[n]:t==="light"?e.light=Tc(e.main,i):t==="dark"&&(e.dark=Ac(e.main,o)))}function hk(e="light"){return e==="dark"?{main:qr[200],light:qr[50],dark:qr[400]}:{main:qr[700],light:qr[400],dark:qr[800]}}function pk(e="light"){return e==="dark"?{main:Yr[200],light:Yr[50],dark:Yr[400]}:{main:Yr[500],light:Yr[300],dark:Yr[700]}}function gk(e="light"){return e==="dark"?{main:Kr[500],light:Kr[300],dark:Kr[700]}:{main:Kr[700],light:Kr[400],dark:Kr[800]}}function mk(e="light"){return e==="dark"?{main:Qr[400],light:Qr[300],dark:Qr[700]}:{main:Qr[700],light:Qr[500],dark:Qr[900]}}function vk(e="light"){return e==="dark"?{main:Jr[400],light:Jr[300],dark:Jr[700]}:{main:Jr[800],light:Jr[500],dark:Jr[900]}}function bk(e="light"){return e==="dark"?{main:eo[400],light:eo[300],dark:eo[700]}:{main:"#ed6c02",light:eo[500],dark:eo[900]}}function kc(e){const g=e,{mode:t="light",contrastThreshold:n=3,tonalOffset:r=.2}=g,i=We(g,["mode","contrastThreshold","tonalOffset"]),o=e.primary||hk(t),a=e.secondary||pk(t),s=e.error||gk(t),l=e.info||mk(t),c=e.success||vk(t),d=e.warning||bk(t);function f(v){return ZE(v,vp.text.primary)>=n?vp.text.primary:fk.text.primary}const h=({color:v,name:S,mainShade:I=500,lightShade:x=300,darkShade:C=700})=>{if(v=N({},v),!v.main&&v[I]&&(v.main=v[I]),!v.hasOwnProperty("main"))throw new Error(yr(11,S?` (${S})`:"",I));if(typeof v.main!="string")throw new Error(yr(12,S?` (${S})`:"",JSON.stringify(v.main)));return bp(v,"light",x,r),bp(v,"dark",C,r),v.contrastText||(v.contrastText=f(v.main)),v};let p;return t==="light"?p=gp():t==="dark"&&(p=mp()),Wt(N({common:N({},Zi),mode:t,primary:h({color:o,name:"primary"}),secondary:h({color:a,name:"secondary",mainShade:"A400",lightShade:"A200",darkShade:"A700"}),error:h({color:s,name:"error"}),warning:h({color:d,name:"warning"}),info:h({color:l,name:"info"}),success:h({color:c,name:"success"}),grey:dk,contrastThreshold:n,getContrastText:f,augmentColor:h,tonalOffset:r},p),i)}function yk(e){const t={};return Object.entries(e).forEach(r=>{const[i,o]=r;typeof o=="object"&&(t[i]=`${o.fontStyle?`${o.fontStyle} `:""}${o.fontVariant?`${o.fontVariant} `:""}${o.fontWeight?`${o.fontWeight} `:""}${o.fontStretch?`${o.fontStretch} `:""}${o.fontSize||""}${o.lineHeight?`/${o.lineHeight} `:""}${o.fontFamily||""}`)}),t}function xk(e,t){return N({toolbar:{minHeight:56,[e.up("xs")]:{"@media (orientation: landscape)":{minHeight:48}},[e.up("sm")]:{minHeight:64}}},t)}function Ck(e){return Math.round(e*1e5)/1e5}const yp={textTransform:"uppercase"},xp='"Roboto", "Helvetica", "Arial", sans-serif';function wk(e,t){const v=typeof t=="function"?t(e):t,{fontFamily:n=xp,fontSize:r=14,fontWeightLight:i=300,fontWeightRegular:o=400,fontWeightMedium:a=500,fontWeightBold:s=700,htmlFontSize:l=16,allVariants:c,pxToRem:d}=v,f=We(v,["fontFamily","fontSize","fontWeightLight","fontWeightRegular","fontWeightMedium","fontWeightBold","htmlFontSize","allVariants","pxToRem"]),h=r/14,p=d||(S=>`${S/l*h}rem`),m=(S,I,x,C,y)=>N(N(N({fontFamily:n,fontWeight:S,fontSize:p(I),lineHeight:x},n===xp?{letterSpacing:`${Ck(C/I)}em`}:{}),y),c),g={h1:m(i,96,1.167,-1.5),h2:m(i,60,1.2,-.5),h3:m(o,48,1.167,0),h4:m(o,34,1.235,.25),h5:m(o,24,1.334,0),h6:m(a,20,1.6,.15),subtitle1:m(o,16,1.75,.15),subtitle2:m(a,14,1.57,.1),body1:m(o,16,1.5,.15),body2:m(o,14,1.43,.15),button:m(a,14,1.75,.4,yp),caption:m(o,12,1.66,.4),overline:m(o,12,2.66,1,yp),inherit:{fontFamily:"inherit",fontWeight:"inherit",fontSize:"inherit",lineHeight:"inherit",letterSpacing:"inherit"}};return Wt(N({htmlFontSize:l,pxToRem:p,fontFamily:n,fontSize:r,fontWeightLight:i,fontWeightRegular:o,fontWeightMedium:a,fontWeightBold:s},g),f,{clone:!1})}const Ik=.2,Sk=.14,Ak=.12;function je(...e){return[`${e[0]}px ${e[1]}px ${e[2]}px ${e[3]}px rgba(0,0,0,${Ik})`,`${e[4]}px ${e[5]}px ${e[6]}px ${e[7]}px rgba(0,0,0,${Sk})`,`${e[8]}px ${e[9]}px ${e[10]}px ${e[11]}px rgba(0,0,0,${Ak})`].join(",")}const Tk=["none",je(0,2,1,-1,0,1,1,0,0,1,3,0),je(0,3,1,-2,0,2,2,0,0,1,5,0),je(0,3,3,-2,0,3,4,0,0,1,8,0),je(0,2,4,-1,0,4,5,0,0,1,10,0),je(0,3,5,-1,0,5,8,0,0,1,14,0),je(0,3,5,-1,0,6,10,0,0,1,18,0),je(0,4,5,-2,0,7,10,1,0,2,16,1),je(0,5,5,-3,0,8,10,1,0,3,14,2),je(0,5,6,-3,0,9,12,1,0,3,16,2),je(0,6,6,-3,0,10,14,1,0,4,18,3),je(0,6,7,-4,0,11,15,1,0,4,20,3),je(0,7,8,-4,0,12,17,2,0,5,22,4),je(0,7,8,-4,0,13,19,2,0,5,24,4),je(0,7,9,-4,0,14,21,2,0,5,26,4),je(0,8,9,-5,0,15,22,2,0,6,28,5),je(0,8,10,-5,0,16,24,2,0,6,30,5),je(0,8,11,-5,0,17,26,2,0,6,32,5),je(0,9,11,-5,0,18,28,2,0,7,34,6),je(0,9,12,-6,0,19,29,2,0,7,36,6),je(0,10,13,-6,0,20,31,3,0,8,38,7),je(0,10,13,-6,0,21,33,3,0,8,40,7),je(0,10,14,-6,0,22,35,3,0,8,42,7),je(0,11,14,-7,0,23,36,3,0,9,44,8),je(0,11,15,-7,0,24,38,3,0,9,46,8)],Ek={easeInOut:"cubic-bezier(0.4, 0, 0.2, 1)",easeOut:"cubic-bezier(0.0, 0, 0.2, 1)",easeIn:"cubic-bezier(0.4, 0, 1, 1)",sharp:"cubic-bezier(0.4, 0, 0.6, 1)"},kk={shortest:150,shorter:200,short:250,standard:300,complex:375,enteringScreen:225,leavingScreen:195};function Cp(e){return`${Math.round(e)}ms`}function _k(e){if(!e)return 0;const t=e/36;return Math.min(Math.round((4+15*vi(t,.25)+t/5)*10),3e3)}function Pk(e){const t=N(N({},Ek),e.easing),n=N(N({},kk),e.duration);return Q(N({getAutoHeightDuration:_k,create:(i=["all"],o={})=>{const d=o,{duration:a=n.standard,easing:s=t.easeInOut,delay:l=0}=d,c=We(d,["duration","easing","delay"]);return(Array.isArray(i)?i:[i]).map(f=>`${f} ${typeof a=="string"?a:Cp(a)} ${s} ${typeof l=="string"?l:Cp(l)}`).join(",")}},e),{easing:t,duration:n})}const Dk={mobileStepper:1e3,fab:1050,speedDial:1050,appBar:1100,drawer:1200,modal:1300,snackbar:1400,tooltip:1500};function Ok(e){return Fn(e)||typeof e=="undefined"||typeof e=="string"||typeof e=="boolean"||typeof e=="number"||Array.isArray(e)}function wp(e={}){const t=N({},e);function n(r){const i=Object.entries(r);for(let o=0;o<i.length;o++){const[a,s]=i[o];!Ok(s)||a.startsWith("unstable_")?delete r[a]:Fn(s)&&(r[a]=N({},s),n(r[a]))}}return n(t),`import { unstable_createBreakpoints as createBreakpoints, createTransitions } from '@mui/material/styles';
|
|
2340
|
+
|
|
2341
|
+
const theme = ${JSON.stringify(t,null,2)};
|
|
2342
|
+
|
|
2343
|
+
theme.breakpoints = createBreakpoints(theme.breakpoints || {});
|
|
2344
|
+
theme.transitions = createTransitions(theme.transitions || {});
|
|
2345
|
+
|
|
2346
|
+
export default theme;`}function _c(e={},...t){const p=e,{breakpoints:n,mixins:r={},spacing:i,palette:o={},transitions:a={},typography:s={},shape:l}=p,c=We(p,["breakpoints","mixins","spacing","palette","transitions","typography","shape"]);if(e.vars)throw new Error(yr(20));const d=kc(o),f=cp(e);let h=Wt(f,{mixins:xk(f.breakpoints,r),palette:d,shadows:Tk.slice(),typography:wk(d,s),transitions:Pk(a),zIndex:N({},Dk)});return h=Wt(h,c),h=t.reduce((m,g)=>Wt(m,g),h),h.unstable_sxConfig=N(N({},Fa),c==null?void 0:c.unstable_sxConfig),h.unstable_sx=function(g){return Gr({sx:g,theme:this})},h.toRuntimeSource=wp,h}function Rk(e){let t;return e<1?t=5.11916*vi(e,2):t=4.5*Math.log(e+1)+2,Math.round(t*10)/1e3}const Lk=[...Array(25)].map((e,t)=>{if(t===0)return"none";const n=Rk(t);return`linear-gradient(rgba(255 255 255 / ${n}), rgba(255 255 255 / ${n}))`});function Ip(e){return{inputPlaceholder:e==="dark"?.5:.42,inputUnderline:e==="dark"?.7:.42,switchTrackDisabled:e==="dark"?.2:.12,switchTrack:e==="dark"?.3:.38}}function Sp(e){return e==="dark"?Lk:[]}function Mk(e){const a=e,{palette:t={mode:"light"},opacity:n,overlays:r}=a,i=We(a,["palette","opacity","overlays"]),o=kc(t);return N({palette:o,opacity:N(N({},Ip(o.mode)),n),overlays:r||Sp(o.mode)},i)}function Bk(e){var t;return!!e[0].match(/(cssVarPrefix|colorSchemeSelector|rootSelector|typography|mixins|breakpoints|direction|transitions)/)||!!e[0].match(/sxConfig$/)||e[0]==="palette"&&!!((t=e[1])!=null&&t.match(/(mode|contrastThreshold|tonalOffset)/))}const $k=e=>[...[...Array(25)].map((t,n)=>`--${e?`${e}-`:""}overlays-${n}`),`--${e?`${e}-`:""}palette-AppBar-darkBg`,`--${e?`${e}-`:""}palette-AppBar-darkColor`],Nk=e=>(t,n)=>{const r=e.rootSelector||":root",i=e.colorSchemeSelector;let o=i;if(i==="class"&&(o=".%s"),i==="data"&&(o="[data-%s]"),i!=null&&i.startsWith("data-")&&!i.includes("%s")&&(o=`[${i}="%s"]`),e.defaultColorScheme===t){if(t==="dark"){const a={};return $k(e.cssVarPrefix).forEach(s=>{a[s]=n[s],delete n[s]}),o==="media"?{[r]:n,"@media (prefers-color-scheme: dark)":{[r]:a}}:o?{[o.replace("%s",t)]:a,[`${r}, ${o.replace("%s",t)}`]:n}:{[r]:N(N({},n),a)}}if(o&&o!=="media")return`${r}, ${o.replace("%s",String(t))}`}else if(t){if(o==="media")return{[`@media (prefers-color-scheme: ${String(t)})`]:{[r]:n}};if(o)return o.replace("%s",String(t))}return r};function Fk(e,t){t.forEach(n=>{e[n]||(e[n]={})})}function Z(e,t,n){!e[t]&&n&&(e[t]=n)}function to(e){return typeof e!="string"||!e.startsWith("hsl")?e:fp(e)}function jn(e,t){`${t}Channel`in e||(e[`${t}Channel`]=Xi(to(e[t]),`MUI: Can't create \`palette.${t}Channel\` because \`palette.${t}\` is not one of these formats: #nnn, #nnnnnn, rgb(), rgba(), hsl(), hsla(), color().
|
|
2347
|
+
To suppress this warning, you need to explicitly provide the \`palette.${t}Channel\` as a string (in rgb format, for example "12 12 12") or undefined if you want to remove the channel token.`))}function zk(e){return typeof e=="number"?`${e}px`:typeof e=="string"||typeof e=="function"||Array.isArray(e)?e:"8px"}const yn=e=>{try{return e()}catch(t){}},jk=(e="mui")=>ak(e);function Pc(e,t,n,r){if(!t)return;t=t===!0?{}:t;const i=r==="dark"?"dark":"light";if(!n){e[r]=Mk(Q(N({},t),{palette:N({mode:i},t==null?void 0:t.palette)}));return}const s=_c(Q(N({},n),{palette:N({mode:i},t==null?void 0:t.palette)})),{palette:o}=s,a=We(s,["palette"]);return e[r]=Q(N({},t),{palette:o,opacity:N(N({},Ip(i)),t==null?void 0:t.opacity),overlays:(t==null?void 0:t.overlays)||Sp(i)}),a}function Uk(e={},...t){const D=e,{colorSchemes:n={light:!0},defaultColorScheme:r,disableCssColorScheme:i=!1,cssVarPrefix:o="mui",shouldSkipGeneratingVar:a=Bk,colorSchemeSelector:s=n.light&&n.dark?"media":void 0,rootSelector:l=":root"}=D,c=We(D,["colorSchemes","defaultColorScheme","disableCssColorScheme","cssVarPrefix","shouldSkipGeneratingVar","colorSchemeSelector","rootSelector"]),d=Object.keys(n)[0],f=r||(n.light&&d!=="light"?"light":d),h=jk(o),G=n,{[f]:p,light:m,dark:g}=G,v=We(G,[Ns(f),"light","dark"]),S=N({},v);let I=p;if((f==="dark"&&!("dark"in n)||f==="light"&&!("light"in n))&&(I=!0),!I)throw new Error(yr(21,f));const x=Pc(S,I,c,f);m&&!S.light&&Pc(S,m,void 0,"light"),g&&!S.dark&&Pc(S,g,void 0,"dark");let C=Q(N({defaultColorScheme:f},x),{cssVarPrefix:o,colorSchemeSelector:s,rootSelector:l,getCssVar:h,colorSchemes:S,font:N(N({},yk(x.typography)),x.font),spacing:zk(c.spacing)});Object.keys(C.colorSchemes).forEach(F=>{const T=C.colorSchemes[F].palette,j=Y=>{const z=Y.split("-"),$=z[1],B=z[2];return h(Y,T[$][B])};if(T.mode==="light"&&(Z(T.common,"background","#fff"),Z(T.common,"onBackground","#000")),T.mode==="dark"&&(Z(T.common,"background","#000"),Z(T.common,"onBackground","#fff")),Fk(T,["Alert","AppBar","Avatar","Button","Chip","FilledInput","LinearProgress","Skeleton","Slider","SnackbarContent","SpeedDialAction","StepConnector","StepContent","Switch","TableCell","Tooltip"]),T.mode==="light"){Z(T.Alert,"errorColor",$e(T.error.light,.6)),Z(T.Alert,"infoColor",$e(T.info.light,.6)),Z(T.Alert,"successColor",$e(T.success.light,.6)),Z(T.Alert,"warningColor",$e(T.warning.light,.6)),Z(T.Alert,"errorFilledBg",j("palette-error-main")),Z(T.Alert,"infoFilledBg",j("palette-info-main")),Z(T.Alert,"successFilledBg",j("palette-success-main")),Z(T.Alert,"warningFilledBg",j("palette-warning-main")),Z(T.Alert,"errorFilledColor",yn(()=>T.getContrastText(T.error.main))),Z(T.Alert,"infoFilledColor",yn(()=>T.getContrastText(T.info.main))),Z(T.Alert,"successFilledColor",yn(()=>T.getContrastText(T.success.main))),Z(T.Alert,"warningFilledColor",yn(()=>T.getContrastText(T.warning.main))),Z(T.Alert,"errorStandardBg",Ne(T.error.light,.9)),Z(T.Alert,"infoStandardBg",Ne(T.info.light,.9)),Z(T.Alert,"successStandardBg",Ne(T.success.light,.9)),Z(T.Alert,"warningStandardBg",Ne(T.warning.light,.9)),Z(T.Alert,"errorIconColor",j("palette-error-main")),Z(T.Alert,"infoIconColor",j("palette-info-main")),Z(T.Alert,"successIconColor",j("palette-success-main")),Z(T.Alert,"warningIconColor",j("palette-warning-main")),Z(T.AppBar,"defaultBg",j("palette-grey-100")),Z(T.Avatar,"defaultBg",j("palette-grey-400")),Z(T.Button,"inheritContainedBg",j("palette-grey-300")),Z(T.Button,"inheritContainedHoverBg",j("palette-grey-A100")),Z(T.Chip,"defaultBorder",j("palette-grey-400")),Z(T.Chip,"defaultAvatarColor",j("palette-grey-700")),Z(T.Chip,"defaultIconColor",j("palette-grey-700")),Z(T.FilledInput,"bg","rgba(0, 0, 0, 0.06)"),Z(T.FilledInput,"hoverBg","rgba(0, 0, 0, 0.09)"),Z(T.FilledInput,"disabledBg","rgba(0, 0, 0, 0.12)"),Z(T.LinearProgress,"primaryBg",Ne(T.primary.main,.62)),Z(T.LinearProgress,"secondaryBg",Ne(T.secondary.main,.62)),Z(T.LinearProgress,"errorBg",Ne(T.error.main,.62)),Z(T.LinearProgress,"infoBg",Ne(T.info.main,.62)),Z(T.LinearProgress,"successBg",Ne(T.success.main,.62)),Z(T.LinearProgress,"warningBg",Ne(T.warning.main,.62)),Z(T.Skeleton,"bg",`rgba(${j("palette-text-primaryChannel")} / 0.11)`),Z(T.Slider,"primaryTrack",Ne(T.primary.main,.62)),Z(T.Slider,"secondaryTrack",Ne(T.secondary.main,.62)),Z(T.Slider,"errorTrack",Ne(T.error.main,.62)),Z(T.Slider,"infoTrack",Ne(T.info.main,.62)),Z(T.Slider,"successTrack",Ne(T.success.main,.62)),Z(T.Slider,"warningTrack",Ne(T.warning.main,.62));const Y=Ha(T.background.default,.8);Z(T.SnackbarContent,"bg",Y),Z(T.SnackbarContent,"color",yn(()=>T.getContrastText(Y))),Z(T.SpeedDialAction,"fabHoverBg",Ha(T.background.paper,.15)),Z(T.StepConnector,"border",j("palette-grey-400")),Z(T.StepContent,"border",j("palette-grey-400")),Z(T.Switch,"defaultColor",j("palette-common-white")),Z(T.Switch,"defaultDisabledColor",j("palette-grey-100")),Z(T.Switch,"primaryDisabledColor",Ne(T.primary.main,.62)),Z(T.Switch,"secondaryDisabledColor",Ne(T.secondary.main,.62)),Z(T.Switch,"errorDisabledColor",Ne(T.error.main,.62)),Z(T.Switch,"infoDisabledColor",Ne(T.info.main,.62)),Z(T.Switch,"successDisabledColor",Ne(T.success.main,.62)),Z(T.Switch,"warningDisabledColor",Ne(T.warning.main,.62)),Z(T.TableCell,"border",Ne(Va(T.divider,1),.88)),Z(T.Tooltip,"bg",Va(T.grey[700],.92))}if(T.mode==="dark"){Z(T.Alert,"errorColor",Ne(T.error.light,.6)),Z(T.Alert,"infoColor",Ne(T.info.light,.6)),Z(T.Alert,"successColor",Ne(T.success.light,.6)),Z(T.Alert,"warningColor",Ne(T.warning.light,.6)),Z(T.Alert,"errorFilledBg",j("palette-error-dark")),Z(T.Alert,"infoFilledBg",j("palette-info-dark")),Z(T.Alert,"successFilledBg",j("palette-success-dark")),Z(T.Alert,"warningFilledBg",j("palette-warning-dark")),Z(T.Alert,"errorFilledColor",yn(()=>T.getContrastText(T.error.dark))),Z(T.Alert,"infoFilledColor",yn(()=>T.getContrastText(T.info.dark))),Z(T.Alert,"successFilledColor",yn(()=>T.getContrastText(T.success.dark))),Z(T.Alert,"warningFilledColor",yn(()=>T.getContrastText(T.warning.dark))),Z(T.Alert,"errorStandardBg",$e(T.error.light,.9)),Z(T.Alert,"infoStandardBg",$e(T.info.light,.9)),Z(T.Alert,"successStandardBg",$e(T.success.light,.9)),Z(T.Alert,"warningStandardBg",$e(T.warning.light,.9)),Z(T.Alert,"errorIconColor",j("palette-error-main")),Z(T.Alert,"infoIconColor",j("palette-info-main")),Z(T.Alert,"successIconColor",j("palette-success-main")),Z(T.Alert,"warningIconColor",j("palette-warning-main")),Z(T.AppBar,"defaultBg",j("palette-grey-900")),Z(T.AppBar,"darkBg",j("palette-background-paper")),Z(T.AppBar,"darkColor",j("palette-text-primary")),Z(T.Avatar,"defaultBg",j("palette-grey-600")),Z(T.Button,"inheritContainedBg",j("palette-grey-800")),Z(T.Button,"inheritContainedHoverBg",j("palette-grey-700")),Z(T.Chip,"defaultBorder",j("palette-grey-700")),Z(T.Chip,"defaultAvatarColor",j("palette-grey-300")),Z(T.Chip,"defaultIconColor",j("palette-grey-300")),Z(T.FilledInput,"bg","rgba(255, 255, 255, 0.09)"),Z(T.FilledInput,"hoverBg","rgba(255, 255, 255, 0.13)"),Z(T.FilledInput,"disabledBg","rgba(255, 255, 255, 0.12)"),Z(T.LinearProgress,"primaryBg",$e(T.primary.main,.5)),Z(T.LinearProgress,"secondaryBg",$e(T.secondary.main,.5)),Z(T.LinearProgress,"errorBg",$e(T.error.main,.5)),Z(T.LinearProgress,"infoBg",$e(T.info.main,.5)),Z(T.LinearProgress,"successBg",$e(T.success.main,.5)),Z(T.LinearProgress,"warningBg",$e(T.warning.main,.5)),Z(T.Skeleton,"bg",`rgba(${j("palette-text-primaryChannel")} / 0.13)`),Z(T.Slider,"primaryTrack",$e(T.primary.main,.5)),Z(T.Slider,"secondaryTrack",$e(T.secondary.main,.5)),Z(T.Slider,"errorTrack",$e(T.error.main,.5)),Z(T.Slider,"infoTrack",$e(T.info.main,.5)),Z(T.Slider,"successTrack",$e(T.success.main,.5)),Z(T.Slider,"warningTrack",$e(T.warning.main,.5));const Y=Ha(T.background.default,.98);Z(T.SnackbarContent,"bg",Y),Z(T.SnackbarContent,"color",yn(()=>T.getContrastText(Y))),Z(T.SpeedDialAction,"fabHoverBg",Ha(T.background.paper,.15)),Z(T.StepConnector,"border",j("palette-grey-600")),Z(T.StepContent,"border",j("palette-grey-600")),Z(T.Switch,"defaultColor",j("palette-grey-300")),Z(T.Switch,"defaultDisabledColor",j("palette-grey-600")),Z(T.Switch,"primaryDisabledColor",$e(T.primary.main,.55)),Z(T.Switch,"secondaryDisabledColor",$e(T.secondary.main,.55)),Z(T.Switch,"errorDisabledColor",$e(T.error.main,.55)),Z(T.Switch,"infoDisabledColor",$e(T.info.main,.55)),Z(T.Switch,"successDisabledColor",$e(T.success.main,.55)),Z(T.Switch,"warningDisabledColor",$e(T.warning.main,.55)),Z(T.TableCell,"border",$e(Va(T.divider,1),.68)),Z(T.Tooltip,"bg",Va(T.grey[700],.92))}jn(T.background,"default"),jn(T.background,"paper"),jn(T.common,"background"),jn(T.common,"onBackground"),jn(T,"divider"),Object.keys(T).forEach(Y=>{const z=T[Y];Y!=="tonalOffset"&&z&&typeof z=="object"&&(z.main&&Z(T[Y],"mainChannel",Xi(to(z.main))),z.light&&Z(T[Y],"lightChannel",Xi(to(z.light))),z.dark&&Z(T[Y],"darkChannel",Xi(to(z.dark))),z.contrastText&&Z(T[Y],"contrastTextChannel",Xi(to(z.contrastText))),Y==="text"&&(jn(T[Y],"primary"),jn(T[Y],"secondary")),Y==="action"&&(z.active&&jn(T[Y],"active"),z.selected&&jn(T[Y],"selected")))})}),C=t.reduce((F,T)=>Wt(F,T),C);const y={prefix:o,disableCssColorScheme:i,shouldSkipGeneratingVar:a,getSelector:Nk(C)},{vars:A,generateThemeVars:E,generateStyleSheets:_}=ck(C,y);return C.vars=A,Object.entries(C.colorSchemes[C.defaultColorScheme]).forEach(([F,T])=>{C[F]=T}),C.generateThemeVars=E,C.generateStyleSheets=_,C.generateSpacing=function(){return lp(c.spacing,yc(this))},C.getColorSchemeSelector=uk(s),C.spacing=C.generateSpacing(),C.shouldSkipGeneratingVar=a,C.unstable_sxConfig=N(N({},Fa),c==null?void 0:c.unstable_sxConfig),C.unstable_sx=function(T){return Gr({sx:T,theme:this})},C.toRuntimeSource=wp,C}function Ap(e,t,n){e.colorSchemes&&n&&(e.colorSchemes[t]=Q(N({},n!==!0&&n),{palette:kc(Q(N({},n===!0?{}:n.palette),{mode:t}))}))}function Vk(e={},...t){const d=e,{palette:n,cssVariables:r=!1,colorSchemes:i=n?void 0:{light:!0},defaultColorScheme:o=n==null?void 0:n.mode}=d,a=We(d,["palette","cssVariables","colorSchemes","defaultColorScheme"]),s=o||"light",l=i==null?void 0:i[s],c=N(N({},i),n?{[s]:Q(N({},typeof l!="boolean"&&l),{palette:n})}:void 0);if(r===!1){if(!("colorSchemes"in e))return _c(e,...t);let f=n;"palette"in e||c[s]&&(c[s]!==!0?f=c[s].palette:s==="dark"&&(f={mode:"dark"}));const h=_c(Q(N({},e),{palette:f}),...t);return h.defaultColorScheme=s,h.colorSchemes=c,h.palette.mode==="light"&&(h.colorSchemes.light=Q(N({},c.light!==!0&&c.light),{palette:h.palette}),Ap(h,"dark",c.dark)),h.palette.mode==="dark"&&(h.colorSchemes.dark=Q(N({},c.dark!==!0&&c.dark),{palette:h.palette}),Ap(h,"light",c.light)),h}return!n&&!("light"in c)&&s==="light"&&(c.light=!0),Uk(N(Q(N({},a),{colorSchemes:c,defaultColorScheme:s}),typeof r!="boolean"&&r),...t)}const Hk=Vk(),Wk="$$material";function Gk(e){return e!=="ownerState"&&e!=="theme"&&e!=="sx"&&e!=="as"}const Yk=GE({themeId:Wk,defaultTheme:Hk,rootShouldForwardProp:e=>Gk(e)&&e!=="classes"}),Kk=ok;function qk(e){return ik(e)}function Qk(e){return Xh("MuiSvgIcon",e)}MT("MuiSvgIcon",["root","colorPrimary","colorSecondary","colorAction","colorError","colorDisabled","fontSizeInherit","fontSizeSmall","fontSizeMedium","fontSizeLarge"]);const Jk=e=>{const{color:t,fontSize:n,classes:r}=e,i={root:["root",t!=="inherit"&&`color${Hr(t)}`,`fontSize${Hr(n)}`]};return OT(i,Qk,r)},Xk=Yk("svg",{name:"MuiSvgIcon",slot:"Root",overridesResolver:(e,t)=>{const{ownerState:n}=e;return[t.root,n.color!=="inherit"&&t[`color${Hr(n.color)}`],t[`fontSize${Hr(n.fontSize)}`]]}})(Kk(({theme:e})=>{var t,n,r,i,o,a,s,l,c,d,f,h,p,m,g,v,S,I;return{userSelect:"none",width:"1em",height:"1em",display:"inline-block",flexShrink:0,transition:(o=(t=e.transitions)==null?void 0:t.create)==null?void 0:o.call(t,"fill",{duration:(i=(r=((n=e.vars)!=null?n:e).transitions)==null?void 0:r.duration)==null?void 0:i.shorter}),variants:[{props:x=>!x.hasSvgAsChild,style:{fill:"currentColor"}},{props:{fontSize:"inherit"},style:{fontSize:"inherit"}},{props:{fontSize:"small"},style:{fontSize:((s=(a=e.typography)==null?void 0:a.pxToRem)==null?void 0:s.call(a,20))||"1.25rem"}},{props:{fontSize:"medium"},style:{fontSize:((c=(l=e.typography)==null?void 0:l.pxToRem)==null?void 0:c.call(l,24))||"1.5rem"}},{props:{fontSize:"large"},style:{fontSize:((f=(d=e.typography)==null?void 0:d.pxToRem)==null?void 0:f.call(d,35))||"2.1875rem"}},...Object.entries(((h=e.vars)!=null?h:e).palette).filter(([,x])=>x&&x.main).map(([x])=>{var C,y,A;return{props:{color:x},style:{color:(A=(y=((C=e.vars)!=null?C:e).palette)==null?void 0:y[x])==null?void 0:A.main}}}),{props:{color:"action"},style:{color:(g=(m=((p=e.vars)!=null?p:e).palette)==null?void 0:m.action)==null?void 0:g.active}},{props:{color:"disabled"},style:{color:(I=(S=((v=e.vars)!=null?v:e).palette)==null?void 0:S.action)==null?void 0:I.disabled}},{props:{color:"inherit"},style:{color:void 0}}]}})),Dc=W.forwardRef(function(t,n){const r=qk({props:t,name:"MuiSvgIcon"}),I=r,{children:i,className:o,color:a="inherit",component:s="svg",fontSize:l="medium",htmlColor:c,inheritViewBox:d=!1,titleAccess:f,viewBox:h="0 0 24 24"}=I,p=We(I,["children","className","color","component","fontSize","htmlColor","inheritViewBox","titleAccess","viewBox"]),m=W.isValidElement(i)&&i.type==="svg",g=Q(N({},r),{color:a,component:s,fontSize:l,instanceFontSize:t.fontSize,inheritViewBox:d,viewBox:h,hasSvgAsChild:m}),v={};d||(v.viewBox=h);const S=Jk(g);return u.jsxs(Xk,Q(N(N(N({as:s,className:Mn(S.root,o),focusable:"false",color:c,"aria-hidden":f?void 0:!0,role:f?"img":void 0,ref:n},v),p),m&&i.props),{ownerState:g,children:[m?i.props.children:i,f?u.jsx("title",{children:f}):null]}))});Dc.muiName="SvgIcon";function Ue(e,t){function n(r,i){return u.jsx(Dc,Q(N({"data-testid":`${t}Icon`,ref:i},r),{children:e}))}return n.muiName=Dc.muiName,W.memo(W.forwardRef(n))}const Oc=Ue(u.jsx("path",{d:"M21 19V5c0-1.1-.9-2-2-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2M8.5 13.5l2.5 3.01L14.5 12l4.5 6H5z"}),"Image"),Zk=Ue(u.jsx("path",{d:"M12 3c-4.97 0-9 4.03-9 9s4.03 9 9 9c.83 0 1.5-.67 1.5-1.5 0-.39-.15-.74-.39-1.01-.23-.26-.38-.61-.38-.99 0-.83.67-1.5 1.5-1.5H16c2.76 0 5-2.24 5-5 0-4.42-4.03-8-9-8m-5.5 9c-.83 0-1.5-.67-1.5-1.5S5.67 9 6.5 9 8 9.67 8 10.5 7.33 12 6.5 12m3-4C8.67 8 8 7.33 8 6.5S8.67 5 9.5 5s1.5.67 1.5 1.5S10.33 8 9.5 8m5 0c-.83 0-1.5-.67-1.5-1.5S13.67 5 14.5 5s1.5.67 1.5 1.5S15.33 8 14.5 8m3 4c-.83 0-1.5-.67-1.5-1.5S16.67 9 17.5 9s1.5.67 1.5 1.5-.67 1.5-1.5 1.5"}),"ColorLens"),e_=Ue(u.jsx("path",{d:"M3.9 12c0-1.71 1.39-3.1 3.1-3.1h4V7H7c-2.76 0-5 2.24-5 5s2.24 5 5 5h4v-1.9H7c-1.71 0-3.1-1.39-3.1-3.1M8 13h8v-2H8zm9-6h-4v1.9h4c1.71 0 3.1 1.39 3.1 3.1s-1.39 3.1-3.1 3.1h-4V17h4c2.76 0 5-2.24 5-5s-2.24-5-5-5"}),"Link");function t_(e){return it("MuiTabPanel",e)}Xe("MuiTabPanel",["root","hidden","sizeSm","sizeMd","sizeLg","horizontal","vertical","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const n_=["children","value","component","color","variant","size","slots","slotProps","keepMounted"],r_=e=>{const{hidden:t,size:n,variant:r,color:i,orientation:o}=e,a={root:["root",t&&"hidden",n&&`size${xe(n)}`,o,r&&`variant${xe(r)}`,i&&`color${xe(i)}`,n&&`size${xe(n)}`]};return dt(a,t_,{})},i_=ye("div",{name:"JoyTabPanel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n;return O({display:t.hidden?"none":"block",padding:"var(--Tabs-spacing)",flexGrow:1,fontFamily:e.vars.fontFamily.body},e.typography[`body-${t.size}`],(n=e.variants[t.variant])==null?void 0:n[t.color])}),Xr=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyTabPanel"}),{orientation:i}=va()||{orientation:"horizontal"},o=W.useContext(pc),{children:a,value:s=0,component:l,color:c="neutral",variant:d="plain",size:f,slots:h={},slotProps:p={},keepMounted:m=!1}=r,g=Te(r,n_),{hidden:v,getRootProps:S}=YS(O({},r,{value:s})),I=f!=null?f:o,x=O({},r,{orientation:i,hidden:v,size:I,color:c,variant:d}),C=r_(x),y=O({},g,{component:l,slots:h,slotProps:p}),[A,E]=Se("root",{ref:n,elementType:i_,getSlotProps:S,externalForwardedProps:y,additionalProps:{role:"tabpanel",ref:n,as:l},ownerState:x,className:C.root});return m?u.jsx(A,O({},E,{children:a})):u.jsx(A,O({},E,{children:!v&&a}))});function o_(e){return it("MuiInput",e)}const Tp=Xe("MuiInput",["root","input","formControl","focused","disabled","error","adornedStart","adornedEnd","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid","fullWidth","startDecorator","endDecorator"]),Wa=W.createContext(void 0),a_=["aria-describedby","aria-label","aria-labelledby","autoComplete","autoFocus","className","defaultValue","disabled","disabledInProp","error","id","name","onClick","onChange","onKeyDown","onKeyUp","onFocus","onBlur","placeholder","readOnly","required","type","value"];function s_(e,t){var n;const r=W.useContext(Wa),{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:s,autoFocus:l,className:c,defaultValue:d,disabled:f,disabledInProp:h,error:p,id:m,name:g,onClick:v,onChange:S,onKeyDown:I,onKeyUp:x,onFocus:C,onBlur:y,placeholder:A,readOnly:E,required:_,type:D,value:G}=e,F=Te(e,a_),{getRootProps:T,getInputProps:j,focused:Y,error:z,disabled:$}=lS({disabled:(n=h!=null?h:r==null?void 0:r.disabled)!=null?n:f,defaultValue:d,error:p,onBlur:y,onClick:v,onChange:S,onFocus:C,required:_!=null?_:r==null?void 0:r.required,value:G}),B={[t.disabled]:$,[t.error]:z,[t.focused]:Y,[t.formControl]:!!r,[c]:c},H={[t.disabled]:$};return O({formControl:r,propsToForward:{"aria-describedby":i,"aria-label":o,"aria-labelledby":a,autoComplete:s,autoFocus:l,disabled:$,id:m,onKeyDown:I,onKeyUp:x,name:g,placeholder:A,readOnly:E,type:D},rootStateClasses:B,inputStateClasses:H,getRootProps:T,getInputProps:j,focused:Y,error:z,disabled:$},F)}const Rc=e=>t=>`--${e?`${e}-`:""}${t.replace(/^--/,"")}`,no="data-skip-inverted-colors",Ep=`& :not([${no}], [${no}] *)`,kp=e=>{var t,n,r,i,o,a,s,l,c,d,f,h,p,m,g,v,S,I,x,C,y,A;const E=Rc(e.cssVarPrefix);return{"--variant-plainColor":"var(--variant-plainColor) !important","--variant-plainHoverColor":"var(--variant-plainHoverColor) !important","--variant-plainHoverBg":"var(--variant-plainHoverBg) !important","--variant-plainActiveBg":"var(--variant-plainActiveBg) !important","--variant-plainDisabledColor":"var(--variant-plainDisabledColor) !important","--variant-outlinedColor":"var(--variant-outlinedColor) !important","--variant-outlinedBorder":"var(--variant-outlinedBorder) !important","--variant-outlinedHoverColor":"var(--variant-outlinedHoverColor) !important","--variant-outlinedHoverBorder":"var(--variant-outlinedHoverBorder) !important","--variant-outlinedHoverBg":"var(--variant-outlinedHoverBg) !important","--variant-outlinedActiveBg":"var(--variant-outlinedActiveBg) !important","--variant-outlinedDisabledColor":"var(--variant-outlinedDisabledColor) !important","--variant-outlinedDisabledBorder":"var(--variant-outlinedDisabledBorder) !important","--variant-softColor":"var(--variant-softColor) !important","--variant-softHoverColor":"var(--variant-softHoverColor) !important","--variant-softBg":"var(--variant-softBg) !important","--variant-softHoverBg":"var(--variant-softHoverBg) !important","--variant-softActiveBg":"var(--variant-softActiveBg) !important","--variant-softActiveColor":"var(--variant-softActiveColor) !important","--variant-softDisabledColor":"var(--variant-softDisabledColor) !important","--variant-softDisabledBg":"var(--variant-softDisabledBg) !important","--variant-solidColor":"var(--variant-solidColor) !important","--variant-solidBg":"var(--variant-solidBg) !important","--variant-solidHoverBg":"var(--variant-solidHoverBg) !important","--variant-solidActiveBg":"var(--variant-solidActiveBg) !important","--variant-solidDisabledColor":"var(--variant-solidDisabledColor) !important","--variant-solidDisabledBg":"var(--variant-solidDisabledBg) !important","--Badge-ringColor":"var(--Badge-ringColor) !important",colorScheme:"unset",[e.getColorSchemeSelector("light")]:{[E("--palette-focusVisible")]:`${(t=e.colorSchemes.light)==null?void 0:t.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(n=e.colorSchemes.light)==null?void 0:n.palette.background.body} !important`,[E("--palette-background-surface")]:`${(r=e.colorSchemes.light)==null?void 0:r.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(i=e.colorSchemes.light)==null?void 0:i.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(o=e.colorSchemes.light)==null?void 0:o.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(a=e.colorSchemes.light)==null?void 0:a.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(s=e.colorSchemes.light)==null?void 0:s.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(l=e.colorSchemes.light)==null?void 0:l.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(c=e.colorSchemes.light)==null?void 0:c.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(d=e.colorSchemes.light)==null?void 0:d.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(f=e.colorSchemes.light)==null?void 0:f.palette.divider} !important`},[e.getColorSchemeSelector("dark")]:{[E("--palette-focusVisible")]:`${(h=e.colorSchemes.dark)==null?void 0:h.palette.focusVisible} !important`,[E("--palette-background-body")]:`${(p=e.colorSchemes.dark)==null?void 0:p.palette.background.body} !important`,[E("--palette-background-surface")]:`${(m=e.colorSchemes.dark)==null?void 0:m.palette.background.surface} !important`,[E("--palette-background-popup")]:`${(g=e.colorSchemes.dark)==null?void 0:g.palette.background.popup} !important`,[E("--palette-background-level1")]:`${(v=e.colorSchemes.dark)==null?void 0:v.palette.background.level1} !important`,[E("--palette-background-level2")]:`${(S=e.colorSchemes.dark)==null?void 0:S.palette.background.level2} !important`,[E("--palette-background-level3")]:`${(I=e.colorSchemes.dark)==null?void 0:I.palette.background.level3} !important`,[E("--palette-text-primary")]:`${(x=e.colorSchemes.dark)==null?void 0:x.palette.text.primary} !important`,[E("--palette-text-secondary")]:`${(C=e.colorSchemes.dark)==null?void 0:C.palette.text.secondary} !important`,[E("--palette-text-tertiary")]:`${(y=e.colorSchemes.dark)==null?void 0:y.palette.text.tertiary} !important`,[E("--palette-divider")]:`${(A=e.colorSchemes.dark)==null?void 0:A.palette.divider} !important`}}};function l_(e){return e.theme!==void 0}const c_=e=>t=>{const n=l_(t)?t.theme:t,r=tc(n.cssVarPrefix),i=Rc(n.cssVarPrefix),o=a=>{const s=a.split("-");return r(a,n.palette[s[1]][s[2]])};return{[Ep]:{"--Badge-ringColor":o(`palette-${e}-solidBg`),"--Icon-color":"currentColor",[`${n.getColorSchemeSelector("light")}, ${n.getColorSchemeSelector("dark")}`]:{colorScheme:"dark",[i("--palette-focusVisible")]:o(`palette-${e}-200`),[i("--palette-background-body")]:"rgba(0 0 0 / 0.1)",[i("--palette-background-surface")]:"rgba(0 0 0 / 0.06)",[i("--palette-background-popup")]:o(`palette-${e}-700`),[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.36)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.6)`,[i("--palette-text-primary")]:o("palette-common-white"),[i("--palette-text-secondary")]:o(`palette-${e}-200`),[i("--palette-text-tertiary")]:o(`palette-${e}-300`),[i("--palette-text-icon")]:o(`palette-${e}-200`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainColor":o(`palette-${e}-50`),"--variant-plainHoverColor":"#fff","--variant-plainHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedColor":o(`palette-${e}-50`),"--variant-outlinedBorder":`rgba(${o(`palette-${e}-lightChannel`)} / 0.5)`,"--variant-outlinedHoverColor":"#fff","--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":"rgba(255 255 255 / 0.2)","--variant-softColor":o("palette-common-white"),"--variant-softHoverColor":o("palette-common-white"),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.24)`,"--variant-softHoverBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.36)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.16)`,"--variant-softActiveColor":"#fff","--variant-softDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`,"--variant-solidColor":o(`palette-${e}-${e==="neutral"?"600":"500"}`),"--variant-solidBg":o("palette-common-white"),"--variant-solidHoverBg":o("palette-common-white"),"--variant-solidActiveBg":o(`palette-${e}-100`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.1)`}},[`&, & [${no}]`]:kp(n)}},u_=e=>t=>{const{theme:n=t}=t,r=tc(n.cssVarPrefix),i=Rc(n.cssVarPrefix),o=a=>{const s=a.split("-");return r(a,n.palette[s[1]][s[2]])};return{[Ep]:{"--Badge-ringColor":o(`palette-${e}-softBg`),"--Icon-color":"currentColor",[n.getColorSchemeSelector("dark")]:{[i("--palette-focusVisible")]:o(`palette-${e}-300`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,[i("--palette-text-primary")]:o(`palette-${e}-100`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.72)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-text-icon")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.6)`,[i("--palette-divider")]:`rgba(${o(`palette-${e}-lightChannel`)} / 0.2)`,"--variant-plainColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-plainHoverColor":o(`palette-${e}-50`),"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-lightChannel`)} / 1)`,"--variant-outlinedHoverColor":o(`palette-${e}-50`),"--variant-outlinedBg":"initial","--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverBorder":o(`palette-${e}-600`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.16)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,"--variant-softColor":o(`palette-${e}-200`),"--variant-softBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-softHoverColor":"#fff","--variant-softHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-softActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-solidColor":"#fff","--variant-solidBg":o(`palette-${e}-500`),"--variant-solidHoverColor":"#fff","--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.72)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`},[n.getColorSchemeSelector("light")]:{[i("--palette-focusVisible")]:o(`palette-${e}-500`),[i("--palette-background-body")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.1)`,[i("--palette-background-surface")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,[i("--palette-background-level1")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.2)`,[i("--palette-background-level2")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,[i("--palette-background-level3")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.48)`,[i("--palette-text-primary")]:o(`palette-${e}-700`),[i("--palette-text-secondary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,[i("--palette-text-tertiary")]:`rgba(${o(`palette-${e}-darkChannel`)} / 0.68)`,[i("--palette-text-icon")]:o(`palette-${e}-500`),[i("--palette-divider")]:`rgba(${o(`palette-${e}-mainChannel`)} / 0.32)`,"--variant-plainColor":`rgba(${o(`palette-${e}-darkChannel`)} / 0.8)`,"--variant-plainHoverColor":`rgba(${o(`palette-${e}-darkChannel`)} / 1)`,"--variant-plainHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-plainActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-plainDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedColor":`rgba(${o(`palette-${e}-mainChannel`)} / 1)`,"--variant-outlinedBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.4)`,"--variant-outlinedHoverColor":o(`palette-${e}-600`),"--variant-outlinedHoverBorder":o(`palette-${e}-300`),"--variant-outlinedHoverBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-outlinedActiveBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.24)`,"--variant-outlinedDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-outlinedDisabledBorder":`rgba(${o(`palette-${e}-mainChannel`)} / 0.12)`,"--variant-softColor":o(`palette-${e}-600`),"--variant-softBg":`rgba(${o(`palette-${e}-lightChannel`)} / 0.8)`,"--variant-softHoverColor":o(`palette-${e}-700`),"--variant-softHoverBg":o(`palette-${e}-200`),"--variant-softActiveBg":o(`palette-${e}-300`),"--variant-softDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-softDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`,"--variant-solidColor":o("palette-common-white"),"--variant-solidBg":o(`palette-${e}-${e==="neutral"?"700":"500"}`),"--variant-solidHoverColor":o("palette-common-white"),"--variant-solidHoverBg":o(`palette-${e}-600`),"--variant-solidActiveBg":o(`palette-${e}-600`),"--variant-solidDisabledColor":`rgba(${o(`palette-${e}-mainChannel`)} / 0.6)`,"--variant-solidDisabledBg":`rgba(${o(`palette-${e}-mainChannel`)} / 0.08)`}},[`&, & [${no}]`]:kp(n)}},d_=["propsToForward","rootStateClasses","inputStateClasses","getRootProps","getInputProps","formControl","focused","error","disabled","fullWidth","size","color","variant","startDecorator","endDecorator","component","slots","slotProps"],f_=e=>{const{disabled:t,fullWidth:n,variant:r,color:i,size:o}=e,a={root:["root",t&&"disabled",n&&"fullWidth",r&&`variant${xe(r)}`,i&&`color${xe(i)}`,o&&`size${xe(o)}`],input:["input"],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return dt(a,o_,{})},h_=ye("div")(({theme:e,ownerState:t})=>{var n,r,i,o,a,s;const l=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[O({"--Input-radius":e.vars.radius.sm,"--Input-gap":"0.5rem","--Input-placeholderColor":"inherit","--Input-placeholderOpacity":.64,"--Input-decoratorColor":e.vars.palette.text.icon,"--Input-focused":"0","--Input-focusedThickness":e.vars.focus.thickness,"--Input-focusedHighlight":(r=e.vars.palette[t.color==="neutral"?"primary":t.color])==null?void 0:r[500],[`&:not([${no}])`]:O({},t.instanceColor&&{"--_Input-focusedHighlight":(i=e.vars.palette[t.instanceColor==="neutral"?"primary":t.instanceColor])==null?void 0:i[500]},{"--Input-focusedHighlight":`var(--_Input-focusedHighlight, ${e.vars.palette.focusVisible})`})},t.size==="sm"&&{"--Input-minHeight":"2rem","--Input-paddingInline":"0.5rem","--Input-decoratorChildHeight":"min(1.5rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl},t.size==="md"&&{"--Input-minHeight":"2.25rem","--Input-paddingInline":"0.75rem","--Input-decoratorChildHeight":"min(1.75rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},t.size==="lg"&&{"--Input-minHeight":"2.75rem","--Input-paddingInline":"1rem","--Input-gap":"0.75rem","--Input-decoratorChildHeight":"min(2.25rem, var(--Input-minHeight))","--Icon-fontSize":e.vars.fontSize.xl2},{"--Input-decoratorChildOffset":"min(calc(var(--Input-paddingInline) - (var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2), var(--Input-paddingInline))","--_Input-paddingBlock":"max((var(--Input-minHeight) - 2 * var(--variant-borderWidth, 0px) - var(--Input-decoratorChildHeight)) / 2, 0px)","--Input-decoratorChildRadius":"max(var(--Input-radius) - var(--variant-borderWidth, 0px) - var(--_Input-paddingBlock), min(var(--_Input-paddingBlock) + var(--variant-borderWidth, 0px), var(--Input-radius) / 2))","--Button-minHeight":"var(--Input-decoratorChildHeight)","--Button-paddingBlock":"0px","--IconButton-size":"var(--Input-decoratorChildHeight)","--Button-radius":"var(--Input-decoratorChildRadius)","--IconButton-radius":"var(--Input-decoratorChildRadius)",boxSizing:"border-box"},t.variant!=="plain"&&{boxShadow:e.shadow.xs},{minWidth:0,minHeight:"var(--Input-minHeight)"},t.fullWidth&&{width:"100%"},{cursor:"text",position:"relative",display:"flex",paddingInline:"var(--Input-paddingInline)",borderRadius:"var(--Input-radius)"},e.typography[`body-${t.size}`],l,{backgroundColor:(o=l==null?void 0:l.backgroundColor)!=null?o:e.vars.palette.background.surface,"&::before":{boxSizing:"border-box",content:'""',display:"block",position:"absolute",pointerEvents:"none",top:0,left:0,right:0,bottom:0,zIndex:1,borderRadius:"inherit",margin:"calc(var(--variant-borderWidth, 0px) * -1)",boxShadow:"var(--Input-focusedInset, inset) 0 0 0 calc(var(--Input-focused) * var(--Input-focusedThickness)) var(--Input-focusedHighlight)"}}),{"&:hover":O({},(a=e.variants[`${t.variant}Hover`])==null?void 0:a[t.color],{backgroundColor:null}),[`&.${Tp.disabled}`]:(s=e.variants[`${t.variant}Disabled`])==null?void 0:s[t.color],"&:focus-within::before":{"--Input-focused":"1"}}]}),p_=ye("input")(({ownerState:e})=>({border:"none",minWidth:0,outline:0,padding:0,flex:1,color:"inherit",backgroundColor:"transparent",fontFamily:"inherit",fontSize:"inherit",fontStyle:"inherit",fontWeight:"inherit",lineHeight:"inherit",textOverflow:"ellipsis","&:-webkit-autofill":O({paddingInline:"var(--Input-paddingInline)"},!e.startDecorator&&{marginInlineStart:"calc(-1 * var(--Input-paddingInline))",paddingInlineStart:"var(--Input-paddingInline)",borderTopLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomLeftRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"},!e.endDecorator&&{marginInlineEnd:"calc(-1 * var(--Input-paddingInline))",paddingInlineEnd:"var(--Input-paddingInline)",borderTopRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))",borderBottomRightRadius:"calc(var(--Input-radius) - var(--variant-borderWidth, 0px))"}),"&::-webkit-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-moz-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&:-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"},"&::-ms-input-placeholder":{color:"var(--Input-placeholderColor)",opacity:"var(--Input-placeholderOpacity)"}})),g_=ye("div")({"--Button-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--IconButton-margin":"0 0 0 calc(var(--Input-decoratorChildOffset) * -1)","--Icon-margin":"0 0 0 calc(var(--Input-paddingInline) / -4)",display:"inherit",alignItems:"center",paddingBlock:"var(--unstable_InputPaddingBlock)",flexWrap:"wrap",marginInlineEnd:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),m_=ye("div")({"--Button-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--IconButton-margin":"0 calc(var(--Input-decoratorChildOffset) * -1) 0 0","--Icon-margin":"0 calc(var(--Input-paddingInline) / -4) 0 0",display:"inherit",alignItems:"center",marginInlineStart:"var(--Input-gap)",color:"var(--Input-decoratorColor)",cursor:"initial"}),v_=ye(h_,{name:"JoyInput",slot:"Root",overridesResolver:(e,t)=>t.root})({}),b_=ye(p_,{name:"JoyInput",slot:"Input",overridesResolver:(e,t)=>t.input})({}),y_=ye(g_,{name:"JoyInput",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({}),x_=ye(m_,{name:"JoyInput",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({}),Ga=W.forwardRef(function(t,n){var r,i,o,a,s,l;const c=ft({props:t,name:"JoyInput"}),d=s_(O({},c,{disabledInProp:t.disabled}),Tp),{propsToForward:f,rootStateClasses:h,inputStateClasses:p,getRootProps:m,getInputProps:g,formControl:v,focused:S,error:I=!1,disabled:x,fullWidth:C=!1,size:y="md",color:A="neutral",variant:E="outlined",startDecorator:_,endDecorator:D,component:G,slots:F={},slotProps:T={}}=d,j=Te(d,d_),Y=(r=(i=t.error)!=null?i:v==null?void 0:v.error)!=null?r:I,z=(o=(a=t.size)!=null?a:v==null?void 0:v.size)!=null?o:y,$=(s=t.color)!=null?s:Y?"danger":(l=v==null?void 0:v.color)!=null?l:A,B=O({instanceColor:Y?"danger":t.color},c,{fullWidth:C,color:$,disabled:x,error:Y,focused:S,size:z,variant:E}),H=f_(B),q=O({},j,{component:G,slots:F,slotProps:T}),[ee,R]=Se("root",{ref:n,className:[H.root,h],elementType:v_,getSlotProps:m,externalForwardedProps:q,ownerState:B}),[M,U]=Se("input",O({},v&&{additionalProps:{id:v.htmlFor,"aria-describedby":v["aria-describedby"]}},{className:[H.input,p],elementType:b_,getSlotProps:g,internalForwardedProps:f,externalForwardedProps:q,ownerState:B})),[V,ne]=Se("startDecorator",{className:H.startDecorator,elementType:y_,externalForwardedProps:q,ownerState:B}),[se,ae]=Se("endDecorator",{className:H.endDecorator,elementType:x_,externalForwardedProps:q,ownerState:B});return u.jsxs(ee,O({},R,{children:[_&&u.jsx(V,O({},ne,{children:_})),u.jsx(M,O({},U)),D&&u.jsx(se,O({},ae,{children:D}))]}))}),xn=({label:e,placeholder:t,value:n,defaultValue:r,required:i,size:o,readOnly:a=!1,endDecorator:s=void 0,onChange:l})=>u.jsxs(b.FormControl,{size:o||"md",sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{required:i,color:"primary",children:e}),u.jsx(Ga,{placeholder:t,size:"md",variant:"outlined",color:"neutral",value:n||r,defaultValue:r,readOnly:a,endDecorator:s,onChange:l,sx:{backgroundColor:"#fff",borderRadius:"md"}})]}),_p=Ue(u.jsx("path",{d:"M6 19c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7H6zM19 4h-3.5l-1-1h-5l-1 1H5v2h14z"}),"Delete");function C_(e){return it("MuiCircularProgress",e)}Xe("MuiCircularProgress",["root","determinate","svg","track","progress","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantPlain","variantOutlined","variantSoft","variantSolid"]);let w_=e=>e,Pp;const I_=["color","backgroundColor"],S_=["children","className","color","size","variant","thickness","determinate","value","component","slots","slotProps"],A_=pe.keyframes({"0%":{transform:"rotate(-90deg)"},"100%":{transform:"rotate(270deg)"}}),T_=e=>{const{determinate:t,color:n,variant:r,size:i}=e,o={root:["root",t&&"determinate",n&&`color${xe(n)}`,r&&`variant${xe(r)}`,i&&`size${xe(i)}`],svg:["svg"],track:["track"],progress:["progress"]};return dt(o,C_,{})};function Zr(e,t){return`var(--CircularProgress-${e}Thickness, var(--CircularProgress-thickness, ${t}))`}const E_=ye("span",{name:"JoyCircularProgress",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i,o;const a=((n=t.variants[e.variant])==null?void 0:n[e.color])||{},{color:s,backgroundColor:l}=a,c=Te(a,I_);return O({"--Icon-fontSize":"calc(0.4 * var(--_root-size))","--CircularProgress-trackColor":l,"--CircularProgress-progressColor":s,"--CircularProgress-percent":e.value,"--CircularProgress-linecap":"round"},e.size==="sm"&&{"--_root-size":"var(--CircularProgress-size, 24px)","--_track-thickness":Zr("track","3px"),"--_progress-thickness":Zr("progress","3px")},e.instanceSize==="sm"&&{"--CircularProgress-size":"24px"},e.size==="md"&&{"--_track-thickness":Zr("track","6px"),"--_progress-thickness":Zr("progress","6px"),"--_root-size":"var(--CircularProgress-size, 40px)"},e.instanceSize==="md"&&{"--CircularProgress-size":"40px"},e.size==="lg"&&{"--_track-thickness":Zr("track","8px"),"--_progress-thickness":Zr("progress","8px"),"--_root-size":"var(--CircularProgress-size, 64px)"},e.instanceSize==="lg"&&{"--CircularProgress-size":"64px"},e.thickness&&{"--_track-thickness":`${e.thickness}px`,"--_progress-thickness":`${e.thickness}px`},{"--_thickness-diff":"calc(var(--_track-thickness) - var(--_progress-thickness))","--_inner-size":"calc(var(--_root-size) - 2 * var(--variant-borderWidth, 0px))","--_outlined-inset":"max(var(--_track-thickness), var(--_progress-thickness))",width:"var(--_root-size)",height:"var(--_root-size)",borderRadius:"var(--_root-size)",margin:"var(--CircularProgress-margin)",boxSizing:"border-box",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0,position:"relative",color:s},e.children&&{fontFamily:t.vars.fontFamily.body,fontWeight:t.vars.fontWeight.md,fontSize:"calc(0.2 * var(--_root-size))"},c,e.variant==="outlined"&&{"&::before":O({content:'""',display:"block",position:"absolute",borderRadius:"inherit",top:"var(--_outlined-inset)",left:"var(--_outlined-inset)",right:"var(--_outlined-inset)",bottom:"var(--_outlined-inset)"},c)},e.variant==="soft"&&{"--CircularProgress-trackColor":t.variants.soft.neutral.backgroundColor,"--CircularProgress-progressColor":(r=t.variants.solid)==null?void 0:r[e.color].backgroundColor},e.variant==="solid"&&{"--CircularProgress-trackColor":(i=t.variants.softHover)==null?void 0:i[e.color].backgroundColor,"--CircularProgress-progressColor":(o=t.variants.solid)==null?void 0:o[e.color].backgroundColor})}),k_=ye("svg",{name:"JoyCircularProgress",slot:"Svg",overridesResolver:(e,t)=>t.svg})({width:"inherit",height:"inherit",display:"inherit",boxSizing:"inherit",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))"}),__=ye("circle",{name:"JoyCircularProgress",slot:"track",overridesResolver:(e,t)=>t.track})({cx:"50%",cy:"50%",r:"calc(var(--_inner-size) / 2 - var(--_track-thickness) / 2 + min(0px, var(--_thickness-diff) / 2))",fill:"transparent",strokeWidth:"var(--_track-thickness)",stroke:"var(--CircularProgress-trackColor)"}),P_=ye("circle",{name:"JoyCircularProgress",slot:"progress",overridesResolver:(e,t)=>t.progress})({"--_progress-radius":"calc(var(--_inner-size) / 2 - var(--_progress-thickness) / 2 - max(0px, var(--_thickness-diff) / 2))","--_progress-length":"calc(2 * 3.1415926535 * var(--_progress-radius))",cx:"50%",cy:"50%",r:"var(--_progress-radius)",fill:"transparent",strokeWidth:"var(--_progress-thickness)",stroke:"var(--CircularProgress-progressColor)",strokeLinecap:"var(--CircularProgress-linecap, round)",strokeDasharray:"var(--_progress-length)",strokeDashoffset:"calc(var(--_progress-length) - var(--CircularProgress-percent) * var(--_progress-length) / 100)",transformOrigin:"center",transform:"rotate(-90deg)"},({ownerState:e})=>!e.determinate&&pe.css(Pp||(Pp=w_`
|
|
2348
|
+
animation: var(--CircularProgress-circulation, 0.8s linear 0s infinite normal none running)
|
|
2349
|
+
${0};
|
|
2350
|
+
`),A_)),Dp=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyCircularProgress"}),{children:i,className:o,color:a="primary",size:s="md",variant:l="soft",thickness:c,determinate:d=!1,value:f=d?0:25,component:h,slots:p={},slotProps:m={}}=r,g=Te(r,S_),v=O({},r,{color:a,size:s,variant:l,thickness:c,value:f,determinate:d,instanceSize:t.size}),S=T_(v),I=O({},g,{component:h,slots:p,slotProps:m}),[x,C]=Se("root",{ref:n,className:Mn(S.root,o),elementType:E_,externalForwardedProps:I,ownerState:v,additionalProps:O({role:"progressbar",style:{"--CircularProgress-percent":f}},f&&d&&{"aria-valuenow":Math.round(typeof f=="number"?f:Number(f||0))})}),[y,A]=Se("svg",{className:S.svg,elementType:k_,externalForwardedProps:I,ownerState:v}),[E,_]=Se("track",{className:S.track,elementType:__,externalForwardedProps:I,ownerState:v}),[D,G]=Se("progress",{className:S.progress,elementType:P_,externalForwardedProps:I,ownerState:v});return u.jsxs(x,O({},C,{children:[u.jsxs(y,O({},A,{children:[u.jsx(E,O({},_)),u.jsx(D,O({},G))]})),i]}))});function D_(e){return it("MuiButton",e)}const Op=Xe("MuiButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","fullWidth","startDecorator","endDecorator","loading","loadingIndicatorCenter"]),Rp=W.createContext({}),Lp=W.createContext(void 0),O_=["children","action","color","variant","size","fullWidth","startDecorator","endDecorator","loading","loadingPosition","loadingIndicator","disabled","component","slots","slotProps"],R_=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,fullWidth:o,size:a,variant:s,loading:l}=e,c={root:["root",n&&"disabled",r&&"focusVisible",o&&"fullWidth",s&&`variant${xe(s)}`,t&&`color${xe(t)}`,a&&`size${xe(a)}`,l&&"loading"],startDecorator:["startDecorator"],endDecorator:["endDecorator"],loadingIndicatorCenter:["loadingIndicatorCenter"]},d=dt(c,D_,{});return r&&i&&(d.root+=` ${i}`),d},L_=ye("span",{name:"JoyButton",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({"--Icon-margin":"0 0 0 calc(var(--Button-gap) / -2)","--CircularProgress-margin":"0 0 0 calc(var(--Button-gap) / -2)",display:"inherit",marginRight:"var(--Button-gap)"}),M_=ye("span",{name:"JoyButton",slot:"EndDecorator",overridesResolver:(e,t)=>t.endDecorator})({"--Icon-margin":"0 calc(var(--Button-gap) / -2) 0 0","--CircularProgress-margin":"0 calc(var(--Button-gap) / -2) 0 0",display:"inherit",marginLeft:"var(--Button-gap)"}),B_=ye("span",{name:"JoyButton",slot:"LoadingCenter",overridesResolver:(e,t)=>t.loadingIndicatorCenter})(({theme:e,ownerState:t})=>{var n,r;return O({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),$_=({theme:e,ownerState:t})=>{var n,r,i,o;return[O({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.size==="sm"&&{"--Icon-fontSize":e.vars.fontSize.lg,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.375rem",minHeight:"var(--Button-minHeight, 2rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.25rem)",paddingInline:"0.75rem"},t.size==="md"&&{"--Icon-fontSize":e.vars.fontSize.xl,"--CircularProgress-size":"20px","--CircularProgress-thickness":"2px","--Button-gap":"0.5rem",minHeight:"var(--Button-minHeight, 2.25rem)",fontSize:e.vars.fontSize.sm,paddingBlock:"var(--Button-paddingBlock, 0.375rem)",paddingInline:"1rem"},t.size==="lg"&&{"--Icon-fontSize":e.vars.fontSize.xl2,"--CircularProgress-size":"28px","--CircularProgress-thickness":"4px","--Button-gap":"0.75rem",minHeight:"var(--Button-minHeight, 2.75rem)",fontSize:e.vars.fontSize.md,paddingBlock:"var(--Button-paddingBlock, 0.5rem)",paddingInline:"1.5rem"},{WebkitTapHighlightColor:"transparent",boxSizing:"border-box",borderRadius:`var(--Button-radius, ${e.vars.radius.sm})`,margin:"var(--Button-margin)",border:"none",backgroundColor:"transparent",cursor:"pointer",userSelect:"none",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",textDecoration:"none",fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.lg,lineHeight:e.vars.lineHeight.md},t.fullWidth&&{width:"100%"},{[e.focus.selector]:e.focus.default}),O({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},'&:active, &[aria-pressed="true"]':(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color],[`&.${Op.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]},t.loadingPosition==="center"&&{[`&.${Op.loading}`]:{color:"transparent"}})]},N_=ye("button",{name:"JoyButton",slot:"Root",overridesResolver:(e,t)=>t.root})($_),ei=W.forwardRef(function(t,n){var r;const i=ft({props:t,name:"JoyButton"}),{children:o,action:a,color:s="primary",variant:l="solid",size:c="md",fullWidth:d=!1,startDecorator:f,endDecorator:h,loading:p=!1,loadingPosition:m="center",loadingIndicator:g,disabled:v,component:S,slots:I={},slotProps:x={}}=i,C=Te(i,O_),y=W.useContext(Rp),A=W.useContext(Lp),E=t.variant||y.variant||l,_=t.size||y.size||c,D=t.color||y.color||s,G=(r=t.loading||t.disabled)!=null?r:y.disabled||p||v,F=W.useRef(null),T=sn(F,n),{focusVisible:j,setFocusVisible:Y,getRootProps:z}=Ul(O({},i,{disabled:G,rootRef:T})),$=g!=null?g:u.jsx(Dp,{color:D,thickness:{sm:2,md:3,lg:4}[_]||3});W.useImperativeHandle(a,()=>({focusVisible:()=>{var re;Y(!0),(re=F.current)==null||re.focus()}}),[Y]);const B=O({},i,{color:D,fullWidth:d,variant:E,size:_,focusVisible:j,loading:p,loadingPosition:m,disabled:G}),H=R_(B),q=re=>{var ge;let Ae=i.onClick;if(typeof x.root=="function"?Ae=x.root(B).onClick:x.root&&(Ae=x.root.onClick),(ge=Ae)==null||ge(re),A){var Ve;(Ve=A.onClick)==null||Ve.call(A,re,i.value)}};let ee=i["aria-pressed"];typeof x.root=="function"?ee=x.root(B)["aria-pressed"]:x.root&&(ee=x.root["aria-pressed"]),A!=null&&A.value&&(Array.isArray(A.value)?ee=A.value.indexOf(i.value)!==-1:ee=A.value===i.value);const R=O({},C,{component:S,slots:I,slotProps:x}),[M,U]=Se("root",{ref:n,className:H.root,elementType:N_,externalForwardedProps:R,getSlotProps:z,ownerState:B,additionalProps:{onClick:q,"aria-pressed":ee}}),[V,ne]=Se("startDecorator",{className:H.startDecorator,elementType:L_,externalForwardedProps:R,ownerState:B}),[se,ae]=Se("endDecorator",{className:H.endDecorator,elementType:M_,externalForwardedProps:R,ownerState:B}),[X,le]=Se("loadingIndicatorCenter",{className:H.loadingIndicatorCenter,elementType:B_,externalForwardedProps:R,ownerState:B});return u.jsxs(M,O({},U,{children:[(f||p&&m==="start")&&u.jsx(V,O({},ne,{children:p&&m==="start"?$:f})),o,p&&m==="center"&&u.jsx(X,O({},le,{children:$})),(h||p&&m==="end")&&u.jsx(se,O({},ae,{children:p&&m==="end"?$:h}))]}))});ei.muiName="Button";var Mp={exports:{}};function F_(e){throw new Error('Could not dynamically require "'+e+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Lc={exports:{}};const z_=zu(Object.freeze(Object.defineProperty({__proto__:null,default:{}},Symbol.toStringTag,{value:"Module"})));var Bp;function Mc(){return Bp||(Bp=1,function(e,t){(function(n,r){e.exports=r()})(Bt,function(){var n=n||function(r,i){var o;if(typeof window!="undefined"&&window.crypto&&(o=window.crypto),typeof self!="undefined"&&self.crypto&&(o=self.crypto),typeof globalThis!="undefined"&&globalThis.crypto&&(o=globalThis.crypto),!o&&typeof window!="undefined"&&window.msCrypto&&(o=window.msCrypto),!o&&typeof Bt!="undefined"&&Bt.crypto&&(o=Bt.crypto),!o&&typeof F_=="function")try{o=z_}catch(I){}var a=function(){if(o){if(typeof o.getRandomValues=="function")try{return o.getRandomValues(new Uint32Array(1))[0]}catch(I){}if(typeof o.randomBytes=="function")try{return o.randomBytes(4).readInt32LE()}catch(I){}}throw new Error("Native crypto module could not be used to get secure random number.")},s=Object.create||function(){function I(){}return function(x){var C;return I.prototype=x,C=new I,I.prototype=null,C}}(),l={},c=l.lib={},d=c.Base=function(){return{extend:function(I){var x=s(this);return I&&x.mixIn(I),(!x.hasOwnProperty("init")||this.init===x.init)&&(x.init=function(){x.$super.init.apply(this,arguments)}),x.init.prototype=x,x.$super=this,x},create:function(){var I=this.extend();return I.init.apply(I,arguments),I},init:function(){},mixIn:function(I){for(var x in I)I.hasOwnProperty(x)&&(this[x]=I[x]);I.hasOwnProperty("toString")&&(this.toString=I.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),f=c.WordArray=d.extend({init:function(I,x){I=this.words=I||[],x!=i?this.sigBytes=x:this.sigBytes=I.length*4},toString:function(I){return(I||p).stringify(this)},concat:function(I){var x=this.words,C=I.words,y=this.sigBytes,A=I.sigBytes;if(this.clamp(),y%4)for(var E=0;E<A;E++){var _=C[E>>>2]>>>24-E%4*8&255;x[y+E>>>2]|=_<<24-(y+E)%4*8}else for(var D=0;D<A;D+=4)x[y+D>>>2]=C[D>>>2];return this.sigBytes+=A,this},clamp:function(){var I=this.words,x=this.sigBytes;I[x>>>2]&=4294967295<<32-x%4*8,I.length=r.ceil(x/4)},clone:function(){var I=d.clone.call(this);return I.words=this.words.slice(0),I},random:function(I){for(var x=[],C=0;C<I;C+=4)x.push(a());return new f.init(x,I)}}),h=l.enc={},p=h.Hex={stringify:function(I){for(var x=I.words,C=I.sigBytes,y=[],A=0;A<C;A++){var E=x[A>>>2]>>>24-A%4*8&255;y.push((E>>>4).toString(16)),y.push((E&15).toString(16))}return y.join("")},parse:function(I){for(var x=I.length,C=[],y=0;y<x;y+=2)C[y>>>3]|=parseInt(I.substr(y,2),16)<<24-y%8*4;return new f.init(C,x/2)}},m=h.Latin1={stringify:function(I){for(var x=I.words,C=I.sigBytes,y=[],A=0;A<C;A++){var E=x[A>>>2]>>>24-A%4*8&255;y.push(String.fromCharCode(E))}return y.join("")},parse:function(I){for(var x=I.length,C=[],y=0;y<x;y++)C[y>>>2]|=(I.charCodeAt(y)&255)<<24-y%4*8;return new f.init(C,x)}},g=h.Utf8={stringify:function(I){try{return decodeURIComponent(escape(m.stringify(I)))}catch(x){throw new Error("Malformed UTF-8 data")}},parse:function(I){return m.parse(unescape(encodeURIComponent(I)))}},v=c.BufferedBlockAlgorithm=d.extend({reset:function(){this._data=new f.init,this._nDataBytes=0},_append:function(I){typeof I=="string"&&(I=g.parse(I)),this._data.concat(I),this._nDataBytes+=I.sigBytes},_process:function(I){var x,C=this._data,y=C.words,A=C.sigBytes,E=this.blockSize,_=E*4,D=A/_;I?D=r.ceil(D):D=r.max((D|0)-this._minBufferSize,0);var G=D*E,F=r.min(G*4,A);if(G){for(var T=0;T<G;T+=E)this._doProcessBlock(y,T);x=y.splice(0,G),C.sigBytes-=F}return new f.init(x,F)},clone:function(){var I=d.clone.call(this);return I._data=this._data.clone(),I},_minBufferSize:0});c.Hasher=v.extend({cfg:d.extend(),init:function(I){this.cfg=this.cfg.extend(I),this.reset()},reset:function(){v.reset.call(this),this._doReset()},update:function(I){return this._append(I),this._process(),this},finalize:function(I){I&&this._append(I);var x=this._doFinalize();return x},blockSize:16,_createHelper:function(I){return function(x,C){return new I.init(C).finalize(x)}},_createHmacHelper:function(I){return function(x,C){return new S.HMAC.init(I,C).finalize(x)}}});var S=l.algo={};return l}(Math);return n})}(Lc)),Lc.exports}(function(e,t){(function(n,r){e.exports=r(Mc())})(Bt,function(n){return function(r){var i=n,o=i.lib,a=o.WordArray,s=o.Hasher,l=i.algo,c=[];(function(){for(var g=0;g<64;g++)c[g]=r.abs(r.sin(g+1))*4294967296|0})();var d=l.MD5=s.extend({_doReset:function(){this._hash=new a.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(g,v){for(var S=0;S<16;S++){var I=v+S,x=g[I];g[I]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360}var C=this._hash.words,y=g[v+0],A=g[v+1],E=g[v+2],_=g[v+3],D=g[v+4],G=g[v+5],F=g[v+6],T=g[v+7],j=g[v+8],Y=g[v+9],z=g[v+10],$=g[v+11],B=g[v+12],H=g[v+13],q=g[v+14],ee=g[v+15],R=C[0],M=C[1],U=C[2],V=C[3];R=f(R,M,U,V,y,7,c[0]),V=f(V,R,M,U,A,12,c[1]),U=f(U,V,R,M,E,17,c[2]),M=f(M,U,V,R,_,22,c[3]),R=f(R,M,U,V,D,7,c[4]),V=f(V,R,M,U,G,12,c[5]),U=f(U,V,R,M,F,17,c[6]),M=f(M,U,V,R,T,22,c[7]),R=f(R,M,U,V,j,7,c[8]),V=f(V,R,M,U,Y,12,c[9]),U=f(U,V,R,M,z,17,c[10]),M=f(M,U,V,R,$,22,c[11]),R=f(R,M,U,V,B,7,c[12]),V=f(V,R,M,U,H,12,c[13]),U=f(U,V,R,M,q,17,c[14]),M=f(M,U,V,R,ee,22,c[15]),R=h(R,M,U,V,A,5,c[16]),V=h(V,R,M,U,F,9,c[17]),U=h(U,V,R,M,$,14,c[18]),M=h(M,U,V,R,y,20,c[19]),R=h(R,M,U,V,G,5,c[20]),V=h(V,R,M,U,z,9,c[21]),U=h(U,V,R,M,ee,14,c[22]),M=h(M,U,V,R,D,20,c[23]),R=h(R,M,U,V,Y,5,c[24]),V=h(V,R,M,U,q,9,c[25]),U=h(U,V,R,M,_,14,c[26]),M=h(M,U,V,R,j,20,c[27]),R=h(R,M,U,V,H,5,c[28]),V=h(V,R,M,U,E,9,c[29]),U=h(U,V,R,M,T,14,c[30]),M=h(M,U,V,R,B,20,c[31]),R=p(R,M,U,V,G,4,c[32]),V=p(V,R,M,U,j,11,c[33]),U=p(U,V,R,M,$,16,c[34]),M=p(M,U,V,R,q,23,c[35]),R=p(R,M,U,V,A,4,c[36]),V=p(V,R,M,U,D,11,c[37]),U=p(U,V,R,M,T,16,c[38]),M=p(M,U,V,R,z,23,c[39]),R=p(R,M,U,V,H,4,c[40]),V=p(V,R,M,U,y,11,c[41]),U=p(U,V,R,M,_,16,c[42]),M=p(M,U,V,R,F,23,c[43]),R=p(R,M,U,V,Y,4,c[44]),V=p(V,R,M,U,B,11,c[45]),U=p(U,V,R,M,ee,16,c[46]),M=p(M,U,V,R,E,23,c[47]),R=m(R,M,U,V,y,6,c[48]),V=m(V,R,M,U,T,10,c[49]),U=m(U,V,R,M,q,15,c[50]),M=m(M,U,V,R,G,21,c[51]),R=m(R,M,U,V,B,6,c[52]),V=m(V,R,M,U,_,10,c[53]),U=m(U,V,R,M,z,15,c[54]),M=m(M,U,V,R,A,21,c[55]),R=m(R,M,U,V,j,6,c[56]),V=m(V,R,M,U,ee,10,c[57]),U=m(U,V,R,M,F,15,c[58]),M=m(M,U,V,R,H,21,c[59]),R=m(R,M,U,V,D,6,c[60]),V=m(V,R,M,U,$,10,c[61]),U=m(U,V,R,M,E,15,c[62]),M=m(M,U,V,R,Y,21,c[63]),C[0]=C[0]+R|0,C[1]=C[1]+M|0,C[2]=C[2]+U|0,C[3]=C[3]+V|0},_doFinalize:function(){var g=this._data,v=g.words,S=this._nDataBytes*8,I=g.sigBytes*8;v[I>>>5]|=128<<24-I%32;var x=r.floor(S/4294967296),C=S;v[(I+64>>>9<<4)+15]=(x<<8|x>>>24)&16711935|(x<<24|x>>>8)&4278255360,v[(I+64>>>9<<4)+14]=(C<<8|C>>>24)&16711935|(C<<24|C>>>8)&4278255360,g.sigBytes=(v.length+1)*4,this._process();for(var y=this._hash,A=y.words,E=0;E<4;E++){var _=A[E];A[E]=(_<<8|_>>>24)&16711935|(_<<24|_>>>8)&4278255360}return y},clone:function(){var g=s.clone.call(this);return g._hash=this._hash.clone(),g}});function f(g,v,S,I,x,C,y){var A=g+(v&S|~v&I)+x+y;return(A<<C|A>>>32-C)+v}function h(g,v,S,I,x,C,y){var A=g+(v&I|S&~I)+x+y;return(A<<C|A>>>32-C)+v}function p(g,v,S,I,x,C,y){var A=g+(v^S^I)+x+y;return(A<<C|A>>>32-C)+v}function m(g,v,S,I,x,C,y){var A=g+(S^(v|~I))+x+y;return(A<<C|A>>>32-C)+v}i.MD5=s._createHelper(d),i.HmacMD5=s._createHmacHelper(d)}(Math),n.MD5})})(Mp);var j_=Mp.exports;const $p=fn(j_);var Np={exports:{}};(function(e,t){(function(n,r){e.exports=r(Mc())})(Bt,function(n){return function(){if(typeof ArrayBuffer=="function"){var r=n,i=r.lib,o=i.WordArray,a=o.init,s=o.init=function(l){if(l instanceof ArrayBuffer&&(l=new Uint8Array(l)),(l instanceof Int8Array||typeof Uint8ClampedArray!="undefined"&&l instanceof Uint8ClampedArray||l instanceof Int16Array||l instanceof Uint16Array||l instanceof Int32Array||l instanceof Uint32Array||l instanceof Float32Array||l instanceof Float64Array)&&(l=new Uint8Array(l.buffer,l.byteOffset,l.byteLength)),l instanceof Uint8Array){for(var c=l.byteLength,d=[],f=0;f<c;f++)d[f>>>2]|=l[f]<<24-f%4*8;a.call(this,d,c)}else a.apply(this,arguments)};s.prototype=o}}(),n.lib.WordArray})})(Np);var U_=Np.exports;const Fp=fn(U_);var zp={exports:{}};(function(e,t){(function(n,r){e.exports=r(Mc())})(Bt,function(n){return function(){var r=n,i=r.lib,o=i.WordArray,a=r.enc;a.Base64={stringify:function(l){var c=l.words,d=l.sigBytes,f=this._map;l.clamp();for(var h=[],p=0;p<d;p+=3)for(var m=c[p>>>2]>>>24-p%4*8&255,g=c[p+1>>>2]>>>24-(p+1)%4*8&255,v=c[p+2>>>2]>>>24-(p+2)%4*8&255,S=m<<16|g<<8|v,I=0;I<4&&p+I*.75<d;I++)h.push(f.charAt(S>>>6*(3-I)&63));var x=f.charAt(64);if(x)for(;h.length%4;)h.push(x);return h.join("")},parse:function(l){var c=l.length,d=this._map,f=this._reverseMap;if(!f){f=this._reverseMap=[];for(var h=0;h<d.length;h++)f[d.charCodeAt(h)]=h}var p=d.charAt(64);if(p){var m=l.indexOf(p);m!==-1&&(c=m)}return s(l,c,f)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="};function s(l,c,d){for(var f=[],h=0,p=0;p<c;p++)if(p%4){var m=d[l.charCodeAt(p-1)]<<p%4*2,g=d[l.charCodeAt(p)]>>>6-p%4*2,v=m|g;f[h>>>2]|=v<<24-h%4*8,h++}return o.create(f,h)}}(),n.enc.Base64})})(zp);var V_=zp.exports;const H_=fn(V_);class jp{constructor(){te(this,"readFileAndHash",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,s=Fp.create(new Uint8Array(a)),c=$p(s).toString(H_);n(c)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}));te(this,"generateHashFileName",t=>new Promise((n,r)=>{const i=new FileReader;i.onload=o=>{const a=o.target.result,s=Fp.create(new Uint8Array(a)),l=$p(s).toString();n(l)},i.onerror=o=>{r(o)},i.readAsArrayBuffer(t)}))}}const Up=({title:e,open:t,imageSrc:n,toggleModal:r})=>u.jsx(b.Modal,{open:t,onClose:r,children:u.jsxs(b.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[u.jsx(b.ModalClose,{}),u.jsx(b.DialogTitle,{sx:{marginBottom:"10px"},children:e}),u.jsx(b.DialogContent,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:u.jsx("img",{src:n,alt:"Image modal",style:{maxWidth:"100%",maxHeight:"100%"}})})]})}),Vp=Ue(u.jsx("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6z"}),"Add"),at=()=>{const e=w.useContext(ea);if(!e)throw new Error("useAPIContext must be used within a APIProvider");return e},W_=Ue(u.jsx("path",{d:"M10 18h4v-2h-4zM3 6v2h18V6zm3 7h12v-2H6z"}),"FilterList"),G_=({isLoading:e,images:t,onClick:n})=>u.jsxs(u.Fragment,{children:[u.jsx(b.Grid,{container:!0,spacing:2,children:t.map(r=>{var i,o;return u.jsx(b.Grid,{xs:5,sm:4,md:3,children:u.jsxs(b.Box,{sx:{position:"relative",width:"100%","&:hover .overlay":{backgroundColor:"rgba(0, 0, 0, 0.5)",opacity:1},"&:hover .plusSign":{opacity:1}},onClick:()=>{var a,s;return n(((s=(a=r.urls)==null?void 0:a.uploaded)==null?void 0:s.embed)||"")},children:[u.jsx(b.Box,{component:"img",src:(o=(i=r.urls)==null?void 0:i.uploaded)==null?void 0:o.thumbnail,alt:`image-${r.id}`,sx:{width:"100%",height:"auto",borderRadius:"8px"}}),u.jsx(b.Box,{className:"overlay",sx:{position:"absolute",top:0,left:0,right:0,bottom:5,display:"flex",justifyContent:"center",alignItems:"center",backgroundColor:"rgba(0, 0, 0, 0)",opacity:0,transition:"background-color 0.3s ease, opacity 0.3s ease",borderRadius:"8px",cursor:"pointer"},children:u.jsx(b.Typography,{className:"plusSign",level:"h2",sx:{color:"white",opacity:0,transition:"opacity 0.3s ease"},children:"+"})})]})},`sportal-image-${r.id}`)})}),e?u.jsx(b.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%"},children:u.jsx(b.CircularProgress,{variant:"solid",color:"neutral"})}):u.jsx(u.Fragment,{})]}),Y_=Ue(u.jsx("path",{d:"M15.41 7.41 14 6l-6 6 6 6 1.41-1.41L10.83 12z"}),"ChevronLeft"),K_=Ue(u.jsx("path",{d:"M10 6 8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z"}),"ChevronRight"),q_=e=>u.jsx(b.Box,{display:"flex",alignItems:"baseline",flexWrap:"wrap",children:u.jsxs(b.Box,{display:"flex",children:[e.pageCount&&e.pageCount!==1&&u.jsx(b.Button,{variant:"outlined",color:"neutral",startDecorator:u.jsx(Y_,{}),onClick:e.getPreviousPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:"4px 0 0 4px",borderRight:0,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.previous}),e.images&&e.images.length===20&&u.jsx(b.Button,{variant:"outlined",color:"neutral",endDecorator:u.jsx(K_,{}),onClick:e.getNextPage,sx:{textTransform:"none",fontSize:"14px",fontWeight:"bold",paddingX:2,paddingY:1,borderRadius:e.pageCount!==1?"0 4px 4px 0":"4px",borderLeft:e.pageCount!==1?0:1,"&:hover":{backgroundColor:"background.level1"}},children:e.labels.next})]})}),ti=Ue(u.jsx("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m1 15h-2v-6h2zm0-8h-2V7h2z"}),"Info"),Q_=Ue(u.jsx("path",{d:"M1 21h22L12 2zm12-3h-2v-2h2zm0-4h-2v-4h2z"}),"Warning"),J_=({color:e})=>e==="warning"?u.jsx(Q_,{}):u.jsx(ti,{}),st=e=>u.jsx(b.Snackbar,{anchorOrigin:{vertical:"top",horizontal:"right"},open:e.showToast,onClose:e.hideToast,autoHideDuration:3e3,color:e.color,startDecorator:u.jsx(J_,{color:e.color}),children:e.message},e.message),ro=({label:e,defaultValue:t,required:n,onChange:r})=>{const i=o=>{r(o.target.value)};return u.jsxs(b.FormControl,{sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{required:n,color:"primary",children:e}),u.jsx(b.Input,{type:"date",defaultValue:t,onChange:i,sx:{backgroundColor:"#fff",borderRadius:"md"}})]})},X_=({labels:e,showFilters:t,onClick:n})=>u.jsx(b.Tooltip,{title:t?e.hideFilters:e.showFilters,children:u.jsx(b.IconButton,{"aria-label":"Filters",onClick:n,children:u.jsx(W_,{})})}),Hp=({labels:e,onChangeImages:t})=>{const[n,r]=w.useState(!1),[i,o]=w.useState(!1),[a,s]=w.useState(!1),[l,c]=w.useState(!1),[d,f]=w.useState(1),[h,p]=w.useState(""),[m,g]=w.useState(null),[v,S]=w.useState([]),{https:I}=at();w.useEffect(()=>{E()},[d]);const x=()=>c(!l),C=()=>f(D=>D-1),y=()=>f(D=>D+1),A=()=>k(this,null,function*(){if(h){o(!0);const D=m?N({},m):null,G=yield I.fetchImagesFromSportal365(h,D,d);if(G){const F=yield G.json();G.ok?(S(F.data),f(F.meta.pagination.current_page)):(console.error(F),x())}o(!1)}else S([])}),E=()=>k(this,null,function*(){if(h){s(!0),S([]);const D=m&&m.from&&m.to?N({},m):null,G=yield I.fetchImagesFromSportal365(h,D,d);if(G){const F=yield G.json();G.ok?(S(F.data),f(F.meta.pagination.current_page)):(console.error(F),x())}s(!1)}}),_=(D,G)=>{g(F=>F?Q(N({},F),{[G]:D}):{[G]:D})};return u.jsxs(u.Fragment,{children:[u.jsxs(b.Box,{sx:{marginBottom:"10px"},children:[u.jsx(b.Input,{value:h,onChange:D=>p(D.target.value),sx:{mb:2,width:"100%"},placeholder:e.searchImage,endDecorator:u.jsx(X_,{labels:e,showFilters:n,onClick:()=>r(!n)})}),n?u.jsxs(b.Grid,{container:!0,spacing:2,children:[u.jsx(b.Grid,{xs:6,children:u.jsx(ro,{label:e.fromDate,defaultValue:m==null?void 0:m.from,required:!1,onChange:D=>_(D,"from")})}),u.jsx(b.Grid,{xs:6,children:u.jsx(ro,{label:e.toDate,defaultValue:m==null?void 0:m.to,required:!1,onChange:D=>_(D,"to")})})]}):u.jsx(u.Fragment,{}),u.jsx(b.Button,{onClick:A,sx:{mb:2,backgroundColor:"#ef8b34","&:hover":{backgroundColor:"#d7772e"},"&:active":{backgroundColor:"#c06c29"}},loading:i,children:e.search}),u.jsx(G_,{images:v,isLoading:a,onClick:t}),u.jsx(q_,{labels:e,pageCount:d,images:v,getPreviousPage:C,getNextPage:y})]}),u.jsx(st,{showToast:l,message:e.searchSportal365ImagesErrorMessage,color:"danger",hideToast:x})]})},Wp=Ue(u.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.49 2 2 6.49 2 12s4.49 10 10 10h8c1.1 0 2-.9 2-2v-8c0-5.51-4.49-10-10-10m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"Loupe"),Gp=b.styled("input")`
|
|
2351
|
+
clip: rect(0 0 0 0);
|
|
2352
|
+
clip-path: inset(50%);
|
|
2353
|
+
height: 1px;
|
|
2354
|
+
overflow: hidden;
|
|
2355
|
+
position: absolute;
|
|
2356
|
+
bottom: 0;
|
|
2357
|
+
left: 0;
|
|
2358
|
+
white-space: nowrap;
|
|
2359
|
+
width: 1px;
|
|
2360
|
+
`;var Yp=!1,xr,Bc,$c,Ya,Ka,Kp,qa,Nc,Fc,zc,qp,jc,Uc,Qp,Jp;function Ft(){if(!Yp){Yp=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),n=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(jc=/\b(iPhone|iP[ao]d)/.exec(e),Uc=/\b(iP[ao]d)/.exec(e),zc=/Android/i.exec(e),Qp=/FBAN\/\w+;/i.exec(e),Jp=/Mobile/i.exec(e),qp=!!/Win64/.exec(e),t){xr=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN,xr&&document&&document.documentMode&&(xr=document.documentMode);var r=/(?:Trident\/(\d+.\d+))/.exec(e);Kp=r?parseFloat(r[1])+4:xr,Bc=t[2]?parseFloat(t[2]):NaN,$c=t[3]?parseFloat(t[3]):NaN,Ya=t[4]?parseFloat(t[4]):NaN,Ya?(t=/(?:Chrome\/(\d+\.\d+))/.exec(e),Ka=t&&t[1]?parseFloat(t[1]):NaN):Ka=NaN}else xr=Bc=$c=Ka=Ya=NaN;if(n){if(n[1]){var i=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);qa=i?parseFloat(i[1].replace("_",".")):!0}else qa=!1;Nc=!!n[2],Fc=!!n[3]}else qa=Nc=Fc=!1}}var Vc={ie:function(){return Ft()||xr},ieCompatibilityMode:function(){return Ft()||Kp>xr},ie64:function(){return Vc.ie()&&qp},firefox:function(){return Ft()||Bc},opera:function(){return Ft()||$c},webkit:function(){return Ft()||Ya},safari:function(){return Vc.webkit()},chrome:function(){return Ft()||Ka},windows:function(){return Ft()||Nc},osx:function(){return Ft()||qa},linux:function(){return Ft()||Fc},iphone:function(){return Ft()||jc},mobile:function(){return Ft()||jc||Uc||zc||Jp},nativeApp:function(){return Ft()||Qp},android:function(){return Ft()||zc},ipad:function(){return Ft()||Uc}},Z_=Vc,Qa=!!(typeof window!="undefined"&&window.document&&window.document.createElement),eP={canUseDOM:Qa,canUseWorkers:typeof Worker!="undefined",canUseEventListeners:Qa&&!!(window.addEventListener||window.attachEvent),canUseViewport:Qa&&!!window.screen,isInWorker:!Qa},tP=eP,Xp=tP,Zp;Xp.canUseDOM&&(Zp=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/**
|
|
2361
|
+
* Checks if an event is supported in the current execution environment.
|
|
2362
|
+
*
|
|
2363
|
+
* NOTE: This will not work correctly for non-generic events such as `change`,
|
|
2364
|
+
* `reset`, `load`, `error`, and `select`.
|
|
2365
|
+
*
|
|
2366
|
+
* Borrows from Modernizr.
|
|
2367
|
+
*
|
|
2368
|
+
* @param {string} eventNameSuffix Event name, e.g. "click".
|
|
2369
|
+
* @param {?boolean} capture Check if the capture phase is supported.
|
|
2370
|
+
* @return {boolean} True if the event is supported.
|
|
2371
|
+
* @internal
|
|
2372
|
+
* @license Modernizr 3.0.0pre (Custom Build) | MIT
|
|
2373
|
+
*/function nP(e,t){if(!Xp.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var i=document.createElement("div");i.setAttribute(n,"return;"),r=typeof i[n]=="function"}return!r&&Zp&&e==="wheel"&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var rP=nP,iP=Z_,oP=rP,eg=10,tg=40,ng=800;function rg(e){var t=0,n=0,r=0,i=0;return"detail"in e&&(n=e.detail),"wheelDelta"in e&&(n=-e.wheelDelta/120),"wheelDeltaY"in e&&(n=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=n,n=0),r=t*eg,i=n*eg,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||i)&&e.deltaMode&&(e.deltaMode==1?(r*=tg,i*=tg):(r*=ng,i*=ng)),r&&!t&&(t=r<1?-1:1),i&&!n&&(n=i<1?-1:1),{spinX:t,spinY:n,pixelX:r,pixelY:i}}rg.getEventType=function(){return iP.firefox()?"DOMMouseScroll":oP("wheel")?"wheel":"mousewheel"};var aP=rg,sP=aP;const lP=fn(sP);function cP(e,t,n,r,i,o){o===void 0&&(o=0);var a=ni(e,t,o),s=a.width,l=a.height,c=Math.min(s,n),d=Math.min(l,r);return c>d*i?{width:d*i,height:d}:{width:c,height:c/i}}function uP(e){return e.width>e.height?e.width/e.naturalWidth:e.height/e.naturalHeight}function Ja(e,t,n,r,i){i===void 0&&(i=0);var o=ni(t.width,t.height,i),a=o.width,s=o.height;return{x:ig(e.x,a,n.width,r),y:ig(e.y,s,n.height,r)}}function ig(e,t,n,r){var i=t*r/2-n/2;return Xa(e,-i,i)}function og(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function ag(e,t){return Math.atan2(t.y-e.y,t.x-e.x)*180/Math.PI}function dP(e,t,n,r,i,o,a){o===void 0&&(o=0),a===void 0&&(a=!0);var s=a?fP:hP,l=ni(t.width,t.height,o),c=ni(t.naturalWidth,t.naturalHeight,o),d={x:s(100,((l.width-n.width/i)/2-e.x/i)/l.width*100),y:s(100,((l.height-n.height/i)/2-e.y/i)/l.height*100),width:s(100,n.width/l.width*100/i),height:s(100,n.height/l.height*100/i)},f=Math.round(s(c.width,d.width*c.width/100)),h=Math.round(s(c.height,d.height*c.height/100)),p=c.width>=c.height*r,m=p?{width:Math.round(h*r),height:h}:{width:f,height:Math.round(f/r)},g=Tt(Tt({},m),{x:Math.round(s(c.width-m.width,d.x*c.width/100)),y:Math.round(s(c.height-m.height,d.y*c.height/100))});return{croppedAreaPercentages:d,croppedAreaPixels:g}}function fP(e,t){return Math.min(e,Math.max(0,t))}function hP(e,t){return t}function pP(e,t,n,r,i,o){var a=ni(t.width,t.height,n),s=Xa(r.width/a.width*(100/e.width),i,o),l={x:s*a.width/2-r.width/2-a.width*s*(e.x/100),y:s*a.height/2-r.height/2-a.height*s*(e.y/100)};return{crop:l,zoom:s}}function gP(e,t,n){var r=uP(t);return n.height>n.width?n.height/(e.height*r):n.width/(e.width*r)}function mP(e,t,n,r,i,o){n===void 0&&(n=0);var a=ni(t.naturalWidth,t.naturalHeight,n),s=Xa(gP(e,t,r),i,o),l=r.height>r.width?r.height/e.height:r.width/e.width,c={x:((a.width-e.width)/2-e.x)*l,y:((a.height-e.height)/2-e.y)*l};return{crop:c,zoom:s}}function sg(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function vP(e){return e*Math.PI/180}function ni(e,t,n){var r=vP(n);return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function Xa(e,t,n){return Math.min(Math.max(e,t),n)}function Za(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(n){return typeof n=="string"&&n.length>0}).join(" ").trim()}var bP=`.reactEasyCrop_Container {
|
|
2374
|
+
position: absolute;
|
|
2375
|
+
top: 0;
|
|
2376
|
+
left: 0;
|
|
2377
|
+
right: 0;
|
|
2378
|
+
bottom: 0;
|
|
2379
|
+
overflow: hidden;
|
|
2380
|
+
user-select: none;
|
|
2381
|
+
touch-action: none;
|
|
2382
|
+
cursor: move;
|
|
2383
|
+
display: flex;
|
|
2384
|
+
justify-content: center;
|
|
2385
|
+
align-items: center;
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
.reactEasyCrop_Image,
|
|
2389
|
+
.reactEasyCrop_Video {
|
|
2390
|
+
will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */
|
|
2391
|
+
}
|
|
2392
|
+
|
|
2393
|
+
.reactEasyCrop_Contain {
|
|
2394
|
+
max-width: 100%;
|
|
2395
|
+
max-height: 100%;
|
|
2396
|
+
margin: auto;
|
|
2397
|
+
position: absolute;
|
|
2398
|
+
top: 0;
|
|
2399
|
+
bottom: 0;
|
|
2400
|
+
left: 0;
|
|
2401
|
+
right: 0;
|
|
2402
|
+
}
|
|
2403
|
+
.reactEasyCrop_Cover_Horizontal {
|
|
2404
|
+
width: 100%;
|
|
2405
|
+
height: auto;
|
|
2406
|
+
}
|
|
2407
|
+
.reactEasyCrop_Cover_Vertical {
|
|
2408
|
+
width: auto;
|
|
2409
|
+
height: 100%;
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2412
|
+
.reactEasyCrop_CropArea {
|
|
2413
|
+
position: absolute;
|
|
2414
|
+
left: 50%;
|
|
2415
|
+
top: 50%;
|
|
2416
|
+
transform: translate(-50%, -50%);
|
|
2417
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
2418
|
+
box-sizing: border-box;
|
|
2419
|
+
box-shadow: 0 0 0 9999em;
|
|
2420
|
+
color: rgba(0, 0, 0, 0.5);
|
|
2421
|
+
overflow: hidden;
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
.reactEasyCrop_CropAreaRound {
|
|
2425
|
+
border-radius: 50%;
|
|
2426
|
+
}
|
|
2427
|
+
|
|
2428
|
+
.reactEasyCrop_CropAreaGrid::before {
|
|
2429
|
+
content: ' ';
|
|
2430
|
+
box-sizing: border-box;
|
|
2431
|
+
position: absolute;
|
|
2432
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
2433
|
+
top: 0;
|
|
2434
|
+
bottom: 0;
|
|
2435
|
+
left: 33.33%;
|
|
2436
|
+
right: 33.33%;
|
|
2437
|
+
border-top: 0;
|
|
2438
|
+
border-bottom: 0;
|
|
2439
|
+
}
|
|
2440
|
+
|
|
2441
|
+
.reactEasyCrop_CropAreaGrid::after {
|
|
2442
|
+
content: ' ';
|
|
2443
|
+
box-sizing: border-box;
|
|
2444
|
+
position: absolute;
|
|
2445
|
+
border: 1px solid rgba(255, 255, 255, 0.5);
|
|
2446
|
+
top: 33.33%;
|
|
2447
|
+
bottom: 33.33%;
|
|
2448
|
+
left: 0;
|
|
2449
|
+
right: 0;
|
|
2450
|
+
border-left: 0;
|
|
2451
|
+
border-right: 0;
|
|
2452
|
+
}
|
|
2453
|
+
`,yP=1,xP=3,CP=function(e){hy(t,e);function t(){var n=e!==null&&e.apply(this,arguments)||this;return n.imageRef=W.createRef(),n.videoRef=W.createRef(),n.containerPosition={x:0,y:0},n.containerRef=null,n.styleRef=null,n.containerRect=null,n.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},n.dragStartPosition={x:0,y:0},n.dragStartCrop={x:0,y:0},n.gestureZoomStart=0,n.gestureRotationStart=0,n.isTouching=!1,n.lastPinchDistance=0,n.lastPinchRotation=0,n.rafDragTimeout=null,n.rafPinchTimeout=null,n.wheelTimer=null,n.currentDoc=typeof document!="undefined"?document:null,n.currentWindow=typeof window!="undefined"?window:null,n.resizeObserver=null,n.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},n.initResizeObserver=function(){if(!(typeof window.ResizeObserver=="undefined"||!n.containerRef)){var r=!0;n.resizeObserver=new window.ResizeObserver(function(i){if(r){r=!1;return}n.computeSizes()}),n.resizeObserver.observe(n.containerRef)}},n.preventZoomSafari=function(r){return r.preventDefault()},n.cleanEvents=function(){n.currentDoc&&(n.currentDoc.removeEventListener("mousemove",n.onMouseMove),n.currentDoc.removeEventListener("mouseup",n.onDragStopped),n.currentDoc.removeEventListener("touchmove",n.onTouchMove),n.currentDoc.removeEventListener("touchend",n.onDragStopped),n.currentDoc.removeEventListener("gesturemove",n.onGestureMove),n.currentDoc.removeEventListener("gestureend",n.onGestureEnd),n.currentDoc.removeEventListener("scroll",n.onScroll))},n.clearScrollEvent=function(){n.containerRef&&n.containerRef.removeEventListener("wheel",n.onWheel),n.wheelTimer&&clearTimeout(n.wheelTimer)},n.onMediaLoad=function(){var r=n.computeSizes();r&&(n.emitCropData(),n.setInitialCrop(r)),n.props.onMediaLoaded&&n.props.onMediaLoaded(n.mediaSize)},n.setInitialCrop=function(r){if(n.props.initialCroppedAreaPercentages){var i=pP(n.props.initialCroppedAreaPercentages,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=i.crop,a=i.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}else if(n.props.initialCroppedAreaPixels){var s=mP(n.props.initialCroppedAreaPixels,n.mediaSize,n.props.rotation,r,n.props.minZoom,n.props.maxZoom),o=s.crop,a=s.zoom;n.props.onCropChange(o),n.props.onZoomChange&&n.props.onZoomChange(a)}},n.computeSizes=function(){var r,i,o,a,s,l,c=n.imageRef.current||n.videoRef.current;if(c&&n.containerRef){n.containerRect=n.containerRef.getBoundingClientRect(),n.saveContainerPosition();var d=n.containerRect.width/n.containerRect.height,f=((r=n.imageRef.current)===null||r===void 0?void 0:r.naturalWidth)||((i=n.videoRef.current)===null||i===void 0?void 0:i.videoWidth)||0,h=((o=n.imageRef.current)===null||o===void 0?void 0:o.naturalHeight)||((a=n.videoRef.current)===null||a===void 0?void 0:a.videoHeight)||0,p=c.offsetWidth<f||c.offsetHeight<h,m=f/h,g=void 0;if(p)switch(n.state.mediaObjectFit){default:case"contain":g=d>m?{width:n.containerRect.height*m,height:n.containerRect.height}:{width:n.containerRect.width,height:n.containerRect.width/m};break;case"horizontal-cover":g={width:n.containerRect.width,height:n.containerRect.width/m};break;case"vertical-cover":g={width:n.containerRect.height*m,height:n.containerRect.height};break}else g={width:c.offsetWidth,height:c.offsetHeight};n.mediaSize=Tt(Tt({},g),{naturalWidth:f,naturalHeight:h}),n.props.setMediaSize&&n.props.setMediaSize(n.mediaSize);var v=n.props.cropSize?n.props.cropSize:cP(n.mediaSize.width,n.mediaSize.height,n.containerRect.width,n.containerRect.height,n.props.aspect,n.props.rotation);return(((s=n.state.cropSize)===null||s===void 0?void 0:s.height)!==v.height||((l=n.state.cropSize)===null||l===void 0?void 0:l.width)!==v.width)&&n.props.onCropSizeChange&&n.props.onCropSizeChange(v),n.setState({cropSize:v},n.recomputeCropPosition),n.props.setCropSize&&n.props.setCropSize(v),v}},n.saveContainerPosition=function(){if(n.containerRef){var r=n.containerRef.getBoundingClientRect();n.containerPosition={x:r.left,y:r.top}}},n.onMouseDown=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("mousemove",n.onMouseMove),n.currentDoc.addEventListener("mouseup",n.onDragStopped),n.saveContainerPosition(),n.onDragStart(t.getMousePoint(r)))},n.onMouseMove=function(r){return n.onDrag(t.getMousePoint(r))},n.onScroll=function(r){n.currentDoc&&(r.preventDefault(),n.saveContainerPosition())},n.onTouchStart=function(r){n.currentDoc&&(n.isTouching=!0,!(n.props.onTouchRequest&&!n.props.onTouchRequest(r))&&(n.currentDoc.addEventListener("touchmove",n.onTouchMove,{passive:!1}),n.currentDoc.addEventListener("touchend",n.onDragStopped),n.saveContainerPosition(),r.touches.length===2?n.onPinchStart(r):r.touches.length===1&&n.onDragStart(t.getTouchPoint(r.touches[0]))))},n.onTouchMove=function(r){r.preventDefault(),r.touches.length===2?n.onPinchMove(r):r.touches.length===1&&n.onDrag(t.getTouchPoint(r.touches[0]))},n.onGestureStart=function(r){n.currentDoc&&(r.preventDefault(),n.currentDoc.addEventListener("gesturechange",n.onGestureMove),n.currentDoc.addEventListener("gestureend",n.onGestureEnd),n.gestureZoomStart=n.props.zoom,n.gestureRotationStart=n.props.rotation)},n.onGestureMove=function(r){if(r.preventDefault(),!n.isTouching){var i=t.getMousePoint(r),o=n.gestureZoomStart-1+r.scale;if(n.setNewZoom(o,i,{shouldUpdatePosition:!0}),n.props.onRotationChange){var a=n.gestureRotationStart+r.rotation;n.props.onRotationChange(a)}}},n.onGestureEnd=function(r){n.cleanEvents()},n.onDragStart=function(r){var i,o,a=r.x,s=r.y;n.dragStartPosition={x:a,y:s},n.dragStartCrop=Tt({},n.props.crop),(o=(i=n.props).onInteractionStart)===null||o===void 0||o.call(i)},n.onDrag=function(r){var i=r.x,o=r.y;n.currentWindow&&(n.rafDragTimeout&&n.currentWindow.cancelAnimationFrame(n.rafDragTimeout),n.rafDragTimeout=n.currentWindow.requestAnimationFrame(function(){if(n.state.cropSize&&!(i===void 0||o===void 0)){var a=i-n.dragStartPosition.x,s=o-n.dragStartPosition.y,l={x:n.dragStartCrop.x+a,y:n.dragStartCrop.y+s},c=n.props.restrictPosition?Ja(l,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):l;n.props.onCropChange(c)}}))},n.onDragStopped=function(){var r,i;n.isTouching=!1,n.cleanEvents(),n.emitCropData(),(i=(r=n.props).onInteractionEnd)===null||i===void 0||i.call(r)},n.onWheel=function(r){if(n.currentWindow&&!(n.props.onWheelRequest&&!n.props.onWheelRequest(r))){r.preventDefault();var i=t.getMousePoint(r),o=lP(r).pixelY,a=n.props.zoom-o*n.props.zoomSpeed/200;n.setNewZoom(a,i,{shouldUpdatePosition:!0}),n.state.hasWheelJustStarted||n.setState({hasWheelJustStarted:!0},function(){var s,l;return(l=(s=n.props).onInteractionStart)===null||l===void 0?void 0:l.call(s)}),n.wheelTimer&&clearTimeout(n.wheelTimer),n.wheelTimer=n.currentWindow.setTimeout(function(){return n.setState({hasWheelJustStarted:!1},function(){var s,l;return(l=(s=n.props).onInteractionEnd)===null||l===void 0?void 0:l.call(s)})},250)}},n.getPointOnContainer=function(r,i){var o=r.x,a=r.y;if(!n.containerRect)throw new Error("The Cropper is not mounted");return{x:n.containerRect.width/2-(o-i.x),y:n.containerRect.height/2-(a-i.y)}},n.getPointOnMedia=function(r){var i=r.x,o=r.y,a=n.props,s=a.crop,l=a.zoom;return{x:(i+s.x)/l,y:(o+s.y)/l}},n.setNewZoom=function(r,i,o){var a=o===void 0?{}:o,s=a.shouldUpdatePosition,l=s===void 0?!0:s;if(!(!n.state.cropSize||!n.props.onZoomChange)){var c=Xa(r,n.props.minZoom,n.props.maxZoom);if(l){var d=n.getPointOnContainer(i,n.containerPosition),f=n.getPointOnMedia(d),h={x:f.x*c-d.x,y:f.y*c-d.y},p=n.props.restrictPosition?Ja(h,n.mediaSize,n.state.cropSize,c,n.props.rotation):h;n.props.onCropChange(p)}n.props.onZoomChange(c)}},n.getCropData=function(){if(!n.state.cropSize)return null;var r=n.props.restrictPosition?Ja(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;return dP(r,n.mediaSize,n.state.cropSize,n.getAspect(),n.props.zoom,n.props.rotation,n.props.restrictPosition)},n.emitCropData=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropComplete&&n.props.onCropComplete(i,o),n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.emitCropAreaChange=function(){var r=n.getCropData();if(r){var i=r.croppedAreaPercentages,o=r.croppedAreaPixels;n.props.onCropAreaChange&&n.props.onCropAreaChange(i,o)}},n.recomputeCropPosition=function(){if(n.state.cropSize){var r=n.props.restrictPosition?Ja(n.props.crop,n.mediaSize,n.state.cropSize,n.props.zoom,n.props.rotation):n.props.crop;n.props.onCropChange(r),n.emitCropData()}},n}return t.prototype.componentDidMount=function(){!this.currentDoc||!this.currentWindow||(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),typeof window.ResizeObserver=="undefined"&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=bP,this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef))},t.prototype.componentWillUnmount=function(){var n,r;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver=="undefined"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(n=this.resizeObserver)===null||n===void 0||n.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((r=this.styleRef.parentNode)===null||r===void 0||r.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(n){var r,i,o,a,s,l,c,d,f;n.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):n.aspect!==this.props.aspect?this.computeSizes():n.objectFit!==this.props.objectFit?this.computeSizes():n.zoom!==this.props.zoom?this.recomputeCropPosition():((r=n.cropSize)===null||r===void 0?void 0:r.height)!==((i=this.props.cropSize)===null||i===void 0?void 0:i.height)||((o=n.cropSize)===null||o===void 0?void 0:o.width)!==((a=this.props.cropSize)===null||a===void 0?void 0:a.width)?this.computeSizes():(((s=n.crop)===null||s===void 0?void 0:s.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((c=n.crop)===null||c===void 0?void 0:c.y)!==((d=this.props.crop)===null||d===void 0?void 0:d.y))&&this.emitCropAreaChange(),n.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),n.video!==this.props.video&&((f=this.videoRef.current)===null||f===void 0||f.load());var h=this.getObjectFit();h!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:h},this.computeSizes)},t.prototype.getAspect=function(){var n=this.props,r=n.cropSize,i=n.aspect;return r?r.width/r.height:i},t.prototype.getObjectFit=function(){var n,r,i,o;if(this.props.objectFit==="cover"){var a=this.imageRef.current||this.videoRef.current;if(a&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var s=this.containerRect.width/this.containerRect.height,l=((n=this.imageRef.current)===null||n===void 0?void 0:n.naturalWidth)||((r=this.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,c=((i=this.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((o=this.videoRef.current)===null||o===void 0?void 0:o.videoHeight)||0,d=l/c;return d<s?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(n){var r=t.getTouchPoint(n.touches[0]),i=t.getTouchPoint(n.touches[1]);this.lastPinchDistance=og(r,i),this.lastPinchRotation=ag(r,i),this.onDragStart(sg(r,i))},t.prototype.onPinchMove=function(n){var r=this;if(!(!this.currentDoc||!this.currentWindow)){var i=t.getTouchPoint(n.touches[0]),o=t.getTouchPoint(n.touches[1]),a=sg(i,o);this.onDrag(a),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var s=og(i,o),l=r.props.zoom*(s/r.lastPinchDistance);r.setNewZoom(l,a,{shouldUpdatePosition:!1}),r.lastPinchDistance=s;var c=ag(i,o),d=r.props.rotation+(c-r.lastPinchRotation);r.props.onRotationChange&&r.props.onRotationChange(d),r.lastPinchRotation=c})}},t.prototype.render=function(){var n=this,r,i=this.props,o=i.image,a=i.video,s=i.mediaProps,l=i.transform,c=i.crop,d=c.x,f=c.y,h=i.rotation,p=i.zoom,m=i.cropShape,g=i.showGrid,v=i.style,S=v.containerStyle,I=v.cropAreaStyle,x=v.mediaStyle,C=i.classes,y=C.containerClassName,A=C.cropAreaClassName,E=C.mediaClassName,_=(r=this.state.mediaObjectFit)!==null&&r!==void 0?r:this.getObjectFit();return W.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(G){return n.containerRef=G},"data-testid":"container",style:S,className:Za("reactEasyCrop_Container",y)},o?W.createElement("img",Tt({alt:"",className:Za("reactEasyCrop_Image",_==="contain"&&"reactEasyCrop_Contain",_==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",_==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},s,{src:o,ref:this.imageRef,style:Tt(Tt({},x),{transform:l||"translate(".concat(d,"px, ").concat(f,"px) rotate(").concat(h,"deg) scale(").concat(p,")")}),onLoad:this.onMediaLoad})):a&&W.createElement("video",Tt({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:Za("reactEasyCrop_Video",_==="contain"&&"reactEasyCrop_Contain",_==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",_==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",E)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:Tt(Tt({},x),{transform:l||"translate(".concat(d,"px, ").concat(f,"px) rotate(").concat(h,"deg) scale(").concat(p,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(D){return W.createElement("source",Tt({key:D.src},D))})),this.state.cropSize&&W.createElement("div",{style:Tt(Tt({},I),{width:this.state.cropSize.width,height:this.state.cropSize.height}),"data-testid":"cropper",className:Za("reactEasyCrop_CropArea",m==="round"&&"reactEasyCrop_CropAreaRound",g&&"reactEasyCrop_CropAreaGrid",A)}))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:xP,minZoom:yP,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0},t.getMousePoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t.getTouchPoint=function(n){return{x:Number(n.clientX),y:Number(n.clientY)}},t}(W.Component);const wP=e=>new Promise((t,n)=>{const r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",i=>n(i)),r.crossOrigin="Anonymous",r.src=e});function IP(e){return e*Math.PI/180}function SP(e,t,n=0){return k(this,null,function*(){const r=yield wP(e),i=document.createElement("canvas"),o=i.getContext("2d"),s=2*(Math.max(r.width,r.height)/2*Math.sqrt(2));i.width=s,i.height=s,o.translate(s/2,s/2),o.rotate(IP(n)),o.translate(-s/2,-s/2),o.drawImage(r,s/2-r.width*.5,s/2-r.height*.5);const l=o.getImageData(0,0,s,s);return i.width=t.width,i.height=t.height,o.putImageData(l,Math.round(0-s/2+r.width*.5-t.x),Math.round(0-s/2+r.height*.5-t.y)),new Promise(c=>i.toBlob(d=>{const f=new File([d],`cropped_image_${Date.now()}.jpeg`,{type:"image/jpeg"});c(f)},"image/jpeg"))})}const lg=({labels:e,open:t,imageSrc:n,resetDefaultImageUrl:r,toggleModal:i,uploadImage:o})=>{const[a,s]=w.useState({x:0,y:0}),[l,c]=w.useState(1),[d,f]=w.useState(16/9),[h,p]=w.useState(null),m=(x,C)=>{p(C)},g=(x,C)=>f(C),v=()=>k(this,null,function*(){const x=yield SP(n,h);I(),o(x)}),S=()=>{I(),r()},I=()=>{s({x:0,y:0}),c(1),f(16/9),p(null)};return u.jsx(b.Modal,{open:t,onClose:i,children:u.jsxs(b.ModalDialog,{layout:"fullscreen",variant:"soft",sx:{display:"flex",flexDirection:"column",justifyContent:"center",alignItems:"center"},children:[u.jsx(b.ModalClose,{}),u.jsx(b.DialogTitle,{children:e.cropImage}),u.jsxs(b.DialogContent,{sx:{width:"100%"},children:[u.jsx(b.Box,{position:"relative",height:"100%",width:"100%",mb:2,children:u.jsx(CP,{image:n,crop:a,zoom:l,aspect:d,onCropChange:s,onCropComplete:m,onZoomChange:c})}),u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:e.aspectRatio}),u.jsxs(b.Select,{value:d,onChange:g,children:[u.jsx(b.Option,{value:4/3,children:"4 / 3"}),u.jsx(b.Option,{value:16/9,children:"16 / 9"}),u.jsx(b.Option,{value:1,children:"1"})]})]}),u.jsx(b.Box,{mb:1,mx:2,children:u.jsx(b.Slider,{value:l,min:1,max:3,step:.1,onChange:(x,C)=>c(C)})}),u.jsxs(b.DialogActions,{children:[u.jsx(b.Button,{color:"primary",onClick:v,loading:!1,children:e.crop}),u.jsx(b.Button,{color:"primary",variant:"outlined",onClick:S,loading:!1,children:e.reset})]})]})]})})},cg=Ue(u.jsx("path",{d:"M17 15h2V7c0-1.1-.9-2-2-2H9v2h8zM7 17V1H5v4H1v2h4v10c0 1.1.9 2 2 2h10v4h2v-4h4v-2z"}),"CropOutlined"),ug=({labels:e,title:t,image:n,onChangeImages:r,clearImage:i})=>{const[o,a]=w.useState(!1),[s,l]=w.useState(!1),[c,d]=w.useState(!1),[f,h]=w.useState(!1),[p,m]=w.useState(""),[g,v]=w.useState("primary"),[S,I]=w.useState(""),x=w.useRef(null),C=()=>h(!f),y=()=>{x.current&&x.current.click()},A=new jp,E=w.useContext(ea),_=()=>{m(""),l(!1)},D=B=>{let H="",q="primary";switch(B){case"copy_url":H=e.urlCopiedToClipboardMessage,q="primary";break;case"image_deleted":H=e.imageDeletedMessage,q="primary";break;case"image_reset":H=e.imageResetMessage,q="primary";break;case"upload_success":H=e.uploadingImageMessage,q="success";break;case"upload_failed":H=e.uploadingImageErrorMessage,q="danger";break;case"sign_in_url_failed":H=e.generateSignedInUrlErrorMessage,q="danger";break;case"encrypting_file_failed":H=e.encryptingImageErrorMessage,q="danger";break}v(q),m(H),l(!0)},G=()=>d(!c),F=()=>{i(),D("image_deleted")},T=B=>{navigator.clipboard.writeText(B),D("copy_url")},j=B=>k(this,null,function*(){B.persist();const H=B.target.files?B.target.files[0]:null;if(H){a(!0);try{const q=H.type.split("/")[1],ee=yield A.readFileAndHash(H),R=(yield A.generateHashFileName(H))+"."+q,M={image_type:q,image_file_name:R,image_size:H.size,base64_sum:ee},U=yield E==null?void 0:E.https.generateSignedInUrl(M);if(U!=null&&U.ok){const V=yield U.json(),ne={"Content-Type":H.type,"Content-MD5":ee};try{const se=new File([H],R,{type:H.type}),ae=yield E==null?void 0:E.https.storeInBucket(V.data.signed_url,se,ne);r(ae||""),I(ae),D("upload_success")}catch(se){console.error("There was a problem with uploading the file: ",se),D("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield U==null?void 0:U.json()),D("sign_in_url_failed")}catch(q){console.error("There was a problem with encrypting file...",q),D("encrypting_file_failed")}a(!1)}}),Y=B=>k(this,null,function*(){if(B){a(!0);try{const H=B.type.split("/")[1],q=yield A.readFileAndHash(B),ee=(yield A.generateHashFileName(B))+"."+H,R={image_type:H,image_file_name:ee,image_size:B.size,base64_sum:q},M=yield E==null?void 0:E.https.generateSignedInUrl(R);if(M!=null&&M.ok){const U=yield M.json(),V={"Content-Type":B.type,"Content-MD5":q};try{const ne=new File([B],ee,{type:B.type}),se=yield E==null?void 0:E.https.storeInBucket(U.data.signed_url,ne,V);r(se||""),D("upload_success")}catch(ne){console.error("There was a problem with uploading the file: ",ne),D("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield M==null?void 0:M.json()),D("sign_in_url_failed")}catch(H){console.error("There was a problem with encrypting file...",H),D("encrypting_file_failed")}a(!1)}}),z=()=>{r(S),D("image_reset")},$=B=>{r(B),I(B)};return u.jsxs(u.Fragment,{children:[u.jsxs(b.Card,{sx:{marginBottom:"10px"},children:[u.jsxs(b.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[u.jsx(b.Typography,{level:"title-lg",children:t}),u.jsx(b.Tooltip,{title:e.clearImage,children:u.jsx(b.IconButton,{"aria-label":e.clearImage,variant:"plain",color:"danger",size:"sm",onClick:F,children:u.jsx(_p,{})})})]}),u.jsxs(b.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[u.jsxs(b.Skeleton,{loading:o,animation:"wave",children:[n?u.jsx(b.Box,{component:"img",src:n,loading:"lazy",alt:t,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):u.jsx(Oc,{sx:{fontSize:"3rem",opacity:.2}}),n?u.jsx(b.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:u.jsx(Vp,{sx:{fontSize:"3rem",color:"#fff"}})}):u.jsx(u.Fragment,{})]}),u.jsx(b.Tooltip,{title:e.copyUrl,children:u.jsx(ei,{onClick:()=>T(n),disabled:!n,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:u.jsx(ke.ContentCopy,{})})}),u.jsx(b.Tooltip,{title:e.viewImage,children:u.jsx(ei,{onClick:G,disabled:!n,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:u.jsx(Wp,{})})}),u.jsx(b.Tooltip,{title:e.cropImage,children:u.jsx(ei,{onClick:C,disabled:!n,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:u.jsx(cg,{})})})]}),u.jsx(b.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:u.jsxs(ei,{sx:{width:"100%"},onClick:y,children:[u.jsx(ke.Upload,{})," ",e.uploadImage,u.jsx(Gp,{type:"file",accept:"image/*",onChange:j,ref:x})]})}),E!=null&&E.https.sportal365Config?u.jsx(b.AccordionGroup,{variant:"soft",children:u.jsxs(b.Accordion,{children:[u.jsx(b.AccordionSummary,{children:u.jsx(b.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.sportal365Images})}),u.jsx(b.AccordionDetails,{children:u.jsx(Hp,{labels:e,onChangeImages:$})})]})}):u.jsx(u.Fragment,{})]}),u.jsx(st,{showToast:s,message:p,color:g,hideToast:_}),u.jsx(Up,{title:e.viewImage,open:c,imageSrc:n,toggleModal:G}),u.jsx(lg,{labels:e,open:f,imageSrc:n,toggleModal:C,uploadImage:Y,resetDefaultImageUrl:z})]})},AP=e=>new Map().set("main_logo",e.mainLogo).set("mobile_logo",e.mobileLogo).set("background_image",e.backgroundImage).set("mobile_background_image",e.mobileBackgroundImage).set("additional_image",e.additionalImage),TP=e=>new Map().set("primary_color",e.primaryColor).set("secondary_color",e.secondaryColor).set("content_color",e.contentColor).set("background_color",e.backgroundColor).set("border_color",e.borderColor).set("additional_color",e.additionalColor),EP=e=>new Map().set("primary_url",e.primaryUrl).set("secondary_url",e.secondaryUrl).set("privacy_policy_url",e.privacyPolicyUrl).set("terms_and_conditions_url",e.termsAndConditionsUrl).set("additional_url",e.additionalUrl),kP=({labels:e,defaultValue:t,onChange:n})=>{const[r,i]=w.useState(!1),o=JSON.parse(JSON.stringify(t)),a=["mobile_logo","background_image","mobile_background_image","additional_image"],s=AP(e),l=TP(e),c=EP(e),d=(m,g)=>{const v=m.target.value;o.colors[g]=v,n(o)},f=(m,g)=>{const v=m.target.value;o.urls[g]=v,n(o)},h=(m,g)=>{o.images[g]=m,n(o)},p=m=>{o.images[m]="",n(o)};return u.jsx(b.Box,{children:u.jsxs(Kh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[u.jsxs(qh,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${gc.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[u.jsxs(Vr,{children:[u.jsx(b.ListItemDecorator,{children:u.jsx(Oc,{sx:{width:"20px"}})}),e.images]}),u.jsxs(Vr,{children:[u.jsx(b.ListItemDecorator,{children:u.jsx(Zk,{sx:{width:"20px"}})}),e.colors]}),u.jsxs(Vr,{children:[u.jsx(b.ListItemDecorator,{children:u.jsx(e_,{sx:{width:"20px"}})}),e.urls]})]}),u.jsxs(Xr,{value:0,sx:{px:0},children:[u.jsx(ug,{labels:e,title:e.mainLogo,image:o.images.main_logo,onChangeImages:m=>h(m,"main_logo"),clearImage:()=>p("main_logo")}),u.jsx(b.Link,{underline:"hover",onClick:()=>i(!r),sx:{marginBottom:"10px"},children:r?e.hideMoreImages:e.showMoreImages}),r?u.jsx(u.Fragment,{children:a.map(m=>u.jsx(ug,{labels:e,title:s.get(m),image:o.images[m],onChangeImages:g=>h(g,m),clearImage:()=>p(m)},`branding-image-${m}`))}):u.jsx(u.Fragment,{})]}),u.jsx(Xr,{value:1,sx:{px:0},children:u.jsx(b.Box,{children:Object.keys(o.colors).map(m=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{size:"sm",label:l.get(m),placeholder:"",defaultValue:o.colors[m],required:!1,onChange:g=>d(g,m)})},`branding-color-${m}`))})}),u.jsx(Xr,{value:2,sx:{px:0},children:u.jsx(b.Box,{children:Object.keys(o.urls).map(m=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{size:"sm",label:c.get(m),placeholder:"",defaultValue:o.urls[m],required:!1,onChange:g=>f(g,m)})},`branding-url-${m}`))})})]})})},Hc=Ue(u.jsx("path",{d:"M13 7h-2v4H7v2h4v4h2v-4h4v-2h-4zm-1-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2m0 18c-4.41 0-8-3.59-8-8s3.59-8 8-8 8 3.59 8 8-3.59 8-8 8"}),"AddCircleOutlineOutlined"),dg=e=>{const t=()=>k(this,null,function*(){yield Vi(e.environment).signOut()});return u.jsx(b.Button,{variant:"outlined",color:"danger",onClick:t,children:e.signOutLabel})},_P=({createLabel:e,createFromTemplateLabel:t,signOutLabel:n,environment:r,onClickCreate:i,onClickCreateFromTemplate:o})=>u.jsx(u.Fragment,{children:u.jsxs(b.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",p:1,sx:()=>({marginBottom:"16px"}),children:[t?u.jsxs(b.Stack,{direction:"row",alignItems:"center",spacing:2,children:[u.jsx(b.Button,{startDecorator:u.jsx(Hc,{}),variant:"solid",color:"primary",onClick:i,children:e}),u.jsx(b.Button,{startDecorator:u.jsx(Hc,{}),variant:"outlined",color:"primary",onClick:o,children:t})]}):u.jsx(b.Button,{startDecorator:u.jsx(Hc,{}),variant:"solid",color:"primary",onClick:i,children:e}),n?u.jsx(dg,{signOutLabel:n,environment:r}):u.jsx(u.Fragment,{})]})});var fg={},Wc=["onChange","onClose","onDayCreate","onDestroy","onKeyDown","onMonthChange","onOpen","onParseConfig","onReady","onValueUpdate","onYearChange","onPreCalendarPosition"],ri={_disable:[],allowInput:!1,allowInvalidPreload:!1,altFormat:"F j, Y",altInput:!1,altInputClass:"form-control input",animate:typeof window=="object"&&window.navigator.userAgent.indexOf("MSIE")===-1,ariaDateFormat:"F j, Y",autoFillDefaultTime:!0,clickOpens:!0,closeOnSelect:!0,conjunction:", ",dateFormat:"Y-m-d",defaultHour:12,defaultMinute:0,defaultSeconds:0,disable:[],disableMobile:!1,enableSeconds:!1,enableTime:!1,errorHandler:function(e){return typeof console!="undefined"&&console.warn(e)},getWeek:function(e){var t=new Date(e.getTime());t.setHours(0,0,0,0),t.setDate(t.getDate()+3-(t.getDay()+6)%7);var n=new Date(t.getFullYear(),0,4);return 1+Math.round(((t.getTime()-n.getTime())/864e5-3+(n.getDay()+6)%7)/7)},hourIncrement:1,ignoredFocusElements:[],inline:!1,locale:"default",minuteIncrement:5,mode:"single",monthSelectorType:"dropdown",nextArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M13.207 8.472l-7.854 7.854-0.707-0.707 7.146-7.146-7.146-7.148 0.707-0.707 7.854 7.854z' /></svg>",noCalendar:!1,now:new Date,onChange:[],onClose:[],onDayCreate:[],onDestroy:[],onKeyDown:[],onMonthChange:[],onOpen:[],onParseConfig:[],onReady:[],onValueUpdate:[],onYearChange:[],onPreCalendarPosition:[],plugins:[],position:"auto",positionElement:void 0,prevArrow:"<svg version='1.1' xmlns='http://www.w3.org/2000/svg' xmlns:xlink='http://www.w3.org/1999/xlink' viewBox='0 0 17 17'><g></g><path d='M5.207 8.471l7.146 7.147-0.707 0.707-7.853-7.854 7.854-7.853 0.707 0.707-7.147 7.146z' /></svg>",shorthandCurrentMonth:!1,showMonths:1,static:!1,time_24hr:!1,weekNumbers:!1,wrap:!1},io={weekdays:{shorthand:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],longhand:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},months:{shorthand:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],longhand:["January","February","March","April","May","June","July","August","September","October","November","December"]},daysInMonth:[31,28,31,30,31,30,31,31,30,31,30,31],firstDayOfWeek:0,ordinal:function(e){var t=e%100;if(t>3&&t<21)return"th";switch(t%10){case 1:return"st";case 2:return"nd";case 3:return"rd";default:return"th"}},rangeSeparator:" to ",weekAbbreviation:"Wk",scrollTitle:"Scroll to increment",toggleTitle:"Click to toggle",amPM:["AM","PM"],yearAriaLabel:"Year",monthAriaLabel:"Month",hourAriaLabel:"Hour",minuteAriaLabel:"Minute",time_24hr:!1},zt=function(e,t){return t===void 0&&(t=2),("000"+e).slice(t*-1)},rn=function(e){return e===!0?1:0};function hg(e,t){var n;return function(){var r=this,i=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,i)},t)}}var Gc=function(e){return e instanceof Array?e:[e]};function Rt(e,t,n){if(n===!0)return e.classList.add(t);e.classList.remove(t)}function Le(e,t,n){var r=window.document.createElement(e);return t=t||"",n=n||"",r.className=t,n!==void 0&&(r.textContent=n),r}function es(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function pg(e,t){if(t(e))return e;if(e.parentNode)return pg(e.parentNode,t)}function ts(e,t){var n=Le("div","numInputWrapper"),r=Le("input","numInput "+e),i=Le("span","arrowUp"),o=Le("span","arrowDown");if(navigator.userAgent.indexOf("MSIE 9.0")===-1?r.type="number":(r.type="text",r.pattern="\\d*"),t!==void 0)for(var a in t)r.setAttribute(a,t[a]);return n.appendChild(r),n.appendChild(i),n.appendChild(o),n}function Yt(e){try{if(typeof e.composedPath=="function"){var t=e.composedPath();return t[0]}return e.target}catch(n){return e.target}}var Yc=function(){},ns=function(e,t,n){return n.months[t?"shorthand":"longhand"][e]},PP={D:Yc,F:function(e,t,n){e.setMonth(n.months.longhand.indexOf(t))},G:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},H:function(e,t){e.setHours(parseFloat(t))},J:function(e,t){e.setDate(parseFloat(t))},K:function(e,t,n){e.setHours(e.getHours()%12+12*rn(new RegExp(n.amPM[1],"i").test(t)))},M:function(e,t,n){e.setMonth(n.months.shorthand.indexOf(t))},S:function(e,t){e.setSeconds(parseFloat(t))},U:function(e,t){return new Date(parseFloat(t)*1e3)},W:function(e,t,n){var r=parseInt(t),i=new Date(e.getFullYear(),0,2+(r-1)*7,0,0,0,0);return i.setDate(i.getDate()-i.getDay()+n.firstDayOfWeek),i},Y:function(e,t){e.setFullYear(parseFloat(t))},Z:function(e,t){return new Date(t)},d:function(e,t){e.setDate(parseFloat(t))},h:function(e,t){e.setHours((e.getHours()>=12?12:0)+parseFloat(t))},i:function(e,t){e.setMinutes(parseFloat(t))},j:function(e,t){e.setDate(parseFloat(t))},l:Yc,m:function(e,t){e.setMonth(parseFloat(t)-1)},n:function(e,t){e.setMonth(parseFloat(t)-1)},s:function(e,t){e.setSeconds(parseFloat(t))},u:function(e,t){return new Date(parseFloat(t))},w:Yc,y:function(e,t){e.setFullYear(2e3+parseFloat(t))}},Cr={D:"",F:"",G:"(\\d\\d|\\d)",H:"(\\d\\d|\\d)",J:"(\\d\\d|\\d)\\w+",K:"",M:"",S:"(\\d\\d|\\d)",U:"(.+)",W:"(\\d\\d|\\d)",Y:"(\\d{4})",Z:"(.+)",d:"(\\d\\d|\\d)",h:"(\\d\\d|\\d)",i:"(\\d\\d|\\d)",j:"(\\d\\d|\\d)",l:"",m:"(\\d\\d|\\d)",n:"(\\d\\d|\\d)",s:"(\\d\\d|\\d)",u:"(.+)",w:"(\\d\\d|\\d)",y:"(\\d{2})"},oo={Z:function(e){return e.toISOString()},D:function(e,t,n){return t.weekdays.shorthand[oo.w(e,t,n)]},F:function(e,t,n){return ns(oo.n(e,t,n)-1,!1,t)},G:function(e,t,n){return zt(oo.h(e,t,n))},H:function(e){return zt(e.getHours())},J:function(e,t){return t.ordinal!==void 0?e.getDate()+t.ordinal(e.getDate()):e.getDate()},K:function(e,t){return t.amPM[rn(e.getHours()>11)]},M:function(e,t){return ns(e.getMonth(),!0,t)},S:function(e){return zt(e.getSeconds())},U:function(e){return e.getTime()/1e3},W:function(e,t,n){return n.getWeek(e)},Y:function(e){return zt(e.getFullYear(),4)},d:function(e){return zt(e.getDate())},h:function(e){return e.getHours()%12?e.getHours()%12:12},i:function(e){return zt(e.getMinutes())},j:function(e){return e.getDate()},l:function(e,t){return t.weekdays.longhand[e.getDay()]},m:function(e){return zt(e.getMonth()+1)},n:function(e){return e.getMonth()+1},s:function(e){return e.getSeconds()},u:function(e){return e.getTime()},w:function(e){return e.getDay()},y:function(e){return String(e.getFullYear()).substring(2)}},gg=function(e){var t=e.config,n=t===void 0?ri:t,r=e.l10n,i=r===void 0?io:r,o=e.isMobile,a=o===void 0?!1:o;return function(s,l,c){var d=c||i;return n.formatDate!==void 0&&!a?n.formatDate(s,l,d):l.split("").map(function(f,h,p){return oo[f]&&p[h-1]!=="\\"?oo[f](s,d,n):f!=="\\"?f:""}).join("")}},Kc=function(e){var t=e.config,n=t===void 0?ri:t,r=e.l10n,i=r===void 0?io:r;return function(o,a,s,l){if(!(o!==0&&!o)){var c=l||i,d,f=o;if(o instanceof Date)d=new Date(o.getTime());else if(typeof o!="string"&&o.toFixed!==void 0)d=new Date(o);else if(typeof o=="string"){var h=a||(n||ri).dateFormat,p=String(o).trim();if(p==="today")d=new Date,s=!0;else if(n&&n.parseDate)d=n.parseDate(o,h);else if(/Z$/.test(p)||/GMT$/.test(p))d=new Date(o);else{for(var m=void 0,g=[],v=0,S=0,I="";v<h.length;v++){var x=h[v],C=x==="\\",y=h[v-1]==="\\"||C;if(Cr[x]&&!y){I+=Cr[x];var A=new RegExp(I).exec(o);A&&(m=!0)&&g[x!=="Y"?"push":"unshift"]({fn:PP[x],val:A[++S]})}else C||(I+=".")}d=!n||!n.noCalendar?new Date(new Date().getFullYear(),0,1,0,0,0,0):new Date(new Date().setHours(0,0,0,0)),g.forEach(function(E){var _=E.fn,D=E.val;return d=_(d,D,c)||d}),d=m?d:void 0}}if(!(d instanceof Date&&!isNaN(d.getTime()))){n.errorHandler(new Error("Invalid date provided: "+f));return}return s===!0&&d.setHours(0,0,0,0),d}}};function Kt(e,t,n){return n===void 0&&(n=!0),n!==!1?new Date(e.getTime()).setHours(0,0,0,0)-new Date(t.getTime()).setHours(0,0,0,0):e.getTime()-t.getTime()}var DP=function(e,t,n){return e>Math.min(t,n)&&e<Math.max(t,n)},qc=function(e,t,n){return e*3600+t*60+n},OP=function(e){var t=Math.floor(e/3600),n=(e-t*3600)/60;return[t,n,e-t*3600-n*60]},RP={DAY:864e5};function Qc(e){var t=e.defaultHour,n=e.defaultMinute,r=e.defaultSeconds;if(e.minDate!==void 0){var i=e.minDate.getHours(),o=e.minDate.getMinutes(),a=e.minDate.getSeconds();t<i&&(t=i),t===i&&n<o&&(n=o),t===i&&n===o&&r<a&&(r=e.minDate.getSeconds())}if(e.maxDate!==void 0){var s=e.maxDate.getHours(),l=e.maxDate.getMinutes();t=Math.min(t,s),t===s&&(n=Math.min(l,n)),t===s&&n===l&&(r=e.maxDate.getSeconds())}return{hours:t,minutes:n,seconds:r}}typeof Object.assign!="function"&&(Object.assign=function(e){for(var t=[],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(!e)throw TypeError("Cannot convert undefined or null to object");for(var r=function(s){s&&Object.keys(s).forEach(function(l){return e[l]=s[l]})},i=0,o=t;i<o.length;i++){var a=o[i];r(a)}return e});var kt=function(){return kt=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var i in t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i])}return e},kt.apply(this,arguments)},mg=function(){for(var e=0,t=0,n=arguments.length;t<n;t++)e+=arguments[t].length;for(var r=Array(e),i=0,t=0;t<n;t++)for(var o=arguments[t],a=0,s=o.length;a<s;a++,i++)r[i]=o[a];return r},LP=300;function MP(e,t){var n={config:kt(kt({},ri),ht.defaultConfig),l10n:io};n.parseDate=Kc({config:n.config,l10n:n.l10n}),n._handlers=[],n.pluginElements=[],n.loadedPlugins=[],n._bind=g,n._setHoursFromDate=h,n._positionCalendar=Ce,n.changeMonth=R,n.changeYear=ae,n.clear=M,n.close=U,n.onMouseOver=Ae,n._createElement=Le,n.createDay=A,n.destroy=V,n.isEnabled=X,n.jumpToDate=I,n.updateValue=un,n.open=It,n.redraw=Oe,n.set=jt,n.setDate=qt,n.toggle=$u;function r(){n.utils={getDaysInMonth:function(P,L){return P===void 0&&(P=n.currentMonth),L===void 0&&(L=n.currentYear),P===1&&(L%4===0&&L%100!==0||L%400===0)?29:n.l10n.daysInMonth[P]}}}function i(){n.element=n.input=e,n.isOpen=!1,Pt(),he(),In(),Ls(),r(),n.isMobile||y(),S(),(n.selectedDates.length||n.config.noCalendar)&&(n.config.enableTime&&h(n.config.noCalendar?n.latestSelectedDateObj:void 0),un(!1)),s();var P=/^((?!chrome|android).)*safari/i.test(navigator.userAgent);!n.isMobile&&P&&Ce(),Fe("onReady")}function o(){var P;return((P=n.calendarContainer)===null||P===void 0?void 0:P.getRootNode()).activeElement||document.activeElement}function a(P){return P.bind(n)}function s(){var P=n.config;P.weekNumbers===!1&&P.showMonths===1||P.noCalendar!==!0&&window.requestAnimationFrame(function(){if(n.calendarContainer!==void 0&&(n.calendarContainer.style.visibility="hidden",n.calendarContainer.style.display="block"),n.daysContainer!==void 0){var L=(n.days.offsetWidth+1)*P.showMonths;n.daysContainer.style.width=L+"px",n.calendarContainer.style.width=L+(n.weekWrapper!==void 0?n.weekWrapper.offsetWidth:0)+"px",n.calendarContainer.style.removeProperty("visibility"),n.calendarContainer.style.removeProperty("display")}})}function l(P){if(n.selectedDates.length===0){var L=n.config.minDate===void 0||Kt(new Date,n.config.minDate)>=0?new Date:new Date(n.config.minDate.getTime()),K=Qc(n.config);L.setHours(K.hours,K.minutes,K.seconds,L.getMilliseconds()),n.selectedDates=[L],n.latestSelectedDateObj=L}P!==void 0&&P.type!=="blur"&&wt(P);var J=n._input.value;f(),un(),n._input.value!==J&&n._debouncedChange()}function c(P,L){return P%12+12*rn(L===n.l10n.amPM[1])}function d(P){switch(P%24){case 0:case 12:return 12;default:return P%12}}function f(){if(!(n.hourElement===void 0||n.minuteElement===void 0)){var P=(parseInt(n.hourElement.value.slice(-2),10)||0)%24,L=(parseInt(n.minuteElement.value,10)||0)%60,K=n.secondElement!==void 0?(parseInt(n.secondElement.value,10)||0)%60:0;n.amPM!==void 0&&(P=c(P,n.amPM.textContent));var J=n.config.minTime!==void 0||n.config.minDate&&n.minDateHasTime&&n.latestSelectedDateObj&&Kt(n.latestSelectedDateObj,n.config.minDate,!0)===0,ie=n.config.maxTime!==void 0||n.config.maxDate&&n.maxDateHasTime&&n.latestSelectedDateObj&&Kt(n.latestSelectedDateObj,n.config.maxDate,!0)===0;if(n.config.maxTime!==void 0&&n.config.minTime!==void 0&&n.config.minTime>n.config.maxTime){var ce=qc(n.config.minTime.getHours(),n.config.minTime.getMinutes(),n.config.minTime.getSeconds()),we=qc(n.config.maxTime.getHours(),n.config.maxTime.getMinutes(),n.config.maxTime.getSeconds()),ue=qc(P,L,K);if(ue>we&&ue<ce){var Ie=OP(ce);P=Ie[0],L=Ie[1],K=Ie[2]}}else{if(ie){var fe=n.config.maxTime!==void 0?n.config.maxTime:n.config.maxDate;P=Math.min(P,fe.getHours()),P===fe.getHours()&&(L=Math.min(L,fe.getMinutes())),L===fe.getMinutes()&&(K=Math.min(K,fe.getSeconds()))}if(J){var me=n.config.minTime!==void 0?n.config.minTime:n.config.minDate;P=Math.max(P,me.getHours()),P===me.getHours()&&L<me.getMinutes()&&(L=me.getMinutes()),L===me.getMinutes()&&(K=Math.max(K,me.getSeconds()))}}p(P,L,K)}}function h(P){var L=P||n.latestSelectedDateObj;L&&L instanceof Date&&p(L.getHours(),L.getMinutes(),L.getSeconds())}function p(P,L,K){n.latestSelectedDateObj!==void 0&&n.latestSelectedDateObj.setHours(P%24,L,K||0,0),!(!n.hourElement||!n.minuteElement||n.isMobile)&&(n.hourElement.value=zt(n.config.time_24hr?P:(12+P)%12+12*rn(P%12===0)),n.minuteElement.value=zt(L),n.amPM!==void 0&&(n.amPM.textContent=n.l10n.amPM[rn(P>=12)]),n.secondElement!==void 0&&(n.secondElement.value=zt(K)))}function m(P){var L=Yt(P),K=parseInt(L.value)+(P.delta||0);(K/1e3>1||P.key==="Enter"&&!/[^\d]/.test(K.toString()))&&ae(K)}function g(P,L,K,J){if(L instanceof Array)return L.forEach(function(ie){return g(P,ie,K,J)});if(P instanceof Array)return P.forEach(function(ie){return g(ie,L,K,J)});P.addEventListener(L,K,J),n._handlers.push({remove:function(){return P.removeEventListener(L,K,J)}})}function v(){Fe("onChange")}function S(){if(n.config.wrap&&["open","close","toggle","clear"].forEach(function(K){Array.prototype.forEach.call(n.element.querySelectorAll("[data-"+K+"]"),function(J){return g(J,"click",n[K])})}),n.isMobile){Bu();return}var P=hg(Ve,50);if(n._debouncedChange=hg(v,LP),n.daysContainer&&!/iPhone|iPad|iPod/i.test(navigator.userAgent)&&g(n.daysContainer,"mouseover",function(K){n.config.mode==="range"&&Ae(Yt(K))}),g(n._input,"keydown",ge),n.calendarContainer!==void 0&&g(n.calendarContainer,"keydown",ge),!n.config.inline&&!n.config.static&&g(window,"resize",P),window.ontouchstart!==void 0?g(window.document,"touchstart",se):g(window.document,"mousedown",se),g(window.document,"focus",se,{capture:!0}),n.config.clickOpens===!0&&(g(n._input,"focus",n.open),g(n._input,"click",n.open)),n.daysContainer!==void 0&&(g(n.monthNav,"click",Bs),g(n.monthNav,["keyup","increment"],m),g(n.daysContainer,"click",St)),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0){var L=function(K){return Yt(K).select()};g(n.timeContainer,["increment"],l),g(n.timeContainer,"blur",l,{capture:!0}),g(n.timeContainer,"click",x),g([n.hourElement,n.minuteElement],["focus","click"],L),n.secondElement!==void 0&&g(n.secondElement,"focus",function(){return n.secondElement&&n.secondElement.select()}),n.amPM!==void 0&&g(n.amPM,"click",function(K){l(K)})}n.config.allowInput&&g(n._input,"blur",re)}function I(P,L){var K=P!==void 0?n.parseDate(P):n.latestSelectedDateObj||(n.config.minDate&&n.config.minDate>n.now?n.config.minDate:n.config.maxDate&&n.config.maxDate<n.now?n.config.maxDate:n.now),J=n.currentYear,ie=n.currentMonth;try{K!==void 0&&(n.currentYear=K.getFullYear(),n.currentMonth=K.getMonth())}catch(ce){ce.message="Invalid date supplied: "+K,n.config.errorHandler(ce)}L&&n.currentYear!==J&&(Fe("onYearChange"),j()),L&&(n.currentYear!==J||n.currentMonth!==ie)&&Fe("onMonthChange"),n.redraw()}function x(P){var L=Yt(P);~L.className.indexOf("arrow")&&C(P,L.classList.contains("arrowUp")?1:-1)}function C(P,L,K){var J=P&&Yt(P),ie=K||J&&J.parentNode&&J.parentNode.firstChild,ce=gi("increment");ce.delta=L,ie&&ie.dispatchEvent(ce)}function y(){var P=window.document.createDocumentFragment();if(n.calendarContainer=Le("div","flatpickr-calendar"),n.calendarContainer.tabIndex=-1,!n.config.noCalendar){if(P.appendChild($()),n.innerContainer=Le("div","flatpickr-innerContainer"),n.config.weekNumbers){var L=ee(),K=L.weekWrapper,J=L.weekNumbers;n.innerContainer.appendChild(K),n.weekNumbers=J,n.weekWrapper=K}n.rContainer=Le("div","flatpickr-rContainer"),n.rContainer.appendChild(H()),n.daysContainer||(n.daysContainer=Le("div","flatpickr-days"),n.daysContainer.tabIndex=-1),T(),n.rContainer.appendChild(n.daysContainer),n.innerContainer.appendChild(n.rContainer),P.appendChild(n.innerContainer)}n.config.enableTime&&P.appendChild(B()),Rt(n.calendarContainer,"rangeMode",n.config.mode==="range"),Rt(n.calendarContainer,"animate",n.config.animate===!0),Rt(n.calendarContainer,"multiMonth",n.config.showMonths>1),n.calendarContainer.appendChild(P);var ie=n.config.appendTo!==void 0&&n.config.appendTo.nodeType!==void 0;if((n.config.inline||n.config.static)&&(n.calendarContainer.classList.add(n.config.inline?"inline":"static"),n.config.inline&&(!ie&&n.element.parentNode?n.element.parentNode.insertBefore(n.calendarContainer,n._input.nextSibling):n.config.appendTo!==void 0&&n.config.appendTo.appendChild(n.calendarContainer)),n.config.static)){var ce=Le("div","flatpickr-wrapper");n.element.parentNode&&n.element.parentNode.insertBefore(ce,n.element),ce.appendChild(n.element),n.altInput&&ce.appendChild(n.altInput),ce.appendChild(n.calendarContainer)}!n.config.static&&!n.config.inline&&(n.config.appendTo!==void 0?n.config.appendTo:window.document.body).appendChild(n.calendarContainer)}function A(P,L,K,J){var ie=X(L,!0),ce=Le("span",P,L.getDate().toString());return ce.dateObj=L,ce.$i=J,ce.setAttribute("aria-label",n.formatDate(L,n.config.ariaDateFormat)),P.indexOf("hidden")===-1&&Kt(L,n.now)===0&&(n.todayDateElem=ce,ce.classList.add("today"),ce.setAttribute("aria-current","date")),ie?(ce.tabIndex=-1,Ao(L)&&(ce.classList.add("selected"),n.selectedDateElem=ce,n.config.mode==="range"&&(Rt(ce,"startRange",n.selectedDates[0]&&Kt(L,n.selectedDates[0],!0)===0),Rt(ce,"endRange",n.selectedDates[1]&&Kt(L,n.selectedDates[1],!0)===0),P==="nextMonthDay"&&ce.classList.add("inRange")))):ce.classList.add("flatpickr-disabled"),n.config.mode==="range"&&Ms(L)&&!Ao(L)&&ce.classList.add("inRange"),n.weekNumbers&&n.config.showMonths===1&&P!=="prevMonthDay"&&J%7===6&&n.weekNumbers.insertAdjacentHTML("beforeend","<span class='flatpickr-day'>"+n.config.getWeek(L)+"</span>"),Fe("onDayCreate",ce),ce}function E(P){P.focus(),n.config.mode==="range"&&Ae(P)}function _(P){for(var L=P>0?0:n.config.showMonths-1,K=P>0?n.config.showMonths:-1,J=L;J!=K;J+=P)for(var ie=n.daysContainer.children[J],ce=P>0?0:ie.children.length-1,we=P>0?ie.children.length:-1,ue=ce;ue!=we;ue+=P){var Ie=ie.children[ue];if(Ie.className.indexOf("hidden")===-1&&X(Ie.dateObj))return Ie}}function D(P,L){for(var K=P.className.indexOf("Month")===-1?P.dateObj.getMonth():n.currentMonth,J=L>0?n.config.showMonths:-1,ie=L>0?1:-1,ce=K-n.currentMonth;ce!=J;ce+=ie)for(var we=n.daysContainer.children[ce],ue=K-n.currentMonth===ce?P.$i+L:L<0?we.children.length-1:0,Ie=we.children.length,fe=ue;fe>=0&&fe<Ie&&fe!=(L>0?Ie:-1);fe+=ie){var me=we.children[fe];if(me.className.indexOf("hidden")===-1&&X(me.dateObj)&&Math.abs(P.$i-fe)>=Math.abs(L))return E(me)}n.changeMonth(ie),G(_(ie),0)}function G(P,L){var K=o(),J=le(K||document.body),ie=P!==void 0?P:J?K:n.selectedDateElem!==void 0&&le(n.selectedDateElem)?n.selectedDateElem:n.todayDateElem!==void 0&&le(n.todayDateElem)?n.todayDateElem:_(L>0?1:-1);ie===void 0?n._input.focus():J?D(ie,L):E(ie)}function F(P,L){for(var K=(new Date(P,L,1).getDay()-n.l10n.firstDayOfWeek+7)%7,J=n.utils.getDaysInMonth((L-1+12)%12,P),ie=n.utils.getDaysInMonth(L,P),ce=window.document.createDocumentFragment(),we=n.config.showMonths>1,ue=we?"prevMonthDay hidden":"prevMonthDay",Ie=we?"nextMonthDay hidden":"nextMonthDay",fe=J+1-K,me=0;fe<=J;fe++,me++)ce.appendChild(A("flatpickr-day "+ue,new Date(P,L-1,fe),fe,me));for(fe=1;fe<=ie;fe++,me++)ce.appendChild(A("flatpickr-day",new Date(P,L,fe),fe,me));for(var Re=ie+1;Re<=42-K&&(n.config.showMonths===1||me%7!==0);Re++,me++)ce.appendChild(A("flatpickr-day "+Ie,new Date(P,L+1,Re%ie),Re,me));var Dt=Le("div","dayContainer");return Dt.appendChild(ce),Dt}function T(){if(n.daysContainer!==void 0){es(n.daysContainer),n.weekNumbers&&es(n.weekNumbers);for(var P=document.createDocumentFragment(),L=0;L<n.config.showMonths;L++){var K=new Date(n.currentYear,n.currentMonth,1);K.setMonth(n.currentMonth+L),P.appendChild(F(K.getFullYear(),K.getMonth()))}n.daysContainer.appendChild(P),n.days=n.daysContainer.firstChild,n.config.mode==="range"&&n.selectedDates.length===1&&Ae()}}function j(){if(!(n.config.showMonths>1||n.config.monthSelectorType!=="dropdown")){var P=function(J){return n.config.minDate!==void 0&&n.currentYear===n.config.minDate.getFullYear()&&J<n.config.minDate.getMonth()?!1:!(n.config.maxDate!==void 0&&n.currentYear===n.config.maxDate.getFullYear()&&J>n.config.maxDate.getMonth())};n.monthsDropdownContainer.tabIndex=-1,n.monthsDropdownContainer.innerHTML="";for(var L=0;L<12;L++)if(P(L)){var K=Le("option","flatpickr-monthDropdown-month");K.value=new Date(n.currentYear,L).getMonth().toString(),K.textContent=ns(L,n.config.shorthandCurrentMonth,n.l10n),K.tabIndex=-1,n.currentMonth===L&&(K.selected=!0),n.monthsDropdownContainer.appendChild(K)}}}function Y(){var P=Le("div","flatpickr-month"),L=window.document.createDocumentFragment(),K;n.config.showMonths>1||n.config.monthSelectorType==="static"?K=Le("span","cur-month"):(n.monthsDropdownContainer=Le("select","flatpickr-monthDropdown-months"),n.monthsDropdownContainer.setAttribute("aria-label",n.l10n.monthAriaLabel),g(n.monthsDropdownContainer,"change",function(we){var ue=Yt(we),Ie=parseInt(ue.value,10);n.changeMonth(Ie-n.currentMonth),Fe("onMonthChange")}),j(),K=n.monthsDropdownContainer);var J=ts("cur-year",{tabindex:"-1"}),ie=J.getElementsByTagName("input")[0];ie.setAttribute("aria-label",n.l10n.yearAriaLabel),n.config.minDate&&ie.setAttribute("min",n.config.minDate.getFullYear().toString()),n.config.maxDate&&(ie.setAttribute("max",n.config.maxDate.getFullYear().toString()),ie.disabled=!!n.config.minDate&&n.config.minDate.getFullYear()===n.config.maxDate.getFullYear());var ce=Le("div","flatpickr-current-month");return ce.appendChild(K),ce.appendChild(J),L.appendChild(ce),P.appendChild(L),{container:P,yearElement:ie,monthElement:K}}function z(){es(n.monthNav),n.monthNav.appendChild(n.prevMonthNav),n.config.showMonths&&(n.yearElements=[],n.monthElements=[]);for(var P=n.config.showMonths;P--;){var L=Y();n.yearElements.push(L.yearElement),n.monthElements.push(L.monthElement),n.monthNav.appendChild(L.container)}n.monthNav.appendChild(n.nextMonthNav)}function $(){return n.monthNav=Le("div","flatpickr-months"),n.yearElements=[],n.monthElements=[],n.prevMonthNav=Le("span","flatpickr-prev-month"),n.prevMonthNav.innerHTML=n.config.prevArrow,n.nextMonthNav=Le("span","flatpickr-next-month"),n.nextMonthNav.innerHTML=n.config.nextArrow,z(),Object.defineProperty(n,"_hidePrevMonthArrow",{get:function(){return n.__hidePrevMonthArrow},set:function(P){n.__hidePrevMonthArrow!==P&&(Rt(n.prevMonthNav,"flatpickr-disabled",P),n.__hidePrevMonthArrow=P)}}),Object.defineProperty(n,"_hideNextMonthArrow",{get:function(){return n.__hideNextMonthArrow},set:function(P){n.__hideNextMonthArrow!==P&&(Rt(n.nextMonthNav,"flatpickr-disabled",P),n.__hideNextMonthArrow=P)}}),n.currentYearElement=n.yearElements[0],mi(),n.monthNav}function B(){n.calendarContainer.classList.add("hasTime"),n.config.noCalendar&&n.calendarContainer.classList.add("noCalendar");var P=Qc(n.config);n.timeContainer=Le("div","flatpickr-time"),n.timeContainer.tabIndex=-1;var L=Le("span","flatpickr-time-separator",":"),K=ts("flatpickr-hour",{"aria-label":n.l10n.hourAriaLabel});n.hourElement=K.getElementsByTagName("input")[0];var J=ts("flatpickr-minute",{"aria-label":n.l10n.minuteAriaLabel});if(n.minuteElement=J.getElementsByTagName("input")[0],n.hourElement.tabIndex=n.minuteElement.tabIndex=-1,n.hourElement.value=zt(n.latestSelectedDateObj?n.latestSelectedDateObj.getHours():n.config.time_24hr?P.hours:d(P.hours)),n.minuteElement.value=zt(n.latestSelectedDateObj?n.latestSelectedDateObj.getMinutes():P.minutes),n.hourElement.setAttribute("step",n.config.hourIncrement.toString()),n.minuteElement.setAttribute("step",n.config.minuteIncrement.toString()),n.hourElement.setAttribute("min",n.config.time_24hr?"0":"1"),n.hourElement.setAttribute("max",n.config.time_24hr?"23":"12"),n.hourElement.setAttribute("maxlength","2"),n.minuteElement.setAttribute("min","0"),n.minuteElement.setAttribute("max","59"),n.minuteElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(K),n.timeContainer.appendChild(L),n.timeContainer.appendChild(J),n.config.time_24hr&&n.timeContainer.classList.add("time24hr"),n.config.enableSeconds){n.timeContainer.classList.add("hasSeconds");var ie=ts("flatpickr-second");n.secondElement=ie.getElementsByTagName("input")[0],n.secondElement.value=zt(n.latestSelectedDateObj?n.latestSelectedDateObj.getSeconds():P.seconds),n.secondElement.setAttribute("step",n.minuteElement.getAttribute("step")),n.secondElement.setAttribute("min","0"),n.secondElement.setAttribute("max","59"),n.secondElement.setAttribute("maxlength","2"),n.timeContainer.appendChild(Le("span","flatpickr-time-separator",":")),n.timeContainer.appendChild(ie)}return n.config.time_24hr||(n.amPM=Le("span","flatpickr-am-pm",n.l10n.amPM[rn((n.latestSelectedDateObj?n.hourElement.value:n.config.defaultHour)>11)]),n.amPM.title=n.l10n.toggleTitle,n.amPM.tabIndex=-1,n.timeContainer.appendChild(n.amPM)),n.timeContainer}function H(){n.weekdayContainer?es(n.weekdayContainer):n.weekdayContainer=Le("div","flatpickr-weekdays");for(var P=n.config.showMonths;P--;){var L=Le("div","flatpickr-weekdaycontainer");n.weekdayContainer.appendChild(L)}return q(),n.weekdayContainer}function q(){if(n.weekdayContainer){var P=n.l10n.firstDayOfWeek,L=mg(n.l10n.weekdays.shorthand);P>0&&P<L.length&&(L=mg(L.splice(P,L.length),L.splice(0,P)));for(var K=n.config.showMonths;K--;)n.weekdayContainer.children[K].innerHTML=`
|
|
2454
|
+
<span class='flatpickr-weekday'>
|
|
2455
|
+
`+L.join("</span><span class='flatpickr-weekday'>")+`
|
|
2456
|
+
</span>
|
|
2457
|
+
`}}function ee(){n.calendarContainer.classList.add("hasWeeks");var P=Le("div","flatpickr-weekwrapper");P.appendChild(Le("span","flatpickr-weekday",n.l10n.weekAbbreviation));var L=Le("div","flatpickr-weeks");return P.appendChild(L),{weekWrapper:P,weekNumbers:L}}function R(P,L){L===void 0&&(L=!0);var K=L?P:P-n.currentMonth;K<0&&n._hidePrevMonthArrow===!0||K>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=K,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,Fe("onYearChange"),j()),T(),Fe("onMonthChange"),mi())}function M(P,L){if(P===void 0&&(P=!0),L===void 0&&(L=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,L===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var K=Qc(n.config),J=K.hours,ie=K.minutes,ce=K.seconds;p(J,ie,ce)}n.redraw(),P&&Fe("onChange")}function U(){n.isOpen=!1,n.isMobile||(n.calendarContainer!==void 0&&n.calendarContainer.classList.remove("open"),n._input!==void 0&&n._input.classList.remove("active")),Fe("onClose")}function V(){n.config!==void 0&&Fe("onDestroy");for(var P=n._handlers.length;P--;)n._handlers[P].remove();if(n._handlers=[],n.mobileInput)n.mobileInput.parentNode&&n.mobileInput.parentNode.removeChild(n.mobileInput),n.mobileInput=void 0;else if(n.calendarContainer&&n.calendarContainer.parentNode)if(n.config.static&&n.calendarContainer.parentNode){var L=n.calendarContainer.parentNode;if(L.lastChild&&L.removeChild(L.lastChild),L.parentNode){for(;L.firstChild;)L.parentNode.insertBefore(L.firstChild,L);L.parentNode.removeChild(L)}}else n.calendarContainer.parentNode.removeChild(n.calendarContainer);n.altInput&&(n.input.type="text",n.altInput.parentNode&&n.altInput.parentNode.removeChild(n.altInput),delete n.altInput),n.input&&(n.input.type=n.input._type,n.input.classList.remove("flatpickr-input"),n.input.removeAttribute("readonly")),["_showTimeInput","latestSelectedDateObj","_hideNextMonthArrow","_hidePrevMonthArrow","__hideNextMonthArrow","__hidePrevMonthArrow","isMobile","isOpen","selectedDateElem","minDateHasTime","maxDateHasTime","days","daysContainer","_input","_positionElement","innerContainer","rContainer","monthNav","todayDateElem","calendarContainer","weekdayContainer","prevMonthNav","nextMonthNav","monthsDropdownContainer","currentMonthElement","currentYearElement","navigationCurrentMonth","selectedDateElem","config"].forEach(function(K){try{delete n[K]}catch(J){}})}function ne(P){return n.calendarContainer.contains(P)}function se(P){if(n.isOpen&&!n.config.inline){var L=Yt(P),K=ne(L),J=L===n.input||L===n.altInput||n.element.contains(L)||P.path&&P.path.indexOf&&(~P.path.indexOf(n.input)||~P.path.indexOf(n.altInput)),ie=!J&&!K&&!ne(P.relatedTarget),ce=!n.config.ignoredFocusElements.some(function(we){return we.contains(L)});ie&&ce&&(n.config.allowInput&&n.setDate(n._input.value,!1,n.config.altInput?n.config.altFormat:n.config.dateFormat),n.timeContainer!==void 0&&n.minuteElement!==void 0&&n.hourElement!==void 0&&n.input.value!==""&&n.input.value!==void 0&&l(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function ae(P){if(!(!P||n.config.minDate&&P<n.config.minDate.getFullYear()||n.config.maxDate&&P>n.config.maxDate.getFullYear())){var L=P,K=n.currentYear!==L;n.currentYear=L||n.currentYear,n.config.maxDate&&n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth=Math.min(n.config.maxDate.getMonth(),n.currentMonth):n.config.minDate&&n.currentYear===n.config.minDate.getFullYear()&&(n.currentMonth=Math.max(n.config.minDate.getMonth(),n.currentMonth)),K&&(n.redraw(),Fe("onYearChange"),j())}}function X(P,L){var K;L===void 0&&(L=!0);var J=n.parseDate(P,void 0,L);if(n.config.minDate&&J&&Kt(J,n.config.minDate,L!==void 0?L:!n.minDateHasTime)<0||n.config.maxDate&&J&&Kt(J,n.config.maxDate,L!==void 0?L:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&n.config.disable.length===0)return!0;if(J===void 0)return!1;for(var ie=!!n.config.enable,ce=(K=n.config.enable)!==null&&K!==void 0?K:n.config.disable,we=0,ue=void 0;we<ce.length;we++){if(ue=ce[we],typeof ue=="function"&&ue(J))return ie;if(ue instanceof Date&&J!==void 0&&ue.getTime()===J.getTime())return ie;if(typeof ue=="string"){var Ie=n.parseDate(ue,void 0,!0);return Ie&&Ie.getTime()===J.getTime()?ie:!ie}else if(typeof ue=="object"&&J!==void 0&&ue.from&&ue.to&&J.getTime()>=ue.from.getTime()&&J.getTime()<=ue.to.getTime())return ie}return!ie}function le(P){return n.daysContainer!==void 0?P.className.indexOf("hidden")===-1&&P.className.indexOf("flatpickr-disabled")===-1&&n.daysContainer.contains(P):!1}function re(P){var L=P.target===n._input,K=n._input.value.trimEnd()!==To();L&&K&&!(P.relatedTarget&&ne(P.relatedTarget))&&n.setDate(n._input.value,!0,P.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function ge(P){var L=Yt(P),K=n.config.wrap?e.contains(L):L===n._input,J=n.config.allowInput,ie=n.isOpen&&(!J||!K),ce=n.config.inline&&K&&!J;if(P.keyCode===13&&K){if(J)return n.setDate(n._input.value,!0,L===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),L.blur();n.open()}else if(ne(L)||ie||ce){var we=!!n.timeContainer&&n.timeContainer.contains(L);switch(P.keyCode){case 13:we?(P.preventDefault(),l(),_e()):St(P);break;case 27:P.preventDefault(),_e();break;case 8:case 46:K&&!n.config.allowInput&&(P.preventDefault(),n.clear());break;case 37:case 39:if(!we&&!K){P.preventDefault();var ue=o();if(n.daysContainer!==void 0&&(J===!1||ue&&le(ue))){var Ie=P.keyCode===39?1:-1;P.ctrlKey?(P.stopPropagation(),R(Ie),G(_(1),0)):G(void 0,Ie)}}else n.hourElement&&n.hourElement.focus();break;case 38:case 40:P.preventDefault();var fe=P.keyCode===40?1:-1;n.daysContainer&&L.$i!==void 0||L===n.input||L===n.altInput?P.ctrlKey?(P.stopPropagation(),ae(n.currentYear-fe),G(_(1),0)):we||G(void 0,fe*7):L===n.currentYearElement?ae(n.currentYear-fe):n.config.enableTime&&(!we&&n.hourElement&&n.hourElement.focus(),l(P),n._debouncedChange());break;case 9:if(we){var me=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(nt){return nt}),Re=me.indexOf(L);if(Re!==-1){var Dt=me[Re+(P.shiftKey?-1:1)];P.preventDefault(),(Dt||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(L)&&P.shiftKey&&(P.preventDefault(),n._input.focus());break}}if(n.amPM!==void 0&&L===n.amPM)switch(P.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],f(),un();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],f(),un();break}(K||ne(L))&&Fe("onKeyDown",P)}function Ae(P,L){if(L===void 0&&(L="flatpickr-day"),!(n.selectedDates.length!==1||P&&(!P.classList.contains(L)||P.classList.contains("flatpickr-disabled")))){for(var K=P?P.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),J=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),ie=Math.min(K,n.selectedDates[0].getTime()),ce=Math.max(K,n.selectedDates[0].getTime()),we=!1,ue=0,Ie=0,fe=ie;fe<ce;fe+=RP.DAY)X(new Date(fe),!0)||(we=we||fe>ie&&fe<ce,fe<J&&(!ue||fe>ue)?ue=fe:fe>J&&(!Ie||fe<Ie)&&(Ie=fe));var me=Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+L));me.forEach(function(Re){var Dt=Re.dateObj,nt=Dt.getTime(),dn=ue>0&&nt<ue||Ie>0&&nt>Ie;if(dn){Re.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Sn){Re.classList.remove(Sn)});return}else if(we&&!dn)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Sn){Re.classList.remove(Sn)}),P!==void 0&&(P.classList.add(K<=n.selectedDates[0].getTime()?"startRange":"endRange"),J<K&&nt===J?Re.classList.add("startRange"):J>K&&nt===J&&Re.classList.add("endRange"),nt>=ue&&(Ie===0||nt<=Ie)&&DP(nt,J,K)&&Re.classList.add("inRange"))})}}function Ve(){n.isOpen&&!n.config.static&&!n.config.inline&&Ce()}function It(P,L){if(L===void 0&&(L=n._positionElement),n.isMobile===!0){if(P){P.preventDefault();var K=Yt(P);K&&K.blur()}n.mobileInput!==void 0&&(n.mobileInput.focus(),n.mobileInput.click()),Fe("onOpen");return}else if(n._input.disabled||n.config.inline)return;var J=n.isOpen;n.isOpen=!0,J||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),Fe("onOpen"),Ce(L)),n.config.enableTime===!0&&n.config.noCalendar===!0&&n.config.allowInput===!1&&(P===void 0||!n.timeContainer.contains(P.relatedTarget))&&setTimeout(function(){return n.hourElement.select()},50)}function ct(P){return function(L){var K=n.config["_"+P+"Date"]=n.parseDate(L,n.config.dateFormat),J=n.config["_"+(P==="min"?"max":"min")+"Date"];K!==void 0&&(n[P==="min"?"minDateHasTime":"maxDateHasTime"]=K.getHours()>0||K.getMinutes()>0||K.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(ie){return X(ie)}),!n.selectedDates.length&&P==="min"&&h(K),un()),n.daysContainer&&(Oe(),K!==void 0?n.currentYearElement[P]=K.getFullYear().toString():n.currentYearElement.removeAttribute(P),n.currentYearElement.disabled=!!J&&K!==void 0&&J.getFullYear()===K.getFullYear())}}function Pt(){var P=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],L=kt(kt({},JSON.parse(JSON.stringify(e.dataset||{}))),t),K={};n.config.parseDate=L.parseDate,n.config.formatDate=L.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(me){n.config._enable=or(me)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(me){n.config._disable=or(me)}});var J=L.mode==="time";if(!L.dateFormat&&(L.enableTime||J)){var ie=ht.defaultConfig.dateFormat||ri.dateFormat;K.dateFormat=L.noCalendar||J?"H:i"+(L.enableSeconds?":S":""):ie+" H:i"+(L.enableSeconds?":S":"")}if(L.altInput&&(L.enableTime||J)&&!L.altFormat){var ce=ht.defaultConfig.altFormat||ri.altFormat;K.altFormat=L.noCalendar||J?"h:i"+(L.enableSeconds?":S K":" K"):ce+(" h:i"+(L.enableSeconds?":S":"")+" K")}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:ct("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:ct("max")});var we=function(me){return function(Re){n.config[me==="min"?"_minTime":"_maxTime"]=n.parseDate(Re,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:we("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:we("max")}),L.mode==="time"&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,K,L);for(var ue=0;ue<P.length;ue++)n.config[P[ue]]=n.config[P[ue]]===!0||n.config[P[ue]]==="true";Wc.filter(function(me){return n.config[me]!==void 0}).forEach(function(me){n.config[me]=Gc(n.config[me]||[]).map(a)}),n.isMobile=!n.config.disableMobile&&!n.config.inline&&n.config.mode==="single"&&!n.config.disable.length&&!n.config.enable&&!n.config.weekNumbers&&/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent);for(var ue=0;ue<n.config.plugins.length;ue++){var Ie=n.config.plugins[ue](n)||{};for(var fe in Ie)Wc.indexOf(fe)>-1?n.config[fe]=Gc(Ie[fe]).map(a).concat(n.config[fe]):typeof L[fe]=="undefined"&&(n.config[fe]=Ie[fe])}L.altInputClass||(n.config.altInputClass=de().className+" "+n.config.altInputClass),Fe("onParseConfig")}function de(){return n.config.wrap?e.querySelector("[data-input]"):e}function he(){typeof n.config.locale!="object"&&typeof ht.l10ns[n.config.locale]=="undefined"&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=kt(kt({},ht.l10ns.default),typeof n.config.locale=="object"?n.config.locale:n.config.locale!=="default"?ht.l10ns[n.config.locale]:void 0),Cr.D="("+n.l10n.weekdays.shorthand.join("|")+")",Cr.l="("+n.l10n.weekdays.longhand.join("|")+")",Cr.M="("+n.l10n.months.shorthand.join("|")+")",Cr.F="("+n.l10n.months.longhand.join("|")+")",Cr.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")";var P=kt(kt({},t),JSON.parse(JSON.stringify(e.dataset||{})));P.time_24hr===void 0&&ht.defaultConfig.time_24hr===void 0&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=gg(n),n.parseDate=Kc({config:n.config,l10n:n.l10n})}function Ce(P){if(typeof n.config.position=="function")return void n.config.position(n,P);if(n.calendarContainer!==void 0){Fe("onPreCalendarPosition");var L=P||n._positionElement,K=Array.prototype.reduce.call(n.calendarContainer.children,function(_F,PF){return _F+PF.offsetHeight},0),J=n.calendarContainer.offsetWidth,ie=n.config.position.split(" "),ce=ie[0],we=ie.length>1?ie[1]:null,ue=L.getBoundingClientRect(),Ie=window.innerHeight-ue.bottom,fe=ce==="above"||ce!=="below"&&Ie<K&&ue.top>K,me=window.pageYOffset+ue.top+(fe?-K-2:L.offsetHeight+2);if(Rt(n.calendarContainer,"arrowTop",!fe),Rt(n.calendarContainer,"arrowBottom",fe),!n.config.inline){var Re=window.pageXOffset+ue.left,Dt=!1,nt=!1;we==="center"?(Re-=(J-ue.width)/2,Dt=!0):we==="right"&&(Re-=J-ue.width,nt=!0),Rt(n.calendarContainer,"arrowLeft",!Dt&&!nt),Rt(n.calendarContainer,"arrowCenter",Dt),Rt(n.calendarContainer,"arrowRight",nt);var dn=window.document.body.offsetWidth-(window.pageXOffset+ue.right),Sn=Re+J>window.document.body.offsetWidth,wF=dn+J>window.document.body.offsetWidth;if(Rt(n.calendarContainer,"rightMost",Sn),!n.config.static)if(n.calendarContainer.style.top=me+"px",!Sn)n.calendarContainer.style.left=Re+"px",n.calendarContainer.style.right="auto";else if(!wF)n.calendarContainer.style.left="auto",n.calendarContainer.style.right=dn+"px";else{var Nu=Ee();if(Nu===void 0)return;var IF=window.document.body.offsetWidth,SF=Math.max(0,IF/2-J/2),AF=".flatpickr-calendar.centerMost:before",TF=".flatpickr-calendar.centerMost:after",EF=Nu.cssRules.length,kF="{left:"+ue.left+"px;right:auto;}";Rt(n.calendarContainer,"rightMost",!1),Rt(n.calendarContainer,"centerMost",!0),Nu.insertRule(AF+","+TF+kF,EF),n.calendarContainer.style.left=SF+"px",n.calendarContainer.style.right="auto"}}}}function Ee(){for(var P=null,L=0;L<document.styleSheets.length;L++){var K=document.styleSheets[L];if(K.cssRules){try{K.cssRules}catch(J){continue}P=K;break}}return P!=null?P:He()}function He(){var P=document.createElement("style");return document.head.appendChild(P),P.sheet}function Oe(){n.config.noCalendar||n.isMobile||(j(),mi(),T())}function _e(){n._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(n.close,0):n.close()}function St(P){P.preventDefault(),P.stopPropagation();var L=function(me){return me.classList&&me.classList.contains("flatpickr-day")&&!me.classList.contains("flatpickr-disabled")&&!me.classList.contains("notAllowed")},K=pg(Yt(P),L);if(K!==void 0){var J=K,ie=n.latestSelectedDateObj=new Date(J.dateObj.getTime()),ce=(ie.getMonth()<n.currentMonth||ie.getMonth()>n.currentMonth+n.config.showMonths-1)&&n.config.mode!=="range";if(n.selectedDateElem=J,n.config.mode==="single")n.selectedDates=[ie];else if(n.config.mode==="multiple"){var we=Ao(ie);we?n.selectedDates.splice(parseInt(we),1):n.selectedDates.push(ie)}else n.config.mode==="range"&&(n.selectedDates.length===2&&n.clear(!1,!1),n.latestSelectedDateObj=ie,n.selectedDates.push(ie),Kt(ie,n.selectedDates[0],!0)!==0&&n.selectedDates.sort(function(me,Re){return me.getTime()-Re.getTime()}));if(f(),ce){var ue=n.currentYear!==ie.getFullYear();n.currentYear=ie.getFullYear(),n.currentMonth=ie.getMonth(),ue&&(Fe("onYearChange"),j()),Fe("onMonthChange")}if(mi(),T(),un(),!ce&&n.config.mode!=="range"&&n.config.showMonths===1?E(J):n.selectedDateElem!==void 0&&n.hourElement===void 0&&n.selectedDateElem&&n.selectedDateElem.focus(),n.hourElement!==void 0&&n.hourElement!==void 0&&n.hourElement.focus(),n.config.closeOnSelect){var Ie=n.config.mode==="single"&&!n.config.enableTime,fe=n.config.mode==="range"&&n.selectedDates.length===2&&!n.config.enableTime;(Ie||fe)&&_e()}v()}}var At={locale:[he,q],showMonths:[z,s,H],minDate:[I],maxDate:[I],positionElement:[So],clickOpens:[function(){n.config.clickOpens===!0?(g(n._input,"focus",n.open),g(n._input,"click",n.open)):(n._input.removeEventListener("focus",n.open),n._input.removeEventListener("click",n.open))}]};function jt(P,L){if(P!==null&&typeof P=="object"){Object.assign(n.config,P);for(var K in P)At[K]!==void 0&&At[K].forEach(function(J){return J()})}else n.config[P]=L,At[P]!==void 0?At[P].forEach(function(J){return J()}):Wc.indexOf(P)>-1&&(n.config[P]=Gc(L));n.redraw(),un(!0)}function Mt(P,L){var K=[];if(P instanceof Array)K=P.map(function(J){return n.parseDate(J,L)});else if(P instanceof Date||typeof P=="number")K=[n.parseDate(P,L)];else if(typeof P=="string")switch(n.config.mode){case"single":case"time":K=[n.parseDate(P,L)];break;case"multiple":K=P.split(n.config.conjunction).map(function(J){return n.parseDate(J,L)});break;case"range":K=P.split(n.l10n.rangeSeparator).map(function(J){return n.parseDate(J,L)});break}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(P)));n.selectedDates=n.config.allowInvalidPreload?K:K.filter(function(J){return J instanceof Date&&X(J,!1)}),n.config.mode==="range"&&n.selectedDates.sort(function(J,ie){return J.getTime()-ie.getTime()})}function qt(P,L,K){if(L===void 0&&(L=!1),K===void 0&&(K=n.config.dateFormat),P!==0&&!P||P instanceof Array&&P.length===0)return n.clear(L);Mt(P,K),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),I(void 0,L),h(),n.selectedDates.length===0&&n.clear(!1),un(L),L&&Fe("onChange")}function or(P){return P.slice().map(function(L){return typeof L=="string"||typeof L=="number"||L instanceof Date?n.parseDate(L,void 0,!0):L&&typeof L=="object"&&L.from&&L.to?{from:n.parseDate(L.from,void 0),to:n.parseDate(L.to,void 0)}:L}).filter(function(L){return L})}function Ls(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var P=n.config.defaultDate||((n.input.nodeName==="INPUT"||n.input.nodeName==="TEXTAREA")&&n.input.placeholder&&n.input.value===n.input.placeholder?null:n.input.value);P&&Mt(P,n.config.dateFormat),n._initialDate=n.selectedDates.length>0?n.selectedDates[0]:n.config.minDate&&n.config.minDate.getTime()>n.now.getTime()?n.config.minDate:n.config.maxDate&&n.config.maxDate.getTime()<n.now.getTime()?n.config.maxDate:n.now,n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth(),n.selectedDates.length>0&&(n.latestSelectedDateObj=n.selectedDates[0]),n.config.minTime!==void 0&&(n.config.minTime=n.parseDate(n.config.minTime,"H:i")),n.config.maxTime!==void 0&&(n.config.maxTime=n.parseDate(n.config.maxTime,"H:i")),n.minDateHasTime=!!n.config.minDate&&(n.config.minDate.getHours()>0||n.config.minDate.getMinutes()>0||n.config.minDate.getSeconds()>0),n.maxDateHasTime=!!n.config.maxDate&&(n.config.maxDate.getHours()>0||n.config.maxDate.getMinutes()>0||n.config.maxDate.getSeconds()>0)}function In(){if(n.input=de(),!n.input){n.config.errorHandler(new Error("Invalid input element specified"));return}n.input._type=n.input.type,n.input.type="text",n.input.classList.add("flatpickr-input"),n._input=n.input,n.config.altInput&&(n.altInput=Le(n.input.nodeName,n.config.altInputClass),n._input=n.altInput,n.altInput.placeholder=n.input.placeholder,n.altInput.disabled=n.input.disabled,n.altInput.required=n.input.required,n.altInput.tabIndex=n.input.tabIndex,n.altInput.type="text",n.input.setAttribute("type","hidden"),!n.config.static&&n.input.parentNode&&n.input.parentNode.insertBefore(n.altInput,n.input.nextSibling)),n.config.allowInput||n._input.setAttribute("readonly","readonly"),So()}function So(){n._positionElement=n.config.positionElement||n._input}function Bu(){var P=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=Le("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=P,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr=P==="datetime-local"?"Y-m-d\\TH:i:S":P==="date"?"Y-m-d":"H:i:S",n.selectedDates.length>0&&(n.mobileInput.defaultValue=n.mobileInput.value=n.formatDate(n.selectedDates[0],n.mobileFormatStr)),n.config.minDate&&(n.mobileInput.min=n.formatDate(n.config.minDate,"Y-m-d")),n.config.maxDate&&(n.mobileInput.max=n.formatDate(n.config.maxDate,"Y-m-d")),n.input.getAttribute("step")&&(n.mobileInput.step=String(n.input.getAttribute("step"))),n.input.type="hidden",n.altInput!==void 0&&(n.altInput.type="hidden");try{n.input.parentNode&&n.input.parentNode.insertBefore(n.mobileInput,n.input.nextSibling)}catch(L){}g(n.mobileInput,"change",function(L){n.setDate(Yt(L).value,!1,n.mobileFormatStr),Fe("onChange"),Fe("onClose")})}function $u(P){if(n.isOpen===!0)return n.close();n.open(P)}function Fe(P,L){if(n.config!==void 0){var K=n.config[P];if(K!==void 0&&K.length>0)for(var J=0;K[J]&&J<K.length;J++)K[J](n.selectedDates,n.input.value,n,L);P==="onChange"&&(n.input.dispatchEvent(gi("change")),n.input.dispatchEvent(gi("input")))}}function gi(P){var L=document.createEvent("Event");return L.initEvent(P,!0,!0),L}function Ao(P){for(var L=0;L<n.selectedDates.length;L++){var K=n.selectedDates[L];if(K instanceof Date&&Kt(K,P)===0)return""+L}return!1}function Ms(P){return n.config.mode!=="range"||n.selectedDates.length<2?!1:Kt(P,n.selectedDates[0])>=0&&Kt(P,n.selectedDates[1])<=0}function mi(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(P,L){var K=new Date(n.currentYear,n.currentMonth,1);K.setMonth(n.currentMonth+L),n.config.showMonths>1||n.config.monthSelectorType==="static"?n.monthElements[L].textContent=ns(K.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=K.getMonth().toString(),P.value=K.getFullYear().toString()}),n._hidePrevMonthArrow=n.config.minDate!==void 0&&(n.currentYear===n.config.minDate.getFullYear()?n.currentMonth<=n.config.minDate.getMonth():n.currentYear<n.config.minDate.getFullYear()),n._hideNextMonthArrow=n.config.maxDate!==void 0&&(n.currentYear===n.config.maxDate.getFullYear()?n.currentMonth+1>n.config.maxDate.getMonth():n.currentYear>n.config.maxDate.getFullYear()))}function To(P){var L=P||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(K){return n.formatDate(K,L)}).filter(function(K,J,ie){return n.config.mode!=="range"||n.config.enableTime||ie.indexOf(K)===J}).join(n.config.mode!=="range"?n.config.conjunction:n.l10n.rangeSeparator)}function un(P){P===void 0&&(P=!0),n.mobileInput!==void 0&&n.mobileFormatStr&&(n.mobileInput.value=n.latestSelectedDateObj!==void 0?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=To(n.config.dateFormat),n.altInput!==void 0&&(n.altInput.value=To(n.config.altFormat)),P!==!1&&Fe("onValueUpdate")}function Bs(P){var L=Yt(P),K=n.prevMonthNav.contains(L),J=n.nextMonthNav.contains(L);K||J?R(K?-1:1):n.yearElements.indexOf(L)>=0?L.select():L.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):L.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}function wt(P){P.preventDefault();var L=P.type==="keydown",K=Yt(P),J=K;n.amPM!==void 0&&K===n.amPM&&(n.amPM.textContent=n.l10n.amPM[rn(n.amPM.textContent===n.l10n.amPM[0])]);var ie=parseFloat(J.getAttribute("min")),ce=parseFloat(J.getAttribute("max")),we=parseFloat(J.getAttribute("step")),ue=parseInt(J.value,10),Ie=P.delta||(L?P.which===38?1:-1:0),fe=ue+we*Ie;if(typeof J.value!="undefined"&&J.value.length===2){var me=J===n.hourElement,Re=J===n.minuteElement;fe<ie?(fe=ce+fe+rn(!me)+(rn(me)&&rn(!n.amPM)),Re&&C(void 0,-1,n.hourElement)):fe>ce&&(fe=J===n.hourElement?fe-ce-rn(!n.amPM):ie,Re&&C(void 0,1,n.hourElement)),n.amPM&&me&&(we===1?fe+ue===23:Math.abs(fe-ue)>we)&&(n.amPM.textContent=n.l10n.amPM[rn(n.amPM.textContent===n.l10n.amPM[0])]),J.value=zt(fe)}}return i(),n}function ii(e,t){for(var n=Array.prototype.slice.call(e).filter(function(a){return a instanceof HTMLElement}),r=[],i=0;i<n.length;i++){var o=n[i];try{if(o.getAttribute("data-fp-omit")!==null)continue;o._flatpickr!==void 0&&(o._flatpickr.destroy(),o._flatpickr=void 0),o._flatpickr=MP(o,t||{}),r.push(o._flatpickr)}catch(a){console.error(a)}}return r.length===1?r[0]:r}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(e){return ii(this,e)},HTMLElement.prototype.flatpickr=function(e){return ii([this],e)});var ht=function(e,t){return typeof e=="string"?ii(window.document.querySelectorAll(e),t):e instanceof Node?ii([e],t):ii(e,t)};ht.defaultConfig={},ht.l10ns={en:kt({},io),default:kt({},io)},ht.localize=function(e){ht.l10ns.default=kt(kt({},ht.l10ns.default),e)},ht.setDefaults=function(e){ht.defaultConfig=kt(kt({},ht.defaultConfig),e)},ht.parseDate=Kc({}),ht.formatDate=gg({}),ht.compareDates=Kt,typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(e){return ii(this,e)}),Date.prototype.fp_incr=function(e){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof e=="string"?parseInt(e,10):e))},typeof window!="undefined"&&(window.flatpickr=ht);const BP=zu(Object.freeze(Object.defineProperty({__proto__:null,default:ht},Symbol.toStringTag,{value:"Module"})));(function(e){function t(R){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?t=function(U){return typeof U}:t=function(U){return U&&typeof Symbol=="function"&&U.constructor===Symbol&&U!==Symbol.prototype?"symbol":typeof U},t(R)}Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var n=s(w),r=o(BI),i=o(BP);function o(R){return R&&R.__esModule?R:{default:R}}function a(){if(typeof WeakMap!="function")return null;var R=new WeakMap;return a=function(){return R},R}function s(R){if(R&&R.__esModule)return R;if(R===null||t(R)!=="object"&&typeof R!="function")return{default:R};var M=a();if(M&&M.has(R))return M.get(R);var U={},V=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var ne in R)if(Object.prototype.hasOwnProperty.call(R,ne)){var se=V?Object.getOwnPropertyDescriptor(R,ne):null;se&&(se.get||se.set)?Object.defineProperty(U,ne,se):U[ne]=R[ne]}return U.default=R,M&&M.set(R,U),U}function l(R){return h(R)||f(R)||d(R)||c()}function c(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2458
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(R,M){if(R){if(typeof R=="string")return p(R,M);var U=Object.prototype.toString.call(R).slice(8,-1);if(U==="Object"&&R.constructor&&(U=R.constructor.name),U==="Map"||U==="Set")return Array.from(R);if(U==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(U))return p(R,M)}}function f(R){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(R))return Array.from(R)}function h(R){if(Array.isArray(R))return p(R)}function p(R,M){(M==null||M>R.length)&&(M=R.length);for(var U=0,V=new Array(M);U<M;U++)V[U]=R[U];return V}function m(){return m=Object.assign||function(R){for(var M=1;M<arguments.length;M++){var U=arguments[M];for(var V in U)Object.prototype.hasOwnProperty.call(U,V)&&(R[V]=U[V])}return R},m.apply(this,arguments)}function g(R,M){if(R==null)return{};var U=v(R,M),V,ne;if(Object.getOwnPropertySymbols){var se=Object.getOwnPropertySymbols(R);for(ne=0;ne<se.length;ne++)V=se[ne],!(M.indexOf(V)>=0)&&Object.prototype.propertyIsEnumerable.call(R,V)&&(U[V]=R[V])}return U}function v(R,M){if(R==null)return{};var U={},V=Object.keys(R),ne,se;for(se=0;se<V.length;se++)ne=V[se],!(M.indexOf(ne)>=0)&&(U[ne]=R[ne]);return U}function S(R,M){var U=Object.keys(R);if(Object.getOwnPropertySymbols){var V=Object.getOwnPropertySymbols(R);M&&(V=V.filter(function(ne){return Object.getOwnPropertyDescriptor(R,ne).enumerable})),U.push.apply(U,V)}return U}function I(R){for(var M=1;M<arguments.length;M++){var U=arguments[M]!=null?arguments[M]:{};M%2?S(Object(U),!0).forEach(function(V){j(R,V,U[V])}):Object.getOwnPropertyDescriptors?Object.defineProperties(R,Object.getOwnPropertyDescriptors(U)):S(Object(U)).forEach(function(V){Object.defineProperty(R,V,Object.getOwnPropertyDescriptor(U,V))})}return R}function x(R,M){if(!(R instanceof M))throw new TypeError("Cannot call a class as a function")}function C(R,M){for(var U=0;U<M.length;U++){var V=M[U];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(R,V.key,V)}}function y(R,M,U){return M&&C(R.prototype,M),R}function A(R,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");R.prototype=Object.create(M&&M.prototype,{constructor:{value:R,writable:!0,configurable:!0}}),M&&E(R,M)}function E(R,M){return E=Object.setPrototypeOf||function(V,ne){return V.__proto__=ne,V},E(R,M)}function _(R){var M=F();return function(){var V=T(R),ne;if(M){var se=T(this).constructor;ne=Reflect.construct(V,arguments,se)}else ne=V.apply(this,arguments);return D(this,ne)}}function D(R,M){return M&&(t(M)==="object"||typeof M=="function")?M:G(R)}function G(R){if(R===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return R}function F(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(R){return!1}}function T(R){return T=Object.setPrototypeOf?Object.getPrototypeOf:function(U){return U.__proto__||Object.getPrototypeOf(U)},T(R)}function j(R,M,U){return M in R?Object.defineProperty(R,M,{value:U,enumerable:!0,configurable:!0,writable:!0}):R[M]=U,R}var Y=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],z=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),$=["onCreate","onDestroy"],B=r.default.func,H=function(R){A(U,R);var M=_(U);function U(){var V;x(this,U);for(var ne=arguments.length,se=new Array(ne),ae=0;ae<ne;ae++)se[ae]=arguments[ae];return V=M.call.apply(M,[this].concat(se)),j(G(V),"createFlatpickrInstance",function(){var X=I({onClose:function(){V.node.blur&&V.node.blur()}},V.props.options);X=q(X,V.props),V.flatpickr=(0,i.default)(V.node,X),V.props.hasOwnProperty("value")&&V.flatpickr.setDate(V.props.value,!1);var le=V.props.onCreate;le&&le(V.flatpickr)}),j(G(V),"destroyFlatpickrInstance",function(){var X=V.props.onDestroy;X&&X(V.flatpickr),V.flatpickr.destroy(),V.flatpickr=null}),j(G(V),"handleNodeChange",function(X){V.node=X,V.flatpickr&&(V.destroyFlatpickrInstance(),V.createFlatpickrInstance())}),V}return y(U,[{key:"componentDidUpdate",value:function(ne){var se=this.props.options,ae=ne.options;se=q(se,this.props),ae=q(ae,ne);for(var X=Object.getOwnPropertyNames(se),le=X.length-1;le>=0;le--){var re=X[le],ge=se[re];ge!==ae[re]&&(Y.indexOf(re)!==-1&&!Array.isArray(ge)&&(ge=[ge]),this.flatpickr.set(re,ge))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&ne.value&&Array.isArray(ne.value)&&this.props.value.every(function(Ae,Ve){ne[Ve]}))&&this.props.value!==ne.value&&this.flatpickr.setDate(this.props.value,!1)}},{key:"componentDidMount",value:function(){this.createFlatpickrInstance()}},{key:"componentWillUnmount",value:function(){this.destroyFlatpickrInstance()}},{key:"render",value:function(){var ne=this.props,se=ne.options,ae=ne.defaultValue,X=ne.value,le=ne.children,re=ne.render,ge=g(ne,["options","defaultValue","value","children","render"]);return Y.forEach(function(Ae){delete ge[Ae]}),$.forEach(function(Ae){delete ge[Ae]}),re?re(I(I({},ge),{},{defaultValue:ae,value:X}),this.handleNodeChange):se.wrap?n.default.createElement("div",m({},ge,{ref:this.handleNodeChange}),le):n.default.createElement("input",m({},ge,{defaultValue:ae,ref:this.handleNodeChange}))}}]),U}(n.Component);j(H,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:z,onOpen:z,onClose:z,onMonthChange:z,onYearChange:z,onReady:z,onValueUpdate:z,onDayCreate:z,onCreate:B,onDestroy:B,value:r.default.oneOfType([r.default.string,r.default.array,r.default.object,r.default.number]),children:r.default.node,className:r.default.string,render:r.default.func}),j(H,"defaultProps",{options:{}});function q(R,M){var U=I({},R);return Y.forEach(function(V){if(M.hasOwnProperty(V)){var ne;U[V]&&!Array.isArray(U[V])?U[V]=[U[V]]:U[V]||(U[V]=[]);var se=Array.isArray(M[V])?M[V]:[M[V]];(ne=U[V]).push.apply(ne,l(se))}}),U}var ee=H;e.default=ee})(fg);const vg=fn(fg);var bg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Bt,function(){var n=1e3,r=6e4,i=36e5,o="millisecond",a="second",s="minute",l="hour",c="day",d="week",f="month",h="quarter",p="year",m="date",g="Invalid Date",v=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,S=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,I={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_"),ordinal:function(Y){var z=["th","st","nd","rd"],$=Y%100;return"["+Y+(z[($-20)%10]||z[$]||z[0])+"]"}},x=function(Y,z,$){var B=String(Y);return!B||B.length>=z?Y:""+Array(z+1-B.length).join($)+Y},C={s:x,z:function(Y){var z=-Y.utcOffset(),$=Math.abs(z),B=Math.floor($/60),H=$%60;return(z<=0?"+":"-")+x(B,2,"0")+":"+x(H,2,"0")},m:function Y(z,$){if(z.date()<$.date())return-Y($,z);var B=12*($.year()-z.year())+($.month()-z.month()),H=z.clone().add(B,f),q=$-H<0,ee=z.clone().add(B+(q?-1:1),f);return+(-(B+($-H)/(q?H-ee:ee-H))||0)},a:function(Y){return Y<0?Math.ceil(Y)||0:Math.floor(Y)},p:function(Y){return{M:f,y:p,w:d,d:c,D:m,h:l,m:s,s:a,ms:o,Q:h}[Y]||String(Y||"").toLowerCase().replace(/s$/,"")},u:function(Y){return Y===void 0}},y="en",A={};A[y]=I;var E="$isDayjsObject",_=function(Y){return Y instanceof T||!(!Y||!Y[E])},D=function Y(z,$,B){var H;if(!z)return y;if(typeof z=="string"){var q=z.toLowerCase();A[q]&&(H=q),$&&(A[q]=$,H=q);var ee=z.split("-");if(!H&&ee.length>1)return Y(ee[0])}else{var R=z.name;A[R]=z,H=R}return!B&&H&&(y=H),H||!B&&y},G=function(Y,z){if(_(Y))return Y.clone();var $=typeof z=="object"?z:{};return $.date=Y,$.args=arguments,new T($)},F=C;F.l=D,F.i=_,F.w=function(Y,z){return G(Y,{locale:z.$L,utc:z.$u,x:z.$x,$offset:z.$offset})};var T=function(){function Y($){this.$L=D($.locale,null,!0),this.parse($),this.$x=this.$x||$.x||{},this[E]=!0}var z=Y.prototype;return z.parse=function($){this.$d=function(B){var H=B.date,q=B.utc;if(H===null)return new Date(NaN);if(F.u(H))return new Date;if(H instanceof Date)return new Date(H);if(typeof H=="string"&&!/Z$/i.test(H)){var ee=H.match(v);if(ee){var R=ee[2]-1||0,M=(ee[7]||"0").substring(0,3);return q?new Date(Date.UTC(ee[1],R,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,M)):new Date(ee[1],R,ee[3]||1,ee[4]||0,ee[5]||0,ee[6]||0,M)}}return new Date(H)}($),this.init()},z.init=function(){var $=this.$d;this.$y=$.getFullYear(),this.$M=$.getMonth(),this.$D=$.getDate(),this.$W=$.getDay(),this.$H=$.getHours(),this.$m=$.getMinutes(),this.$s=$.getSeconds(),this.$ms=$.getMilliseconds()},z.$utils=function(){return F},z.isValid=function(){return this.$d.toString()!==g},z.isSame=function($,B){var H=G($);return this.startOf(B)<=H&&H<=this.endOf(B)},z.isAfter=function($,B){return G($)<this.startOf(B)},z.isBefore=function($,B){return this.endOf(B)<G($)},z.$g=function($,B,H){return F.u($)?this[B]:this.set(H,$)},z.unix=function(){return Math.floor(this.valueOf()/1e3)},z.valueOf=function(){return this.$d.getTime()},z.startOf=function($,B){var H=this,q=!!F.u(B)||B,ee=F.p($),R=function(le,re){var ge=F.w(H.$u?Date.UTC(H.$y,re,le):new Date(H.$y,re,le),H);return q?ge:ge.endOf(c)},M=function(le,re){return F.w(H.toDate()[le].apply(H.toDate("s"),(q?[0,0,0,0]:[23,59,59,999]).slice(re)),H)},U=this.$W,V=this.$M,ne=this.$D,se="set"+(this.$u?"UTC":"");switch(ee){case p:return q?R(1,0):R(31,11);case f:return q?R(1,V):R(0,V+1);case d:var ae=this.$locale().weekStart||0,X=(U<ae?U+7:U)-ae;return R(q?ne-X:ne+(6-X),V);case c:case m:return M(se+"Hours",0);case l:return M(se+"Minutes",1);case s:return M(se+"Seconds",2);case a:return M(se+"Milliseconds",3);default:return this.clone()}},z.endOf=function($){return this.startOf($,!1)},z.$set=function($,B){var H,q=F.p($),ee="set"+(this.$u?"UTC":""),R=(H={},H[c]=ee+"Date",H[m]=ee+"Date",H[f]=ee+"Month",H[p]=ee+"FullYear",H[l]=ee+"Hours",H[s]=ee+"Minutes",H[a]=ee+"Seconds",H[o]=ee+"Milliseconds",H)[q],M=q===c?this.$D+(B-this.$W):B;if(q===f||q===p){var U=this.clone().set(m,1);U.$d[R](M),U.init(),this.$d=U.set(m,Math.min(this.$D,U.daysInMonth())).$d}else R&&this.$d[R](M);return this.init(),this},z.set=function($,B){return this.clone().$set($,B)},z.get=function($){return this[F.p($)]()},z.add=function($,B){var H,q=this;$=Number($);var ee=F.p(B),R=function(V){var ne=G(q);return F.w(ne.date(ne.date()+Math.round(V*$)),q)};if(ee===f)return this.set(f,this.$M+$);if(ee===p)return this.set(p,this.$y+$);if(ee===c)return R(1);if(ee===d)return R(7);var M=(H={},H[s]=r,H[l]=i,H[a]=n,H)[ee]||1,U=this.$d.getTime()+$*M;return F.w(U,this)},z.subtract=function($,B){return this.add(-1*$,B)},z.format=function($){var B=this,H=this.$locale();if(!this.isValid())return H.invalidDate||g;var q=$||"YYYY-MM-DDTHH:mm:ssZ",ee=F.z(this),R=this.$H,M=this.$m,U=this.$M,V=H.weekdays,ne=H.months,se=H.meridiem,ae=function(re,ge,Ae,Ve){return re&&(re[ge]||re(B,q))||Ae[ge].slice(0,Ve)},X=function(re){return F.s(R%12||12,re,"0")},le=se||function(re,ge,Ae){var Ve=re<12?"AM":"PM";return Ae?Ve.toLowerCase():Ve};return q.replace(S,function(re,ge){return ge||function(Ae){switch(Ae){case"YY":return String(B.$y).slice(-2);case"YYYY":return F.s(B.$y,4,"0");case"M":return U+1;case"MM":return F.s(U+1,2,"0");case"MMM":return ae(H.monthsShort,U,ne,3);case"MMMM":return ae(ne,U);case"D":return B.$D;case"DD":return F.s(B.$D,2,"0");case"d":return String(B.$W);case"dd":return ae(H.weekdaysMin,B.$W,V,2);case"ddd":return ae(H.weekdaysShort,B.$W,V,3);case"dddd":return V[B.$W];case"H":return String(R);case"HH":return F.s(R,2,"0");case"h":return X(1);case"hh":return X(2);case"a":return le(R,M,!0);case"A":return le(R,M,!1);case"m":return String(M);case"mm":return F.s(M,2,"0");case"s":return String(B.$s);case"ss":return F.s(B.$s,2,"0");case"SSS":return F.s(B.$ms,3,"0");case"Z":return ee}return null}(re)||ee.replace(":","")})},z.utcOffset=function(){return 15*-Math.round(this.$d.getTimezoneOffset()/15)},z.diff=function($,B,H){var q,ee=this,R=F.p(B),M=G($),U=(M.utcOffset()-this.utcOffset())*r,V=this-M,ne=function(){return F.m(ee,M)};switch(R){case p:q=ne()/12;break;case f:q=ne();break;case h:q=ne()/3;break;case d:q=(V-U)/6048e5;break;case c:q=(V-U)/864e5;break;case l:q=V/i;break;case s:q=V/r;break;case a:q=V/n;break;default:q=V}return H?q:F.a(q)},z.daysInMonth=function(){return this.endOf(f).$D},z.$locale=function(){return A[this.$L]},z.locale=function($,B){if(!$)return this.$L;var H=this.clone(),q=D($,B,!0);return q&&(H.$L=q),H},z.clone=function(){return F.w(this.$d,this)},z.toDate=function(){return new Date(this.valueOf())},z.toJSON=function(){return this.isValid()?this.toISOString():null},z.toISOString=function(){return this.$d.toISOString()},z.toString=function(){return this.$d.toUTCString()},Y}(),j=T.prototype;return G.prototype=j,[["$ms",o],["$s",a],["$m",s],["$H",l],["$W",c],["$M",f],["$y",p],["$D",m]].forEach(function(Y){j[Y[1]]=function(z){return this.$g(z,Y[0],Y[1])}}),G.extend=function(Y,z){return Y.$i||(Y(z,T,G),Y.$i=!0),G},G.locale=D,G.isDayjs=_,G.unix=function(Y){return G(1e3*Y)},G.en=A[y],G.Ls=A,G.p={},G})})(bg);var $P=bg.exports;const _t=fn($P);var yg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Bt,function(){var n={year:0,month:1,day:2,hour:3,minute:4,second:5},r={};return function(i,o,a){var s,l=function(h,p,m){m===void 0&&(m={});var g=new Date(h),v=function(S,I){I===void 0&&(I={});var x=I.timeZoneName||"short",C=S+"|"+x,y=r[C];return y||(y=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:S,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",timeZoneName:x}),r[C]=y),y}(p,m);return v.formatToParts(g)},c=function(h,p){for(var m=l(h,p),g=[],v=0;v<m.length;v+=1){var S=m[v],I=S.type,x=S.value,C=n[I];C>=0&&(g[C]=parseInt(x,10))}var y=g[3],A=y===24?0:y,E=g[0]+"-"+g[1]+"-"+g[2]+" "+A+":"+g[4]+":"+g[5]+":000",_=+h;return(a.utc(E).valueOf()-(_-=_%1e3))/6e4},d=o.prototype;d.tz=function(h,p){h===void 0&&(h=s);var m,g=this.utcOffset(),v=this.toDate(),S=v.toLocaleString("en-US",{timeZone:h}),I=Math.round((v-new Date(S))/1e3/60),x=15*-Math.round(v.getTimezoneOffset()/15)-I;if(!Number(x))m=this.utcOffset(0,p);else if(m=a(S,{locale:this.$L}).$set("millisecond",this.$ms).utcOffset(x,!0),p){var C=m.utcOffset();m=m.add(g-C,"minute")}return m.$x.$timezone=h,m},d.offsetName=function(h){var p=this.$x.$timezone||a.tz.guess(),m=l(this.valueOf(),p,{timeZoneName:h}).find(function(g){return g.type.toLowerCase()==="timezonename"});return m&&m.value};var f=d.startOf;d.startOf=function(h,p){if(!this.$x||!this.$x.$timezone)return f.call(this,h,p);var m=a(this.format("YYYY-MM-DD HH:mm:ss:SSS"),{locale:this.$L});return f.call(m,h,p).tz(this.$x.$timezone,!0)},a.tz=function(h,p,m){var g=m&&p,v=m||p||s,S=c(+a(),v);if(typeof h!="string")return a(h).tz(v);var I=function(A,E,_){var D=A-60*E*1e3,G=c(D,_);if(E===G)return[D,E];var F=c(D-=60*(G-E)*1e3,_);return G===F?[D,G]:[A-60*Math.min(G,F)*1e3,Math.max(G,F)]}(a.utc(h,g).valueOf(),S,v),x=I[0],C=I[1],y=a(x).utcOffset(C);return y.$x.$timezone=v,y},a.tz.guess=function(){return Intl.DateTimeFormat().resolvedOptions().timeZone},a.tz.setDefault=function(h){s=h}}})})(yg);var NP=yg.exports;const FP=fn(NP);var xg={exports:{}};(function(e,t){(function(n,r){e.exports=r()})(Bt,function(){var n="minute",r=/[+-]\d\d(?::?\d\d)?/g,i=/([+-]|\d\d)/g;return function(o,a,s){var l=a.prototype;s.utc=function(g){var v={date:g,utc:!0,args:arguments};return new a(v)},l.utc=function(g){var v=s(this.toDate(),{locale:this.$L,utc:!0});return g?v.add(this.utcOffset(),n):v},l.local=function(){return s(this.toDate(),{locale:this.$L,utc:!1})};var c=l.parse;l.parse=function(g){g.utc&&(this.$u=!0),this.$utils().u(g.$offset)||(this.$offset=g.$offset),c.call(this,g)};var d=l.init;l.init=function(){if(this.$u){var g=this.$d;this.$y=g.getUTCFullYear(),this.$M=g.getUTCMonth(),this.$D=g.getUTCDate(),this.$W=g.getUTCDay(),this.$H=g.getUTCHours(),this.$m=g.getUTCMinutes(),this.$s=g.getUTCSeconds(),this.$ms=g.getUTCMilliseconds()}else d.call(this)};var f=l.utcOffset;l.utcOffset=function(g,v){var S=this.$utils().u;if(S(g))return this.$u?0:S(this.$offset)?f.call(this):this.$offset;if(typeof g=="string"&&(g=function(y){y===void 0&&(y="");var A=y.match(r);if(!A)return null;var E=(""+A[0]).match(i)||["-",0,0],_=E[0],D=60*+E[1]+ +E[2];return D===0?0:_==="+"?D:-D}(g),g===null))return this;var I=Math.abs(g)<=16?60*g:g,x=this;if(v)return x.$offset=I,x.$u=g===0,x;if(g!==0){var C=this.$u?this.toDate().getTimezoneOffset():-1*this.utcOffset();(x=this.local().add(I+C,n)).$offset=I,x.$x.$localOffset=C}else x=this.utc();return x};var h=l.format;l.format=function(g){var v=g||(this.$u?"YYYY-MM-DDTHH:mm:ss[Z]":"");return h.call(this,v)},l.valueOf=function(){var g=this.$utils().u(this.$offset)?0:this.$offset+(this.$x.$localOffset||this.$d.getTimezoneOffset());return this.$d.valueOf()-6e4*g},l.isUTC=function(){return!!this.$u},l.toISOString=function(){return this.toDate().toISOString()},l.toString=function(){return this.toDate().toUTCString()};var p=l.toDate;l.toDate=function(g){return g==="s"&&this.$offset?s(this.format("YYYY-MM-DD HH:mm:ss:SSS")).toDate():p.call(this)};var m=l.diff;l.diff=function(g,v,S){if(g&&this.$u===g.$u)return m.call(this,g,v,S);var I=this.local(),x=s(g).local();return m.call(I,x,v,S)}}})})(xg);var zP=xg.exports;const jP=fn(zP);_t.extend(FP),_t.extend(jP);const UP=e=>{if(!_t(e).isAfter(_t(Date.now()).subtract(15,"minute")))return _t(Date.now()).add(15,"minute").toDate()},Jc=({defaultDate:e,minDate:t,maxDate:n,dateFormat:r="DD.MM.YYYY HH:mm",onChange:i})=>{const o=a=>{if(a&&a.length){const s=_t.utc(a[0]).toISOString();i(s)}else i("")};return u.jsx(b.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",paddingLeft:"0.5rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,minHeight:"37px",color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:u.jsx(vg,{value:e&&_t(e).format("YYYY-MM-DD HH:mm")||void 0,onChange:o,className:"flatpickr-input",options:{enableTime:!0,dateFormat:r,position:"below",minDate:t||UP(e),maxDate:n,parseDate:(a,s)=>_t(a,s).toDate(),formatDate:(a,s)=>_t(a).format(s),time_24hr:!0,minuteIncrement:1}})})},VP=({required:e,defaultValue:t,onChangeFromDate:n,onChangeToDate:r})=>{const[i,o]=t;return u.jsxs(b.Box,{sx:{marginBottom:"16px"},children:[u.jsx(b.FormControl,{children:u.jsx(b.FormLabel,{required:e,color:"primary",children:"Duration"})}),u.jsxs(b.Grid,{container:!0,direction:"row",justifyContent:"flex-start",alignItems:"flex-start",children:[u.jsx(ro,{label:"From date",defaultValue:i,required:e,onChange:n}),u.jsx(ro,{label:"To date",defaultValue:o,required:e,onChange:r})]})]})},Cg=e=>{if(!e)return[];const{from:t,to:n}=e,r=[];return t&&r.push(_t(t).toDate()),n&&r.push(_t(n).toDate()),r},HP=({label:e,defaultValue:t,required:n,onChange:r})=>{const[i,o]=w.useState(Cg(t)),[a,s]=w.useState(!1),l=()=>s(!a),c=d=>{if(d&&d.length>0){const f="YYYY-MM-DD",h=_t(d[0]).format(f),p=_t(d[1]).format(f);r({from:h,to:p})}else d&&d.length===0&&(r({from:"",to:""}),l());o(d)};return u.jsxs(b.FormControl,{sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{required:n,color:"primary",children:e}),u.jsx(b.Box,{sx:{width:"100%",".flatpickr-input":{width:"100%",padding:"0.5rem 0.75rem",boxSizing:"border-box",fontSize:"1rem",lineHeight:1.3,color:"rgba(0, 0, 0, 0.87)",backgroundColor:"#fff",backgroundClip:"padding-box",border:"1px solid #ced4da",borderRadius:"0.375rem",transition:"border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out","&:focus":{borderColor:"#80bdff",outline:0,boxShadow:"0 0 0 0.2rem rgba(0, 123, 255, 0.25)"}}},children:u.jsx(vg,{value:i,onChange:c,placeholder:"Select Date...",className:"flatpickr-input",options:{mode:"range",enableTime:!1,dateFormat:"DD.MM.YYYY",altFormat:"DD.MM.YYYY",position:"below",parseDate:(d,f)=>_t(d,f).toDate(),formatDate:(d,f)=>_t(d).format(f),defaultDate:Cg(t)||void 0}})}),u.jsx(st,{showToast:a,message:"Succesfully cleared the duration time",color:"primary",hideToast:l})]})},WP=({environment:e,labels:t,setNoPermission:n})=>{const{featureDisabled:r,noPermissionMessage:i,tryAgainButton:o}=t,a=()=>{Vi(e).signOut().then(()=>n(null)).catch(s=>{console.error("There was a problem logging out the user:",s)})};return u.jsx(b.Box,{"data-testid":"no permission card",sx:{display:"flex",alignItems:"center",justifyContent:"center",minHeight:"100vh",bgcolor:"background.body"},children:u.jsx(b.Card,{variant:"outlined",sx:{maxWidth:300,overflow:"hidden",borderRadius:"md"},children:u.jsxs(b.CardContent,{children:[u.jsx(b.Typography,{level:"h2",textAlign:"center",mb:2,children:r}),u.jsx(b.Typography,{level:"body-md",color:"neutral",mb:2,children:i}),u.jsx(b.Box,{display:"flex",justifyContent:"center",children:u.jsx(b.Button,{variant:"solid",color:"neutral",fullWidth:!0,size:"sm",onClick:a,children:o})})]})})})},wg=e=>e?Object.entries(e).map(([t,n])=>({key:t,value:n})):[],Xc=e=>e.reduce((t,n)=>(t[n.key]=n.value,t),{}),GP=({labels:e,type:t,defaultValue:n,onChange:r})=>{const[i,o]=w.useState(wg(n)),[a,s]=w.useState(null),[l,c]=w.useState(""),[d,f]=w.useState(""),[h,p]=w.useState(""),[m,g]=w.useState("");w.useEffect(()=>o(wg(n)),[n]);const v=()=>{const C=[...i];C.push({key:l,value:h}),o(C),c(""),p(""),r(Xc(C))},S=C=>{const y=i.filter((A,E)=>E!==C);o(y),r(Xc(y))},I=(C,y)=>{f(y.key),g(y.value),s(C)},x=C=>{const y=[...i];y[C]={key:d,value:m},o(y),s(null),f(""),g(""),r(Xc(y))};return u.jsxs(b.Box,{children:[i.map((C,y)=>u.jsx(b.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:u.jsx(b.CardContent,{style:{flex:1},children:a===y?u.jsxs(b.Box,{display:"flex",alignItems:"center",children:[u.jsx(b.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:d,onChange:A=>f(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),u.jsx(b.Input,{size:"md",variant:"outlined",color:"neutral",defaultValue:m,onChange:A=>g(A.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),u.jsx(b.Tooltip,{title:e.save,children:d&&m?u.jsx(b.IconButton,{onClick:()=>x(y),children:u.jsx(ke.Check,{})}):u.jsx("span",{children:u.jsx(b.IconButton,{disabled:!0,children:u.jsx(ke.Check,{})})})})]}):u.jsxs(b.Box,{display:"flex",justifyContent:"space-between",alignItems:"center",children:[u.jsxs(b.Box,{children:[u.jsxs(b.Typography,{style:{fontWeight:"bold"},children:[e.keyDynamicFields,": ",u.jsx(b.Typography,{whiteSpace:"wrap",children:C.key})]}),u.jsxs(b.Typography,{style:{color:"gray"},children:[e.valueDynamicFields,": ",u.jsx(b.Typography,{whiteSpace:"wrap",children:C.value})]})]}),u.jsxs(b.Box,{children:[u.jsx(b.Tooltip,{title:e.edit,children:u.jsx(b.IconButton,{onClick:()=>I(y,C),children:u.jsx(ke.Edit,{})})}),u.jsx(b.Tooltip,{title:e.delete,children:u.jsx(b.IconButton,{onClick:()=>S(y),children:u.jsx(ke.Delete,{})})})]})]})})},`dynamic-fields-${t}-${y}`)),u.jsxs(b.Box,{display:"flex",alignItems:"center",style:{marginTop:i&&i.length?"20px":"0px"},children:[u.jsx(b.Input,{size:"md",variant:"outlined",color:"neutral",value:l,placeholder:e.keyDynamicFields,onChange:C=>c(C.target.value),sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),u.jsx(b.Input,{size:"md",variant:"outlined",color:"neutral",value:h,onChange:C=>p(C.target.value),placeholder:e.valueDynamicFields,sx:{backgroundColor:"#fff",borderRadius:"md",marginRight:"10px"}}),u.jsx(b.Tooltip,{title:e.add,children:l&&h?u.jsx(b.Button,{onClick:v,children:u.jsx(ke.Add,{})}):u.jsx("span",{children:u.jsx(b.Button,{disabled:!0,children:u.jsx(ke.Add,{})})})})]})]})};function ao(e,t,n){return(t=rc(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Ig(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(e,i).enumerable})),n.push.apply(n,r)}return n}function ve(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]!=null?arguments[t]:{};t%2?Ig(Object(n),!0).forEach(function(r){ao(e,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):Ig(Object(n)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(n,r))})}return e}function YP(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Sg(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,rc(r.key),r)}}function KP(e,t,n){return t&&Sg(e.prototype,t),n&&Sg(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function Zc(e,t){return Zc=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Zc(e,t)}function qP(e,t){if(typeof t!="function"&&t!==null)throw new 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&&Zc(e,t)}function rs(e){return rs=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},rs(e)}function Ag(){try{var e=!Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){}))}catch(t){}return(Ag=function(){return!!e})()}function QP(e){if(e===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function JP(e,t){if(t&&(vr(t)=="object"||typeof t=="function"))return t;if(t!==void 0)throw new TypeError("Derived constructors may only return object or undefined");return QP(e)}function XP(e){var t=Ag();return function(){var n,r=rs(e);if(t){var i=rs(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return JP(this,n)}}function eu(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function ZP(e){if(Array.isArray(e))return eu(e)}function eD(e){if(typeof Symbol!="undefined"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function Tg(e,t){if(e){if(typeof e=="string")return eu(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?eu(e,t):void 0}}function tD(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2459
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function oi(e){return ZP(e)||eD(e)||Tg(e)||tD()}function nD(e){if(Array.isArray(e))return e}function rD(e,t){var n=e==null?null:typeof Symbol!="undefined"&&e[Symbol.iterator]||e["@@iterator"];if(n!=null){var r,i,o,a,s=[],l=!0,c=!1;try{if(o=(n=n.call(e)).next,t===0){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==t);l=!0);}catch(d){c=!0,i=d}finally{try{if(!l&&n.return!=null&&(a=n.return(),Object(a)!==a))return}finally{if(c)throw i}}return s}}function iD(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
2460
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Un(e,t){return nD(e)||rD(e,t)||Tg(e,t)||iD()}function Cn(e,t){if(e==null)return{};var n,r,i=Te(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.includes(n)||{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function oD(e,t){return t||(t=e.slice(0)),Object.freeze(Object.defineProperties(e,{raw:{value:Object.freeze(t)}}))}var tu=w.useLayoutEffect,aD=["className","clearValue","cx","getStyles","getClassNames","getValue","hasValue","isMulti","isRtl","options","selectOption","selectProps","setValue","theme"],is=function(){};function sD(e,t){return t?t[0]==="-"?e+t:e+"__"+t:e}function lD(e,t){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];var o=[].concat(r);if(t&&e)for(var a in t)t.hasOwnProperty(a)&&t[a]&&o.push("".concat(sD(e,a)));return o.filter(function(s){return s}).map(function(s){return String(s).trim()}).join(" ")}var os=function(t){return vD(t)?t.filter(Boolean):vr(t)==="object"&&t!==null?[t]:[]},Eg=function(t){t.className,t.clearValue,t.cx,t.getStyles,t.getClassNames,t.getValue,t.hasValue,t.isMulti,t.isRtl,t.options,t.selectOption,t.selectProps,t.setValue,t.theme;var n=Cn(t,aD);return ve({},n)},tt=function(t,n,r){var i=t.cx,o=t.getStyles,a=t.getClassNames,s=t.className;return{css:o(n,t),className:i(r!=null?r:{},a(n,t),s)}};function as(e){return[document.documentElement,document.body,window].indexOf(e)>-1}function cD(e){return as(e)?window.innerHeight:e.clientHeight}function kg(e){return as(e)?window.pageYOffset:e.scrollTop}function ss(e,t){if(as(e)){window.scrollTo(0,t);return}e.scrollTop=t}function uD(e){var t=getComputedStyle(e),n=t.position==="absolute",r=/(auto|scroll)/;if(t.position==="fixed")return document.documentElement;for(var i=e;i=i.parentElement;)if(t=getComputedStyle(i),!(n&&t.position==="static")&&r.test(t.overflow+t.overflowY+t.overflowX))return i;return document.documentElement}function dD(e,t,n,r){return n*((e=e/r-1)*e*e+1)+t}function ls(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:200,r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:is,i=kg(e),o=t-i,a=10,s=0;function l(){s+=a;var c=dD(s,i,o,n);ss(e,c),s<n?window.requestAnimationFrame(l):r(e)}l()}function _g(e,t){var n=e.getBoundingClientRect(),r=t.getBoundingClientRect(),i=t.offsetHeight/3;r.bottom+i>n.bottom?ss(e,Math.min(t.offsetTop+t.clientHeight-e.offsetHeight+i,e.scrollHeight)):r.top-i<n.top&&ss(e,Math.max(t.offsetTop-i,0))}function fD(e){var t=e.getBoundingClientRect();return{bottom:t.bottom,height:t.height,left:t.left,right:t.right,top:t.top,width:t.width}}function Pg(){try{return document.createEvent("TouchEvent"),!0}catch(e){return!1}}function hD(){try{return/Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)}catch(e){return!1}}var Dg=!1,pD={get passive(){return Dg=!0}},cs=typeof window!="undefined"?window:{};cs.addEventListener&&cs.removeEventListener&&(cs.addEventListener("p",is,pD),cs.removeEventListener("p",is,!1));var gD=Dg;function mD(e){return e!=null}function vD(e){return Array.isArray(e)}function so(e,t,n){return e?t:n}function HF(e){return e}function WF(e){return e}var bD=function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];var o=Object.entries(t).filter(function(a){var s=Un(a,1),l=s[0];return!r.includes(l)});return o.reduce(function(a,s){var l=Un(s,2),c=l[0],d=l[1];return a[c]=d,a},{})},yD=["children","innerProps"],xD=["children","innerProps"];function CD(e){var t=e.maxHeight,n=e.menuEl,r=e.minHeight,i=e.placement,o=e.shouldScroll,a=e.isFixedPosition,s=e.controlHeight,l=uD(n),c={placement:"bottom",maxHeight:t};if(!n||!n.offsetParent)return c;var d=l.getBoundingClientRect(),f=d.height,h=n.getBoundingClientRect(),p=h.bottom,m=h.height,g=h.top,v=n.offsetParent.getBoundingClientRect(),S=v.top,I=a?window.innerHeight:cD(l),x=kg(l),C=parseInt(getComputedStyle(n).marginBottom,10),y=parseInt(getComputedStyle(n).marginTop,10),A=S-y,E=I-g,_=A+x,D=f-x-g,G=p-I+x+C,F=x+g-y,T=160;switch(i){case"auto":case"bottom":if(E>=m)return{placement:"bottom",maxHeight:t};if(D>=m&&!a)return o&&ls(l,G,T),{placement:"bottom",maxHeight:t};if(!a&&D>=r||a&&E>=r){o&&ls(l,G,T);var j=a?E-C:D-C;return{placement:"bottom",maxHeight:j}}if(i==="auto"||a){var Y=t,z=a?A:_;return z>=r&&(Y=Math.min(z-C-s,t)),{placement:"top",maxHeight:Y}}if(i==="bottom")return o&&ss(l,G),{placement:"bottom",maxHeight:t};break;case"top":if(A>=m)return{placement:"top",maxHeight:t};if(_>=m&&!a)return o&&ls(l,F,T),{placement:"top",maxHeight:t};if(!a&&_>=r||a&&A>=r){var $=t;return(!a&&_>=r||a&&A>=r)&&($=a?A-y:_-y),o&&ls(l,F,T),{placement:"top",maxHeight:$}}return{placement:"bottom",maxHeight:t};default:throw new Error('Invalid placement provided "'.concat(i,'".'))}return c}function wD(e){var t={bottom:"top",top:"bottom"};return e?t[e]:"bottom"}var Og=function(t){return t==="auto"?"bottom":t},ID=function(t,n){var r,i=t.placement,o=t.theme,a=o.borderRadius,s=o.spacing,l=o.colors;return ve((r={label:"menu"},ao(r,wD(i),"100%"),ao(r,"position","absolute"),ao(r,"width","100%"),ao(r,"zIndex",1),r),n?{}:{backgroundColor:l.neutral0,borderRadius:a,boxShadow:"0 0 0 1px hsla(0, 0%, 0%, 0.1), 0 4px 11px hsla(0, 0%, 0%, 0.1)",marginBottom:s.menuGutter,marginTop:s.menuGutter})},Rg=w.createContext(null),SD=function(t){var n=t.children,r=t.minMenuHeight,i=t.maxMenuHeight,o=t.menuPlacement,a=t.menuPosition,s=t.menuShouldScrollIntoView,l=t.theme,c=w.useContext(Rg)||{},d=c.setPortalPlacement,f=w.useRef(null),h=w.useState(i),p=Un(h,2),m=p[0],g=p[1],v=w.useState(null),S=Un(v,2),I=S[0],x=S[1],C=l.spacing.controlHeight;return tu(function(){var y=f.current;if(y){var A=a==="fixed",E=s&&!A,_=CD({maxHeight:i,menuEl:y,minHeight:r,placement:o,shouldScroll:E,isFixedPosition:A,controlHeight:C});g(_.maxHeight),x(_.placement),d==null||d(_.placement)}},[i,o,a,s,r,d,C]),n({ref:f,placerProps:ve(ve({},t),{},{placement:I||Og(o),maxHeight:m})})},AD=function(t){var n=t.children,r=t.innerRef,i=t.innerProps;return pe.jsx("div",O({},tt(t,"menu",{menu:!0}),{ref:r},i),n)},TD=AD,ED=function(t,n){var r=t.maxHeight,i=t.theme.spacing.baseUnit;return ve({maxHeight:r,overflowY:"auto",position:"relative",WebkitOverflowScrolling:"touch"},n?{}:{paddingBottom:i,paddingTop:i})},kD=function(t){var n=t.children,r=t.innerProps,i=t.innerRef,o=t.isMulti;return pe.jsx("div",O({},tt(t,"menuList",{"menu-list":!0,"menu-list--is-multi":o}),{ref:i},r),n)},Lg=function(t,n){var r=t.theme,i=r.spacing.baseUnit,o=r.colors;return ve({textAlign:"center"},n?{}:{color:o.neutral40,padding:"".concat(i*2,"px ").concat(i*3,"px")})},_D=Lg,PD=Lg,DD=function(t){var n=t.children,r=n===void 0?"No options":n,i=t.innerProps,o=Cn(t,yD);return pe.jsx("div",O({},tt(ve(ve({},o),{},{children:r,innerProps:i}),"noOptionsMessage",{"menu-notice":!0,"menu-notice--no-options":!0}),i),r)},OD=function(t){var n=t.children,r=n===void 0?"Loading...":n,i=t.innerProps,o=Cn(t,xD);return pe.jsx("div",O({},tt(ve(ve({},o),{},{children:r,innerProps:i}),"loadingMessage",{"menu-notice":!0,"menu-notice--loading":!0}),i),r)},RD=function(t){var n=t.rect,r=t.offset,i=t.position;return{left:n.left,position:i,top:r,width:n.width,zIndex:1}},LD=function(t){var n=t.appendTo,r=t.children,i=t.controlElement,o=t.innerProps,a=t.menuPlacement,s=t.menuPosition,l=w.useRef(null),c=w.useRef(null),d=w.useState(Og(a)),f=Un(d,2),h=f[0],p=f[1],m=w.useMemo(function(){return{setPortalPlacement:p}},[]),g=w.useState(null),v=Un(g,2),S=v[0],I=v[1],x=w.useCallback(function(){if(i){var E=fD(i),_=s==="fixed"?0:window.pageYOffset,D=E[h]+_;(D!==(S==null?void 0:S.offset)||E.left!==(S==null?void 0:S.rect.left)||E.width!==(S==null?void 0:S.rect.width))&&I({offset:D,rect:E})}},[i,s,h,S==null?void 0:S.offset,S==null?void 0:S.rect.left,S==null?void 0:S.rect.width]);tu(function(){x()},[x]);var C=w.useCallback(function(){typeof c.current=="function"&&(c.current(),c.current=null),i&&l.current&&(c.current=US(i,l.current,x,{elementResize:"ResizeObserver"in window}))},[i,x]);tu(function(){C()},[C]);var y=w.useCallback(function(E){l.current=E,C()},[C]);if(!n&&s!=="fixed"||!S)return null;var A=pe.jsx("div",O({ref:y},tt(ve(ve({},t),{},{offset:S.offset,position:s,rect:S.rect}),"menuPortal",{"menu-portal":!0}),o),r);return pe.jsx(Rg.Provider,{value:m},n?pt.createPortal(A,n):A)},MD=function(t){var n=t.isDisabled,r=t.isRtl;return{label:"container",direction:r?"rtl":void 0,pointerEvents:n?"none":void 0,position:"relative"}},BD=function(t){var n=t.children,r=t.innerProps,i=t.isDisabled,o=t.isRtl;return pe.jsx("div",O({},tt(t,"container",{"--is-disabled":i,"--is-rtl":o}),r),n)},$D=function(t,n){var r=t.theme.spacing,i=t.isMulti,o=t.hasValue,a=t.selectProps.controlShouldRenderValue;return ve({alignItems:"center",display:i&&o&&a?"flex":"grid",flex:1,flexWrap:"wrap",WebkitOverflowScrolling:"touch",position:"relative",overflow:"hidden"},n?{}:{padding:"".concat(r.baseUnit/2,"px ").concat(r.baseUnit*2,"px")})},ND=function(t){var n=t.children,r=t.innerProps,i=t.isMulti,o=t.hasValue;return pe.jsx("div",O({},tt(t,"valueContainer",{"value-container":!0,"value-container--is-multi":i,"value-container--has-value":o}),r),n)},FD=function(){return{alignItems:"center",alignSelf:"stretch",display:"flex",flexShrink:0}},zD=function(t){var n=t.children,r=t.innerProps;return pe.jsx("div",O({},tt(t,"indicatorsContainer",{indicators:!0}),r),n)},Mg,jD=["size"],UD=["innerProps","isRtl","size"],VD={name:"8mmkcg",styles:"display:inline-block;fill:currentColor;line-height:1;stroke:currentColor;stroke-width:0"},Bg=function(t){var n=t.size,r=Cn(t,jD);return pe.jsx("svg",O({height:n,width:n,viewBox:"0 0 20 20","aria-hidden":"true",focusable:"false",css:VD},r))},nu=function(t){return pe.jsx(Bg,O({size:20},t),pe.jsx("path",{d:"M14.348 14.849c-0.469 0.469-1.229 0.469-1.697 0l-2.651-3.030-2.651 3.029c-0.469 0.469-1.229 0.469-1.697 0-0.469-0.469-0.469-1.229 0-1.697l2.758-3.15-2.759-3.152c-0.469-0.469-0.469-1.228 0-1.697s1.228-0.469 1.697 0l2.652 3.031 2.651-3.031c0.469-0.469 1.228-0.469 1.697 0s0.469 1.229 0 1.697l-2.758 3.152 2.758 3.15c0.469 0.469 0.469 1.229 0 1.698z"}))},$g=function(t){return pe.jsx(Bg,O({size:20},t),pe.jsx("path",{d:"M4.516 7.548c0.436-0.446 1.043-0.481 1.576 0l3.908 3.747 3.908-3.747c0.533-0.481 1.141-0.446 1.574 0 0.436 0.445 0.408 1.197 0 1.615-0.406 0.418-4.695 4.502-4.695 4.502-0.217 0.223-0.502 0.335-0.787 0.335s-0.57-0.112-0.789-0.335c0 0-4.287-4.084-4.695-4.502s-0.436-1.17 0-1.615z"}))},Ng=function(t,n){var r=t.isFocused,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return ve({label:"indicatorContainer",display:"flex",transition:"color 150ms"},n?{}:{color:r?a.neutral60:a.neutral20,padding:o*2,":hover":{color:r?a.neutral80:a.neutral40}})},HD=Ng,WD=function(t){var n=t.children,r=t.innerProps;return pe.jsx("div",O({},tt(t,"dropdownIndicator",{indicator:!0,"dropdown-indicator":!0}),r),n||pe.jsx($g,null))},GD=Ng,YD=function(t){var n=t.children,r=t.innerProps;return pe.jsx("div",O({},tt(t,"clearIndicator",{indicator:!0,"clear-indicator":!0}),r),n||pe.jsx(nu,null))},KD=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing.baseUnit,a=i.colors;return ve({label:"indicatorSeparator",alignSelf:"stretch",width:1},n?{}:{backgroundColor:r?a.neutral10:a.neutral20,marginBottom:o*2,marginTop:o*2})},qD=function(t){var n=t.innerProps;return pe.jsx("span",O({},n,tt(t,"indicatorSeparator",{"indicator-separator":!0})))},QD=pe.keyframes(Mg||(Mg=oD([`
|
|
2461
|
+
0%, 80%, 100% { opacity: 0; }
|
|
2462
|
+
40% { opacity: 1; }
|
|
2463
|
+
`]))),JD=function(t,n){var r=t.isFocused,i=t.size,o=t.theme,a=o.colors,s=o.spacing.baseUnit;return ve({label:"loadingIndicator",display:"flex",transition:"color 150ms",alignSelf:"center",fontSize:i,lineHeight:1,marginRight:i,textAlign:"center",verticalAlign:"middle"},n?{}:{color:r?a.neutral60:a.neutral20,padding:s*2})},ru=function(t){var n=t.delay,r=t.offset;return pe.jsx("span",{css:pe.css({animation:"".concat(QD," 1s ease-in-out ").concat(n,"ms infinite;"),backgroundColor:"currentColor",borderRadius:"1em",display:"inline-block",marginLeft:r?"1em":void 0,height:"1em",verticalAlign:"top",width:"1em"},"","")})},XD=function(t){var n=t.innerProps,r=t.isRtl,i=t.size,o=i===void 0?4:i,a=Cn(t,UD);return pe.jsx("div",O({},tt(ve(ve({},a),{},{innerProps:n,isRtl:r,size:o}),"loadingIndicator",{indicator:!0,"loading-indicator":!0}),n),pe.jsx(ru,{delay:0,offset:r}),pe.jsx(ru,{delay:160,offset:!0}),pe.jsx(ru,{delay:320,offset:!r}))},ZD=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.theme,a=o.colors,s=o.borderRadius,l=o.spacing;return ve({label:"control",alignItems:"center",cursor:"default",display:"flex",flexWrap:"wrap",justifyContent:"space-between",minHeight:l.controlHeight,outline:"0 !important",position:"relative",transition:"all 100ms"},n?{}:{backgroundColor:r?a.neutral5:a.neutral0,borderColor:r?a.neutral10:i?a.primary:a.neutral20,borderRadius:s,borderStyle:"solid",borderWidth:1,boxShadow:i?"0 0 0 1px ".concat(a.primary):void 0,"&:hover":{borderColor:i?a.primary:a.neutral30}})},eO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.innerRef,a=t.innerProps,s=t.menuIsOpen;return pe.jsx("div",O({ref:o},tt(t,"control",{control:!0,"control--is-disabled":r,"control--is-focused":i,"control--menu-is-open":s}),a,{"aria-disabled":r||void 0}),n)},tO=eO,nO=["data"],rO=function(t,n){var r=t.theme.spacing;return n?{}:{paddingBottom:r.baseUnit*2,paddingTop:r.baseUnit*2}},iO=function(t){var n=t.children,r=t.cx,i=t.getStyles,o=t.getClassNames,a=t.Heading,s=t.headingProps,l=t.innerProps,c=t.label,d=t.theme,f=t.selectProps;return pe.jsx("div",O({},tt(t,"group",{group:!0}),l),pe.jsx(a,O({},s,{selectProps:f,theme:d,getStyles:i,getClassNames:o,cx:r}),c),pe.jsx("div",null,n))},oO=function(t,n){var r=t.theme,i=r.colors,o=r.spacing;return ve({label:"group",cursor:"default",display:"block"},n?{}:{color:i.neutral40,fontSize:"75%",fontWeight:500,marginBottom:"0.25em",paddingLeft:o.baseUnit*3,paddingRight:o.baseUnit*3,textTransform:"uppercase"})},aO=function(t){var n=Eg(t);n.data;var r=Cn(n,nO);return pe.jsx("div",O({},tt(t,"groupHeading",{"group-heading":!0}),r))},sO=iO,lO=["innerRef","isDisabled","isHidden","inputClassName"],cO=function(t,n){var r=t.isDisabled,i=t.value,o=t.theme,a=o.spacing,s=o.colors;return ve(ve({visibility:r?"hidden":"visible",transform:i?"translateZ(0)":""},uO),n?{}:{margin:a.baseUnit/2,paddingBottom:a.baseUnit/2,paddingTop:a.baseUnit/2,color:s.neutral80})},Fg={gridArea:"1 / 2",font:"inherit",minWidth:"2px",border:0,margin:0,outline:0,padding:0},uO={flex:"1 1 auto",display:"inline-grid",gridArea:"1 / 1 / 2 / 3",gridTemplateColumns:"0 min-content","&:after":ve({content:'attr(data-value) " "',visibility:"hidden",whiteSpace:"pre"},Fg)},dO=function(t){return ve({label:"input",color:"inherit",background:0,opacity:t?0:1,width:"100%"},Fg)},fO=function(t){var n=t.cx,r=t.value,i=Eg(t),o=i.innerRef,a=i.isDisabled,s=i.isHidden,l=i.inputClassName,c=Cn(i,lO);return pe.jsx("div",O({},tt(t,"input",{"input-container":!0}),{"data-value":r||""}),pe.jsx("input",O({className:n({input:!0},l),ref:o,style:dO(s),disabled:a},c)))},hO=fO,pO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors;return ve({label:"multiValue",display:"flex",minWidth:0},n?{}:{backgroundColor:a.neutral10,borderRadius:o/2,margin:i.baseUnit/2})},gO=function(t,n){var r=t.theme,i=r.borderRadius,o=r.colors,a=t.cropWithEllipsis;return ve({overflow:"hidden",textOverflow:a||a===void 0?"ellipsis":void 0,whiteSpace:"nowrap"},n?{}:{borderRadius:i/2,color:o.neutral80,fontSize:"85%",padding:3,paddingLeft:6})},mO=function(t,n){var r=t.theme,i=r.spacing,o=r.borderRadius,a=r.colors,s=t.isFocused;return ve({alignItems:"center",display:"flex"},n?{}:{borderRadius:o/2,backgroundColor:s?a.dangerLight:void 0,paddingLeft:i.baseUnit,paddingRight:i.baseUnit,":hover":{backgroundColor:a.dangerLight,color:a.danger}})},zg=function(t){var n=t.children,r=t.innerProps;return pe.jsx("div",r,n)},vO=zg,bO=zg;function yO(e){var t=e.children,n=e.innerProps;return pe.jsx("div",O({role:"button"},n),t||pe.jsx(nu,{size:14}))}var xO=function(t){var n=t.children,r=t.components,i=t.data,o=t.innerProps,a=t.isDisabled,s=t.removeProps,l=t.selectProps,c=r.Container,d=r.Label,f=r.Remove;return pe.jsx(c,{data:i,innerProps:ve(ve({},tt(t,"multiValue",{"multi-value":!0,"multi-value--is-disabled":a})),o),selectProps:l},pe.jsx(d,{data:i,innerProps:ve({},tt(t,"multiValueLabel",{"multi-value__label":!0})),selectProps:l},n),pe.jsx(f,{data:i,innerProps:ve(ve({},tt(t,"multiValueRemove",{"multi-value__remove":!0})),{},{"aria-label":"Remove ".concat(n||"option")},s),selectProps:l}))},CO=xO,wO=function(t,n){var r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.theme,s=a.spacing,l=a.colors;return ve({label:"option",cursor:"default",display:"block",fontSize:"inherit",width:"100%",userSelect:"none",WebkitTapHighlightColor:"rgba(0, 0, 0, 0)"},n?{}:{backgroundColor:o?l.primary:i?l.primary25:"transparent",color:r?l.neutral20:o?l.neutral0:"inherit",padding:"".concat(s.baseUnit*2,"px ").concat(s.baseUnit*3,"px"),":active":{backgroundColor:r?void 0:o?l.primary:l.primary50}})},IO=function(t){var n=t.children,r=t.isDisabled,i=t.isFocused,o=t.isSelected,a=t.innerRef,s=t.innerProps;return pe.jsx("div",O({},tt(t,"option",{option:!0,"option--is-disabled":r,"option--is-focused":i,"option--is-selected":o}),{ref:a,"aria-disabled":r},s),n)},SO=IO,AO=function(t,n){var r=t.theme,i=r.spacing,o=r.colors;return ve({label:"placeholder",gridArea:"1 / 1 / 2 / 3"},n?{}:{color:o.neutral50,marginLeft:i.baseUnit/2,marginRight:i.baseUnit/2})},TO=function(t){var n=t.children,r=t.innerProps;return pe.jsx("div",O({},tt(t,"placeholder",{placeholder:!0}),r),n)},EO=TO,kO=function(t,n){var r=t.isDisabled,i=t.theme,o=i.spacing,a=i.colors;return ve({label:"singleValue",gridArea:"1 / 1 / 2 / 3",maxWidth:"100%",overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},n?{}:{color:r?a.neutral40:a.neutral80,marginLeft:o.baseUnit/2,marginRight:o.baseUnit/2})},_O=function(t){var n=t.children,r=t.isDisabled,i=t.innerProps;return pe.jsx("div",O({},tt(t,"singleValue",{"single-value":!0,"single-value--is-disabled":r}),i),n)},PO=_O,DO={ClearIndicator:YD,Control:tO,DropdownIndicator:WD,DownChevron:$g,CrossIcon:nu,Group:sO,GroupHeading:aO,IndicatorsContainer:zD,IndicatorSeparator:qD,Input:hO,LoadingIndicator:XD,Menu:TD,MenuList:kD,MenuPortal:LD,LoadingMessage:OD,NoOptionsMessage:DD,MultiValue:CO,MultiValueContainer:vO,MultiValueLabel:bO,MultiValueRemove:yO,Option:SO,Placeholder:EO,SelectContainer:BD,SingleValue:PO,ValueContainer:ND},OO=function(t){return ve(ve({},DO),t.components)},jg=Number.isNaN||function(t){return typeof t=="number"&&t!==t};function RO(e,t){return!!(e===t||jg(e)&&jg(t))}function LO(e,t){if(e.length!==t.length)return!1;for(var n=0;n<e.length;n++)if(!RO(e[n],t[n]))return!1;return!0}function MO(e,t){t===void 0&&(t=LO);var n=null;function r(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];if(n&&n.lastThis===this&&t(i,n.lastArgs))return n.lastResult;var a=e.apply(this,i);return n={lastResult:a,lastArgs:i,lastThis:this},a}return r.clear=function(){n=null},r}for(var BO={name:"7pg0cj-a11yText",styles:"label:a11yText;z-index:9999;border:0;clip:rect(1px, 1px, 1px, 1px);height:1px;width:1px;position:absolute;overflow:hidden;padding:0;white-space:nowrap"},$O=function(t){return pe.jsx("span",O({css:BO},t))},Ug=$O,NO={guidance:function(t){var n=t.isSearchable,r=t.isMulti,i=t.tabSelectsValue,o=t.context,a=t.isInitialFocus;switch(o){case"menu":return"Use Up and Down to choose options, press Enter to select the currently focused option, press Escape to exit the menu".concat(i?", press Tab to select the option and exit the menu":"",".");case"input":return a?"".concat(t["aria-label"]||"Select"," is focused ").concat(n?",type to refine list":"",", press Down to open the menu, ").concat(r?" press left to focus selected values":""):"";case"value":return"Use left and right to toggle between focused values, press Backspace to remove the currently focused value";default:return""}},onChange:function(t){var n=t.action,r=t.label,i=r===void 0?"":r,o=t.labels,a=t.isDisabled;switch(n){case"deselect-option":case"pop-value":case"remove-value":return"option ".concat(i,", deselected.");case"clear":return"All selected options have been cleared.";case"initial-input-focus":return"option".concat(o.length>1?"s":""," ").concat(o.join(","),", selected.");case"select-option":return a?"option ".concat(i," is disabled. Select another option."):"option ".concat(i,", selected.");default:return""}},onFocus:function(t){var n=t.context,r=t.focused,i=t.options,o=t.label,a=o===void 0?"":o,s=t.selectValue,l=t.isDisabled,c=t.isSelected,d=t.isAppleDevice,f=function(g,v){return g&&g.length?"".concat(g.indexOf(v)+1," of ").concat(g.length):""};if(n==="value"&&s)return"value ".concat(a," focused, ").concat(f(s,r),".");if(n==="menu"&&d){var h=l?" disabled":"",p="".concat(c?" selected":"").concat(h);return"".concat(a).concat(p,", ").concat(f(i,r),".")}return""},onFilter:function(t){var n=t.inputValue,r=t.resultsMessage;return"".concat(r).concat(n?" for search term "+n:"",".")}},FO=function(t){var n=t.ariaSelection,r=t.focusedOption,i=t.focusedValue,o=t.focusableOptions,a=t.isFocused,s=t.selectValue,l=t.selectProps,c=t.id,d=t.isAppleDevice,f=l.ariaLiveMessages,h=l.getOptionLabel,p=l.inputValue,m=l.isMulti,g=l.isOptionDisabled,v=l.isSearchable,S=l.menuIsOpen,I=l.options,x=l.screenReaderStatus,C=l.tabSelectsValue,y=l.isLoading,A=l["aria-label"],E=l["aria-live"],_=w.useMemo(function(){return ve(ve({},NO),f||{})},[f]),D=w.useMemo(function(){var z="";if(n&&_.onChange){var $=n.option,B=n.options,H=n.removedValue,q=n.removedValues,ee=n.value,R=function(X){return Array.isArray(X)?null:X},M=H||$||R(ee),U=M?h(M):"",V=B||q||void 0,ne=V?V.map(h):[],se=ve({isDisabled:M&&g(M,s),label:U,labels:ne},n);z=_.onChange(se)}return z},[n,_,g,s,h]),G=w.useMemo(function(){var z="",$=r||i,B=!!(r&&s&&s.includes(r));if($&&_.onFocus){var H={focused:$,label:h($),isDisabled:g($,s),isSelected:B,options:o,context:$===r?"menu":"value",selectValue:s,isAppleDevice:d};z=_.onFocus(H)}return z},[r,i,h,g,_,o,s,d]),F=w.useMemo(function(){var z="";if(S&&I.length&&!y&&_.onFilter){var $=x({count:o.length});z=_.onFilter({inputValue:p,resultsMessage:$})}return z},[o,p,S,_,I,x,y]),T=(n==null?void 0:n.action)==="initial-input-focus",j=w.useMemo(function(){var z="";if(_.guidance){var $=i?"value":S?"menu":"input";z=_.guidance({"aria-label":A,context:$,isDisabled:r&&g(r,s),isMulti:m,isSearchable:v,tabSelectsValue:C,isInitialFocus:T})}return z},[A,r,i,m,g,v,S,_,s,C,T]),Y=pe.jsx(w.Fragment,null,pe.jsx("span",{id:"aria-selection"},D),pe.jsx("span",{id:"aria-focused"},G),pe.jsx("span",{id:"aria-results"},F),pe.jsx("span",{id:"aria-guidance"},j));return pe.jsx(w.Fragment,null,pe.jsx(Ug,{id:c},T&&Y),pe.jsx(Ug,{"aria-live":E,"aria-atomic":"false","aria-relevant":"additions text",role:"log"},a&&!T&&Y))},zO=FO,iu=[{base:"A",letters:"AⒶAÀÁÂẦẤẪẨÃĀĂẰẮẴẲȦǠÄǞẢÅǺǍȀȂẠẬẶḀĄȺⱯ"},{base:"AA",letters:"Ꜳ"},{base:"AE",letters:"ÆǼǢ"},{base:"AO",letters:"Ꜵ"},{base:"AU",letters:"Ꜷ"},{base:"AV",letters:"ꜸꜺ"},{base:"AY",letters:"Ꜽ"},{base:"B",letters:"BⒷBḂḄḆɃƂƁ"},{base:"C",letters:"CⒸCĆĈĊČÇḈƇȻꜾ"},{base:"D",letters:"DⒹDḊĎḌḐḒḎĐƋƊƉꝹ"},{base:"DZ",letters:"DZDŽ"},{base:"Dz",letters:"DzDž"},{base:"E",letters:"EⒺEÈÉÊỀẾỄỂẼĒḔḖĔĖËẺĚȄȆẸỆȨḜĘḘḚƐƎ"},{base:"F",letters:"FⒻFḞƑꝻ"},{base:"G",letters:"GⒼGǴĜḠĞĠǦĢǤƓꞠꝽꝾ"},{base:"H",letters:"HⒽHĤḢḦȞḤḨḪĦⱧⱵꞍ"},{base:"I",letters:"IⒾIÌÍÎĨĪĬİÏḮỈǏȈȊỊĮḬƗ"},{base:"J",letters:"JⒿJĴɈ"},{base:"K",letters:"KⓀKḰǨḲĶḴƘⱩꝀꝂꝄꞢ"},{base:"L",letters:"LⓁLĿĹĽḶḸĻḼḺŁȽⱢⱠꝈꝆꞀ"},{base:"LJ",letters:"LJ"},{base:"Lj",letters:"Lj"},{base:"M",letters:"MⓂMḾṀṂⱮƜ"},{base:"N",letters:"NⓃNǸŃÑṄŇṆŅṊṈȠƝꞐꞤ"},{base:"NJ",letters:"NJ"},{base:"Nj",letters:"Nj"},{base:"O",letters:"OⓄOÒÓÔỒỐỖỔÕṌȬṎŌṐṒŎȮȰÖȪỎŐǑȌȎƠỜỚỠỞỢỌỘǪǬØǾƆƟꝊꝌ"},{base:"OI",letters:"Ƣ"},{base:"OO",letters:"Ꝏ"},{base:"OU",letters:"Ȣ"},{base:"P",letters:"PⓅPṔṖƤⱣꝐꝒꝔ"},{base:"Q",letters:"QⓆQꝖꝘɊ"},{base:"R",letters:"RⓇRŔṘŘȐȒṚṜŖṞɌⱤꝚꞦꞂ"},{base:"S",letters:"SⓈSẞŚṤŜṠŠṦṢṨȘŞⱾꞨꞄ"},{base:"T",letters:"TⓉTṪŤṬȚŢṰṮŦƬƮȾꞆ"},{base:"TZ",letters:"Ꜩ"},{base:"U",letters:"UⓊUÙÚÛŨṸŪṺŬÜǛǗǕǙỦŮŰǓȔȖƯỪỨỮỬỰỤṲŲṶṴɄ"},{base:"V",letters:"VⓋVṼṾƲꝞɅ"},{base:"VY",letters:"Ꝡ"},{base:"W",letters:"WⓌWẀẂŴẆẄẈⱲ"},{base:"X",letters:"XⓍXẊẌ"},{base:"Y",letters:"YⓎYỲÝŶỸȲẎŸỶỴƳɎỾ"},{base:"Z",letters:"ZⓏZŹẐŻŽẒẔƵȤⱿⱫꝢ"},{base:"a",letters:"aⓐaẚàáâầấẫẩãāăằắẵẳȧǡäǟảåǻǎȁȃạậặḁąⱥɐ"},{base:"aa",letters:"ꜳ"},{base:"ae",letters:"æǽǣ"},{base:"ao",letters:"ꜵ"},{base:"au",letters:"ꜷ"},{base:"av",letters:"ꜹꜻ"},{base:"ay",letters:"ꜽ"},{base:"b",letters:"bⓑbḃḅḇƀƃɓ"},{base:"c",letters:"cⓒcćĉċčçḉƈȼꜿↄ"},{base:"d",letters:"dⓓdḋďḍḑḓḏđƌɖɗꝺ"},{base:"dz",letters:"dzdž"},{base:"e",letters:"eⓔeèéêềếễểẽēḕḗĕėëẻěȅȇẹệȩḝęḙḛɇɛǝ"},{base:"f",letters:"fⓕfḟƒꝼ"},{base:"g",letters:"gⓖgǵĝḡğġǧģǥɠꞡᵹꝿ"},{base:"h",letters:"hⓗhĥḣḧȟḥḩḫẖħⱨⱶɥ"},{base:"hv",letters:"ƕ"},{base:"i",letters:"iⓘiìíîĩīĭïḯỉǐȉȋịįḭɨı"},{base:"j",letters:"jⓙjĵǰɉ"},{base:"k",letters:"kⓚkḱǩḳķḵƙⱪꝁꝃꝅꞣ"},{base:"l",letters:"lⓛlŀĺľḷḹļḽḻſłƚɫⱡꝉꞁꝇ"},{base:"lj",letters:"lj"},{base:"m",letters:"mⓜmḿṁṃɱɯ"},{base:"n",letters:"nⓝnǹńñṅňṇņṋṉƞɲʼnꞑꞥ"},{base:"nj",letters:"nj"},{base:"o",letters:"oⓞoòóôồốỗổõṍȭṏōṑṓŏȯȱöȫỏőǒȍȏơờớỡởợọộǫǭøǿɔꝋꝍɵ"},{base:"oi",letters:"ƣ"},{base:"ou",letters:"ȣ"},{base:"oo",letters:"ꝏ"},{base:"p",letters:"pⓟpṕṗƥᵽꝑꝓꝕ"},{base:"q",letters:"qⓠqɋꝗꝙ"},{base:"r",letters:"rⓡrŕṙřȑȓṛṝŗṟɍɽꝛꞧꞃ"},{base:"s",letters:"sⓢsßśṥŝṡšṧṣṩșşȿꞩꞅẛ"},{base:"t",letters:"tⓣtṫẗťṭțţṱṯŧƭʈⱦꞇ"},{base:"tz",letters:"ꜩ"},{base:"u",letters:"uⓤuùúûũṹūṻŭüǜǘǖǚủůűǔȕȗưừứữửựụṳųṷṵʉ"},{base:"v",letters:"vⓥvṽṿʋꝟʌ"},{base:"vy",letters:"ꝡ"},{base:"w",letters:"wⓦwẁẃŵẇẅẘẉⱳ"},{base:"x",letters:"xⓧxẋẍ"},{base:"y",letters:"yⓨyỳýŷỹȳẏÿỷẙỵƴɏỿ"},{base:"z",letters:"zⓩzźẑżžẓẕƶȥɀⱬꝣ"}],jO=new RegExp("["+iu.map(function(e){return e.letters}).join("")+"]","g"),Vg={},ou=0;ou<iu.length;ou++)for(var au=iu[ou],su=0;su<au.letters.length;su++)Vg[au.letters[su]]=au.base;var Hg=function(t){return t.replace(jO,function(n){return Vg[n]})},UO=MO(Hg),Wg=function(t){return t.replace(/^\s+|\s+$/g,"")},VO=function(t){return"".concat(t.label," ").concat(t.value)},HO=function(t){return function(n,r){if(n.data.__isNew__)return!0;var i=ve({ignoreCase:!0,ignoreAccents:!0,stringify:VO,trim:!0,matchFrom:"any"},t),o=i.ignoreCase,a=i.ignoreAccents,s=i.stringify,l=i.trim,c=i.matchFrom,d=l?Wg(r):r,f=l?Wg(s(n)):s(n);return o&&(d=d.toLowerCase(),f=f.toLowerCase()),a&&(d=UO(d),f=Hg(f)),c==="start"?f.substr(0,d.length)===d:f.indexOf(d)>-1}},WO=["innerRef"];function GO(e){var t=e.innerRef,n=Cn(e,WO),r=bD(n,"onExited","in","enter","exit","appear");return pe.jsx("input",O({ref:t},r,{css:pe.css({label:"dummyInput",background:0,border:0,caretColor:"transparent",fontSize:"inherit",gridArea:"1 / 1 / 2 / 3",outline:0,padding:0,width:1,color:"transparent",left:-100,opacity:0,position:"relative",transform:"scale(.01)"},"","")}))}var YO=function(t){t.cancelable&&t.preventDefault(),t.stopPropagation()};function KO(e){var t=e.isEnabled,n=e.onBottomArrive,r=e.onBottomLeave,i=e.onTopArrive,o=e.onTopLeave,a=w.useRef(!1),s=w.useRef(!1),l=w.useRef(0),c=w.useRef(null),d=w.useCallback(function(v,S){if(c.current!==null){var I=c.current,x=I.scrollTop,C=I.scrollHeight,y=I.clientHeight,A=c.current,E=S>0,_=C-y-x,D=!1;_>S&&a.current&&(r&&r(v),a.current=!1),E&&s.current&&(o&&o(v),s.current=!1),E&&S>_?(n&&!a.current&&n(v),A.scrollTop=C,D=!0,a.current=!0):!E&&-S>x&&(i&&!s.current&&i(v),A.scrollTop=0,D=!0,s.current=!0),D&&YO(v)}},[n,r,i,o]),f=w.useCallback(function(v){d(v,v.deltaY)},[d]),h=w.useCallback(function(v){l.current=v.changedTouches[0].clientY},[]),p=w.useCallback(function(v){var S=l.current-v.changedTouches[0].clientY;d(v,S)},[d]),m=w.useCallback(function(v){if(v){var S=gD?{passive:!1}:!1;v.addEventListener("wheel",f,S),v.addEventListener("touchstart",h,S),v.addEventListener("touchmove",p,S)}},[p,h,f]),g=w.useCallback(function(v){v&&(v.removeEventListener("wheel",f,!1),v.removeEventListener("touchstart",h,!1),v.removeEventListener("touchmove",p,!1))},[p,h,f]);return w.useEffect(function(){if(t){var v=c.current;return m(v),function(){g(v)}}},[t,m,g]),function(v){c.current=v}}var Gg=["boxSizing","height","overflow","paddingRight","position"],Yg={boxSizing:"border-box",overflow:"hidden",position:"relative",height:"100%"};function Kg(e){e.preventDefault()}function qg(e){e.stopPropagation()}function Qg(){var e=this.scrollTop,t=this.scrollHeight,n=e+this.offsetHeight;e===0?this.scrollTop=1:n===t&&(this.scrollTop=e-1)}function Jg(){return"ontouchstart"in window||navigator.maxTouchPoints}var Xg=!!(typeof window!="undefined"&&window.document&&window.document.createElement),lo=0,ai={capture:!1,passive:!1};function qO(e){var t=e.isEnabled,n=e.accountForScrollbars,r=n===void 0?!0:n,i=w.useRef({}),o=w.useRef(null),a=w.useCallback(function(l){if(Xg){var c=document.body,d=c&&c.style;if(r&&Gg.forEach(function(m){var g=d&&d[m];i.current[m]=g}),r&&lo<1){var f=parseInt(i.current.paddingRight,10)||0,h=document.body?document.body.clientWidth:0,p=window.innerWidth-h+f||0;Object.keys(Yg).forEach(function(m){var g=Yg[m];d&&(d[m]=g)}),d&&(d.paddingRight="".concat(p,"px"))}c&&Jg()&&(c.addEventListener("touchmove",Kg,ai),l&&(l.addEventListener("touchstart",Qg,ai),l.addEventListener("touchmove",qg,ai))),lo+=1}},[r]),s=w.useCallback(function(l){if(Xg){var c=document.body,d=c&&c.style;lo=Math.max(lo-1,0),r&&lo<1&&Gg.forEach(function(f){var h=i.current[f];d&&(d[f]=h)}),c&&Jg()&&(c.removeEventListener("touchmove",Kg,ai),l&&(l.removeEventListener("touchstart",Qg,ai),l.removeEventListener("touchmove",qg,ai)))}},[r]);return w.useEffect(function(){if(t){var l=o.current;return a(l),function(){s(l)}}},[t,a,s]),function(l){o.current=l}}var QO=function(t){var n=t.target;return n.ownerDocument.activeElement&&n.ownerDocument.activeElement.blur()},JO={name:"1kfdb0e",styles:"position:fixed;left:0;bottom:0;right:0;top:0"};function XO(e){var t=e.children,n=e.lockEnabled,r=e.captureEnabled,i=r===void 0?!0:r,o=e.onBottomArrive,a=e.onBottomLeave,s=e.onTopArrive,l=e.onTopLeave,c=KO({isEnabled:i,onBottomArrive:o,onBottomLeave:a,onTopArrive:s,onTopLeave:l}),d=qO({isEnabled:n}),f=function(p){c(p),d(p)};return pe.jsx(w.Fragment,null,n&&pe.jsx("div",{onClick:QO,css:JO}),t(f))}var ZO={name:"1a0ro4n-requiredInput",styles:"label:requiredInput;opacity:0;pointer-events:none;position:absolute;bottom:0;left:0;right:0;width:100%"},eR=function(t){var n=t.name,r=t.onFocus;return pe.jsx("input",{required:!0,name:n,tabIndex:-1,"aria-hidden":"true",onFocus:r,css:ZO,value:"",onChange:function(){}})},tR=eR;function lu(e){var t;return typeof window!="undefined"&&window.navigator!=null?e.test(((t=window.navigator.userAgentData)===null||t===void 0?void 0:t.platform)||window.navigator.platform):!1}function nR(){return lu(/^iPhone/i)}function Zg(){return lu(/^Mac/i)}function rR(){return lu(/^iPad/i)||Zg()&&navigator.maxTouchPoints>1}function iR(){return nR()||rR()}function oR(){return Zg()||iR()}var aR=function(t){return t.label},em=function(t){return t.label},tm=function(t){return t.value},sR=function(t){return!!t.isDisabled},lR={clearIndicator:GD,container:MD,control:ZD,dropdownIndicator:HD,group:rO,groupHeading:oO,indicatorsContainer:FD,indicatorSeparator:KD,input:cO,loadingIndicator:JD,loadingMessage:PD,menu:ID,menuList:ED,menuPortal:RD,multiValue:pO,multiValueLabel:gO,multiValueRemove:mO,noOptionsMessage:_D,option:wO,placeholder:AO,singleValue:kO,valueContainer:$D},cR={primary:"#2684FF",primary75:"#4C9AFF",primary50:"#B2D4FF",primary25:"#DEEBFF",danger:"#DE350B",dangerLight:"#FFBDAD",neutral0:"hsl(0, 0%, 100%)",neutral5:"hsl(0, 0%, 95%)",neutral10:"hsl(0, 0%, 90%)",neutral20:"hsl(0, 0%, 80%)",neutral30:"hsl(0, 0%, 70%)",neutral40:"hsl(0, 0%, 60%)",neutral50:"hsl(0, 0%, 50%)",neutral60:"hsl(0, 0%, 40%)",neutral70:"hsl(0, 0%, 30%)",neutral80:"hsl(0, 0%, 20%)",neutral90:"hsl(0, 0%, 10%)"},uR=4,nm=4,dR=38,fR=nm*2,hR={baseUnit:nm,controlHeight:dR,menuGutter:fR},cu={borderRadius:uR,colors:cR,spacing:hR},pR={"aria-live":"polite",backspaceRemovesValue:!0,blurInputOnSelect:Pg(),captureMenuScroll:!Pg(),classNames:{},closeMenuOnSelect:!0,closeMenuOnScroll:!1,components:{},controlShouldRenderValue:!0,escapeClearsValue:!1,filterOption:HO(),formatGroupLabel:aR,getOptionLabel:em,getOptionValue:tm,isDisabled:!1,isLoading:!1,isMulti:!1,isRtl:!1,isSearchable:!0,isOptionDisabled:sR,loadingMessage:function(){return"Loading..."},maxMenuHeight:300,minMenuHeight:140,menuIsOpen:!1,menuPlacement:"bottom",menuPosition:"absolute",menuShouldBlockScroll:!1,menuShouldScrollIntoView:!hD(),noOptionsMessage:function(){return"No options"},openMenuOnFocus:!1,openMenuOnClick:!0,options:[],pageSize:5,placeholder:"Select...",screenReaderStatus:function(t){var n=t.count;return"".concat(n," result").concat(n!==1?"s":""," available")},styles:{},tabIndex:0,tabSelectsValue:!0,unstyled:!1};function rm(e,t,n,r){var i=lm(e,t,n),o=cm(e,t,n),a=sm(e,t),s=ds(e,t);return{type:"option",data:t,isDisabled:i,isSelected:o,label:a,value:s,index:r}}function us(e,t){return e.options.map(function(n,r){if("options"in n){var i=n.options.map(function(a,s){return rm(e,a,t,s)}).filter(function(a){return am(e,a)});return i.length>0?{type:"group",data:n,options:i,index:r}:void 0}var o=rm(e,n,t,r);return am(e,o)?o:void 0}).filter(mD)}function im(e){return e.reduce(function(t,n){return n.type==="group"?t.push.apply(t,oi(n.options.map(function(r){return r.data}))):t.push(n.data),t},[])}function om(e,t){return e.reduce(function(n,r){return r.type==="group"?n.push.apply(n,oi(r.options.map(function(i){return{data:i.data,id:"".concat(t,"-").concat(r.index,"-").concat(i.index)}}))):n.push({data:r.data,id:"".concat(t,"-").concat(r.index)}),n},[])}function gR(e,t){return im(us(e,t))}function am(e,t){var n=e.inputValue,r=n===void 0?"":n,i=t.data,o=t.isSelected,a=t.label,s=t.value;return(!dm(e)||!o)&&um(e,{label:a,value:s,data:i},r)}function mR(e,t){var n=e.focusedValue,r=e.selectValue,i=r.indexOf(n);if(i>-1){var o=t.indexOf(n);if(o>-1)return n;if(i<t.length)return t[i]}return null}function vR(e,t){var n=e.focusedOption;return n&&t.indexOf(n)>-1?n:t[0]}var uu=function(t,n){var r,i=(r=t.find(function(o){return o.data===n}))===null||r===void 0?void 0:r.id;return i||null},sm=function(t,n){return t.getOptionLabel(n)},ds=function(t,n){return t.getOptionValue(n)};function lm(e,t,n){return typeof e.isOptionDisabled=="function"?e.isOptionDisabled(t,n):!1}function cm(e,t,n){if(n.indexOf(t)>-1)return!0;if(typeof e.isOptionSelected=="function")return e.isOptionSelected(t,n);var r=ds(e,t);return n.some(function(i){return ds(e,i)===r})}function um(e,t,n){return e.filterOption?e.filterOption(t,n):!0}var dm=function(t){var n=t.hideSelectedOptions,r=t.isMulti;return n===void 0?r:n},bR=1,fm=function(e){qP(n,e);var t=XP(n);function n(r){var i;if(YP(this,n),i=t.call(this,r),i.state={ariaSelection:null,focusedOption:null,focusedOptionId:null,focusableOptionsWithIds:[],focusedValue:null,inputIsHidden:!1,isFocused:!1,selectValue:[],clearFocusValueOnUpdate:!1,prevWasFocused:!1,inputIsHiddenAfterUpdate:void 0,prevProps:void 0,instancePrefix:""},i.blockOptionHover=!1,i.isComposing=!1,i.commonProps=void 0,i.initialTouchX=0,i.initialTouchY=0,i.openAfterFocus=!1,i.scrollToFocusedOptionOnUpdate=!1,i.userIsDragging=void 0,i.isAppleDevice=oR(),i.controlRef=null,i.getControlRef=function(l){i.controlRef=l},i.focusedOptionRef=null,i.getFocusedOptionRef=function(l){i.focusedOptionRef=l},i.menuListRef=null,i.getMenuListRef=function(l){i.menuListRef=l},i.inputRef=null,i.getInputRef=function(l){i.inputRef=l},i.focus=i.focusInput,i.blur=i.blurInput,i.onChange=function(l,c){var d=i.props,f=d.onChange,h=d.name;c.name=h,i.ariaOnChange(l,c),f(l,c)},i.setValue=function(l,c,d){var f=i.props,h=f.closeMenuOnSelect,p=f.isMulti,m=f.inputValue;i.onInputChange("",{action:"set-value",prevInputValue:m}),h&&(i.setState({inputIsHiddenAfterUpdate:!p}),i.onMenuClose()),i.setState({clearFocusValueOnUpdate:!0}),i.onChange(l,{action:c,option:d})},i.selectOption=function(l){var c=i.props,d=c.blurInputOnSelect,f=c.isMulti,h=c.name,p=i.state.selectValue,m=f&&i.isOptionSelected(l,p),g=i.isOptionDisabled(l,p);if(m){var v=i.getOptionValue(l);i.setValue(p.filter(function(S){return i.getOptionValue(S)!==v}),"deselect-option",l)}else if(!g)f?i.setValue([].concat(oi(p),[l]),"select-option",l):i.setValue(l,"select-option");else{i.ariaOnChange(l,{action:"select-option",option:l,name:h});return}d&&i.blurInput()},i.removeValue=function(l){var c=i.props.isMulti,d=i.state.selectValue,f=i.getOptionValue(l),h=d.filter(function(m){return i.getOptionValue(m)!==f}),p=so(c,h,h[0]||null);i.onChange(p,{action:"remove-value",removedValue:l}),i.focusInput()},i.clearValue=function(){var l=i.state.selectValue;i.onChange(so(i.props.isMulti,[],null),{action:"clear",removedValues:l})},i.popValue=function(){var l=i.props.isMulti,c=i.state.selectValue,d=c[c.length-1],f=c.slice(0,c.length-1),h=so(l,f,f[0]||null);i.onChange(h,{action:"pop-value",removedValue:d})},i.getFocusedOptionId=function(l){return uu(i.state.focusableOptionsWithIds,l)},i.getFocusableOptionsWithIds=function(){return om(us(i.props,i.state.selectValue),i.getElementId("option"))},i.getValue=function(){return i.state.selectValue},i.cx=function(){for(var l=arguments.length,c=new Array(l),d=0;d<l;d++)c[d]=arguments[d];return lD.apply(void 0,[i.props.classNamePrefix].concat(c))},i.getOptionLabel=function(l){return sm(i.props,l)},i.getOptionValue=function(l){return ds(i.props,l)},i.getStyles=function(l,c){var d=i.props.unstyled,f=lR[l](c,d);f.boxSizing="border-box";var h=i.props.styles[l];return h?h(f,c):f},i.getClassNames=function(l,c){var d,f;return(d=(f=i.props.classNames)[l])===null||d===void 0?void 0:d.call(f,c)},i.getElementId=function(l){return"".concat(i.state.instancePrefix,"-").concat(l)},i.getComponents=function(){return OO(i.props)},i.buildCategorizedOptions=function(){return us(i.props,i.state.selectValue)},i.getCategorizedOptions=function(){return i.props.menuIsOpen?i.buildCategorizedOptions():[]},i.buildFocusableOptions=function(){return im(i.buildCategorizedOptions())},i.getFocusableOptions=function(){return i.props.menuIsOpen?i.buildFocusableOptions():[]},i.ariaOnChange=function(l,c){i.setState({ariaSelection:ve({value:l},c)})},i.onMenuMouseDown=function(l){l.button===0&&(l.stopPropagation(),l.preventDefault(),i.focusInput())},i.onMenuMouseMove=function(l){i.blockOptionHover=!1},i.onControlMouseDown=function(l){if(!l.defaultPrevented){var c=i.props.openMenuOnClick;i.state.isFocused?i.props.menuIsOpen?l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&i.onMenuClose():c&&i.openMenu("first"):(c&&(i.openAfterFocus=!0),i.focusInput()),l.target.tagName!=="INPUT"&&l.target.tagName!=="TEXTAREA"&&l.preventDefault()}},i.onDropdownIndicatorMouseDown=function(l){if(!(l&&l.type==="mousedown"&&l.button!==0)&&!i.props.isDisabled){var c=i.props,d=c.isMulti,f=c.menuIsOpen;i.focusInput(),f?(i.setState({inputIsHiddenAfterUpdate:!d}),i.onMenuClose()):i.openMenu("first"),l.preventDefault()}},i.onClearIndicatorMouseDown=function(l){l&&l.type==="mousedown"&&l.button!==0||(i.clearValue(),l.preventDefault(),i.openAfterFocus=!1,l.type==="touchend"?i.focusInput():setTimeout(function(){return i.focusInput()}))},i.onScroll=function(l){typeof i.props.closeMenuOnScroll=="boolean"?l.target instanceof HTMLElement&&as(l.target)&&i.props.onMenuClose():typeof i.props.closeMenuOnScroll=="function"&&i.props.closeMenuOnScroll(l)&&i.props.onMenuClose()},i.onCompositionStart=function(){i.isComposing=!0},i.onCompositionEnd=function(){i.isComposing=!1},i.onTouchStart=function(l){var c=l.touches,d=c&&c.item(0);d&&(i.initialTouchX=d.clientX,i.initialTouchY=d.clientY,i.userIsDragging=!1)},i.onTouchMove=function(l){var c=l.touches,d=c&&c.item(0);if(d){var f=Math.abs(d.clientX-i.initialTouchX),h=Math.abs(d.clientY-i.initialTouchY),p=5;i.userIsDragging=f>p||h>p}},i.onTouchEnd=function(l){i.userIsDragging||(i.controlRef&&!i.controlRef.contains(l.target)&&i.menuListRef&&!i.menuListRef.contains(l.target)&&i.blurInput(),i.initialTouchX=0,i.initialTouchY=0)},i.onControlTouchEnd=function(l){i.userIsDragging||i.onControlMouseDown(l)},i.onClearIndicatorTouchEnd=function(l){i.userIsDragging||i.onClearIndicatorMouseDown(l)},i.onDropdownIndicatorTouchEnd=function(l){i.userIsDragging||i.onDropdownIndicatorMouseDown(l)},i.handleInputChange=function(l){var c=i.props.inputValue,d=l.currentTarget.value;i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange(d,{action:"input-change",prevInputValue:c}),i.props.menuIsOpen||i.onMenuOpen()},i.onInputFocus=function(l){i.props.onFocus&&i.props.onFocus(l),i.setState({inputIsHiddenAfterUpdate:!1,isFocused:!0}),(i.openAfterFocus||i.props.openMenuOnFocus)&&i.openMenu("first"),i.openAfterFocus=!1},i.onInputBlur=function(l){var c=i.props.inputValue;if(i.menuListRef&&i.menuListRef.contains(document.activeElement)){i.inputRef.focus();return}i.props.onBlur&&i.props.onBlur(l),i.onInputChange("",{action:"input-blur",prevInputValue:c}),i.onMenuClose(),i.setState({focusedValue:null,isFocused:!1})},i.onOptionHover=function(l){if(!(i.blockOptionHover||i.state.focusedOption===l)){var c=i.getFocusableOptions(),d=c.indexOf(l);i.setState({focusedOption:l,focusedOptionId:d>-1?i.getFocusedOptionId(l):null})}},i.shouldHideSelectedOptions=function(){return dm(i.props)},i.onValueInputFocus=function(l){l.preventDefault(),l.stopPropagation(),i.focus()},i.onKeyDown=function(l){var c=i.props,d=c.isMulti,f=c.backspaceRemovesValue,h=c.escapeClearsValue,p=c.inputValue,m=c.isClearable,g=c.isDisabled,v=c.menuIsOpen,S=c.onKeyDown,I=c.tabSelectsValue,x=c.openMenuOnFocus,C=i.state,y=C.focusedOption,A=C.focusedValue,E=C.selectValue;if(!g&&!(typeof S=="function"&&(S(l),l.defaultPrevented))){switch(i.blockOptionHover=!0,l.key){case"ArrowLeft":if(!d||p)return;i.focusValue("previous");break;case"ArrowRight":if(!d||p)return;i.focusValue("next");break;case"Delete":case"Backspace":if(p)return;if(A)i.removeValue(A);else{if(!f)return;d?i.popValue():m&&i.clearValue()}break;case"Tab":if(i.isComposing||l.shiftKey||!v||!I||!y||x&&i.isOptionSelected(y,E))return;i.selectOption(y);break;case"Enter":if(l.keyCode===229)break;if(v){if(!y||i.isComposing)return;i.selectOption(y);break}return;case"Escape":v?(i.setState({inputIsHiddenAfterUpdate:!1}),i.onInputChange("",{action:"menu-close",prevInputValue:p}),i.onMenuClose()):m&&h&&i.clearValue();break;case" ":if(p)return;if(!v){i.openMenu("first");break}if(!y)return;i.selectOption(y);break;case"ArrowUp":v?i.focusOption("up"):i.openMenu("last");break;case"ArrowDown":v?i.focusOption("down"):i.openMenu("first");break;case"PageUp":if(!v)return;i.focusOption("pageup");break;case"PageDown":if(!v)return;i.focusOption("pagedown");break;case"Home":if(!v)return;i.focusOption("first");break;case"End":if(!v)return;i.focusOption("last");break;default:return}l.preventDefault()}},i.state.instancePrefix="react-select-"+(i.props.instanceId||++bR),i.state.selectValue=os(r.value),r.menuIsOpen&&i.state.selectValue.length){var o=i.getFocusableOptionsWithIds(),a=i.buildFocusableOptions(),s=a.indexOf(i.state.selectValue[0]);i.state.focusableOptionsWithIds=o,i.state.focusedOption=a[s],i.state.focusedOptionId=uu(o,a[s])}return i}return KP(n,[{key:"componentDidMount",value:function(){this.startListeningComposition(),this.startListeningToTouch(),this.props.closeMenuOnScroll&&document&&document.addEventListener&&document.addEventListener("scroll",this.onScroll,!0),this.props.autoFocus&&this.focusInput(),this.props.menuIsOpen&&this.state.focusedOption&&this.menuListRef&&this.focusedOptionRef&&_g(this.menuListRef,this.focusedOptionRef)}},{key:"componentDidUpdate",value:function(i){var o=this.props,a=o.isDisabled,s=o.menuIsOpen,l=this.state.isFocused;(l&&!a&&i.isDisabled||l&&s&&!i.menuIsOpen)&&this.focusInput(),l&&a&&!i.isDisabled?this.setState({isFocused:!1},this.onMenuClose):!l&&!a&&i.isDisabled&&this.inputRef===document.activeElement&&this.setState({isFocused:!0}),this.menuListRef&&this.focusedOptionRef&&this.scrollToFocusedOptionOnUpdate&&(_g(this.menuListRef,this.focusedOptionRef),this.scrollToFocusedOptionOnUpdate=!1)}},{key:"componentWillUnmount",value:function(){this.stopListeningComposition(),this.stopListeningToTouch(),document.removeEventListener("scroll",this.onScroll,!0)}},{key:"onMenuOpen",value:function(){this.props.onMenuOpen()}},{key:"onMenuClose",value:function(){this.onInputChange("",{action:"menu-close",prevInputValue:this.props.inputValue}),this.props.onMenuClose()}},{key:"onInputChange",value:function(i,o){this.props.onInputChange(i,o)}},{key:"focusInput",value:function(){this.inputRef&&this.inputRef.focus()}},{key:"blurInput",value:function(){this.inputRef&&this.inputRef.blur()}},{key:"openMenu",value:function(i){var o=this,a=this.state,s=a.selectValue,l=a.isFocused,c=this.buildFocusableOptions(),d=i==="first"?0:c.length-1;if(!this.props.isMulti){var f=c.indexOf(s[0]);f>-1&&(d=f)}this.scrollToFocusedOptionOnUpdate=!(l&&this.menuListRef),this.setState({inputIsHiddenAfterUpdate:!1,focusedValue:null,focusedOption:c[d],focusedOptionId:this.getFocusedOptionId(c[d])},function(){return o.onMenuOpen()})}},{key:"focusValue",value:function(i){var o=this.state,a=o.selectValue,s=o.focusedValue;if(this.props.isMulti){this.setState({focusedOption:null});var l=a.indexOf(s);s||(l=-1);var c=a.length-1,d=-1;if(a.length){switch(i){case"previous":l===0?d=0:l===-1?d=c:d=l-1;break;case"next":l>-1&&l<c&&(d=l+1);break}this.setState({inputIsHidden:d!==-1,focusedValue:a[d]})}}}},{key:"focusOption",value:function(){var i=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"first",o=this.props.pageSize,a=this.state.focusedOption,s=this.getFocusableOptions();if(s.length){var l=0,c=s.indexOf(a);a||(c=-1),i==="up"?l=c>0?c-1:s.length-1:i==="down"?l=(c+1)%s.length:i==="pageup"?(l=c-o,l<0&&(l=0)):i==="pagedown"?(l=c+o,l>s.length-1&&(l=s.length-1)):i==="last"&&(l=s.length-1),this.scrollToFocusedOptionOnUpdate=!0,this.setState({focusedOption:s[l],focusedValue:null,focusedOptionId:this.getFocusedOptionId(s[l])})}}},{key:"getTheme",value:function(){return this.props.theme?typeof this.props.theme=="function"?this.props.theme(cu):ve(ve({},cu),this.props.theme):cu}},{key:"getCommonProps",value:function(){var i=this.clearValue,o=this.cx,a=this.getStyles,s=this.getClassNames,l=this.getValue,c=this.selectOption,d=this.setValue,f=this.props,h=f.isMulti,p=f.isRtl,m=f.options,g=this.hasValue();return{clearValue:i,cx:o,getStyles:a,getClassNames:s,getValue:l,hasValue:g,isMulti:h,isRtl:p,options:m,selectOption:c,selectProps:f,setValue:d,theme:this.getTheme()}}},{key:"hasValue",value:function(){var i=this.state.selectValue;return i.length>0}},{key:"hasOptions",value:function(){return!!this.getFocusableOptions().length}},{key:"isClearable",value:function(){var i=this.props,o=i.isClearable,a=i.isMulti;return o===void 0?a:o}},{key:"isOptionDisabled",value:function(i,o){return lm(this.props,i,o)}},{key:"isOptionSelected",value:function(i,o){return cm(this.props,i,o)}},{key:"filterOption",value:function(i,o){return um(this.props,i,o)}},{key:"formatOptionLabel",value:function(i,o){if(typeof this.props.formatOptionLabel=="function"){var a=this.props.inputValue,s=this.state.selectValue;return this.props.formatOptionLabel(i,{context:o,inputValue:a,selectValue:s})}else return this.getOptionLabel(i)}},{key:"formatGroupLabel",value:function(i){return this.props.formatGroupLabel(i)}},{key:"startListeningComposition",value:function(){document&&document.addEventListener&&(document.addEventListener("compositionstart",this.onCompositionStart,!1),document.addEventListener("compositionend",this.onCompositionEnd,!1))}},{key:"stopListeningComposition",value:function(){document&&document.removeEventListener&&(document.removeEventListener("compositionstart",this.onCompositionStart),document.removeEventListener("compositionend",this.onCompositionEnd))}},{key:"startListeningToTouch",value:function(){document&&document.addEventListener&&(document.addEventListener("touchstart",this.onTouchStart,!1),document.addEventListener("touchmove",this.onTouchMove,!1),document.addEventListener("touchend",this.onTouchEnd,!1))}},{key:"stopListeningToTouch",value:function(){document&&document.removeEventListener&&(document.removeEventListener("touchstart",this.onTouchStart),document.removeEventListener("touchmove",this.onTouchMove),document.removeEventListener("touchend",this.onTouchEnd))}},{key:"renderInput",value:function(){var i=this.props,o=i.isDisabled,a=i.isSearchable,s=i.inputId,l=i.inputValue,c=i.tabIndex,d=i.form,f=i.menuIsOpen,h=i.required,p=this.getComponents(),m=p.Input,g=this.state,v=g.inputIsHidden,S=g.ariaSelection,I=this.commonProps,x=s||this.getElementId("input"),C=ve(ve(ve({"aria-autocomplete":"list","aria-expanded":f,"aria-haspopup":!0,"aria-errormessage":this.props["aria-errormessage"],"aria-invalid":this.props["aria-invalid"],"aria-label":this.props["aria-label"],"aria-labelledby":this.props["aria-labelledby"],"aria-required":h,role:"combobox","aria-activedescendant":this.isAppleDevice?void 0:this.state.focusedOptionId||""},f&&{"aria-controls":this.getElementId("listbox")}),!a&&{"aria-readonly":!0}),this.hasValue()?(S==null?void 0:S.action)==="initial-input-focus"&&{"aria-describedby":this.getElementId("live-region")}:{"aria-describedby":this.getElementId("placeholder")});return a?W.createElement(m,O({},I,{autoCapitalize:"none",autoComplete:"off",autoCorrect:"off",id:x,innerRef:this.getInputRef,isDisabled:o,isHidden:v,onBlur:this.onInputBlur,onChange:this.handleInputChange,onFocus:this.onInputFocus,spellCheck:"false",tabIndex:c,form:d,type:"text",value:l},C)):W.createElement(GO,O({id:x,innerRef:this.getInputRef,onBlur:this.onInputBlur,onChange:is,onFocus:this.onInputFocus,disabled:o,tabIndex:c,inputMode:"none",form:d,value:""},C))}},{key:"renderPlaceholderOrValue",value:function(){var i=this,o=this.getComponents(),a=o.MultiValue,s=o.MultiValueContainer,l=o.MultiValueLabel,c=o.MultiValueRemove,d=o.SingleValue,f=o.Placeholder,h=this.commonProps,p=this.props,m=p.controlShouldRenderValue,g=p.isDisabled,v=p.isMulti,S=p.inputValue,I=p.placeholder,x=this.state,C=x.selectValue,y=x.focusedValue,A=x.isFocused;if(!this.hasValue()||!m)return S?null:W.createElement(f,O({},h,{key:"placeholder",isDisabled:g,isFocused:A,innerProps:{id:this.getElementId("placeholder")}}),I);if(v)return C.map(function(_,D){var G=_===y,F="".concat(i.getOptionLabel(_),"-").concat(i.getOptionValue(_));return W.createElement(a,O({},h,{components:{Container:s,Label:l,Remove:c},isFocused:G,isDisabled:g,key:F,index:D,removeProps:{onClick:function(){return i.removeValue(_)},onTouchEnd:function(){return i.removeValue(_)},onMouseDown:function(j){j.preventDefault()}},data:_}),i.formatOptionLabel(_,"value"))});if(S)return null;var E=C[0];return W.createElement(d,O({},h,{data:E,isDisabled:g}),this.formatOptionLabel(E,"value"))}},{key:"renderClearIndicator",value:function(){var i=this.getComponents(),o=i.ClearIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,c=s.isLoading,d=this.state.isFocused;if(!this.isClearable()||!o||l||!this.hasValue()||c)return null;var f={onMouseDown:this.onClearIndicatorMouseDown,onTouchEnd:this.onClearIndicatorTouchEnd,"aria-hidden":"true"};return W.createElement(o,O({},a,{innerProps:f,isFocused:d}))}},{key:"renderLoadingIndicator",value:function(){var i=this.getComponents(),o=i.LoadingIndicator,a=this.commonProps,s=this.props,l=s.isDisabled,c=s.isLoading,d=this.state.isFocused;if(!o||!c)return null;var f={"aria-hidden":"true"};return W.createElement(o,O({},a,{innerProps:f,isDisabled:l,isFocused:d}))}},{key:"renderIndicatorSeparator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator,a=i.IndicatorSeparator;if(!o||!a)return null;var s=this.commonProps,l=this.props.isDisabled,c=this.state.isFocused;return W.createElement(a,O({},s,{isDisabled:l,isFocused:c}))}},{key:"renderDropdownIndicator",value:function(){var i=this.getComponents(),o=i.DropdownIndicator;if(!o)return null;var a=this.commonProps,s=this.props.isDisabled,l=this.state.isFocused,c={onMouseDown:this.onDropdownIndicatorMouseDown,onTouchEnd:this.onDropdownIndicatorTouchEnd,"aria-hidden":"true"};return W.createElement(o,O({},a,{innerProps:c,isDisabled:s,isFocused:l}))}},{key:"renderMenu",value:function(){var i=this,o=this.getComponents(),a=o.Group,s=o.GroupHeading,l=o.Menu,c=o.MenuList,d=o.MenuPortal,f=o.LoadingMessage,h=o.NoOptionsMessage,p=o.Option,m=this.commonProps,g=this.state.focusedOption,v=this.props,S=v.captureMenuScroll,I=v.inputValue,x=v.isLoading,C=v.loadingMessage,y=v.minMenuHeight,A=v.maxMenuHeight,E=v.menuIsOpen,_=v.menuPlacement,D=v.menuPosition,G=v.menuPortalTarget,F=v.menuShouldBlockScroll,T=v.menuShouldScrollIntoView,j=v.noOptionsMessage,Y=v.onMenuScrollToTop,z=v.onMenuScrollToBottom;if(!E)return null;var $=function(U,V){var ne=U.type,se=U.data,ae=U.isDisabled,X=U.isSelected,le=U.label,re=U.value,ge=g===se,Ae=ae?void 0:function(){return i.onOptionHover(se)},Ve=ae?void 0:function(){return i.selectOption(se)},It="".concat(i.getElementId("option"),"-").concat(V),ct={id:It,onClick:Ve,onMouseMove:Ae,onMouseOver:Ae,tabIndex:-1,role:"option","aria-selected":i.isAppleDevice?void 0:X};return W.createElement(p,O({},m,{innerProps:ct,data:se,isDisabled:ae,isSelected:X,key:It,label:le,type:ne,value:re,isFocused:ge,innerRef:ge?i.getFocusedOptionRef:void 0}),i.formatOptionLabel(U.data,"menu"))},B;if(this.hasOptions())B=this.getCategorizedOptions().map(function(M){if(M.type==="group"){var U=M.data,V=M.options,ne=M.index,se="".concat(i.getElementId("group"),"-").concat(ne),ae="".concat(se,"-heading");return W.createElement(a,O({},m,{key:se,data:U,options:V,Heading:s,headingProps:{id:ae,data:M.data},label:i.formatGroupLabel(M.data)}),M.options.map(function(X){return $(X,"".concat(ne,"-").concat(X.index))}))}else if(M.type==="option")return $(M,"".concat(M.index))});else if(x){var H=C({inputValue:I});if(H===null)return null;B=W.createElement(f,m,H)}else{var q=j({inputValue:I});if(q===null)return null;B=W.createElement(h,m,q)}var ee={minMenuHeight:y,maxMenuHeight:A,menuPlacement:_,menuPosition:D,menuShouldScrollIntoView:T},R=W.createElement(SD,O({},m,ee),function(M){var U=M.ref,V=M.placerProps,ne=V.placement,se=V.maxHeight;return W.createElement(l,O({},m,ee,{innerRef:U,innerProps:{onMouseDown:i.onMenuMouseDown,onMouseMove:i.onMenuMouseMove},isLoading:x,placement:ne}),W.createElement(XO,{captureEnabled:S,onTopArrive:Y,onBottomArrive:z,lockEnabled:F},function(ae){return W.createElement(c,O({},m,{innerRef:function(le){i.getMenuListRef(le),ae(le)},innerProps:{role:"listbox","aria-multiselectable":m.isMulti,id:i.getElementId("listbox")},isLoading:x,maxHeight:se,focusedOption:g}),B)}))});return G||D==="fixed"?W.createElement(d,O({},m,{appendTo:G,controlElement:this.controlRef,menuPlacement:_,menuPosition:D}),R):R}},{key:"renderFormField",value:function(){var i=this,o=this.props,a=o.delimiter,s=o.isDisabled,l=o.isMulti,c=o.name,d=o.required,f=this.state.selectValue;if(d&&!this.hasValue()&&!s)return W.createElement(tR,{name:c,onFocus:this.onValueInputFocus});if(!(!c||s))if(l)if(a){var h=f.map(function(g){return i.getOptionValue(g)}).join(a);return W.createElement("input",{name:c,type:"hidden",value:h})}else{var p=f.length>0?f.map(function(g,v){return W.createElement("input",{key:"i-".concat(v),name:c,type:"hidden",value:i.getOptionValue(g)})}):W.createElement("input",{name:c,type:"hidden",value:""});return W.createElement("div",null,p)}else{var m=f[0]?this.getOptionValue(f[0]):"";return W.createElement("input",{name:c,type:"hidden",value:m})}}},{key:"renderLiveRegion",value:function(){var i=this.commonProps,o=this.state,a=o.ariaSelection,s=o.focusedOption,l=o.focusedValue,c=o.isFocused,d=o.selectValue,f=this.getFocusableOptions();return W.createElement(zO,O({},i,{id:this.getElementId("live-region"),ariaSelection:a,focusedOption:s,focusedValue:l,isFocused:c,selectValue:d,focusableOptions:f,isAppleDevice:this.isAppleDevice}))}},{key:"render",value:function(){var i=this.getComponents(),o=i.Control,a=i.IndicatorsContainer,s=i.SelectContainer,l=i.ValueContainer,c=this.props,d=c.className,f=c.id,h=c.isDisabled,p=c.menuIsOpen,m=this.state.isFocused,g=this.commonProps=this.getCommonProps();return W.createElement(s,O({},g,{className:d,innerProps:{id:f,onKeyDown:this.onKeyDown},isDisabled:h,isFocused:m}),this.renderLiveRegion(),W.createElement(o,O({},g,{innerRef:this.getControlRef,innerProps:{onMouseDown:this.onControlMouseDown,onTouchEnd:this.onControlTouchEnd},isDisabled:h,isFocused:m,menuIsOpen:p}),W.createElement(l,O({},g,{isDisabled:h}),this.renderPlaceholderOrValue(),this.renderInput()),W.createElement(a,O({},g,{isDisabled:h}),this.renderClearIndicator(),this.renderLoadingIndicator(),this.renderIndicatorSeparator(),this.renderDropdownIndicator())),this.renderMenu(),this.renderFormField())}}],[{key:"getDerivedStateFromProps",value:function(i,o){var a=o.prevProps,s=o.clearFocusValueOnUpdate,l=o.inputIsHiddenAfterUpdate,c=o.ariaSelection,d=o.isFocused,f=o.prevWasFocused,h=o.instancePrefix,p=i.options,m=i.value,g=i.menuIsOpen,v=i.inputValue,S=i.isMulti,I=os(m),x={};if(a&&(m!==a.value||p!==a.options||g!==a.menuIsOpen||v!==a.inputValue)){var C=g?gR(i,I):[],y=g?om(us(i,I),"".concat(h,"-option")):[],A=s?mR(o,I):null,E=vR(o,C),_=uu(y,E);x={selectValue:I,focusedOption:E,focusedOptionId:_,focusableOptionsWithIds:y,focusedValue:A,clearFocusValueOnUpdate:!1}}var D=l!=null&&i!==a?{inputIsHidden:l,inputIsHiddenAfterUpdate:void 0}:{},G=c,F=d&&f;return d&&!F&&(G={value:so(S,I,I[0]||null),options:I,action:"initial-input-focus"},F=!f),(c==null?void 0:c.action)==="initial-input-focus"&&(G=null),ve(ve(ve({},x),D),{},{prevProps:i,ariaSelection:G,prevWasFocused:F})}}]),n}(w.Component);fm.defaultProps=pR;var yR=["defaultInputValue","defaultMenuIsOpen","defaultValue","inputValue","menuIsOpen","onChange","onInputChange","onMenuClose","onMenuOpen","value"];function xR(e){var t=e.defaultInputValue,n=t===void 0?"":t,r=e.defaultMenuIsOpen,i=r===void 0?!1:r,o=e.defaultValue,a=o===void 0?null:o,s=e.inputValue,l=e.menuIsOpen,c=e.onChange,d=e.onInputChange,f=e.onMenuClose,h=e.onMenuOpen,p=e.value,m=Cn(e,yR),g=w.useState(s!==void 0?s:n),v=Un(g,2),S=v[0],I=v[1],x=w.useState(l!==void 0?l:i),C=Un(x,2),y=C[0],A=C[1],E=w.useState(p!==void 0?p:a),_=Un(E,2),D=_[0],G=_[1],F=w.useCallback(function(H,q){typeof c=="function"&&c(H,q),G(H)},[c]),T=w.useCallback(function(H,q){var ee;typeof d=="function"&&(ee=d(H,q)),I(ee!==void 0?ee:H)},[d]),j=w.useCallback(function(){typeof h=="function"&&h(),A(!0)},[h]),Y=w.useCallback(function(){typeof f=="function"&&f(),A(!1)},[f]),z=s!==void 0?s:S,$=l!==void 0?l:y,B=p!==void 0?p:D;return ve(ve({},m),{},{inputValue:z,menuIsOpen:$,onChange:F,onInputChange:T,onMenuClose:Y,onMenuOpen:j,value:B})}var CR=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],hm=function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",n=arguments.length>1?arguments[1]:void 0,r=arguments.length>2?arguments[2]:void 0,i=String(t).toLowerCase(),o=String(r.getOptionValue(n)).toLowerCase(),a=String(r.getOptionLabel(n)).toLowerCase();return o===i||a===i},du={formatCreateLabel:function(t){return'Create "'.concat(t,'"')},isValidNewOption:function(t,n,r,i){return!(!t||n.some(function(o){return hm(t,o,i)})||r.some(function(o){return hm(t,o,i)}))},getNewOptionData:function(t,n){return{label:n,value:t,__isNew__:!0}}};function wR(e){var t=e.allowCreateWhileLoading,n=t===void 0?!1:t,r=e.createOptionPosition,i=r===void 0?"last":r,o=e.formatCreateLabel,a=o===void 0?du.formatCreateLabel:o,s=e.isValidNewOption,l=s===void 0?du.isValidNewOption:s,c=e.getNewOptionData,d=c===void 0?du.getNewOptionData:c,f=e.onCreateOption,h=e.options,p=h===void 0?[]:h,m=e.onChange,g=Cn(e,CR),v=g.getOptionValue,S=v===void 0?tm:v,I=g.getOptionLabel,x=I===void 0?em:I,C=g.inputValue,y=g.isLoading,A=g.isMulti,E=g.value,_=g.name,D=w.useMemo(function(){return l(C,os(E),p,{getOptionValue:S,getOptionLabel:x})?d(C,a(C)):void 0},[a,d,x,S,C,l,p,E]),G=w.useMemo(function(){return(n||!y)&&D?i==="first"?[D].concat(oi(p)):[].concat(oi(p),[D]):p},[n,i,y,D,p]),F=w.useCallback(function(T,j){if(j.action!=="select-option")return m(T,j);var Y=Array.isArray(T)?T:[T];if(Y[Y.length-1]===D){if(f)f(C);else{var z=d(C,C),$={action:"create-option",name:_,option:z};m(so(A,[].concat(oi(os(E)),[z]),z),$)}return}m(T,j)},[d,C,A,_,D,f,m,E]);return ve(ve({},g),{},{options:G,onChange:F})}var IR=w.forwardRef(function(e,t){var n=xR(e),r=wR(n);return W.createElement(fm,O({ref:t},r))}),pm=IR;const SR={control:(e,t)=>Q(N({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px",fontFamily:'var(--joy-fontFamily-body, "Inter", var(--joy-fontFamily-fallback, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"));',"&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(N({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(N({},e),{minHeight:"36px"}),menu:e=>Q(N({},e),{position:"relative"}),clearIndicator:e=>Q(N({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(N({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(N({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(N({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"14px"}),multiValueLabel:e=>Q(N({},e),{color:"#333"})},AR=e=>e.map(t=>({label:t,value:t})),TR=e=>{const[t,n]=w.useState(""),[r,i]=w.useState(!1),o=e.sx||{marginBottom:"16px"},a=AR(e.flags),s=()=>i(!r),l=h=>{e.onChange(h.map(p=>p.value))},c=h=>{n(h)},d=h=>{h.persist();const{key:p}=h;if(t)switch(p){case"Enter":case"Tab":if(e.flags&&e.flags.length===0){const m=[...e.flags,t];e.onChange(m)}if(e.flags&&e.flags.length>0&&f()){const m=[...e.flags,t];e.onChange(m)}n(""),h.preventDefault()}},f=()=>{let h=!1;return e.flags.length&&e.flags.includes(t)?(s(),h):(h=!0,h)};return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:o,children:u.jsx(pm,{styles:SR,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:l,onInputChange:c,onKeyDown:d,placeholder:e.labels.flagsPlaceholder,value:a})}),u.jsx(st,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:s})]})},co=e=>{const[t,n]=w.useState(!1),[r,i]=w.useState(!1),[o,a]=w.useState(!1),[s,l]=w.useState(!1),[c,d]=w.useState(""),[f,h]=w.useState("primary"),[p,m]=w.useState(""),g=w.useRef(null),v=()=>{g.current&&g.current.click()},S=new jp,I=at(),x=()=>{d(""),i(!1)},C=j=>{let Y="",z="primary";switch(j){case"copy_url":Y=e.labels.urlCopiedToClipboardMessage,z="primary";break;case"image_deleted":Y=e.labels.imageDeletedMessage,z="primary";break;case"image_reset":Y=e.labels.imageResetMessage,z="primary";break;case"upload_success":Y=e.labels.uploadingImageMessage,z="success";break;case"upload_failed":Y=e.labels.uploadingImageErrorMessage,z="danger";break;case"sign_in_url_failed":Y=e.labels.generateSignedInUrlErrorMessage,z="danger";break;case"encrypting_file_failed":Y=e.labels.encryptingImageErrorMessage,z="danger";break}h(z),d(Y),i(!0)},y=()=>a(!o),A=()=>l(!s),E=()=>{e.clearImage(),C("image_deleted")},_=j=>{navigator.clipboard.writeText(j),C("copy_url")},D=j=>k(this,null,function*(){j.persist();const Y=j.target.files?j.target.files[0]:null;if(Y){n(!0);try{const z=Y.type.split("/")[1],$=yield S.readFileAndHash(Y),B=(yield S.generateHashFileName(Y))+"."+z,H={image_type:z,image_file_name:B,image_size:Y.size,base64_sum:$},q=yield I==null?void 0:I.https.generateSignedInUrl(H);if(q!=null&&q.ok){const ee=yield q.json(),R={"Content-Type":Y.type,"Content-MD5":$};try{const M=new File([Y],B,{type:Y.type}),U=yield I==null?void 0:I.https.storeInBucket(ee.data.signed_url,M,R);e.onChangeImages(U||""),m(U),C("upload_success")}catch(M){console.error("There was a problem with uploading the file: ",M),C("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield q==null?void 0:q.json()),C("sign_in_url_failed")}catch(z){console.error("There was a problem with encrypting file...",z),C("encrypting_file_failed")}n(!1)}}),G=j=>k(this,null,function*(){if(j){n(!0);try{const Y=j.type.split("/")[1],z=yield S.readFileAndHash(j),$=(yield S.generateHashFileName(j))+"."+Y,B={image_type:Y,image_file_name:$,image_size:j.size,base64_sum:z},H=yield I==null?void 0:I.https.generateSignedInUrl(B);if(H!=null&&H.ok){const q=yield H.json(),ee={"Content-Type":j.type,"Content-MD5":z};try{const R=new File([j],$,{type:j.type}),M=yield I==null?void 0:I.https.storeInBucket(q.data.signed_url,R,ee);e.onChangeImages(M||""),C("upload_success")}catch(R){console.error("There was a problem with uploading the file: ",R),C("upload_failed")}}else console.error("There was a problem with generating signed in URL: ",yield H==null?void 0:H.json()),C("sign_in_url_failed")}catch(Y){console.error("There was a problem with encrypting file...",Y),C("encrypting_file_failed")}n(!1)}}),F=()=>{e.onChangeImages(p),C("image_reset")},T=j=>{e.onChangeImages(j),m(j)};return u.jsxs(u.Fragment,{children:[u.jsxs(b.Card,{sx:{marginBottom:"10px"},children:[u.jsxs(b.Stack,{direction:"row",alignItems:"center",justifyContent:"space-between",children:[u.jsx(b.Typography,{level:"title-lg",children:e.title}),u.jsx(b.Tooltip,{title:e.labels.clearImage,children:u.jsx(b.IconButton,{variant:"plain",color:"danger",size:"sm",onClick:E,children:u.jsx(_p,{})})})]}),u.jsxs(b.AspectRatio,{maxHeight:"200px",ratio:"16/9",sx:{position:"relative"},children:[u.jsxs(b.Skeleton,{loading:t,animation:"wave",children:[e.image?u.jsx(b.Box,{component:"img",src:e.image,loading:"lazy",alt:e.title,sx:{width:"100%",height:"100%",position:"relative",transition:"background-color 0.3s ease","&:hover":{backgroundColor:"rgba(0, 0, 0, 0.3)"}}}):u.jsx(Oc,{sx:{fontSize:"3rem",opacity:.2}}),e.image?u.jsx(b.Box,{sx:{position:"absolute",top:0,left:0,right:0,bottom:0,display:"flex",justifyContent:"center",alignItems:"center",pointerEvents:"none",opacity:0,transition:"opacity 0.3s ease","&:hover":{opacity:1}},children:u.jsx(Vp,{sx:{fontSize:"3rem",color:"#fff"}})}):u.jsx(u.Fragment,{})]}),u.jsx(b.Tooltip,{title:e.labels.copyUrl,children:u.jsx(b.Button,{onClick:()=>_(e.image),disabled:!e.image,sx:{position:"absolute",top:"10px",left:"10px"},variant:"soft",color:"neutral",children:u.jsx(ke.ContentCopy,{})})}),u.jsx(b.Tooltip,{title:e.labels.viewImage,children:u.jsx(b.Button,{onClick:y,disabled:!e.image,sx:{position:"absolute",top:"10px",right:"10px"},variant:"soft",color:"neutral",children:u.jsx(Wp,{})})}),u.jsx(b.Tooltip,{title:e.labels.cropImage,children:u.jsx(b.Button,{onClick:A,disabled:!e.image,sx:{position:"absolute",bottom:"10px",left:"10px"},variant:"soft",color:"neutral",children:u.jsx(cg,{})})})]}),u.jsx(b.CardContent,{orientation:"horizontal",sx:{justifyContent:"space-between"},children:u.jsxs(b.Button,{sx:{width:"100%"},onClick:v,children:[u.jsx(ke.Upload,{})," ",e.labels.uploadImage,u.jsx(Gp,{type:"file",accept:"image/*",onChange:D,ref:g})]})}),I.https.sportal365Config?u.jsx(b.AccordionGroup,{variant:"soft",children:u.jsxs(b.Accordion,{children:[u.jsx(b.AccordionSummary,{children:u.jsx(b.Typography,{fontWeight:"bold",sx:{color:"#ef8b34"},children:e.labels.sportal365Images})}),u.jsx(b.AccordionDetails,{children:u.jsx(Hp,{labels:e.labels,onChangeImages:T})})]})}):u.jsx(u.Fragment,{})]}),u.jsx(st,{showToast:r,message:c,color:f,hideToast:x}),u.jsx(Up,{title:e.labels.viewImage,open:o,imageSrc:e.image,toggleModal:y}),u.jsx(lg,{labels:e.labels,open:s,imageSrc:e.image,toggleModal:A,uploadImage:G,resetDefaultImageUrl:F})]})},ER=["cover","mobile"],kR=e=>new Map().set("main",e.mainImage).set("cover",e.coverImage).set("mobile",e.mobileImage),_R=e=>e?N({},e):{main:"",mobile:"",cover:""},PR=e=>{const[t,n]=w.useState(!1),r=_R(e.defaultValue),i=kR(e.labels),o=(s,l)=>{r[l]=s,e.onChange(r)},a=s=>{r[s]="",e.onChange(r)};return u.jsxs(b.Box,{sx:{marginBottom:"10px"},children:[u.jsx(co,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:s=>o(s,"main"),clearImage:()=>a("main")}),u.jsx(b.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?u.jsx(u.Fragment,{children:ER.map(s=>u.jsx(co,{labels:e.labels,title:i.get(s),image:r[s],onChangeImages:l=>o(l,s),clearImage:()=>a(s)},`images-${s}`))}):u.jsx(u.Fragment,{})]})};function DR(e){return it("MuiSheet",e)}Xe("MuiSheet",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const OR=["className","color","component","variant","invertedColors","slots","slotProps"],RR=e=>{const{variant:t,color:n}=e,r={root:["root",t&&`variant${xe(t)}`,n&&`color${xe(n)}`]};return dt(r,DR,{})},LR=ye("div",{name:"JoySheet",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r;const i=(n=e.variants[t.variant])==null?void 0:n[t.color],{borderRadius:o,bgcolor:a,backgroundColor:s,background:l}=lc({theme:e,ownerState:t},["borderRadius","bgcolor","backgroundColor","background"]),c=er(e,`palette.${a}`)||a||er(e,`palette.${s}`)||s||l||(i==null?void 0:i.backgroundColor)||(i==null?void 0:i.background)||e.vars.palette.background.surface;return[O({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,"--ListItem-stickyBackground":c==="transparent"?"initial":c,"--Sheet-background":c==="transparent"?"initial":c},o!==void 0&&{"--List-radius":`calc(${o} - var(--variant-borderWidth, 0px))`,"--unstable_actionRadius":`calc(${o} - var(--variant-borderWidth, 0px))`},{backgroundColor:e.vars.palette.background.surface,position:"relative"}),O({},e.typography["body-md"],t.variant==="solid"&&t.color&&t.invertedColors&&c_(t.color)(e),t.variant==="soft"&&t.color&&t.invertedColors&&u_(t.color)(e),(r=e.variants[t.variant])==null?void 0:r[t.color],i)]}),MR=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoySheet"}),{className:i,color:o="neutral",component:a="div",variant:s="plain",invertedColors:l=!1,slots:c={},slotProps:d={}}=r,f=Te(r,OR),h=O({},r,{color:o,component:a,invertedColors:l,variant:s}),p=RR(h),m=O({},f,{component:a,slots:c,slotProps:d}),[g,v]=Se("root",{ref:n,className:Mn(p.root,i),elementType:LR,externalForwardedProps:m,ownerState:h});return u.jsx(g,O({},v))});function BR(e){return it("MuiTypography",e)}Xe("MuiTypography",["root","h1","h2","h3","h4","title-lg","title-md","title-sm","body-lg","body-md","body-sm","body-xs","noWrap","gutterBottom","startDecorator","endDecorator","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid"]);const $R=["color","textColor"],NR=["component","gutterBottom","noWrap","level","levelMapping","children","endDecorator","startDecorator","variant","slots","slotProps"],fu=W.createContext(!1),FR=W.createContext(!1),zR=e=>{const{gutterBottom:t,noWrap:n,level:r,color:i,variant:o}=e,a={root:["root",r,t&&"gutterBottom",n&&"noWrap",i&&`color${xe(i)}`,o&&`variant${xe(o)}`],startDecorator:["startDecorator"],endDecorator:["endDecorator"]};return dt(a,BR,{})},jR=ye("span",{name:"JoyTypography",slot:"StartDecorator",overridesResolver:(e,t)=>t.startDecorator})({display:"inline-flex",marginInlineEnd:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),UR=ye("span",{name:"JoyTypography",slot:"endDecorator",overridesResolver:(e,t)=>t.endDecorator})({display:"inline-flex",marginInlineStart:"clamp(4px, var(--Typography-gap, 0.375em), 0.75rem)"}),VR=ye("span",{name:"JoyTypography",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const s=t.level!=="inherit"?(n=e.typography[t.level])==null?void 0:n.lineHeight:"1";return O({"--Icon-fontSize":`calc(1em * ${s})`},t.color&&{"--Icon-color":"currentColor"},{margin:"var(--Typography-margin, 0px)"},t.nesting?{display:"inline"}:O({display:"block"},t.unstable_hasSkeleton&&{position:"relative"}),(t.startDecorator||t.endDecorator)&&O({display:"flex",alignItems:"center"},t.nesting&&O({display:"inline-flex"},t.startDecorator&&{verticalAlign:"bottom"})),t.level&&t.level!=="inherit"&&e.typography[t.level],{fontSize:`var(--Typography-fontSize, ${t.level&&t.level!=="inherit"&&(r=(i=e.typography[t.level])==null?void 0:i.fontSize)!=null?r:"inherit"})`},t.noWrap&&{overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},t.gutterBottom&&{marginBottom:"0.35em"},t.color&&{color:`var(--variant-plainColor, rgba(${(o=e.vars.palette[t.color])==null?void 0:o.mainChannel} / 1))`},t.variant&&O({borderRadius:e.vars.radius.xs,paddingBlock:"min(0.1em, 4px)",paddingInline:"0.25em"},!t.nesting&&{marginInline:"-0.25em"},(a=e.variants[t.variant])==null?void 0:a[t.color]))}),gm={h1:"h1",h2:"h2",h3:"h3",h4:"h4","title-lg":"p","title-md":"p","title-sm":"p","body-lg":"p","body-md":"p","body-sm":"p","body-xs":"span",inherit:"p"},hu=W.forwardRef(function(t,n){var r;const i=ft({props:t,name:"JoyTypography"}),{color:o,textColor:a}=i,s=Te(i,$R),l=W.useContext(fu),c=W.useContext(FR),d=ZA(O({},s,{color:a})),{component:f,gutterBottom:h=!1,noWrap:p=!1,level:m="body-md",levelMapping:g=gm,children:v,endDecorator:S,startDecorator:I,variant:x,slots:C={},slotProps:y={}}=d,A=Te(d,NR),E=(r=t.color)!=null?r:x?o!=null?o:"neutral":o,_=l||c?t.level||"inherit":m,D=th(v,["Skeleton"]),G=f||(l?"span":g[_]||gm[_]||"span"),F=O({},d,{level:_,component:G,color:E,gutterBottom:h,noWrap:p,nesting:l,variant:x,unstable_hasSkeleton:D}),T=zR(F),j=O({},A,{component:G,slots:C,slotProps:y}),[Y,z]=Se("root",{ref:n,className:T.root,elementType:VR,externalForwardedProps:j,ownerState:F}),[$,B]=Se("startDecorator",{className:T.startDecorator,elementType:jR,externalForwardedProps:j,ownerState:F}),[H,q]=Se("endDecorator",{className:T.endDecorator,elementType:UR,externalForwardedProps:j,ownerState:F});return u.jsx(fu.Provider,{value:!0,children:u.jsxs(Y,O({},z,{children:[I&&u.jsx($,O({},B,{children:I})),D?W.cloneElement(v,{variant:v.props.variant||"inline"}):v,S&&u.jsx(H,O({},q,{children:S}))]}))})});hu.muiName="Typography";function HR(e){return it("MuiFormControl",e)}const mm=Xe("MuiFormControl",["root","error","disabled","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","sizeSm","sizeMd","sizeLg","horizontal","vertical"]),WR=Xe("MuiSwitch",["root","checked","disabled","action","input","thumb","track","focusVisible","readOnly","colorPrimary","colorDanger","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid","startDecorator","endDecorator"]),GR=["id","className","component","disabled","required","error","color","size","orientation","slots","slotProps"],YR=e=>{const{disabled:t,error:n,size:r,color:i,orientation:o}=e,a={root:["root",o,t&&"disabled",n&&"error",i&&`color${xe(i)}`,r&&`size${xe(r)}`]};return dt(a,HR,{})},KR=ye("div",{name:"JoyFormControl",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e,ownerState:t})=>{var n,r,i;return O({"--unstable_RadioGroup-margin":"0.5rem 0","--FormLabel-alignSelf":t.orientation==="horizontal"?"align-items":"flex-start","--FormLabel-asteriskColor":e.vars.palette.danger[500]},t.size==="sm"&&{"--FormLabel-fontSize":e.vars.fontSize.xs,"--FormLabel-lineHeight":e.vars.lineHeight.xl,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.5rem 0 0":"0 0 0.25rem 0","--FormHelperText-fontSize":e.vars.fontSize.xs,"--FormHelperText-lineHeight":e.vars.lineHeight.xl},t.size==="md"&&{"--FormLabel-fontSize":e.vars.fontSize.sm,"--FormLabel-lineHeight":e.vars.lineHeight.sm,"--FormLabel-margin":t.orientation==="horizontal"?"0 0.75rem 0 0":"0 0 0.375rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.size==="lg"&&{"--FormLabel-fontSize":e.vars.fontSize.md,"--FormLabel-lineHeight":e.vars.lineHeight.md,"--FormLabel-margin":t.orientation==="horizontal"?"0 1rem 0 0":"0 0 0.5rem 0","--FormHelperText-fontSize":e.vars.fontSize.sm,"--FormHelperText-lineHeight":e.vars.lineHeight.sm},t.color&&{"--FormHelperText-color":(n=e.vars.palette[t.color])==null?void 0:n[500]},{"--FormHelperText-margin":"0.375rem 0 0 0",[`&.${mm.error}`]:{"--FormHelperText-color":e.vars.palette.danger[500]},[`&.${mm.disabled}`]:{"--FormLabel-color":(r=e.variants.plainDisabled)==null||(r=r[t.color||"neutral"])==null?void 0:r.color,"--FormHelperText-color":(i=e.variants.plainDisabled)==null||(i=i[t.color||"neutral"])==null?void 0:i.color},display:"flex",position:"relative",flexDirection:t.orientation==="horizontal"?"row":"column"},t.orientation==="horizontal"&&{[`& > label ~ .${WR.root}`]:{"--unstable_Switch-margin":"0 0 0 auto"}})}),pu=W.forwardRef(function(t,n){const r=ft({props:t,name:"JoyFormControl"}),{id:i,className:o,component:a="div",disabled:s=!1,required:l=!1,error:c=!1,color:d,size:f="md",orientation:h="vertical",slots:p={},slotProps:m={}}=r,g=Te(r,GR),v=Hi(i),[S,I]=W.useState(null),x=O({},r,{id:v,component:a,color:d,disabled:s,error:c,required:l,size:f,orientation:h});let C;const y=YR(x),[A,E]=Se("root",{ref:n,className:Mn(y.root,o),elementType:KR,externalForwardedProps:O({},g,{component:a,slots:p,slotProps:m}),ownerState:x}),_=W.useMemo(()=>({disabled:s,required:l,error:c,color:d,size:f,htmlFor:v,labelId:`${v}-label`,"aria-describedby":S?`${v}-helper-text`:void 0,setHelperText:I,registerEffect:C}),[d,s,c,S,v,C,l,f]);return u.jsx(Wa.Provider,{value:_,children:u.jsx(A,O({},E))})});function qR(e){return it("MuiFormLabel",e)}Xe("MuiFormLabel",["root","asterisk"]);const QR=["children","component","htmlFor","id","slots","slotProps"],JR=()=>dt({root:["root"],asterisk:["asterisk"]},qR,{}),XR=ye("label",{name:"JoyFormLabel",slot:"Root",overridesResolver:(e,t)=>t.root})(({theme:e})=>({"--Icon-fontSize":"calc(var(--FormLabel-lineHeight) * 1em)",WebkitTapHighlightColor:"transparent",alignSelf:"var(--FormLabel-alignSelf)",display:"flex",gap:"2px",alignItems:"center",flexWrap:"wrap",userSelect:"none",fontFamily:e.vars.fontFamily.body,fontSize:`var(--FormLabel-fontSize, ${e.vars.fontSize.sm})`,fontWeight:e.vars.fontWeight.md,lineHeight:`var(--FormLabel-lineHeight, ${e.vars.lineHeight.sm})`,color:`var(--FormLabel-color, ${e.vars.palette.text.primary})`,margin:"var(--FormLabel-margin, 0px)"})),ZR=ye("span",{name:"JoyFormLabel",slot:"Asterisk",overridesResolver:(e,t)=>t.asterisk})({color:"var(--FormLabel-asteriskColor)"}),gu=W.forwardRef(function(t,n){var r,i;const o=ft({props:t,name:"JoyFormLabel"}),{children:a,component:s="label",htmlFor:l,id:c,slots:d={},slotProps:f={}}=o,h=Te(o,QR),p=W.useContext(Wa),m=(r=(i=t.required)!=null?i:p==null?void 0:p.required)!=null?r:!1,g=O({},o,{required:m}),v=JR(),S=O({},h,{component:s,slots:d,slotProps:f}),[I,x]=Se("root",{additionalProps:{htmlFor:l!=null?l:p==null?void 0:p.htmlFor,id:c!=null?c:p==null?void 0:p.labelId},ref:n,className:v.root,elementType:XR,externalForwardedProps:S,ownerState:g}),[C,y]=Se("asterisk",{additionalProps:{"aria-hidden":!0},className:v.asterisk,elementType:ZR,externalForwardedProps:S,ownerState:g});return u.jsxs(I,O({},x,{children:[a,m&&u.jsxs(C,O({},y,{children:[" ","*"]}))]}))}),eL=({environment:e,userNotFound:t})=>{const[n,r]=w.useState(""),[i,o]=w.useState(""),[a,s]=w.useState(!1),l=()=>{s(!a)},c=h=>{h.persist(),r(h.target.value)},d=h=>{h.persist(),o(h.target.value)},f=()=>k(this,null,function*(){try{yield Vi(e).signInWithEmailAndPassword(n,i)}catch(h){console.error(h),l()}});return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{minHeight:"100vh",display:"flex",justifyContent:"center",alignItems:"center"},children:u.jsxs(MR,{sx:{width:300,mx:"auto",py:3,px:2,display:"flex",flexDirection:"column",justifyContent:"center",gap:2,borderRadius:"sm",boxShadow:"md"},variant:"outlined",children:[u.jsxs("div",{children:[u.jsx(hu,{level:"h4",component:"h1",children:u.jsx("b",{children:"Sign in"})}),u.jsx(hu,{level:"body-sm",children:"Use your account in the Fans United platform."})]}),u.jsxs(pu,{children:[u.jsx(gu,{children:"Email"}),u.jsx(Ga,{name:"email",type:"email",onChange:c})]}),u.jsxs(pu,{children:[u.jsx(gu,{children:"Password"}),u.jsx(Ga,{name:"password",type:"password",onChange:d})]}),u.jsx(ei,{sx:{mt:1},onClick:f,children:"Log in"})]})}),u.jsx(st,{showToast:a,message:t,color:"danger",hideToast:l})]})};function tL(e){return it("MuiCheckbox",e)}const si=Xe("MuiCheckbox",["root","checkbox","action","input","label","checked","disabled","focusVisible","indeterminate","colorPrimary","colorDanger","colorNeutral","colorSuccess","colorWarning","colorContext","sizeSm","sizeMd","sizeLg","variantOutlined","variantSoft","variantSolid"]),nL=dc(u.jsx("path",{d:"M9 16.17 5.53 12.7a.9959.9959 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71c.39-.39.39-1.02 0-1.41a.9959.9959 0 0 0-1.41 0L9 16.17z"}),"Check"),rL=dc(u.jsx("path",{d:"M19 13H5c-.55 0-1-.45-1-1s.45-1 1-1h14c.55 0 1 .45 1 1s-.45 1-1 1z"}),"HorizontalRule"),iL=["checked","uncheckedIcon","checkedIcon","label","defaultChecked","disabled","disableIcon","overlay","id","indeterminate","indeterminateIcon","name","onBlur","onChange","onFocus","onFocusVisible","readOnly","required","value","color","variant","size","component","slots","slotProps"],oL=e=>{const{checked:t,disabled:n,disableIcon:r,focusVisible:i,color:o,variant:a,size:s,indeterminate:l}=e,c={root:["root",t&&"checked",n&&"disabled",i&&"focusVisible",a&&`variant${xe(a)}`,o&&`color${xe(o)}`,s&&`size${xe(s)}`],checkbox:["checkbox",t&&"checked",l&&"indeterminate",n&&"disabled"],action:["action",t&&"checked",r&&n&&"disabled",i&&"focusVisible"],input:["input"],label:["label"]};return dt(c,tL,{})},aL=ye("span",{name:"JoyCheckbox",slot:"Root",overridesResolver:(e,t)=>t.root})(({ownerState:e,theme:t})=>{var n,r,i;return O({"--Icon-fontSize":"var(--Checkbox-size)"},e.size==="sm"&&{"--Checkbox-size":"1rem","& ~ *":{"--FormHelperText-margin":"0 0 0 1.5rem"},fontSize:t.vars.fontSize.sm,gap:"var(--Checkbox-gap, 0.5rem)"},e.size==="md"&&{"--Checkbox-size":"1.25rem","& ~ *":{"--FormHelperText-margin":"0.25rem 0 0 1.875rem"},fontSize:t.vars.fontSize.md,gap:"var(--Checkbox-gap, 0.625rem)"},e.size==="lg"&&{"--Checkbox-size":"1.5rem","& ~ *":{"--FormHelperText-margin":"0.375rem 0 0 2.25rem"},fontSize:t.vars.fontSize.lg,gap:"var(--Checkbox-gap, 0.75rem)"},{position:e.overlay?"initial":"relative",display:"inline-flex",fontFamily:t.vars.fontFamily.body,lineHeight:"var(--Checkbox-size)",color:t.vars.palette.text.primary,[`&.${si.disabled}`]:{color:(n=t.variants.plainDisabled)==null||(n=n[e.color])==null?void 0:n.color}},e.disableIcon&&{color:(r=t.variants[e.variant])==null||(r=r[e.color])==null?void 0:r.color,[`&.${si.disabled}`]:{color:(i=t.variants[`${e.variant}Disabled`])==null||(i=i[e.color])==null?void 0:i.color}})}),sL=ye("span",{name:"JoyCheckbox",slot:"Checkbox",overridesResolver:(e,t)=>t.checkbox})(({theme:e,ownerState:t})=>{var n,r,i,o,a;const s=(n=e.variants[`${t.variant}`])==null?void 0:n[t.color];return[O({"--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon,boxSizing:"border-box",borderRadius:`min(${e.vars.radius.sm}, 0.25rem)`,width:"var(--Checkbox-size)",height:"var(--Checkbox-size)",display:"inline-flex",justifyContent:"center",alignItems:"center",flexShrink:0},t.disableIcon&&{display:"contents"},{[`&.${si.checked}, &.${si.indeterminate}`]:{"--Icon-color":"currentColor"}}),...t.disableIcon?[]:[O({},s,{backgroundColor:(r=s==null?void 0:s.backgroundColor)!=null?r:e.vars.palette.background.surface}),{"&:hover":{"@media (hover: hover)":(i=e.variants[`${t.variant}Hover`])==null?void 0:i[t.color]}},{"&:active":(o=e.variants[`${t.variant}Active`])==null?void 0:o[t.color]},{[`&.${si.disabled}`]:(a=e.variants[`${t.variant}Disabled`])==null?void 0:a[t.color]}]]}),lL=ye("span",{name:"JoyCheckbox",slot:"Action",overridesResolver:(e,t)=>t.action})(({theme:e,ownerState:t})=>{var n,r,i,o;return[{borderRadius:`var(--Checkbox-actionRadius, ${t.overlay?"var(--unstable_actionRadius, inherit)":"inherit"})`,textAlign:"left",position:"absolute",top:"calc(-1 * var(--variant-borderWidth, 0px))",left:"calc(-1 * var(--variant-borderWidth, 0px))",bottom:"calc(-1 * var(--variant-borderWidth, 0px))",right:"calc(-1 * var(--variant-borderWidth, 0px))",zIndex:1,[e.focus.selector]:e.focus.default},...t.disableIcon?[(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color]},{"&:active":(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]},{[`&.${si.disabled}`]:(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]}]:[]]}),cL=ye("input",{name:"JoyCheckbox",slot:"Input",overridesResolver:(e,t)=>t.input})(()=>({margin:0,opacity:0,position:"absolute",width:"100%",height:"100%",cursor:"pointer"})),uL=ye("label",{name:"JoyCheckbox",slot:"Label",overridesResolver:(e,t)=>t.label})(({ownerState:e})=>O({flex:1,minWidth:0},e.disableIcon&&{zIndex:1,pointerEvents:"none"})),dL=u.jsx(nL,{}),fL=u.jsx(rL,{}),hL=W.forwardRef(function(t,n){var r,i,o,a,s;const l=ft({props:t,name:"JoyCheckbox"}),{checked:c,uncheckedIcon:d,checkedIcon:f=dL,label:h,defaultChecked:p,disabled:m,disableIcon:g=!1,overlay:v,id:S,indeterminate:I=!1,indeterminateIcon:x=fL,name:C,onBlur:y,onChange:A,onFocus:E,onFocusVisible:_,readOnly:D,required:G,value:F,color:T,variant:j,size:Y="md",component:z,slots:$={},slotProps:B={}}=l,H=Te(l,iL),q=W.useContext(Wa),ee=(r=(i=t.disabled)!=null?i:q==null?void 0:q.disabled)!=null?r:m,R=(o=(a=t.size)!=null?a:q==null?void 0:q.size)!=null?o:Y,M=Hi(S!=null?S:q==null?void 0:q.htmlFor),U={checked:c,defaultChecked:p,disabled:ee,onBlur:y,onChange:A,onFocus:E,onFocusVisible:_},{getInputProps:V,checked:ne,disabled:se,focusVisible:ae}=VS(U),X=ne||I,ge=X?j||"solid":j||"outlined",Ae=t.color||(q!=null&&q.error?"danger":(s=q==null?void 0:q.color)!=null?s:T),ct=O({},l,{checked:ne,disabled:se,disableIcon:g,overlay:v,focusVisible:ae,color:X?Ae||"primary":Ae||"neutral",variant:ge,size:R}),Pt=oL(ct),de=O({},H,{component:z,slots:$,slotProps:B}),[he,Ce]=Se("root",{ref:n,className:Pt.root,elementType:aL,externalForwardedProps:de,ownerState:ct}),[Ee,He]=Se("checkbox",{className:Pt.checkbox,elementType:sL,externalForwardedProps:de,ownerState:ct}),[Oe,_e]=Se("action",{className:Pt.action,elementType:lL,externalForwardedProps:de,ownerState:ct}),[St,At]=Se("input",{additionalProps:O({id:M,name:C,value:F,readOnly:D,role:void 0,required:G!=null?G:q==null?void 0:q.required,"aria-describedby":q==null?void 0:q["aria-describedby"]},I&&{"aria-checked":"mixed"}),className:Pt.input,elementType:cL,externalForwardedProps:de,getSlotProps:V,ownerState:ct}),[jt,Mt]=Se("label",{additionalProps:{htmlFor:M},className:Pt.label,elementType:uL,externalForwardedProps:de,ownerState:ct});let qt=d;return g?qt=null:I?qt=x:ne&&(qt=f),u.jsxs(he,O({},Ce,{children:[u.jsxs(Ee,O({},He,{children:[u.jsx(Oe,O({},_e,{children:u.jsx(St,O({},At))})),qt]})),h&&u.jsx(fu.Provider,{value:!0,children:u.jsx(jt,O({},Mt,{children:h}))})]}))}),pL=Ue(u.jsx("path",{d:"M9 16.2 4.8 12l-1.4 1.4L9 19 21 7l-1.4-1.4z"}),"Done"),wr=({label:e,values:t,allValues:n,valuesMap:r,showAll:i,showAllLabel:o,onChange:a,toggleShowAll:s})=>{const l=(c,d)=>{c.persist();let f=[...t];if(c.target.checked){f.push(d),a(f);return}f=t.filter(h=>h!==d),a(f)};return u.jsxs(b.Box,{sx:{mb:2},children:[u.jsx(b.Typography,{level:"body-sm",mb:1,children:e}),u.jsxs(K1,{orientation:"horizontal",wrap:!0,sx:{columnGap:"12px","--List-gap":"8px","--ListItem-radius":"20px","--ListItem-minHeight":"32px","--ListItem-gap":"4px"},children:[n.map(c=>u.jsxs(Hh,{children:[t.includes(c)&&u.jsx(pL,{fontSize:"medium",color:"primary",sx:{ml:-.5,zIndex:2,pointerEvents:"none"}}),u.jsx(hL,{checked:t.includes(c),variant:t.includes(c)?"soft":"outlined",overlay:!0,disableIcon:!0,label:r[c]||"N/A",onChange:d=>l(d,c),slotProps:{action:({checked:d})=>({sx:d?{border:"1px solid",borderColor:"primary.500"}:{backgroundColor:"#fff"}})}})]},`checkbox-value-${e}-${c}`)),i===!1?u.jsx(Hh,{children:u.jsx(b.Link,{onClick:s,children:o})}):u.jsx(u.Fragment,{})]})]})},li={popular:["FT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","CORRECT_SCORE","OVER_CORNERS_9_5"],playerRelated:["PLAYER_YELLOW_CARD","PLAYER_RED_CARD","PLAYER_SCORE","PLAYER_SCORE_FIRST_GOAL","PLAYER_SCORE_TWICE","PLAYER_SCORE_HATTRICK"],goals:["OVER_GOALS_0_5","OVER_GOALS_1_5","OVER_GOALS_2_5","OVER_GOALS_3_5","OVER_GOALS_4_5","OVER_GOALS_5_5","OVER_GOALS_6_5"],corners:["CORNERS_MATCH","OVER_CORNERS_6_5","OVER_CORNERS_7_5","OVER_CORNERS_8_5","OVER_CORNERS_9_5","OVER_CORNERS_10_5","OVER_CORNERS_11_5","OVER_CORNERS_12_5","OVER_CORNERS_13_5"],correctScores:["CORRECT_SCORE","CORRECT_SCORE_HT","CORRECT_SCORE_ADVANCED"],misc:["FT_1X2","HT_1X2","BOTH_TEAMS_SCORE","DOUBLE_CHANCE","HT_FT","RED_CARD_MATCH","PENALTY_MATCH"]},gL=({labels:e,values:t,valuesMap:n,onChange:r})=>{const[i,o]=w.useState(!1);return u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:e.marketSelection}),u.jsx(b.FormHelperText,{sx:{mb:2},children:e.marketSelectionDescription}),u.jsx(wr,{label:"Popular",values:t,allValues:li.popular,valuesMap:n,showAll:i,showAllLabel:e.showAll,onChange:r,toggleShowAll:()=>o(!0)}),i?u.jsxs(u.Fragment,{children:[u.jsx(wr,{label:e.playerRelated,values:t,allValues:li.playerRelated,valuesMap:n,onChange:r}),u.jsx(wr,{label:e.goals,values:t,allValues:li.goals,valuesMap:n,onChange:r}),u.jsx(wr,{label:e.corners,values:t,allValues:li.corners,valuesMap:n,onChange:r}),u.jsx(wr,{label:e.correctScores,values:t,allValues:li.correctScores,valuesMap:n,onChange:r}),u.jsx(wr,{label:e.misc,values:t,allValues:li.misc,valuesMap:n,onChange:r})]}):u.jsx(u.Fragment,{})]})},lt={avatar:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMA+h6XBeOBCz4ozafvc/W9X+nD29ROsWmINjBVRxC4F3uPnhL6/TMAAAygSURBVHja7N0JkqJAEIXhAsEFEEVs9z3vf8eZmI6J3mxFZamq/L8zaC2ZrxKjTzTaLfu9xWweZ7n8FeRFmRwuq+XbZmDgs2gzPR9iuaGYpOl4yO/AQ+G0lwRSUXJ+40fgkXCaxvKgYDIeGXhgvZrLk8rVxsBp63MsLyn7rAPOCvul1GB+Cg2cE20nUpvDNjJwybpXSK2KPsuAM8J+LPULUk6EbjgF0pDD0MB2w0QaNOMnYLfhRL7iJ6DJaCEtOHAWsNO+F0g7Um4EFlpm0pq8T6/IMptEWhVPDewxWAXSthlNAltEu1I6EKyoD9sgOufSkZIrYfeOM+lQj8NgxzaxdKpcG3RonEvHgpNBV8KDWGByNOjENBMrFJwFu7BPxRbB2KBtw1gsknIbaNk4EKskHATaNLBn+f8vpjLcnn0i9skue4NWHOdipYRfwHUa/v//JBwFWzCYibUm9AebtxCLpQYN64nVVgaNGovllgYN2or13gwaM7Ss/ndNTmuoMevOu/9VZGREGrKxpP17T8bToUaMCnFEQV+gAaFV/d/bYt6O1e5YikPmtAVqNrC2AUBboA2RFfHPRywManQR5/QManMSB5EU1VQApij8k7IC4E855YBaHB0qAHwVExWuQWRxAuieiYHvCZDbzgYvmorTtgYvGTl6APwv4yD4koGlTwCqSwgKqz0AUBHUWgGiHlST0JEI0G0F1YBnOdcCpDFYq6V4grGyTwkdvwF+yEiIKd4A2AR0lgApCL5o70wIvIqCkKiCEBjloBqtxTO8FnqMYynw+2YGWk+AnAMfNnA2Bfa7mLag5zFwYuK1OXpTA/wsoymkKAXAVfAFIwcGwTwjIB7mwSRApgheQw2oGqYHVTERbx0M7tqJxxghd5/DL8F4K8YCwBLAAsAS8IqheI4lQO0VgIuA7hoAyRDVRUDKgZWMxH8BjwTUtQFpCqrOAXyXExFXFQQiGlRZ5GESkHSg7igwAWGqwLwRqGojapANU3sH5Cb4q4GKO+C7jO+JeDwQhqExPAflGEgbgGPgg1aiCp+Z/86riTD3xQaasqA/7Qw+S0WZi4HSIsC7jI6Qd2PBGSJOFpBsIDtAVTl7gOodgD1A9R2APeCLyIsvg3APoArEM0GiIHxW9AlK0sDflQYaO8EfeCT2bixKLQ08+zgQnxJ6QqSwDMhFUNNUGC6Ct/VFrZOBohdhzAy7KvJ0NjgdwT/snVlSAlEMRYO2duEADnQVIO2U/e9RLSkZbB7o5zvnbAGqX3Jzc2MJYHq0KoBZEZqBHAm7EOB6wGHOEo3jAKQbTF8Ydidwn8ugg50EOQ+yBrQKjHhJOPTYULQO6EAQlgykK2iHZtGtxlBD8Ibz8apbEGdC/Su8/Nvmfo4rBTp//h1uYPnBkGB43UGOgB0N2/uZG7VHD10FO8YFJUEYbAN2MoQ5DeU5KTsAO4FhHlPIC+O2AHCbONwCZBmIOgzxV66ietqUw4zqlwIsAeD+ELwDhO4PwTtA6NFx6FVAbeI2Afg2QCcQfE8AnAdyCjdROylFonKalCK1O8QVAuF/AL8A8D+ANQC8BrALoHcByPNA6gAbZikFZlE70xR0ejDyRKDJkRveUgrMo3Y0hBS5i9qBHonUEmY0rNGxCgHqQOwLMcd5iPqxDUB7QiPuUsBNAPhSsDWgtlBHQYrBcCFYLRBfAlgE0EsAM2LAZgCVAPgo0IgA+CTom8ZxwCD3QcGMgEHOg4JvAPoF+MS0aGpKpHHR9JxYbUGHGEFUIJOCsOlAWkMtAc2KAqdD6QsqAjsbF40TIWwP6CcA6wRwT5w+CN7mKeWHLoC4IQJKBRhiaVzQmtE4kOgMAu0DDdE6FGSdjFUQhh+N1hoENwL9plUMyBn2AfhiiT8kPYF2ACrC0CGQl2SZuyAuC5PXgcs04PDYafXXAU6hxQ4FHtANwIYW+g2Y+vuvaZB1wLXff7QkSBYA3RThpIGYGqIL1DfAF+A4XcJAugALtDB/2MQWkH1M6jlkl9tEcRuCjo+0CWRvCtF2gTUG7HEZss8iQSxDyNFhyoDwN0AjGPwN8AVgD4SIaQDGR0IjIdWCVIHMjgOeB/WclIFQ/6BHzISdBMO3hNwGgl+SgIUCKwUoAmgL0QpyKn31gRGTPqTAe1aOdvAyy6wceCIMPkCWGQrrhoiZgB/snVFOwzAQRO2QElJFhUAJClUpwve/I0h8tagobVzH3nnvColsz+7sLEoQDUhDgDbAFOo+mGVFJoR2MYgi0BQas9vlO/qA2tYwrGDT2Bs9AjgAxI8ADgDtV0DPAaAtBJAA2tuEqAGIrxGgCKgdF0EkhPhCMdqAF/IRTDE4uIzW1JCI6nJYFsuKL4edw95QW1h3OSxSEAmIPxQnqPg7UH05qHxXkC7gtdQm6oFbmgBXMxq4BPzoQDk8klBI7UtgzQUwi/fCLwFPKOhMPkPRYAPSXiZECWg+VcEO0f7gQHlgnOWA2o1hFGAc6kIzhJ9RgJGoirQG9ISCR+OhwGqAJxH0B+FRoTcHTjg/kDzAuNSF2YMeeQBG5lBUetgLgbDRaQuqCHaYwH4RlQIbBMBN2IUy8FSAj1HLkEQAniBmDsAE/AcpjyAdoJtyFzKHMdBj1P4ACoCnaP0BfP9zaPhDOP/PIPISvHfwD+abw1jAk/GUYVXYkwKRkNfsFkxuyIFLypiZTXDFCFhiqqzGRtcYQJPTDCEbBlLAJmJTDiL/FmKXxVOwo/2/GG0GD4Et9q8FaRa3i39x/X+zdyc5CMNAEEUhuQnc/46sEFMGWyJy1PX+Fept7R7bfXAXdQWAABAAAkAACAABIAAEgAAQAAJAAAgAASAABIAAEAACQADofPelvQrqqd7+BPRUcX8C2qu5PwGtVd2fgLbq7k9AS5X3J2C/2vsTsFf1/QnYrv7+BGyVsD8B62XsT8BaKfsTsFzO/gQslbQ/Ab9l7U/Ad2n7E/BZ3v4EvJe4PwGvMvcn4Fnq/gQc0zT8W+D2bu5H/LtpPuGdqPWuMwLB8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8C8fMjED8/AvHzIxA/PwLx8yMQPz8CD/buRStRKIDC8NaBRBBFzfttxvP+7zi1Wq2mxgxLC87+v1f4d6VwIPv8TMA+PxOwz88E7PMzAfv8TMA+PxOQukfr/I86xieIyW89gT75n3WKvtz0C/IbT6BfBLxhNAHyn1as5YD875uvFDvyn7ePewJr8n9olClW63lADZOtYkT++vKZYkN+6wmsyH+xfKNYrPYBn3BfKQbk/7xplajlyP816aLVE8jI/2Vp2VNLZaOAKxi3cwLkv57B79ZNgPzXNbjbqUXIf32D5UEtQf7bGP5pxQSyScCNDJt/inxL/tM8HiQg/+11jo09PEj+8yI/QrzNAz4W6xHiGfm/17xRR4jJf4nojhCT/4fsG3F+lPyXiuoIMfkvE9kENuT/eZO6EyB/rEZr/YDNfUBTFF2dR/7Inb9HQH4D70+A/Ca+aQIV+RvrG24TVdOAJnt1gZj8jm72dHlC/pa4rxLye0sXybXzpwFtMi575Pd2tceJkgX52+lhAuT3Ni4T8ntLK/Kby7PP5i/JH4eiS35vw1KX2pI/Knlfl9jxTt/YdErVt+LHP0Kjg2pa8N9cojTOVEfyKyBOtf4M9Hitb8SOyYf9ecY/avse/b1Ndjoj4f1e0cvPLYCv/wbynt5zF2BglOi0WYCFQid1BwEeSp3CFwAbnUz/KwNspDu91ecGgJNfeosrAF4yvbYJsJLrlYTnvtxU+tciwEya6EXCESA/C34BeJvqBZ8AHM30bBtgaK5nnAKz1DnoSZeLgJ5K7gJ4m+gJ73x2ddCjfoCpir8A3gruA3pL9aDHdwBfXa4CedtIWgbYWvIRwNteEofBjaVSN8BYj8eBvK25DORtpmOAsZIvAd6WnAbzVmgYYGyvAGc5A/A2ZQDexgzA25ABmGMA5hiAOQZgjgGYYwDmGIA5BmCOAZjjTKg5jQOcifeDeWMA5hiAOT4DmPvb3h2lNAxEYRT+kzo0JtNqoFpQmyCz/z2KFJFa8d2e863hvCRzZ65fAXAOhcL5IwjOAOAMAM4A4AwAzgDgDADOAOAMAM4A4AwAzgDg4lPRaN4Ohus8DmYrjoSxLVmawHY+Fcu2zdrENSeOBZNtkmyasNa4MYJsdHMs25BPL01MY86mJqT7nJ28Hob0ni9DE88h3x6baOopFgBW+1x48lgYpfT5oXd9GMjzNteGyfEwhvKW363HxQZu3uE1f7gbdtO4b1e6WudSylz3JvJ/dfPDcc2FD2jGIfoz6ZkMAAAAAElFTkSuQmCC",team:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAgAAAAIACAMAAADDpiTIAAAAbFBMVEUAAAA4Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk04Pk3VGBMfAAAAI3RSTlMAcN3YbAMJ8lQsGkdh97kVyyLTsT0Q7ayEfDXD6KSLdeSclIjjiMMAAAu4SURBVHja7NjbasJAFIbRbY0S0npA641Cxc77v2OveyElYCY7nbWe4YPZ/wQAAAAAAAAAAAAAAAAAAAAAANCU7bXvVrxI11+3sSDD/Vh4sdt9iGUYHoVJPJaQwGa1K0xk120iucu+MKHzJVIbToVJnQ6R2GFd+K2pAraO/wpuee+A70IFX5HUe6GKz0hp4wCs5JjzEegLlfSRkR+AavaR0FCoJuMU/Cg818AbYAP+4b8vQSdARefIxwis6Bj5vBWqWUc+AnhOAAgAASAABIAAEAACQAAIAAEgAASAABAAAkAACAABIAAEgAAQAAJAAAgAASCAxgmgcQJonAAaJ4DGCaBxAmicABongJfpZiaAmcXMBDCOAAQgAAEIIPIRgACWKEYSgAAEIAABCEAAAhCAAAQgAAEIQAACEIAABLBEMZIABCAAAQhAAAIQgAAEIAABCEAAAhCAAAQggCWKkQQgAAH8sEvHNAAAAAiA7J/aDJ5ukAEBBBBAAAEEEEAAAQQQQAABBBBAgEcZCSCAAAIIIIAAAggggAACCCCAAAIIIIAAjzISQAABBBBAAAEEEEAAAQQQQAABBBBAAAEeZSSAAAIIIIAAAggggAACCCCAAAIIIIAAAjzKSAABBBBAAAEEEEAAAQQQQAABBBBAAAEEeJSRAAIIIIAAAggggAACCCCAAAIIIIAAAgjwKCMBBBBAAAEEEEAAAQQQQAABBBBAAAEEEOBRRgIIIIAAAggggAACCCCAAAIIIIAAAgggwKOMBBBAAAEEEEAAAQQQQAABBBBAAAEEEECARxkJIIAAAggggAACCCCAAAIIIIAAAggggACPMhJAAAEEEEAAAQQQQAABBBBAAAEEEEAAAR5lJIAAAggggAACCCCAAAIIIIAAAggggAACPMpIgLJLxzQAAAAIgOyf2gyebpABAQQQQAABBBBAAAEEEEAAAQQQQAABBHiUkQACCCCAAAIIIIAAAggggAACCCCAAAII8CgjAQQQQAABBBBAAAEEEEAAAQQQQAABBBDgUUYClF07y2kgiKEoehVIAGUgE5CkRYC8/e+RNZR/7NfyWULrSl1lVwfQAXQAHUAH0AF0AB1AB9ABdAAdQAcQt+wAxswtgNV8AniSJcYUCeBIPUdZIte7QvbUs5clch0UMlHPJEvkuilkRz07WSLXWiEn6vmSJXJtFPJNPX+yRK6rQh7Uc5Elcj0UcqWeH1kiIP/k9Ew9G1ki10Ihr9SzliUC0lcBOlPPmywxosxHO1DPhywxqsR/c0VBL3JEqrtCPqnIcxtEqmk+uyA4yRGZltv5DALhLkdkuinmQkWegwCGFRiebajoLEeMS58D6kZFnvdAEq22c7oFwq8MMS59eLqgJssnIYzKXwX+k3cvOgnEUBBAx0ddXbMqJkAUMJj5/38UwsMA4rZsdjtTzieIudveO20l4yC2A2Ekyz4JkhwGrz3SEFLlHwTwGZpqGkK67I2TV4ia0w+yCcvC1oCeuVCkUeibaDaCXVNhSCSQolXMg2180g9yGTe80BNUBcNIANIIjE4mAbIMJ8JIohCfmELXDe0gnsYSUHgJYBkMRTSVYqkYCDWeByGPEVlcF8DzgCCiCP2hFI8FOp8OQRZ1w9IGAfuIgxlk8cVLVcKbQMuNICKpFADlTaBlMhQJsidBRI+FWgcDEUljC8BGNA7o+w1ABgsW+wXwiwUhnsLMTP0L4LcPQIrsF+pV8l8AYEEriKJSI7+hz6wXhKE9LLlS0M0gx4LXteGIpRCe154D7HzQCeJoDExVDwQ4p8MxrDBjBzUsWLUCEEGlU6rfBDBcBmJQdUWy0EGg6TIQ7VTOzyq+E+N/PgCtVD4A0mHAQ2OjbiAGNKrYQTWGDaNkGFrI7ADEs2C26WC00GmQSKeBfS8LQQuFkwDS14K47wQxlNclycLHAI6PyGEg4YVb5TwUV0QuBP/S2RrrJ0FMm0E4T+mb+C6eBveNB2MQowm3iroctoQSgCE8vLGbW7sCYFMCcJ5QTM6vANiUAJyj0wHyLAAuJQBnSO2IHAuASwlA754adnRnWQBMegHo22hOXlkPYCc4PCOFno3f+aukJ6JKmQjglFIH2CkJ5jkURK/ClJ29wJdBLgB/y38RgMHFoEVEg3BCqQFgFgQ6VctfHose3bO7SvZxgEICwjgm1gm7gbdwR204pNYG8RsDu20Fsaf4+7sFwQyfEcGe4j++7uMgxawDsaH5+7uvADfuqQy9eG64cqVTwGNhRmHYEvz+c2a/AjToB2JN8/dvrHuAP+zd62KiMBAF4CkWUBTFG6JSLz3v/45bbbu77noBm8AknO8F/EFMJpPJxJWmMfJN2f7/w158ESq+JiJnGmOezJMF4GSg9764iOic7vxZAHRnhOWTgpcAnG0HUUWotjJAjAqPMGTs0QJwkuTQSUyK5jAkd6QjnPsVomLQZItPnS4Du+UdKok50x7OOl8Fcl2ks0ZYjNmUAHeAd0xVngqJKf0UpsROtQNyPAzQlv7xNAD4tIM+YkT4DnMK8ZXGbICYsBwDYAbgsYm+x6XFgOkM5gQONQStb6PuUEB+bpHjA48A3GwaoCv8c/cmsLOBoKrwz+cA8Fuo7D0RPdnfk5XHAaDSjKD8yOYAkzIH3oVU0TJDywAYpTDp4N0RoANbAXledIRRsecbAJ05YXnaNMMJM8Ct75zaGQDDHL/xFoi7m0F5TljghBvAJ4Vq3hiXpyRjXOP5u+AiHp4LyTOGJQybdyABcClScllExfSPbScSAJcmOhJCUluyhWkzr08Ab0lU9BKWuvo5TAs6kgBSmRKUeqJ3GHfwtATwsYGC2yJSy6AH48rOfn+RQfuFwlJDuId5eWcSwNdsWh8BUt10iw/8/kYtYrRLKhvFMC/eSMe1PQKkoskcJ/z+vo2Aeps/fn8Rz0aAVDF5wxm//5lXkaBU0C/xB+O/M2/yAfLQZAUrSn7/3wYl2tLS6g8c+P3/Mg3QErkvmcOOoMP5v2uSHtoh94SvMeyYdfT8R9/psNwxyGBJ5kUbcLOWW7RBbop2sGXcwfoPwz3W7A+AYYCreAHsXwq7LP58ACQrWPPO739LgcbdOPdNYc1aSFH7ALli2MP/eP/jAXXN1qppdvZH2qH7Xwr6rTwxAKJ1CntKHv88NAjQJLnUD2BRj+m/CiYZGnQ5+Mawacv0j76EgPwxOcKqFdM/FYU7NEa+RfsYVu24/dfYQOD+4s/tX1uGMZohZ4sMdsXc/tU0OKAR59+aw7KA1R+1JRmaIJIccRPD/xZFb2jAskhh25Hhn94nZ3M8xCdgW9OP4TyGfw7lhb8w/NNjqaWZ1JPGnWz+IuJmVtC8guGfgyUCxsTev/5wCwOBkx6Xf0OWyh6Z4OGfCa0357HsRcighYaWcjWUC6EbtLRntmnM5P9tahq027Pm7u8BJT267Thw+rdk4sQyMOf0b034oj4plL4KWTTQ0WT+phmTP3UpaNcNVv66ZKjvDfovAaO/RizVvDh16Y1Hv0/S8GrHj5U8+mtQou54aMXNX7NGqsoFY977qcTXw4E5u/5V4eskkPPvX5mPkcCKf/9aPNsOMPi3xt5TDtz7+2QYoDUBb/0oEO3Qkh3LPnXYZGhBxoM/NcKXGA2LX3nwp0myQqPeuPfT5n4wyODPf9E6RSNSFv0qNZ2jAXP2e9XL/jrQ4+yvmuV1IN5z9tcuecMFxv6dY6vtZ8Zm/44IRyWMO4w4+7sjKlIYlRbM+7tlugJY9NFp5kKBjBc+nBSOSi7+3WYgFEjXXPxd9tOswJGLv+sGYzxtzJoPHwxneMqMaX9PhKMDagsY+3kk2ueoJX9h7OeXZRGjsnjNcn//THYpKokLXvX206SI+fm7bbnOcVfOyd9z0b7ETQeGfh0QjQJc1ePGryPCfob/bPv8/B2yWOHCiuVeXTMtZvgyK1jq30nLRf/1tb9g3P+rPTgkAAAAABD0/7U3DAAAAAAAAAAAAAAAAAAAAAAAALATZ09HWAi+hXYAAAAASUVORK5CYII=",competition:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAJYAAACjCAYAAABotuf8AAAAAXNSR0IB2cksfwAAAAlwSFlzAAALiQAAC4kBN8nLrQAAEnpJREFUeJztXQmQXFUVpaBCzCIIghAooCBRIZDp7r93/+5Ze++GYrNEooALUux7sYmAqIAUQgWpArRKBBHKsMgiawhhEWIpi4AssoY9rAGUBEgGz+2ewDDTPfPf//3+7f79TtUtqMnMe/+de9599/3/lnXWUVBQUFBQUFBQUFBQUFBghe7k5unJ/FlWurzMSBVXGcnCMOxTZQ1tGBx9DK6W4/8vBG+D3P5rSxipQtl0S4/Ymepqp3fnT5V5N+IMAnuWOITApnH7sm3Qo/dtBWJWcDuo04041JxchdufgaHZ2el6srCfZudOQbS5xM5UrvFjIORlbqdExcDna4hg1/r0w58S1tBpdZ9mNwxdUAkrux7G953NVGkhGvGula6sxn/ZSVUW3ODLYfIpAsWt8PE+8PX6oQmLwi0e4G1uEpTJNQjsE93JHxWWqBIImyu5G60sNHF9DJ+XpIoK4+80zDx+xd1YZeEahsSb4+bgTGnCQpI+23LLz3E3VFm4RjkXhsSYNGHpyXwKSd0n3A1VFrawKmswU5T3GgMhcX/uRirjMfj+TGnCQo51DHcDlfEYfL9AmrB6jP4TuRuojMfg+wulCQuqPYO7gcp4LGFlr5YmLCtduZG7gcp4DL5/UZqwTLd8G3cDlfEYfL9cmrAwM1js56HsTHUVbGUzc3qra7iJi5CtmYTvVfQ7ouXC929LE5aZKi0SfqBkYdhKlx0ovqnpyfxF6iN2cCMOzVRx4UR8079BJA+Ilg3fvyVNWJZbul30gdAQsm0mFa1buoPbMZ1uxCE66XYT+hC+QL70kI+y32idksY/1K1+Gqw7hZ7JyrYzlQ00J38BGv0yhsaxPRHhu6o+fPfWhrIPxv4cnC3Xk8U/O+BwMp7JFyjjcdG64fvXWqOiBoBqr/BDSI/eZ3gpn9b+xIyBr2P4/IFmZ09O2NlTIbZjEbrzqPsqfsfyGni5xEgVMnqycEyNGzt3On52UMIeioG7GV44Jl+gEz8lWjeGwgeDqWcCwOm+XpBuPy+ZClp33Bz8KbdjuS1uDZ0UlEfyBaLPM6J1w/cXBa27KdBLjvJDiOZkvxO07rg51PVv/RGhjgvKI/kCEest0brh+3OD1t0U9BHaz+wNofskO11eN0jdGBqP43Yst+lIC4L6sOaLTEV4hQp8f3LQupsC+Y6vZTO00QKkfCVI3bqTO5bbsdwGDo8J6kPyhSMYHGrLZpx8NWjdTQHV7oQZyLs+1H7HvERm0lcOEwGh+Hhux3JbK4ZC8oVovfRiFX/nBK27KZDAbQHF3yv6YJZbfgeKTwepO4HEldux3Ibk/cQgHMIHU034QlxYlWWYPE34fiwQMK3dGMK6xofikWflfxikbkyzz+d2LLchYp0RhMMevc/ykyNjlHoCHXuzIHVPCs3J+UqijWTht0HqxRT5L9yO5TY4+NogHEIcZ/kStJO7Pki9nhA3B4Z8kvIIprqb+q0XY/wtXutCr/yQti1xC6HVZqaKN/nlj7hHSvIvP/XC5/v7rdczoPqvYTgUPrgD4/R7mNlpfupEtJuOOpd6dgB+F9PqF7iF0GpD57rLSOan++EQUUcjH4jWiYCwBj7f1k+dwkAS6Gv5DIT1Bz/17Rh3t0QDn/ZcT7JwPm0R5xZCq40+xczTej19Hhvns2T+ND91mqnSY37q8wXKszDUDAs/pFt6GxOArUXrw2xoLkhd7l1Y+aPxjGdyC0GCsF7X7OzuovwR5+D+bj91IkpeJlqfb6Bxup2uvO/nQeH0wy23NEWkPtrPCFI/8loHkZ+wsidwC6H1wqrSYXTCZykQ5/hbX/4Cl/Lzq7VAMjfDdMv3+3lQzO5eQUMzIvXRpwyv02T6vbg5OBs9zdd3zba22kK+klA6QUdNEed+6oOPP4Kv5b5mGAv0nAX+CKoOm27xAiNV8Hw8DoY1z8t1MPNZiQR3Csg8jF0IEgxD2j2efQSO0YnnE+d+6kKuers/dQQAKt0dCfUqPw9Mh4Ohwdt7rQvR53XPwkqXX6C/QR2HcItAhqF973j3UX57/P6D/nxU/QQ+/p4PaQQDpqD0Fv7SAD3vaTR80jAbM/rn0GFgAuXWXiKCmAO5RSDDaNKUMAcnnRliBr4ZuLghgIAfJB+3QitCQERYF7nPbqJfykcbItE5k9WDxu0hQPpqlHk6/Z1m58rIR9iFIMOQN034zdDJVKZAVOc2WsbszWqf4I4hH7dKL0KIG5TElzy/BhgnhHRlZcwc6G1WPs0ekSf8TEBYKyD279PfxoyBPtohxC0CGYY2TviJJWFnDXDheRY91uDT1zEBCv8M0tFAYn0UlO2zZ9TyrQ8ggEMblR23BrdFI+/yWhZ9LAUhtXOcSLAQZSSP9sYwRS9Kt2jEmZ4szgcPrwUpX3PyR8rUjCfUX76VPTu/iSDeQqI4f2zZCMcuSPR81ilEuBhDYe2TBwQGYRUjKSx0xvfRoe3xfBVIVE8EFO2biHjCL7GlwHSL+wU9+B+EfBAzBg/E8Dd1bbkg6jCRHM5MFT87EQX51T4ok10EsgzcHLy2rcQZOtKuxGEwwVbXoDPyR6u1wMPQDPHi4IRV10CkV6G8OVQuyrxO5O/xd4evfSaI7Ehu58s0DPOXUzvj5sBMiGxBK1ZzQJhLyZdcOmoIPNA3EaKFly036DXD1ECIam/890nvpJQ/pP2Ha5+H9iNyO1+m0ZBnuWVE5fLN4P2/gXlPV+hs9305NdQURqr085FDJwITNzK0iry/uhfJ/mfLZzE0RH0pM7hp3b1D5Dt0zPa8hwcheSYe7iIOolHveWsTdwJ68u/bwPkdYXSKkO7k5R233Qogt+nhOEeL7n8Z/RxqKbM3oyEV+ZrJJBcxYBja1PK5rMYnObR8dqvRz4BeGLmFfhJ4e19P5nfh0okvIILsgajxfBgEIb/6wjGGCSvbg4RW+ESVbjL45iPyEbgL7xKmVgHj9gB6xZsyCaJZJKLTJaPr3THu9ocl6k602gtpJ19mkkVw4OHXQ68oIXq0ZKbYRFgfjv0khDoPws8DT8GjaOQLdMTDyDdcumgZ0JDdEEH+I6f3lR9O2ENzRtenOflf0HkD3E5sN6OcinwB67zhrxlGFvTf6WcTxkQ2dhgkYFZ6PbcT28nqL51LS/1sZOkIJOzBjSGEK2l1YqsIM5L5cR+v0TOFDxaLsoHzKzQ7O6eRTyIDDFHTMFTNR/R6Nbiwatuhdhhdvu7kpiNiRW4XtB9DmvA68s3TiXMuf4cOJNybGqnCwiAfT9ETb7PT5amjy+3R+9LcDuW2+krawkJ0ukkPFY4kNCc3E7YLSBBO7GmbF4gb99EU0fBgbsdyGi3yQ4c7WrNz7f2JJgwg6myAsP2iCIEYSl8ZW07cGtzIdIu+N3h0uhGHGAkCHyQcGcTNQcsW2IlD67YstzTuWKSENdQDwXVt4o5capiOMufwYdtBs4doQ8ZNgj3zyYSdHffh1Ki/GO3q91fgZpHmZMPdvdyOSNQP/HhDhDzkEH9sVJaZKl7G7Vhuo8NT0On2DNuPbQeI5HdixFVXNzrBV0/mDSSuwjcuRNEQte7g8GXbgN4E05JiEdJMt/wohDVrbFkQ6An03ZDbqe1gdDKP1i47bThgpArCB3doTu74RmXR1i9uh7aT6U7uR2H7s20AMfxNhCz8/rJG5dBOFUQ+9bZ9lCGC300bfsP2KTswg6uKfDOkg94QrY4eW07M6F8PQ+MB3I5sNyNu0RGP4PAtGzAEzrDSYhdfgqT75unjt5WjV85C71SrGRqJK11Zgk7n+6TqjoOeLGTqd0F77n1rmr34M1PFvZGsRnIrfQuE9W7CGuyOXEuzh6ZAJOeJEISItERP5jcZWxYi2Pr4N+GbMrrJEOkfwAxR6MzXjkTCHtKQaHs+uIKuQNOcbMP12RgG59K1tdzOa2erHdQGzsP2c+igE/e8nolJCaiRLJ7XqBwnU5mGIfVObsd1gtH9R8i1Ng/b16EBSftckdsRLLd8HwgZd1apVt+ksVvQE266xcD5CojrWxw+DwXIrQRu8Kp+2uxIHfx8W9MtL+F2WCcZnRcbtr9DQT0fKnvOh5A7rUbS2fA8eAh0P7ULR8woF01YQzs04rOjgSFNaElLfaNE4fhGt1jg599AD/R8G5iy+isbzcmdyuB6uTBT4is7EeH+DTL0RuUhApq0TZzbYZ1kyHEfDdvv0uFHWCPiWtaj9321UZkg6tv+j5zuPkNu+kjYfpcODIU/9rcjp3Y2w5X4+y3HlonZ4fT6eVzdvWrUk4F73cmdxOF7qcDQtYXp84bPkUNXz9YaHA6Gn8+DCV+A3m2G5P0xJO8Nj/DueCDh3qj+mkA8wpC4MJzejzLGrXWfp/V+GT9/jNt57WrEuZkqRXuPIaJLDA290RE4X/Rzqw7b6cqDKGOXmNH/hYMtUOaudqaixPVFG0aO+lyN81Sp80+XmQwY0rZGYx/ySxidzozZ4qWa/cXdKCjTQEKvVpKOGKL4I+Da4vIzC+Lm4MZ+r5Nda+iN7xnJwkUoa08kppuOlDuT8glup3IbcYvOF+f2MwsQXWIj9+n5PtqIci8Mj8tB5N9R3i2IWjchokk9RbDNjc7Jf4a41exc9Ie/ZoCwtqHe5fVqXmXNjTgEn0thDV8qdyWQCyygD8/czulkIw57jP7uWYrsBQlraBNErgsRxgNfm9JtNrIs5krikNuPbYkeva92GK7pltVnGs+iqn5ipkqHgrupkzPc5YiZA3Mhrsf93r7eHUbnipZfSljZLF3Vy+2zjgEiVwLEXauO1W4oqo+IG93JN732WGEC6Mn8hkaysBfyB89bxaJutFTISBWOIG64/dPxMN3iTiB0cZeffUVD32LDLQ5y+yNSQOSaqtnZXTADeq7bBIY2v4YZ3wHEAbcfIgsMAdvQwWvdsPt55J6guxvtVFKQANrZGzcHdSOZvwzDQ+ReTdB5rMijbsDseKgrdjG3IxDBXCtdWuS04LJtdkMb6JMM2pTl5lVhnfrpNWaqOB85yKJO3BZGQ56eLPyj1oZUYSNuPhXGAI6Zgt4eR15yvuWWl7X1h+36B+MV9KwGfW3As3Pzp+ABCWvwS/P0XldzcjfTKsp2iGQ0m7XSlZc0J38z8qfv0jNy86TgE3FzYErM6N8GM6u9gtzb0wJRfYzo9JMeo38OPRM3LwotBGZbK/iEVXnXdEsONwcKEgDnBr7KLoCwXoWw1AK8KAIJ8m1cwjJTpdswDG7FzYGCBCBinMd1phbyq19j9jeDmwMFCdCT+V4I61kGYQ33GH0x7vYrSIKdLk9B1Do1zNkh1UVHLtlqMV60UTtDIu3vDAk/ZqXLj9GRS9ztVggBiCCz4PCHnV65kYvqQF1qlWc3QbOzW5hu8RQZyTyVabml6xKoA0PgutxtVQgZmKk5EMEqCcJaaaaK3XWPjcLnwFBlYziUcMdh9UOUfRh3+xSYQMISudNHJGKh7MO526fABLM+FEoRlhoKuxi6k3eRXLd8ZkhlouxjudunwAQ4v2inW79Oi8pE2b/kbp8CE0y3dEjrE/e6Ice6irt9CkxI2NnjZQnLSBZu4W6fAhOMlMilUWKGaBi9WyAUvMFyy9fJEhbyrPe426fAALqEG1FlqcQca01XXfStUEfM6E8hqjwjS1hkVAd3OxVChpEsHij77C2qg7udCiFDTxZ+QzuQZQqL6oibg2o5cjfBTJXukSkqMqojZg5sx91WhRCBxF3CqoYxwkIdmp1zuduqEBLi5sB+skU1ajg8lbu9CiFAd/JT4OyrwxIWotZfUafKs6KOhJ2dbWcqL4YlLKoLdea5260gGUaysGeYZ5iO3A67gLvdCh5hpArT49bQ5pjOz/JqCWtoFoR1cViiGjUcPkp1izwrGdr4FW6euwa6k9sIOdK5iAL3IRo8KWhPwf4XtrBqN8PW6xZ6XgjyAbT1crR5NjfvkQXtJAbRVcstvxC+MHjNSpffQNsPVLupJUBzci4Ifp7byVw2cl2xeifWakBUoedG7WbEAbcfIgU6zAM51RJux3IbcQAupnH7IzIwksXNnEz1cW7Hshs4ABc93P6IDIxkQQnrM2EVlLBaBSUsJSwpUMJSwpICJSwlLClQwlLCkgIlLCUsKVDCUsKSAiUsJSwpUMJSwpICJSwlLCmoCatXCYs4UMJqIZxMZWoY+wDb3WocZCobcPsjUkBPPRs9lt25nEYccPshctCcbMZ0S69wO5fLrHTlfeKA2w+RRMwY6LPS5Te5ncwgqvfQ9n25+Y80NCcXN1KFc3Qnf0/CHvpnlI3aSG2lNnPzrqCgoKCgoKCg0D74PybY2tE87U6rAAAAAElFTkSuQmCC",bin:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABgAAAAYCAYAAADgdz34AAAACXBIWXMAAAsTAAALEwEAmpwYAAAA8klEQVR4nOWUvQ3CMBCFX5MGloAJwgQwAUwAYoAwATSUMAGZACYgA/CzQSaAjgGgQTIyegU6WfbZioQET3Lxonf+4uR8wL9oCcCItUrZyDS0vgewqhnK306nnDW2NqiK4WEEYMSavSZcMlx8PJNHl35Gv9EAFo4uMQHAmn6uAUwY3kYAdvRjDWDA8CkCcKbvawBdhi8RgCt9RwPIADy5MgXAlQ9KvpHxAFwnDkp+U+MBuP5ZULIrjAfg6rqgZF8bD8B1b4IqWFTSHx2Ag+fmNzpbqoTZhV7EdKwTpi/aAB4R8/8OoIVITQHcFJvbjO2kH9UL+0+m+SiE/A0AAAAASUVORK5CYII=",checkMark:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAYAAABXAvmHAAAACXBIWXMAAAsTAAALEwEAmpwYAAAE10lEQVR4nO2ZXVBUdRjGdzS78BLqSmqyIKducjKZuvKqNMMpMgQW17IENEIFEWhVViYEJlm+dmG/JAFFZFcQ+QqlRKAQiNUWli/5EJYFgd0FUWI/gJ7mv+ZkAp497GG3Znhmzv3vec/7f//veQ6LtaIVrchuySFfLbY0vpc528DNtDQUCi31bemm+vE0Y50lZbrWkmysGedP31AnTVUXJk1d5yZOVr/LA28Vy9n6AU0vSeaaEiUzTVrRbCMyZxogtNyEwFyPdNMvSDXWIcVYi+TpGiT9cQOnp6rx/cPrSHz4E+Inrw3GTV5N4Okr3BwOnoVbL8rmlBLJbJNZMtsEuvAJD6pwavIa4u5fxXfjleaTExUi3oOSFxwCL8MttnROaZDO/Qa74ScqETvxI06OV4CnL9MfHyv1WzZwCZrXnIFSJvtTCcbhDWU4oS/FcV0JuKNXxEGQrGEafu0ZKCuWG/7Y2BV8O1aMqJGict5QyVomK+8w+OjRy8QAjg4rqnhq+fN2G3BE2xx7Gv7eJUQMKxA+JBfZCX87wGnww3KEDRXgkDbfd0nwOWh0lc0pdc6EP6y9iNDBC4bwoTz6I5bMeWfDHxzMR6gmDyH95zNowUuhcmPkkmIA/puB8/h6INcc1Jvzss0GrOuBg+CPaC/CuywWIT25i8Cfw4H+XAT3ZSfYBM8DVolnmgYdAR+uLcDGU/5wYb+D9Yc+QHB71oLw++/mILD3rNYH8tWUBshW6ajKvxXnB9fdm60GXPw3wT1s24LwQX3ZxAC+6pV5UhqwrsSOgud4zjOwOHwW9vbKoikNZFhuFi1728SzH8Fz/jHwysH3sU8tXRT+y54z+KJbpqA0ILDUq22BjxkpAefn04jVly+t8k8YeDVsKwLbnw2/t1uGPXekLdQGTL8aKOGHi7EheocV4O14NmJ0pfQr//ezPmwrZeUJ/Od3pNjTJdFRGkg31pmp2uZN7if/gtgUH4ATo8X0Ks/xxGsRHyKwXWYrPHZ3ik2UBlKna81UPf/GUwYevwnuSNGywXO6xAjoEFEbSDHWGKgOLHewEBuivOZBbYzzQ+TwJRvaZhv2tUnpwXeKwG4XUreQNT2wYdpEaRR4fQETpNoRWgXz8B0Z8GsTUh/ipKnqIltHZUR/ATwiFzbBWNt0PoL3bxdiV5uAeoyS3IbOnD9y9wI8Ij+aB8tk5f3bhfBtE8BHnRZFaYCETnQvqcN9ec80wQT8LnU6vFtTN1MaIIlZwmSVhu4NG9qTC/fI7csGv7M1bcDmNI8kZkvZ50O6s+F+dDvj8J+p07CzNTXeJnjrW9BXuJHEbCkfI/s7z8Ijeof1sefA+j4J35Ji8rnNX8eiIxL32f8lxUjl4a1KFtCCt76F+5UuMfoynbPhP1Xx9V7NSUvLTUlW6VT4lmR4t/B9WPaIZJXOgv/4d76QZa/Id2jUaNFlh8Or+GVbqnnPsZgQCVoj7inKHQhf6tUsYSbcfSwSeZOs0hFts4Wpyi8kklWGavJ1jI/KFv6Y3QfWVoVoc1xJ3Hdg4JyJiUvKW5Us8FHzXViOVrAmex1JzAL7sjW0dxt1moasB7Rv2OUQWbJI6ERyGxJ9kPSA0yU2cLpE5oDOTDO7Q2jwbxOoyD5PVmKyVf4nfrOuaEWs/7/+Atqs1blaLwVcAAAAAElFTkSuQmCC",upload:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAAAsTAAALEwEAmpwYAAAC+ElEQVR4nO2aO2gUURSGP8T1AaImIGjUIkIMooj4KgRBbFJZiYVY2agIVj5WsDC9VklIsLNQwS2yhZVmN4KotYVPWERFLBbER1Y0aBy5cAaGZXZm7nhn92bmfnBg2T1n98x/z5z7mAWHw+FwOBwOh8MheDm3WLycmxMgDi/n5gSIw8u5OQHi8BLaPHAJGBAry3uFqYBySGy5SAJsCIldXyQBBkJiNxb9FricUdK3gDu2CTAvImTdBN8Ca4C1wAebBPC6YL+BA4HcDgJ/iiTA1ZD8rhdFgMfA0pD8lgPP8i7AV2AwIsftwM88C3AiQZ7n8yTAJ6ACnAK2JEkSWALU8yDAbdKjFl6fF7MAH4F+/o+jNgrQBI4BR6S8w3wWgMOY4Z1NAlSAdYHv6wNuhPhdwxw3bRCgKaMexqE23+fACoMCnOy1AJW2UW/nYcD3F7ATswz2SoBmxKh3Gn01f2fBMmAlsAnYD5wD7gKtrASoxIx62OjXZf7uJquBM7KrNCbAC40ERiXmC7AZcwzLFrwGvJKRbsnrmnymfHxUz7liSoBRzWSV/3HMsA+Y1ahUVXV7dX7AS2BqM9JtSsAk8DdFk1YxE/IdsXgGy98U/W29JK3NyrokEi/FIUWWlDRLPs4eyYzREdvKf9Lgxfs2HvWDXo/tvZz6+A0vyT0/F8i/lbAn7LFVgNOBXJKWfiMQ00gYM2OjAD+AVZLHNs3zQ58nGnHDtgmglq5pnjNOB+KmNeIu2ibA2UAeNY24qUDclEbcA9sEUJsYnzcdfFpyn6tSr8osMRKIG5H3quLTiGiMr20TQD1d9pnr4JOWuNnDCgGChyTfuyDAt6SO3TJ//u/pLWALM11ogvexmLTTYFUj7gIWM6RxIarUfZ5qxG3Fcuq9WArbxC55gBJ3MarJGdsM2cZEBrPNGIuIUsqnwKkPRGykz9CpUD3JkZjNlTCe8lB0Qco+7C83i44dwD2Ni1fdfjc5ZEj282pLqx6GqI2NspeywlOfKZ9I/gGPNfEFBL9FwQAAAABJRU5ErkJggg==",upArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAz0lEQVR4nO3YywrCMBBG4fOE1oWDC/vsCiq+RAuVQLpzvDVtJvAfCJSki/nIqgWllFJKKaUqtwfuwDU/N5kBAzDlNQI9jSOmFjHmIJrCHF8gBmcvvdvMTYzACTg4Z31LiLnwGPsCER5jPyDCYuwPRDiMLUCEwVgBRHWMFURUw9gKiM0xtiJiM4xtgFgdYxsi5opjaiCKY2oiimEiIBZjuoDfDkdnpjSr2y0Y4h0m/dBwewREeJg0q1uXpedPV1epDrjkGXe1h1FKKaWUUrTVE5bz7NyN3sYLAAAAAElFTkSuQmCC",downArrow:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAACXBIWXMAAAsTAAALEwEAmpwYAAAAgklEQVR4nO2UOwrAIBAF5xKReP+bJFV+TSxynATBQiSI0TXVDggW7htesYKiKIogE7ADRiDLZxzAXPJ4BW7ANcpNyPBZS8nAAJxh4AJshTTNGGsH7R/SFnmztEYuJv0iF5eWyLtJc/Lu0rfddMld4sPJErfs3jTFt9vC6d5UURSFmAePTDtnrV72/QAAAABJRU5ErkJggg==",image:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADIAAAAyCAYAAAAeP4ixAAAACXBIWXMAAAsTAAALEwEAmpwYAAABvUlEQVR4nO2XTUrDQBSAPwXBn7ps0TO4EFfd24obEfQQHqOt4qIewAt4BkFci+610IIW7MpFXQtWxJGRNxBK02k0qTPpfDCUvDbJ+/LezDQQCARmBpWTQe5EfEUFEcdQoSKOoUJFMmIZOAG6wEA+G8CSTxXRyd7F7A+3FhmnRI4lh2egAqwAVaAn8bovIl3JYXsoXpX4ky8iA8mhMBRflfh7miIlYJNsK1IZiu9I/DEtES3RAtrAIunTkBx60k4FkTBzpJaGiJEwvztL3+NnVdKr06hV68by8CYSiUroCfcpo5yBjE62LvcZyGdtgg6wihSBB/muA6xJNcyxbaOaFmqcSLQSLTlGnk5b4s2YCy/giEgpRsJQjrTYHnAAnAJXQD/mnKmLFEe00yialtdOfe76f4mULJWIYlqsL5XQFTmUfWbSa2Qm0kqYQNxqkuSBZCKiLO2UhGiLjmu/rSxEOilJJJH5kF19Pu05Mi30HnQOfMm9r/+wOCgX/v3uAi9y/1dg31cRpBMuI3lcyIuVdyKaOeAIeLPMqXHDCRHDBnCfB5HfEERcQ4XWcgwVKuIYKrcVUZ4PciMSCARmgG9mLvK/OR2iiQAAAABJRU5ErkJggg==",flag:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAIUAAACBCAYAAADuS3kqAAAAAXNSR0IB2cksfwAAAAlwSFlzAAALEwAACxMBAJqcGAAACfRJREFUeJztnXuIXNUdx913shutjfVBqtGFupuZ3Xnd9zz3Ne/dYKEo/isSEGqFSlslSFBi2kStSqkiCEGl1D/ECP4hKLYmTUziZjfRjUl8FzU0pbJLtIlJ1t2N37PZQHBM9t67d845d+b3hS8z9+59nfP73N/5nZnZmcsuI5FIJJJE0pOlpqg+2NwbTbUEQlZLd4/ecnNAbT3vrqDWuqbXbA1GEq0RbaBFSxSbRF8zySOF1b5G1cqtDCl93Xhcq1r530X1gYeMVHlUTxSPYnkqZgydBCDTCP4cfJY9YnkG608pVu44gDiGbXdFtP6N2P4+xcwWw2p/AH/vwHYEi+xC8BoQrOUI1q3wk1jeA39ppIZPm+nhOSuz9uxSjePMmjgeYPlIjeffCGt9vwcoAZyvRXT7SQvCUHAFAjIIGNYjUP/A8gkzPbLk4DsxzjmtJQrjgGNzVBtI4FpaRfdL3QkdvwypPaPFC5uMZGkcmQAgDHMF4cezyMickSxPApLtuL518C8AS6Po/qppYShYjbtwHdL2q3qyfEo0BIsMM3OoXY4iez0AeDvNVLlBdP/VjHC3tQGComLmtgGE06KD7caA42u0YyOK3JVL7hAccAW8DR5d8L6LeAze6kEMpBIq/lvUeGEn7rrvRAd26ZljZE5PFg+j7uhH1nA/pOBgP4E/sXni3R7GQ5gwdbwaIGzAuPwpagVPZgwyGVnjjBYvbsEweLmrDqonKBQru0q18vdjDJ4UHbhqm9UbGBJfQpHc5bijcIArah0KFI8rAMPdyAzHWIoVHTCOnsFM5UHHHVbLUKDwuhLTtQ1Ip/+TIEAiPAsoNjruOIdQ7KlC7DwXIOjQ4vlfYZjYgTQ6I0FwfAnFx7UCRdQY7EIR+SJgmJYgKKJd31AoZu46DTAgSxAMHkBxuZ+hAAjNmHr9AUPFvyUIgmyuLygw1boKReSv8fhxnc0onELxsOPO9RsUmHtfjaxwJ4aJccBwRoKOl9lcoNhbhTjbEoaIFTEzu05Plj63MpQZ6hYKI1VqiZlD3agb/gYYpmiYkBiKrqDeGlIyN1jpYc8/6ME+PBLVB8PICvdgmHgbU8uTEnSuX+0aihVOoQAQIRR5n8HPhrW+jGrl25YCgmJmGwFCGhlhA471MrLCccoKnkGxiQsUCGAMQZv/AAoeZ1D8/Ze9RqBYubvwPN8TSXZim9W406/HRf0cvhLPVyELrAZQnRGtP6InSndgm3uxfif2+8pIDc9K0Im1ZjFQ/MBz7GVlzAxO4vFrKz0yhXWTWP4cy5PY5zj7WBt7a5dtK0Gn1bqXBMVHNk/yDtsHd3z0IlCQ5TJBQfYOig6CombNEQozGwEU30rQaPLiUPyRCxSYQoYJCl+YCxSj56DIERT+MEcorFyIoPCF+UGhnoOCXn6W366haHcORb6XoPCFZ40ULyjiBIVPzBOKAkHhD7N/QP6TWyg+tHmSfWwfLVHoISh8YZ5QFINWeuSEBI0mywKFTlD4xa6hWO4YimQpYGUICh+YoCCLgWLsHBRlQLGWoJDfDIrNvKBYg+f/l6DRZFmgMAgKv5gjFKlyN0HhCwOKYVdQLHMKhZkaJij8YY5QpEe68PwbCRpNXhyKLW6h+MDmScYXMsWNOFnNf5lYDZgfFOynCmJm1m52IdcDFDcHVPZFIXb3IfsQijbnUGiAIntEgkaTZYGiKwgoTILCB2ZQPFJtKPZfAMVhCRpNlgiKJoWg8IN5QqE3IVMckqDRZFmg6O4hKHxi11C0uoECw8f7EjSaLA8UBqDIERTym0HxaLWhOHABFAclaDS5ilDYfc2BoPCXOULROw/FhASNJlcJihanUKzpNQkKf5g7FO9J0Gjy4lA8xguKRoLCF+YCxbvzUISsRsXKvStBo8kEBVlaKAKAQrVyByRoNLlKUDQ7hyIOKPIEhfzmCEV4Hor9EjSavDgUfyYoyJ5BYfcDM++xfYLhBINiXIJGkwkKMi8omhxDEQEU8fyYBI0mywJFTyRJUPjDXKFo0OKFfRI0mrw4FI9XG4qJeSiiBIVfzBuKUdENJksFRapBJSh8YbdQNDqFovccFO+IbjBZJihiKTZ8EBQ+MEco0gyKvaIbLKPN9MhZLVE4ZaTKX+nJ0ljUGHpBtfLPaoni01j+q5Es/0WHsfwUsu0zMTO7VbVyryF4x7DuhNe/3IzjPuEWCrv/7XWQ7RMiKM4DwKZ8JxHcCS1ReiOiDdyvxvO3OQ7Cgsz0MIbl/K1hrf8+gPU6IPoC677zBxRKpgFU7xEdFEEgnEWwvgEIb8aM7DoEsFNPFJrdgnAp4cb7Kc5T1uL5vyPzTFkZ51mENxS7RQeIlwHBDIJzULFyW5ANBsJqX4PnBCwiPVFcFlb7h5BJngcgtr+Z0C0UDQRFpdnQABjYOP9yVB8soc3XeB5pF0L2aAYYA7i25wDHot9QyBGKvpqFYr5QjBcOozjcHDUGA4qZ5Z4V7ArXVgQcE+yaLwHFk44P7BCK98/vByjeFh1Aj2GYBQzjipn7ZUTrlxaEHxMyx1Zc/4wMUOwSHUgvjDttFiBsQ7V/i5EstnsaLU7SE6V2tOMx+LRQKHSfQ4Gp3oyRLO/AMJEVUThWQ6h9CgDjuDgoksWdogPrEoZpdNx+DBVr0YZGT6MigZDBkyhA/4Ppq3somNxBUfIdFADhQxRntxvJUodnUZBQMTO7CnXGAQYGbyj+JTrI9jLD/ItNX6jxwnpkiZWe9bzkwrD4M7T7Jdj5ex9MLNg2O/nQ+X38AAXS6CSKyMdjxuBNyBI1UTc4EWJ0LWo/xdXOLqHYITrol4BhFrOJ15BCcyi+6g4GT1QrUACGM0ibb0b1gSxqh5orIrnKHRTl7aIhuACGGWSFVzBMpCNaP8HghdxAgTn+WyJBWCggj0aNwU3ICgZlBo/lEop/CgCB/XreFIqn7Sgcf6tauWBYyRAM1RA63O7XH7Kp63zhhuBwgWIhI5zA8LBLsXL3KOZQJ7JCk+g+q3m5gQKB+Q3u1DH23r6RWtqngy4EAMeaRhaaBAB7o8bQw3AhrPa1ITMQCDzlBgoA0RhSMq0IXjceFUwB740ZQw/GzOwzAGU3UvwYZgIT+PshAHQE6z9gZs+x/qAaLxxABhiF34poA6wuWI9tb++NpsL4+40hta8Z56DppCi5geJiYu8nIMDLAUp7IBxvX9NrdHQFdVhbsI51ZnswkliODLAMw0Ibr3aSHMhLKEg1IgdQHCYo6kQItN2vVCYo6kUEBalCBAWpQgQFqUIEBalCDqGg9xrqQQi03Z9pICjqRQQFqUIEBalCBAWpQgQFqUIItN1f+TlCUNSJCApShQgKUoUIClKFCApShRxCQR+grQch0HZ/OZCgqBcRFKQKERSkChEUJBKJRCKRHOh7LktbCRuu/n0AAAAASUVORK5CYII="},mL=({match:e,timeFormat:t})=>{var n,r,i,o;return u.jsxs(b.Box,{display:"flex",alignItems:"center",gap:.5,fontSize:"xs",children:[u.jsxs(b.Typography,{mr:1,children:["[",_t(e.kickoffAt).format(t),"]"]}),e.homeTeam.code?u.jsx(b.Tooltip,{title:e.homeTeam.name,children:u.jsxs(b.Box,{display:"flex",gap:.5,alignItems:"center",minWidth:"60px",justifyContent:"flex-end",children:[u.jsx(b.Typography,{children:e.homeTeam.code||e.homeTeam.name}),u.jsx(b.Avatar,{src:((n=e.homeTeam.assets)==null?void 0:n.logo)||lt.team,sx:{width:"20px",height:"20px"}})]})}):u.jsxs(u.Fragment,{children:[u.jsx(b.Typography,{children:e.homeTeam.code||e.homeTeam.name}),u.jsx(b.Avatar,{src:((r=e.homeTeam.assets)==null?void 0:r.logo)||lt.team,sx:{width:"20px",height:"20px"}})]}),"-",e.awayTeam.code?u.jsx(b.Tooltip,{title:e.awayTeam.name,children:u.jsxs(b.Box,{display:"flex",gap:.5,alignItems:"center",children:[u.jsx(b.Avatar,{src:((i=e.awayTeam.assets)==null?void 0:i.logo)||lt.team,sx:{width:"20px",height:"20px"}})," ",u.jsx(b.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})}):u.jsxs(u.Fragment,{children:[u.jsx(b.Avatar,{src:((o=e.awayTeam.assets)==null?void 0:o.logo)||lt.team,sx:{width:"20px",height:"20px"}}),u.jsx(b.Typography,{children:e.awayTeam.code||e.awayTeam.name})]})]})},vm=Ue(u.jsx("path",{d:"M7.41 8.59 12 13.17l4.59-4.58L18 10l-6 6-6-6z"}),"KeyboardArrowDown"),vL=e=>{const[t,n]=w.useState([]),[r,i]=w.useState([]),[o,a]=w.useState(!1),{sdk:s}=at(),l=()=>k(this,null,function*(){try{const h=yield s.topX.getGames({limit:50},!0),p=yield s.matchQuiz.getGames({limit:50},!0),m=[...h.data,...p.data];if(e.related&&e.related.length>0){const g=m.filter(v=>{var S;return(S=e.related)==null?void 0:S.some(I=>I.entity_id===v.id)}).map(v=>v.id);n(g)}i(m)}catch(f){console.error(f),d()}}),c=(f,h)=>{const p=h.map(m=>({entity_id:m,entity_type:"GAME",entity_relationship:"relatedTo"}));e.onChange(p)},d=()=>a(!o);return w.useEffect(()=>{l()},[]),u.jsxs(u.Fragment,{children:[r.length>0?u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:e.label}),u.jsx(b.Select,{multiple:!0,indicator:u.jsx(vm,{}),defaultValue:t,renderValue:f=>u.jsx(b.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:f.map((h,p)=>u.jsx(b.Chip,{variant:"soft",color:"primary",children:h.label},`related-game-${h.label}-${p}`))}),onChange:c,sx:{minWidth:"15rem",[`& .${b.selectClasses.indicator}`]:{transition:"0.2s",[`&.${b.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(f=>u.jsx(b.Option,{value:f.id,children:f.title?f.title+` (${f.type})`:`Game with no title (${f.type}). ID: ${f.id}`},`related-game-title-${f.id}`))})]}):u.jsx(u.Fragment,{}),u.jsx(st,{showToast:o,message:"There was a problem witch fetching games for related options",color:"danger",hideToast:d})]})},bL=e=>{const[t,n]=w.useState([]),[r,i]=w.useState([]),[o,a]=w.useState(!1),{sdk:s}=at(),l=()=>k(this,null,function*(){try{const h=yield s.loyalty.getTemplates(void 0,!0);if(e.related&&e.related.length>0){const p=h.data.filter(m=>{var g;return(g=e.related)==null?void 0:g.some(v=>v.entity_id===m.id)}).map(m=>m.id);n(p)}i(h.data)}catch(f){console.error(f),d()}}),c=(f,h)=>{const p=h.map(m=>({entity_id:m,entity_type:"TEMPLATE",entity_relationship:"relatedTo"}));e.onChange(p)},d=()=>a(!o);return w.useEffect(()=>{l()},[]),u.jsxs(u.Fragment,{children:[r.length>0?u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:e.label}),u.jsx(b.Select,{multiple:!0,indicator:u.jsx(vm,{}),defaultValue:t,renderValue:f=>u.jsx(b.Box,{sx:{display:"flex",gap:"0.25rem",flexWrap:"wrap"},children:f.map((h,p)=>u.jsx(b.Chip,{variant:"soft",color:"primary",children:h.label},`related-template-${h.label}-${p}`))}),onChange:c,sx:{minWidth:"15rem",[`& .${b.selectClasses.indicator}`]:{transition:"0.2s",[`&.${b.selectClasses.expanded}`]:{transform:"rotate(-180deg)"}}},slotProps:{listbox:{sx:{width:"100%"}}},children:r.map(f=>u.jsx(b.Option,{value:f.id,children:f.name||`Template with no name. ID: ${f.id}`},`related-template-name-${f.id}`))})]}):u.jsx(u.Fragment,{}),u.jsx(st,{showToast:o,message:"There was a problem witch fetching templates for related options",color:"danger",hideToast:d})]})},bm=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="game"),ym=e=>e.filter(t=>t.entity_type.toLocaleLowerCase()==="template"),yL=e=>{const t=(n,r)=>{if(r==="games"){const i=ym(e.related);e.onChange([...n,...i])}if(r==="templates"){const i=bm(e.related);e.onChange([...n,...i])}};return u.jsxs(u.Fragment,{children:[u.jsx(vL,{label:e.labels.games,related:bm(e.related),onChange:n=>t(n,"games")}),u.jsx(bL,{label:e.labels.templates,related:ym(e.related),onChange:n=>t(n,"templates")})]})},xL=(e,t)=>{const[n,r]=w.useState(null),{https:i}=at(),o=()=>k(this,null,function*(){const a=yield i.getSchedulersByEntityId(e);if(a.ok){const s=yield a.json();r(s.data);return}r([])});return w.useEffect(()=>(o(),()=>r(null)),[e,t]),n},fs=({my:e})=>u.jsx(b.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",width:"100%",height:"100%",my:e},children:u.jsx(b.CircularProgress,{variant:"solid",color:"neutral"})}),CL=["PENDING","LIVE","SETTLED"],wL=["OPEN"],IL=["ACTIVE","INACTIVE","EXPIRED"],SL=new Map().set("PENDING","Pending").set("LIVE","Live").set("SETTLED","Settled").set("CANCELED","Canceled").set("OPEN","Open").set("ACTIVE","Active").set("INACTIVE","Inactive").set("PENDING","Pending").set("EXPIRED","Expired"),xm=e=>{let t=[];return e.entityType==="CLASSIC_QUIZ"||e.entityType==="EITHER_OR"||e.entityType==="POLL"?t=Array.from(IL):e.entityType==="TEMPLATE"?t=Array.from(CL):t=Array.from(wL),u.jsx(u.Fragment,{children:t.map(n=>u.jsx(b.Option,{value:n,children:SL.get(n)},`${e.entityType}-${n}-status`))})};class AL{constructor(){te(this,"name","");te(this,"scheduled_task_config",{entity_id:"",entity_type:"",change:{status:""}});te(this,"trigger",{trigger_type:"DATETIME",date:""})}}const TL=Ue(u.jsx("path",{d:"M4.47 21h15.06c1.54 0 2.5-1.67 1.73-3L13.73 4.99c-.77-1.33-2.69-1.33-3.46 0L2.74 18c-.77 1.33.19 3 1.73 3M12 14c-.55 0-1-.45-1-1v-2c0-.55.45-1 1-1s1 .45 1 1v2c0 .55-.45 1-1 1m1 4h-2v-2h2z"}),"WarningRounded"),EL=e=>{const[t,n]=w.useState(!1),{https:r}=at(),i=o=>k(this,null,function*(){if(o.stopPropagation(),n(!0),(yield r.deleteScheduledTask(e.taskId)).ok){n(!1),e.toggleToast("success",e.labels.deleteScheduledTaskMessage),e.refetchTasks(),e.toggleModal();return}n(!1),e.toggleToast("danger",e.labels.deleteScheduledTaskErrorMessage)});return u.jsx(u.Fragment,{children:u.jsx(b.Modal,{open:e.isOpen,onClose:e.toggleModal,children:u.jsxs(b.ModalDialog,{children:[u.jsxs(b.DialogTitle,{children:[u.jsx(TL,{}),e.labels.deleteScheduledTaskModalTitle]}),u.jsx(b.Divider,{}),u.jsx(b.DialogContent,{children:u.jsxs(b.Typography,{children:[e.labels.deleteScheduledTaskModalParagraph,u.jsx(b.Typography,{fontWeight:"bold",children:e.taskName}),"?"]})}),u.jsxs(b.DialogActions,{children:[u.jsx(b.Button,{loading:t,variant:"solid",color:"danger",onClick:o=>i(o),children:e.labels.delete}),u.jsx(b.Button,{variant:"plain",color:"neutral",onClick:o=>{o.stopPropagation(),e.toggleModal()},children:e.labels.close})]})]})})})},kL=e=>{const[t,n]=w.useState(null),[r,i]=w.useState(""),[o,a]=w.useState(""),[s,l]=w.useState(""),[c,d]=w.useState(""),[f,h]=w.useState(!1),[p,m]=w.useState(!1),[g,v]=w.useState(!1),[S,I]=w.useState("success"),[x,C]=w.useState(""),[y,A]=w.useState(!1),E=w.useRef(!1),_=xL(e.entityId,E.current),{https:D}=at();if(!_)return u.jsx(fs,{my:10});const G=()=>A(!y),F=(B,H)=>{v(!0),I(B),C(H)},T=(B,H)=>{i(H.scheduled_task_config.change.status),l(H.trigger.date),n(B)},j=()=>k(this,null,function*(){h(!0);const B=$("CREATE","");if((yield D.setSchedulers(B,"CREATE",null)).ok){h(!1),a(""),d(""),E.current=!E.current,F("success",e.labels.createScheduledTaskMessage);return}h(!1),a(""),d(""),F("danger",e.labels.createScheduledTaskErrorMessage)}),Y=(B,H)=>k(this,null,function*(){m(!0);const q=$("UPDATE",H);if((yield D.setSchedulers(q,"UPDATE",B)).ok){m(!1),n(null),i(""),l(""),E.current=!E.current,F("success",e.labels.updateScheduledTaskMessage);return}m(!1),F("danger",e.labels.updateScheduledTaskErrorMessage),n(null),i(""),l("")}),z=()=>{E.current=!E.current},$=(B,H)=>{const q=new AL,ee=B==="CREATE"?o:r,R=B==="CREATE"?null:H,M=B==="CREATE"?c:s;return q.scheduled_task_config.entity_id=e.entityId,q.scheduled_task_config.entity_type=e.entityType,q.scheduled_task_config.change.status=ee,q.trigger.date=M,q.name=R,q};return u.jsxs(u.Fragment,{children:[_.map((B,H)=>u.jsx(b.Card,{style:{marginBottom:"10px",display:"flex",padding:"10px"},children:u.jsx(b.CardContent,{children:t===H?u.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%"},children:[u.jsxs(b.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),u.jsx(b.Select,{value:r,size:"sm",name:"status",onChange:(q,ee)=>i(ee),sx:{minHeight:"36px"},children:u.jsx(xm,{entityType:e.entityType})})]}),u.jsxs(b.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:e.labels.at}),u.jsx(Jc,{defaultDate:s,onChange:q=>l(q)})]}),r&&s?u.jsx(b.Button,{onClick:()=>Y(B.id,B.name),loading:p,sx:{mt:"auto"},children:e.labels.save}):u.jsx(b.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.save})]}):u.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"}},children:[u.jsxs(b.Box,{children:[u.jsxs(b.Typography,{style:{fontWeight:"bold"},children:[e.labels.name,": ",u.jsx(b.Typography,{whiteSpace:"wrap",children:B.name})]}),u.jsxs(b.Typography,{style:{color:"gray"},children:[e.labels.status,": ",u.jsx(b.Typography,{whiteSpace:"wrap",children:B.status})]})]}),!e.readOnly&&u.jsxs(b.Box,{children:[u.jsx(b.Tooltip,{title:e.labels.edit,children:u.jsx(b.IconButton,{onClick:()=>T(H,B),children:u.jsx(ke.Edit,{})})}),u.jsx(b.Tooltip,{title:e.labels.delete,children:u.jsx(b.IconButton,{onClick:G,children:u.jsx(ke.Delete,{})})})]}),u.jsx(EL,{labels:e.labels,isOpen:y,taskId:B.id,taskName:B.name,toggleModal:G,refetchTasks:z,toggleToast:F})]})})},`scheduled-task-${e.entityId}-${e.entityType}-${B.id}`)),!e.readOnly&&u.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",xl:"row"},width:"100%",mt:_&&_.length?2:0},children:[u.jsxs(b.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:e.labels.changeStatusTo}),u.jsx(b.Select,{value:o,size:"sm",name:"status",onChange:(B,H)=>a(H),sx:{minHeight:"37px"},children:u.jsx(xm,{entityType:e.entityType})})]}),u.jsxs(b.FormControl,{sx:{mr:{xl:1},width:"100%",mb:{xs:1,xl:0}},children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:e.labels.at}),u.jsx(Jc,{defaultDate:c,onChange:B=>d(B)})]}),o&&c?u.jsx(b.Button,{onClick:j,loading:f,sx:{mt:"auto"},children:e.labels.create}):u.jsx(b.Button,{disabled:!0,sx:{mt:"auto"},children:e.labels.create})]}),u.jsx(st,{showToast:g,message:x,color:S,hideToast:()=>v(!1)})]})};function _L(e){return it("MuiIconButton",e)}Xe("MuiIconButton",["root","colorPrimary","colorNeutral","colorDanger","colorSuccess","colorWarning","colorContext","variantPlain","variantOutlined","variantSoft","variantSolid","focusVisible","disabled","sizeSm","sizeMd","sizeLg","loading","loadingIndicator"]);const PL=["children","action","component","color","disabled","variant","loading","loadingIndicator","size","slots","slotProps"],DL=e=>{const{color:t,disabled:n,focusVisible:r,focusVisibleClassName:i,size:o,variant:a,loading:s}=e,l={root:["root",n&&"disabled",r&&"focusVisible",a&&`variant${xe(a)}`,t&&`color${xe(t)}`,o&&`size${xe(o)}`,s&&"loading"],loadingIndicator:["loadingIndicator"]},c=dt(l,_L,{});return r&&i&&(c.root+=` ${i}`),c},OL=ye("button")(({theme:e,ownerState:t})=>{var n,r,i,o;return[O({"--Icon-margin":"initial","--Icon-color":t.color!=="neutral"||t.variant==="solid"?"currentColor":e.vars.palette.text.icon},t.instanceSize&&{"--IconButton-size":{sm:"2rem",md:"2.25rem",lg:"2.75rem"}[t.instanceSize]},t.size==="sm"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2rem) / 1.6)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2rem)",minHeight:"var(--IconButton-size, 2rem)",fontSize:e.vars.fontSize.sm,paddingInline:"2px"},t.size==="md"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.25rem) / 1.5)","--CircularProgress-size":"20px","--CircularProgress-thickness":"2px",minWidth:"var(--IconButton-size, 2.25rem)",minHeight:"var(--IconButton-size, 2.25rem)",fontSize:e.vars.fontSize.md,paddingInline:"0.25rem"},t.size==="lg"&&{"--Icon-fontSize":"calc(var(--IconButton-size, 2.75rem) / 1.571)","--CircularProgress-size":"28px","--CircularProgress-thickness":"4px",minWidth:"var(--IconButton-size, 2.75rem)",minHeight:"var(--IconButton-size, 2.75rem)",fontSize:e.vars.fontSize.lg,paddingInline:"0.375rem"},{WebkitTapHighlightColor:"transparent",paddingBlock:0,fontFamily:e.vars.fontFamily.body,fontWeight:e.vars.fontWeight.md,margin:"var(--IconButton-margin)",borderRadius:`var(--IconButton-radius, ${e.vars.radius.sm})`,border:"none",boxSizing:"border-box",backgroundColor:"transparent",cursor:"pointer",display:"inline-flex",alignItems:"center",justifyContent:"center",position:"relative",[e.focus.selector]:O({"--Icon-color":"currentColor"},e.focus.default)}),O({},(n=e.variants[t.variant])==null?void 0:n[t.color],{"&:hover":{"@media (hover: hover)":O({"--Icon-color":"currentColor"},(r=e.variants[`${t.variant}Hover`])==null?void 0:r[t.color])},'&:active, &[aria-pressed="true"]':O({"--Icon-color":"currentColor"},(i=e.variants[`${t.variant}Active`])==null?void 0:i[t.color]),"&:disabled":(o=e.variants[`${t.variant}Disabled`])==null?void 0:o[t.color]})]}),RL=ye(OL,{name:"JoyIconButton",slot:"Root",overridesResolver:(e,t)=>t.root})({}),LL=ye("span",{name:"JoyIconButton",slot:"LoadingIndicator",overridesResolver:(e,t)=>t.loadingIndicator})(({theme:e,ownerState:t})=>{var n,r;return O({display:"inherit",position:"absolute",left:"50%",transform:"translateX(-50%)",color:(n=e.variants[t.variant])==null||(n=n[t.color])==null?void 0:n.color},t.disabled&&{color:(r=e.variants[`${t.variant}Disabled`])==null||(r=r[t.color])==null?void 0:r.color})}),Cm=W.forwardRef(function(t,n){var r;const i=ft({props:t,name:"JoyIconButton"}),{children:o,action:a,component:s="button",color:l="neutral",disabled:c,variant:d="plain",loading:f=!1,loadingIndicator:h,size:p="md",slots:m={},slotProps:g={}}=i,v=Te(i,PL),S=W.useContext(Rp),I=W.useContext(Lp),x=t.variant||S.variant||d,C=t.size||S.size||p,y=t.color||S.color||l,A=(r=t.loading||t.disabled)!=null?r:S.disabled||f||c,E=W.useRef(null),_=sn(E,n),{focusVisible:D,setFocusVisible:G,getRootProps:F}=Ul(O({},i,{disabled:A,rootRef:_})),T=h!=null?h:u.jsx(Dp,{color:y,thickness:{sm:2,md:3,lg:4}[C]||3});W.useImperativeHandle(a,()=>({focusVisible:()=>{var M;G(!0),(M=E.current)==null||M.focus()}}),[G]);const j=O({},i,{component:s,color:y,disabled:A,variant:x,loading:f,size:C,focusVisible:D,instanceSize:t.size}),Y=DL(j),z=M=>{var U;let V=i.onClick;if(typeof g.root=="function"?V=g.root(j).onClick:g.root&&(V=g.root.onClick),(U=V)==null||U(M),I){var ne;(ne=I.onClick)==null||ne.call(I,M,i.value)}};let $=i["aria-pressed"];typeof g.root=="function"?$=g.root(j)["aria-pressed"]:g.root&&($=g.root["aria-pressed"]),I!=null&&I.value&&(Array.isArray(I.value)?$=I.value.indexOf(i.value)!==-1:$=I.value===i.value);const B=O({},v,{component:s,slots:m,slotProps:g}),[H,q]=Se("root",{ref:n,className:Y.root,elementType:RL,getSlotProps:F,externalForwardedProps:B,ownerState:j,additionalProps:{onClick:z,"aria-pressed":$}}),[ee,R]=Se("loadingIndicator",{className:Y.loadingIndicator,elementType:LL,externalForwardedProps:B,ownerState:j});return u.jsx(H,O({},q,{children:f?u.jsx(ee,O({},R,{children:T})):o}))});Cm.muiName="IconButton";const wm=Ue(u.jsx("path",{d:"M18.3 5.71a.996.996 0 0 0-1.41 0L12 10.59 7.11 5.7a.996.996 0 0 0-1.41 0c-.39.39-.39 1.02 0 1.41L10.59 12 5.7 16.89c-.39.39-.39 1.02 0 1.41s1.02.39 1.41 0L12 13.41l4.89 4.89c.39.39 1.02.39 1.41 0s.39-1.02 0-1.41L13.41 12l4.89-4.89c.38-.38.38-1.02 0-1.4"}),"CloseRounded"),ML=({label:e,defaultValue:t,options:n,required:r,onChange:i})=>{function o(l){var c,d;return l?u.jsxs(u.Fragment,{children:[u.jsx(b.ListItemDecorator,{children:u.jsx(b.Avatar,{size:"sm",src:((d=(c=n.find(f=>f.id===l.value))==null?void 0:c.assets)==null?void 0:d.logo)||lt.competition})}),l.label]}):null}const a=w.useRef(null),s=(l,c)=>{i(c)};return u.jsxs(b.FormControl,{sx:{mb:1},children:[u.jsx(b.FormLabel,{required:r,color:"primary",children:e}),u.jsx(b.Select,Q(N({slotProps:{button:{sx:{whiteSpace:"nowrap"}}},sx:{"--ListItemDecorator-size":"44px",minHeight:"37px"},renderValue:o,value:t,onChange:s},t&&{endDecorator:u.jsx(Cm,{variant:"plain",color:"neutral",onMouseDown:l=>{l.stopPropagation()},onClick:()=>{var l;i(""),(l=a.current)==null||l.focusVisible()},sx:{width:"18px",height:"18px"},children:u.jsx(wm,{})}),indicator:null}),{children:n.map((l,c)=>{var d;return u.jsxs(w.Fragment,{children:[c!==0?u.jsx(b.ListDivider,{role:"none"}):null,u.jsxs(b.Option,{value:l.id,label:l.name,children:[u.jsx(b.ListItemDecorator,{children:u.jsx(b.Avatar,{size:"sm",src:((d=l.assets)==null?void 0:d.logo)||lt.competition})}),l.name]})]},`${l.id}-${c}`)})}))]})};function BL(e){var t=typeof e;return e!=null&&(t=="object"||t=="function")}var Im=BL,$L=typeof Bt=="object"&&Bt&&Bt.Object===Object&&Bt,NL=$L,FL=NL,zL=typeof self=="object"&&self&&self.Object===Object&&self,jL=FL||zL||Function("return this")(),Sm=jL,UL=Sm,VL=function(){return UL.Date.now()},HL=VL,WL=/\s/;function GL(e){for(var t=e.length;t--&&WL.test(e.charAt(t)););return t}var YL=GL,KL=YL,qL=/^\s+/;function QL(e){return e&&e.slice(0,KL(e)+1).replace(qL,"")}var JL=QL,XL=Sm,ZL=XL.Symbol,mu=ZL,Am=mu,Tm=Object.prototype,eM=Tm.hasOwnProperty,tM=Tm.toString,uo=Am?Am.toStringTag:void 0;function nM(e){var t=eM.call(e,uo),n=e[uo];try{e[uo]=void 0;var r=!0}catch(o){}var i=tM.call(e);return r&&(t?e[uo]=n:delete e[uo]),i}var rM=nM,iM=Object.prototype,oM=iM.toString;function aM(e){return oM.call(e)}var sM=aM,Em=mu,lM=rM,cM=sM,uM="[object Null]",dM="[object Undefined]",km=Em?Em.toStringTag:void 0;function fM(e){return e==null?e===void 0?dM:uM:km&&km in Object(e)?lM(e):cM(e)}var hM=fM;function pM(e){return e!=null&&typeof e=="object"}var gM=pM,mM=hM,vM=gM,bM="[object Symbol]";function yM(e){return typeof e=="symbol"||vM(e)&&mM(e)==bM}var _m=yM,xM=JL,Pm=Im,CM=_m,Dm=NaN,wM=/^[-+]0x[0-9a-f]+$/i,IM=/^0b[01]+$/i,SM=/^0o[0-7]+$/i,AM=parseInt;function TM(e){if(typeof e=="number")return e;if(CM(e))return Dm;if(Pm(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=Pm(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=xM(e);var n=IM.test(e);return n||SM.test(e)?AM(e.slice(2),n?2:8):wM.test(e)?Dm:+e}var EM=TM,kM=Im,vu=HL,Om=EM,_M="Expected a function",PM=Math.max,DM=Math.min;function OM(e,t,n){var r,i,o,a,s,l,c=0,d=!1,f=!1,h=!0;if(typeof e!="function")throw new TypeError(_M);t=Om(t)||0,kM(n)&&(d=!!n.leading,f="maxWait"in n,o=f?PM(Om(n.maxWait)||0,t):o,h="trailing"in n?!!n.trailing:h);function p(A){var E=r,_=i;return r=i=void 0,c=A,a=e.apply(_,E),a}function m(A){return c=A,s=setTimeout(S,t),d?p(A):a}function g(A){var E=A-l,_=A-c,D=t-E;return f?DM(D,o-_):D}function v(A){var E=A-l,_=A-c;return l===void 0||E>=t||E<0||f&&_>=o}function S(){var A=vu();if(v(A))return I(A);s=setTimeout(S,g(A))}function I(A){return s=void 0,h&&r?p(A):(r=i=void 0,a)}function x(){s!==void 0&&clearTimeout(s),c=0,r=l=i=s=void 0}function C(){return s===void 0?a:I(vu())}function y(){var A=vu(),E=v(A);if(r=arguments,i=this,l=A,E){if(s===void 0)return m(l);if(f)return clearTimeout(s),s=setTimeout(S,t),p(l)}return s===void 0&&(s=setTimeout(S,t)),a}return y.cancel=x,y.flush=C,y}var RM=OM;const Ir=fn(RM),wn=({option:e})=>u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:e.logo}),u.jsx(b.Typography,{children:e.label}),u.jsx(b.Typography,{ml:.5,level:"body-xs",children:`(${e.countryName})`})]}),Rm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||lt.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||lt.flag}}))||[],LM=({labels:e,label:t,ids:n,required:r,onChange:i})=>{const[o,a]=w.useState([]),[s,l]=w.useState([]),[c,d]=w.useState(!1),[f,h]=w.useState(""),[p,m]=w.useState(!1),{sdk:g}=at(),v=()=>m(!p),S=(y,A)=>{a(A),i(A[0]?[A[0].id]:[])},I=3;w.useEffect(()=>{!f&&n&&n.length&&g.football.getCompetitions({competitionIds:n}).then(y=>{a(Rm(y))}).catch(y=>{console.error(y),v(),a([])})},[]);const x=w.useMemo(()=>Ir(y=>{d(!0),g.football.getCompetitions({name:y}).then(A=>{l([...Rm(A)]),d(!1)}).catch(A=>{console.error(A),v(),l([]),d(!1)})},300),[]);w.useEffect(()=>{if(!f||f.length<I){l([]);return}return x(f),()=>x.cancel()},[f,x]);const C=(y,A)=>y.map((E,_)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:D=>A({index:_}).onClick(D),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:E},`option_${E.id}`)},E.id));return u.jsxs(b.FormControl,{sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{required:r,color:"primary",children:t}),u.jsx(b.Box,{children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:c,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(y,A)=>y.id===A.id,endDecorator:c?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.competitionsSelectionPlaceholder,options:s,disabled:o.length===1,filterOptions:y=>y.filter(A=>!o.some(E=>E.value===A.value)),onInputChange:(y,A)=>{h(A)},onChange:S,getOptionKey:y=>y.id,value:o,renderTags:C,renderOption:(y,A)=>u.jsx(b.AutocompleteOption,Q(N({},y),{children:u.jsx(wn,{option:A})}))})}),u.jsx(st,{showToast:p,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:v})]})},Lm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Competition with no name",label:t.name?t.name:"Competition with no name",logo:((n=t.assets)==null?void 0:n.logo)||lt.competition,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||lt.flag}}))||[],MM=({labels:e,ids:t,scope:n,onChange:r})=>{const[i,o]=w.useState([]),[a,s]=w.useState([]),[l,c]=w.useState(!1),[d,f]=w.useState(""),[h,p]=w.useState(!1),{sdk:m}=at(),g=()=>p(!h),v=(C,y)=>{o(y);const A=y.map(E=>E.id);r(A&&A.length?A:null)},S=3;w.useEffect(()=>{!d&&t&&t.length&&m.football.getCompetitions({competitionIds:t}).then(C=>{o(Lm(C))}).catch(C=>{console.error(C),g(),o([])})},[]);const I=w.useMemo(()=>Ir(C=>{c(!0);const y={name:C,competitionIds:[""]};n&&Array.isArray(n)&&n.length>0?y.competitionIds=Array.from(n):delete y.competitionIds,m.football.getCompetitions(y).then(A=>{s([...Lm(A)]),c(!1)}).catch(A=>{console.error(A),g(),s([]),c(!1)})},300),[]);w.useEffect(()=>{if(!d||d.length<S){s([]);return}return I(d),()=>I.cancel()},[d,I]);const x=(C,y)=>C.map((A,E)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:_=>y({index:E}).onClick(_),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:A},`option_${A.id}`)},A.id));return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{marginBottom:"16px"},children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:l,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(C,y)=>C.id===y.id,endDecorator:l?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e.competitionsSelectionPlaceholder,options:a,filterOptions:C=>C.filter(y=>!i.some(A=>A.value===y.value)),onInputChange:(C,y)=>{f(y)},onChange:v,getOptionKey:C=>C.id,value:i,renderTags:x,renderOption:(C,y)=>u.jsx(b.AutocompleteOption,Q(N({},C),{children:u.jsx(wn,{option:y})}))})}),u.jsx(st,{showToast:h,message:e.searchCompetitionsErrorMessage,color:"danger",hideToast:g})]})},Mm=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],BM=({labels:e,ids:t,onChange:n})=>{const[r,i]=w.useState([]),[o,a]=w.useState([]),[s,l]=w.useState(!1),[c,d]=w.useState(""),[f,h]=w.useState(!1),{sdk:p}=at(),m=()=>h(!f),g=(x,C)=>{i(C);const y=C.map(A=>A.id);n(y&&y.length?y:null)},v=3;w.useEffect(()=>{!c&&t&&t.length&&p.profile.getByIds(t).then(x=>{i(Mm(x))}).catch(x=>{m(),console.error(x),i([])})},[]);const S=w.useMemo(()=>Ir(x=>{l(!0),p.profile.getByIds([],x).then(C=>{a([...Mm(C)]),l(!1)}).catch(C=>{console.error(C),m(),a([]),l(!1)})},300),[]);w.useEffect(()=>{if(!c||c.length<v){a([]);return}return S(c),()=>S.cancel()},[c,S]);const I=(x,C)=>x.map((y,A)=>{var E;return u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:_=>C({index:A}).onClick(_),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(E=y.avatar)!=null?E:lt.avatar}),u.jsx(b.Typography,{children:y.label})]})},y.id)});return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{marginBottom:"16px"},children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:s,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(x,C)=>x.id===C.id,endDecorator:s?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:x=>x.filter(C=>!r.some(y=>y.value===C.value)),onInputChange:(x,C)=>{d(C)},onChange:g,getOptionKey:x=>x.id,value:r,renderTags:I,renderOption:(x,C)=>{var y;return u.jsx(b.AutocompleteOption,Q(N({},x),{children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(y=C.avatar)!=null?y:lt.avatar}),u.jsx(b.Typography,{children:C.label})]})}))}})}),u.jsx(st,{showToast:f,message:e.searchProfilesErrorMessage,color:"danger",hideToast:m})]})},Bm=e=>(e==null?void 0:e.map(t=>{var n,r,i,o;return{id:t.id,value:t.name?t.name:"Team with no name",label:t.name?t.name:"Team with no name",logo:((n=t.assets)==null?void 0:n.logo)||lt.team,countryName:((r=t.country)==null?void 0:r.name)||"No country",countryFlag:((o=(i=t.country)==null?void 0:i.assets)==null?void 0:o.flag)||lt.flag}}))||[],$M=({labels:e,ids:t,scope:n,onChange:r})=>{const[i,o]=w.useState([]),[a,s]=w.useState([]),[l,c]=w.useState(!1),[d,f]=w.useState(""),[h,p]=w.useState(!1),{sdk:m}=at(),g=()=>p(!h),v=(C,y)=>{o(y);const A=y.map(E=>E.id);r(A&&A.length?A:null)},S=3;w.useEffect(()=>{!d&&t&&t.length&&m.football.getTeams({teamIds:t,scope:n}).then(C=>{const y=C.data.filter(A=>!A.name.includes("/"));o(Bm(y))}).catch(C=>{console.error(C),g(),o([])})},[]);const I=w.useMemo(()=>Ir((C,y)=>{c(!0),m.football.getTeams({name:C,scope:y}).then(A=>{const E=A.data.filter(_=>!_.name.includes("/"));s([...Bm(E)]),c(!1)}).catch(A=>{console.error(A),g(),s([]),c(!1)})},300),[]);w.useEffect(()=>{if(!d||d.length<S){s([]);return}return I(d,n),()=>I.cancel()},[d,I]);const x=(C,y)=>C.map((A,E)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:_=>y({index:E}).onClick(_),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:A},`option_${A.id}`)},A.id));return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{marginBottom:"16px"},children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:l,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(C,y)=>C.id===y.id,endDecorator:l?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:i.length>0?"":e.teamsSelectionPlaceholder,options:a,filterOptions:C=>C.filter(y=>!i.some(A=>A.value===y.value)),onInputChange:(C,y)=>{f(y)},onChange:v,getOptionKey:C=>C.id,value:i,renderTags:x,renderOption:(C,y)=>u.jsx(b.AutocompleteOption,Q(N({},C),{children:u.jsx(wn,{option:y})}))})}),u.jsx(st,{showToast:h,message:e.searchTeamsErrorMessage,color:"danger",hideToast:g})]})},NM=({checked:e,disabled:t,sx:n,onChange:r})=>{const i=n?N({},n):{ml:1};return u.jsx(b.Switch,{color:e?"success":"danger",checked:e,disabled:t,onChange:o=>r(o.target.checked),sx:Q(N({},i),{"--Switch-thumbSize":"16px","--Switch-trackWidth":"40px","--Switch-trackHeight":"24px","--Switch-trackBackground":"#EE5E52","&:hover":{"--Switch-trackBackground":"#EE5E52"},[`&.${b.switchClasses.checked}`]:{"--Switch-trackBackground":"#5CB176","&:hover":{"--Switch-trackBackground":"#5CB176"}}})})},hs=({label:e,labelPosition:t="start",defaultValue:n,description:r,disabled:i,descriptionColor:o,sx:a,onChange:s})=>{const l=u.jsx(NM,{checked:n,disabled:i,onChange:s,sx:a==null?void 0:a.switch}),c=a!=null&&a.container?N({},a.container):{mb:2};return r?u.jsxs(b.Box,{sx:N({},c),children:[u.jsx(b.Typography,{component:"label",startDecorator:t=="start"?void 0:l,endDecorator:t=="start"?l:void 0,children:e}),u.jsx(b.Typography,{level:"body-sm",color:o||"neutral",children:r})]}):u.jsx(b.Typography,{sx:{mb:2},component:"label",startDecorator:t=="start"?void 0:l,endDecorator:t=="start"?l:void 0,children:e})},FM={control:(e,t)=>Q(N({},e),{minHeight:"36px",borderColor:t.isFocused?"#0b6bcb":"#ced4da",boxShadow:t.isFocused?"0 0 0 0px 1px 2px 0px rgba(25, 118, 210, 0.25)":"none",borderRadius:"6px","&:hover":{borderColor:t.isFocused?"#1976d2":"#ced4da"}}),valueContainer:e=>Q(N({},e),{minHeight:"36px",marginTop:"0px"}),indicatorsContainer:e=>Q(N({},e),{minHeight:"36px"}),menu:e=>Q(N({},e),{position:"relative"}),clearIndicator:e=>Q(N({},e),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:e=>Q(N({},e),{"input:focus":{boxShadow:"none"}}),placeholder:e=>Q(N({},e),{color:"rgba(0, 0, 0, 0.54)",fontSize:"14px"}),multiValue:e=>Q(N({},e),{backgroundColor:"#e0f3ff",borderRadius:"4px",fontSize:"13px"}),multiValueLabel:e=>Q(N({},e),{color:"#333"})},zM=e=>e.map(t=>({label:t,value:t})),$m=e=>{const[t,n]=w.useState(""),[r,i]=w.useState(!1),o=zM(e.tags),a=()=>i(!r),s=f=>{e.onChange(f.map(h=>h.value))},l=f=>{n(f)},c=f=>{f.persist();const{key:h}=f;if(t)switch(h){case"Enter":case"Tab":if(e.tags&&e.tags.length===0){const p=[...e.tags,t];e.onChange(p)}if(e.tags&&e.tags.length>0&&d()){const p=[...e.tags,t];e.onChange(p)}n(""),f.preventDefault()}},d=()=>{let f=!1;return e.tags&&e.tags.length&&e.tags.includes(t)?(a(),f):(f=!0,f)};return u.jsxs(u.Fragment,{children:[u.jsx(pm,{styles:FM,components:{DropdownIndicator:null},inputValue:t,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:s,onInputChange:l,onKeyDown:c,placeholder:e.labels.tagsPlaceholder,value:o}),u.jsx(st,{showToast:r,message:e.labels.repeatedValueMessage,color:"warning",hideToast:a})]})},jM=Ue(u.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"}),"ArrowBackIos");class Nm{constructor(){te(this,"contestId","");te(this,"contestType","");te(this,"description","");te(this,"userList",[])}}const UM=(e,t,n)=>{const[r,i]=w.useState(null),{sdk:o}=at(),a=()=>k(this,null,function*(){try{let s;switch(t){case"top_x":s=yield o.topX.getGameWinners(e,!0);break;case"match_quiz":s=yield o.matchQuiz.getGameWinners(e,!0);break;default:s=yield o.loyalty.getTemplateWinners(e,!0)}s.userList&&s.userList.forEach(l=>{l.tags||(l.tags=[])}),i(s)}catch(s){const l=s;console.error(s),l.error.code!==404&&l.error.status!=="code_unknown_contest"&&n(),i(new Nm)}});return w.useEffect(()=>{a()},[]),r};class VM{constructor(){te(this,"position","");te(this,"profileId","");te(this,"note","");te(this,"tags",[])}}function HM(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var WM=HM,GM=Array.isArray,YM=GM,Fm=mu,KM=WM,qM=YM,QM=_m,JM=1/0,zm=Fm?Fm.prototype:void 0,jm=zm?zm.toString:void 0;function Um(e){if(typeof e=="string")return e;if(qM(e))return KM(e,Um)+"";if(QM(e))return jm?jm.call(e):"";var t=e+"";return t=="0"&&1/e==-JM?"-0":t}var XM=Um,ZM=XM;function e2(e){return e==null?"":ZM(e)}var Vm=e2;function t2(e,t,n,r){var i=-1,o=e==null?0:e.length;for(r&&o&&(n=e[++i]);++i<o;)n=t(n,e[i],i,e);return n}var n2=t2;function r2(e){return function(t){return e==null?void 0:e[t]}}var i2=r2,o2=i2,a2={À:"A",Á:"A",Â:"A",Ã:"A",Ä:"A",Å:"A",à:"a",á:"a",â:"a",ã:"a",ä:"a",å:"a",Ç:"C",ç:"c",Ð:"D",ð:"d",È:"E",É:"E",Ê:"E",Ë:"E",è:"e",é:"e",ê:"e",ë:"e",Ì:"I",Í:"I",Î:"I",Ï:"I",ì:"i",í:"i",î:"i",ï:"i",Ñ:"N",ñ:"n",Ò:"O",Ó:"O",Ô:"O",Õ:"O",Ö:"O",Ø:"O",ò:"o",ó:"o",ô:"o",õ:"o",ö:"o",ø:"o",Ù:"U",Ú:"U",Û:"U",Ü:"U",ù:"u",ú:"u",û:"u",ü:"u",Ý:"Y",ý:"y",ÿ:"y",Æ:"Ae",æ:"ae",Þ:"Th",þ:"th",ß:"ss",Ā:"A",Ă:"A",Ą:"A",ā:"a",ă:"a",ą:"a",Ć:"C",Ĉ:"C",Ċ:"C",Č:"C",ć:"c",ĉ:"c",ċ:"c",č:"c",Ď:"D",Đ:"D",ď:"d",đ:"d",Ē:"E",Ĕ:"E",Ė:"E",Ę:"E",Ě:"E",ē:"e",ĕ:"e",ė:"e",ę:"e",ě:"e",Ĝ:"G",Ğ:"G",Ġ:"G",Ģ:"G",ĝ:"g",ğ:"g",ġ:"g",ģ:"g",Ĥ:"H",Ħ:"H",ĥ:"h",ħ:"h",Ĩ:"I",Ī:"I",Ĭ:"I",Į:"I",İ:"I",ĩ:"i",ī:"i",ĭ:"i",į:"i",ı:"i",Ĵ:"J",ĵ:"j",Ķ:"K",ķ:"k",ĸ:"k",Ĺ:"L",Ļ:"L",Ľ:"L",Ŀ:"L",Ł:"L",ĺ:"l",ļ:"l",ľ:"l",ŀ:"l",ł:"l",Ń:"N",Ņ:"N",Ň:"N",Ŋ:"N",ń:"n",ņ:"n",ň:"n",ŋ:"n",Ō:"O",Ŏ:"O",Ő:"O",ō:"o",ŏ:"o",ő:"o",Ŕ:"R",Ŗ:"R",Ř:"R",ŕ:"r",ŗ:"r",ř:"r",Ś:"S",Ŝ:"S",Ş:"S",Š:"S",ś:"s",ŝ:"s",ş:"s",š:"s",Ţ:"T",Ť:"T",Ŧ:"T",ţ:"t",ť:"t",ŧ:"t",Ũ:"U",Ū:"U",Ŭ:"U",Ů:"U",Ű:"U",Ų:"U",ũ:"u",ū:"u",ŭ:"u",ů:"u",ű:"u",ų:"u",Ŵ:"W",ŵ:"w",Ŷ:"Y",ŷ:"y",Ÿ:"Y",Ź:"Z",Ż:"Z",Ž:"Z",ź:"z",ż:"z",ž:"z",IJ:"IJ",ij:"ij",Œ:"Oe",œ:"oe",ʼn:"'n",ſ:"s"},s2=o2(a2),l2=s2,c2=l2,u2=Vm,d2=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,f2="\\u0300-\\u036f",h2="\\ufe20-\\ufe2f",p2="\\u20d0-\\u20ff",g2=f2+h2+p2,m2="["+g2+"]",v2=RegExp(m2,"g");function b2(e){return e=u2(e),e&&e.replace(d2,c2).replace(v2,"")}var y2=b2,x2=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g;function C2(e){return e.match(x2)||[]}var w2=C2,I2=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/;function S2(e){return I2.test(e)}var A2=S2,Hm="\\ud800-\\udfff",T2="\\u0300-\\u036f",E2="\\ufe20-\\ufe2f",k2="\\u20d0-\\u20ff",_2=T2+E2+k2,Wm="\\u2700-\\u27bf",Gm="a-z\\xdf-\\xf6\\xf8-\\xff",P2="\\xac\\xb1\\xd7\\xf7",D2="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",O2="\\u2000-\\u206f",R2=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ym="A-Z\\xc0-\\xd6\\xd8-\\xde",L2="\\ufe0e\\ufe0f",Km=P2+D2+O2+R2,qm="['’]",Qm="["+Km+"]",M2="["+_2+"]",Jm="\\d+",B2="["+Wm+"]",Xm="["+Gm+"]",Zm="[^"+Hm+Km+Jm+Wm+Gm+Ym+"]",$2="\\ud83c[\\udffb-\\udfff]",N2="(?:"+M2+"|"+$2+")",F2="[^"+Hm+"]",ev="(?:\\ud83c[\\udde6-\\uddff]){2}",tv="[\\ud800-\\udbff][\\udc00-\\udfff]",ci="["+Ym+"]",z2="\\u200d",nv="(?:"+Xm+"|"+Zm+")",j2="(?:"+ci+"|"+Zm+")",rv="(?:"+qm+"(?:d|ll|m|re|s|t|ve))?",iv="(?:"+qm+"(?:D|LL|M|RE|S|T|VE))?",ov=N2+"?",av="["+L2+"]?",U2="(?:"+z2+"(?:"+[F2,ev,tv].join("|")+")"+av+ov+")*",V2="\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",H2="\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])",W2=av+ov+U2,G2="(?:"+[B2,ev,tv].join("|")+")"+W2,Y2=RegExp([ci+"?"+Xm+"+"+rv+"(?="+[Qm,ci,"$"].join("|")+")",j2+"+"+iv+"(?="+[Qm,ci+nv,"$"].join("|")+")",ci+"?"+nv+"+"+rv,ci+"+"+iv,H2,V2,Jm,G2].join("|"),"g");function K2(e){return e.match(Y2)||[]}var q2=K2,Q2=w2,J2=A2,X2=Vm,Z2=q2;function eB(e,t,n){return e=X2(e),t=n?void 0:t,t===void 0?J2(e)?Z2(e):Q2(e):e.match(t)||[]}var tB=eB,nB=n2,rB=y2,iB=tB,oB="['’]",aB=RegExp(oB,"g");function sB(e){return function(t){return nB(iB(rB(t).replace(aB,"")),e,"")}}var lB=sB,cB=lB,uB=cB(function(e,t,n){return e+(n?"_":"")+t.toLowerCase()}),dB=uB;const fB=fn(dB);class hB{constructor(){te(this,"id","");te(this,"value","");te(this,"label","")}}class pB extends hB{constructor(){super(...arguments);te(this,"logo","");te(this,"countryFlag","");te(this,"countryName","")}}class sv extends pB{constructor(){super(...arguments);te(this,"group","")}}const gB=(e,t)=>t||e||"-------------",bu=(e,t)=>Array.isArray(e)?e.map(n=>bu(n)):e!=null&&e.constructor===Object?Object.keys(e).reduce((n,r)=>Q(N({},n),{[fB(r)]:bu(e[r])}),{}):e,lv=e=>{const t=[];return e.competitions.forEach(n=>{t.push(yu(n,"competition"))}),e.teams.forEach(n=>{t.push(yu(n,"team"))}),e.players.forEach(n=>{t.push(yu(n,"player"))}),t},yu=(e,t)=>{var r,i,o,a,s;const n=new sv;return n.label=e.name,n.value=e.id,n.id=e.id,n.group=t,t==="player"?n.logo=((r=e.assets)==null?void 0:r.headshot)||lt.avatar:t==="team"?n.logo=((i=e.assets)==null?void 0:i.logo)||lt.team:n.logo=((o=e.assets)==null?void 0:o.logo)||lt.competition,n.countryName=e.country.name,n.countryFlag=((s=(a=e.country)==null?void 0:a.assets)==null?void 0:s.flag)||lt.country,n},mB=e=>{switch(e){case"CLASSIC_QUIZ":return"success";case"EITHER_OR":return"success";case"POLL":return"warning";case"TOP_X":return"primary";case"MATCH_QUIZ":return"primary";case"LEADERBOARD_TEMPLATES":return"neutral";default:return"neutral"}},vB=e=>{switch(e){case"CLASSIC_QUIZ":return"CLASSIC QUIZ";case"EITHER_OR":return"EITHER/OR";case"POLL":return"POLL";case"TOP_X":return"TOP X";case"MATCH_QUIZ":return"MATCH QUIZ";case"LEADERBOARD_TEMPLATES":return"LEADERBOARD TEMPLATES"}},bB=({profile:e,winner:t,labels:n,onChange:r,onRemove:i})=>{var v,S,I,x,C,y;const[o,a]=w.useState(t.position),[s,l]=w.useState(t.note),[c,d]=w.useState(t.tags),f=o||s||c.length>0,h=A=>{A.persist();const{value:E}=A.target;a(E),r("position",E)},p=A=>{A.persist();const{value:E}=A.target;l(E),r("note",E)},m=A=>{d(A),r("tags",A)},g=()=>{a(""),l(""),d([]),i()};return u.jsxs("tr",{style:{backgroundColor:f?"rgb(255 237 213)":""},children:[u.jsx("td",{children:u.jsxs(b.Box,{display:"flex",alignItems:"center",children:[u.jsx(b.Avatar,{src:((v=e.profileModel)==null?void 0:v.avatar)||"",alt:((S=e.profileModel)==null?void 0:S.name)||"Unknown",sx:{mr:1}}),u.jsxs(b.Box,{children:[u.jsxs(b.Typography,{fontWeight:"md",children:[gB((I=e.profileModel)==null?void 0:I.name,(x=e.profileModel)==null?void 0:x.nickname)," ",(C=e.profileModel)!=null&&C.name?u.jsxs(b.Typography,{children:["(",(y=e.profileModel)==null?void 0:y.name,")"]}):u.jsx(u.Fragment,{})]}),u.jsx(b.Typography,{fontSize:"sm",sx:{opacity:"0.5"},children:e.profileModel&&e.profileModel.country?e.profileModel.country.name:""})]})]})}),u.jsx("td",{style:{textAlign:"center"},children:e.points}),u.jsx("td",{style:{textAlign:"center"},children:e.predictionsMade}),u.jsx("td",{children:u.jsx(b.Input,{name:"position",placeholder:"#",value:o,onChange:h,sx:{backgroundColor:"#fff"}})}),u.jsx("td",{children:u.jsx(b.Input,{name:"note",value:s,placeholder:"This user has...",onChange:p,sx:{backgroundColor:"#fff"}})}),u.jsx("td",{children:u.jsx($m,{labels:n,tags:c,onChange:m})}),u.jsx("td",{children:u.jsx(b.Tooltip,{title:n.clearWinner,children:u.jsx(b.IconButton,{onClick:g,variant:"outlined",color:"danger",disabled:!f,children:u.jsx(ke.Remove,{})})})})]})},yB=e=>{const t=(i,o,a)=>{if(e.winners.find(d=>d.profileId===i)){const d=e.winners.map(f=>f.profileId===i?Q(N({},f),{[o]:a}):f);r(d);return}const l=new VM;l.profileId=i,l[o]=a;const c=[...e.winners,l];r(c)},n=i=>{const o=e.winners.filter(a=>a.profileId!==i);r(o)},r=i=>{e.setWinnersRequestBody(o=>Q(N({},o),{userList:i}))};return e.leaderboard?u.jsxs(u.Fragment,{children:[u.jsx(b.Typography,{level:"h4",children:e.labels.configureWinners}),e.leaderboard.length===0?u.jsx(b.Typography,{level:"body-lg",textAlign:"center",fontWeight:"bold",children:e.labels.noStandingsAvailable}):u.jsx(u.Fragment,{}),u.jsxs(b.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:last-child, & > tbody > tr > td:last-child":{textAlign:"center",width:"50px"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"}},children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:e.labels.nicknameAndName}),u.jsx("th",{style:{width:"70px",textAlign:"center"},children:e.labels.points}),u.jsx("th",{style:{width:"100px",textAlign:"center"},children:e.labels.predictions}),u.jsx("th",{style:{width:"100px"},children:e.labels.position}),u.jsx("th",{children:e.labels.note}),u.jsx("th",{children:e.labels.tags}),u.jsx("th",{children:e.labels.actions})]})}),u.jsxs("tbody",{children:[e.leaderboard.length>0?e.leaderboard.map(i=>u.jsx(bB,{winner:e.winners.find(o=>o.profileId===i.profileId)||{position:"",profileId:"",note:"",tags:[]},profile:i,labels:e.labels,onChange:(o,a)=>t(i.profileId,o,a),onRemove:()=>n(i.profileId)},`winner-profile-${i.profileId}`)):u.jsx(u.Fragment,{}),u.jsx("tr",{children:u.jsx("td",{colSpan:7,children:e.hasMoreParticipants?u.jsx(b.Box,{textAlign:"center",my:1,children:u.jsx(b.Button,{variant:"plain",sx:{width:"100%"},onClick:()=>e.setPage(i=>i+1),loading:e.isLoading,children:e.labels.loadMore})}):u.jsx(u.Fragment,{})})})]})]})]}):u.jsx(fs,{my:40})},xB=(e,t,n,r,i)=>{const[o,a]=w.useState(null),[s,l]=w.useState(!1),[c,d]=w.useState(!1),{sdk:f}=at(),h=()=>k(this,null,function*(){d(!0);const p={limit:10,page:r},m=!0;try{let g;t==="template"?g=yield f.loyalty.getLeaderboard(e,p,m):g=yield f.loyalty.getLeaderboardForGame(e,p,m),g.meta.pagination.numberOfPages>r?l(!0):l(!1),o&&o.length?a(v=>[...v,...g.data]):a(g.data)}catch(g){console.error(g),i("danger",n),a([])}d(!1)});return w.useEffect(()=>{h()},[r]),{leaderboard:o,hasMoreParticipants:s,isLeaderboardLoading:c}};class CB{constructor(){te(this,"isValid",!0);te(this,"message","");te(this,"validate",(t,n,r)=>(this.validateField(t,n),this.validateWinnerIds(t,r),this));te(this,"validateField",(t,n)=>{const r=t.every(i=>i.position&&i.profileId);r||(this.isValid=r,this.message=n)});te(this,"validateWinnerIds",(t,n)=>{const r=t.map(o=>o.profileId),i=new Set(r);r.length!==i.size&&(this.isValid=!1,this.message=n)})}}const wB=e=>{const t=e.winners.userList.length>0&&(e.winners.userList[0].position||e.winners.userList[0].profileId||e.winners.userList[0].note||e.winners.userList[0].tags.length);return u.jsx(b.Card,{variant:"plain",children:t?u.jsxs(u.Fragment,{children:[u.jsx(b.Typography,{level:"body-lg",mb:2,fontWeight:"bold",children:e.labels.preview}),u.jsx(b.Sheet,{children:u.jsxs(b.Table,{sx:{"& > thead > tr > th:nth-of-type(n + 3), & > tbody > tr > td:nth-of-type(n + 3)":{textAlign:"right"},"& > thead > tr > th:nth-of-type(3), & > thead > tr > th:nth-of-type(4), & > tbody > tr > td:nth-of-type(3), & > tbody > tr > td:nth-of-type(4)":{fontSize:"sm",display:{xs:"none",md:"table-cell"}}},children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{style:{width:"3%"},children:"#"}),u.jsx("th",{children:e.labels.name}),u.jsx("th",{children:e.labels.note}),u.jsx("th",{children:e.labels.tags})]})}),u.jsx("tbody",{children:e.winners.userList.map(n=>{var i;const r=e.profiles.find(o=>o.id===n.profileId);return u.jsxs("tr",{children:[u.jsx("td",{children:n.position}),u.jsx("td",{children:u.jsxs(b.Box,{display:"flex",alignItems:"center",justifyContent:{xs:"center",md:"flex-start"},gap:2,children:[u.jsx(b.Avatar,{src:(r==null?void 0:r.avatar)||"",alt:(r==null?void 0:r.name)||"Unknown"}),u.jsxs(b.Box,{textAlign:"left",children:[u.jsxs(b.Typography,{fontWeight:"bold",children:[(r==null?void 0:r.nickname)||"-------------"," ",u.jsxs(b.Typography,{children:["(",(r==null?void 0:r.name)||"-------------",")"]})]}),u.jsx(b.Typography,{fontSize:"sm",color:"neutral",children:(i=r==null?void 0:r.country)==null?void 0:i.name})]})]})}),u.jsx("td",{children:n.note}),u.jsx("td",{children:n.tags.map(o=>u.jsx(b.Chip,{variant:"soft",color:"neutral",size:"sm",sx:{mr:1},children:o},`preview-winner-${n.profileId}-tag-${o}`))})]},`preview-winner-${n.profileId}`)})})]})})]}):u.jsx(b.Typography,{textAlign:"center",fontWeight:"bold",children:e.labels.noSetWinnersMessage})})},IB=e=>Object.keys(e).length?(e.userList||(e.userList=[]),e):new Nm,SB=e=>{var y;const[t,n]=w.useState(IB(e.winners)),[r,i]=w.useState(((y=e.winners)==null?void 0:y.description)||""),[o,a]=w.useState(!1),[s,l]=w.useState(1),[c,d]=w.useState(!1),[f,h]=w.useState("danger"),[p,m]=w.useState(""),g=(A,E)=>{h(A),m(E),d(!0)},{leaderboard:v,hasMoreParticipants:S,isLeaderboardLoading:I}=xB(e.entityId,e.entityType,e.labels.leaderboardErrorMessage,s,g),{https:x}=at(),C=()=>k(this,null,function*(){a(!0);const A=JSON.parse(JSON.stringify(t));if(A.contestId=e.entityId,A.contestType=e.entityType==="template"?"TEMPLATE":"GAME",A.description=r,delete A.contestModel,A.userList.length>0){const _=new CB().validate(A.userList,e.labels.positionAndWinnerRequiredMessage,e.labels.sameChosenWinnerMessage);if(!_.isValid){g("danger",_.message),a(!1);return}}else delete A.userList;const E=bu(A);try{yield x.setWinners(E),g("success",Object.keys(e.winners).length?e.labels.editWinnersMessage:e.labels.createWinnersMessage)}catch(_){console.error(_),g("danger",Object.keys(e.winners).length?e.labels.editWinnersErrorMessage:e.labels.createWinnersErrorMessage)}a(!1)});return u.jsxs(u.Fragment,{children:[u.jsx("section",{style:{marginRight:"auto",marginLeft:"auto"},children:u.jsx(b.Box,{width:"100%",overflow:"hidden",borderRadius:"4px",bgcolor:"#fff",children:u.jsxs(b.Box,{width:"100%",sx:{overflowX:"auto"},children:[u.jsxs(b.Card,{variant:"plain",children:[u.jsx(hc,{property:"description",label:e.labels.description,defaultValue:r,placeholder:e.labels.winnersDescription,onChange:A=>{i(A)}}),u.jsx(yB,{winners:t.userList,leaderboard:v,hasMoreParticipants:S,isLoading:I,setPage:l,setWinnersRequestBody:n,labels:e.labels}),u.jsx(b.Box,{textAlign:"center",my:3,children:u.jsx(b.Button,{variant:"solid",color:"primary",onClick:C,loading:o,children:e.labels.save})}),u.jsx(b.Divider,{sx:{my:4}})]}),v?u.jsx(wB,{winners:t,profiles:v.map(A=>A.profileModel),labels:e.labels}):u.jsx(u.Fragment,{})]})})}),u.jsx(st,{showToast:c,color:f,message:p,hideToast:()=>d(!1)})]})},AB=e=>{const[t,n]=w.useState(!1),r=()=>n(!0),i=UM(e.entityId,e.entityType,r);return i?u.jsxs(u.Fragment,{children:[u.jsxs(b.Box,{p:2,children:[u.jsx(b.Typography,{fontSize:"12px",sx:{cursor:"pointer"},startDecorator:u.jsx(jM,{fontSize:"inherit"}),onClick:e.onClickBack,children:e.labels.back}),u.jsxs(b.Typography,{level:"h3",children:[e.labels.manageWinners,":"," ",u.jsx(b.Typography,{level:"title-lg",fontWeight:"italic",children:e.entityName})]})]}),u.jsx(SB,{labels:e.labels,winners:i,entityId:e.entityId,entityType:e.entityType}),u.jsx(st,{showToast:t,color:"danger",message:e.labels.winnersErrorMessage,hideToast:()=>n(!1)})]}):u.jsx(fs,{my:50})},TB=10,EB=e=>{var f;const[t,n]=w.useState([]),[r,i]=w.useState(!1),[o,a]=w.useState(""),{sdk:s}=at(),l=w.useMemo(()=>Ir(h=>{if(!h){n([]),i(!1);return}i(!0),s.football.search({query:h}).then(p=>{n([...lv(p)]),i(!1)}).catch(p=>{console.error(p),n([]),i(!1)})},300),[]);w.useEffect(()=>(l(o),()=>l.cancel()),[o,l]);const c=(h,p)=>{const m=p.map(g=>g.id);e.setOptions(p),e.handleResetData(),e.setFilters(g=>Q(N({},g),{entityIds:m}))},d=(h,p)=>h.map((m,g)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:v=>p({index:g}).onClick(v),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:m},`option_${m.id}`)},m.id));return u.jsxs(b.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{sx:{fontSize:12},color:"primary",children:e.labels.contextEntityTag}),u.jsx(b.Autocomplete,{getOptionDisabled:()=>e.options.length===TB,forcePopupIcon:!1,multiple:!0,loading:r,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(h,p)=>h.id===p.id,endDecorator:r?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:e.options.length>0?"":e.labels.typeContextTagNamePlaceholder,options:t,filterOptions:h=>h.filter(p=>!e.options.some(m=>m.value===p.value)),onInputChange:(h,p)=>{a(p)},onChange:c,getOptionKey:h=>h.id,groupBy:h=>h.group+"s",value:(f=e.options)!=null?f:[],renderTags:d,renderOption:(h,p)=>u.jsx(b.AutocompleteOption,Q(N({},h),{children:u.jsx(wn,{option:p})}))})]})};function cv(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}var fo;(function(e){e.event="event",e.props="prop"})(fo||(fo={}));function rr(){}function kB(e){var t,n=void 0;return function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t&&r.length===t.length&&r.every(function(o,a){return o===t[a]})||(t=r,n=e.apply(void 0,r)),n}}function ho(e){return!!(e||"").match(/\d/)}function ui(e){return e==null}function _B(e){return typeof e=="number"&&isNaN(e)}function uv(e){return ui(e)||_B(e)||typeof e=="number"&&!isFinite(e)}function dv(e){return e.replace(/[-[\]/{}()*+?.\\^$|]/g,"\\$&")}function PB(e){switch(e){case"lakh":return/(\d+?)(?=(\d\d)+(\d)(?!\d))(\.\d+)?/g;case"wan":return/(\d)(?=(\d{4})+(?!\d))/g;case"thousand":default:return/(\d)(?=(\d{3})+(?!\d))/g}}function DB(e,t,n){var r=PB(n),i=e.search(/[1-9]/);return i=i===-1?e.length:i,e.substring(0,i)+e.substring(i,e.length).replace(r,"$1"+t)}function OB(e){var t=w.useRef(e);t.current=e;var n=w.useRef(function(){for(var r=[],i=arguments.length;i--;)r[i]=arguments[i];return t.current.apply(t,r)});return n.current}function xu(e,t){t===void 0&&(t=!0);var n=e[0]==="-",r=n&&t;e=e.replace("-","");var i=e.split("."),o=i[0],a=i[1]||"";return{beforeDecimal:o,afterDecimal:a,hasNegation:n,addNegation:r}}function RB(e){if(!e)return e;var t=e[0]==="-";t&&(e=e.substring(1,e.length));var n=e.split("."),r=n[0].replace(/^0+/,"")||"0",i=n[1]||"";return(t?"-":"")+r+(i?"."+i:"")}function fv(e,t,n){for(var r="",i=n?"0":"",o=0;o<=t-1;o++)r+=e[o]||i;return r}function hv(e,t){return Array(t+1).join(e)}function pv(e){var t=e+"",n=t[0]==="-"?"-":"";n&&(t=t.substring(1));var r=t.split(/[eE]/g),i=r[0],o=r[1];if(o=Number(o),!o)return n+i;i=i.replace(".","");var a=1+o,s=i.length;return a<0?i="0."+hv("0",Math.abs(a))+i:a>=s?i=i+hv("0",a-s):i=(i.substring(0,a)||"0")+"."+i.substring(a),n+i}function gv(e,t,n){if(["","-"].indexOf(e)!==-1)return e;var r=(e.indexOf(".")!==-1||n)&&t,i=xu(e),o=i.beforeDecimal,a=i.afterDecimal,s=i.hasNegation,l=parseFloat("0."+(a||"0")),c=a.length<=t?"0."+a:l.toFixed(t),d=c.split("."),f=o;o&&Number(d[0])&&(f=o.split("").reverse().reduce(function(g,v,S){return g.length>S?(Number(g[0])+Number(v)).toString()+g.substring(1,g.length):v+g},d[0]));var h=fv(d[1]||"",t,n),p=s?"-":"",m=r?".":"";return""+p+f+m+h}function Sr(e,t){if(e.value=e.value,e!==null){if(e.createTextRange){var n=e.createTextRange();return n.move("character",t),n.select(),!0}return e.selectionStart||e.selectionStart===0?(e.focus(),e.setSelectionRange(t,t),!0):(e.focus(),!1)}}var mv=kB(function(e,t){for(var n=0,r=0,i=e.length,o=t.length;e[n]===t[n]&&n<i;)n++;for(;e[i-1-r]===t[o-1-r]&&o-r>n&&i-r>n;)r++;return{from:{start:n,end:i-r},to:{start:n,end:o-r}}}),LB=function(e,t){var n=Math.min(e.selectionStart,t);return{from:{start:n,end:e.selectionEnd},to:{start:n,end:t}}};function MB(e,t,n){return Math.min(Math.max(e,t),n)}function Cu(e){return Math.max(e.selectionStart,e.selectionEnd)}function BB(){return typeof navigator!="undefined"&&!(navigator.platform&&/iPhone|iPod/.test(navigator.platform))}function $B(e){return{from:{start:0,end:0},to:{start:0,end:e.length},lastValue:""}}function NB(e){var t=e.currentValue,n=e.formattedValue,r=e.currentValueIndex,i=e.formattedValueIndex;return t[r]===n[i]}function FB(e,t,n,r,i,o,a){a===void 0&&(a=NB);var s=i.findIndex(function(C){return C}),l=e.slice(0,s);!t&&!n.startsWith(l)&&(t=l,n=l+n,r=r+l.length);for(var c=n.length,d=e.length,f={},h=new Array(c),p=0;p<c;p++){h[p]=-1;for(var m=0,g=d;m<g;m++){var v=a({currentValue:n,lastValue:t,formattedValue:e,currentValueIndex:p,formattedValueIndex:m});if(v&&f[m]!==!0){h[p]=m,f[m]=!0;break}}}for(var S=r;S<c&&(h[S]===-1||!o(n[S]));)S++;var I=S===c||h[S]===-1?d:h[S];for(S=r-1;S>0&&h[S]===-1;)S--;var x=S===-1||h[S]===-1?0:h[S]+1;return x>I?I:r-x<I-r?x:I}function vv(e,t,n,r){var i=e.length;if(t=MB(t,0,i),r==="left"){for(;t>=0&&!n[t];)t--;t===-1&&(t=n.indexOf(!0))}else{for(;t<=i&&!n[t];)t++;t>i&&(t=n.lastIndexOf(!0))}return t===-1&&(t=i),t}function zB(e){for(var t=Array.from({length:e.length+1}).map(function(){return!0}),n=0,r=t.length;n<r;n++)t[n]=!!(ho(e[n])||ho(e[n-1]));return t}function bv(e,t,n,r,i,o){o===void 0&&(o=rr);var a=OB(function(m,g){var v,S;return uv(m)?(S="",v=""):typeof m=="number"||g?(S=typeof m=="number"?pv(m):m,v=r(S)):(S=i(m,void 0),v=r(S)),{formattedValue:v,numAsString:S}}),s=w.useState(function(){return a(ui(e)?t:e,n)}),l=s[0],c=s[1],d=function(m,g){m.formattedValue!==l.formattedValue&&c({formattedValue:m.formattedValue,numAsString:m.value}),o(m,g)},f=e,h=n;ui(e)&&(f=l.numAsString,h=!0);var p=a(f,h);return w.useMemo(function(){c(p)},[p.formattedValue]),[l,d]}function jB(e){return e.replace(/[^0-9]/g,"")}function UB(e){return e}function VB(e){var t=e.type;t===void 0&&(t="text");var n=e.displayType;n===void 0&&(n="input");var r=e.customInput,i=e.renderText,o=e.getInputRef,a=e.format;a===void 0&&(a=UB);var s=e.removeFormatting;s===void 0&&(s=jB);var l=e.defaultValue,c=e.valueIsNumericString,d=e.onValueChange,f=e.isAllowed,h=e.onChange;h===void 0&&(h=rr);var p=e.onKeyDown;p===void 0&&(p=rr);var m=e.onMouseUp;m===void 0&&(m=rr);var g=e.onFocus;g===void 0&&(g=rr);var v=e.onBlur;v===void 0&&(v=rr);var S=e.value,I=e.getCaretBoundary;I===void 0&&(I=zB);var x=e.isValidInputCharacter;x===void 0&&(x=ho);var C=e.isCharacterSame,y=cv(e,["type","displayType","customInput","renderText","getInputRef","format","removeFormatting","defaultValue","valueIsNumericString","onValueChange","isAllowed","onChange","onKeyDown","onMouseUp","onFocus","onBlur","value","getCaretBoundary","isValidInputCharacter","isCharacterSame"]),A=bv(S,l,!!c,a,s,d),E=A[0],_=E.formattedValue,D=E.numAsString,G=A[1],F=w.useRef(),T=w.useRef({formattedValue:_,numAsString:D}),j=function(de,he){T.current={formattedValue:de.formattedValue,numAsString:de.value},G(de,he)},Y=w.useState(!1),z=Y[0],$=Y[1],B=w.useRef(null),H=w.useRef({setCaretTimeout:null,focusTimeout:null});w.useEffect(function(){return $(!0),function(){clearTimeout(H.current.setCaretTimeout),clearTimeout(H.current.focusTimeout)}},[]);var q=a,ee=function(de,he){var Ce=parseFloat(he);return{formattedValue:de,value:he,floatValue:isNaN(Ce)?void 0:Ce}},R=function(de,he,Ce){de.selectionStart===0&&de.selectionEnd===de.value.length||(Sr(de,he),H.current.setCaretTimeout=setTimeout(function(){de.value===Ce&&de.selectionStart!==he&&Sr(de,he)},0))},M=function(de,he,Ce){return vv(de,he,I(de),Ce)},U=function(de,he,Ce){var Ee=I(he),He=FB(he,_,de,Ce,Ee,x,C);return He=vv(he,He,Ee),He},V=function(de){var he=de.formattedValue;he===void 0&&(he="");var Ce=de.input,Ee=de.source,He=de.event,Oe=de.numAsString,_e;if(Ce){var St=de.inputValue||Ce.value,At=Cu(Ce);Ce.value=he,_e=U(St,he,At),_e!==void 0&&R(Ce,_e,he)}he!==_&&j(ee(he,Oe),{event:He,source:Ee})};w.useEffect(function(){var de=T.current,he=de.formattedValue,Ce=de.numAsString;(_!==he||D!==Ce)&&j(ee(_,D),{event:void 0,source:fo.props})},[_,D]);var ne=B.current?Cu(B.current):void 0,se=typeof window!="undefined"?w.useLayoutEffect:w.useEffect;se(function(){var de=B.current;if(_!==T.current.formattedValue&&de){var he=U(T.current.formattedValue,_,ne);de.value=_,R(de,he,_)}},[_]);var ae=function(de,he,Ce){var Ee=he.target,He=F.current?LB(F.current,Ee.selectionEnd):mv(_,de),Oe=Object.assign(Object.assign({},He),{lastValue:_}),_e=s(de,Oe),St=q(_e);if(_e=s(St,void 0),f&&!f(ee(St,_e))){var At=he.target,jt=Cu(At),Mt=U(de,_,jt);return At.value=_,R(At,Mt,_),!1}return V({formattedValue:St,numAsString:_e,inputValue:de,event:he,source:Ce,input:he.target}),!0},X=function(de,he){he===void 0&&(he=0);var Ce=de.selectionStart,Ee=de.selectionEnd;F.current={selectionStart:Ce,selectionEnd:Ee+he}},le=function(de){var he=de.target,Ce=he.value,Ee=ae(Ce,de,fo.event);Ee&&h(de),F.current=void 0},re=function(de){var he=de.target,Ce=de.key,Ee=he.selectionStart,He=he.selectionEnd,Oe=he.value;Oe===void 0&&(Oe="");var _e;Ce==="ArrowLeft"||Ce==="Backspace"?_e=Math.max(Ee-1,0):Ce==="ArrowRight"?_e=Math.min(Ee+1,Oe.length):Ce==="Delete"&&(_e=Ee);var St=0;Ce==="Delete"&&Ee===He&&(St=1);var At=Ce==="ArrowLeft"||Ce==="ArrowRight";if(_e===void 0||Ee!==He&&!At){p(de),X(he,St);return}var jt=_e;if(At){var Mt=Ce==="ArrowLeft"?"left":"right";jt=M(Oe,_e,Mt),jt!==_e&&de.preventDefault()}else Ce==="Delete"&&!x(Oe[_e])?jt=M(Oe,_e,"right"):Ce==="Backspace"&&!x(Oe[_e])&&(jt=M(Oe,_e,"left"));jt!==_e&&R(he,jt,Oe),p(de),X(he,St)},ge=function(de){var he=de.target,Ce=function(){var Ee=he.selectionStart,He=he.selectionEnd,Oe=he.value;if(Oe===void 0&&(Oe=""),Ee===He){var _e=M(Oe,Ee);_e!==Ee&&R(he,_e,Oe)}};Ce(),requestAnimationFrame(function(){Ce()}),m(de),X(he)},Ae=function(de){de.persist&&de.persist();var he=de.target,Ce=de.currentTarget;B.current=he,H.current.focusTimeout=setTimeout(function(){var Ee=he.selectionStart,He=he.selectionEnd,Oe=he.value;Oe===void 0&&(Oe="");var _e=M(Oe,Ee);_e!==Ee&&!(Ee===0&&He===Oe.length)&&R(he,_e,Oe),g(Object.assign(Object.assign({},de),{currentTarget:Ce}))},0)},Ve=function(de){B.current=null,clearTimeout(H.current.focusTimeout),clearTimeout(H.current.setCaretTimeout),v(de)},It=z&&BB()?"numeric":void 0,ct=Object.assign({inputMode:It},y,{type:t,value:_,onChange:le,onKeyDown:re,onMouseUp:ge,onFocus:Ae,onBlur:Ve});if(n==="text")return i?w.createElement(w.Fragment,null,i(_,y)||null):w.createElement("span",Object.assign({},y,{ref:o}),_);if(r){var Pt=r;return w.createElement(Pt,Object.assign({},ct,{ref:o}))}return w.createElement("input",Object.assign({},ct,{ref:o}))}function yv(e,t){var n=t.decimalScale,r=t.fixedDecimalScale,i=t.prefix;i===void 0&&(i="");var o=t.suffix;o===void 0&&(o="");var a=t.allowNegative,s=t.thousandsGroupStyle;if(s===void 0&&(s="thousand"),e===""||e==="-")return e;var l=ps(t),c=l.thousandSeparator,d=l.decimalSeparator,f=n!==0&&e.indexOf(".")!==-1||n&&r,h=xu(e,a),p=h.beforeDecimal,m=h.afterDecimal,g=h.addNegation;return n!==void 0&&(m=fv(m,n,!!r)),c&&(p=DB(p,c,s)),i&&(p=i+p),o&&(m=m+o),g&&(p="-"+p),e=p+(f&&d||"")+m,e}function ps(e){var t=e.decimalSeparator;t===void 0&&(t=".");var n=e.thousandSeparator,r=e.allowedDecimalSeparators;return n===!0&&(n=","),r||(r=[t,"."]),{decimalSeparator:t,thousandSeparator:n,allowedDecimalSeparators:r}}function HB(e,t){e===void 0&&(e="");var n=new RegExp("(-)"),r=new RegExp("(-)(.)*(-)"),i=n.test(e),o=r.test(e);return e=e.replace(/-/g,""),i&&!o&&t&&(e="-"+e),e}function WB(e,t){return new RegExp("(^-)|[0-9]|"+dv(e),"g")}function GB(e,t,n){return e===""?!0:!(t!=null&&t.match(/\d/))&&!(n!=null&&n.match(/\d/))&&typeof e=="string"&&!isNaN(Number(e))}function YB(e,t,n){var r;t===void 0&&(t=$B(e));var i=n.allowNegative,o=n.prefix;o===void 0&&(o="");var a=n.suffix;a===void 0&&(a="");var s=n.decimalScale,l=t.from,c=t.to,d=c.start,f=c.end,h=ps(n),p=h.allowedDecimalSeparators,m=h.decimalSeparator,g=e[f]===m;if(ho(e)&&(e===o||e===a)&&t.lastValue==="")return e;if(f-d===1&&p.indexOf(e[d])!==-1){var v=s===0?"":m;e=e.substring(0,d)+v+e.substring(d+1,e.length)}var S=function(B,H,q){var ee=!1,R=!1;o.startsWith("-")?ee=!1:B.startsWith("--")?(ee=!1,R=!0):a.startsWith("-")&&B.length===a.length?ee=!1:B[0]==="-"&&(ee=!0);var M=ee?1:0;return R&&(M=2),M&&(B=B.substring(M),H-=M,q-=M),{value:B,start:H,end:q,hasNegation:ee}},I=S(e,d,f),x=I.hasNegation;r=I,e=r.value,d=r.start,f=r.end;var C=S(t.lastValue,l.start,l.end),y=C.start,A=C.end,E=C.value,_=e.substring(d,f);e.length&&E.length&&(y>E.length-a.length||A<o.length)&&!(_&&a.startsWith(_))&&(e=E);var D=0;e.startsWith(o)?D+=o.length:d<o.length&&(D=d),e=e.substring(D),f-=D;var G=e.length,F=e.length-a.length;e.endsWith(a)?G=F:(f>F||f>e.length-a.length)&&(G=f),e=e.substring(0,G),e=HB(x?"-"+e:e,i),e=(e.match(WB(m))||[]).join("");var T=e.indexOf(m);e=e.replace(new RegExp(dv(m),"g"),function(B,H){return H===T?".":""});var j=xu(e,i),Y=j.beforeDecimal,z=j.afterDecimal,$=j.addNegation;return c.end-c.start<l.end-l.start&&Y===""&&g&&!parseFloat(z)&&(e=$?"-":""),e}function KB(e,t){var n=t.prefix;n===void 0&&(n="");var r=t.suffix;r===void 0&&(r="");var i=Array.from({length:e.length+1}).map(function(){return!0}),o=e[0]==="-";i.fill(!1,0,n.length+(o?1:0));var a=e.length;return i.fill(!1,a-r.length+1,a+1),i}function qB(e){var t=ps(e),n=t.thousandSeparator,r=t.decimalSeparator,i=e.prefix;i===void 0&&(i="");var o=e.allowNegative;if(o===void 0&&(o=!0),n===r)throw new Error(`
|
|
2464
|
+
Decimal separator can't be same as thousand separator.
|
|
2465
|
+
thousandSeparator: `+n+` (thousandSeparator = {true} is same as thousandSeparator = ",")
|
|
2466
|
+
decimalSeparator: `+r+` (default value for decimalSeparator is .)
|
|
2467
|
+
`);return i.startsWith("-")&&o&&(console.error(`
|
|
2468
|
+
Prefix can't start with '-' when allowNegative is true.
|
|
2469
|
+
prefix: `+i+`
|
|
2470
|
+
allowNegative: `+o+`
|
|
2471
|
+
`),o=!1),Object.assign(Object.assign({},e),{allowNegative:o})}function QB(e){e=qB(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=rr);var o=e.onBlur;o===void 0&&(o=rr);var a=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,c=e.prefix;c===void 0&&(c="");var d=e.defaultValue,f=e.value,h=e.valueIsNumericString,p=e.onValueChange,m=cv(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),g=ps(e),v=g.decimalSeparator,S=g.allowedDecimalSeparators,I=function($){return yv($,e)},x=function($,B){return YB($,B,e)},C=ui(f)?d:f,y=h!=null?h:GB(C,c,t);ui(f)?ui(d)||(y=y||typeof d=="number"):y=y||typeof f=="number";var A=function($){return uv($)?$:(typeof $=="number"&&($=pv($)),y&&typeof s=="number"?gv($,s,!!l):$)},E=bv(A(f),A(d),!!y,I,x,p),_=E[0],D=_.numAsString,G=_.formattedValue,F=E[1],T=function($){var B=$.target,H=$.key,q=B.selectionStart,ee=B.selectionEnd,R=B.value;if(R===void 0&&(R=""),(H==="Backspace"||H==="Delete")&&ee<c.length){$.preventDefault();return}if(q!==ee){i($);return}H==="Backspace"&&R[0]==="-"&&q===c.length+1&&n&&Sr(B,1),s&&l&&(H==="Backspace"&&R[q-1]===v?(Sr(B,q-1),$.preventDefault()):H==="Delete"&&R[q]===v&&$.preventDefault()),S!=null&&S.includes(H)&&R[q]===v&&Sr(B,q+1);var M=a===!0?",":a;H==="Backspace"&&R[q-1]===M&&Sr(B,q-1),H==="Delete"&&R[q]===M&&Sr(B,q+1),i($)},j=function($){var B=D;if(B.match(/\d/g)||(B=""),r||(B=RB(B)),l&&s&&(B=gv(B,s,l)),B!==D){var H=yv(B,e);F({formattedValue:H,value:B,floatValue:parseFloat(B)},{event:$,source:fo.event})}o($)},Y=function($){return $===v?!0:ho($)},z=function($){var B=$.currentValue,H=$.lastValue,q=$.formattedValue,ee=$.currentValueIndex,R=$.formattedValueIndex,M=B[ee],U=q[R],V=mv(H,B),ne=V.to,se=function(ae){return x(ae).indexOf(".")+c.length};return f===0&&l&&s&&B[ne.start]===v&&se(B)<ee&&se(q)>R?!1:ee>=ne.start&&ee<ne.end&&S&&S.includes(M)&&U===v?!0:M===U};return Object.assign(Object.assign({},m),{value:G,valueIsNumericString:!1,isValidInputCharacter:Y,isCharacterSame:z,onValueChange:F,format:I,removeFormatting:x,getCaretBoundary:function($){return KB($,e)},onKeyDown:T,onBlur:j})}function JB(e){var t=QB(e);return w.createElement(VB,Object.assign({},t))}const XB=W.forwardRef(function(t,n){const a=t,{onChange:r,isAllowed:i}=a,o=We(a,["onChange","isAllowed"]);return u.jsx(JB,Q(N({},o),{getInputRef:n,onValueChange:s=>{r({target:{name:t.name,value:s.value}})},thousandSeparator:!0,valueIsNumericString:!0,isAllowed:i}))}),wu=e=>{const t=n=>{e.onChange(Number(n.target.value))};return u.jsxs(pu,{size:e.size||"sm",children:[u.jsx(gu,{children:e.label}),u.jsx(Ga,{sx:e.sx,value:e.defaultValue,onChange:t,slotProps:{input:{component:XB,isAllowed:e.isAllowed?e.isAllowed:()=>!0}}}),e.description?u.jsx(b.FormHelperText,{children:e.description}):u.jsx(u.Fragment,{})]})},ZB=e=>e.startsWith("fb:c:")?"competition":e.startsWith("fb:t:")?"team":"player",e$=(e,t,n,r)=>{const i=e.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),o=e.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),a=e.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),s=[],l=[];if(i.length>0){const c=t.football.getCompetitions({competitionIds:i}).then(d=>{l.push(d)}).catch(d=>{console.error(d),r()});s.push(c)}if(o.length>0){const c=t.football.getTeams({teamIds:o}).then(d=>{l.push(d.data)}).catch(d=>{console.error(d),r()});s.push(c)}if(a.length>0){const c=t.football.getPlayers({playerIds:a}).then(d=>{l.push(d.data)}).catch(d=>{console.error(d),r()});s.push(c)}Promise.all(s).then(()=>{const d=Array.prototype.concat.apply([],l).map(f=>t$(f));n(d)})},t$=e=>{const t=new sv;return t.label=e.name,t.value=e.name,t.id=e.id,t.group=ZB(e.id),e.birthDate?t.logo=e.assets&&e.assets.headshot&&e.assets.headshot:t.logo=e.assets&&e.assets.logo&&e.assets.logo,t.countryName=e.country.name,t.countryFlag=e.country.assets&&e.country.assets.flag?e.country.assets.flag:lt.country,t},n$=10,r$=e=>{const[t,n]=w.useState([]),[r,i]=w.useState([]),[o,a]=w.useState(!1),[s,l]=w.useState(""),[c,d]=w.useState(!1),{sdk:f}=at(),h=()=>d(!c),p=(v,S)=>{n(S),e.onChangeTags(S)};w.useEffect(()=>{e$(e.tags,f,n,h)},[e.tags]);const m=w.useMemo(()=>Ir(v=>{if(!v){i([]),a(!1);return}a(!0),f.football.search({query:v}).then(S=>{i([...lv(S)]),a(!1)}).catch(S=>{console.error(S),i([]),a(!1)})},300),[]);w.useEffect(()=>(m(s),()=>m.cancel()),[s,m]);const g=(v,S)=>v.map((I,x)=>u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:C=>S({index:x}).onClick(C),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsx(wn,{option:I},`option_${I.id}`)},I.id));return u.jsxs(b.FormControl,{size:"sm",sx:{marginBottom:"16px"},children:[u.jsx(b.FormLabel,{color:"primary",children:e.labels.contextEntityTag}),u.jsx(b.Autocomplete,{getOptionDisabled:()=>t.length===n$,forcePopupIcon:!1,multiple:!0,loading:o,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(v,S)=>v.id===S.id,endDecorator:o?u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary"}}):null,placeholder:t.length>0?"":e.labels.typeContextTagNamePlaceholder,options:r,filterOptions:v=>v.filter(S=>!t.some(I=>I.value===S.value)),onInputChange:(v,S)=>{l(S)},onChange:p,getOptionKey:v=>v.id,groupBy:v=>v.group+"s",value:t!=null?t:[],renderTags:g,renderOption:(v,S)=>u.jsx(b.AutocompleteOption,Q(N({},v),{children:u.jsx(wn,{option:S})}))}),u.jsx(st,{showToast:c,message:e.labels.getFootballEntitiesErrorMessage,color:"danger",hideToast:h})]})},i$=e=>new Map().set("id",e.id).set("type",e.type).set("label",e.label),o$=e=>{const t=JSON.parse(JSON.stringify(e.context)),n=e.context.content,r=e.context.campaign,i=i$(e.labels),o=(l,c)=>{const d=l.target.value;t.content[c]=d,e.onChange(t)},a=(l,c)=>{const d=l.target.value;t.campaign[c]=d,e.onChange(t)},s=l=>{l.length?t.tags=l.map(c=>({id:c.id,type:c.group,source:"football"})):t.tags=[],e.onChange(t)};return u.jsx(u.Fragment,{children:u.jsxs(Kh,{defaultValue:0,sx:{p:0,bgcolor:"transparent"},children:[u.jsxs(qh,{sx:{borderRadius:0,fontSize:"0.875rem",[`& .${gc.root}`]:{'&[aria-selected="true"]':{bgcolor:"transparent",py:1,borderColor:"transparent","&::before":{content:'""',display:"block",position:"absolute",height:2,bottom:-2,left:0,right:0},"&::after":{bgcolor:"primary.500"}}}},tabFlex:"auto",children:[u.jsx(Vr,{children:e.labels.tags}),u.jsx(Vr,{children:e.labels.content}),u.jsx(Vr,{children:e.labels.campaign})]}),u.jsx(Xr,{value:0,sx:{px:0},children:u.jsx(r$,{labels:e.labels,tags:e.context.tags,onChangeTags:s})}),u.jsx(Xr,{value:1,sx:{px:0},children:Object.keys(n).map(l=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{label:i.get(l),placeholder:"",defaultValue:n[l],required:!1,size:"sm",onChange:c=>o(c,l)})},`context-content-${l}`))}),u.jsx(Xr,{value:2,sx:{px:0},children:Object.keys(r).map(l=>u.jsx(b.Box,{mb:2,children:u.jsx(xn,{label:i.get(l),placeholder:"",defaultValue:r[l],required:!1,size:"sm",onChange:c=>a(c,l)})},`context-campaign-${l}`))})]})})},a$=e=>e?N({},e):{main:"",mobile:""},s$=e=>{const[t,n]=w.useState(!1),r=a$(e.defaultValue),i=(a,s)=>{r[s]=a,e.onChange(r)},o=a=>{r[a]="",e.onChange(r)};return u.jsxs(b.Box,{sx:{marginBottom:"10px"},children:[u.jsx(co,{labels:e.labels,title:e.labels.mainImage,image:r.main,onChangeImages:a=>i(a,"main"),clearImage:()=>o("main")}),u.jsx(b.Link,{underline:"hover",onClick:()=>n(!t),sx:{marginBottom:"10px"},children:t?e.labels.hideMoreImages:e.labels.showMoreImages}),t?u.jsx(co,{labels:e.labels,title:e.labels.mobileImage,image:r.mobile,onChangeImages:a=>i(a,"mobile"),clearImage:()=>o("mobile")}):u.jsx(u.Fragment,{})]})},l$=({defaultValue:e,isClearable:t=!0,labels:n,onChange:r})=>{const i=w.useRef(null),o=[{id:"FREE",label:n.free},{id:"LEAD",label:n.lead},{id:"REGISTERED",label:n.registered},{id:"PAID",label:n.paid}];return u.jsxs(b.FormControl,{size:"sm",sx:{mb:2},children:[u.jsx(b.FormLabel,{children:n.authRequirement}),u.jsx(b.Select,Q(N({value:e,size:"sm",slotProps:{button:{sx:{whiteSpace:"nowrap"}}},onChange:(a,s)=>r(s),sx:{minHeight:"37px"}},e&&t&&{endDecorator:u.jsx(b.IconButton,{variant:"plain",color:"neutral",onMouseDown:a=>{a.stopPropagation()},onClick:()=>{var a;r(null),(a=i.current)==null||a.focusVisible()},sx:{width:"18px",height:"18px"},children:u.jsx(wm,{})}),indicator:null}),{children:o.map(a=>u.jsx(b.Option,{value:a.id,children:a.label},a.id))})),u.jsx(b.FormHelperText,{children:n.authRequirementDescription})]})};function c$(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return w.useMemo(()=>r=>{t.forEach(i=>i(r))},t)}const gs=typeof window!="undefined"&&typeof window.document!="undefined"&&typeof window.document.createElement!="undefined";function di(e){const t=Object.prototype.toString.call(e);return t==="[object Window]"||t==="[object global]"}function Iu(e){return"nodeType"in e}function Lt(e){var t,n;return e?di(e)?e:Iu(e)&&(t=(n=e.ownerDocument)==null?void 0:n.defaultView)!=null?t:window:window}function Su(e){const{Document:t}=Lt(e);return e instanceof t}function po(e){return di(e)?!1:e instanceof Lt(e).HTMLElement}function xv(e){return e instanceof Lt(e).SVGElement}function fi(e){return e?di(e)?e.document:Iu(e)?Su(e)?e:po(e)||xv(e)?e.ownerDocument:document:document:document}const ln=gs?w.useLayoutEffect:w.useEffect;function ms(e){const t=w.useRef(e);return ln(()=>{t.current=e}),w.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return t.current==null?void 0:t.current(...r)},[])}function u$(){const e=w.useRef(null),t=w.useCallback((r,i)=>{e.current=setInterval(r,i)},[]),n=w.useCallback(()=>{e.current!==null&&(clearInterval(e.current),e.current=null)},[]);return[t,n]}function go(e,t){t===void 0&&(t=[e]);const n=w.useRef(e);return ln(()=>{n.current!==e&&(n.current=e)},t),n}function mo(e,t){const n=w.useRef();return w.useMemo(()=>{const r=e(n.current);return n.current=r,r},[...t])}function vs(e){const t=ms(e),n=w.useRef(null),r=w.useCallback(i=>{i!==n.current&&(t==null||t(i,n.current)),n.current=i},[]);return[n,r]}function bs(e){const t=w.useRef();return w.useEffect(()=>{t.current=e},[e]),t.current}let Au={};function vo(e,t){return w.useMemo(()=>{if(t)return t;const n=Au[e]==null?0:Au[e]+1;return Au[e]=n,e+"-"+n},[e,t])}function Cv(e){return function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];return r.reduce((o,a)=>{const s=Object.entries(a);for(const[l,c]of s){const d=o[l];d!=null&&(o[l]=d+e*c)}return o},N({},t))}}const hi=Cv(1),bo=Cv(-1);function d$(e){return"clientX"in e&&"clientY"in e}function ys(e){if(!e)return!1;const{KeyboardEvent:t}=Lt(e.target);return t&&e instanceof t}function f$(e){if(!e)return!1;const{TouchEvent:t}=Lt(e.target);return t&&e instanceof t}function xs(e){if(f$(e)){if(e.touches&&e.touches.length){const{clientX:t,clientY:n}=e.touches[0];return{x:t,y:n}}else if(e.changedTouches&&e.changedTouches.length){const{clientX:t,clientY:n}=e.changedTouches[0];return{x:t,y:n}}}return d$(e)?{x:e.clientX,y:e.clientY}:null}const Vn=Object.freeze({Translate:{toString(e){if(!e)return;const{x:t,y:n}=e;return"translate3d("+(t?Math.round(t):0)+"px, "+(n?Math.round(n):0)+"px, 0)"}},Scale:{toString(e){if(!e)return;const{scaleX:t,scaleY:n}=e;return"scaleX("+t+") scaleY("+n+")"}},Transform:{toString(e){if(e)return[Vn.Translate.toString(e),Vn.Scale.toString(e)].join(" ")}},Transition:{toString(e){let{property:t,duration:n,easing:r}=e;return t+" "+n+"ms "+r}}}),wv="a,frame,iframe,input:not([type=hidden]):not(:disabled),select:not(:disabled),textarea:not(:disabled),button:not(:disabled),*[tabindex]";function h$(e){return e.matches(wv)?e:e.querySelector(wv)}const p$={display:"none"};function g$(e){let{id:t,value:n}=e;return w.createElement("div",{id:t,style:p$},n)}function m$(e){let{id:t,announcement:n,ariaLiveType:r="assertive"}=e;const i={position:"fixed",top:0,left:0,width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0 0 0 0)",clipPath:"inset(100%)",whiteSpace:"nowrap"};return w.createElement("div",{id:t,style:i,role:"status","aria-live":r,"aria-atomic":!0},n)}function v$(){const[e,t]=w.useState("");return{announce:w.useCallback(r=>{r!=null&&t(r)},[]),announcement:e}}const Iv=w.createContext(null);function b$(e){const t=w.useContext(Iv);w.useEffect(()=>{if(!t)throw new Error("useDndMonitor must be used within a children of <DndContext>");return t(e)},[e,t])}function y$(){const[e]=w.useState(()=>new Set),t=w.useCallback(r=>(e.add(r),()=>e.delete(r)),[e]);return[w.useCallback(r=>{let{type:i,event:o}=r;e.forEach(a=>{var s;return(s=a[i])==null?void 0:s.call(a,o)})},[e]),t]}const x$={draggable:`
|
|
2472
|
+
To pick up a draggable item, press the space bar.
|
|
2473
|
+
While dragging, use the arrow keys to move the item.
|
|
2474
|
+
Press space again to drop the item in its new position, or press escape to cancel.
|
|
2475
|
+
`},C$={onDragStart(e){let{active:t}=e;return"Picked up draggable item "+t.id+"."},onDragOver(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was moved over droppable area "+n.id+".":"Draggable item "+t.id+" is no longer over a droppable area."},onDragEnd(e){let{active:t,over:n}=e;return n?"Draggable item "+t.id+" was dropped over droppable area "+n.id:"Draggable item "+t.id+" was dropped."},onDragCancel(e){let{active:t}=e;return"Dragging was cancelled. Draggable item "+t.id+" was dropped."}};function w$(e){let{announcements:t=C$,container:n,hiddenTextDescribedById:r,screenReaderInstructions:i=x$}=e;const{announce:o,announcement:a}=v$(),s=vo("DndLiveRegion"),[l,c]=w.useState(!1);if(w.useEffect(()=>{c(!0)},[]),b$(w.useMemo(()=>({onDragStart(f){let{active:h}=f;o(t.onDragStart({active:h}))},onDragMove(f){let{active:h,over:p}=f;t.onDragMove&&o(t.onDragMove({active:h,over:p}))},onDragOver(f){let{active:h,over:p}=f;o(t.onDragOver({active:h,over:p}))},onDragEnd(f){let{active:h,over:p}=f;o(t.onDragEnd({active:h,over:p}))},onDragCancel(f){let{active:h,over:p}=f;o(t.onDragCancel({active:h,over:p}))}}),[o,t])),!l)return null;const d=w.createElement(w.Fragment,null,w.createElement(g$,{id:r,value:i.draggable}),w.createElement(m$,{id:s,announcement:a}));return n?pt.createPortal(d,n):d}var vt;(function(e){e.DragStart="dragStart",e.DragMove="dragMove",e.DragEnd="dragEnd",e.DragCancel="dragCancel",e.DragOver="dragOver",e.RegisterDroppable="registerDroppable",e.SetDroppableDisabled="setDroppableDisabled",e.UnregisterDroppable="unregisterDroppable"})(vt||(vt={}));function Cs(){}function ws(e,t){return w.useMemo(()=>({sensor:e,options:t!=null?t:{}}),[e,t])}function Sv(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return w.useMemo(()=>[...t].filter(r=>r!=null),[...t])}const cn=Object.freeze({x:0,y:0});function I$(e,t){return Math.sqrt(Math.pow(e.x-t.x,2)+Math.pow(e.y-t.y,2))}function S$(e,t){const n=xs(e);if(!n)return"0 0";const r={x:(n.x-t.left)/t.width*100,y:(n.y-t.top)/t.height*100};return r.x+"% "+r.y+"%"}function A$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return n-r}function T$(e,t){let{data:{value:n}}=e,{data:{value:r}}=t;return r-n}function Av(e){let{left:t,top:n,height:r,width:i}=e;return[{x:t,y:n},{x:t+i,y:n},{x:t,y:n+r},{x:t+i,y:n+r}]}function Tv(e,t){if(!e||e.length===0)return null;const[n]=e;return n[t]}const E$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=Av(t),o=[];for(const a of r){const{id:s}=a,l=n.get(s);if(l){const c=Av(l),d=i.reduce((h,p,m)=>h+I$(c[m],p),0),f=Number((d/4).toFixed(4));o.push({id:s,data:{droppableContainer:a,value:f}})}}return o.sort(A$)};function k$(e,t){const n=Math.max(t.top,e.top),r=Math.max(t.left,e.left),i=Math.min(t.left+t.width,e.left+e.width),o=Math.min(t.top+t.height,e.top+e.height),a=i-r,s=o-n;if(r<i&&n<o){const l=t.width*t.height,c=e.width*e.height,d=a*s,f=d/(l+c-d);return Number(f.toFixed(4))}return 0}const _$=e=>{let{collisionRect:t,droppableRects:n,droppableContainers:r}=e;const i=[];for(const o of r){const{id:a}=o,s=n.get(a);if(s){const l=k$(s,t);l>0&&i.push({id:a,data:{droppableContainer:o,value:l}})}}return i.sort(T$)};function P$(e,t,n){return Q(N({},e),{scaleX:t&&n?t.width/n.width:1,scaleY:t&&n?t.height/n.height:1})}function Ev(e,t){return e&&t?{x:e.left-t.left,y:e.top-t.top}:cn}function D$(e){return function(n){for(var r=arguments.length,i=new Array(r>1?r-1:0),o=1;o<r;o++)i[o-1]=arguments[o];return i.reduce((a,s)=>Q(N({},a),{top:a.top+e*s.y,bottom:a.bottom+e*s.y,left:a.left+e*s.x,right:a.right+e*s.x}),N({},n))}}const O$=D$(1);function kv(e){if(e.startsWith("matrix3d(")){const t=e.slice(9,-1).split(/, /);return{x:+t[12],y:+t[13],scaleX:+t[0],scaleY:+t[5]}}else if(e.startsWith("matrix(")){const t=e.slice(7,-1).split(/, /);return{x:+t[4],y:+t[5],scaleX:+t[0],scaleY:+t[3]}}return null}function R$(e,t,n){const r=kv(t);if(!r)return e;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=e.left-a-(1-i)*parseFloat(n),c=e.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),d=i?e.width/i:e.width,f=o?e.height/o:e.height;return{width:d,height:f,top:c,right:l+d,bottom:c+f,left:l}}const L$={ignoreTransform:!1};function pi(e,t){t===void 0&&(t=L$);let n=e.getBoundingClientRect();if(t.ignoreTransform){const{transform:c,transformOrigin:d}=Lt(e).getComputedStyle(e);c&&(n=R$(n,c,d))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function _v(e){return pi(e,{ignoreTransform:!0})}function M$(e){const t=e.innerWidth,n=e.innerHeight;return{top:0,left:0,right:t,bottom:n,width:t,height:n}}function B$(e,t){return t===void 0&&(t=Lt(e).getComputedStyle(e)),t.position==="fixed"}function $$(e,t){t===void 0&&(t=Lt(e).getComputedStyle(e));const n=/(auto|scroll|overlay)/;return["overflow","overflowX","overflowY"].some(i=>{const o=t[i];return typeof o=="string"?n.test(o):!1})}function Is(e,t){const n=[];function r(i){if(t!=null&&n.length>=t||!i)return n;if(Su(i)&&i.scrollingElement!=null&&!n.includes(i.scrollingElement))return n.push(i.scrollingElement),n;if(!po(i)||xv(i)||n.includes(i))return n;const o=Lt(e).getComputedStyle(i);return i!==e&&$$(i,o)&&n.push(i),B$(i,o)?n:r(i.parentNode)}return e?r(e):n}function Pv(e){const[t]=Is(e,1);return t!=null?t:null}function Tu(e){return!gs||!e?null:di(e)?e:Iu(e)?Su(e)||e===fi(e).scrollingElement?window:po(e)?e:null:null}function Dv(e){return di(e)?e.scrollX:e.scrollLeft}function Ov(e){return di(e)?e.scrollY:e.scrollTop}function Eu(e){return{x:Dv(e),y:Ov(e)}}var Ct;(function(e){e[e.Forward=1]="Forward",e[e.Backward=-1]="Backward"})(Ct||(Ct={}));function Rv(e){return!gs||!e?!1:e===document.scrollingElement}function Lv(e){const t={x:0,y:0},n=Rv(e)?{height:window.innerHeight,width:window.innerWidth}:{height:e.clientHeight,width:e.clientWidth},r={x:e.scrollWidth-n.width,y:e.scrollHeight-n.height},i=e.scrollTop<=t.y,o=e.scrollLeft<=t.x,a=e.scrollTop>=r.y,s=e.scrollLeft>=r.x;return{isTop:i,isLeft:o,isBottom:a,isRight:s,maxScroll:r,minScroll:t}}const N$={x:.2,y:.2};function F$(e,t,n,r,i){let{top:o,left:a,right:s,bottom:l}=n;r===void 0&&(r=10),i===void 0&&(i=N$);const{isTop:c,isBottom:d,isLeft:f,isRight:h}=Lv(e),p={x:0,y:0},m={x:0,y:0},g={height:t.height*i.y,width:t.width*i.x};return!c&&o<=t.top+g.height?(p.y=Ct.Backward,m.y=r*Math.abs((t.top+g.height-o)/g.height)):!d&&l>=t.bottom-g.height&&(p.y=Ct.Forward,m.y=r*Math.abs((t.bottom-g.height-l)/g.height)),!h&&s>=t.right-g.width?(p.x=Ct.Forward,m.x=r*Math.abs((t.right-g.width-s)/g.width)):!f&&a<=t.left+g.width&&(p.x=Ct.Backward,m.x=r*Math.abs((t.left+g.width-a)/g.width)),{direction:p,speed:m}}function z$(e){if(e===document.scrollingElement){const{innerWidth:o,innerHeight:a}=window;return{top:0,left:0,right:o,bottom:a,width:o,height:a}}const{top:t,left:n,right:r,bottom:i}=e.getBoundingClientRect();return{top:t,left:n,right:r,bottom:i,width:e.clientWidth,height:e.clientHeight}}function Mv(e){return e.reduce((t,n)=>hi(t,Eu(n)),cn)}function j$(e){return e.reduce((t,n)=>t+Dv(n),0)}function U$(e){return e.reduce((t,n)=>t+Ov(n),0)}function Bv(e,t){if(t===void 0&&(t=pi),!e)return;const{top:n,left:r,bottom:i,right:o}=t(e);Pv(e)&&(i<=0||o<=0||n>=window.innerHeight||r>=window.innerWidth)&&e.scrollIntoView({block:"center",inline:"center"})}const V$=[["x",["left","right"],j$],["y",["top","bottom"],U$]];class ku{constructor(t,n){this.rect=void 0,this.width=void 0,this.height=void 0,this.top=void 0,this.bottom=void 0,this.right=void 0,this.left=void 0;const r=Is(n),i=Mv(r);this.rect=N({},t),this.width=t.width,this.height=t.height;for(const[o,a,s]of V$)for(const l of a)Object.defineProperty(this,l,{get:()=>{const c=s(r),d=i[o]-c;return this.rect[l]+d},enumerable:!0});Object.defineProperty(this,"rect",{enumerable:!1})}}class yo{constructor(t){this.target=void 0,this.listeners=[],this.removeAll=()=>{this.listeners.forEach(n=>{var r;return(r=this.target)==null?void 0:r.removeEventListener(...n)})},this.target=t}add(t,n,r){var i;(i=this.target)==null||i.addEventListener(t,n,r),this.listeners.push([t,n,r])}}function H$(e){const{EventTarget:t}=Lt(e);return e instanceof t?e:fi(e)}function _u(e,t){const n=Math.abs(e.x),r=Math.abs(e.y);return typeof t=="number"?Math.sqrt(vi(n,2)+vi(r,2))>t:"x"in t&&"y"in t?n>t.x&&r>t.y:"x"in t?n>t.x:"y"in t?r>t.y:!1}var on;(function(e){e.Click="click",e.DragStart="dragstart",e.Keydown="keydown",e.ContextMenu="contextmenu",e.Resize="resize",e.SelectionChange="selectionchange",e.VisibilityChange="visibilitychange"})(on||(on={}));function $v(e){e.preventDefault()}function W$(e){e.stopPropagation()}var Pe;(function(e){e.Space="Space",e.Down="ArrowDown",e.Right="ArrowRight",e.Left="ArrowLeft",e.Up="ArrowUp",e.Esc="Escape",e.Enter="Enter",e.Tab="Tab"})(Pe||(Pe={}));const Nv={start:[Pe.Space,Pe.Enter],cancel:[Pe.Esc],end:[Pe.Space,Pe.Enter,Pe.Tab]},G$=(e,t)=>{let{currentCoordinates:n}=t;switch(e.code){case Pe.Right:return Q(N({},n),{x:n.x+25});case Pe.Left:return Q(N({},n),{x:n.x-25});case Pe.Down:return Q(N({},n),{y:n.y+25});case Pe.Up:return Q(N({},n),{y:n.y-25})}};class Ss{constructor(t){this.props=void 0,this.autoScrollEnabled=!1,this.referenceCoordinates=void 0,this.listeners=void 0,this.windowListeners=void 0,this.props=t;const{event:{target:n}}=t;this.props=t,this.listeners=new yo(fi(n)),this.windowListeners=new yo(Lt(n)),this.handleKeyDown=this.handleKeyDown.bind(this),this.handleCancel=this.handleCancel.bind(this),this.attach()}attach(){this.handleStart(),this.windowListeners.add(on.Resize,this.handleCancel),this.windowListeners.add(on.VisibilityChange,this.handleCancel),setTimeout(()=>this.listeners.add(on.Keydown,this.handleKeyDown))}handleStart(){const{activeNode:t,onStart:n}=this.props,r=t.node.current;r&&Bv(r),n(cn)}handleKeyDown(t){if(ys(t)){const{active:n,context:r,options:i}=this.props,{keyboardCodes:o=Nv,coordinateGetter:a=G$,scrollBehavior:s="smooth"}=i,{code:l}=t;if(o.end.includes(l)){this.handleEnd(t);return}if(o.cancel.includes(l)){this.handleCancel(t);return}const{collisionRect:c}=r.current,d=c?{x:c.left,y:c.top}:cn;this.referenceCoordinates||(this.referenceCoordinates=d);const f=a(t,{active:n,context:r.current,currentCoordinates:d});if(f){const h=bo(f,d),p={x:0,y:0},{scrollableAncestors:m}=r.current;for(const g of m){const v=t.code,{isTop:S,isRight:I,isLeft:x,isBottom:C,maxScroll:y,minScroll:A}=Lv(g),E=z$(g),_={x:Math.min(v===Pe.Right?E.right-E.width/2:E.right,Math.max(v===Pe.Right?E.left:E.left+E.width/2,f.x)),y:Math.min(v===Pe.Down?E.bottom-E.height/2:E.bottom,Math.max(v===Pe.Down?E.top:E.top+E.height/2,f.y))},D=v===Pe.Right&&!I||v===Pe.Left&&!x,G=v===Pe.Down&&!C||v===Pe.Up&&!S;if(D&&_.x!==f.x){const F=g.scrollLeft+h.x,T=v===Pe.Right&&F<=y.x||v===Pe.Left&&F>=A.x;if(T&&!h.y){g.scrollTo({left:F,behavior:s});return}T?p.x=g.scrollLeft-F:p.x=v===Pe.Right?g.scrollLeft-y.x:g.scrollLeft-A.x,p.x&&g.scrollBy({left:-p.x,behavior:s});break}else if(G&&_.y!==f.y){const F=g.scrollTop+h.y,T=v===Pe.Down&&F<=y.y||v===Pe.Up&&F>=A.y;if(T&&!h.x){g.scrollTo({top:F,behavior:s});return}T?p.y=g.scrollTop-F:p.y=v===Pe.Down?g.scrollTop-y.y:g.scrollTop-A.y,p.y&&g.scrollBy({top:-p.y,behavior:s});break}}this.handleMove(t,hi(bo(f,this.referenceCoordinates),p))}}}handleMove(t,n){const{onMove:r}=this.props;t.preventDefault(),r(n)}handleEnd(t){const{onEnd:n}=this.props;t.preventDefault(),this.detach(),n()}handleCancel(t){const{onCancel:n}=this.props;t.preventDefault(),this.detach(),n()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll()}}Ss.activators=[{eventName:"onKeyDown",handler:(e,t,n)=>{let{keyboardCodes:r=Nv,onActivation:i}=t,{active:o}=n;const{code:a}=e.nativeEvent;if(r.start.includes(a)){const s=o.activatorNode.current;return s&&e.target!==s?!1:(e.preventDefault(),i==null||i({event:e.nativeEvent}),!0)}return!1}}];function Fv(e){return!!(e&&"distance"in e)}function zv(e){return!!(e&&"delay"in e)}class Pu{constructor(t,n,r){var i;r===void 0&&(r=H$(t.event.target)),this.props=void 0,this.events=void 0,this.autoScrollEnabled=!0,this.document=void 0,this.activated=!1,this.initialCoordinates=void 0,this.timeoutId=null,this.listeners=void 0,this.documentListeners=void 0,this.windowListeners=void 0,this.props=t,this.events=n;const{event:o}=t,{target:a}=o;this.props=t,this.events=n,this.document=fi(a),this.documentListeners=new yo(this.document),this.listeners=new yo(r),this.windowListeners=new yo(Lt(a)),this.initialCoordinates=(i=xs(o))!=null?i:cn,this.handleStart=this.handleStart.bind(this),this.handleMove=this.handleMove.bind(this),this.handleEnd=this.handleEnd.bind(this),this.handleCancel=this.handleCancel.bind(this),this.handleKeydown=this.handleKeydown.bind(this),this.removeTextSelection=this.removeTextSelection.bind(this),this.attach()}attach(){const{events:t,props:{options:{activationConstraint:n,bypassActivationConstraint:r}}}=this;if(this.listeners.add(t.move.name,this.handleMove,{passive:!1}),this.listeners.add(t.end.name,this.handleEnd),t.cancel&&this.listeners.add(t.cancel.name,this.handleCancel),this.windowListeners.add(on.Resize,this.handleCancel),this.windowListeners.add(on.DragStart,$v),this.windowListeners.add(on.VisibilityChange,this.handleCancel),this.windowListeners.add(on.ContextMenu,$v),this.documentListeners.add(on.Keydown,this.handleKeydown),n){if(r!=null&&r({event:this.props.event,activeNode:this.props.activeNode,options:this.props.options}))return this.handleStart();if(zv(n)){this.timeoutId=setTimeout(this.handleStart,n.delay),this.handlePending(n);return}if(Fv(n)){this.handlePending(n);return}}this.handleStart()}detach(){this.listeners.removeAll(),this.windowListeners.removeAll(),setTimeout(this.documentListeners.removeAll,50),this.timeoutId!==null&&(clearTimeout(this.timeoutId),this.timeoutId=null)}handlePending(t,n){const{active:r,onPending:i}=this.props;i(r,t,this.initialCoordinates,n)}handleStart(){const{initialCoordinates:t}=this,{onStart:n}=this.props;t&&(this.activated=!0,this.documentListeners.add(on.Click,W$,{capture:!0}),this.removeTextSelection(),this.documentListeners.add(on.SelectionChange,this.removeTextSelection),n(t))}handleMove(t){var n;const{activated:r,initialCoordinates:i,props:o}=this,{onMove:a,options:{activationConstraint:s}}=o;if(!i)return;const l=(n=xs(t))!=null?n:cn,c=bo(i,l);if(!r&&s){if(Fv(s)){if(s.tolerance!=null&&_u(c,s.tolerance))return this.handleCancel();if(_u(c,s.distance))return this.handleStart()}if(zv(s)&&_u(c,s.tolerance))return this.handleCancel();this.handlePending(s,c);return}t.cancelable&&t.preventDefault(),a(l)}handleEnd(){const{onAbort:t,onEnd:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleCancel(){const{onAbort:t,onCancel:n}=this.props;this.detach(),this.activated||t(this.props.active),n()}handleKeydown(t){t.code===Pe.Esc&&this.handleCancel()}removeTextSelection(){var t;(t=this.document.getSelection())==null||t.removeAllRanges()}}const Y$={cancel:{name:"pointercancel"},move:{name:"pointermove"},end:{name:"pointerup"}};class As extends Pu{constructor(t){const{event:n}=t,r=fi(n.target);super(t,Y$,r)}}As.activators=[{eventName:"onPointerDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return!n.isPrimary||n.button!==0?!1:(r==null||r({event:n}),!0)}}];const K$={move:{name:"mousemove"},end:{name:"mouseup"}};var Du;(function(e){e[e.RightClick=2]="RightClick"})(Du||(Du={}));class q$ extends Pu{constructor(t){super(t,K$,fi(t.event.target))}}q$.activators=[{eventName:"onMouseDown",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;return n.button===Du.RightClick?!1:(r==null||r({event:n}),!0)}}];const Ou={cancel:{name:"touchcancel"},move:{name:"touchmove"},end:{name:"touchend"}};class Q$ extends Pu{constructor(t){super(t,Ou)}static setup(){return window.addEventListener(Ou.move.name,t,{capture:!1,passive:!1}),function(){window.removeEventListener(Ou.move.name,t)};function t(){}}}Q$.activators=[{eventName:"onTouchStart",handler:(e,t)=>{let{nativeEvent:n}=e,{onActivation:r}=t;const{touches:i}=n;return i.length>1?!1:(r==null||r({event:n}),!0)}}];var xo;(function(e){e[e.Pointer=0]="Pointer",e[e.DraggableRect=1]="DraggableRect"})(xo||(xo={}));var Ts;(function(e){e[e.TreeOrder=0]="TreeOrder",e[e.ReversedTreeOrder=1]="ReversedTreeOrder"})(Ts||(Ts={}));function J$(e){let{acceleration:t,activator:n=xo.Pointer,canScroll:r,draggingRect:i,enabled:o,interval:a=5,order:s=Ts.TreeOrder,pointerCoordinates:l,scrollableAncestors:c,scrollableAncestorRects:d,delta:f,threshold:h}=e;const p=Z$({delta:f,disabled:!o}),[m,g]=u$(),v=w.useRef({x:0,y:0}),S=w.useRef({x:0,y:0}),I=w.useMemo(()=>{switch(n){case xo.Pointer:return l?{top:l.y,bottom:l.y,left:l.x,right:l.x}:null;case xo.DraggableRect:return i}},[n,i,l]),x=w.useRef(null),C=w.useCallback(()=>{const A=x.current;if(!A)return;const E=v.current.x*S.current.x,_=v.current.y*S.current.y;A.scrollBy(E,_)},[]),y=w.useMemo(()=>s===Ts.TreeOrder?[...c].reverse():c,[s,c]);w.useEffect(()=>{if(!o||!c.length||!I){g();return}for(const A of y){if((r==null?void 0:r(A))===!1)continue;const E=c.indexOf(A),_=d[E];if(!_)continue;const{direction:D,speed:G}=F$(A,_,I,t,h);for(const F of["x","y"])p[F][D[F]]||(G[F]=0,D[F]=0);if(G.x>0||G.y>0){g(),x.current=A,m(C,a),v.current=G,S.current=D;return}}v.current={x:0,y:0},S.current={x:0,y:0},g()},[t,C,r,g,o,a,JSON.stringify(I),JSON.stringify(p),m,c,y,d,JSON.stringify(h)])}const X$={x:{[Ct.Backward]:!1,[Ct.Forward]:!1},y:{[Ct.Backward]:!1,[Ct.Forward]:!1}};function Z$(e){let{delta:t,disabled:n}=e;const r=bs(t);return mo(i=>{if(n||!r||!i)return X$;const o={x:Math.sign(t.x-r.x),y:Math.sign(t.y-r.y)};return{x:{[Ct.Backward]:i.x[Ct.Backward]||o.x===-1,[Ct.Forward]:i.x[Ct.Forward]||o.x===1},y:{[Ct.Backward]:i.y[Ct.Backward]||o.y===-1,[Ct.Forward]:i.y[Ct.Forward]||o.y===1}}},[n,t,r])}function eN(e,t){const n=t!=null?e.get(t):void 0,r=n?n.node.current:null;return mo(i=>{var o;return t==null?null:(o=r!=null?r:i)!=null?o:null},[r,t])}function tN(e,t){return w.useMemo(()=>e.reduce((n,r)=>{const{sensor:i}=r,o=i.activators.map(a=>({eventName:a.eventName,handler:t(a.handler,r)}));return[...n,...o]},[]),[e,t])}var Co;(function(e){e[e.Always=0]="Always",e[e.BeforeDragging=1]="BeforeDragging",e[e.WhileDragging=2]="WhileDragging"})(Co||(Co={}));var Ru;(function(e){e.Optimized="optimized"})(Ru||(Ru={}));const jv=new Map;function nN(e,t){let{dragging:n,dependencies:r,config:i}=t;const[o,a]=w.useState(null),{frequency:s,measure:l,strategy:c}=i,d=w.useRef(e),f=v(),h=go(f),p=w.useCallback(function(S){S===void 0&&(S=[]),!h.current&&a(I=>I===null?S:I.concat(S.filter(x=>!I.includes(x))))},[h]),m=w.useRef(null),g=mo(S=>{if(f&&!n)return jv;if(!S||S===jv||d.current!==e||o!=null){const I=new Map;for(let x of e){if(!x)continue;if(o&&o.length>0&&!o.includes(x.id)&&x.rect.current){I.set(x.id,x.rect.current);continue}const C=x.node.current,y=C?new ku(l(C),C):null;x.rect.current=y,y&&I.set(x.id,y)}return I}return S},[e,o,n,f,l]);return w.useEffect(()=>{d.current=e},[e]),w.useEffect(()=>{f||p()},[n,f]),w.useEffect(()=>{o&&o.length>0&&a(null)},[JSON.stringify(o)]),w.useEffect(()=>{f||typeof s!="number"||m.current!==null||(m.current=setTimeout(()=>{p(),m.current=null},s))},[s,f,p,...r]),{droppableRects:g,measureDroppableContainers:p,measuringScheduled:o!=null};function v(){switch(c){case Co.Always:return!1;case Co.BeforeDragging:return n;default:return!n}}}function Lu(e,t){return mo(n=>e?n||(typeof t=="function"?t(e):e):null,[t,e])}function rN(e,t){return Lu(e,t)}function iN(e){let{callback:t,disabled:n}=e;const r=ms(t),i=w.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.MutationObserver=="undefined")return;const{MutationObserver:o}=window;return new o(r)},[r,n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function Es(e){let{callback:t,disabled:n}=e;const r=ms(t),i=w.useMemo(()=>{if(n||typeof window=="undefined"||typeof window.ResizeObserver=="undefined")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return w.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}function oN(e){return new ku(pi(e),e)}function Uv(e,t,n){t===void 0&&(t=oN);const[r,i]=w.useState(null);function o(){i(l=>{if(!e)return null;if(e.isConnected===!1){var c;return(c=l!=null?l:n)!=null?c:null}const d=t(e);return JSON.stringify(l)===JSON.stringify(d)?l:d})}const a=iN({callback(l){if(e)for(const c of l){const{type:d,target:f}=c;if(d==="childList"&&f instanceof HTMLElement&&f.contains(e)){o();break}}}}),s=Es({callback:o});return ln(()=>{o(),e?(s==null||s.observe(e),a==null||a.observe(document.body,{childList:!0,subtree:!0})):(s==null||s.disconnect(),a==null||a.disconnect())},[e]),r}function aN(e){const t=Lu(e);return Ev(e,t)}const Vv=[];function sN(e){const t=w.useRef(e),n=mo(r=>e?r&&r!==Vv&&e&&t.current&&e.parentNode===t.current.parentNode?r:Is(e):Vv,[e]);return w.useEffect(()=>{t.current=e},[e]),n}function lN(e){const[t,n]=w.useState(null),r=w.useRef(e),i=w.useCallback(o=>{const a=Tu(o.target);a&&n(s=>s?(s.set(a,Eu(a)),new Map(s)):null)},[]);return w.useEffect(()=>{const o=r.current;if(e!==o){a(o);const s=e.map(l=>{const c=Tu(l);return c?(c.addEventListener("scroll",i,{passive:!0}),[c,Eu(c)]):null}).filter(l=>l!=null);n(s.length?new Map(s):null),r.current=e}return()=>{a(e),a(o)};function a(s){s.forEach(l=>{const c=Tu(l);c==null||c.removeEventListener("scroll",i)})}},[i,e]),w.useMemo(()=>e.length?t?Array.from(t.values()).reduce((o,a)=>hi(o,a),cn):Mv(e):cn,[e,t])}function Hv(e,t){t===void 0&&(t=[]);const n=w.useRef(null);return w.useEffect(()=>{n.current=null},t),w.useEffect(()=>{const r=e!==cn;r&&!n.current&&(n.current=e),!r&&n.current&&(n.current=null)},[e]),n.current?bo(e,n.current):cn}function cN(e){w.useEffect(()=>{if(!gs)return;const t=e.map(n=>{let{sensor:r}=n;return r.setup==null?void 0:r.setup()});return()=>{for(const n of t)n==null||n()}},e.map(t=>{let{sensor:n}=t;return n}))}function uN(e,t){return w.useMemo(()=>e.reduce((n,r)=>{let{eventName:i,handler:o}=r;return n[i]=a=>{o(a,t)},n},{}),[e,t])}function Wv(e){return w.useMemo(()=>e?M$(e):null,[e])}const Gv=[];function dN(e,t){t===void 0&&(t=pi);const[n]=e,r=Wv(n?Lt(n):null),[i,o]=w.useState(Gv);function a(){o(()=>e.length?e.map(l=>Rv(l)?r:new ku(t(l),l)):Gv)}const s=Es({callback:a});return ln(()=>{s==null||s.disconnect(),a(),e.forEach(l=>s==null?void 0:s.observe(l))},[e]),i}function Yv(e){if(!e)return null;if(e.children.length>1)return e;const t=e.children[0];return po(t)?t:e}function fN(e){let{measure:t}=e;const[n,r]=w.useState(null),i=w.useCallback(c=>{for(const{target:d}of c)if(po(d)){r(f=>{const h=t(d);return f?Q(N({},f),{width:h.width,height:h.height}):h});break}},[t]),o=Es({callback:i}),a=w.useCallback(c=>{const d=Yv(c);o==null||o.disconnect(),d&&(o==null||o.observe(d)),r(d?t(d):null)},[t,o]),[s,l]=vs(a);return w.useMemo(()=>({nodeRef:s,rect:n,setRef:l}),[n,s,l])}const hN=[{sensor:As,options:{}},{sensor:Ss,options:{}}],pN={current:{}},ks={draggable:{measure:_v},droppable:{measure:_v,strategy:Co.WhileDragging,frequency:Ru.Optimized},dragOverlay:{measure:pi}};class wo extends Map{get(t){var n;return t!=null&&(n=super.get(t))!=null?n:void 0}toArray(){return Array.from(this.values())}getEnabled(){return this.toArray().filter(t=>{let{disabled:n}=t;return!n})}getNodeFor(t){var n,r;return(n=(r=this.get(t))==null?void 0:r.node.current)!=null?n:void 0}}const gN={activatorEvent:null,active:null,activeNode:null,activeNodeRect:null,collisions:null,containerNodeRect:null,draggableNodes:new Map,droppableRects:new Map,droppableContainers:new wo,over:null,dragOverlay:{nodeRef:{current:null},rect:null,setRef:Cs},scrollableAncestors:[],scrollableAncestorRects:[],measuringConfiguration:ks,measureDroppableContainers:Cs,windowRect:null,measuringScheduled:!1},Kv={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:Cs,draggableNodes:new Map,over:null,measureDroppableContainers:Cs},Io=w.createContext(Kv),qv=w.createContext(gN);function mN(){return{draggable:{active:null,initialCoordinates:{x:0,y:0},nodes:new Map,translate:{x:0,y:0}},droppable:{containers:new wo}}}function vN(e,t){switch(t.type){case vt.DragStart:return Q(N({},e),{draggable:Q(N({},e.draggable),{initialCoordinates:t.initialCoordinates,active:t.active})});case vt.DragMove:return e.draggable.active==null?e:Q(N({},e),{draggable:Q(N({},e.draggable),{translate:{x:t.coordinates.x-e.draggable.initialCoordinates.x,y:t.coordinates.y-e.draggable.initialCoordinates.y}})});case vt.DragEnd:case vt.DragCancel:return Q(N({},e),{draggable:Q(N({},e.draggable),{active:null,initialCoordinates:{x:0,y:0},translate:{x:0,y:0}})});case vt.RegisterDroppable:{const{element:n}=t,{id:r}=n,i=new wo(e.droppable.containers);return i.set(r,n),Q(N({},e),{droppable:Q(N({},e.droppable),{containers:i})})}case vt.SetDroppableDisabled:{const{id:n,key:r,disabled:i}=t,o=e.droppable.containers.get(n);if(!o||r!==o.key)return e;const a=new wo(e.droppable.containers);return a.set(n,Q(N({},o),{disabled:i})),Q(N({},e),{droppable:Q(N({},e.droppable),{containers:a})})}case vt.UnregisterDroppable:{const{id:n,key:r}=t,i=e.droppable.containers.get(n);if(!i||r!==i.key)return e;const o=new wo(e.droppable.containers);return o.delete(n),Q(N({},e),{droppable:Q(N({},e.droppable),{containers:o})})}default:return e}}function bN(e){let{disabled:t}=e;const{active:n,activatorEvent:r,draggableNodes:i}=w.useContext(Io),o=bs(r),a=bs(n==null?void 0:n.id);return w.useEffect(()=>{if(!t&&!r&&o&&a!=null){if(!ys(o)||document.activeElement===o.target)return;const s=i.get(a);if(!s)return;const{activatorNode:l,node:c}=s;if(!l.current&&!c.current)return;requestAnimationFrame(()=>{for(const d of[l.current,c.current]){if(!d)continue;const f=h$(d);if(f){f.focus();break}}})}},[r,t,i,a,o]),null}function Qv(e,t){let i=t,{transform:n}=i,r=We(i,["transform"]);return e!=null&&e.length?e.reduce((o,a)=>a(N({transform:o},r)),n):n}function yN(e){return w.useMemo(()=>({draggable:N(N({},ks.draggable),e==null?void 0:e.draggable),droppable:N(N({},ks.droppable),e==null?void 0:e.droppable),dragOverlay:N(N({},ks.dragOverlay),e==null?void 0:e.dragOverlay)}),[e==null?void 0:e.draggable,e==null?void 0:e.droppable,e==null?void 0:e.dragOverlay])}function xN(e){let{activeNode:t,measure:n,initialRect:r,config:i=!0}=e;const o=w.useRef(!1),{x:a,y:s}=typeof i=="boolean"?{x:i,y:i}:i;ln(()=>{if(!a&&!s||!t){o.current=!1;return}if(o.current||!r)return;const c=t==null?void 0:t.node.current;if(!c||c.isConnected===!1)return;const d=n(c),f=Ev(d,r);if(a||(f.x=0),s||(f.y=0),o.current=!0,Math.abs(f.x)>0||Math.abs(f.y)>0){const h=Pv(c);h&&h.scrollBy({top:f.y,left:f.x})}},[t,a,s,r,n])}const _s=w.createContext(Q(N({},cn),{scaleX:1,scaleY:1}));var ir;(function(e){e[e.Uninitialized=0]="Uninitialized",e[e.Initializing=1]="Initializing",e[e.Initialized=2]="Initialized"})(ir||(ir={}));const Jv=w.memo(function(t){var n,r,i,o;let Bs=t,{id:a,accessibility:s,autoScroll:l=!0,children:c,sensors:d=hN,collisionDetection:f=_$,measuring:h,modifiers:p}=Bs,m=We(Bs,["id","accessibility","autoScroll","children","sensors","collisionDetection","measuring","modifiers"]);const g=w.useReducer(vN,void 0,mN),[v,S]=g,[I,x]=y$(),[C,y]=w.useState(ir.Uninitialized),A=C===ir.Initialized,{draggable:{active:E,nodes:_,translate:D},droppable:{containers:G}}=v,F=E!=null?_.get(E):null,T=w.useRef({initial:null,translated:null}),j=w.useMemo(()=>{var wt;return E!=null?{id:E,data:(wt=F==null?void 0:F.data)!=null?wt:pN,rect:T}:null},[E,F]),Y=w.useRef(null),[z,$]=w.useState(null),[B,H]=w.useState(null),q=go(m,Object.values(m)),ee=vo("DndDescribedBy",a),R=w.useMemo(()=>G.getEnabled(),[G]),M=yN(h),{droppableRects:U,measureDroppableContainers:V,measuringScheduled:ne}=nN(R,{dragging:A,dependencies:[D.x,D.y],config:M.droppable}),se=eN(_,E),ae=w.useMemo(()=>B?xs(B):null,[B]),X=un(),le=rN(se,M.draggable.measure);xN({activeNode:E!=null?_.get(E):null,config:X.layoutShiftCompensation,initialRect:le,measure:M.draggable.measure});const re=Uv(se,M.draggable.measure,le),ge=Uv(se?se.parentElement:null),Ae=w.useRef({activatorEvent:null,active:null,activeNode:se,collisionRect:null,collisions:null,droppableRects:U,draggableNodes:_,draggingNode:null,draggingNodeRect:null,droppableContainers:G,over:null,scrollableAncestors:[],scrollAdjustedTranslate:null}),Ve=G.getNodeFor((n=Ae.current.over)==null?void 0:n.id),It=fN({measure:M.dragOverlay.measure}),ct=(r=It.nodeRef.current)!=null?r:se,Pt=A?(i=It.rect)!=null?i:re:null,de=!!(It.nodeRef.current&&It.rect),he=aN(de?null:re),Ce=Wv(ct?Lt(ct):null),Ee=sN(A?Ve!=null?Ve:se:null),He=dN(Ee),Oe=Qv(p,{transform:{x:D.x-he.x,y:D.y-he.y,scaleX:1,scaleY:1},activatorEvent:B,active:j,activeNodeRect:re,containerNodeRect:ge,draggingNodeRect:Pt,over:Ae.current.over,overlayNodeRect:It.rect,scrollableAncestors:Ee,scrollableAncestorRects:He,windowRect:Ce}),_e=ae?hi(ae,D):null,St=lN(Ee),At=Hv(St),jt=Hv(St,[re]),Mt=hi(Oe,At),qt=Pt?O$(Pt,Oe):null,or=j&&qt?f({active:j,collisionRect:qt,droppableRects:U,droppableContainers:R,pointerCoordinates:_e}):null,Ls=Tv(or,"id"),[In,So]=w.useState(null),Bu=de?Oe:hi(Oe,jt),$u=P$(Bu,(o=In==null?void 0:In.rect)!=null?o:null,re),Fe=w.useRef(null),gi=w.useCallback((wt,P)=>{let{sensor:L,options:K}=P;if(Y.current==null)return;const J=_.get(Y.current);if(!J)return;const ie=wt.nativeEvent,ce=new L({active:Y.current,activeNode:J,event:ie,options:K,context:Ae,onAbort(ue){if(!_.get(ue))return;const{onDragAbort:fe}=q.current,me={id:ue};fe==null||fe(me),I({type:"onDragAbort",event:me})},onPending(ue,Ie,fe,me){if(!_.get(ue))return;const{onDragPending:Dt}=q.current,nt={id:ue,constraint:Ie,initialCoordinates:fe,offset:me};Dt==null||Dt(nt),I({type:"onDragPending",event:nt})},onStart(ue){const Ie=Y.current;if(Ie==null)return;const fe=_.get(Ie);if(!fe)return;const{onDragStart:me}=q.current,Re={activatorEvent:ie,active:{id:Ie,data:fe.data,rect:T}};pt.unstable_batchedUpdates(()=>{me==null||me(Re),y(ir.Initializing),S({type:vt.DragStart,initialCoordinates:ue,active:Ie}),I({type:"onDragStart",event:Re}),$(Fe.current),H(ie)})},onMove(ue){S({type:vt.DragMove,coordinates:ue})},onEnd:we(vt.DragEnd),onCancel:we(vt.DragCancel)});Fe.current=ce;function we(ue){return function(){return k(this,null,function*(){const{active:fe,collisions:me,over:Re,scrollAdjustedTranslate:Dt}=Ae.current;let nt=null;if(fe&&Dt){const{cancelDrop:dn}=q.current;nt={activatorEvent:ie,active:fe,collisions:me,delta:Dt,over:Re},ue===vt.DragEnd&&typeof dn=="function"&&(yield Promise.resolve(dn(nt)))&&(ue=vt.DragCancel)}Y.current=null,pt.unstable_batchedUpdates(()=>{S({type:ue}),y(ir.Uninitialized),So(null),$(null),H(null),Fe.current=null;const dn=ue===vt.DragEnd?"onDragEnd":"onDragCancel";if(nt){const Sn=q.current[dn];Sn==null||Sn(nt),I({type:dn,event:nt})}})})}}},[_]),Ao=w.useCallback((wt,P)=>(L,K)=>{const J=L.nativeEvent,ie=_.get(K);if(Y.current!==null||!ie||J.dndKit||J.defaultPrevented)return;const ce={active:ie};wt(L,P.options,ce)===!0&&(J.dndKit={capturedBy:P.sensor},Y.current=K,gi(L,P))},[_,gi]),Ms=tN(d,Ao);cN(d),ln(()=>{re&&C===ir.Initializing&&y(ir.Initialized)},[re,C]),w.useEffect(()=>{const{onDragMove:wt}=q.current,{active:P,activatorEvent:L,collisions:K,over:J}=Ae.current;if(!P||!L)return;const ie={active:P,activatorEvent:L,collisions:K,delta:{x:Mt.x,y:Mt.y},over:J};pt.unstable_batchedUpdates(()=>{wt==null||wt(ie),I({type:"onDragMove",event:ie})})},[Mt.x,Mt.y]),w.useEffect(()=>{const{active:wt,activatorEvent:P,collisions:L,droppableContainers:K,scrollAdjustedTranslate:J}=Ae.current;if(!wt||Y.current==null||!P||!J)return;const{onDragOver:ie}=q.current,ce=K.get(Ls),we=ce&&ce.rect.current?{id:ce.id,rect:ce.rect.current,data:ce.data,disabled:ce.disabled}:null,ue={active:wt,activatorEvent:P,collisions:L,delta:{x:J.x,y:J.y},over:we};pt.unstable_batchedUpdates(()=>{So(we),ie==null||ie(ue),I({type:"onDragOver",event:ue})})},[Ls]),ln(()=>{Ae.current={activatorEvent:B,active:j,activeNode:se,collisionRect:qt,collisions:or,droppableRects:U,draggableNodes:_,draggingNode:ct,draggingNodeRect:Pt,droppableContainers:G,over:In,scrollableAncestors:Ee,scrollAdjustedTranslate:Mt},T.current={initial:Pt,translated:qt}},[j,se,or,qt,_,ct,Pt,U,G,In,Ee,Mt]),J$(Q(N({},X),{delta:D,draggingRect:qt,pointerCoordinates:_e,scrollableAncestors:Ee,scrollableAncestorRects:He}));const mi=w.useMemo(()=>({active:j,activeNode:se,activeNodeRect:re,activatorEvent:B,collisions:or,containerNodeRect:ge,dragOverlay:It,draggableNodes:_,droppableContainers:G,droppableRects:U,over:In,measureDroppableContainers:V,scrollableAncestors:Ee,scrollableAncestorRects:He,measuringConfiguration:M,measuringScheduled:ne,windowRect:Ce}),[j,se,re,B,or,ge,It,_,G,U,In,V,Ee,He,M,ne,Ce]),To=w.useMemo(()=>({activatorEvent:B,activators:Ms,active:j,activeNodeRect:re,ariaDescribedById:{draggable:ee},dispatch:S,draggableNodes:_,over:In,measureDroppableContainers:V}),[B,Ms,j,re,S,ee,_,In,V]);return w.createElement(Iv.Provider,{value:x},w.createElement(Io.Provider,{value:To},w.createElement(qv.Provider,{value:mi},w.createElement(_s.Provider,{value:$u},c)),w.createElement(bN,{disabled:(s==null?void 0:s.restoreFocus)===!1})),w.createElement(w$,Q(N({},s),{hiddenTextDescribedById:ee})));function un(){const wt=(z==null?void 0:z.autoScrollEnabled)===!1,P=typeof l=="object"?l.enabled===!1:l===!1,L=A&&!wt&&!P;return typeof l=="object"?Q(N({},l),{enabled:L}):{enabled:L}}}),CN=w.createContext(null),Xv="button",wN="Draggable";function IN(e){let{id:t,data:n,disabled:r=!1,attributes:i}=e;const o=vo(wN),{activators:a,activatorEvent:s,active:l,activeNodeRect:c,ariaDescribedById:d,draggableNodes:f,over:h}=w.useContext(Io),{role:p=Xv,roleDescription:m="draggable",tabIndex:g=0}=i!=null?i:{},v=(l==null?void 0:l.id)===t,S=w.useContext(v?_s:CN),[I,x]=vs(),[C,y]=vs(),A=uN(a,t),E=go(n);ln(()=>(f.set(t,{id:t,key:o,node:I,activatorNode:C,data:E}),()=>{const D=f.get(t);D&&D.key===o&&f.delete(t)}),[f,t]);const _=w.useMemo(()=>({role:p,tabIndex:g,"aria-disabled":r,"aria-pressed":v&&p===Xv?!0:void 0,"aria-roledescription":m,"aria-describedby":d.draggable}),[r,p,g,v,m,d.draggable]);return{active:l,activatorEvent:s,activeNodeRect:c,attributes:_,isDragging:v,listeners:r?void 0:A,node:I,over:h,setNodeRef:x,setActivatorNodeRef:y,transform:S}}function Zv(){return w.useContext(qv)}const SN="Droppable",AN={timeout:25};function TN(e){let{data:t,disabled:n=!1,id:r,resizeObserverConfig:i}=e;const o=vo(SN),{active:a,dispatch:s,over:l,measureDroppableContainers:c}=w.useContext(Io),d=w.useRef({disabled:n}),f=w.useRef(!1),h=w.useRef(null),p=w.useRef(null),{disabled:m,updateMeasurementsFor:g,timeout:v}=N(N({},AN),i),S=go(g!=null?g:r),I=w.useCallback(()=>{if(!f.current){f.current=!0;return}p.current!=null&&clearTimeout(p.current),p.current=setTimeout(()=>{c(Array.isArray(S.current)?S.current:[S.current]),p.current=null},v)},[v]),x=Es({callback:I,disabled:m||!a}),C=w.useCallback((_,D)=>{x&&(D&&(x.unobserve(D),f.current=!1),_&&x.observe(_))},[x]),[y,A]=vs(C),E=go(t);return w.useEffect(()=>{!x||!y.current||(x.disconnect(),f.current=!1,x.observe(y.current))},[y,x]),w.useEffect(()=>(s({type:vt.RegisterDroppable,element:{id:r,key:o,disabled:n,node:y,rect:h,data:E}}),()=>s({type:vt.UnregisterDroppable,key:o,id:r})),[r]),w.useEffect(()=>{n!==d.current.disabled&&(s({type:vt.SetDroppableDisabled,id:r,key:o,disabled:n}),d.current.disabled=n)},[r,o,n,s]),{active:a,rect:h,isOver:(l==null?void 0:l.id)===r,node:y,over:l,setNodeRef:A}}function EN(e){let{animation:t,children:n}=e;const[r,i]=w.useState(null),[o,a]=w.useState(null),s=bs(n);return!n&&!r&&s&&i(s),ln(()=>{if(!o)return;const l=r==null?void 0:r.key,c=r==null?void 0:r.props.id;if(l==null||c==null){i(null);return}Promise.resolve(t(c,o)).then(()=>{i(null)})},[t,r,o]),w.createElement(w.Fragment,null,n,r?w.cloneElement(r,{ref:a}):null)}const kN={x:0,y:0,scaleX:1,scaleY:1};function _N(e){let{children:t}=e;return w.createElement(Io.Provider,{value:Kv},w.createElement(_s.Provider,{value:kN},t))}const PN={position:"fixed",touchAction:"none"},DN=e=>ys(e)?"transform 250ms ease":void 0,ON=w.forwardRef((e,t)=>{let{as:n,activatorEvent:r,adjustScale:i,children:o,className:a,rect:s,style:l,transform:c,transition:d=DN}=e;if(!s)return null;const f=i?c:Q(N({},c),{scaleX:1,scaleY:1}),h=N(Q(N({},PN),{width:s.width,height:s.height,top:s.top,left:s.left,transform:Vn.Transform.toString(f),transformOrigin:i&&r?S$(r,s):void 0,transition:typeof d=="function"?d(r):d}),l);return w.createElement(n,{className:a,style:h,ref:t},o)}),eb=e=>t=>{let{active:n,dragOverlay:r}=t;const i={},{styles:o,className:a}=e;if(o!=null&&o.active)for(const[s,l]of Object.entries(o.active))l!==void 0&&(i[s]=n.node.style.getPropertyValue(s),n.node.style.setProperty(s,l));if(o!=null&&o.dragOverlay)for(const[s,l]of Object.entries(o.dragOverlay))l!==void 0&&r.node.style.setProperty(s,l);return a!=null&&a.active&&n.node.classList.add(a.active),a!=null&&a.dragOverlay&&r.node.classList.add(a.dragOverlay),function(){for(const[l,c]of Object.entries(i))n.node.style.setProperty(l,c);a!=null&&a.active&&n.node.classList.remove(a.active)}},RN={duration:250,easing:"ease",keyframes:e=>{let{transform:{initial:t,final:n}}=e;return[{transform:Vn.Transform.toString(t)},{transform:Vn.Transform.toString(n)}]},sideEffects:eb({styles:{active:{opacity:"0"}}})};function LN(e){let{config:t,draggableNodes:n,droppableContainers:r,measuringConfiguration:i}=e;return ms((o,a)=>{if(t===null)return;const s=n.get(o);if(!s)return;const l=s.node.current;if(!l)return;const c=Yv(a);if(!c)return;const{transform:d}=Lt(a).getComputedStyle(a),f=kv(d);if(!f)return;const h=typeof t=="function"?t:MN(t);return Bv(l,i.draggable.measure),h({active:{id:o,data:s.data,node:l,rect:i.draggable.measure(l)},draggableNodes:n,dragOverlay:{node:a,rect:i.dragOverlay.measure(c)},droppableContainers:r,measuringConfiguration:i,transform:f})})}function MN(e){const{duration:t,easing:n,sideEffects:r,keyframes:i}=N(N({},RN),e);return o=>{let I=o,{active:a,dragOverlay:s,transform:l}=I,c=We(I,["active","dragOverlay","transform"]);if(!t)return;const d={x:s.rect.left-a.rect.left,y:s.rect.top-a.rect.top},f={scaleX:l.scaleX!==1?a.rect.width*l.scaleX/s.rect.width:1,scaleY:l.scaleY!==1?a.rect.height*l.scaleY/s.rect.height:1},h=N({x:l.x-d.x,y:l.y-d.y},f),p=i(Q(N({},c),{active:a,dragOverlay:s,transform:{initial:l,final:h}})),[m]=p,g=p[p.length-1];if(JSON.stringify(m)===JSON.stringify(g))return;const v=r==null?void 0:r(N({active:a,dragOverlay:s},c)),S=s.node.animate(p,{duration:t,easing:n,fill:"forwards"});return new Promise(x=>{S.onfinish=()=>{v==null||v(),x()}})}}let tb=0;function BN(e){return w.useMemo(()=>{if(e!=null)return tb++,tb},[e])}const $N=w.memo(e=>{let{adjustScale:t=!1,children:n,dropAnimation:r,style:i,transition:o,modifiers:a,wrapperElement:s="div",className:l,zIndex:c=999}=e;const{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggableNodes:m,droppableContainers:g,dragOverlay:v,over:S,measuringConfiguration:I,scrollableAncestors:x,scrollableAncestorRects:C,windowRect:y}=Zv(),A=w.useContext(_s),E=BN(f==null?void 0:f.id),_=Qv(a,{activatorEvent:d,active:f,activeNodeRect:h,containerNodeRect:p,draggingNodeRect:v.rect,over:S,overlayNodeRect:v.rect,scrollableAncestors:x,scrollableAncestorRects:C,transform:A,windowRect:y}),D=Lu(h),G=LN({config:r,draggableNodes:m,droppableContainers:g,measuringConfiguration:I}),F=D?v.setRef:void 0;return w.createElement(_N,null,w.createElement(EN,{animation:G},f&&E?w.createElement(ON,{key:E,id:f.id,ref:F,as:s,activatorEvent:d,adjustScale:t,className:l,transition:o,rect:D,style:N({zIndex:c},i),transform:_},n):null))});function Ps(e,t,n){const r=e.slice();return r.splice(n<0?r.length+n:n,0,r.splice(t,1)[0]),r}function NN(e,t){return e.reduce((n,r,i)=>{const o=t.get(r);return o&&(n[i]=o),n},Array(e.length))}function Ds(e){return e!==null&&e>=0}function FN(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function zN(e){return typeof e=="boolean"?{draggable:e,droppable:e}:e}const nb=e=>{let{rects:t,activeIndex:n,overIndex:r,index:i}=e;const o=Ps(t,r,n),a=t[i],s=o[i];return!s||!a?null:{x:s.left-a.left,y:s.top-a.top,scaleX:s.width/a.width,scaleY:s.height/a.height}},rb="Sortable",ib=w.createContext({activeIndex:-1,containerId:rb,disableTransforms:!1,items:[],overIndex:-1,useDragOverlay:!1,sortedRects:[],strategy:nb,disabled:{draggable:!1,droppable:!1}});function ob(e){let{children:t,id:n,items:r,strategy:i=nb,disabled:o=!1}=e;const{active:a,dragOverlay:s,droppableRects:l,over:c,measureDroppableContainers:d}=Zv(),f=vo(rb,n),h=s.rect!==null,p=w.useMemo(()=>r.map(A=>typeof A=="object"&&"id"in A?A.id:A),[r]),m=a!=null,g=a?p.indexOf(a.id):-1,v=c?p.indexOf(c.id):-1,S=w.useRef(p),I=!FN(p,S.current),x=v!==-1&&g===-1||I,C=zN(o);ln(()=>{I&&m&&d(p)},[I,p,m,d]),w.useEffect(()=>{S.current=p},[p]);const y=w.useMemo(()=>({activeIndex:g,containerId:f,disabled:C,disableTransforms:x,items:p,overIndex:v,useDragOverlay:h,sortedRects:NN(p,l),strategy:i}),[g,f,C.draggable,C.droppable,x,p,v,l,h,i]);return w.createElement(ib.Provider,{value:y},t)}const jN=e=>{let{id:t,items:n,activeIndex:r,overIndex:i}=e;return Ps(n,r,i).indexOf(t)},UN=e=>{let{containerId:t,isSorting:n,wasDragging:r,index:i,items:o,newIndex:a,previousItems:s,previousContainerId:l,transition:c}=e;return!c||!r||s!==o&&i===a?!1:n?!0:a!==i&&t===l},VN={duration:200,easing:"ease"},ab="transform",HN=Vn.Transition.toString({property:ab,duration:0,easing:"linear"}),WN={roleDescription:"sortable"};function GN(e){let{disabled:t,index:n,node:r,rect:i}=e;const[o,a]=w.useState(null),s=w.useRef(n);return ln(()=>{if(!t&&n!==s.current&&r.current){const l=i.current;if(l){const c=pi(r.current,{ignoreTransform:!0}),d={x:l.left-c.left,y:l.top-c.top,scaleX:l.width/c.width,scaleY:l.height/c.height};(d.x||d.y)&&a(d)}}n!==s.current&&(s.current=n)},[t,n,r,i]),w.useEffect(()=>{o&&a(null)},[o]),o}function sb(e){let{animateLayoutChanges:t=UN,attributes:n,disabled:r,data:i,getNewIndex:o=jN,id:a,strategy:s,resizeObserverConfig:l,transition:c=VN}=e;const{items:d,containerId:f,activeIndex:h,disabled:p,disableTransforms:m,sortedRects:g,overIndex:v,useDragOverlay:S,strategy:I}=w.useContext(ib),x=YN(r,p),C=d.indexOf(a),y=w.useMemo(()=>N({sortable:{containerId:f,index:C,items:d}},i),[f,i,C,d]),A=w.useMemo(()=>d.slice(d.indexOf(a)),[d,a]),{rect:E,node:_,isOver:D,setNodeRef:G}=TN({id:a,data:y,disabled:x.droppable,resizeObserverConfig:N({updateMeasurementsFor:A},l)}),{active:F,activatorEvent:T,activeNodeRect:j,attributes:Y,setNodeRef:z,listeners:$,isDragging:B,over:H,setActivatorNodeRef:q,transform:ee}=IN({id:a,data:y,attributes:N(N({},WN),n),disabled:x.draggable}),R=c$(G,z),M=!!F,U=M&&!m&&Ds(h)&&Ds(v),V=!S&&B,ne=V&&U?ee:null,se=s!=null?s:I,ae=U?ne!=null?ne:se({rects:g,activeNodeRect:j,activeIndex:h,overIndex:v,index:C}):null,X=Ds(h)&&Ds(v)?o({id:a,items:d,activeIndex:h,overIndex:v}):C,le=F==null?void 0:F.id,re=w.useRef({activeId:le,items:d,newIndex:X,containerId:f}),ge=d!==re.current.items,Ae=t({active:F,containerId:f,isDragging:B,isSorting:M,id:a,index:C,items:d,newIndex:re.current.newIndex,previousItems:re.current.items,previousContainerId:re.current.containerId,transition:c,wasDragging:re.current.activeId!=null}),Ve=GN({disabled:!Ae,index:C,node:_,rect:E});return w.useEffect(()=>{M&&re.current.newIndex!==X&&(re.current.newIndex=X),f!==re.current.containerId&&(re.current.containerId=f),d!==re.current.items&&(re.current.items=d)},[M,X,f,d]),w.useEffect(()=>{if(le===re.current.activeId)return;if(le!=null&&re.current.activeId==null){re.current.activeId=le;return}const ct=setTimeout(()=>{re.current.activeId=le},50);return()=>clearTimeout(ct)},[le]),{active:F,activeIndex:h,attributes:Y,data:y,rect:E,index:C,newIndex:X,items:d,isOver:D,isSorting:M,isDragging:B,listeners:$,node:_,overIndex:v,over:H,setNodeRef:R,setActivatorNodeRef:q,setDroppableNodeRef:G,setDraggableNodeRef:z,transform:Ve!=null?Ve:ae,transition:It()};function It(){if(Ve||ge&&re.current.newIndex===C)return HN;if(!(V&&!ys(T)||!c)&&(M||Ae))return Vn.Transition.toString(Q(N({},c),{property:ab}))}}function YN(e,t){var n,r;return typeof e=="boolean"?{draggable:e,droppable:!1}:{draggable:(n=e==null?void 0:e.draggable)!=null?n:t.draggable,droppable:(r=e==null?void 0:e.droppable)!=null?r:t.droppable}}function Os(e){if(!e)return!1;const t=e.data.current;return!!(t&&"sortable"in t&&typeof t.sortable=="object"&&"containerId"in t.sortable&&"items"in t.sortable&&"index"in t.sortable)}const KN=[Pe.Down,Pe.Right,Pe.Up,Pe.Left],lb=(e,t)=>{let{context:{active:n,collisionRect:r,droppableRects:i,droppableContainers:o,over:a,scrollableAncestors:s}}=t;if(KN.includes(e.code)){if(e.preventDefault(),!n||!r)return;const l=[];o.getEnabled().forEach(f=>{if(!f||f!=null&&f.disabled)return;const h=i.get(f.id);if(h)switch(e.code){case Pe.Down:r.top<h.top&&l.push(f);break;case Pe.Up:r.top>h.top&&l.push(f);break;case Pe.Left:r.left>h.left&&l.push(f);break;case Pe.Right:r.left<h.left&&l.push(f);break}});const c=E$({active:n,collisionRect:r,droppableRects:i,droppableContainers:l,pointerCoordinates:null});let d=Tv(c,"id");if(d===(a==null?void 0:a.id)&&c.length>1&&(d=c[1].id),d!=null){const f=o.get(n.id),h=o.get(d),p=h?i.get(h.id):null,m=h==null?void 0:h.node.current;if(m&&p&&f&&h){const v=Is(m).some((A,E)=>s[E]!==A),S=cb(f,h),I=qN(f,h),x=v||!S?{x:0,y:0}:{x:I?r.width-p.width:0,y:I?r.height-p.height:0},C={x:p.left,y:p.top};return x.x&&x.y?C:bo(C,x)}}}};function cb(e,t){return!Os(e)||!Os(t)?!1:e.data.current.sortable.containerId===t.data.current.sortable.containerId}function qN(e,t){return!Os(e)||!Os(t)||!cb(e,t)?!1:e.data.current.sortable.index<t.data.current.sortable.index}const ub=Ue(u.jsx("path",{d:"M11 18c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2m-2-8c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0-6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m6 4c1.1 0 2-.9 2-2s-.9-2-2-2-2 .9-2 2 .9 2 2 2m0 2c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2m0 6c-1.1 0-2 .9-2 2s.9 2 2 2 2-.9 2-2-.9-2-2-2"}),"DragIndicator"),Rs=w.createContext({attributes:{},listeners:void 0,ref(){}}),QN=()=>{const{attributes:e,listeners:t,ref:n}=w.useContext(Rs);return u.jsx(b.Button,Q(N(N({sx:{backgroundColor:"transparent",color:"#919eab",width:"10px",":hover":{backgroundColor:"transparent"},":active":{backgroundColor:"transparent"}}},e),t),{ref:n,children:u.jsx(ub,{})}))},db=({children:e,id:t,tooltipTitle:n,removeItem:r,useDraggable:i=!0,variant:o="plain"})=>{const{attributes:a,isDragging:s,listeners:l,setNodeRef:c,setActivatorNodeRef:d,transform:f,transition:h}=sb({id:t}),p=w.useMemo(()=>({attributes:a,listeners:l,ref:d}),[a,l,d]),m={opacity:s?.6:void 0,transform:Vn.Translate.toString(f),transition:h};return u.jsx(Rs.Provider,{value:p,children:u.jsx(b.ListItem,{variant:o,ref:c,style:m,startAction:i?u.jsx(QN,{}):u.jsx(u.Fragment,{}),endAction:i?u.jsx(b.Tooltip,{title:n,children:u.jsx(b.Button,{variant:"outlined",color:"danger",onClick:r,sx:{ml:"auto",p:.5},size:"sm",children:u.jsx(ke.Remove,{})})}):u.jsx(u.Fragment,{}),sx:{p:2,borderRadius:"sm"},children:e})})},JN={sideEffects:eb({styles:{active:{opacity:"0.6"}}})},fb=({children:e})=>u.jsx($N,{dropAnimation:JN,children:e}),XN=({entities:e=[],labels:t,disabled:n,setEntities:r,removeItem:i})=>{const[o,a]=w.useState(null),s=w.useMemo(()=>e.find(c=>c.id===(o==null?void 0:o.id)),[o,e]),l=Sv(ws(As),ws(Ss,{coordinateGetter:lb}));return u.jsxs(Jv,{sensors:l,onDragStart:({active:c})=>{a(c)},onDragEnd:({active:c,over:d})=>{if(d&&c.id!==(d==null?void 0:d.id)){const f=e.findIndex(({id:p})=>p===c.id),h=e.findIndex(({id:p})=>p===d.id);r(Ps(e,f,h))}a(null)},onDragCancel:()=>{a(null)},children:[u.jsx(ob,{items:e,children:u.jsx(b.List,{sx:{gap:"10px",padding:0},children:e.map(c=>u.jsxs(db,{id:c.id,variant:"outlined",removeItem:()=>i(c.id),tooltipTitle:t.removeEntity,useDraggable:!n,children:[u.jsx(b.Typography,{ml:n?0:2.5,children:c.title||c.name}),c.type&&u.jsx(b.Chip,{color:mB(c.type),sx:{marginLeft:2,marginRight:4},children:vB(c.type)})]},`sortable-item-${c.id}`))})}),u.jsx(fb,{children:s?u.jsx(u.Fragment,{children:e.map(c=>u.jsx(db,{id:c.id,useDraggable:!1,removeItem:()=>{},tooltipTitle:t.removeEntity},`sortable-overlay-item-${c.id}`))}):u.jsx(u.Fragment,{})})]})},ZN=({labels:e,value:t,options:n,size:r="sm",disabled:i=!1,sx:o={},onChange:a})=>u.jsxs(b.FormControl,{size:r,disabled:i,children:[u.jsx(b.FormLabel,{children:e.itemsPerPage}),u.jsx(b.Select,{value:t,size:r,onChange:a,sx:Q(N({},o),{minHeight:"37px"}),children:n.map((s,l)=>u.jsx(b.Option,{value:s,children:s},`items-per-page-${s}-${l}`))})]}),eF=(e,t)=>{const[n,r]=w.useState(null),{sdk:i}=at(),o=()=>k(this,null,function*(){let s=[];if(!e){r(s);return}try{switch(e){case"top_x":s=(yield i.topX.getGames({limit:50},!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break;case"match_quiz":s=(yield i.matchQuiz.getGames({limit:50},!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break;case"template":s=(yield i.loyalty.getTemplates(void 0,!0)).data.map(v=>({id:v.id,name:v.name,status:v.status,type:e,relationship:"relatedTo"}));break;case"classic_quiz":s=(yield i.miniGames.getClassicQuizzes({limit:50},!1,!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break;case"either_or":s=(yield i.miniGames.getEitherOrs({limit:50},!1,!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break;case"poll":s=(yield i.voting.getPolls({limit:50},!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break;case"bracket":s=(yield i.bracketGame.getGames({limit:50},!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break;case"standing":s=(yield i.standingGame.getGames({limit:50},!0)).data.map(v=>({id:v.id,name:v.title,status:v.status,type:e,relationship:"relatedTo"}));break}}catch(l){console.error(l),r(s),t();return}r(s)});return w.useEffect(()=>(o(),()=>r(null)),[e]),n},tF=({status:e})=>{let t="neutral";switch(e){case"DYNAMIC":t="primary";break;case"CUSTOM":t="success";break;case"OPEN":t="primary";break;case"LIVE":t="primary";break;case"CANCELED":t="warning";break;case"SETTLED":t="success";break;case"INACTIVE":t="danger";break;case"ACTIVE":t="success";break;case"EXPIRED":t="neutral";break}return u.jsx(b.Chip,{color:t,variant:"solid",size:"sm",children:e})},nF=Ue(u.jsx("path",{d:"M12.16 3h-.32L9.21 8.25h5.58zm4.3 5.25h5.16L19 3h-5.16zm4.92 1.5h-8.63V20.1zM11.25 20.1V9.75H2.62zM7.54 8.25 10.16 3H5L2.38 8.25z"}),"Diamond"),rF=Ue(u.jsx("path",{d:"m21.58 16.09-1.09-7.66C20.21 6.46 18.52 5 16.53 5H7.47C5.48 5 3.79 6.46 3.51 8.43l-1.09 7.66C2.2 17.63 3.39 19 4.94 19c.68 0 1.32-.27 1.8-.75L9 16h6l2.25 2.25c.48.48 1.13.75 1.8.75 1.56 0 2.75-1.37 2.53-2.91M11 11H9v2H8v-2H6v-1h2V8h1v2h2zm4-1c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1m2 3c-.55 0-1-.45-1-1s.45-1 1-1 1 .45 1 1-.45 1-1 1"}),"SportsEsports"),iF=Ue(u.jsx("path",{d:"M11.07 12.85c.77-1.39 2.25-2.21 3.11-3.44.91-1.29.4-3.7-2.18-3.7-1.69 0-2.52 1.28-2.87 2.34L6.54 6.96C7.25 4.83 9.18 3 11.99 3c2.35 0 3.96 1.07 4.78 2.41.7 1.15 1.11 3.3.03 4.9-1.2 1.77-2.35 2.31-2.97 3.45-.25.46-.35.76-.35 2.24h-2.89c-.01-.78-.13-2.05.48-3.15M14 20c0 1.1-.9 2-2 2s-2-.9-2-2 .9-2 2-2 2 .9 2 2"}),"QuestionMark"),oF=Ue(u.jsx("path",{d:"M9.01 14H2v2h7.01v3L13 15l-3.99-4zm5.98-1v-3H22V8h-7.01V5L11 9z"}),"CompareArrows"),aF=Ue(u.jsx("path",{d:"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2M9 17H7v-7h2zm4 0h-2V7h2zm4 0h-2v-4h2z"}),"Poll"),sF=e=>{switch(e.entityType){case"top_x":return u.jsx(b.Tooltip,{title:"Top X",children:u.jsx(nF,{})});case"match_quiz":return u.jsx(b.Tooltip,{title:"Match Quiz",children:u.jsx(rF,{})});case"template":return u.jsx(b.Tooltip,{title:"Leaderboard Templates",children:u.jsx(ke.EmojiEvents,{})});case"classic_quiz":return u.jsx(b.Tooltip,{title:"Classic Quiz",children:u.jsx(iF,{})});case"either_or":return u.jsx(b.Tooltip,{title:"Either/Or",children:u.jsx(oF,{})});case"poll":return u.jsx(b.Tooltip,{title:"Poll",children:u.jsx(aF,{})});case"bracket":return u.jsx(b.Tooltip,{title:"Custom Bracket Game",children:u.jsx(ke.EmojiEvents,{})});case"standing":return u.jsx(b.Tooltip,{title:"Custom Standings Game",children:u.jsx(ke.EmojiEvents,{})});default:return null}},lF=({entity:e,deleteLabel:t,onDelete:n})=>u.jsx(u.Fragment,{children:u.jsx(b.Card,{sx:{p:2,mb:2},children:u.jsx(b.CardContent,{children:u.jsxs(b.Box,{sx:{display:"flex",flexDirection:{xs:"column",md:"row"},alignItems:"center",justifyContent:"space-between"},children:[u.jsx(b.Typography,{fontSize:"sm",startDecorator:u.jsx(sF,{entityType:e.type}),children:e.name}),u.jsx(b.Box,{display:{xs:"none",md:"block"},children:u.jsx(tF,{status:e.status})}),u.jsx(b.Box,{children:u.jsx(b.Tooltip,{title:t,children:u.jsx(b.IconButton,{onClick:()=>n(e.id,e.relationship),color:"danger",size:"sm",children:u.jsx(ke.Delete,{})})})})]})})})}),cF=(e,t,n,r)=>k(this,null,function*(){let o=[];const a=new Map;t.forEach(s=>{if(a.has(s.entity_type)){const l=a.get(s.entity_type);a.set(s.entity_type,[...l,[s.entity_id,s.entity_relationship]])}else a.set(s.entity_type,[[s.entity_id,s.entity_relationship]])});try{for(const[s,l]of a)switch(s){case"top_x":const c=l.map(([D])=>D),d=yield e.topX.getGames({limit:c.length,gameIds:c},!0);o=[...o,...d.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"match_quiz":const f=l.map(([D])=>D),h=yield e.matchQuiz.getGames({limit:f.length,gameIds:f},!0);o=[...o,...h.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"template":const p=l.map(([D])=>D),m=yield e.loyalty.getTemplates(void 0,!0);o=[...o,...m.data.filter(D=>p.includes(D.id)).map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"classic_quiz":const g=l.map(([D])=>D),v=yield e.miniGames.getClassicQuizzes({limit:g.length,classicQuizIds:g},!1,!0);o=[...o,...v.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"either_or":const S=l.map(([D])=>D),I=yield e.miniGames.getEitherOrs({limit:S.length,eitherOrIds:S},!1,!0);o=[...o,...I.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"poll":const x=l.map(([D])=>D),C=yield e.voting.getPolls({limit:x.length,pollIds:x},!0);o=[...o,...C.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"bracket":const y=l.map(([D])=>D),A=yield e.bracketGame.getGames({limit:y.length,gameIds:y},!0);o=[...o,...A.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;case"standing":const E=l.map(([D])=>D),_=yield e.standingGame.getGames({limit:E.length,gameIds:E},!0);o=[...o,..._.data.map(D=>{var F;const G=((F=l.find(([T])=>T===D.id))==null?void 0:F[1])||"relatedTo";return{id:D.id,name:D.title,status:D.status,type:s,relationship:G}})];break;default:}}catch(s){console.error("Error loading related entities",s),n(o),r()}n(o)}),uF=["top_x","match_quiz","template","classic_quiz","poll","either_or","bracket","standing"],dF=["relatedTo","blocks","blockedBy","bonusPointsGame","nextInSeries","previousInSeries"],fF=new Map().set("template","Leaderboard Templates").set("classic_quiz","Classic Quiz").set("either_or","Either/Or").set("match_quiz","Match Quiz").set("top_x","Top X").set("bracket","Custom Bracket Game").set("standing","Custom Standing Game").set("poll","Poll"),hb=new Map().set("relatedTo","Related to").set("blocks","Blocks").set("blockedBy","Blocked by").set("nextInSeries","Next in series").set("previousInSeries","Previous in series").set("bonusPointsGame","Bonus points game"),hF=({defaultValue:e=[],onChange:t,labels:n})=>{const[r,i]=w.useState([]),[o,a]=w.useState(""),[s,l]=w.useState(null),[c,d]=w.useState("relatedTo"),[f,h]=w.useState(!1),p=()=>h(!f),m=eF(s,p),{sdk:g}=at();w.useEffect(()=>(e.length>0&&cF(g,e,i,p),()=>{i([]),a(""),l(null),d("relatedTo")}),[]);const v=()=>{if(e.some(E=>E.entity_id===o&&E.entity_relationship===c)){a("");return}const y=[...e,{entity_id:o,entity_type:s,entity_relationship:c}],A=(m==null?void 0:m.filter(E=>E.id===o).map(E=>({id:E.id,name:E.name,type:s,status:E.status,relationship:c})))||[];i([...r,...A]),t(y),a("")},S=(C,y)=>{const A=e.filter(_=>!(_.entity_id===C&&_.entity_relationship===y)),E=r.filter(_=>!(_.id===C&&_.relationship===y));i(E),t(A)},I=r.reduce((C,y)=>{const A=y.relationship;return C[A]||(C[A]=[]),C[A].push(y),C},{}),x=Object.keys(I).sort();return u.jsxs(u.Fragment,{children:[x.map(C=>u.jsxs(b.Box,{sx:{mb:2},children:[u.jsx(b.Typography,{level:"title-md",sx:{fontWeight:"bold",mb:1},children:u.jsx(b.Chip,{variant:"outlined",size:"md",sx:{bgcolor:"background.surface"},children:hb.get(C)||"Unknown relationship"})}),I[C].map((y,A)=>u.jsx(lF,{entity:y,deleteLabel:n.delete,onDelete:S},`related-entity-relationship-${y.id}-${A}`))]},`relationship-group-${C}`)),u.jsxs(b.Box,{sx:{display:"flex",flexDirection:"column",width:"100%",gap:1},children:[u.jsxs(b.FormControl,{children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:n.type}),u.jsx(b.Select,{value:s,size:"sm",name:"entity_type",onChange:(C,y)=>l(y),sx:{minHeight:"37px"},children:uF.map(C=>u.jsx(b.Option,{value:C,children:fF.get(C)},`entity-type-option-${C}`))})]}),u.jsxs(b.FormControl,{children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:n.relationship}),u.jsx(b.Select,{value:c,size:"sm",name:"entity_relationship",onChange:(C,y)=>d(y),sx:{minHeight:"37px"},children:dF.map(C=>u.jsx(b.Option,{value:C,children:hb.get(C)},`entity-relationship-option-${C}`))})]}),u.jsxs(b.FormControl,{children:[u.jsx(b.FormLabel,{required:!0,color:"primary",children:n.entity}),u.jsx(b.Select,{value:o,size:"sm",name:"entity_id",onChange:(C,y)=>a(y),sx:{width:"100%",mr:{xs:0,md:1},mb:{xs:1,md:0},minHeight:"37px"},endDecorator:!m&&u.jsx(b.CircularProgress,{size:"sm"}),children:m&&m.map(C=>u.jsx(b.Option,{value:C.id,children:C.name},`entity--${C.id}`))})]}),u.jsx(b.Button,{startDecorator:u.jsx(ke.Add,{}),disabled:!o||!s,onClick:v,sx:{mb:1},children:n.add})]}),u.jsx(st,{showToast:f,message:n.relatedEntitiesErrorMessage,color:"danger",hideToast:p})]})},pF=e=>{const[t,n]=w.useState(!1),[r,i]=w.useState(!1),[o,a]=w.useState("success"),[s,l]=w.useState(""),c=w.useContext(ea),d=(h,p)=>{a(h),l(p),i(!0)},f=()=>k(this,null,function*(){n(!0);const h=yield c==null?void 0:c.https.exportLeadsPerEntity(e.entityId);if(h!=null&&h.ok){const p=yield h.blob(),m=URL.createObjectURL(p),g=document.createElement("a");g.href=m,g.download=`${e.entityType}_${e.entityName}_exported_users_leads.csv`,document.body.appendChild(g),g.click(),document.body.removeChild(g),URL.revokeObjectURL(m),n(!1),d("success",e.labels.usersLeadsExportMessage)}else console.error("Failed to export all users leads: ",yield h==null?void 0:h.json()),n(!1),d("danger",e.labels.usersLeadsExportErrorMessage)});return u.jsxs(u.Fragment,{children:[u.jsxs(b.Box,{mb:2,children:[u.jsx(b.Box,{display:"flex",alignItems:"center",mb:1,children:u.jsx(b.Typography,{level:"body-lg",sx:{mx:"auto"},children:e.labels.exportUsersLeads})}),u.jsx(b.Sheet,{sx:{overflowX:"auto",minWidth:"700px"},children:u.jsxs(b.Table,{variant:"outlined",hoverRow:!1,borderAxis:"bothBetween",size:"sm",sx:{backgroundColor:"#fff","& > thead > tr > th:first-child, & > tbody > tr > td:first-child":{textAlign:"left",width:"50%"},"--TableCell-paddingX":"0.5rem",cursor:"default","& > tbody > tr:hover":{backgroundColor:"transparent"},"& > thead > tr > th":{backgroundColor:"#fff",verticalAlign:"middle"},"& > thead > tr > th, & > tbody > tr > td":{textAlign:"right"}},children:[u.jsx("thead",{children:u.jsxs("tr",{children:[u.jsx("th",{children:e.labels.category}),u.jsx("th",{children:e.labels.action})]})}),u.jsx("tbody",{children:u.jsxs("tr",{children:[u.jsxs("td",{children:[u.jsx(b.Typography,{level:"body-sm",fontWeight:"600",children:e.labels.exportAllUsersLeads}),u.jsx(b.Typography,{level:"body-xs",color:"neutral",children:e.labels.exportAllUsersLeadsDescription})]}),u.jsx("td",{children:u.jsx(b.Button,{loading:t,onClick:f,children:e.labels.exportAllUsersLeads})})]})})]})})]}),u.jsx(st,{showToast:r,color:o,message:s,hideToast:()=>i(!1)})]})},gF=({tooltipContent:e="Drag to reorder"})=>{const{attributes:t,listeners:n,ref:r}=w.useContext(Rs);return u.jsx(b.Tooltip,{title:e,placement:"left",arrow:!0,children:u.jsx(b.IconButton,Q(N(N({variant:"plain",color:"neutral",size:"sm",sx:{color:"text.tertiary",my:"auto",mr:1,":hover":{bgcolor:"action.hover"},":active":{bgcolor:"action.selected"},transition:"all 0.2s",cursor:"grab","&:active":{cursor:"grabbing"}}},t),n),{ref:r,children:u.jsx(ub,{})}))})},pb=({id:e,useDraggable:t=!0,variant:n="outlined",item:r,tooltipContent:i})=>{const{attributes:o,isDragging:a,listeners:s,setNodeRef:l,setActivatorNodeRef:c,transform:d,transition:f}=sb({id:e}),h=w.useMemo(()=>({attributes:o,listeners:s,ref:c}),[o,s,c]),p={opacity:a?.6:void 0,transform:Vn.Translate.toString(d),transition:f},m=v=>v.split(" ").map(S=>S[0]).join("").toUpperCase().substring(0,2),g=v=>r!=null&&r.color?r.color:`hsl(${v.split("").reduce((x,C)=>C.charCodeAt(0)+((x<<5)-x),0)%360}, 70%, 80%)`;return u.jsx(Rs.Provider,{value:h,children:u.jsx(b.ListItem,{variant:n,ref:l,style:p,endAction:t?u.jsx(gF,{tooltipContent:i}):null,sx:{p:0,borderRadius:"md",overflow:"hidden",transition:"all 0.2s",boxShadow:a?"md":"sm",transform:`scale(${a?1.02:1})`,border:"1px solid",borderColor:"divider"},children:u.jsxs(b.Box,{sx:{display:"flex",width:"100%",alignItems:"center",gap:2,p:0},children:[u.jsx(b.Sheet,{sx:{width:"8px",alignSelf:"stretch",bgcolor:g(r.name)}}),u.jsx(b.Avatar,{src:r.image,alt:r.name,sx:{bgcolor:g(r.name),my:2,ml:1},children:m(r.name)}),u.jsxs(b.Box,{sx:{py:2,pr:2,flexGrow:1,display:"flex",flexDirection:"column",gap:.5},children:[u.jsx(b.Typography,{level:"title-md",children:r.name}),r.description&&u.jsx(b.Typography,{level:"body-sm",sx:{color:"text.secondary",textOverflow:"ellipsis"},children:r.description}),u.jsx(b.Box,{sx:{mt:.5},children:r.type&&u.jsx(b.Chip,{variant:"soft",color:"primary",size:"sm",sx:{px:1,bgcolor:`${g(r.type)}40`},children:r.type})})]})]})})})},mF=({items:e=[],labels:t,setItems:n})=>{const[r,i]=w.useState(null),o=w.useMemo(()=>e.find(s=>s.id===(r==null?void 0:r.id)),[r,e]),a=Sv(ws(As,{activationConstraint:{distance:8}}),ws(Ss,{coordinateGetter:lb}));return e.length===0?u.jsx(b.Box,{sx:{display:"flex",justifyContent:"center",alignItems:"center",height:"100px",border:"1px dashed",borderColor:"divider",borderRadius:"md"},children:u.jsx(b.Typography,{level:"body-lg",color:"neutral",children:(t==null?void 0:t.noItemsToDisplay)||"No items to display"})}):u.jsxs(Jv,{sensors:a,onDragStart:({active:s})=>{i(s)},onDragEnd:({active:s,over:l})=>{if(l&&s.id!==(l==null?void 0:l.id)){const c=e.findIndex(({id:f})=>f===s.id),d=e.findIndex(({id:f})=>f===l.id);n(Ps(e,c,d))}i(null)},onDragCancel:()=>{i(null)},children:[u.jsx(ob,{items:e,children:u.jsx(b.List,{sx:{gap:2,maxHeight:"70vh",overflowY:"auto","&::-webkit-scrollbar":{width:"8px"},"&::-webkit-scrollbar-thumb":{backgroundColor:"action.focus",borderRadius:"4px"}},children:e.map(s=>u.jsx(pb,{id:s.id,variant:"outlined",item:s,tooltipContent:t==null?void 0:t.dragToReorder},`sortable-item-${s.id}`))})}),u.jsx(fb,{children:o?u.jsx(pb,{id:o.id,useDraggable:!1,item:o,tooltipContent:t.dragToReorder},`sortable-overlay-item-${o.id}`):null})]})},vF=({entityType:e,entityId:t,authRequirement:n,labels:r})=>{const[i,o]=w.useState(!1),[a,s]=w.useState([]),[l,c]=w.useState("before"),[d,f]=w.useState(!1),[h,p]=w.useState(""),[m,g]=w.useState(""),v=`
|
|
2476
|
+
data-content-type="${e}"`,S=`
|
|
2477
|
+
data-content-id="${t}"`,I=a.length>0?`
|
|
2478
|
+
data-lead-fields="${a.join(", ")}"`:"",x=i?`
|
|
2479
|
+
data-lead-position="${l}"`:"",C=h?`
|
|
2480
|
+
data-campaign-id="${h}"`:"",y=m?`
|
|
2481
|
+
data-campaign-name="${m}"`:"",A=`<div
|
|
2482
|
+
data-component="fu-widget"${v}${S}${I}${x}${C}${y}
|
|
2483
|
+
></div>`,E={fullName:"Full name",firstName:"First name",lastName:"Last name",email:"Email",gender:"Gender",country:"Country",phoneCountryCode:"Phone country code",phoneNumber:"Phone number"},_=({title:F})=>u.jsx(b.Tooltip,{title:F,sx:{maxWidth:300},children:u.jsx(ti,{color:"primary"})}),D=()=>u.jsxs(b.Card,{sx:{mb:3},children:[u.jsx(wr,{label:"",values:a,allValues:Object.keys(E),valuesMap:E,onChange:F=>s(F)}),u.jsxs(b.FormControl,{sx:{mb:1},children:[u.jsx(b.FormLabel,{color:"primary",children:r.leadPosition}),u.jsxs(b.Select,{value:l,size:"md",name:"lead_position",onChange:(F,T)=>c(T==="before"?"before":"after"),children:[u.jsx(b.Option,{value:"before",children:"Before"}),u.jsx(b.Option,{value:"after",children:"After"})]})]})]}),G=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xn,{label:r.id,placeholder:"",defaultValue:h,required:!1,size:"md",endDecorator:u.jsx(_,{title:r.campaignIdInfoMessage}),onChange:F=>p(F.target.value)}),u.jsx(xn,{label:r.name,placeholder:"",defaultValue:m,required:!1,size:"md",endDecorator:u.jsx(_,{title:r.campaignNameInfoMessage}),onChange:F=>g(F.target.value)})]});return u.jsxs(b.Box,{mt:1,children:[u.jsxs(b.Box,{display:"flex",children:[u.jsx(hs,{defaultValue:i,label:r.configureLeads,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:n!=="LEAD",onChange:F=>{F===!1&&(s([]),c("before")),o(F)}}),n!=="LEAD"&&u.jsx(b.Tooltip,{title:r.configureLeadsDisabledMessage,sx:{ml:2,maxWidth:300},children:u.jsx(ti,{color:"primary"})})]}),i&&D(),u.jsx(hs,{defaultValue:d,label:r.addCampaignInfo,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:F=>{F===!1&&(p(""),g("")),f(F)}}),d&&G(),u.jsxs(b.Box,{position:"relative",mb:1,children:[u.jsx(b.Textarea,{value:A,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:F=>F.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),u.jsx(b.Tooltip,{title:r.copyToClipboard,children:u.jsx(b.Button,{onClick:()=>{navigator.clipboard.writeText(A)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:u.jsx(ke.ContentCopy,{})})})]}),u.jsx(b.Alert,{variant:"outlined",color:"primary",startDecorator:u.jsx(ti,{}),sx:{mb:1,width:"fit-content"},children:u.jsxs(b.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[r.divElementTextInfo,u.jsx(b.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},bF=["load-more","limited"],yF={"load-more":"Load more",limited:"Limited"},xF=({entityId:e,labels:t})=>{const[n,r]=w.useState(!1),[i,o]=w.useState(""),[a,s]=w.useState(""),[l,c]=w.useState(""),[d,f]=w.useState(10),[h,p]=w.useState(2),[m,g]=w.useState("load-more"),v=`
|
|
2484
|
+
data-content-id="${e}"`,S=i?`
|
|
2485
|
+
data-classic-quiz-url="${i}"`:"",I=a?`
|
|
2486
|
+
data-either-or-url="${a}"`:"",x=l?`
|
|
2487
|
+
data-poll-url="${l}"`:"",C=d?Math.min(50,Math.max(1,d)):1,y=h?Math.min(5,Math.max(1,h)):1,A=`
|
|
2488
|
+
data-items-count="${C}"`,E=`
|
|
2489
|
+
data-items-per-row="${y}"`,_=`
|
|
2490
|
+
data-widget-mode="${m}"`,D=`<div
|
|
2491
|
+
data-component="fu-widget"
|
|
2492
|
+
data-content-type="list"${v}${S}${I}${x}${A}${E}${_}
|
|
2493
|
+
></div>`,G=({title:j})=>u.jsx(b.Tooltip,{title:j,sx:{maxWidth:300},children:u.jsx(ti,{color:"primary"})}),F=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(xn,{label:t.classicQuizURL,placeholder:"",defaultValue:i,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.quizzesInfoMessage}),onChange:j=>o(j.target.value)}),u.jsx(xn,{label:t.eitherOrURL,placeholder:"",defaultValue:a,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.eitherOrsInfoMessage}),onChange:j=>s(j.target.value)}),u.jsx(xn,{label:t.pollURL,placeholder:"",defaultValue:l,required:!1,size:"md",endDecorator:u.jsx(G,{title:t.pollsInfoMessage}),onChange:j=>c(j.target.value)})]}),T=()=>u.jsxs(b.Card,{sx:{pb:1,mb:3},children:[u.jsx(wu,{label:t.itemsPerPage,description:t.itemsPerPageDescription,defaultValue:d,onChange:j=>f(j||null),size:"md"}),u.jsx(wu,{label:t.itemsPerRow,description:t.itemsPerRowDescription,defaultValue:h,onChange:j=>p(j||null),size:"md"}),u.jsxs(b.FormControl,{sx:()=>({marginBottom:"16px"}),children:[u.jsx(b.FormLabel,{color:"primary",children:t.mode}),u.jsx(b.Select,{defaultValue:m,onChange:(j,Y)=>g(Y),children:bF.map((j,Y)=>u.jsx(b.Option,{value:j,children:yF[j]},`basic-select-${j}-${Y}`))}),u.jsx(b.FormHelperText,{children:t.modeDescription})]})]});return u.jsxs(b.Box,{mt:1,children:[T(),u.jsx(hs,{defaultValue:n,label:t.configureURLs,labelPosition:"end",description:"",descriptionColor:"neutral",disabled:!1,onChange:j=>{j===!1&&(o(""),s(""),c("")),r(j)}}),n&&F(),u.jsxs(b.Box,{position:"relative",mb:1,children:[u.jsx(b.Textarea,{value:D,minRows:"5",maxRows:"20",readOnly:!0,onMouseDown:j=>j.preventDefault(),sx:{cursor:"default","&:hover":{cursor:"default"},"& textarea":{cursor:"default"}}}),u.jsx(b.Tooltip,{title:t.copyToClipboard,children:u.jsx(b.Button,{onClick:()=>{navigator.clipboard.writeText(D)},sx:{position:"absolute",top:"10px",right:"10px",zIndex:1},variant:"soft",color:"neutral",children:u.jsx(ke.ContentCopy,{})})})]}),u.jsx(b.Alert,{variant:"outlined",color:"primary",startDecorator:u.jsx(ti,{}),sx:{mb:1,width:"fit-content"},children:u.jsxs(b.Typography,{color:"primary",fontSize:14,fontWeight:500,children:[t.divElementTextInfo,u.jsx(b.Link,{href:"https://docs.fansunitedmedia.com/docs/user-centric-widgets#/",underline:"always",target:"_blank",rel:"noopener noreferrer",children:"User-centric widgets"})]})})]})},gb=e=>(e==null?void 0:e.map(t=>({id:t.id,value:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,label:t.nickname?t.nickname:t.name||`No name ${t.id.slice(0,5)}`,avatar:t.avatar})))||[],mb={Login:eL,InformationInput:xn,RichText:hc,HeaderButtons:_P,MarketSelection:gL,Accordion:vT,DynamicFields:GP,BasicSelect:yT,BooleanSwitch:hs,Branding:kP,ProfileSearchSelect:BM,RangeCalendar:HP,CompetitionSearchSelect:LM,Related:yL,Images:PR,Duration:VP,DatePickerComponent:ro,Flags:TR,Spinner:fs,Tags:$m,Toast:st,AdContent:bT,Match:mL,Winners:AB,CompetitionsSearchSelect:MM,TeamsSearchSelect:$M,CustomSelect:ML,Schedule:kL,NoPermissionCard:WP,CustomFlatpickrCalendar:Jc,ContextSelectFilter:EB,NumberInput:wu,EntityContext:o$,MiniGamesImages:s$,AuthRequirement:l$,SortableList:XN,ItemsPerPageFilter:ZN,ImageCard:co,RelatedRelationship:hF,ExportUsersLeads:pF,SignOutButton:dg,BasicSortableList:mF,WidgetEmbedCode:vF,WidgetListEmbedCode:xF,AdvancedProfileSearchSelect:({labels:e,ids:t,onChange:n})=>{const[r,i]=w.useState([]),[o,a]=w.useState([]),[s,l]=w.useState(""),[c,d]=w.useState("name"),[f,h]=w.useState(!1),[p,m]=w.useState(!1),{sdk:g}=at(),v=!0,S=()=>m(!p),I=(A,E)=>{i(E);const _=E.map(D=>D.id);n(_&&_.length?_:null)},x=3;w.useEffect(()=>{!s&&t&&t.length&&g.profile.getByIds(t,void 0,v).then(A=>{i(gb(A))}).catch(A=>{S(),console.error(A),i([])})},[]);const C=w.useMemo(()=>Ir((A,E)=>{h(!0),g.profile.getByIds(E==="id"?[A]:[],E==="name"?A:void 0,v).then(_=>{a([...gb(_)]),h(!1)}).catch(_=>{console.error(_),S(),a([]),h(!1)})},300),[]);w.useEffect(()=>{if(!s||s.length<x){a([]);return}return C(s,c),()=>C.cancel()},[s,C,c]);const y=(A,E)=>A.map((_,D)=>{var G;return u.jsx(b.Chip,{variant:"solid",endDecorator:u.jsx(b.ChipDelete,{color:"danger",sx:{marginRight:.5},variant:"plain",onClick:F=>E({index:D}).onClick(F),children:u.jsx(ke.Close,{fontSize:"small"})}),sx:{marginLeft:"3px",marginY:"1px",backgroundColor:"#e0f3ff",padding:"2px",borderRadius:4,"&:hover":{cursor:"default"}},children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(G=_.avatar)!=null?G:lt.avatar}),u.jsx(b.Typography,{children:_.label})]})},_.id)});return u.jsxs(u.Fragment,{children:[u.jsx(b.Box,{sx:{marginBottom:"16px"},children:u.jsx(b.Autocomplete,{forcePopupIcon:!1,multiple:!0,loading:f,disableClearable:!0,slotProps:{input:{sx:{"&::placeholder":{fontSize:"14px"}}},root:{sx:{boxShadow:"none",backgroundColor:"white",minHeight:38}}},isOptionEqualToValue:(A,E)=>A.id===E.id,endDecorator:u.jsxs(u.Fragment,{children:[f&&u.jsx(b.CircularProgress,{size:"sm",sx:{bgcolor:"primary",marginRight:2}}),u.jsx(b.Divider,{orientation:"vertical"}),u.jsxs(b.Select,{variant:"plain",value:c,onChange:(A,E)=>d(E),slotProps:{listbox:{variant:"outlined"}},sx:{mr:-1.5,"&:hover":{bgcolor:"transparent"}},children:[u.jsx(b.Option,{value:"name",children:e.searchByName}),u.jsx(b.Option,{value:"id",children:e.searchById})]})]}),placeholder:r.length>0?"":e.excludedProfilesPlaceholder,options:o,filterOptions:A=>A.filter(E=>!r.some(_=>_.value===E.value)),onInputChange:(A,E)=>{l(E)},onChange:I,getOptionKey:A=>A.id,value:r,renderTags:y,renderOption:(A,E)=>{var _;return u.jsx(b.AutocompleteOption,Q(N({},A),{children:u.jsxs(b.Box,{display:"flex",alignItems:"center",mr:1,children:[u.jsx(b.Avatar,{sx:{width:"1.5rem",height:" 1.5rem",mr:.5,borderRadius:"0.75rem"},src:(_=E.avatar)!=null?_:lt.avatar}),u.jsx(b.Typography,{children:E.label})]})}))}})}),u.jsx(st,{showToast:p,message:e.searchProfilesErrorMessage,color:"danger",hideToast:S})]})},FormatNumber:({value:e,sx:t,tooltipPlacement:n})=>{const r=l=>{const c=Math.abs(l);return c>=1e9?(l/1e9).toFixed(1)+"b":c>=1e6?(l/1e6).toFixed(1)+"m":c>=1e3?(l/1e3).toFixed(1)+"k":l.toString()},i=l=>new Intl.NumberFormat("en-US").format(l),o=Math.abs(e)>=1e3,a=r(e),s=i(e);return o?u.jsx(b.Tooltip,{title:s,placement:n,arrow:!0,children:u.jsx(b.Typography,{sx:t,children:a})}):u.jsx(b.Typography,{sx:t,children:a})}},Mu=w.createContext(null),vb=({children:e})=>{const t=mb;return u.jsx(Mu.Provider,{value:t,children:e})},bb=()=>{const e=w.useContext(Mu);if(!e)throw new Error("useComponentContext must be used within a ComponentProvider");return e},yb=425,xb=1024,Cb=()=>{const[e,t]=w.useState(window.innerWidth<=xb),[n,r]=w.useState(window.innerWidth<=yb);return w.useLayoutEffect(()=>{const i=()=>{t(window.innerWidth<=xb),r(window.innerWidth<=yb)};return window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),{isMobile:e,isPhone:n}},CF={APIProvider:Hf,AuthProvider:Wf,AuthContext:Ml,ComponentProvider:vb,useComponentContext:bb,useAPIContext:at,useIsMobile:Cb};be.APIProvider=Hf,be.AuthContext=Ml,be.AuthProvider=Wf,be.ComponentContext=Mu,be.ComponentProvider=vb,be.components=mb,be.default=CF,be.useAPIContext=at,be.useComponentContext=bb,be.useIsMobile=Cb,Object.defineProperties(be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|