fansunited-widget-either-or 1.1.4-RC1 → 1.1.4
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/either-or-manager.es.js +13 -6
- package/either-or-manager.umd.js +2 -2
- package/package.json +1 -1
package/either-or-manager.es.js
CHANGED
|
@@ -9769,15 +9769,15 @@ const du = (t) => {
|
|
|
9769
9769
|
const e = "api_key";
|
|
9770
9770
|
Mn.initializeApp({ apiKey: e });
|
|
9771
9771
|
const n = PE();
|
|
9772
|
-
Jc(n, "
|
|
9772
|
+
Jc(n, "24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K");
|
|
9773
9773
|
} else {
|
|
9774
9774
|
const n = {
|
|
9775
9775
|
apiKey: t && t === "staging" ? "AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8" : "AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",
|
|
9776
9776
|
authDomain: "fans-united-clients.firebaseapp.com",
|
|
9777
9777
|
projectId: "fans-united-clients",
|
|
9778
9778
|
messagingSenderId: "78627953958",
|
|
9779
|
-
appId: "1:78627953958:web:
|
|
9780
|
-
measurementId: "G-
|
|
9779
|
+
appId: "1:78627953958:web:9e4c6caf6bd197b185f5e7",
|
|
9780
|
+
measurementId: "G-DPV1TYL0JW"
|
|
9781
9781
|
};
|
|
9782
9782
|
Mn.initializeApp(n);
|
|
9783
9783
|
}
|
|
@@ -37123,9 +37123,16 @@ const u$ = (t, e, n, r) => ({
|
|
|
37123
37123
|
errorHandlingMode: "standard",
|
|
37124
37124
|
authProvider: { getIdToken: () => "", logout: () => {
|
|
37125
37125
|
} }
|
|
37126
|
-
}), d$ = (t, e) =>
|
|
37127
|
-
|
|
37128
|
-
|
|
37126
|
+
}), d$ = (t, e) => {
|
|
37127
|
+
if (!t && !e)
|
|
37128
|
+
return null;
|
|
37129
|
+
if (!t && e)
|
|
37130
|
+
return console.warn(
|
|
37131
|
+
"'sportal365Project' prop is not provided. The prop is required when 'sportal365Infrastructure' prop is provided. Functionalities with Sportal365 API will not be exposed"
|
|
37132
|
+
), null;
|
|
37133
|
+
const n = e && e === "betway" ? {}.VITE_SPORTAL365_BETWAY_TOKEN : {}.VITE_SPORTAL365_SHARED_TOKEN;
|
|
37134
|
+
return { project: t, authorization: `Bearer ${n}` };
|
|
37135
|
+
}, Yf = (t) => {
|
|
37129
37136
|
document.getElementById(t).scrollIntoView({ behavior: "smooth" });
|
|
37130
37137
|
}, td = {
|
|
37131
37138
|
container: (t) => X({}, t),
|
package/either-or-manager.umd.js
CHANGED
|
@@ -2265,7 +2265,7 @@ object-assign
|
|
|
2265
2265
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
2266
2266
|
* See the License for the specific language governing permissions and
|
|
2267
2267
|
* limitations under the License.
|
|
2268
|
-
*/const hI="auth-compat";function pI(t){t.INTERNAL.registerComponent(new Kn(hI,e=>{const n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("auth");return new Ql(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:$r.EMAIL_SIGNIN,PASSWORD_RESET:$r.PASSWORD_RESET,RECOVER_EMAIL:$r.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:$r.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:$r.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:$r.VERIFY_EMAIL}},EmailAuthProvider:rr,FacebookAuthProvider:gn,GithubAuthProvider:yn,GoogleAuthProvider:vn,OAuthProvider:Gr,SAMLAuthProvider:ns,PhoneAuthProvider:Yl,PhoneMultiFactorGenerator:nh,RecaptchaVerifier:fI,TwitterAuthProvider:wn,Auth:Ql,AuthCredential:qr,Error:Pt}).setInstantiationMode("LAZY").setMultipleInstances(!1)),t.registerVersion(zE,QE)}pI(Dn);let gh=!1;const Kl=t=>{if(gh)return Dn.auth();if(t&&t==="dev"){const e="api_key";Dn.initializeApp({apiKey:e});const n=TE();El(n,"http://localhost:39199")}else{const n={apiKey:t&&t==="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"};Dn.initializeApp(n)}return gh=!0,Dn.auth()},mI=({fansUnitedEnvironment:t})=>{const[e,n]=K.useState(""),[r,i]=K.useState(""),{userNotFound:s}=_e(Me);return j("div",{className:"eow-flex eow-items-center eow-justify-center eow-min-h-screen eow-bg-gray-100",children:se("div",{className:"eow-px-8 eow-py-6 eow-mt-4 eow-text-left eow-bg-white eow-shadow-lg",children:[j("h3",{className:"eow-text-2xl eow-font-bold eow-text-center eow-mb-4",children:"Sign in"}),j("p",{className:"eow-text-gray-400 eow-text-xs eow-mb-4 eow-text-center",children:"Use your account in the Fans United platform."}),se("div",{className:"eow-mt-4",children:[se("div",{children:[j("label",{className:"eow-block",htmlFor:"email",children:"Email"}),j("input",{value:e,type:"text",placeholder:"Email",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),n(l.target.value)}})]}),se("div",{className:"eow-mt-4",children:[j("label",{className:"eow-block",htmlFor:"password",children:"Password"}),j("input",{value:r,type:"password",placeholder:"Password",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),i(l.target.value)}})]}),j("div",{className:"eow-flex eow-items-baseline eow-justify-between",children:j("button",{onClick:()=>_(this,null,function*(){try{yield Kl(t).signInWithEmailAndPassword(e,r)}catch(l){console.error(l),Pe.error(s)}}),className:"eow-px-6 eow-py-2 eow-mt-4 eow-text-white eow-bg-gray-600 eow-rounded hover:eow-bg-gray-900",children:"Login"})})]})]})})},vh=K.createContext(null),gI=({children:t,fansUnitedEnvironment:e})=>{const[n,r]=K.useState(null),[i,s]=K.useState(!0);return K.useEffect(()=>Kl(e).onAuthStateChanged(l=>{We.unstable_batchedUpdates(()=>{s(!1),r(l)})}),[]),j(vh.Provider,{value:n,children:!i&&t})},vI=({children:t})=>j("div",{className:"eow-w-full eow-bg-white","data-testid":"widget-card",children:t}),yI=({fansUnitedEnvironment:t})=>{const{signOut:e}=_e(Me);return j("button",{className:"eow-rounded eow-bg-gray-700 eow-text-white hover:eow-bg-gray-800 eow-uppercase eow-text-xs eow-font-bold eow-py-2 eow-px-6 ",onClick:()=>_(this,null,function*(){yield Kl(t).signOut()}),children:e})},yh=({hideSignOutButton:t,toggleScreen:e,fansUnitedEnvironment:n})=>{const{create:r}=_e(Me);return se("div",{className:"eow-mb-4 eow-flex eow-p-2 eow-items-center eow-justify-between",children:[j("button",{onClick:e,className:"eow-rounded eow-bg-gray-700 hover:eow-bg-gray-800 eow-text-white eow-uppercase eow-text-xs eow-font-bold eow-px-6 eow-py-2",children:r}),t?j(xe,{}):j(yI,{fansUnitedEnvironment:n})]})},wI=()=>{const{title:t,status:e,type:n,creationDate:r,actions:i}=_e(Me);return j("thead",{className:"eow-bg-gray-200",children:se("tr",{className:"eow-uppercase eow-text-xs",children:[j("th",{className:"eow-px-2 eow-py-4 eow-font-semibold eow-text-left",children:t}),j("th",{className:"md:eow-text-center eow-text-right eow-p-2 eow-font-semibold",children:e}),j("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:n}),j("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:r}),j("th",{className:"eow-text-right eow-p-2",children:i})]})})};class Ki{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const n={listener:e};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ji=typeof window=="undefined"||"Deno"in window;function Qt(){}function bI(t,e){return typeof t=="function"?t(e):t}function Jl(t){return typeof t=="number"&&t>=0&&t!==1/0}function wh(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Xi(t,e,n){return ys(t)?typeof e=="function"?ae(Z({},n),{queryKey:t,queryFn:e}):ae(Z({},e),{queryKey:t}):t}function sr(t,e,n){return ys(t)?[ae(Z({},e),{queryKey:t}),n]:[t||{},e]}function bh(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=t;if(ys(o)){if(r){if(e.queryHash!==Xl(o,e.options))return!1}else if(!vs(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof i!="undefined"&&i!==e.state.fetchStatus||s&&!s(e))}function _h(t,e){const{exact:n,fetching:r,predicate:i,mutationKey:s}=t;if(ys(s)){if(!e.options.mutationKey)return!1;if(n){if(Or(e.options.mutationKey)!==Or(s))return!1}else if(!vs(e.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&e.state.status==="loading"!==r||i&&!i(e))}function Xl(t,e){return((e==null?void 0:e.queryKeyHashFn)||Or)(t)}function Or(t){return JSON.stringify(t,(e,n)=>eu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function vs(t,e){return Eh(t,e)}function Eh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Eh(t[n],e[n])):!1}function Ih(t,e){if(t===e)return t;const n=Ah(t)&&Ah(e);if(n||eu(t)&&eu(e)){const r=n?t.length:Object.keys(t).length,i=n?e:Object.keys(e),s=i.length,o=n?[]:{};let l=0;for(let u=0;u<s;u++){const c=n?u:i[u];o[c]=Ih(t[c],e[c]),o[c]===t[c]&&l++}return r===s&&l===r?t:o}return e}function Zl(t,e){if(t&&!e||e&&!t)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Ah(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function eu(t){if(!Oh(t))return!1;const e=t.constructor;if(typeof e=="undefined")return!0;const n=e.prototype;return!(!Oh(n)||!n.hasOwnProperty("isPrototypeOf"))}function Oh(t){return Object.prototype.toString.call(t)==="[object Object]"}function ys(t){return Array.isArray(t)}function Th(t){return new Promise(e=>{setTimeout(e,t)})}function Ch(t){Th(0).then(t)}function _I(){if(typeof AbortController=="function")return new AbortController}function tu(t,e,n){return n.isDataEqual!=null&&n.isDataEqual(t,e)?t:typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Ih(t,e):e}class EI extends Ki{constructor(){super(),this.setup=e=>{if(!Ji&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document=="undefined"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const ws=new EI,Sh=["online","offline"];class II extends Ki{constructor(){super(),this.setup=e=>{if(!Ji&&window.addEventListener){const n=()=>e();return Sh.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Sh.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator=="undefined"||typeof navigator.onLine=="undefined"?!0:navigator.onLine}}const bs=new II;function AI(t){return Math.min(1e3*gw(2,t),3e4)}function _s(t){return(t!=null?t:"online")==="online"?bs.isOnline():!0}class Ph{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Es(t){return t instanceof Ph}function Mh(t){let e=!1,n=0,r=!1,i,s,o;const l=new Promise((v,b)=>{s=v,o=b}),u=v=>{r||(h(new Ph(v)),t.abort==null||t.abort())},c=()=>{e=!0},d=()=>{e=!1},f=()=>!ws.isFocused()||t.networkMode!=="always"&&!bs.isOnline(),p=v=>{r||(r=!0,t.onSuccess==null||t.onSuccess(v),i==null||i(),s(v))},h=v=>{r||(r=!0,t.onError==null||t.onError(v),i==null||i(),o(v))},y=()=>new Promise(v=>{i=b=>{const w=r||!f();return w&&v(b),w},t.onPause==null||t.onPause()}).then(()=>{i=void 0,r||t.onContinue==null||t.onContinue()}),g=()=>{if(r)return;let v;try{v=t.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(p).catch(b=>{var w,E;if(r)return;const m=(w=t.retry)!=null?w:3,A=(E=t.retryDelay)!=null?E:AI,I=typeof A=="function"?A(n,b):A,O=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,b);if(e||!O){h(b);return}n++,t.onFail==null||t.onFail(n,b),Th(I).then(()=>{if(f())return y()}).then(()=>{e?h(b):g()})})};return _s(t.networkMode)?g():y().then(g),{promise:l,cancel:u,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:c,continueRetry:d}}const nu=console;function OI(){let t=[],e=0,n=d=>{d()},r=d=>{d()};const i=d=>{let f;e++;try{f=d()}finally{e--,e||l()}return f},s=d=>{e?t.push(d):Ch(()=>{n(d)})},o=d=>(...f)=>{s(()=>{d(...f)})},l=()=>{const d=t;t=[],d.length&&Ch(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d}}}const ut=OI();class Rh{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jl(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e!=null?e:Ji?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class TI extends Rh{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||nu,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||CI(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options=Z(Z({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,n){const r=tu(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){this.dispatch({type:"setState",state:e,setStateOptions:n})}cancel(e){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(e),r?r.then(Qt).catch(Qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!wh(this.state.dataUpdatedAt,e)}onFocus(){var e;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const o=_I(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};u(l);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),d={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(u(d),(r=this.options.behavior)==null||r.onFetch(d),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=d.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=d.fetchOptions)==null?void 0:f.meta})}const p=h=>{if(Es(h)&&h.silent||this.dispatch({type:"error",error:h}),!Es(h)){var y,g,v,b;(y=(g=this.cache.config).onError)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Mh({fn:d.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:h=>{var y,g,v,b;if(typeof h=="undefined"){p(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(y=(g=this.cache.config).onSuccess)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:p,onFail:(h,y)=>{this.dispatch({type:"failed",failureCount:h,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const n=r=>{var i,s;switch(e.type){case"failed":return ae(Z({},r),{fetchFailureCount:e.failureCount,fetchFailureReason:e.error});case"pause":return ae(Z({},r),{fetchStatus:"paused"});case"continue":return ae(Z({},r),{fetchStatus:"fetching"});case"fetch":return Z(ae(Z({},r),{fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:_s(this.options.networkMode)?"fetching":"paused"}),!r.dataUpdatedAt&&{error:null,status:"loading"});case"success":return Z(ae(Z({},r),{data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success"}),!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});case"error":const o=e.error;return Es(o)&&o.revert&&this.revertState?ae(Z({},this.revertState),{fetchStatus:"idle"}):ae(Z({},r),{error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"});case"invalidate":return ae(Z({},r),{isInvalidated:!0});case"setState":return Z(Z({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function CI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=typeof e!="undefined",r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class SI extends Ki{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,n,r){var i;const s=n.queryKey,o=(i=n.queryHash)!=null?i:Xl(s,n);let l=this.get(o);return l||(l=new TI({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(l)),l}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const n=this.queriesMap[e.queryHash];n&&(e.destroy(),this.queries=this.queries.filter(r=>r!==e),n===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,n){const[r]=sr(e,n);return typeof r.exact=="undefined"&&(r.exact=!0),this.queries.find(i=>bh(r,i))}findAll(e,n){const[r]=sr(e,n);return Object.keys(r).length>0?this.queries.filter(i=>bh(r,i)):this.queries}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}onFocus(){ut.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class PI extends Rh{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||nu,this.observers=[],this.state=e.state||MI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=Z(Z({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(n=>n!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,n;return(e=(n=this.retryer)==null?void 0:n.continue())!=null?e:this.execute()}execute(){return _(this,null,function*(){const e=()=>{var O;return this.retryer=Mh({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(T,k)=>{this.dispatch({type:"failed",failureCount:T,error:k})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,s,o,l,u,c,d;if(!n){var f,p,h,y;this.dispatch({type:"loading",variables:this.options.variables}),yield(f=(p=this.mutationCache.config).onMutate)==null?void 0:f.call(p,this.state.variables,this);const T=yield(h=(y=this.options).onMutate)==null?void 0:h.call(y,this.state.variables);T!==this.state.context&&this.dispatch({type:"loading",context:T,variables:this.state.variables})}const O=yield e();return yield(r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this),yield(s=(o=this.options).onSuccess)==null?void 0:s.call(o,O,this.state.variables,this.state.context),yield(l=(u=this.mutationCache.config).onSettled)==null?void 0:l.call(u,O,null,this.state.variables,this.state.context,this),yield(c=(d=this.options).onSettled)==null?void 0:c.call(d,O,null,this.state.variables,this.state.context),this.dispatch({type:"success",data:O}),O}catch(O){try{var g,v,b,w,E,m,A,I;throw yield(g=(v=this.mutationCache.config).onError)==null?void 0:g.call(v,O,this.state.variables,this.state.context,this),yield(b=(w=this.options).onError)==null?void 0:b.call(w,O,this.state.variables,this.state.context),yield(E=(m=this.mutationCache.config).onSettled)==null?void 0:E.call(m,void 0,O,this.state.variables,this.state.context,this),yield(A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,O,this.state.variables,this.state.context),O}finally{this.dispatch({type:"error",error:O})}}})}dispatch(e){const n=r=>{switch(e.type){case"failed":return ae(Z({},r),{failureCount:e.failureCount,failureReason:e.error});case"pause":return ae(Z({},r),{isPaused:!0});case"continue":return ae(Z({},r),{isPaused:!1});case"loading":return ae(Z({},r),{context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!_s(this.options.networkMode),status:"loading",variables:e.variables});case"success":return ae(Z({},r),{data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return ae(Z({},r),{data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"});case"setState":return Z(Z({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function MI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class RI extends Ki{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,n,r){const i=new PI({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?e.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(n=>n!==e),this.notify({type:"removed",mutation:e})}clear(){ut.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact=="undefined"&&(e.exact=!0),this.mutations.find(n=>_h(e,n))}findAll(e){return this.mutations.filter(n=>_h(e,n))}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return ut.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(Qt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function kI(){return{onFetch:t=>{t.fetchFn=()=>{var e,n,r,i,s,o;const l=(e=t.fetchOptions)==null||(n=e.meta)==null?void 0:n.refetchPage,u=(r=t.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,c=u==null?void 0:u.pageParam,d=(u==null?void 0:u.direction)==="forward",f=(u==null?void 0:u.direction)==="backward",p=((s=t.state.data)==null?void 0:s.pages)||[],h=((o=t.state.data)==null?void 0:o.pageParams)||[];let y=h,g=!1;const v=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>{var O;if((O=t.signal)!=null&&O.aborted)g=!0;else{var T;(T=t.signal)==null||T.addEventListener("abort",()=>{g=!0})}return t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),w=(I,O,T,k)=>(y=k?[O,...y]:[...y,O],k?[T,...I]:[...I,T]),E=(I,O,T,k)=>{if(g)return Promise.reject("Cancelled");if(typeof T=="undefined"&&!O&&I.length)return Promise.resolve(I);const P={queryKey:t.queryKey,pageParam:T,meta:t.options.meta};v(P);const S=b(P);return Promise.resolve(S).then(D=>w(I,T,D,k))};let m;if(!p.length)m=E([]);else if(d){const I=typeof c!="undefined",O=I?c:kh(t.options,p);m=E(p,I,O)}else if(f){const I=typeof c!="undefined",O=I?c:xI(t.options,p);m=E(p,I,O,!0)}else{y=[];const I=typeof t.options.getNextPageParam=="undefined";m=(l&&p[0]?l(p[0],0,p):!0)?E([],I,h[0]):Promise.resolve(w([],h[0],p[0]));for(let T=1;T<p.length;T++)m=m.then(k=>{if(l&&p[T]?l(p[T],T,p):!0){const S=I?h[T]:kh(t.options,k);return E(k,I,S)}return Promise.resolve(w(k,h[T],p[T]))})}return m.then(I=>({pages:I,pageParams:y}))}}}}function kh(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function xI(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}class DI{constructor(e={}){this.queryCache=e.queryCache||new SI,this.mutationCache=e.mutationCache||new RI,this.logger=e.logger||nu,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=ws.subscribe(()=>{ws.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=bs.subscribe(()=>{bs.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,n;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(e,n){const[r]=sr(e,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll(ae(Z({},e),{fetching:!0})).length}getQueryData(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state.data}ensureQueryData(e,n,r){const i=Xi(e,n,r),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=bI(n,s);if(typeof o=="undefined")return;const l=Xi(e),u=this.defaultQueryOptions(l);return this.queryCache.build(this,u).setData(o,ae(Z({},r),{manual:!0}))}setQueriesData(e,n,r){return ut.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state}removeQueries(e,n){const[r]=sr(e,n),i=this.queryCache;ut.batch(()=>{i.findAll(r).forEach(s=>{i.remove(s)})})}resetQueries(e,n,r){const[i,s]=sr(e,n,r),o=this.queryCache,l=Z({type:"active"},i);return ut.batch(()=>(o.findAll(i).forEach(u=>{u.reset()}),this.refetchQueries(l,s)))}cancelQueries(e,n,r){const[i,s={}]=sr(e,n,r);typeof s.revert=="undefined"&&(s.revert=!0);const o=ut.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(s)));return Promise.all(o).then(Qt).catch(Qt)}invalidateQueries(e,n,r){const[i,s]=sr(e,n,r);return ut.batch(()=>{var o,l;if(this.queryCache.findAll(i).forEach(c=>{c.invalidate()}),i.refetchType==="none")return Promise.resolve();const u=ae(Z({},i),{type:(o=(l=i.refetchType)!=null?l:i.type)!=null?o:"active"});return this.refetchQueries(u,s)})}refetchQueries(e,n,r){const[i,s]=sr(e,n,r),o=ut.batch(()=>this.queryCache.findAll(i).filter(u=>!u.isDisabled()).map(u=>{var c;return u.fetch(void 0,ae(Z({},s),{cancelRefetch:(c=s==null?void 0:s.cancelRefetch)!=null?c:!0,meta:{refetchPage:i.refetchPage}}))}));let l=Promise.all(o).then(Qt);return s!=null&&s.throwOnError||(l=l.catch(Qt)),l}fetchQuery(e,n,r){const i=Xi(e,n,r),s=this.defaultQueryOptions(i);typeof s.retry=="undefined"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,n,r){return this.fetchQuery(e,n,r).then(Qt).catch(Qt)}fetchInfiniteQuery(e,n,r){const i=Xi(e,n,r);return i.behavior=kI(),this.fetchQuery(i)}prefetchInfiniteQuery(e,n,r){return this.fetchInfiniteQuery(e,n,r).then(Qt).catch(Qt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,n){const r=this.queryDefaults.find(i=>Or(e)===Or(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:e,defaultOptions:n})}getQueryDefaults(e){if(!e)return;const n=this.queryDefaults.find(r=>vs(e,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(e,n){const r=this.mutationDefaults.find(i=>Or(e)===Or(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:e,defaultOptions:n})}getMutationDefaults(e){if(!e)return;const n=this.mutationDefaults.find(r=>vs(e,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const n=ae(Z(Z(Z({},this.defaultOptions.queries),this.getQueryDefaults(e==null?void 0:e.queryKey)),e),{_defaulted:!0});return!n.queryHash&&n.queryKey&&(n.queryHash=Xl(n.queryKey,n)),typeof n.refetchOnReconnect=="undefined"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary=="undefined"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:ae(Z(Z(Z({},this.defaultOptions.mutations),this.getMutationDefaults(e==null?void 0:e.mutationKey)),e),{_defaulted:!0})}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class FI extends Ki{constructor(e,n){super(),this.client=e,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),xh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ru(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ru(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),Zl(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled!="undefined"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const s=this.hasListeners();s&&Dh(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const n=this.client.getQueryCache().build(this.client,e),r=this.createResult(n,e);return LI(this,r,e)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch(r={}){var i=r,{refetchPage:e}=i,n=zn(i,["refetchPage"]);return this.fetch(ae(Z({},n),{meta:{refetchPage:e}}))}fetchOptimistic(e){const n=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){var n;return this.executeFetch(ae(Z({},e),{cancelRefetch:(n=e.cancelRefetch)!=null?n:!0})).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let n=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Qt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ji||this.currentResult.isStale||!Jl(this.options.staleTime))return;const n=wh(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(Ji||this.options.enabled===!1||!Jl(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||ws.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,n){const r=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,l=this.currentResultOptions,u=e!==r,c=u?e.state:this.currentQueryInitialState,d=u?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:p,error:h,errorUpdatedAt:y,fetchStatus:g,status:v}=f,b=!1,w=!1,E;if(n._optimisticResults){const T=this.hasListeners(),k=!T&&xh(e,n),P=T&&Dh(e,r,n,i);(k||P)&&(g=_s(e.options.networkMode)?"fetching":"paused",p||(v="loading")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&d!=null&&d.isSuccess&&v!=="error")E=d.data,p=d.dataUpdatedAt,v=d.status,b=!0;else if(n.select&&typeof f.data!="undefined")if(s&&f.data===(o==null?void 0:o.data)&&n.select===this.selectFn)E=this.selectResult;else try{this.selectFn=n.select,E=n.select(f.data),E=tu(s==null?void 0:s.data,E,n),this.selectResult=E,this.selectError=null}catch(T){this.selectError=T}else E=f.data;if(typeof n.placeholderData!="undefined"&&typeof E=="undefined"&&v==="loading"){let T;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))T=s.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof T!="undefined")try{T=n.select(T),this.selectError=null}catch(k){this.selectError=k}typeof T!="undefined"&&(v="success",E=tu(s==null?void 0:s.data,T,n),w=!0)}this.selectError&&(h=this.selectError,E=this.selectResult,y=Date.now(),v="error");const m=g==="fetching",A=v==="loading",I=v==="error";return{status:v,fetchStatus:g,isLoading:A,isSuccess:v==="success",isError:I,isInitialLoading:A&&m,data:E,dataUpdatedAt:p,error:h,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!A,isLoadingError:I&&f.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:w,isPreviousData:b,isRefetchError:I&&f.dataUpdatedAt!==0,isStale:iu(e,n),refetch:this.refetch,remove:this.remove}}updateResult(e){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Zl(r,n))return;this.currentResult=r;const i={cache:!0},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.trackedProps.size)return!0;const u=new Set(l!=null?l:this.trackedProps);return this.options.useErrorBoundary&&u.add("error"),Object.keys(this.currentResult).some(c=>{const d=c;return this.currentResult[d]!==n[d]&&u.has(d)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify(Z(Z({},i),e))}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const n={};e.type==="success"?n.onSuccess=!e.manual:e.type==="error"&&!Es(e.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(e){ut.batch(()=>{if(e.onSuccess){var n,r,i,s;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,l,u,c;(o=(l=this.options).onError)==null||o.call(l,this.currentResult.error),(u=(c=this.options).onSettled)==null||u.call(c,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function NI(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function xh(t,e){return NI(t,e)||t.state.dataUpdatedAt>0&&ru(t,e,e.refetchOnMount)}function ru(t,e,n){if(e.enabled!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&iu(t,e)}return!1}function Dh(t,e,n,r){return n.enabled!==!1&&(t!==e||r.enabled===!1)&&(!n.suspense||t.state.status!=="error")&&iu(t,n)}function iu(t,e){return t.isStaleByTime(e.staleTime)}function LI(t,e,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?e.isPlaceholderData:!Zl(t.getCurrentResult(),e)}var Fh={exports:{}},Nh={};/**
|
|
2268
|
+
*/const hI="auth-compat";function pI(t){t.INTERNAL.registerComponent(new Kn(hI,e=>{const n=e.getProvider("app-compat").getImmediate(),r=e.getProvider("auth");return new Ql(n,r)},"PUBLIC").setServiceProps({ActionCodeInfo:{Operation:{EMAIL_SIGNIN:$r.EMAIL_SIGNIN,PASSWORD_RESET:$r.PASSWORD_RESET,RECOVER_EMAIL:$r.RECOVER_EMAIL,REVERT_SECOND_FACTOR_ADDITION:$r.REVERT_SECOND_FACTOR_ADDITION,VERIFY_AND_CHANGE_EMAIL:$r.VERIFY_AND_CHANGE_EMAIL,VERIFY_EMAIL:$r.VERIFY_EMAIL}},EmailAuthProvider:rr,FacebookAuthProvider:gn,GithubAuthProvider:yn,GoogleAuthProvider:vn,OAuthProvider:Gr,SAMLAuthProvider:ns,PhoneAuthProvider:Yl,PhoneMultiFactorGenerator:nh,RecaptchaVerifier:fI,TwitterAuthProvider:wn,Auth:Ql,AuthCredential:qr,Error:Pt}).setInstantiationMode("LAZY").setMultipleInstances(!1)),t.registerVersion(zE,QE)}pI(Dn);let gh=!1;const Kl=t=>{if(gh)return Dn.auth();if(t&&t==="dev"){const e="api_key";Dn.initializeApp({apiKey:e});const n=TE();El(n,"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K")}else{const n={apiKey:t&&t==="staging"?"AIzaSyBKhAYwkvkmjm16FxCMvCUQjSRpKC0DbM8":"AIzaSyDPD_SETLswR_U3dKawYkAyRhbzVXziD_4",authDomain:"fans-united-clients.firebaseapp.com",projectId:"fans-united-clients",messagingSenderId:"78627953958",appId:"1:78627953958:web:9e4c6caf6bd197b185f5e7",measurementId:"G-DPV1TYL0JW"};Dn.initializeApp(n)}return gh=!0,Dn.auth()},mI=({fansUnitedEnvironment:t})=>{const[e,n]=K.useState(""),[r,i]=K.useState(""),{userNotFound:s}=_e(Me);return j("div",{className:"eow-flex eow-items-center eow-justify-center eow-min-h-screen eow-bg-gray-100",children:se("div",{className:"eow-px-8 eow-py-6 eow-mt-4 eow-text-left eow-bg-white eow-shadow-lg",children:[j("h3",{className:"eow-text-2xl eow-font-bold eow-text-center eow-mb-4",children:"Sign in"}),j("p",{className:"eow-text-gray-400 eow-text-xs eow-mb-4 eow-text-center",children:"Use your account in the Fans United platform."}),se("div",{className:"eow-mt-4",children:[se("div",{children:[j("label",{className:"eow-block",htmlFor:"email",children:"Email"}),j("input",{value:e,type:"text",placeholder:"Email",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),n(l.target.value)}})]}),se("div",{className:"eow-mt-4",children:[j("label",{className:"eow-block",htmlFor:"password",children:"Password"}),j("input",{value:r,type:"password",placeholder:"Password",className:"eow-w-full eow-px-4 eow-py-2 eow-mt-2 eow-border eow-rounded-md focus:eow-outline-none focus:eow-ring-1 focus:eow-ring-gray-600",onChange:l=>{l.persist(),i(l.target.value)}})]}),j("div",{className:"eow-flex eow-items-baseline eow-justify-between",children:j("button",{onClick:()=>_(this,null,function*(){try{yield Kl(t).signInWithEmailAndPassword(e,r)}catch(l){console.error(l),Pe.error(s)}}),className:"eow-px-6 eow-py-2 eow-mt-4 eow-text-white eow-bg-gray-600 eow-rounded hover:eow-bg-gray-900",children:"Login"})})]})]})})},vh=K.createContext(null),gI=({children:t,fansUnitedEnvironment:e})=>{const[n,r]=K.useState(null),[i,s]=K.useState(!0);return K.useEffect(()=>Kl(e).onAuthStateChanged(l=>{We.unstable_batchedUpdates(()=>{s(!1),r(l)})}),[]),j(vh.Provider,{value:n,children:!i&&t})},vI=({children:t})=>j("div",{className:"eow-w-full eow-bg-white","data-testid":"widget-card",children:t}),yI=({fansUnitedEnvironment:t})=>{const{signOut:e}=_e(Me);return j("button",{className:"eow-rounded eow-bg-gray-700 eow-text-white hover:eow-bg-gray-800 eow-uppercase eow-text-xs eow-font-bold eow-py-2 eow-px-6 ",onClick:()=>_(this,null,function*(){yield Kl(t).signOut()}),children:e})},yh=({hideSignOutButton:t,toggleScreen:e,fansUnitedEnvironment:n})=>{const{create:r}=_e(Me);return se("div",{className:"eow-mb-4 eow-flex eow-p-2 eow-items-center eow-justify-between",children:[j("button",{onClick:e,className:"eow-rounded eow-bg-gray-700 hover:eow-bg-gray-800 eow-text-white eow-uppercase eow-text-xs eow-font-bold eow-px-6 eow-py-2",children:r}),t?j(xe,{}):j(yI,{fansUnitedEnvironment:n})]})},wI=()=>{const{title:t,status:e,type:n,creationDate:r,actions:i}=_e(Me);return j("thead",{className:"eow-bg-gray-200",children:se("tr",{className:"eow-uppercase eow-text-xs",children:[j("th",{className:"eow-px-2 eow-py-4 eow-font-semibold eow-text-left",children:t}),j("th",{className:"md:eow-text-center eow-text-right eow-p-2 eow-font-semibold",children:e}),j("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:n}),j("th",{className:"eow-text-center eow-hidden md:eow-table-cell eow-p-2 eow-font-semibold",children:r}),j("th",{className:"eow-text-right eow-p-2",children:i})]})})};class Ki{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){const n={listener:e};return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}}const Ji=typeof window=="undefined"||"Deno"in window;function Qt(){}function bI(t,e){return typeof t=="function"?t(e):t}function Jl(t){return typeof t=="number"&&t>=0&&t!==1/0}function wh(t,e){return Math.max(t+(e||0)-Date.now(),0)}function Xi(t,e,n){return ys(t)?typeof e=="function"?ae(Z({},n),{queryKey:t,queryFn:e}):ae(Z({},e),{queryKey:t}):t}function sr(t,e,n){return ys(t)?[ae(Z({},e),{queryKey:t}),n]:[t||{},e]}function bh(t,e){const{type:n="all",exact:r,fetchStatus:i,predicate:s,queryKey:o,stale:l}=t;if(ys(o)){if(r){if(e.queryHash!==Xl(o,e.options))return!1}else if(!vs(e.queryKey,o))return!1}if(n!=="all"){const u=e.isActive();if(n==="active"&&!u||n==="inactive"&&u)return!1}return!(typeof l=="boolean"&&e.isStale()!==l||typeof i!="undefined"&&i!==e.state.fetchStatus||s&&!s(e))}function _h(t,e){const{exact:n,fetching:r,predicate:i,mutationKey:s}=t;if(ys(s)){if(!e.options.mutationKey)return!1;if(n){if(Or(e.options.mutationKey)!==Or(s))return!1}else if(!vs(e.options.mutationKey,s))return!1}return!(typeof r=="boolean"&&e.state.status==="loading"!==r||i&&!i(e))}function Xl(t,e){return((e==null?void 0:e.queryKeyHashFn)||Or)(t)}function Or(t){return JSON.stringify(t,(e,n)=>eu(n)?Object.keys(n).sort().reduce((r,i)=>(r[i]=n[i],r),{}):n)}function vs(t,e){return Eh(t,e)}function Eh(t,e){return t===e?!0:typeof t!=typeof e?!1:t&&e&&typeof t=="object"&&typeof e=="object"?!Object.keys(e).some(n=>!Eh(t[n],e[n])):!1}function Ih(t,e){if(t===e)return t;const n=Ah(t)&&Ah(e);if(n||eu(t)&&eu(e)){const r=n?t.length:Object.keys(t).length,i=n?e:Object.keys(e),s=i.length,o=n?[]:{};let l=0;for(let u=0;u<s;u++){const c=n?u:i[u];o[c]=Ih(t[c],e[c]),o[c]===t[c]&&l++}return r===s&&l===r?t:o}return e}function Zl(t,e){if(t&&!e||e&&!t)return!1;for(const n in t)if(t[n]!==e[n])return!1;return!0}function Ah(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function eu(t){if(!Oh(t))return!1;const e=t.constructor;if(typeof e=="undefined")return!0;const n=e.prototype;return!(!Oh(n)||!n.hasOwnProperty("isPrototypeOf"))}function Oh(t){return Object.prototype.toString.call(t)==="[object Object]"}function ys(t){return Array.isArray(t)}function Th(t){return new Promise(e=>{setTimeout(e,t)})}function Ch(t){Th(0).then(t)}function _I(){if(typeof AbortController=="function")return new AbortController}function tu(t,e,n){return n.isDataEqual!=null&&n.isDataEqual(t,e)?t:typeof n.structuralSharing=="function"?n.structuralSharing(t,e):n.structuralSharing!==!1?Ih(t,e):e}class EI extends Ki{constructor(){super(),this.setup=e=>{if(!Ji&&window.addEventListener){const n=()=>e();return window.addEventListener("visibilitychange",n,!1),window.addEventListener("focus",n,!1),()=>{window.removeEventListener("visibilitychange",n),window.removeEventListener("focus",n)}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()})}setFocused(e){this.focused!==e&&(this.focused=e,this.onFocus())}onFocus(){this.listeners.forEach(({listener:e})=>{e()})}isFocused(){return typeof this.focused=="boolean"?this.focused:typeof document=="undefined"?!0:[void 0,"visible","prerender"].includes(document.visibilityState)}}const ws=new EI,Sh=["online","offline"];class II extends Ki{constructor(){super(),this.setup=e=>{if(!Ji&&window.addEventListener){const n=()=>e();return Sh.forEach(r=>{window.addEventListener(r,n,!1)}),()=>{Sh.forEach(r=>{window.removeEventListener(r,n)})}}}}onSubscribe(){this.cleanup||this.setEventListener(this.setup)}onUnsubscribe(){if(!this.hasListeners()){var e;(e=this.cleanup)==null||e.call(this),this.cleanup=void 0}}setEventListener(e){var n;this.setup=e,(n=this.cleanup)==null||n.call(this),this.cleanup=e(r=>{typeof r=="boolean"?this.setOnline(r):this.onOnline()})}setOnline(e){this.online!==e&&(this.online=e,this.onOnline())}onOnline(){this.listeners.forEach(({listener:e})=>{e()})}isOnline(){return typeof this.online=="boolean"?this.online:typeof navigator=="undefined"||typeof navigator.onLine=="undefined"?!0:navigator.onLine}}const bs=new II;function AI(t){return Math.min(1e3*gw(2,t),3e4)}function _s(t){return(t!=null?t:"online")==="online"?bs.isOnline():!0}class Ph{constructor(e){this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}}function Es(t){return t instanceof Ph}function Mh(t){let e=!1,n=0,r=!1,i,s,o;const l=new Promise((v,b)=>{s=v,o=b}),u=v=>{r||(h(new Ph(v)),t.abort==null||t.abort())},c=()=>{e=!0},d=()=>{e=!1},f=()=>!ws.isFocused()||t.networkMode!=="always"&&!bs.isOnline(),p=v=>{r||(r=!0,t.onSuccess==null||t.onSuccess(v),i==null||i(),s(v))},h=v=>{r||(r=!0,t.onError==null||t.onError(v),i==null||i(),o(v))},y=()=>new Promise(v=>{i=b=>{const w=r||!f();return w&&v(b),w},t.onPause==null||t.onPause()}).then(()=>{i=void 0,r||t.onContinue==null||t.onContinue()}),g=()=>{if(r)return;let v;try{v=t.fn()}catch(b){v=Promise.reject(b)}Promise.resolve(v).then(p).catch(b=>{var w,E;if(r)return;const m=(w=t.retry)!=null?w:3,A=(E=t.retryDelay)!=null?E:AI,I=typeof A=="function"?A(n,b):A,O=m===!0||typeof m=="number"&&n<m||typeof m=="function"&&m(n,b);if(e||!O){h(b);return}n++,t.onFail==null||t.onFail(n,b),Th(I).then(()=>{if(f())return y()}).then(()=>{e?h(b):g()})})};return _s(t.networkMode)?g():y().then(g),{promise:l,cancel:u,continue:()=>(i==null?void 0:i())?l:Promise.resolve(),cancelRetry:c,continueRetry:d}}const nu=console;function OI(){let t=[],e=0,n=d=>{d()},r=d=>{d()};const i=d=>{let f;e++;try{f=d()}finally{e--,e||l()}return f},s=d=>{e?t.push(d):Ch(()=>{n(d)})},o=d=>(...f)=>{s(()=>{d(...f)})},l=()=>{const d=t;t=[],d.length&&Ch(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:i,batchCalls:o,schedule:s,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d}}}const ut=OI();class Rh{destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Jl(this.cacheTime)&&(this.gcTimeout=setTimeout(()=>{this.optionalRemove()},this.cacheTime))}updateCacheTime(e){this.cacheTime=Math.max(this.cacheTime||0,e!=null?e:Ji?1/0:5*60*1e3)}clearGcTimeout(){this.gcTimeout&&(clearTimeout(this.gcTimeout),this.gcTimeout=void 0)}}class TI extends Rh{constructor(e){super(),this.abortSignalConsumed=!1,this.defaultOptions=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.cache=e.cache,this.logger=e.logger||nu,this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.initialState=e.state||CI(this.options),this.state=this.initialState,this.scheduleGc()}get meta(){return this.options.meta}setOptions(e){this.options=Z(Z({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&this.cache.remove(this)}setData(e,n){const r=tu(this.state.data,e,this.options);return this.dispatch({data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(e,n){this.dispatch({type:"setState",state:e,setStateOptions:n})}cancel(e){var n;const r=this.promise;return(n=this.retryer)==null||n.cancel(e),r?r.then(Qt).catch(Qt):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(this.initialState)}isActive(){return this.observers.some(e=>e.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||this.observers.some(e=>e.getCurrentResult().isStale)}isStaleByTime(e=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!wh(this.state.dataUpdatedAt,e)}onFocus(){var e;const n=this.observers.find(r=>r.shouldFetchOnWindowFocus());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}onOnline(){var e;const n=this.observers.find(r=>r.shouldFetchOnReconnect());n&&n.refetch({cancelRefetch:!1}),(e=this.retryer)==null||e.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.cache.notify({type:"observerAdded",query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(n=>n!==e),this.observers.length||(this.retryer&&(this.abortSignalConsumed?this.retryer.cancel({revert:!0}):this.retryer.cancelRetry()),this.scheduleGc()),this.cache.notify({type:"observerRemoved",query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.dispatch({type:"invalidate"})}fetch(e,n){var r,i;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&n!=null&&n.cancelRefetch)this.cancel({silent:!0});else if(this.promise){var s;return(s=this.retryer)==null||s.continueRetry(),this.promise}}if(e&&this.setOptions(e),!this.options.queryFn){const h=this.observers.find(y=>y.options.queryFn);h&&this.setOptions(h.options)}const o=_I(),l={queryKey:this.queryKey,pageParam:void 0,meta:this.meta},u=h=>{Object.defineProperty(h,"signal",{enumerable:!0,get:()=>{if(o)return this.abortSignalConsumed=!0,o.signal}})};u(l);const c=()=>this.options.queryFn?(this.abortSignalConsumed=!1,this.options.queryFn(l)):Promise.reject("Missing queryFn for queryKey '"+this.options.queryHash+"'"),d={fetchOptions:n,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:c};if(u(d),(r=this.options.behavior)==null||r.onFetch(d),this.revertState=this.state,this.state.fetchStatus==="idle"||this.state.fetchMeta!==((i=d.fetchOptions)==null?void 0:i.meta)){var f;this.dispatch({type:"fetch",meta:(f=d.fetchOptions)==null?void 0:f.meta})}const p=h=>{if(Es(h)&&h.silent||this.dispatch({type:"error",error:h}),!Es(h)){var y,g,v,b;(y=(g=this.cache.config).onError)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,this.state.data,h,this)}this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return this.retryer=Mh({fn:d.fetchFn,abort:o==null?void 0:o.abort.bind(o),onSuccess:h=>{var y,g,v,b;if(typeof h=="undefined"){p(new Error(this.queryHash+" data is undefined"));return}this.setData(h),(y=(g=this.cache.config).onSuccess)==null||y.call(g,h,this),(v=(b=this.cache.config).onSettled)==null||v.call(b,h,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:p,onFail:(h,y)=>{this.dispatch({type:"failed",failureCount:h,error:y})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode}),this.promise=this.retryer.promise,this.promise}dispatch(e){const n=r=>{var i,s;switch(e.type){case"failed":return ae(Z({},r),{fetchFailureCount:e.failureCount,fetchFailureReason:e.error});case"pause":return ae(Z({},r),{fetchStatus:"paused"});case"continue":return ae(Z({},r),{fetchStatus:"fetching"});case"fetch":return Z(ae(Z({},r),{fetchFailureCount:0,fetchFailureReason:null,fetchMeta:(i=e.meta)!=null?i:null,fetchStatus:_s(this.options.networkMode)?"fetching":"paused"}),!r.dataUpdatedAt&&{error:null,status:"loading"});case"success":return Z(ae(Z({},r),{data:e.data,dataUpdateCount:r.dataUpdateCount+1,dataUpdatedAt:(s=e.dataUpdatedAt)!=null?s:Date.now(),error:null,isInvalidated:!1,status:"success"}),!e.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null});case"error":const o=e.error;return Es(o)&&o.revert&&this.revertState?ae(Z({},this.revertState),{fetchStatus:"idle"}):ae(Z({},r),{error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error"});case"invalidate":return ae(Z({},r),{isInvalidated:!0});case"setState":return Z(Z({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate(e)}),this.cache.notify({query:this,type:"updated",action:e})})}}function CI(t){const e=typeof t.initialData=="function"?t.initialData():t.initialData,n=typeof e!="undefined",r=n?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:e,dataUpdateCount:0,dataUpdatedAt:n?r!=null?r:Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?"success":"loading",fetchStatus:"idle"}}class SI extends Ki{constructor(e){super(),this.config=e||{},this.queries=[],this.queriesMap={}}build(e,n,r){var i;const s=n.queryKey,o=(i=n.queryHash)!=null?i:Xl(s,n);let l=this.get(o);return l||(l=new TI({cache:this,logger:e.getLogger(),queryKey:s,queryHash:o,options:e.defaultQueryOptions(n),state:r,defaultOptions:e.getQueryDefaults(s)}),this.add(l)),l}add(e){this.queriesMap[e.queryHash]||(this.queriesMap[e.queryHash]=e,this.queries.push(e),this.notify({type:"added",query:e}))}remove(e){const n=this.queriesMap[e.queryHash];n&&(e.destroy(),this.queries=this.queries.filter(r=>r!==e),n===e&&delete this.queriesMap[e.queryHash],this.notify({type:"removed",query:e}))}clear(){ut.batch(()=>{this.queries.forEach(e=>{this.remove(e)})})}get(e){return this.queriesMap[e]}getAll(){return this.queries}find(e,n){const[r]=sr(e,n);return typeof r.exact=="undefined"&&(r.exact=!0),this.queries.find(i=>bh(r,i))}findAll(e,n){const[r]=sr(e,n);return Object.keys(r).length>0?this.queries.filter(i=>bh(r,i)):this.queries}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}onFocus(){ut.batch(()=>{this.queries.forEach(e=>{e.onFocus()})})}onOnline(){ut.batch(()=>{this.queries.forEach(e=>{e.onOnline()})})}}class PI extends Rh{constructor(e){super(),this.defaultOptions=e.defaultOptions,this.mutationId=e.mutationId,this.mutationCache=e.mutationCache,this.logger=e.logger||nu,this.observers=[],this.state=e.state||MI(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=Z(Z({},this.defaultOptions),e),this.updateCacheTime(this.options.cacheTime)}get meta(){return this.options.meta}setState(e){this.dispatch({type:"setState",state:e})}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.mutationCache.notify({type:"observerAdded",mutation:this,observer:e}))}removeObserver(e){this.observers=this.observers.filter(n=>n!==e),this.scheduleGc(),this.mutationCache.notify({type:"observerRemoved",mutation:this,observer:e})}optionalRemove(){this.observers.length||(this.state.status==="loading"?this.scheduleGc():this.mutationCache.remove(this))}continue(){var e,n;return(e=(n=this.retryer)==null?void 0:n.continue())!=null?e:this.execute()}execute(){return _(this,null,function*(){const e=()=>{var O;return this.retryer=Mh({fn:()=>this.options.mutationFn?this.options.mutationFn(this.state.variables):Promise.reject("No mutationFn found"),onFail:(T,k)=>{this.dispatch({type:"failed",failureCount:T,error:k})},onPause:()=>{this.dispatch({type:"pause"})},onContinue:()=>{this.dispatch({type:"continue"})},retry:(O=this.options.retry)!=null?O:0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode}),this.retryer.promise},n=this.state.status==="loading";try{var r,i,s,o,l,u,c,d;if(!n){var f,p,h,y;this.dispatch({type:"loading",variables:this.options.variables}),yield(f=(p=this.mutationCache.config).onMutate)==null?void 0:f.call(p,this.state.variables,this);const T=yield(h=(y=this.options).onMutate)==null?void 0:h.call(y,this.state.variables);T!==this.state.context&&this.dispatch({type:"loading",context:T,variables:this.state.variables})}const O=yield e();return yield(r=(i=this.mutationCache.config).onSuccess)==null?void 0:r.call(i,O,this.state.variables,this.state.context,this),yield(s=(o=this.options).onSuccess)==null?void 0:s.call(o,O,this.state.variables,this.state.context),yield(l=(u=this.mutationCache.config).onSettled)==null?void 0:l.call(u,O,null,this.state.variables,this.state.context,this),yield(c=(d=this.options).onSettled)==null?void 0:c.call(d,O,null,this.state.variables,this.state.context),this.dispatch({type:"success",data:O}),O}catch(O){try{var g,v,b,w,E,m,A,I;throw yield(g=(v=this.mutationCache.config).onError)==null?void 0:g.call(v,O,this.state.variables,this.state.context,this),yield(b=(w=this.options).onError)==null?void 0:b.call(w,O,this.state.variables,this.state.context),yield(E=(m=this.mutationCache.config).onSettled)==null?void 0:E.call(m,void 0,O,this.state.variables,this.state.context,this),yield(A=(I=this.options).onSettled)==null?void 0:A.call(I,void 0,O,this.state.variables,this.state.context),O}finally{this.dispatch({type:"error",error:O})}}})}dispatch(e){const n=r=>{switch(e.type){case"failed":return ae(Z({},r),{failureCount:e.failureCount,failureReason:e.error});case"pause":return ae(Z({},r),{isPaused:!0});case"continue":return ae(Z({},r),{isPaused:!1});case"loading":return ae(Z({},r),{context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!_s(this.options.networkMode),status:"loading",variables:e.variables});case"success":return ae(Z({},r),{data:e.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1});case"error":return ae(Z({},r),{data:void 0,error:e.error,failureCount:r.failureCount+1,failureReason:e.error,isPaused:!1,status:"error"});case"setState":return Z(Z({},r),e.state)}};this.state=n(this.state),ut.batch(()=>{this.observers.forEach(r=>{r.onMutationUpdate(e)}),this.mutationCache.notify({mutation:this,type:"updated",action:e})})}}function MI(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0}}class RI extends Ki{constructor(e){super(),this.config=e||{},this.mutations=[],this.mutationId=0}build(e,n,r){const i=new PI({mutationCache:this,logger:e.getLogger(),mutationId:++this.mutationId,options:e.defaultMutationOptions(n),state:r,defaultOptions:n.mutationKey?e.getMutationDefaults(n.mutationKey):void 0});return this.add(i),i}add(e){this.mutations.push(e),this.notify({type:"added",mutation:e})}remove(e){this.mutations=this.mutations.filter(n=>n!==e),this.notify({type:"removed",mutation:e})}clear(){ut.batch(()=>{this.mutations.forEach(e=>{this.remove(e)})})}getAll(){return this.mutations}find(e){return typeof e.exact=="undefined"&&(e.exact=!0),this.mutations.find(n=>_h(e,n))}findAll(e){return this.mutations.filter(n=>_h(e,n))}notify(e){ut.batch(()=>{this.listeners.forEach(({listener:n})=>{n(e)})})}resumePausedMutations(){var e;return this.resuming=((e=this.resuming)!=null?e:Promise.resolve()).then(()=>{const n=this.mutations.filter(r=>r.state.isPaused);return ut.batch(()=>n.reduce((r,i)=>r.then(()=>i.continue().catch(Qt)),Promise.resolve()))}).then(()=>{this.resuming=void 0}),this.resuming}}function kI(){return{onFetch:t=>{t.fetchFn=()=>{var e,n,r,i,s,o;const l=(e=t.fetchOptions)==null||(n=e.meta)==null?void 0:n.refetchPage,u=(r=t.fetchOptions)==null||(i=r.meta)==null?void 0:i.fetchMore,c=u==null?void 0:u.pageParam,d=(u==null?void 0:u.direction)==="forward",f=(u==null?void 0:u.direction)==="backward",p=((s=t.state.data)==null?void 0:s.pages)||[],h=((o=t.state.data)==null?void 0:o.pageParams)||[];let y=h,g=!1;const v=I=>{Object.defineProperty(I,"signal",{enumerable:!0,get:()=>{var O;if((O=t.signal)!=null&&O.aborted)g=!0;else{var T;(T=t.signal)==null||T.addEventListener("abort",()=>{g=!0})}return t.signal}})},b=t.options.queryFn||(()=>Promise.reject("Missing queryFn for queryKey '"+t.options.queryHash+"'")),w=(I,O,T,k)=>(y=k?[O,...y]:[...y,O],k?[T,...I]:[...I,T]),E=(I,O,T,k)=>{if(g)return Promise.reject("Cancelled");if(typeof T=="undefined"&&!O&&I.length)return Promise.resolve(I);const P={queryKey:t.queryKey,pageParam:T,meta:t.options.meta};v(P);const S=b(P);return Promise.resolve(S).then(D=>w(I,T,D,k))};let m;if(!p.length)m=E([]);else if(d){const I=typeof c!="undefined",O=I?c:kh(t.options,p);m=E(p,I,O)}else if(f){const I=typeof c!="undefined",O=I?c:xI(t.options,p);m=E(p,I,O,!0)}else{y=[];const I=typeof t.options.getNextPageParam=="undefined";m=(l&&p[0]?l(p[0],0,p):!0)?E([],I,h[0]):Promise.resolve(w([],h[0],p[0]));for(let T=1;T<p.length;T++)m=m.then(k=>{if(l&&p[T]?l(p[T],T,p):!0){const S=I?h[T]:kh(t.options,k);return E(k,I,S)}return Promise.resolve(w(k,h[T],p[T]))})}return m.then(I=>({pages:I,pageParams:y}))}}}}function kh(t,e){return t.getNextPageParam==null?void 0:t.getNextPageParam(e[e.length-1],e)}function xI(t,e){return t.getPreviousPageParam==null?void 0:t.getPreviousPageParam(e[0],e)}class DI{constructor(e={}){this.queryCache=e.queryCache||new SI,this.mutationCache=e.mutationCache||new RI,this.logger=e.logger||nu,this.defaultOptions=e.defaultOptions||{},this.queryDefaults=[],this.mutationDefaults=[],this.mountCount=0}mount(){this.mountCount++,this.mountCount===1&&(this.unsubscribeFocus=ws.subscribe(()=>{ws.isFocused()&&(this.resumePausedMutations(),this.queryCache.onFocus())}),this.unsubscribeOnline=bs.subscribe(()=>{bs.isOnline()&&(this.resumePausedMutations(),this.queryCache.onOnline())}))}unmount(){var e,n;this.mountCount--,this.mountCount===0&&((e=this.unsubscribeFocus)==null||e.call(this),this.unsubscribeFocus=void 0,(n=this.unsubscribeOnline)==null||n.call(this),this.unsubscribeOnline=void 0)}isFetching(e,n){const[r]=sr(e,n);return r.fetchStatus="fetching",this.queryCache.findAll(r).length}isMutating(e){return this.mutationCache.findAll(ae(Z({},e),{fetching:!0})).length}getQueryData(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state.data}ensureQueryData(e,n,r){const i=Xi(e,n,r),s=this.getQueryData(i.queryKey);return s?Promise.resolve(s):this.fetchQuery(i)}getQueriesData(e){return this.getQueryCache().findAll(e).map(({queryKey:n,state:r})=>{const i=r.data;return[n,i]})}setQueryData(e,n,r){const i=this.queryCache.find(e),s=i==null?void 0:i.state.data,o=bI(n,s);if(typeof o=="undefined")return;const l=Xi(e),u=this.defaultQueryOptions(l);return this.queryCache.build(this,u).setData(o,ae(Z({},r),{manual:!0}))}setQueriesData(e,n,r){return ut.batch(()=>this.getQueryCache().findAll(e).map(({queryKey:i})=>[i,this.setQueryData(i,n,r)]))}getQueryState(e,n){var r;return(r=this.queryCache.find(e,n))==null?void 0:r.state}removeQueries(e,n){const[r]=sr(e,n),i=this.queryCache;ut.batch(()=>{i.findAll(r).forEach(s=>{i.remove(s)})})}resetQueries(e,n,r){const[i,s]=sr(e,n,r),o=this.queryCache,l=Z({type:"active"},i);return ut.batch(()=>(o.findAll(i).forEach(u=>{u.reset()}),this.refetchQueries(l,s)))}cancelQueries(e,n,r){const[i,s={}]=sr(e,n,r);typeof s.revert=="undefined"&&(s.revert=!0);const o=ut.batch(()=>this.queryCache.findAll(i).map(l=>l.cancel(s)));return Promise.all(o).then(Qt).catch(Qt)}invalidateQueries(e,n,r){const[i,s]=sr(e,n,r);return ut.batch(()=>{var o,l;if(this.queryCache.findAll(i).forEach(c=>{c.invalidate()}),i.refetchType==="none")return Promise.resolve();const u=ae(Z({},i),{type:(o=(l=i.refetchType)!=null?l:i.type)!=null?o:"active"});return this.refetchQueries(u,s)})}refetchQueries(e,n,r){const[i,s]=sr(e,n,r),o=ut.batch(()=>this.queryCache.findAll(i).filter(u=>!u.isDisabled()).map(u=>{var c;return u.fetch(void 0,ae(Z({},s),{cancelRefetch:(c=s==null?void 0:s.cancelRefetch)!=null?c:!0,meta:{refetchPage:i.refetchPage}}))}));let l=Promise.all(o).then(Qt);return s!=null&&s.throwOnError||(l=l.catch(Qt)),l}fetchQuery(e,n,r){const i=Xi(e,n,r),s=this.defaultQueryOptions(i);typeof s.retry=="undefined"&&(s.retry=!1);const o=this.queryCache.build(this,s);return o.isStaleByTime(s.staleTime)?o.fetch(s):Promise.resolve(o.state.data)}prefetchQuery(e,n,r){return this.fetchQuery(e,n,r).then(Qt).catch(Qt)}fetchInfiniteQuery(e,n,r){const i=Xi(e,n,r);return i.behavior=kI(),this.fetchQuery(i)}prefetchInfiniteQuery(e,n,r){return this.fetchInfiniteQuery(e,n,r).then(Qt).catch(Qt)}resumePausedMutations(){return this.mutationCache.resumePausedMutations()}getQueryCache(){return this.queryCache}getMutationCache(){return this.mutationCache}getLogger(){return this.logger}getDefaultOptions(){return this.defaultOptions}setDefaultOptions(e){this.defaultOptions=e}setQueryDefaults(e,n){const r=this.queryDefaults.find(i=>Or(e)===Or(i.queryKey));r?r.defaultOptions=n:this.queryDefaults.push({queryKey:e,defaultOptions:n})}getQueryDefaults(e){if(!e)return;const n=this.queryDefaults.find(r=>vs(e,r.queryKey));return n==null?void 0:n.defaultOptions}setMutationDefaults(e,n){const r=this.mutationDefaults.find(i=>Or(e)===Or(i.mutationKey));r?r.defaultOptions=n:this.mutationDefaults.push({mutationKey:e,defaultOptions:n})}getMutationDefaults(e){if(!e)return;const n=this.mutationDefaults.find(r=>vs(e,r.mutationKey));return n==null?void 0:n.defaultOptions}defaultQueryOptions(e){if(e!=null&&e._defaulted)return e;const n=ae(Z(Z(Z({},this.defaultOptions.queries),this.getQueryDefaults(e==null?void 0:e.queryKey)),e),{_defaulted:!0});return!n.queryHash&&n.queryKey&&(n.queryHash=Xl(n.queryKey,n)),typeof n.refetchOnReconnect=="undefined"&&(n.refetchOnReconnect=n.networkMode!=="always"),typeof n.useErrorBoundary=="undefined"&&(n.useErrorBoundary=!!n.suspense),n}defaultMutationOptions(e){return e!=null&&e._defaulted?e:ae(Z(Z(Z({},this.defaultOptions.mutations),this.getMutationDefaults(e==null?void 0:e.mutationKey)),e),{_defaulted:!0})}clear(){this.queryCache.clear(),this.mutationCache.clear()}}class FI extends Ki{constructor(e,n){super(),this.client=e,this.options=n,this.trackedProps=new Set,this.selectError=null,this.bindMethods(),this.setOptions(n)}bindMethods(){this.remove=this.remove.bind(this),this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.currentQuery.addObserver(this),xh(this.currentQuery,this.options)&&this.executeFetch(),this.updateTimers())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ru(this.currentQuery,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ru(this.currentQuery,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.clearStaleTimeout(),this.clearRefetchInterval(),this.currentQuery.removeObserver(this)}setOptions(e,n){const r=this.options,i=this.currentQuery;if(this.options=this.client.defaultQueryOptions(e),Zl(r,this.options)||this.client.getQueryCache().notify({type:"observerOptionsUpdated",query:this.currentQuery,observer:this}),typeof this.options.enabled!="undefined"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=r.queryKey),this.updateQuery();const s=this.hasListeners();s&&Dh(this.currentQuery,i,this.options,r)&&this.executeFetch(),this.updateResult(n),s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||this.options.staleTime!==r.staleTime)&&this.updateStaleTimeout();const o=this.computeRefetchInterval();s&&(this.currentQuery!==i||this.options.enabled!==r.enabled||o!==this.currentRefetchInterval)&&this.updateRefetchInterval(o)}getOptimisticResult(e){const n=this.client.getQueryCache().build(this.client,e),r=this.createResult(n,e);return LI(this,r,e)&&(this.currentResult=r,this.currentResultOptions=this.options,this.currentResultState=this.currentQuery.state),r}getCurrentResult(){return this.currentResult}trackResult(e){const n={};return Object.keys(e).forEach(r=>{Object.defineProperty(n,r,{configurable:!1,enumerable:!0,get:()=>(this.trackedProps.add(r),e[r])})}),n}getCurrentQuery(){return this.currentQuery}remove(){this.client.getQueryCache().remove(this.currentQuery)}refetch(r={}){var i=r,{refetchPage:e}=i,n=zn(i,["refetchPage"]);return this.fetch(ae(Z({},n),{meta:{refetchPage:e}}))}fetchOptimistic(e){const n=this.client.defaultQueryOptions(e),r=this.client.getQueryCache().build(this.client,n);return r.isFetchingOptimistic=!0,r.fetch().then(()=>this.createResult(r,n))}fetch(e){var n;return this.executeFetch(ae(Z({},e),{cancelRefetch:(n=e.cancelRefetch)!=null?n:!0})).then(()=>(this.updateResult(),this.currentResult))}executeFetch(e){this.updateQuery();let n=this.currentQuery.fetch(this.options,e);return e!=null&&e.throwOnError||(n=n.catch(Qt)),n}updateStaleTimeout(){if(this.clearStaleTimeout(),Ji||this.currentResult.isStale||!Jl(this.options.staleTime))return;const n=wh(this.currentResult.dataUpdatedAt,this.options.staleTime)+1;this.staleTimeoutId=setTimeout(()=>{this.currentResult.isStale||this.updateResult()},n)}computeRefetchInterval(){var e;return typeof this.options.refetchInterval=="function"?this.options.refetchInterval(this.currentResult.data,this.currentQuery):(e=this.options.refetchInterval)!=null?e:!1}updateRefetchInterval(e){this.clearRefetchInterval(),this.currentRefetchInterval=e,!(Ji||this.options.enabled===!1||!Jl(this.currentRefetchInterval)||this.currentRefetchInterval===0)&&(this.refetchIntervalId=setInterval(()=>{(this.options.refetchIntervalInBackground||ws.isFocused())&&this.executeFetch()},this.currentRefetchInterval))}updateTimers(){this.updateStaleTimeout(),this.updateRefetchInterval(this.computeRefetchInterval())}clearStaleTimeout(){this.staleTimeoutId&&(clearTimeout(this.staleTimeoutId),this.staleTimeoutId=void 0)}clearRefetchInterval(){this.refetchIntervalId&&(clearInterval(this.refetchIntervalId),this.refetchIntervalId=void 0)}createResult(e,n){const r=this.currentQuery,i=this.options,s=this.currentResult,o=this.currentResultState,l=this.currentResultOptions,u=e!==r,c=u?e.state:this.currentQueryInitialState,d=u?this.currentResult:this.previousQueryResult,{state:f}=e;let{dataUpdatedAt:p,error:h,errorUpdatedAt:y,fetchStatus:g,status:v}=f,b=!1,w=!1,E;if(n._optimisticResults){const T=this.hasListeners(),k=!T&&xh(e,n),P=T&&Dh(e,r,n,i);(k||P)&&(g=_s(e.options.networkMode)?"fetching":"paused",p||(v="loading")),n._optimisticResults==="isRestoring"&&(g="idle")}if(n.keepPreviousData&&!f.dataUpdatedAt&&d!=null&&d.isSuccess&&v!=="error")E=d.data,p=d.dataUpdatedAt,v=d.status,b=!0;else if(n.select&&typeof f.data!="undefined")if(s&&f.data===(o==null?void 0:o.data)&&n.select===this.selectFn)E=this.selectResult;else try{this.selectFn=n.select,E=n.select(f.data),E=tu(s==null?void 0:s.data,E,n),this.selectResult=E,this.selectError=null}catch(T){this.selectError=T}else E=f.data;if(typeof n.placeholderData!="undefined"&&typeof E=="undefined"&&v==="loading"){let T;if(s!=null&&s.isPlaceholderData&&n.placeholderData===(l==null?void 0:l.placeholderData))T=s.data;else if(T=typeof n.placeholderData=="function"?n.placeholderData():n.placeholderData,n.select&&typeof T!="undefined")try{T=n.select(T),this.selectError=null}catch(k){this.selectError=k}typeof T!="undefined"&&(v="success",E=tu(s==null?void 0:s.data,T,n),w=!0)}this.selectError&&(h=this.selectError,E=this.selectResult,y=Date.now(),v="error");const m=g==="fetching",A=v==="loading",I=v==="error";return{status:v,fetchStatus:g,isLoading:A,isSuccess:v==="success",isError:I,isInitialLoading:A&&m,data:E,dataUpdatedAt:p,error:h,errorUpdatedAt:y,failureCount:f.fetchFailureCount,failureReason:f.fetchFailureReason,errorUpdateCount:f.errorUpdateCount,isFetched:f.dataUpdateCount>0||f.errorUpdateCount>0,isFetchedAfterMount:f.dataUpdateCount>c.dataUpdateCount||f.errorUpdateCount>c.errorUpdateCount,isFetching:m,isRefetching:m&&!A,isLoadingError:I&&f.dataUpdatedAt===0,isPaused:g==="paused",isPlaceholderData:w,isPreviousData:b,isRefetchError:I&&f.dataUpdatedAt!==0,isStale:iu(e,n),refetch:this.refetch,remove:this.remove}}updateResult(e){const n=this.currentResult,r=this.createResult(this.currentQuery,this.options);if(this.currentResultState=this.currentQuery.state,this.currentResultOptions=this.options,Zl(r,n))return;this.currentResult=r;const i={cache:!0},s=()=>{if(!n)return!0;const{notifyOnChangeProps:o}=this.options,l=typeof o=="function"?o():o;if(l==="all"||!l&&!this.trackedProps.size)return!0;const u=new Set(l!=null?l:this.trackedProps);return this.options.useErrorBoundary&&u.add("error"),Object.keys(this.currentResult).some(c=>{const d=c;return this.currentResult[d]!==n[d]&&u.has(d)})};(e==null?void 0:e.listeners)!==!1&&s()&&(i.listeners=!0),this.notify(Z(Z({},i),e))}updateQuery(){const e=this.client.getQueryCache().build(this.client,this.options);if(e===this.currentQuery)return;const n=this.currentQuery;this.currentQuery=e,this.currentQueryInitialState=e.state,this.previousQueryResult=this.currentResult,this.hasListeners()&&(n==null||n.removeObserver(this),e.addObserver(this))}onQueryUpdate(e){const n={};e.type==="success"?n.onSuccess=!e.manual:e.type==="error"&&!Es(e.error)&&(n.onError=!0),this.updateResult(n),this.hasListeners()&&this.updateTimers()}notify(e){ut.batch(()=>{if(e.onSuccess){var n,r,i,s;(n=(r=this.options).onSuccess)==null||n.call(r,this.currentResult.data),(i=(s=this.options).onSettled)==null||i.call(s,this.currentResult.data,null)}else if(e.onError){var o,l,u,c;(o=(l=this.options).onError)==null||o.call(l,this.currentResult.error),(u=(c=this.options).onSettled)==null||u.call(c,void 0,this.currentResult.error)}e.listeners&&this.listeners.forEach(({listener:d})=>{d(this.currentResult)}),e.cache&&this.client.getQueryCache().notify({query:this.currentQuery,type:"observerResultsUpdated"})})}}function NI(t,e){return e.enabled!==!1&&!t.state.dataUpdatedAt&&!(t.state.status==="error"&&e.retryOnMount===!1)}function xh(t,e){return NI(t,e)||t.state.dataUpdatedAt>0&&ru(t,e,e.refetchOnMount)}function ru(t,e,n){if(e.enabled!==!1){const r=typeof n=="function"?n(t):n;return r==="always"||r!==!1&&iu(t,e)}return!1}function Dh(t,e,n,r){return n.enabled!==!1&&(t!==e||r.enabled===!1)&&(!n.suspense||t.state.status!=="error")&&iu(t,n)}function iu(t,e){return t.isStaleByTime(e.staleTime)}function LI(t,e,n){return n.keepPreviousData?!1:n.placeholderData!==void 0?e.isPlaceholderData:!Zl(t.getCurrentResult(),e)}var Fh={exports:{}},Nh={};/**
|
|
2269
2269
|
* @license React
|
|
2270
2270
|
* use-sync-external-store-shim.production.min.js
|
|
2271
2271
|
*
|
|
@@ -2332,4 +2332,4 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
|
|
|
2332
2332
|
`+G.join("</span><span class='flatpickr-weekday'>")+`
|
|
2333
2333
|
</span>
|
|
2334
2334
|
`}}function F(){n.calendarContainer.classList.add("hasWeeks");var V=je("div","flatpickr-weekwrapper");V.appendChild(je("span","flatpickr-weekday",n.l10n.weekAbbreviation));var G=je("div","flatpickr-weeks");return V.appendChild(G),{weekWrapper:V,weekNumbers:G}}function C(V,G){G===void 0&&(G=!0);var J=G?V:V-n.currentMonth;J<0&&n._hidePrevMonthArrow===!0||J>0&&n._hideNextMonthArrow===!0||(n.currentMonth+=J,(n.currentMonth<0||n.currentMonth>11)&&(n.currentYear+=n.currentMonth>11?1:-1,n.currentMonth=(n.currentMonth+12)%12,fe("onYearChange"),D()),R(),fe("onMonthChange"),ft())}function M(V,G){if(V===void 0&&(V=!0),G===void 0&&(G=!0),n.input.value="",n.altInput!==void 0&&(n.altInput.value=""),n.mobileInput!==void 0&&(n.mobileInput.value=""),n.selectedDates=[],n.latestSelectedDateObj=void 0,G===!0&&(n.currentYear=n._initialDate.getFullYear(),n.currentMonth=n._initialDate.getMonth()),n.config.enableTime===!0){var J=xc(n.config),ne=J.hours,de=J.minutes,pe=J.seconds;h(ne,de,pe)}n.redraw(),V&&fe("onChange")}function x(){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 B(){n.config!==void 0&&fe("onDestroy");for(var V=n._handlers.length;V--;)n._handlers[V].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 G=n.calendarContainer.parentNode;if(G.lastChild&&G.removeChild(G.lastChild),G.parentNode){for(;G.firstChild;)G.parentNode.insertBefore(G.firstChild,G);G.parentNode.removeChild(G)}}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(J){try{delete n[J]}catch(ne){}})}function W(V){return n.calendarContainer.contains(V)}function U(V){if(n.isOpen&&!n.config.inline){var G=Ht(V),J=W(G),ne=G===n.input||G===n.altInput||n.element.contains(G)||V.path&&V.path.indexOf&&(~V.path.indexOf(n.input)||~V.path.indexOf(n.altInput)),de=!ne&&!J&&!W(V.relatedTarget),pe=!n.config.ignoredFocusElements.some(function(Re){return Re.contains(G)});de&&pe&&(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&&u(),n.close(),n.config&&n.config.mode==="range"&&n.selectedDates.length===1&&n.clear(!1))}}function Q(V){if(!(!V||n.config.minDate&&V<n.config.minDate.getFullYear()||n.config.maxDate&&V>n.config.maxDate.getFullYear())){var G=V,J=n.currentYear!==G;n.currentYear=G||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)),J&&(n.redraw(),fe("onYearChange"),D())}}function Y(V,G){var J;G===void 0&&(G=!0);var ne=n.parseDate(V,void 0,G);if(n.config.minDate&&ne&&Vt(ne,n.config.minDate,G!==void 0?G:!n.minDateHasTime)<0||n.config.maxDate&&ne&&Vt(ne,n.config.maxDate,G!==void 0?G:!n.maxDateHasTime)>0)return!1;if(!n.config.enable&&n.config.disable.length===0)return!0;if(ne===void 0)return!1;for(var de=!!n.config.enable,pe=(J=n.config.enable)!==null&&J!==void 0?J:n.config.disable,Re=0,ye=void 0;Re<pe.length;Re++){if(ye=pe[Re],typeof ye=="function"&&ye(ne))return de;if(ye instanceof Date&&ne!==void 0&&ye.getTime()===ne.getTime())return de;if(typeof ye=="string"){var ke=n.parseDate(ye,void 0,!0);return ke&&ke.getTime()===ne.getTime()?de:!de}else if(typeof ye=="object"&&ne!==void 0&&ye.from&&ye.to&&ne.getTime()>=ye.from.getTime()&&ne.getTime()<=ye.to.getTime())return de}return!de}function X(V){return n.daysContainer!==void 0?V.className.indexOf("hidden")===-1&&V.className.indexOf("flatpickr-disabled")===-1&&n.daysContainer.contains(V):!1}function ee(V){var G=V.target===n._input,J=n._input.value.trimEnd()!==At();G&&J&&!(V.relatedTarget&&W(V.relatedTarget))&&n.setDate(n._input.value,!0,V.target===n.altInput?n.config.altFormat:n.config.dateFormat)}function le(V){var G=Ht(V),J=n.config.wrap?t.contains(G):G===n._input,ne=n.config.allowInput,de=n.isOpen&&(!ne||!J),pe=n.config.inline&&J&&!ne;if(V.keyCode===13&&J){if(ne)return n.setDate(n._input.value,!0,G===n.altInput?n.config.altFormat:n.config.dateFormat),n.close(),G.blur();n.open()}else if(W(G)||de||pe){var Re=!!n.timeContainer&&n.timeContainer.contains(G);switch(V.keyCode){case 13:Re?(V.preventDefault(),u(),Ee()):Oe(V);break;case 27:V.preventDefault(),Ee();break;case 8:case 46:J&&!n.config.allowInput&&(V.preventDefault(),n.clear());break;case 37:case 39:if(!Re&&!J){V.preventDefault();var ye=s();if(n.daysContainer!==void 0&&(ne===!1||ye&&X(ye))){var ke=V.keyCode===39?1:-1;V.ctrlKey?(V.stopPropagation(),C(ke),P(T(1),0)):P(void 0,ke)}}else n.hourElement&&n.hourElement.focus();break;case 38:case 40:V.preventDefault();var ge=V.keyCode===40?1:-1;n.daysContainer&&G.$i!==void 0||G===n.input||G===n.altInput?V.ctrlKey?(V.stopPropagation(),Q(n.currentYear-ge),P(T(1),0)):Re||P(void 0,ge*7):G===n.currentYearElement?Q(n.currentYear-ge):n.config.enableTime&&(!Re&&n.hourElement&&n.hourElement.focus(),u(V),n._debouncedChange());break;case 9:if(Re){var Ce=[n.hourElement,n.minuteElement,n.secondElement,n.amPM].concat(n.pluginElements).filter(function(Wt){return Wt}),Ke=Ce.indexOf(G);if(Ke!==-1){var kn=Ce[Ke+(V.shiftKey?-1:1)];V.preventDefault(),(kn||n._input).focus()}}else!n.config.noCalendar&&n.daysContainer&&n.daysContainer.contains(G)&&V.shiftKey&&(V.preventDefault(),n._input.focus());break}}if(n.amPM!==void 0&&G===n.amPM)switch(V.key){case n.l10n.amPM[0].charAt(0):case n.l10n.amPM[0].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[0],f(),Ot();break;case n.l10n.amPM[1].charAt(0):case n.l10n.amPM[1].charAt(0).toLowerCase():n.amPM.textContent=n.l10n.amPM[1],f(),Ot();break}(J||W(G))&&fe("onKeyDown",V)}function me(V,G){if(G===void 0&&(G="flatpickr-day"),!(n.selectedDates.length!==1||V&&(!V.classList.contains(G)||V.classList.contains("flatpickr-disabled")))){for(var J=V?V.dateObj.getTime():n.days.firstElementChild.dateObj.getTime(),ne=n.parseDate(n.selectedDates[0],void 0,!0).getTime(),de=Math.min(J,n.selectedDates[0].getTime()),pe=Math.max(J,n.selectedDates[0].getTime()),Re=!1,ye=0,ke=0,ge=de;ge<pe;ge+=OB.DAY)Y(new Date(ge),!0)||(Re=Re||ge>de&&ge<pe,ge<ne&&(!ye||ge>ye)?ye=ge:ge>ne&&(!ke||ge<ke)&&(ke=ge));var Ce=Array.from(n.rContainer.querySelectorAll("*:nth-child(-n+"+n.config.showMonths+") > ."+G));Ce.forEach(function(Ke){var kn=Ke.dateObj,Wt=kn.getTime(),Na=ye>0&&Wt<ye||ke>0&&Wt>ke;if(Na){Ke.classList.add("notAllowed"),["inRange","startRange","endRange"].forEach(function(Oi){Ke.classList.remove(Oi)});return}else if(Re&&!Na)return;["startRange","inRange","endRange","notAllowed"].forEach(function(Oi){Ke.classList.remove(Oi)}),V!==void 0&&(V.classList.add(J<=n.selectedDates[0].getTime()?"startRange":"endRange"),ne<J&&Wt===ne?Ke.classList.add("startRange"):ne>J&&Wt===ne&&Ke.classList.add("endRange"),Wt>=ye&&(ke===0||Wt<=ke)&&IB(Wt,ne,J)&&Ke.classList.add("inRange"))})}}function ve(){n.isOpen&&!n.config.static&&!n.config.inline&&re()}function Ae(V,G){if(G===void 0&&(G=n._positionElement),n.isMobile===!0){if(V){V.preventDefault();var J=Ht(V);J&&J.blur()}n.mobileInput!==void 0&&(n.mobileInput.focus(),n.mobileInput.click()),fe("onOpen");return}else if(n._input.disabled||n.config.inline)return;var ne=n.isOpen;n.isOpen=!0,ne||(n.calendarContainer.classList.add("open"),n._input.classList.add("active"),fe("onOpen"),re(G)),n.config.enableTime===!0&&n.config.noCalendar===!0&&n.config.allowInput===!1&&(V===void 0||!n.timeContainer.contains(V.relatedTarget))&&setTimeout(function(){return n.hourElement.select()},50)}function Se(V){return function(G){var J=n.config["_"+V+"Date"]=n.parseDate(G,n.config.dateFormat),ne=n.config["_"+(V==="min"?"max":"min")+"Date"];J!==void 0&&(n[V==="min"?"minDateHasTime":"maxDateHasTime"]=J.getHours()>0||J.getMinutes()>0||J.getSeconds()>0),n.selectedDates&&(n.selectedDates=n.selectedDates.filter(function(de){return Y(de)}),!n.selectedDates.length&&V==="min"&&p(J),Ot()),n.daysContainer&&(oe(),J!==void 0?n.currentYearElement[V]=J.getFullYear().toString():n.currentYearElement.removeAttribute(V),n.currentYearElement.disabled=!!ne&&J!==void 0&&ne.getFullYear()===J.getFullYear())}}function Ze(){var V=["wrap","weekNumbers","allowInput","allowInvalidPreload","clickOpens","time_24hr","enableTime","noCalendar","altInput","shorthandCurrentMonth","inline","static","enableSeconds","disableMobile"],G=It(It({},JSON.parse(JSON.stringify(t.dataset||{}))),e),J={};n.config.parseDate=G.parseDate,n.config.formatDate=G.formatDate,Object.defineProperty(n.config,"enable",{get:function(){return n.config._enable},set:function(Ce){n.config._enable=Ai(Ce)}}),Object.defineProperty(n.config,"disable",{get:function(){return n.config._disable},set:function(Ce){n.config._disable=Ai(Ce)}});var ne=G.mode==="time";if(!G.dateFormat&&(G.enableTime||ne)){var de=dt.defaultConfig.dateFormat||vi.dateFormat;J.dateFormat=G.noCalendar||ne?"H:i"+(G.enableSeconds?":S":""):de+" H:i"+(G.enableSeconds?":S":"")}if(G.altInput&&(G.enableTime||ne)&&!G.altFormat){var pe=dt.defaultConfig.altFormat||vi.altFormat;J.altFormat=G.noCalendar||ne?"h:i"+(G.enableSeconds?":S K":" K"):pe+(" h:i"+(G.enableSeconds?":S":"")+" K")}Object.defineProperty(n.config,"minDate",{get:function(){return n.config._minDate},set:Se("min")}),Object.defineProperty(n.config,"maxDate",{get:function(){return n.config._maxDate},set:Se("max")});var Re=function(Ce){return function(Ke){n.config[Ce==="min"?"_minTime":"_maxTime"]=n.parseDate(Ke,"H:i:S")}};Object.defineProperty(n.config,"minTime",{get:function(){return n.config._minTime},set:Re("min")}),Object.defineProperty(n.config,"maxTime",{get:function(){return n.config._maxTime},set:Re("max")}),G.mode==="time"&&(n.config.noCalendar=!0,n.config.enableTime=!0),Object.assign(n.config,J,G);for(var ye=0;ye<V.length;ye++)n.config[V[ye]]=n.config[V[ye]]===!0||n.config[V[ye]]==="true";Sc.filter(function(Ce){return n.config[Ce]!==void 0}).forEach(function(Ce){n.config[Ce]=Pc(n.config[Ce]||[]).map(o)}),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 ye=0;ye<n.config.plugins.length;ye++){var ke=n.config.plugins[ye](n)||{};for(var ge in ke)Sc.indexOf(ge)>-1?n.config[ge]=Pc(ke[ge]).map(o).concat(n.config[ge]):typeof G[ge]=="undefined"&&(n.config[ge]=ke[ge])}G.altInputClass||(n.config.altInputClass=Ve().className+" "+n.config.altInputClass),fe("onParseConfig")}function Ve(){return n.config.wrap?t.querySelector("[data-input]"):t}function te(){typeof n.config.locale!="object"&&typeof dt.l10ns[n.config.locale]=="undefined"&&n.config.errorHandler(new Error("flatpickr: invalid locale "+n.config.locale)),n.l10n=It(It({},dt.l10ns.default),typeof n.config.locale=="object"?n.config.locale:n.config.locale!=="default"?dt.l10ns[n.config.locale]:void 0),Rr.D="("+n.l10n.weekdays.shorthand.join("|")+")",Rr.l="("+n.l10n.weekdays.longhand.join("|")+")",Rr.M="("+n.l10n.months.shorthand.join("|")+")",Rr.F="("+n.l10n.months.longhand.join("|")+")",Rr.K="("+n.l10n.amPM[0]+"|"+n.l10n.amPM[1]+"|"+n.l10n.amPM[0].toLowerCase()+"|"+n.l10n.amPM[1].toLowerCase()+")";var V=It(It({},e),JSON.parse(JSON.stringify(t.dataset||{})));V.time_24hr===void 0&&dt.defaultConfig.time_24hr===void 0&&(n.config.time_24hr=n.l10n.time_24hr),n.formatDate=Zv(n),n.parseDate=Rc({config:n.config,l10n:n.l10n})}function re(V){if(typeof n.config.position=="function")return void n.config.position(n,V);if(n.calendarContainer!==void 0){fe("onPreCalendarPosition");var G=V||n._positionElement,J=Array.prototype.reduce.call(n.calendarContainer.children,function(b3,_3){return b3+_3.offsetHeight},0),ne=n.calendarContainer.offsetWidth,de=n.config.position.split(" "),pe=de[0],Re=de.length>1?de[1]:null,ye=G.getBoundingClientRect(),ke=window.innerHeight-ye.bottom,ge=pe==="above"||pe!=="below"&&ke<J&&ye.top>J,Ce=window.pageYOffset+ye.top+(ge?-J-2:G.offsetHeight+2);if(Tt(n.calendarContainer,"arrowTop",!ge),Tt(n.calendarContainer,"arrowBottom",ge),!n.config.inline){var Ke=window.pageXOffset+ye.left,kn=!1,Wt=!1;Re==="center"?(Ke-=(ne-ye.width)/2,kn=!0):Re==="right"&&(Ke-=ne-ye.width,Wt=!0),Tt(n.calendarContainer,"arrowLeft",!kn&&!Wt),Tt(n.calendarContainer,"arrowCenter",kn),Tt(n.calendarContainer,"arrowRight",Wt);var Na=window.document.body.offsetWidth-(window.pageXOffset+ye.right),Oi=Ke+ne>window.document.body.offsetWidth,h3=Na+ne>window.document.body.offsetWidth;if(Tt(n.calendarContainer,"rightMost",Oi),!n.config.static)if(n.calendarContainer.style.top=Ce+"px",!Oi)n.calendarContainer.style.left=Ke+"px",n.calendarContainer.style.right="auto";else if(!h3)n.calendarContainer.style.left="auto",n.calendarContainer.style.right=Na+"px";else{var od=ue();if(od===void 0)return;var p3=window.document.body.offsetWidth,m3=Math.max(0,p3/2-ne/2),g3=".flatpickr-calendar.centerMost:before",v3=".flatpickr-calendar.centerMost:after",y3=od.cssRules.length,w3="{left:"+ye.left+"px;right:auto;}";Tt(n.calendarContainer,"rightMost",!1),Tt(n.calendarContainer,"centerMost",!0),od.insertRule(g3+","+v3+w3,y3),n.calendarContainer.style.left=m3+"px",n.calendarContainer.style.right="auto"}}}}function ue(){for(var V=null,G=0;G<document.styleSheets.length;G++){var J=document.styleSheets[G];if(!!J.cssRules){try{J.cssRules}catch(ne){continue}V=J;break}}return V!=null?V:he()}function he(){var V=document.createElement("style");return document.head.appendChild(V),V.sheet}function oe(){n.config.noCalendar||n.isMobile||(D(),ft(),R())}function Ee(){n._input.focus(),window.navigator.userAgent.indexOf("MSIE")!==-1||navigator.msMaxTouchPoints!==void 0?setTimeout(n.close,0):n.close()}function Oe(V){V.preventDefault(),V.stopPropagation();var G=function(Ce){return Ce.classList&&Ce.classList.contains("flatpickr-day")&&!Ce.classList.contains("flatpickr-disabled")&&!Ce.classList.contains("notAllowed")},J=Xv(Ht(V),G);if(J!==void 0){var ne=J,de=n.latestSelectedDateObj=new Date(ne.dateObj.getTime()),pe=(de.getMonth()<n.currentMonth||de.getMonth()>n.currentMonth+n.config.showMonths-1)&&n.config.mode!=="range";if(n.selectedDateElem=ne,n.config.mode==="single")n.selectedDates=[de];else if(n.config.mode==="multiple"){var Re=Le(de);Re?n.selectedDates.splice(parseInt(Re),1):n.selectedDates.push(de)}else n.config.mode==="range"&&(n.selectedDates.length===2&&n.clear(!1,!1),n.latestSelectedDateObj=de,n.selectedDates.push(de),Vt(de,n.selectedDates[0],!0)!==0&&n.selectedDates.sort(function(Ce,Ke){return Ce.getTime()-Ke.getTime()}));if(f(),pe){var ye=n.currentYear!==de.getFullYear();n.currentYear=de.getFullYear(),n.currentMonth=de.getMonth(),ye&&(fe("onYearChange"),D()),fe("onMonthChange")}if(ft(),R(),Ot(),!pe&&n.config.mode!=="range"&&n.config.showMonths===1?O(ne):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 ke=n.config.mode==="single"&&!n.config.enableTime,ge=n.config.mode==="range"&&n.selectedDates.length===2&&!n.config.enableTime;(ke||ge)&&Ee()}v()}}var Te={locale:[te,$],showMonths:[N,l,z],minDate:[w],maxDate:[w],positionElement:[Yo],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 mt(V,G){if(V!==null&&typeof V=="object"){Object.assign(n.config,V);for(var J in V)Te[J]!==void 0&&Te[J].forEach(function(ne){return ne()})}else n.config[V]=G,Te[V]!==void 0?Te[V].forEach(function(ne){return ne()}):Sc.indexOf(V)>-1&&(n.config[V]=Pc(G));n.redraw(),Ot(!0)}function _t(V,G){var J=[];if(V instanceof Array)J=V.map(function(ne){return n.parseDate(ne,G)});else if(V instanceof Date||typeof V=="number")J=[n.parseDate(V,G)];else if(typeof V=="string")switch(n.config.mode){case"single":case"time":J=[n.parseDate(V,G)];break;case"multiple":J=V.split(n.config.conjunction).map(function(ne){return n.parseDate(ne,G)});break;case"range":J=V.split(n.l10n.rangeSeparator).map(function(ne){return n.parseDate(ne,G)});break}else n.config.errorHandler(new Error("Invalid date supplied: "+JSON.stringify(V)));n.selectedDates=n.config.allowInvalidPreload?J:J.filter(function(ne){return ne instanceof Date&&Y(ne,!1)}),n.config.mode==="range"&&n.selectedDates.sort(function(ne,de){return ne.getTime()-de.getTime()})}function qe(V,G,J){if(G===void 0&&(G=!1),J===void 0&&(J=n.config.dateFormat),V!==0&&!V||V instanceof Array&&V.length===0)return n.clear(G);_t(V,J),n.latestSelectedDateObj=n.selectedDates[n.selectedDates.length-1],n.redraw(),w(void 0,G),p(),n.selectedDates.length===0&&n.clear(!1),Ot(G),G&&fe("onChange")}function Ai(V){return V.slice().map(function(G){return typeof G=="string"||typeof G=="number"||G instanceof Date?n.parseDate(G,void 0,!0):G&&typeof G=="object"&&G.from&&G.to?{from:n.parseDate(G.from,void 0),to:n.parseDate(G.to,void 0)}:G}).filter(function(G){return G})}function et(){n.selectedDates=[],n.now=n.parseDate(n.config.now)||new Date;var V=n.config.defaultDate||((n.input.nodeName==="INPUT"||n.input.nodeName==="TEXTAREA")&&n.input.placeholder&&n.input.value===n.input.placeholder?null:n.input.value);V&&_t(V,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 tn(){if(n.input=Ve(),!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=je(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"),Yo()}function Yo(){n._positionElement=n.config.positionElement||n._input}function sd(){var V=n.config.enableTime?n.config.noCalendar?"time":"datetime-local":"date";n.mobileInput=je("input",n.input.className+" flatpickr-mobile"),n.mobileInput.tabIndex=1,n.mobileInput.type=V,n.mobileInput.disabled=n.input.disabled,n.mobileInput.required=n.input.required,n.mobileInput.placeholder=n.input.placeholder,n.mobileFormatStr=V==="datetime-local"?"Y-m-d\\TH:i:S":V==="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(G){}g(n.mobileInput,"change",function(G){n.setDate(Ht(G).value,!1,n.mobileFormatStr),fe("onChange"),fe("onClose")})}function ie(V){if(n.isOpen===!0)return n.close();n.open(V)}function fe(V,G){if(n.config!==void 0){var J=n.config[V];if(J!==void 0&&J.length>0)for(var ne=0;J[ne]&&ne<J.length;ne++)J[ne](n.selectedDates,n.input.value,n,G);V==="onChange"&&(n.input.dispatchEvent(Ie("change")),n.input.dispatchEvent(Ie("input")))}}function Ie(V){var G=document.createEvent("Event");return G.initEvent(V,!0,!0),G}function Le(V){for(var G=0;G<n.selectedDates.length;G++){var J=n.selectedDates[G];if(J instanceof Date&&Vt(J,V)===0)return""+G}return!1}function De(V){return n.config.mode!=="range"||n.selectedDates.length<2?!1:Vt(V,n.selectedDates[0])>=0&&Vt(V,n.selectedDates[1])<=0}function ft(){n.config.noCalendar||n.isMobile||!n.monthNav||(n.yearElements.forEach(function(V,G){var J=new Date(n.currentYear,n.currentMonth,1);J.setMonth(n.currentMonth+G),n.config.showMonths>1||n.config.monthSelectorType==="static"?n.monthElements[G].textContent=jo(J.getMonth(),n.config.shorthandCurrentMonth,n.l10n)+" ":n.monthsDropdownContainer.value=J.getMonth().toString(),V.value=J.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 At(V){var G=V||(n.config.altInput?n.config.altFormat:n.config.dateFormat);return n.selectedDates.map(function(J){return n.formatDate(J,G)}).filter(function(J,ne,de){return n.config.mode!=="range"||n.config.enableTime||de.indexOf(J)===ne}).join(n.config.mode!=="range"?n.config.conjunction:n.l10n.rangeSeparator)}function Ot(V){V===void 0&&(V=!0),n.mobileInput!==void 0&&n.mobileFormatStr&&(n.mobileInput.value=n.latestSelectedDateObj!==void 0?n.formatDate(n.latestSelectedDateObj,n.mobileFormatStr):""),n.input.value=At(n.config.dateFormat),n.altInput!==void 0&&(n.altInput.value=At(n.config.altFormat)),V!==!1&&fe("onValueUpdate")}function Ko(V){var G=Ht(V),J=n.prevMonthNav.contains(G),ne=n.nextMonthNav.contains(G);J||ne?C(J?-1:1):n.yearElements.indexOf(G)>=0?G.select():G.classList.contains("arrowUp")?n.changeYear(n.currentYear+1):G.classList.contains("arrowDown")&&n.changeYear(n.currentYear-1)}function Gn(V){V.preventDefault();var G=V.type==="keydown",J=Ht(V),ne=J;n.amPM!==void 0&&J===n.amPM&&(n.amPM.textContent=n.l10n.amPM[Jt(n.amPM.textContent===n.l10n.amPM[0])]);var de=parseFloat(ne.getAttribute("min")),pe=parseFloat(ne.getAttribute("max")),Re=parseFloat(ne.getAttribute("step")),ye=parseInt(ne.value,10),ke=V.delta||(G?V.which===38?1:-1:0),ge=ye+Re*ke;if(typeof ne.value!="undefined"&&ne.value.length===2){var Ce=ne===n.hourElement,Ke=ne===n.minuteElement;ge<de?(ge=pe+ge+Jt(!Ce)+(Jt(Ce)&&Jt(!n.amPM)),Ke&&m(void 0,-1,n.hourElement)):ge>pe&&(ge=ne===n.hourElement?ge-pe-Jt(!n.amPM):de,Ke&&m(void 0,1,n.hourElement)),n.amPM&&Ce&&(Re===1?ge+ye===23:Math.abs(ge-ye)>Re)&&(n.amPM.textContent=n.l10n.amPM[Jt(n.amPM.textContent===n.l10n.amPM[0])]),ne.value=Dt(ge)}}return i(),n}function yi(t,e){for(var n=Array.prototype.slice.call(t).filter(function(o){return o instanceof HTMLElement}),r=[],i=0;i<n.length;i++){var s=n[i];try{if(s.getAttribute("data-fp-omit")!==null)continue;s._flatpickr!==void 0&&(s._flatpickr.destroy(),s._flatpickr=void 0),s._flatpickr=CB(s,e||{}),r.push(s._flatpickr)}catch(o){console.error(o)}}return r.length===1?r[0]:r}typeof HTMLElement!="undefined"&&typeof HTMLCollection!="undefined"&&typeof NodeList!="undefined"&&(HTMLCollection.prototype.flatpickr=NodeList.prototype.flatpickr=function(t){return yi(this,t)},HTMLElement.prototype.flatpickr=function(t){return yi([this],t)});var dt=function(t,e){return typeof t=="string"?yi(window.document.querySelectorAll(t),e):t instanceof Node?yi([t],e):yi(t,e)};dt.defaultConfig={},dt.l10ns={en:It({},Oa),default:It({},Oa)},dt.localize=function(t){dt.l10ns.default=It(It({},dt.l10ns.default),t)},dt.setDefaults=function(t){dt.defaultConfig=It(It({},dt.defaultConfig),t)},dt.parseDate=Rc({}),dt.formatDate=Zv({}),dt.compareDates=Vt,typeof jQuery!="undefined"&&typeof jQuery.fn!="undefined"&&(jQuery.fn.flatpickr=function(t){return yi(this,t)}),Date.prototype.fp_incr=function(t){return new Date(this.getFullYear(),this.getMonth(),this.getDate()+(typeof t=="string"?parseInt(t,10):t))},typeof window!="undefined"&&(window.flatpickr=dt);const SB=ud(Object.freeze(Object.defineProperty({__proto__:null,default:dt},Symbol.toStringTag,{value:"Module"})));(function(t){function e(C){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?e=function(x){return typeof x}:e=function(x){return x&&typeof Symbol=="function"&&x.constructor===Symbol&&x!==Symbol.prototype?"symbol":typeof x},e(C)}Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var n=l(hn.default),r=s(Qv.exports),i=s(SB);function s(C){return C&&C.__esModule?C:{default:C}}function o(){if(typeof WeakMap!="function")return null;var C=new WeakMap;return o=function(){return C},C}function l(C){if(C&&C.__esModule)return C;if(C===null||e(C)!=="object"&&typeof C!="function")return{default:C};var M=o();if(M&&M.has(C))return M.get(C);var x={},B=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var W in C)if(Object.prototype.hasOwnProperty.call(C,W)){var U=B?Object.getOwnPropertyDescriptor(C,W):null;U&&(U.get||U.set)?Object.defineProperty(x,W,U):x[W]=C[W]}return x.default=C,M&&M.set(C,x),x}function u(C){return p(C)||f(C)||d(C)||c()}function c(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
2335
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(C,M){if(!!C){if(typeof C=="string")return h(C,M);var x=Object.prototype.toString.call(C).slice(8,-1);if(x==="Object"&&C.constructor&&(x=C.constructor.name),x==="Map"||x==="Set")return Array.from(C);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return h(C,M)}}function f(C){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(C))return Array.from(C)}function p(C){if(Array.isArray(C))return h(C)}function h(C,M){(M==null||M>C.length)&&(M=C.length);for(var x=0,B=new Array(M);x<M;x++)B[x]=C[x];return B}function y(){return y=Object.assign||function(C){for(var M=1;M<arguments.length;M++){var x=arguments[M];for(var B in x)Object.prototype.hasOwnProperty.call(x,B)&&(C[B]=x[B])}return C},y.apply(this,arguments)}function g(C,M){if(C==null)return{};var x=v(C,M),B,W;if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(C);for(W=0;W<U.length;W++)B=U[W],!(M.indexOf(B)>=0)&&(!Object.prototype.propertyIsEnumerable.call(C,B)||(x[B]=C[B]))}return x}function v(C,M){if(C==null)return{};var x={},B=Object.keys(C),W,U;for(U=0;U<B.length;U++)W=B[U],!(M.indexOf(W)>=0)&&(x[W]=C[W]);return x}function b(C,M){var x=Object.keys(C);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(C);M&&(B=B.filter(function(W){return Object.getOwnPropertyDescriptor(C,W).enumerable})),x.push.apply(x,B)}return x}function w(C){for(var M=1;M<arguments.length;M++){var x=arguments[M]!=null?arguments[M]:{};M%2?b(Object(x),!0).forEach(function(B){D(C,B,x[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(x)):b(Object(x)).forEach(function(B){Object.defineProperty(C,B,Object.getOwnPropertyDescriptor(x,B))})}return C}function E(C,M){if(!(C instanceof M))throw new TypeError("Cannot call a class as a function")}function m(C,M){for(var x=0;x<M.length;x++){var B=M[x];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(C,B.key,B)}}function A(C,M,x){return M&&m(C.prototype,M),x&&m(C,x),C}function I(C,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(M&&M.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),M&&O(C,M)}function O(C,M){return O=Object.setPrototypeOf||function(B,W){return B.__proto__=W,B},O(C,M)}function T(C){var M=S();return function(){var B=R(C),W;if(M){var U=R(this).constructor;W=Reflect.construct(B,arguments,U)}else W=B.apply(this,arguments);return k(this,W)}}function k(C,M){return M&&(e(M)==="object"||typeof M=="function")?M:P(C)}function P(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function S(){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(C){return!1}}function R(C){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},R(C)}function D(C,M,x){return M in C?Object.defineProperty(C,M,{value:x,enumerable:!0,configurable:!0,writable:!0}):C[M]=x,C}var L=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],N=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),H=["onCreate","onDestroy"],q=r.default.func,z=function(C){I(x,C);var M=T(x);function x(){var B;E(this,x);for(var W=arguments.length,U=new Array(W),Q=0;Q<W;Q++)U[Q]=arguments[Q];return B=M.call.apply(M,[this].concat(U)),D(P(B),"createFlatpickrInstance",function(){var Y=w({onClose:function(){B.node.blur&&B.node.blur()}},B.props.options);Y=$(Y,B.props),B.flatpickr=(0,i.default)(B.node,Y),B.props.hasOwnProperty("value")&&B.flatpickr.setDate(B.props.value,!1);var X=B.props.onCreate;X&&X(B.flatpickr)}),D(P(B),"destroyFlatpickrInstance",function(){var Y=B.props.onDestroy;Y&&Y(B.flatpickr),B.flatpickr.destroy(),B.flatpickr=null}),D(P(B),"handleNodeChange",function(Y){B.node=Y,B.flatpickr&&(B.destroyFlatpickrInstance(),B.createFlatpickrInstance())}),B}return A(x,[{key:"componentDidUpdate",value:function(W){var U=this.props.options,Q=W.options;U=$(U,this.props),Q=$(Q,W);for(var Y=Object.getOwnPropertyNames(U),X=Y.length-1;X>=0;X--){var ee=Y[X],le=U[ee];le!==Q[ee]&&(L.indexOf(ee)!==-1&&!Array.isArray(le)&&(le=[le]),this.flatpickr.set(ee,le))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&W.value&&Array.isArray(W.value)&&this.props.value.every(function(me,ve){W[ve]}))&&this.props.value!==W.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 W=this.props,U=W.options,Q=W.defaultValue,Y=W.value,X=W.children,ee=W.render,le=g(W,["options","defaultValue","value","children","render"]);return L.forEach(function(me){delete le[me]}),H.forEach(function(me){delete le[me]}),ee?ee(w(w({},le),{},{defaultValue:Q,value:Y}),this.handleNodeChange):U.wrap?n.default.createElement("div",y({},le,{ref:this.handleNodeChange}),X):n.default.createElement("input",y({},le,{defaultValue:Q,ref:this.handleNodeChange}))}}]),x}(n.Component);D(z,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:N,onOpen:N,onClose:N,onMonthChange:N,onYearChange:N,onReady:N,onValueUpdate:N,onDayCreate:N,onCreate:q,onDestroy:q,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}),D(z,"defaultProps",{options:{}});function $(C,M){var x=w({},C);return L.forEach(function(B){if(M.hasOwnProperty(B)){var W;x[B]&&!Array.isArray(x[B])?x[B]=[x[B]]:x[B]||(x[B]=[]);var U=Array.isArray(M[B])?M[B]:[M[B]];(W=x[B]).push.apply(W,u(U))}}),x}var F=z;t.default=F})(zv);const PB=vw(zv);var Ft="top",Xt="bottom",Zt="right",Nt="left",Dc="auto",Ca=[Ft,Xt,Zt,Nt],wi="start",Sa="end",MB="clippingParents",ty="viewport",Pa="popper",RB="reference",ny=Ca.reduce(function(t,e){return t.concat([e+"-"+wi,e+"-"+Sa])},[]),ry=[].concat(Ca,[Dc]).reduce(function(t,e){return t.concat([e,e+"-"+wi,e+"-"+Sa])},[]),kB="beforeRead",xB="read",DB="afterRead",FB="beforeMain",NB="main",LB="afterMain",BB="beforeWrite",$B="write",UB="afterWrite",jB=[kB,xB,DB,FB,NB,LB,BB,$B,UB];function Pn(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function kr(t){var e=qt(t).Element;return t instanceof e||t instanceof Element}function en(t){var e=qt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Fc(t){if(typeof ShadowRoot=="undefined")return!1;var e=qt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function HB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!en(s)||!Pn(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var l=i[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function VB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=o.reduce(function(u,c){return u[c]="",u},{});!en(i)||!Pn(i)||(Object.assign(i.style,l),Object.keys(s).forEach(function(u){i.removeAttribute(u)}))})}}const iy={name:"applyStyles",enabled:!0,phase:"write",fn:HB,effect:VB,requires:["computeStyles"]};function Mn(t){return t.split("-")[0]}var xr=Math.max,Ho=Math.min,bi=Math.round;function Nc(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ay(){return!/^((?!chrome|android).)*safari/i.test(Nc())}function _i(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&en(t)&&(i=t.offsetWidth>0&&bi(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&bi(r.height)/t.offsetHeight||1);var o=kr(t)?qt(t):window,l=o.visualViewport,u=!ay()&&n,c=(r.left+(u&&l?l.offsetLeft:0))/i,d=(r.top+(u&&l?l.offsetTop:0))/s,f=r.width/i,p=r.height/s;return{width:f,height:p,top:d,right:c+f,bottom:d+p,left:c,x:c,y:d}}function Lc(t){var e=_i(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function sy(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Fc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wn(t){return qt(t).getComputedStyle(t)}function qB(t){return["table","td","th"].indexOf(Pn(t))>=0}function ur(t){return((kr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Vo(t){return Pn(t)==="html"?t:t.assignedSlot||t.parentNode||(Fc(t)?t.host:null)||ur(t)}function oy(t){return!en(t)||Wn(t).position==="fixed"?null:t.offsetParent}function WB(t){var e=/firefox/i.test(Nc()),n=/Trident/i.test(Nc());if(n&&en(t)){var r=Wn(t);if(r.position==="fixed")return null}var i=Vo(t);for(Fc(i)&&(i=i.host);en(i)&&["html","body"].indexOf(Pn(i))<0;){var s=Wn(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Ma(t){for(var e=qt(t),n=oy(t);n&&qB(n)&&Wn(n).position==="static";)n=oy(n);return n&&(Pn(n)==="html"||Pn(n)==="body"&&Wn(n).position==="static")?e:n||WB(t)||e}function Bc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ra(t,e,n){return xr(t,Ho(e,n))}function GB(t,e,n){var r=Ra(t,e,n);return r>n?n:r}function ly(){return{top:0,right:0,bottom:0,left:0}}function uy(t){return Object.assign({},ly(),t)}function cy(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var zB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,uy(typeof e!="number"?e:cy(e,Ca))};function QB(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Mn(n.placement),u=Bc(l),c=[Nt,Zt].indexOf(l)>=0,d=c?"height":"width";if(!(!s||!o)){var f=zB(i.padding,n),p=Lc(s),h=u==="y"?Ft:Nt,y=u==="y"?Xt:Zt,g=n.rects.reference[d]+n.rects.reference[u]-o[u]-n.rects.popper[d],v=o[u]-n.rects.reference[u],b=Ma(s),w=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,E=g/2-v/2,m=f[h],A=w-p[d]-f[y],I=w/2-p[d]/2+E,O=Ra(m,I,A),T=u;n.modifiersData[r]=(e={},e[T]=O,e.centerOffset=O-I,e)}}function YB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!sy(e.elements.popper,i)||(e.elements.arrow=i))}const KB={name:"arrow",enabled:!0,phase:"main",fn:QB,effect:YB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ei(t){return t.split("-")[1]}var JB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function XB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:bi(n*i)/i||0,y:bi(r*i)/i||0}}function dy(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=o.x,h=p===void 0?0:p,y=o.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),E=Nt,m=Ft,A=window;if(c){var I=Ma(n),O="clientHeight",T="clientWidth";if(I===qt(n)&&(I=ur(n),Wn(I).position!=="static"&&l==="absolute"&&(O="scrollHeight",T="scrollWidth")),I=I,i===Ft||(i===Nt||i===Zt)&&s===Sa){m=Xt;var k=f&&I===A&&A.visualViewport?A.visualViewport.height:I[O];g-=k-r.height,g*=u?1:-1}if(i===Nt||(i===Ft||i===Xt)&&s===Sa){E=Zt;var P=f&&I===A&&A.visualViewport?A.visualViewport.width:I[T];h-=P-r.width,h*=u?1:-1}}var S=Object.assign({position:l},c&&JB),R=d===!0?XB({x:h,y:g},qt(n)):{x:h,y:g};if(h=R.x,g=R.y,u){var D;return Object.assign({},S,(D={},D[m]=w?"0":"",D[E]=b?"0":"",D.transform=(A.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",D))}return Object.assign({},S,(e={},e[m]=w?g+"px":"",e[E]=b?h+"px":"",e.transform="",e))}function ZB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Mn(e.placement),variation:Ei(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,dy(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,dy(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const e5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ZB,data:{}};var qo={passive:!0};function t5(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,l=o===void 0?!0:o,u=qt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",n.update,qo)}),l&&u.addEventListener("resize",n.update,qo),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",n.update,qo)}),l&&u.removeEventListener("resize",n.update,qo)}}const n5={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:t5,data:{}};var r5={left:"right",right:"left",bottom:"top",top:"bottom"};function Wo(t){return t.replace(/left|right|bottom|top/g,function(e){return r5[e]})}var i5={start:"end",end:"start"};function fy(t){return t.replace(/start|end/g,function(e){return i5[e]})}function $c(t){var e=qt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Uc(t){return _i(ur(t)).left+$c(t).scrollLeft}function a5(t,e){var n=qt(t),r=ur(t),i=n.visualViewport,s=r.clientWidth,o=r.clientHeight,l=0,u=0;if(i){s=i.width,o=i.height;var c=ay();(c||!c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:o,x:l+Uc(t),y:u}}function s5(t){var e,n=ur(t),r=$c(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=xr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=xr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Uc(t),u=-r.scrollTop;return Wn(i||n).direction==="rtl"&&(l+=xr(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function jc(t){var e=Wn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function hy(t){return["html","body","#document"].indexOf(Pn(t))>=0?t.ownerDocument.body:en(t)&&jc(t)?t:hy(Vo(t))}function ka(t,e){var n;e===void 0&&(e=[]);var r=hy(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=qt(r),o=i?[s].concat(s.visualViewport||[],jc(r)?r:[]):r,l=e.concat(o);return i?l:l.concat(ka(Vo(o)))}function Hc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function o5(t,e){var n=_i(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function py(t,e,n){return e===ty?Hc(a5(t,n)):kr(e)?o5(e,n):Hc(s5(ur(t)))}function l5(t){var e=ka(Vo(t)),n=["absolute","fixed"].indexOf(Wn(t).position)>=0,r=n&&en(t)?Ma(t):t;return kr(r)?e.filter(function(i){return kr(i)&&sy(i,r)&&Pn(i)!=="body"}):[]}function u5(t,e,n,r){var i=e==="clippingParents"?l5(t):[].concat(e),s=[].concat(i,[n]),o=s[0],l=s.reduce(function(u,c){var d=py(t,c,r);return u.top=xr(d.top,u.top),u.right=Ho(d.right,u.right),u.bottom=Ho(d.bottom,u.bottom),u.left=xr(d.left,u.left),u},py(t,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function my(t){var e=t.reference,n=t.element,r=t.placement,i=r?Mn(r):null,s=r?Ei(r):null,o=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case Ft:u={x:o,y:e.y-n.height};break;case Xt:u={x:o,y:e.y+e.height};break;case Zt:u={x:e.x+e.width,y:l};break;case Nt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=i?Bc(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case wi:u[c]=u[c]-(e[d]/2-n[d]/2);break;case Sa:u[c]=u[c]+(e[d]/2-n[d]/2);break}}return u}function xa(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,o=s===void 0?t.strategy:s,l=n.boundary,u=l===void 0?MB:l,c=n.rootBoundary,d=c===void 0?ty:c,f=n.elementContext,p=f===void 0?Pa:f,h=n.altBoundary,y=h===void 0?!1:h,g=n.padding,v=g===void 0?0:g,b=uy(typeof v!="number"?v:cy(v,Ca)),w=p===Pa?RB:Pa,E=t.rects.popper,m=t.elements[y?w:p],A=u5(kr(m)?m:m.contextElement||ur(t.elements.popper),u,d,o),I=_i(t.elements.reference),O=my({reference:I,element:E,strategy:"absolute",placement:i}),T=Hc(Object.assign({},E,O)),k=p===Pa?T:I,P={top:A.top-k.top+b.top,bottom:k.bottom-A.bottom+b.bottom,left:A.left-k.left+b.left,right:k.right-A.right+b.right},S=t.modifiersData.offset;if(p===Pa&&S){var R=S[i];Object.keys(P).forEach(function(D){var L=[Zt,Xt].indexOf(D)>=0?1:-1,N=[Ft,Xt].indexOf(D)>=0?"y":"x";P[D]+=R[N]*L})}return P}function c5(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?ry:u,d=Ei(r),f=d?l?ny:ny.filter(function(y){return Ei(y)===d}):Ca,p=f.filter(function(y){return c.indexOf(y)>=0});p.length===0&&(p=f);var h=p.reduce(function(y,g){return y[g]=xa(t,{placement:g,boundary:i,rootBoundary:s,padding:o})[Mn(g)],y},{});return Object.keys(h).sort(function(y,g){return h[y]-h[g]})}function d5(t){if(Mn(t)===Dc)return[];var e=Wo(t);return[fy(t),e,fy(e)]}function f5(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,l=o===void 0?!0:o,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,y=h===void 0?!0:h,g=n.allowedAutoPlacements,v=e.options.placement,b=Mn(v),w=b===v,E=u||(w||!y?[Wo(v)]:d5(v)),m=[v].concat(E).reduce(function(B,W){return B.concat(Mn(W)===Dc?c5(e,{placement:W,boundary:d,rootBoundary:f,padding:c,flipVariations:y,allowedAutoPlacements:g}):W)},[]),A=e.rects.reference,I=e.rects.popper,O=new Map,T=!0,k=m[0],P=0;P<m.length;P++){var S=m[P],R=Mn(S),D=Ei(S)===wi,L=[Ft,Xt].indexOf(R)>=0,N=L?"width":"height",H=xa(e,{placement:S,boundary:d,rootBoundary:f,altBoundary:p,padding:c}),q=L?D?Zt:Nt:D?Xt:Ft;A[N]>I[N]&&(q=Wo(q));var z=Wo(q),$=[];if(s&&$.push(H[R]<=0),l&&$.push(H[q]<=0,H[z]<=0),$.every(function(B){return B})){k=S,T=!1;break}O.set(S,$)}if(T)for(var F=y?3:1,C=function(W){var U=m.find(function(Q){var Y=O.get(Q);if(Y)return Y.slice(0,W).every(function(X){return X})});if(U)return k=U,"break"},M=F;M>0;M--){var x=C(M);if(x==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const h5={name:"flip",enabled:!0,phase:"main",fn:f5,requiresIfExists:["offset"],data:{_skip:!1}};function gy(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function vy(t){return[Ft,Zt,Xt,Nt].some(function(e){return t[e]>=0})}function p5(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=xa(e,{elementContext:"reference"}),l=xa(e,{altBoundary:!0}),u=gy(o,r),c=gy(l,i,s),d=vy(u),f=vy(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const m5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:p5};function g5(t,e,n){var r=Mn(t),i=[Nt,Ft].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],l=s[1];return o=o||0,l=(l||0)*i,[Nt,Zt].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function v5(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=ry.reduce(function(d,f){return d[f]=g5(f,e.rects,s),d},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const y5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:v5};function w5(t){var e=t.state,n=t.name;e.modifiersData[n]=my({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const b5={name:"popperOffsets",enabled:!0,phase:"read",fn:w5,data:{}};function _5(t){return t==="x"?"y":"x"}function E5(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,l=o===void 0?!1:o,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,y=n.tetherOffset,g=y===void 0?0:y,v=xa(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),b=Mn(e.placement),w=Ei(e.placement),E=!w,m=Bc(b),A=_5(m),I=e.modifiersData.popperOffsets,O=e.rects.reference,T=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,P=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(!!I){if(s){var D,L=m==="y"?Ft:Nt,N=m==="y"?Xt:Zt,H=m==="y"?"height":"width",q=I[m],z=q+v[L],$=q-v[N],F=h?-T[H]/2:0,C=w===wi?O[H]:T[H],M=w===wi?-T[H]:-O[H],x=e.elements.arrow,B=h&&x?Lc(x):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ly(),U=W[L],Q=W[N],Y=Ra(0,O[H],B[H]),X=E?O[H]/2-F-Y-U-P.mainAxis:C-Y-U-P.mainAxis,ee=E?-O[H]/2+F+Y+Q+P.mainAxis:M+Y+Q+P.mainAxis,le=e.elements.arrow&&Ma(e.elements.arrow),me=le?m==="y"?le.clientTop||0:le.clientLeft||0:0,ve=(D=S==null?void 0:S[m])!=null?D:0,Ae=q+X-ve-me,Se=q+ee-ve,Ze=Ra(h?Ho(z,Ae):z,q,h?xr($,Se):$);I[m]=Ze,R[m]=Ze-q}if(l){var Ve,te=m==="x"?Ft:Nt,re=m==="x"?Xt:Zt,ue=I[A],he=A==="y"?"height":"width",oe=ue+v[te],Ee=ue-v[re],Oe=[Ft,Nt].indexOf(b)!==-1,Te=(Ve=S==null?void 0:S[A])!=null?Ve:0,mt=Oe?oe:ue-O[he]-T[he]-Te+P.altAxis,_t=Oe?ue+O[he]+T[he]-Te-P.altAxis:Ee,qe=h&&Oe?GB(mt,ue,_t):Ra(h?mt:oe,ue,h?_t:Ee);I[A]=qe,R[A]=qe-ue}e.modifiersData[r]=R}}const I5={name:"preventOverflow",enabled:!0,phase:"main",fn:E5,requiresIfExists:["offset"]};function A5(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function O5(t){return t===qt(t)||!en(t)?$c(t):A5(t)}function T5(t){var e=t.getBoundingClientRect(),n=bi(e.width)/t.offsetWidth||1,r=bi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function C5(t,e,n){n===void 0&&(n=!1);var r=en(e),i=en(e)&&T5(e),s=ur(e),o=_i(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Pn(e)!=="body"||jc(s))&&(l=O5(e)),en(e)?(u=_i(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Uc(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function S5(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function P5(t){var e=S5(t);return jB.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function M5(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function R5(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var yy={placement:"bottom",modifiers:[],strategy:"absolute"};function wy(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function k5(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?yy:i;return function(l,u,c){c===void 0&&(c=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},yy,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],p=!1,h={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;g(),d.options=Object.assign({},s,d.options,w),d.scrollParents={reference:kr(l)?ka(l):l.contextElement?ka(l.contextElement):[],popper:ka(u)};var E=P5(R5([].concat(r,d.options.modifiers)));return d.orderedModifiers=E.filter(function(m){return m.enabled}),y(),h.update()},forceUpdate:function(){if(!p){var b=d.elements,w=b.reference,E=b.popper;if(!!wy(w,E)){d.rects={reference:C5(w,Ma(E),d.options.strategy==="fixed"),popper:Lc(E)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(P){return d.modifiersData[P.name]=Object.assign({},P.data)});for(var m=0;m<d.orderedModifiers.length;m++){if(d.reset===!0){d.reset=!1,m=-1;continue}var A=d.orderedModifiers[m],I=A.fn,O=A.options,T=O===void 0?{}:O,k=A.name;typeof I=="function"&&(d=I({state:d,options:T,name:k,instance:h})||d)}}}},update:M5(function(){return new Promise(function(v){h.forceUpdate(),v(d)})}),destroy:function(){g(),p=!0}};if(!wy(l,u))return h;h.setOptions(c).then(function(v){!p&&c.onFirstUpdate&&c.onFirstUpdate(v)});function y(){d.orderedModifiers.forEach(function(v){var b=v.name,w=v.options,E=w===void 0?{}:w,m=v.effect;if(typeof m=="function"){var A=m({state:d,name:b,instance:h,options:E}),I=function(){};f.push(A||I)}})}function g(){f.forEach(function(v){return v()}),f=[]}return h}}var x5=[n5,b5,e5,iy,y5,h5,I5,KB,m5],D5=k5({defaultModifiers:x5}),F5="tippy-box",by="tippy-content",N5="tippy-backdrop",_y="tippy-arrow",Ey="tippy-svg-arrow",Dr={passive:!0,capture:!0},Iy=function(){return document.body};function Vc(t,e,n){if(Array.isArray(t)){var r=t[e];return r==null?Array.isArray(n)?n[e]:n:r}return t}function qc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ay(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Oy(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function L5(t){return t.split(/\s+/).filter(Boolean)}function Ii(t){return[].concat(t)}function Ty(t,e){t.indexOf(e)===-1&&t.push(e)}function B5(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function $5(t){return t.split("-")[0]}function Go(t){return[].slice.call(t)}function Cy(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Da(){return document.createElement("div")}function zo(t){return["Element","Fragment"].some(function(e){return qc(t,e)})}function U5(t){return qc(t,"NodeList")}function j5(t){return qc(t,"MouseEvent")}function H5(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function V5(t){return zo(t)?[t]:U5(t)?Go(t):Array.isArray(t)?t:Go(document.querySelectorAll(t))}function Wc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Sy(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function q5(t){var e,n=Ii(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function W5(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,o=i.popperState,l=i.props,u=l.interactiveBorder,c=$5(o.placement),d=o.modifiersData.offset;if(!d)return!0;var f=c==="bottom"?d.top.y:0,p=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,y=c==="left"?d.right.x:0,g=s.top-r+f>u,v=r-s.bottom-p>u,b=s.left-n+h>u,w=n-s.right-y>u;return g||v||b||w})}function Gc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Py(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Rn={isTouch:!1},My=0;function G5(){Rn.isTouch||(Rn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ry))}function Ry(){var t=performance.now();t-My<20&&(Rn.isTouch=!1,document.removeEventListener("mousemove",Ry)),My=t}function z5(){var t=document.activeElement;if(H5(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Q5(){document.addEventListener("touchstart",G5,Dr),window.addEventListener("blur",z5)}var Y5=typeof window!="undefined"&&typeof document!="undefined",K5=Y5?!!window.msCrypto:!1,J5={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},X5={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fn=Object.assign({appendTo:Iy,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},J5,X5),Z5=Object.keys(fn),e$=function(e){var n=Object.keys(e);n.forEach(function(r){fn[r]=e[r]})};function ky(t){var e=t.plugins||[],n=e.reduce(function(r,i){var s=i.name,o=i.defaultValue;if(s){var l;r[s]=t[s]!==void 0?t[s]:(l=fn[s])!=null?l:o}return r},{});return Object.assign({},t,n)}function t$(t,e){var n=e?Object.keys(ky(Object.assign({},fn,{plugins:e}))):Z5,r=n.reduce(function(i,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch(l){i[s]=o}return i},{});return r}function xy(t,e){var n=Object.assign({},e,{content:Ay(e.content,[t])},e.ignoreAttributes?{}:t$(t,e.plugins));return n.aria=Object.assign({},fn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var n$=function(){return"innerHTML"};function zc(t,e){t[n$()]=e}function Dy(t){var e=Da();return t===!0?e.className=_y:(e.className=Ey,zo(t)?e.appendChild(t):zc(e,t)),e}function Fy(t,e){zo(e.content)?(zc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?zc(t,e.content):t.textContent=e.content)}function Qc(t){var e=t.firstElementChild,n=Go(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(by)}),arrow:n.find(function(r){return r.classList.contains(_y)||r.classList.contains(Ey)}),backdrop:n.find(function(r){return r.classList.contains(N5)})}}function Ny(t){var e=Da(),n=Da();n.className=F5,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Da();r.className=by,r.setAttribute("data-state","hidden"),Fy(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,o){var l=Qc(e),u=l.box,c=l.content,d=l.arrow;o.theme?u.setAttribute("data-theme",o.theme):u.removeAttribute("data-theme"),typeof o.animation=="string"?u.setAttribute("data-animation",o.animation):u.removeAttribute("data-animation"),o.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?u.setAttribute("role",o.role):u.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Fy(c,t.props),o.arrow?d?s.arrow!==o.arrow&&(u.removeChild(d),u.appendChild(Dy(o.arrow))):u.appendChild(Dy(o.arrow)):d&&u.removeChild(d)}return{popper:e,onUpdate:i}}Ny.$$tippy=!0;var r$=1,Qo=[],Yc=[];function i$(t,e){var n=xy(t,Object.assign({},fn,ky(Cy(e)))),r,i,s,o=!1,l=!1,u=!1,c=!1,d,f,p,h=[],y=Oy(Ae,n.interactiveDebounce),g,v=r$++,b=null,w=B5(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:v,reference:t,popper:Da(),popperInstance:b,props:n,state:E,plugins:w,clearDelayTimeouts:mt,setProps:_t,setContent:qe,show:Ai,hide:et,hideWithInteractivity:tn,enable:Oe,disable:Te,unmount:Yo,destroy:sd};if(!n.render)return m;var A=n.render(m),I=A.popper,O=A.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+m.id,m.popper=I,t._tippy=m,I._tippy=m;var T=w.map(function(ie){return ie.fn(m)}),k=t.hasAttribute("aria-expanded");return le(),F(),q(),z("onCreate",[m]),n.showOnCreate&&oe(),I.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",y)}),m;function P(){var ie=m.props.touch;return Array.isArray(ie)?ie:[ie,0]}function S(){return P()[0]==="hold"}function R(){var ie;return!!((ie=m.props.render)!=null&&ie.$$tippy)}function D(){return g||t}function L(){var ie=D().parentNode;return ie?q5(ie):document}function N(){return Qc(I)}function H(ie){return m.state.isMounted&&!m.state.isVisible||Rn.isTouch||d&&d.type==="focus"?0:Vc(m.props.delay,ie?0:1,fn.delay)}function q(ie){ie===void 0&&(ie=!1),I.style.pointerEvents=m.props.interactive&&!ie?"":"none",I.style.zIndex=""+m.props.zIndex}function z(ie,fe,Ie){if(Ie===void 0&&(Ie=!0),T.forEach(function(De){De[ie]&&De[ie].apply(De,fe)}),Ie){var Le;(Le=m.props)[ie].apply(Le,fe)}}function $(){var ie=m.props.aria;if(!!ie.content){var fe="aria-"+ie.content,Ie=I.id,Le=Ii(m.props.triggerTarget||t);Le.forEach(function(De){var ft=De.getAttribute(fe);if(m.state.isVisible)De.setAttribute(fe,ft?ft+" "+Ie:Ie);else{var At=ft&&ft.replace(Ie,"").trim();At?De.setAttribute(fe,At):De.removeAttribute(fe)}})}}function F(){if(!(k||!m.props.aria.expanded)){var ie=Ii(m.props.triggerTarget||t);ie.forEach(function(fe){m.props.interactive?fe.setAttribute("aria-expanded",m.state.isVisible&&fe===D()?"true":"false"):fe.removeAttribute("aria-expanded")})}}function C(){L().removeEventListener("mousemove",y),Qo=Qo.filter(function(ie){return ie!==y})}function M(ie){if(!(Rn.isTouch&&(u||ie.type==="mousedown"))){var fe=ie.composedPath&&ie.composedPath()[0]||ie.target;if(!(m.props.interactive&&Py(I,fe))){if(Ii(m.props.triggerTarget||t).some(function(Ie){return Py(Ie,fe)})){if(Rn.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else z("onClickOutside",[m,ie]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),l=!0,setTimeout(function(){l=!1}),m.state.isMounted||U())}}}function x(){u=!0}function B(){u=!1}function W(){var ie=L();ie.addEventListener("mousedown",M,!0),ie.addEventListener("touchend",M,Dr),ie.addEventListener("touchstart",B,Dr),ie.addEventListener("touchmove",x,Dr)}function U(){var ie=L();ie.removeEventListener("mousedown",M,!0),ie.removeEventListener("touchend",M,Dr),ie.removeEventListener("touchstart",B,Dr),ie.removeEventListener("touchmove",x,Dr)}function Q(ie,fe){X(ie,function(){!m.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&fe()})}function Y(ie,fe){X(ie,fe)}function X(ie,fe){var Ie=N().box;function Le(De){De.target===Ie&&(Gc(Ie,"remove",Le),fe())}if(ie===0)return fe();Gc(Ie,"remove",f),Gc(Ie,"add",Le),f=Le}function ee(ie,fe,Ie){Ie===void 0&&(Ie=!1);var Le=Ii(m.props.triggerTarget||t);Le.forEach(function(De){De.addEventListener(ie,fe,Ie),h.push({node:De,eventType:ie,handler:fe,options:Ie})})}function le(){S()&&(ee("touchstart",ve,{passive:!0}),ee("touchend",Se,{passive:!0})),L5(m.props.trigger).forEach(function(ie){if(ie!=="manual")switch(ee(ie,ve),ie){case"mouseenter":ee("mouseleave",Se);break;case"focus":ee(K5?"focusout":"blur",Ze);break;case"focusin":ee("focusout",Ze);break}})}function me(){h.forEach(function(ie){var fe=ie.node,Ie=ie.eventType,Le=ie.handler,De=ie.options;fe.removeEventListener(Ie,Le,De)}),h=[]}function ve(ie){var fe,Ie=!1;if(!(!m.state.isEnabled||Ve(ie)||l)){var Le=((fe=d)==null?void 0:fe.type)==="focus";d=ie,g=ie.currentTarget,F(),!m.state.isVisible&&j5(ie)&&Qo.forEach(function(De){return De(ie)}),ie.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||o)&&m.props.hideOnClick!==!1&&m.state.isVisible?Ie=!0:oe(ie),ie.type==="click"&&(o=!Ie),Ie&&!Le&&Ee(ie)}}function Ae(ie){var fe=ie.target,Ie=D().contains(fe)||I.contains(fe);if(!(ie.type==="mousemove"&&Ie)){var Le=he().concat(I).map(function(De){var ft,At=De._tippy,Ot=(ft=At.popperInstance)==null?void 0:ft.state;return Ot?{popperRect:De.getBoundingClientRect(),popperState:Ot,props:n}:null}).filter(Boolean);W5(Le,ie)&&(C(),Ee(ie))}}function Se(ie){var fe=Ve(ie)||m.props.trigger.indexOf("click")>=0&&o;if(!fe){if(m.props.interactive){m.hideWithInteractivity(ie);return}Ee(ie)}}function Ze(ie){m.props.trigger.indexOf("focusin")<0&&ie.target!==D()||m.props.interactive&&ie.relatedTarget&&I.contains(ie.relatedTarget)||Ee(ie)}function Ve(ie){return Rn.isTouch?S()!==ie.type.indexOf("touch")>=0:!1}function te(){re();var ie=m.props,fe=ie.popperOptions,Ie=ie.placement,Le=ie.offset,De=ie.getReferenceClientRect,ft=ie.moveTransition,At=R()?Qc(I).arrow:null,Ot=De?{getBoundingClientRect:De,contextElement:De.contextElement||D()}:t,Ko={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(G){var J=G.state;if(R()){var ne=N(),de=ne.box;["placement","reference-hidden","escaped"].forEach(function(pe){pe==="placement"?de.setAttribute("data-placement",J.placement):J.attributes.popper["data-popper-"+pe]?de.setAttribute("data-"+pe,""):de.removeAttribute("data-"+pe)}),J.attributes.popper={}}}},Gn=[{name:"offset",options:{offset:Le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ft}},Ko];R()&&At&&Gn.push({name:"arrow",options:{element:At,padding:3}}),Gn.push.apply(Gn,(fe==null?void 0:fe.modifiers)||[]),m.popperInstance=D5(Ot,I,Object.assign({},fe,{placement:Ie,onFirstUpdate:p,modifiers:Gn}))}function re(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function ue(){var ie=m.props.appendTo,fe,Ie=D();m.props.interactive&&ie===Iy||ie==="parent"?fe=Ie.parentNode:fe=Ay(ie,[Ie]),fe.contains(I)||fe.appendChild(I),m.state.isMounted=!0,te()}function he(){return Go(I.querySelectorAll("[data-tippy-root]"))}function oe(ie){m.clearDelayTimeouts(),ie&&z("onTrigger",[m,ie]),W();var fe=H(!0),Ie=P(),Le=Ie[0],De=Ie[1];Rn.isTouch&&Le==="hold"&&De&&(fe=De),fe?r=setTimeout(function(){m.show()},fe):m.show()}function Ee(ie){if(m.clearDelayTimeouts(),z("onUntrigger",[m,ie]),!m.state.isVisible){U();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ie.type)>=0&&o)){var fe=H(!1);fe?i=setTimeout(function(){m.state.isVisible&&m.hide()},fe):s=requestAnimationFrame(function(){m.hide()})}}function Oe(){m.state.isEnabled=!0}function Te(){m.hide(),m.state.isEnabled=!1}function mt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(s)}function _t(ie){if(!m.state.isDestroyed){z("onBeforeUpdate",[m,ie]),me();var fe=m.props,Ie=xy(t,Object.assign({},fe,Cy(ie),{ignoreAttributes:!0}));m.props=Ie,le(),fe.interactiveDebounce!==Ie.interactiveDebounce&&(C(),y=Oy(Ae,Ie.interactiveDebounce)),fe.triggerTarget&&!Ie.triggerTarget?Ii(fe.triggerTarget).forEach(function(Le){Le.removeAttribute("aria-expanded")}):Ie.triggerTarget&&t.removeAttribute("aria-expanded"),F(),q(),O&&O(fe,Ie),m.popperInstance&&(te(),he().forEach(function(Le){requestAnimationFrame(Le._tippy.popperInstance.forceUpdate)})),z("onAfterUpdate",[m,ie])}}function qe(ie){m.setProps({content:ie})}function Ai(){var ie=m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Rn.isTouch&&!m.props.touch,De=Vc(m.props.duration,0,fn.duration);if(!(ie||fe||Ie||Le)&&!D().hasAttribute("disabled")&&(z("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,R()&&(I.style.visibility="visible"),q(),W(),m.state.isMounted||(I.style.transition="none"),R()){var ft=N(),At=ft.box,Ot=ft.content;Wc([At,Ot],0)}p=function(){var Gn;if(!(!m.state.isVisible||c)){if(c=!0,I.offsetHeight,I.style.transition=m.props.moveTransition,R()&&m.props.animation){var V=N(),G=V.box,J=V.content;Wc([G,J],De),Sy([G,J],"visible")}$(),F(),Ty(Yc,m),(Gn=m.popperInstance)==null||Gn.forceUpdate(),z("onMount",[m]),m.props.animation&&R()&&Y(De,function(){m.state.isShown=!0,z("onShown",[m])})}},ue()}}function et(){var ie=!m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Vc(m.props.duration,1,fn.duration);if(!(ie||fe||Ie)&&(z("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,c=!1,o=!1,R()&&(I.style.visibility="hidden"),C(),U(),q(!0),R()){var De=N(),ft=De.box,At=De.content;m.props.animation&&(Wc([ft,At],Le),Sy([ft,At],"hidden"))}$(),F(),m.props.animation?R()&&Q(Le,m.unmount):m.unmount()}}function tn(ie){L().addEventListener("mousemove",y),Ty(Qo,y),y(ie)}function Yo(){m.state.isVisible&&m.hide(),m.state.isMounted&&(re(),he().forEach(function(ie){ie._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),Yc=Yc.filter(function(ie){return ie!==m}),m.state.isMounted=!1,z("onHidden",[m]))}function sd(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),me(),delete t._tippy,m.state.isDestroyed=!0,z("onDestroy",[m]))}}function Fa(t,e){e===void 0&&(e={});var n=fn.plugins.concat(e.plugins||[]);Q5();var r=Object.assign({},e,{plugins:n}),i=V5(t),s=i.reduce(function(o,l){var u=l&&i$(l,r);return u&&o.push(u),o},[]);return zo(t)?s[0]:s}Fa.defaultProps=fn,Fa.setDefaultProps=e$,Fa.currentInput=Rn,Object.assign({},iy,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Fa.setDefaultProps({render:Ny});function Ly(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var By=typeof window!="undefined"&&typeof document!="undefined";function Kc(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function $y(){return By&&document.createElement("div")}function a$(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function Uy(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!Uy(t[n],e[n]))return!1}else return!1;return!0}else return!1}function s$(t){var e=[];return t.forEach(function(n){e.find(function(r){return Uy(n,r)})||e.push(n)}),e}function o$(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:s$([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Jc=By?K.useLayoutEffect:K.useEffect;function l$(t){var e=K.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function jy(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var u$={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var l;return!!((l=e.props.render)!=null&&l.$$tippy)};function i(){e.props.className&&!r()||jy(n,"add",e.props.className)}function s(){r()&&jy(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:s,onAfterUpdate:i}}};function c$(t){function e(n){var r=n.children,i=n.content,s=n.visible,o=n.singleton,l=n.render,u=n.reference,c=n.disabled,d=c===void 0?!1:c,f=n.ignoreAttributes,p=f===void 0?!0:f;n.__source,n.__self;var h=Ly(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),y=s!==void 0,g=o!==void 0,v=K.useState(!1),b=v[0],w=v[1],E=K.useState({}),m=E[0],A=E[1],I=K.useState(),O=I[0],T=I[1],k=l$(function(){return{container:$y(),renders:1}}),P=Object.assign({ignoreAttributes:p},h,{content:k.container});y&&(P.trigger="manual",P.hideOnClick=!1),g&&(d=!0);var S=P,R=P.plugins||[];l&&(S=Object.assign({},P,{plugins:g&&o.data!=null?[].concat(R,[{fn:function(){return{onTrigger:function(H,q){var z=o.data.children.find(function($){var F=$.instance;return F.reference===q.currentTarget});H.state.$$activeSingletonInstance=z.instance,T(z.content)}}}}]):R,render:function(){return{popper:k.container}}}));var D=[u].concat(r?[r.type]:[]);return Jc(function(){var L=u;u&&u.hasOwnProperty("current")&&(L=u.current);var N=t(L||k.ref||$y(),Object.assign({},S,{plugins:[u$].concat(P.plugins||[])}));return k.instance=N,d&&N.disable(),s&&N.show(),g&&o.hook({instance:N,content:i,props:S,setSingletonContent:T}),w(!0),function(){N.destroy(),o==null||o.cleanup(N)}},D),Jc(function(){var L;if(k.renders===1){k.renders++;return}var N=k.instance;N.setProps(o$(N.props,S)),(L=N.popperInstance)==null||L.forceUpdate(),d?N.disable():N.enable(),y&&(s?N.show():N.hide()),g&&o.hook({instance:N,content:i,props:S,setSingletonContent:T})}),Jc(function(){var L;if(!!l){var N=k.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((L=N.props.popperOptions)==null?void 0:L.modifiers)||[]).filter(function(H){var q=H.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var z,$=q.state,F=(z=$.modifiersData)==null?void 0:z.hide;(m.placement!==$.placement||m.referenceHidden!==(F==null?void 0:F.isReferenceHidden)||m.escaped!==(F==null?void 0:F.hasPopperEscaped))&&A({placement:$.placement,referenceHidden:F==null?void 0:F.isReferenceHidden,escaped:F==null?void 0:F.hasPopperEscaped}),$.attributes.popper={}}}])})})}},[m.placement,m.referenceHidden,m.escaped].concat(D)),se(xe,{children:[r?K.cloneElement(r,{ref:function(N){k.ref=N,Kc(r.ref,N)}}):null,b&&We.createPortal(l?l(a$(m),O,k.instance):i,k.container)]})}return e}var d$=function(t,e){return K.forwardRef(function(r,i){var s=r.children,o=Ly(r,["children"]);return j(t,ae(Z({},Object.assign({},e,o)),{children:s?K.cloneElement(s,{ref:function(u){Kc(i,u),Kc(s.ref,u)}}):null}))})},f$=d$(c$(Fa));const h$=f$,p$=({onClick:t})=>{const{clear:e}=_e(Me);return j(h$,{content:e,children:j("button",{onClick:t,"data-testid":"clear",className:"eow-border eow-rounded eow-ml-2 eow-px-3 eow-flex eow-items-center",children:j("svg",{xmlns:"http://www.w3.org/2000/svg",className:"eow-h-4 eow-w-4 ",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:j("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})},m$=({setFilters:t})=>{const[e,n]=K.useState(!1),r=K.useRef(null),{clearFromToFilterSportal365ImagesMessage:i,dateFromTo:s,dateFromToPlaceholder:o}=_e(Me);return se("div",{"data-testid":"from/to filter",children:[j("label",{htmlFor:"date from/to",className:Kt,children:s}),se("div",{className:"eow-flex eow-flex-row",children:[j(PB,{ref:r,className:"eow-flex-1",placeholder:o,options:{mode:"range",enableTime:!1,dateFormat:"YYYY-MM-DD",altFormat:"YYYY-MM-DD",altInput:!0,position:"below",altInputClass:ca,parseDate:(c,d)=>Zi(c,d).toDate(),formatDate:(c,d)=>Zi(c).format(d),defaultDate:null},onChange:c=>{if(c&&c.length>1){n(!0);const d="YYYY-MM-DD",f=Zi(c[0]).format(d),p=Zi(c[1]).format(d);t({from:f,to:p})}else c.length===0&&!e&&(t(null),Pe.info(i))}}),e?j(p$,{onClick:()=>{r.current.flatpickr.clear(),n(!1),t(null)}}):j(xe,{})]})]})};class g${constructor(){a(this,"id");a(this,"value");a(this,"label")}}class Hy extends g${constructor(){super(...arguments);a(this,"logo");a(this,"countryName");a(this,"countryFlag")}}const v$=(t,e,n,r)=>({apiKey:t,clientId:e,lang:n||"en",environment:r||"prod",idSchema:"native",errorHandlingMode:"standard",authProvider:{getIdToken:()=>"",logout:()=>{}}}),y$=(t,e)=>!t&&!e?null:!t&&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:t,authorization:`Bearer ${e&&e==="betway"?"24PkUfW1ce63mH9jvAAug2QQzdASj9k5smngepPUZD2KUq5cbTFGE98KgZ0zg2wCtuQcoJrHElW7Dr0K":"dEZS1V21veHBIDIik8Y33dDkZAoCmxgge5MBnAORN7IKbltA79giTZLaXJ6OVgQkGnYxwtyRv8ObRSvY"}`},Vy=t=>{document.getElementById(t).scrollIntoView({behavior:"smooth"})},Xc={container:t=>Z({},t),control:t=>ae(Z({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",textTransform:"capitalize"}),input:t=>ae(Z({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>ae(Z({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"},textTransform:"capitalize"})},w$=t=>{let e=new Hy;return e.label=t.name,e.value=t.name,e.id=t.id,t.birthDate?e.logo=t.assets&&t.assets.headshot&&t.assets.headshot:e.logo=t.assets&&t.assets.logo&&t.assets.logo,e.countryName=t.country.name,e.countryFlag=t.country.assets&&t.country.assets.flag?t.country.assets.flag:bn.country,e},b$=({setQuery:t,setFilters:e})=>{const[n,r]=K.useState(!1),[i,s]=K.useState(null),{searchImages:o,hideFilters:l,showFilters:u}=_e(Me),c=()=>r(!n),d=h=>{s(h),t((h==null?void 0:h.value)||"")},p=zu((h,y)=>{h&&y([{id:h,value:h,label:h}])},300);return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"search image",className:Kt,children:o}),j(Cc,{components:{DropdownIndicator:null},loadOptions:p,isClearable:!0,styles:Xc,getOptionValue:h=>h.id,onChange:d,value:i,placeholder:"",className:"eow-mb-1"}),j("a",{className:"eow-flex eow-justify-end eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-cursor-pointer eow-mb-4",onClick:c,children:n?l:u}),n?j(m$,{setFilters:e}):j(xe,{})]})},Zc="sportal365-images-search",_$=({imageNode:t,onChangeImages:e,setShowImagesContainer:n})=>{const[r,i]=K.useState(null),[s,o]=K.useState(""),[l,u]=K.useState(1),[c,d]=K.useState(null),[f,p]=K.useState(!1),h=K.useRef(!1),{https:y}=_e(on),{searchSportal365ImagesErrorMessage:g,noImagesFound:v}=_e(Me);K.useEffect(()=>(h.current?b():h.current=!0,()=>i(null)),[s,c,l]);const b=()=>_(this,null,function*(){if(s){p(!0);const A=yield y.fetchImagesFromSportal365(s,c,l),I=yield A.json();A.ok?(i(I),u(I.meta.pagination.current_page)):(console.error(I),Pe.error(g)),p(!1)}else i(null)}),w=()=>{u(A=>A-1),Vy(Zc)},E=()=>{u(A=>A+1),Vy(Zc)};return se("div",{id:Zc,className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded eow-bg-gray-100",children:[j("div",{className:"eow-flex eow-justify-end",children:j(Vu,{isDisabled:!1,onClick:()=>{n(A=>ae(Z({},A),{[t]:!A[t]}))}})}),j(b$,{setQuery:o,setFilters:d}),r?se(xe,{children:[j("div",{className:"eow-grid xl:eow-grid-cols-4 md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:r.data.map(A=>{var I,O;return se("div",{className:"eow-relative eow-cursor-pointer eow-group eow-mb-2",onClick:()=>{var T,k;return e((k=(T=A.urls)==null?void 0:T.uploaded)==null?void 0:k.embed)},children:[j("img",{src:(O=(I=A.urls)==null?void 0:I.uploaded)==null?void 0:O.thumbnail,alt:"Sportal365 image",className:"eow-object-cover eow-w-full eow-h-full"}),j("div",{className:"eow-absolute eow-inset-0 eow-bg-black eow-bg-opacity-0 group-hover:eow-bg-opacity-50 eow-flex eow-justify-center eow-items-center eow-transition eow-duration-300",children:j("span",{className:"eow-text-white eow-text-4xl eow-opacity-0 group-hover:eow-opacity-100 eow-transition eow-duration-300",children:"+"})})]},A.id)})}),j($F,{pageCount:r==null?void 0:r.meta.pagination.current_page,images:r,getPreviousPage:w,getNextPage:E})]}):j(xe,{}),r&&r.data.length===0?j("p",{className:"eow-text-center eow-font-bold eow-mb-4",children:v}):j(xe,{}),f?j(pm,{}):j(xe,{})]})},E$=({imageUrl:t,isOpen:e,closeModal:n})=>{K.useLayoutEffect(()=>(e&&document.body.addEventListener("keydown",r),()=>{document.body.removeEventListener("keydown",r)}),[n]);const r=i=>i.key==="Escape"?n():null;return e?j(gm,{wrapperId:"image-modal",children:se("div",{className:"eow-fixed eow-inset-0 eow-z-20 eow-flex eow-items-center eow-justify-center eow-bg-black eow-bg-opacity-50 eow-animate-fadeIn",children:[j("div",{className:"eow-absolute eow-top-0 eow-right-0 eow-m-4",children:j("button",{className:"eow-text-white eow-text-2xl eow-bg-transparent",onClick:n,children:"X"})}),j("div",{className:"eow-flex eow-items-center eow-justify-center eow-h-full",children:j("img",{src:t,alt:"Image modal",className:"eow-w-full eow-object-cover"})})]})}):null},ed={mainImage:!1,coverImage:!1,mobileImage:!1},qy=({id:t,type:e,label:n,imageUrl:r,imageNode:i,onChange:s})=>{const[o,l]=K.useState(ed),[u,c]=K.useState(ed),[d,f]=K.useState(!1),{https:p}=_e(on),h=()=>f(!1),y=(v,b)=>{c(ed),s(v,b)},g=(v,b)=>{navigator.clipboard.writeText(v).then(()=>{c(w=>ae(Z({},w),{[b]:!0}))}).catch(w=>{console.error("Failed to copy: ",w),c(E=>ae(Z({},E),{[b]:!1}))})};return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:n,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:n}),se("div",{className:"eow-w-full eow-border eow-rounded eow-overflow-hidden eow-p-2",children:[se("div",{className:"eow-grid lg:eow-grid-cols-8 eow-grid-cols-1 eow-gap-2 eow-mb-2",children:[j("div",{className:"lg:eow-col-span-2",children:r?se(xe,{children:[j("img",{src:r,alt:"Card Image",className:"eow-w-full eow-object-cover eow-cursor-pointer",onClick:()=>f(!0)}),j(E$,{imageUrl:r,isOpen:d,closeModal:h})]}):j("div",{className:"eow-bg-gray-200 lg:eow-min-w-16 eow-min-h-24 eow-flex eow-justify-center eow-items-center eow-p-5",children:j("img",{src:bn.image,alt:"Card image"})})}),se("div",{className:"eow-flex eow-flex-col eow-col-span-6",children:[se("div",{className:"eow-grid eow-grid-cols-2 eow-gap-2 eow-mb-2",children:[j(FF,{imageNode:i,onChangeImages:y,type:e,id:t}),j(NF,{isDisabled:!r,isUrlCopied:u[i],onClick:()=>g(r||"",i)})]}),p.sportal365Config?j(BF,{imageNode:i,setShowImagesContainer:l}):j(xe,{})]})]}),o[i]?j(_$,{onChangeImages:v=>y(v,i),setShowImagesContainer:l,imageNode:i}):j(xe,{})]})]})},Wy=({id:t,type:e,loadedImages:n,onChange:r})=>{const[i,s]=K.useState(!1),o=()=>s(!i),l=_e(Me),u=e==="game"?Array.from(ym.keys()):Array.from(GS.keys());return se(xe,{children:[j(qy,{id:t,type:e,label:l.main,imageUrl:n==null?void 0:n.main,imageNode:"mainImage",onChange:r}),j("button",{className:"eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-bg-transparent eow-mb-4",onClick:o,children:i?l.hideMoreImages:l.showMoreImages}),i?j(xe,{children:u.map((c,d)=>j(qy,{id:t,type:e,label:l[c],imageUrl:n&&n[c]?n[c]:"",imageNode:ym.get(c),onChange:r},`${c}-${d}`))}):j(xe,{})]})},I$=({id:t,loadedImages:e,onChange:n})=>{const r=_e(Me);return j(MF,{images:r.optionImages,children:j(Wy,{id:t,type:"option",loadedImages:e,onChange:n})})},Gy=new ua,A$=5,O$=100,T$=({options:t,setRequestBody:e})=>{const{label:n,labelOptionPlaceholder:r,options:i,optionNumber:s,optionsDescription:o}=_e(Me),l=Gy.constructOptions(t),u=(y,g)=>{y.persist();const v=Array.from(l);v[g].label=y.target.value,h(v)},c=(y,g)=>{const v=Array.from(l);v[g].value=y,h(v)},d=(y,g,v)=>{const b=y||null,w=Array.from(l);switch(g){case"mainImage":w[v].images.main=b,h(w);break;case"mobileImage":w[v].images.mobile=b,h(w);break}},f=()=>{const y=Array.from(l).sort((w,E)=>parseInt(E.id)-parseInt(w.id))[0].id,g=`${parseInt(y)+1}`,v=Gy.constructEmptyOption(g),b=Array.from(l);b.push(v),h(b)},p=y=>{const g=l.filter((v,b)=>b!==y);h(g)},h=y=>{e(g=>ae(Z({},g),{options:y}))};return se("div",{className:"eow-mb-4",children:[se("div",{className:"eow-mb-2",children:[j("h3",{className:Kt,children:i}),j("p",{className:"eow-text-gray-400 eow-text-sm",children:o})]}),se("div",{className:"eow-grid eow-grid-cols-1 lg:eow-grid-cols-2 2xl:eow-grid-cols-3 eow-gap-4 eow-mb-1",children:[l.map((y,g)=>se("div",{className:"eow-overflow-visible eow-shadow-l eow-border eow-border-gray-200",children:[se("div",{className:"eow-bg-gray-100 eow-flex eow-justify-between eow-px-3 eow-py-2",children:[se("h2",{className:"eow-card-title",children:[s," ",g+1]}),j(Vu,{isDisabled:l.length===A$,onClick:()=>p(g)})]}),se("div",{className:"eow-p-3",children:[se("div",{className:"eow-grid sm:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[j(PF,{label:n,defaultValue:y.label,placeholder:r,onChange:v=>u(v,g)}),j(ma,{type:"options_value",defaultValue:y.value,onChange:v=>c(v,g)})]}),j(I$,{id:g,loadedImages:y.images,onChange:(v,b)=>d(v,b,g)})]})]},`points_number_${y.id}_${g}`)),j(Hu,{isDisabled:l.length===O$,onClick:f})]})]})},C$=({requestBody:t,setRequestBody:e,description:n,setDescription:r})=>{const i=_e(Me),s=o=>{o.persist(),e(l=>ae(Z({},l),{title:o.target.value}))};return se("div",{className:"md:eow-w-4/6 eow-w-full",children:[j(zS,{value:(t==null?void 0:t.id)||null}),j(ri,{title:i.title,placeholder:i.titlePlaceholder,onChange:s,defaultValue:t.title||""}),j(ju,{defaultValue:n,setValue:r,property:"description"}),j(SF,{points:t.points,setRequestBody:e}),j(T$,{options:t.options,setRequestBody:e})]})},cr=({title:t,children:e})=>{const[n,r]=K.useState(!1);return se("div",{className:"eow-border-b eow-border-gray-200 eow-mb-2",children:[se("button",{className:"eow-flex eow-justify-between eow-py-2 eow-px-4 eow-py-2 eow-px-4 eow-w-full eow-text-left eow-text-gray-800 eow-font-semibold eow-bg-gray-100 hover:eow-bg-gray-200 focus:eow-outline-none",onClick:()=>r(!n),children:[j("span",{children:t}),j("img",{src:n?bn.upArrow:bn.downArrow,alt:"Up arrow",className:"eow-w-6 eow-h-6"})]}),n&&j("div",{className:"eow-border eow-border-gray-200 eow-p-4",children:e})]})},S$=({defaultValue:t,onChange:e})=>{const{https:n}=_e(on),{type:r,typeDescription:i,noType:s}=_e(Me),{data:o}=su({queryKey:["eitherOrTypes"],queryFn:()=>n.getEitherOrTypes()});return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"type",className:Kt,children:r}),se("select",{id:"quizType",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:e,defaultValue:t||"",children:[j("option",{value:"",children:s}),o?o.map((l,u)=>j("option",{id:l.id,value:l.id,children:l.label},`${l.id}-${u}`)):j(xe,{})]}),j("p",{className:"eow-text-gray-400 eow-text-xs",children:i})]})},zy=({type:t,defaultValue:e,onChange:n})=>{const{status:r,active:i,inactive:s,statusDescription:o,winningCondition:l,winningConditionDescription:u,more:c,less:d}=_e(Me);return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"status",className:Kt,children:t==="status"?r:l}),se("select",{id:t==="status"?"gameStatus":"gameWinningCondition",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:n,defaultValue:e,children:[j("option",{value:t==="status"?"ACTIVE":"MORE",children:t==="status"?i:c}),j("option",{value:t==="status"?"INACTIVE":"LESS",children:t==="status"?s:d})]}),j("p",{className:"eow-text-gray-400 eow-text-xs",children:t==="status"?o:u})]})};var P$=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Qy=function(){var e=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(e).toLowerCase(),s=String(r.getOptionValue(n)).toLowerCase(),o=String(r.getOptionLabel(n)).toLowerCase();return s===i||o===i},td={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,r,i){return!(!e||n.some(function(s){return Qy(e,s,i)})||r.some(function(s){return Qy(e,s,i)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function M$(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,r=t.createOptionPosition,i=r===void 0?"last":r,s=t.formatCreateLabel,o=s===void 0?td.formatCreateLabel:s,l=t.isValidNewOption,u=l===void 0?td.isValidNewOption:l,c=t.getNewOptionData,d=c===void 0?td.getNewOptionData:c,f=t.onCreateOption,p=t.options,h=p===void 0?[]:p,y=t.onChange,g=ln(t,P$),v=g.getOptionValue,b=v===void 0?Nv:v,w=g.getOptionLabel,E=w===void 0?Fv:w,m=g.inputValue,A=g.isLoading,I=g.isMulti,O=g.value,T=g.name,k=K.useMemo(function(){return u(m,Ro(O),h,{getOptionValue:b,getOptionLabel:E})?d(m,o(m)):void 0},[o,d,E,b,m,u,h,O]),P=K.useMemo(function(){return(n||!A)&&k?i==="first"?[k].concat(di(h)):[].concat(di(h),[k]):h},[n,i,A,k,h]),S=K.useCallback(function(R,D){if(D.action!=="select-option")return y(R,D);var L=Array.isArray(R)?R:[R];if(L[L.length-1]===k){if(f)f(m);else{var N=d(m,m),H={action:"create-option",name:T,option:N};y(Ia(I,[].concat(di(Ro(O)),[N]),N),H)}return}y(R,D)},[d,m,I,T,k,f,y,O]);return we(we({},g),{},{options:P,onChange:S})}var R$=K.forwardRef(function(t,e){var n=Tc(t),r=M$(n);return j(Bo,Z({ref:e},r))}),k$=R$;const x$=t=>({label:t,value:t}),D$={control:t=>ae(Z({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"6px 1px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",boxShadow:"none"}),clearIndicator:t=>ae(Z({},t),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:t=>ae(Z({},t),{"input:focus":{boxShadow:"none"}})},Yy=({defaultValue:t,showLabel:e,setObject:n,handleResetData:r})=>{const[i,s]=K.useState(""),o=t.map(y=>x$(y)),{repeatedValueMessage:l,flags:u,flagsPlaceholder:c}=_e(Me),d=y=>{const g=y.map(v=>v.value);n(v=>ae(Z({},v),{flags:g})),r&&r()},f=y=>{s(y)},p=y=>{y.persist();const{key:g}=y;if(!!i)switch(g){case"Enter":case"Tab":if(t.length===0){const v=Array.from(t);v.push(i),n(b=>ae(Z({},b),{flags:v}))}if(t.length>0&&h()){const v=Array.from(t);v.push(i),n(b=>ae(Z({},b),{flags:v}))}s(""),y.preventDefault()}},h=()=>{let y=!1;const g=o.map(v=>v.label);return g.length&&g.includes(i)?(Pe.warn(l),y):(y=!0,y)};return se("div",{className:"eow-mb-4",children:[e?j("label",{htmlFor:u,className:"eow-text-sm eow-mb-1",children:u}):j(xe,{}),j(k$,{styles:D$,components:{DropdownIndicator:null},getOptionValue:y=>y.value,inputValue:i,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:d,onInputChange:f,onKeyDown:p,placeholder:c,value:o})]})},F$=t=>Object.keys(t).length++,Ky=({property:t,field:e,onChange:n})=>{const r=F$(e),[i,s]=K.useState(JSON.parse(JSON.stringify(e))),{dynamicFieldsDescription:o,keyDynamicFields:l,valueDynamicFields:u}=_e(Me),c=()=>{const p="new_key"+r,h=JSON.parse(JSON.stringify(e));h[p]="";const y=Z(Z({},e),h);s(y),n(y)},d=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p];y[h]=y[g],delete y[g],n(y)},f=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p]?Object.keys(y)[p]:"new_key";y[g]=h,n(y)};return se("div",{className:"eow-mb-4",children:[j("div",{className:"eow-mb-2",children:j("p",{className:"eow-text-gray-400 eow-text-sm",children:o})}),se("div",{className:"eow-border eow-border-gray-200 eow-rounded eow-p-2 eow-mb-4",children:[Object.keys(i).map((p,h)=>se("div",{className:"eow-flex eow-items-center eow-mb-4",children:[se("div",{className:"eow-mr-4",children:[j("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:l}),j("input",{"data-testid":"dynamic-key-field",onChange:y=>d(h,y.target.value),value:Object.keys(e)[h]&&Object.keys(e)[h].includes("new_key")?"":Object.keys(e)[h],type:"text",id:`${t}-key-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-64 focus:eow-outline-none eow-px-3 eow-py-2"})]}),se("div",{className:"eow-w-full",children:[j("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:u}),j("input",{"data-testid":"dynamic-value-field",onChange:y=>f(h,y.target.value),value:e[p],type:"text",id:`${t}-value-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2"})]})]},`${t}-${p}-${h}`)),j(Hu,{isDisabled:!1,onClick:()=>c()})]})]})},N$=({tabValue:t,setTabValue:e})=>{const{content:n,tags:r,campaign:i}=_e(Me);return j(xe,{children:j("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-1 eow-w-full eow-mb-6 eow-border-b",children:[r,n,i].map(o=>j("div",{className:`md:eow-mr-2 last:eow-mr-0 eow-flex-auto eow-text-center eow-pb-2 ${t===o?"eow-border-b-2":"eow-border-b-2 eow-border-white"}`,children:j("a",{className:"eow-leading-normal eow-p-2 eow-cursor-pointer eow-mb-2 "+(t===o?"eow-font-bold eow-text-brandColor":"eow-text-gray-400"),onClick:()=>e(o),children:o})},`context-tab-${o}`))})})};class nd{constructor(){a(this,"label","");a(this,"options",[])}}const L$=10,Jy=t=>{const e=[];if(t.competitions.length>0){const n=new nd;n.label="Competitions",n.options=t.competitions.map(r=>rd(r,"competition")),e.push(n)}if(t.teams.length>0){const n=new nd;n.label="Teams",n.options=t.teams.map(r=>rd(r,"team")),e.push(n)}if(t.players.length>0){const n=new nd;n.label="Players",n.options=t.players.map(r=>rd(r,"player")),e.push(n)}return e},rd=(t,e)=>{var r,i,s,o,l;let n=new Hy;return n.label=t.name,n.value=t.name,n.id=t.id,e==="player"?n.logo=((r=t.assets)==null?void 0:r.headshot)||bn.avatar:e==="team"?n.logo=((i=t.assets)==null?void 0:i.logo)||bn.team:n.logo=((s=t.assets)==null?void 0:s.logo)||bn.competition,n.countryName=t.country.name,n.countryFlag=((l=(o=t.country)==null?void 0:o.assets)==null?void 0:l.flag)||bn.country,n},B$=({options:t,setOptions:e,setFilters:n,handleResetData:r})=>{const{sdk:i}=_e(on),{contextEntityTag:s,typeContextTagNamePlaceholder:o}=_e(Me),l=d=>{const f=d.map(p=>p.id);e(d),r(),n(p=>ae(Z({},p),{entityIds:f}))},c=zu((d,f)=>{if(d){const p={query:d};i.football.search(p).then(h=>{const y=Jy(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"context entity tag",className:"eow-text-sm eow-mb-1",children:s}),j(Cc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:Xc,onChange:l,loadingMessage:()=>"Loading...",isOptionDisabled:()=>t.length===L$,value:t,loadOptions:c,isClearable:!0,isMulti:!0,placeholder:o,formatOptionLabel:d=>se("div",{className:"eow-flex eow-items-center",children:[j("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-2",children:d.label}),j("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-1",children:d.countryName})]})})]})},$$=(t,e,n,r)=>{const i=t.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),s=t.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),o=t.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),l=[],u=[];if(i.length>0){const c=e.football.getCompetitions({competitionIds:i}).then(d=>{u.push(d)}).catch(d=>{console.error(d),Pe.error(n)});l.push(c)}if(s.length>0){const c=e.football.getTeams({teamIds:s}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),Pe.error(n)});l.push(c)}if(o.length>0){const c=e.football.getPlayers({playerIds:o}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),Pe.error(n)});l.push(c)}Promise.all(l).then(()=>{const d=Array.prototype.concat.apply([],u).map(f=>w$(f));r(d)})},U$=({tags:t,onChangeTags:e})=>{const[n,r]=K.useState([]),{sdk:i}=_e(on),{getFootballEntitiesErrorMessage:s,typeContextTagNamePlaceholder:o}=_e(Me),l=d=>{r(d),e(d)},c=zu((d,f)=>{if(!d&&t.length>0&&$$(t,i,s,r),d){const p={query:d};i.football.search(p).then(h=>{const y=Jy(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return j("div",{className:"eow-mb-4",children:j(Cc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:Xc,onChange:l,loadingMessage:()=>"Loading...",value:n,loadOptions:c,isClearable:!0,defaultOptions:!0,isMulti:!0,placeholder:o,formatOptionLabel:d=>se("div",{className:"eow-flex eow-items-center",children:[j("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-2",children:d.label}),j("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-1",children:d.countryName})]})})})},j$=new ua,H$=t=>t.startsWith("fb:c:")?"competition":t.startsWith("fb:t:")?"team":"player",V$=({defaultValue:t,setRequestBody:e})=>{const n=j$.createContext(t),{content:r,tags:i,campaign:s,id:o,idContentPlaceholder:l,labelContentPlaceholder:u,typeContentPlaceholder:c,idCampaignPlaceholder:d,labelCampaignPlaceholder:f,label:p,type:h}=_e(Me),[y,g]=K.useState(i),v=O=>{O.persist();const T=Z({},n);T.content.id=O.target.value,I(T)},b=O=>{O.persist();const T=Z({},n);T.content.label=O.target.value,I(T)},w=O=>{O.persist();const T=Z({},n);T.content.type=O.target.value,I(T)},E=O=>{O.persist();const T=Z({},n);T.campaign.id=O.target.value,I(T)},m=O=>{O.persist();const T=Z({},n);T.campaign.label=O.target.value,I(T)},A=O=>{const T=Z({},n);O.length?T.tags=O.map(k=>({id:k.id,type:H$(k.id),source:"football"})):T.tags=[],I(T)},I=O=>{e(T=>ae(Z({},T),{context:O}))};return se("div",{className:"eow-mb-4 eow-p-2",children:[j(N$,{tabValue:y,setTabValue:g}),y===i?j(U$,{tags:n.tags,onChangeTags:A}):j(xe,{}),y===r?se(xe,{children:[j(ri,{title:o,placeholder:l,defaultValue:n.content.id,onChange:v}),j(ri,{title:p,placeholder:u,defaultValue:n.content.label,onChange:b}),j(ri,{title:h,placeholder:c,defaultValue:n.content.type,onChange:w})]}):j(xe,{}),y===s?se(xe,{children:[j(ri,{title:o,placeholder:d,defaultValue:n.campaign.id,onChange:E}),j(ri,{title:p,placeholder:f,defaultValue:n.campaign.label,onChange:m})]}):j(xe,{})]})},q$=new ua,W$=({requestBody:t,rules:e,adContent:n,setRules:r,setAdContent:i,setRequestBody:s})=>{const{configuration:o,images:l,flags:u,labels:c,customFields:d,rules:f,adContent:p,context:h}=_e(Me),y=I=>{I.persist(),s(O=>ae(Z({},O),{type:I.target.value?I.target.value:null}))},g=I=>{I.persist(),s(O=>ae(Z({},O),{status:I.target.value}))},v=I=>{I.persist(),s(O=>ae(Z({},O),{winning_condition:I.target.value}))},b=I=>{s(O=>ae(Z({},O),{time:I}))},w=I=>{s(O=>ae(Z({},O),{lives:I}))},E=(I,O)=>{const T=I||null,k=q$.createImagesModel();switch(O){case"mainImage":s(P=>{const S=P.images?JSON.parse(JSON.stringify(P.images)):k;return S.main=T,ae(Z({},P),{images:S})});break;case"coverImage":s(P=>{const S=P.images?JSON.parse(JSON.stringify(P.images)):k;return S.cover=T,ae(Z({},P),{images:S})});break;case"mobileImage":s(P=>{const S=P.images?JSON.parse(JSON.stringify(P.images)):k;return S.mobile=T,ae(Z({},P),{images:S})});break}},m=I=>{s(O=>ae(Z({},O),{labels:I}))},A=I=>{s(O=>ae(Z({},O),{custom_fields:I}))};return se("div",{className:"md:eow-w-2/6 eow-w-full eow-p-4",children:[se(cr,{title:o,children:[se("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:[j(S$,{defaultValue:t.type,onChange:y}),j(zy,{type:"status",defaultValue:t.status,onChange:g}),j(zy,{type:"winning_condition",defaultValue:t.winning_condition,onChange:v})]}),se("div",{className:"eow-grid md:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[j(ma,{type:"time",defaultValue:t.time,showDescription:!0,onChange:b}),j(ma,{type:"lives",defaultValue:t.lives,showDescription:!0,onChange:w})]})]}),j(cr,{title:l,children:j(Wy,{id:0,type:"game",loadedImages:t.images,onChange:E})}),j(cr,{title:u,children:j(Yy,{defaultValue:t.flags,setObject:s})}),j(cr,{title:c,children:j(Ky,{property:"labels",field:t.labels?t.labels:new Object,onChange:m})}),j(cr,{title:d,children:j(Ky,{property:"custom_fields",field:t.custom_fields?t.custom_fields:new Object,onChange:A})}),j(cr,{title:f,children:j(ju,{defaultValue:e,setValue:r,property:"rules"})}),j(cr,{title:p,children:j(ju,{defaultValue:n,setValue:i,property:"ad_content"})}),j(cr,{title:h,children:j(V$,{defaultValue:t.context,setRequestBody:s})})]})},Xy=new ua,G$="manage-either-or",z$=({eitherOrById:t,setFilters:e,toggleScreen:n,clearEitherOrById:r})=>{const[i,s]=K.useState(Xy.createNewRequestBody(t)),[o,l]=K.useState(t==null?void 0:t.description),[u,c]=K.useState(t==null?void 0:t.rules),[d,f]=K.useState(t==null?void 0:t.ad_content),[p,h]=K.useState(!1),[y,g]=K.useState(!1),v=_e(Me),{https:b}=_e(on),w=!!t,E=()=>{g(!y)};return se("div",{id:G$,children:[j($S,{managementScreen:w?"edit":"create",toggleScreen:n,clearQuizById:r}),se("div",{className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded",children:[se("div",{className:"eow-flex eow-flex-col md:eow-flex-row",children:[j(C$,{requestBody:i,setRequestBody:s,description:o,setDescription:l}),j(W$,{requestBody:i,setRequestBody:s,rules:u,adContent:d,setRules:c,setAdContent:f})]}),j(HS,{isLoading:p,manageEitherOr:()=>_(this,null,function*(){const A=new US;if(h(!0),w?A.validateUpdate(i,v):A.validateCreate(i,v),!A.isValid){Pe.error(A.message),h(!1);return}i.description=o,i.rules=u,i.ad_content=d;const I=Xy.finalizeNewRequestBody(Z({},i));let O=null;w?O=yield b.updateEitherOr(I.id,Z({},I)):O=yield b.createEitherOr(Z({},I)),O.ok?(h(!1),Pe.success(w?v.updateEitherOrMessage:v.createEitherOrMessage),e(T=>ae(Z({},T),{refetchEitherOrs:!T.refetchEitherOrs})),n()):(Pe.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage),console.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage,yield O.json()),h(!1))}),handleModal:E})]}),j(WS,{isOpen:y,requestBody:i,description:o,handleClose:E})]})},Q$=t=>{const e=document.createElement("div");return e.setAttribute("id",t),document.body.appendChild(e),e},Y$=({children:t,wrapperId:e})=>{const[n,r]=K.useState(null);return K.useLayoutEffect(()=>{let i=document.getElementById(e),s=!1;return i||(s=!0,i=Q$(e)),r(i),()=>{s&&i.parentNode&&i.parentNode.removeChild(i)}},[e]),n===null?null:dr.default.createPortal(t,n)},K$=({isOpen:t,eitherOr:e,setFilters:n,handleClose:r})=>{const[i,s]=K.useState(!1),{confirmationQuestionLabel:o,deleteLabel:l,cancelLabel:u,deleteEitherOrMessage:c,deleteEitherOrErrorMessage:d}=_e(Me),{https:f}=_e(on);K.useLayoutEffect(()=>(t&&document.body.addEventListener("keydown",p),()=>{document.body.removeEventListener("keydown",p)}),[r]);const p=y=>y.key==="Escape"&&!i?r():null,h=()=>_(this,null,function*(){s(!0);const y=yield f.deleteEitherOr(e.id);y.ok?(Pe.success(c),s(!1),n(g=>ae(Z({},g),{refetchEitherOrs:!g.refetchEitherOrs})),r()):(console.error(d,yield y.json()),Pe.error(d),s(!1))});return t?j(Y$,{wrapperId:"confirmation-modal",children:se(xe,{children:[j("div",{className:"eow-justify-center eow-items-center eow-flex eow-overflow-x-hidden eow-overflow-y-hidden eow-absolute eow-inset-0 eow-z-50 eow-top-0 eow-right-0 eow-bottom-0 eow-left-0 eow-outline-none focus:eow-outline-none",children:j("div",{className:"eow-relative eow-w-full eow-my-6 eow-mx-auto eow-max-w-lg",children:se("div",{className:"eow-border-0 eow-rounded eow-shadow-lg eow-relative eow-flex eow-flex-col eow-w-full eow-bg-white eow-outline-none focus:eow-outline-none",children:[se("div",{className:"eow-flex eow-justify-items-center eow-p-4 eow-border-b eow-border-solid eow-border-gray-200",children:[se("h3",{className:"eow-text-2xl eow-font-semibold eow-mr-2",children:[l," ",e.title]}),j("button",{className:"eow-flex eow-justify-items-center eow-ml-auto eow-bg-transparent eow-border-0 eow-leading-none eow-font-semibold eow-outline-none focus:eow-outline-none",onClick:r,children:j("span",{className:"eow-bg-transparent eow-h-6 eow-w-6 eow-text-2xl eow-block eow-outline-none focus:eow-outline-none eow-text-red-500 hover:eow-text-red-600",children:"x"})})]}),j("div",{className:"eow-relative eow-whitespace-nowrap eow-p-4 eow-text-gray-500 eow-text-lg eow-mb-4",children:se("p",{className:"eow-whitespace-normal eow-mb-2",children:[o," ",j("span",{className:"eow-text-xl eow-italic",children:e.title})," ?"]})}),se("div",{className:"eow-flex eow-items-center eow-justify-end eow-p-3 eow-border-t eow-border-solid eow-border-gray-200 eow-rounded-b",children:[se("button",{className:`${i?"eow-bg-gray-600":"eow-bg-brandColor hover:eow-bg-blue-700"} eow-text-white eow-font-bold eow-px-4 eow-py-2 eow-text-sm eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:h,disabled:i,children:[i?j(mm,{}):null,l]}),j("button",{className:`${i?"eow-bg-gray-600":"eow-bg-red-500 hover:eow-bg-red-700"} eow-text-white eow-font-bold eow-text-sm eow-px-4 eow-py-2 eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:r,disabled:i,children:u})]})]})})}),j("div",{className:"eow-opacity-80 eow-absolute eow-inset-0 eow-z-40 eow-bg-black eow-top-0 eow-right-0 eow-bottom-0 eow-left-0"})]})}):null};var Zy=(t=>(t.CREATED_AT_ASC="created_at_asc",t.CREATED_AT_DESC="created_at_desc",t.UPDATED_AT_ASC="updated_at_asc",t.UPDATED_AT_DESC="updated_at_desc",t))(Zy||{});class J${constructor(){a(this,"sort","created_at_desc");a(this,"status","");a(this,"flags",[]);a(this,"entityIds",[]);a(this,"groupByStatus",!0);a(this,"refetchEitherOrs",!1)}}var X$=K.forwardRef(function(t,e){var n=Tc(t);return j(Bo,Z({ref:e},n))}),Z$=X$;function eU(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var tU=eU,ew=Qs,nU=tU,rU=Zs,iU=gg,aU=1/0,tw=ew?ew.prototype:void 0,nw=tw?tw.toString:void 0;function rw(t){if(typeof t=="string")return t;if(rU(t))return nU(t,rw)+"";if(iU(t))return nw?nw.call(t):"";var e=t+"";return e=="0"&&1/t==-aU?"-0":e}var sU=rw,oU=sU;function lU(t){return t==null?"":oU(t)}var iw=lU;function uU(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var cU=uU,dU=cU;function fU(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:dU(t,e,n)}var hU=fU,pU="\\ud800-\\udfff",mU="\\u0300-\\u036f",gU="\\ufe20-\\ufe2f",vU="\\u20d0-\\u20ff",yU=mU+gU+vU,wU="\\ufe0e\\ufe0f",bU="\\u200d",_U=RegExp("["+bU+pU+yU+wU+"]");function EU(t){return _U.test(t)}var aw=EU;function IU(t){return t.split("")}var AU=IU,sw="\\ud800-\\udfff",OU="\\u0300-\\u036f",TU="\\ufe20-\\ufe2f",CU="\\u20d0-\\u20ff",SU=OU+TU+CU,PU="\\ufe0e\\ufe0f",MU="["+sw+"]",id="["+SU+"]",ad="\\ud83c[\\udffb-\\udfff]",RU="(?:"+id+"|"+ad+")",ow="[^"+sw+"]",lw="(?:\\ud83c[\\udde6-\\uddff]){2}",uw="[\\ud800-\\udbff][\\udc00-\\udfff]",kU="\\u200d",cw=RU+"?",dw="["+PU+"]?",xU="(?:"+kU+"(?:"+[ow,lw,uw].join("|")+")"+dw+cw+")*",DU=dw+cw+xU,FU="(?:"+[ow+id+"?",id,lw,uw,MU].join("|")+")",NU=RegExp(ad+"(?="+ad+")|"+FU+DU,"g");function LU(t){return t.match(NU)||[]}var BU=LU,$U=AU,UU=aw,jU=BU;function HU(t){return UU(t)?jU(t):$U(t)}var VU=HU,qU=hU,WU=aw,GU=VU,zU=iw;function QU(t){return function(e){e=zU(e);var n=WU(e)?GU(e):void 0,r=n?n[0]:e.charAt(0),i=n?qU(n,1).join(""):e.slice(1);return r[t]()+i}}var YU=QU,KU=YU,JU=KU("toUpperCase"),XU=JU,ZU=iw,e3=XU;function t3(t){return e3(ZU(t).toLowerCase())}var n3=t3;const fw=(t,e)=>{let n="";if(e==="sort")switch(t){case"created_at_asc":n="Sort by created at field in ascending order";break;case"created_at_desc":n="Sort by created at field in descending order";break;case"updated_at_asc":n="Sort by updated at field in ascending order";break;case"updated_at_desc":n="Sort by updated at field in descending order";break}return t&&(t=n3(t)),{id:t,value:t,label:e==="status"?t:n}},r3={control:t=>ae(Z({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray"}),input:t=>ae(Z({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>ae(Z({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"}})},hw=({defaultValue:t,filterValues:e,filterType:n,showClearStatus:r,setFilters:i,handleResetData:s})=>{const{status:o,clearStatus:l}=_e(Me),u=e.map(f=>fw(f,n)),c=f=>{const p=f.value.toLocaleLowerCase();n==="sort"?i(h=>ae(Z({},h),{sort:p})):n==="status"&&i(h=>ae(Z({},h),{status:p.toLocaleUpperCase()})),s()},d=()=>{i(f=>ae(Z({},f),{status:""}))};return se("div",{className:"eow-w-full eow-mb-4",children:[j("label",{className:"eow-text-sm eow-mb-1",children:n==="status"?o:""}),j(Z$,{onChange:c,options:u,styles:r3,value:fw(t,n),placeholder:""}),r?j("a",{className:"eow-text-brandColor eow-cursor-pointer eow-text-sm eow-mb-8",onClick:()=>d(),children:l}):j(xe,{})]})},i3=({value:t,setFilters:e,handleResetData:n})=>{const{groupByStatus:r}=_e(Me);return se("div",{className:"eow-flex eow-items-center eow-cursor-pointer",onClick:()=>{e(s=>ae(Z({},s),{groupByStatus:!t})),n()},children:[j("input",{type:"checkbox",className:"eow-mr-2 focus:eow-outline-none eow-outline-none eow-cursor-pointer",checked:t,readOnly:!0}),j("span",{className:"eow-text-blueGray-600 eow-select-none",children:r})]})},a3=Object.values(Zy),s3=["active","inactive"],o3=({filters:t,options:e,setOptions:n,setFilters:r,handleResetData:i})=>{const{filterBy:s,sortBy:o}=_e(Me);return se("div",{className:"eow-grid md:eow-grid-cols-2 eow-gap-4 eow-grid-cols-1 eow-mb-6",children:[se("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[j("h3",{className:"eow-font-bold eow-mb-2",children:s}),j(hw,{filterType:"status",defaultValue:t.status,filterValues:s3,showClearStatus:!0,setFilters:r,handleResetData:i}),j(Yy,{defaultValue:t.flags,showLabel:!0,setObject:r,handleResetData:i}),j(B$,{options:e,setOptions:n,setFilters:r,handleResetData:i})]}),se("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[j("h3",{className:"eow-font-bold eow-mb-2",children:o}),j(hw,{filterType:"sort",defaultValue:t.sort,filterValues:a3,setFilters:r,handleResetData:i}),j(i3,{value:t.groupByStatus,setFilters:r,handleResetData:i})]})]})},l3=({children:t})=>j("div",{children:j("section",{className:"eow-mx-auto",children:j("div",{className:"eow-mb-8 eow-overflow-hidden eow-rounded eow-bg-white",children:j("div",{className:"eow-w-full eow-overflow-x-auto",children:t})})})}),u3=({fansUnitedEnvironment:t,hideSignOutButton:e})=>{const[n,r]=K.useState(new J$),[i,s]=K.useState(1),[o,l]=K.useState(null),[u,c]=K.useState(new Map),[d,f]=K.useState(null),[p,h]=K.useState(!1),[y,g]=K.useState(!1),[v,b]=K.useState(!1),[w,E]=K.useState(null),[m,A]=K.useState([]),{sdk:I,https:O}=_e(on),{getEitherOrsErrorMessage:T,getEitherOrErrorMessage:k,noGamesFound:P}=_e(Me),S=K.useMemo(()=>JSON.stringify(n),[n]),{isError:R,error:D,data:L}=su({queryKey:["eitherOrsList",S],queryFn:()=>I.miniGames.getEitherOrs(n,!1,!0)});K.useEffect(()=>{if(L){const M=new Map(u).set(i,L.data);c(M),l(L.meta.pagination.nextPageStartsAfter)}},[L]),K.useEffect(()=>{Array.from(u.keys()).length>0&&(Array.from(u.keys()).includes(i)||(x=>_(this,null,function*(){try{const W=yield I.miniGames.getEitherOrs(ae(Z({},n),{startAfter:x}),!1,!0);if(W.data.length>0){const U=new Map(u).set(i,W.data);c(U),l(W.meta.pagination.nextPageStartsAfter)}}catch(W){Pe.error(T),console.error(W)}}))(o))},[i]);const N=()=>s(M=>M-1),H=()=>s(M=>M+1),q=()=>h(!p),z=()=>f(null),$=M=>_(this,null,function*(){g(!0);const x=yield O.getEitherOrById(M);if(x.ok){const B=yield x.json();f(B.data),h(!0)}else console.error(k,yield x.json()),Pe.error(k);g(!1)}),F=()=>b(!v),C=()=>{s(1),c(new Map)};return R?(Pe.error(k),console.error(D),j(yh,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e})):p?j(z$,{eitherOrById:d,setFilters:r,toggleScreen:q,clearEitherOrById:z}):y||!u.get(i)?j(pm,{}):se(xe,{children:[se(l3,{children:[j(yh,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e}),j(o3,{filters:n,options:m,setOptions:A,setFilters:r,handleResetData:C}),u.get(i).length>0?se(xe,{children:[se("table",{className:"eow-w-full eow-border eow-border-gray-200 eow-mb-2 eow-table",children:[j(wI,{}),j(LS,{data:u.get(i),fetchEitherOrById:$,handleModal:F,setSelectedEitherOr:E})]}),j(BS,{pageCount:i,pageGames:u,getPreviousPage:N,getNextPage:H})]}):j("h2",{className:"eow-text-center eow-font-bold eow-text-xl eow-my-60",children:P})]}),j(K$,{isOpen:v,eitherOr:w,setFilters:r,handleClose:F})]})},c3=({fansUnitedEnvironment:t,hideSignOutButton:e})=>K.useContext(vh)?j(vI,{children:j(u3,{fansUnitedEnvironment:t,hideSignOutButton:e})}):j(mI,{fansUnitedEnvironment:t}),d3=new DI({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),f3=t=>{const e=v$(t.fansUnitedApiKey,t.fansUnitedClientId,t.fansUnitedLanguage,t.fansUnitedEnvironment),n=y$(t.sportal365Project,t.sportal365Infrastructure);return j(gI,{fansUnitedEnvironment:t.fansUnitedEnvironment,children:j(Fw,{labels:t.labels,children:j(NS,{config:e,sportal365Config:n,children:se(YI,{client:d3,children:[j(el,{position:"top-right",autoClose:5e3,hideProgressBar:!1,limit:3,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!0,pauseOnHover:!0}),j(c3,{fansUnitedEnvironment:t.fansUnitedEnvironment,hideSignOutButton:t.hideSignOutButton})]})})})})};Be.EitherOrManager=f3,Object.defineProperties(Be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
2335
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function d(C,M){if(!!C){if(typeof C=="string")return h(C,M);var x=Object.prototype.toString.call(C).slice(8,-1);if(x==="Object"&&C.constructor&&(x=C.constructor.name),x==="Map"||x==="Set")return Array.from(C);if(x==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(x))return h(C,M)}}function f(C){if(typeof Symbol!="undefined"&&Symbol.iterator in Object(C))return Array.from(C)}function p(C){if(Array.isArray(C))return h(C)}function h(C,M){(M==null||M>C.length)&&(M=C.length);for(var x=0,B=new Array(M);x<M;x++)B[x]=C[x];return B}function y(){return y=Object.assign||function(C){for(var M=1;M<arguments.length;M++){var x=arguments[M];for(var B in x)Object.prototype.hasOwnProperty.call(x,B)&&(C[B]=x[B])}return C},y.apply(this,arguments)}function g(C,M){if(C==null)return{};var x=v(C,M),B,W;if(Object.getOwnPropertySymbols){var U=Object.getOwnPropertySymbols(C);for(W=0;W<U.length;W++)B=U[W],!(M.indexOf(B)>=0)&&(!Object.prototype.propertyIsEnumerable.call(C,B)||(x[B]=C[B]))}return x}function v(C,M){if(C==null)return{};var x={},B=Object.keys(C),W,U;for(U=0;U<B.length;U++)W=B[U],!(M.indexOf(W)>=0)&&(x[W]=C[W]);return x}function b(C,M){var x=Object.keys(C);if(Object.getOwnPropertySymbols){var B=Object.getOwnPropertySymbols(C);M&&(B=B.filter(function(W){return Object.getOwnPropertyDescriptor(C,W).enumerable})),x.push.apply(x,B)}return x}function w(C){for(var M=1;M<arguments.length;M++){var x=arguments[M]!=null?arguments[M]:{};M%2?b(Object(x),!0).forEach(function(B){D(C,B,x[B])}):Object.getOwnPropertyDescriptors?Object.defineProperties(C,Object.getOwnPropertyDescriptors(x)):b(Object(x)).forEach(function(B){Object.defineProperty(C,B,Object.getOwnPropertyDescriptor(x,B))})}return C}function E(C,M){if(!(C instanceof M))throw new TypeError("Cannot call a class as a function")}function m(C,M){for(var x=0;x<M.length;x++){var B=M[x];B.enumerable=B.enumerable||!1,B.configurable=!0,"value"in B&&(B.writable=!0),Object.defineProperty(C,B.key,B)}}function A(C,M,x){return M&&m(C.prototype,M),x&&m(C,x),C}function I(C,M){if(typeof M!="function"&&M!==null)throw new TypeError("Super expression must either be null or a function");C.prototype=Object.create(M&&M.prototype,{constructor:{value:C,writable:!0,configurable:!0}}),M&&O(C,M)}function O(C,M){return O=Object.setPrototypeOf||function(B,W){return B.__proto__=W,B},O(C,M)}function T(C){var M=S();return function(){var B=R(C),W;if(M){var U=R(this).constructor;W=Reflect.construct(B,arguments,U)}else W=B.apply(this,arguments);return k(this,W)}}function k(C,M){return M&&(e(M)==="object"||typeof M=="function")?M:P(C)}function P(C){if(C===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return C}function S(){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(C){return!1}}function R(C){return R=Object.setPrototypeOf?Object.getPrototypeOf:function(x){return x.__proto__||Object.getPrototypeOf(x)},R(C)}function D(C,M,x){return M in C?Object.defineProperty(C,M,{value:x,enumerable:!0,configurable:!0,writable:!0}):C[M]=x,C}var L=["onChange","onOpen","onClose","onMonthChange","onYearChange","onReady","onValueUpdate","onDayCreate"],N=r.default.oneOfType([r.default.func,r.default.arrayOf(r.default.func)]),H=["onCreate","onDestroy"],q=r.default.func,z=function(C){I(x,C);var M=T(x);function x(){var B;E(this,x);for(var W=arguments.length,U=new Array(W),Q=0;Q<W;Q++)U[Q]=arguments[Q];return B=M.call.apply(M,[this].concat(U)),D(P(B),"createFlatpickrInstance",function(){var Y=w({onClose:function(){B.node.blur&&B.node.blur()}},B.props.options);Y=$(Y,B.props),B.flatpickr=(0,i.default)(B.node,Y),B.props.hasOwnProperty("value")&&B.flatpickr.setDate(B.props.value,!1);var X=B.props.onCreate;X&&X(B.flatpickr)}),D(P(B),"destroyFlatpickrInstance",function(){var Y=B.props.onDestroy;Y&&Y(B.flatpickr),B.flatpickr.destroy(),B.flatpickr=null}),D(P(B),"handleNodeChange",function(Y){B.node=Y,B.flatpickr&&(B.destroyFlatpickrInstance(),B.createFlatpickrInstance())}),B}return A(x,[{key:"componentDidUpdate",value:function(W){var U=this.props.options,Q=W.options;U=$(U,this.props),Q=$(Q,W);for(var Y=Object.getOwnPropertyNames(U),X=Y.length-1;X>=0;X--){var ee=Y[X],le=U[ee];le!==Q[ee]&&(L.indexOf(ee)!==-1&&!Array.isArray(le)&&(le=[le]),this.flatpickr.set(ee,le))}this.props.hasOwnProperty("value")&&!(this.props.value&&Array.isArray(this.props.value)&&W.value&&Array.isArray(W.value)&&this.props.value.every(function(me,ve){W[ve]}))&&this.props.value!==W.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 W=this.props,U=W.options,Q=W.defaultValue,Y=W.value,X=W.children,ee=W.render,le=g(W,["options","defaultValue","value","children","render"]);return L.forEach(function(me){delete le[me]}),H.forEach(function(me){delete le[me]}),ee?ee(w(w({},le),{},{defaultValue:Q,value:Y}),this.handleNodeChange):U.wrap?n.default.createElement("div",y({},le,{ref:this.handleNodeChange}),X):n.default.createElement("input",y({},le,{defaultValue:Q,ref:this.handleNodeChange}))}}]),x}(n.Component);D(z,"propTypes",{defaultValue:r.default.string,options:r.default.object,onChange:N,onOpen:N,onClose:N,onMonthChange:N,onYearChange:N,onReady:N,onValueUpdate:N,onDayCreate:N,onCreate:q,onDestroy:q,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}),D(z,"defaultProps",{options:{}});function $(C,M){var x=w({},C);return L.forEach(function(B){if(M.hasOwnProperty(B)){var W;x[B]&&!Array.isArray(x[B])?x[B]=[x[B]]:x[B]||(x[B]=[]);var U=Array.isArray(M[B])?M[B]:[M[B]];(W=x[B]).push.apply(W,u(U))}}),x}var F=z;t.default=F})(zv);const PB=vw(zv);var Ft="top",Xt="bottom",Zt="right",Nt="left",Dc="auto",Ca=[Ft,Xt,Zt,Nt],wi="start",Sa="end",MB="clippingParents",ty="viewport",Pa="popper",RB="reference",ny=Ca.reduce(function(t,e){return t.concat([e+"-"+wi,e+"-"+Sa])},[]),ry=[].concat(Ca,[Dc]).reduce(function(t,e){return t.concat([e,e+"-"+wi,e+"-"+Sa])},[]),kB="beforeRead",xB="read",DB="afterRead",FB="beforeMain",NB="main",LB="afterMain",BB="beforeWrite",$B="write",UB="afterWrite",jB=[kB,xB,DB,FB,NB,LB,BB,$B,UB];function Pn(t){return t?(t.nodeName||"").toLowerCase():null}function qt(t){if(t==null)return window;if(t.toString()!=="[object Window]"){var e=t.ownerDocument;return e&&e.defaultView||window}return t}function kr(t){var e=qt(t).Element;return t instanceof e||t instanceof Element}function en(t){var e=qt(t).HTMLElement;return t instanceof e||t instanceof HTMLElement}function Fc(t){if(typeof ShadowRoot=="undefined")return!1;var e=qt(t).ShadowRoot;return t instanceof e||t instanceof ShadowRoot}function HB(t){var e=t.state;Object.keys(e.elements).forEach(function(n){var r=e.styles[n]||{},i=e.attributes[n]||{},s=e.elements[n];!en(s)||!Pn(s)||(Object.assign(s.style,r),Object.keys(i).forEach(function(o){var l=i[o];l===!1?s.removeAttribute(o):s.setAttribute(o,l===!0?"":l)}))})}function VB(t){var e=t.state,n={popper:{position:e.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};return Object.assign(e.elements.popper.style,n.popper),e.styles=n,e.elements.arrow&&Object.assign(e.elements.arrow.style,n.arrow),function(){Object.keys(e.elements).forEach(function(r){var i=e.elements[r],s=e.attributes[r]||{},o=Object.keys(e.styles.hasOwnProperty(r)?e.styles[r]:n[r]),l=o.reduce(function(u,c){return u[c]="",u},{});!en(i)||!Pn(i)||(Object.assign(i.style,l),Object.keys(s).forEach(function(u){i.removeAttribute(u)}))})}}const iy={name:"applyStyles",enabled:!0,phase:"write",fn:HB,effect:VB,requires:["computeStyles"]};function Mn(t){return t.split("-")[0]}var xr=Math.max,Ho=Math.min,bi=Math.round;function Nc(){var t=navigator.userAgentData;return t!=null&&t.brands&&Array.isArray(t.brands)?t.brands.map(function(e){return e.brand+"/"+e.version}).join(" "):navigator.userAgent}function ay(){return!/^((?!chrome|android).)*safari/i.test(Nc())}function _i(t,e,n){e===void 0&&(e=!1),n===void 0&&(n=!1);var r=t.getBoundingClientRect(),i=1,s=1;e&&en(t)&&(i=t.offsetWidth>0&&bi(r.width)/t.offsetWidth||1,s=t.offsetHeight>0&&bi(r.height)/t.offsetHeight||1);var o=kr(t)?qt(t):window,l=o.visualViewport,u=!ay()&&n,c=(r.left+(u&&l?l.offsetLeft:0))/i,d=(r.top+(u&&l?l.offsetTop:0))/s,f=r.width/i,p=r.height/s;return{width:f,height:p,top:d,right:c+f,bottom:d+p,left:c,x:c,y:d}}function Lc(t){var e=_i(t),n=t.offsetWidth,r=t.offsetHeight;return Math.abs(e.width-n)<=1&&(n=e.width),Math.abs(e.height-r)<=1&&(r=e.height),{x:t.offsetLeft,y:t.offsetTop,width:n,height:r}}function sy(t,e){var n=e.getRootNode&&e.getRootNode();if(t.contains(e))return!0;if(n&&Fc(n)){var r=e;do{if(r&&t.isSameNode(r))return!0;r=r.parentNode||r.host}while(r)}return!1}function Wn(t){return qt(t).getComputedStyle(t)}function qB(t){return["table","td","th"].indexOf(Pn(t))>=0}function ur(t){return((kr(t)?t.ownerDocument:t.document)||window.document).documentElement}function Vo(t){return Pn(t)==="html"?t:t.assignedSlot||t.parentNode||(Fc(t)?t.host:null)||ur(t)}function oy(t){return!en(t)||Wn(t).position==="fixed"?null:t.offsetParent}function WB(t){var e=/firefox/i.test(Nc()),n=/Trident/i.test(Nc());if(n&&en(t)){var r=Wn(t);if(r.position==="fixed")return null}var i=Vo(t);for(Fc(i)&&(i=i.host);en(i)&&["html","body"].indexOf(Pn(i))<0;){var s=Wn(i);if(s.transform!=="none"||s.perspective!=="none"||s.contain==="paint"||["transform","perspective"].indexOf(s.willChange)!==-1||e&&s.willChange==="filter"||e&&s.filter&&s.filter!=="none")return i;i=i.parentNode}return null}function Ma(t){for(var e=qt(t),n=oy(t);n&&qB(n)&&Wn(n).position==="static";)n=oy(n);return n&&(Pn(n)==="html"||Pn(n)==="body"&&Wn(n).position==="static")?e:n||WB(t)||e}function Bc(t){return["top","bottom"].indexOf(t)>=0?"x":"y"}function Ra(t,e,n){return xr(t,Ho(e,n))}function GB(t,e,n){var r=Ra(t,e,n);return r>n?n:r}function ly(){return{top:0,right:0,bottom:0,left:0}}function uy(t){return Object.assign({},ly(),t)}function cy(t,e){return e.reduce(function(n,r){return n[r]=t,n},{})}var zB=function(e,n){return e=typeof e=="function"?e(Object.assign({},n.rects,{placement:n.placement})):e,uy(typeof e!="number"?e:cy(e,Ca))};function QB(t){var e,n=t.state,r=t.name,i=t.options,s=n.elements.arrow,o=n.modifiersData.popperOffsets,l=Mn(n.placement),u=Bc(l),c=[Nt,Zt].indexOf(l)>=0,d=c?"height":"width";if(!(!s||!o)){var f=zB(i.padding,n),p=Lc(s),h=u==="y"?Ft:Nt,y=u==="y"?Xt:Zt,g=n.rects.reference[d]+n.rects.reference[u]-o[u]-n.rects.popper[d],v=o[u]-n.rects.reference[u],b=Ma(s),w=b?u==="y"?b.clientHeight||0:b.clientWidth||0:0,E=g/2-v/2,m=f[h],A=w-p[d]-f[y],I=w/2-p[d]/2+E,O=Ra(m,I,A),T=u;n.modifiersData[r]=(e={},e[T]=O,e.centerOffset=O-I,e)}}function YB(t){var e=t.state,n=t.options,r=n.element,i=r===void 0?"[data-popper-arrow]":r;i!=null&&(typeof i=="string"&&(i=e.elements.popper.querySelector(i),!i)||!sy(e.elements.popper,i)||(e.elements.arrow=i))}const KB={name:"arrow",enabled:!0,phase:"main",fn:QB,effect:YB,requires:["popperOffsets"],requiresIfExists:["preventOverflow"]};function Ei(t){return t.split("-")[1]}var JB={top:"auto",right:"auto",bottom:"auto",left:"auto"};function XB(t,e){var n=t.x,r=t.y,i=e.devicePixelRatio||1;return{x:bi(n*i)/i||0,y:bi(r*i)/i||0}}function dy(t){var e,n=t.popper,r=t.popperRect,i=t.placement,s=t.variation,o=t.offsets,l=t.position,u=t.gpuAcceleration,c=t.adaptive,d=t.roundOffsets,f=t.isFixed,p=o.x,h=p===void 0?0:p,y=o.y,g=y===void 0?0:y,v=typeof d=="function"?d({x:h,y:g}):{x:h,y:g};h=v.x,g=v.y;var b=o.hasOwnProperty("x"),w=o.hasOwnProperty("y"),E=Nt,m=Ft,A=window;if(c){var I=Ma(n),O="clientHeight",T="clientWidth";if(I===qt(n)&&(I=ur(n),Wn(I).position!=="static"&&l==="absolute"&&(O="scrollHeight",T="scrollWidth")),I=I,i===Ft||(i===Nt||i===Zt)&&s===Sa){m=Xt;var k=f&&I===A&&A.visualViewport?A.visualViewport.height:I[O];g-=k-r.height,g*=u?1:-1}if(i===Nt||(i===Ft||i===Xt)&&s===Sa){E=Zt;var P=f&&I===A&&A.visualViewport?A.visualViewport.width:I[T];h-=P-r.width,h*=u?1:-1}}var S=Object.assign({position:l},c&&JB),R=d===!0?XB({x:h,y:g},qt(n)):{x:h,y:g};if(h=R.x,g=R.y,u){var D;return Object.assign({},S,(D={},D[m]=w?"0":"",D[E]=b?"0":"",D.transform=(A.devicePixelRatio||1)<=1?"translate("+h+"px, "+g+"px)":"translate3d("+h+"px, "+g+"px, 0)",D))}return Object.assign({},S,(e={},e[m]=w?g+"px":"",e[E]=b?h+"px":"",e.transform="",e))}function ZB(t){var e=t.state,n=t.options,r=n.gpuAcceleration,i=r===void 0?!0:r,s=n.adaptive,o=s===void 0?!0:s,l=n.roundOffsets,u=l===void 0?!0:l,c={placement:Mn(e.placement),variation:Ei(e.placement),popper:e.elements.popper,popperRect:e.rects.popper,gpuAcceleration:i,isFixed:e.options.strategy==="fixed"};e.modifiersData.popperOffsets!=null&&(e.styles.popper=Object.assign({},e.styles.popper,dy(Object.assign({},c,{offsets:e.modifiersData.popperOffsets,position:e.options.strategy,adaptive:o,roundOffsets:u})))),e.modifiersData.arrow!=null&&(e.styles.arrow=Object.assign({},e.styles.arrow,dy(Object.assign({},c,{offsets:e.modifiersData.arrow,position:"absolute",adaptive:!1,roundOffsets:u})))),e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-placement":e.placement})}const e5={name:"computeStyles",enabled:!0,phase:"beforeWrite",fn:ZB,data:{}};var qo={passive:!0};function t5(t){var e=t.state,n=t.instance,r=t.options,i=r.scroll,s=i===void 0?!0:i,o=r.resize,l=o===void 0?!0:o,u=qt(e.elements.popper),c=[].concat(e.scrollParents.reference,e.scrollParents.popper);return s&&c.forEach(function(d){d.addEventListener("scroll",n.update,qo)}),l&&u.addEventListener("resize",n.update,qo),function(){s&&c.forEach(function(d){d.removeEventListener("scroll",n.update,qo)}),l&&u.removeEventListener("resize",n.update,qo)}}const n5={name:"eventListeners",enabled:!0,phase:"write",fn:function(){},effect:t5,data:{}};var r5={left:"right",right:"left",bottom:"top",top:"bottom"};function Wo(t){return t.replace(/left|right|bottom|top/g,function(e){return r5[e]})}var i5={start:"end",end:"start"};function fy(t){return t.replace(/start|end/g,function(e){return i5[e]})}function $c(t){var e=qt(t),n=e.pageXOffset,r=e.pageYOffset;return{scrollLeft:n,scrollTop:r}}function Uc(t){return _i(ur(t)).left+$c(t).scrollLeft}function a5(t,e){var n=qt(t),r=ur(t),i=n.visualViewport,s=r.clientWidth,o=r.clientHeight,l=0,u=0;if(i){s=i.width,o=i.height;var c=ay();(c||!c&&e==="fixed")&&(l=i.offsetLeft,u=i.offsetTop)}return{width:s,height:o,x:l+Uc(t),y:u}}function s5(t){var e,n=ur(t),r=$c(t),i=(e=t.ownerDocument)==null?void 0:e.body,s=xr(n.scrollWidth,n.clientWidth,i?i.scrollWidth:0,i?i.clientWidth:0),o=xr(n.scrollHeight,n.clientHeight,i?i.scrollHeight:0,i?i.clientHeight:0),l=-r.scrollLeft+Uc(t),u=-r.scrollTop;return Wn(i||n).direction==="rtl"&&(l+=xr(n.clientWidth,i?i.clientWidth:0)-s),{width:s,height:o,x:l,y:u}}function jc(t){var e=Wn(t),n=e.overflow,r=e.overflowX,i=e.overflowY;return/auto|scroll|overlay|hidden/.test(n+i+r)}function hy(t){return["html","body","#document"].indexOf(Pn(t))>=0?t.ownerDocument.body:en(t)&&jc(t)?t:hy(Vo(t))}function ka(t,e){var n;e===void 0&&(e=[]);var r=hy(t),i=r===((n=t.ownerDocument)==null?void 0:n.body),s=qt(r),o=i?[s].concat(s.visualViewport||[],jc(r)?r:[]):r,l=e.concat(o);return i?l:l.concat(ka(Vo(o)))}function Hc(t){return Object.assign({},t,{left:t.x,top:t.y,right:t.x+t.width,bottom:t.y+t.height})}function o5(t,e){var n=_i(t,!1,e==="fixed");return n.top=n.top+t.clientTop,n.left=n.left+t.clientLeft,n.bottom=n.top+t.clientHeight,n.right=n.left+t.clientWidth,n.width=t.clientWidth,n.height=t.clientHeight,n.x=n.left,n.y=n.top,n}function py(t,e,n){return e===ty?Hc(a5(t,n)):kr(e)?o5(e,n):Hc(s5(ur(t)))}function l5(t){var e=ka(Vo(t)),n=["absolute","fixed"].indexOf(Wn(t).position)>=0,r=n&&en(t)?Ma(t):t;return kr(r)?e.filter(function(i){return kr(i)&&sy(i,r)&&Pn(i)!=="body"}):[]}function u5(t,e,n,r){var i=e==="clippingParents"?l5(t):[].concat(e),s=[].concat(i,[n]),o=s[0],l=s.reduce(function(u,c){var d=py(t,c,r);return u.top=xr(d.top,u.top),u.right=Ho(d.right,u.right),u.bottom=Ho(d.bottom,u.bottom),u.left=xr(d.left,u.left),u},py(t,o,r));return l.width=l.right-l.left,l.height=l.bottom-l.top,l.x=l.left,l.y=l.top,l}function my(t){var e=t.reference,n=t.element,r=t.placement,i=r?Mn(r):null,s=r?Ei(r):null,o=e.x+e.width/2-n.width/2,l=e.y+e.height/2-n.height/2,u;switch(i){case Ft:u={x:o,y:e.y-n.height};break;case Xt:u={x:o,y:e.y+e.height};break;case Zt:u={x:e.x+e.width,y:l};break;case Nt:u={x:e.x-n.width,y:l};break;default:u={x:e.x,y:e.y}}var c=i?Bc(i):null;if(c!=null){var d=c==="y"?"height":"width";switch(s){case wi:u[c]=u[c]-(e[d]/2-n[d]/2);break;case Sa:u[c]=u[c]+(e[d]/2-n[d]/2);break}}return u}function xa(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=r===void 0?t.placement:r,s=n.strategy,o=s===void 0?t.strategy:s,l=n.boundary,u=l===void 0?MB:l,c=n.rootBoundary,d=c===void 0?ty:c,f=n.elementContext,p=f===void 0?Pa:f,h=n.altBoundary,y=h===void 0?!1:h,g=n.padding,v=g===void 0?0:g,b=uy(typeof v!="number"?v:cy(v,Ca)),w=p===Pa?RB:Pa,E=t.rects.popper,m=t.elements[y?w:p],A=u5(kr(m)?m:m.contextElement||ur(t.elements.popper),u,d,o),I=_i(t.elements.reference),O=my({reference:I,element:E,strategy:"absolute",placement:i}),T=Hc(Object.assign({},E,O)),k=p===Pa?T:I,P={top:A.top-k.top+b.top,bottom:k.bottom-A.bottom+b.bottom,left:A.left-k.left+b.left,right:k.right-A.right+b.right},S=t.modifiersData.offset;if(p===Pa&&S){var R=S[i];Object.keys(P).forEach(function(D){var L=[Zt,Xt].indexOf(D)>=0?1:-1,N=[Ft,Xt].indexOf(D)>=0?"y":"x";P[D]+=R[N]*L})}return P}function c5(t,e){e===void 0&&(e={});var n=e,r=n.placement,i=n.boundary,s=n.rootBoundary,o=n.padding,l=n.flipVariations,u=n.allowedAutoPlacements,c=u===void 0?ry:u,d=Ei(r),f=d?l?ny:ny.filter(function(y){return Ei(y)===d}):Ca,p=f.filter(function(y){return c.indexOf(y)>=0});p.length===0&&(p=f);var h=p.reduce(function(y,g){return y[g]=xa(t,{placement:g,boundary:i,rootBoundary:s,padding:o})[Mn(g)],y},{});return Object.keys(h).sort(function(y,g){return h[y]-h[g]})}function d5(t){if(Mn(t)===Dc)return[];var e=Wo(t);return[fy(t),e,fy(e)]}function f5(t){var e=t.state,n=t.options,r=t.name;if(!e.modifiersData[r]._skip){for(var i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,l=o===void 0?!0:o,u=n.fallbackPlacements,c=n.padding,d=n.boundary,f=n.rootBoundary,p=n.altBoundary,h=n.flipVariations,y=h===void 0?!0:h,g=n.allowedAutoPlacements,v=e.options.placement,b=Mn(v),w=b===v,E=u||(w||!y?[Wo(v)]:d5(v)),m=[v].concat(E).reduce(function(B,W){return B.concat(Mn(W)===Dc?c5(e,{placement:W,boundary:d,rootBoundary:f,padding:c,flipVariations:y,allowedAutoPlacements:g}):W)},[]),A=e.rects.reference,I=e.rects.popper,O=new Map,T=!0,k=m[0],P=0;P<m.length;P++){var S=m[P],R=Mn(S),D=Ei(S)===wi,L=[Ft,Xt].indexOf(R)>=0,N=L?"width":"height",H=xa(e,{placement:S,boundary:d,rootBoundary:f,altBoundary:p,padding:c}),q=L?D?Zt:Nt:D?Xt:Ft;A[N]>I[N]&&(q=Wo(q));var z=Wo(q),$=[];if(s&&$.push(H[R]<=0),l&&$.push(H[q]<=0,H[z]<=0),$.every(function(B){return B})){k=S,T=!1;break}O.set(S,$)}if(T)for(var F=y?3:1,C=function(W){var U=m.find(function(Q){var Y=O.get(Q);if(Y)return Y.slice(0,W).every(function(X){return X})});if(U)return k=U,"break"},M=F;M>0;M--){var x=C(M);if(x==="break")break}e.placement!==k&&(e.modifiersData[r]._skip=!0,e.placement=k,e.reset=!0)}}const h5={name:"flip",enabled:!0,phase:"main",fn:f5,requiresIfExists:["offset"],data:{_skip:!1}};function gy(t,e,n){return n===void 0&&(n={x:0,y:0}),{top:t.top-e.height-n.y,right:t.right-e.width+n.x,bottom:t.bottom-e.height+n.y,left:t.left-e.width-n.x}}function vy(t){return[Ft,Zt,Xt,Nt].some(function(e){return t[e]>=0})}function p5(t){var e=t.state,n=t.name,r=e.rects.reference,i=e.rects.popper,s=e.modifiersData.preventOverflow,o=xa(e,{elementContext:"reference"}),l=xa(e,{altBoundary:!0}),u=gy(o,r),c=gy(l,i,s),d=vy(u),f=vy(c);e.modifiersData[n]={referenceClippingOffsets:u,popperEscapeOffsets:c,isReferenceHidden:d,hasPopperEscaped:f},e.attributes.popper=Object.assign({},e.attributes.popper,{"data-popper-reference-hidden":d,"data-popper-escaped":f})}const m5={name:"hide",enabled:!0,phase:"main",requiresIfExists:["preventOverflow"],fn:p5};function g5(t,e,n){var r=Mn(t),i=[Nt,Ft].indexOf(r)>=0?-1:1,s=typeof n=="function"?n(Object.assign({},e,{placement:t})):n,o=s[0],l=s[1];return o=o||0,l=(l||0)*i,[Nt,Zt].indexOf(r)>=0?{x:l,y:o}:{x:o,y:l}}function v5(t){var e=t.state,n=t.options,r=t.name,i=n.offset,s=i===void 0?[0,0]:i,o=ry.reduce(function(d,f){return d[f]=g5(f,e.rects,s),d},{}),l=o[e.placement],u=l.x,c=l.y;e.modifiersData.popperOffsets!=null&&(e.modifiersData.popperOffsets.x+=u,e.modifiersData.popperOffsets.y+=c),e.modifiersData[r]=o}const y5={name:"offset",enabled:!0,phase:"main",requires:["popperOffsets"],fn:v5};function w5(t){var e=t.state,n=t.name;e.modifiersData[n]=my({reference:e.rects.reference,element:e.rects.popper,strategy:"absolute",placement:e.placement})}const b5={name:"popperOffsets",enabled:!0,phase:"read",fn:w5,data:{}};function _5(t){return t==="x"?"y":"x"}function E5(t){var e=t.state,n=t.options,r=t.name,i=n.mainAxis,s=i===void 0?!0:i,o=n.altAxis,l=o===void 0?!1:o,u=n.boundary,c=n.rootBoundary,d=n.altBoundary,f=n.padding,p=n.tether,h=p===void 0?!0:p,y=n.tetherOffset,g=y===void 0?0:y,v=xa(e,{boundary:u,rootBoundary:c,padding:f,altBoundary:d}),b=Mn(e.placement),w=Ei(e.placement),E=!w,m=Bc(b),A=_5(m),I=e.modifiersData.popperOffsets,O=e.rects.reference,T=e.rects.popper,k=typeof g=="function"?g(Object.assign({},e.rects,{placement:e.placement})):g,P=typeof k=="number"?{mainAxis:k,altAxis:k}:Object.assign({mainAxis:0,altAxis:0},k),S=e.modifiersData.offset?e.modifiersData.offset[e.placement]:null,R={x:0,y:0};if(!!I){if(s){var D,L=m==="y"?Ft:Nt,N=m==="y"?Xt:Zt,H=m==="y"?"height":"width",q=I[m],z=q+v[L],$=q-v[N],F=h?-T[H]/2:0,C=w===wi?O[H]:T[H],M=w===wi?-T[H]:-O[H],x=e.elements.arrow,B=h&&x?Lc(x):{width:0,height:0},W=e.modifiersData["arrow#persistent"]?e.modifiersData["arrow#persistent"].padding:ly(),U=W[L],Q=W[N],Y=Ra(0,O[H],B[H]),X=E?O[H]/2-F-Y-U-P.mainAxis:C-Y-U-P.mainAxis,ee=E?-O[H]/2+F+Y+Q+P.mainAxis:M+Y+Q+P.mainAxis,le=e.elements.arrow&&Ma(e.elements.arrow),me=le?m==="y"?le.clientTop||0:le.clientLeft||0:0,ve=(D=S==null?void 0:S[m])!=null?D:0,Ae=q+X-ve-me,Se=q+ee-ve,Ze=Ra(h?Ho(z,Ae):z,q,h?xr($,Se):$);I[m]=Ze,R[m]=Ze-q}if(l){var Ve,te=m==="x"?Ft:Nt,re=m==="x"?Xt:Zt,ue=I[A],he=A==="y"?"height":"width",oe=ue+v[te],Ee=ue-v[re],Oe=[Ft,Nt].indexOf(b)!==-1,Te=(Ve=S==null?void 0:S[A])!=null?Ve:0,mt=Oe?oe:ue-O[he]-T[he]-Te+P.altAxis,_t=Oe?ue+O[he]+T[he]-Te-P.altAxis:Ee,qe=h&&Oe?GB(mt,ue,_t):Ra(h?mt:oe,ue,h?_t:Ee);I[A]=qe,R[A]=qe-ue}e.modifiersData[r]=R}}const I5={name:"preventOverflow",enabled:!0,phase:"main",fn:E5,requiresIfExists:["offset"]};function A5(t){return{scrollLeft:t.scrollLeft,scrollTop:t.scrollTop}}function O5(t){return t===qt(t)||!en(t)?$c(t):A5(t)}function T5(t){var e=t.getBoundingClientRect(),n=bi(e.width)/t.offsetWidth||1,r=bi(e.height)/t.offsetHeight||1;return n!==1||r!==1}function C5(t,e,n){n===void 0&&(n=!1);var r=en(e),i=en(e)&&T5(e),s=ur(e),o=_i(t,i,n),l={scrollLeft:0,scrollTop:0},u={x:0,y:0};return(r||!r&&!n)&&((Pn(e)!=="body"||jc(s))&&(l=O5(e)),en(e)?(u=_i(e,!0),u.x+=e.clientLeft,u.y+=e.clientTop):s&&(u.x=Uc(s))),{x:o.left+l.scrollLeft-u.x,y:o.top+l.scrollTop-u.y,width:o.width,height:o.height}}function S5(t){var e=new Map,n=new Set,r=[];t.forEach(function(s){e.set(s.name,s)});function i(s){n.add(s.name);var o=[].concat(s.requires||[],s.requiresIfExists||[]);o.forEach(function(l){if(!n.has(l)){var u=e.get(l);u&&i(u)}}),r.push(s)}return t.forEach(function(s){n.has(s.name)||i(s)}),r}function P5(t){var e=S5(t);return jB.reduce(function(n,r){return n.concat(e.filter(function(i){return i.phase===r}))},[])}function M5(t){var e;return function(){return e||(e=new Promise(function(n){Promise.resolve().then(function(){e=void 0,n(t())})})),e}}function R5(t){var e=t.reduce(function(n,r){var i=n[r.name];return n[r.name]=i?Object.assign({},i,r,{options:Object.assign({},i.options,r.options),data:Object.assign({},i.data,r.data)}):r,n},{});return Object.keys(e).map(function(n){return e[n]})}var yy={placement:"bottom",modifiers:[],strategy:"absolute"};function wy(){for(var t=arguments.length,e=new Array(t),n=0;n<t;n++)e[n]=arguments[n];return!e.some(function(r){return!(r&&typeof r.getBoundingClientRect=="function")})}function k5(t){t===void 0&&(t={});var e=t,n=e.defaultModifiers,r=n===void 0?[]:n,i=e.defaultOptions,s=i===void 0?yy:i;return function(l,u,c){c===void 0&&(c=s);var d={placement:"bottom",orderedModifiers:[],options:Object.assign({},yy,s),modifiersData:{},elements:{reference:l,popper:u},attributes:{},styles:{}},f=[],p=!1,h={state:d,setOptions:function(b){var w=typeof b=="function"?b(d.options):b;g(),d.options=Object.assign({},s,d.options,w),d.scrollParents={reference:kr(l)?ka(l):l.contextElement?ka(l.contextElement):[],popper:ka(u)};var E=P5(R5([].concat(r,d.options.modifiers)));return d.orderedModifiers=E.filter(function(m){return m.enabled}),y(),h.update()},forceUpdate:function(){if(!p){var b=d.elements,w=b.reference,E=b.popper;if(!!wy(w,E)){d.rects={reference:C5(w,Ma(E),d.options.strategy==="fixed"),popper:Lc(E)},d.reset=!1,d.placement=d.options.placement,d.orderedModifiers.forEach(function(P){return d.modifiersData[P.name]=Object.assign({},P.data)});for(var m=0;m<d.orderedModifiers.length;m++){if(d.reset===!0){d.reset=!1,m=-1;continue}var A=d.orderedModifiers[m],I=A.fn,O=A.options,T=O===void 0?{}:O,k=A.name;typeof I=="function"&&(d=I({state:d,options:T,name:k,instance:h})||d)}}}},update:M5(function(){return new Promise(function(v){h.forceUpdate(),v(d)})}),destroy:function(){g(),p=!0}};if(!wy(l,u))return h;h.setOptions(c).then(function(v){!p&&c.onFirstUpdate&&c.onFirstUpdate(v)});function y(){d.orderedModifiers.forEach(function(v){var b=v.name,w=v.options,E=w===void 0?{}:w,m=v.effect;if(typeof m=="function"){var A=m({state:d,name:b,instance:h,options:E}),I=function(){};f.push(A||I)}})}function g(){f.forEach(function(v){return v()}),f=[]}return h}}var x5=[n5,b5,e5,iy,y5,h5,I5,KB,m5],D5=k5({defaultModifiers:x5}),F5="tippy-box",by="tippy-content",N5="tippy-backdrop",_y="tippy-arrow",Ey="tippy-svg-arrow",Dr={passive:!0,capture:!0},Iy=function(){return document.body};function Vc(t,e,n){if(Array.isArray(t)){var r=t[e];return r==null?Array.isArray(n)?n[e]:n:r}return t}function qc(t,e){var n={}.toString.call(t);return n.indexOf("[object")===0&&n.indexOf(e+"]")>-1}function Ay(t,e){return typeof t=="function"?t.apply(void 0,e):t}function Oy(t,e){if(e===0)return t;var n;return function(r){clearTimeout(n),n=setTimeout(function(){t(r)},e)}}function L5(t){return t.split(/\s+/).filter(Boolean)}function Ii(t){return[].concat(t)}function Ty(t,e){t.indexOf(e)===-1&&t.push(e)}function B5(t){return t.filter(function(e,n){return t.indexOf(e)===n})}function $5(t){return t.split("-")[0]}function Go(t){return[].slice.call(t)}function Cy(t){return Object.keys(t).reduce(function(e,n){return t[n]!==void 0&&(e[n]=t[n]),e},{})}function Da(){return document.createElement("div")}function zo(t){return["Element","Fragment"].some(function(e){return qc(t,e)})}function U5(t){return qc(t,"NodeList")}function j5(t){return qc(t,"MouseEvent")}function H5(t){return!!(t&&t._tippy&&t._tippy.reference===t)}function V5(t){return zo(t)?[t]:U5(t)?Go(t):Array.isArray(t)?t:Go(document.querySelectorAll(t))}function Wc(t,e){t.forEach(function(n){n&&(n.style.transitionDuration=e+"ms")})}function Sy(t,e){t.forEach(function(n){n&&n.setAttribute("data-state",e)})}function q5(t){var e,n=Ii(t),r=n[0];return r!=null&&(e=r.ownerDocument)!=null&&e.body?r.ownerDocument:document}function W5(t,e){var n=e.clientX,r=e.clientY;return t.every(function(i){var s=i.popperRect,o=i.popperState,l=i.props,u=l.interactiveBorder,c=$5(o.placement),d=o.modifiersData.offset;if(!d)return!0;var f=c==="bottom"?d.top.y:0,p=c==="top"?d.bottom.y:0,h=c==="right"?d.left.x:0,y=c==="left"?d.right.x:0,g=s.top-r+f>u,v=r-s.bottom-p>u,b=s.left-n+h>u,w=n-s.right-y>u;return g||v||b||w})}function Gc(t,e,n){var r=e+"EventListener";["transitionend","webkitTransitionEnd"].forEach(function(i){t[r](i,n)})}function Py(t,e){for(var n=e;n;){var r;if(t.contains(n))return!0;n=n.getRootNode==null||(r=n.getRootNode())==null?void 0:r.host}return!1}var Rn={isTouch:!1},My=0;function G5(){Rn.isTouch||(Rn.isTouch=!0,window.performance&&document.addEventListener("mousemove",Ry))}function Ry(){var t=performance.now();t-My<20&&(Rn.isTouch=!1,document.removeEventListener("mousemove",Ry)),My=t}function z5(){var t=document.activeElement;if(H5(t)){var e=t._tippy;t.blur&&!e.state.isVisible&&t.blur()}}function Q5(){document.addEventListener("touchstart",G5,Dr),window.addEventListener("blur",z5)}var Y5=typeof window!="undefined"&&typeof document!="undefined",K5=Y5?!!window.msCrypto:!1,J5={animateFill:!1,followCursor:!1,inlinePositioning:!1,sticky:!1},X5={allowHTML:!1,animation:"fade",arrow:!0,content:"",inertia:!1,maxWidth:350,role:"tooltip",theme:"",zIndex:9999},fn=Object.assign({appendTo:Iy,aria:{content:"auto",expanded:"auto"},delay:0,duration:[300,250],getReferenceClientRect:null,hideOnClick:!0,ignoreAttributes:!1,interactive:!1,interactiveBorder:2,interactiveDebounce:0,moveTransition:"",offset:[0,10],onAfterUpdate:function(){},onBeforeUpdate:function(){},onCreate:function(){},onDestroy:function(){},onHidden:function(){},onHide:function(){},onMount:function(){},onShow:function(){},onShown:function(){},onTrigger:function(){},onUntrigger:function(){},onClickOutside:function(){},placement:"top",plugins:[],popperOptions:{},render:null,showOnCreate:!1,touch:!0,trigger:"mouseenter focus",triggerTarget:null},J5,X5),Z5=Object.keys(fn),e$=function(e){var n=Object.keys(e);n.forEach(function(r){fn[r]=e[r]})};function ky(t){var e=t.plugins||[],n=e.reduce(function(r,i){var s=i.name,o=i.defaultValue;if(s){var l;r[s]=t[s]!==void 0?t[s]:(l=fn[s])!=null?l:o}return r},{});return Object.assign({},t,n)}function t$(t,e){var n=e?Object.keys(ky(Object.assign({},fn,{plugins:e}))):Z5,r=n.reduce(function(i,s){var o=(t.getAttribute("data-tippy-"+s)||"").trim();if(!o)return i;if(s==="content")i[s]=o;else try{i[s]=JSON.parse(o)}catch(l){i[s]=o}return i},{});return r}function xy(t,e){var n=Object.assign({},e,{content:Ay(e.content,[t])},e.ignoreAttributes?{}:t$(t,e.plugins));return n.aria=Object.assign({},fn.aria,n.aria),n.aria={expanded:n.aria.expanded==="auto"?e.interactive:n.aria.expanded,content:n.aria.content==="auto"?e.interactive?null:"describedby":n.aria.content},n}var n$=function(){return"innerHTML"};function zc(t,e){t[n$()]=e}function Dy(t){var e=Da();return t===!0?e.className=_y:(e.className=Ey,zo(t)?e.appendChild(t):zc(e,t)),e}function Fy(t,e){zo(e.content)?(zc(t,""),t.appendChild(e.content)):typeof e.content!="function"&&(e.allowHTML?zc(t,e.content):t.textContent=e.content)}function Qc(t){var e=t.firstElementChild,n=Go(e.children);return{box:e,content:n.find(function(r){return r.classList.contains(by)}),arrow:n.find(function(r){return r.classList.contains(_y)||r.classList.contains(Ey)}),backdrop:n.find(function(r){return r.classList.contains(N5)})}}function Ny(t){var e=Da(),n=Da();n.className=F5,n.setAttribute("data-state","hidden"),n.setAttribute("tabindex","-1");var r=Da();r.className=by,r.setAttribute("data-state","hidden"),Fy(r,t.props),e.appendChild(n),n.appendChild(r),i(t.props,t.props);function i(s,o){var l=Qc(e),u=l.box,c=l.content,d=l.arrow;o.theme?u.setAttribute("data-theme",o.theme):u.removeAttribute("data-theme"),typeof o.animation=="string"?u.setAttribute("data-animation",o.animation):u.removeAttribute("data-animation"),o.inertia?u.setAttribute("data-inertia",""):u.removeAttribute("data-inertia"),u.style.maxWidth=typeof o.maxWidth=="number"?o.maxWidth+"px":o.maxWidth,o.role?u.setAttribute("role",o.role):u.removeAttribute("role"),(s.content!==o.content||s.allowHTML!==o.allowHTML)&&Fy(c,t.props),o.arrow?d?s.arrow!==o.arrow&&(u.removeChild(d),u.appendChild(Dy(o.arrow))):u.appendChild(Dy(o.arrow)):d&&u.removeChild(d)}return{popper:e,onUpdate:i}}Ny.$$tippy=!0;var r$=1,Qo=[],Yc=[];function i$(t,e){var n=xy(t,Object.assign({},fn,ky(Cy(e)))),r,i,s,o=!1,l=!1,u=!1,c=!1,d,f,p,h=[],y=Oy(Ae,n.interactiveDebounce),g,v=r$++,b=null,w=B5(n.plugins),E={isEnabled:!0,isVisible:!1,isDestroyed:!1,isMounted:!1,isShown:!1},m={id:v,reference:t,popper:Da(),popperInstance:b,props:n,state:E,plugins:w,clearDelayTimeouts:mt,setProps:_t,setContent:qe,show:Ai,hide:et,hideWithInteractivity:tn,enable:Oe,disable:Te,unmount:Yo,destroy:sd};if(!n.render)return m;var A=n.render(m),I=A.popper,O=A.onUpdate;I.setAttribute("data-tippy-root",""),I.id="tippy-"+m.id,m.popper=I,t._tippy=m,I._tippy=m;var T=w.map(function(ie){return ie.fn(m)}),k=t.hasAttribute("aria-expanded");return le(),F(),q(),z("onCreate",[m]),n.showOnCreate&&oe(),I.addEventListener("mouseenter",function(){m.props.interactive&&m.state.isVisible&&m.clearDelayTimeouts()}),I.addEventListener("mouseleave",function(){m.props.interactive&&m.props.trigger.indexOf("mouseenter")>=0&&L().addEventListener("mousemove",y)}),m;function P(){var ie=m.props.touch;return Array.isArray(ie)?ie:[ie,0]}function S(){return P()[0]==="hold"}function R(){var ie;return!!((ie=m.props.render)!=null&&ie.$$tippy)}function D(){return g||t}function L(){var ie=D().parentNode;return ie?q5(ie):document}function N(){return Qc(I)}function H(ie){return m.state.isMounted&&!m.state.isVisible||Rn.isTouch||d&&d.type==="focus"?0:Vc(m.props.delay,ie?0:1,fn.delay)}function q(ie){ie===void 0&&(ie=!1),I.style.pointerEvents=m.props.interactive&&!ie?"":"none",I.style.zIndex=""+m.props.zIndex}function z(ie,fe,Ie){if(Ie===void 0&&(Ie=!0),T.forEach(function(De){De[ie]&&De[ie].apply(De,fe)}),Ie){var Le;(Le=m.props)[ie].apply(Le,fe)}}function $(){var ie=m.props.aria;if(!!ie.content){var fe="aria-"+ie.content,Ie=I.id,Le=Ii(m.props.triggerTarget||t);Le.forEach(function(De){var ft=De.getAttribute(fe);if(m.state.isVisible)De.setAttribute(fe,ft?ft+" "+Ie:Ie);else{var At=ft&&ft.replace(Ie,"").trim();At?De.setAttribute(fe,At):De.removeAttribute(fe)}})}}function F(){if(!(k||!m.props.aria.expanded)){var ie=Ii(m.props.triggerTarget||t);ie.forEach(function(fe){m.props.interactive?fe.setAttribute("aria-expanded",m.state.isVisible&&fe===D()?"true":"false"):fe.removeAttribute("aria-expanded")})}}function C(){L().removeEventListener("mousemove",y),Qo=Qo.filter(function(ie){return ie!==y})}function M(ie){if(!(Rn.isTouch&&(u||ie.type==="mousedown"))){var fe=ie.composedPath&&ie.composedPath()[0]||ie.target;if(!(m.props.interactive&&Py(I,fe))){if(Ii(m.props.triggerTarget||t).some(function(Ie){return Py(Ie,fe)})){if(Rn.isTouch||m.state.isVisible&&m.props.trigger.indexOf("click")>=0)return}else z("onClickOutside",[m,ie]);m.props.hideOnClick===!0&&(m.clearDelayTimeouts(),m.hide(),l=!0,setTimeout(function(){l=!1}),m.state.isMounted||U())}}}function x(){u=!0}function B(){u=!1}function W(){var ie=L();ie.addEventListener("mousedown",M,!0),ie.addEventListener("touchend",M,Dr),ie.addEventListener("touchstart",B,Dr),ie.addEventListener("touchmove",x,Dr)}function U(){var ie=L();ie.removeEventListener("mousedown",M,!0),ie.removeEventListener("touchend",M,Dr),ie.removeEventListener("touchstart",B,Dr),ie.removeEventListener("touchmove",x,Dr)}function Q(ie,fe){X(ie,function(){!m.state.isVisible&&I.parentNode&&I.parentNode.contains(I)&&fe()})}function Y(ie,fe){X(ie,fe)}function X(ie,fe){var Ie=N().box;function Le(De){De.target===Ie&&(Gc(Ie,"remove",Le),fe())}if(ie===0)return fe();Gc(Ie,"remove",f),Gc(Ie,"add",Le),f=Le}function ee(ie,fe,Ie){Ie===void 0&&(Ie=!1);var Le=Ii(m.props.triggerTarget||t);Le.forEach(function(De){De.addEventListener(ie,fe,Ie),h.push({node:De,eventType:ie,handler:fe,options:Ie})})}function le(){S()&&(ee("touchstart",ve,{passive:!0}),ee("touchend",Se,{passive:!0})),L5(m.props.trigger).forEach(function(ie){if(ie!=="manual")switch(ee(ie,ve),ie){case"mouseenter":ee("mouseleave",Se);break;case"focus":ee(K5?"focusout":"blur",Ze);break;case"focusin":ee("focusout",Ze);break}})}function me(){h.forEach(function(ie){var fe=ie.node,Ie=ie.eventType,Le=ie.handler,De=ie.options;fe.removeEventListener(Ie,Le,De)}),h=[]}function ve(ie){var fe,Ie=!1;if(!(!m.state.isEnabled||Ve(ie)||l)){var Le=((fe=d)==null?void 0:fe.type)==="focus";d=ie,g=ie.currentTarget,F(),!m.state.isVisible&&j5(ie)&&Qo.forEach(function(De){return De(ie)}),ie.type==="click"&&(m.props.trigger.indexOf("mouseenter")<0||o)&&m.props.hideOnClick!==!1&&m.state.isVisible?Ie=!0:oe(ie),ie.type==="click"&&(o=!Ie),Ie&&!Le&&Ee(ie)}}function Ae(ie){var fe=ie.target,Ie=D().contains(fe)||I.contains(fe);if(!(ie.type==="mousemove"&&Ie)){var Le=he().concat(I).map(function(De){var ft,At=De._tippy,Ot=(ft=At.popperInstance)==null?void 0:ft.state;return Ot?{popperRect:De.getBoundingClientRect(),popperState:Ot,props:n}:null}).filter(Boolean);W5(Le,ie)&&(C(),Ee(ie))}}function Se(ie){var fe=Ve(ie)||m.props.trigger.indexOf("click")>=0&&o;if(!fe){if(m.props.interactive){m.hideWithInteractivity(ie);return}Ee(ie)}}function Ze(ie){m.props.trigger.indexOf("focusin")<0&&ie.target!==D()||m.props.interactive&&ie.relatedTarget&&I.contains(ie.relatedTarget)||Ee(ie)}function Ve(ie){return Rn.isTouch?S()!==ie.type.indexOf("touch")>=0:!1}function te(){re();var ie=m.props,fe=ie.popperOptions,Ie=ie.placement,Le=ie.offset,De=ie.getReferenceClientRect,ft=ie.moveTransition,At=R()?Qc(I).arrow:null,Ot=De?{getBoundingClientRect:De,contextElement:De.contextElement||D()}:t,Ko={name:"$$tippy",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(G){var J=G.state;if(R()){var ne=N(),de=ne.box;["placement","reference-hidden","escaped"].forEach(function(pe){pe==="placement"?de.setAttribute("data-placement",J.placement):J.attributes.popper["data-popper-"+pe]?de.setAttribute("data-"+pe,""):de.removeAttribute("data-"+pe)}),J.attributes.popper={}}}},Gn=[{name:"offset",options:{offset:Le}},{name:"preventOverflow",options:{padding:{top:2,bottom:2,left:5,right:5}}},{name:"flip",options:{padding:5}},{name:"computeStyles",options:{adaptive:!ft}},Ko];R()&&At&&Gn.push({name:"arrow",options:{element:At,padding:3}}),Gn.push.apply(Gn,(fe==null?void 0:fe.modifiers)||[]),m.popperInstance=D5(Ot,I,Object.assign({},fe,{placement:Ie,onFirstUpdate:p,modifiers:Gn}))}function re(){m.popperInstance&&(m.popperInstance.destroy(),m.popperInstance=null)}function ue(){var ie=m.props.appendTo,fe,Ie=D();m.props.interactive&&ie===Iy||ie==="parent"?fe=Ie.parentNode:fe=Ay(ie,[Ie]),fe.contains(I)||fe.appendChild(I),m.state.isMounted=!0,te()}function he(){return Go(I.querySelectorAll("[data-tippy-root]"))}function oe(ie){m.clearDelayTimeouts(),ie&&z("onTrigger",[m,ie]),W();var fe=H(!0),Ie=P(),Le=Ie[0],De=Ie[1];Rn.isTouch&&Le==="hold"&&De&&(fe=De),fe?r=setTimeout(function(){m.show()},fe):m.show()}function Ee(ie){if(m.clearDelayTimeouts(),z("onUntrigger",[m,ie]),!m.state.isVisible){U();return}if(!(m.props.trigger.indexOf("mouseenter")>=0&&m.props.trigger.indexOf("click")>=0&&["mouseleave","mousemove"].indexOf(ie.type)>=0&&o)){var fe=H(!1);fe?i=setTimeout(function(){m.state.isVisible&&m.hide()},fe):s=requestAnimationFrame(function(){m.hide()})}}function Oe(){m.state.isEnabled=!0}function Te(){m.hide(),m.state.isEnabled=!1}function mt(){clearTimeout(r),clearTimeout(i),cancelAnimationFrame(s)}function _t(ie){if(!m.state.isDestroyed){z("onBeforeUpdate",[m,ie]),me();var fe=m.props,Ie=xy(t,Object.assign({},fe,Cy(ie),{ignoreAttributes:!0}));m.props=Ie,le(),fe.interactiveDebounce!==Ie.interactiveDebounce&&(C(),y=Oy(Ae,Ie.interactiveDebounce)),fe.triggerTarget&&!Ie.triggerTarget?Ii(fe.triggerTarget).forEach(function(Le){Le.removeAttribute("aria-expanded")}):Ie.triggerTarget&&t.removeAttribute("aria-expanded"),F(),q(),O&&O(fe,Ie),m.popperInstance&&(te(),he().forEach(function(Le){requestAnimationFrame(Le._tippy.popperInstance.forceUpdate)})),z("onAfterUpdate",[m,ie])}}function qe(ie){m.setProps({content:ie})}function Ai(){var ie=m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Rn.isTouch&&!m.props.touch,De=Vc(m.props.duration,0,fn.duration);if(!(ie||fe||Ie||Le)&&!D().hasAttribute("disabled")&&(z("onShow",[m],!1),m.props.onShow(m)!==!1)){if(m.state.isVisible=!0,R()&&(I.style.visibility="visible"),q(),W(),m.state.isMounted||(I.style.transition="none"),R()){var ft=N(),At=ft.box,Ot=ft.content;Wc([At,Ot],0)}p=function(){var Gn;if(!(!m.state.isVisible||c)){if(c=!0,I.offsetHeight,I.style.transition=m.props.moveTransition,R()&&m.props.animation){var V=N(),G=V.box,J=V.content;Wc([G,J],De),Sy([G,J],"visible")}$(),F(),Ty(Yc,m),(Gn=m.popperInstance)==null||Gn.forceUpdate(),z("onMount",[m]),m.props.animation&&R()&&Y(De,function(){m.state.isShown=!0,z("onShown",[m])})}},ue()}}function et(){var ie=!m.state.isVisible,fe=m.state.isDestroyed,Ie=!m.state.isEnabled,Le=Vc(m.props.duration,1,fn.duration);if(!(ie||fe||Ie)&&(z("onHide",[m],!1),m.props.onHide(m)!==!1)){if(m.state.isVisible=!1,m.state.isShown=!1,c=!1,o=!1,R()&&(I.style.visibility="hidden"),C(),U(),q(!0),R()){var De=N(),ft=De.box,At=De.content;m.props.animation&&(Wc([ft,At],Le),Sy([ft,At],"hidden"))}$(),F(),m.props.animation?R()&&Q(Le,m.unmount):m.unmount()}}function tn(ie){L().addEventListener("mousemove",y),Ty(Qo,y),y(ie)}function Yo(){m.state.isVisible&&m.hide(),m.state.isMounted&&(re(),he().forEach(function(ie){ie._tippy.unmount()}),I.parentNode&&I.parentNode.removeChild(I),Yc=Yc.filter(function(ie){return ie!==m}),m.state.isMounted=!1,z("onHidden",[m]))}function sd(){m.state.isDestroyed||(m.clearDelayTimeouts(),m.unmount(),me(),delete t._tippy,m.state.isDestroyed=!0,z("onDestroy",[m]))}}function Fa(t,e){e===void 0&&(e={});var n=fn.plugins.concat(e.plugins||[]);Q5();var r=Object.assign({},e,{plugins:n}),i=V5(t),s=i.reduce(function(o,l){var u=l&&i$(l,r);return u&&o.push(u),o},[]);return zo(t)?s[0]:s}Fa.defaultProps=fn,Fa.setDefaultProps=e$,Fa.currentInput=Rn,Object.assign({},iy,{effect:function(e){var n=e.state,r={popper:{position:n.options.strategy,left:"0",top:"0",margin:"0"},arrow:{position:"absolute"},reference:{}};Object.assign(n.elements.popper.style,r.popper),n.styles=r,n.elements.arrow&&Object.assign(n.elements.arrow.style,r.arrow)}}),Fa.setDefaultProps({render:Ny});function Ly(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,s;for(s=0;s<r.length;s++)i=r[s],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var By=typeof window!="undefined"&&typeof document!="undefined";function Kc(t,e){t&&(typeof t=="function"&&t(e),{}.hasOwnProperty.call(t,"current")&&(t.current=e))}function $y(){return By&&document.createElement("div")}function a$(t){var e={"data-placement":t.placement};return t.referenceHidden&&(e["data-reference-hidden"]=""),t.escaped&&(e["data-escaped"]=""),e}function Uy(t,e){if(t===e)return!0;if(typeof t=="object"&&t!=null&&typeof e=="object"&&e!=null){if(Object.keys(t).length!==Object.keys(e).length)return!1;for(var n in t)if(e.hasOwnProperty(n)){if(!Uy(t[n],e[n]))return!1}else return!1;return!0}else return!1}function s$(t){var e=[];return t.forEach(function(n){e.find(function(r){return Uy(n,r)})||e.push(n)}),e}function o$(t,e){var n,r;return Object.assign({},e,{popperOptions:Object.assign({},t.popperOptions,e.popperOptions,{modifiers:s$([].concat(((n=t.popperOptions)==null?void 0:n.modifiers)||[],((r=e.popperOptions)==null?void 0:r.modifiers)||[]))})})}var Jc=By?K.useLayoutEffect:K.useEffect;function l$(t){var e=K.useRef();return e.current||(e.current=typeof t=="function"?t():t),e.current}function jy(t,e,n){n.split(/\s+/).forEach(function(r){r&&t.classList[e](r)})}var u$={name:"className",defaultValue:"",fn:function(e){var n=e.popper.firstElementChild,r=function(){var l;return!!((l=e.props.render)!=null&&l.$$tippy)};function i(){e.props.className&&!r()||jy(n,"add",e.props.className)}function s(){r()&&jy(n,"remove",e.props.className)}return{onCreate:i,onBeforeUpdate:s,onAfterUpdate:i}}};function c$(t){function e(n){var r=n.children,i=n.content,s=n.visible,o=n.singleton,l=n.render,u=n.reference,c=n.disabled,d=c===void 0?!1:c,f=n.ignoreAttributes,p=f===void 0?!0:f;n.__source,n.__self;var h=Ly(n,["children","content","visible","singleton","render","reference","disabled","ignoreAttributes","__source","__self"]),y=s!==void 0,g=o!==void 0,v=K.useState(!1),b=v[0],w=v[1],E=K.useState({}),m=E[0],A=E[1],I=K.useState(),O=I[0],T=I[1],k=l$(function(){return{container:$y(),renders:1}}),P=Object.assign({ignoreAttributes:p},h,{content:k.container});y&&(P.trigger="manual",P.hideOnClick=!1),g&&(d=!0);var S=P,R=P.plugins||[];l&&(S=Object.assign({},P,{plugins:g&&o.data!=null?[].concat(R,[{fn:function(){return{onTrigger:function(H,q){var z=o.data.children.find(function($){var F=$.instance;return F.reference===q.currentTarget});H.state.$$activeSingletonInstance=z.instance,T(z.content)}}}}]):R,render:function(){return{popper:k.container}}}));var D=[u].concat(r?[r.type]:[]);return Jc(function(){var L=u;u&&u.hasOwnProperty("current")&&(L=u.current);var N=t(L||k.ref||$y(),Object.assign({},S,{plugins:[u$].concat(P.plugins||[])}));return k.instance=N,d&&N.disable(),s&&N.show(),g&&o.hook({instance:N,content:i,props:S,setSingletonContent:T}),w(!0),function(){N.destroy(),o==null||o.cleanup(N)}},D),Jc(function(){var L;if(k.renders===1){k.renders++;return}var N=k.instance;N.setProps(o$(N.props,S)),(L=N.popperInstance)==null||L.forceUpdate(),d?N.disable():N.enable(),y&&(s?N.show():N.hide()),g&&o.hook({instance:N,content:i,props:S,setSingletonContent:T})}),Jc(function(){var L;if(!!l){var N=k.instance;N.setProps({popperOptions:Object.assign({},N.props.popperOptions,{modifiers:[].concat((((L=N.props.popperOptions)==null?void 0:L.modifiers)||[]).filter(function(H){var q=H.name;return q!=="$$tippyReact"}),[{name:"$$tippyReact",enabled:!0,phase:"beforeWrite",requires:["computeStyles"],fn:function(q){var z,$=q.state,F=(z=$.modifiersData)==null?void 0:z.hide;(m.placement!==$.placement||m.referenceHidden!==(F==null?void 0:F.isReferenceHidden)||m.escaped!==(F==null?void 0:F.hasPopperEscaped))&&A({placement:$.placement,referenceHidden:F==null?void 0:F.isReferenceHidden,escaped:F==null?void 0:F.hasPopperEscaped}),$.attributes.popper={}}}])})})}},[m.placement,m.referenceHidden,m.escaped].concat(D)),se(xe,{children:[r?K.cloneElement(r,{ref:function(N){k.ref=N,Kc(r.ref,N)}}):null,b&&We.createPortal(l?l(a$(m),O,k.instance):i,k.container)]})}return e}var d$=function(t,e){return K.forwardRef(function(r,i){var s=r.children,o=Ly(r,["children"]);return j(t,ae(Z({},Object.assign({},e,o)),{children:s?K.cloneElement(s,{ref:function(u){Kc(i,u),Kc(s.ref,u)}}):null}))})},f$=d$(c$(Fa));const h$=f$,p$=({onClick:t})=>{const{clear:e}=_e(Me);return j(h$,{content:e,children:j("button",{onClick:t,"data-testid":"clear",className:"eow-border eow-rounded eow-ml-2 eow-px-3 eow-flex eow-items-center",children:j("svg",{xmlns:"http://www.w3.org/2000/svg",className:"eow-h-4 eow-w-4 ",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",strokeWidth:2,children:j("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"M6 18L18 6M6 6l12 12"})})})})},m$=({setFilters:t})=>{const[e,n]=K.useState(!1),r=K.useRef(null),{clearFromToFilterSportal365ImagesMessage:i,dateFromTo:s,dateFromToPlaceholder:o}=_e(Me);return se("div",{"data-testid":"from/to filter",children:[j("label",{htmlFor:"date from/to",className:Kt,children:s}),se("div",{className:"eow-flex eow-flex-row",children:[j(PB,{ref:r,className:"eow-flex-1",placeholder:o,options:{mode:"range",enableTime:!1,dateFormat:"YYYY-MM-DD",altFormat:"YYYY-MM-DD",altInput:!0,position:"below",altInputClass:ca,parseDate:(c,d)=>Zi(c,d).toDate(),formatDate:(c,d)=>Zi(c).format(d),defaultDate:null},onChange:c=>{if(c&&c.length>1){n(!0);const d="YYYY-MM-DD",f=Zi(c[0]).format(d),p=Zi(c[1]).format(d);t({from:f,to:p})}else c.length===0&&!e&&(t(null),Pe.info(i))}}),e?j(p$,{onClick:()=>{r.current.flatpickr.clear(),n(!1),t(null)}}):j(xe,{})]})]})};class g${constructor(){a(this,"id");a(this,"value");a(this,"label")}}class Hy extends g${constructor(){super(...arguments);a(this,"logo");a(this,"countryName");a(this,"countryFlag")}}const v$=(t,e,n,r)=>({apiKey:t,clientId:e,lang:n||"en",environment:r||"prod",idSchema:"native",errorHandlingMode:"standard",authProvider:{getIdToken:()=>"",logout:()=>{}}}),y$=(t,e)=>{if(!t&&!e)return null;if(!t&&e)return 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;const n=e&&e==="betway"?{}.VITE_SPORTAL365_BETWAY_TOKEN:{}.VITE_SPORTAL365_SHARED_TOKEN;return{project:t,authorization:`Bearer ${n}`}},Vy=t=>{document.getElementById(t).scrollIntoView({behavior:"smooth"})},Xc={container:t=>Z({},t),control:t=>ae(Z({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",textTransform:"capitalize"}),input:t=>ae(Z({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>ae(Z({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"},textTransform:"capitalize"})},w$=t=>{let e=new Hy;return e.label=t.name,e.value=t.name,e.id=t.id,t.birthDate?e.logo=t.assets&&t.assets.headshot&&t.assets.headshot:e.logo=t.assets&&t.assets.logo&&t.assets.logo,e.countryName=t.country.name,e.countryFlag=t.country.assets&&t.country.assets.flag?t.country.assets.flag:bn.country,e},b$=({setQuery:t,setFilters:e})=>{const[n,r]=K.useState(!1),[i,s]=K.useState(null),{searchImages:o,hideFilters:l,showFilters:u}=_e(Me),c=()=>r(!n),d=h=>{s(h),t((h==null?void 0:h.value)||"")},p=zu((h,y)=>{h&&y([{id:h,value:h,label:h}])},300);return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"search image",className:Kt,children:o}),j(Cc,{components:{DropdownIndicator:null},loadOptions:p,isClearable:!0,styles:Xc,getOptionValue:h=>h.id,onChange:d,value:i,placeholder:"",className:"eow-mb-1"}),j("a",{className:"eow-flex eow-justify-end eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-cursor-pointer eow-mb-4",onClick:c,children:n?l:u}),n?j(m$,{setFilters:e}):j(xe,{})]})},Zc="sportal365-images-search",_$=({imageNode:t,onChangeImages:e,setShowImagesContainer:n})=>{const[r,i]=K.useState(null),[s,o]=K.useState(""),[l,u]=K.useState(1),[c,d]=K.useState(null),[f,p]=K.useState(!1),h=K.useRef(!1),{https:y}=_e(on),{searchSportal365ImagesErrorMessage:g,noImagesFound:v}=_e(Me);K.useEffect(()=>(h.current?b():h.current=!0,()=>i(null)),[s,c,l]);const b=()=>_(this,null,function*(){if(s){p(!0);const A=yield y.fetchImagesFromSportal365(s,c,l),I=yield A.json();A.ok?(i(I),u(I.meta.pagination.current_page)):(console.error(I),Pe.error(g)),p(!1)}else i(null)}),w=()=>{u(A=>A-1),Vy(Zc)},E=()=>{u(A=>A+1),Vy(Zc)};return se("div",{id:Zc,className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded eow-bg-gray-100",children:[j("div",{className:"eow-flex eow-justify-end",children:j(Vu,{isDisabled:!1,onClick:()=>{n(A=>ae(Z({},A),{[t]:!A[t]}))}})}),j(b$,{setQuery:o,setFilters:d}),r?se(xe,{children:[j("div",{className:"eow-grid xl:eow-grid-cols-4 md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:r.data.map(A=>{var I,O;return se("div",{className:"eow-relative eow-cursor-pointer eow-group eow-mb-2",onClick:()=>{var T,k;return e((k=(T=A.urls)==null?void 0:T.uploaded)==null?void 0:k.embed)},children:[j("img",{src:(O=(I=A.urls)==null?void 0:I.uploaded)==null?void 0:O.thumbnail,alt:"Sportal365 image",className:"eow-object-cover eow-w-full eow-h-full"}),j("div",{className:"eow-absolute eow-inset-0 eow-bg-black eow-bg-opacity-0 group-hover:eow-bg-opacity-50 eow-flex eow-justify-center eow-items-center eow-transition eow-duration-300",children:j("span",{className:"eow-text-white eow-text-4xl eow-opacity-0 group-hover:eow-opacity-100 eow-transition eow-duration-300",children:"+"})})]},A.id)})}),j($F,{pageCount:r==null?void 0:r.meta.pagination.current_page,images:r,getPreviousPage:w,getNextPage:E})]}):j(xe,{}),r&&r.data.length===0?j("p",{className:"eow-text-center eow-font-bold eow-mb-4",children:v}):j(xe,{}),f?j(pm,{}):j(xe,{})]})},E$=({imageUrl:t,isOpen:e,closeModal:n})=>{K.useLayoutEffect(()=>(e&&document.body.addEventListener("keydown",r),()=>{document.body.removeEventListener("keydown",r)}),[n]);const r=i=>i.key==="Escape"?n():null;return e?j(gm,{wrapperId:"image-modal",children:se("div",{className:"eow-fixed eow-inset-0 eow-z-20 eow-flex eow-items-center eow-justify-center eow-bg-black eow-bg-opacity-50 eow-animate-fadeIn",children:[j("div",{className:"eow-absolute eow-top-0 eow-right-0 eow-m-4",children:j("button",{className:"eow-text-white eow-text-2xl eow-bg-transparent",onClick:n,children:"X"})}),j("div",{className:"eow-flex eow-items-center eow-justify-center eow-h-full",children:j("img",{src:t,alt:"Image modal",className:"eow-w-full eow-object-cover"})})]})}):null},ed={mainImage:!1,coverImage:!1,mobileImage:!1},qy=({id:t,type:e,label:n,imageUrl:r,imageNode:i,onChange:s})=>{const[o,l]=K.useState(ed),[u,c]=K.useState(ed),[d,f]=K.useState(!1),{https:p}=_e(on),h=()=>f(!1),y=(v,b)=>{c(ed),s(v,b)},g=(v,b)=>{navigator.clipboard.writeText(v).then(()=>{c(w=>ae(Z({},w),{[b]:!0}))}).catch(w=>{console.error("Failed to copy: ",w),c(E=>ae(Z({},E),{[b]:!1}))})};return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:n,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:n}),se("div",{className:"eow-w-full eow-border eow-rounded eow-overflow-hidden eow-p-2",children:[se("div",{className:"eow-grid lg:eow-grid-cols-8 eow-grid-cols-1 eow-gap-2 eow-mb-2",children:[j("div",{className:"lg:eow-col-span-2",children:r?se(xe,{children:[j("img",{src:r,alt:"Card Image",className:"eow-w-full eow-object-cover eow-cursor-pointer",onClick:()=>f(!0)}),j(E$,{imageUrl:r,isOpen:d,closeModal:h})]}):j("div",{className:"eow-bg-gray-200 lg:eow-min-w-16 eow-min-h-24 eow-flex eow-justify-center eow-items-center eow-p-5",children:j("img",{src:bn.image,alt:"Card image"})})}),se("div",{className:"eow-flex eow-flex-col eow-col-span-6",children:[se("div",{className:"eow-grid eow-grid-cols-2 eow-gap-2 eow-mb-2",children:[j(FF,{imageNode:i,onChangeImages:y,type:e,id:t}),j(NF,{isDisabled:!r,isUrlCopied:u[i],onClick:()=>g(r||"",i)})]}),p.sportal365Config?j(BF,{imageNode:i,setShowImagesContainer:l}):j(xe,{})]})]}),o[i]?j(_$,{onChangeImages:v=>y(v,i),setShowImagesContainer:l,imageNode:i}):j(xe,{})]})]})},Wy=({id:t,type:e,loadedImages:n,onChange:r})=>{const[i,s]=K.useState(!1),o=()=>s(!i),l=_e(Me),u=e==="game"?Array.from(ym.keys()):Array.from(GS.keys());return se(xe,{children:[j(qy,{id:t,type:e,label:l.main,imageUrl:n==null?void 0:n.main,imageNode:"mainImage",onChange:r}),j("button",{className:"eow-underline eow-text-blue-600 hover:eow-text-blue-800 visited:eow-text-purple-600 eow-bg-transparent eow-mb-4",onClick:o,children:i?l.hideMoreImages:l.showMoreImages}),i?j(xe,{children:u.map((c,d)=>j(qy,{id:t,type:e,label:l[c],imageUrl:n&&n[c]?n[c]:"",imageNode:ym.get(c),onChange:r},`${c}-${d}`))}):j(xe,{})]})},I$=({id:t,loadedImages:e,onChange:n})=>{const r=_e(Me);return j(MF,{images:r.optionImages,children:j(Wy,{id:t,type:"option",loadedImages:e,onChange:n})})},Gy=new ua,A$=5,O$=100,T$=({options:t,setRequestBody:e})=>{const{label:n,labelOptionPlaceholder:r,options:i,optionNumber:s,optionsDescription:o}=_e(Me),l=Gy.constructOptions(t),u=(y,g)=>{y.persist();const v=Array.from(l);v[g].label=y.target.value,h(v)},c=(y,g)=>{const v=Array.from(l);v[g].value=y,h(v)},d=(y,g,v)=>{const b=y||null,w=Array.from(l);switch(g){case"mainImage":w[v].images.main=b,h(w);break;case"mobileImage":w[v].images.mobile=b,h(w);break}},f=()=>{const y=Array.from(l).sort((w,E)=>parseInt(E.id)-parseInt(w.id))[0].id,g=`${parseInt(y)+1}`,v=Gy.constructEmptyOption(g),b=Array.from(l);b.push(v),h(b)},p=y=>{const g=l.filter((v,b)=>b!==y);h(g)},h=y=>{e(g=>ae(Z({},g),{options:y}))};return se("div",{className:"eow-mb-4",children:[se("div",{className:"eow-mb-2",children:[j("h3",{className:Kt,children:i}),j("p",{className:"eow-text-gray-400 eow-text-sm",children:o})]}),se("div",{className:"eow-grid eow-grid-cols-1 lg:eow-grid-cols-2 2xl:eow-grid-cols-3 eow-gap-4 eow-mb-1",children:[l.map((y,g)=>se("div",{className:"eow-overflow-visible eow-shadow-l eow-border eow-border-gray-200",children:[se("div",{className:"eow-bg-gray-100 eow-flex eow-justify-between eow-px-3 eow-py-2",children:[se("h2",{className:"eow-card-title",children:[s," ",g+1]}),j(Vu,{isDisabled:l.length===A$,onClick:()=>p(g)})]}),se("div",{className:"eow-p-3",children:[se("div",{className:"eow-grid sm:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[j(PF,{label:n,defaultValue:y.label,placeholder:r,onChange:v=>u(v,g)}),j(ma,{type:"options_value",defaultValue:y.value,onChange:v=>c(v,g)})]}),j(I$,{id:g,loadedImages:y.images,onChange:(v,b)=>d(v,b,g)})]})]},`points_number_${y.id}_${g}`)),j(Hu,{isDisabled:l.length===O$,onClick:f})]})]})},C$=({requestBody:t,setRequestBody:e,description:n,setDescription:r})=>{const i=_e(Me),s=o=>{o.persist(),e(l=>ae(Z({},l),{title:o.target.value}))};return se("div",{className:"md:eow-w-4/6 eow-w-full",children:[j(zS,{value:(t==null?void 0:t.id)||null}),j(ri,{title:i.title,placeholder:i.titlePlaceholder,onChange:s,defaultValue:t.title||""}),j(ju,{defaultValue:n,setValue:r,property:"description"}),j(SF,{points:t.points,setRequestBody:e}),j(T$,{options:t.options,setRequestBody:e})]})},cr=({title:t,children:e})=>{const[n,r]=K.useState(!1);return se("div",{className:"eow-border-b eow-border-gray-200 eow-mb-2",children:[se("button",{className:"eow-flex eow-justify-between eow-py-2 eow-px-4 eow-py-2 eow-px-4 eow-w-full eow-text-left eow-text-gray-800 eow-font-semibold eow-bg-gray-100 hover:eow-bg-gray-200 focus:eow-outline-none",onClick:()=>r(!n),children:[j("span",{children:t}),j("img",{src:n?bn.upArrow:bn.downArrow,alt:"Up arrow",className:"eow-w-6 eow-h-6"})]}),n&&j("div",{className:"eow-border eow-border-gray-200 eow-p-4",children:e})]})},S$=({defaultValue:t,onChange:e})=>{const{https:n}=_e(on),{type:r,typeDescription:i,noType:s}=_e(Me),{data:o}=su({queryKey:["eitherOrTypes"],queryFn:()=>n.getEitherOrTypes()});return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"type",className:Kt,children:r}),se("select",{id:"quizType",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:e,defaultValue:t||"",children:[j("option",{value:"",children:s}),o?o.map((l,u)=>j("option",{id:l.id,value:l.id,children:l.label},`${l.id}-${u}`)):j(xe,{})]}),j("p",{className:"eow-text-gray-400 eow-text-xs",children:i})]})},zy=({type:t,defaultValue:e,onChange:n})=>{const{status:r,active:i,inactive:s,statusDescription:o,winningCondition:l,winningConditionDescription:u,more:c,less:d}=_e(Me);return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"status",className:Kt,children:t==="status"?r:l}),se("select",{id:t==="status"?"gameStatus":"gameWinningCondition",className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2 eow-mb-1",onChange:n,defaultValue:e,children:[j("option",{value:t==="status"?"ACTIVE":"MORE",children:t==="status"?i:c}),j("option",{value:t==="status"?"INACTIVE":"LESS",children:t==="status"?s:d})]}),j("p",{className:"eow-text-gray-400 eow-text-xs",children:t==="status"?o:u})]})};var P$=["allowCreateWhileLoading","createOptionPosition","formatCreateLabel","isValidNewOption","getNewOptionData","onCreateOption","options","onChange"],Qy=function(){var e=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(e).toLowerCase(),s=String(r.getOptionValue(n)).toLowerCase(),o=String(r.getOptionLabel(n)).toLowerCase();return s===i||o===i},td={formatCreateLabel:function(e){return'Create "'.concat(e,'"')},isValidNewOption:function(e,n,r,i){return!(!e||n.some(function(s){return Qy(e,s,i)})||r.some(function(s){return Qy(e,s,i)}))},getNewOptionData:function(e,n){return{label:n,value:e,__isNew__:!0}}};function M$(t){var e=t.allowCreateWhileLoading,n=e===void 0?!1:e,r=t.createOptionPosition,i=r===void 0?"last":r,s=t.formatCreateLabel,o=s===void 0?td.formatCreateLabel:s,l=t.isValidNewOption,u=l===void 0?td.isValidNewOption:l,c=t.getNewOptionData,d=c===void 0?td.getNewOptionData:c,f=t.onCreateOption,p=t.options,h=p===void 0?[]:p,y=t.onChange,g=ln(t,P$),v=g.getOptionValue,b=v===void 0?Nv:v,w=g.getOptionLabel,E=w===void 0?Fv:w,m=g.inputValue,A=g.isLoading,I=g.isMulti,O=g.value,T=g.name,k=K.useMemo(function(){return u(m,Ro(O),h,{getOptionValue:b,getOptionLabel:E})?d(m,o(m)):void 0},[o,d,E,b,m,u,h,O]),P=K.useMemo(function(){return(n||!A)&&k?i==="first"?[k].concat(di(h)):[].concat(di(h),[k]):h},[n,i,A,k,h]),S=K.useCallback(function(R,D){if(D.action!=="select-option")return y(R,D);var L=Array.isArray(R)?R:[R];if(L[L.length-1]===k){if(f)f(m);else{var N=d(m,m),H={action:"create-option",name:T,option:N};y(Ia(I,[].concat(di(Ro(O)),[N]),N),H)}return}y(R,D)},[d,m,I,T,k,f,y,O]);return we(we({},g),{},{options:P,onChange:S})}var R$=K.forwardRef(function(t,e){var n=Tc(t),r=M$(n);return j(Bo,Z({ref:e},r))}),k$=R$;const x$=t=>({label:t,value:t}),D$={control:t=>ae(Z({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"6px 1px","&:hover":{borderColor:"gray"},border:"1px solid lightgray",boxShadow:"none"}),clearIndicator:t=>ae(Z({},t),{"&:hover":{backGroundColor:"gray"},cursor:"pointer"}),input:t=>ae(Z({},t),{"input:focus":{boxShadow:"none"}})},Yy=({defaultValue:t,showLabel:e,setObject:n,handleResetData:r})=>{const[i,s]=K.useState(""),o=t.map(y=>x$(y)),{repeatedValueMessage:l,flags:u,flagsPlaceholder:c}=_e(Me),d=y=>{const g=y.map(v=>v.value);n(v=>ae(Z({},v),{flags:g})),r&&r()},f=y=>{s(y)},p=y=>{y.persist();const{key:g}=y;if(!!i)switch(g){case"Enter":case"Tab":if(t.length===0){const v=Array.from(t);v.push(i),n(b=>ae(Z({},b),{flags:v}))}if(t.length>0&&h()){const v=Array.from(t);v.push(i),n(b=>ae(Z({},b),{flags:v}))}s(""),y.preventDefault()}},h=()=>{let y=!1;const g=o.map(v=>v.label);return g.length&&g.includes(i)?(Pe.warn(l),y):(y=!0,y)};return se("div",{className:"eow-mb-4",children:[e?j("label",{htmlFor:u,className:"eow-text-sm eow-mb-1",children:u}):j(xe,{}),j(k$,{styles:D$,components:{DropdownIndicator:null},getOptionValue:y=>y.value,inputValue:i,isClearable:!0,isMulti:!0,menuIsOpen:!1,onChange:d,onInputChange:f,onKeyDown:p,placeholder:c,value:o})]})},F$=t=>Object.keys(t).length++,Ky=({property:t,field:e,onChange:n})=>{const r=F$(e),[i,s]=K.useState(JSON.parse(JSON.stringify(e))),{dynamicFieldsDescription:o,keyDynamicFields:l,valueDynamicFields:u}=_e(Me),c=()=>{const p="new_key"+r,h=JSON.parse(JSON.stringify(e));h[p]="";const y=Z(Z({},e),h);s(y),n(y)},d=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p];y[h]=y[g],delete y[g],n(y)},f=(p,h)=>{const y=JSON.parse(JSON.stringify(e)),g=Object.keys(y)[p]?Object.keys(y)[p]:"new_key";y[g]=h,n(y)};return se("div",{className:"eow-mb-4",children:[j("div",{className:"eow-mb-2",children:j("p",{className:"eow-text-gray-400 eow-text-sm",children:o})}),se("div",{className:"eow-border eow-border-gray-200 eow-rounded eow-p-2 eow-mb-4",children:[Object.keys(i).map((p,h)=>se("div",{className:"eow-flex eow-items-center eow-mb-4",children:[se("div",{className:"eow-mr-4",children:[j("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:l}),j("input",{"data-testid":"dynamic-key-field",onChange:y=>d(h,y.target.value),value:Object.keys(e)[h]&&Object.keys(e)[h].includes("new_key")?"":Object.keys(e)[h],type:"text",id:`${t}-key-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-64 focus:eow-outline-none eow-px-3 eow-py-2"})]}),se("div",{className:"eow-w-full",children:[j("label",{htmlFor:l,className:"eow-text-xs eow-font-medium eow-block eow-mb-1 eow-uppercase",children:u}),j("input",{"data-testid":"dynamic-value-field",onChange:y=>f(h,y.target.value),value:e[p],type:"text",id:`${t}-value-${h}`,className:"eow-rounded eow-border eow-border-gray-200 eow-w-full focus:eow-outline-none eow-px-3 eow-py-2"})]})]},`${t}-${p}-${h}`)),j(Hu,{isDisabled:!1,onClick:()=>c()})]})]})},N$=({tabValue:t,setTabValue:e})=>{const{content:n,tags:r,campaign:i}=_e(Me);return j(xe,{children:j("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-1 eow-w-full eow-mb-6 eow-border-b",children:[r,n,i].map(o=>j("div",{className:`md:eow-mr-2 last:eow-mr-0 eow-flex-auto eow-text-center eow-pb-2 ${t===o?"eow-border-b-2":"eow-border-b-2 eow-border-white"}`,children:j("a",{className:"eow-leading-normal eow-p-2 eow-cursor-pointer eow-mb-2 "+(t===o?"eow-font-bold eow-text-brandColor":"eow-text-gray-400"),onClick:()=>e(o),children:o})},`context-tab-${o}`))})})};class nd{constructor(){a(this,"label","");a(this,"options",[])}}const L$=10,Jy=t=>{const e=[];if(t.competitions.length>0){const n=new nd;n.label="Competitions",n.options=t.competitions.map(r=>rd(r,"competition")),e.push(n)}if(t.teams.length>0){const n=new nd;n.label="Teams",n.options=t.teams.map(r=>rd(r,"team")),e.push(n)}if(t.players.length>0){const n=new nd;n.label="Players",n.options=t.players.map(r=>rd(r,"player")),e.push(n)}return e},rd=(t,e)=>{var r,i,s,o,l;let n=new Hy;return n.label=t.name,n.value=t.name,n.id=t.id,e==="player"?n.logo=((r=t.assets)==null?void 0:r.headshot)||bn.avatar:e==="team"?n.logo=((i=t.assets)==null?void 0:i.logo)||bn.team:n.logo=((s=t.assets)==null?void 0:s.logo)||bn.competition,n.countryName=t.country.name,n.countryFlag=((l=(o=t.country)==null?void 0:o.assets)==null?void 0:l.flag)||bn.country,n},B$=({options:t,setOptions:e,setFilters:n,handleResetData:r})=>{const{sdk:i}=_e(on),{contextEntityTag:s,typeContextTagNamePlaceholder:o}=_e(Me),l=d=>{const f=d.map(p=>p.id);e(d),r(),n(p=>ae(Z({},p),{entityIds:f}))},c=zu((d,f)=>{if(d){const p={query:d};i.football.search(p).then(h=>{const y=Jy(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return se("div",{className:"eow-mb-4",children:[j("label",{htmlFor:"context entity tag",className:"eow-text-sm eow-mb-1",children:s}),j(Cc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:Xc,onChange:l,loadingMessage:()=>"Loading...",isOptionDisabled:()=>t.length===L$,value:t,loadOptions:c,isClearable:!0,isMulti:!0,placeholder:o,formatOptionLabel:d=>se("div",{className:"eow-flex eow-items-center",children:[j("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-2",children:d.label}),j("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-1",children:d.countryName})]})})]})},$$=(t,e,n,r)=>{const i=t.filter(c=>c.type.toLocaleLowerCase()==="competition").map(c=>c.id),s=t.filter(c=>c.type.toLocaleLowerCase()==="team").map(c=>c.id),o=t.filter(c=>c.type.toLocaleLowerCase()==="player").map(c=>c.id),l=[],u=[];if(i.length>0){const c=e.football.getCompetitions({competitionIds:i}).then(d=>{u.push(d)}).catch(d=>{console.error(d),Pe.error(n)});l.push(c)}if(s.length>0){const c=e.football.getTeams({teamIds:s}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),Pe.error(n)});l.push(c)}if(o.length>0){const c=e.football.getPlayers({playerIds:o}).then(d=>{u.push(d.data)}).catch(d=>{console.error(d),Pe.error(n)});l.push(c)}Promise.all(l).then(()=>{const d=Array.prototype.concat.apply([],u).map(f=>w$(f));r(d)})},U$=({tags:t,onChangeTags:e})=>{const[n,r]=K.useState([]),{sdk:i}=_e(on),{getFootballEntitiesErrorMessage:s,typeContextTagNamePlaceholder:o}=_e(Me),l=d=>{r(d),e(d)},c=zu((d,f)=>{if(!d&&t.length>0&&$$(t,i,s,r),d){const p={query:d};i.football.search(p).then(h=>{const y=Jy(h);f(y)}).catch(h=>{console.error(h),f([])})}},300);return j("div",{className:"eow-mb-4",children:j(Cc,{components:{DropdownIndicator:null},getOptionValue:d=>d.label,styles:Xc,onChange:l,loadingMessage:()=>"Loading...",value:n,loadOptions:c,isClearable:!0,defaultOptions:!0,isMulti:!0,placeholder:o,formatOptionLabel:d=>se("div",{className:"eow-flex eow-items-center",children:[j("img",{src:d.logo,alt:"Logo",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-2",children:d.label}),j("img",{src:d.countryFlag,alt:"Country flag",className:"eow-h-5 eow-w-5 eow-mr-1"}),j("span",{className:"eow-mr-1",children:d.countryName})]})})})},j$=new ua,H$=t=>t.startsWith("fb:c:")?"competition":t.startsWith("fb:t:")?"team":"player",V$=({defaultValue:t,setRequestBody:e})=>{const n=j$.createContext(t),{content:r,tags:i,campaign:s,id:o,idContentPlaceholder:l,labelContentPlaceholder:u,typeContentPlaceholder:c,idCampaignPlaceholder:d,labelCampaignPlaceholder:f,label:p,type:h}=_e(Me),[y,g]=K.useState(i),v=O=>{O.persist();const T=Z({},n);T.content.id=O.target.value,I(T)},b=O=>{O.persist();const T=Z({},n);T.content.label=O.target.value,I(T)},w=O=>{O.persist();const T=Z({},n);T.content.type=O.target.value,I(T)},E=O=>{O.persist();const T=Z({},n);T.campaign.id=O.target.value,I(T)},m=O=>{O.persist();const T=Z({},n);T.campaign.label=O.target.value,I(T)},A=O=>{const T=Z({},n);O.length?T.tags=O.map(k=>({id:k.id,type:H$(k.id),source:"football"})):T.tags=[],I(T)},I=O=>{e(T=>ae(Z({},T),{context:O}))};return se("div",{className:"eow-mb-4 eow-p-2",children:[j(N$,{tabValue:y,setTabValue:g}),y===i?j(U$,{tags:n.tags,onChangeTags:A}):j(xe,{}),y===r?se(xe,{children:[j(ri,{title:o,placeholder:l,defaultValue:n.content.id,onChange:v}),j(ri,{title:p,placeholder:u,defaultValue:n.content.label,onChange:b}),j(ri,{title:h,placeholder:c,defaultValue:n.content.type,onChange:w})]}):j(xe,{}),y===s?se(xe,{children:[j(ri,{title:o,placeholder:d,defaultValue:n.campaign.id,onChange:E}),j(ri,{title:p,placeholder:f,defaultValue:n.campaign.label,onChange:m})]}):j(xe,{})]})},q$=new ua,W$=({requestBody:t,rules:e,adContent:n,setRules:r,setAdContent:i,setRequestBody:s})=>{const{configuration:o,images:l,flags:u,labels:c,customFields:d,rules:f,adContent:p,context:h}=_e(Me),y=I=>{I.persist(),s(O=>ae(Z({},O),{type:I.target.value?I.target.value:null}))},g=I=>{I.persist(),s(O=>ae(Z({},O),{status:I.target.value}))},v=I=>{I.persist(),s(O=>ae(Z({},O),{winning_condition:I.target.value}))},b=I=>{s(O=>ae(Z({},O),{time:I}))},w=I=>{s(O=>ae(Z({},O),{lives:I}))},E=(I,O)=>{const T=I||null,k=q$.createImagesModel();switch(O){case"mainImage":s(P=>{const S=P.images?JSON.parse(JSON.stringify(P.images)):k;return S.main=T,ae(Z({},P),{images:S})});break;case"coverImage":s(P=>{const S=P.images?JSON.parse(JSON.stringify(P.images)):k;return S.cover=T,ae(Z({},P),{images:S})});break;case"mobileImage":s(P=>{const S=P.images?JSON.parse(JSON.stringify(P.images)):k;return S.mobile=T,ae(Z({},P),{images:S})});break}},m=I=>{s(O=>ae(Z({},O),{labels:I}))},A=I=>{s(O=>ae(Z({},O),{custom_fields:I}))};return se("div",{className:"md:eow-w-2/6 eow-w-full eow-p-4",children:[se(cr,{title:o,children:[se("div",{className:"eow-grid md:eow-grid-cols-3 eow-grid-cols-1 eow-gap-2",children:[j(S$,{defaultValue:t.type,onChange:y}),j(zy,{type:"status",defaultValue:t.status,onChange:g}),j(zy,{type:"winning_condition",defaultValue:t.winning_condition,onChange:v})]}),se("div",{className:"eow-grid md:eow-grid-cols-2 eow-grid-cols-1 eow-gap-2",children:[j(ma,{type:"time",defaultValue:t.time,showDescription:!0,onChange:b}),j(ma,{type:"lives",defaultValue:t.lives,showDescription:!0,onChange:w})]})]}),j(cr,{title:l,children:j(Wy,{id:0,type:"game",loadedImages:t.images,onChange:E})}),j(cr,{title:u,children:j(Yy,{defaultValue:t.flags,setObject:s})}),j(cr,{title:c,children:j(Ky,{property:"labels",field:t.labels?t.labels:new Object,onChange:m})}),j(cr,{title:d,children:j(Ky,{property:"custom_fields",field:t.custom_fields?t.custom_fields:new Object,onChange:A})}),j(cr,{title:f,children:j(ju,{defaultValue:e,setValue:r,property:"rules"})}),j(cr,{title:p,children:j(ju,{defaultValue:n,setValue:i,property:"ad_content"})}),j(cr,{title:h,children:j(V$,{defaultValue:t.context,setRequestBody:s})})]})},Xy=new ua,G$="manage-either-or",z$=({eitherOrById:t,setFilters:e,toggleScreen:n,clearEitherOrById:r})=>{const[i,s]=K.useState(Xy.createNewRequestBody(t)),[o,l]=K.useState(t==null?void 0:t.description),[u,c]=K.useState(t==null?void 0:t.rules),[d,f]=K.useState(t==null?void 0:t.ad_content),[p,h]=K.useState(!1),[y,g]=K.useState(!1),v=_e(Me),{https:b}=_e(on),w=!!t,E=()=>{g(!y)};return se("div",{id:G$,children:[j($S,{managementScreen:w?"edit":"create",toggleScreen:n,clearQuizById:r}),se("div",{className:"eow-p-2 eow-border eow-border-gray-200 eow-rounded",children:[se("div",{className:"eow-flex eow-flex-col md:eow-flex-row",children:[j(C$,{requestBody:i,setRequestBody:s,description:o,setDescription:l}),j(W$,{requestBody:i,setRequestBody:s,rules:u,adContent:d,setRules:c,setAdContent:f})]}),j(HS,{isLoading:p,manageEitherOr:()=>_(this,null,function*(){const A=new US;if(h(!0),w?A.validateUpdate(i,v):A.validateCreate(i,v),!A.isValid){Pe.error(A.message),h(!1);return}i.description=o,i.rules=u,i.ad_content=d;const I=Xy.finalizeNewRequestBody(Z({},i));let O=null;w?O=yield b.updateEitherOr(I.id,Z({},I)):O=yield b.createEitherOr(Z({},I)),O.ok?(h(!1),Pe.success(w?v.updateEitherOrMessage:v.createEitherOrMessage),e(T=>ae(Z({},T),{refetchEitherOrs:!T.refetchEitherOrs})),n()):(Pe.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage),console.error(w?v.updateEitherOrErrorMessage:v.createEitherOrErrorMessage,yield O.json()),h(!1))}),handleModal:E})]}),j(WS,{isOpen:y,requestBody:i,description:o,handleClose:E})]})},Q$=t=>{const e=document.createElement("div");return e.setAttribute("id",t),document.body.appendChild(e),e},Y$=({children:t,wrapperId:e})=>{const[n,r]=K.useState(null);return K.useLayoutEffect(()=>{let i=document.getElementById(e),s=!1;return i||(s=!0,i=Q$(e)),r(i),()=>{s&&i.parentNode&&i.parentNode.removeChild(i)}},[e]),n===null?null:dr.default.createPortal(t,n)},K$=({isOpen:t,eitherOr:e,setFilters:n,handleClose:r})=>{const[i,s]=K.useState(!1),{confirmationQuestionLabel:o,deleteLabel:l,cancelLabel:u,deleteEitherOrMessage:c,deleteEitherOrErrorMessage:d}=_e(Me),{https:f}=_e(on);K.useLayoutEffect(()=>(t&&document.body.addEventListener("keydown",p),()=>{document.body.removeEventListener("keydown",p)}),[r]);const p=y=>y.key==="Escape"&&!i?r():null,h=()=>_(this,null,function*(){s(!0);const y=yield f.deleteEitherOr(e.id);y.ok?(Pe.success(c),s(!1),n(g=>ae(Z({},g),{refetchEitherOrs:!g.refetchEitherOrs})),r()):(console.error(d,yield y.json()),Pe.error(d),s(!1))});return t?j(Y$,{wrapperId:"confirmation-modal",children:se(xe,{children:[j("div",{className:"eow-justify-center eow-items-center eow-flex eow-overflow-x-hidden eow-overflow-y-hidden eow-absolute eow-inset-0 eow-z-50 eow-top-0 eow-right-0 eow-bottom-0 eow-left-0 eow-outline-none focus:eow-outline-none",children:j("div",{className:"eow-relative eow-w-full eow-my-6 eow-mx-auto eow-max-w-lg",children:se("div",{className:"eow-border-0 eow-rounded eow-shadow-lg eow-relative eow-flex eow-flex-col eow-w-full eow-bg-white eow-outline-none focus:eow-outline-none",children:[se("div",{className:"eow-flex eow-justify-items-center eow-p-4 eow-border-b eow-border-solid eow-border-gray-200",children:[se("h3",{className:"eow-text-2xl eow-font-semibold eow-mr-2",children:[l," ",e.title]}),j("button",{className:"eow-flex eow-justify-items-center eow-ml-auto eow-bg-transparent eow-border-0 eow-leading-none eow-font-semibold eow-outline-none focus:eow-outline-none",onClick:r,children:j("span",{className:"eow-bg-transparent eow-h-6 eow-w-6 eow-text-2xl eow-block eow-outline-none focus:eow-outline-none eow-text-red-500 hover:eow-text-red-600",children:"x"})})]}),j("div",{className:"eow-relative eow-whitespace-nowrap eow-p-4 eow-text-gray-500 eow-text-lg eow-mb-4",children:se("p",{className:"eow-whitespace-normal eow-mb-2",children:[o," ",j("span",{className:"eow-text-xl eow-italic",children:e.title})," ?"]})}),se("div",{className:"eow-flex eow-items-center eow-justify-end eow-p-3 eow-border-t eow-border-solid eow-border-gray-200 eow-rounded-b",children:[se("button",{className:`${i?"eow-bg-gray-600":"eow-bg-brandColor hover:eow-bg-blue-700"} eow-text-white eow-font-bold eow-px-4 eow-py-2 eow-text-sm eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:h,disabled:i,children:[i?j(mm,{}):null,l]}),j("button",{className:`${i?"eow-bg-gray-600":"eow-bg-red-500 hover:eow-bg-red-700"} eow-text-white eow-font-bold eow-text-sm eow-px-4 eow-py-2 eow-rounded eow-outline-none focus:eow-outline-none eow-mr-2 eow-mb-1 eow-ease-linear eow-transition-all eow-duration-150`,onClick:r,disabled:i,children:u})]})]})})}),j("div",{className:"eow-opacity-80 eow-absolute eow-inset-0 eow-z-40 eow-bg-black eow-top-0 eow-right-0 eow-bottom-0 eow-left-0"})]})}):null};var Zy=(t=>(t.CREATED_AT_ASC="created_at_asc",t.CREATED_AT_DESC="created_at_desc",t.UPDATED_AT_ASC="updated_at_asc",t.UPDATED_AT_DESC="updated_at_desc",t))(Zy||{});class J${constructor(){a(this,"sort","created_at_desc");a(this,"status","");a(this,"flags",[]);a(this,"entityIds",[]);a(this,"groupByStatus",!0);a(this,"refetchEitherOrs",!1)}}var X$=K.forwardRef(function(t,e){var n=Tc(t);return j(Bo,Z({ref:e},n))}),Z$=X$;function eU(t,e){for(var n=-1,r=t==null?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}var tU=eU,ew=Qs,nU=tU,rU=Zs,iU=gg,aU=1/0,tw=ew?ew.prototype:void 0,nw=tw?tw.toString:void 0;function rw(t){if(typeof t=="string")return t;if(rU(t))return nU(t,rw)+"";if(iU(t))return nw?nw.call(t):"";var e=t+"";return e=="0"&&1/t==-aU?"-0":e}var sU=rw,oU=sU;function lU(t){return t==null?"":oU(t)}var iw=lU;function uU(t,e,n){var r=-1,i=t.length;e<0&&(e=-e>i?0:i+e),n=n>i?i:n,n<0&&(n+=i),i=e>n?0:n-e>>>0,e>>>=0;for(var s=Array(i);++r<i;)s[r]=t[r+e];return s}var cU=uU,dU=cU;function fU(t,e,n){var r=t.length;return n=n===void 0?r:n,!e&&n>=r?t:dU(t,e,n)}var hU=fU,pU="\\ud800-\\udfff",mU="\\u0300-\\u036f",gU="\\ufe20-\\ufe2f",vU="\\u20d0-\\u20ff",yU=mU+gU+vU,wU="\\ufe0e\\ufe0f",bU="\\u200d",_U=RegExp("["+bU+pU+yU+wU+"]");function EU(t){return _U.test(t)}var aw=EU;function IU(t){return t.split("")}var AU=IU,sw="\\ud800-\\udfff",OU="\\u0300-\\u036f",TU="\\ufe20-\\ufe2f",CU="\\u20d0-\\u20ff",SU=OU+TU+CU,PU="\\ufe0e\\ufe0f",MU="["+sw+"]",id="["+SU+"]",ad="\\ud83c[\\udffb-\\udfff]",RU="(?:"+id+"|"+ad+")",ow="[^"+sw+"]",lw="(?:\\ud83c[\\udde6-\\uddff]){2}",uw="[\\ud800-\\udbff][\\udc00-\\udfff]",kU="\\u200d",cw=RU+"?",dw="["+PU+"]?",xU="(?:"+kU+"(?:"+[ow,lw,uw].join("|")+")"+dw+cw+")*",DU=dw+cw+xU,FU="(?:"+[ow+id+"?",id,lw,uw,MU].join("|")+")",NU=RegExp(ad+"(?="+ad+")|"+FU+DU,"g");function LU(t){return t.match(NU)||[]}var BU=LU,$U=AU,UU=aw,jU=BU;function HU(t){return UU(t)?jU(t):$U(t)}var VU=HU,qU=hU,WU=aw,GU=VU,zU=iw;function QU(t){return function(e){e=zU(e);var n=WU(e)?GU(e):void 0,r=n?n[0]:e.charAt(0),i=n?qU(n,1).join(""):e.slice(1);return r[t]()+i}}var YU=QU,KU=YU,JU=KU("toUpperCase"),XU=JU,ZU=iw,e3=XU;function t3(t){return e3(ZU(t).toLowerCase())}var n3=t3;const fw=(t,e)=>{let n="";if(e==="sort")switch(t){case"created_at_asc":n="Sort by created at field in ascending order";break;case"created_at_desc":n="Sort by created at field in descending order";break;case"updated_at_asc":n="Sort by updated at field in ascending order";break;case"updated_at_desc":n="Sort by updated at field in descending order";break}return t&&(t=n3(t)),{id:t,value:t,label:e==="status"?t:n}},r3={control:t=>ae(Z({},t),{fontSize:"14px",borderRadius:"0.25em",padding:"2px 6px","&:hover":{borderColor:"gray"},border:"1px solid lightgray"}),input:t=>ae(Z({},t),{"input:focus":{boxShadow:"none"}}),option:(t,e)=>ae(Z({},t),{backgroundColor:e.isSelected?"#0066cc":"white","&:hover":{backgroundColor:e.isSelected?"#0066cc":"lightgray"}})},hw=({defaultValue:t,filterValues:e,filterType:n,showClearStatus:r,setFilters:i,handleResetData:s})=>{const{status:o,clearStatus:l}=_e(Me),u=e.map(f=>fw(f,n)),c=f=>{const p=f.value.toLocaleLowerCase();n==="sort"?i(h=>ae(Z({},h),{sort:p})):n==="status"&&i(h=>ae(Z({},h),{status:p.toLocaleUpperCase()})),s()},d=()=>{i(f=>ae(Z({},f),{status:""}))};return se("div",{className:"eow-w-full eow-mb-4",children:[j("label",{className:"eow-text-sm eow-mb-1",children:n==="status"?o:""}),j(Z$,{onChange:c,options:u,styles:r3,value:fw(t,n),placeholder:""}),r?j("a",{className:"eow-text-brandColor eow-cursor-pointer eow-text-sm eow-mb-8",onClick:()=>d(),children:l}):j(xe,{})]})},i3=({value:t,setFilters:e,handleResetData:n})=>{const{groupByStatus:r}=_e(Me);return se("div",{className:"eow-flex eow-items-center eow-cursor-pointer",onClick:()=>{e(s=>ae(Z({},s),{groupByStatus:!t})),n()},children:[j("input",{type:"checkbox",className:"eow-mr-2 focus:eow-outline-none eow-outline-none eow-cursor-pointer",checked:t,readOnly:!0}),j("span",{className:"eow-text-blueGray-600 eow-select-none",children:r})]})},a3=Object.values(Zy),s3=["active","inactive"],o3=({filters:t,options:e,setOptions:n,setFilters:r,handleResetData:i})=>{const{filterBy:s,sortBy:o}=_e(Me);return se("div",{className:"eow-grid md:eow-grid-cols-2 eow-gap-4 eow-grid-cols-1 eow-mb-6",children:[se("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[j("h3",{className:"eow-font-bold eow-mb-2",children:s}),j(hw,{filterType:"status",defaultValue:t.status,filterValues:s3,showClearStatus:!0,setFilters:r,handleResetData:i}),j(Yy,{defaultValue:t.flags,showLabel:!0,setObject:r,handleResetData:i}),j(B$,{options:e,setOptions:n,setFilters:r,handleResetData:i})]}),se("div",{className:"eow-border eow-border-gray-100 eow-rounded eow-p-4 eow-w-full",children:[j("h3",{className:"eow-font-bold eow-mb-2",children:o}),j(hw,{filterType:"sort",defaultValue:t.sort,filterValues:a3,setFilters:r,handleResetData:i}),j(i3,{value:t.groupByStatus,setFilters:r,handleResetData:i})]})]})},l3=({children:t})=>j("div",{children:j("section",{className:"eow-mx-auto",children:j("div",{className:"eow-mb-8 eow-overflow-hidden eow-rounded eow-bg-white",children:j("div",{className:"eow-w-full eow-overflow-x-auto",children:t})})})}),u3=({fansUnitedEnvironment:t,hideSignOutButton:e})=>{const[n,r]=K.useState(new J$),[i,s]=K.useState(1),[o,l]=K.useState(null),[u,c]=K.useState(new Map),[d,f]=K.useState(null),[p,h]=K.useState(!1),[y,g]=K.useState(!1),[v,b]=K.useState(!1),[w,E]=K.useState(null),[m,A]=K.useState([]),{sdk:I,https:O}=_e(on),{getEitherOrsErrorMessage:T,getEitherOrErrorMessage:k,noGamesFound:P}=_e(Me),S=K.useMemo(()=>JSON.stringify(n),[n]),{isError:R,error:D,data:L}=su({queryKey:["eitherOrsList",S],queryFn:()=>I.miniGames.getEitherOrs(n,!1,!0)});K.useEffect(()=>{if(L){const M=new Map(u).set(i,L.data);c(M),l(L.meta.pagination.nextPageStartsAfter)}},[L]),K.useEffect(()=>{Array.from(u.keys()).length>0&&(Array.from(u.keys()).includes(i)||(x=>_(this,null,function*(){try{const W=yield I.miniGames.getEitherOrs(ae(Z({},n),{startAfter:x}),!1,!0);if(W.data.length>0){const U=new Map(u).set(i,W.data);c(U),l(W.meta.pagination.nextPageStartsAfter)}}catch(W){Pe.error(T),console.error(W)}}))(o))},[i]);const N=()=>s(M=>M-1),H=()=>s(M=>M+1),q=()=>h(!p),z=()=>f(null),$=M=>_(this,null,function*(){g(!0);const x=yield O.getEitherOrById(M);if(x.ok){const B=yield x.json();f(B.data),h(!0)}else console.error(k,yield x.json()),Pe.error(k);g(!1)}),F=()=>b(!v),C=()=>{s(1),c(new Map)};return R?(Pe.error(k),console.error(D),j(yh,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e})):p?j(z$,{eitherOrById:d,setFilters:r,toggleScreen:q,clearEitherOrById:z}):y||!u.get(i)?j(pm,{}):se(xe,{children:[se(l3,{children:[j(yh,{fansUnitedEnvironment:t,toggleScreen:q,hideSignOutButton:e}),j(o3,{filters:n,options:m,setOptions:A,setFilters:r,handleResetData:C}),u.get(i).length>0?se(xe,{children:[se("table",{className:"eow-w-full eow-border eow-border-gray-200 eow-mb-2 eow-table",children:[j(wI,{}),j(LS,{data:u.get(i),fetchEitherOrById:$,handleModal:F,setSelectedEitherOr:E})]}),j(BS,{pageCount:i,pageGames:u,getPreviousPage:N,getNextPage:H})]}):j("h2",{className:"eow-text-center eow-font-bold eow-text-xl eow-my-60",children:P})]}),j(K$,{isOpen:v,eitherOr:w,setFilters:r,handleClose:F})]})},c3=({fansUnitedEnvironment:t,hideSignOutButton:e})=>K.useContext(vh)?j(vI,{children:j(u3,{fansUnitedEnvironment:t,hideSignOutButton:e})}):j(mI,{fansUnitedEnvironment:t}),d3=new DI({defaultOptions:{queries:{refetchOnWindowFocus:!1}}}),f3=t=>{const e=v$(t.fansUnitedApiKey,t.fansUnitedClientId,t.fansUnitedLanguage,t.fansUnitedEnvironment),n=y$(t.sportal365Project,t.sportal365Infrastructure);return j(gI,{fansUnitedEnvironment:t.fansUnitedEnvironment,children:j(Fw,{labels:t.labels,children:j(NS,{config:e,sportal365Config:n,children:se(YI,{client:d3,children:[j(el,{position:"top-right",autoClose:5e3,hideProgressBar:!1,limit:3,newestOnTop:!1,closeOnClick:!0,rtl:!1,pauseOnFocusLoss:!1,draggable:!0,pauseOnHover:!0}),j(c3,{fansUnitedEnvironment:t.fansUnitedEnvironment,hideSignOutButton:t.hideSignOutButton})]})})})})};Be.EitherOrManager=f3,Object.defineProperties(Be,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|