(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))l(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const d of c.addedNodes)d.tagName==="LINK"&&d.rel==="modulepreload"&&l(d)}).observe(document,{childList:!0,subtree:!0});function o(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function l(s){if(s.ep)return;s.ep=!0;const c=o(s);fetch(s.href,c)}})();var Ha=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Hu(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var gu={exports:{}},yl={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Hh;function wv(){if(Hh)return yl;Hh=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function o(l,s,c){var d=null;if(c!==void 0&&(d=""+c),s.key!==void 0&&(d=""+s.key),"key"in s){c={};for(var m in s)m!=="key"&&(c[m]=s[m])}else c=s;return s=c.ref,{$$typeof:n,type:l,key:d,ref:s!==void 0?s:null,props:c}}return yl.Fragment=e,yl.jsx=o,yl.jsxs=o,yl}var Gh;function bv(){return Gh||(Gh=1,gu.exports=wv()),gu.exports}var $=bv(),yu={exports:{}},Ue={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var qh;function Dv(){if(qh)return Ue;qh=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),d=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),g=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),T=Symbol.iterator;function _(I){return I===null||typeof I!="object"?null:(I=T&&I[T]||I["@@iterator"],typeof I=="function"?I:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},M=Object.assign,S={};function R(I,P,H){this.props=I,this.context=P,this.refs=S,this.updater=H||C}R.prototype.isReactComponent={},R.prototype.setState=function(I,P){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,P,"setState")},R.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function x(){}x.prototype=R.prototype;function b(I,P,H){this.props=I,this.context=P,this.refs=S,this.updater=H||C}var N=b.prototype=new x;N.constructor=b,M(N,R.prototype),N.isPureReactComponent=!0;var z=Array.isArray,k={H:null,A:null,T:null,S:null,V:null},X=Object.prototype.hasOwnProperty;function Y(I,P,H,ie,se,he){return H=he.ref,{$$typeof:n,type:I,key:P,ref:H!==void 0?H:null,props:he}}function oe(I,P){return Y(I.type,P,void 0,void 0,void 0,I.props)}function q(I){return typeof I=="object"&&I!==null&&I.$$typeof===n}function re(I){var P={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(H){return P[H]})}var ye=/\/+/g;function B(I,P){return typeof I=="object"&&I!==null&&I.key!=null?re(""+I.key):P.toString(36)}function le(){}function w(I){switch(I.status){case"fulfilled":return I.value;case"rejected":throw I.reason;default:switch(typeof I.status=="string"?I.then(le,le):(I.status="pending",I.then(function(P){I.status==="pending"&&(I.status="fulfilled",I.value=P)},function(P){I.status==="pending"&&(I.status="rejected",I.reason=P)})),I.status){case"fulfilled":return I.value;case"rejected":throw I.reason}}throw I}function te(I,P,H,ie,se){var he=typeof I;(he==="undefined"||he==="boolean")&&(I=null);var Ce=!1;if(I===null)Ce=!0;else switch(he){case"bigint":case"string":case"number":Ce=!0;break;case"object":switch(I.$$typeof){case n:case e:Ce=!0;break;case v:return Ce=I._init,te(Ce(I._payload),P,H,ie,se)}}if(Ce)return se=se(I),Ce=ie===""?"."+B(I,0):ie,z(se)?(H="",Ce!=null&&(H=Ce.replace(ye,"$&/")+"/"),te(se,P,H,"",function(Ie){return Ie})):se!=null&&(q(se)&&(se=oe(se,H+(se.key==null||I&&I.key===se.key?"":(""+se.key).replace(ye,"$&/")+"/")+Ce)),P.push(se)),1;Ce=0;var He=ie===""?".":ie+":";if(z(I))for(var Ae=0;Ae<I.length;Ae++)ie=I[Ae],he=He+B(ie,Ae),Ce+=te(ie,P,H,he,se);else if(Ae=_(I),typeof Ae=="function")for(I=Ae.call(I),Ae=0;!(ie=I.next()).done;)ie=ie.value,he=He+B(ie,Ae++),Ce+=te(ie,P,H,he,se);else if(he==="object"){if(typeof I.then=="function")return te(w(I),P,H,ie,se);throw P=String(I),Error("Objects are not valid as a React child (found: "+(P==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":P)+"). If you meant to render a collection of children, use an array instead.")}return Ce}function J(I,P,H){if(I==null)return I;var ie=[],se=0;return te(I,ie,"","",function(he){return P.call(H,he,se++)}),ie}function K(I){if(I._status===-1){var P=I._result;P=P(),P.then(function(H){(I._status===0||I._status===-1)&&(I._status=1,I._result=H)},function(H){(I._status===0||I._status===-1)&&(I._status=2,I._result=H)}),I._status===-1&&(I._status=0,I._result=P)}if(I._status===1)return I._result.default;throw I._result}var ve=typeof reportError=="function"?reportError:function(I){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var P=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof I=="object"&&I!==null&&typeof I.message=="string"?String(I.message):String(I),error:I});if(!window.dispatchEvent(P))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",I);return}console.error(I)};function fe(){}return Ue.Children={map:J,forEach:function(I,P,H){J(I,function(){P.apply(this,arguments)},H)},count:function(I){var P=0;return J(I,function(){P++}),P},toArray:function(I){return J(I,function(P){return P})||[]},only:function(I){if(!q(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Ue.Component=R,Ue.Fragment=o,Ue.Profiler=s,Ue.PureComponent=b,Ue.StrictMode=l,Ue.Suspense=g,Ue.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=k,Ue.__COMPILER_RUNTIME={__proto__:null,c:function(I){return k.H.useMemoCache(I)}},Ue.cache=function(I){return function(){return I.apply(null,arguments)}},Ue.cloneElement=function(I,P,H){if(I==null)throw Error("The argument must be a React element, but you passed "+I+".");var ie=M({},I.props),se=I.key,he=void 0;if(P!=null)for(Ce in P.ref!==void 0&&(he=void 0),P.key!==void 0&&(se=""+P.key),P)!X.call(P,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&P.ref===void 0||(ie[Ce]=P[Ce]);var Ce=arguments.length-2;if(Ce===1)ie.children=H;else if(1<Ce){for(var He=Array(Ce),Ae=0;Ae<Ce;Ae++)He[Ae]=arguments[Ae+2];ie.children=He}return Y(I.type,se,void 0,void 0,he,ie)},Ue.createContext=function(I){return I={$$typeof:d,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null},I.Provider=I,I.Consumer={$$typeof:c,_context:I},I},Ue.createElement=function(I,P,H){var ie,se={},he=null;if(P!=null)for(ie in P.key!==void 0&&(he=""+P.key),P)X.call(P,ie)&&ie!=="key"&&ie!=="__self"&&ie!=="__source"&&(se[ie]=P[ie]);var Ce=arguments.length-2;if(Ce===1)se.children=H;else if(1<Ce){for(var He=Array(Ce),Ae=0;Ae<Ce;Ae++)He[Ae]=arguments[Ae+2];se.children=He}if(I&&I.defaultProps)for(ie in Ce=I.defaultProps,Ce)se[ie]===void 0&&(se[ie]=Ce[ie]);return Y(I,he,void 0,void 0,null,se)},Ue.createRef=function(){return{current:null}},Ue.forwardRef=function(I){return{$$typeof:m,render:I}},Ue.isValidElement=q,Ue.lazy=function(I){return{$$typeof:v,_payload:{_status:-1,_result:I},_init:K}},Ue.memo=function(I,P){return{$$typeof:h,type:I,compare:P===void 0?null:P}},Ue.startTransition=function(I){var P=k.T,H={};k.T=H;try{var ie=I(),se=k.S;se!==null&&se(H,ie),typeof ie=="object"&&ie!==null&&typeof ie.then=="function"&&ie.then(fe,ve)}catch(he){ve(he)}finally{k.T=P}},Ue.unstable_useCacheRefresh=function(){return k.H.useCacheRefresh()},Ue.use=function(I){return k.H.use(I)},Ue.useActionState=function(I,P,H){return k.H.useActionState(I,P,H)},Ue.useCallback=function(I,P){return k.H.useCallback(I,P)},Ue.useContext=function(I){return k.H.useContext(I)},Ue.useDebugValue=function(){},Ue.useDeferredValue=function(I,P){return k.H.useDeferredValue(I,P)},Ue.useEffect=function(I,P,H){var ie=k.H;if(typeof H=="function")throw Error("useEffect CRUD overload is not enabled in this build of React.");return ie.useEffect(I,P)},Ue.useId=function(){return k.H.useId()},Ue.useImperativeHandle=function(I,P,H){return k.H.useImperativeHandle(I,P,H)},Ue.useInsertionEffect=function(I,P){return k.H.useInsertionEffect(I,P)},Ue.useLayoutEffect=function(I,P){return k.H.useLayoutEffect(I,P)},Ue.useMemo=function(I,P){return k.H.useMemo(I,P)},Ue.useOptimistic=function(I,P){return k.H.useOptimistic(I,P)},Ue.useReducer=function(I,P,H){return k.H.useReducer(I,P,H)},Ue.useRef=function(I){return k.H.useRef(I)},Ue.useState=function(I){return k.H.useState(I)},Ue.useSyncExternalStore=function(I,P,H){return k.H.useSyncExternalStore(I,P,H)},Ue.useTransition=function(){return k.H.useTransition()},Ue.version="19.1.1",Ue}var Fh;function Gu(){return Fh||(Fh=1,yu.exports=Dv()),yu.exports}var ae=Gu();const Nv=Hu(ae);var vu={exports:{}},vl={},Tu={exports:{}},_u={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Oh;function Iv(){return Oh||(Oh=1,(function(n){function e(J,K){var ve=J.length;J.push(K);e:for(;0<ve;){var fe=ve-1>>>1,I=J[fe];if(0<s(I,K))J[fe]=K,J[ve]=I,ve=fe;else break e}}function o(J){return J.length===0?null:J[0]}function l(J){if(J.length===0)return null;var K=J[0],ve=J.pop();if(ve!==K){J[0]=ve;e:for(var fe=0,I=J.length,P=I>>>1;fe<P;){var H=2*(fe+1)-1,ie=J[H],se=H+1,he=J[se];if(0>s(ie,ve))se<I&&0>s(he,ie)?(J[fe]=he,J[se]=ve,fe=se):(J[fe]=ie,J[H]=ve,fe=H);else if(se<I&&0>s(he,ve))J[fe]=he,J[se]=ve,fe=se;else break e}}return K}function s(J,K){var ve=J.sortIndex-K.sortIndex;return ve!==0?ve:J.id-K.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var d=Date,m=d.now();n.unstable_now=function(){return d.now()-m}}var g=[],h=[],v=1,T=null,_=3,C=!1,M=!1,S=!1,R=!1,x=typeof setTimeout=="function"?setTimeout:null,b=typeof clearTimeout=="function"?clearTimeout:null,N=typeof setImmediate<"u"?setImmediate:null;function z(J){for(var K=o(h);K!==null;){if(K.callback===null)l(h);else if(K.startTime<=J)l(h),K.sortIndex=K.expirationTime,e(g,K);else break;K=o(h)}}function k(J){if(S=!1,z(J),!M)if(o(g)!==null)M=!0,X||(X=!0,B());else{var K=o(h);K!==null&&te(k,K.startTime-J)}}var X=!1,Y=-1,oe=5,q=-1;function re(){return R?!0:!(n.unstable_now()-q<oe)}function ye(){if(R=!1,X){var J=n.unstable_now();q=J;var K=!0;try{e:{M=!1,S&&(S=!1,b(Y),Y=-1),C=!0;var ve=_;try{t:{for(z(J),T=o(g);T!==null&&!(T.expirationTime>J&&re());){var fe=T.callback;if(typeof fe=="function"){T.callback=null,_=T.priorityLevel;var I=fe(T.expirationTime<=J);if(J=n.unstable_now(),typeof I=="function"){T.callback=I,z(J),K=!0;break t}T===o(g)&&l(g),z(J)}else l(g);T=o(g)}if(T!==null)K=!0;else{var P=o(h);P!==null&&te(k,P.startTime-J),K=!1}}break e}finally{T=null,_=ve,C=!1}K=void 0}}finally{K?B():X=!1}}}var B;if(typeof N=="function")B=function(){N(ye)};else if(typeof MessageChannel<"u"){var le=new MessageChannel,w=le.port2;le.port1.onmessage=ye,B=function(){w.postMessage(null)}}else B=function(){x(ye,0)};function te(J,K){Y=x(function(){J(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(J){J.callback=null},n.unstable_forceFrameRate=function(J){0>J||125<J?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<J?Math.floor(1e3/J):5},n.unstable_getCurrentPriorityLevel=function(){return _},n.unstable_next=function(J){switch(_){case 1:case 2:case 3:var K=3;break;default:K=_}var ve=_;_=K;try{return J()}finally{_=ve}},n.unstable_requestPaint=function(){R=!0},n.unstable_runWithPriority=function(J,K){switch(J){case 1:case 2:case 3:case 4:case 5:break;default:J=3}var ve=_;_=J;try{return K()}finally{_=ve}},n.unstable_scheduleCallback=function(J,K,ve){var fe=n.unstable_now();switch(typeof ve=="object"&&ve!==null?(ve=ve.delay,ve=typeof ve=="number"&&0<ve?fe+ve:fe):ve=fe,J){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=ve+I,J={id:v++,callback:K,priorityLevel:J,startTime:ve,expirationTime:I,sortIndex:-1},ve>fe?(J.sortIndex=ve,e(h,J),o(g)===null&&J===o(h)&&(S?(b(Y),Y=-1):S=!0,te(k,ve-fe))):(J.sortIndex=I,e(g,J),M||C||(M=!0,X||(X=!0,B()))),J},n.unstable_shouldYield=re,n.unstable_wrapCallback=function(J){var K=_;return function(){var ve=_;_=K;try{return J.apply(this,arguments)}finally{_=ve}}}})(_u)),_u}var Yh;function Uv(){return Yh||(Yh=1,Tu.exports=Iv()),Tu.exports}var Cu={exports:{}},St={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Jh;function kv(){if(Jh)return St;Jh=1;var n=Gu();function e(g){var h="https://react.dev/errors/"+g;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)h+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+g+"; visit "+h+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var l={d:{f:o,r:function(){throw Error(e(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},s=Symbol.for("react.portal");function c(g,h,v){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:T==null?null:""+T,children:g,containerInfo:h,implementation:v}}var d=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function m(g,h){if(g==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return St.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,St.createPortal=function(g,h){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(e(299));return c(g,h,null,v)},St.flushSync=function(g){var h=d.T,v=l.p;try{if(d.T=null,l.p=2,g)return g()}finally{d.T=h,l.p=v,l.d.f()}},St.preconnect=function(g,h){typeof g=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,l.d.C(g,h))},St.prefetchDNS=function(g){typeof g=="string"&&l.d.D(g)},St.preinit=function(g,h){if(typeof g=="string"&&h&&typeof h.as=="string"){var v=h.as,T=m(v,h.crossOrigin),_=typeof h.integrity=="string"?h.integrity:void 0,C=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;v==="style"?l.d.S(g,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:T,integrity:_,fetchPriority:C}):v==="script"&&l.d.X(g,{crossOrigin:T,integrity:_,fetchPriority:C,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},St.preinitModule=function(g,h){if(typeof g=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var v=m(h.as,h.crossOrigin);l.d.M(g,{crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&l.d.M(g)},St.preload=function(g,h){if(typeof g=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var v=h.as,T=m(v,h.crossOrigin);l.d.L(g,v,{crossOrigin:T,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},St.preloadModule=function(g,h){if(typeof g=="string")if(h){var v=m(h.as,h.crossOrigin);l.d.m(g,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:v,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else l.d.m(g)},St.requestFormReset=function(g){l.d.r(g)},St.unstable_batchedUpdates=function(g,h){return g(h)},St.useFormState=function(g,h,v){return d.H.useFormState(g,h,v)},St.useFormStatus=function(){return d.H.useHostTransitionStatus()},St.version="19.1.1",St}var Kh;function Lv(){if(Kh)return Cu.exports;Kh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),Cu.exports=kv(),Cu.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Zh;function Pv(){if(Zh)return vl;Zh=1;var n=Uv(),e=Gu(),o=Lv();function l(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)i+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function c(t){var i=t,a=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(a=i.return),t=i.return;while(t)}return i.tag===3?a:null}function d(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function m(t){if(c(t)!==t)throw Error(l(188))}function g(t){var i=t.alternate;if(!i){if(i=c(t),i===null)throw Error(l(188));return i!==t?null:t}for(var a=t,f=i;;){var p=a.return;if(p===null)break;var y=p.alternate;if(y===null){if(f=p.return,f!==null){a=f;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===a)return m(p),t;if(y===f)return m(p),i;y=y.sibling}throw Error(l(188))}if(a.return!==f.return)a=p,f=y;else{for(var E=!1,D=p.child;D;){if(D===a){E=!0,a=p,f=y;break}if(D===f){E=!0,f=p,a=y;break}D=D.sibling}if(!E){for(D=y.child;D;){if(D===a){E=!0,a=y,f=p;break}if(D===f){E=!0,f=y,a=p;break}D=D.sibling}if(!E)throw Error(l(189))}}if(a.alternate!==f)throw Error(l(190))}if(a.tag!==3)throw Error(l(188));return a.stateNode.current===a?t:i}function h(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=h(t),i!==null)return i;t=t.sibling}return null}var v=Object.assign,T=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),S=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),x=Symbol.for("react.provider"),b=Symbol.for("react.consumer"),N=Symbol.for("react.context"),z=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),X=Symbol.for("react.suspense_list"),Y=Symbol.for("react.memo"),oe=Symbol.for("react.lazy"),q=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),ye=Symbol.iterator;function B(t){return t===null||typeof t!="object"?null:(t=ye&&t[ye]||t["@@iterator"],typeof t=="function"?t:null)}var le=Symbol.for("react.client.reference");function w(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===le?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case M:return"Fragment";case R:return"Profiler";case S:return"StrictMode";case k:return"Suspense";case X:return"SuspenseList";case q:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case C:return"Portal";case N:return(t.displayName||"Context")+".Provider";case b:return(t._context.displayName||"Context")+".Consumer";case z:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Y:return i=t.displayName||null,i!==null?i:w(t.type)||"Memo";case oe:i=t._payload,t=t._init;try{return w(t(i))}catch{}}return null}var te=Array.isArray,J=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ve={pending:!1,data:null,method:null,action:null},fe=[],I=-1;function P(t){return{current:t}}function H(t){0>I||(t.current=fe[I],fe[I]=null,I--)}function ie(t,i){I++,fe[I]=t.current,t.current=i}var se=P(null),he=P(null),Ce=P(null),He=P(null);function Ae(t,i){switch(ie(Ce,i),ie(he,t),ie(se,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?mh(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=mh(i),t=ph(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}H(se),ie(se,t)}function Ie(){H(se),H(he),H(Ce)}function tt(t){t.memoizedState!==null&&ie(He,t);var i=se.current,a=ph(i,t.type);i!==a&&(ie(he,t),ie(se,a))}function Qe(t){he.current===t&&(H(se),H(he)),He.current===t&&(H(He),dl._currentValue=ve)}var Mt=Object.prototype.hasOwnProperty,At=n.unstable_scheduleCallback,A=n.unstable_cancelCallback,de=n.unstable_shouldYield,ne=n.unstable_requestPaint,L=n.unstable_now,U=n.unstable_getCurrentPriorityLevel,F=n.unstable_ImmediatePriority,pe=n.unstable_UserBlockingPriority,ge=n.unstable_NormalPriority,W=n.unstable_LowPriority,Te=n.unstable_IdlePriority,Se=n.log,_e=n.unstable_setDisableYieldValue,Me=null,ke=null;function Ne(t){if(typeof Se=="function"&&_e(t),ke&&typeof ke.setStrictMode=="function")try{ke.setStrictMode(Me,t)}catch{}}var $e=Math.clz32?Math.clz32:ii,ni=Math.log,Ht=Math.LN2;function ii(t){return t>>>=0,t===0?32:31-(ni(t)/Ht|0)|0}var We=256,fn=4194304;function $t(t){var i=t&42;if(i!==0)return i;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194048;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function Rt(t,i,a){var f=t.pendingLanes;if(f===0)return 0;var p=0,y=t.suspendedLanes,E=t.pingedLanes;t=t.warmLanes;var D=f&134217727;return D!==0?(f=D&~y,f!==0?p=$t(f):(E&=D,E!==0?p=$t(E):a||(a=D&~t,a!==0&&(p=$t(a))))):(D=f&~y,D!==0?p=$t(D):E!==0?p=$t(E):a||(a=f&~t,a!==0&&(p=$t(a)))),p===0?0:i!==0&&i!==p&&(i&y)===0&&(y=p&-p,a=i&-i,y>=a||y===32&&(a&4194048)!==0)?i:p}function Nn(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function lr(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function wl(){var t=We;return We<<=1,(We&4194048)===0&&(We=256),t}function bl(){var t=fn;return fn<<=1,(fn&62914560)===0&&(fn=4194304),t}function Mi(t){for(var i=[],a=0;31>a;a++)i.push(t);return i}function Wt(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function Ri(t,i,a,f,p,y){var E=t.pendingLanes;t.pendingLanes=a,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=a,t.entangledLanes&=a,t.errorRecoveryDisabledLanes&=a,t.shellSuspendCounter=0;var D=t.entanglements,V=t.expirationTimes,Q=t.hiddenUpdates;for(a=E&~a;0<a;){var ue=31-$e(a),me=1<<ue;D[ue]=0,V[ue]=-1;var j=Q[ue];if(j!==null)for(Q[ue]=null,ue=0;ue<j.length;ue++){var ee=j[ue];ee!==null&&(ee.lane&=-536870913)}a&=~me}f!==0&&Wu(t,f,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(E&~i))}function Wu(t,i,a){t.pendingLanes|=i,t.suspendedLanes&=~i;var f=31-$e(i);t.entangledLanes|=i,t.entanglements[f]=t.entanglements[f]|1073741824|a&4194090}function ju(t,i){var a=t.entangledLanes|=i;for(t=t.entanglements;a;){var f=31-$e(a),p=1<<f;p&i|t[f]&i&&(t[f]|=i),a&=~p}}function ar(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function rr(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function ef(){var t=K.p;return t!==0?t:(t=window.event,t===void 0?32:kh(t.type))}function yg(t,i){var a=K.p;try{return K.p=t,i()}finally{K.p=a}}var In=Math.random().toString(36).slice(2),_t="__reactFiber$"+In,wt="__reactProps$"+In,wi="__reactContainer$"+In,sr="__reactEvents$"+In,vg="__reactListeners$"+In,Tg="__reactHandles$"+In,tf="__reactResources$"+In,Eo="__reactMarker$"+In;function ur(t){delete t[_t],delete t[wt],delete t[sr],delete t[vg],delete t[Tg]}function bi(t){var i=t[_t];if(i)return i;for(var a=t.parentNode;a;){if(i=a[wi]||a[_t]){if(a=i.alternate,i.child!==null||a!==null&&a.child!==null)for(t=Th(t);t!==null;){if(a=t[_t])return a;t=Th(t)}return i}t=a,a=t.parentNode}return null}function Di(t){if(t=t[_t]||t[wi]){var i=t.tag;if(i===5||i===6||i===13||i===26||i===27||i===3)return t}return null}function Ao(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(l(33))}function Ni(t){var i=t[tf];return i||(i=t[tf]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function ht(t){t[Eo]=!0}var nf=new Set,of={};function oi(t,i){Ii(t,i),Ii(t+"Capture",i)}function Ii(t,i){for(of[t]=i,t=0;t<i.length;t++)nf.add(i[t])}var _g=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),lf={},af={};function Cg(t){return Mt.call(af,t)?!0:Mt.call(lf,t)?!1:_g.test(t)?af[t]=!0:(lf[t]=!0,!1)}function Dl(t,i,a){if(Cg(i))if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var f=i.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+a)}}function Nl(t,i,a){if(a===null)t.removeAttribute(i);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+a)}}function cn(t,i,a,f){if(f===null)t.removeAttribute(a);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(a);return}t.setAttributeNS(i,a,""+f)}}var fr,rf;function Ui(t){if(fr===void 0)try{throw Error()}catch(a){var i=a.stack.trim().match(/\n( *(at )?)/);fr=i&&i[1]||"",rf=-1<a.stack.indexOf(`
    at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
`+fr+t+rf}var cr=!1;function dr(t,i){if(!t||cr)return"";cr=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var f={DetermineComponentFrameRoot:function(){try{if(i){var me=function(){throw Error()};if(Object.defineProperty(me.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(me,[])}catch(ee){var j=ee}Reflect.construct(t,[],me)}else{try{me.call()}catch(ee){j=ee}t.call(me.prototype)}}else{try{throw Error()}catch(ee){j=ee}(me=t())&&typeof me.catch=="function"&&me.catch(function(){})}}catch(ee){if(ee&&j&&typeof ee.stack=="string")return[ee.stack,j.stack]}return[null,null]}};f.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var p=Object.getOwnPropertyDescriptor(f.DetermineComponentFrameRoot,"name");p&&p.configurable&&Object.defineProperty(f.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var y=f.DetermineComponentFrameRoot(),E=y[0],D=y[1];if(E&&D){var V=E.split(`
`),Q=D.split(`
`);for(p=f=0;f<V.length&&!V[f].includes("DetermineComponentFrameRoot");)f++;for(;p<Q.length&&!Q[p].includes("DetermineComponentFrameRoot");)p++;if(f===V.length||p===Q.length)for(f=V.length-1,p=Q.length-1;1<=f&&0<=p&&V[f]!==Q[p];)p--;for(;1<=f&&0<=p;f--,p--)if(V[f]!==Q[p]){if(f!==1||p!==1)do if(f--,p--,0>p||V[f]!==Q[p]){var ue=`
`+V[f].replace(" at new "," at ");return t.displayName&&ue.includes("<anonymous>")&&(ue=ue.replace("<anonymous>",t.displayName)),ue}while(1<=f&&0<=p);break}}}finally{cr=!1,Error.prepareStackTrace=a}return(a=t?t.displayName||t.name:"")?Ui(a):""}function Sg(t){switch(t.tag){case 26:case 27:case 5:return Ui(t.type);case 16:return Ui("Lazy");case 13:return Ui("Suspense");case 19:return Ui("SuspenseList");case 0:case 15:return dr(t.type,!1);case 11:return dr(t.type.render,!1);case 1:return dr(t.type,!0);case 31:return Ui("Activity");default:return""}}function sf(t){try{var i="";do i+=Sg(t),t=t.return;while(t);return i}catch(a){return`
Error generating stack: `+a.message+`
`+a.stack}}function Gt(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function uf(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Eg(t){var i=uf(t)?"checked":"value",a=Object.getOwnPropertyDescriptor(t.constructor.prototype,i),f=""+t[i];if(!t.hasOwnProperty(i)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var p=a.get,y=a.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return p.call(this)},set:function(E){f=""+E,y.call(this,E)}}),Object.defineProperty(t,i,{enumerable:a.enumerable}),{getValue:function(){return f},setValue:function(E){f=""+E},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Il(t){t._valueTracker||(t._valueTracker=Eg(t))}function ff(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var a=i.getValue(),f="";return t&&(f=uf(t)?t.checked?"true":"false":t.value),t=f,t!==a?(i.setValue(t),!0):!1}function Ul(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}var Ag=/[\n"\\]/g;function qt(t){return t.replace(Ag,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function hr(t,i,a,f,p,y,E,D){t.name="",E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"?t.type=E:t.removeAttribute("type"),i!=null?E==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Gt(i)):t.value!==""+Gt(i)&&(t.value=""+Gt(i)):E!=="submit"&&E!=="reset"||t.removeAttribute("value"),i!=null?mr(t,E,Gt(i)):a!=null?mr(t,E,Gt(a)):f!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?t.name=""+Gt(D):t.removeAttribute("name")}function cf(t,i,a,f,p,y,E,D){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(t.type=y),i!=null||a!=null){if(!(y!=="submit"&&y!=="reset"||i!=null))return;a=a!=null?""+Gt(a):"",i=i!=null?""+Gt(i):a,D||i===t.value||(t.value=i),t.defaultValue=i}f=f??p,f=typeof f!="function"&&typeof f!="symbol"&&!!f,t.checked=D?t.checked:!!f,t.defaultChecked=!!f,E!=null&&typeof E!="function"&&typeof E!="symbol"&&typeof E!="boolean"&&(t.name=E)}function mr(t,i,a){i==="number"&&Ul(t.ownerDocument)===t||t.defaultValue===""+a||(t.defaultValue=""+a)}function ki(t,i,a,f){if(t=t.options,i){i={};for(var p=0;p<a.length;p++)i["$"+a[p]]=!0;for(a=0;a<t.length;a++)p=i.hasOwnProperty("$"+t[a].value),t[a].selected!==p&&(t[a].selected=p),p&&f&&(t[a].defaultSelected=!0)}else{for(a=""+Gt(a),i=null,p=0;p<t.length;p++){if(t[p].value===a){t[p].selected=!0,f&&(t[p].defaultSelected=!0);return}i!==null||t[p].disabled||(i=t[p])}i!==null&&(i.selected=!0)}}function df(t,i,a){if(i!=null&&(i=""+Gt(i),i!==t.value&&(t.value=i),a==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=a!=null?""+Gt(a):""}function hf(t,i,a,f){if(i==null){if(f!=null){if(a!=null)throw Error(l(92));if(te(f)){if(1<f.length)throw Error(l(93));f=f[0]}a=f}a==null&&(a=""),i=a}a=Gt(i),t.defaultValue=a,f=t.textContent,f===a&&f!==""&&f!==null&&(t.value=f)}function Li(t,i){if(i){var a=t.firstChild;if(a&&a===t.lastChild&&a.nodeType===3){a.nodeValue=i;return}}t.textContent=i}var xg=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mf(t,i,a){var f=i.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?f?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":f?t.setProperty(i,a):typeof a!="number"||a===0||xg.has(i)?i==="float"?t.cssFloat=a:t[i]=(""+a).trim():t[i]=a+"px"}function pf(t,i,a){if(i!=null&&typeof i!="object")throw Error(l(62));if(t=t.style,a!=null){for(var f in a)!a.hasOwnProperty(f)||i!=null&&i.hasOwnProperty(f)||(f.indexOf("--")===0?t.setProperty(f,""):f==="float"?t.cssFloat="":t[f]="");for(var p in i)f=i[p],i.hasOwnProperty(p)&&a[p]!==f&&mf(t,p,f)}else for(var y in i)i.hasOwnProperty(y)&&mf(t,y,i[y])}function pr(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var Mg=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Rg=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function kl(t){return Rg.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}var gr=null;function yr(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Pi=null,zi=null;function gf(t){var i=Di(t);if(i&&(t=i.stateNode)){var a=t[wt]||null;e:switch(t=i.stateNode,i.type){case"input":if(hr(t,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),i=a.name,a.type==="radio"&&i!=null){for(a=t;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+qt(""+i)+'"][type="radio"]'),i=0;i<a.length;i++){var f=a[i];if(f!==t&&f.form===t.form){var p=f[wt]||null;if(!p)throw Error(l(90));hr(f,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(i=0;i<a.length;i++)f=a[i],f.form===t.form&&ff(f)}break e;case"textarea":df(t,a.value,a.defaultValue);break e;case"select":i=a.value,i!=null&&ki(t,!!a.multiple,i,!1)}}}var vr=!1;function yf(t,i,a){if(vr)return t(i,a);vr=!0;try{var f=t(i);return f}finally{if(vr=!1,(Pi!==null||zi!==null)&&(Ta(),Pi&&(i=Pi,t=zi,zi=Pi=null,gf(i),t)))for(i=0;i<t.length;i++)gf(t[i])}}function xo(t,i){var a=t.stateNode;if(a===null)return null;var f=a[wt]||null;if(f===null)return null;a=f[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(t=t.type,f=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!f;break e;default:t=!1}if(t)return null;if(a&&typeof a!="function")throw Error(l(231,i,typeof a));return a}var dn=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Tr=!1;if(dn)try{var Mo={};Object.defineProperty(Mo,"passive",{get:function(){Tr=!0}}),window.addEventListener("test",Mo,Mo),window.removeEventListener("test",Mo,Mo)}catch{Tr=!1}var Un=null,_r=null,Ll=null;function vf(){if(Ll)return Ll;var t,i=_r,a=i.length,f,p="value"in Un?Un.value:Un.textContent,y=p.length;for(t=0;t<a&&i[t]===p[t];t++);var E=a-t;for(f=1;f<=E&&i[a-f]===p[y-f];f++);return Ll=p.slice(t,1<f?1-f:void 0)}function Pl(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function zl(){return!0}function Tf(){return!1}function bt(t){function i(a,f,p,y,E){this._reactName=a,this._targetInst=p,this.type=f,this.nativeEvent=y,this.target=E,this.currentTarget=null;for(var D in t)t.hasOwnProperty(D)&&(a=t[D],this[D]=a?a(y):y[D]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?zl:Tf,this.isPropagationStopped=Tf,this}return v(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=zl)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=zl)},persist:function(){},isPersistent:zl}),i}var li={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bl=bt(li),Ro=v({},li,{view:0,detail:0}),wg=bt(Ro),Cr,Sr,wo,Vl=v({},Ro,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Ar,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==wo&&(wo&&t.type==="mousemove"?(Cr=t.screenX-wo.screenX,Sr=t.screenY-wo.screenY):Sr=Cr=0,wo=t),Cr)},movementY:function(t){return"movementY"in t?t.movementY:Sr}}),_f=bt(Vl),bg=v({},Vl,{dataTransfer:0}),Dg=bt(bg),Ng=v({},Ro,{relatedTarget:0}),Er=bt(Ng),Ig=v({},li,{animationName:0,elapsedTime:0,pseudoElement:0}),Ug=bt(Ig),kg=v({},li,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Lg=bt(kg),Pg=v({},li,{data:0}),Cf=bt(Pg),zg={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Bg={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},Vg={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Hg(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Vg[t])?!!i[t]:!1}function Ar(){return Hg}var Gg=v({},Ro,{key:function(t){if(t.key){var i=zg[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Pl(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Bg[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Ar,charCode:function(t){return t.type==="keypress"?Pl(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Pl(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),qg=bt(Gg),Fg=v({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Sf=bt(Fg),Og=v({},Ro,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Ar}),Yg=bt(Og),Jg=v({},li,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kg=bt(Jg),Zg=v({},Vl,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Xg=bt(Zg),Qg=v({},li,{newState:0,oldState:0}),$g=bt(Qg),Wg=[9,13,27,32],xr=dn&&"CompositionEvent"in window,bo=null;dn&&"documentMode"in document&&(bo=document.documentMode);var jg=dn&&"TextEvent"in window&&!bo,Ef=dn&&(!xr||bo&&8<bo&&11>=bo),Af=" ",xf=!1;function Mf(t,i){switch(t){case"keyup":return Wg.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Rf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Bi=!1;function ey(t,i){switch(t){case"compositionend":return Rf(i);case"keypress":return i.which!==32?null:(xf=!0,Af);case"textInput":return t=i.data,t===Af&&xf?null:t;default:return null}}function ty(t,i){if(Bi)return t==="compositionend"||!xr&&Mf(t,i)?(t=vf(),Ll=_r=Un=null,Bi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Ef&&i.locale!=="ko"?null:i.data;default:return null}}var ny={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wf(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!ny[t.type]:i==="textarea"}function bf(t,i,a,f){Pi?zi?zi.push(f):zi=[f]:Pi=f,i=xa(i,"onChange"),0<i.length&&(a=new Bl("onChange","change",null,a,f),t.push({event:a,listeners:i}))}var Do=null,No=null;function iy(t){uh(t,0)}function Hl(t){var i=Ao(t);if(ff(i))return t}function Df(t,i){if(t==="change")return i}var Nf=!1;if(dn){var Mr;if(dn){var Rr="oninput"in document;if(!Rr){var If=document.createElement("div");If.setAttribute("oninput","return;"),Rr=typeof If.oninput=="function"}Mr=Rr}else Mr=!1;Nf=Mr&&(!document.documentMode||9<document.documentMode)}function Uf(){Do&&(Do.detachEvent("onpropertychange",kf),No=Do=null)}function kf(t){if(t.propertyName==="value"&&Hl(No)){var i=[];bf(i,No,t,yr(t)),yf(iy,i)}}function oy(t,i,a){t==="focusin"?(Uf(),Do=i,No=a,Do.attachEvent("onpropertychange",kf)):t==="focusout"&&Uf()}function ly(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Hl(No)}function ay(t,i){if(t==="click")return Hl(i)}function ry(t,i){if(t==="input"||t==="change")return Hl(i)}function sy(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Ut=typeof Object.is=="function"?Object.is:sy;function Io(t,i){if(Ut(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var a=Object.keys(t),f=Object.keys(i);if(a.length!==f.length)return!1;for(f=0;f<a.length;f++){var p=a[f];if(!Mt.call(i,p)||!Ut(t[p],i[p]))return!1}return!0}function Lf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Pf(t,i){var a=Lf(t);t=0;for(var f;a;){if(a.nodeType===3){if(f=t+a.textContent.length,t<=i&&f>=i)return{node:a,offset:i-t};t=f}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Lf(a)}}function zf(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?zf(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Bf(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Ul(t.document);i instanceof t.HTMLIFrameElement;){try{var a=typeof i.contentWindow.location.href=="string"}catch{a=!1}if(a)t=i.contentWindow;else break;i=Ul(t.document)}return i}function wr(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}var uy=dn&&"documentMode"in document&&11>=document.documentMode,Vi=null,br=null,Uo=null,Dr=!1;function Vf(t,i,a){var f=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Dr||Vi==null||Vi!==Ul(f)||(f=Vi,"selectionStart"in f&&wr(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Uo&&Io(Uo,f)||(Uo=f,f=xa(br,"onSelect"),0<f.length&&(i=new Bl("onSelect","select",null,i,a),t.push({event:i,listeners:f}),i.target=Vi)))}function ai(t,i){var a={};return a[t.toLowerCase()]=i.toLowerCase(),a["Webkit"+t]="webkit"+i,a["Moz"+t]="moz"+i,a}var Hi={animationend:ai("Animation","AnimationEnd"),animationiteration:ai("Animation","AnimationIteration"),animationstart:ai("Animation","AnimationStart"),transitionrun:ai("Transition","TransitionRun"),transitionstart:ai("Transition","TransitionStart"),transitioncancel:ai("Transition","TransitionCancel"),transitionend:ai("Transition","TransitionEnd")},Nr={},Hf={};dn&&(Hf=document.createElement("div").style,"AnimationEvent"in window||(delete Hi.animationend.animation,delete Hi.animationiteration.animation,delete Hi.animationstart.animation),"TransitionEvent"in window||delete Hi.transitionend.transition);function ri(t){if(Nr[t])return Nr[t];if(!Hi[t])return t;var i=Hi[t],a;for(a in i)if(i.hasOwnProperty(a)&&a in Hf)return Nr[t]=i[a];return t}var Gf=ri("animationend"),qf=ri("animationiteration"),Ff=ri("animationstart"),fy=ri("transitionrun"),cy=ri("transitionstart"),dy=ri("transitioncancel"),Of=ri("transitionend"),Yf=new Map,Ir="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Ir.push("scrollEnd");function jt(t,i){Yf.set(t,i),oi(i,[t])}var Jf=new WeakMap;function Ft(t,i){if(typeof t=="object"&&t!==null){var a=Jf.get(t);return a!==void 0?a:(i={value:t,source:i,stack:sf(i)},Jf.set(t,i),i)}return{value:t,source:i,stack:sf(i)}}var Ot=[],Gi=0,Ur=0;function Gl(){for(var t=Gi,i=Ur=Gi=0;i<t;){var a=Ot[i];Ot[i++]=null;var f=Ot[i];Ot[i++]=null;var p=Ot[i];Ot[i++]=null;var y=Ot[i];if(Ot[i++]=null,f!==null&&p!==null){var E=f.pending;E===null?p.next=p:(p.next=E.next,E.next=p),f.pending=p}y!==0&&Kf(a,p,y)}}function ql(t,i,a,f){Ot[Gi++]=t,Ot[Gi++]=i,Ot[Gi++]=a,Ot[Gi++]=f,Ur|=f,t.lanes|=f,t=t.alternate,t!==null&&(t.lanes|=f)}function kr(t,i,a,f){return ql(t,i,a,f),Fl(t)}function qi(t,i){return ql(t,null,null,i),Fl(t)}function Kf(t,i,a){t.lanes|=a;var f=t.alternate;f!==null&&(f.lanes|=a);for(var p=!1,y=t.return;y!==null;)y.childLanes|=a,f=y.alternate,f!==null&&(f.childLanes|=a),y.tag===22&&(t=y.stateNode,t===null||t._visibility&1||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&i!==null&&(p=31-$e(a),t=y.hiddenUpdates,f=t[p],f===null?t[p]=[i]:f.push(i),i.lane=a|536870912),y):null}function Fl(t){if(50<ol)throw ol=0,Hs=null,Error(l(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var Fi={};function hy(t,i,a,f){this.tag=t,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function kt(t,i,a,f){return new hy(t,i,a,f)}function Lr(t){return t=t.prototype,!(!t||!t.isReactComponent)}function hn(t,i){var a=t.alternate;return a===null?(a=kt(t.tag,i,t.key,t.mode),a.elementType=t.elementType,a.type=t.type,a.stateNode=t.stateNode,a.alternate=t,t.alternate=a):(a.pendingProps=i,a.type=t.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=t.flags&65011712,a.childLanes=t.childLanes,a.lanes=t.lanes,a.child=t.child,a.memoizedProps=t.memoizedProps,a.memoizedState=t.memoizedState,a.updateQueue=t.updateQueue,i=t.dependencies,a.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},a.sibling=t.sibling,a.index=t.index,a.ref=t.ref,a.refCleanup=t.refCleanup,a}function Zf(t,i){t.flags&=65011714;var a=t.alternate;return a===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=a.childLanes,t.lanes=a.lanes,t.child=a.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=a.memoizedProps,t.memoizedState=a.memoizedState,t.updateQueue=a.updateQueue,t.type=a.type,i=a.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function Ol(t,i,a,f,p,y){var E=0;if(f=t,typeof t=="function")Lr(t)&&(E=1);else if(typeof t=="string")E=pv(t,a,se.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case q:return t=kt(31,a,i,p),t.elementType=q,t.lanes=y,t;case M:return si(a.children,p,y,i);case S:E=8,p|=24;break;case R:return t=kt(12,a,i,p|2),t.elementType=R,t.lanes=y,t;case k:return t=kt(13,a,i,p),t.elementType=k,t.lanes=y,t;case X:return t=kt(19,a,i,p),t.elementType=X,t.lanes=y,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case x:case N:E=10;break e;case b:E=9;break e;case z:E=11;break e;case Y:E=14;break e;case oe:E=16,f=null;break e}E=29,a=Error(l(130,t===null?"null":typeof t,"")),f=null}return i=kt(E,a,i,p),i.elementType=t,i.type=f,i.lanes=y,i}function si(t,i,a,f){return t=kt(7,t,f,i),t.lanes=a,t}function Pr(t,i,a){return t=kt(6,t,null,i),t.lanes=a,t}function zr(t,i,a){return i=kt(4,t.children!==null?t.children:[],t.key,i),i.lanes=a,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var Oi=[],Yi=0,Yl=null,Jl=0,Yt=[],Jt=0,ui=null,mn=1,pn="";function fi(t,i){Oi[Yi++]=Jl,Oi[Yi++]=Yl,Yl=t,Jl=i}function Xf(t,i,a){Yt[Jt++]=mn,Yt[Jt++]=pn,Yt[Jt++]=ui,ui=t;var f=mn;t=pn;var p=32-$e(f)-1;f&=~(1<<p),a+=1;var y=32-$e(i)+p;if(30<y){var E=p-p%5;y=(f&(1<<E)-1).toString(32),f>>=E,p-=E,mn=1<<32-$e(i)+p|a<<p|f,pn=y+t}else mn=1<<y|a<<p|f,pn=t}function Br(t){t.return!==null&&(fi(t,1),Xf(t,1,0))}function Vr(t){for(;t===Yl;)Yl=Oi[--Yi],Oi[Yi]=null,Jl=Oi[--Yi],Oi[Yi]=null;for(;t===ui;)ui=Yt[--Jt],Yt[Jt]=null,pn=Yt[--Jt],Yt[Jt]=null,mn=Yt[--Jt],Yt[Jt]=null}var xt=null,lt=null,qe=!1,ci=null,on=!1,Hr=Error(l(519));function di(t){var i=Error(l(418,""));throw Po(Ft(i,t)),Hr}function Qf(t){var i=t.stateNode,a=t.type,f=t.memoizedProps;switch(i[_t]=t,i[wt]=f,a){case"dialog":Be("cancel",i),Be("close",i);break;case"iframe":case"object":case"embed":Be("load",i);break;case"video":case"audio":for(a=0;a<al.length;a++)Be(al[a],i);break;case"source":Be("error",i);break;case"img":case"image":case"link":Be("error",i),Be("load",i);break;case"details":Be("toggle",i);break;case"input":Be("invalid",i),cf(i,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0),Il(i);break;case"select":Be("invalid",i);break;case"textarea":Be("invalid",i),hf(i,f.value,f.defaultValue,f.children),Il(i)}a=f.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||i.textContent===""+a||f.suppressHydrationWarning===!0||hh(i.textContent,a)?(f.popover!=null&&(Be("beforetoggle",i),Be("toggle",i)),f.onScroll!=null&&Be("scroll",i),f.onScrollEnd!=null&&Be("scrollend",i),f.onClick!=null&&(i.onclick=Ma),i=!0):i=!1,i||di(t)}function $f(t){for(xt=t.return;xt;)switch(xt.tag){case 5:case 13:on=!1;return;case 27:case 3:on=!0;return;default:xt=xt.return}}function ko(t){if(t!==xt)return!1;if(!qe)return $f(t),qe=!0,!1;var i=t.tag,a;if((a=i!==3&&i!==27)&&((a=i===5)&&(a=t.type,a=!(a!=="form"&&a!=="button")||nu(t.type,t.memoizedProps)),a=!a),a&&lt&&di(t),$f(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(l(317));e:{for(t=t.nextSibling,i=0;t;){if(t.nodeType===8)if(a=t.data,a==="/$"){if(i===0){lt=tn(t.nextSibling);break e}i--}else a!=="$"&&a!=="$!"&&a!=="$?"||i++;t=t.nextSibling}lt=null}}else i===27?(i=lt,Xn(t.type)?(t=au,au=null,lt=t):lt=i):lt=xt?tn(t.stateNode.nextSibling):null;return!0}function Lo(){lt=xt=null,qe=!1}function Wf(){var t=ci;return t!==null&&(It===null?It=t:It.push.apply(It,t),ci=null),t}function Po(t){ci===null?ci=[t]:ci.push(t)}var Gr=P(null),hi=null,gn=null;function kn(t,i,a){ie(Gr,i._currentValue),i._currentValue=a}function yn(t){t._currentValue=Gr.current,H(Gr)}function qr(t,i,a){for(;t!==null;){var f=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,f!==null&&(f.childLanes|=i)):f!==null&&(f.childLanes&i)!==i&&(f.childLanes|=i),t===a)break;t=t.return}}function Fr(t,i,a,f){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var E=p.child;y=y.firstContext;e:for(;y!==null;){var D=y;y=p;for(var V=0;V<i.length;V++)if(D.context===i[V]){y.lanes|=a,D=y.alternate,D!==null&&(D.lanes|=a),qr(y.return,a,t),f||(E=null);break e}y=D.next}}else if(p.tag===18){if(E=p.return,E===null)throw Error(l(341));E.lanes|=a,y=E.alternate,y!==null&&(y.lanes|=a),qr(E,a,t),E=null}else E=p.child;if(E!==null)E.return=p;else for(E=p;E!==null;){if(E===t){E=null;break}if(p=E.sibling,p!==null){p.return=E.return,E=p;break}E=E.return}p=E}}function zo(t,i,a,f){t=null;for(var p=i,y=!1;p!==null;){if(!y){if((p.flags&524288)!==0)y=!0;else if((p.flags&262144)!==0)break}if(p.tag===10){var E=p.alternate;if(E===null)throw Error(l(387));if(E=E.memoizedProps,E!==null){var D=p.type;Ut(p.pendingProps.value,E.value)||(t!==null?t.push(D):t=[D])}}else if(p===He.current){if(E=p.alternate,E===null)throw Error(l(387));E.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(dl):t=[dl])}p=p.return}t!==null&&Fr(i,t,a,f),i.flags|=262144}function Kl(t){for(t=t.firstContext;t!==null;){if(!Ut(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function mi(t){hi=t,gn=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function Ct(t){return jf(hi,t)}function Zl(t,i){return hi===null&&mi(t),jf(t,i)}function jf(t,i){var a=i._currentValue;if(i={context:i,memoizedValue:a,next:null},gn===null){if(t===null)throw Error(l(308));gn=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else gn=gn.next=i;return a}var my=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(a,f){t.push(f)}};this.abort=function(){i.aborted=!0,t.forEach(function(a){return a()})}},py=n.unstable_scheduleCallback,gy=n.unstable_NormalPriority,ct={$$typeof:N,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Or(){return{controller:new my,data:new Map,refCount:0}}function Bo(t){t.refCount--,t.refCount===0&&py(gy,function(){t.controller.abort()})}var Vo=null,Yr=0,Ji=0,Ki=null;function yy(t,i){if(Vo===null){var a=Vo=[];Yr=0,Ji=Ks(),Ki={status:"pending",value:void 0,then:function(f){a.push(f)}}}return Yr++,i.then(ec,ec),i}function ec(){if(--Yr===0&&Vo!==null){Ki!==null&&(Ki.status="fulfilled");var t=Vo;Vo=null,Ji=0,Ki=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function vy(t,i){var a=[],f={status:"pending",value:null,reason:null,then:function(p){a.push(p)}};return t.then(function(){f.status="fulfilled",f.value=i;for(var p=0;p<a.length;p++)(0,a[p])(i)},function(p){for(f.status="rejected",f.reason=p,p=0;p<a.length;p++)(0,a[p])(void 0)}),f}var tc=J.S;J.S=function(t,i){typeof i=="object"&&i!==null&&typeof i.then=="function"&&yy(t,i),tc!==null&&tc(t,i)};var pi=P(null);function Jr(){var t=pi.current;return t!==null?t:je.pooledCache}function Xl(t,i){i===null?ie(pi,pi.current):ie(pi,i.pool)}function nc(){var t=Jr();return t===null?null:{parent:ct._currentValue,pool:t}}var Ho=Error(l(460)),ic=Error(l(474)),Ql=Error(l(542)),Kr={then:function(){}};function oc(t){return t=t.status,t==="fulfilled"||t==="rejected"}function $l(){}function lc(t,i,a){switch(a=t[a],a===void 0?t.push(i):a!==i&&(i.then($l,$l),i=a),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,rc(t),t;default:if(typeof i.status=="string")i.then($l,$l);else{if(t=je,t!==null&&100<t.shellSuspendCounter)throw Error(l(482));t=i,t.status="pending",t.then(function(f){if(i.status==="pending"){var p=i;p.status="fulfilled",p.value=f}},function(f){if(i.status==="pending"){var p=i;p.status="rejected",p.reason=f}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,rc(t),t}throw Go=i,Ho}}var Go=null;function ac(){if(Go===null)throw Error(l(459));var t=Go;return Go=null,t}function rc(t){if(t===Ho||t===Ql)throw Error(l(483))}var Ln=!1;function Zr(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Xr(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function Pn(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function zn(t,i,a){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,(Oe&2)!==0){var p=f.pending;return p===null?i.next=i:(i.next=p.next,p.next=i),f.pending=i,i=Fl(t),Kf(t,null,a),i}return ql(t,f,i,a),Fl(t)}function qo(t,i,a){if(i=i.updateQueue,i!==null&&(i=i.shared,(a&4194048)!==0)){var f=i.lanes;f&=t.pendingLanes,a|=f,i.lanes=a,ju(t,a)}}function Qr(t,i){var a=t.updateQueue,f=t.alternate;if(f!==null&&(f=f.updateQueue,a===f)){var p=null,y=null;if(a=a.firstBaseUpdate,a!==null){do{var E={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};y===null?p=y=E:y=y.next=E,a=a.next}while(a!==null);y===null?p=y=i:y=y.next=i}else p=y=i;a={baseState:f.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},t.updateQueue=a;return}t=a.lastBaseUpdate,t===null?a.firstBaseUpdate=i:t.next=i,a.lastBaseUpdate=i}var $r=!1;function Fo(){if($r){var t=Ki;if(t!==null)throw t}}function Oo(t,i,a,f){$r=!1;var p=t.updateQueue;Ln=!1;var y=p.firstBaseUpdate,E=p.lastBaseUpdate,D=p.shared.pending;if(D!==null){p.shared.pending=null;var V=D,Q=V.next;V.next=null,E===null?y=Q:E.next=Q,E=V;var ue=t.alternate;ue!==null&&(ue=ue.updateQueue,D=ue.lastBaseUpdate,D!==E&&(D===null?ue.firstBaseUpdate=Q:D.next=Q,ue.lastBaseUpdate=V))}if(y!==null){var me=p.baseState;E=0,ue=Q=V=null,D=y;do{var j=D.lane&-536870913,ee=j!==D.lane;if(ee?(Ve&j)===j:(f&j)===j){j!==0&&j===Ji&&($r=!0),ue!==null&&(ue=ue.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var De=t,we=D;j=i;var Ze=a;switch(we.tag){case 1:if(De=we.payload,typeof De=="function"){me=De.call(Ze,me,j);break e}me=De;break e;case 3:De.flags=De.flags&-65537|128;case 0:if(De=we.payload,j=typeof De=="function"?De.call(Ze,me,j):De,j==null)break e;me=v({},me,j);break e;case 2:Ln=!0}}j=D.callback,j!==null&&(t.flags|=64,ee&&(t.flags|=8192),ee=p.callbacks,ee===null?p.callbacks=[j]:ee.push(j))}else ee={lane:j,tag:D.tag,payload:D.payload,callback:D.callback,next:null},ue===null?(Q=ue=ee,V=me):ue=ue.next=ee,E|=j;if(D=D.next,D===null){if(D=p.shared.pending,D===null)break;ee=D,D=ee.next,ee.next=null,p.lastBaseUpdate=ee,p.shared.pending=null}}while(!0);ue===null&&(V=me),p.baseState=V,p.firstBaseUpdate=Q,p.lastBaseUpdate=ue,y===null&&(p.shared.lanes=0),Yn|=E,t.lanes=E,t.memoizedState=me}}function sc(t,i){if(typeof t!="function")throw Error(l(191,t));t.call(i)}function uc(t,i){var a=t.callbacks;if(a!==null)for(t.callbacks=null,t=0;t<a.length;t++)sc(a[t],i)}var Zi=P(null),Wl=P(0);function fc(t,i){t=An,ie(Wl,t),ie(Zi,i),An=t|i.baseLanes}function Wr(){ie(Wl,An),ie(Zi,Zi.current)}function jr(){An=Wl.current,H(Zi),H(Wl)}var Bn=0,Le=null,Je=null,ut=null,jl=!1,Xi=!1,gi=!1,ea=0,Yo=0,Qi=null,Ty=0;function rt(){throw Error(l(321))}function es(t,i){if(i===null)return!1;for(var a=0;a<i.length&&a<t.length;a++)if(!Ut(t[a],i[a]))return!1;return!0}function ts(t,i,a,f,p,y){return Bn=y,Le=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,J.H=t===null||t.memoizedState===null?Kc:Zc,gi=!1,y=a(f,p),gi=!1,Xi&&(y=dc(i,a,f,p)),cc(t),y}function cc(t){J.H=aa;var i=Je!==null&&Je.next!==null;if(Bn=0,ut=Je=Le=null,jl=!1,Yo=0,Qi=null,i)throw Error(l(300));t===null||mt||(t=t.dependencies,t!==null&&Kl(t)&&(mt=!0))}function dc(t,i,a,f){Le=t;var p=0;do{if(Xi&&(Qi=null),Yo=0,Xi=!1,25<=p)throw Error(l(301));if(p+=1,ut=Je=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}J.H=My,y=i(a,f)}while(Xi);return y}function _y(){var t=J.H,i=t.useState()[0];return i=typeof i.then=="function"?Jo(i):i,t=t.useState()[0],(Je!==null?Je.memoizedState:null)!==t&&(Le.flags|=1024),i}function ns(){var t=ea!==0;return ea=0,t}function is(t,i,a){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~a}function os(t){if(jl){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}jl=!1}Bn=0,ut=Je=Le=null,Xi=!1,Yo=ea=0,Qi=null}function Dt(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?Le.memoizedState=ut=t:ut=ut.next=t,ut}function ft(){if(Je===null){var t=Le.alternate;t=t!==null?t.memoizedState:null}else t=Je.next;var i=ut===null?Le.memoizedState:ut.next;if(i!==null)ut=i,Je=t;else{if(t===null)throw Le.alternate===null?Error(l(467)):Error(l(310));Je=t,t={memoizedState:Je.memoizedState,baseState:Je.baseState,baseQueue:Je.baseQueue,queue:Je.queue,next:null},ut===null?Le.memoizedState=ut=t:ut=ut.next=t}return ut}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(t){var i=Yo;return Yo+=1,Qi===null&&(Qi=[]),t=lc(Qi,t,i),i=Le,(ut===null?i.memoizedState:ut.next)===null&&(i=i.alternate,J.H=i===null||i.memoizedState===null?Kc:Zc),t}function ta(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Jo(t);if(t.$$typeof===N)return Ct(t)}throw Error(l(438,String(t)))}function as(t){var i=null,a=Le.updateQueue;if(a!==null&&(i=a.memoCache),i==null){var f=Le.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(i={data:f.data.map(function(p){return p.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),a===null&&(a=ls(),Le.updateQueue=a),a.memoCache=i,a=i.data[i.index],a===void 0)for(a=i.data[i.index]=Array(t),f=0;f<t;f++)a[f]=re;return i.index++,a}function vn(t,i){return typeof i=="function"?i(t):i}function na(t){var i=ft();return rs(i,Je,t)}function rs(t,i,a){var f=t.queue;if(f===null)throw Error(l(311));f.lastRenderedReducer=a;var p=t.baseQueue,y=f.pending;if(y!==null){if(p!==null){var E=p.next;p.next=y.next,y.next=E}i.baseQueue=p=y,f.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{i=p.next;var D=E=null,V=null,Q=i,ue=!1;do{var me=Q.lane&-536870913;if(me!==Q.lane?(Ve&me)===me:(Bn&me)===me){var j=Q.revertLane;if(j===0)V!==null&&(V=V.next={lane:0,revertLane:0,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null}),me===Ji&&(ue=!0);else if((Bn&j)===j){Q=Q.next,j===Ji&&(ue=!0);continue}else me={lane:0,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},V===null?(D=V=me,E=y):V=V.next=me,Le.lanes|=j,Yn|=j;me=Q.action,gi&&a(y,me),y=Q.hasEagerState?Q.eagerState:a(y,me)}else j={lane:me,revertLane:Q.revertLane,action:Q.action,hasEagerState:Q.hasEagerState,eagerState:Q.eagerState,next:null},V===null?(D=V=j,E=y):V=V.next=j,Le.lanes|=me,Yn|=me;Q=Q.next}while(Q!==null&&Q!==i);if(V===null?E=y:V.next=D,!Ut(y,t.memoizedState)&&(mt=!0,ue&&(a=Ki,a!==null)))throw a;t.memoizedState=y,t.baseState=E,t.baseQueue=V,f.lastRenderedState=y}return p===null&&(f.lanes=0),[t.memoizedState,f.dispatch]}function ss(t){var i=ft(),a=i.queue;if(a===null)throw Error(l(311));a.lastRenderedReducer=t;var f=a.dispatch,p=a.pending,y=i.memoizedState;if(p!==null){a.pending=null;var E=p=p.next;do y=t(y,E.action),E=E.next;while(E!==p);Ut(y,i.memoizedState)||(mt=!0),i.memoizedState=y,i.baseQueue===null&&(i.baseState=y),a.lastRenderedState=y}return[y,f]}function hc(t,i,a){var f=Le,p=ft(),y=qe;if(y){if(a===void 0)throw Error(l(407));a=a()}else a=i();var E=!Ut((Je||p).memoizedState,a);E&&(p.memoizedState=a,mt=!0),p=p.queue;var D=gc.bind(null,f,p,t);if(Ko(2048,8,D,[t]),p.getSnapshot!==i||E||ut!==null&&ut.memoizedState.tag&1){if(f.flags|=2048,$i(9,ia(),pc.bind(null,f,p,a,i),null),je===null)throw Error(l(349));y||(Bn&124)!==0||mc(f,i,a)}return a}function mc(t,i,a){t.flags|=16384,t={getSnapshot:i,value:a},i=Le.updateQueue,i===null?(i=ls(),Le.updateQueue=i,i.stores=[t]):(a=i.stores,a===null?i.stores=[t]:a.push(t))}function pc(t,i,a,f){i.value=a,i.getSnapshot=f,yc(i)&&vc(t)}function gc(t,i,a){return a(function(){yc(i)&&vc(t)})}function yc(t){var i=t.getSnapshot;t=t.value;try{var a=i();return!Ut(t,a)}catch{return!0}}function vc(t){var i=qi(t,2);i!==null&&Vt(i,t,2)}function us(t){var i=Dt();if(typeof t=="function"){var a=t;if(t=a(),gi){Ne(!0);try{a()}finally{Ne(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:vn,lastRenderedState:t},i}function Tc(t,i,a,f){return t.baseState=a,rs(t,Je,typeof f=="function"?f:vn)}function Cy(t,i,a,f,p){if(la(t))throw Error(l(485));if(t=i.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(E){y.listeners.push(E)}};J.T!==null?a(!0):y.isTransition=!1,f(y),a=i.pending,a===null?(y.next=i.pending=y,_c(i,y)):(y.next=a.next,i.pending=a.next=y)}}function _c(t,i){var a=i.action,f=i.payload,p=t.state;if(i.isTransition){var y=J.T,E={};J.T=E;try{var D=a(p,f),V=J.S;V!==null&&V(E,D),Cc(t,i,D)}catch(Q){fs(t,i,Q)}finally{J.T=y}}else try{y=a(p,f),Cc(t,i,y)}catch(Q){fs(t,i,Q)}}function Cc(t,i,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(f){Sc(t,i,f)},function(f){return fs(t,i,f)}):Sc(t,i,a)}function Sc(t,i,a){i.status="fulfilled",i.value=a,Ec(i),t.state=a,i=t.pending,i!==null&&(a=i.next,a===i?t.pending=null:(a=a.next,i.next=a,_c(t,a)))}function fs(t,i,a){var f=t.pending;if(t.pending=null,f!==null){f=f.next;do i.status="rejected",i.reason=a,Ec(i),i=i.next;while(i!==f)}t.action=null}function Ec(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Ac(t,i){return i}function xc(t,i){if(qe){var a=je.formState;if(a!==null){e:{var f=Le;if(qe){if(lt){t:{for(var p=lt,y=on;p.nodeType!==8;){if(!y){p=null;break t}if(p=tn(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y==="F!"||y==="F"?p:null}if(p){lt=tn(p.nextSibling),f=p.data==="F!";break e}}di(f)}f=!1}f&&(i=a[0])}}return a=Dt(),a.memoizedState=a.baseState=i,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ac,lastRenderedState:i},a.queue=f,a=Oc.bind(null,Le,f),f.dispatch=a,f=us(!1),y=ps.bind(null,Le,!1,f.queue),f=Dt(),p={state:i,dispatch:null,action:t,pending:null},f.queue=p,a=Cy.bind(null,Le,p,y,a),p.dispatch=a,f.memoizedState=t,[i,a,!1]}function Mc(t){var i=ft();return Rc(i,Je,t)}function Rc(t,i,a){if(i=rs(t,i,Ac)[0],t=na(vn)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var f=Jo(i)}catch(E){throw E===Ho?Ql:E}else f=i;i=ft();var p=i.queue,y=p.dispatch;return a!==i.memoizedState&&(Le.flags|=2048,$i(9,ia(),Sy.bind(null,p,a),null)),[f,y,t]}function Sy(t,i){t.action=i}function wc(t){var i=ft(),a=Je;if(a!==null)return Rc(i,a,t);ft(),i=i.memoizedState,a=ft();var f=a.queue.dispatch;return a.memoizedState=t,[i,f,!1]}function $i(t,i,a,f){return t={tag:t,create:a,deps:f,inst:i,next:null},i=Le.updateQueue,i===null&&(i=ls(),Le.updateQueue=i),a=i.lastEffect,a===null?i.lastEffect=t.next=t:(f=a.next,a.next=t,t.next=f,i.lastEffect=t),t}function ia(){return{destroy:void 0,resource:void 0}}function bc(){return ft().memoizedState}function oa(t,i,a,f){var p=Dt();f=f===void 0?null:f,Le.flags|=t,p.memoizedState=$i(1|i,ia(),a,f)}function Ko(t,i,a,f){var p=ft();f=f===void 0?null:f;var y=p.memoizedState.inst;Je!==null&&f!==null&&es(f,Je.memoizedState.deps)?p.memoizedState=$i(i,y,a,f):(Le.flags|=t,p.memoizedState=$i(1|i,y,a,f))}function Dc(t,i){oa(8390656,8,t,i)}function Nc(t,i){Ko(2048,8,t,i)}function Ic(t,i){return Ko(4,2,t,i)}function Uc(t,i){return Ko(4,4,t,i)}function kc(t,i){if(typeof i=="function"){t=t();var a=i(t);return function(){typeof a=="function"?a():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Lc(t,i,a){a=a!=null?a.concat([t]):null,Ko(4,4,kc.bind(null,i,t),a)}function cs(){}function Pc(t,i){var a=ft();i=i===void 0?null:i;var f=a.memoizedState;return i!==null&&es(i,f[1])?f[0]:(a.memoizedState=[t,i],t)}function zc(t,i){var a=ft();i=i===void 0?null:i;var f=a.memoizedState;if(i!==null&&es(i,f[1]))return f[0];if(f=t(),gi){Ne(!0);try{t()}finally{Ne(!1)}}return a.memoizedState=[f,i],f}function ds(t,i,a){return a===void 0||(Bn&1073741824)!==0?t.memoizedState=i:(t.memoizedState=a,t=Hd(),Le.lanes|=t,Yn|=t,a)}function Bc(t,i,a,f){return Ut(a,i)?a:Zi.current!==null?(t=ds(t,a,f),Ut(t,i)||(mt=!0),t):(Bn&42)===0?(mt=!0,t.memoizedState=a):(t=Hd(),Le.lanes|=t,Yn|=t,i)}function Vc(t,i,a,f,p){var y=K.p;K.p=y!==0&&8>y?y:8;var E=J.T,D={};J.T=D,ps(t,!1,i,a);try{var V=p(),Q=J.S;if(Q!==null&&Q(D,V),V!==null&&typeof V=="object"&&typeof V.then=="function"){var ue=vy(V,f);Zo(t,i,ue,Bt(t))}else Zo(t,i,f,Bt(t))}catch(me){Zo(t,i,{then:function(){},status:"rejected",reason:me},Bt())}finally{K.p=y,J.T=E}}function Ey(){}function hs(t,i,a,f){if(t.tag!==5)throw Error(l(476));var p=Hc(t).queue;Vc(t,p,i,ve,a===null?Ey:function(){return Gc(t),a(f)})}function Hc(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ve,baseState:ve,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vn,lastRenderedState:ve},next:null};var a={};return i.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:vn,lastRenderedState:a},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function Gc(t){var i=Hc(t).next.queue;Zo(t,i,{},Bt())}function ms(){return Ct(dl)}function qc(){return ft().memoizedState}function Fc(){return ft().memoizedState}function Ay(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var a=Bt();t=Pn(a);var f=zn(i,t,a);f!==null&&(Vt(f,i,a),qo(f,i,a)),i={cache:Or()},t.payload=i;return}i=i.return}}function xy(t,i,a){var f=Bt();a={lane:f,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null},la(t)?Yc(i,a):(a=kr(t,i,a,f),a!==null&&(Vt(a,t,f),Jc(a,i,f)))}function Oc(t,i,a){var f=Bt();Zo(t,i,a,f)}function Zo(t,i,a,f){var p={lane:f,revertLane:0,action:a,hasEagerState:!1,eagerState:null,next:null};if(la(t))Yc(i,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=i.lastRenderedReducer,y!==null))try{var E=i.lastRenderedState,D=y(E,a);if(p.hasEagerState=!0,p.eagerState=D,Ut(D,E))return ql(t,i,p,0),je===null&&Gl(),!1}catch{}finally{}if(a=kr(t,i,p,f),a!==null)return Vt(a,t,f),Jc(a,i,f),!0}return!1}function ps(t,i,a,f){if(f={lane:2,revertLane:Ks(),action:f,hasEagerState:!1,eagerState:null,next:null},la(t)){if(i)throw Error(l(479))}else i=kr(t,a,f,2),i!==null&&Vt(i,t,2)}function la(t){var i=t.alternate;return t===Le||i!==null&&i===Le}function Yc(t,i){Xi=jl=!0;var a=t.pending;a===null?i.next=i:(i.next=a.next,a.next=i),t.pending=i}function Jc(t,i,a){if((a&4194048)!==0){var f=i.lanes;f&=t.pendingLanes,a|=f,i.lanes=a,ju(t,a)}}var aa={readContext:Ct,use:ta,useCallback:rt,useContext:rt,useEffect:rt,useImperativeHandle:rt,useLayoutEffect:rt,useInsertionEffect:rt,useMemo:rt,useReducer:rt,useRef:rt,useState:rt,useDebugValue:rt,useDeferredValue:rt,useTransition:rt,useSyncExternalStore:rt,useId:rt,useHostTransitionStatus:rt,useFormState:rt,useActionState:rt,useOptimistic:rt,useMemoCache:rt,useCacheRefresh:rt},Kc={readContext:Ct,use:ta,useCallback:function(t,i){return Dt().memoizedState=[t,i===void 0?null:i],t},useContext:Ct,useEffect:Dc,useImperativeHandle:function(t,i,a){a=a!=null?a.concat([t]):null,oa(4194308,4,kc.bind(null,i,t),a)},useLayoutEffect:function(t,i){return oa(4194308,4,t,i)},useInsertionEffect:function(t,i){oa(4,2,t,i)},useMemo:function(t,i){var a=Dt();i=i===void 0?null:i;var f=t();if(gi){Ne(!0);try{t()}finally{Ne(!1)}}return a.memoizedState=[f,i],f},useReducer:function(t,i,a){var f=Dt();if(a!==void 0){var p=a(i);if(gi){Ne(!0);try{a(i)}finally{Ne(!1)}}}else p=i;return f.memoizedState=f.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},f.queue=t,t=t.dispatch=xy.bind(null,Le,t),[f.memoizedState,t]},useRef:function(t){var i=Dt();return t={current:t},i.memoizedState=t},useState:function(t){t=us(t);var i=t.queue,a=Oc.bind(null,Le,i);return i.dispatch=a,[t.memoizedState,a]},useDebugValue:cs,useDeferredValue:function(t,i){var a=Dt();return ds(a,t,i)},useTransition:function(){var t=us(!1);return t=Vc.bind(null,Le,t.queue,!0,!1),Dt().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,a){var f=Le,p=Dt();if(qe){if(a===void 0)throw Error(l(407));a=a()}else{if(a=i(),je===null)throw Error(l(349));(Ve&124)!==0||mc(f,i,a)}p.memoizedState=a;var y={value:a,getSnapshot:i};return p.queue=y,Dc(gc.bind(null,f,y,t),[t]),f.flags|=2048,$i(9,ia(),pc.bind(null,f,y,a,i),null),a},useId:function(){var t=Dt(),i=je.identifierPrefix;if(qe){var a=pn,f=mn;a=(f&~(1<<32-$e(f)-1)).toString(32)+a,i="«"+i+"R"+a,a=ea++,0<a&&(i+="H"+a.toString(32)),i+="»"}else a=Ty++,i="«"+i+"r"+a.toString(32)+"»";return t.memoizedState=i},useHostTransitionStatus:ms,useFormState:xc,useActionState:xc,useOptimistic:function(t){var i=Dt();i.memoizedState=i.baseState=t;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=a,i=ps.bind(null,Le,!0,a),a.dispatch=i,[t,i]},useMemoCache:as,useCacheRefresh:function(){return Dt().memoizedState=Ay.bind(null,Le)}},Zc={readContext:Ct,use:ta,useCallback:Pc,useContext:Ct,useEffect:Nc,useImperativeHandle:Lc,useInsertionEffect:Ic,useLayoutEffect:Uc,useMemo:zc,useReducer:na,useRef:bc,useState:function(){return na(vn)},useDebugValue:cs,useDeferredValue:function(t,i){var a=ft();return Bc(a,Je.memoizedState,t,i)},useTransition:function(){var t=na(vn)[0],i=ft().memoizedState;return[typeof t=="boolean"?t:Jo(t),i]},useSyncExternalStore:hc,useId:qc,useHostTransitionStatus:ms,useFormState:Mc,useActionState:Mc,useOptimistic:function(t,i){var a=ft();return Tc(a,Je,t,i)},useMemoCache:as,useCacheRefresh:Fc},My={readContext:Ct,use:ta,useCallback:Pc,useContext:Ct,useEffect:Nc,useImperativeHandle:Lc,useInsertionEffect:Ic,useLayoutEffect:Uc,useMemo:zc,useReducer:ss,useRef:bc,useState:function(){return ss(vn)},useDebugValue:cs,useDeferredValue:function(t,i){var a=ft();return Je===null?ds(a,t,i):Bc(a,Je.memoizedState,t,i)},useTransition:function(){var t=ss(vn)[0],i=ft().memoizedState;return[typeof t=="boolean"?t:Jo(t),i]},useSyncExternalStore:hc,useId:qc,useHostTransitionStatus:ms,useFormState:wc,useActionState:wc,useOptimistic:function(t,i){var a=ft();return Je!==null?Tc(a,Je,t,i):(a.baseState=t,[t,a.queue.dispatch])},useMemoCache:as,useCacheRefresh:Fc},Wi=null,Xo=0;function ra(t){var i=Xo;return Xo+=1,Wi===null&&(Wi=[]),lc(Wi,t,i)}function Qo(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function sa(t,i){throw i.$$typeof===T?Error(l(525)):(t=Object.prototype.toString.call(i),Error(l(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function Xc(t){var i=t._init;return i(t._payload)}function Qc(t){function i(O,G){if(t){var Z=O.deletions;Z===null?(O.deletions=[G],O.flags|=16):Z.push(G)}}function a(O,G){if(!t)return null;for(;G!==null;)i(O,G),G=G.sibling;return null}function f(O){for(var G=new Map;O!==null;)O.key!==null?G.set(O.key,O):G.set(O.index,O),O=O.sibling;return G}function p(O,G){return O=hn(O,G),O.index=0,O.sibling=null,O}function y(O,G,Z){return O.index=Z,t?(Z=O.alternate,Z!==null?(Z=Z.index,Z<G?(O.flags|=67108866,G):Z):(O.flags|=67108866,G)):(O.flags|=1048576,G)}function E(O){return t&&O.alternate===null&&(O.flags|=67108866),O}function D(O,G,Z,ce){return G===null||G.tag!==6?(G=Pr(Z,O.mode,ce),G.return=O,G):(G=p(G,Z),G.return=O,G)}function V(O,G,Z,ce){var Ee=Z.type;return Ee===M?ue(O,G,Z.props.children,ce,Z.key):G!==null&&(G.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===oe&&Xc(Ee)===G.type)?(G=p(G,Z.props),Qo(G,Z),G.return=O,G):(G=Ol(Z.type,Z.key,Z.props,null,O.mode,ce),Qo(G,Z),G.return=O,G)}function Q(O,G,Z,ce){return G===null||G.tag!==4||G.stateNode.containerInfo!==Z.containerInfo||G.stateNode.implementation!==Z.implementation?(G=zr(Z,O.mode,ce),G.return=O,G):(G=p(G,Z.children||[]),G.return=O,G)}function ue(O,G,Z,ce,Ee){return G===null||G.tag!==7?(G=si(Z,O.mode,ce,Ee),G.return=O,G):(G=p(G,Z),G.return=O,G)}function me(O,G,Z){if(typeof G=="string"&&G!==""||typeof G=="number"||typeof G=="bigint")return G=Pr(""+G,O.mode,Z),G.return=O,G;if(typeof G=="object"&&G!==null){switch(G.$$typeof){case _:return Z=Ol(G.type,G.key,G.props,null,O.mode,Z),Qo(Z,G),Z.return=O,Z;case C:return G=zr(G,O.mode,Z),G.return=O,G;case oe:var ce=G._init;return G=ce(G._payload),me(O,G,Z)}if(te(G)||B(G))return G=si(G,O.mode,Z,null),G.return=O,G;if(typeof G.then=="function")return me(O,ra(G),Z);if(G.$$typeof===N)return me(O,Zl(O,G),Z);sa(O,G)}return null}function j(O,G,Z,ce){var Ee=G!==null?G.key:null;if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return Ee!==null?null:D(O,G,""+Z,ce);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:return Z.key===Ee?V(O,G,Z,ce):null;case C:return Z.key===Ee?Q(O,G,Z,ce):null;case oe:return Ee=Z._init,Z=Ee(Z._payload),j(O,G,Z,ce)}if(te(Z)||B(Z))return Ee!==null?null:ue(O,G,Z,ce,null);if(typeof Z.then=="function")return j(O,G,ra(Z),ce);if(Z.$$typeof===N)return j(O,G,Zl(O,Z),ce);sa(O,Z)}return null}function ee(O,G,Z,ce,Ee){if(typeof ce=="string"&&ce!==""||typeof ce=="number"||typeof ce=="bigint")return O=O.get(Z)||null,D(G,O,""+ce,Ee);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case _:return O=O.get(ce.key===null?Z:ce.key)||null,V(G,O,ce,Ee);case C:return O=O.get(ce.key===null?Z:ce.key)||null,Q(G,O,ce,Ee);case oe:var Pe=ce._init;return ce=Pe(ce._payload),ee(O,G,Z,ce,Ee)}if(te(ce)||B(ce))return O=O.get(Z)||null,ue(G,O,ce,Ee,null);if(typeof ce.then=="function")return ee(O,G,Z,ra(ce),Ee);if(ce.$$typeof===N)return ee(O,G,Z,Zl(G,ce),Ee);sa(G,ce)}return null}function De(O,G,Z,ce){for(var Ee=null,Pe=null,Re=G,be=G=0,gt=null;Re!==null&&be<Z.length;be++){Re.index>be?(gt=Re,Re=null):gt=Re.sibling;var Ge=j(O,Re,Z[be],ce);if(Ge===null){Re===null&&(Re=gt);break}t&&Re&&Ge.alternate===null&&i(O,Re),G=y(Ge,G,be),Pe===null?Ee=Ge:Pe.sibling=Ge,Pe=Ge,Re=gt}if(be===Z.length)return a(O,Re),qe&&fi(O,be),Ee;if(Re===null){for(;be<Z.length;be++)Re=me(O,Z[be],ce),Re!==null&&(G=y(Re,G,be),Pe===null?Ee=Re:Pe.sibling=Re,Pe=Re);return qe&&fi(O,be),Ee}for(Re=f(Re);be<Z.length;be++)gt=ee(Re,O,be,Z[be],ce),gt!==null&&(t&&gt.alternate!==null&&Re.delete(gt.key===null?be:gt.key),G=y(gt,G,be),Pe===null?Ee=gt:Pe.sibling=gt,Pe=gt);return t&&Re.forEach(function(ei){return i(O,ei)}),qe&&fi(O,be),Ee}function we(O,G,Z,ce){if(Z==null)throw Error(l(151));for(var Ee=null,Pe=null,Re=G,be=G=0,gt=null,Ge=Z.next();Re!==null&&!Ge.done;be++,Ge=Z.next()){Re.index>be?(gt=Re,Re=null):gt=Re.sibling;var ei=j(O,Re,Ge.value,ce);if(ei===null){Re===null&&(Re=gt);break}t&&Re&&ei.alternate===null&&i(O,Re),G=y(ei,G,be),Pe===null?Ee=ei:Pe.sibling=ei,Pe=ei,Re=gt}if(Ge.done)return a(O,Re),qe&&fi(O,be),Ee;if(Re===null){for(;!Ge.done;be++,Ge=Z.next())Ge=me(O,Ge.value,ce),Ge!==null&&(G=y(Ge,G,be),Pe===null?Ee=Ge:Pe.sibling=Ge,Pe=Ge);return qe&&fi(O,be),Ee}for(Re=f(Re);!Ge.done;be++,Ge=Z.next())Ge=ee(Re,O,be,Ge.value,ce),Ge!==null&&(t&&Ge.alternate!==null&&Re.delete(Ge.key===null?be:Ge.key),G=y(Ge,G,be),Pe===null?Ee=Ge:Pe.sibling=Ge,Pe=Ge);return t&&Re.forEach(function(Rv){return i(O,Rv)}),qe&&fi(O,be),Ee}function Ze(O,G,Z,ce){if(typeof Z=="object"&&Z!==null&&Z.type===M&&Z.key===null&&(Z=Z.props.children),typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case _:e:{for(var Ee=Z.key;G!==null;){if(G.key===Ee){if(Ee=Z.type,Ee===M){if(G.tag===7){a(O,G.sibling),ce=p(G,Z.props.children),ce.return=O,O=ce;break e}}else if(G.elementType===Ee||typeof Ee=="object"&&Ee!==null&&Ee.$$typeof===oe&&Xc(Ee)===G.type){a(O,G.sibling),ce=p(G,Z.props),Qo(ce,Z),ce.return=O,O=ce;break e}a(O,G);break}else i(O,G);G=G.sibling}Z.type===M?(ce=si(Z.props.children,O.mode,ce,Z.key),ce.return=O,O=ce):(ce=Ol(Z.type,Z.key,Z.props,null,O.mode,ce),Qo(ce,Z),ce.return=O,O=ce)}return E(O);case C:e:{for(Ee=Z.key;G!==null;){if(G.key===Ee)if(G.tag===4&&G.stateNode.containerInfo===Z.containerInfo&&G.stateNode.implementation===Z.implementation){a(O,G.sibling),ce=p(G,Z.children||[]),ce.return=O,O=ce;break e}else{a(O,G);break}else i(O,G);G=G.sibling}ce=zr(Z,O.mode,ce),ce.return=O,O=ce}return E(O);case oe:return Ee=Z._init,Z=Ee(Z._payload),Ze(O,G,Z,ce)}if(te(Z))return De(O,G,Z,ce);if(B(Z)){if(Ee=B(Z),typeof Ee!="function")throw Error(l(150));return Z=Ee.call(Z),we(O,G,Z,ce)}if(typeof Z.then=="function")return Ze(O,G,ra(Z),ce);if(Z.$$typeof===N)return Ze(O,G,Zl(O,Z),ce);sa(O,Z)}return typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint"?(Z=""+Z,G!==null&&G.tag===6?(a(O,G.sibling),ce=p(G,Z),ce.return=O,O=ce):(a(O,G),ce=Pr(Z,O.mode,ce),ce.return=O,O=ce),E(O)):a(O,G)}return function(O,G,Z,ce){try{Xo=0;var Ee=Ze(O,G,Z,ce);return Wi=null,Ee}catch(Re){if(Re===Ho||Re===Ql)throw Re;var Pe=kt(29,Re,null,O.mode);return Pe.lanes=ce,Pe.return=O,Pe}finally{}}}var ji=Qc(!0),$c=Qc(!1),Kt=P(null),ln=null;function Vn(t){var i=t.alternate;ie(dt,dt.current&1),ie(Kt,t),ln===null&&(i===null||Zi.current!==null||i.memoizedState!==null)&&(ln=t)}function Wc(t){if(t.tag===22){if(ie(dt,dt.current),ie(Kt,t),ln===null){var i=t.alternate;i!==null&&i.memoizedState!==null&&(ln=t)}}else Hn()}function Hn(){ie(dt,dt.current),ie(Kt,Kt.current)}function Tn(t){H(Kt),ln===t&&(ln=null),H(dt)}var dt=P(0);function ua(t){for(var i=t;i!==null;){if(i.tag===13){var a=i.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||lu(a)))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}function gs(t,i,a,f){i=t.memoizedState,a=a(f,i),a=a==null?i:v({},i,a),t.memoizedState=a,t.lanes===0&&(t.updateQueue.baseState=a)}var ys={enqueueSetState:function(t,i,a){t=t._reactInternals;var f=Bt(),p=Pn(f);p.payload=i,a!=null&&(p.callback=a),i=zn(t,p,f),i!==null&&(Vt(i,t,f),qo(i,t,f))},enqueueReplaceState:function(t,i,a){t=t._reactInternals;var f=Bt(),p=Pn(f);p.tag=1,p.payload=i,a!=null&&(p.callback=a),i=zn(t,p,f),i!==null&&(Vt(i,t,f),qo(i,t,f))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var a=Bt(),f=Pn(a);f.tag=2,i!=null&&(f.callback=i),i=zn(t,f,a),i!==null&&(Vt(i,t,a),qo(i,t,a))}};function jc(t,i,a,f,p,y,E){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(f,y,E):i.prototype&&i.prototype.isPureReactComponent?!Io(a,f)||!Io(p,y):!0}function ed(t,i,a,f){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(a,f),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(a,f),i.state!==t&&ys.enqueueReplaceState(i,i.state,null)}function yi(t,i){var a=i;if("ref"in i){a={};for(var f in i)f!=="ref"&&(a[f]=i[f])}if(t=t.defaultProps){a===i&&(a=v({},a));for(var p in t)a[p]===void 0&&(a[p]=t[p])}return a}var fa=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)};function td(t){fa(t)}function nd(t){console.error(t)}function id(t){fa(t)}function ca(t,i){try{var a=t.onUncaughtError;a(i.value,{componentStack:i.stack})}catch(f){setTimeout(function(){throw f})}}function od(t,i,a){try{var f=t.onCaughtError;f(a.value,{componentStack:a.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function vs(t,i,a){return a=Pn(a),a.tag=3,a.payload={element:null},a.callback=function(){ca(t,i)},a}function ld(t){return t=Pn(t),t.tag=3,t}function ad(t,i,a,f){var p=a.type.getDerivedStateFromError;if(typeof p=="function"){var y=f.value;t.payload=function(){return p(y)},t.callback=function(){od(i,a,f)}}var E=a.stateNode;E!==null&&typeof E.componentDidCatch=="function"&&(t.callback=function(){od(i,a,f),typeof p!="function"&&(Jn===null?Jn=new Set([this]):Jn.add(this));var D=f.stack;this.componentDidCatch(f.value,{componentStack:D!==null?D:""})})}function Ry(t,i,a,f,p){if(a.flags|=32768,f!==null&&typeof f=="object"&&typeof f.then=="function"){if(i=a.alternate,i!==null&&zo(i,a,p,!0),a=Kt.current,a!==null){switch(a.tag){case 13:return ln===null?qs():a.alternate===null&&at===0&&(at=3),a.flags&=-257,a.flags|=65536,a.lanes=p,f===Kr?a.flags|=16384:(i=a.updateQueue,i===null?a.updateQueue=new Set([f]):i.add(f),Os(t,f,p)),!1;case 22:return a.flags|=65536,f===Kr?a.flags|=16384:(i=a.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([f])},a.updateQueue=i):(a=i.retryQueue,a===null?i.retryQueue=new Set([f]):a.add(f)),Os(t,f,p)),!1}throw Error(l(435,a.tag))}return Os(t,f,p),qs(),!1}if(qe)return i=Kt.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=p,f!==Hr&&(t=Error(l(422),{cause:f}),Po(Ft(t,a)))):(f!==Hr&&(i=Error(l(423),{cause:f}),Po(Ft(i,a))),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,f=Ft(f,a),p=vs(t.stateNode,f,p),Qr(t,p),at!==4&&(at=2)),!1;var y=Error(l(520),{cause:f});if(y=Ft(y,a),il===null?il=[y]:il.push(y),at!==4&&(at=2),i===null)return!0;f=Ft(f,a),a=i;do{switch(a.tag){case 3:return a.flags|=65536,t=p&-p,a.lanes|=t,t=vs(a.stateNode,f,t),Qr(a,t),!1;case 1:if(i=a.type,y=a.stateNode,(a.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(Jn===null||!Jn.has(y))))return a.flags|=65536,p&=-p,a.lanes|=p,p=ld(p),ad(p,t,a,f),Qr(a,p),!1}a=a.return}while(a!==null);return!1}var rd=Error(l(461)),mt=!1;function yt(t,i,a,f){i.child=t===null?$c(i,null,a,f):ji(i,t.child,a,f)}function sd(t,i,a,f,p){a=a.render;var y=i.ref;if("ref"in f){var E={};for(var D in f)D!=="ref"&&(E[D]=f[D])}else E=f;return mi(i),f=ts(t,i,a,E,y,p),D=ns(),t!==null&&!mt?(is(t,i,p),_n(t,i,p)):(qe&&D&&Br(i),i.flags|=1,yt(t,i,f,p),i.child)}function ud(t,i,a,f,p){if(t===null){var y=a.type;return typeof y=="function"&&!Lr(y)&&y.defaultProps===void 0&&a.compare===null?(i.tag=15,i.type=y,fd(t,i,y,f,p)):(t=Ol(a.type,null,f,i,i.mode,p),t.ref=i.ref,t.return=i,i.child=t)}if(y=t.child,!Ms(t,p)){var E=y.memoizedProps;if(a=a.compare,a=a!==null?a:Io,a(E,f)&&t.ref===i.ref)return _n(t,i,p)}return i.flags|=1,t=hn(y,f),t.ref=i.ref,t.return=i,i.child=t}function fd(t,i,a,f,p){if(t!==null){var y=t.memoizedProps;if(Io(y,f)&&t.ref===i.ref)if(mt=!1,i.pendingProps=f=y,Ms(t,p))(t.flags&131072)!==0&&(mt=!0);else return i.lanes=t.lanes,_n(t,i,p)}return Ts(t,i,a,f,p)}function cd(t,i,a){var f=i.pendingProps,p=f.children,y=t!==null?t.memoizedState:null;if(f.mode==="hidden"){if((i.flags&128)!==0){if(f=y!==null?y.baseLanes|a:a,t!==null){for(p=i.child=t.child,y=0;p!==null;)y=y|p.lanes|p.childLanes,p=p.sibling;i.childLanes=y&~f}else i.childLanes=0,i.child=null;return dd(t,i,f,a)}if((a&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&Xl(i,y!==null?y.cachePool:null),y!==null?fc(i,y):Wr(),Wc(i);else return i.lanes=i.childLanes=536870912,dd(t,i,y!==null?y.baseLanes|a:a,a)}else y!==null?(Xl(i,y.cachePool),fc(i,y),Hn(),i.memoizedState=null):(t!==null&&Xl(i,null),Wr(),Hn());return yt(t,i,p,a),i.child}function dd(t,i,a,f){var p=Jr();return p=p===null?null:{parent:ct._currentValue,pool:p},i.memoizedState={baseLanes:a,cachePool:p},t!==null&&Xl(i,null),Wr(),Wc(i),t!==null&&zo(t,i,f,!0),null}function da(t,i){var a=i.ref;if(a===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(l(284));(t===null||t.ref!==a)&&(i.flags|=4194816)}}function Ts(t,i,a,f,p){return mi(i),a=ts(t,i,a,f,void 0,p),f=ns(),t!==null&&!mt?(is(t,i,p),_n(t,i,p)):(qe&&f&&Br(i),i.flags|=1,yt(t,i,a,p),i.child)}function hd(t,i,a,f,p,y){return mi(i),i.updateQueue=null,a=dc(i,f,a,p),cc(t),f=ns(),t!==null&&!mt?(is(t,i,y),_n(t,i,y)):(qe&&f&&Br(i),i.flags|=1,yt(t,i,a,y),i.child)}function md(t,i,a,f,p){if(mi(i),i.stateNode===null){var y=Fi,E=a.contextType;typeof E=="object"&&E!==null&&(y=Ct(E)),y=new a(f,y),i.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=ys,i.stateNode=y,y._reactInternals=i,y=i.stateNode,y.props=f,y.state=i.memoizedState,y.refs={},Zr(i),E=a.contextType,y.context=typeof E=="object"&&E!==null?Ct(E):Fi,y.state=i.memoizedState,E=a.getDerivedStateFromProps,typeof E=="function"&&(gs(i,a,E,f),y.state=i.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(E=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),E!==y.state&&ys.enqueueReplaceState(y,y.state,null),Oo(i,f,y,p),Fo(),y.state=i.memoizedState),typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!0}else if(t===null){y=i.stateNode;var D=i.memoizedProps,V=yi(a,D);y.props=V;var Q=y.context,ue=a.contextType;E=Fi,typeof ue=="object"&&ue!==null&&(E=Ct(ue));var me=a.getDerivedStateFromProps;ue=typeof me=="function"||typeof y.getSnapshotBeforeUpdate=="function",D=i.pendingProps!==D,ue||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(D||Q!==E)&&ed(i,y,f,E),Ln=!1;var j=i.memoizedState;y.state=j,Oo(i,f,y,p),Fo(),Q=i.memoizedState,D||j!==Q||Ln?(typeof me=="function"&&(gs(i,a,me,f),Q=i.memoizedState),(V=Ln||jc(i,a,V,f,j,Q,E))?(ue||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(i.flags|=4194308)):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=f,i.memoizedState=Q),y.props=f,y.state=Q,y.context=E,f=V):(typeof y.componentDidMount=="function"&&(i.flags|=4194308),f=!1)}else{y=i.stateNode,Xr(t,i),E=i.memoizedProps,ue=yi(a,E),y.props=ue,me=i.pendingProps,j=y.context,Q=a.contextType,V=Fi,typeof Q=="object"&&Q!==null&&(V=Ct(Q)),D=a.getDerivedStateFromProps,(Q=typeof D=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(E!==me||j!==V)&&ed(i,y,f,V),Ln=!1,j=i.memoizedState,y.state=j,Oo(i,f,y,p),Fo();var ee=i.memoizedState;E!==me||j!==ee||Ln||t!==null&&t.dependencies!==null&&Kl(t.dependencies)?(typeof D=="function"&&(gs(i,a,D,f),ee=i.memoizedState),(ue=Ln||jc(i,a,ue,f,j,ee,V)||t!==null&&t.dependencies!==null&&Kl(t.dependencies))?(Q||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,ee,V),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,ee,V)),typeof y.componentDidUpdate=="function"&&(i.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof y.componentDidUpdate!="function"||E===t.memoizedProps&&j===t.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&j===t.memoizedState||(i.flags|=1024),i.memoizedProps=f,i.memoizedState=ee),y.props=f,y.state=ee,y.context=V,f=ue):(typeof y.componentDidUpdate!="function"||E===t.memoizedProps&&j===t.memoizedState||(i.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||E===t.memoizedProps&&j===t.memoizedState||(i.flags|=1024),f=!1)}return y=f,da(t,i),f=(i.flags&128)!==0,y||f?(y=i.stateNode,a=f&&typeof a.getDerivedStateFromError!="function"?null:y.render(),i.flags|=1,t!==null&&f?(i.child=ji(i,t.child,null,p),i.child=ji(i,null,a,p)):yt(t,i,a,p),i.memoizedState=y.state,t=i.child):t=_n(t,i,p),t}function pd(t,i,a,f){return Lo(),i.flags|=256,yt(t,i,a,f),i.child}var _s={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cs(t){return{baseLanes:t,cachePool:nc()}}function Ss(t,i,a){return t=t!==null?t.childLanes&~a:0,i&&(t|=Zt),t}function gd(t,i,a){var f=i.pendingProps,p=!1,y=(i.flags&128)!==0,E;if((E=y)||(E=t!==null&&t.memoizedState===null?!1:(dt.current&2)!==0),E&&(p=!0,i.flags&=-129),E=(i.flags&32)!==0,i.flags&=-33,t===null){if(qe){if(p?Vn(i):Hn(),qe){var D=lt,V;if(V=D){e:{for(V=D,D=on;V.nodeType!==8;){if(!D){D=null;break e}if(V=tn(V.nextSibling),V===null){D=null;break e}}D=V}D!==null?(i.memoizedState={dehydrated:D,treeContext:ui!==null?{id:mn,overflow:pn}:null,retryLane:536870912,hydrationErrors:null},V=kt(18,null,null,0),V.stateNode=D,V.return=i,i.child=V,xt=i,lt=null,V=!0):V=!1}V||di(i)}if(D=i.memoizedState,D!==null&&(D=D.dehydrated,D!==null))return lu(D)?i.lanes=32:i.lanes=536870912,null;Tn(i)}return D=f.children,f=f.fallback,p?(Hn(),p=i.mode,D=ha({mode:"hidden",children:D},p),f=si(f,p,a,null),D.return=i,f.return=i,D.sibling=f,i.child=D,p=i.child,p.memoizedState=Cs(a),p.childLanes=Ss(t,E,a),i.memoizedState=_s,f):(Vn(i),Es(i,D))}if(V=t.memoizedState,V!==null&&(D=V.dehydrated,D!==null)){if(y)i.flags&256?(Vn(i),i.flags&=-257,i=As(t,i,a)):i.memoizedState!==null?(Hn(),i.child=t.child,i.flags|=128,i=null):(Hn(),p=f.fallback,D=i.mode,f=ha({mode:"visible",children:f.children},D),p=si(p,D,a,null),p.flags|=2,f.return=i,p.return=i,f.sibling=p,i.child=f,ji(i,t.child,null,a),f=i.child,f.memoizedState=Cs(a),f.childLanes=Ss(t,E,a),i.memoizedState=_s,i=p);else if(Vn(i),lu(D)){if(E=D.nextSibling&&D.nextSibling.dataset,E)var Q=E.dgst;E=Q,f=Error(l(419)),f.stack="",f.digest=E,Po({value:f,source:null,stack:null}),i=As(t,i,a)}else if(mt||zo(t,i,a,!1),E=(a&t.childLanes)!==0,mt||E){if(E=je,E!==null&&(f=a&-a,f=(f&42)!==0?1:ar(f),f=(f&(E.suspendedLanes|a))!==0?0:f,f!==0&&f!==V.retryLane))throw V.retryLane=f,qi(t,f),Vt(E,t,f),rd;D.data==="$?"||qs(),i=As(t,i,a)}else D.data==="$?"?(i.flags|=192,i.child=t.child,i=null):(t=V.treeContext,lt=tn(D.nextSibling),xt=i,qe=!0,ci=null,on=!1,t!==null&&(Yt[Jt++]=mn,Yt[Jt++]=pn,Yt[Jt++]=ui,mn=t.id,pn=t.overflow,ui=i),i=Es(i,f.children),i.flags|=4096);return i}return p?(Hn(),p=f.fallback,D=i.mode,V=t.child,Q=V.sibling,f=hn(V,{mode:"hidden",children:f.children}),f.subtreeFlags=V.subtreeFlags&65011712,Q!==null?p=hn(Q,p):(p=si(p,D,a,null),p.flags|=2),p.return=i,f.return=i,f.sibling=p,i.child=f,f=p,p=i.child,D=t.child.memoizedState,D===null?D=Cs(a):(V=D.cachePool,V!==null?(Q=ct._currentValue,V=V.parent!==Q?{parent:Q,pool:Q}:V):V=nc(),D={baseLanes:D.baseLanes|a,cachePool:V}),p.memoizedState=D,p.childLanes=Ss(t,E,a),i.memoizedState=_s,f):(Vn(i),a=t.child,t=a.sibling,a=hn(a,{mode:"visible",children:f.children}),a.return=i,a.sibling=null,t!==null&&(E=i.deletions,E===null?(i.deletions=[t],i.flags|=16):E.push(t)),i.child=a,i.memoizedState=null,a)}function Es(t,i){return i=ha({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function ha(t,i){return t=kt(22,t,null,i),t.lanes=0,t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null},t}function As(t,i,a){return ji(i,t.child,null,a),t=Es(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function yd(t,i,a){t.lanes|=i;var f=t.alternate;f!==null&&(f.lanes|=i),qr(t.return,i,a)}function xs(t,i,a,f,p){var y=t.memoizedState;y===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:f,tail:a,tailMode:p}:(y.isBackwards=i,y.rendering=null,y.renderingStartTime=0,y.last=f,y.tail=a,y.tailMode=p)}function vd(t,i,a){var f=i.pendingProps,p=f.revealOrder,y=f.tail;if(yt(t,i,f.children,a),f=dt.current,(f&2)!==0)f=f&1|2,i.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&yd(t,a,i);else if(t.tag===19)yd(t,a,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}f&=1}switch(ie(dt,f),p){case"forwards":for(a=i.child,p=null;a!==null;)t=a.alternate,t!==null&&ua(t)===null&&(p=a),a=a.sibling;a=p,a===null?(p=i.child,i.child=null):(p=a.sibling,a.sibling=null),xs(i,!1,p,a,y);break;case"backwards":for(a=null,p=i.child,i.child=null;p!==null;){if(t=p.alternate,t!==null&&ua(t)===null){i.child=p;break}t=p.sibling,p.sibling=a,a=p,p=t}xs(i,!0,a,null,y);break;case"together":xs(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function _n(t,i,a){if(t!==null&&(i.dependencies=t.dependencies),Yn|=i.lanes,(a&i.childLanes)===0)if(t!==null){if(zo(t,i,a,!1),(a&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(l(153));if(i.child!==null){for(t=i.child,a=hn(t,t.pendingProps),i.child=a,a.return=i;t.sibling!==null;)t=t.sibling,a=a.sibling=hn(t,t.pendingProps),a.return=i;a.sibling=null}return i.child}function Ms(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&Kl(t)))}function wy(t,i,a){switch(i.tag){case 3:Ae(i,i.stateNode.containerInfo),kn(i,ct,t.memoizedState.cache),Lo();break;case 27:case 5:tt(i);break;case 4:Ae(i,i.stateNode.containerInfo);break;case 10:kn(i,i.type,i.memoizedProps.value);break;case 13:var f=i.memoizedState;if(f!==null)return f.dehydrated!==null?(Vn(i),i.flags|=128,null):(a&i.child.childLanes)!==0?gd(t,i,a):(Vn(i),t=_n(t,i,a),t!==null?t.sibling:null);Vn(i);break;case 19:var p=(t.flags&128)!==0;if(f=(a&i.childLanes)!==0,f||(zo(t,i,a,!1),f=(a&i.childLanes)!==0),p){if(f)return vd(t,i,a);i.flags|=128}if(p=i.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),ie(dt,dt.current),f)break;return null;case 22:case 23:return i.lanes=0,cd(t,i,a);case 24:kn(i,ct,t.memoizedState.cache)}return _n(t,i,a)}function Td(t,i,a){if(t!==null)if(t.memoizedProps!==i.pendingProps)mt=!0;else{if(!Ms(t,a)&&(i.flags&128)===0)return mt=!1,wy(t,i,a);mt=(t.flags&131072)!==0}else mt=!1,qe&&(i.flags&1048576)!==0&&Xf(i,Jl,i.index);switch(i.lanes=0,i.tag){case 16:e:{t=i.pendingProps;var f=i.elementType,p=f._init;if(f=p(f._payload),i.type=f,typeof f=="function")Lr(f)?(t=yi(f,t),i.tag=1,i=md(null,i,f,t,a)):(i.tag=0,i=Ts(null,i,f,t,a));else{if(f!=null){if(p=f.$$typeof,p===z){i.tag=11,i=sd(null,i,f,t,a);break e}else if(p===Y){i.tag=14,i=ud(null,i,f,t,a);break e}}throw i=w(f)||f,Error(l(306,i,""))}}return i;case 0:return Ts(t,i,i.type,i.pendingProps,a);case 1:return f=i.type,p=yi(f,i.pendingProps),md(t,i,f,p,a);case 3:e:{if(Ae(i,i.stateNode.containerInfo),t===null)throw Error(l(387));f=i.pendingProps;var y=i.memoizedState;p=y.element,Xr(t,i),Oo(i,f,null,a);var E=i.memoizedState;if(f=E.cache,kn(i,ct,f),f!==y.cache&&Fr(i,[ct],a,!0),Fo(),f=E.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:E.cache},i.updateQueue.baseState=y,i.memoizedState=y,i.flags&256){i=pd(t,i,f,a);break e}else if(f!==p){p=Ft(Error(l(424)),i),Po(p),i=pd(t,i,f,a);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(lt=tn(t.firstChild),xt=i,qe=!0,ci=null,on=!0,a=$c(i,null,f,a),i.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling}else{if(Lo(),f===p){i=_n(t,i,a);break e}yt(t,i,f,a)}i=i.child}return i;case 26:return da(t,i),t===null?(a=Eh(i.type,null,i.pendingProps,null))?i.memoizedState=a:qe||(a=i.type,t=i.pendingProps,f=Ra(Ce.current).createElement(a),f[_t]=i,f[wt]=t,Tt(f,a,t),ht(f),i.stateNode=f):i.memoizedState=Eh(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return tt(i),t===null&&qe&&(f=i.stateNode=_h(i.type,i.pendingProps,Ce.current),xt=i,on=!0,p=lt,Xn(i.type)?(au=p,lt=tn(f.firstChild)):lt=p),yt(t,i,i.pendingProps.children,a),da(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&qe&&((p=f=lt)&&(f=nv(f,i.type,i.pendingProps,on),f!==null?(i.stateNode=f,xt=i,lt=tn(f.firstChild),on=!1,p=!0):p=!1),p||di(i)),tt(i),p=i.type,y=i.pendingProps,E=t!==null?t.memoizedProps:null,f=y.children,nu(p,y)?f=null:E!==null&&nu(p,E)&&(i.flags|=32),i.memoizedState!==null&&(p=ts(t,i,_y,null,null,a),dl._currentValue=p),da(t,i),yt(t,i,f,a),i.child;case 6:return t===null&&qe&&((t=a=lt)&&(a=iv(a,i.pendingProps,on),a!==null?(i.stateNode=a,xt=i,lt=null,t=!0):t=!1),t||di(i)),null;case 13:return gd(t,i,a);case 4:return Ae(i,i.stateNode.containerInfo),f=i.pendingProps,t===null?i.child=ji(i,null,f,a):yt(t,i,f,a),i.child;case 11:return sd(t,i,i.type,i.pendingProps,a);case 7:return yt(t,i,i.pendingProps,a),i.child;case 8:return yt(t,i,i.pendingProps.children,a),i.child;case 12:return yt(t,i,i.pendingProps.children,a),i.child;case 10:return f=i.pendingProps,kn(i,i.type,f.value),yt(t,i,f.children,a),i.child;case 9:return p=i.type._context,f=i.pendingProps.children,mi(i),p=Ct(p),f=f(p),i.flags|=1,yt(t,i,f,a),i.child;case 14:return ud(t,i,i.type,i.pendingProps,a);case 15:return fd(t,i,i.type,i.pendingProps,a);case 19:return vd(t,i,a);case 31:return f=i.pendingProps,a=i.mode,f={mode:f.mode,children:f.children},t===null?(a=ha(f,a),a.ref=i.ref,i.child=a,a.return=i,i=a):(a=hn(t.child,f),a.ref=i.ref,i.child=a,a.return=i,i=a),i;case 22:return cd(t,i,a);case 24:return mi(i),f=Ct(ct),t===null?(p=Jr(),p===null&&(p=je,y=Or(),p.pooledCache=y,y.refCount++,y!==null&&(p.pooledCacheLanes|=a),p=y),i.memoizedState={parent:f,cache:p},Zr(i),kn(i,ct,p)):((t.lanes&a)!==0&&(Xr(t,i),Oo(i,null,null,a),Fo()),p=t.memoizedState,y=i.memoizedState,p.parent!==f?(p={parent:f,cache:f},i.memoizedState=p,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=p),kn(i,ct,f)):(f=y.cache,kn(i,ct,f),f!==p.cache&&Fr(i,[ct],a,!0))),yt(t,i,i.pendingProps.children,a),i.child;case 29:throw i.pendingProps}throw Error(l(156,i.tag))}function Cn(t){t.flags|=4}function _d(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!wh(i)){if(i=Kt.current,i!==null&&((Ve&4194048)===Ve?ln!==null:(Ve&62914560)!==Ve&&(Ve&536870912)===0||i!==ln))throw Go=Kr,ic;t.flags|=8192}}function ma(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?bl():536870912,t.lanes|=i,io|=i)}function $o(t,i){if(!qe)switch(t.tailMode){case"hidden":i=t.tail;for(var a=null;i!==null;)i.alternate!==null&&(a=i),i=i.sibling;a===null?t.tail=null:a.sibling=null;break;case"collapsed":a=t.tail;for(var f=null;a!==null;)a.alternate!==null&&(f=a),a=a.sibling;f===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:f.sibling=null}}function it(t){var i=t.alternate!==null&&t.alternate.child===t.child,a=0,f=0;if(i)for(var p=t.child;p!==null;)a|=p.lanes|p.childLanes,f|=p.subtreeFlags&65011712,f|=p.flags&65011712,p.return=t,p=p.sibling;else for(p=t.child;p!==null;)a|=p.lanes|p.childLanes,f|=p.subtreeFlags,f|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=f,t.childLanes=a,i}function by(t,i,a){var f=i.pendingProps;switch(Vr(i),i.tag){case 31:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return it(i),null;case 1:return it(i),null;case 3:return a=i.stateNode,f=null,t!==null&&(f=t.memoizedState.cache),i.memoizedState.cache!==f&&(i.flags|=2048),yn(ct),Ie(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(t===null||t.child===null)&&(ko(i)?Cn(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Wf())),it(i),null;case 26:return a=i.memoizedState,t===null?(Cn(i),a!==null?(it(i),_d(i,a)):(it(i),i.flags&=-16777217)):a?a!==t.memoizedState?(Cn(i),it(i),_d(i,a)):(it(i),i.flags&=-16777217):(t.memoizedProps!==f&&Cn(i),it(i),i.flags&=-16777217),null;case 27:Qe(i),a=Ce.current;var p=i.type;if(t!==null&&i.stateNode!=null)t.memoizedProps!==f&&Cn(i);else{if(!f){if(i.stateNode===null)throw Error(l(166));return it(i),null}t=se.current,ko(i)?Qf(i):(t=_h(p,f,a),i.stateNode=t,Cn(i))}return it(i),null;case 5:if(Qe(i),a=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==f&&Cn(i);else{if(!f){if(i.stateNode===null)throw Error(l(166));return it(i),null}if(t=se.current,ko(i))Qf(i);else{switch(p=Ra(Ce.current),t){case 1:t=p.createElementNS("http://www.w3.org/2000/svg",a);break;case 2:t=p.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;default:switch(a){case"svg":t=p.createElementNS("http://www.w3.org/2000/svg",a);break;case"math":t=p.createElementNS("http://www.w3.org/1998/Math/MathML",a);break;case"script":t=p.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild);break;case"select":t=typeof f.is=="string"?p.createElement("select",{is:f.is}):p.createElement("select"),f.multiple?t.multiple=!0:f.size&&(t.size=f.size);break;default:t=typeof f.is=="string"?p.createElement(a,{is:f.is}):p.createElement(a)}}t[_t]=i,t[wt]=f;e:for(p=i.child;p!==null;){if(p.tag===5||p.tag===6)t.appendChild(p.stateNode);else if(p.tag!==4&&p.tag!==27&&p.child!==null){p.child.return=p,p=p.child;continue}if(p===i)break e;for(;p.sibling===null;){if(p.return===null||p.return===i)break e;p=p.return}p.sibling.return=p.return,p=p.sibling}i.stateNode=t;e:switch(Tt(t,a,f),a){case"button":case"input":case"select":case"textarea":t=!!f.autoFocus;break e;case"img":t=!0;break e;default:t=!1}t&&Cn(i)}}return it(i),i.flags&=-16777217,null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==f&&Cn(i);else{if(typeof f!="string"&&i.stateNode===null)throw Error(l(166));if(t=Ce.current,ko(i)){if(t=i.stateNode,a=i.memoizedProps,f=null,p=xt,p!==null)switch(p.tag){case 27:case 5:f=p.memoizedProps}t[_t]=i,t=!!(t.nodeValue===a||f!==null&&f.suppressHydrationWarning===!0||hh(t.nodeValue,a)),t||di(i)}else t=Ra(t).createTextNode(f),t[_t]=i,i.stateNode=t}return it(i),null;case 13:if(f=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=ko(i),f!==null&&f.dehydrated!==null){if(t===null){if(!p)throw Error(l(318));if(p=i.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(l(317));p[_t]=i}else Lo(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;it(i),p=!1}else p=Wf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return i.flags&256?(Tn(i),i):(Tn(i),null)}if(Tn(i),(i.flags&128)!==0)return i.lanes=a,i;if(a=f!==null,t=t!==null&&t.memoizedState!==null,a){f=i.child,p=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(p=f.alternate.memoizedState.cachePool.pool);var y=null;f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==p&&(f.flags|=2048)}return a!==t&&a&&(i.child.flags|=8192),ma(i,i.updateQueue),it(i),null;case 4:return Ie(),t===null&&$s(i.stateNode.containerInfo),it(i),null;case 10:return yn(i.type),it(i),null;case 19:if(H(dt),p=i.memoizedState,p===null)return it(i),null;if(f=(i.flags&128)!==0,y=p.rendering,y===null)if(f)$o(p,!1);else{if(at!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(y=ua(t),y!==null){for(i.flags|=128,$o(p,!1),t=y.updateQueue,i.updateQueue=t,ma(i,t),i.subtreeFlags=0,t=a,a=i.child;a!==null;)Zf(a,t),a=a.sibling;return ie(dt,dt.current&1|2),i.child}t=t.sibling}p.tail!==null&&L()>ya&&(i.flags|=128,f=!0,$o(p,!1),i.lanes=4194304)}else{if(!f)if(t=ua(y),t!==null){if(i.flags|=128,f=!0,t=t.updateQueue,i.updateQueue=t,ma(i,t),$o(p,!0),p.tail===null&&p.tailMode==="hidden"&&!y.alternate&&!qe)return it(i),null}else 2*L()-p.renderingStartTime>ya&&a!==536870912&&(i.flags|=128,f=!0,$o(p,!1),i.lanes=4194304);p.isBackwards?(y.sibling=i.child,i.child=y):(t=p.last,t!==null?t.sibling=y:i.child=y,p.last=y)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=L(),i.sibling=null,t=dt.current,ie(dt,f?t&1|2:t&1),i):(it(i),null);case 22:case 23:return Tn(i),jr(),f=i.memoizedState!==null,t!==null?t.memoizedState!==null!==f&&(i.flags|=8192):f&&(i.flags|=8192),f?(a&536870912)!==0&&(i.flags&128)===0&&(it(i),i.subtreeFlags&6&&(i.flags|=8192)):it(i),a=i.updateQueue,a!==null&&ma(i,a.retryQueue),a=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),f=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(f=i.memoizedState.cachePool.pool),f!==a&&(i.flags|=2048),t!==null&&H(pi),null;case 24:return a=null,t!==null&&(a=t.memoizedState.cache),i.memoizedState.cache!==a&&(i.flags|=2048),yn(ct),it(i),null;case 25:return null;case 30:return null}throw Error(l(156,i.tag))}function Dy(t,i){switch(Vr(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return yn(ct),Ie(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Qe(i),null;case 13:if(Tn(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(l(340));Lo()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return H(dt),null;case 4:return Ie(),null;case 10:return yn(i.type),null;case 22:case 23:return Tn(i),jr(),t!==null&&H(pi),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return yn(ct),null;case 25:return null;default:return null}}function Cd(t,i){switch(Vr(i),i.tag){case 3:yn(ct),Ie();break;case 26:case 27:case 5:Qe(i);break;case 4:Ie();break;case 13:Tn(i);break;case 19:H(dt);break;case 10:yn(i.type);break;case 22:case 23:Tn(i),jr(),t!==null&&H(pi);break;case 24:yn(ct)}}function Wo(t,i){try{var a=i.updateQueue,f=a!==null?a.lastEffect:null;if(f!==null){var p=f.next;a=p;do{if((a.tag&t)===t){f=void 0;var y=a.create,E=a.inst;f=y(),E.destroy=f}a=a.next}while(a!==p)}}catch(D){Xe(i,i.return,D)}}function Gn(t,i,a){try{var f=i.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var y=p.next;f=y;do{if((f.tag&t)===t){var E=f.inst,D=E.destroy;if(D!==void 0){E.destroy=void 0,p=i;var V=a,Q=D;try{Q()}catch(ue){Xe(p,V,ue)}}}f=f.next}while(f!==y)}}catch(ue){Xe(i,i.return,ue)}}function Sd(t){var i=t.updateQueue;if(i!==null){var a=t.stateNode;try{uc(i,a)}catch(f){Xe(t,t.return,f)}}}function Ed(t,i,a){a.props=yi(t.type,t.memoizedProps),a.state=t.memoizedState;try{a.componentWillUnmount()}catch(f){Xe(t,i,f)}}function jo(t,i){try{var a=t.ref;if(a!==null){switch(t.tag){case 26:case 27:case 5:var f=t.stateNode;break;case 30:f=t.stateNode;break;default:f=t.stateNode}typeof a=="function"?t.refCleanup=a(f):a.current=f}}catch(p){Xe(t,i,p)}}function an(t,i){var a=t.ref,f=t.refCleanup;if(a!==null)if(typeof f=="function")try{f()}catch(p){Xe(t,i,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(p){Xe(t,i,p)}else a.current=null}function Ad(t){var i=t.type,a=t.memoizedProps,f=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":a.autoFocus&&f.focus();break e;case"img":a.src?f.src=a.src:a.srcSet&&(f.srcset=a.srcSet)}}catch(p){Xe(t,t.return,p)}}function Rs(t,i,a){try{var f=t.stateNode;$y(f,t.type,a,i),f[wt]=i}catch(p){Xe(t,t.return,p)}}function xd(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&Xn(t.type)||t.tag===4}function ws(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||xd(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&Xn(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function bs(t,i,a){var f=t.tag;if(f===5||f===6)t=t.stateNode,i?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(t,i):(i=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,i.appendChild(t),a=a._reactRootContainer,a!=null||i.onclick!==null||(i.onclick=Ma));else if(f!==4&&(f===27&&Xn(t.type)&&(a=t.stateNode,i=null),t=t.child,t!==null))for(bs(t,i,a),t=t.sibling;t!==null;)bs(t,i,a),t=t.sibling}function pa(t,i,a){var f=t.tag;if(f===5||f===6)t=t.stateNode,i?a.insertBefore(t,i):a.appendChild(t);else if(f!==4&&(f===27&&Xn(t.type)&&(a=t.stateNode),t=t.child,t!==null))for(pa(t,i,a),t=t.sibling;t!==null;)pa(t,i,a),t=t.sibling}function Md(t){var i=t.stateNode,a=t.memoizedProps;try{for(var f=t.type,p=i.attributes;p.length;)i.removeAttributeNode(p[0]);Tt(i,f,a),i[_t]=t,i[wt]=a}catch(y){Xe(t,t.return,y)}}var Sn=!1,st=!1,Ds=!1,Rd=typeof WeakSet=="function"?WeakSet:Set,pt=null;function Ny(t,i){if(t=t.containerInfo,eu=Ua,t=Bf(t),wr(t)){if("selectionStart"in t)var a={start:t.selectionStart,end:t.selectionEnd};else e:{a=(a=t.ownerDocument)&&a.defaultView||window;var f=a.getSelection&&a.getSelection();if(f&&f.rangeCount!==0){a=f.anchorNode;var p=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{a.nodeType,y.nodeType}catch{a=null;break e}var E=0,D=-1,V=-1,Q=0,ue=0,me=t,j=null;t:for(;;){for(var ee;me!==a||p!==0&&me.nodeType!==3||(D=E+p),me!==y||f!==0&&me.nodeType!==3||(V=E+f),me.nodeType===3&&(E+=me.nodeValue.length),(ee=me.firstChild)!==null;)j=me,me=ee;for(;;){if(me===t)break t;if(j===a&&++Q===p&&(D=E),j===y&&++ue===f&&(V=E),(ee=me.nextSibling)!==null)break;me=j,j=me.parentNode}me=ee}a=D===-1||V===-1?null:{start:D,end:V}}else a=null}a=a||{start:0,end:0}}else a=null;for(tu={focusedElem:t,selectionRange:a},Ua=!1,pt=i;pt!==null;)if(i=pt,t=i.child,(i.subtreeFlags&1024)!==0&&t!==null)t.return=i,pt=t;else for(;pt!==null;){switch(i=pt,y=i.alternate,t=i.flags,i.tag){case 0:break;case 11:case 15:break;case 1:if((t&1024)!==0&&y!==null){t=void 0,a=i,p=y.memoizedProps,y=y.memoizedState,f=a.stateNode;try{var De=yi(a.type,p,a.elementType===a.type);t=f.getSnapshotBeforeUpdate(De,y),f.__reactInternalSnapshotBeforeUpdate=t}catch(we){Xe(a,a.return,we)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,a=t.nodeType,a===9)ou(t);else if(a===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ou(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(l(163))}if(t=i.sibling,t!==null){t.return=i.return,pt=t;break}pt=i.return}}function wd(t,i,a){var f=a.flags;switch(a.tag){case 0:case 11:case 15:qn(t,a),f&4&&Wo(5,a);break;case 1:if(qn(t,a),f&4)if(t=a.stateNode,i===null)try{t.componentDidMount()}catch(E){Xe(a,a.return,E)}else{var p=yi(a.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(p,i,t.__reactInternalSnapshotBeforeUpdate)}catch(E){Xe(a,a.return,E)}}f&64&&Sd(a),f&512&&jo(a,a.return);break;case 3:if(qn(t,a),f&64&&(t=a.updateQueue,t!==null)){if(i=null,a.child!==null)switch(a.child.tag){case 27:case 5:i=a.child.stateNode;break;case 1:i=a.child.stateNode}try{uc(t,i)}catch(E){Xe(a,a.return,E)}}break;case 27:i===null&&f&4&&Md(a);case 26:case 5:qn(t,a),i===null&&f&4&&Ad(a),f&512&&jo(a,a.return);break;case 12:qn(t,a);break;case 13:qn(t,a),f&4&&Nd(t,a),f&64&&(t=a.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(a=Hy.bind(null,a),ov(t,a))));break;case 22:if(f=a.memoizedState!==null||Sn,!f){i=i!==null&&i.memoizedState!==null||st,p=Sn;var y=st;Sn=f,(st=i)&&!y?Fn(t,a,(a.subtreeFlags&8772)!==0):qn(t,a),Sn=p,st=y}break;case 30:break;default:qn(t,a)}}function bd(t){var i=t.alternate;i!==null&&(t.alternate=null,bd(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&ur(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var nt=null,Nt=!1;function En(t,i,a){for(a=a.child;a!==null;)Dd(t,i,a),a=a.sibling}function Dd(t,i,a){if(ke&&typeof ke.onCommitFiberUnmount=="function")try{ke.onCommitFiberUnmount(Me,a)}catch{}switch(a.tag){case 26:st||an(a,i),En(t,i,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:st||an(a,i);var f=nt,p=Nt;Xn(a.type)&&(nt=a.stateNode,Nt=!1),En(t,i,a),sl(a.stateNode),nt=f,Nt=p;break;case 5:st||an(a,i);case 6:if(f=nt,p=Nt,nt=null,En(t,i,a),nt=f,Nt=p,nt!==null)if(Nt)try{(nt.nodeType===9?nt.body:nt.nodeName==="HTML"?nt.ownerDocument.body:nt).removeChild(a.stateNode)}catch(y){Xe(a,i,y)}else try{nt.removeChild(a.stateNode)}catch(y){Xe(a,i,y)}break;case 18:nt!==null&&(Nt?(t=nt,vh(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,a.stateNode),gl(t)):vh(nt,a.stateNode));break;case 4:f=nt,p=Nt,nt=a.stateNode.containerInfo,Nt=!0,En(t,i,a),nt=f,Nt=p;break;case 0:case 11:case 14:case 15:st||Gn(2,a,i),st||Gn(4,a,i),En(t,i,a);break;case 1:st||(an(a,i),f=a.stateNode,typeof f.componentWillUnmount=="function"&&Ed(a,i,f)),En(t,i,a);break;case 21:En(t,i,a);break;case 22:st=(f=st)||a.memoizedState!==null,En(t,i,a),st=f;break;default:En(t,i,a)}}function Nd(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{gl(t)}catch(a){Xe(i,i.return,a)}}function Iy(t){switch(t.tag){case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new Rd),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new Rd),i;default:throw Error(l(435,t.tag))}}function Ns(t,i){var a=Iy(t);i.forEach(function(f){var p=Gy.bind(null,t,f);a.has(f)||(a.add(f),f.then(p,p))})}function Lt(t,i){var a=i.deletions;if(a!==null)for(var f=0;f<a.length;f++){var p=a[f],y=t,E=i,D=E;e:for(;D!==null;){switch(D.tag){case 27:if(Xn(D.type)){nt=D.stateNode,Nt=!1;break e}break;case 5:nt=D.stateNode,Nt=!1;break e;case 3:case 4:nt=D.stateNode.containerInfo,Nt=!0;break e}D=D.return}if(nt===null)throw Error(l(160));Dd(y,E,p),nt=null,Nt=!1,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(i.subtreeFlags&13878)for(i=i.child;i!==null;)Id(i,t),i=i.sibling}var en=null;function Id(t,i){var a=t.alternate,f=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Lt(i,t),Pt(t),f&4&&(Gn(3,t,t.return),Wo(3,t),Gn(5,t,t.return));break;case 1:Lt(i,t),Pt(t),f&512&&(st||a===null||an(a,a.return)),f&64&&Sn&&(t=t.updateQueue,t!==null&&(f=t.callbacks,f!==null&&(a=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=a===null?f:a.concat(f))));break;case 26:var p=en;if(Lt(i,t),Pt(t),f&512&&(st||a===null||an(a,a.return)),f&4){var y=a!==null?a.memoizedState:null;if(f=t.memoizedState,a===null)if(f===null)if(t.stateNode===null){e:{f=t.type,a=t.memoizedProps,p=p.ownerDocument||p;t:switch(f){case"title":y=p.getElementsByTagName("title")[0],(!y||y[Eo]||y[_t]||y.namespaceURI==="http://www.w3.org/2000/svg"||y.hasAttribute("itemprop"))&&(y=p.createElement(f),p.head.insertBefore(y,p.querySelector("head > title"))),Tt(y,f,a),y[_t]=t,ht(y),f=y;break e;case"link":var E=Mh("link","href",p).get(f+(a.href||""));if(E){for(var D=0;D<E.length;D++)if(y=E[D],y.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&y.getAttribute("rel")===(a.rel==null?null:a.rel)&&y.getAttribute("title")===(a.title==null?null:a.title)&&y.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){E.splice(D,1);break t}}y=p.createElement(f),Tt(y,f,a),p.head.appendChild(y);break;case"meta":if(E=Mh("meta","content",p).get(f+(a.content||""))){for(D=0;D<E.length;D++)if(y=E[D],y.getAttribute("content")===(a.content==null?null:""+a.content)&&y.getAttribute("name")===(a.name==null?null:a.name)&&y.getAttribute("property")===(a.property==null?null:a.property)&&y.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&y.getAttribute("charset")===(a.charSet==null?null:a.charSet)){E.splice(D,1);break t}}y=p.createElement(f),Tt(y,f,a),p.head.appendChild(y);break;default:throw Error(l(468,f))}y[_t]=t,ht(y),f=y}t.stateNode=f}else Rh(p,t.type,t.stateNode);else t.stateNode=xh(p,f,t.memoizedProps);else y!==f?(y===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):y.count--,f===null?Rh(p,t.type,t.stateNode):xh(p,f,t.memoizedProps)):f===null&&t.stateNode!==null&&Rs(t,t.memoizedProps,a.memoizedProps)}break;case 27:Lt(i,t),Pt(t),f&512&&(st||a===null||an(a,a.return)),a!==null&&f&4&&Rs(t,t.memoizedProps,a.memoizedProps);break;case 5:if(Lt(i,t),Pt(t),f&512&&(st||a===null||an(a,a.return)),t.flags&32){p=t.stateNode;try{Li(p,"")}catch(ee){Xe(t,t.return,ee)}}f&4&&t.stateNode!=null&&(p=t.memoizedProps,Rs(t,p,a!==null?a.memoizedProps:p)),f&1024&&(Ds=!0);break;case 6:if(Lt(i,t),Pt(t),f&4){if(t.stateNode===null)throw Error(l(162));f=t.memoizedProps,a=t.stateNode;try{a.nodeValue=f}catch(ee){Xe(t,t.return,ee)}}break;case 3:if(Da=null,p=en,en=wa(i.containerInfo),Lt(i,t),en=p,Pt(t),f&4&&a!==null&&a.memoizedState.isDehydrated)try{gl(i.containerInfo)}catch(ee){Xe(t,t.return,ee)}Ds&&(Ds=!1,Ud(t));break;case 4:f=en,en=wa(t.stateNode.containerInfo),Lt(i,t),Pt(t),en=f;break;case 12:Lt(i,t),Pt(t);break;case 13:Lt(i,t),Pt(t),t.child.flags&8192&&t.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(zs=L()),f&4&&(f=t.updateQueue,f!==null&&(t.updateQueue=null,Ns(t,f)));break;case 22:p=t.memoizedState!==null;var V=a!==null&&a.memoizedState!==null,Q=Sn,ue=st;if(Sn=Q||p,st=ue||V,Lt(i,t),st=ue,Sn=Q,Pt(t),f&8192)e:for(i=t.stateNode,i._visibility=p?i._visibility&-2:i._visibility|1,p&&(a===null||V||Sn||st||vi(t)),a=null,i=t;;){if(i.tag===5||i.tag===26){if(a===null){V=a=i;try{if(y=V.stateNode,p)E=y.style,typeof E.setProperty=="function"?E.setProperty("display","none","important"):E.display="none";else{D=V.stateNode;var me=V.memoizedProps.style,j=me!=null&&me.hasOwnProperty("display")?me.display:null;D.style.display=j==null||typeof j=="boolean"?"":(""+j).trim()}}catch(ee){Xe(V,V.return,ee)}}}else if(i.tag===6){if(a===null){V=i;try{V.stateNode.nodeValue=p?"":V.memoizedProps}catch(ee){Xe(V,V.return,ee)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;a===i&&(a=null),i=i.return}a===i&&(a=null),i.sibling.return=i.return,i=i.sibling}f&4&&(f=t.updateQueue,f!==null&&(a=f.retryQueue,a!==null&&(f.retryQueue=null,Ns(t,a))));break;case 19:Lt(i,t),Pt(t),f&4&&(f=t.updateQueue,f!==null&&(t.updateQueue=null,Ns(t,f)));break;case 30:break;case 21:break;default:Lt(i,t),Pt(t)}}function Pt(t){var i=t.flags;if(i&2){try{for(var a,f=t.return;f!==null;){if(xd(f)){a=f;break}f=f.return}if(a==null)throw Error(l(160));switch(a.tag){case 27:var p=a.stateNode,y=ws(t);pa(t,y,p);break;case 5:var E=a.stateNode;a.flags&32&&(Li(E,""),a.flags&=-33);var D=ws(t);pa(t,D,E);break;case 3:case 4:var V=a.stateNode.containerInfo,Q=ws(t);bs(t,Q,V);break;default:throw Error(l(161))}}catch(ue){Xe(t,t.return,ue)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Ud(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;Ud(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function qn(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)wd(t,i.alternate,i),i=i.sibling}function vi(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:Gn(4,i,i.return),vi(i);break;case 1:an(i,i.return);var a=i.stateNode;typeof a.componentWillUnmount=="function"&&Ed(i,i.return,a),vi(i);break;case 27:sl(i.stateNode);case 26:case 5:an(i,i.return),vi(i);break;case 22:i.memoizedState===null&&vi(i);break;case 30:vi(i);break;default:vi(i)}t=t.sibling}}function Fn(t,i,a){for(a=a&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var f=i.alternate,p=t,y=i,E=y.flags;switch(y.tag){case 0:case 11:case 15:Fn(p,y,a),Wo(4,y);break;case 1:if(Fn(p,y,a),f=y,p=f.stateNode,typeof p.componentDidMount=="function")try{p.componentDidMount()}catch(Q){Xe(f,f.return,Q)}if(f=y,p=f.updateQueue,p!==null){var D=f.stateNode;try{var V=p.shared.hiddenCallbacks;if(V!==null)for(p.shared.hiddenCallbacks=null,p=0;p<V.length;p++)sc(V[p],D)}catch(Q){Xe(f,f.return,Q)}}a&&E&64&&Sd(y),jo(y,y.return);break;case 27:Md(y);case 26:case 5:Fn(p,y,a),a&&f===null&&E&4&&Ad(y),jo(y,y.return);break;case 12:Fn(p,y,a);break;case 13:Fn(p,y,a),a&&E&4&&Nd(p,y);break;case 22:y.memoizedState===null&&Fn(p,y,a),jo(y,y.return);break;case 30:break;default:Fn(p,y,a)}i=i.sibling}}function Is(t,i){var a=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(a=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==a&&(t!=null&&t.refCount++,a!=null&&Bo(a))}function Us(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Bo(t))}function rn(t,i,a,f){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)kd(t,i,a,f),i=i.sibling}function kd(t,i,a,f){var p=i.flags;switch(i.tag){case 0:case 11:case 15:rn(t,i,a,f),p&2048&&Wo(9,i);break;case 1:rn(t,i,a,f);break;case 3:rn(t,i,a,f),p&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Bo(t)));break;case 12:if(p&2048){rn(t,i,a,f),t=i.stateNode;try{var y=i.memoizedProps,E=y.id,D=y.onPostCommit;typeof D=="function"&&D(E,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(V){Xe(i,i.return,V)}}else rn(t,i,a,f);break;case 13:rn(t,i,a,f);break;case 23:break;case 22:y=i.stateNode,E=i.alternate,i.memoizedState!==null?y._visibility&2?rn(t,i,a,f):el(t,i):y._visibility&2?rn(t,i,a,f):(y._visibility|=2,eo(t,i,a,f,(i.subtreeFlags&10256)!==0)),p&2048&&Is(E,i);break;case 24:rn(t,i,a,f),p&2048&&Us(i.alternate,i);break;default:rn(t,i,a,f)}}function eo(t,i,a,f,p){for(p=p&&(i.subtreeFlags&10256)!==0,i=i.child;i!==null;){var y=t,E=i,D=a,V=f,Q=E.flags;switch(E.tag){case 0:case 11:case 15:eo(y,E,D,V,p),Wo(8,E);break;case 23:break;case 22:var ue=E.stateNode;E.memoizedState!==null?ue._visibility&2?eo(y,E,D,V,p):el(y,E):(ue._visibility|=2,eo(y,E,D,V,p)),p&&Q&2048&&Is(E.alternate,E);break;case 24:eo(y,E,D,V,p),p&&Q&2048&&Us(E.alternate,E);break;default:eo(y,E,D,V,p)}i=i.sibling}}function el(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var a=t,f=i,p=f.flags;switch(f.tag){case 22:el(a,f),p&2048&&Is(f.alternate,f);break;case 24:el(a,f),p&2048&&Us(f.alternate,f);break;default:el(a,f)}i=i.sibling}}var tl=8192;function to(t){if(t.subtreeFlags&tl)for(t=t.child;t!==null;)Ld(t),t=t.sibling}function Ld(t){switch(t.tag){case 26:to(t),t.flags&tl&&t.memoizedState!==null&&yv(en,t.memoizedState,t.memoizedProps);break;case 5:to(t);break;case 3:case 4:var i=en;en=wa(t.stateNode.containerInfo),to(t),en=i;break;case 22:t.memoizedState===null&&(i=t.alternate,i!==null&&i.memoizedState!==null?(i=tl,tl=16777216,to(t),tl=i):to(t));break;default:to(t)}}function Pd(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function nl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var f=i[a];pt=f,Bd(f,t)}Pd(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)zd(t),t=t.sibling}function zd(t){switch(t.tag){case 0:case 11:case 15:nl(t),t.flags&2048&&Gn(9,t,t.return);break;case 3:nl(t);break;case 12:nl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,ga(t)):nl(t);break;default:nl(t)}}function ga(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var a=0;a<i.length;a++){var f=i[a];pt=f,Bd(f,t)}Pd(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:Gn(8,i,i.return),ga(i);break;case 22:a=i.stateNode,a._visibility&2&&(a._visibility&=-3,ga(i));break;default:ga(i)}t=t.sibling}}function Bd(t,i){for(;pt!==null;){var a=pt;switch(a.tag){case 0:case 11:case 15:Gn(8,a,i);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var f=a.memoizedState.cachePool.pool;f!=null&&f.refCount++}break;case 24:Bo(a.memoizedState.cache)}if(f=a.child,f!==null)f.return=a,pt=f;else e:for(a=t;pt!==null;){f=pt;var p=f.sibling,y=f.return;if(bd(f),f===a){pt=null;break e}if(p!==null){p.return=y,pt=p;break e}pt=y}}}var Uy={getCacheForType:function(t){var i=Ct(ct),a=i.data.get(t);return a===void 0&&(a=t(),i.data.set(t,a)),a}},ky=typeof WeakMap=="function"?WeakMap:Map,Oe=0,je=null,ze=null,Ve=0,Ye=0,zt=null,On=!1,no=!1,ks=!1,An=0,at=0,Yn=0,Ti=0,Ls=0,Zt=0,io=0,il=null,It=null,Ps=!1,zs=0,ya=1/0,va=null,Jn=null,vt=0,Kn=null,oo=null,lo=0,Bs=0,Vs=null,Vd=null,ol=0,Hs=null;function Bt(){if((Oe&2)!==0&&Ve!==0)return Ve&-Ve;if(J.T!==null){var t=Ji;return t!==0?t:Ks()}return ef()}function Hd(){Zt===0&&(Zt=(Ve&536870912)===0||qe?wl():536870912);var t=Kt.current;return t!==null&&(t.flags|=32),Zt}function Vt(t,i,a){(t===je&&(Ye===2||Ye===9)||t.cancelPendingCommit!==null)&&(ao(t,0),Zn(t,Ve,Zt,!1)),Wt(t,a),((Oe&2)===0||t!==je)&&(t===je&&((Oe&2)===0&&(Ti|=a),at===4&&Zn(t,Ve,Zt,!1)),sn(t))}function Gd(t,i,a){if((Oe&6)!==0)throw Error(l(327));var f=!a&&(i&124)===0&&(i&t.expiredLanes)===0||Nn(t,i),p=f?zy(t,i):Fs(t,i,!0),y=f;do{if(p===0){no&&!f&&Zn(t,i,0,!1);break}else{if(a=t.current.alternate,y&&!Ly(a)){p=Fs(t,i,!1),y=!1;continue}if(p===2){if(y=i,t.errorRecoveryDisabledLanes&y)var E=0;else E=t.pendingLanes&-536870913,E=E!==0?E:E&536870912?536870912:0;if(E!==0){i=E;e:{var D=t;p=il;var V=D.current.memoizedState.isDehydrated;if(V&&(ao(D,E).flags|=256),E=Fs(D,E,!1),E!==2){if(ks&&!V){D.errorRecoveryDisabledLanes|=y,Ti|=y,p=4;break e}y=It,It=p,y!==null&&(It===null?It=y:It.push.apply(It,y))}p=E}if(y=!1,p!==2)continue}}if(p===1){ao(t,0),Zn(t,i,0,!0);break}e:{switch(f=t,y=p,y){case 0:case 1:throw Error(l(345));case 4:if((i&4194048)!==i)break;case 6:Zn(f,i,Zt,!On);break e;case 2:It=null;break;case 3:case 5:break;default:throw Error(l(329))}if((i&62914560)===i&&(p=zs+300-L(),10<p)){if(Zn(f,i,Zt,!On),Rt(f,0,!0)!==0)break e;f.timeoutHandle=gh(qd.bind(null,f,a,It,va,Ps,i,Zt,Ti,io,On,y,2,-0,0),p);break e}qd(f,a,It,va,Ps,i,Zt,Ti,io,On,y,0,-0,0)}}break}while(!0);sn(t)}function qd(t,i,a,f,p,y,E,D,V,Q,ue,me,j,ee){if(t.timeoutHandle=-1,me=i.subtreeFlags,(me&8192||(me&16785408)===16785408)&&(cl={stylesheets:null,count:0,unsuspend:gv},Ld(i),me=vv(),me!==null)){t.cancelPendingCommit=me(Xd.bind(null,t,i,y,a,f,p,E,D,V,ue,1,j,ee)),Zn(t,y,E,!Q);return}Xd(t,i,y,a,f,p,E,D,V)}function Ly(t){for(var i=t;;){var a=i.tag;if((a===0||a===11||a===15)&&i.flags&16384&&(a=i.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var f=0;f<a.length;f++){var p=a[f],y=p.getSnapshot;p=p.value;try{if(!Ut(y(),p))return!1}catch{return!1}}if(a=i.child,i.subtreeFlags&16384&&a!==null)a.return=i,i=a;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Zn(t,i,a,f){i&=~Ls,i&=~Ti,t.suspendedLanes|=i,t.pingedLanes&=~i,f&&(t.warmLanes|=i),f=t.expirationTimes;for(var p=i;0<p;){var y=31-$e(p),E=1<<y;f[y]=-1,p&=~E}a!==0&&Wu(t,a,i)}function Ta(){return(Oe&6)===0?(ll(0),!1):!0}function Gs(){if(ze!==null){if(Ye===0)var t=ze.return;else t=ze,gn=hi=null,os(t),Wi=null,Xo=0,t=ze;for(;t!==null;)Cd(t.alternate,t),t=t.return;ze=null}}function ao(t,i){var a=t.timeoutHandle;a!==-1&&(t.timeoutHandle=-1,jy(a)),a=t.cancelPendingCommit,a!==null&&(t.cancelPendingCommit=null,a()),Gs(),je=t,ze=a=hn(t.current,null),Ve=i,Ye=0,zt=null,On=!1,no=Nn(t,i),ks=!1,io=Zt=Ls=Ti=Yn=at=0,It=il=null,Ps=!1,(i&8)!==0&&(i|=i&32);var f=t.entangledLanes;if(f!==0)for(t=t.entanglements,f&=i;0<f;){var p=31-$e(f),y=1<<p;i|=t[p],f&=~y}return An=i,Gl(),a}function Fd(t,i){Le=null,J.H=aa,i===Ho||i===Ql?(i=ac(),Ye=3):i===ic?(i=ac(),Ye=4):Ye=i===rd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,zt=i,ze===null&&(at=1,ca(t,Ft(i,t.current)))}function Od(){var t=J.H;return J.H=aa,t===null?aa:t}function Yd(){var t=J.A;return J.A=Uy,t}function qs(){at=4,On||(Ve&4194048)!==Ve&&Kt.current!==null||(no=!0),(Yn&134217727)===0&&(Ti&134217727)===0||je===null||Zn(je,Ve,Zt,!1)}function Fs(t,i,a){var f=Oe;Oe|=2;var p=Od(),y=Yd();(je!==t||Ve!==i)&&(va=null,ao(t,i)),i=!1;var E=at;e:do try{if(Ye!==0&&ze!==null){var D=ze,V=zt;switch(Ye){case 8:Gs(),E=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(i=!0);var Q=Ye;if(Ye=0,zt=null,ro(t,D,V,Q),a&&no){E=0;break e}break;default:Q=Ye,Ye=0,zt=null,ro(t,D,V,Q)}}Py(),E=at;break}catch(ue){Fd(t,ue)}while(!0);return i&&t.shellSuspendCounter++,gn=hi=null,Oe=f,J.H=p,J.A=y,ze===null&&(je=null,Ve=0,Gl()),E}function Py(){for(;ze!==null;)Jd(ze)}function zy(t,i){var a=Oe;Oe|=2;var f=Od(),p=Yd();je!==t||Ve!==i?(va=null,ya=L()+500,ao(t,i)):no=Nn(t,i);e:do try{if(Ye!==0&&ze!==null){i=ze;var y=zt;t:switch(Ye){case 1:Ye=0,zt=null,ro(t,i,y,1);break;case 2:case 9:if(oc(y)){Ye=0,zt=null,Kd(i);break}i=function(){Ye!==2&&Ye!==9||je!==t||(Ye=7),sn(t)},y.then(i,i);break e;case 3:Ye=7;break e;case 4:Ye=5;break e;case 7:oc(y)?(Ye=0,zt=null,Kd(i)):(Ye=0,zt=null,ro(t,i,y,7));break;case 5:var E=null;switch(ze.tag){case 26:E=ze.memoizedState;case 5:case 27:var D=ze;if(!E||wh(E)){Ye=0,zt=null;var V=D.sibling;if(V!==null)ze=V;else{var Q=D.return;Q!==null?(ze=Q,_a(Q)):ze=null}break t}}Ye=0,zt=null,ro(t,i,y,5);break;case 6:Ye=0,zt=null,ro(t,i,y,6);break;case 8:Gs(),at=6;break e;default:throw Error(l(462))}}By();break}catch(ue){Fd(t,ue)}while(!0);return gn=hi=null,J.H=f,J.A=p,Oe=a,ze!==null?0:(je=null,Ve=0,Gl(),at)}function By(){for(;ze!==null&&!de();)Jd(ze)}function Jd(t){var i=Td(t.alternate,t,An);t.memoizedProps=t.pendingProps,i===null?_a(t):ze=i}function Kd(t){var i=t,a=i.alternate;switch(i.tag){case 15:case 0:i=hd(a,i,i.pendingProps,i.type,void 0,Ve);break;case 11:i=hd(a,i,i.pendingProps,i.type.render,i.ref,Ve);break;case 5:os(i);default:Cd(a,i),i=ze=Zf(i,An),i=Td(a,i,An)}t.memoizedProps=t.pendingProps,i===null?_a(t):ze=i}function ro(t,i,a,f){gn=hi=null,os(i),Wi=null,Xo=0;var p=i.return;try{if(Ry(t,p,i,a,Ve)){at=1,ca(t,Ft(a,t.current)),ze=null;return}}catch(y){if(p!==null)throw ze=p,y;at=1,ca(t,Ft(a,t.current)),ze=null;return}i.flags&32768?(qe||f===1?t=!0:no||(Ve&536870912)!==0?t=!1:(On=t=!0,(f===2||f===9||f===3||f===6)&&(f=Kt.current,f!==null&&f.tag===13&&(f.flags|=16384))),Zd(i,t)):_a(i)}function _a(t){var i=t;do{if((i.flags&32768)!==0){Zd(i,On);return}t=i.return;var a=by(i.alternate,i,An);if(a!==null){ze=a;return}if(i=i.sibling,i!==null){ze=i;return}ze=i=t}while(i!==null);at===0&&(at=5)}function Zd(t,i){do{var a=Dy(t.alternate,t);if(a!==null){a.flags&=32767,ze=a;return}if(a=t.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!i&&(t=t.sibling,t!==null)){ze=t;return}ze=t=a}while(t!==null);at=6,ze=null}function Xd(t,i,a,f,p,y,E,D,V){t.cancelPendingCommit=null;do Ca();while(vt!==0);if((Oe&6)!==0)throw Error(l(327));if(i!==null){if(i===t.current)throw Error(l(177));if(y=i.lanes|i.childLanes,y|=Ur,Ri(t,a,y,E,D,V),t===je&&(ze=je=null,Ve=0),oo=i,Kn=t,lo=a,Bs=y,Vs=p,Vd=f,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,qy(ge,function(){return eh(),null})):(t.callbackNode=null,t.callbackPriority=0),f=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||f){f=J.T,J.T=null,p=K.p,K.p=2,E=Oe,Oe|=4;try{Ny(t,i,a)}finally{Oe=E,K.p=p,J.T=f}}vt=1,Qd(),$d(),Wd()}}function Qd(){if(vt===1){vt=0;var t=Kn,i=oo,a=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||a){a=J.T,J.T=null;var f=K.p;K.p=2;var p=Oe;Oe|=4;try{Id(i,t);var y=tu,E=Bf(t.containerInfo),D=y.focusedElem,V=y.selectionRange;if(E!==D&&D&&D.ownerDocument&&zf(D.ownerDocument.documentElement,D)){if(V!==null&&wr(D)){var Q=V.start,ue=V.end;if(ue===void 0&&(ue=Q),"selectionStart"in D)D.selectionStart=Q,D.selectionEnd=Math.min(ue,D.value.length);else{var me=D.ownerDocument||document,j=me&&me.defaultView||window;if(j.getSelection){var ee=j.getSelection(),De=D.textContent.length,we=Math.min(V.start,De),Ze=V.end===void 0?we:Math.min(V.end,De);!ee.extend&&we>Ze&&(E=Ze,Ze=we,we=E);var O=Pf(D,we),G=Pf(D,Ze);if(O&&G&&(ee.rangeCount!==1||ee.anchorNode!==O.node||ee.anchorOffset!==O.offset||ee.focusNode!==G.node||ee.focusOffset!==G.offset)){var Z=me.createRange();Z.setStart(O.node,O.offset),ee.removeAllRanges(),we>Ze?(ee.addRange(Z),ee.extend(G.node,G.offset)):(Z.setEnd(G.node,G.offset),ee.addRange(Z))}}}}for(me=[],ee=D;ee=ee.parentNode;)ee.nodeType===1&&me.push({element:ee,left:ee.scrollLeft,top:ee.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<me.length;D++){var ce=me[D];ce.element.scrollLeft=ce.left,ce.element.scrollTop=ce.top}}Ua=!!eu,tu=eu=null}finally{Oe=p,K.p=f,J.T=a}}t.current=i,vt=2}}function $d(){if(vt===2){vt=0;var t=Kn,i=oo,a=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||a){a=J.T,J.T=null;var f=K.p;K.p=2;var p=Oe;Oe|=4;try{wd(t,i.alternate,i)}finally{Oe=p,K.p=f,J.T=a}}vt=3}}function Wd(){if(vt===4||vt===3){vt=0,ne();var t=Kn,i=oo,a=lo,f=Vd;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?vt=5:(vt=0,oo=Kn=null,jd(t,t.pendingLanes));var p=t.pendingLanes;if(p===0&&(Jn=null),rr(a),i=i.stateNode,ke&&typeof ke.onCommitFiberRoot=="function")try{ke.onCommitFiberRoot(Me,i,void 0,(i.current.flags&128)===128)}catch{}if(f!==null){i=J.T,p=K.p,K.p=2,J.T=null;try{for(var y=t.onRecoverableError,E=0;E<f.length;E++){var D=f[E];y(D.value,{componentStack:D.stack})}}finally{J.T=i,K.p=p}}(lo&3)!==0&&Ca(),sn(t),p=t.pendingLanes,(a&4194090)!==0&&(p&42)!==0?t===Hs?ol++:(ol=0,Hs=t):ol=0,ll(0)}}function jd(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Bo(i)))}function Ca(t){return Qd(),$d(),Wd(),eh()}function eh(){if(vt!==5)return!1;var t=Kn,i=Bs;Bs=0;var a=rr(lo),f=J.T,p=K.p;try{K.p=32>a?32:a,J.T=null,a=Vs,Vs=null;var y=Kn,E=lo;if(vt=0,oo=Kn=null,lo=0,(Oe&6)!==0)throw Error(l(331));var D=Oe;if(Oe|=4,zd(y.current),kd(y,y.current,E,a),Oe=D,ll(0,!1),ke&&typeof ke.onPostCommitFiberRoot=="function")try{ke.onPostCommitFiberRoot(Me,y)}catch{}return!0}finally{K.p=p,J.T=f,jd(t,i)}}function th(t,i,a){i=Ft(a,i),i=vs(t.stateNode,i,2),t=zn(t,i,2),t!==null&&(Wt(t,2),sn(t))}function Xe(t,i,a){if(t.tag===3)th(t,t,a);else for(;i!==null;){if(i.tag===3){th(i,t,a);break}else if(i.tag===1){var f=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(Jn===null||!Jn.has(f))){t=Ft(a,t),a=ld(2),f=zn(i,a,2),f!==null&&(ad(a,f,i,t),Wt(f,2),sn(f));break}}i=i.return}}function Os(t,i,a){var f=t.pingCache;if(f===null){f=t.pingCache=new ky;var p=new Set;f.set(i,p)}else p=f.get(i),p===void 0&&(p=new Set,f.set(i,p));p.has(a)||(ks=!0,p.add(a),t=Vy.bind(null,t,i,a),i.then(t,t))}function Vy(t,i,a){var f=t.pingCache;f!==null&&f.delete(i),t.pingedLanes|=t.suspendedLanes&a,t.warmLanes&=~a,je===t&&(Ve&a)===a&&(at===4||at===3&&(Ve&62914560)===Ve&&300>L()-zs?(Oe&2)===0&&ao(t,0):Ls|=a,io===Ve&&(io=0)),sn(t)}function nh(t,i){i===0&&(i=bl()),t=qi(t,i),t!==null&&(Wt(t,i),sn(t))}function Hy(t){var i=t.memoizedState,a=0;i!==null&&(a=i.retryLane),nh(t,a)}function Gy(t,i){var a=0;switch(t.tag){case 13:var f=t.stateNode,p=t.memoizedState;p!==null&&(a=p.retryLane);break;case 19:f=t.stateNode;break;case 22:f=t.stateNode._retryCache;break;default:throw Error(l(314))}f!==null&&f.delete(i),nh(t,a)}function qy(t,i){return At(t,i)}var Sa=null,so=null,Ys=!1,Ea=!1,Js=!1,_i=0;function sn(t){t!==so&&t.next===null&&(so===null?Sa=so=t:so=so.next=t),Ea=!0,Ys||(Ys=!0,Oy())}function ll(t,i){if(!Js&&Ea){Js=!0;do for(var a=!1,f=Sa;f!==null;){if(t!==0){var p=f.pendingLanes;if(p===0)var y=0;else{var E=f.suspendedLanes,D=f.pingedLanes;y=(1<<31-$e(42|t)+1)-1,y&=p&~(E&~D),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(a=!0,ah(f,y))}else y=Ve,y=Rt(f,f===je?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==-1),(y&3)===0||Nn(f,y)||(a=!0,ah(f,y));f=f.next}while(a);Js=!1}}function Fy(){ih()}function ih(){Ea=Ys=!1;var t=0;_i!==0&&(Wy()&&(t=_i),_i=0);for(var i=L(),a=null,f=Sa;f!==null;){var p=f.next,y=oh(f,i);y===0?(f.next=null,a===null?Sa=p:a.next=p,p===null&&(so=a)):(a=f,(t!==0||(y&3)!==0)&&(Ea=!0)),f=p}ll(t)}function oh(t,i){for(var a=t.suspendedLanes,f=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var E=31-$e(y),D=1<<E,V=p[E];V===-1?((D&a)===0||(D&f)!==0)&&(p[E]=lr(D,i)):V<=i&&(t.expiredLanes|=D),y&=~D}if(i=je,a=Ve,a=Rt(t,t===i?a:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),f=t.callbackNode,a===0||t===i&&(Ye===2||Ye===9)||t.cancelPendingCommit!==null)return f!==null&&f!==null&&A(f),t.callbackNode=null,t.callbackPriority=0;if((a&3)===0||Nn(t,a)){if(i=a&-a,i===t.callbackPriority)return i;switch(f!==null&&A(f),rr(a)){case 2:case 8:a=pe;break;case 32:a=ge;break;case 268435456:a=Te;break;default:a=ge}return f=lh.bind(null,t),a=At(a,f),t.callbackPriority=i,t.callbackNode=a,i}return f!==null&&f!==null&&A(f),t.callbackPriority=2,t.callbackNode=null,2}function lh(t,i){if(vt!==0&&vt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var a=t.callbackNode;if(Ca()&&t.callbackNode!==a)return null;var f=Ve;return f=Rt(t,t===je?f:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),f===0?null:(Gd(t,f,i),oh(t,L()),t.callbackNode!=null&&t.callbackNode===a?lh.bind(null,t):null)}function ah(t,i){if(Ca())return null;Gd(t,i,!0)}function Oy(){ev(function(){(Oe&6)!==0?At(F,Fy):ih()})}function Ks(){return _i===0&&(_i=wl()),_i}function rh(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:kl(""+t)}function sh(t,i){var a=i.ownerDocument.createElement("input");return a.name=i.name,a.value=i.value,t.id&&a.setAttribute("form",t.id),i.parentNode.insertBefore(a,i),t=new FormData(t),a.parentNode.removeChild(a),t}function Yy(t,i,a,f,p){if(i==="submit"&&a&&a.stateNode===p){var y=rh((p[wt]||null).action),E=f.submitter;E&&(i=(i=E[wt]||null)?rh(i.formAction):E.getAttribute("formAction"),i!==null&&(y=i,E=null));var D=new Bl("action","action",null,f,p);t.push({event:D,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(_i!==0){var V=E?sh(p,E):new FormData(p);hs(a,{pending:!0,data:V,method:p.method,action:y},null,V)}}else typeof y=="function"&&(D.preventDefault(),V=E?sh(p,E):new FormData(p),hs(a,{pending:!0,data:V,method:p.method,action:y},y,V))},currentTarget:p}]})}}for(var Zs=0;Zs<Ir.length;Zs++){var Xs=Ir[Zs],Jy=Xs.toLowerCase(),Ky=Xs[0].toUpperCase()+Xs.slice(1);jt(Jy,"on"+Ky)}jt(Gf,"onAnimationEnd"),jt(qf,"onAnimationIteration"),jt(Ff,"onAnimationStart"),jt("dblclick","onDoubleClick"),jt("focusin","onFocus"),jt("focusout","onBlur"),jt(fy,"onTransitionRun"),jt(cy,"onTransitionStart"),jt(dy,"onTransitionCancel"),jt(Of,"onTransitionEnd"),Ii("onMouseEnter",["mouseout","mouseover"]),Ii("onMouseLeave",["mouseout","mouseover"]),Ii("onPointerEnter",["pointerout","pointerover"]),Ii("onPointerLeave",["pointerout","pointerover"]),oi("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),oi("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),oi("onBeforeInput",["compositionend","keypress","textInput","paste"]),oi("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),oi("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var al="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Zy=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(al));function uh(t,i){i=(i&4)!==0;for(var a=0;a<t.length;a++){var f=t[a],p=f.event;f=f.listeners;e:{var y=void 0;if(i)for(var E=f.length-1;0<=E;E--){var D=f[E],V=D.instance,Q=D.currentTarget;if(D=D.listener,V!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=Q;try{y(p)}catch(ue){fa(ue)}p.currentTarget=null,y=V}else for(E=0;E<f.length;E++){if(D=f[E],V=D.instance,Q=D.currentTarget,D=D.listener,V!==y&&p.isPropagationStopped())break e;y=D,p.currentTarget=Q;try{y(p)}catch(ue){fa(ue)}p.currentTarget=null,y=V}}}}function Be(t,i){var a=i[sr];a===void 0&&(a=i[sr]=new Set);var f=t+"__bubble";a.has(f)||(fh(i,t,2,!1),a.add(f))}function Qs(t,i,a){var f=0;i&&(f|=4),fh(a,t,f,i)}var Aa="_reactListening"+Math.random().toString(36).slice(2);function $s(t){if(!t[Aa]){t[Aa]=!0,nf.forEach(function(a){a!=="selectionchange"&&(Zy.has(a)||Qs(a,!1,t),Qs(a,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Aa]||(i[Aa]=!0,Qs("selectionchange",!1,i))}}function fh(t,i,a,f){switch(kh(i)){case 2:var p=Cv;break;case 8:p=Sv;break;default:p=cu}a=p.bind(null,i,a,t),p=void 0,!Tr||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(p=!0),f?p!==void 0?t.addEventListener(i,a,{capture:!0,passive:p}):t.addEventListener(i,a,!0):p!==void 0?t.addEventListener(i,a,{passive:p}):t.addEventListener(i,a,!1)}function Ws(t,i,a,f,p){var y=f;if((i&1)===0&&(i&2)===0&&f!==null)e:for(;;){if(f===null)return;var E=f.tag;if(E===3||E===4){var D=f.stateNode.containerInfo;if(D===p)break;if(E===4)for(E=f.return;E!==null;){var V=E.tag;if((V===3||V===4)&&E.stateNode.containerInfo===p)return;E=E.return}for(;D!==null;){if(E=bi(D),E===null)return;if(V=E.tag,V===5||V===6||V===26||V===27){f=y=E;continue e}D=D.parentNode}}f=f.return}yf(function(){var Q=y,ue=yr(a),me=[];e:{var j=Yf.get(t);if(j!==void 0){var ee=Bl,De=t;switch(t){case"keypress":if(Pl(a)===0)break e;case"keydown":case"keyup":ee=qg;break;case"focusin":De="focus",ee=Er;break;case"focusout":De="blur",ee=Er;break;case"beforeblur":case"afterblur":ee=Er;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ee=_f;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ee=Dg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ee=Yg;break;case Gf:case qf:case Ff:ee=Ug;break;case Of:ee=Kg;break;case"scroll":case"scrollend":ee=wg;break;case"wheel":ee=Xg;break;case"copy":case"cut":case"paste":ee=Lg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ee=Sf;break;case"toggle":case"beforetoggle":ee=$g}var we=(i&4)!==0,Ze=!we&&(t==="scroll"||t==="scrollend"),O=we?j!==null?j+"Capture":null:j;we=[];for(var G=Q,Z;G!==null;){var ce=G;if(Z=ce.stateNode,ce=ce.tag,ce!==5&&ce!==26&&ce!==27||Z===null||O===null||(ce=xo(G,O),ce!=null&&we.push(rl(G,ce,Z))),Ze)break;G=G.return}0<we.length&&(j=new ee(j,De,null,a,ue),me.push({event:j,listeners:we}))}}if((i&7)===0){e:{if(j=t==="mouseover"||t==="pointerover",ee=t==="mouseout"||t==="pointerout",j&&a!==gr&&(De=a.relatedTarget||a.fromElement)&&(bi(De)||De[wi]))break e;if((ee||j)&&(j=ue.window===ue?ue:(j=ue.ownerDocument)?j.defaultView||j.parentWindow:window,ee?(De=a.relatedTarget||a.toElement,ee=Q,De=De?bi(De):null,De!==null&&(Ze=c(De),we=De.tag,De!==Ze||we!==5&&we!==27&&we!==6)&&(De=null)):(ee=null,De=Q),ee!==De)){if(we=_f,ce="onMouseLeave",O="onMouseEnter",G="mouse",(t==="pointerout"||t==="pointerover")&&(we=Sf,ce="onPointerLeave",O="onPointerEnter",G="pointer"),Ze=ee==null?j:Ao(ee),Z=De==null?j:Ao(De),j=new we(ce,G+"leave",ee,a,ue),j.target=Ze,j.relatedTarget=Z,ce=null,bi(ue)===Q&&(we=new we(O,G+"enter",De,a,ue),we.target=Z,we.relatedTarget=Ze,ce=we),Ze=ce,ee&&De)t:{for(we=ee,O=De,G=0,Z=we;Z;Z=uo(Z))G++;for(Z=0,ce=O;ce;ce=uo(ce))Z++;for(;0<G-Z;)we=uo(we),G--;for(;0<Z-G;)O=uo(O),Z--;for(;G--;){if(we===O||O!==null&&we===O.alternate)break t;we=uo(we),O=uo(O)}we=null}else we=null;ee!==null&&ch(me,j,ee,we,!1),De!==null&&Ze!==null&&ch(me,Ze,De,we,!0)}}e:{if(j=Q?Ao(Q):window,ee=j.nodeName&&j.nodeName.toLowerCase(),ee==="select"||ee==="input"&&j.type==="file")var Ee=Df;else if(wf(j))if(Nf)Ee=ry;else{Ee=ly;var Pe=oy}else ee=j.nodeName,!ee||ee.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?Q&&pr(Q.elementType)&&(Ee=Df):Ee=ay;if(Ee&&(Ee=Ee(t,Q))){bf(me,Ee,a,ue);break e}Pe&&Pe(t,j,Q),t==="focusout"&&Q&&j.type==="number"&&Q.memoizedProps.value!=null&&mr(j,"number",j.value)}switch(Pe=Q?Ao(Q):window,t){case"focusin":(wf(Pe)||Pe.contentEditable==="true")&&(Vi=Pe,br=Q,Uo=null);break;case"focusout":Uo=br=Vi=null;break;case"mousedown":Dr=!0;break;case"contextmenu":case"mouseup":case"dragend":Dr=!1,Vf(me,a,ue);break;case"selectionchange":if(uy)break;case"keydown":case"keyup":Vf(me,a,ue)}var Re;if(xr)e:{switch(t){case"compositionstart":var be="onCompositionStart";break e;case"compositionend":be="onCompositionEnd";break e;case"compositionupdate":be="onCompositionUpdate";break e}be=void 0}else Bi?Mf(t,a)&&(be="onCompositionEnd"):t==="keydown"&&a.keyCode===229&&(be="onCompositionStart");be&&(Ef&&a.locale!=="ko"&&(Bi||be!=="onCompositionStart"?be==="onCompositionEnd"&&Bi&&(Re=vf()):(Un=ue,_r="value"in Un?Un.value:Un.textContent,Bi=!0)),Pe=xa(Q,be),0<Pe.length&&(be=new Cf(be,t,null,a,ue),me.push({event:be,listeners:Pe}),Re?be.data=Re:(Re=Rf(a),Re!==null&&(be.data=Re)))),(Re=jg?ey(t,a):ty(t,a))&&(be=xa(Q,"onBeforeInput"),0<be.length&&(Pe=new Cf("onBeforeInput","beforeinput",null,a,ue),me.push({event:Pe,listeners:be}),Pe.data=Re)),Yy(me,t,Q,a,ue)}uh(me,i)})}function rl(t,i,a){return{instance:t,listener:i,currentTarget:a}}function xa(t,i){for(var a=i+"Capture",f=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=xo(t,a),p!=null&&f.unshift(rl(t,p,y)),p=xo(t,i),p!=null&&f.push(rl(t,p,y))),t.tag===3)return f;t=t.return}return[]}function uo(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function ch(t,i,a,f,p){for(var y=i._reactName,E=[];a!==null&&a!==f;){var D=a,V=D.alternate,Q=D.stateNode;if(D=D.tag,V!==null&&V===f)break;D!==5&&D!==26&&D!==27||Q===null||(V=Q,p?(Q=xo(a,y),Q!=null&&E.unshift(rl(a,Q,V))):p||(Q=xo(a,y),Q!=null&&E.push(rl(a,Q,V)))),a=a.return}E.length!==0&&t.push({event:i,listeners:E})}var Xy=/\r\n?/g,Qy=/\u0000|\uFFFD/g;function dh(t){return(typeof t=="string"?t:""+t).replace(Xy,`
`).replace(Qy,"")}function hh(t,i){return i=dh(i),dh(t)===i}function Ma(){}function Ke(t,i,a,f,p,y){switch(a){case"children":typeof f=="string"?i==="body"||i==="textarea"&&f===""||Li(t,f):(typeof f=="number"||typeof f=="bigint")&&i!=="body"&&Li(t,""+f);break;case"className":Nl(t,"class",f);break;case"tabIndex":Nl(t,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Nl(t,a,f);break;case"style":pf(t,f,y);break;case"data":if(i!=="object"){Nl(t,"data",f);break}case"src":case"href":if(f===""&&(i!=="a"||a!=="href")){t.removeAttribute(a);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(a);break}f=kl(""+f),t.setAttribute(a,f);break;case"action":case"formAction":if(typeof f=="function"){t.setAttribute(a,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(a==="formAction"?(i!=="input"&&Ke(t,i,"name",p.name,p,null),Ke(t,i,"formEncType",p.formEncType,p,null),Ke(t,i,"formMethod",p.formMethod,p,null),Ke(t,i,"formTarget",p.formTarget,p,null)):(Ke(t,i,"encType",p.encType,p,null),Ke(t,i,"method",p.method,p,null),Ke(t,i,"target",p.target,p,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(a);break}f=kl(""+f),t.setAttribute(a,f);break;case"onClick":f!=null&&(t.onclick=Ma);break;case"onScroll":f!=null&&Be("scroll",t);break;case"onScrollEnd":f!=null&&Be("scrollend",t);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(l(61));if(a=f.__html,a!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"multiple":t.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":t.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){t.removeAttribute("xlink:href");break}a=kl(""+f),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(a,""+f):t.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(a,""):t.removeAttribute(a);break;case"capture":case"download":f===!0?t.setAttribute(a,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(a,f):t.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?t.setAttribute(a,f):t.removeAttribute(a);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?t.removeAttribute(a):t.setAttribute(a,f);break;case"popover":Be("beforetoggle",t),Be("toggle",t),Dl(t,"popover",f);break;case"xlinkActuate":cn(t,"http://www.w3.org/1999/xlink","xlink:actuate",f);break;case"xlinkArcrole":cn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",f);break;case"xlinkRole":cn(t,"http://www.w3.org/1999/xlink","xlink:role",f);break;case"xlinkShow":cn(t,"http://www.w3.org/1999/xlink","xlink:show",f);break;case"xlinkTitle":cn(t,"http://www.w3.org/1999/xlink","xlink:title",f);break;case"xlinkType":cn(t,"http://www.w3.org/1999/xlink","xlink:type",f);break;case"xmlBase":cn(t,"http://www.w3.org/XML/1998/namespace","xml:base",f);break;case"xmlLang":cn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",f);break;case"xmlSpace":cn(t,"http://www.w3.org/XML/1998/namespace","xml:space",f);break;case"is":Dl(t,"is",f);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Mg.get(a)||a,Dl(t,a,f))}}function js(t,i,a,f,p,y){switch(a){case"style":pf(t,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error(l(61));if(a=f.__html,a!=null){if(p.children!=null)throw Error(l(60));t.innerHTML=a}}break;case"children":typeof f=="string"?Li(t,f):(typeof f=="number"||typeof f=="bigint")&&Li(t,""+f);break;case"onScroll":f!=null&&Be("scroll",t);break;case"onScrollEnd":f!=null&&Be("scrollend",t);break;case"onClick":f!=null&&(t.onclick=Ma);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!of.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(p=a.endsWith("Capture"),i=a.slice(2,p?a.length-7:void 0),y=t[wt]||null,y=y!=null?y[a]:null,typeof y=="function"&&t.removeEventListener(i,y,p),typeof f=="function")){typeof y!="function"&&y!==null&&(a in t?t[a]=null:t.hasAttribute(a)&&t.removeAttribute(a)),t.addEventListener(i,f,p);break e}a in t?t[a]=f:f===!0?t.setAttribute(a,""):Dl(t,a,f)}}}function Tt(t,i,a){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Be("error",t),Be("load",t);var f=!1,p=!1,y;for(y in a)if(a.hasOwnProperty(y)){var E=a[y];if(E!=null)switch(y){case"src":f=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:Ke(t,i,y,E,a,null)}}p&&Ke(t,i,"srcSet",a.srcSet,a,null),f&&Ke(t,i,"src",a.src,a,null);return;case"input":Be("invalid",t);var D=y=E=p=null,V=null,Q=null;for(f in a)if(a.hasOwnProperty(f)){var ue=a[f];if(ue!=null)switch(f){case"name":p=ue;break;case"type":E=ue;break;case"checked":V=ue;break;case"defaultChecked":Q=ue;break;case"value":y=ue;break;case"defaultValue":D=ue;break;case"children":case"dangerouslySetInnerHTML":if(ue!=null)throw Error(l(137,i));break;default:Ke(t,i,f,ue,a,null)}}cf(t,y,D,V,Q,E,p,!1),Il(t);return;case"select":Be("invalid",t),f=E=y=null;for(p in a)if(a.hasOwnProperty(p)&&(D=a[p],D!=null))switch(p){case"value":y=D;break;case"defaultValue":E=D;break;case"multiple":f=D;default:Ke(t,i,p,D,a,null)}i=y,a=E,t.multiple=!!f,i!=null?ki(t,!!f,i,!1):a!=null&&ki(t,!!f,a,!0);return;case"textarea":Be("invalid",t),y=p=f=null;for(E in a)if(a.hasOwnProperty(E)&&(D=a[E],D!=null))switch(E){case"value":f=D;break;case"defaultValue":p=D;break;case"children":y=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(l(91));break;default:Ke(t,i,E,D,a,null)}hf(t,f,p,y),Il(t);return;case"option":for(V in a)if(a.hasOwnProperty(V)&&(f=a[V],f!=null))switch(V){case"selected":t.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Ke(t,i,V,f,a,null)}return;case"dialog":Be("beforetoggle",t),Be("toggle",t),Be("cancel",t),Be("close",t);break;case"iframe":case"object":Be("load",t);break;case"video":case"audio":for(f=0;f<al.length;f++)Be(al[f],t);break;case"image":Be("error",t),Be("load",t);break;case"details":Be("toggle",t);break;case"embed":case"source":case"link":Be("error",t),Be("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Q in a)if(a.hasOwnProperty(Q)&&(f=a[Q],f!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,i));default:Ke(t,i,Q,f,a,null)}return;default:if(pr(i)){for(ue in a)a.hasOwnProperty(ue)&&(f=a[ue],f!==void 0&&js(t,i,ue,f,a,void 0));return}}for(D in a)a.hasOwnProperty(D)&&(f=a[D],f!=null&&Ke(t,i,D,f,a,null))}function $y(t,i,a,f){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,E=null,D=null,V=null,Q=null,ue=null;for(ee in a){var me=a[ee];if(a.hasOwnProperty(ee)&&me!=null)switch(ee){case"checked":break;case"value":break;case"defaultValue":V=me;default:f.hasOwnProperty(ee)||Ke(t,i,ee,null,f,me)}}for(var j in f){var ee=f[j];if(me=a[j],f.hasOwnProperty(j)&&(ee!=null||me!=null))switch(j){case"type":y=ee;break;case"name":p=ee;break;case"checked":Q=ee;break;case"defaultChecked":ue=ee;break;case"value":E=ee;break;case"defaultValue":D=ee;break;case"children":case"dangerouslySetInnerHTML":if(ee!=null)throw Error(l(137,i));break;default:ee!==me&&Ke(t,i,j,ee,f,me)}}hr(t,E,D,V,Q,ue,y,p);return;case"select":ee=E=D=j=null;for(y in a)if(V=a[y],a.hasOwnProperty(y)&&V!=null)switch(y){case"value":break;case"multiple":ee=V;default:f.hasOwnProperty(y)||Ke(t,i,y,null,f,V)}for(p in f)if(y=f[p],V=a[p],f.hasOwnProperty(p)&&(y!=null||V!=null))switch(p){case"value":j=y;break;case"defaultValue":D=y;break;case"multiple":E=y;default:y!==V&&Ke(t,i,p,y,f,V)}i=D,a=E,f=ee,j!=null?ki(t,!!a,j,!1):!!f!=!!a&&(i!=null?ki(t,!!a,i,!0):ki(t,!!a,a?[]:"",!1));return;case"textarea":ee=j=null;for(D in a)if(p=a[D],a.hasOwnProperty(D)&&p!=null&&!f.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Ke(t,i,D,null,f,p)}for(E in f)if(p=f[E],y=a[E],f.hasOwnProperty(E)&&(p!=null||y!=null))switch(E){case"value":j=p;break;case"defaultValue":ee=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(l(91));break;default:p!==y&&Ke(t,i,E,p,f,y)}df(t,j,ee);return;case"option":for(var De in a)if(j=a[De],a.hasOwnProperty(De)&&j!=null&&!f.hasOwnProperty(De))switch(De){case"selected":t.selected=!1;break;default:Ke(t,i,De,null,f,j)}for(V in f)if(j=f[V],ee=a[V],f.hasOwnProperty(V)&&j!==ee&&(j!=null||ee!=null))switch(V){case"selected":t.selected=j&&typeof j!="function"&&typeof j!="symbol";break;default:Ke(t,i,V,j,f,ee)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var we in a)j=a[we],a.hasOwnProperty(we)&&j!=null&&!f.hasOwnProperty(we)&&Ke(t,i,we,null,f,j);for(Q in f)if(j=f[Q],ee=a[Q],f.hasOwnProperty(Q)&&j!==ee&&(j!=null||ee!=null))switch(Q){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(l(137,i));break;default:Ke(t,i,Q,j,f,ee)}return;default:if(pr(i)){for(var Ze in a)j=a[Ze],a.hasOwnProperty(Ze)&&j!==void 0&&!f.hasOwnProperty(Ze)&&js(t,i,Ze,void 0,f,j);for(ue in f)j=f[ue],ee=a[ue],!f.hasOwnProperty(ue)||j===ee||j===void 0&&ee===void 0||js(t,i,ue,j,f,ee);return}}for(var O in a)j=a[O],a.hasOwnProperty(O)&&j!=null&&!f.hasOwnProperty(O)&&Ke(t,i,O,null,f,j);for(me in f)j=f[me],ee=a[me],!f.hasOwnProperty(me)||j===ee||j==null&&ee==null||Ke(t,i,me,j,f,ee)}var eu=null,tu=null;function Ra(t){return t.nodeType===9?t:t.ownerDocument}function mh(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function ph(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function nu(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var iu=null;function Wy(){var t=window.event;return t&&t.type==="popstate"?t===iu?!1:(iu=t,!0):(iu=null,!1)}var gh=typeof setTimeout=="function"?setTimeout:void 0,jy=typeof clearTimeout=="function"?clearTimeout:void 0,yh=typeof Promise=="function"?Promise:void 0,ev=typeof queueMicrotask=="function"?queueMicrotask:typeof yh<"u"?function(t){return yh.resolve(null).then(t).catch(tv)}:gh;function tv(t){setTimeout(function(){throw t})}function Xn(t){return t==="head"}function vh(t,i){var a=i,f=0,p=0;do{var y=a.nextSibling;if(t.removeChild(a),y&&y.nodeType===8)if(a=y.data,a==="/$"){if(0<f&&8>f){a=f;var E=t.ownerDocument;if(a&1&&sl(E.documentElement),a&2&&sl(E.body),a&4)for(a=E.head,sl(a),E=a.firstChild;E;){var D=E.nextSibling,V=E.nodeName;E[Eo]||V==="SCRIPT"||V==="STYLE"||V==="LINK"&&E.rel.toLowerCase()==="stylesheet"||a.removeChild(E),E=D}}if(p===0){t.removeChild(y),gl(i);return}p--}else a==="$"||a==="$?"||a==="$!"?p++:f=a.charCodeAt(0)-48;else f=0;a=y}while(a);gl(i)}function ou(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var a=i;switch(i=i.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":ou(a),ur(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}t.removeChild(a)}}function nv(t,i,a,f){for(;t.nodeType===1;){var p=a;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!f&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(f){if(!t[Eo])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=tn(t.nextSibling),t===null)break}return null}function iv(t,i,a){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!a||(t=tn(t.nextSibling),t===null))return null;return t}function lu(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState==="complete"}function ov(t,i){var a=t.ownerDocument;if(t.data!=="$?"||a.readyState==="complete")i();else{var f=function(){i(),a.removeEventListener("DOMContentLoaded",f)};a.addEventListener("DOMContentLoaded",f),t._reactRetry=f}}function tn(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?"||i==="F!"||i==="F")break;if(i==="/$")return null}}return t}var au=null;function Th(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var a=t.data;if(a==="$"||a==="$!"||a==="$?"){if(i===0)return t;i--}else a==="/$"&&i++}t=t.previousSibling}return null}function _h(t,i,a){switch(i=Ra(a),t){case"html":if(t=i.documentElement,!t)throw Error(l(452));return t;case"head":if(t=i.head,!t)throw Error(l(453));return t;case"body":if(t=i.body,!t)throw Error(l(454));return t;default:throw Error(l(451))}}function sl(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);ur(t)}var Xt=new Map,Ch=new Set;function wa(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var xn=K.d;K.d={f:lv,r:av,D:rv,C:sv,L:uv,m:fv,X:dv,S:cv,M:hv};function lv(){var t=xn.f(),i=Ta();return t||i}function av(t){var i=Di(t);i!==null&&i.tag===5&&i.type==="form"?Gc(i):xn.r(t)}var fo=typeof document>"u"?null:document;function Sh(t,i,a){var f=fo;if(f&&typeof i=="string"&&i){var p=qt(i);p='link[rel="'+t+'"][href="'+p+'"]',typeof a=="string"&&(p+='[crossorigin="'+a+'"]'),Ch.has(p)||(Ch.add(p),t={rel:t,crossOrigin:a,href:i},f.querySelector(p)===null&&(i=f.createElement("link"),Tt(i,"link",t),ht(i),f.head.appendChild(i)))}}function rv(t){xn.D(t),Sh("dns-prefetch",t,null)}function sv(t,i){xn.C(t,i),Sh("preconnect",t,i)}function uv(t,i,a){xn.L(t,i,a);var f=fo;if(f&&t&&i){var p='link[rel="preload"][as="'+qt(i)+'"]';i==="image"&&a&&a.imageSrcSet?(p+='[imagesrcset="'+qt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(p+='[imagesizes="'+qt(a.imageSizes)+'"]')):p+='[href="'+qt(t)+'"]';var y=p;switch(i){case"style":y=co(t);break;case"script":y=ho(t)}Xt.has(y)||(t=v({rel:"preload",href:i==="image"&&a&&a.imageSrcSet?void 0:t,as:i},a),Xt.set(y,t),f.querySelector(p)!==null||i==="style"&&f.querySelector(ul(y))||i==="script"&&f.querySelector(fl(y))||(i=f.createElement("link"),Tt(i,"link",t),ht(i),f.head.appendChild(i)))}}function fv(t,i){xn.m(t,i);var a=fo;if(a&&t){var f=i&&typeof i.as=="string"?i.as:"script",p='link[rel="modulepreload"][as="'+qt(f)+'"][href="'+qt(t)+'"]',y=p;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=ho(t)}if(!Xt.has(y)&&(t=v({rel:"modulepreload",href:t},i),Xt.set(y,t),a.querySelector(p)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(fl(y)))return}f=a.createElement("link"),Tt(f,"link",t),ht(f),a.head.appendChild(f)}}}function cv(t,i,a){xn.S(t,i,a);var f=fo;if(f&&t){var p=Ni(f).hoistableStyles,y=co(t);i=i||"default";var E=p.get(y);if(!E){var D={loading:0,preload:null};if(E=f.querySelector(ul(y)))D.loading=5;else{t=v({rel:"stylesheet",href:t,"data-precedence":i},a),(a=Xt.get(y))&&ru(t,a);var V=E=f.createElement("link");ht(V),Tt(V,"link",t),V._p=new Promise(function(Q,ue){V.onload=Q,V.onerror=ue}),V.addEventListener("load",function(){D.loading|=1}),V.addEventListener("error",function(){D.loading|=2}),D.loading|=4,ba(E,i,f)}E={type:"stylesheet",instance:E,count:1,state:D},p.set(y,E)}}}function dv(t,i){xn.X(t,i);var a=fo;if(a&&t){var f=Ni(a).hoistableScripts,p=ho(t),y=f.get(p);y||(y=a.querySelector(fl(p)),y||(t=v({src:t,async:!0},i),(i=Xt.get(p))&&su(t,i),y=a.createElement("script"),ht(y),Tt(y,"link",t),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(p,y))}}function hv(t,i){xn.M(t,i);var a=fo;if(a&&t){var f=Ni(a).hoistableScripts,p=ho(t),y=f.get(p);y||(y=a.querySelector(fl(p)),y||(t=v({src:t,async:!0,type:"module"},i),(i=Xt.get(p))&&su(t,i),y=a.createElement("script"),ht(y),Tt(y,"link",t),a.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(p,y))}}function Eh(t,i,a,f){var p=(p=Ce.current)?wa(p):null;if(!p)throw Error(l(446));switch(t){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(i=co(a.href),a=Ni(p).hoistableStyles,f=a.get(i),f||(f={type:"style",instance:null,count:0,state:null},a.set(i,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){t=co(a.href);var y=Ni(p).hoistableStyles,E=y.get(t);if(E||(p=p.ownerDocument||p,E={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},y.set(t,E),(y=p.querySelector(ul(t)))&&!y._p&&(E.instance=y,E.state.loading=5),Xt.has(t)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Xt.set(t,a),y||mv(p,t,a,E.state))),i&&f===null)throw Error(l(528,""));return E}if(i&&f!==null)throw Error(l(529,""));return null;case"script":return i=a.async,a=a.src,typeof a=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=ho(a),a=Ni(p).hoistableScripts,f=a.get(i),f||(f={type:"script",instance:null,count:0,state:null},a.set(i,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,t))}}function co(t){return'href="'+qt(t)+'"'}function ul(t){return'link[rel="stylesheet"]['+t+"]"}function Ah(t){return v({},t,{"data-precedence":t.precedence,precedence:null})}function mv(t,i,a,f){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?f.loading=1:(i=t.createElement("link"),f.preload=i,i.addEventListener("load",function(){return f.loading|=1}),i.addEventListener("error",function(){return f.loading|=2}),Tt(i,"link",a),ht(i),t.head.appendChild(i))}function ho(t){return'[src="'+qt(t)+'"]'}function fl(t){return"script[async]"+t}function xh(t,i,a){if(i.count++,i.instance===null)switch(i.type){case"style":var f=t.querySelector('style[data-href~="'+qt(a.href)+'"]');if(f)return i.instance=f,ht(f),f;var p=v({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return f=(t.ownerDocument||t).createElement("style"),ht(f),Tt(f,"style",p),ba(f,a.precedence,t),i.instance=f;case"stylesheet":p=co(a.href);var y=t.querySelector(ul(p));if(y)return i.state.loading|=4,i.instance=y,ht(y),y;f=Ah(a),(p=Xt.get(p))&&ru(f,p),y=(t.ownerDocument||t).createElement("link"),ht(y);var E=y;return E._p=new Promise(function(D,V){E.onload=D,E.onerror=V}),Tt(y,"link",f),i.state.loading|=4,ba(y,a.precedence,t),i.instance=y;case"script":return y=ho(a.src),(p=t.querySelector(fl(y)))?(i.instance=p,ht(p),p):(f=a,(p=Xt.get(y))&&(f=v({},a),su(f,p)),t=t.ownerDocument||t,p=t.createElement("script"),ht(p),Tt(p,"link",f),t.head.appendChild(p),i.instance=p);case"void":return null;default:throw Error(l(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(f=i.instance,i.state.loading|=4,ba(f,a.precedence,t));return i.instance}function ba(t,i,a){for(var f=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=f.length?f[f.length-1]:null,y=p,E=0;E<f.length;E++){var D=f[E];if(D.dataset.precedence===i)y=D;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(i=a.nodeType===9?a.head:a,i.insertBefore(t,i.firstChild))}function ru(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function su(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Da=null;function Mh(t,i,a){if(Da===null){var f=new Map,p=Da=new Map;p.set(a,f)}else p=Da,f=p.get(a),f||(f=new Map,p.set(a,f));if(f.has(t))return f;for(f.set(t,null),a=a.getElementsByTagName(t),p=0;p<a.length;p++){var y=a[p];if(!(y[Eo]||y[_t]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!=="http://www.w3.org/2000/svg"){var E=y.getAttribute(i)||"";E=t+E;var D=f.get(E);D?D.push(y):f.set(E,[y])}}return f}function Rh(t,i,a){t=t.ownerDocument||t,t.head.insertBefore(a,i==="title"?t.querySelector("head > title"):null)}function pv(t,i,a){if(a===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function wh(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}var cl=null;function gv(){}function yv(t,i,a){if(cl===null)throw Error(l(475));var f=cl;if(i.type==="stylesheet"&&(typeof a.media!="string"||matchMedia(a.media).matches!==!1)&&(i.state.loading&4)===0){if(i.instance===null){var p=co(a.href),y=t.querySelector(ul(p));if(y){t=y._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(f.count++,f=Na.bind(f),t.then(f,f)),i.state.loading|=4,i.instance=y,ht(y);return}y=t.ownerDocument||t,a=Ah(a),(p=Xt.get(p))&&ru(a,p),y=y.createElement("link"),ht(y);var E=y;E._p=new Promise(function(D,V){E.onload=D,E.onerror=V}),Tt(y,"link",a),i.instance=y}f.stylesheets===null&&(f.stylesheets=new Map),f.stylesheets.set(i,t),(t=i.state.preload)&&(i.state.loading&3)===0&&(f.count++,i=Na.bind(f),t.addEventListener("load",i),t.addEventListener("error",i))}}function vv(){if(cl===null)throw Error(l(475));var t=cl;return t.stylesheets&&t.count===0&&uu(t,t.stylesheets),0<t.count?function(i){var a=setTimeout(function(){if(t.stylesheets&&uu(t,t.stylesheets),t.unsuspend){var f=t.unsuspend;t.unsuspend=null,f()}},6e4);return t.unsuspend=i,function(){t.unsuspend=null,clearTimeout(a)}}:null}function Na(){if(this.count--,this.count===0){if(this.stylesheets)uu(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Ia=null;function uu(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Ia=new Map,i.forEach(Tv,t),Ia=null,Na.call(t))}function Tv(t,i){if(!(i.state.loading&4)){var a=Ia.get(t);if(a)var f=a.get(null);else{a=new Map,Ia.set(t,a);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var E=p[y];(E.nodeName==="LINK"||E.getAttribute("media")!=="not all")&&(a.set(E.dataset.precedence,E),f=E)}f&&a.set(null,f)}p=i.instance,E=p.getAttribute("data-precedence"),y=a.get(E)||f,y===f&&a.set(null,p),a.set(E,p),this.count++,f=Na.bind(this),p.addEventListener("load",f),p.addEventListener("error",f),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),i.state.loading|=4}}var dl={$$typeof:N,Provider:null,Consumer:null,_currentValue:ve,_currentValue2:ve,_threadCount:0};function _v(t,i,a,f,p,y,E,D){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Mi(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Mi(0),this.hiddenUpdates=Mi(null),this.identifierPrefix=f,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=E,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=D,this.incompleteTransitions=new Map}function bh(t,i,a,f,p,y,E,D,V,Q,ue,me){return t=new _v(t,i,a,E,D,V,Q,me),i=1,y===!0&&(i|=24),y=kt(3,null,null,i),t.current=y,y.stateNode=t,i=Or(),i.refCount++,t.pooledCache=i,i.refCount++,y.memoizedState={element:f,isDehydrated:a,cache:i},Zr(y),t}function Dh(t){return t?(t=Fi,t):Fi}function Nh(t,i,a,f,p,y){p=Dh(p),f.context===null?f.context=p:f.pendingContext=p,f=Pn(i),f.payload={element:a},y=y===void 0?null:y,y!==null&&(f.callback=y),a=zn(t,f,i),a!==null&&(Vt(a,t,i),qo(a,t,i))}function Ih(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var a=t.retryLane;t.retryLane=a!==0&&a<i?a:i}}function fu(t,i){Ih(t,i),(t=t.alternate)&&Ih(t,i)}function Uh(t){if(t.tag===13){var i=qi(t,67108864);i!==null&&Vt(i,t,67108864),fu(t,67108864)}}var Ua=!0;function Cv(t,i,a,f){var p=J.T;J.T=null;var y=K.p;try{K.p=2,cu(t,i,a,f)}finally{K.p=y,J.T=p}}function Sv(t,i,a,f){var p=J.T;J.T=null;var y=K.p;try{K.p=8,cu(t,i,a,f)}finally{K.p=y,J.T=p}}function cu(t,i,a,f){if(Ua){var p=du(f);if(p===null)Ws(t,i,f,ka,a),Lh(t,f);else if(Av(p,t,i,a,f))f.stopPropagation();else if(Lh(t,f),i&4&&-1<Ev.indexOf(t)){for(;p!==null;){var y=Di(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var E=$t(y.pendingLanes);if(E!==0){var D=y;for(D.pendingLanes|=2,D.entangledLanes|=2;E;){var V=1<<31-$e(E);D.entanglements[1]|=V,E&=~V}sn(y),(Oe&6)===0&&(ya=L()+500,ll(0))}}break;case 13:D=qi(y,2),D!==null&&Vt(D,y,2),Ta(),fu(y,2)}if(y=du(f),y===null&&Ws(t,i,f,ka,a),y===p)break;p=y}p!==null&&f.stopPropagation()}else Ws(t,i,f,null,a)}}function du(t){return t=yr(t),hu(t)}var ka=null;function hu(t){if(ka=null,t=bi(t),t!==null){var i=c(t);if(i===null)t=null;else{var a=i.tag;if(a===13){if(t=d(i),t!==null)return t;t=null}else if(a===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return ka=t,null}function kh(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(U()){case F:return 2;case pe:return 8;case ge:case W:return 32;case Te:return 268435456;default:return 32}default:return 32}}var mu=!1,Qn=null,$n=null,Wn=null,hl=new Map,ml=new Map,jn=[],Ev="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function Lh(t,i){switch(t){case"focusin":case"focusout":Qn=null;break;case"dragenter":case"dragleave":$n=null;break;case"mouseover":case"mouseout":Wn=null;break;case"pointerover":case"pointerout":hl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ml.delete(i.pointerId)}}function pl(t,i,a,f,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:i,domEventName:a,eventSystemFlags:f,nativeEvent:y,targetContainers:[p]},i!==null&&(i=Di(i),i!==null&&Uh(i)),t):(t.eventSystemFlags|=f,i=t.targetContainers,p!==null&&i.indexOf(p)===-1&&i.push(p),t)}function Av(t,i,a,f,p){switch(i){case"focusin":return Qn=pl(Qn,t,i,a,f,p),!0;case"dragenter":return $n=pl($n,t,i,a,f,p),!0;case"mouseover":return Wn=pl(Wn,t,i,a,f,p),!0;case"pointerover":var y=p.pointerId;return hl.set(y,pl(hl.get(y)||null,t,i,a,f,p)),!0;case"gotpointercapture":return y=p.pointerId,ml.set(y,pl(ml.get(y)||null,t,i,a,f,p)),!0}return!1}function Ph(t){var i=bi(t.target);if(i!==null){var a=c(i);if(a!==null){if(i=a.tag,i===13){if(i=d(a),i!==null){t.blockedOn=i,yg(t.priority,function(){if(a.tag===13){var f=Bt();f=ar(f);var p=qi(a,f);p!==null&&Vt(p,a,f),fu(a,f)}});return}}else if(i===3&&a.stateNode.current.memoizedState.isDehydrated){t.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}t.blockedOn=null}function La(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var a=du(t.nativeEvent);if(a===null){a=t.nativeEvent;var f=new a.constructor(a.type,a);gr=f,a.target.dispatchEvent(f),gr=null}else return i=Di(a),i!==null&&Uh(i),t.blockedOn=a,!1;i.shift()}return!0}function zh(t,i,a){La(t)&&a.delete(i)}function xv(){mu=!1,Qn!==null&&La(Qn)&&(Qn=null),$n!==null&&La($n)&&($n=null),Wn!==null&&La(Wn)&&(Wn=null),hl.forEach(zh),ml.forEach(zh)}function Pa(t,i){t.blockedOn===i&&(t.blockedOn=null,mu||(mu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,xv)))}var za=null;function Bh(t){za!==t&&(za=t,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){za===t&&(za=null);for(var i=0;i<t.length;i+=3){var a=t[i],f=t[i+1],p=t[i+2];if(typeof f!="function"){if(hu(f||a)===null)continue;break}var y=Di(a);y!==null&&(t.splice(i,3),i-=3,hs(y,{pending:!0,data:p,method:a.method,action:f},f,p))}}))}function gl(t){function i(V){return Pa(V,t)}Qn!==null&&Pa(Qn,t),$n!==null&&Pa($n,t),Wn!==null&&Pa(Wn,t),hl.forEach(i),ml.forEach(i);for(var a=0;a<jn.length;a++){var f=jn[a];f.blockedOn===t&&(f.blockedOn=null)}for(;0<jn.length&&(a=jn[0],a.blockedOn===null);)Ph(a),a.blockedOn===null&&jn.shift();if(a=(t.ownerDocument||t).$$reactFormReplay,a!=null)for(f=0;f<a.length;f+=3){var p=a[f],y=a[f+1],E=p[wt]||null;if(typeof y=="function")E||Bh(a);else if(E){var D=null;if(y&&y.hasAttribute("formAction")){if(p=y,E=y[wt]||null)D=E.formAction;else if(hu(p)!==null)continue}else D=E.action;typeof D=="function"?a[f+1]=D:(a.splice(f,3),f-=3),Bh(a)}}}function pu(t){this._internalRoot=t}Ba.prototype.render=pu.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(l(409));var a=i.current,f=Bt();Nh(a,f,t,i,null,null)},Ba.prototype.unmount=pu.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Nh(t.current,2,null,t,null,null),Ta(),i[wi]=null}};function Ba(t){this._internalRoot=t}Ba.prototype.unstable_scheduleHydration=function(t){if(t){var i=ef();t={blockedOn:null,target:t,priority:i};for(var a=0;a<jn.length&&i!==0&&i<jn[a].priority;a++);jn.splice(a,0,t),a===0&&Ph(t)}};var Vh=e.version;if(Vh!=="19.1.1")throw Error(l(527,Vh,"19.1.1"));K.findDOMNode=function(t){var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(l(188)):(t=Object.keys(t).join(","),Error(l(268,t)));return t=g(i),t=t!==null?h(t):null,t=t===null?null:t.stateNode,t};var Mv={bundleType:0,version:"19.1.1",rendererPackageName:"react-dom",currentDispatcherRef:J,reconcilerVersion:"19.1.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Va=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Va.isDisabled&&Va.supportsFiber)try{Me=Va.inject(Mv),ke=Va}catch{}}return vl.createRoot=function(t,i){if(!s(t))throw Error(l(299));var a=!1,f="",p=td,y=nd,E=id,D=null;return i!=null&&(i.unstable_strictMode===!0&&(a=!0),i.identifierPrefix!==void 0&&(f=i.identifierPrefix),i.onUncaughtError!==void 0&&(p=i.onUncaughtError),i.onCaughtError!==void 0&&(y=i.onCaughtError),i.onRecoverableError!==void 0&&(E=i.onRecoverableError),i.unstable_transitionCallbacks!==void 0&&(D=i.unstable_transitionCallbacks)),i=bh(t,1,!1,null,null,a,f,p,y,E,D,null),t[wi]=i.current,$s(t),new pu(i)},vl.hydrateRoot=function(t,i,a){if(!s(t))throw Error(l(299));var f=!1,p="",y=td,E=nd,D=id,V=null,Q=null;return a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(p=a.identifierPrefix),a.onUncaughtError!==void 0&&(y=a.onUncaughtError),a.onCaughtError!==void 0&&(E=a.onCaughtError),a.onRecoverableError!==void 0&&(D=a.onRecoverableError),a.unstable_transitionCallbacks!==void 0&&(V=a.unstable_transitionCallbacks),a.formState!==void 0&&(Q=a.formState)),i=bh(t,1,!0,i,a??null,f,p,y,E,D,V,Q),i.context=Dh(null),a=i.current,f=Bt(),f=ar(f),p=Pn(f),p.callback=null,zn(a,p,f),a=f,i.current.lanes=a,Wt(i,a),sn(i),t[wi]=i.current,$s(t),new Ba(i)},vl.version="19.1.1",vl}var Xh;function zv(){if(Xh)return vu.exports;Xh=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),vu.exports=Pv(),vu.exports}var Bv=zv();const Vv=Hu(Bv);/**
 * react-router v7.8.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var Qh="popstate";function Hv(n={}){function e(s,c){let{pathname:d="/",search:m="",hash:g=""}=Si(s.location.hash.substring(1));return!d.startsWith("/")&&!d.startsWith(".")&&(d="/"+d),Mu("",{pathname:d,search:m,hash:g},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function o(s,c){let d=s.document.querySelector("base"),m="";if(d&&d.getAttribute("href")){let g=s.location.href,h=g.indexOf("#");m=h===-1?g:g.slice(0,h)}return m+"#"+(typeof c=="string"?c:Sl(c))}function l(s,c){nn(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(c)})`)}return qv(e,o,l,n)}function ot(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function nn(n,e){if(!n){typeof console<"u"&&console.warn(e);try{throw new Error(e)}catch{}}}function Gv(){return Math.random().toString(36).substring(2,10)}function $h(n,e){return{usr:n.state,key:n.key,idx:e}}function Mu(n,e,o=null,l){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof e=="string"?Si(e):e,state:o,key:e&&e.key||l||Gv()}}function Sl({pathname:n="/",search:e="",hash:o=""}){return e&&e!=="?"&&(n+=e.charAt(0)==="?"?e:"?"+e),o&&o!=="#"&&(n+=o.charAt(0)==="#"?o:"#"+o),n}function Si(n){let e={};if(n){let o=n.indexOf("#");o>=0&&(e.hash=n.substring(o),n=n.substring(0,o));let l=n.indexOf("?");l>=0&&(e.search=n.substring(l),n=n.substring(0,l)),n&&(e.pathname=n)}return e}function qv(n,e,o,l={}){let{window:s=document.defaultView,v5Compat:c=!1}=l,d=s.history,m="POP",g=null,h=v();h==null&&(h=0,d.replaceState({...d.state,idx:h},""));function v(){return(d.state||{idx:null}).idx}function T(){m="POP";let R=v(),x=R==null?null:R-h;h=R,g&&g({action:m,location:S.location,delta:x})}function _(R,x){m="PUSH";let b=Mu(S.location,R,x);o&&o(b,R),h=v()+1;let N=$h(b,h),z=S.createHref(b);try{d.pushState(N,"",z)}catch(k){if(k instanceof DOMException&&k.name==="DataCloneError")throw k;s.location.assign(z)}c&&g&&g({action:m,location:S.location,delta:1})}function C(R,x){m="REPLACE";let b=Mu(S.location,R,x);o&&o(b,R),h=v();let N=$h(b,h),z=S.createHref(b);d.replaceState(N,"",z),c&&g&&g({action:m,location:S.location,delta:0})}function M(R){return Fv(R)}let S={get action(){return m},get location(){return n(s,d)},listen(R){if(g)throw new Error("A history only accepts one active listener");return s.addEventListener(Qh,T),g=R,()=>{s.removeEventListener(Qh,T),g=null}},createHref(R){return e(s,R)},createURL:M,encodeLocation(R){let x=M(R);return{pathname:x.pathname,search:x.search,hash:x.hash}},push:_,replace:C,go(R){return d.go(R)}};return S}function Fv(n,e=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),ot(o,"No window.location.(origin|href) available to create URL");let l=typeof n=="string"?n:Sl(n);return l=l.replace(/ $/,"%20"),!e&&l.startsWith("//")&&(l=o+l),new URL(l,o)}function Ep(n,e,o="/"){return Ov(n,e,o,!1)}function Ov(n,e,o,l){let s=typeof e=="string"?Si(e):e,c=Rn(s.pathname||"/",o);if(c==null)return null;let d=Ap(n);Yv(d);let m=null;for(let g=0;m==null&&g<d.length;++g){let h=n0(c);m=e0(d[g],h,l)}return m}function Ap(n,e=[],o=[],l="",s=!1){let c=(d,m,g=s,h)=>{let v={relativePath:h===void 0?d.path||"":h,caseSensitive:d.caseSensitive===!0,childrenIndex:m,route:d};if(v.relativePath.startsWith("/")){if(!v.relativePath.startsWith(l)&&g)return;ot(v.relativePath.startsWith(l),`Absolute route path "${v.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),v.relativePath=v.relativePath.slice(l.length)}let T=Mn([l,v.relativePath]),_=o.concat(v);d.children&&d.children.length>0&&(ot(d.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${T}".`),Ap(d.children,e,_,T,g)),!(d.path==null&&!d.index)&&e.push({path:T,score:Wv(T,d.index),routesMeta:_})};return n.forEach((d,m)=>{var g;if(d.path===""||!((g=d.path)!=null&&g.includes("?")))c(d,m);else for(let h of xp(d.path))c(d,m,!0,h)}),e}function xp(n){let e=n.split("/");if(e.length===0)return[];let[o,...l]=e,s=o.endsWith("?"),c=o.replace(/\?$/,"");if(l.length===0)return s?[c,""]:[c];let d=xp(l.join("/")),m=[];return m.push(...d.map(g=>g===""?c:[c,g].join("/"))),s&&m.push(...d),m.map(g=>n.startsWith("/")&&g===""?"/":g)}function Yv(n){n.sort((e,o)=>e.score!==o.score?o.score-e.score:jv(e.routesMeta.map(l=>l.childrenIndex),o.routesMeta.map(l=>l.childrenIndex)))}var Jv=/^:[\w-]+$/,Kv=3,Zv=2,Xv=1,Qv=10,$v=-2,Wh=n=>n==="*";function Wv(n,e){let o=n.split("/"),l=o.length;return o.some(Wh)&&(l+=$v),e&&(l+=Zv),o.filter(s=>!Wh(s)).reduce((s,c)=>s+(Jv.test(c)?Kv:c===""?Xv:Qv),l)}function jv(n,e){return n.length===e.length&&n.slice(0,-1).every((l,s)=>l===e[s])?n[n.length-1]-e[e.length-1]:0}function e0(n,e,o=!1){let{routesMeta:l}=n,s={},c="/",d=[];for(let m=0;m<l.length;++m){let g=l[m],h=m===l.length-1,v=c==="/"?e:e.slice(c.length)||"/",T=Qa({path:g.relativePath,caseSensitive:g.caseSensitive,end:h},v),_=g.route;if(!T&&h&&o&&!l[l.length-1].route.index&&(T=Qa({path:g.relativePath,caseSensitive:g.caseSensitive,end:!1},v)),!T)return null;Object.assign(s,T.params),d.push({params:s,pathname:Mn([c,T.pathname]),pathnameBase:a0(Mn([c,T.pathnameBase])),route:_}),T.pathnameBase!=="/"&&(c=Mn([c,T.pathnameBase]))}return d}function Qa(n,e){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[o,l]=t0(n.path,n.caseSensitive,n.end),s=e.match(o);if(!s)return null;let c=s[0],d=c.replace(/(.)\/+$/,"$1"),m=s.slice(1);return{params:l.reduce((h,{paramName:v,isOptional:T},_)=>{if(v==="*"){let M=m[_]||"";d=c.slice(0,c.length-M.length).replace(/(.)\/+$/,"$1")}const C=m[_];return T&&!C?h[v]=void 0:h[v]=(C||"").replace(/%2F/g,"/"),h},{}),pathname:c,pathnameBase:d,pattern:n}}function t0(n,e=!1,o=!0){nn(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],s="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(d,m,g)=>(l.push({paramName:m,isOptional:g!=null}),g?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),s+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?s+="\\/*$":n!==""&&n!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,e?void 0:"i"),l]}function n0(n){try{return n.split("/").map(e=>decodeURIComponent(e).replace(/\//g,"%2F")).join("/")}catch(e){return nn(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${e}).`),n}}function Rn(n,e){if(e==="/")return n;if(!n.toLowerCase().startsWith(e.toLowerCase()))return null;let o=e.endsWith("/")?e.length-1:e.length,l=n.charAt(o);return l&&l!=="/"?null:n.slice(o)||"/"}function i0(n,e="/"){let{pathname:o,search:l="",hash:s=""}=typeof n=="string"?Si(n):n;return{pathname:o?o.startsWith("/")?o:o0(o,e):e,search:r0(l),hash:s0(s)}}function o0(n,e){let o=e.replace(/\/+$/,"").split("/");return n.split("/").forEach(s=>{s===".."?o.length>1&&o.pop():s!=="."&&o.push(s)}),o.length>1?o.join("/"):"/"}function Su(n,e,o,l){return`Cannot include a '${n}' character in a manually specified \`to.${e}\` field [${JSON.stringify(l)}].  Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function l0(n){return n.filter((e,o)=>o===0||e.route.path&&e.route.path.length>0)}function Mp(n){let e=l0(n);return e.map((o,l)=>l===e.length-1?o.pathname:o.pathnameBase)}function Rp(n,e,o,l=!1){let s;typeof n=="string"?s=Si(n):(s={...n},ot(!s.pathname||!s.pathname.includes("?"),Su("?","pathname","search",s)),ot(!s.pathname||!s.pathname.includes("#"),Su("#","pathname","hash",s)),ot(!s.search||!s.search.includes("#"),Su("#","search","hash",s)));let c=n===""||s.pathname==="",d=c?"/":s.pathname,m;if(d==null)m=o;else{let T=e.length-1;if(!l&&d.startsWith("..")){let _=d.split("/");for(;_[0]==="..";)_.shift(),T-=1;s.pathname=_.join("/")}m=T>=0?e[T]:"/"}let g=i0(s,m),h=d&&d!=="/"&&d.endsWith("/"),v=(c||d===".")&&o.endsWith("/");return!g.pathname.endsWith("/")&&(h||v)&&(g.pathname+="/"),g}var Mn=n=>n.join("/").replace(/\/\/+/g,"/"),a0=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),r0=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,s0=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n;function u0(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}var wp=["POST","PUT","PATCH","DELETE"];new Set(wp);var f0=["GET",...wp];new Set(f0);var vo=ae.createContext(null);vo.displayName="DataRouter";var er=ae.createContext(null);er.displayName="DataRouterState";ae.createContext(!1);var bp=ae.createContext({isTransitioning:!1});bp.displayName="ViewTransition";var c0=ae.createContext(new Map);c0.displayName="Fetchers";var d0=ae.createContext(null);d0.displayName="Await";var un=ae.createContext(null);un.displayName="Navigation";var Al=ae.createContext(null);Al.displayName="Location";var wn=ae.createContext({outlet:null,matches:[],isDataRoute:!1});wn.displayName="Route";var qu=ae.createContext(null);qu.displayName="RouteError";function h0(n,{relative:e}={}){ot(xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:l}=ae.useContext(un),{hash:s,pathname:c,search:d}=Ml(n,{relative:e}),m=c;return o!=="/"&&(m=c==="/"?o:Mn([o,c])),l.createHref({pathname:m,search:d,hash:s})}function xl(){return ae.useContext(Al)!=null}function Ei(){return ot(xl(),"useLocation() may be used only in the context of a <Router> component."),ae.useContext(Al).location}var Dp="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Np(n){ae.useContext(un).static||ae.useLayoutEffect(n)}function m0(){let{isDataRoute:n}=ae.useContext(wn);return n?R0():p0()}function p0(){ot(xl(),"useNavigate() may be used only in the context of a <Router> component.");let n=ae.useContext(vo),{basename:e,navigator:o}=ae.useContext(un),{matches:l}=ae.useContext(wn),{pathname:s}=Ei(),c=JSON.stringify(Mp(l)),d=ae.useRef(!1);return Np(()=>{d.current=!0}),ae.useCallback((g,h={})=>{if(nn(d.current,Dp),!d.current)return;if(typeof g=="number"){o.go(g);return}let v=Rp(g,JSON.parse(c),s,h.relative==="path");n==null&&e!=="/"&&(v.pathname=v.pathname==="/"?e:Mn([e,v.pathname])),(h.replace?o.replace:o.push)(v,h.state,h)},[e,o,c,s,n])}ae.createContext(null);function Ml(n,{relative:e}={}){let{matches:o}=ae.useContext(wn),{pathname:l}=Ei(),s=JSON.stringify(Mp(o));return ae.useMemo(()=>Rp(n,JSON.parse(s),l,e==="path"),[n,s,l,e])}function g0(n,e){return Ip(n,e)}function Ip(n,e,o,l){var x;ot(xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:s}=ae.useContext(un),{matches:c}=ae.useContext(wn),d=c[c.length-1],m=d?d.params:{},g=d?d.pathname:"/",h=d?d.pathnameBase:"/",v=d&&d.route;{let b=v&&v.path||"";Up(g,!v||b.endsWith("*")||b.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${b}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.

Please change the parent <Route path="${b}"> to <Route path="${b==="/"?"*":`${b}/*`}">.`)}let T=Ei(),_;if(e){let b=typeof e=="string"?Si(e):e;ot(h==="/"||((x=b.pathname)==null?void 0:x.startsWith(h)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${h}" but pathname "${b.pathname}" was given in the \`location\` prop.`),_=b}else _=T;let C=_.pathname||"/",M=C;if(h!=="/"){let b=h.replace(/^\//,"").split("/");M="/"+C.replace(/^\//,"").split("/").slice(b.length).join("/")}let S=Ep(n,{pathname:M});nn(v||S!=null,`No routes matched location "${_.pathname}${_.search}${_.hash}" `),nn(S==null||S[S.length-1].route.element!==void 0||S[S.length-1].route.Component!==void 0||S[S.length-1].route.lazy!==void 0,`Matched leaf route at location "${_.pathname}${_.search}${_.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let R=C0(S&&S.map(b=>Object.assign({},b,{params:Object.assign({},m,b.params),pathname:Mn([h,s.encodeLocation?s.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?h:Mn([h,s.encodeLocation?s.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),c,o,l);return e&&R?ae.createElement(Al.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",..._},navigationType:"POP"}},R):R}function y0(){let n=M0(),e=u0(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),o=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:l},c={padding:"2px 4px",backgroundColor:l},d=null;return console.error("Error handled by React Router default ErrorBoundary:",n),d=ae.createElement(ae.Fragment,null,ae.createElement("p",null,"💿 Hey developer 👋"),ae.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",ae.createElement("code",{style:c},"ErrorBoundary")," or"," ",ae.createElement("code",{style:c},"errorElement")," prop on your route.")),ae.createElement(ae.Fragment,null,ae.createElement("h2",null,"Unexpected Application Error!"),ae.createElement("h3",{style:{fontStyle:"italic"}},e),o?ae.createElement("pre",{style:s},o):null,d)}var v0=ae.createElement(y0,null),T0=class extends ae.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,e){return e.location!==n.location||e.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:e.error,location:e.location,revalidation:n.revalidation||e.revalidation}}componentDidCatch(n,e){console.error("React Router caught the following error during render",n,e)}render(){return this.state.error!==void 0?ae.createElement(wn.Provider,{value:this.props.routeContext},ae.createElement(qu.Provider,{value:this.state.error,children:this.props.component})):this.props.children}};function _0({routeContext:n,match:e,children:o}){let l=ae.useContext(vo);return l&&l.static&&l.staticContext&&(e.route.errorElement||e.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=e.route.id),ae.createElement(wn.Provider,{value:n},o)}function C0(n,e=[],o=null,l=null){if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(e.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let s=n,c=o==null?void 0:o.errors;if(c!=null){let g=s.findIndex(h=>h.route.id&&(c==null?void 0:c[h.route.id])!==void 0);ot(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(c).join(",")}`),s=s.slice(0,Math.min(s.length,g+1))}let d=!1,m=-1;if(o)for(let g=0;g<s.length;g++){let h=s[g];if((h.route.HydrateFallback||h.route.hydrateFallbackElement)&&(m=g),h.route.id){let{loaderData:v,errors:T}=o,_=h.route.loader&&!v.hasOwnProperty(h.route.id)&&(!T||T[h.route.id]===void 0);if(h.route.lazy||_){d=!0,m>=0?s=s.slice(0,m+1):s=[s[0]];break}}}return s.reduceRight((g,h,v)=>{let T,_=!1,C=null,M=null;o&&(T=c&&h.route.id?c[h.route.id]:void 0,C=h.route.errorElement||v0,d&&(m<0&&v===0?(Up("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),_=!0,M=null):m===v&&(_=!0,M=h.route.hydrateFallbackElement||null)));let S=e.concat(s.slice(0,v+1)),R=()=>{let x;return T?x=C:_?x=M:h.route.Component?x=ae.createElement(h.route.Component,null):h.route.element?x=h.route.element:x=g,ae.createElement(_0,{match:h,routeContext:{outlet:g,matches:S,isDataRoute:o!=null},children:x})};return o&&(h.route.ErrorBoundary||h.route.errorElement||v===0)?ae.createElement(T0,{location:o.location,revalidation:o.revalidation,component:C,error:T,children:R(),routeContext:{outlet:null,matches:S,isDataRoute:!0}}):R()},null)}function Fu(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function S0(n){let e=ae.useContext(vo);return ot(e,Fu(n)),e}function E0(n){let e=ae.useContext(er);return ot(e,Fu(n)),e}function A0(n){let e=ae.useContext(wn);return ot(e,Fu(n)),e}function Ou(n){let e=A0(n),o=e.matches[e.matches.length-1];return ot(o.route.id,`${n} can only be used on routes that contain a unique "id"`),o.route.id}function x0(){return Ou("useRouteId")}function M0(){var l;let n=ae.useContext(qu),e=E0("useRouteError"),o=Ou("useRouteError");return n!==void 0?n:(l=e.errors)==null?void 0:l[o]}function R0(){let{router:n}=S0("useNavigate"),e=Ou("useNavigate"),o=ae.useRef(!1);return Np(()=>{o.current=!0}),ae.useCallback(async(s,c={})=>{nn(o.current,Dp),o.current&&(typeof s=="number"?n.navigate(s):await n.navigate(s,{fromRouteId:e,...c}))},[n,e])}var jh={};function Up(n,e,o){!e&&!jh[n]&&(jh[n]=!0,nn(!1,o))}ae.memo(w0);function w0({routes:n,future:e,state:o}){return Ip(n,void 0,o,e)}function Ru(n){ot(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function b0({basename:n="/",children:e=null,location:o,navigationType:l="POP",navigator:s,static:c=!1}){ot(!xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=n.replace(/^\/*/,"/"),m=ae.useMemo(()=>({basename:d,navigator:s,static:c,future:{}}),[d,s,c]);typeof o=="string"&&(o=Si(o));let{pathname:g="/",search:h="",hash:v="",state:T=null,key:_="default"}=o,C=ae.useMemo(()=>{let M=Rn(g,d);return M==null?null:{location:{pathname:M,search:h,hash:v,state:T,key:_},navigationType:l}},[d,g,h,v,T,_,l]);return nn(C!=null,`<Router basename="${d}"> is not able to match the URL "${g}${h}${v}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:ae.createElement(un.Provider,{value:m},ae.createElement(Al.Provider,{children:e,value:C}))}function D0({children:n,location:e}){return g0(wu(n),e)}function wu(n,e=[]){let o=[];return ae.Children.forEach(n,(l,s)=>{if(!ae.isValidElement(l))return;let c=[...e,s];if(l.type===ae.Fragment){o.push.apply(o,wu(l.props.children,c));return}ot(l.type===Ru,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),ot(!l.props.index||!l.props.children,"An index route cannot have child routes.");let d={id:l.props.id||c.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(d.children=wu(l.props.children,c)),o.push(d)}),o}var Ya="get",Ja="application/x-www-form-urlencoded";function tr(n){return n!=null&&typeof n.tagName=="string"}function N0(n){return tr(n)&&n.tagName.toLowerCase()==="button"}function I0(n){return tr(n)&&n.tagName.toLowerCase()==="form"}function U0(n){return tr(n)&&n.tagName.toLowerCase()==="input"}function k0(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function L0(n,e){return n.button===0&&(!e||e==="_self")&&!k0(n)}var Ga=null;function P0(){if(Ga===null)try{new FormData(document.createElement("form"),0),Ga=!1}catch{Ga=!0}return Ga}var z0=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Eu(n){return n!=null&&!z0.has(n)?(nn(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ja}"`),null):n}function B0(n,e){let o,l,s,c,d;if(I0(n)){let m=n.getAttribute("action");l=m?Rn(m,e):null,o=n.getAttribute("method")||Ya,s=Eu(n.getAttribute("enctype"))||Ja,c=new FormData(n)}else if(N0(n)||U0(n)&&(n.type==="submit"||n.type==="image")){let m=n.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let g=n.getAttribute("formaction")||m.getAttribute("action");if(l=g?Rn(g,e):null,o=n.getAttribute("formmethod")||m.getAttribute("method")||Ya,s=Eu(n.getAttribute("formenctype"))||Eu(m.getAttribute("enctype"))||Ja,c=new FormData(m,n),!P0()){let{name:h,type:v,value:T}=n;if(v==="image"){let _=h?`${h}.`:"";c.append(`${_}x`,"0"),c.append(`${_}y`,"0")}else h&&c.append(h,T)}}else{if(tr(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Ya,l=null,s=Ja,d=n}return c&&s==="text/plain"&&(d=c,c=void 0),{action:l,method:o.toLowerCase(),encType:s,formData:c,body:d}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Yu(n,e){if(n===!1||n===null||typeof n>"u")throw new Error(e)}function V0(n,e,o){let l=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return l.pathname==="/"?l.pathname=`_root.${o}`:e&&Rn(l.pathname,e)==="/"?l.pathname=`${e.replace(/\/$/,"")}/_root.${o}`:l.pathname=`${l.pathname.replace(/\/$/,"")}.${o}`,l}async function H0(n,e){if(n.id in e)return e[n.id];try{let o=await import(n.module);return e[n.id]=o,o}catch(o){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function G0(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function q0(n,e,o){let l=await Promise.all(n.map(async s=>{let c=e.routes[s.route.id];if(c){let d=await H0(c,o);return d.links?d.links():[]}return[]}));return J0(l.flat(1).filter(G0).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function em(n,e,o,l,s,c){let d=(g,h)=>o[h]?g.route.id!==o[h].route.id:!0,m=(g,h)=>{var v;return o[h].pathname!==g.pathname||((v=o[h].route.path)==null?void 0:v.endsWith("*"))&&o[h].params["*"]!==g.params["*"]};return c==="assets"?e.filter((g,h)=>d(g,h)||m(g,h)):c==="data"?e.filter((g,h)=>{var T;let v=l.routes[g.route.id];if(!v||!v.hasLoader)return!1;if(d(g,h)||m(g,h))return!0;if(g.route.shouldRevalidate){let _=g.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((T=o[0])==null?void 0:T.params)||{},nextUrl:new URL(n,window.origin),nextParams:g.params,defaultShouldRevalidate:!0});if(typeof _=="boolean")return _}return!0}):[]}function F0(n,e,{includeHydrateFallback:o}={}){return O0(n.map(l=>{let s=e.routes[l.route.id];if(!s)return[];let c=[s.module];return s.clientActionModule&&(c=c.concat(s.clientActionModule)),s.clientLoaderModule&&(c=c.concat(s.clientLoaderModule)),o&&s.hydrateFallbackModule&&(c=c.concat(s.hydrateFallbackModule)),s.imports&&(c=c.concat(s.imports)),c}).flat(1))}function O0(n){return[...new Set(n)]}function Y0(n){let e={},o=Object.keys(n).sort();for(let l of o)e[l]=n[l];return e}function J0(n,e){let o=new Set;return new Set(e),n.reduce((l,s)=>{let c=JSON.stringify(Y0(s));return o.has(c)||(o.add(c),l.push({key:c,link:s})),l},[])}function kp(){let n=ae.useContext(vo);return Yu(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function K0(){let n=ae.useContext(er);return Yu(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Ju=ae.createContext(void 0);Ju.displayName="FrameworkContext";function Lp(){let n=ae.useContext(Ju);return Yu(n,"You must render this element inside a <HydratedRouter> element"),n}function Z0(n,e){let o=ae.useContext(Ju),[l,s]=ae.useState(!1),[c,d]=ae.useState(!1),{onFocus:m,onBlur:g,onMouseEnter:h,onMouseLeave:v,onTouchStart:T}=e,_=ae.useRef(null);ae.useEffect(()=>{if(n==="render"&&d(!0),n==="viewport"){let S=x=>{x.forEach(b=>{d(b.isIntersecting)})},R=new IntersectionObserver(S,{threshold:.5});return _.current&&R.observe(_.current),()=>{R.disconnect()}}},[n]),ae.useEffect(()=>{if(l){let S=setTimeout(()=>{d(!0)},100);return()=>{clearTimeout(S)}}},[l]);let C=()=>{s(!0)},M=()=>{s(!1),d(!1)};return o?n!=="intent"?[c,_,{}]:[c,_,{onFocus:Tl(m,C),onBlur:Tl(g,M),onMouseEnter:Tl(h,C),onMouseLeave:Tl(v,M),onTouchStart:Tl(T,C)}]:[!1,_,{}]}function Tl(n,e){return o=>{n&&n(o),o.defaultPrevented||e(o)}}function X0({page:n,...e}){let{router:o}=kp(),l=ae.useMemo(()=>Ep(o.routes,n,o.basename),[o.routes,n,o.basename]);return l?ae.createElement($0,{page:n,matches:l,...e}):null}function Q0(n){let{manifest:e,routeModules:o}=Lp(),[l,s]=ae.useState([]);return ae.useEffect(()=>{let c=!1;return q0(n,e,o).then(d=>{c||s(d)}),()=>{c=!0}},[n,e,o]),l}function $0({page:n,matches:e,...o}){let l=Ei(),{manifest:s,routeModules:c}=Lp(),{basename:d}=kp(),{loaderData:m,matches:g}=K0(),h=ae.useMemo(()=>em(n,e,g,s,l,"data"),[n,e,g,s,l]),v=ae.useMemo(()=>em(n,e,g,s,l,"assets"),[n,e,g,s,l]),T=ae.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let M=new Set,S=!1;if(e.forEach(x=>{var N;let b=s.routes[x.route.id];!b||!b.hasLoader||(!h.some(z=>z.route.id===x.route.id)&&x.route.id in m&&((N=c[x.route.id])!=null&&N.shouldRevalidate)||b.hasClientLoader?S=!0:M.add(x.route.id))}),M.size===0)return[];let R=V0(n,d,"data");return S&&M.size>0&&R.searchParams.set("_routes",e.filter(x=>M.has(x.route.id)).map(x=>x.route.id).join(",")),[R.pathname+R.search]},[d,m,l,s,h,e,n,c]),_=ae.useMemo(()=>F0(v,s),[v,s]),C=Q0(v);return ae.createElement(ae.Fragment,null,T.map(M=>ae.createElement("link",{key:M,rel:"prefetch",as:"fetch",href:M,...o})),_.map(M=>ae.createElement("link",{key:M,rel:"modulepreload",href:M,...o})),C.map(({key:M,link:S})=>ae.createElement("link",{key:M,nonce:o.nonce,...S})))}function W0(...n){return e=>{n.forEach(o=>{typeof o=="function"?o(e):o!=null&&(o.current=e)})}}var Pp=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Pp&&(window.__reactRouterVersion="7.8.1")}catch{}function j0({basename:n,children:e,window:o}){let l=ae.useRef();l.current==null&&(l.current=Hv({window:o,v5Compat:!0}));let s=l.current,[c,d]=ae.useState({action:s.action,location:s.location}),m=ae.useCallback(g=>{ae.startTransition(()=>d(g))},[d]);return ae.useLayoutEffect(()=>s.listen(m),[s,m]),ae.createElement(b0,{basename:n,children:e,location:c.location,navigationType:c.action,navigator:s})}var zp=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,El=ae.forwardRef(function({onClick:e,discover:o="render",prefetch:l="none",relative:s,reloadDocument:c,replace:d,state:m,target:g,to:h,preventScrollReset:v,viewTransition:T,..._},C){let{basename:M}=ae.useContext(un),S=typeof h=="string"&&zp.test(h),R,x=!1;if(typeof h=="string"&&S&&(R=h,Pp))try{let q=new URL(window.location.href),re=h.startsWith("//")?new URL(q.protocol+h):new URL(h),ye=Rn(re.pathname,M);re.origin===q.origin&&ye!=null?h=ye+re.search+re.hash:x=!0}catch{nn(!1,`<Link to="${h}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}let b=h0(h,{relative:s}),[N,z,k]=Z0(l,_),X=iT(h,{replace:d,state:m,target:g,preventScrollReset:v,relative:s,viewTransition:T});function Y(q){e&&e(q),q.defaultPrevented||X(q)}let oe=ae.createElement("a",{..._,...k,href:R||b,onClick:x||c?e:Y,ref:W0(C,z),target:g,"data-discover":!S&&o==="render"?"true":void 0});return N&&!S?ae.createElement(ae.Fragment,null,oe,ae.createElement(X0,{page:b})):oe});El.displayName="Link";var eT=ae.forwardRef(function({"aria-current":e="page",caseSensitive:o=!1,className:l="",end:s=!1,style:c,to:d,viewTransition:m,children:g,...h},v){let T=Ml(d,{relative:h.relative}),_=Ei(),C=ae.useContext(er),{navigator:M,basename:S}=ae.useContext(un),R=C!=null&&sT(T)&&m===!0,x=M.encodeLocation?M.encodeLocation(T).pathname:T.pathname,b=_.pathname,N=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;o||(b=b.toLowerCase(),N=N?N.toLowerCase():null,x=x.toLowerCase()),N&&S&&(N=Rn(N,S)||N);const z=x!=="/"&&x.endsWith("/")?x.length-1:x.length;let k=b===x||!s&&b.startsWith(x)&&b.charAt(z)==="/",X=N!=null&&(N===x||!s&&N.startsWith(x)&&N.charAt(x.length)==="/"),Y={isActive:k,isPending:X,isTransitioning:R},oe=k?e:void 0,q;typeof l=="function"?q=l(Y):q=[l,k?"active":null,X?"pending":null,R?"transitioning":null].filter(Boolean).join(" ");let re=typeof c=="function"?c(Y):c;return ae.createElement(El,{...h,"aria-current":oe,className:q,ref:v,style:re,to:d,viewTransition:m},typeof g=="function"?g(Y):g)});eT.displayName="NavLink";var tT=ae.forwardRef(({discover:n="render",fetcherKey:e,navigate:o,reloadDocument:l,replace:s,state:c,method:d=Ya,action:m,onSubmit:g,relative:h,preventScrollReset:v,viewTransition:T,..._},C)=>{let M=aT(),S=rT(m,{relative:h}),R=d.toLowerCase()==="get"?"get":"post",x=typeof m=="string"&&zp.test(m),b=N=>{if(g&&g(N),N.defaultPrevented)return;N.preventDefault();let z=N.nativeEvent.submitter,k=(z==null?void 0:z.getAttribute("formmethod"))||d;M(z||N.currentTarget,{fetcherKey:e,method:k,navigate:o,replace:s,state:c,relative:h,preventScrollReset:v,viewTransition:T})};return ae.createElement("form",{ref:C,method:R,action:S,onSubmit:l?g:b,..._,"data-discover":!x&&n==="render"?"true":void 0})});tT.displayName="Form";function nT(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function Bp(n){let e=ae.useContext(vo);return ot(e,nT(n)),e}function iT(n,{target:e,replace:o,state:l,preventScrollReset:s,relative:c,viewTransition:d}={}){let m=m0(),g=Ei(),h=Ml(n,{relative:c});return ae.useCallback(v=>{if(L0(v,e)){v.preventDefault();let T=o!==void 0?o:Sl(g)===Sl(h);m(n,{replace:T,state:l,preventScrollReset:s,relative:c,viewTransition:d})}},[g,m,h,o,l,e,n,s,c,d])}var oT=0,lT=()=>`__${String(++oT)}__`;function aT(){let{router:n}=Bp("useSubmit"),{basename:e}=ae.useContext(un),o=x0();return ae.useCallback(async(l,s={})=>{let{action:c,method:d,encType:m,formData:g,body:h}=B0(l,e);if(s.navigate===!1){let v=s.fetcherKey||lT();await n.fetch(v,o,s.action||c,{preventScrollReset:s.preventScrollReset,formData:g,body:h,formMethod:s.method||d,formEncType:s.encType||m,flushSync:s.flushSync})}else await n.navigate(s.action||c,{preventScrollReset:s.preventScrollReset,formData:g,body:h,formMethod:s.method||d,formEncType:s.encType||m,replace:s.replace,state:s.state,fromRouteId:o,flushSync:s.flushSync,viewTransition:s.viewTransition})},[n,e,o])}function rT(n,{relative:e}={}){let{basename:o}=ae.useContext(un),l=ae.useContext(wn);ot(l,"useFormAction must be used inside a RouteContext");let[s]=l.matches.slice(-1),c={...Ml(n||".",{relative:e})},d=Ei();if(n==null){c.search=d.search;let m=new URLSearchParams(c.search),g=m.getAll("index");if(g.some(v=>v==="")){m.delete("index"),g.filter(T=>T).forEach(T=>m.append("index",T));let v=m.toString();c.search=v?`?${v}`:""}}return(!n||n===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(c.pathname=c.pathname==="/"?o:Mn([o,c.pathname])),Sl(c)}function sT(n,{relative:e}={}){let o=ae.useContext(bp);ot(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=Bp("useViewTransitionState"),s=Ml(n,{relative:e});if(!o.isTransitioning)return!1;let c=Rn(o.currentLocation.pathname,l)||o.currentLocation.pathname,d=Rn(o.nextLocation.pathname,l)||o.nextLocation.pathname;return Qa(s.pathname,d)!=null||Qa(s.pathname,c)!=null}const Ku=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("polyline",{points:"16 18 22 12 16 6"}),$.jsx("polyline",{points:"8 6 2 12 8 18"})]}),uT=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 0 2l-.15.08a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.38a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1 0-2l.15-.08a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z"}),$.jsx("circle",{cx:"12",cy:"12",r:"3"})]}),fT=()=>$.jsx("header",{className:"bg-gray-800 shadow-md",children:$.jsx("nav",{className:"container mx-auto px-4 sm:px-6 lg:px-8",children:$.jsxs("div",{className:"flex items-center justify-between h-16",children:[$.jsx("div",{className:"flex items-center",children:$.jsxs(El,{to:"/",className:"flex-shrink-0 text-white font-bold text-xl flex items-center gap-2",children:[$.jsx(Ku,{className:"h-8 w-8 text-primary"}),"Interactive Builder"]})}),$.jsx("div",{className:"flex items-center",children:$.jsx(El,{to:"/settings",className:"text-gray-400 hover:text-white p-2 rounded-full transition-colors","aria-label":"Go to Settings",children:$.jsx(uT,{className:"h-6 w-6"})})})]})})}),cT=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("path",{d:"M20 8.54V4a2 2 0 0 0-2-2H6a2 2 0 0 0-2 2v4.54"}),$.jsx("path",{d:"M12 22a4 4 0 0 0 4-4H8a4 4 0 0 0 4 4Z"}),$.jsx("path",{d:"M2 12h2"}),$.jsx("path",{d:"M20 12h2"}),$.jsx("path",{d:"M15 12a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z"})]}),dT=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("circle",{cx:"12",cy:"12",r:"2"}),$.jsx("path",{d:"M12 2a10 10 0 0 0-3.38 19.53"}),$.jsx("path",{d:"M12 2a10 10 0 0 1 3.38 19.53"}),$.jsx("path",{d:"M2 12a10 10 0 0 0 19.53 3.38"}),$.jsx("path",{d:"M2 12a10 10 0 0 1 19.53-3.38"})]}),hT=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("path",{d:"M3 3v18h18"}),$.jsx("path",{d:"m19 9-5 5-4-4-3 3"})]}),mT=({className:n})=>$.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:$.jsx("path",{d:"M12 2a4 4 0 0 0-4 4v2H4a4 4 0 0 0-4 4v2a4 4 0 0 0 4 4h4v2a4 4 0 0 0 8 0v-2h4a4 4 0 0 0 4-4v-2a4 4 0 0 0-4-4h-4V6a4 4 0 0 0-4-4z"})}),pT=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2",ry:"2"}),$.jsx("circle",{cx:"8.5",cy:"8.5",r:"1.5"}),$.jsx("polyline",{points:"21 15 16 10 5 21"})]}),gT=[{id:"simple-game",title:"Simple Game",description:"Create a gamified learning experience with scoring and real-time analytics.",icon:cT,promptTemplate:`Create a simple game for a gamified learning experience.

Topic: [Simple Fractional Equations]
Level: [Sec 1 Mathematics (G3)]

Instructions:
- Score should not go higher than 99 maximum marks.
- Add real-time data analytics of the chain of actions (corrects and wrongs) at every question to allow the teacher to see the misconception of the student.
- The analytics should show: the question, the correct answer, what the student chose, and a correct/wrong mark with clear unicode color coding.
`},{id:"simple-simulation",title:"Simple Simulation",description:"A physics simulation of light, objects, and shadows with draggable elements.",icon:dT,promptTemplate:`Create a fully interactive and realistic simulation of light and shadows.

Elements:
- On the left, a point/beam light source emitting 2 straight light path lines that touch the top and bottom of the object.
- In the center, an opaque object (selectable via a dropdown: cube, sphere) casting a shadow.
- On the right, a screen for the shadow to be cast upon.

Interactivity:
- Allow dragging the light source, object, and screen along the x-axis only.
- The physics of straight-line light projection must be obeyed and updated in real-time during dragging.
- For a cube, light rays should emanate from the edges.
- For a sphere, calculate the tangent for the light path accurately.
- Include interactive controls: [Play, Pause, Reset] in a top control panel.

Focus on scientific accuracy appropriate for primary school students.
`},{id:"data-visualization",title:"Data Visualisation",description:"Generate interactive charts and graphs to explore datasets and reveal patterns.",icon:hT,promptTemplate:`Create an interactive data visualization.

Topic / Dataset: [Singapore Population Trends 1980-2020]
Target Audience: [Students aged 12 to 18]

Data to Display:
- Numerical: [Population Count]
- Categorical: [e.g., Age Group]
- Temporal: [Year]

Key Patterns to Highlight:
- [Growth trend over time]
- [Comparison between categories]

Visualization & Interaction:
- Chart Type: [Line Chart]
- Filtering: [Filter by Year Range (Slider)]
- Interaction: [Hover on data points for tooltips with detailed info, Click on legend items to toggle visibility]
`},{id:"mind-map",title:"Mind Map",description:"Design a mind map with a central idea, main branches, and draggable nodes.",icon:mT,promptTemplate:`Create an interactive mind map.

Topic: [Speed and Velocity]
Audience: [Primary School Students]

Structure:
- Central idea: [Speed and Velocity]
- Main branches: [e.g., Definition, Formula, Units, Examples]
- Sub-branches: Supporting details for each main branch.
- Draw connection lines between related concepts.

Interactivity:
- Allow users to drag and reposition the bubbles (nodes).
- The layout should use the available width effectively.
`},{id:"explanation-interactive",title:"Explanation Interactive",description:"Create a step-by-step interactive explanation for a math or science problem.",icon:Ku,promptTemplate:`Create an interactive with explaining steps for a math problem.

Problem: Express x/2 + x/6 as a single fraction in its simplest form.

Instructions:
- Break down the solution into clear, incremental steps.
- Each step should be revealed one by one with a "Next" button.
- Use clear visual displays for fractions and mathematical operations.
- Ensure visuals do not overlap and are easy to read.
`},{id:"image-to-interactive",title:"Image to Interactive",description:"Generate an interactive math manipulative from an image.",icon:pT,promptTemplate:`Based on the provided image, design a clear, interactive math manipulative that visually illustrates a key concept from the image.
- Make the explanation steps incremental to help students understand.
- Ensure the visual display does not overlap and cause issues with viewing it clearly.
- If the image content is insufficient to create a meaningful interactive, state that clearly in the output.
`}],yT=({recipe:n,isSelected:e,onSelect:o})=>{const l=n.icon,s=`
    p-4 rounded-lg border-2 cursor-pointer transition-all duration-200
    flex flex-col items-center text-center gap-2
    ${e?"bg-primary/20 border-primary shadow-lg scale-105":"bg-gray-800 border-gray-700 hover:border-primary/50 hover:bg-gray-700"}
  `;return $.jsxs("div",{className:s,onClick:()=>o(n),children:[$.jsx(l,{className:`w-8 h-8 mb-2 ${e?"text-primary":"text-gray-400"}`}),$.jsx("h3",{className:"font-semibold text-sm text-white",children:n.title}),$.jsx("p",{className:"text-xs text-gray-400 hidden md:block",children:n.description})]})};function qa(n){throw new Error('Could not dynamically require "'+n+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Au={exports:{}};/*!

JSZip v3.10.1 - A JavaScript class for generating and reading zip files
<http://stuartk.com/jszip>

(c) 2009-2016 Stuart Knightley <stuart [at] stuartk.com>
Dual licenced under the MIT license or GPLv3. See https://raw.github.com/Stuk/jszip/main/LICENSE.markdown.

JSZip uses the library pako released under the MIT license :
https://github.com/nodeca/pako/blob/main/LICENSE
*/var tm;function vT(){return tm||(tm=1,(function(n,e){(function(o){n.exports=o()})(function(){return(function o(l,s,c){function d(h,v){if(!s[h]){if(!l[h]){var T=typeof qa=="function"&&qa;if(!v&&T)return T(h,!0);if(m)return m(h,!0);var _=new Error("Cannot find module '"+h+"'");throw _.code="MODULE_NOT_FOUND",_}var C=s[h]={exports:{}};l[h][0].call(C.exports,function(M){var S=l[h][1][M];return d(S||M)},C,C.exports,o,l,s,c)}return s[h].exports}for(var m=typeof qa=="function"&&qa,g=0;g<c.length;g++)d(c[g]);return d})({1:[function(o,l,s){var c=o("./utils"),d=o("./support"),m="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";s.encode=function(g){for(var h,v,T,_,C,M,S,R=[],x=0,b=g.length,N=b,z=c.getTypeOf(g)!=="string";x<g.length;)N=b-x,T=z?(h=g[x++],v=x<b?g[x++]:0,x<b?g[x++]:0):(h=g.charCodeAt(x++),v=x<b?g.charCodeAt(x++):0,x<b?g.charCodeAt(x++):0),_=h>>2,C=(3&h)<<4|v>>4,M=1<N?(15&v)<<2|T>>6:64,S=2<N?63&T:64,R.push(m.charAt(_)+m.charAt(C)+m.charAt(M)+m.charAt(S));return R.join("")},s.decode=function(g){var h,v,T,_,C,M,S=0,R=0,x="data:";if(g.substr(0,x.length)===x)throw new Error("Invalid base64 input, it looks like a data url.");var b,N=3*(g=g.replace(/[^A-Za-z0-9+/=]/g,"")).length/4;if(g.charAt(g.length-1)===m.charAt(64)&&N--,g.charAt(g.length-2)===m.charAt(64)&&N--,N%1!=0)throw new Error("Invalid base64 input, bad content length.");for(b=d.uint8array?new Uint8Array(0|N):new Array(0|N);S<g.length;)h=m.indexOf(g.charAt(S++))<<2|(_=m.indexOf(g.charAt(S++)))>>4,v=(15&_)<<4|(C=m.indexOf(g.charAt(S++)))>>2,T=(3&C)<<6|(M=m.indexOf(g.charAt(S++))),b[R++]=h,C!==64&&(b[R++]=v),M!==64&&(b[R++]=T);return b}},{"./support":30,"./utils":32}],2:[function(o,l,s){var c=o("./external"),d=o("./stream/DataWorker"),m=o("./stream/Crc32Probe"),g=o("./stream/DataLengthProbe");function h(v,T,_,C,M){this.compressedSize=v,this.uncompressedSize=T,this.crc32=_,this.compression=C,this.compressedContent=M}h.prototype={getContentWorker:function(){var v=new d(c.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new g("data_length")),T=this;return v.on("end",function(){if(this.streamInfo.data_length!==T.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")}),v},getCompressedWorker:function(){return new d(c.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},h.createWorkerFrom=function(v,T,_){return v.pipe(new m).pipe(new g("uncompressedSize")).pipe(T.compressWorker(_)).pipe(new g("compressedSize")).withStreamInfo("compression",T)},l.exports=h},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(o,l,s){var c=o("./stream/GenericWorker");s.STORE={magic:"\0\0",compressWorker:function(){return new c("STORE compression")},uncompressWorker:function(){return new c("STORE decompression")}},s.DEFLATE=o("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(o,l,s){var c=o("./utils"),d=(function(){for(var m,g=[],h=0;h<256;h++){m=h;for(var v=0;v<8;v++)m=1&m?3988292384^m>>>1:m>>>1;g[h]=m}return g})();l.exports=function(m,g){return m!==void 0&&m.length?c.getTypeOf(m)!=="string"?(function(h,v,T,_){var C=d,M=_+T;h^=-1;for(var S=_;S<M;S++)h=h>>>8^C[255&(h^v[S])];return-1^h})(0|g,m,m.length,0):(function(h,v,T,_){var C=d,M=_+T;h^=-1;for(var S=_;S<M;S++)h=h>>>8^C[255&(h^v.charCodeAt(S))];return-1^h})(0|g,m,m.length,0):0}},{"./utils":32}],5:[function(o,l,s){s.base64=!1,s.binary=!1,s.dir=!1,s.createFolders=!0,s.date=null,s.compression=null,s.compressionOptions=null,s.comment=null,s.unixPermissions=null,s.dosPermissions=null},{}],6:[function(o,l,s){var c=null;c=typeof Promise<"u"?Promise:o("lie"),l.exports={Promise:c}},{lie:37}],7:[function(o,l,s){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Uint32Array<"u",d=o("pako"),m=o("./utils"),g=o("./stream/GenericWorker"),h=c?"uint8array":"array";function v(T,_){g.call(this,"FlateWorker/"+T),this._pako=null,this._pakoAction=T,this._pakoOptions=_,this.meta={}}s.magic="\b\0",m.inherits(v,g),v.prototype.processChunk=function(T){this.meta=T.meta,this._pako===null&&this._createPako(),this._pako.push(m.transformTo(h,T.data),!1)},v.prototype.flush=function(){g.prototype.flush.call(this),this._pako===null&&this._createPako(),this._pako.push([],!0)},v.prototype.cleanUp=function(){g.prototype.cleanUp.call(this),this._pako=null},v.prototype._createPako=function(){this._pako=new d[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var T=this;this._pako.onData=function(_){T.push({data:_,meta:T.meta})}},s.compressWorker=function(T){return new v("Deflate",T)},s.uncompressWorker=function(){return new v("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(o,l,s){function c(C,M){var S,R="";for(S=0;S<M;S++)R+=String.fromCharCode(255&C),C>>>=8;return R}function d(C,M,S,R,x,b){var N,z,k=C.file,X=C.compression,Y=b!==h.utf8encode,oe=m.transformTo("string",b(k.name)),q=m.transformTo("string",h.utf8encode(k.name)),re=k.comment,ye=m.transformTo("string",b(re)),B=m.transformTo("string",h.utf8encode(re)),le=q.length!==k.name.length,w=B.length!==re.length,te="",J="",K="",ve=k.dir,fe=k.date,I={crc32:0,compressedSize:0,uncompressedSize:0};M&&!S||(I.crc32=C.crc32,I.compressedSize=C.compressedSize,I.uncompressedSize=C.uncompressedSize);var P=0;M&&(P|=8),Y||!le&&!w||(P|=2048);var H=0,ie=0;ve&&(H|=16),x==="UNIX"?(ie=798,H|=(function(he,Ce){var He=he;return he||(He=Ce?16893:33204),(65535&He)<<16})(k.unixPermissions,ve)):(ie=20,H|=(function(he){return 63&(he||0)})(k.dosPermissions)),N=fe.getUTCHours(),N<<=6,N|=fe.getUTCMinutes(),N<<=5,N|=fe.getUTCSeconds()/2,z=fe.getUTCFullYear()-1980,z<<=4,z|=fe.getUTCMonth()+1,z<<=5,z|=fe.getUTCDate(),le&&(J=c(1,1)+c(v(oe),4)+q,te+="up"+c(J.length,2)+J),w&&(K=c(1,1)+c(v(ye),4)+B,te+="uc"+c(K.length,2)+K);var se="";return se+=`
\0`,se+=c(P,2),se+=X.magic,se+=c(N,2),se+=c(z,2),se+=c(I.crc32,4),se+=c(I.compressedSize,4),se+=c(I.uncompressedSize,4),se+=c(oe.length,2),se+=c(te.length,2),{fileRecord:T.LOCAL_FILE_HEADER+se+oe+te,dirRecord:T.CENTRAL_FILE_HEADER+c(ie,2)+se+c(ye.length,2)+"\0\0\0\0"+c(H,4)+c(R,4)+oe+te+ye}}var m=o("../utils"),g=o("../stream/GenericWorker"),h=o("../utf8"),v=o("../crc32"),T=o("../signature");function _(C,M,S,R){g.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=M,this.zipPlatform=S,this.encodeFileName=R,this.streamFiles=C,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}m.inherits(_,g),_.prototype.push=function(C){var M=C.meta.percent||0,S=this.entriesCount,R=this._sources.length;this.accumulate?this.contentBuffer.push(C):(this.bytesWritten+=C.data.length,g.prototype.push.call(this,{data:C.data,meta:{currentFile:this.currentFile,percent:S?(M+100*(S-R-1))/S:100}}))},_.prototype.openedSource=function(C){this.currentSourceOffset=this.bytesWritten,this.currentFile=C.file.name;var M=this.streamFiles&&!C.file.dir;if(M){var S=d(C,M,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:S.fileRecord,meta:{percent:0}})}else this.accumulate=!0},_.prototype.closedSource=function(C){this.accumulate=!1;var M=this.streamFiles&&!C.file.dir,S=d(C,M,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(S.dirRecord),M)this.push({data:(function(R){return T.DATA_DESCRIPTOR+c(R.crc32,4)+c(R.compressedSize,4)+c(R.uncompressedSize,4)})(C),meta:{percent:100}});else for(this.push({data:S.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},_.prototype.flush=function(){for(var C=this.bytesWritten,M=0;M<this.dirRecords.length;M++)this.push({data:this.dirRecords[M],meta:{percent:100}});var S=this.bytesWritten-C,R=(function(x,b,N,z,k){var X=m.transformTo("string",k(z));return T.CENTRAL_DIRECTORY_END+"\0\0\0\0"+c(x,2)+c(x,2)+c(b,4)+c(N,4)+c(X.length,2)+X})(this.dirRecords.length,S,C,this.zipComment,this.encodeFileName);this.push({data:R,meta:{percent:100}})},_.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},_.prototype.registerPrevious=function(C){this._sources.push(C);var M=this;return C.on("data",function(S){M.processChunk(S)}),C.on("end",function(){M.closedSource(M.previous.streamInfo),M._sources.length?M.prepareNextSource():M.end()}),C.on("error",function(S){M.error(S)}),this},_.prototype.resume=function(){return!!g.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},_.prototype.error=function(C){var M=this._sources;if(!g.prototype.error.call(this,C))return!1;for(var S=0;S<M.length;S++)try{M[S].error(C)}catch{}return!0},_.prototype.lock=function(){g.prototype.lock.call(this);for(var C=this._sources,M=0;M<C.length;M++)C[M].lock()},l.exports=_},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(o,l,s){var c=o("../compressions"),d=o("./ZipFileWorker");s.generateWorker=function(m,g,h){var v=new d(g.streamFiles,h,g.platform,g.encodeFileName),T=0;try{m.forEach(function(_,C){T++;var M=(function(b,N){var z=b||N,k=c[z];if(!k)throw new Error(z+" is not a valid compression method !");return k})(C.options.compression,g.compression),S=C.options.compressionOptions||g.compressionOptions||{},R=C.dir,x=C.date;C._compressWorker(M,S).withStreamInfo("file",{name:_,dir:R,date:x,comment:C.comment||"",unixPermissions:C.unixPermissions,dosPermissions:C.dosPermissions}).pipe(v)}),v.entriesCount=T}catch(_){v.error(_)}return v}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(o,l,s){function c(){if(!(this instanceof c))return new c;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var d=new c;for(var m in this)typeof this[m]!="function"&&(d[m]=this[m]);return d}}(c.prototype=o("./object")).loadAsync=o("./load"),c.support=o("./support"),c.defaults=o("./defaults"),c.version="3.10.1",c.loadAsync=function(d,m){return new c().loadAsync(d,m)},c.external=o("./external"),l.exports=c},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(o,l,s){var c=o("./utils"),d=o("./external"),m=o("./utf8"),g=o("./zipEntries"),h=o("./stream/Crc32Probe"),v=o("./nodejsUtils");function T(_){return new d.Promise(function(C,M){var S=_.decompressed.getContentWorker().pipe(new h);S.on("error",function(R){M(R)}).on("end",function(){S.streamInfo.crc32!==_.decompressed.crc32?M(new Error("Corrupted zip : CRC32 mismatch")):C()}).resume()})}l.exports=function(_,C){var M=this;return C=c.extend(C||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:m.utf8decode}),v.isNode&&v.isStream(_)?d.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):c.prepareContent("the loaded zip file",_,!0,C.optimizedBinaryString,C.base64).then(function(S){var R=new g(C);return R.load(S),R}).then(function(S){var R=[d.Promise.resolve(S)],x=S.files;if(C.checkCRC32)for(var b=0;b<x.length;b++)R.push(T(x[b]));return d.Promise.all(R)}).then(function(S){for(var R=S.shift(),x=R.files,b=0;b<x.length;b++){var N=x[b],z=N.fileNameStr,k=c.resolve(N.fileNameStr);M.file(k,N.decompressed,{binary:!0,optimizedBinaryString:!0,date:N.date,dir:N.dir,comment:N.fileCommentStr.length?N.fileCommentStr:null,unixPermissions:N.unixPermissions,dosPermissions:N.dosPermissions,createFolders:C.createFolders}),N.dir||(M.file(k).unsafeOriginalName=z)}return R.zipComment.length&&(M.comment=R.zipComment),M})}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(o,l,s){var c=o("../utils"),d=o("../stream/GenericWorker");function m(g,h){d.call(this,"Nodejs stream input adapter for "+g),this._upstreamEnded=!1,this._bindStream(h)}c.inherits(m,d),m.prototype._bindStream=function(g){var h=this;(this._stream=g).pause(),g.on("data",function(v){h.push({data:v,meta:{percent:0}})}).on("error",function(v){h.isPaused?this.generatedError=v:h.error(v)}).on("end",function(){h.isPaused?h._upstreamEnded=!0:h.end()})},m.prototype.pause=function(){return!!d.prototype.pause.call(this)&&(this._stream.pause(),!0)},m.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},l.exports=m},{"../stream/GenericWorker":28,"../utils":32}],13:[function(o,l,s){var c=o("readable-stream").Readable;function d(m,g,h){c.call(this,g),this._helper=m;var v=this;m.on("data",function(T,_){v.push(T)||v._helper.pause(),h&&h(_)}).on("error",function(T){v.emit("error",T)}).on("end",function(){v.push(null)})}o("../utils").inherits(d,c),d.prototype._read=function(){this._helper.resume()},l.exports=d},{"../utils":32,"readable-stream":16}],14:[function(o,l,s){l.exports={isNode:typeof Buffer<"u",newBufferFrom:function(c,d){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(c,d);if(typeof c=="number")throw new Error('The "data" argument must not be a number');return new Buffer(c,d)},allocBuffer:function(c){if(Buffer.alloc)return Buffer.alloc(c);var d=new Buffer(c);return d.fill(0),d},isBuffer:function(c){return Buffer.isBuffer(c)},isStream:function(c){return c&&typeof c.on=="function"&&typeof c.pause=="function"&&typeof c.resume=="function"}}},{}],15:[function(o,l,s){function c(k,X,Y){var oe,q=m.getTypeOf(X),re=m.extend(Y||{},v);re.date=re.date||new Date,re.compression!==null&&(re.compression=re.compression.toUpperCase()),typeof re.unixPermissions=="string"&&(re.unixPermissions=parseInt(re.unixPermissions,8)),re.unixPermissions&&16384&re.unixPermissions&&(re.dir=!0),re.dosPermissions&&16&re.dosPermissions&&(re.dir=!0),re.dir&&(k=x(k)),re.createFolders&&(oe=R(k))&&b.call(this,oe,!0);var ye=q==="string"&&re.binary===!1&&re.base64===!1;Y&&Y.binary!==void 0||(re.binary=!ye),(X instanceof T&&X.uncompressedSize===0||re.dir||!X||X.length===0)&&(re.base64=!1,re.binary=!0,X="",re.compression="STORE",q="string");var B=null;B=X instanceof T||X instanceof g?X:M.isNode&&M.isStream(X)?new S(k,X):m.prepareContent(k,X,re.binary,re.optimizedBinaryString,re.base64);var le=new _(k,B,re);this.files[k]=le}var d=o("./utf8"),m=o("./utils"),g=o("./stream/GenericWorker"),h=o("./stream/StreamHelper"),v=o("./defaults"),T=o("./compressedObject"),_=o("./zipObject"),C=o("./generate"),M=o("./nodejsUtils"),S=o("./nodejs/NodejsStreamInputAdapter"),R=function(k){k.slice(-1)==="/"&&(k=k.substring(0,k.length-1));var X=k.lastIndexOf("/");return 0<X?k.substring(0,X):""},x=function(k){return k.slice(-1)!=="/"&&(k+="/"),k},b=function(k,X){return X=X!==void 0?X:v.createFolders,k=x(k),this.files[k]||c.call(this,k,null,{dir:!0,createFolders:X}),this.files[k]};function N(k){return Object.prototype.toString.call(k)==="[object RegExp]"}var z={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(k){var X,Y,oe;for(X in this.files)oe=this.files[X],(Y=X.slice(this.root.length,X.length))&&X.slice(0,this.root.length)===this.root&&k(Y,oe)},filter:function(k){var X=[];return this.forEach(function(Y,oe){k(Y,oe)&&X.push(oe)}),X},file:function(k,X,Y){if(arguments.length!==1)return k=this.root+k,c.call(this,k,X,Y),this;if(N(k)){var oe=k;return this.filter(function(re,ye){return!ye.dir&&oe.test(re)})}var q=this.files[this.root+k];return q&&!q.dir?q:null},folder:function(k){if(!k)return this;if(N(k))return this.filter(function(q,re){return re.dir&&k.test(q)});var X=this.root+k,Y=b.call(this,X),oe=this.clone();return oe.root=Y.name,oe},remove:function(k){k=this.root+k;var X=this.files[k];if(X||(k.slice(-1)!=="/"&&(k+="/"),X=this.files[k]),X&&!X.dir)delete this.files[k];else for(var Y=this.filter(function(q,re){return re.name.slice(0,k.length)===k}),oe=0;oe<Y.length;oe++)delete this.files[Y[oe].name];return this},generate:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(k){var X,Y={};try{if((Y=m.extend(k||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:d.utf8encode})).type=Y.type.toLowerCase(),Y.compression=Y.compression.toUpperCase(),Y.type==="binarystring"&&(Y.type="string"),!Y.type)throw new Error("No output type specified.");m.checkSupport(Y.type),Y.platform!=="darwin"&&Y.platform!=="freebsd"&&Y.platform!=="linux"&&Y.platform!=="sunos"||(Y.platform="UNIX"),Y.platform==="win32"&&(Y.platform="DOS");var oe=Y.comment||this.comment||"";X=C.generateWorker(this,Y,oe)}catch(q){(X=new g("error")).error(q)}return new h(X,Y.type||"string",Y.mimeType)},generateAsync:function(k,X){return this.generateInternalStream(k).accumulate(X)},generateNodeStream:function(k,X){return(k=k||{}).type||(k.type="nodebuffer"),this.generateInternalStream(k).toNodejsStream(X)}};l.exports=z},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(o,l,s){l.exports=o("stream")},{stream:void 0}],17:[function(o,l,s){var c=o("./DataReader");function d(m){c.call(this,m);for(var g=0;g<this.data.length;g++)m[g]=255&m[g]}o("../utils").inherits(d,c),d.prototype.byteAt=function(m){return this.data[this.zero+m]},d.prototype.lastIndexOfSignature=function(m){for(var g=m.charCodeAt(0),h=m.charCodeAt(1),v=m.charCodeAt(2),T=m.charCodeAt(3),_=this.length-4;0<=_;--_)if(this.data[_]===g&&this.data[_+1]===h&&this.data[_+2]===v&&this.data[_+3]===T)return _-this.zero;return-1},d.prototype.readAndCheckSignature=function(m){var g=m.charCodeAt(0),h=m.charCodeAt(1),v=m.charCodeAt(2),T=m.charCodeAt(3),_=this.readData(4);return g===_[0]&&h===_[1]&&v===_[2]&&T===_[3]},d.prototype.readData=function(m){if(this.checkOffset(m),m===0)return[];var g=this.data.slice(this.zero+this.index,this.zero+this.index+m);return this.index+=m,g},l.exports=d},{"../utils":32,"./DataReader":18}],18:[function(o,l,s){var c=o("../utils");function d(m){this.data=m,this.length=m.length,this.index=0,this.zero=0}d.prototype={checkOffset:function(m){this.checkIndex(this.index+m)},checkIndex:function(m){if(this.length<this.zero+m||m<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+m+"). Corrupted zip ?")},setIndex:function(m){this.checkIndex(m),this.index=m},skip:function(m){this.setIndex(this.index+m)},byteAt:function(){},readInt:function(m){var g,h=0;for(this.checkOffset(m),g=this.index+m-1;g>=this.index;g--)h=(h<<8)+this.byteAt(g);return this.index+=m,h},readString:function(m){return c.transformTo("string",this.readData(m))},readData:function(){},lastIndexOfSignature:function(){},readAndCheckSignature:function(){},readDate:function(){var m=this.readInt(4);return new Date(Date.UTC(1980+(m>>25&127),(m>>21&15)-1,m>>16&31,m>>11&31,m>>5&63,(31&m)<<1))}},l.exports=d},{"../utils":32}],19:[function(o,l,s){var c=o("./Uint8ArrayReader");function d(m){c.call(this,m)}o("../utils").inherits(d,c),d.prototype.readData=function(m){this.checkOffset(m);var g=this.data.slice(this.zero+this.index,this.zero+this.index+m);return this.index+=m,g},l.exports=d},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(o,l,s){var c=o("./DataReader");function d(m){c.call(this,m)}o("../utils").inherits(d,c),d.prototype.byteAt=function(m){return this.data.charCodeAt(this.zero+m)},d.prototype.lastIndexOfSignature=function(m){return this.data.lastIndexOf(m)-this.zero},d.prototype.readAndCheckSignature=function(m){return m===this.readData(4)},d.prototype.readData=function(m){this.checkOffset(m);var g=this.data.slice(this.zero+this.index,this.zero+this.index+m);return this.index+=m,g},l.exports=d},{"../utils":32,"./DataReader":18}],21:[function(o,l,s){var c=o("./ArrayReader");function d(m){c.call(this,m)}o("../utils").inherits(d,c),d.prototype.readData=function(m){if(this.checkOffset(m),m===0)return new Uint8Array(0);var g=this.data.subarray(this.zero+this.index,this.zero+this.index+m);return this.index+=m,g},l.exports=d},{"../utils":32,"./ArrayReader":17}],22:[function(o,l,s){var c=o("../utils"),d=o("../support"),m=o("./ArrayReader"),g=o("./StringReader"),h=o("./NodeBufferReader"),v=o("./Uint8ArrayReader");l.exports=function(T){var _=c.getTypeOf(T);return c.checkSupport(_),_!=="string"||d.uint8array?_==="nodebuffer"?new h(T):d.uint8array?new v(c.transformTo("uint8array",T)):new m(c.transformTo("array",T)):new g(T)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(o,l,s){s.LOCAL_FILE_HEADER="PK",s.CENTRAL_FILE_HEADER="PK",s.CENTRAL_DIRECTORY_END="PK",s.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK\x07",s.ZIP64_CENTRAL_DIRECTORY_END="PK",s.DATA_DESCRIPTOR="PK\x07\b"},{}],24:[function(o,l,s){var c=o("./GenericWorker"),d=o("../utils");function m(g){c.call(this,"ConvertWorker to "+g),this.destType=g}d.inherits(m,c),m.prototype.processChunk=function(g){this.push({data:d.transformTo(this.destType,g.data),meta:g.meta})},l.exports=m},{"../utils":32,"./GenericWorker":28}],25:[function(o,l,s){var c=o("./GenericWorker"),d=o("../crc32");function m(){c.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}o("../utils").inherits(m,c),m.prototype.processChunk=function(g){this.streamInfo.crc32=d(g.data,this.streamInfo.crc32||0),this.push(g)},l.exports=m},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(o,l,s){var c=o("../utils"),d=o("./GenericWorker");function m(g){d.call(this,"DataLengthProbe for "+g),this.propName=g,this.withStreamInfo(g,0)}c.inherits(m,d),m.prototype.processChunk=function(g){if(g){var h=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=h+g.data.length}d.prototype.processChunk.call(this,g)},l.exports=m},{"../utils":32,"./GenericWorker":28}],27:[function(o,l,s){var c=o("../utils"),d=o("./GenericWorker");function m(g){d.call(this,"DataWorker");var h=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,g.then(function(v){h.dataIsReady=!0,h.data=v,h.max=v&&v.length||0,h.type=c.getTypeOf(v),h.isPaused||h._tickAndRepeat()},function(v){h.error(v)})}c.inherits(m,d),m.prototype.cleanUp=function(){d.prototype.cleanUp.call(this),this.data=null},m.prototype.resume=function(){return!!d.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,c.delay(this._tickAndRepeat,[],this)),!0)},m.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(c.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},m.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var g=null,h=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":g=this.data.substring(this.index,h);break;case"uint8array":g=this.data.subarray(this.index,h);break;case"array":case"nodebuffer":g=this.data.slice(this.index,h)}return this.index=h,this.push({data:g,meta:{percent:this.max?this.index/this.max*100:0}})},l.exports=m},{"../utils":32,"./GenericWorker":28}],28:[function(o,l,s){function c(d){this.name=d||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}c.prototype={push:function(d){this.emit("data",d)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(d){this.emit("error",d)}return!0},error:function(d){return!this.isFinished&&(this.isPaused?this.generatedError=d:(this.isFinished=!0,this.emit("error",d),this.previous&&this.previous.error(d),this.cleanUp()),!0)},on:function(d,m){return this._listeners[d].push(m),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(d,m){if(this._listeners[d])for(var g=0;g<this._listeners[d].length;g++)this._listeners[d][g].call(this,m)},pipe:function(d){return d.registerPrevious(this)},registerPrevious:function(d){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=d.streamInfo,this.mergeStreamInfo(),this.previous=d;var m=this;return d.on("data",function(g){m.processChunk(g)}),d.on("end",function(){m.end()}),d.on("error",function(g){m.error(g)}),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var d=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),d=!0),this.previous&&this.previous.resume(),!d},flush:function(){},processChunk:function(d){this.push(d)},withStreamInfo:function(d,m){return this.extraStreamInfo[d]=m,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var d in this.extraStreamInfo)Object.prototype.hasOwnProperty.call(this.extraStreamInfo,d)&&(this.streamInfo[d]=this.extraStreamInfo[d])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var d="Worker "+this.name;return this.previous?this.previous+" -> "+d:d}},l.exports=c},{}],29:[function(o,l,s){var c=o("../utils"),d=o("./ConvertWorker"),m=o("./GenericWorker"),g=o("../base64"),h=o("../support"),v=o("../external"),T=null;if(h.nodestream)try{T=o("../nodejs/NodejsStreamOutputAdapter")}catch{}function _(M,S){return new v.Promise(function(R,x){var b=[],N=M._internalType,z=M._outputType,k=M._mimeType;M.on("data",function(X,Y){b.push(X),S&&S(Y)}).on("error",function(X){b=[],x(X)}).on("end",function(){try{var X=(function(Y,oe,q){switch(Y){case"blob":return c.newBlob(c.transformTo("arraybuffer",oe),q);case"base64":return g.encode(oe);default:return c.transformTo(Y,oe)}})(z,(function(Y,oe){var q,re=0,ye=null,B=0;for(q=0;q<oe.length;q++)B+=oe[q].length;switch(Y){case"string":return oe.join("");case"array":return Array.prototype.concat.apply([],oe);case"uint8array":for(ye=new Uint8Array(B),q=0;q<oe.length;q++)ye.set(oe[q],re),re+=oe[q].length;return ye;case"nodebuffer":return Buffer.concat(oe);default:throw new Error("concat : unsupported type '"+Y+"'")}})(N,b),k);R(X)}catch(Y){x(Y)}b=[]}).resume()})}function C(M,S,R){var x=S;switch(S){case"blob":case"arraybuffer":x="uint8array";break;case"base64":x="string"}try{this._internalType=x,this._outputType=S,this._mimeType=R,c.checkSupport(x),this._worker=M.pipe(new d(x)),M.lock()}catch(b){this._worker=new m("error"),this._worker.error(b)}}C.prototype={accumulate:function(M){return _(this,M)},on:function(M,S){var R=this;return M==="data"?this._worker.on(M,function(x){S.call(R,x.data,x.meta)}):this._worker.on(M,function(){c.delay(S,arguments,R)}),this},resume:function(){return c.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(M){if(c.checkSupport("nodestream"),this._outputType!=="nodebuffer")throw new Error(this._outputType+" is not supported by this method");return new T(this,{objectMode:this._outputType!=="nodebuffer"},M)}},l.exports=C},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(o,l,s){if(s.base64=!0,s.array=!0,s.string=!0,s.arraybuffer=typeof ArrayBuffer<"u"&&typeof Uint8Array<"u",s.nodebuffer=typeof Buffer<"u",s.uint8array=typeof Uint8Array<"u",typeof ArrayBuffer>"u")s.blob=!1;else{var c=new ArrayBuffer(0);try{s.blob=new Blob([c],{type:"application/zip"}).size===0}catch{try{var d=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);d.append(c),s.blob=d.getBlob("application/zip").size===0}catch{s.blob=!1}}}try{s.nodestream=!!o("readable-stream").Readable}catch{s.nodestream=!1}},{"readable-stream":16}],31:[function(o,l,s){for(var c=o("./utils"),d=o("./support"),m=o("./nodejsUtils"),g=o("./stream/GenericWorker"),h=new Array(256),v=0;v<256;v++)h[v]=252<=v?6:248<=v?5:240<=v?4:224<=v?3:192<=v?2:1;h[254]=h[254]=1;function T(){g.call(this,"utf-8 decode"),this.leftOver=null}function _(){g.call(this,"utf-8 encode")}s.utf8encode=function(C){return d.nodebuffer?m.newBufferFrom(C,"utf-8"):(function(M){var S,R,x,b,N,z=M.length,k=0;for(b=0;b<z;b++)(64512&(R=M.charCodeAt(b)))==55296&&b+1<z&&(64512&(x=M.charCodeAt(b+1)))==56320&&(R=65536+(R-55296<<10)+(x-56320),b++),k+=R<128?1:R<2048?2:R<65536?3:4;for(S=d.uint8array?new Uint8Array(k):new Array(k),b=N=0;N<k;b++)(64512&(R=M.charCodeAt(b)))==55296&&b+1<z&&(64512&(x=M.charCodeAt(b+1)))==56320&&(R=65536+(R-55296<<10)+(x-56320),b++),R<128?S[N++]=R:(R<2048?S[N++]=192|R>>>6:(R<65536?S[N++]=224|R>>>12:(S[N++]=240|R>>>18,S[N++]=128|R>>>12&63),S[N++]=128|R>>>6&63),S[N++]=128|63&R);return S})(C)},s.utf8decode=function(C){return d.nodebuffer?c.transformTo("nodebuffer",C).toString("utf-8"):(function(M){var S,R,x,b,N=M.length,z=new Array(2*N);for(S=R=0;S<N;)if((x=M[S++])<128)z[R++]=x;else if(4<(b=h[x]))z[R++]=65533,S+=b-1;else{for(x&=b===2?31:b===3?15:7;1<b&&S<N;)x=x<<6|63&M[S++],b--;1<b?z[R++]=65533:x<65536?z[R++]=x:(x-=65536,z[R++]=55296|x>>10&1023,z[R++]=56320|1023&x)}return z.length!==R&&(z.subarray?z=z.subarray(0,R):z.length=R),c.applyFromCharCode(z)})(C=c.transformTo(d.uint8array?"uint8array":"array",C))},c.inherits(T,g),T.prototype.processChunk=function(C){var M=c.transformTo(d.uint8array?"uint8array":"array",C.data);if(this.leftOver&&this.leftOver.length){if(d.uint8array){var S=M;(M=new Uint8Array(S.length+this.leftOver.length)).set(this.leftOver,0),M.set(S,this.leftOver.length)}else M=this.leftOver.concat(M);this.leftOver=null}var R=(function(b,N){var z;for((N=N||b.length)>b.length&&(N=b.length),z=N-1;0<=z&&(192&b[z])==128;)z--;return z<0||z===0?N:z+h[b[z]]>N?z:N})(M),x=M;R!==M.length&&(d.uint8array?(x=M.subarray(0,R),this.leftOver=M.subarray(R,M.length)):(x=M.slice(0,R),this.leftOver=M.slice(R,M.length))),this.push({data:s.utf8decode(x),meta:C.meta})},T.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:s.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},s.Utf8DecodeWorker=T,c.inherits(_,g),_.prototype.processChunk=function(C){this.push({data:s.utf8encode(C.data),meta:C.meta})},s.Utf8EncodeWorker=_},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(o,l,s){var c=o("./support"),d=o("./base64"),m=o("./nodejsUtils"),g=o("./external");function h(S){return S}function v(S,R){for(var x=0;x<S.length;++x)R[x]=255&S.charCodeAt(x);return R}o("setimmediate"),s.newBlob=function(S,R){s.checkSupport("blob");try{return new Blob([S],{type:R})}catch{try{var x=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return x.append(S),x.getBlob(R)}catch{throw new Error("Bug : can't construct the Blob.")}}};var T={stringifyByChunk:function(S,R,x){var b=[],N=0,z=S.length;if(z<=x)return String.fromCharCode.apply(null,S);for(;N<z;)R==="array"||R==="nodebuffer"?b.push(String.fromCharCode.apply(null,S.slice(N,Math.min(N+x,z)))):b.push(String.fromCharCode.apply(null,S.subarray(N,Math.min(N+x,z)))),N+=x;return b.join("")},stringifyByChar:function(S){for(var R="",x=0;x<S.length;x++)R+=String.fromCharCode(S[x]);return R},applyCanBeUsed:{uint8array:(function(){try{return c.uint8array&&String.fromCharCode.apply(null,new Uint8Array(1)).length===1}catch{return!1}})(),nodebuffer:(function(){try{return c.nodebuffer&&String.fromCharCode.apply(null,m.allocBuffer(1)).length===1}catch{return!1}})()}};function _(S){var R=65536,x=s.getTypeOf(S),b=!0;if(x==="uint8array"?b=T.applyCanBeUsed.uint8array:x==="nodebuffer"&&(b=T.applyCanBeUsed.nodebuffer),b)for(;1<R;)try{return T.stringifyByChunk(S,x,R)}catch{R=Math.floor(R/2)}return T.stringifyByChar(S)}function C(S,R){for(var x=0;x<S.length;x++)R[x]=S[x];return R}s.applyFromCharCode=_;var M={};M.string={string:h,array:function(S){return v(S,new Array(S.length))},arraybuffer:function(S){return M.string.uint8array(S).buffer},uint8array:function(S){return v(S,new Uint8Array(S.length))},nodebuffer:function(S){return v(S,m.allocBuffer(S.length))}},M.array={string:_,array:h,arraybuffer:function(S){return new Uint8Array(S).buffer},uint8array:function(S){return new Uint8Array(S)},nodebuffer:function(S){return m.newBufferFrom(S)}},M.arraybuffer={string:function(S){return _(new Uint8Array(S))},array:function(S){return C(new Uint8Array(S),new Array(S.byteLength))},arraybuffer:h,uint8array:function(S){return new Uint8Array(S)},nodebuffer:function(S){return m.newBufferFrom(new Uint8Array(S))}},M.uint8array={string:_,array:function(S){return C(S,new Array(S.length))},arraybuffer:function(S){return S.buffer},uint8array:h,nodebuffer:function(S){return m.newBufferFrom(S)}},M.nodebuffer={string:_,array:function(S){return C(S,new Array(S.length))},arraybuffer:function(S){return M.nodebuffer.uint8array(S).buffer},uint8array:function(S){return C(S,new Uint8Array(S.length))},nodebuffer:h},s.transformTo=function(S,R){if(R=R||"",!S)return R;s.checkSupport(S);var x=s.getTypeOf(R);return M[x][S](R)},s.resolve=function(S){for(var R=S.split("/"),x=[],b=0;b<R.length;b++){var N=R[b];N==="."||N===""&&b!==0&&b!==R.length-1||(N===".."?x.pop():x.push(N))}return x.join("/")},s.getTypeOf=function(S){return typeof S=="string"?"string":Object.prototype.toString.call(S)==="[object Array]"?"array":c.nodebuffer&&m.isBuffer(S)?"nodebuffer":c.uint8array&&S instanceof Uint8Array?"uint8array":c.arraybuffer&&S instanceof ArrayBuffer?"arraybuffer":void 0},s.checkSupport=function(S){if(!c[S.toLowerCase()])throw new Error(S+" is not supported by this platform")},s.MAX_VALUE_16BITS=65535,s.MAX_VALUE_32BITS=-1,s.pretty=function(S){var R,x,b="";for(x=0;x<(S||"").length;x++)b+="\\x"+((R=S.charCodeAt(x))<16?"0":"")+R.toString(16).toUpperCase();return b},s.delay=function(S,R,x){setImmediate(function(){S.apply(x||null,R||[])})},s.inherits=function(S,R){function x(){}x.prototype=R.prototype,S.prototype=new x},s.extend=function(){var S,R,x={};for(S=0;S<arguments.length;S++)for(R in arguments[S])Object.prototype.hasOwnProperty.call(arguments[S],R)&&x[R]===void 0&&(x[R]=arguments[S][R]);return x},s.prepareContent=function(S,R,x,b,N){return g.Promise.resolve(R).then(function(z){return c.blob&&(z instanceof Blob||["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(z))!==-1)&&typeof FileReader<"u"?new g.Promise(function(k,X){var Y=new FileReader;Y.onload=function(oe){k(oe.target.result)},Y.onerror=function(oe){X(oe.target.error)},Y.readAsArrayBuffer(z)}):z}).then(function(z){var k=s.getTypeOf(z);return k?(k==="arraybuffer"?z=s.transformTo("uint8array",z):k==="string"&&(N?z=d.decode(z):x&&b!==!0&&(z=(function(X){return v(X,c.uint8array?new Uint8Array(X.length):new Array(X.length))})(z))),z):g.Promise.reject(new Error("Can't read the data of '"+S+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))})}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(o,l,s){var c=o("./reader/readerFor"),d=o("./utils"),m=o("./signature"),g=o("./zipEntry"),h=o("./support");function v(T){this.files=[],this.loadOptions=T}v.prototype={checkSignature:function(T){if(!this.reader.readAndCheckSignature(T)){this.reader.index-=4;var _=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+d.pretty(_)+", expected "+d.pretty(T)+")")}},isSignature:function(T,_){var C=this.reader.index;this.reader.setIndex(T);var M=this.reader.readString(4)===_;return this.reader.setIndex(C),M},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var T=this.reader.readData(this.zipCommentLength),_=h.uint8array?"uint8array":"array",C=d.transformTo(_,T);this.zipComment=this.loadOptions.decodeFileName(C)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var T,_,C,M=this.zip64EndOfCentralSize-44;0<M;)T=this.reader.readInt(2),_=this.reader.readInt(4),C=this.reader.readData(_),this.zip64ExtensibleData[T]={id:T,length:_,value:C}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var T,_;for(T=0;T<this.files.length;T++)_=this.files[T],this.reader.setIndex(_.localHeaderOffset),this.checkSignature(m.LOCAL_FILE_HEADER),_.readLocalPart(this.reader),_.handleUTF8(),_.processAttributes()},readCentralDir:function(){var T;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(m.CENTRAL_FILE_HEADER);)(T=new g({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(T);if(this.centralDirRecords!==this.files.length&&this.centralDirRecords!==0&&this.files.length===0)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var T=this.reader.lastIndexOfSignature(m.CENTRAL_DIRECTORY_END);if(T<0)throw this.isSignature(0,m.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(T);var _=T;if(this.checkSignature(m.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===d.MAX_VALUE_16BITS||this.diskWithCentralDirStart===d.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===d.MAX_VALUE_16BITS||this.centralDirRecords===d.MAX_VALUE_16BITS||this.centralDirSize===d.MAX_VALUE_32BITS||this.centralDirOffset===d.MAX_VALUE_32BITS){if(this.zip64=!0,(T=this.reader.lastIndexOfSignature(m.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(T),this.checkSignature(m.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,m.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(m.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(m.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var C=this.centralDirOffset+this.centralDirSize;this.zip64&&(C+=20,C+=12+this.zip64EndOfCentralSize);var M=_-C;if(0<M)this.isSignature(_,m.CENTRAL_FILE_HEADER)||(this.reader.zero=M);else if(M<0)throw new Error("Corrupted zip: missing "+Math.abs(M)+" bytes.")},prepareReader:function(T){this.reader=c(T)},load:function(T){this.prepareReader(T),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},l.exports=v},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utils":32,"./zipEntry":34}],34:[function(o,l,s){var c=o("./reader/readerFor"),d=o("./utils"),m=o("./compressedObject"),g=o("./crc32"),h=o("./utf8"),v=o("./compressions"),T=o("./support");function _(C,M){this.options=C,this.loadOptions=M}_.prototype={isEncrypted:function(){return(1&this.bitFlag)==1},useUTF8:function(){return(2048&this.bitFlag)==2048},readLocalPart:function(C){var M,S;if(C.skip(22),this.fileNameLength=C.readInt(2),S=C.readInt(2),this.fileName=C.readData(this.fileNameLength),C.skip(S),this.compressedSize===-1||this.uncompressedSize===-1)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if((M=(function(R){for(var x in v)if(Object.prototype.hasOwnProperty.call(v,x)&&v[x].magic===R)return v[x];return null})(this.compressionMethod))===null)throw new Error("Corrupted zip : compression "+d.pretty(this.compressionMethod)+" unknown (inner file : "+d.transformTo("string",this.fileName)+")");this.decompressed=new m(this.compressedSize,this.uncompressedSize,this.crc32,M,C.readData(this.compressedSize))},readCentralPart:function(C){this.versionMadeBy=C.readInt(2),C.skip(2),this.bitFlag=C.readInt(2),this.compressionMethod=C.readString(2),this.date=C.readDate(),this.crc32=C.readInt(4),this.compressedSize=C.readInt(4),this.uncompressedSize=C.readInt(4);var M=C.readInt(2);if(this.extraFieldsLength=C.readInt(2),this.fileCommentLength=C.readInt(2),this.diskNumberStart=C.readInt(2),this.internalFileAttributes=C.readInt(2),this.externalFileAttributes=C.readInt(4),this.localHeaderOffset=C.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");C.skip(M),this.readExtraFields(C),this.parseZIP64ExtraField(C),this.fileComment=C.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var C=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),C==0&&(this.dosPermissions=63&this.externalFileAttributes),C==3&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||this.fileNameStr.slice(-1)!=="/"||(this.dir=!0)},parseZIP64ExtraField:function(){if(this.extraFields[1]){var C=c(this.extraFields[1].value);this.uncompressedSize===d.MAX_VALUE_32BITS&&(this.uncompressedSize=C.readInt(8)),this.compressedSize===d.MAX_VALUE_32BITS&&(this.compressedSize=C.readInt(8)),this.localHeaderOffset===d.MAX_VALUE_32BITS&&(this.localHeaderOffset=C.readInt(8)),this.diskNumberStart===d.MAX_VALUE_32BITS&&(this.diskNumberStart=C.readInt(4))}},readExtraFields:function(C){var M,S,R,x=C.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});C.index+4<x;)M=C.readInt(2),S=C.readInt(2),R=C.readData(S),this.extraFields[M]={id:M,length:S,value:R};C.setIndex(x)},handleUTF8:function(){var C=T.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=h.utf8decode(this.fileName),this.fileCommentStr=h.utf8decode(this.fileComment);else{var M=this.findExtraFieldUnicodePath();if(M!==null)this.fileNameStr=M;else{var S=d.transformTo(C,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(S)}var R=this.findExtraFieldUnicodeComment();if(R!==null)this.fileCommentStr=R;else{var x=d.transformTo(C,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(x)}}},findExtraFieldUnicodePath:function(){var C=this.extraFields[28789];if(C){var M=c(C.value);return M.readInt(1)!==1||g(this.fileName)!==M.readInt(4)?null:h.utf8decode(M.readData(C.length-5))}return null},findExtraFieldUnicodeComment:function(){var C=this.extraFields[25461];if(C){var M=c(C.value);return M.readInt(1)!==1||g(this.fileComment)!==M.readInt(4)?null:h.utf8decode(M.readData(C.length-5))}return null}},l.exports=_},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(o,l,s){function c(M,S,R){this.name=M,this.dir=R.dir,this.date=R.date,this.comment=R.comment,this.unixPermissions=R.unixPermissions,this.dosPermissions=R.dosPermissions,this._data=S,this._dataBinary=R.binary,this.options={compression:R.compression,compressionOptions:R.compressionOptions}}var d=o("./stream/StreamHelper"),m=o("./stream/DataWorker"),g=o("./utf8"),h=o("./compressedObject"),v=o("./stream/GenericWorker");c.prototype={internalStream:function(M){var S=null,R="string";try{if(!M)throw new Error("No output type specified.");var x=(R=M.toLowerCase())==="string"||R==="text";R!=="binarystring"&&R!=="text"||(R="string"),S=this._decompressWorker();var b=!this._dataBinary;b&&!x&&(S=S.pipe(new g.Utf8EncodeWorker)),!b&&x&&(S=S.pipe(new g.Utf8DecodeWorker))}catch(N){(S=new v("error")).error(N)}return new d(S,R,"")},async:function(M,S){return this.internalStream(M).accumulate(S)},nodeStream:function(M,S){return this.internalStream(M||"nodebuffer").toNodejsStream(S)},_compressWorker:function(M,S){if(this._data instanceof h&&this._data.compression.magic===M.magic)return this._data.getCompressedWorker();var R=this._decompressWorker();return this._dataBinary||(R=R.pipe(new g.Utf8EncodeWorker)),h.createWorkerFrom(R,M,S)},_decompressWorker:function(){return this._data instanceof h?this._data.getContentWorker():this._data instanceof v?this._data:new m(this._data)}};for(var T=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],_=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},C=0;C<T.length;C++)c.prototype[T[C]]=_;l.exports=c},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(o,l,s){(function(c){var d,m,g=c.MutationObserver||c.WebKitMutationObserver;if(g){var h=0,v=new g(M),T=c.document.createTextNode("");v.observe(T,{characterData:!0}),d=function(){T.data=h=++h%2}}else if(c.setImmediate||c.MessageChannel===void 0)d="document"in c&&"onreadystatechange"in c.document.createElement("script")?function(){var S=c.document.createElement("script");S.onreadystatechange=function(){M(),S.onreadystatechange=null,S.parentNode.removeChild(S),S=null},c.document.documentElement.appendChild(S)}:function(){setTimeout(M,0)};else{var _=new c.MessageChannel;_.port1.onmessage=M,d=function(){_.port2.postMessage(0)}}var C=[];function M(){var S,R;m=!0;for(var x=C.length;x;){for(R=C,C=[],S=-1;++S<x;)R[S]();x=C.length}m=!1}l.exports=function(S){C.push(S)!==1||m||d()}}).call(this,typeof Ha<"u"?Ha:typeof self<"u"?self:typeof window<"u"?window:{})},{}],37:[function(o,l,s){var c=o("immediate");function d(){}var m={},g=["REJECTED"],h=["FULFILLED"],v=["PENDING"];function T(x){if(typeof x!="function")throw new TypeError("resolver must be a function");this.state=v,this.queue=[],this.outcome=void 0,x!==d&&S(this,x)}function _(x,b,N){this.promise=x,typeof b=="function"&&(this.onFulfilled=b,this.callFulfilled=this.otherCallFulfilled),typeof N=="function"&&(this.onRejected=N,this.callRejected=this.otherCallRejected)}function C(x,b,N){c(function(){var z;try{z=b(N)}catch(k){return m.reject(x,k)}z===x?m.reject(x,new TypeError("Cannot resolve promise with itself")):m.resolve(x,z)})}function M(x){var b=x&&x.then;if(x&&(typeof x=="object"||typeof x=="function")&&typeof b=="function")return function(){b.apply(x,arguments)}}function S(x,b){var N=!1;function z(Y){N||(N=!0,m.reject(x,Y))}function k(Y){N||(N=!0,m.resolve(x,Y))}var X=R(function(){b(k,z)});X.status==="error"&&z(X.value)}function R(x,b){var N={};try{N.value=x(b),N.status="success"}catch(z){N.status="error",N.value=z}return N}(l.exports=T).prototype.finally=function(x){if(typeof x!="function")return this;var b=this.constructor;return this.then(function(N){return b.resolve(x()).then(function(){return N})},function(N){return b.resolve(x()).then(function(){throw N})})},T.prototype.catch=function(x){return this.then(null,x)},T.prototype.then=function(x,b){if(typeof x!="function"&&this.state===h||typeof b!="function"&&this.state===g)return this;var N=new this.constructor(d);return this.state!==v?C(N,this.state===h?x:b,this.outcome):this.queue.push(new _(N,x,b)),N},_.prototype.callFulfilled=function(x){m.resolve(this.promise,x)},_.prototype.otherCallFulfilled=function(x){C(this.promise,this.onFulfilled,x)},_.prototype.callRejected=function(x){m.reject(this.promise,x)},_.prototype.otherCallRejected=function(x){C(this.promise,this.onRejected,x)},m.resolve=function(x,b){var N=R(M,b);if(N.status==="error")return m.reject(x,N.value);var z=N.value;if(z)S(x,z);else{x.state=h,x.outcome=b;for(var k=-1,X=x.queue.length;++k<X;)x.queue[k].callFulfilled(b)}return x},m.reject=function(x,b){x.state=g,x.outcome=b;for(var N=-1,z=x.queue.length;++N<z;)x.queue[N].callRejected(b);return x},T.resolve=function(x){return x instanceof this?x:m.resolve(new this(d),x)},T.reject=function(x){var b=new this(d);return m.reject(b,x)},T.all=function(x){var b=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=x.length,z=!1;if(!N)return this.resolve([]);for(var k=new Array(N),X=0,Y=-1,oe=new this(d);++Y<N;)q(x[Y],Y);return oe;function q(re,ye){b.resolve(re).then(function(B){k[ye]=B,++X!==N||z||(z=!0,m.resolve(oe,k))},function(B){z||(z=!0,m.reject(oe,B))})}},T.race=function(x){var b=this;if(Object.prototype.toString.call(x)!=="[object Array]")return this.reject(new TypeError("must be an array"));var N=x.length,z=!1;if(!N)return this.resolve([]);for(var k=-1,X=new this(d);++k<N;)Y=x[k],b.resolve(Y).then(function(oe){z||(z=!0,m.resolve(X,oe))},function(oe){z||(z=!0,m.reject(X,oe))});var Y;return X}},{immediate:36}],38:[function(o,l,s){var c={};(0,o("./lib/utils/common").assign)(c,o("./lib/deflate"),o("./lib/inflate"),o("./lib/zlib/constants")),l.exports=c},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(o,l,s){var c=o("./zlib/deflate"),d=o("./utils/common"),m=o("./utils/strings"),g=o("./zlib/messages"),h=o("./zlib/zstream"),v=Object.prototype.toString,T=0,_=-1,C=0,M=8;function S(x){if(!(this instanceof S))return new S(x);this.options=d.assign({level:_,method:M,chunkSize:16384,windowBits:15,memLevel:8,strategy:C,to:""},x||{});var b=this.options;b.raw&&0<b.windowBits?b.windowBits=-b.windowBits:b.gzip&&0<b.windowBits&&b.windowBits<16&&(b.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new h,this.strm.avail_out=0;var N=c.deflateInit2(this.strm,b.level,b.method,b.windowBits,b.memLevel,b.strategy);if(N!==T)throw new Error(g[N]);if(b.header&&c.deflateSetHeader(this.strm,b.header),b.dictionary){var z;if(z=typeof b.dictionary=="string"?m.string2buf(b.dictionary):v.call(b.dictionary)==="[object ArrayBuffer]"?new Uint8Array(b.dictionary):b.dictionary,(N=c.deflateSetDictionary(this.strm,z))!==T)throw new Error(g[N]);this._dict_set=!0}}function R(x,b){var N=new S(b);if(N.push(x,!0),N.err)throw N.msg||g[N.err];return N.result}S.prototype.push=function(x,b){var N,z,k=this.strm,X=this.options.chunkSize;if(this.ended)return!1;z=b===~~b?b:b===!0?4:0,typeof x=="string"?k.input=m.string2buf(x):v.call(x)==="[object ArrayBuffer]"?k.input=new Uint8Array(x):k.input=x,k.next_in=0,k.avail_in=k.input.length;do{if(k.avail_out===0&&(k.output=new d.Buf8(X),k.next_out=0,k.avail_out=X),(N=c.deflate(k,z))!==1&&N!==T)return this.onEnd(N),!(this.ended=!0);k.avail_out!==0&&(k.avail_in!==0||z!==4&&z!==2)||(this.options.to==="string"?this.onData(m.buf2binstring(d.shrinkBuf(k.output,k.next_out))):this.onData(d.shrinkBuf(k.output,k.next_out)))}while((0<k.avail_in||k.avail_out===0)&&N!==1);return z===4?(N=c.deflateEnd(this.strm),this.onEnd(N),this.ended=!0,N===T):z!==2||(this.onEnd(T),!(k.avail_out=0))},S.prototype.onData=function(x){this.chunks.push(x)},S.prototype.onEnd=function(x){x===T&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=x,this.msg=this.strm.msg},s.Deflate=S,s.deflate=R,s.deflateRaw=function(x,b){return(b=b||{}).raw=!0,R(x,b)},s.gzip=function(x,b){return(b=b||{}).gzip=!0,R(x,b)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(o,l,s){var c=o("./zlib/inflate"),d=o("./utils/common"),m=o("./utils/strings"),g=o("./zlib/constants"),h=o("./zlib/messages"),v=o("./zlib/zstream"),T=o("./zlib/gzheader"),_=Object.prototype.toString;function C(S){if(!(this instanceof C))return new C(S);this.options=d.assign({chunkSize:16384,windowBits:0,to:""},S||{});var R=this.options;R.raw&&0<=R.windowBits&&R.windowBits<16&&(R.windowBits=-R.windowBits,R.windowBits===0&&(R.windowBits=-15)),!(0<=R.windowBits&&R.windowBits<16)||S&&S.windowBits||(R.windowBits+=32),15<R.windowBits&&R.windowBits<48&&(15&R.windowBits)==0&&(R.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new v,this.strm.avail_out=0;var x=c.inflateInit2(this.strm,R.windowBits);if(x!==g.Z_OK)throw new Error(h[x]);this.header=new T,c.inflateGetHeader(this.strm,this.header)}function M(S,R){var x=new C(R);if(x.push(S,!0),x.err)throw x.msg||h[x.err];return x.result}C.prototype.push=function(S,R){var x,b,N,z,k,X,Y=this.strm,oe=this.options.chunkSize,q=this.options.dictionary,re=!1;if(this.ended)return!1;b=R===~~R?R:R===!0?g.Z_FINISH:g.Z_NO_FLUSH,typeof S=="string"?Y.input=m.binstring2buf(S):_.call(S)==="[object ArrayBuffer]"?Y.input=new Uint8Array(S):Y.input=S,Y.next_in=0,Y.avail_in=Y.input.length;do{if(Y.avail_out===0&&(Y.output=new d.Buf8(oe),Y.next_out=0,Y.avail_out=oe),(x=c.inflate(Y,g.Z_NO_FLUSH))===g.Z_NEED_DICT&&q&&(X=typeof q=="string"?m.string2buf(q):_.call(q)==="[object ArrayBuffer]"?new Uint8Array(q):q,x=c.inflateSetDictionary(this.strm,X)),x===g.Z_BUF_ERROR&&re===!0&&(x=g.Z_OK,re=!1),x!==g.Z_STREAM_END&&x!==g.Z_OK)return this.onEnd(x),!(this.ended=!0);Y.next_out&&(Y.avail_out!==0&&x!==g.Z_STREAM_END&&(Y.avail_in!==0||b!==g.Z_FINISH&&b!==g.Z_SYNC_FLUSH)||(this.options.to==="string"?(N=m.utf8border(Y.output,Y.next_out),z=Y.next_out-N,k=m.buf2string(Y.output,N),Y.next_out=z,Y.avail_out=oe-z,z&&d.arraySet(Y.output,Y.output,N,z,0),this.onData(k)):this.onData(d.shrinkBuf(Y.output,Y.next_out)))),Y.avail_in===0&&Y.avail_out===0&&(re=!0)}while((0<Y.avail_in||Y.avail_out===0)&&x!==g.Z_STREAM_END);return x===g.Z_STREAM_END&&(b=g.Z_FINISH),b===g.Z_FINISH?(x=c.inflateEnd(this.strm),this.onEnd(x),this.ended=!0,x===g.Z_OK):b!==g.Z_SYNC_FLUSH||(this.onEnd(g.Z_OK),!(Y.avail_out=0))},C.prototype.onData=function(S){this.chunks.push(S)},C.prototype.onEnd=function(S){S===g.Z_OK&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=d.flattenChunks(this.chunks)),this.chunks=[],this.err=S,this.msg=this.strm.msg},s.Inflate=C,s.inflate=M,s.inflateRaw=function(S,R){return(R=R||{}).raw=!0,M(S,R)},s.ungzip=M},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(o,l,s){var c=typeof Uint8Array<"u"&&typeof Uint16Array<"u"&&typeof Int32Array<"u";s.assign=function(g){for(var h=Array.prototype.slice.call(arguments,1);h.length;){var v=h.shift();if(v){if(typeof v!="object")throw new TypeError(v+"must be non-object");for(var T in v)v.hasOwnProperty(T)&&(g[T]=v[T])}}return g},s.shrinkBuf=function(g,h){return g.length===h?g:g.subarray?g.subarray(0,h):(g.length=h,g)};var d={arraySet:function(g,h,v,T,_){if(h.subarray&&g.subarray)g.set(h.subarray(v,v+T),_);else for(var C=0;C<T;C++)g[_+C]=h[v+C]},flattenChunks:function(g){var h,v,T,_,C,M;for(h=T=0,v=g.length;h<v;h++)T+=g[h].length;for(M=new Uint8Array(T),h=_=0,v=g.length;h<v;h++)C=g[h],M.set(C,_),_+=C.length;return M}},m={arraySet:function(g,h,v,T,_){for(var C=0;C<T;C++)g[_+C]=h[v+C]},flattenChunks:function(g){return[].concat.apply([],g)}};s.setTyped=function(g){g?(s.Buf8=Uint8Array,s.Buf16=Uint16Array,s.Buf32=Int32Array,s.assign(s,d)):(s.Buf8=Array,s.Buf16=Array,s.Buf32=Array,s.assign(s,m))},s.setTyped(c)},{}],42:[function(o,l,s){var c=o("./common"),d=!0,m=!0;try{String.fromCharCode.apply(null,[0])}catch{d=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{m=!1}for(var g=new c.Buf8(256),h=0;h<256;h++)g[h]=252<=h?6:248<=h?5:240<=h?4:224<=h?3:192<=h?2:1;function v(T,_){if(_<65537&&(T.subarray&&m||!T.subarray&&d))return String.fromCharCode.apply(null,c.shrinkBuf(T,_));for(var C="",M=0;M<_;M++)C+=String.fromCharCode(T[M]);return C}g[254]=g[254]=1,s.string2buf=function(T){var _,C,M,S,R,x=T.length,b=0;for(S=0;S<x;S++)(64512&(C=T.charCodeAt(S)))==55296&&S+1<x&&(64512&(M=T.charCodeAt(S+1)))==56320&&(C=65536+(C-55296<<10)+(M-56320),S++),b+=C<128?1:C<2048?2:C<65536?3:4;for(_=new c.Buf8(b),S=R=0;R<b;S++)(64512&(C=T.charCodeAt(S)))==55296&&S+1<x&&(64512&(M=T.charCodeAt(S+1)))==56320&&(C=65536+(C-55296<<10)+(M-56320),S++),C<128?_[R++]=C:(C<2048?_[R++]=192|C>>>6:(C<65536?_[R++]=224|C>>>12:(_[R++]=240|C>>>18,_[R++]=128|C>>>12&63),_[R++]=128|C>>>6&63),_[R++]=128|63&C);return _},s.buf2binstring=function(T){return v(T,T.length)},s.binstring2buf=function(T){for(var _=new c.Buf8(T.length),C=0,M=_.length;C<M;C++)_[C]=T.charCodeAt(C);return _},s.buf2string=function(T,_){var C,M,S,R,x=_||T.length,b=new Array(2*x);for(C=M=0;C<x;)if((S=T[C++])<128)b[M++]=S;else if(4<(R=g[S]))b[M++]=65533,C+=R-1;else{for(S&=R===2?31:R===3?15:7;1<R&&C<x;)S=S<<6|63&T[C++],R--;1<R?b[M++]=65533:S<65536?b[M++]=S:(S-=65536,b[M++]=55296|S>>10&1023,b[M++]=56320|1023&S)}return v(b,M)},s.utf8border=function(T,_){var C;for((_=_||T.length)>T.length&&(_=T.length),C=_-1;0<=C&&(192&T[C])==128;)C--;return C<0||C===0?_:C+g[T[C]]>_?C:_}},{"./common":41}],43:[function(o,l,s){l.exports=function(c,d,m,g){for(var h=65535&c|0,v=c>>>16&65535|0,T=0;m!==0;){for(m-=T=2e3<m?2e3:m;v=v+(h=h+d[g++]|0)|0,--T;);h%=65521,v%=65521}return h|v<<16|0}},{}],44:[function(o,l,s){l.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(o,l,s){var c=(function(){for(var d,m=[],g=0;g<256;g++){d=g;for(var h=0;h<8;h++)d=1&d?3988292384^d>>>1:d>>>1;m[g]=d}return m})();l.exports=function(d,m,g,h){var v=c,T=h+g;d^=-1;for(var _=h;_<T;_++)d=d>>>8^v[255&(d^m[_])];return-1^d}},{}],46:[function(o,l,s){var c,d=o("../utils/common"),m=o("./trees"),g=o("./adler32"),h=o("./crc32"),v=o("./messages"),T=0,_=4,C=0,M=-2,S=-1,R=4,x=2,b=8,N=9,z=286,k=30,X=19,Y=2*z+1,oe=15,q=3,re=258,ye=re+q+1,B=42,le=113,w=1,te=2,J=3,K=4;function ve(A,de){return A.msg=v[de],de}function fe(A){return(A<<1)-(4<A?9:0)}function I(A){for(var de=A.length;0<=--de;)A[de]=0}function P(A){var de=A.state,ne=de.pending;ne>A.avail_out&&(ne=A.avail_out),ne!==0&&(d.arraySet(A.output,de.pending_buf,de.pending_out,ne,A.next_out),A.next_out+=ne,de.pending_out+=ne,A.total_out+=ne,A.avail_out-=ne,de.pending-=ne,de.pending===0&&(de.pending_out=0))}function H(A,de){m._tr_flush_block(A,0<=A.block_start?A.block_start:-1,A.strstart-A.block_start,de),A.block_start=A.strstart,P(A.strm)}function ie(A,de){A.pending_buf[A.pending++]=de}function se(A,de){A.pending_buf[A.pending++]=de>>>8&255,A.pending_buf[A.pending++]=255&de}function he(A,de){var ne,L,U=A.max_chain_length,F=A.strstart,pe=A.prev_length,ge=A.nice_match,W=A.strstart>A.w_size-ye?A.strstart-(A.w_size-ye):0,Te=A.window,Se=A.w_mask,_e=A.prev,Me=A.strstart+re,ke=Te[F+pe-1],Ne=Te[F+pe];A.prev_length>=A.good_match&&(U>>=2),ge>A.lookahead&&(ge=A.lookahead);do if(Te[(ne=de)+pe]===Ne&&Te[ne+pe-1]===ke&&Te[ne]===Te[F]&&Te[++ne]===Te[F+1]){F+=2,ne++;do;while(Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&Te[++F]===Te[++ne]&&F<Me);if(L=re-(Me-F),F=Me-re,pe<L){if(A.match_start=de,ge<=(pe=L))break;ke=Te[F+pe-1],Ne=Te[F+pe]}}while((de=_e[de&Se])>W&&--U!=0);return pe<=A.lookahead?pe:A.lookahead}function Ce(A){var de,ne,L,U,F,pe,ge,W,Te,Se,_e=A.w_size;do{if(U=A.window_size-A.lookahead-A.strstart,A.strstart>=_e+(_e-ye)){for(d.arraySet(A.window,A.window,_e,_e,0),A.match_start-=_e,A.strstart-=_e,A.block_start-=_e,de=ne=A.hash_size;L=A.head[--de],A.head[de]=_e<=L?L-_e:0,--ne;);for(de=ne=_e;L=A.prev[--de],A.prev[de]=_e<=L?L-_e:0,--ne;);U+=_e}if(A.strm.avail_in===0)break;if(pe=A.strm,ge=A.window,W=A.strstart+A.lookahead,Te=U,Se=void 0,Se=pe.avail_in,Te<Se&&(Se=Te),ne=Se===0?0:(pe.avail_in-=Se,d.arraySet(ge,pe.input,pe.next_in,Se,W),pe.state.wrap===1?pe.adler=g(pe.adler,ge,Se,W):pe.state.wrap===2&&(pe.adler=h(pe.adler,ge,Se,W)),pe.next_in+=Se,pe.total_in+=Se,Se),A.lookahead+=ne,A.lookahead+A.insert>=q)for(F=A.strstart-A.insert,A.ins_h=A.window[F],A.ins_h=(A.ins_h<<A.hash_shift^A.window[F+1])&A.hash_mask;A.insert&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[F+q-1])&A.hash_mask,A.prev[F&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=F,F++,A.insert--,!(A.lookahead+A.insert<q)););}while(A.lookahead<ye&&A.strm.avail_in!==0)}function He(A,de){for(var ne,L;;){if(A.lookahead<ye){if(Ce(A),A.lookahead<ye&&de===T)return w;if(A.lookahead===0)break}if(ne=0,A.lookahead>=q&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+q-1])&A.hash_mask,ne=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),ne!==0&&A.strstart-ne<=A.w_size-ye&&(A.match_length=he(A,ne)),A.match_length>=q)if(L=m._tr_tally(A,A.strstart-A.match_start,A.match_length-q),A.lookahead-=A.match_length,A.match_length<=A.max_lazy_match&&A.lookahead>=q){for(A.match_length--;A.strstart++,A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+q-1])&A.hash_mask,ne=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart,--A.match_length!=0;);A.strstart++}else A.strstart+=A.match_length,A.match_length=0,A.ins_h=A.window[A.strstart],A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+1])&A.hash_mask;else L=m._tr_tally(A,0,A.window[A.strstart]),A.lookahead--,A.strstart++;if(L&&(H(A,!1),A.strm.avail_out===0))return w}return A.insert=A.strstart<q-1?A.strstart:q-1,de===_?(H(A,!0),A.strm.avail_out===0?J:K):A.last_lit&&(H(A,!1),A.strm.avail_out===0)?w:te}function Ae(A,de){for(var ne,L,U;;){if(A.lookahead<ye){if(Ce(A),A.lookahead<ye&&de===T)return w;if(A.lookahead===0)break}if(ne=0,A.lookahead>=q&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+q-1])&A.hash_mask,ne=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),A.prev_length=A.match_length,A.prev_match=A.match_start,A.match_length=q-1,ne!==0&&A.prev_length<A.max_lazy_match&&A.strstart-ne<=A.w_size-ye&&(A.match_length=he(A,ne),A.match_length<=5&&(A.strategy===1||A.match_length===q&&4096<A.strstart-A.match_start)&&(A.match_length=q-1)),A.prev_length>=q&&A.match_length<=A.prev_length){for(U=A.strstart+A.lookahead-q,L=m._tr_tally(A,A.strstart-1-A.prev_match,A.prev_length-q),A.lookahead-=A.prev_length-1,A.prev_length-=2;++A.strstart<=U&&(A.ins_h=(A.ins_h<<A.hash_shift^A.window[A.strstart+q-1])&A.hash_mask,ne=A.prev[A.strstart&A.w_mask]=A.head[A.ins_h],A.head[A.ins_h]=A.strstart),--A.prev_length!=0;);if(A.match_available=0,A.match_length=q-1,A.strstart++,L&&(H(A,!1),A.strm.avail_out===0))return w}else if(A.match_available){if((L=m._tr_tally(A,0,A.window[A.strstart-1]))&&H(A,!1),A.strstart++,A.lookahead--,A.strm.avail_out===0)return w}else A.match_available=1,A.strstart++,A.lookahead--}return A.match_available&&(L=m._tr_tally(A,0,A.window[A.strstart-1]),A.match_available=0),A.insert=A.strstart<q-1?A.strstart:q-1,de===_?(H(A,!0),A.strm.avail_out===0?J:K):A.last_lit&&(H(A,!1),A.strm.avail_out===0)?w:te}function Ie(A,de,ne,L,U){this.good_length=A,this.max_lazy=de,this.nice_length=ne,this.max_chain=L,this.func=U}function tt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=b,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new d.Buf16(2*Y),this.dyn_dtree=new d.Buf16(2*(2*k+1)),this.bl_tree=new d.Buf16(2*(2*X+1)),I(this.dyn_ltree),I(this.dyn_dtree),I(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new d.Buf16(oe+1),this.heap=new d.Buf16(2*z+1),I(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new d.Buf16(2*z+1),I(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function Qe(A){var de;return A&&A.state?(A.total_in=A.total_out=0,A.data_type=x,(de=A.state).pending=0,de.pending_out=0,de.wrap<0&&(de.wrap=-de.wrap),de.status=de.wrap?B:le,A.adler=de.wrap===2?0:1,de.last_flush=T,m._tr_init(de),C):ve(A,M)}function Mt(A){var de=Qe(A);return de===C&&(function(ne){ne.window_size=2*ne.w_size,I(ne.head),ne.max_lazy_match=c[ne.level].max_lazy,ne.good_match=c[ne.level].good_length,ne.nice_match=c[ne.level].nice_length,ne.max_chain_length=c[ne.level].max_chain,ne.strstart=0,ne.block_start=0,ne.lookahead=0,ne.insert=0,ne.match_length=ne.prev_length=q-1,ne.match_available=0,ne.ins_h=0})(A.state),de}function At(A,de,ne,L,U,F){if(!A)return M;var pe=1;if(de===S&&(de=6),L<0?(pe=0,L=-L):15<L&&(pe=2,L-=16),U<1||N<U||ne!==b||L<8||15<L||de<0||9<de||F<0||R<F)return ve(A,M);L===8&&(L=9);var ge=new tt;return(A.state=ge).strm=A,ge.wrap=pe,ge.gzhead=null,ge.w_bits=L,ge.w_size=1<<ge.w_bits,ge.w_mask=ge.w_size-1,ge.hash_bits=U+7,ge.hash_size=1<<ge.hash_bits,ge.hash_mask=ge.hash_size-1,ge.hash_shift=~~((ge.hash_bits+q-1)/q),ge.window=new d.Buf8(2*ge.w_size),ge.head=new d.Buf16(ge.hash_size),ge.prev=new d.Buf16(ge.w_size),ge.lit_bufsize=1<<U+6,ge.pending_buf_size=4*ge.lit_bufsize,ge.pending_buf=new d.Buf8(ge.pending_buf_size),ge.d_buf=1*ge.lit_bufsize,ge.l_buf=3*ge.lit_bufsize,ge.level=de,ge.strategy=F,ge.method=ne,Mt(A)}c=[new Ie(0,0,0,0,function(A,de){var ne=65535;for(ne>A.pending_buf_size-5&&(ne=A.pending_buf_size-5);;){if(A.lookahead<=1){if(Ce(A),A.lookahead===0&&de===T)return w;if(A.lookahead===0)break}A.strstart+=A.lookahead,A.lookahead=0;var L=A.block_start+ne;if((A.strstart===0||A.strstart>=L)&&(A.lookahead=A.strstart-L,A.strstart=L,H(A,!1),A.strm.avail_out===0)||A.strstart-A.block_start>=A.w_size-ye&&(H(A,!1),A.strm.avail_out===0))return w}return A.insert=0,de===_?(H(A,!0),A.strm.avail_out===0?J:K):(A.strstart>A.block_start&&(H(A,!1),A.strm.avail_out),w)}),new Ie(4,4,8,4,He),new Ie(4,5,16,8,He),new Ie(4,6,32,32,He),new Ie(4,4,16,16,Ae),new Ie(8,16,32,32,Ae),new Ie(8,16,128,128,Ae),new Ie(8,32,128,256,Ae),new Ie(32,128,258,1024,Ae),new Ie(32,258,258,4096,Ae)],s.deflateInit=function(A,de){return At(A,de,b,15,8,0)},s.deflateInit2=At,s.deflateReset=Mt,s.deflateResetKeep=Qe,s.deflateSetHeader=function(A,de){return A&&A.state?A.state.wrap!==2?M:(A.state.gzhead=de,C):M},s.deflate=function(A,de){var ne,L,U,F;if(!A||!A.state||5<de||de<0)return A?ve(A,M):M;if(L=A.state,!A.output||!A.input&&A.avail_in!==0||L.status===666&&de!==_)return ve(A,A.avail_out===0?-5:M);if(L.strm=A,ne=L.last_flush,L.last_flush=de,L.status===B)if(L.wrap===2)A.adler=0,ie(L,31),ie(L,139),ie(L,8),L.gzhead?(ie(L,(L.gzhead.text?1:0)+(L.gzhead.hcrc?2:0)+(L.gzhead.extra?4:0)+(L.gzhead.name?8:0)+(L.gzhead.comment?16:0)),ie(L,255&L.gzhead.time),ie(L,L.gzhead.time>>8&255),ie(L,L.gzhead.time>>16&255),ie(L,L.gzhead.time>>24&255),ie(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),ie(L,255&L.gzhead.os),L.gzhead.extra&&L.gzhead.extra.length&&(ie(L,255&L.gzhead.extra.length),ie(L,L.gzhead.extra.length>>8&255)),L.gzhead.hcrc&&(A.adler=h(A.adler,L.pending_buf,L.pending,0)),L.gzindex=0,L.status=69):(ie(L,0),ie(L,0),ie(L,0),ie(L,0),ie(L,0),ie(L,L.level===9?2:2<=L.strategy||L.level<2?4:0),ie(L,3),L.status=le);else{var pe=b+(L.w_bits-8<<4)<<8;pe|=(2<=L.strategy||L.level<2?0:L.level<6?1:L.level===6?2:3)<<6,L.strstart!==0&&(pe|=32),pe+=31-pe%31,L.status=le,se(L,pe),L.strstart!==0&&(se(L,A.adler>>>16),se(L,65535&A.adler)),A.adler=1}if(L.status===69)if(L.gzhead.extra){for(U=L.pending;L.gzindex<(65535&L.gzhead.extra.length)&&(L.pending!==L.pending_buf_size||(L.gzhead.hcrc&&L.pending>U&&(A.adler=h(A.adler,L.pending_buf,L.pending-U,U)),P(A),U=L.pending,L.pending!==L.pending_buf_size));)ie(L,255&L.gzhead.extra[L.gzindex]),L.gzindex++;L.gzhead.hcrc&&L.pending>U&&(A.adler=h(A.adler,L.pending_buf,L.pending-U,U)),L.gzindex===L.gzhead.extra.length&&(L.gzindex=0,L.status=73)}else L.status=73;if(L.status===73)if(L.gzhead.name){U=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>U&&(A.adler=h(A.adler,L.pending_buf,L.pending-U,U)),P(A),U=L.pending,L.pending===L.pending_buf_size)){F=1;break}F=L.gzindex<L.gzhead.name.length?255&L.gzhead.name.charCodeAt(L.gzindex++):0,ie(L,F)}while(F!==0);L.gzhead.hcrc&&L.pending>U&&(A.adler=h(A.adler,L.pending_buf,L.pending-U,U)),F===0&&(L.gzindex=0,L.status=91)}else L.status=91;if(L.status===91)if(L.gzhead.comment){U=L.pending;do{if(L.pending===L.pending_buf_size&&(L.gzhead.hcrc&&L.pending>U&&(A.adler=h(A.adler,L.pending_buf,L.pending-U,U)),P(A),U=L.pending,L.pending===L.pending_buf_size)){F=1;break}F=L.gzindex<L.gzhead.comment.length?255&L.gzhead.comment.charCodeAt(L.gzindex++):0,ie(L,F)}while(F!==0);L.gzhead.hcrc&&L.pending>U&&(A.adler=h(A.adler,L.pending_buf,L.pending-U,U)),F===0&&(L.status=103)}else L.status=103;if(L.status===103&&(L.gzhead.hcrc?(L.pending+2>L.pending_buf_size&&P(A),L.pending+2<=L.pending_buf_size&&(ie(L,255&A.adler),ie(L,A.adler>>8&255),A.adler=0,L.status=le)):L.status=le),L.pending!==0){if(P(A),A.avail_out===0)return L.last_flush=-1,C}else if(A.avail_in===0&&fe(de)<=fe(ne)&&de!==_)return ve(A,-5);if(L.status===666&&A.avail_in!==0)return ve(A,-5);if(A.avail_in!==0||L.lookahead!==0||de!==T&&L.status!==666){var ge=L.strategy===2?(function(W,Te){for(var Se;;){if(W.lookahead===0&&(Ce(W),W.lookahead===0)){if(Te===T)return w;break}if(W.match_length=0,Se=m._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++,Se&&(H(W,!1),W.strm.avail_out===0))return w}return W.insert=0,Te===_?(H(W,!0),W.strm.avail_out===0?J:K):W.last_lit&&(H(W,!1),W.strm.avail_out===0)?w:te})(L,de):L.strategy===3?(function(W,Te){for(var Se,_e,Me,ke,Ne=W.window;;){if(W.lookahead<=re){if(Ce(W),W.lookahead<=re&&Te===T)return w;if(W.lookahead===0)break}if(W.match_length=0,W.lookahead>=q&&0<W.strstart&&(_e=Ne[Me=W.strstart-1])===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]){ke=W.strstart+re;do;while(_e===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]&&_e===Ne[++Me]&&Me<ke);W.match_length=re-(ke-Me),W.match_length>W.lookahead&&(W.match_length=W.lookahead)}if(W.match_length>=q?(Se=m._tr_tally(W,1,W.match_length-q),W.lookahead-=W.match_length,W.strstart+=W.match_length,W.match_length=0):(Se=m._tr_tally(W,0,W.window[W.strstart]),W.lookahead--,W.strstart++),Se&&(H(W,!1),W.strm.avail_out===0))return w}return W.insert=0,Te===_?(H(W,!0),W.strm.avail_out===0?J:K):W.last_lit&&(H(W,!1),W.strm.avail_out===0)?w:te})(L,de):c[L.level].func(L,de);if(ge!==J&&ge!==K||(L.status=666),ge===w||ge===J)return A.avail_out===0&&(L.last_flush=-1),C;if(ge===te&&(de===1?m._tr_align(L):de!==5&&(m._tr_stored_block(L,0,0,!1),de===3&&(I(L.head),L.lookahead===0&&(L.strstart=0,L.block_start=0,L.insert=0))),P(A),A.avail_out===0))return L.last_flush=-1,C}return de!==_?C:L.wrap<=0?1:(L.wrap===2?(ie(L,255&A.adler),ie(L,A.adler>>8&255),ie(L,A.adler>>16&255),ie(L,A.adler>>24&255),ie(L,255&A.total_in),ie(L,A.total_in>>8&255),ie(L,A.total_in>>16&255),ie(L,A.total_in>>24&255)):(se(L,A.adler>>>16),se(L,65535&A.adler)),P(A),0<L.wrap&&(L.wrap=-L.wrap),L.pending!==0?C:1)},s.deflateEnd=function(A){var de;return A&&A.state?(de=A.state.status)!==B&&de!==69&&de!==73&&de!==91&&de!==103&&de!==le&&de!==666?ve(A,M):(A.state=null,de===le?ve(A,-3):C):M},s.deflateSetDictionary=function(A,de){var ne,L,U,F,pe,ge,W,Te,Se=de.length;if(!A||!A.state||(F=(ne=A.state).wrap)===2||F===1&&ne.status!==B||ne.lookahead)return M;for(F===1&&(A.adler=g(A.adler,de,Se,0)),ne.wrap=0,Se>=ne.w_size&&(F===0&&(I(ne.head),ne.strstart=0,ne.block_start=0,ne.insert=0),Te=new d.Buf8(ne.w_size),d.arraySet(Te,de,Se-ne.w_size,ne.w_size,0),de=Te,Se=ne.w_size),pe=A.avail_in,ge=A.next_in,W=A.input,A.avail_in=Se,A.next_in=0,A.input=de,Ce(ne);ne.lookahead>=q;){for(L=ne.strstart,U=ne.lookahead-(q-1);ne.ins_h=(ne.ins_h<<ne.hash_shift^ne.window[L+q-1])&ne.hash_mask,ne.prev[L&ne.w_mask]=ne.head[ne.ins_h],ne.head[ne.ins_h]=L,L++,--U;);ne.strstart=L,ne.lookahead=q-1,Ce(ne)}return ne.strstart+=ne.lookahead,ne.block_start=ne.strstart,ne.insert=ne.lookahead,ne.lookahead=0,ne.match_length=ne.prev_length=q-1,ne.match_available=0,A.next_in=ge,A.input=W,A.avail_in=pe,ne.wrap=F,C},s.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(o,l,s){l.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(o,l,s){l.exports=function(c,d){var m,g,h,v,T,_,C,M,S,R,x,b,N,z,k,X,Y,oe,q,re,ye,B,le,w,te;m=c.state,g=c.next_in,w=c.input,h=g+(c.avail_in-5),v=c.next_out,te=c.output,T=v-(d-c.avail_out),_=v+(c.avail_out-257),C=m.dmax,M=m.wsize,S=m.whave,R=m.wnext,x=m.window,b=m.hold,N=m.bits,z=m.lencode,k=m.distcode,X=(1<<m.lenbits)-1,Y=(1<<m.distbits)-1;e:do{N<15&&(b+=w[g++]<<N,N+=8,b+=w[g++]<<N,N+=8),oe=z[b&X];t:for(;;){if(b>>>=q=oe>>>24,N-=q,(q=oe>>>16&255)===0)te[v++]=65535&oe;else{if(!(16&q)){if((64&q)==0){oe=z[(65535&oe)+(b&(1<<q)-1)];continue t}if(32&q){m.mode=12;break e}c.msg="invalid literal/length code",m.mode=30;break e}re=65535&oe,(q&=15)&&(N<q&&(b+=w[g++]<<N,N+=8),re+=b&(1<<q)-1,b>>>=q,N-=q),N<15&&(b+=w[g++]<<N,N+=8,b+=w[g++]<<N,N+=8),oe=k[b&Y];n:for(;;){if(b>>>=q=oe>>>24,N-=q,!(16&(q=oe>>>16&255))){if((64&q)==0){oe=k[(65535&oe)+(b&(1<<q)-1)];continue n}c.msg="invalid distance code",m.mode=30;break e}if(ye=65535&oe,N<(q&=15)&&(b+=w[g++]<<N,(N+=8)<q&&(b+=w[g++]<<N,N+=8)),C<(ye+=b&(1<<q)-1)){c.msg="invalid distance too far back",m.mode=30;break e}if(b>>>=q,N-=q,(q=v-T)<ye){if(S<(q=ye-q)&&m.sane){c.msg="invalid distance too far back",m.mode=30;break e}if(le=x,(B=0)===R){if(B+=M-q,q<re){for(re-=q;te[v++]=x[B++],--q;);B=v-ye,le=te}}else if(R<q){if(B+=M+R-q,(q-=R)<re){for(re-=q;te[v++]=x[B++],--q;);if(B=0,R<re){for(re-=q=R;te[v++]=x[B++],--q;);B=v-ye,le=te}}}else if(B+=R-q,q<re){for(re-=q;te[v++]=x[B++],--q;);B=v-ye,le=te}for(;2<re;)te[v++]=le[B++],te[v++]=le[B++],te[v++]=le[B++],re-=3;re&&(te[v++]=le[B++],1<re&&(te[v++]=le[B++]))}else{for(B=v-ye;te[v++]=te[B++],te[v++]=te[B++],te[v++]=te[B++],2<(re-=3););re&&(te[v++]=te[B++],1<re&&(te[v++]=te[B++]))}break}}break}}while(g<h&&v<_);g-=re=N>>3,b&=(1<<(N-=re<<3))-1,c.next_in=g,c.next_out=v,c.avail_in=g<h?h-g+5:5-(g-h),c.avail_out=v<_?_-v+257:257-(v-_),m.hold=b,m.bits=N}},{}],49:[function(o,l,s){var c=o("../utils/common"),d=o("./adler32"),m=o("./crc32"),g=o("./inffast"),h=o("./inftrees"),v=1,T=2,_=0,C=-2,M=1,S=852,R=592;function x(B){return(B>>>24&255)+(B>>>8&65280)+((65280&B)<<8)+((255&B)<<24)}function b(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new c.Buf16(320),this.work=new c.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function N(B){var le;return B&&B.state?(le=B.state,B.total_in=B.total_out=le.total=0,B.msg="",le.wrap&&(B.adler=1&le.wrap),le.mode=M,le.last=0,le.havedict=0,le.dmax=32768,le.head=null,le.hold=0,le.bits=0,le.lencode=le.lendyn=new c.Buf32(S),le.distcode=le.distdyn=new c.Buf32(R),le.sane=1,le.back=-1,_):C}function z(B){var le;return B&&B.state?((le=B.state).wsize=0,le.whave=0,le.wnext=0,N(B)):C}function k(B,le){var w,te;return B&&B.state?(te=B.state,le<0?(w=0,le=-le):(w=1+(le>>4),le<48&&(le&=15)),le&&(le<8||15<le)?C:(te.window!==null&&te.wbits!==le&&(te.window=null),te.wrap=w,te.wbits=le,z(B))):C}function X(B,le){var w,te;return B?(te=new b,(B.state=te).window=null,(w=k(B,le))!==_&&(B.state=null),w):C}var Y,oe,q=!0;function re(B){if(q){var le;for(Y=new c.Buf32(512),oe=new c.Buf32(32),le=0;le<144;)B.lens[le++]=8;for(;le<256;)B.lens[le++]=9;for(;le<280;)B.lens[le++]=7;for(;le<288;)B.lens[le++]=8;for(h(v,B.lens,0,288,Y,0,B.work,{bits:9}),le=0;le<32;)B.lens[le++]=5;h(T,B.lens,0,32,oe,0,B.work,{bits:5}),q=!1}B.lencode=Y,B.lenbits=9,B.distcode=oe,B.distbits=5}function ye(B,le,w,te){var J,K=B.state;return K.window===null&&(K.wsize=1<<K.wbits,K.wnext=0,K.whave=0,K.window=new c.Buf8(K.wsize)),te>=K.wsize?(c.arraySet(K.window,le,w-K.wsize,K.wsize,0),K.wnext=0,K.whave=K.wsize):(te<(J=K.wsize-K.wnext)&&(J=te),c.arraySet(K.window,le,w-te,J,K.wnext),(te-=J)?(c.arraySet(K.window,le,w-te,te,0),K.wnext=te,K.whave=K.wsize):(K.wnext+=J,K.wnext===K.wsize&&(K.wnext=0),K.whave<K.wsize&&(K.whave+=J))),0}s.inflateReset=z,s.inflateReset2=k,s.inflateResetKeep=N,s.inflateInit=function(B){return X(B,15)},s.inflateInit2=X,s.inflate=function(B,le){var w,te,J,K,ve,fe,I,P,H,ie,se,he,Ce,He,Ae,Ie,tt,Qe,Mt,At,A,de,ne,L,U=0,F=new c.Buf8(4),pe=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!B||!B.state||!B.output||!B.input&&B.avail_in!==0)return C;(w=B.state).mode===12&&(w.mode=13),ve=B.next_out,J=B.output,I=B.avail_out,K=B.next_in,te=B.input,fe=B.avail_in,P=w.hold,H=w.bits,ie=fe,se=I,de=_;e:for(;;)switch(w.mode){case M:if(w.wrap===0){w.mode=13;break}for(;H<16;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(2&w.wrap&&P===35615){F[w.check=0]=255&P,F[1]=P>>>8&255,w.check=m(w.check,F,2,0),H=P=0,w.mode=2;break}if(w.flags=0,w.head&&(w.head.done=!1),!(1&w.wrap)||(((255&P)<<8)+(P>>8))%31){B.msg="incorrect header check",w.mode=30;break}if((15&P)!=8){B.msg="unknown compression method",w.mode=30;break}if(H-=4,A=8+(15&(P>>>=4)),w.wbits===0)w.wbits=A;else if(A>w.wbits){B.msg="invalid window size",w.mode=30;break}w.dmax=1<<A,B.adler=w.check=1,w.mode=512&P?10:12,H=P=0;break;case 2:for(;H<16;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(w.flags=P,(255&w.flags)!=8){B.msg="unknown compression method",w.mode=30;break}if(57344&w.flags){B.msg="unknown header flags set",w.mode=30;break}w.head&&(w.head.text=P>>8&1),512&w.flags&&(F[0]=255&P,F[1]=P>>>8&255,w.check=m(w.check,F,2,0)),H=P=0,w.mode=3;case 3:for(;H<32;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}w.head&&(w.head.time=P),512&w.flags&&(F[0]=255&P,F[1]=P>>>8&255,F[2]=P>>>16&255,F[3]=P>>>24&255,w.check=m(w.check,F,4,0)),H=P=0,w.mode=4;case 4:for(;H<16;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}w.head&&(w.head.xflags=255&P,w.head.os=P>>8),512&w.flags&&(F[0]=255&P,F[1]=P>>>8&255,w.check=m(w.check,F,2,0)),H=P=0,w.mode=5;case 5:if(1024&w.flags){for(;H<16;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}w.length=P,w.head&&(w.head.extra_len=P),512&w.flags&&(F[0]=255&P,F[1]=P>>>8&255,w.check=m(w.check,F,2,0)),H=P=0}else w.head&&(w.head.extra=null);w.mode=6;case 6:if(1024&w.flags&&(fe<(he=w.length)&&(he=fe),he&&(w.head&&(A=w.head.extra_len-w.length,w.head.extra||(w.head.extra=new Array(w.head.extra_len)),c.arraySet(w.head.extra,te,K,he,A)),512&w.flags&&(w.check=m(w.check,te,he,K)),fe-=he,K+=he,w.length-=he),w.length))break e;w.length=0,w.mode=7;case 7:if(2048&w.flags){if(fe===0)break e;for(he=0;A=te[K+he++],w.head&&A&&w.length<65536&&(w.head.name+=String.fromCharCode(A)),A&&he<fe;);if(512&w.flags&&(w.check=m(w.check,te,he,K)),fe-=he,K+=he,A)break e}else w.head&&(w.head.name=null);w.length=0,w.mode=8;case 8:if(4096&w.flags){if(fe===0)break e;for(he=0;A=te[K+he++],w.head&&A&&w.length<65536&&(w.head.comment+=String.fromCharCode(A)),A&&he<fe;);if(512&w.flags&&(w.check=m(w.check,te,he,K)),fe-=he,K+=he,A)break e}else w.head&&(w.head.comment=null);w.mode=9;case 9:if(512&w.flags){for(;H<16;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(P!==(65535&w.check)){B.msg="header crc mismatch",w.mode=30;break}H=P=0}w.head&&(w.head.hcrc=w.flags>>9&1,w.head.done=!0),B.adler=w.check=0,w.mode=12;break;case 10:for(;H<32;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}B.adler=w.check=x(P),H=P=0,w.mode=11;case 11:if(w.havedict===0)return B.next_out=ve,B.avail_out=I,B.next_in=K,B.avail_in=fe,w.hold=P,w.bits=H,2;B.adler=w.check=1,w.mode=12;case 12:if(le===5||le===6)break e;case 13:if(w.last){P>>>=7&H,H-=7&H,w.mode=27;break}for(;H<3;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}switch(w.last=1&P,H-=1,3&(P>>>=1)){case 0:w.mode=14;break;case 1:if(re(w),w.mode=20,le!==6)break;P>>>=2,H-=2;break e;case 2:w.mode=17;break;case 3:B.msg="invalid block type",w.mode=30}P>>>=2,H-=2;break;case 14:for(P>>>=7&H,H-=7&H;H<32;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if((65535&P)!=(P>>>16^65535)){B.msg="invalid stored block lengths",w.mode=30;break}if(w.length=65535&P,H=P=0,w.mode=15,le===6)break e;case 15:w.mode=16;case 16:if(he=w.length){if(fe<he&&(he=fe),I<he&&(he=I),he===0)break e;c.arraySet(J,te,K,he,ve),fe-=he,K+=he,I-=he,ve+=he,w.length-=he;break}w.mode=12;break;case 17:for(;H<14;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(w.nlen=257+(31&P),P>>>=5,H-=5,w.ndist=1+(31&P),P>>>=5,H-=5,w.ncode=4+(15&P),P>>>=4,H-=4,286<w.nlen||30<w.ndist){B.msg="too many length or distance symbols",w.mode=30;break}w.have=0,w.mode=18;case 18:for(;w.have<w.ncode;){for(;H<3;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}w.lens[pe[w.have++]]=7&P,P>>>=3,H-=3}for(;w.have<19;)w.lens[pe[w.have++]]=0;if(w.lencode=w.lendyn,w.lenbits=7,ne={bits:w.lenbits},de=h(0,w.lens,0,19,w.lencode,0,w.work,ne),w.lenbits=ne.bits,de){B.msg="invalid code lengths set",w.mode=30;break}w.have=0,w.mode=19;case 19:for(;w.have<w.nlen+w.ndist;){for(;Ie=(U=w.lencode[P&(1<<w.lenbits)-1])>>>16&255,tt=65535&U,!((Ae=U>>>24)<=H);){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(tt<16)P>>>=Ae,H-=Ae,w.lens[w.have++]=tt;else{if(tt===16){for(L=Ae+2;H<L;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(P>>>=Ae,H-=Ae,w.have===0){B.msg="invalid bit length repeat",w.mode=30;break}A=w.lens[w.have-1],he=3+(3&P),P>>>=2,H-=2}else if(tt===17){for(L=Ae+3;H<L;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}H-=Ae,A=0,he=3+(7&(P>>>=Ae)),P>>>=3,H-=3}else{for(L=Ae+7;H<L;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}H-=Ae,A=0,he=11+(127&(P>>>=Ae)),P>>>=7,H-=7}if(w.have+he>w.nlen+w.ndist){B.msg="invalid bit length repeat",w.mode=30;break}for(;he--;)w.lens[w.have++]=A}}if(w.mode===30)break;if(w.lens[256]===0){B.msg="invalid code -- missing end-of-block",w.mode=30;break}if(w.lenbits=9,ne={bits:w.lenbits},de=h(v,w.lens,0,w.nlen,w.lencode,0,w.work,ne),w.lenbits=ne.bits,de){B.msg="invalid literal/lengths set",w.mode=30;break}if(w.distbits=6,w.distcode=w.distdyn,ne={bits:w.distbits},de=h(T,w.lens,w.nlen,w.ndist,w.distcode,0,w.work,ne),w.distbits=ne.bits,de){B.msg="invalid distances set",w.mode=30;break}if(w.mode=20,le===6)break e;case 20:w.mode=21;case 21:if(6<=fe&&258<=I){B.next_out=ve,B.avail_out=I,B.next_in=K,B.avail_in=fe,w.hold=P,w.bits=H,g(B,se),ve=B.next_out,J=B.output,I=B.avail_out,K=B.next_in,te=B.input,fe=B.avail_in,P=w.hold,H=w.bits,w.mode===12&&(w.back=-1);break}for(w.back=0;Ie=(U=w.lencode[P&(1<<w.lenbits)-1])>>>16&255,tt=65535&U,!((Ae=U>>>24)<=H);){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(Ie&&(240&Ie)==0){for(Qe=Ae,Mt=Ie,At=tt;Ie=(U=w.lencode[At+((P&(1<<Qe+Mt)-1)>>Qe)])>>>16&255,tt=65535&U,!(Qe+(Ae=U>>>24)<=H);){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}P>>>=Qe,H-=Qe,w.back+=Qe}if(P>>>=Ae,H-=Ae,w.back+=Ae,w.length=tt,Ie===0){w.mode=26;break}if(32&Ie){w.back=-1,w.mode=12;break}if(64&Ie){B.msg="invalid literal/length code",w.mode=30;break}w.extra=15&Ie,w.mode=22;case 22:if(w.extra){for(L=w.extra;H<L;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}w.length+=P&(1<<w.extra)-1,P>>>=w.extra,H-=w.extra,w.back+=w.extra}w.was=w.length,w.mode=23;case 23:for(;Ie=(U=w.distcode[P&(1<<w.distbits)-1])>>>16&255,tt=65535&U,!((Ae=U>>>24)<=H);){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if((240&Ie)==0){for(Qe=Ae,Mt=Ie,At=tt;Ie=(U=w.distcode[At+((P&(1<<Qe+Mt)-1)>>Qe)])>>>16&255,tt=65535&U,!(Qe+(Ae=U>>>24)<=H);){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}P>>>=Qe,H-=Qe,w.back+=Qe}if(P>>>=Ae,H-=Ae,w.back+=Ae,64&Ie){B.msg="invalid distance code",w.mode=30;break}w.offset=tt,w.extra=15&Ie,w.mode=24;case 24:if(w.extra){for(L=w.extra;H<L;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}w.offset+=P&(1<<w.extra)-1,P>>>=w.extra,H-=w.extra,w.back+=w.extra}if(w.offset>w.dmax){B.msg="invalid distance too far back",w.mode=30;break}w.mode=25;case 25:if(I===0)break e;if(he=se-I,w.offset>he){if((he=w.offset-he)>w.whave&&w.sane){B.msg="invalid distance too far back",w.mode=30;break}Ce=he>w.wnext?(he-=w.wnext,w.wsize-he):w.wnext-he,he>w.length&&(he=w.length),He=w.window}else He=J,Ce=ve-w.offset,he=w.length;for(I<he&&(he=I),I-=he,w.length-=he;J[ve++]=He[Ce++],--he;);w.length===0&&(w.mode=21);break;case 26:if(I===0)break e;J[ve++]=w.length,I--,w.mode=21;break;case 27:if(w.wrap){for(;H<32;){if(fe===0)break e;fe--,P|=te[K++]<<H,H+=8}if(se-=I,B.total_out+=se,w.total+=se,se&&(B.adler=w.check=w.flags?m(w.check,J,se,ve-se):d(w.check,J,se,ve-se)),se=I,(w.flags?P:x(P))!==w.check){B.msg="incorrect data check",w.mode=30;break}H=P=0}w.mode=28;case 28:if(w.wrap&&w.flags){for(;H<32;){if(fe===0)break e;fe--,P+=te[K++]<<H,H+=8}if(P!==(4294967295&w.total)){B.msg="incorrect length check",w.mode=30;break}H=P=0}w.mode=29;case 29:de=1;break e;case 30:de=-3;break e;case 31:return-4;case 32:default:return C}return B.next_out=ve,B.avail_out=I,B.next_in=K,B.avail_in=fe,w.hold=P,w.bits=H,(w.wsize||se!==B.avail_out&&w.mode<30&&(w.mode<27||le!==4))&&ye(B,B.output,B.next_out,se-B.avail_out)?(w.mode=31,-4):(ie-=B.avail_in,se-=B.avail_out,B.total_in+=ie,B.total_out+=se,w.total+=se,w.wrap&&se&&(B.adler=w.check=w.flags?m(w.check,J,se,B.next_out-se):d(w.check,J,se,B.next_out-se)),B.data_type=w.bits+(w.last?64:0)+(w.mode===12?128:0)+(w.mode===20||w.mode===15?256:0),(ie==0&&se===0||le===4)&&de===_&&(de=-5),de)},s.inflateEnd=function(B){if(!B||!B.state)return C;var le=B.state;return le.window&&(le.window=null),B.state=null,_},s.inflateGetHeader=function(B,le){var w;return B&&B.state?(2&(w=B.state).wrap)==0?C:((w.head=le).done=!1,_):C},s.inflateSetDictionary=function(B,le){var w,te=le.length;return B&&B.state?(w=B.state).wrap!==0&&w.mode!==11?C:w.mode===11&&d(1,le,te,0)!==w.check?-3:ye(B,le,te,te)?(w.mode=31,-4):(w.havedict=1,_):C},s.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(o,l,s){var c=o("../utils/common"),d=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],m=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],g=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],h=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];l.exports=function(v,T,_,C,M,S,R,x){var b,N,z,k,X,Y,oe,q,re,ye=x.bits,B=0,le=0,w=0,te=0,J=0,K=0,ve=0,fe=0,I=0,P=0,H=null,ie=0,se=new c.Buf16(16),he=new c.Buf16(16),Ce=null,He=0;for(B=0;B<=15;B++)se[B]=0;for(le=0;le<C;le++)se[T[_+le]]++;for(J=ye,te=15;1<=te&&se[te]===0;te--);if(te<J&&(J=te),te===0)return M[S++]=20971520,M[S++]=20971520,x.bits=1,0;for(w=1;w<te&&se[w]===0;w++);for(J<w&&(J=w),B=fe=1;B<=15;B++)if(fe<<=1,(fe-=se[B])<0)return-1;if(0<fe&&(v===0||te!==1))return-1;for(he[1]=0,B=1;B<15;B++)he[B+1]=he[B]+se[B];for(le=0;le<C;le++)T[_+le]!==0&&(R[he[T[_+le]]++]=le);if(Y=v===0?(H=Ce=R,19):v===1?(H=d,ie-=257,Ce=m,He-=257,256):(H=g,Ce=h,-1),B=w,X=S,ve=le=P=0,z=-1,k=(I=1<<(K=J))-1,v===1&&852<I||v===2&&592<I)return 1;for(;;){for(oe=B-ve,re=R[le]<Y?(q=0,R[le]):R[le]>Y?(q=Ce[He+R[le]],H[ie+R[le]]):(q=96,0),b=1<<B-ve,w=N=1<<K;M[X+(P>>ve)+(N-=b)]=oe<<24|q<<16|re|0,N!==0;);for(b=1<<B-1;P&b;)b>>=1;if(b!==0?(P&=b-1,P+=b):P=0,le++,--se[B]==0){if(B===te)break;B=T[_+R[le]]}if(J<B&&(P&k)!==z){for(ve===0&&(ve=J),X+=w,fe=1<<(K=B-ve);K+ve<te&&!((fe-=se[K+ve])<=0);)K++,fe<<=1;if(I+=1<<K,v===1&&852<I||v===2&&592<I)return 1;M[z=P&k]=J<<24|K<<16|X-S|0}}return P!==0&&(M[X+P]=B-ve<<24|64<<16|0),x.bits=J,0}},{"../utils/common":41}],51:[function(o,l,s){l.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(o,l,s){var c=o("../utils/common"),d=0,m=1;function g(U){for(var F=U.length;0<=--F;)U[F]=0}var h=0,v=29,T=256,_=T+1+v,C=30,M=19,S=2*_+1,R=15,x=16,b=7,N=256,z=16,k=17,X=18,Y=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],oe=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],q=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],re=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],ye=new Array(2*(_+2));g(ye);var B=new Array(2*C);g(B);var le=new Array(512);g(le);var w=new Array(256);g(w);var te=new Array(v);g(te);var J,K,ve,fe=new Array(C);function I(U,F,pe,ge,W){this.static_tree=U,this.extra_bits=F,this.extra_base=pe,this.elems=ge,this.max_length=W,this.has_stree=U&&U.length}function P(U,F){this.dyn_tree=U,this.max_code=0,this.stat_desc=F}function H(U){return U<256?le[U]:le[256+(U>>>7)]}function ie(U,F){U.pending_buf[U.pending++]=255&F,U.pending_buf[U.pending++]=F>>>8&255}function se(U,F,pe){U.bi_valid>x-pe?(U.bi_buf|=F<<U.bi_valid&65535,ie(U,U.bi_buf),U.bi_buf=F>>x-U.bi_valid,U.bi_valid+=pe-x):(U.bi_buf|=F<<U.bi_valid&65535,U.bi_valid+=pe)}function he(U,F,pe){se(U,pe[2*F],pe[2*F+1])}function Ce(U,F){for(var pe=0;pe|=1&U,U>>>=1,pe<<=1,0<--F;);return pe>>>1}function He(U,F,pe){var ge,W,Te=new Array(R+1),Se=0;for(ge=1;ge<=R;ge++)Te[ge]=Se=Se+pe[ge-1]<<1;for(W=0;W<=F;W++){var _e=U[2*W+1];_e!==0&&(U[2*W]=Ce(Te[_e]++,_e))}}function Ae(U){var F;for(F=0;F<_;F++)U.dyn_ltree[2*F]=0;for(F=0;F<C;F++)U.dyn_dtree[2*F]=0;for(F=0;F<M;F++)U.bl_tree[2*F]=0;U.dyn_ltree[2*N]=1,U.opt_len=U.static_len=0,U.last_lit=U.matches=0}function Ie(U){8<U.bi_valid?ie(U,U.bi_buf):0<U.bi_valid&&(U.pending_buf[U.pending++]=U.bi_buf),U.bi_buf=0,U.bi_valid=0}function tt(U,F,pe,ge){var W=2*F,Te=2*pe;return U[W]<U[Te]||U[W]===U[Te]&&ge[F]<=ge[pe]}function Qe(U,F,pe){for(var ge=U.heap[pe],W=pe<<1;W<=U.heap_len&&(W<U.heap_len&&tt(F,U.heap[W+1],U.heap[W],U.depth)&&W++,!tt(F,ge,U.heap[W],U.depth));)U.heap[pe]=U.heap[W],pe=W,W<<=1;U.heap[pe]=ge}function Mt(U,F,pe){var ge,W,Te,Se,_e=0;if(U.last_lit!==0)for(;ge=U.pending_buf[U.d_buf+2*_e]<<8|U.pending_buf[U.d_buf+2*_e+1],W=U.pending_buf[U.l_buf+_e],_e++,ge===0?he(U,W,F):(he(U,(Te=w[W])+T+1,F),(Se=Y[Te])!==0&&se(U,W-=te[Te],Se),he(U,Te=H(--ge),pe),(Se=oe[Te])!==0&&se(U,ge-=fe[Te],Se)),_e<U.last_lit;);he(U,N,F)}function At(U,F){var pe,ge,W,Te=F.dyn_tree,Se=F.stat_desc.static_tree,_e=F.stat_desc.has_stree,Me=F.stat_desc.elems,ke=-1;for(U.heap_len=0,U.heap_max=S,pe=0;pe<Me;pe++)Te[2*pe]!==0?(U.heap[++U.heap_len]=ke=pe,U.depth[pe]=0):Te[2*pe+1]=0;for(;U.heap_len<2;)Te[2*(W=U.heap[++U.heap_len]=ke<2?++ke:0)]=1,U.depth[W]=0,U.opt_len--,_e&&(U.static_len-=Se[2*W+1]);for(F.max_code=ke,pe=U.heap_len>>1;1<=pe;pe--)Qe(U,Te,pe);for(W=Me;pe=U.heap[1],U.heap[1]=U.heap[U.heap_len--],Qe(U,Te,1),ge=U.heap[1],U.heap[--U.heap_max]=pe,U.heap[--U.heap_max]=ge,Te[2*W]=Te[2*pe]+Te[2*ge],U.depth[W]=(U.depth[pe]>=U.depth[ge]?U.depth[pe]:U.depth[ge])+1,Te[2*pe+1]=Te[2*ge+1]=W,U.heap[1]=W++,Qe(U,Te,1),2<=U.heap_len;);U.heap[--U.heap_max]=U.heap[1],(function(Ne,$e){var ni,Ht,ii,We,fn,$t,Rt=$e.dyn_tree,Nn=$e.max_code,lr=$e.stat_desc.static_tree,wl=$e.stat_desc.has_stree,bl=$e.stat_desc.extra_bits,Mi=$e.stat_desc.extra_base,Wt=$e.stat_desc.max_length,Ri=0;for(We=0;We<=R;We++)Ne.bl_count[We]=0;for(Rt[2*Ne.heap[Ne.heap_max]+1]=0,ni=Ne.heap_max+1;ni<S;ni++)Wt<(We=Rt[2*Rt[2*(Ht=Ne.heap[ni])+1]+1]+1)&&(We=Wt,Ri++),Rt[2*Ht+1]=We,Nn<Ht||(Ne.bl_count[We]++,fn=0,Mi<=Ht&&(fn=bl[Ht-Mi]),$t=Rt[2*Ht],Ne.opt_len+=$t*(We+fn),wl&&(Ne.static_len+=$t*(lr[2*Ht+1]+fn)));if(Ri!==0){do{for(We=Wt-1;Ne.bl_count[We]===0;)We--;Ne.bl_count[We]--,Ne.bl_count[We+1]+=2,Ne.bl_count[Wt]--,Ri-=2}while(0<Ri);for(We=Wt;We!==0;We--)for(Ht=Ne.bl_count[We];Ht!==0;)Nn<(ii=Ne.heap[--ni])||(Rt[2*ii+1]!==We&&(Ne.opt_len+=(We-Rt[2*ii+1])*Rt[2*ii],Rt[2*ii+1]=We),Ht--)}})(U,F),He(Te,ke,U.bl_count)}function A(U,F,pe){var ge,W,Te=-1,Se=F[1],_e=0,Me=7,ke=4;for(Se===0&&(Me=138,ke=3),F[2*(pe+1)+1]=65535,ge=0;ge<=pe;ge++)W=Se,Se=F[2*(ge+1)+1],++_e<Me&&W===Se||(_e<ke?U.bl_tree[2*W]+=_e:W!==0?(W!==Te&&U.bl_tree[2*W]++,U.bl_tree[2*z]++):_e<=10?U.bl_tree[2*k]++:U.bl_tree[2*X]++,Te=W,ke=(_e=0)===Se?(Me=138,3):W===Se?(Me=6,3):(Me=7,4))}function de(U,F,pe){var ge,W,Te=-1,Se=F[1],_e=0,Me=7,ke=4;for(Se===0&&(Me=138,ke=3),ge=0;ge<=pe;ge++)if(W=Se,Se=F[2*(ge+1)+1],!(++_e<Me&&W===Se)){if(_e<ke)for(;he(U,W,U.bl_tree),--_e!=0;);else W!==0?(W!==Te&&(he(U,W,U.bl_tree),_e--),he(U,z,U.bl_tree),se(U,_e-3,2)):_e<=10?(he(U,k,U.bl_tree),se(U,_e-3,3)):(he(U,X,U.bl_tree),se(U,_e-11,7));Te=W,ke=(_e=0)===Se?(Me=138,3):W===Se?(Me=6,3):(Me=7,4)}}g(fe);var ne=!1;function L(U,F,pe,ge){se(U,(h<<1)+(ge?1:0),3),(function(W,Te,Se,_e){Ie(W),ie(W,Se),ie(W,~Se),c.arraySet(W.pending_buf,W.window,Te,Se,W.pending),W.pending+=Se})(U,F,pe)}s._tr_init=function(U){ne||((function(){var F,pe,ge,W,Te,Se=new Array(R+1);for(W=ge=0;W<v-1;W++)for(te[W]=ge,F=0;F<1<<Y[W];F++)w[ge++]=W;for(w[ge-1]=W,W=Te=0;W<16;W++)for(fe[W]=Te,F=0;F<1<<oe[W];F++)le[Te++]=W;for(Te>>=7;W<C;W++)for(fe[W]=Te<<7,F=0;F<1<<oe[W]-7;F++)le[256+Te++]=W;for(pe=0;pe<=R;pe++)Se[pe]=0;for(F=0;F<=143;)ye[2*F+1]=8,F++,Se[8]++;for(;F<=255;)ye[2*F+1]=9,F++,Se[9]++;for(;F<=279;)ye[2*F+1]=7,F++,Se[7]++;for(;F<=287;)ye[2*F+1]=8,F++,Se[8]++;for(He(ye,_+1,Se),F=0;F<C;F++)B[2*F+1]=5,B[2*F]=Ce(F,5);J=new I(ye,Y,T+1,_,R),K=new I(B,oe,0,C,R),ve=new I(new Array(0),q,0,M,b)})(),ne=!0),U.l_desc=new P(U.dyn_ltree,J),U.d_desc=new P(U.dyn_dtree,K),U.bl_desc=new P(U.bl_tree,ve),U.bi_buf=0,U.bi_valid=0,Ae(U)},s._tr_stored_block=L,s._tr_flush_block=function(U,F,pe,ge){var W,Te,Se=0;0<U.level?(U.strm.data_type===2&&(U.strm.data_type=(function(_e){var Me,ke=4093624447;for(Me=0;Me<=31;Me++,ke>>>=1)if(1&ke&&_e.dyn_ltree[2*Me]!==0)return d;if(_e.dyn_ltree[18]!==0||_e.dyn_ltree[20]!==0||_e.dyn_ltree[26]!==0)return m;for(Me=32;Me<T;Me++)if(_e.dyn_ltree[2*Me]!==0)return m;return d})(U)),At(U,U.l_desc),At(U,U.d_desc),Se=(function(_e){var Me;for(A(_e,_e.dyn_ltree,_e.l_desc.max_code),A(_e,_e.dyn_dtree,_e.d_desc.max_code),At(_e,_e.bl_desc),Me=M-1;3<=Me&&_e.bl_tree[2*re[Me]+1]===0;Me--);return _e.opt_len+=3*(Me+1)+5+5+4,Me})(U),W=U.opt_len+3+7>>>3,(Te=U.static_len+3+7>>>3)<=W&&(W=Te)):W=Te=pe+5,pe+4<=W&&F!==-1?L(U,F,pe,ge):U.strategy===4||Te===W?(se(U,2+(ge?1:0),3),Mt(U,ye,B)):(se(U,4+(ge?1:0),3),(function(_e,Me,ke,Ne){var $e;for(se(_e,Me-257,5),se(_e,ke-1,5),se(_e,Ne-4,4),$e=0;$e<Ne;$e++)se(_e,_e.bl_tree[2*re[$e]+1],3);de(_e,_e.dyn_ltree,Me-1),de(_e,_e.dyn_dtree,ke-1)})(U,U.l_desc.max_code+1,U.d_desc.max_code+1,Se+1),Mt(U,U.dyn_ltree,U.dyn_dtree)),Ae(U),ge&&Ie(U)},s._tr_tally=function(U,F,pe){return U.pending_buf[U.d_buf+2*U.last_lit]=F>>>8&255,U.pending_buf[U.d_buf+2*U.last_lit+1]=255&F,U.pending_buf[U.l_buf+U.last_lit]=255&pe,U.last_lit++,F===0?U.dyn_ltree[2*pe]++:(U.matches++,F--,U.dyn_ltree[2*(w[pe]+T+1)]++,U.dyn_dtree[2*H(F)]++),U.last_lit===U.lit_bufsize-1},s._tr_align=function(U){se(U,2,3),he(U,N,ye),(function(F){F.bi_valid===16?(ie(F,F.bi_buf),F.bi_buf=0,F.bi_valid=0):8<=F.bi_valid&&(F.pending_buf[F.pending++]=255&F.bi_buf,F.bi_buf>>=8,F.bi_valid-=8)})(U)}},{"../utils/common":41}],53:[function(o,l,s){l.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(o,l,s){(function(c){(function(d,m){if(!d.setImmediate){var g,h,v,T,_=1,C={},M=!1,S=d.document,R=Object.getPrototypeOf&&Object.getPrototypeOf(d);R=R&&R.setTimeout?R:d,g={}.toString.call(d.process)==="[object process]"?function(z){process.nextTick(function(){b(z)})}:(function(){if(d.postMessage&&!d.importScripts){var z=!0,k=d.onmessage;return d.onmessage=function(){z=!1},d.postMessage("","*"),d.onmessage=k,z}})()?(T="setImmediate$"+Math.random()+"$",d.addEventListener?d.addEventListener("message",N,!1):d.attachEvent("onmessage",N),function(z){d.postMessage(T+z,"*")}):d.MessageChannel?((v=new MessageChannel).port1.onmessage=function(z){b(z.data)},function(z){v.port2.postMessage(z)}):S&&"onreadystatechange"in S.createElement("script")?(h=S.documentElement,function(z){var k=S.createElement("script");k.onreadystatechange=function(){b(z),k.onreadystatechange=null,h.removeChild(k),k=null},h.appendChild(k)}):function(z){setTimeout(b,0,z)},R.setImmediate=function(z){typeof z!="function"&&(z=new Function(""+z));for(var k=new Array(arguments.length-1),X=0;X<k.length;X++)k[X]=arguments[X+1];var Y={callback:z,args:k};return C[_]=Y,g(_),_++},R.clearImmediate=x}function x(z){delete C[z]}function b(z){if(M)setTimeout(b,0,z);else{var k=C[z];if(k){M=!0;try{(function(X){var Y=X.callback,oe=X.args;switch(oe.length){case 0:Y();break;case 1:Y(oe[0]);break;case 2:Y(oe[0],oe[1]);break;case 3:Y(oe[0],oe[1],oe[2]);break;default:Y.apply(m,oe)}})(k)}finally{x(z),M=!1}}}}function N(z){z.source===d&&typeof z.data=="string"&&z.data.indexOf(T)===0&&b(+z.data.slice(T.length))}})(typeof self>"u"?c===void 0?this:c:self)}).call(this,typeof Ha<"u"?Ha:typeof self<"u"?self:typeof window<"u"?window:{})},{}]},{},[10])(10)})})(Au)),Au.exports}var TT=vT();const _T=Hu(TT),CT=({className:n})=>$.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:n,width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[$.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),$.jsx("polyline",{points:"7 10 12 15 17 10"}),$.jsx("line",{x1:"12",y1:"15",x2:"12",y2:"3"})]}),ST=({htmlContent:n,readmeContent:e,isLoading:o,isSelected:l,progress:s,statusMessage:c})=>{const[d,m]=ae.useState(!1),g=async()=>{if(!(!n||!e)){m(!0);try{const v=(k=>{const X=k.match(/<title>(.*?)<\/title>/i);return(X&&X[1]?X[1].trim():"interactive").replace(/[^a-z0-9]/gi,"_").toLowerCase()})(n),T=new Date,_=T.getFullYear(),C=String(T.getMonth()+1).padStart(2,"0"),M=String(T.getDate()).padStart(2,"0"),S=`${_}${C}${M}`,R=`${v}_${S}.zip`,x=new _T;x.file("index.html",n),x.file("readMe.md",e);const b={entry:"index.html"};x.file("config.json",JSON.stringify(b,null,2));const N=await x.generateAsync({type:"blob"}),z=document.createElement("a");z.href=URL.createObjectURL(N),z.download=R,document.body.appendChild(z),z.click(),document.body.removeChild(z),URL.revokeObjectURL(z.href)}catch(h){console.error("Failed to create ZIP file",h)}finally{m(!1)}}};return o?$.jsx("div",{className:"h-full flex flex-col items-center justify-center text-center text-gray-400 p-8",children:$.jsxs("div",{className:"w-full max-w-md",children:[$.jsx("p",{className:"font-semibold mb-3 text-gray-200",children:c||"Generating your interactive..."}),$.jsx("div",{className:"w-full bg-gray-700 rounded-full h-2.5 overflow-hidden",children:$.jsx("div",{className:"bg-primary h-2.5 rounded-full transition-all duration-300 ease-linear",style:{width:`${s}%`},role:"progressbar","aria-valuenow":s,"aria-valuemin":0,"aria-valuemax":100})}),$.jsxs("p",{className:"text-sm mt-3 font-mono",children:[s,"%"]})]})}):n?$.jsxs("div",{className:"w-full h-full flex flex-col bg-gray-900 rounded-b-md",children:[$.jsx("div",{className:"flex-shrink-0 bg-gray-700 p-2 flex items-center justify-end border-b border-gray-600",children:$.jsx("button",{onClick:g,disabled:d||!e,className:"bg-primary hover:bg-primary-hover text-white font-bold py-1 px-3 rounded-md text-sm flex items-center justify-center transition-colors disabled:bg-gray-600 disabled:cursor-wait",title:e?"Download as ZIP":"README content is not available for download.",children:d?$.jsxs($.Fragment,{children:[$.jsxs("svg",{className:"animate-spin -ml-1 mr-2 h-4 w-4 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[$.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),$.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Packaging..."]}):$.jsxs($.Fragment,{children:[$.jsx(CT,{className:"w-4 h-4 mr-2"}),"Download as ZIP"]})})}),$.jsx("div",{className:"flex-grow relative min-h-[350px]",children:$.jsx("iframe",{srcDoc:n,title:"Generated Interactive Content",className:"w-full h-full border-0 bg-white",sandbox:"allow-scripts allow-same-origin",style:{minHeight:"350px"}})})]}):$.jsxs("div",{className:"h-full flex flex-col items-center justify-center text-center text-gray-500",children:[$.jsx(Ku,{className:"w-16 h-16 mb-4"}),$.jsx("h3",{className:"font-semibold text-lg text-gray-400",children:l?"Your generated interactive will appear here.":"Select an interactive type to begin."}),$.jsx("p",{className:"text-sm mt-1",children:l?'Fill in the details and click "Generate".':"Choose a template from the left panel."})]})};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let ET,AT;function xT(){return{geminiUrl:ET,vertexUrl:AT}}function MT(n,e,o,l){var s,c;if(!(n!=null&&n.baseUrl)){const d=xT();return e?(s=d.vertexUrl)!==null&&s!==void 0?s:o:(c=d.geminiUrl)!==null&&c!==void 0?c:l}return n.baseUrl}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Ai{}function xe(n,e){const o=/\{([^}]+)\}/g;return n.replace(o,(l,s)=>{if(Object.prototype.hasOwnProperty.call(e,s)){const c=e[s];return c!=null?String(c):""}else throw new Error(`Key '${s}' not found in valueMap.`)})}function u(n,e,o){for(let c=0;c<e.length-1;c++){const d=e[c];if(d.endsWith("[]")){const m=d.slice(0,-2);if(!(m in n))if(Array.isArray(o))n[m]=Array.from({length:o.length},()=>({}));else throw new Error(`Value must be a list given an array path ${d}`);if(Array.isArray(n[m])){const g=n[m];if(Array.isArray(o))for(let h=0;h<g.length;h++){const v=g[h];u(v,e.slice(c+1),o[h])}else for(const h of g)u(h,e.slice(c+1),o)}return}else if(d.endsWith("[0]")){const m=d.slice(0,-3);m in n||(n[m]=[{}]);const g=n[m];u(g[0],e.slice(c+1),o);return}(!n[d]||typeof n[d]!="object")&&(n[d]={}),n=n[d]}const l=e[e.length-1],s=n[l];if(s!==void 0){if(!o||typeof o=="object"&&Object.keys(o).length===0||o===s)return;if(typeof s=="object"&&typeof o=="object"&&s!==null&&o!==null)Object.assign(s,o);else throw new Error(`Cannot set value for an existing key. Key: ${l}`)}else n[l]=o}function r(n,e){try{if(e.length===1&&e[0]==="_self")return n;for(let o=0;o<e.length;o++){if(typeof n!="object"||n===null)return;const l=e[o];if(l.endsWith("[]")){const s=l.slice(0,-2);if(s in n){const c=n[s];return Array.isArray(c)?c.map(d=>r(d,e.slice(o+1))):void 0}else return}else n=n[l]}return n}catch(o){if(o instanceof TypeError)return;throw o}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function bu(n){if(typeof n!="string")throw new Error("fromImageBytes must be a string");return n}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var nm;(function(n){n.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",n.OUTCOME_OK="OUTCOME_OK",n.OUTCOME_FAILED="OUTCOME_FAILED",n.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(nm||(nm={}));var im;(function(n){n.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",n.PYTHON="PYTHON"})(im||(im={}));var ti;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.STRING="STRING",n.NUMBER="NUMBER",n.INTEGER="INTEGER",n.BOOLEAN="BOOLEAN",n.ARRAY="ARRAY",n.OBJECT="OBJECT",n.NULL="NULL"})(ti||(ti={}));var om;(function(n){n.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",n.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",n.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",n.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",n.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",n.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",n.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",n.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",n.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT"})(om||(om={}));var lm;(function(n){n.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",n.SEVERITY="SEVERITY",n.PROBABILITY="PROBABILITY"})(lm||(lm={}));var am;(function(n){n.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE",n.OFF="OFF"})(am||(am={}));var rm;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(rm||(rm={}));var sm;(function(n){n.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",n.NO_AUTH="NO_AUTH",n.API_KEY_AUTH="API_KEY_AUTH",n.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",n.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",n.OAUTH="OAUTH",n.OIDC_AUTH="OIDC_AUTH"})(sm||(sm={}));var um;(function(n){n.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",n.SIMPLE_SEARCH="SIMPLE_SEARCH",n.ELASTIC_SEARCH="ELASTIC_SEARCH"})(um||(um={}));var fm;(function(n){n.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",n.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",n.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",n.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",n.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(fm||(fm={}));var cm;(function(n){n.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",n.STOP="STOP",n.MAX_TOKENS="MAX_TOKENS",n.SAFETY="SAFETY",n.RECITATION="RECITATION",n.LANGUAGE="LANGUAGE",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.SPII="SPII",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.IMAGE_SAFETY="IMAGE_SAFETY",n.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL"})(cm||(cm={}));var dm;(function(n){n.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",n.NEGLIGIBLE="NEGLIGIBLE",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH"})(dm||(dm={}));var hm;(function(n){n.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",n.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",n.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",n.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",n.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(hm||(hm={}));var mm;(function(n){n.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",n.SAFETY="SAFETY",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.IMAGE_SAFETY="IMAGE_SAFETY"})(mm||(mm={}));var pm;(function(n){n.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",n.ON_DEMAND="ON_DEMAND",n.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(pm||(pm={}));var $a;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.AUDIO="AUDIO"})($a||($a={}));var gm;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(gm||(gm={}));var Du;(function(n){n.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",n.JOB_STATE_QUEUED="JOB_STATE_QUEUED",n.JOB_STATE_PENDING="JOB_STATE_PENDING",n.JOB_STATE_RUNNING="JOB_STATE_RUNNING",n.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",n.JOB_STATE_FAILED="JOB_STATE_FAILED",n.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",n.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",n.JOB_STATE_PAUSED="JOB_STATE_PAUSED",n.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",n.JOB_STATE_UPDATING="JOB_STATE_UPDATING",n.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(Du||(Du={}));var ym;(function(n){n.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",n.TUNING_MODE_FULL="TUNING_MODE_FULL",n.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(ym||(ym={}));var vm;(function(n){n.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",n.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",n.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",n.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",n.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",n.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",n.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(vm||(vm={}));var Tm;(function(n){n.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",n.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",n.BALANCED="BALANCED",n.PRIORITIZE_COST="PRIORITIZE_COST"})(Tm||(Tm={}));var _m;(function(n){n.UNSPECIFIED="UNSPECIFIED",n.BLOCKING="BLOCKING",n.NON_BLOCKING="NON_BLOCKING"})(_m||(_m={}));var Cm;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(Cm||(Cm={}));var Sm;(function(n){n.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",n.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(Sm||(Sm={}));var Em;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.AUTO="AUTO",n.ANY="ANY",n.NONE="NONE"})(Em||(Em={}));var Am;(function(n){n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE"})(Am||(Am={}));var xm;(function(n){n.DONT_ALLOW="DONT_ALLOW",n.ALLOW_ADULT="ALLOW_ADULT",n.ALLOW_ALL="ALLOW_ALL"})(xm||(xm={}));var Mm;(function(n){n.auto="auto",n.en="en",n.ja="ja",n.ko="ko",n.hi="hi",n.zh="zh",n.pt="pt",n.es="es"})(Mm||(Mm={}));var Rm;(function(n){n.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",n.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",n.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",n.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",n.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(Rm||(Rm={}));var wm;(function(n){n.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",n.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",n.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",n.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(wm||(wm={}));var bm;(function(n){n.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",n.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",n.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",n.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(bm||(bm={}));var Dm;(function(n){n.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",n.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",n.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",n.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",n.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",n.EDIT_MODE_STYLE="EDIT_MODE_STYLE",n.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",n.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(Dm||(Dm={}));var Nm;(function(n){n.FOREGROUND="FOREGROUND",n.BACKGROUND="BACKGROUND",n.PROMPT="PROMPT",n.SEMANTIC="SEMANTIC",n.INTERACTIVE="INTERACTIVE"})(Nm||(Nm={}));var Im;(function(n){n.OPTIMIZED="OPTIMIZED",n.LOSSLESS="LOSSLESS"})(Im||(Im={}));var Um;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.PROCESSING="PROCESSING",n.ACTIVE="ACTIVE",n.FAILED="FAILED"})(Um||(Um={}));var km;(function(n){n.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",n.UPLOADED="UPLOADED",n.GENERATED="GENERATED"})(km||(km={}));var Lm;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.VIDEO="VIDEO",n.AUDIO="AUDIO",n.DOCUMENT="DOCUMENT"})(Lm||(Lm={}));var Pm;(function(n){n.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",n.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",n.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(Pm||(Pm={}));var zm;(function(n){n.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",n.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",n.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(zm||(zm={}));var Bm;(function(n){n.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",n.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",n.NO_INTERRUPTION="NO_INTERRUPTION"})(Bm||(Bm={}));var Vm;(function(n){n.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",n.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",n.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(Vm||(Vm={}));var Hm;(function(n){n.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",n.SILENT="SILENT",n.WHEN_IDLE="WHEN_IDLE",n.INTERRUPT="INTERRUPT"})(Hm||(Hm={}));var Gm;(function(n){n.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",n.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",n.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",n.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",n.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",n.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",n.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",n.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",n.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",n.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",n.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",n.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",n.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(Gm||(Gm={}));var qm;(function(n){n.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",n.QUALITY="QUALITY",n.DIVERSITY="DIVERSITY",n.VOCALIZATION="VOCALIZATION"})(qm||(qm={}));var mo;(function(n){n.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",n.PLAY="PLAY",n.PAUSE="PAUSE",n.STOP="STOP",n.RESET_CONTEXT="RESET_CONTEXT"})(mo||(mo={}));class Nu{constructor(e){const o={};for(const l of e.headers.entries())o[l[0]]=l[1];this.headers=o,this.responseInternal=e}json(){return this.responseInternal.json()}}class _l{get text(){var e,o,l,s,c,d,m,g;if(((s=(l=(o=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.content)===null||l===void 0?void 0:l.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let h="",v=!1;const T=[];for(const _ of(g=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)!==null&&g!==void 0?g:[]){for(const[C,M]of Object.entries(_))C!=="text"&&C!=="thought"&&(M!==null||M!==void 0)&&T.push(C);if(typeof _.text=="string"){if(typeof _.thought=="boolean"&&_.thought)continue;v=!0,h+=_.text}}return T.length>0&&console.warn(`there are non-text parts ${T} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),v?h:void 0}get data(){var e,o,l,s,c,d,m,g;if(((s=(l=(o=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.content)===null||l===void 0?void 0:l.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let h="";const v=[];for(const T of(g=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)!==null&&g!==void 0?g:[]){for(const[_,C]of Object.entries(T))_!=="inlineData"&&(C!==null||C!==void 0)&&v.push(_);T.inlineData&&typeof T.inlineData.data=="string"&&(h+=atob(T.inlineData.data))}return v.length>0&&console.warn(`there are non-data parts ${v} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),h.length>0?btoa(h):void 0}get functionCalls(){var e,o,l,s,c,d,m,g;if(((s=(l=(o=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.content)===null||l===void 0?void 0:l.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const h=(g=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)===null||g===void 0?void 0:g.filter(v=>v.functionCall).map(v=>v.functionCall).filter(v=>v!==void 0);if((h==null?void 0:h.length)!==0)return h}get executableCode(){var e,o,l,s,c,d,m,g,h;if(((s=(l=(o=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.content)===null||l===void 0?void 0:l.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const v=(g=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)===null||g===void 0?void 0:g.filter(T=>T.executableCode).map(T=>T.executableCode).filter(T=>T!==void 0);if((v==null?void 0:v.length)!==0)return(h=v==null?void 0:v[0])===null||h===void 0?void 0:h.code}get codeExecutionResult(){var e,o,l,s,c,d,m,g,h;if(((s=(l=(o=(e=this.candidates)===null||e===void 0?void 0:e[0])===null||o===void 0?void 0:o.content)===null||l===void 0?void 0:l.parts)===null||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const v=(g=(m=(d=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content)===null||m===void 0?void 0:m.parts)===null||g===void 0?void 0:g.filter(T=>T.codeExecutionResult).map(T=>T.codeExecutionResult).filter(T=>T!==void 0);if((v==null?void 0:v.length)!==0)return(h=v==null?void 0:v[0])===null||h===void 0?void 0:h.output}}class Fm{}class Om{}class RT{}class wT{}class bT{}class DT{}class Ym{}class Jm{}class Km{}class NT{}class Zm{}class Xm{}class Qm{}class $m{}class IT{}class UT{}class kT{}class Wm{}class LT{get text(){var e,o,l;let s="",c=!1;const d=[];for(const m of(l=(o=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||o===void 0?void 0:o.parts)!==null&&l!==void 0?l:[]){for(const[g,h]of Object.entries(m))g!=="text"&&g!=="thought"&&h!==null&&d.push(g);if(typeof m.text=="string"){if(typeof m.thought=="boolean"&&m.thought)continue;c=!0,s+=m.text}}return d.length>0&&console.warn(`there are non-text parts ${d} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),c?s:void 0}get data(){var e,o,l;let s="";const c=[];for(const d of(l=(o=(e=this.serverContent)===null||e===void 0?void 0:e.modelTurn)===null||o===void 0?void 0:o.parts)!==null&&l!==void 0?l:[]){for(const[m,g]of Object.entries(d))m!=="inlineData"&&g!==null&&c.push(m);d.inlineData&&typeof d.inlineData.data=="string"&&(s+=atob(d.inlineData.data))}return c.length>0&&console.warn(`there are non-data parts ${c} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),s.length>0?btoa(s):void 0}}class Wa{_fromAPIResponse({apiResponse:e,isVertexAI:o}){const l=new Wa;if(l.name=e.name,l.metadata=e.metadata,l.done=e.done,l.error=e.error,o){const s=e.response;if(s){const c=new Zm,d=s.videos;c.generatedVideos=d==null?void 0:d.map(m=>({video:{uri:m.gcsUri,videoBytes:m.bytesBase64Encoded?bu(m.bytesBase64Encoded):void 0,mimeType:m.mimeType}})),c.raiMediaFilteredCount=s.raiMediaFilteredCount,c.raiMediaFilteredReasons=s.raiMediaFilteredReasons,l.response=c}}else{const s=e.response;if(s){const c=new Zm,d=s.generateVideoResponse,m=d==null?void 0:d.generatedSamples;c.generatedVideos=m==null?void 0:m.map(g=>{const h=g.video;return{video:{uri:h==null?void 0:h.uri,videoBytes:h!=null&&h.encodedVideo?bu(h==null?void 0:h.encodedVideo):void 0,mimeType:g.encoding}}}),c.raiMediaFilteredCount=d==null?void 0:d.raiMediaFilteredCount,c.raiMediaFilteredReasons=d==null?void 0:d.raiMediaFilteredReasons,l.response=c}}return l}}class PT{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Fe(n,e){if(!e||typeof e!="string")throw new Error("model is required and must be a string");if(n.isVertexAI()){if(e.startsWith("publishers/")||e.startsWith("projects/")||e.startsWith("models/"))return e;if(e.indexOf("/")>=0){const o=e.split("/",2);return`publishers/${o[0]}/models/${o[1]}`}else return`publishers/google/models/${e}`}else return e.startsWith("models/")||e.startsWith("tunedModels/")?e:`models/${e}`}function Vp(n,e){const o=Fe(n,e);return o?o.startsWith("publishers/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/${o}`:o.startsWith("models/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/publishers/google/${o}`:o:""}function Hp(n){return Array.isArray(n)?n.map(e=>ja(e)):[ja(n)]}function ja(n){if(typeof n=="object"&&n!==null)return n;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof n}`)}function Gp(n){const e=ja(n);if(e.mimeType&&e.mimeType.startsWith("image/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function qp(n){const e=ja(n);if(e.mimeType&&e.mimeType.startsWith("audio/"))return e;throw new Error(`Unsupported mime type: ${e.mimeType}`)}function jm(n){if(n==null)throw new Error("PartUnion is required");if(typeof n=="object")return n;if(typeof n=="string")return{text:n};throw new Error(`Unsupported part type: ${typeof n}`)}function Fp(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("PartListUnion is required");return Array.isArray(n)?n.map(e=>jm(e)):[jm(n)]}function Iu(n){return n!=null&&typeof n=="object"&&"parts"in n&&Array.isArray(n.parts)}function ep(n){return n!=null&&typeof n=="object"&&"functionCall"in n}function tp(n){return n!=null&&typeof n=="object"&&"functionResponse"in n}function Et(n){if(n==null)throw new Error("ContentUnion is required");return Iu(n)?n:{role:"user",parts:Fp(n)}}function Op(n,e){if(!e)return[];if(n.isVertexAI()&&Array.isArray(e))return e.flatMap(o=>{const l=Et(o);return l.parts&&l.parts.length>0&&l.parts[0].text!==void 0?[l.parts[0].text]:[]});if(n.isVertexAI()){const o=Et(e);return o.parts&&o.parts.length>0&&o.parts[0].text!==void 0?[o.parts[0].text]:[]}return Array.isArray(e)?e.map(o=>Et(o)):[Et(e)]}function Qt(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("contents are required");if(!Array.isArray(n)){if(ep(n)||tp(n))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Et(n)]}const e=[],o=[],l=Iu(n[0]);for(const s of n){const c=Iu(s);if(c!=l)throw new Error("Mixing Content and Parts is not supported, please group the parts into a the appropriate Content objects and specify the roles for them");if(c)e.push(s);else{if(ep(s)||tp(s))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");o.push(s)}}return l||e.push({role:"user",parts:Fp(o)}),e}function zT(n,e){n.includes("null")&&(e.nullable=!0);const o=n.filter(l=>l!=="null");if(o.length===1)e.type=Object.values(ti).includes(o[0].toUpperCase())?o[0].toUpperCase():ti.TYPE_UNSPECIFIED;else{e.anyOf=[];for(const l of o)e.anyOf.push({type:Object.values(ti).includes(l.toUpperCase())?l.toUpperCase():ti.TYPE_UNSPECIFIED})}}function po(n){const e={},o=["items"],l=["anyOf"],s=["properties"];if(n.type&&n.anyOf)throw new Error("type and anyOf cannot be both populated.");const c=n.anyOf;c!=null&&c.length==2&&(c[0].type==="null"?(e.nullable=!0,n=c[1]):c[1].type==="null"&&(e.nullable=!0,n=c[0])),n.type instanceof Array&&zT(n.type,e);for(const[d,m]of Object.entries(n))if(m!=null)if(d=="type"){if(m==="null")throw new Error("type: null can not be the only possible type for the field.");if(m instanceof Array)continue;e.type=Object.values(ti).includes(m.toUpperCase())?m.toUpperCase():ti.TYPE_UNSPECIFIED}else if(o.includes(d))e[d]=po(m);else if(l.includes(d)){const g=[];for(const h of m){if(h.type=="null"){e.nullable=!0;continue}g.push(po(h))}e[d]=g}else if(s.includes(d)){const g={};for(const[h,v]of Object.entries(m))g[h]=po(v);e[d]=g}else{if(d==="additionalProperties")continue;e[d]=m}return e}function Zu(n){return po(n)}function Xu(n){if(typeof n=="object")return n;if(typeof n=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:n}}};throw new Error(`Unsupported speechConfig type: ${typeof n}`)}function Qu(n){if("multiSpeakerVoiceConfig"in n)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return n}function To(n){if(n.functionDeclarations)for(const e of n.functionDeclarations)e.parameters&&(Object.keys(e.parameters).includes("$schema")?e.parametersJsonSchema||(e.parametersJsonSchema=e.parameters,delete e.parameters):e.parameters=po(e.parameters)),e.response&&(Object.keys(e.response).includes("$schema")?e.responseJsonSchema||(e.responseJsonSchema=e.response,delete e.response):e.response=po(e.response));return n}function _o(n){if(n==null)throw new Error("tools is required");if(!Array.isArray(n))throw new Error("tools is required and must be an array of Tools");const e=[];for(const o of n)e.push(o);return e}function BT(n,e,o,l=1){const s=!e.startsWith(`${o}/`)&&e.split("/").length===l;return n.isVertexAI()?e.startsWith("projects/")?e:e.startsWith("locations/")?`projects/${n.getProject()}/${e}`:e.startsWith(`${o}/`)?`projects/${n.getProject()}/locations/${n.getLocation()}/${e}`:s?`projects/${n.getProject()}/locations/${n.getLocation()}/${o}/${e}`:e:s?`${o}/${e}`:e}function bn(n,e){if(typeof e!="string")throw new Error("name must be a string");return BT(n,e,"cachedContents")}function Yp(n){switch(n){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return n}}function xi(n){return bu(n)}function VT(n){return n!=null&&typeof n=="object"&&"name"in n}function HT(n){return n!=null&&typeof n=="object"&&"video"in n}function GT(n){return n!=null&&typeof n=="object"&&"uri"in n}function Jp(n){var e;let o;if(VT(n)&&(o=n.name),!(GT(n)&&(o=n.uri,o===void 0))&&!(HT(n)&&(o=(e=n.video)===null||e===void 0?void 0:e.uri,o===void 0))){if(typeof n=="string"&&(o=n),o===void 0)throw new Error("Could not extract file name from the provided input.");if(o.startsWith("https://")){const s=o.split("files/")[1].match(/[a-z0-9]+/);if(s===null)throw new Error(`Could not extract file name from URI ${o}`);o=s[0]}else o.startsWith("files/")&&(o=o.split("files/")[1]);return o}}function Kp(n,e){let o;return n.isVertexAI()?o=e?"publishers/google/models":"models":o=e?"models":"tunedModels",o}function Zp(n){for(const e of["models","tunedModels","publisherModels"])if(qT(n,e))return n[e];return[]}function qT(n,e){return n!==null&&typeof n=="object"&&e in n}function FT(n,e={}){const o=n,l={name:o.name,description:o.description,parametersJsonSchema:o.inputSchema};return e.behavior&&(l.behavior=e.behavior),{functionDeclarations:[l]}}function OT(n,e={}){const o=[],l=new Set;for(const s of n){const c=s.name;if(l.has(c))throw new Error(`Duplicate function name ${c} found in MCP tools. Please ensure function names are unique.`);l.add(c);const d=FT(s,e);d.functionDeclarations&&o.push(...d.functionDeclarations)}return{functionDeclarations:o}}function Xp(n,e){if(typeof e!="string"&&!Array.isArray(e)){if(n&&n.isVertexAI()){if(e.gcsUri&&e.bigqueryUri)throw new Error("Only one of `gcsUri` or `bigqueryUri` can be set.");if(!e.gcsUri&&!e.bigqueryUri)throw new Error("One of `gcsUri` or `bigqueryUri` must be set.")}else{if(e.inlinedRequests&&e.fileName)throw new Error("Only one of `inlinedRequests` or `fileName` can be set.");if(!e.inlinedRequests&&!e.fileName)throw new Error("One of `inlinedRequests` or `fileName` must be set.")}return e}else{if(Array.isArray(e))return{inlinedRequests:e};if(typeof e=="string"){if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:[e]};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};if(e.startsWith("files/"))return{fileName:e}}}throw new Error(`Unsupported source: ${e}`)}function YT(n){if(typeof n!="string")return n;const e=n;if(e.startsWith("gs://"))return{format:"jsonl",gcsUri:e};if(e.startsWith("bq://"))return{format:"bigquery",bigqueryUri:e};throw new Error(`Unsupported destination: ${e}`)}function Co(n,e){const o=e;if(!n.isVertexAI()){if(/batches\/[^/]+$/.test(o))return o.split("/").pop();throw new Error(`Invalid batch job name: ${o}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(o))return o.split("/").pop();if(/^\d+$/.test(o))return o;throw new Error(`Invalid batch job name: ${o}.`)}function Qp(n){const e=n;return e==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":e==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":e==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":e==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":e==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function JT(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function KT(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function ZT(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function XT(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],JT(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],KT(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],ZT(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function $p(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>XT(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function QT(n){const e={},o=r(n,["anyOf"]);o!=null&&u(e,["anyOf"],o);const l=r(n,["default"]);l!=null&&u(e,["default"],l);const s=r(n,["description"]);s!=null&&u(e,["description"],s);const c=r(n,["enum"]);c!=null&&u(e,["enum"],c);const d=r(n,["example"]);d!=null&&u(e,["example"],d);const m=r(n,["format"]);m!=null&&u(e,["format"],m);const g=r(n,["items"]);g!=null&&u(e,["items"],g);const h=r(n,["maxItems"]);h!=null&&u(e,["maxItems"],h);const v=r(n,["maxLength"]);v!=null&&u(e,["maxLength"],v);const T=r(n,["maxProperties"]);T!=null&&u(e,["maxProperties"],T);const _=r(n,["maximum"]);_!=null&&u(e,["maximum"],_);const C=r(n,["minItems"]);C!=null&&u(e,["minItems"],C);const M=r(n,["minLength"]);M!=null&&u(e,["minLength"],M);const S=r(n,["minProperties"]);S!=null&&u(e,["minProperties"],S);const R=r(n,["minimum"]);R!=null&&u(e,["minimum"],R);const x=r(n,["nullable"]);x!=null&&u(e,["nullable"],x);const b=r(n,["pattern"]);b!=null&&u(e,["pattern"],b);const N=r(n,["properties"]);N!=null&&u(e,["properties"],N);const z=r(n,["propertyOrdering"]);z!=null&&u(e,["propertyOrdering"],z);const k=r(n,["required"]);k!=null&&u(e,["required"],k);const X=r(n,["title"]);X!=null&&u(e,["title"],X);const Y=r(n,["type"]);return Y!=null&&u(e,["type"],Y),e}function $T(n){const e={};if(r(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const o=r(n,["category"]);o!=null&&u(e,["category"],o);const l=r(n,["threshold"]);return l!=null&&u(e,["threshold"],l),e}function WT(n){const e={},o=r(n,["behavior"]);o!=null&&u(e,["behavior"],o);const l=r(n,["description"]);l!=null&&u(e,["description"],l);const s=r(n,["name"]);s!=null&&u(e,["name"],s);const c=r(n,["parameters"]);c!=null&&u(e,["parameters"],c);const d=r(n,["parametersJsonSchema"]);d!=null&&u(e,["parametersJsonSchema"],d);const m=r(n,["response"]);m!=null&&u(e,["response"],m);const g=r(n,["responseJsonSchema"]);return g!=null&&u(e,["responseJsonSchema"],g),e}function jT(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function e_(n){const e={},o=r(n,["timeRangeFilter"]);if(o!=null&&u(e,["timeRangeFilter"],jT(o)),r(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");return e}function t_(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function n_(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],t_(o)),e}function i_(){return{}}function o_(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function l_(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let g=o;Array.isArray(g)&&(g=g.map(h=>WT(h))),u(e,["functionDeclarations"],g)}if(r(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const l=r(n,["googleSearch"]);l!=null&&u(e,["googleSearch"],e_(l));const s=r(n,["googleSearchRetrieval"]);if(s!=null&&u(e,["googleSearchRetrieval"],n_(s)),r(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(n,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(n,["urlContext"])!=null&&u(e,["urlContext"],i_());const d=r(n,["computerUse"]);d!=null&&u(e,["computerUse"],o_(d));const m=r(n,["codeExecution"]);return m!=null&&u(e,["codeExecution"],m),e}function a_(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["allowedFunctionNames"]);return l!=null&&u(e,["allowedFunctionNames"],l),e}function r_(n){const e={},o=r(n,["latitude"]);o!=null&&u(e,["latitude"],o);const l=r(n,["longitude"]);return l!=null&&u(e,["longitude"],l),e}function s_(n){const e={},o=r(n,["latLng"]);o!=null&&u(e,["latLng"],r_(o));const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function u_(n){const e={},o=r(n,["functionCallingConfig"]);o!=null&&u(e,["functionCallingConfig"],a_(o));const l=r(n,["retrievalConfig"]);return l!=null&&u(e,["retrievalConfig"],s_(l)),e}function f_(n){const e={},o=r(n,["voiceName"]);return o!=null&&u(e,["voiceName"],o),e}function Wp(n){const e={},o=r(n,["prebuiltVoiceConfig"]);return o!=null&&u(e,["prebuiltVoiceConfig"],f_(o)),e}function c_(n){const e={},o=r(n,["speaker"]);o!=null&&u(e,["speaker"],o);const l=r(n,["voiceConfig"]);return l!=null&&u(e,["voiceConfig"],Wp(l)),e}function d_(n){const e={},o=r(n,["speakerVoiceConfigs"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>c_(s))),u(e,["speakerVoiceConfigs"],l)}return e}function h_(n){const e={},o=r(n,["voiceConfig"]);o!=null&&u(e,["voiceConfig"],Wp(o));const l=r(n,["multiSpeakerVoiceConfig"]);l!=null&&u(e,["multiSpeakerVoiceConfig"],d_(l));const s=r(n,["languageCode"]);return s!=null&&u(e,["languageCode"],s),e}function m_(n){const e={},o=r(n,["includeThoughts"]);o!=null&&u(e,["includeThoughts"],o);const l=r(n,["thinkingBudget"]);return l!=null&&u(e,["thinkingBudget"],l),e}function p_(n,e,o){const l={},s=r(e,["systemInstruction"]);o!==void 0&&s!=null&&u(o,["systemInstruction"],$p(Et(s)));const c=r(e,["temperature"]);c!=null&&u(l,["temperature"],c);const d=r(e,["topP"]);d!=null&&u(l,["topP"],d);const m=r(e,["topK"]);m!=null&&u(l,["topK"],m);const g=r(e,["candidateCount"]);g!=null&&u(l,["candidateCount"],g);const h=r(e,["maxOutputTokens"]);h!=null&&u(l,["maxOutputTokens"],h);const v=r(e,["stopSequences"]);v!=null&&u(l,["stopSequences"],v);const T=r(e,["responseLogprobs"]);T!=null&&u(l,["responseLogprobs"],T);const _=r(e,["logprobs"]);_!=null&&u(l,["logprobs"],_);const C=r(e,["presencePenalty"]);C!=null&&u(l,["presencePenalty"],C);const M=r(e,["frequencyPenalty"]);M!=null&&u(l,["frequencyPenalty"],M);const S=r(e,["seed"]);S!=null&&u(l,["seed"],S);const R=r(e,["responseMimeType"]);R!=null&&u(l,["responseMimeType"],R);const x=r(e,["responseSchema"]);x!=null&&u(l,["responseSchema"],QT(Zu(x)));const b=r(e,["responseJsonSchema"]);if(b!=null&&u(l,["responseJsonSchema"],b),r(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(r(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const N=r(e,["safetySettings"]);if(o!==void 0&&N!=null){let ye=N;Array.isArray(ye)&&(ye=ye.map(B=>$T(B))),u(o,["safetySettings"],ye)}const z=r(e,["tools"]);if(o!==void 0&&z!=null){let ye=_o(z);Array.isArray(ye)&&(ye=ye.map(B=>l_(To(B)))),u(o,["tools"],ye)}const k=r(e,["toolConfig"]);if(o!==void 0&&k!=null&&u(o,["toolConfig"],u_(k)),r(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const X=r(e,["cachedContent"]);o!==void 0&&X!=null&&u(o,["cachedContent"],bn(n,X));const Y=r(e,["responseModalities"]);Y!=null&&u(l,["responseModalities"],Y);const oe=r(e,["mediaResolution"]);oe!=null&&u(l,["mediaResolution"],oe);const q=r(e,["speechConfig"]);if(q!=null&&u(l,["speechConfig"],h_(Xu(q))),r(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const re=r(e,["thinkingConfig"]);return re!=null&&u(l,["thinkingConfig"],m_(re)),l}function g_(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["request","model"],Fe(n,l));const s=r(e,["contents"]);if(s!=null){let d=Qt(s);Array.isArray(d)&&(d=d.map(m=>$p(m))),u(o,["request","contents"],d)}const c=r(e,["config"]);return c!=null&&u(o,["request","generationConfig"],p_(n,c,o)),o}function y_(n,e){const o={};if(r(e,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(r(e,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(r(e,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const l=r(e,["fileName"]);l!=null&&u(o,["fileName"],l);const s=r(e,["inlinedRequests"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>g_(n,d))),u(o,["requests","requests"],c)}return o}function v_(n,e){const o={},l=r(n,["displayName"]);if(e!==void 0&&l!=null&&u(e,["batch","displayName"],l),r(n,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return o}function np(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["src"]);s!=null&&u(o,["batch","inputConfig"],y_(n,Xp(n,s)));const c=r(e,["config"]);return c!=null&&u(o,["config"],v_(c,o)),o}function T_(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],Co(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function __(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],Co(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function C_(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);if(e!==void 0&&s!=null&&u(e,["_query","pageToken"],s),r(n,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return o}function S_(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],C_(o,e)),e}function E_(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],Co(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function A_(n){const e={},o=r(n,["format"]);o!=null&&u(e,["instancesFormat"],o);const l=r(n,["gcsUri"]);l!=null&&u(e,["gcsSource","uris"],l);const s=r(n,["bigqueryUri"]);if(s!=null&&u(e,["bigquerySource","inputUri"],s),r(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(r(n,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return e}function x_(n){const e={},o=r(n,["format"]);o!=null&&u(e,["predictionsFormat"],o);const l=r(n,["gcsUri"]);l!=null&&u(e,["gcsDestination","outputUriPrefix"],l);const s=r(n,["bigqueryUri"]);if(s!=null&&u(e,["bigqueryDestination","outputUri"],s),r(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(r(n,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");return e}function M_(n,e){const o={},l=r(n,["displayName"]);e!==void 0&&l!=null&&u(e,["displayName"],l);const s=r(n,["dest"]);return e!==void 0&&s!=null&&u(e,["outputConfig"],x_(YT(s))),o}function R_(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["model"],Fe(n,l));const s=r(e,["src"]);s!=null&&u(o,["inputConfig"],A_(Xp(n,s)));const c=r(e,["config"]);return c!=null&&u(o,["config"],M_(c,o)),o}function w_(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],Co(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function b_(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],Co(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function D_(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);e!==void 0&&s!=null&&u(e,["_query","pageToken"],s);const c=r(n,["filter"]);return e!==void 0&&c!=null&&u(e,["_query","filter"],c),o}function N_(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],D_(o,e)),e}function I_(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],Co(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function U_(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function k_(n){const e={},o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function L_(n){const e={},o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function P_(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],U_(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],k_(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],L_(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function z_(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>P_(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function B_(n){const e={},o=r(n,["citationSources"]);return o!=null&&u(e,["citations"],o),e}function V_(n){const e={},o=r(n,["retrievedUrl"]);o!=null&&u(e,["retrievedUrl"],o);const l=r(n,["urlRetrievalStatus"]);return l!=null&&u(e,["urlRetrievalStatus"],l),e}function H_(n){const e={},o=r(n,["urlMetadata"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>V_(s))),u(e,["urlMetadata"],l)}return e}function G_(n){const e={},o=r(n,["content"]);o!=null&&u(e,["content"],z_(o));const l=r(n,["citationMetadata"]);l!=null&&u(e,["citationMetadata"],B_(l));const s=r(n,["tokenCount"]);s!=null&&u(e,["tokenCount"],s);const c=r(n,["finishReason"]);c!=null&&u(e,["finishReason"],c);const d=r(n,["urlContextMetadata"]);d!=null&&u(e,["urlContextMetadata"],H_(d));const m=r(n,["avgLogprobs"]);m!=null&&u(e,["avgLogprobs"],m);const g=r(n,["groundingMetadata"]);g!=null&&u(e,["groundingMetadata"],g);const h=r(n,["index"]);h!=null&&u(e,["index"],h);const v=r(n,["logprobsResult"]);v!=null&&u(e,["logprobsResult"],v);const T=r(n,["safetyRatings"]);return T!=null&&u(e,["safetyRatings"],T),e}function q_(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["candidates"]);if(l!=null){let g=l;Array.isArray(g)&&(g=g.map(h=>G_(h))),u(e,["candidates"],g)}const s=r(n,["modelVersion"]);s!=null&&u(e,["modelVersion"],s);const c=r(n,["promptFeedback"]);c!=null&&u(e,["promptFeedback"],c);const d=r(n,["responseId"]);d!=null&&u(e,["responseId"],d);const m=r(n,["usageMetadata"]);return m!=null&&u(e,["usageMetadata"],m),e}function jp(n){const e={},o=r(n,["details"]);o!=null&&u(e,["details"],o);const l=r(n,["code"]);l!=null&&u(e,["code"],l);const s=r(n,["message"]);return s!=null&&u(e,["message"],s),e}function F_(n){const e={},o=r(n,["response"]);o!=null&&u(e,["response"],q_(o));const l=r(n,["error"]);return l!=null&&u(e,["error"],jp(l)),e}function O_(n){const e={},o=r(n,["responsesFile"]);o!=null&&u(e,["fileName"],o);const l=r(n,["inlinedResponses","inlinedResponses"]);if(l!=null){let s=l;Array.isArray(s)&&(s=s.map(c=>F_(c))),u(e,["inlinedResponses"],s)}return e}function Ka(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["metadata","displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["metadata","state"]);s!=null&&u(e,["state"],Qp(s));const c=r(n,["metadata","createTime"]);c!=null&&u(e,["createTime"],c);const d=r(n,["metadata","endTime"]);d!=null&&u(e,["endTime"],d);const m=r(n,["metadata","updateTime"]);m!=null&&u(e,["updateTime"],m);const g=r(n,["metadata","model"]);g!=null&&u(e,["model"],g);const h=r(n,["metadata","output"]);return h!=null&&u(e,["dest"],O_(h)),e}function Y_(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["operations"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>Ka(d))),u(e,["batchJobs"],c)}return e}function J_(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["done"]);s!=null&&u(e,["done"],s);const c=r(n,["error"]);return c!=null&&u(e,["error"],jp(c)),e}function eg(n){const e={},o=r(n,["details"]);o!=null&&u(e,["details"],o);const l=r(n,["code"]);l!=null&&u(e,["code"],l);const s=r(n,["message"]);return s!=null&&u(e,["message"],s),e}function K_(n){const e={},o=r(n,["instancesFormat"]);o!=null&&u(e,["format"],o);const l=r(n,["gcsSource","uris"]);l!=null&&u(e,["gcsUri"],l);const s=r(n,["bigquerySource","inputUri"]);return s!=null&&u(e,["bigqueryUri"],s),e}function Z_(n){const e={},o=r(n,["predictionsFormat"]);o!=null&&u(e,["format"],o);const l=r(n,["gcsDestination","outputUriPrefix"]);l!=null&&u(e,["gcsUri"],l);const s=r(n,["bigqueryDestination","outputUri"]);return s!=null&&u(e,["bigqueryUri"],s),e}function Uu(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["state"]);s!=null&&u(e,["state"],Qp(s));const c=r(n,["error"]);c!=null&&u(e,["error"],eg(c));const d=r(n,["createTime"]);d!=null&&u(e,["createTime"],d);const m=r(n,["startTime"]);m!=null&&u(e,["startTime"],m);const g=r(n,["endTime"]);g!=null&&u(e,["endTime"],g);const h=r(n,["updateTime"]);h!=null&&u(e,["updateTime"],h);const v=r(n,["model"]);v!=null&&u(e,["model"],v);const T=r(n,["inputConfig"]);T!=null&&u(e,["src"],K_(T));const _=r(n,["outputConfig"]);return _!=null&&u(e,["dest"],Z_(_)),e}function X_(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["batchPredictionJobs"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>Uu(d))),u(e,["batchJobs"],c)}return e}function Q_(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["done"]);s!=null&&u(e,["done"],s);const c=r(n,["error"]);return c!=null&&u(e,["error"],eg(c)),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var Ci;(function(n){n.PAGED_ITEM_BATCH_JOBS="batchJobs",n.PAGED_ITEM_MODELS="models",n.PAGED_ITEM_TUNING_JOBS="tuningJobs",n.PAGED_ITEM_FILES="files",n.PAGED_ITEM_CACHED_CONTENTS="cachedContents"})(Ci||(Ci={}));class Rl{constructor(e,o,l,s){this.pageInternal=[],this.paramsInternal={},this.requestInternal=o,this.init(e,l,s)}init(e,o,l){var s,c;this.nameInternal=e,this.pageInternal=o[this.nameInternal]||[],this.sdkHttpResponseInternal=o==null?void 0:o.sdkHttpResponse,this.idxInternal=0;let d={config:{}};!l||Object.keys(l).length===0?d={config:{}}:typeof l=="object"?d=Object.assign({},l):d=l,d.config&&(d.config.pageToken=o.nextPageToken),this.paramsInternal=d,this.pageInternalSize=(c=(s=d.config)===null||s===void 0?void 0:s.pageSize)!==null&&c!==void 0?c:this.pageInternal.length}initNextPage(e){this.init(this.nameInternal,e,this.paramsInternal)}get page(){return this.pageInternal}get name(){return this.nameInternal}get pageSize(){return this.pageInternalSize}get sdkHttpResponse(){return this.sdkHttpResponseInternal}get params(){return this.paramsInternal}get pageLength(){return this.pageInternal.length}getItem(e){return this.pageInternal[e]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const e=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:e,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const e=await this.requestInternal(this.params);return this.initNextPage(e),this.page}hasNextPage(){var e;return((e=this.params.config)===null||e===void 0?void 0:e.pageToken)!==void 0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class $_ extends Ai{constructor(e){super(),this.apiClient=e,this.create=async o=>{var l,s;if(this.apiClient.isVertexAI()){const d=Date.now().toString();if(Array.isArray(o.src))throw new Error("InlinedRequest[] is not supported in Vertex AI. Please use Google Cloud Storage URI or BigQuery URI instead.");if(o.config=o.config||{},o.config.displayName===void 0&&(o.config.displayName="genaiBatchJob_${timestampStr}"),o.config.dest===void 0&&typeof o.src=="string")if(o.src.startsWith("gs://")&&o.src.endsWith(".jsonl"))o.config.dest=`${o.src.slice(0,-6)}/dest`;else if(o.src.startsWith("bq://"))o.config.dest=`${o.src}_dest_${d}`;else throw new Error("Unsupported source:"+o.src)}else if(Array.isArray(o.src)||typeof o.src!="string"&&o.src.inlinedRequests){let c="",d={};const m=np(this.apiClient,o);c=xe("{model}:batchGenerateContent",m._url),d=m._query;const v=m.batch.inputConfig.requests,T=v.requests,_=[];for(const M of T){const S=M;if(S.systemInstruction){const R=S.systemInstruction;delete S.systemInstruction;const x=S.request;x.systemInstruction=R,S.request=x}_.push(S)}return v.requests=_,delete m.config,delete m._url,delete m._query,this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(l=o.config)===null||l===void 0?void 0:l.httpOptions,abortSignal:(s=o.config)===null||s===void 0?void 0:s.abortSignal}).then(M=>M.json()).then(M=>Ka(M))}return await this.createInternal(o)},this.list=async(o={})=>new Rl(Ci.PAGED_ITEM_BATCH_JOBS,l=>this.listInternal(l),await this.listInternal(o),o)}async createInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=R_(this.apiClient,e);return m=xe("batchPredictionJobs",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>Uu(v))}else{const h=np(this.apiClient,e);return m=xe("{model}:batchGenerateContent",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Ka(v))}}async get(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=w_(this.apiClient,e);return m=xe("batchPredictionJobs/{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>Uu(v))}else{const h=T_(this.apiClient,e);return m=xe("batches/{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Ka(v))}}async cancel(e){var o,l,s,c;let d="",m={};if(this.apiClient.isVertexAI()){const g=b_(this.apiClient,e);d=xe("batchPredictionJobs/{name}:cancel",g._url),m=g._query,delete g.config,delete g._url,delete g._query,await this.apiClient.request({path:d,queryParams:m,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal})}else{const g=__(this.apiClient,e);d=xe("batches/{name}:cancel",g._url),m=g._query,delete g.config,delete g._url,delete g._query,await this.apiClient.request({path:d,queryParams:m,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal})}}async listInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=N_(e);return m=xe("batchPredictionJobs",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=X_(v),_=new Wm;return Object.assign(_,T),_})}else{const h=S_(e);return m=xe("batches",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=Y_(v),_=new Wm;return Object.assign(_,T),_})}}async delete(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=I_(this.apiClient,e);return m=xe("batchPredictionJobs/{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"DELETE",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>Q_(v))}else{const h=E_(this.apiClient,e);return m=xe("batches/{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>J_(v))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function W_(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function j_(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function eC(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function tC(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],W_(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],j_(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],eC(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function ip(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>tC(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function nC(n){const e={},o=r(n,["behavior"]);o!=null&&u(e,["behavior"],o);const l=r(n,["description"]);l!=null&&u(e,["description"],l);const s=r(n,["name"]);s!=null&&u(e,["name"],s);const c=r(n,["parameters"]);c!=null&&u(e,["parameters"],c);const d=r(n,["parametersJsonSchema"]);d!=null&&u(e,["parametersJsonSchema"],d);const m=r(n,["response"]);m!=null&&u(e,["response"],m);const g=r(n,["responseJsonSchema"]);return g!=null&&u(e,["responseJsonSchema"],g),e}function iC(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function oC(n){const e={},o=r(n,["timeRangeFilter"]);if(o!=null&&u(e,["timeRangeFilter"],iC(o)),r(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");return e}function lC(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function aC(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],lC(o)),e}function rC(){return{}}function sC(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function uC(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let g=o;Array.isArray(g)&&(g=g.map(h=>nC(h))),u(e,["functionDeclarations"],g)}if(r(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const l=r(n,["googleSearch"]);l!=null&&u(e,["googleSearch"],oC(l));const s=r(n,["googleSearchRetrieval"]);if(s!=null&&u(e,["googleSearchRetrieval"],aC(s)),r(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(n,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(n,["urlContext"])!=null&&u(e,["urlContext"],rC());const d=r(n,["computerUse"]);d!=null&&u(e,["computerUse"],sC(d));const m=r(n,["codeExecution"]);return m!=null&&u(e,["codeExecution"],m),e}function fC(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["allowedFunctionNames"]);return l!=null&&u(e,["allowedFunctionNames"],l),e}function cC(n){const e={},o=r(n,["latitude"]);o!=null&&u(e,["latitude"],o);const l=r(n,["longitude"]);return l!=null&&u(e,["longitude"],l),e}function dC(n){const e={},o=r(n,["latLng"]);o!=null&&u(e,["latLng"],cC(o));const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function hC(n){const e={},o=r(n,["functionCallingConfig"]);o!=null&&u(e,["functionCallingConfig"],fC(o));const l=r(n,["retrievalConfig"]);return l!=null&&u(e,["retrievalConfig"],dC(l)),e}function mC(n,e){const o={},l=r(n,["ttl"]);e!==void 0&&l!=null&&u(e,["ttl"],l);const s=r(n,["expireTime"]);e!==void 0&&s!=null&&u(e,["expireTime"],s);const c=r(n,["displayName"]);e!==void 0&&c!=null&&u(e,["displayName"],c);const d=r(n,["contents"]);if(e!==void 0&&d!=null){let v=Qt(d);Array.isArray(v)&&(v=v.map(T=>ip(T))),u(e,["contents"],v)}const m=r(n,["systemInstruction"]);e!==void 0&&m!=null&&u(e,["systemInstruction"],ip(Et(m)));const g=r(n,["tools"]);if(e!==void 0&&g!=null){let v=g;Array.isArray(v)&&(v=v.map(T=>uC(T))),u(e,["tools"],v)}const h=r(n,["toolConfig"]);if(e!==void 0&&h!=null&&u(e,["toolConfig"],hC(h)),r(n,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return o}function pC(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["model"],Vp(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],mC(s,o)),o}function gC(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],bn(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function yC(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],bn(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function vC(n,e){const o={},l=r(n,["ttl"]);e!==void 0&&l!=null&&u(e,["ttl"],l);const s=r(n,["expireTime"]);return e!==void 0&&s!=null&&u(e,["expireTime"],s),o}function TC(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],bn(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],vC(s,o)),o}function _C(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);return e!==void 0&&s!=null&&u(e,["_query","pageToken"],s),o}function CC(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],_C(o,e)),e}function SC(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function EC(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["data"]);l!=null&&u(e,["data"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function AC(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["fileUri"]);l!=null&&u(e,["fileUri"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function xC(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],SC(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],EC(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],AC(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function op(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>xC(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function MC(n){const e={};if(r(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const o=r(n,["description"]);o!=null&&u(e,["description"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["parameters"]);s!=null&&u(e,["parameters"],s);const c=r(n,["parametersJsonSchema"]);c!=null&&u(e,["parametersJsonSchema"],c);const d=r(n,["response"]);d!=null&&u(e,["response"],d);const m=r(n,["responseJsonSchema"]);return m!=null&&u(e,["responseJsonSchema"],m),e}function RC(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function wC(n){const e={},o=r(n,["timeRangeFilter"]);o!=null&&u(e,["timeRangeFilter"],RC(o));const l=r(n,["excludeDomains"]);return l!=null&&u(e,["excludeDomains"],l),e}function bC(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function DC(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],bC(o)),e}function NC(n){const e={},o=r(n,["excludeDomains"]);return o!=null&&u(e,["excludeDomains"],o),e}function IC(n){const e={},o=r(n,["apiKeyString"]);return o!=null&&u(e,["apiKeyString"],o),e}function UC(n){const e={},o=r(n,["apiKeyConfig"]);o!=null&&u(e,["apiKeyConfig"],IC(o));const l=r(n,["authType"]);l!=null&&u(e,["authType"],l);const s=r(n,["googleServiceAccountConfig"]);s!=null&&u(e,["googleServiceAccountConfig"],s);const c=r(n,["httpBasicAuthConfig"]);c!=null&&u(e,["httpBasicAuthConfig"],c);const d=r(n,["oauthConfig"]);d!=null&&u(e,["oauthConfig"],d);const m=r(n,["oidcConfig"]);return m!=null&&u(e,["oidcConfig"],m),e}function kC(n){const e={},o=r(n,["authConfig"]);return o!=null&&u(e,["authConfig"],UC(o)),e}function LC(){return{}}function PC(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function zC(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let T=o;Array.isArray(T)&&(T=T.map(_=>MC(_))),u(e,["functionDeclarations"],T)}const l=r(n,["retrieval"]);l!=null&&u(e,["retrieval"],l);const s=r(n,["googleSearch"]);s!=null&&u(e,["googleSearch"],wC(s));const c=r(n,["googleSearchRetrieval"]);c!=null&&u(e,["googleSearchRetrieval"],DC(c));const d=r(n,["enterpriseWebSearch"]);d!=null&&u(e,["enterpriseWebSearch"],NC(d));const m=r(n,["googleMaps"]);m!=null&&u(e,["googleMaps"],kC(m)),r(n,["urlContext"])!=null&&u(e,["urlContext"],LC());const h=r(n,["computerUse"]);h!=null&&u(e,["computerUse"],PC(h));const v=r(n,["codeExecution"]);return v!=null&&u(e,["codeExecution"],v),e}function BC(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["allowedFunctionNames"]);return l!=null&&u(e,["allowedFunctionNames"],l),e}function VC(n){const e={},o=r(n,["latitude"]);o!=null&&u(e,["latitude"],o);const l=r(n,["longitude"]);return l!=null&&u(e,["longitude"],l),e}function HC(n){const e={},o=r(n,["latLng"]);o!=null&&u(e,["latLng"],VC(o));const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function GC(n){const e={},o=r(n,["functionCallingConfig"]);o!=null&&u(e,["functionCallingConfig"],BC(o));const l=r(n,["retrievalConfig"]);return l!=null&&u(e,["retrievalConfig"],HC(l)),e}function qC(n,e){const o={},l=r(n,["ttl"]);e!==void 0&&l!=null&&u(e,["ttl"],l);const s=r(n,["expireTime"]);e!==void 0&&s!=null&&u(e,["expireTime"],s);const c=r(n,["displayName"]);e!==void 0&&c!=null&&u(e,["displayName"],c);const d=r(n,["contents"]);if(e!==void 0&&d!=null){let T=Qt(d);Array.isArray(T)&&(T=T.map(_=>op(_))),u(e,["contents"],T)}const m=r(n,["systemInstruction"]);e!==void 0&&m!=null&&u(e,["systemInstruction"],op(Et(m)));const g=r(n,["tools"]);if(e!==void 0&&g!=null){let T=g;Array.isArray(T)&&(T=T.map(_=>zC(_))),u(e,["tools"],T)}const h=r(n,["toolConfig"]);e!==void 0&&h!=null&&u(e,["toolConfig"],GC(h));const v=r(n,["kmsKeyName"]);return e!==void 0&&v!=null&&u(e,["encryption_spec","kmsKeyName"],v),o}function FC(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["model"],Vp(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],qC(s,o)),o}function OC(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],bn(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function YC(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],bn(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function JC(n,e){const o={},l=r(n,["ttl"]);e!==void 0&&l!=null&&u(e,["ttl"],l);const s=r(n,["expireTime"]);return e!==void 0&&s!=null&&u(e,["expireTime"],s),o}function KC(n,e){const o={},l=r(e,["name"]);l!=null&&u(o,["_url","name"],bn(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],JC(s,o)),o}function ZC(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);return e!==void 0&&s!=null&&u(e,["_query","pageToken"],s),o}function XC(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],ZC(o,e)),e}function Za(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["model"]);s!=null&&u(e,["model"],s);const c=r(n,["createTime"]);c!=null&&u(e,["createTime"],c);const d=r(n,["updateTime"]);d!=null&&u(e,["updateTime"],d);const m=r(n,["expireTime"]);m!=null&&u(e,["expireTime"],m);const g=r(n,["usageMetadata"]);return g!=null&&u(e,["usageMetadata"],g),e}function QC(){return{}}function $C(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["cachedContents"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>Za(d))),u(e,["cachedContents"],c)}return e}function Xa(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["model"]);s!=null&&u(e,["model"],s);const c=r(n,["createTime"]);c!=null&&u(e,["createTime"],c);const d=r(n,["updateTime"]);d!=null&&u(e,["updateTime"],d);const m=r(n,["expireTime"]);m!=null&&u(e,["expireTime"],m);const g=r(n,["usageMetadata"]);return g!=null&&u(e,["usageMetadata"],g),e}function WC(){return{}}function jC(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["cachedContents"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>Xa(d))),u(e,["cachedContents"],c)}return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class eS extends Ai{constructor(e){super(),this.apiClient=e,this.list=async(o={})=>new Rl(Ci.PAGED_ITEM_CACHED_CONTENTS,l=>this.listInternal(l),await this.listInternal(o),o)}async create(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=FC(this.apiClient,e);return m=xe("cachedContents",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>Xa(v))}else{const h=pC(this.apiClient,e);return m=xe("cachedContents",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Za(v))}}async get(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=OC(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>Xa(v))}else{const h=gC(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Za(v))}}async delete(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=YC(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"DELETE",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(()=>{const v=WC(),T=new Qm;return Object.assign(T,v),T})}else{const h=yC(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(()=>{const v=QC(),T=new Qm;return Object.assign(T,v),T})}}async update(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=KC(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"PATCH",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>Xa(v))}else{const h=TC(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"PATCH",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Za(v))}}async listInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=XC(e);return m=xe("cachedContents",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=jC(v),_=new $m;return Object.assign(_,T),_})}else{const h=CC(e);return m=xe("cachedContents",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=$C(v),_=new $m;return Object.assign(_,T),_})}}}function lp(n){var e=typeof Symbol=="function"&&Symbol.iterator,o=e&&n[e],l=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&l>=n.length&&(n=void 0),{value:n&&n[l++],done:!n}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function et(n){return this instanceof et?(this.v=n,this):new et(n)}function go(n,e,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var l=o.apply(n,e||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),m("next"),m("throw"),m("return",d),s[Symbol.asyncIterator]=function(){return this},s;function d(C){return function(M){return Promise.resolve(M).then(C,T)}}function m(C,M){l[C]&&(s[C]=function(S){return new Promise(function(R,x){c.push([C,S,R,x])>1||g(C,S)})},M&&(s[C]=M(s[C])))}function g(C,M){try{h(l[C](M))}catch(S){_(c[0][3],S)}}function h(C){C.value instanceof et?Promise.resolve(C.value.v).then(v,T):_(c[0][2],C)}function v(C){g("next",C)}function T(C){g("throw",C)}function _(C,M){C(M),c.shift(),c.length&&g(c[0][0],c[0][1])}}function Cl(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=n[Symbol.asyncIterator],o;return e?e.call(n):(n=typeof lp=="function"?lp(n):n[Symbol.iterator](),o={},l("next"),l("throw"),l("return"),o[Symbol.asyncIterator]=function(){return this},o);function l(c){o[c]=n[c]&&function(d){return new Promise(function(m,g){d=n[c](d),s(m,g,d.done,d.value)})}}function s(c,d,m,g){Promise.resolve(g).then(function(h){c({value:h,done:m})},d)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function tS(n){var e;if(n.candidates==null||n.candidates.length===0)return!1;const o=(e=n.candidates[0])===null||e===void 0?void 0:e.content;return o===void 0?!1:tg(o)}function tg(n){if(n.parts===void 0||n.parts.length===0)return!1;for(const e of n.parts)if(e===void 0||Object.keys(e).length===0)return!1;return!0}function nS(n){if(n.length!==0){for(const e of n)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}}function ap(n){if(n===void 0||n.length===0)return[];const e=[],o=n.length;let l=0;for(;l<o;)if(n[l].role==="user")e.push(n[l]),l++;else{const s=[];let c=!0;for(;l<o&&n[l].role==="model";)s.push(n[l]),c&&!tg(n[l])&&(c=!1),l++;c?e.push(...s):e.pop()}return e}class iS{constructor(e,o){this.modelsModule=e,this.apiClient=o}create(e){return new oS(this.apiClient,this.modelsModule,e.model,e.config,structuredClone(e.history))}}class oS{constructor(e,o,l,s={},c=[]){this.apiClient=e,this.modelsModule=o,this.model=l,this.config=s,this.history=c,this.sendPromise=Promise.resolve(),nS(c)}async sendMessage(e){var o;await this.sendPromise;const l=Et(e.message),s=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(l),config:(o=e.config)!==null&&o!==void 0?o:this.config});return this.sendPromise=(async()=>{var c,d,m;const g=await s,h=(d=(c=g.candidates)===null||c===void 0?void 0:c[0])===null||d===void 0?void 0:d.content,v=g.automaticFunctionCallingHistory,T=this.getHistory(!0).length;let _=[];v!=null&&(_=(m=v.slice(T))!==null&&m!==void 0?m:[]);const C=h?[h]:[];this.recordHistory(l,C,_)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}async sendMessageStream(e){var o;await this.sendPromise;const l=Et(e.message),s=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(l),config:(o=e.config)!==null&&o!==void 0?o:this.config});this.sendPromise=s.then(()=>{}).catch(()=>{});const c=await s;return this.processStreamResponse(c,l)}getHistory(e=!1){const o=e?ap(this.history):this.history;return structuredClone(o)}processStreamResponse(e,o){var l,s;return go(this,arguments,function*(){var d,m,g,h;const v=[];try{for(var T=!0,_=Cl(e),C;C=yield et(_.next()),d=C.done,!d;T=!0){h=C.value,T=!1;const M=h;if(tS(M)){const S=(s=(l=M.candidates)===null||l===void 0?void 0:l[0])===null||s===void 0?void 0:s.content;S!==void 0&&v.push(S)}yield yield et(M)}}catch(M){m={error:M}}finally{try{!T&&!d&&(g=_.return)&&(yield et(g.call(_)))}finally{if(m)throw m.error}}this.recordHistory(o,v)})}recordHistory(e,o,l){let s=[];o.length>0&&o.every(c=>c.role!==void 0)?s=o:s.push({role:"model",parts:[]}),l&&l.length>0?this.history.push(...ap(l)):this.history.push(e),this.history.push(...s)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class nr extends Error{constructor(e){super(e.message),this.name="ApiError",this.status=e.status,Object.setPrototypeOf(this,nr.prototype)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function lS(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);return e!==void 0&&s!=null&&u(e,["_query","pageToken"],s),o}function aS(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],lS(o,e)),e}function rS(n){const e={},o=r(n,["details"]);o!=null&&u(e,["details"],o);const l=r(n,["message"]);l!=null&&u(e,["message"],l);const s=r(n,["code"]);return s!=null&&u(e,["code"],s),e}function sS(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["mimeType"]);s!=null&&u(e,["mimeType"],s);const c=r(n,["sizeBytes"]);c!=null&&u(e,["sizeBytes"],c);const d=r(n,["createTime"]);d!=null&&u(e,["createTime"],d);const m=r(n,["expirationTime"]);m!=null&&u(e,["expirationTime"],m);const g=r(n,["updateTime"]);g!=null&&u(e,["updateTime"],g);const h=r(n,["sha256Hash"]);h!=null&&u(e,["sha256Hash"],h);const v=r(n,["uri"]);v!=null&&u(e,["uri"],v);const T=r(n,["downloadUri"]);T!=null&&u(e,["downloadUri"],T);const _=r(n,["state"]);_!=null&&u(e,["state"],_);const C=r(n,["source"]);C!=null&&u(e,["source"],C);const M=r(n,["videoMetadata"]);M!=null&&u(e,["videoMetadata"],M);const S=r(n,["error"]);return S!=null&&u(e,["error"],rS(S)),e}function uS(n){const e={},o=r(n,["file"]);o!=null&&u(e,["file"],sS(o));const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function fS(n){const e={},o=r(n,["name"]);o!=null&&u(e,["_url","file"],Jp(o));const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function cS(n){const e={},o=r(n,["name"]);o!=null&&u(e,["_url","file"],Jp(o));const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function dS(n){const e={},o=r(n,["details"]);o!=null&&u(e,["details"],o);const l=r(n,["message"]);l!=null&&u(e,["message"],l);const s=r(n,["code"]);return s!=null&&u(e,["code"],s),e}function ku(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["mimeType"]);s!=null&&u(e,["mimeType"],s);const c=r(n,["sizeBytes"]);c!=null&&u(e,["sizeBytes"],c);const d=r(n,["createTime"]);d!=null&&u(e,["createTime"],d);const m=r(n,["expirationTime"]);m!=null&&u(e,["expirationTime"],m);const g=r(n,["updateTime"]);g!=null&&u(e,["updateTime"],g);const h=r(n,["sha256Hash"]);h!=null&&u(e,["sha256Hash"],h);const v=r(n,["uri"]);v!=null&&u(e,["uri"],v);const T=r(n,["downloadUri"]);T!=null&&u(e,["downloadUri"],T);const _=r(n,["state"]);_!=null&&u(e,["state"],_);const C=r(n,["source"]);C!=null&&u(e,["source"],C);const M=r(n,["videoMetadata"]);M!=null&&u(e,["videoMetadata"],M);const S=r(n,["error"]);return S!=null&&u(e,["error"],dS(S)),e}function hS(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["files"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>ku(d))),u(e,["files"],c)}return e}function mS(n){const e={},o=r(n,["sdkHttpResponse"]);return o!=null&&u(e,["sdkHttpResponse"],o),e}function pS(){return{}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class gS extends Ai{constructor(e){super(),this.apiClient=e,this.list=async(o={})=>new Rl(Ci.PAGED_ITEM_FILES,l=>this.listInternal(l),await this.listInternal(o),o)}async upload(e){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files. You can share files through a GCS bucket.");return this.apiClient.uploadFile(e.file,e.config).then(o=>ku(o))}async download(e){await this.apiClient.downloadFile(e)}async listInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=aS(e);return c=xe("files",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json().then(h=>{const v=h;return v.sdkHttpResponse={headers:g.headers},v})),s.then(g=>{const h=hS(g),v=new IT;return Object.assign(v,h),v})}}async createInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=uS(e);return c=xe("upload/v1beta/files",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json()),s.then(g=>{const h=mS(g),v=new UT;return Object.assign(v,h),v})}}async get(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=fS(e);return c=xe("files/{file}",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json()),s.then(g=>ku(g))}}async delete(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=cS(e);return c=xe("files/{file}",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json()),s.then(()=>{const g=pS(),h=new kT;return Object.assign(h,g),h})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function yS(n){const e={},o=r(n,["voiceName"]);return o!=null&&u(e,["voiceName"],o),e}function ng(n){const e={},o=r(n,["prebuiltVoiceConfig"]);return o!=null&&u(e,["prebuiltVoiceConfig"],yS(o)),e}function vS(n){const e={},o=r(n,["speaker"]);o!=null&&u(e,["speaker"],o);const l=r(n,["voiceConfig"]);return l!=null&&u(e,["voiceConfig"],ng(l)),e}function TS(n){const e={},o=r(n,["speakerVoiceConfigs"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>vS(s))),u(e,["speakerVoiceConfigs"],l)}return e}function _S(n){const e={},o=r(n,["voiceConfig"]);o!=null&&u(e,["voiceConfig"],ng(o));const l=r(n,["multiSpeakerVoiceConfig"]);l!=null&&u(e,["multiSpeakerVoiceConfig"],TS(l));const s=r(n,["languageCode"]);return s!=null&&u(e,["languageCode"],s),e}function CS(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function SS(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function ES(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function AS(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],CS(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],SS(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],ES(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function xS(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>AS(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function MS(n){const e={},o=r(n,["behavior"]);o!=null&&u(e,["behavior"],o);const l=r(n,["description"]);l!=null&&u(e,["description"],l);const s=r(n,["name"]);s!=null&&u(e,["name"],s);const c=r(n,["parameters"]);c!=null&&u(e,["parameters"],c);const d=r(n,["parametersJsonSchema"]);d!=null&&u(e,["parametersJsonSchema"],d);const m=r(n,["response"]);m!=null&&u(e,["response"],m);const g=r(n,["responseJsonSchema"]);return g!=null&&u(e,["responseJsonSchema"],g),e}function RS(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function wS(n){const e={},o=r(n,["timeRangeFilter"]);if(o!=null&&u(e,["timeRangeFilter"],RS(o)),r(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");return e}function bS(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function DS(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],bS(o)),e}function NS(){return{}}function IS(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function US(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let g=o;Array.isArray(g)&&(g=g.map(h=>MS(h))),u(e,["functionDeclarations"],g)}if(r(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const l=r(n,["googleSearch"]);l!=null&&u(e,["googleSearch"],wS(l));const s=r(n,["googleSearchRetrieval"]);if(s!=null&&u(e,["googleSearchRetrieval"],DS(s)),r(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(n,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(n,["urlContext"])!=null&&u(e,["urlContext"],NS());const d=r(n,["computerUse"]);d!=null&&u(e,["computerUse"],IS(d));const m=r(n,["codeExecution"]);return m!=null&&u(e,["codeExecution"],m),e}function kS(n){const e={},o=r(n,["handle"]);if(o!=null&&u(e,["handle"],o),r(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function rp(){return{}}function LS(n){const e={},o=r(n,["disabled"]);o!=null&&u(e,["disabled"],o);const l=r(n,["startOfSpeechSensitivity"]);l!=null&&u(e,["startOfSpeechSensitivity"],l);const s=r(n,["endOfSpeechSensitivity"]);s!=null&&u(e,["endOfSpeechSensitivity"],s);const c=r(n,["prefixPaddingMs"]);c!=null&&u(e,["prefixPaddingMs"],c);const d=r(n,["silenceDurationMs"]);return d!=null&&u(e,["silenceDurationMs"],d),e}function PS(n){const e={},o=r(n,["automaticActivityDetection"]);o!=null&&u(e,["automaticActivityDetection"],LS(o));const l=r(n,["activityHandling"]);l!=null&&u(e,["activityHandling"],l);const s=r(n,["turnCoverage"]);return s!=null&&u(e,["turnCoverage"],s),e}function zS(n){const e={},o=r(n,["targetTokens"]);return o!=null&&u(e,["targetTokens"],o),e}function BS(n){const e={},o=r(n,["triggerTokens"]);o!=null&&u(e,["triggerTokens"],o);const l=r(n,["slidingWindow"]);return l!=null&&u(e,["slidingWindow"],zS(l)),e}function VS(n){const e={},o=r(n,["proactiveAudio"]);return o!=null&&u(e,["proactiveAudio"],o),e}function HS(n,e){const o={},l=r(n,["generationConfig"]);e!==void 0&&l!=null&&u(e,["setup","generationConfig"],l);const s=r(n,["responseModalities"]);e!==void 0&&s!=null&&u(e,["setup","generationConfig","responseModalities"],s);const c=r(n,["temperature"]);e!==void 0&&c!=null&&u(e,["setup","generationConfig","temperature"],c);const d=r(n,["topP"]);e!==void 0&&d!=null&&u(e,["setup","generationConfig","topP"],d);const m=r(n,["topK"]);e!==void 0&&m!=null&&u(e,["setup","generationConfig","topK"],m);const g=r(n,["maxOutputTokens"]);e!==void 0&&g!=null&&u(e,["setup","generationConfig","maxOutputTokens"],g);const h=r(n,["mediaResolution"]);e!==void 0&&h!=null&&u(e,["setup","generationConfig","mediaResolution"],h);const v=r(n,["seed"]);e!==void 0&&v!=null&&u(e,["setup","generationConfig","seed"],v);const T=r(n,["speechConfig"]);e!==void 0&&T!=null&&u(e,["setup","generationConfig","speechConfig"],_S(Qu(T)));const _=r(n,["enableAffectiveDialog"]);e!==void 0&&_!=null&&u(e,["setup","generationConfig","enableAffectiveDialog"],_);const C=r(n,["systemInstruction"]);e!==void 0&&C!=null&&u(e,["setup","systemInstruction"],xS(Et(C)));const M=r(n,["tools"]);if(e!==void 0&&M!=null){let k=_o(M);Array.isArray(k)&&(k=k.map(X=>US(To(X)))),u(e,["setup","tools"],k)}const S=r(n,["sessionResumption"]);e!==void 0&&S!=null&&u(e,["setup","sessionResumption"],kS(S));const R=r(n,["inputAudioTranscription"]);e!==void 0&&R!=null&&u(e,["setup","inputAudioTranscription"],rp());const x=r(n,["outputAudioTranscription"]);e!==void 0&&x!=null&&u(e,["setup","outputAudioTranscription"],rp());const b=r(n,["realtimeInputConfig"]);e!==void 0&&b!=null&&u(e,["setup","realtimeInputConfig"],PS(b));const N=r(n,["contextWindowCompression"]);e!==void 0&&N!=null&&u(e,["setup","contextWindowCompression"],BS(N));const z=r(n,["proactivity"]);return e!==void 0&&z!=null&&u(e,["setup","proactivity"],VS(z)),o}function GS(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["setup","model"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],HS(s,o)),o}function qS(){return{}}function FS(){return{}}function OS(n){const e={},o=r(n,["media"]);o!=null&&u(e,["mediaChunks"],Hp(o));const l=r(n,["audio"]);l!=null&&u(e,["audio"],qp(l));const s=r(n,["audioStreamEnd"]);s!=null&&u(e,["audioStreamEnd"],s);const c=r(n,["video"]);c!=null&&u(e,["video"],Gp(c));const d=r(n,["text"]);return d!=null&&u(e,["text"],d),r(n,["activityStart"])!=null&&u(e,["activityStart"],qS()),r(n,["activityEnd"])!=null&&u(e,["activityEnd"],FS()),e}function ig(n){const e={},o=r(n,["text"]);o!=null&&u(e,["text"],o);const l=r(n,["weight"]);return l!=null&&u(e,["weight"],l),e}function YS(n){const e={},o=r(n,["weightedPrompts"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>ig(s))),u(e,["weightedPrompts"],l)}return e}function og(n){const e={},o=r(n,["temperature"]);o!=null&&u(e,["temperature"],o);const l=r(n,["topK"]);l!=null&&u(e,["topK"],l);const s=r(n,["seed"]);s!=null&&u(e,["seed"],s);const c=r(n,["guidance"]);c!=null&&u(e,["guidance"],c);const d=r(n,["bpm"]);d!=null&&u(e,["bpm"],d);const m=r(n,["density"]);m!=null&&u(e,["density"],m);const g=r(n,["brightness"]);g!=null&&u(e,["brightness"],g);const h=r(n,["scale"]);h!=null&&u(e,["scale"],h);const v=r(n,["muteBass"]);v!=null&&u(e,["muteBass"],v);const T=r(n,["muteDrums"]);T!=null&&u(e,["muteDrums"],T);const _=r(n,["onlyBassAndDrums"]);_!=null&&u(e,["onlyBassAndDrums"],_);const C=r(n,["musicGenerationMode"]);return C!=null&&u(e,["musicGenerationMode"],C),e}function JS(n){const e={},o=r(n,["musicGenerationConfig"]);return o!=null&&u(e,["musicGenerationConfig"],og(o)),e}function lg(n){const e={},o=r(n,["model"]);return o!=null&&u(e,["model"],o),e}function ag(n){const e={},o=r(n,["weightedPrompts"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>ig(s))),u(e,["weightedPrompts"],l)}return e}function Lu(n){const e={},o=r(n,["setup"]);o!=null&&u(e,["setup"],lg(o));const l=r(n,["clientContent"]);l!=null&&u(e,["clientContent"],ag(l));const s=r(n,["musicGenerationConfig"]);s!=null&&u(e,["musicGenerationConfig"],og(s));const c=r(n,["playbackControl"]);return c!=null&&u(e,["playbackControl"],c),e}function KS(n){const e={},o=r(n,["voiceName"]);return o!=null&&u(e,["voiceName"],o),e}function ZS(n){const e={},o=r(n,["prebuiltVoiceConfig"]);return o!=null&&u(e,["prebuiltVoiceConfig"],KS(o)),e}function XS(n){const e={},o=r(n,["voiceConfig"]);if(o!=null&&u(e,["voiceConfig"],ZS(o)),r(n,["multiSpeakerVoiceConfig"])!==void 0)throw new Error("multiSpeakerVoiceConfig parameter is not supported in Vertex AI.");const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function QS(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function $S(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["data"]);l!=null&&u(e,["data"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function WS(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["fileUri"]);l!=null&&u(e,["fileUri"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function jS(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],QS(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],$S(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],WS(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function eE(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>jS(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function tE(n){const e={};if(r(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const o=r(n,["description"]);o!=null&&u(e,["description"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["parameters"]);s!=null&&u(e,["parameters"],s);const c=r(n,["parametersJsonSchema"]);c!=null&&u(e,["parametersJsonSchema"],c);const d=r(n,["response"]);d!=null&&u(e,["response"],d);const m=r(n,["responseJsonSchema"]);return m!=null&&u(e,["responseJsonSchema"],m),e}function nE(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function iE(n){const e={},o=r(n,["timeRangeFilter"]);o!=null&&u(e,["timeRangeFilter"],nE(o));const l=r(n,["excludeDomains"]);return l!=null&&u(e,["excludeDomains"],l),e}function oE(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function lE(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],oE(o)),e}function aE(n){const e={},o=r(n,["excludeDomains"]);return o!=null&&u(e,["excludeDomains"],o),e}function rE(n){const e={},o=r(n,["apiKeyString"]);return o!=null&&u(e,["apiKeyString"],o),e}function sE(n){const e={},o=r(n,["apiKeyConfig"]);o!=null&&u(e,["apiKeyConfig"],rE(o));const l=r(n,["authType"]);l!=null&&u(e,["authType"],l);const s=r(n,["googleServiceAccountConfig"]);s!=null&&u(e,["googleServiceAccountConfig"],s);const c=r(n,["httpBasicAuthConfig"]);c!=null&&u(e,["httpBasicAuthConfig"],c);const d=r(n,["oauthConfig"]);d!=null&&u(e,["oauthConfig"],d);const m=r(n,["oidcConfig"]);return m!=null&&u(e,["oidcConfig"],m),e}function uE(n){const e={},o=r(n,["authConfig"]);return o!=null&&u(e,["authConfig"],sE(o)),e}function fE(){return{}}function cE(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function dE(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let T=o;Array.isArray(T)&&(T=T.map(_=>tE(_))),u(e,["functionDeclarations"],T)}const l=r(n,["retrieval"]);l!=null&&u(e,["retrieval"],l);const s=r(n,["googleSearch"]);s!=null&&u(e,["googleSearch"],iE(s));const c=r(n,["googleSearchRetrieval"]);c!=null&&u(e,["googleSearchRetrieval"],lE(c));const d=r(n,["enterpriseWebSearch"]);d!=null&&u(e,["enterpriseWebSearch"],aE(d));const m=r(n,["googleMaps"]);m!=null&&u(e,["googleMaps"],uE(m)),r(n,["urlContext"])!=null&&u(e,["urlContext"],fE());const h=r(n,["computerUse"]);h!=null&&u(e,["computerUse"],cE(h));const v=r(n,["codeExecution"]);return v!=null&&u(e,["codeExecution"],v),e}function hE(n){const e={},o=r(n,["handle"]);o!=null&&u(e,["handle"],o);const l=r(n,["transparent"]);return l!=null&&u(e,["transparent"],l),e}function sp(){return{}}function mE(n){const e={},o=r(n,["disabled"]);o!=null&&u(e,["disabled"],o);const l=r(n,["startOfSpeechSensitivity"]);l!=null&&u(e,["startOfSpeechSensitivity"],l);const s=r(n,["endOfSpeechSensitivity"]);s!=null&&u(e,["endOfSpeechSensitivity"],s);const c=r(n,["prefixPaddingMs"]);c!=null&&u(e,["prefixPaddingMs"],c);const d=r(n,["silenceDurationMs"]);return d!=null&&u(e,["silenceDurationMs"],d),e}function pE(n){const e={},o=r(n,["automaticActivityDetection"]);o!=null&&u(e,["automaticActivityDetection"],mE(o));const l=r(n,["activityHandling"]);l!=null&&u(e,["activityHandling"],l);const s=r(n,["turnCoverage"]);return s!=null&&u(e,["turnCoverage"],s),e}function gE(n){const e={},o=r(n,["targetTokens"]);return o!=null&&u(e,["targetTokens"],o),e}function yE(n){const e={},o=r(n,["triggerTokens"]);o!=null&&u(e,["triggerTokens"],o);const l=r(n,["slidingWindow"]);return l!=null&&u(e,["slidingWindow"],gE(l)),e}function vE(n){const e={},o=r(n,["proactiveAudio"]);return o!=null&&u(e,["proactiveAudio"],o),e}function TE(n,e){const o={},l=r(n,["generationConfig"]);e!==void 0&&l!=null&&u(e,["setup","generationConfig"],l);const s=r(n,["responseModalities"]);e!==void 0&&s!=null&&u(e,["setup","generationConfig","responseModalities"],s);const c=r(n,["temperature"]);e!==void 0&&c!=null&&u(e,["setup","generationConfig","temperature"],c);const d=r(n,["topP"]);e!==void 0&&d!=null&&u(e,["setup","generationConfig","topP"],d);const m=r(n,["topK"]);e!==void 0&&m!=null&&u(e,["setup","generationConfig","topK"],m);const g=r(n,["maxOutputTokens"]);e!==void 0&&g!=null&&u(e,["setup","generationConfig","maxOutputTokens"],g);const h=r(n,["mediaResolution"]);e!==void 0&&h!=null&&u(e,["setup","generationConfig","mediaResolution"],h);const v=r(n,["seed"]);e!==void 0&&v!=null&&u(e,["setup","generationConfig","seed"],v);const T=r(n,["speechConfig"]);e!==void 0&&T!=null&&u(e,["setup","generationConfig","speechConfig"],XS(Qu(T)));const _=r(n,["enableAffectiveDialog"]);e!==void 0&&_!=null&&u(e,["setup","generationConfig","enableAffectiveDialog"],_);const C=r(n,["systemInstruction"]);e!==void 0&&C!=null&&u(e,["setup","systemInstruction"],eE(Et(C)));const M=r(n,["tools"]);if(e!==void 0&&M!=null){let k=_o(M);Array.isArray(k)&&(k=k.map(X=>dE(To(X)))),u(e,["setup","tools"],k)}const S=r(n,["sessionResumption"]);e!==void 0&&S!=null&&u(e,["setup","sessionResumption"],hE(S));const R=r(n,["inputAudioTranscription"]);e!==void 0&&R!=null&&u(e,["setup","inputAudioTranscription"],sp());const x=r(n,["outputAudioTranscription"]);e!==void 0&&x!=null&&u(e,["setup","outputAudioTranscription"],sp());const b=r(n,["realtimeInputConfig"]);e!==void 0&&b!=null&&u(e,["setup","realtimeInputConfig"],pE(b));const N=r(n,["contextWindowCompression"]);e!==void 0&&N!=null&&u(e,["setup","contextWindowCompression"],yE(N));const z=r(n,["proactivity"]);return e!==void 0&&z!=null&&u(e,["setup","proactivity"],vE(z)),o}function _E(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["setup","model"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],TE(s,o)),o}function CE(){return{}}function SE(){return{}}function EE(n){const e={},o=r(n,["media"]);o!=null&&u(e,["mediaChunks"],Hp(o));const l=r(n,["audio"]);l!=null&&u(e,["audio"],qp(l));const s=r(n,["audioStreamEnd"]);s!=null&&u(e,["audioStreamEnd"],s);const c=r(n,["video"]);c!=null&&u(e,["video"],Gp(c));const d=r(n,["text"]);return d!=null&&u(e,["text"],d),r(n,["activityStart"])!=null&&u(e,["activityStart"],CE()),r(n,["activityEnd"])!=null&&u(e,["activityEnd"],SE()),e}function AE(){return{}}function xE(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function ME(n){const e={},o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function RE(n){const e={},o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function wE(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],xE(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],ME(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],RE(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function bE(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>wE(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function up(n){const e={},o=r(n,["text"]);o!=null&&u(e,["text"],o);const l=r(n,["finished"]);return l!=null&&u(e,["finished"],l),e}function DE(n){const e={},o=r(n,["retrievedUrl"]);o!=null&&u(e,["retrievedUrl"],o);const l=r(n,["urlRetrievalStatus"]);return l!=null&&u(e,["urlRetrievalStatus"],l),e}function NE(n){const e={},o=r(n,["urlMetadata"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>DE(s))),u(e,["urlMetadata"],l)}return e}function IE(n){const e={},o=r(n,["modelTurn"]);o!=null&&u(e,["modelTurn"],bE(o));const l=r(n,["turnComplete"]);l!=null&&u(e,["turnComplete"],l);const s=r(n,["interrupted"]);s!=null&&u(e,["interrupted"],s);const c=r(n,["groundingMetadata"]);c!=null&&u(e,["groundingMetadata"],c);const d=r(n,["generationComplete"]);d!=null&&u(e,["generationComplete"],d);const m=r(n,["inputTranscription"]);m!=null&&u(e,["inputTranscription"],up(m));const g=r(n,["outputTranscription"]);g!=null&&u(e,["outputTranscription"],up(g));const h=r(n,["urlContextMetadata"]);return h!=null&&u(e,["urlContextMetadata"],NE(h)),e}function UE(n){const e={},o=r(n,["id"]);o!=null&&u(e,["id"],o);const l=r(n,["args"]);l!=null&&u(e,["args"],l);const s=r(n,["name"]);return s!=null&&u(e,["name"],s),e}function kE(n){const e={},o=r(n,["functionCalls"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>UE(s))),u(e,["functionCalls"],l)}return e}function LE(n){const e={},o=r(n,["ids"]);return o!=null&&u(e,["ids"],o),e}function Fa(n){const e={},o=r(n,["modality"]);o!=null&&u(e,["modality"],o);const l=r(n,["tokenCount"]);return l!=null&&u(e,["tokenCount"],l),e}function PE(n){const e={},o=r(n,["promptTokenCount"]);o!=null&&u(e,["promptTokenCount"],o);const l=r(n,["cachedContentTokenCount"]);l!=null&&u(e,["cachedContentTokenCount"],l);const s=r(n,["responseTokenCount"]);s!=null&&u(e,["responseTokenCount"],s);const c=r(n,["toolUsePromptTokenCount"]);c!=null&&u(e,["toolUsePromptTokenCount"],c);const d=r(n,["thoughtsTokenCount"]);d!=null&&u(e,["thoughtsTokenCount"],d);const m=r(n,["totalTokenCount"]);m!=null&&u(e,["totalTokenCount"],m);const g=r(n,["promptTokensDetails"]);if(g!=null){let _=g;Array.isArray(_)&&(_=_.map(C=>Fa(C))),u(e,["promptTokensDetails"],_)}const h=r(n,["cacheTokensDetails"]);if(h!=null){let _=h;Array.isArray(_)&&(_=_.map(C=>Fa(C))),u(e,["cacheTokensDetails"],_)}const v=r(n,["responseTokensDetails"]);if(v!=null){let _=v;Array.isArray(_)&&(_=_.map(C=>Fa(C))),u(e,["responseTokensDetails"],_)}const T=r(n,["toolUsePromptTokensDetails"]);if(T!=null){let _=T;Array.isArray(_)&&(_=_.map(C=>Fa(C))),u(e,["toolUsePromptTokensDetails"],_)}return e}function zE(n){const e={},o=r(n,["timeLeft"]);return o!=null&&u(e,["timeLeft"],o),e}function BE(n){const e={},o=r(n,["newHandle"]);o!=null&&u(e,["newHandle"],o);const l=r(n,["resumable"]);l!=null&&u(e,["resumable"],l);const s=r(n,["lastConsumedClientMessageIndex"]);return s!=null&&u(e,["lastConsumedClientMessageIndex"],s),e}function VE(n){const e={};r(n,["setupComplete"])!=null&&u(e,["setupComplete"],AE());const l=r(n,["serverContent"]);l!=null&&u(e,["serverContent"],IE(l));const s=r(n,["toolCall"]);s!=null&&u(e,["toolCall"],kE(s));const c=r(n,["toolCallCancellation"]);c!=null&&u(e,["toolCallCancellation"],LE(c));const d=r(n,["usageMetadata"]);d!=null&&u(e,["usageMetadata"],PE(d));const m=r(n,["goAway"]);m!=null&&u(e,["goAway"],zE(m));const g=r(n,["sessionResumptionUpdate"]);return g!=null&&u(e,["sessionResumptionUpdate"],BE(g)),e}function HE(){return{}}function GE(n){const e={},o=r(n,["text"]);o!=null&&u(e,["text"],o);const l=r(n,["weight"]);return l!=null&&u(e,["weight"],l),e}function qE(n){const e={},o=r(n,["weightedPrompts"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>GE(s))),u(e,["weightedPrompts"],l)}return e}function FE(n){const e={},o=r(n,["temperature"]);o!=null&&u(e,["temperature"],o);const l=r(n,["topK"]);l!=null&&u(e,["topK"],l);const s=r(n,["seed"]);s!=null&&u(e,["seed"],s);const c=r(n,["guidance"]);c!=null&&u(e,["guidance"],c);const d=r(n,["bpm"]);d!=null&&u(e,["bpm"],d);const m=r(n,["density"]);m!=null&&u(e,["density"],m);const g=r(n,["brightness"]);g!=null&&u(e,["brightness"],g);const h=r(n,["scale"]);h!=null&&u(e,["scale"],h);const v=r(n,["muteBass"]);v!=null&&u(e,["muteBass"],v);const T=r(n,["muteDrums"]);T!=null&&u(e,["muteDrums"],T);const _=r(n,["onlyBassAndDrums"]);_!=null&&u(e,["onlyBassAndDrums"],_);const C=r(n,["musicGenerationMode"]);return C!=null&&u(e,["musicGenerationMode"],C),e}function OE(n){const e={},o=r(n,["clientContent"]);o!=null&&u(e,["clientContent"],qE(o));const l=r(n,["musicGenerationConfig"]);return l!=null&&u(e,["musicGenerationConfig"],FE(l)),e}function YE(n){const e={},o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);l!=null&&u(e,["mimeType"],l);const s=r(n,["sourceMetadata"]);return s!=null&&u(e,["sourceMetadata"],OE(s)),e}function JE(n){const e={},o=r(n,["audioChunks"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>YE(s))),u(e,["audioChunks"],l)}return e}function KE(n){const e={},o=r(n,["text"]);o!=null&&u(e,["text"],o);const l=r(n,["filteredReason"]);return l!=null&&u(e,["filteredReason"],l),e}function ZE(n){const e={};r(n,["setupComplete"])!=null&&u(e,["setupComplete"],HE());const l=r(n,["serverContent"]);l!=null&&u(e,["serverContent"],JE(l));const s=r(n,["filteredPrompt"]);return s!=null&&u(e,["filteredPrompt"],KE(s)),e}function XE(n){const e={},o=r(n,["sessionId"]);return o!=null&&u(e,["sessionId"],o),e}function QE(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function $E(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["data"]);l!=null&&u(e,["data"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function WE(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["fileUri"]);l!=null&&u(e,["fileUri"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function jE(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],QE(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],$E(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],WE(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function eA(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>jE(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function fp(n){const e={},o=r(n,["text"]);o!=null&&u(e,["text"],o);const l=r(n,["finished"]);return l!=null&&u(e,["finished"],l),e}function tA(n){const e={},o=r(n,["modelTurn"]);o!=null&&u(e,["modelTurn"],eA(o));const l=r(n,["turnComplete"]);l!=null&&u(e,["turnComplete"],l);const s=r(n,["interrupted"]);s!=null&&u(e,["interrupted"],s);const c=r(n,["groundingMetadata"]);c!=null&&u(e,["groundingMetadata"],c);const d=r(n,["generationComplete"]);d!=null&&u(e,["generationComplete"],d);const m=r(n,["inputTranscription"]);m!=null&&u(e,["inputTranscription"],fp(m));const g=r(n,["outputTranscription"]);return g!=null&&u(e,["outputTranscription"],fp(g)),e}function nA(n){const e={},o=r(n,["args"]);o!=null&&u(e,["args"],o);const l=r(n,["name"]);return l!=null&&u(e,["name"],l),e}function iA(n){const e={},o=r(n,["functionCalls"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>nA(s))),u(e,["functionCalls"],l)}return e}function oA(n){const e={},o=r(n,["ids"]);return o!=null&&u(e,["ids"],o),e}function Oa(n){const e={},o=r(n,["modality"]);o!=null&&u(e,["modality"],o);const l=r(n,["tokenCount"]);return l!=null&&u(e,["tokenCount"],l),e}function lA(n){const e={},o=r(n,["promptTokenCount"]);o!=null&&u(e,["promptTokenCount"],o);const l=r(n,["cachedContentTokenCount"]);l!=null&&u(e,["cachedContentTokenCount"],l);const s=r(n,["candidatesTokenCount"]);s!=null&&u(e,["responseTokenCount"],s);const c=r(n,["toolUsePromptTokenCount"]);c!=null&&u(e,["toolUsePromptTokenCount"],c);const d=r(n,["thoughtsTokenCount"]);d!=null&&u(e,["thoughtsTokenCount"],d);const m=r(n,["totalTokenCount"]);m!=null&&u(e,["totalTokenCount"],m);const g=r(n,["promptTokensDetails"]);if(g!=null){let C=g;Array.isArray(C)&&(C=C.map(M=>Oa(M))),u(e,["promptTokensDetails"],C)}const h=r(n,["cacheTokensDetails"]);if(h!=null){let C=h;Array.isArray(C)&&(C=C.map(M=>Oa(M))),u(e,["cacheTokensDetails"],C)}const v=r(n,["candidatesTokensDetails"]);if(v!=null){let C=v;Array.isArray(C)&&(C=C.map(M=>Oa(M))),u(e,["responseTokensDetails"],C)}const T=r(n,["toolUsePromptTokensDetails"]);if(T!=null){let C=T;Array.isArray(C)&&(C=C.map(M=>Oa(M))),u(e,["toolUsePromptTokensDetails"],C)}const _=r(n,["trafficType"]);return _!=null&&u(e,["trafficType"],_),e}function aA(n){const e={},o=r(n,["timeLeft"]);return o!=null&&u(e,["timeLeft"],o),e}function rA(n){const e={},o=r(n,["newHandle"]);o!=null&&u(e,["newHandle"],o);const l=r(n,["resumable"]);l!=null&&u(e,["resumable"],l);const s=r(n,["lastConsumedClientMessageIndex"]);return s!=null&&u(e,["lastConsumedClientMessageIndex"],s),e}function sA(n){const e={},o=r(n,["setupComplete"]);o!=null&&u(e,["setupComplete"],XE(o));const l=r(n,["serverContent"]);l!=null&&u(e,["serverContent"],tA(l));const s=r(n,["toolCall"]);s!=null&&u(e,["toolCall"],iA(s));const c=r(n,["toolCallCancellation"]);c!=null&&u(e,["toolCallCancellation"],oA(c));const d=r(n,["usageMetadata"]);d!=null&&u(e,["usageMetadata"],lA(d));const m=r(n,["goAway"]);m!=null&&u(e,["goAway"],aA(m));const g=r(n,["sessionResumptionUpdate"]);return g!=null&&u(e,["sessionResumptionUpdate"],rA(g)),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function uA(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function fA(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function cA(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function dA(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],uA(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],fA(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],cA(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function ir(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>dA(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function hA(n){const e={},o=r(n,["anyOf"]);o!=null&&u(e,["anyOf"],o);const l=r(n,["default"]);l!=null&&u(e,["default"],l);const s=r(n,["description"]);s!=null&&u(e,["description"],s);const c=r(n,["enum"]);c!=null&&u(e,["enum"],c);const d=r(n,["example"]);d!=null&&u(e,["example"],d);const m=r(n,["format"]);m!=null&&u(e,["format"],m);const g=r(n,["items"]);g!=null&&u(e,["items"],g);const h=r(n,["maxItems"]);h!=null&&u(e,["maxItems"],h);const v=r(n,["maxLength"]);v!=null&&u(e,["maxLength"],v);const T=r(n,["maxProperties"]);T!=null&&u(e,["maxProperties"],T);const _=r(n,["maximum"]);_!=null&&u(e,["maximum"],_);const C=r(n,["minItems"]);C!=null&&u(e,["minItems"],C);const M=r(n,["minLength"]);M!=null&&u(e,["minLength"],M);const S=r(n,["minProperties"]);S!=null&&u(e,["minProperties"],S);const R=r(n,["minimum"]);R!=null&&u(e,["minimum"],R);const x=r(n,["nullable"]);x!=null&&u(e,["nullable"],x);const b=r(n,["pattern"]);b!=null&&u(e,["pattern"],b);const N=r(n,["properties"]);N!=null&&u(e,["properties"],N);const z=r(n,["propertyOrdering"]);z!=null&&u(e,["propertyOrdering"],z);const k=r(n,["required"]);k!=null&&u(e,["required"],k);const X=r(n,["title"]);X!=null&&u(e,["title"],X);const Y=r(n,["type"]);return Y!=null&&u(e,["type"],Y),e}function mA(n){const e={};if(r(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const o=r(n,["category"]);o!=null&&u(e,["category"],o);const l=r(n,["threshold"]);return l!=null&&u(e,["threshold"],l),e}function pA(n){const e={},o=r(n,["behavior"]);o!=null&&u(e,["behavior"],o);const l=r(n,["description"]);l!=null&&u(e,["description"],l);const s=r(n,["name"]);s!=null&&u(e,["name"],s);const c=r(n,["parameters"]);c!=null&&u(e,["parameters"],c);const d=r(n,["parametersJsonSchema"]);d!=null&&u(e,["parametersJsonSchema"],d);const m=r(n,["response"]);m!=null&&u(e,["response"],m);const g=r(n,["responseJsonSchema"]);return g!=null&&u(e,["responseJsonSchema"],g),e}function gA(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function yA(n){const e={},o=r(n,["timeRangeFilter"]);if(o!=null&&u(e,["timeRangeFilter"],gA(o)),r(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");return e}function vA(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function TA(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],vA(o)),e}function _A(){return{}}function CA(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function SA(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let g=o;Array.isArray(g)&&(g=g.map(h=>pA(h))),u(e,["functionDeclarations"],g)}if(r(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const l=r(n,["googleSearch"]);l!=null&&u(e,["googleSearch"],yA(l));const s=r(n,["googleSearchRetrieval"]);if(s!=null&&u(e,["googleSearchRetrieval"],TA(s)),r(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(n,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(n,["urlContext"])!=null&&u(e,["urlContext"],_A());const d=r(n,["computerUse"]);d!=null&&u(e,["computerUse"],CA(d));const m=r(n,["codeExecution"]);return m!=null&&u(e,["codeExecution"],m),e}function EA(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["allowedFunctionNames"]);return l!=null&&u(e,["allowedFunctionNames"],l),e}function AA(n){const e={},o=r(n,["latitude"]);o!=null&&u(e,["latitude"],o);const l=r(n,["longitude"]);return l!=null&&u(e,["longitude"],l),e}function xA(n){const e={},o=r(n,["latLng"]);o!=null&&u(e,["latLng"],AA(o));const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function MA(n){const e={},o=r(n,["functionCallingConfig"]);o!=null&&u(e,["functionCallingConfig"],EA(o));const l=r(n,["retrievalConfig"]);return l!=null&&u(e,["retrievalConfig"],xA(l)),e}function RA(n){const e={},o=r(n,["voiceName"]);return o!=null&&u(e,["voiceName"],o),e}function rg(n){const e={},o=r(n,["prebuiltVoiceConfig"]);return o!=null&&u(e,["prebuiltVoiceConfig"],RA(o)),e}function wA(n){const e={},o=r(n,["speaker"]);o!=null&&u(e,["speaker"],o);const l=r(n,["voiceConfig"]);return l!=null&&u(e,["voiceConfig"],rg(l)),e}function bA(n){const e={},o=r(n,["speakerVoiceConfigs"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>wA(s))),u(e,["speakerVoiceConfigs"],l)}return e}function DA(n){const e={},o=r(n,["voiceConfig"]);o!=null&&u(e,["voiceConfig"],rg(o));const l=r(n,["multiSpeakerVoiceConfig"]);l!=null&&u(e,["multiSpeakerVoiceConfig"],bA(l));const s=r(n,["languageCode"]);return s!=null&&u(e,["languageCode"],s),e}function NA(n){const e={},o=r(n,["includeThoughts"]);o!=null&&u(e,["includeThoughts"],o);const l=r(n,["thinkingBudget"]);return l!=null&&u(e,["thinkingBudget"],l),e}function IA(n,e,o){const l={},s=r(e,["systemInstruction"]);o!==void 0&&s!=null&&u(o,["systemInstruction"],ir(Et(s)));const c=r(e,["temperature"]);c!=null&&u(l,["temperature"],c);const d=r(e,["topP"]);d!=null&&u(l,["topP"],d);const m=r(e,["topK"]);m!=null&&u(l,["topK"],m);const g=r(e,["candidateCount"]);g!=null&&u(l,["candidateCount"],g);const h=r(e,["maxOutputTokens"]);h!=null&&u(l,["maxOutputTokens"],h);const v=r(e,["stopSequences"]);v!=null&&u(l,["stopSequences"],v);const T=r(e,["responseLogprobs"]);T!=null&&u(l,["responseLogprobs"],T);const _=r(e,["logprobs"]);_!=null&&u(l,["logprobs"],_);const C=r(e,["presencePenalty"]);C!=null&&u(l,["presencePenalty"],C);const M=r(e,["frequencyPenalty"]);M!=null&&u(l,["frequencyPenalty"],M);const S=r(e,["seed"]);S!=null&&u(l,["seed"],S);const R=r(e,["responseMimeType"]);R!=null&&u(l,["responseMimeType"],R);const x=r(e,["responseSchema"]);x!=null&&u(l,["responseSchema"],hA(Zu(x)));const b=r(e,["responseJsonSchema"]);if(b!=null&&u(l,["responseJsonSchema"],b),r(e,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(r(e,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const N=r(e,["safetySettings"]);if(o!==void 0&&N!=null){let ye=N;Array.isArray(ye)&&(ye=ye.map(B=>mA(B))),u(o,["safetySettings"],ye)}const z=r(e,["tools"]);if(o!==void 0&&z!=null){let ye=_o(z);Array.isArray(ye)&&(ye=ye.map(B=>SA(To(B)))),u(o,["tools"],ye)}const k=r(e,["toolConfig"]);if(o!==void 0&&k!=null&&u(o,["toolConfig"],MA(k)),r(e,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const X=r(e,["cachedContent"]);o!==void 0&&X!=null&&u(o,["cachedContent"],bn(n,X));const Y=r(e,["responseModalities"]);Y!=null&&u(l,["responseModalities"],Y);const oe=r(e,["mediaResolution"]);oe!=null&&u(l,["mediaResolution"],oe);const q=r(e,["speechConfig"]);if(q!=null&&u(l,["speechConfig"],DA(Xu(q))),r(e,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const re=r(e,["thinkingConfig"]);return re!=null&&u(l,["thinkingConfig"],NA(re)),l}function cp(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);if(s!=null){let d=Qt(s);Array.isArray(d)&&(d=d.map(m=>ir(m))),u(o,["contents"],d)}const c=r(e,["config"]);return c!=null&&u(o,["generationConfig"],IA(n,c,o)),o}function UA(n,e){const o={},l=r(n,["taskType"]);e!==void 0&&l!=null&&u(e,["requests[]","taskType"],l);const s=r(n,["title"]);e!==void 0&&s!=null&&u(e,["requests[]","title"],s);const c=r(n,["outputDimensionality"]);if(e!==void 0&&c!=null&&u(e,["requests[]","outputDimensionality"],c),r(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(r(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return o}function kA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);s!=null&&u(o,["requests[]","content"],Op(n,s));const c=r(e,["config"]);c!=null&&u(o,["config"],UA(c,o));const d=r(e,["model"]);return d!==void 0&&u(o,["requests[]","model"],Fe(n,d)),o}function LA(n,e){const o={};if(r(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(r(n,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const l=r(n,["numberOfImages"]);e!==void 0&&l!=null&&u(e,["parameters","sampleCount"],l);const s=r(n,["aspectRatio"]);e!==void 0&&s!=null&&u(e,["parameters","aspectRatio"],s);const c=r(n,["guidanceScale"]);if(e!==void 0&&c!=null&&u(e,["parameters","guidanceScale"],c),r(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const d=r(n,["safetyFilterLevel"]);e!==void 0&&d!=null&&u(e,["parameters","safetySetting"],d);const m=r(n,["personGeneration"]);e!==void 0&&m!=null&&u(e,["parameters","personGeneration"],m);const g=r(n,["includeSafetyAttributes"]);e!==void 0&&g!=null&&u(e,["parameters","includeSafetyAttributes"],g);const h=r(n,["includeRaiReason"]);e!==void 0&&h!=null&&u(e,["parameters","includeRaiReason"],h);const v=r(n,["language"]);e!==void 0&&v!=null&&u(e,["parameters","language"],v);const T=r(n,["outputMimeType"]);e!==void 0&&T!=null&&u(e,["parameters","outputOptions","mimeType"],T);const _=r(n,["outputCompressionQuality"]);if(e!==void 0&&_!=null&&u(e,["parameters","outputOptions","compressionQuality"],_),r(n,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");const C=r(n,["imageSize"]);if(e!==void 0&&C!=null&&u(e,["parameters","sampleImageSize"],C),r(n,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return o}function PA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["prompt"]);s!=null&&u(o,["instances[0]","prompt"],s);const c=r(e,["config"]);return c!=null&&u(o,["config"],LA(c,o)),o}function zA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","name"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function BA(n,e,o){const l={},s=r(e,["pageSize"]);o!==void 0&&s!=null&&u(o,["_query","pageSize"],s);const c=r(e,["pageToken"]);o!==void 0&&c!=null&&u(o,["_query","pageToken"],c);const d=r(e,["filter"]);o!==void 0&&d!=null&&u(o,["_query","filter"],d);const m=r(e,["queryBase"]);return o!==void 0&&m!=null&&u(o,["_url","models_url"],Kp(n,m)),l}function VA(n,e){const o={},l=r(e,["config"]);return l!=null&&u(o,["config"],BA(n,l,o)),o}function HA(n,e){const o={},l=r(n,["displayName"]);e!==void 0&&l!=null&&u(e,["displayName"],l);const s=r(n,["description"]);e!==void 0&&s!=null&&u(e,["description"],s);const c=r(n,["defaultCheckpointId"]);return e!==void 0&&c!=null&&u(e,["defaultCheckpointId"],c),o}function GA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","name"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],HA(s,o)),o}function qA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","name"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function FA(n){const e={};if(r(n,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(r(n,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(r(n,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return e}function OA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);if(s!=null){let d=Qt(s);Array.isArray(d)&&(d=d.map(m=>ir(m))),u(o,["contents"],d)}const c=r(e,["config"]);return c!=null&&u(o,["config"],FA(c)),o}function YA(n){const e={};if(r(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const o=r(n,["imageBytes"]);o!=null&&u(e,["bytesBase64Encoded"],xi(o));const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function JA(n,e){const o={},l=r(n,["numberOfVideos"]);if(e!==void 0&&l!=null&&u(e,["parameters","sampleCount"],l),r(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(r(n,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const s=r(n,["durationSeconds"]);if(e!==void 0&&s!=null&&u(e,["parameters","durationSeconds"],s),r(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const c=r(n,["aspectRatio"]);if(e!==void 0&&c!=null&&u(e,["parameters","aspectRatio"],c),r(n,["resolution"])!==void 0)throw new Error("resolution parameter is not supported in Gemini API.");const d=r(n,["personGeneration"]);if(e!==void 0&&d!=null&&u(e,["parameters","personGeneration"],d),r(n,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const m=r(n,["negativePrompt"]);e!==void 0&&m!=null&&u(e,["parameters","negativePrompt"],m);const g=r(n,["enhancePrompt"]);if(e!==void 0&&g!=null&&u(e,["parameters","enhancePrompt"],g),r(n,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");if(r(n,["lastFrame"])!==void 0)throw new Error("lastFrame parameter is not supported in Gemini API.");if(r(n,["referenceImages"])!==void 0)throw new Error("referenceImages parameter is not supported in Gemini API.");if(r(n,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return o}function KA(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["prompt"]);s!=null&&u(o,["instances[0]","prompt"],s);const c=r(e,["image"]);if(c!=null&&u(o,["instances[0]","image"],YA(c)),r(e,["video"])!==void 0)throw new Error("video parameter is not supported in Gemini API.");const d=r(e,["config"]);return d!=null&&u(o,["config"],JA(d,o)),o}function ZA(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function XA(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["data"]);l!=null&&u(e,["data"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function QA(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["fileUri"]);l!=null&&u(e,["fileUri"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function $A(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],ZA(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],XA(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],QA(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function So(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>$A(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function WA(n){const e={},o=r(n,["anyOf"]);o!=null&&u(e,["anyOf"],o);const l=r(n,["default"]);l!=null&&u(e,["default"],l);const s=r(n,["description"]);s!=null&&u(e,["description"],s);const c=r(n,["enum"]);c!=null&&u(e,["enum"],c);const d=r(n,["example"]);d!=null&&u(e,["example"],d);const m=r(n,["format"]);m!=null&&u(e,["format"],m);const g=r(n,["items"]);g!=null&&u(e,["items"],g);const h=r(n,["maxItems"]);h!=null&&u(e,["maxItems"],h);const v=r(n,["maxLength"]);v!=null&&u(e,["maxLength"],v);const T=r(n,["maxProperties"]);T!=null&&u(e,["maxProperties"],T);const _=r(n,["maximum"]);_!=null&&u(e,["maximum"],_);const C=r(n,["minItems"]);C!=null&&u(e,["minItems"],C);const M=r(n,["minLength"]);M!=null&&u(e,["minLength"],M);const S=r(n,["minProperties"]);S!=null&&u(e,["minProperties"],S);const R=r(n,["minimum"]);R!=null&&u(e,["minimum"],R);const x=r(n,["nullable"]);x!=null&&u(e,["nullable"],x);const b=r(n,["pattern"]);b!=null&&u(e,["pattern"],b);const N=r(n,["properties"]);N!=null&&u(e,["properties"],N);const z=r(n,["propertyOrdering"]);z!=null&&u(e,["propertyOrdering"],z);const k=r(n,["required"]);k!=null&&u(e,["required"],k);const X=r(n,["title"]);X!=null&&u(e,["title"],X);const Y=r(n,["type"]);return Y!=null&&u(e,["type"],Y),e}function jA(n){const e={},o=r(n,["featureSelectionPreference"]);return o!=null&&u(e,["featureSelectionPreference"],o),e}function e1(n){const e={},o=r(n,["method"]);o!=null&&u(e,["method"],o);const l=r(n,["category"]);l!=null&&u(e,["category"],l);const s=r(n,["threshold"]);return s!=null&&u(e,["threshold"],s),e}function t1(n){const e={};if(r(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");const o=r(n,["description"]);o!=null&&u(e,["description"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["parameters"]);s!=null&&u(e,["parameters"],s);const c=r(n,["parametersJsonSchema"]);c!=null&&u(e,["parametersJsonSchema"],c);const d=r(n,["response"]);d!=null&&u(e,["response"],d);const m=r(n,["responseJsonSchema"]);return m!=null&&u(e,["responseJsonSchema"],m),e}function n1(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function i1(n){const e={},o=r(n,["timeRangeFilter"]);o!=null&&u(e,["timeRangeFilter"],n1(o));const l=r(n,["excludeDomains"]);return l!=null&&u(e,["excludeDomains"],l),e}function o1(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function l1(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],o1(o)),e}function a1(n){const e={},o=r(n,["excludeDomains"]);return o!=null&&u(e,["excludeDomains"],o),e}function r1(n){const e={},o=r(n,["apiKeyString"]);return o!=null&&u(e,["apiKeyString"],o),e}function s1(n){const e={},o=r(n,["apiKeyConfig"]);o!=null&&u(e,["apiKeyConfig"],r1(o));const l=r(n,["authType"]);l!=null&&u(e,["authType"],l);const s=r(n,["googleServiceAccountConfig"]);s!=null&&u(e,["googleServiceAccountConfig"],s);const c=r(n,["httpBasicAuthConfig"]);c!=null&&u(e,["httpBasicAuthConfig"],c);const d=r(n,["oauthConfig"]);d!=null&&u(e,["oauthConfig"],d);const m=r(n,["oidcConfig"]);return m!=null&&u(e,["oidcConfig"],m),e}function u1(n){const e={},o=r(n,["authConfig"]);return o!=null&&u(e,["authConfig"],s1(o)),e}function f1(){return{}}function c1(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function sg(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let T=o;Array.isArray(T)&&(T=T.map(_=>t1(_))),u(e,["functionDeclarations"],T)}const l=r(n,["retrieval"]);l!=null&&u(e,["retrieval"],l);const s=r(n,["googleSearch"]);s!=null&&u(e,["googleSearch"],i1(s));const c=r(n,["googleSearchRetrieval"]);c!=null&&u(e,["googleSearchRetrieval"],l1(c));const d=r(n,["enterpriseWebSearch"]);d!=null&&u(e,["enterpriseWebSearch"],a1(d));const m=r(n,["googleMaps"]);m!=null&&u(e,["googleMaps"],u1(m)),r(n,["urlContext"])!=null&&u(e,["urlContext"],f1());const h=r(n,["computerUse"]);h!=null&&u(e,["computerUse"],c1(h));const v=r(n,["codeExecution"]);return v!=null&&u(e,["codeExecution"],v),e}function d1(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["allowedFunctionNames"]);return l!=null&&u(e,["allowedFunctionNames"],l),e}function h1(n){const e={},o=r(n,["latitude"]);o!=null&&u(e,["latitude"],o);const l=r(n,["longitude"]);return l!=null&&u(e,["longitude"],l),e}function m1(n){const e={},o=r(n,["latLng"]);o!=null&&u(e,["latLng"],h1(o));const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function p1(n){const e={},o=r(n,["functionCallingConfig"]);o!=null&&u(e,["functionCallingConfig"],d1(o));const l=r(n,["retrievalConfig"]);return l!=null&&u(e,["retrievalConfig"],m1(l)),e}function g1(n){const e={},o=r(n,["voiceName"]);return o!=null&&u(e,["voiceName"],o),e}function y1(n){const e={},o=r(n,["prebuiltVoiceConfig"]);return o!=null&&u(e,["prebuiltVoiceConfig"],g1(o)),e}function v1(n){const e={},o=r(n,["voiceConfig"]);if(o!=null&&u(e,["voiceConfig"],y1(o)),r(n,["multiSpeakerVoiceConfig"])!==void 0)throw new Error("multiSpeakerVoiceConfig parameter is not supported in Vertex AI.");const l=r(n,["languageCode"]);return l!=null&&u(e,["languageCode"],l),e}function T1(n){const e={},o=r(n,["includeThoughts"]);o!=null&&u(e,["includeThoughts"],o);const l=r(n,["thinkingBudget"]);return l!=null&&u(e,["thinkingBudget"],l),e}function _1(n,e,o){const l={},s=r(e,["systemInstruction"]);o!==void 0&&s!=null&&u(o,["systemInstruction"],So(Et(s)));const c=r(e,["temperature"]);c!=null&&u(l,["temperature"],c);const d=r(e,["topP"]);d!=null&&u(l,["topP"],d);const m=r(e,["topK"]);m!=null&&u(l,["topK"],m);const g=r(e,["candidateCount"]);g!=null&&u(l,["candidateCount"],g);const h=r(e,["maxOutputTokens"]);h!=null&&u(l,["maxOutputTokens"],h);const v=r(e,["stopSequences"]);v!=null&&u(l,["stopSequences"],v);const T=r(e,["responseLogprobs"]);T!=null&&u(l,["responseLogprobs"],T);const _=r(e,["logprobs"]);_!=null&&u(l,["logprobs"],_);const C=r(e,["presencePenalty"]);C!=null&&u(l,["presencePenalty"],C);const M=r(e,["frequencyPenalty"]);M!=null&&u(l,["frequencyPenalty"],M);const S=r(e,["seed"]);S!=null&&u(l,["seed"],S);const R=r(e,["responseMimeType"]);R!=null&&u(l,["responseMimeType"],R);const x=r(e,["responseSchema"]);x!=null&&u(l,["responseSchema"],WA(Zu(x)));const b=r(e,["responseJsonSchema"]);b!=null&&u(l,["responseJsonSchema"],b);const N=r(e,["routingConfig"]);N!=null&&u(l,["routingConfig"],N);const z=r(e,["modelSelectionConfig"]);z!=null&&u(l,["modelConfig"],jA(z));const k=r(e,["safetySettings"]);if(o!==void 0&&k!=null){let te=k;Array.isArray(te)&&(te=te.map(J=>e1(J))),u(o,["safetySettings"],te)}const X=r(e,["tools"]);if(o!==void 0&&X!=null){let te=_o(X);Array.isArray(te)&&(te=te.map(J=>sg(To(J)))),u(o,["tools"],te)}const Y=r(e,["toolConfig"]);o!==void 0&&Y!=null&&u(o,["toolConfig"],p1(Y));const oe=r(e,["labels"]);o!==void 0&&oe!=null&&u(o,["labels"],oe);const q=r(e,["cachedContent"]);o!==void 0&&q!=null&&u(o,["cachedContent"],bn(n,q));const re=r(e,["responseModalities"]);re!=null&&u(l,["responseModalities"],re);const ye=r(e,["mediaResolution"]);ye!=null&&u(l,["mediaResolution"],ye);const B=r(e,["speechConfig"]);B!=null&&u(l,["speechConfig"],v1(Xu(B)));const le=r(e,["audioTimestamp"]);le!=null&&u(l,["audioTimestamp"],le);const w=r(e,["thinkingConfig"]);return w!=null&&u(l,["thinkingConfig"],T1(w)),l}function dp(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);if(s!=null){let d=Qt(s);Array.isArray(d)&&(d=d.map(m=>So(m))),u(o,["contents"],d)}const c=r(e,["config"]);return c!=null&&u(o,["generationConfig"],_1(n,c,o)),o}function C1(n,e){const o={},l=r(n,["taskType"]);e!==void 0&&l!=null&&u(e,["instances[]","task_type"],l);const s=r(n,["title"]);e!==void 0&&s!=null&&u(e,["instances[]","title"],s);const c=r(n,["outputDimensionality"]);e!==void 0&&c!=null&&u(e,["parameters","outputDimensionality"],c);const d=r(n,["mimeType"]);e!==void 0&&d!=null&&u(e,["instances[]","mimeType"],d);const m=r(n,["autoTruncate"]);return e!==void 0&&m!=null&&u(e,["parameters","autoTruncate"],m),o}function S1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);s!=null&&u(o,["instances[]","content"],Op(n,s));const c=r(e,["config"]);return c!=null&&u(o,["config"],C1(c,o)),o}function E1(n,e){const o={},l=r(n,["outputGcsUri"]);e!==void 0&&l!=null&&u(e,["parameters","storageUri"],l);const s=r(n,["negativePrompt"]);e!==void 0&&s!=null&&u(e,["parameters","negativePrompt"],s);const c=r(n,["numberOfImages"]);e!==void 0&&c!=null&&u(e,["parameters","sampleCount"],c);const d=r(n,["aspectRatio"]);e!==void 0&&d!=null&&u(e,["parameters","aspectRatio"],d);const m=r(n,["guidanceScale"]);e!==void 0&&m!=null&&u(e,["parameters","guidanceScale"],m);const g=r(n,["seed"]);e!==void 0&&g!=null&&u(e,["parameters","seed"],g);const h=r(n,["safetyFilterLevel"]);e!==void 0&&h!=null&&u(e,["parameters","safetySetting"],h);const v=r(n,["personGeneration"]);e!==void 0&&v!=null&&u(e,["parameters","personGeneration"],v);const T=r(n,["includeSafetyAttributes"]);e!==void 0&&T!=null&&u(e,["parameters","includeSafetyAttributes"],T);const _=r(n,["includeRaiReason"]);e!==void 0&&_!=null&&u(e,["parameters","includeRaiReason"],_);const C=r(n,["language"]);e!==void 0&&C!=null&&u(e,["parameters","language"],C);const M=r(n,["outputMimeType"]);e!==void 0&&M!=null&&u(e,["parameters","outputOptions","mimeType"],M);const S=r(n,["outputCompressionQuality"]);e!==void 0&&S!=null&&u(e,["parameters","outputOptions","compressionQuality"],S);const R=r(n,["addWatermark"]);e!==void 0&&R!=null&&u(e,["parameters","addWatermark"],R);const x=r(n,["imageSize"]);e!==void 0&&x!=null&&u(e,["parameters","sampleImageSize"],x);const b=r(n,["enhancePrompt"]);return e!==void 0&&b!=null&&u(e,["parameters","enhancePrompt"],b),o}function A1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["prompt"]);s!=null&&u(o,["instances[0]","prompt"],s);const c=r(e,["config"]);return c!=null&&u(o,["config"],E1(c,o)),o}function Dn(n){const e={},o=r(n,["gcsUri"]);o!=null&&u(e,["gcsUri"],o);const l=r(n,["imageBytes"]);l!=null&&u(e,["bytesBase64Encoded"],xi(l));const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function x1(n){const e={},o=r(n,["maskMode"]);o!=null&&u(e,["maskMode"],o);const l=r(n,["segmentationClasses"]);l!=null&&u(e,["maskClasses"],l);const s=r(n,["maskDilation"]);return s!=null&&u(e,["dilation"],s),e}function M1(n){const e={},o=r(n,["controlType"]);o!=null&&u(e,["controlType"],o);const l=r(n,["enableControlImageComputation"]);return l!=null&&u(e,["computeControl"],l),e}function R1(n){const e={},o=r(n,["styleDescription"]);return o!=null&&u(e,["styleDescription"],o),e}function w1(n){const e={},o=r(n,["subjectType"]);o!=null&&u(e,["subjectType"],o);const l=r(n,["subjectDescription"]);return l!=null&&u(e,["subjectDescription"],l),e}function b1(n){const e={},o=r(n,["referenceImage"]);o!=null&&u(e,["referenceImage"],Dn(o));const l=r(n,["referenceId"]);l!=null&&u(e,["referenceId"],l);const s=r(n,["referenceType"]);s!=null&&u(e,["referenceType"],s);const c=r(n,["maskImageConfig"]);c!=null&&u(e,["maskImageConfig"],x1(c));const d=r(n,["controlImageConfig"]);d!=null&&u(e,["controlImageConfig"],M1(d));const m=r(n,["styleImageConfig"]);m!=null&&u(e,["styleImageConfig"],R1(m));const g=r(n,["subjectImageConfig"]);return g!=null&&u(e,["subjectImageConfig"],w1(g)),e}function D1(n,e){const o={},l=r(n,["outputGcsUri"]);e!==void 0&&l!=null&&u(e,["parameters","storageUri"],l);const s=r(n,["negativePrompt"]);e!==void 0&&s!=null&&u(e,["parameters","negativePrompt"],s);const c=r(n,["numberOfImages"]);e!==void 0&&c!=null&&u(e,["parameters","sampleCount"],c);const d=r(n,["aspectRatio"]);e!==void 0&&d!=null&&u(e,["parameters","aspectRatio"],d);const m=r(n,["guidanceScale"]);e!==void 0&&m!=null&&u(e,["parameters","guidanceScale"],m);const g=r(n,["seed"]);e!==void 0&&g!=null&&u(e,["parameters","seed"],g);const h=r(n,["safetyFilterLevel"]);e!==void 0&&h!=null&&u(e,["parameters","safetySetting"],h);const v=r(n,["personGeneration"]);e!==void 0&&v!=null&&u(e,["parameters","personGeneration"],v);const T=r(n,["includeSafetyAttributes"]);e!==void 0&&T!=null&&u(e,["parameters","includeSafetyAttributes"],T);const _=r(n,["includeRaiReason"]);e!==void 0&&_!=null&&u(e,["parameters","includeRaiReason"],_);const C=r(n,["language"]);e!==void 0&&C!=null&&u(e,["parameters","language"],C);const M=r(n,["outputMimeType"]);e!==void 0&&M!=null&&u(e,["parameters","outputOptions","mimeType"],M);const S=r(n,["outputCompressionQuality"]);e!==void 0&&S!=null&&u(e,["parameters","outputOptions","compressionQuality"],S);const R=r(n,["addWatermark"]);e!==void 0&&R!=null&&u(e,["parameters","addWatermark"],R);const x=r(n,["editMode"]);e!==void 0&&x!=null&&u(e,["parameters","editMode"],x);const b=r(n,["baseSteps"]);return e!==void 0&&b!=null&&u(e,["parameters","editConfig","baseSteps"],b),o}function N1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["prompt"]);s!=null&&u(o,["instances[0]","prompt"],s);const c=r(e,["referenceImages"]);if(c!=null){let m=c;Array.isArray(m)&&(m=m.map(g=>b1(g))),u(o,["instances[0]","referenceImages"],m)}const d=r(e,["config"]);return d!=null&&u(o,["config"],D1(d,o)),o}function I1(n,e){const o={},l=r(n,["includeRaiReason"]);e!==void 0&&l!=null&&u(e,["parameters","includeRaiReason"],l);const s=r(n,["outputMimeType"]);e!==void 0&&s!=null&&u(e,["parameters","outputOptions","mimeType"],s);const c=r(n,["outputCompressionQuality"]);e!==void 0&&c!=null&&u(e,["parameters","outputOptions","compressionQuality"],c);const d=r(n,["enhanceInputImage"]);e!==void 0&&d!=null&&u(e,["parameters","upscaleConfig","enhanceInputImage"],d);const m=r(n,["imagePreservationFactor"]);e!==void 0&&m!=null&&u(e,["parameters","upscaleConfig","imagePreservationFactor"],m);const g=r(n,["numberOfImages"]);e!==void 0&&g!=null&&u(e,["parameters","sampleCount"],g);const h=r(n,["mode"]);return e!==void 0&&h!=null&&u(e,["parameters","mode"],h),o}function U1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["image"]);s!=null&&u(o,["instances[0]","image"],Dn(s));const c=r(e,["upscaleFactor"]);c!=null&&u(o,["parameters","upscaleConfig","upscaleFactor"],c);const d=r(e,["config"]);return d!=null&&u(o,["config"],I1(d,o)),o}function k1(n){const e={},o=r(n,["productImage"]);return o!=null&&u(e,["image"],Dn(o)),e}function L1(n,e){const o={},l=r(n,["prompt"]);e!==void 0&&l!=null&&u(e,["instances[0]","prompt"],l);const s=r(n,["personImage"]);e!==void 0&&s!=null&&u(e,["instances[0]","personImage","image"],Dn(s));const c=r(n,["productImages"]);if(e!==void 0&&c!=null){let d=c;Array.isArray(d)&&(d=d.map(m=>k1(m))),u(e,["instances[0]","productImages"],d)}return o}function P1(n,e){const o={},l=r(n,["numberOfImages"]);e!==void 0&&l!=null&&u(e,["parameters","sampleCount"],l);const s=r(n,["baseSteps"]);e!==void 0&&s!=null&&u(e,["parameters","editConfig","baseSteps"],s);const c=r(n,["outputGcsUri"]);e!==void 0&&c!=null&&u(e,["parameters","storageUri"],c);const d=r(n,["seed"]);e!==void 0&&d!=null&&u(e,["parameters","seed"],d);const m=r(n,["safetyFilterLevel"]);e!==void 0&&m!=null&&u(e,["parameters","safetySetting"],m);const g=r(n,["personGeneration"]);e!==void 0&&g!=null&&u(e,["parameters","personGeneration"],g);const h=r(n,["outputMimeType"]);e!==void 0&&h!=null&&u(e,["parameters","outputOptions","mimeType"],h);const v=r(n,["outputCompressionQuality"]);e!==void 0&&v!=null&&u(e,["parameters","outputOptions","compressionQuality"],v);const T=r(n,["enhancePrompt"]);return e!==void 0&&T!=null&&u(e,["parameters","enhancePrompt"],T),o}function z1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["source"]);s!=null&&u(o,["config"],L1(s,o));const c=r(e,["config"]);return c!=null&&u(o,["config"],P1(c,o)),o}function B1(n){const e={},o=r(n,["image"]);return o!=null&&u(e,["image"],Dn(o)),e}function V1(n,e){const o={},l=r(n,["prompt"]);e!==void 0&&l!=null&&u(e,["instances[0]","prompt"],l);const s=r(n,["image"]);e!==void 0&&s!=null&&u(e,["instances[0]","image"],Dn(s));const c=r(n,["scribbleImage"]);return e!==void 0&&c!=null&&u(e,["instances[0]","scribble"],B1(c)),o}function H1(n,e){const o={},l=r(n,["mode"]);e!==void 0&&l!=null&&u(e,["parameters","mode"],l);const s=r(n,["maxPredictions"]);e!==void 0&&s!=null&&u(e,["parameters","maxPredictions"],s);const c=r(n,["confidenceThreshold"]);e!==void 0&&c!=null&&u(e,["parameters","confidenceThreshold"],c);const d=r(n,["maskDilation"]);e!==void 0&&d!=null&&u(e,["parameters","maskDilation"],d);const m=r(n,["binaryColorThreshold"]);return e!==void 0&&m!=null&&u(e,["parameters","binaryColorThreshold"],m),o}function G1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["source"]);s!=null&&u(o,["config"],V1(s,o));const c=r(e,["config"]);return c!=null&&u(o,["config"],H1(c,o)),o}function q1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","name"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function F1(n,e,o){const l={},s=r(e,["pageSize"]);o!==void 0&&s!=null&&u(o,["_query","pageSize"],s);const c=r(e,["pageToken"]);o!==void 0&&c!=null&&u(o,["_query","pageToken"],c);const d=r(e,["filter"]);o!==void 0&&d!=null&&u(o,["_query","filter"],d);const m=r(e,["queryBase"]);return o!==void 0&&m!=null&&u(o,["_url","models_url"],Kp(n,m)),l}function O1(n,e){const o={},l=r(e,["config"]);return l!=null&&u(o,["config"],F1(n,l,o)),o}function Y1(n,e){const o={},l=r(n,["displayName"]);e!==void 0&&l!=null&&u(e,["displayName"],l);const s=r(n,["description"]);e!==void 0&&s!=null&&u(e,["description"],s);const c=r(n,["defaultCheckpointId"]);return e!==void 0&&c!=null&&u(e,["defaultCheckpointId"],c),o}function J1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],Y1(s,o)),o}function K1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","name"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],s),o}function Z1(n,e){const o={},l=r(n,["systemInstruction"]);e!==void 0&&l!=null&&u(e,["systemInstruction"],So(Et(l)));const s=r(n,["tools"]);if(e!==void 0&&s!=null){let d=s;Array.isArray(d)&&(d=d.map(m=>sg(m))),u(e,["tools"],d)}const c=r(n,["generationConfig"]);return e!==void 0&&c!=null&&u(e,["generationConfig"],c),o}function X1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);if(s!=null){let d=Qt(s);Array.isArray(d)&&(d=d.map(m=>So(m))),u(o,["contents"],d)}const c=r(e,["config"]);return c!=null&&u(o,["config"],Z1(c,o)),o}function Q1(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["contents"]);if(s!=null){let d=Qt(s);Array.isArray(d)&&(d=d.map(m=>So(m))),u(o,["contents"],d)}const c=r(e,["config"]);return c!=null&&u(o,["config"],c),o}function $1(n){const e={},o=r(n,["uri"]);o!=null&&u(e,["gcsUri"],o);const l=r(n,["videoBytes"]);l!=null&&u(e,["bytesBase64Encoded"],xi(l));const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function W1(n){const e={},o=r(n,["image"]);o!=null&&u(e,["image"],Dn(o));const l=r(n,["referenceType"]);return l!=null&&u(e,["referenceType"],l),e}function j1(n,e){const o={},l=r(n,["numberOfVideos"]);e!==void 0&&l!=null&&u(e,["parameters","sampleCount"],l);const s=r(n,["outputGcsUri"]);e!==void 0&&s!=null&&u(e,["parameters","storageUri"],s);const c=r(n,["fps"]);e!==void 0&&c!=null&&u(e,["parameters","fps"],c);const d=r(n,["durationSeconds"]);e!==void 0&&d!=null&&u(e,["parameters","durationSeconds"],d);const m=r(n,["seed"]);e!==void 0&&m!=null&&u(e,["parameters","seed"],m);const g=r(n,["aspectRatio"]);e!==void 0&&g!=null&&u(e,["parameters","aspectRatio"],g);const h=r(n,["resolution"]);e!==void 0&&h!=null&&u(e,["parameters","resolution"],h);const v=r(n,["personGeneration"]);e!==void 0&&v!=null&&u(e,["parameters","personGeneration"],v);const T=r(n,["pubsubTopic"]);e!==void 0&&T!=null&&u(e,["parameters","pubsubTopic"],T);const _=r(n,["negativePrompt"]);e!==void 0&&_!=null&&u(e,["parameters","negativePrompt"],_);const C=r(n,["enhancePrompt"]);e!==void 0&&C!=null&&u(e,["parameters","enhancePrompt"],C);const M=r(n,["generateAudio"]);e!==void 0&&M!=null&&u(e,["parameters","generateAudio"],M);const S=r(n,["lastFrame"]);e!==void 0&&S!=null&&u(e,["instances[0]","lastFrame"],Dn(S));const R=r(n,["referenceImages"]);if(e!==void 0&&R!=null){let b=R;Array.isArray(b)&&(b=b.map(N=>W1(N))),u(e,["instances[0]","referenceImages"],b)}const x=r(n,["compressionQuality"]);return e!==void 0&&x!=null&&u(e,["parameters","compressionQuality"],x),o}function ex(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["_url","model"],Fe(n,l));const s=r(e,["prompt"]);s!=null&&u(o,["instances[0]","prompt"],s);const c=r(e,["image"]);c!=null&&u(o,["instances[0]","image"],Dn(c));const d=r(e,["video"]);d!=null&&u(o,["instances[0]","video"],$1(d));const m=r(e,["config"]);return m!=null&&u(o,["config"],j1(m,o)),o}function tx(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function nx(n){const e={},o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function ix(n){const e={},o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function ox(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],tx(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],nx(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],ix(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function lx(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>ox(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function ax(n){const e={},o=r(n,["citationSources"]);return o!=null&&u(e,["citations"],o),e}function rx(n){const e={},o=r(n,["retrievedUrl"]);o!=null&&u(e,["retrievedUrl"],o);const l=r(n,["urlRetrievalStatus"]);return l!=null&&u(e,["urlRetrievalStatus"],l),e}function sx(n){const e={},o=r(n,["urlMetadata"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>rx(s))),u(e,["urlMetadata"],l)}return e}function ux(n){const e={},o=r(n,["content"]);o!=null&&u(e,["content"],lx(o));const l=r(n,["citationMetadata"]);l!=null&&u(e,["citationMetadata"],ax(l));const s=r(n,["tokenCount"]);s!=null&&u(e,["tokenCount"],s);const c=r(n,["finishReason"]);c!=null&&u(e,["finishReason"],c);const d=r(n,["urlContextMetadata"]);d!=null&&u(e,["urlContextMetadata"],sx(d));const m=r(n,["avgLogprobs"]);m!=null&&u(e,["avgLogprobs"],m);const g=r(n,["groundingMetadata"]);g!=null&&u(e,["groundingMetadata"],g);const h=r(n,["index"]);h!=null&&u(e,["index"],h);const v=r(n,["logprobsResult"]);v!=null&&u(e,["logprobsResult"],v);const T=r(n,["safetyRatings"]);return T!=null&&u(e,["safetyRatings"],T),e}function hp(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["candidates"]);if(l!=null){let g=l;Array.isArray(g)&&(g=g.map(h=>ux(h))),u(e,["candidates"],g)}const s=r(n,["modelVersion"]);s!=null&&u(e,["modelVersion"],s);const c=r(n,["promptFeedback"]);c!=null&&u(e,["promptFeedback"],c);const d=r(n,["responseId"]);d!=null&&u(e,["responseId"],d);const m=r(n,["usageMetadata"]);return m!=null&&u(e,["usageMetadata"],m),e}function fx(n){const e={},o=r(n,["values"]);return o!=null&&u(e,["values"],o),e}function cx(){return{}}function dx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["embeddings"]);if(l!=null){let c=l;Array.isArray(c)&&(c=c.map(d=>fx(d))),u(e,["embeddings"],c)}return r(n,["metadata"])!=null&&u(e,["metadata"],cx()),e}function hx(n){const e={},o=r(n,["bytesBase64Encoded"]);o!=null&&u(e,["imageBytes"],xi(o));const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function ug(n){const e={},o=r(n,["safetyAttributes","categories"]);o!=null&&u(e,["categories"],o);const l=r(n,["safetyAttributes","scores"]);l!=null&&u(e,["scores"],l);const s=r(n,["contentType"]);return s!=null&&u(e,["contentType"],s),e}function mx(n){const e={},o=r(n,["_self"]);o!=null&&u(e,["image"],hx(o));const l=r(n,["raiFilteredReason"]);l!=null&&u(e,["raiFilteredReason"],l);const s=r(n,["_self"]);return s!=null&&u(e,["safetyAttributes"],ug(s)),e}function px(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["predictions"]);if(l!=null){let c=l;Array.isArray(c)&&(c=c.map(d=>mx(d))),u(e,["generatedImages"],c)}const s=r(n,["positivePromptSafetyAttributes"]);return s!=null&&u(e,["positivePromptSafetyAttributes"],ug(s)),e}function gx(n){const e={},o=r(n,["baseModel"]);o!=null&&u(e,["baseModel"],o);const l=r(n,["createTime"]);l!=null&&u(e,["createTime"],l);const s=r(n,["updateTime"]);return s!=null&&u(e,["updateTime"],s),e}function Pu(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["description"]);s!=null&&u(e,["description"],s);const c=r(n,["version"]);c!=null&&u(e,["version"],c);const d=r(n,["_self"]);d!=null&&u(e,["tunedModelInfo"],gx(d));const m=r(n,["inputTokenLimit"]);m!=null&&u(e,["inputTokenLimit"],m);const g=r(n,["outputTokenLimit"]);g!=null&&u(e,["outputTokenLimit"],g);const h=r(n,["supportedGenerationMethods"]);return h!=null&&u(e,["supportedActions"],h),e}function yx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["_self"]);if(s!=null){let c=Zp(s);Array.isArray(c)&&(c=c.map(d=>Pu(d))),u(e,["models"],c)}return e}function vx(){return{}}function Tx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["totalTokens"]);l!=null&&u(e,["totalTokens"],l);const s=r(n,["cachedContentTokenCount"]);return s!=null&&u(e,["cachedContentTokenCount"],s),e}function _x(n){const e={},o=r(n,["video","uri"]);o!=null&&u(e,["uri"],o);const l=r(n,["video","encodedVideo"]);l!=null&&u(e,["videoBytes"],xi(l));const s=r(n,["encoding"]);return s!=null&&u(e,["mimeType"],s),e}function Cx(n){const e={},o=r(n,["_self"]);return o!=null&&u(e,["video"],_x(o)),e}function Sx(n){const e={},o=r(n,["generatedSamples"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>Cx(d))),u(e,["generatedVideos"],c)}const l=r(n,["raiMediaFilteredCount"]);l!=null&&u(e,["raiMediaFilteredCount"],l);const s=r(n,["raiMediaFilteredReasons"]);return s!=null&&u(e,["raiMediaFilteredReasons"],s),e}function Ex(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["metadata"]);l!=null&&u(e,["metadata"],l);const s=r(n,["done"]);s!=null&&u(e,["done"],s);const c=r(n,["error"]);c!=null&&u(e,["error"],c);const d=r(n,["response","generateVideoResponse"]);return d!=null&&u(e,["response"],Sx(d)),e}function Ax(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function xx(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["data"]);l!=null&&u(e,["data"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function Mx(n){const e={},o=r(n,["displayName"]);o!=null&&u(e,["displayName"],o);const l=r(n,["fileUri"]);l!=null&&u(e,["fileUri"],l);const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function Rx(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],Ax(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],xx(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],Mx(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function wx(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>Rx(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function bx(n){const e={},o=r(n,["citations"]);return o!=null&&u(e,["citations"],o),e}function Dx(n){const e={},o=r(n,["retrievedUrl"]);o!=null&&u(e,["retrievedUrl"],o);const l=r(n,["urlRetrievalStatus"]);return l!=null&&u(e,["urlRetrievalStatus"],l),e}function Nx(n){const e={},o=r(n,["urlMetadata"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>Dx(s))),u(e,["urlMetadata"],l)}return e}function Ix(n){const e={},o=r(n,["content"]);o!=null&&u(e,["content"],wx(o));const l=r(n,["citationMetadata"]);l!=null&&u(e,["citationMetadata"],bx(l));const s=r(n,["finishMessage"]);s!=null&&u(e,["finishMessage"],s);const c=r(n,["finishReason"]);c!=null&&u(e,["finishReason"],c);const d=r(n,["urlContextMetadata"]);d!=null&&u(e,["urlContextMetadata"],Nx(d));const m=r(n,["avgLogprobs"]);m!=null&&u(e,["avgLogprobs"],m);const g=r(n,["groundingMetadata"]);g!=null&&u(e,["groundingMetadata"],g);const h=r(n,["index"]);h!=null&&u(e,["index"],h);const v=r(n,["logprobsResult"]);v!=null&&u(e,["logprobsResult"],v);const T=r(n,["safetyRatings"]);return T!=null&&u(e,["safetyRatings"],T),e}function mp(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["candidates"]);if(l!=null){let h=l;Array.isArray(h)&&(h=h.map(v=>Ix(v))),u(e,["candidates"],h)}const s=r(n,["createTime"]);s!=null&&u(e,["createTime"],s);const c=r(n,["modelVersion"]);c!=null&&u(e,["modelVersion"],c);const d=r(n,["promptFeedback"]);d!=null&&u(e,["promptFeedback"],d);const m=r(n,["responseId"]);m!=null&&u(e,["responseId"],m);const g=r(n,["usageMetadata"]);return g!=null&&u(e,["usageMetadata"],g),e}function Ux(n){const e={},o=r(n,["truncated"]);o!=null&&u(e,["truncated"],o);const l=r(n,["token_count"]);return l!=null&&u(e,["tokenCount"],l),e}function kx(n){const e={},o=r(n,["values"]);o!=null&&u(e,["values"],o);const l=r(n,["statistics"]);return l!=null&&u(e,["statistics"],Ux(l)),e}function Lx(n){const e={},o=r(n,["billableCharacterCount"]);return o!=null&&u(e,["billableCharacterCount"],o),e}function Px(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["predictions[]","embeddings"]);if(l!=null){let c=l;Array.isArray(c)&&(c=c.map(d=>kx(d))),u(e,["embeddings"],c)}const s=r(n,["metadata"]);return s!=null&&u(e,["metadata"],Lx(s)),e}function fg(n){const e={},o=r(n,["gcsUri"]);o!=null&&u(e,["gcsUri"],o);const l=r(n,["bytesBase64Encoded"]);l!=null&&u(e,["imageBytes"],xi(l));const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function cg(n){const e={},o=r(n,["safetyAttributes","categories"]);o!=null&&u(e,["categories"],o);const l=r(n,["safetyAttributes","scores"]);l!=null&&u(e,["scores"],l);const s=r(n,["contentType"]);return s!=null&&u(e,["contentType"],s),e}function or(n){const e={},o=r(n,["_self"]);o!=null&&u(e,["image"],fg(o));const l=r(n,["raiFilteredReason"]);l!=null&&u(e,["raiFilteredReason"],l);const s=r(n,["_self"]);s!=null&&u(e,["safetyAttributes"],cg(s));const c=r(n,["prompt"]);return c!=null&&u(e,["enhancedPrompt"],c),e}function zx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["predictions"]);if(l!=null){let c=l;Array.isArray(c)&&(c=c.map(d=>or(d))),u(e,["generatedImages"],c)}const s=r(n,["positivePromptSafetyAttributes"]);return s!=null&&u(e,["positivePromptSafetyAttributes"],cg(s)),e}function Bx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["predictions"]);if(l!=null){let s=l;Array.isArray(s)&&(s=s.map(c=>or(c))),u(e,["generatedImages"],s)}return e}function Vx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["predictions"]);if(l!=null){let s=l;Array.isArray(s)&&(s=s.map(c=>or(c))),u(e,["generatedImages"],s)}return e}function Hx(n){const e={},o=r(n,["predictions"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>or(s))),u(e,["generatedImages"],l)}return e}function Gx(n){const e={},o=r(n,["label"]);o!=null&&u(e,["label"],o);const l=r(n,["score"]);return l!=null&&u(e,["score"],l),e}function qx(n){const e={},o=r(n,["_self"]);o!=null&&u(e,["mask"],fg(o));const l=r(n,["labels"]);if(l!=null){let s=l;Array.isArray(s)&&(s=s.map(c=>Gx(c))),u(e,["labels"],s)}return e}function Fx(n){const e={},o=r(n,["predictions"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>qx(s))),u(e,["generatedMasks"],l)}return e}function Ox(n){const e={},o=r(n,["endpoint"]);o!=null&&u(e,["name"],o);const l=r(n,["deployedModelId"]);return l!=null&&u(e,["deployedModelId"],l),e}function Yx(n){const e={},o=r(n,["labels","google-vertex-llm-tuning-base-model-id"]);o!=null&&u(e,["baseModel"],o);const l=r(n,["createTime"]);l!=null&&u(e,["createTime"],l);const s=r(n,["updateTime"]);return s!=null&&u(e,["updateTime"],s),e}function Jx(n){const e={},o=r(n,["checkpointId"]);o!=null&&u(e,["checkpointId"],o);const l=r(n,["epoch"]);l!=null&&u(e,["epoch"],l);const s=r(n,["step"]);return s!=null&&u(e,["step"],s),e}function zu(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["displayName"]);l!=null&&u(e,["displayName"],l);const s=r(n,["description"]);s!=null&&u(e,["description"],s);const c=r(n,["versionId"]);c!=null&&u(e,["version"],c);const d=r(n,["deployedModels"]);if(d!=null){let T=d;Array.isArray(T)&&(T=T.map(_=>Ox(_))),u(e,["endpoints"],T)}const m=r(n,["labels"]);m!=null&&u(e,["labels"],m);const g=r(n,["_self"]);g!=null&&u(e,["tunedModelInfo"],Yx(g));const h=r(n,["defaultCheckpointId"]);h!=null&&u(e,["defaultCheckpointId"],h);const v=r(n,["checkpoints"]);if(v!=null){let T=v;Array.isArray(T)&&(T=T.map(_=>Jx(_))),u(e,["checkpoints"],T)}return e}function Kx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["_self"]);if(s!=null){let c=Zp(s);Array.isArray(c)&&(c=c.map(d=>zu(d))),u(e,["models"],c)}return e}function Zx(){return{}}function Xx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["totalTokens"]);return l!=null&&u(e,["totalTokens"],l),e}function Qx(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["tokensInfo"]);return l!=null&&u(e,["tokensInfo"],l),e}function $x(n){const e={},o=r(n,["gcsUri"]);o!=null&&u(e,["uri"],o);const l=r(n,["bytesBase64Encoded"]);l!=null&&u(e,["videoBytes"],xi(l));const s=r(n,["mimeType"]);return s!=null&&u(e,["mimeType"],s),e}function Wx(n){const e={},o=r(n,["_self"]);return o!=null&&u(e,["video"],$x(o)),e}function jx(n){const e={},o=r(n,["videos"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(d=>Wx(d))),u(e,["generatedVideos"],c)}const l=r(n,["raiMediaFilteredCount"]);l!=null&&u(e,["raiMediaFilteredCount"],l);const s=r(n,["raiMediaFilteredReasons"]);return s!=null&&u(e,["raiMediaFilteredReasons"],s),e}function e2(n){const e={},o=r(n,["name"]);o!=null&&u(e,["name"],o);const l=r(n,["metadata"]);l!=null&&u(e,["metadata"],l);const s=r(n,["done"]);s!=null&&u(e,["done"],s);const c=r(n,["error"]);c!=null&&u(e,["error"],c);const d=r(n,["response"]);return d!=null&&u(e,["response"],jx(d)),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const t2="Content-Type",n2="X-Server-Timeout",i2="User-Agent",Bu="x-goog-api-client",o2="1.15.0",l2=`google-genai-sdk/${o2}`,a2="v1beta1",r2="v1beta",pp=/^data: (.*)(?:\n\n|\r\r|\r\n\r\n)/;class s2{constructor(e){var o,l;this.clientOptions=Object.assign(Object.assign({},e),{project:e.project,location:e.location,apiKey:e.apiKey,vertexai:e.vertexai});const s={};this.clientOptions.vertexai?(s.apiVersion=(o=this.clientOptions.apiVersion)!==null&&o!==void 0?o:a2,s.baseUrl=this.baseUrlFromProjectLocation(),this.normalizeAuthParameters()):(s.apiVersion=(l=this.clientOptions.apiVersion)!==null&&l!==void 0?l:r2,s.baseUrl="https://generativelanguage.googleapis.com/"),s.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=s,e.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(s,e.httpOptions))}baseUrlFromProjectLocation(){return this.clientOptions.project&&this.clientOptions.location&&this.clientOptions.location!=="global"?`https://${this.clientOptions.location}-aiplatform.googleapis.com/`:"https://aiplatform.googleapis.com/"}normalizeAuthParameters(){if(this.clientOptions.project&&this.clientOptions.location){this.clientOptions.apiKey=void 0;return}this.clientOptions.project=void 0,this.clientOptions.location=void 0}isVertexAI(){var e;return(e=this.clientOptions.vertexai)!==null&&e!==void 0?e:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getApiVersion(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.apiVersion!==void 0)return this.clientOptions.httpOptions.apiVersion;throw new Error("API version is not set.")}getBaseUrl(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.baseUrl!==void 0)return this.clientOptions.httpOptions.baseUrl;throw new Error("Base URL is not set.")}getRequestUrl(){return this.getRequestUrlInternal(this.clientOptions.httpOptions)}getHeaders(){if(this.clientOptions.httpOptions&&this.clientOptions.httpOptions.headers!==void 0)return this.clientOptions.httpOptions.headers;throw new Error("Headers are not set.")}getRequestUrlInternal(e){if(!e||e.baseUrl===void 0||e.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const l=[e.baseUrl.endsWith("/")?e.baseUrl.slice(0,-1):e.baseUrl];return e.apiVersion&&e.apiVersion!==""&&l.push(e.apiVersion),l.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const e=this.getBaseUrl(),o=new URL(e);return o.protocol=o.protocol=="http:"?"ws":"wss",o.toString()}setBaseUrl(e){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=e;else throw new Error("HTTP options are not correctly set.")}constructUrl(e,o,l){const s=[this.getRequestUrlInternal(o)];return l&&s.push(this.getBaseResourcePath()),e!==""&&s.push(e),new URL(`${s.join("/")}`)}shouldPrependVertexProjectPath(e){return!(this.clientOptions.apiKey||!this.clientOptions.vertexai||e.path.startsWith("projects/")||e.httpMethod==="GET"&&e.path.startsWith("publishers/google/models"))}async request(e){let o=this.clientOptions.httpOptions;e.httpOptions&&(o=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const l=this.shouldPrependVertexProjectPath(e),s=this.constructUrl(e.path,o,l);if(e.queryParams)for(const[d,m]of Object.entries(e.queryParams))s.searchParams.append(d,String(m));let c={};if(e.httpMethod==="GET"){if(e.body&&e.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else c.body=e.body;return c=await this.includeExtraHttpOptionsToRequestInit(c,o,e.abortSignal),this.unaryApiCall(s,c,e.httpMethod)}patchHttpOptions(e,o){const l=JSON.parse(JSON.stringify(e));for(const[s,c]of Object.entries(o))typeof c=="object"?l[s]=Object.assign(Object.assign({},l[s]),c):c!==void 0&&(l[s]=c);return l}async requestStream(e){let o=this.clientOptions.httpOptions;e.httpOptions&&(o=this.patchHttpOptions(this.clientOptions.httpOptions,e.httpOptions));const l=this.shouldPrependVertexProjectPath(e),s=this.constructUrl(e.path,o,l);(!s.searchParams.has("alt")||s.searchParams.get("alt")!=="sse")&&s.searchParams.set("alt","sse");let c={};return c.body=e.body,c=await this.includeExtraHttpOptionsToRequestInit(c,o,e.abortSignal),this.streamApiCall(s,c,e.httpMethod)}async includeExtraHttpOptionsToRequestInit(e,o,l){if(o&&o.timeout||l){const s=new AbortController,c=s.signal;if(o.timeout&&(o==null?void 0:o.timeout)>0){const d=setTimeout(()=>s.abort(),o.timeout);d&&typeof d.unref=="function"&&d.unref()}l&&l.addEventListener("abort",()=>{s.abort()}),e.signal=c}return o&&o.extraBody!==null&&u2(e,o.extraBody),e.headers=await this.getHeadersInternal(o),e}async unaryApiCall(e,o,l){return this.apiCall(e.toString(),Object.assign(Object.assign({},o),{method:l})).then(async s=>(await gp(s),new Nu(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}async streamApiCall(e,o,l){return this.apiCall(e.toString(),Object.assign(Object.assign({},o),{method:l})).then(async s=>(await gp(s),this.processStreamResponse(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}processStreamResponse(e){var o;return go(this,arguments,function*(){const s=(o=e==null?void 0:e.body)===null||o===void 0?void 0:o.getReader(),c=new TextDecoder("utf-8");if(!s)throw new Error("Response body is empty");try{let d="";for(;;){const{done:m,value:g}=yield et(s.read());if(m){if(d.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const h=c.decode(g,{stream:!0});try{const T=JSON.parse(h);if("error"in T){const _=JSON.parse(JSON.stringify(T.error)),C=_.status,M=_.code,S=`got status: ${C}. ${JSON.stringify(T)}`;if(M>=400&&M<600)throw new nr({message:S,status:M})}}catch(T){if(T.name==="ApiError")throw T}d+=h;let v=d.match(pp);for(;v;){const T=v[1];try{const _=new Response(T,{headers:e==null?void 0:e.headers,status:e==null?void 0:e.status,statusText:e==null?void 0:e.statusText});yield yield et(new Nu(_)),d=d.slice(v[0].length),v=d.match(pp)}catch(_){throw new Error(`exception parsing stream chunk ${T}. ${_}`)}}}}finally{s.releaseLock()}})}async apiCall(e,o){return fetch(e,o).catch(l=>{throw new Error(`exception ${l} sending request`)})}getDefaultHeaders(){const e={},o=l2+" "+this.clientOptions.userAgentExtra;return e[i2]=o,e[Bu]=o,e[t2]="application/json",e}async getHeadersInternal(e){const o=new Headers;if(e&&e.headers){for(const[l,s]of Object.entries(e.headers))o.append(l,s);e.timeout&&e.timeout>0&&o.append(n2,String(Math.ceil(e.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(o),o}async uploadFile(e,o){var l;const s={};o!=null&&(s.mimeType=o.mimeType,s.name=o.name,s.displayName=o.displayName),s.name&&!s.name.startsWith("files/")&&(s.name=`files/${s.name}`);const c=this.clientOptions.uploader,d=await c.stat(e);s.sizeBytes=String(d.size);const m=(l=o==null?void 0:o.mimeType)!==null&&l!==void 0?l:d.type;if(m===void 0||m==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");s.mimeType=m;const g=await this.fetchUploadUrl(s,o);return c.upload(e,g,this)}async downloadFile(e){await this.clientOptions.downloader.download(e,this)}async fetchUploadUrl(e,o){var l;let s={};o!=null&&o.httpOptions?s=o.httpOptions:s={apiVersion:"",headers:{"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${e.sizeBytes}`,"X-Goog-Upload-Header-Content-Type":`${e.mimeType}`}};const c={file:e},d=await this.request({path:xe("upload/v1beta/files",c._url),body:JSON.stringify(c),httpMethod:"POST",httpOptions:s});if(!d||!(d!=null&&d.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const m=(l=d==null?void 0:d.headers)===null||l===void 0?void 0:l["x-goog-upload-url"];if(m===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return m}}async function gp(n){var e;if(n===void 0)throw new Error("response is undefined");if(!n.ok){const o=n.status;let l;!((e=n.headers.get("content-type"))===null||e===void 0)&&e.includes("application/json")?l=await n.json():l={error:{message:await n.text(),code:n.status,status:n.statusText}};const s=JSON.stringify(l);throw o>=400&&o<600?new nr({message:s,status:o}):new Error(s)}}function u2(n,e){if(!e||Object.keys(e).length===0)return;if(n.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let o={};if(typeof n.body=="string"&&n.body.length>0)try{const c=JSON.parse(n.body);if(typeof c=="object"&&c!==null&&!Array.isArray(c))o=c;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function l(c,d){const m=Object.assign({},c);for(const g in d)if(Object.prototype.hasOwnProperty.call(d,g)){const h=d[g],v=m[g];h&&typeof h=="object"&&!Array.isArray(h)&&v&&typeof v=="object"&&!Array.isArray(v)?m[g]=l(v,h):(v&&h&&typeof v!=typeof h&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${g}". Original type: ${typeof v}, New type: ${typeof h}. Overwriting.`),m[g]=h)}return m}const s=l(o,e);n.body=JSON.stringify(s)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const f2="mcp_used/unknown";let c2=!1;function dg(n){for(const e of n)if(d2(e)||typeof e=="object"&&"inputSchema"in e)return!0;return c2}function hg(n){var e;const o=(e=n[Bu])!==null&&e!==void 0?e:"";n[Bu]=(o+` ${f2}`).trimStart()}function d2(n){return n!==null&&typeof n=="object"&&n instanceof $u}function h2(n,e=100){return go(this,arguments,function*(){let l,s=0;for(;s<e;){const c=yield et(n.listTools({cursor:l}));for(const d of c.tools)yield yield et(d),s++;if(!c.nextCursor)break;l=c.nextCursor}})}class $u{constructor(e=[],o){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=e,this.config=o}static create(e,o){return new $u(e,o)}async initialize(){var e,o,l,s;if(this.mcpTools.length>0)return;const c={},d=[];for(const v of this.mcpClients)try{for(var m=!0,g=(o=void 0,Cl(h2(v))),h;h=await g.next(),e=h.done,!e;m=!0){s=h.value,m=!1;const T=s;d.push(T);const _=T.name;if(c[_])throw new Error(`Duplicate function name ${_} found in MCP tools. Please ensure function names are unique.`);c[_]=v}}catch(T){o={error:T}}finally{try{!m&&!e&&(l=g.return)&&await l.call(g)}finally{if(o)throw o.error}}this.mcpTools=d,this.functionNameToMcpClient=c}async tool(){return await this.initialize(),OT(this.mcpTools,this.config)}async callTool(e){await this.initialize();const o=[];for(const l of e)if(l.name in this.functionNameToMcpClient){const s=this.functionNameToMcpClient[l.name];let c;this.config.timeout&&(c={timeout:this.config.timeout});const d=await s.callTool({name:l.name,arguments:l.args},void 0,c);o.push({functionResponse:{name:l.name,response:d.isError?{error:d}:d}})}return o}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function m2(n,e,o){const l=new PT;let s;o.data instanceof Blob?s=JSON.parse(await o.data.text()):s=JSON.parse(o.data);const c=ZE(s);Object.assign(l,c),e(l)}class p2{constructor(e,o,l){this.apiClient=e,this.auth=o,this.webSocketFactory=l}async connect(e){var o,l;if(this.apiClient.isVertexAI())throw new Error("Live music is not supported for Vertex AI.");console.warn("Live music generation is experimental and may change in future versions.");const s=this.apiClient.getWebsocketBaseUrl(),c=this.apiClient.getApiVersion(),d=v2(this.apiClient.getDefaultHeaders()),m=this.apiClient.getApiKey(),g=`${s}/ws/google.ai.generativelanguage.${c}.GenerativeService.BidiGenerateMusic?key=${m}`;let h=()=>{};const v=new Promise(N=>{h=N}),T=e.callbacks,_=function(){h({})},C=this.apiClient,M={onopen:_,onmessage:N=>{m2(C,T.onmessage,N)},onerror:(o=T==null?void 0:T.onerror)!==null&&o!==void 0?o:function(N){},onclose:(l=T==null?void 0:T.onclose)!==null&&l!==void 0?l:function(N){}},S=this.webSocketFactory.create(g,y2(d),M);S.connect(),await v;const R=Fe(this.apiClient,e.model),x=lg({model:R}),b=Lu({setup:x});return S.send(JSON.stringify(b)),new g2(S,this.apiClient)}}class g2{constructor(e,o){this.conn=e,this.apiClient=o}async setWeightedPrompts(e){if(!e.weightedPrompts||Object.keys(e.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const o=YS(e),l=ag(o);this.conn.send(JSON.stringify({clientContent:l}))}async setMusicGenerationConfig(e){e.musicGenerationConfig||(e.musicGenerationConfig={});const o=JS(e),l=Lu(o);this.conn.send(JSON.stringify(l))}sendPlaybackControl(e){const o=Lu({playbackControl:e});this.conn.send(JSON.stringify(o))}play(){this.sendPlaybackControl(mo.PLAY)}pause(){this.sendPlaybackControl(mo.PAUSE)}stop(){this.sendPlaybackControl(mo.STOP)}resetContext(){this.sendPlaybackControl(mo.RESET_CONTEXT)}close(){this.conn.close()}}function y2(n){const e={};return n.forEach((o,l)=>{e[l]=o}),e}function v2(n){const e=new Headers;for(const[o,l]of Object.entries(n))e.append(o,l);return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const T2="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function _2(n,e,o){const l=new LT;let s;o.data instanceof Blob?s=await o.data.text():o.data instanceof ArrayBuffer?s=new TextDecoder().decode(o.data):s=o.data;const c=JSON.parse(s);if(n.isVertexAI()){const d=sA(c);Object.assign(l,d)}else{const d=VE(c);Object.assign(l,d)}e(l)}class C2{constructor(e,o,l){this.apiClient=e,this.auth=o,this.webSocketFactory=l,this.music=new p2(this.apiClient,this.auth,this.webSocketFactory)}async connect(e){var o,l,s,c,d,m;if(e.config&&e.config.httpOptions)throw new Error("The Live module does not support httpOptions at request-level in LiveConnectConfig yet. Please use the client-level httpOptions configuration instead.");const g=this.apiClient.getWebsocketBaseUrl(),h=this.apiClient.getApiVersion();let v;const T=this.apiClient.getHeaders();e.config&&e.config.tools&&dg(e.config.tools)&&hg(T);const _=x2(T);if(this.apiClient.isVertexAI())v=`${g}/ws/google.cloud.aiplatform.${h}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(_);else{const q=this.apiClient.getApiKey();let re="BidiGenerateContent",ye="key";q!=null&&q.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),h!=="v1alpha"&&console.warn("Warning: The SDK's ephemeral token support is in v1alpha only. Please use const ai = new GoogleGenAI({apiKey: token.name, httpOptions: { apiVersion: 'v1alpha' }}); before session connection."),re="BidiGenerateContentConstrained",ye="access_token"),v=`${g}/ws/google.ai.generativelanguage.${h}.GenerativeService.${re}?${ye}=${q}`}let C=()=>{};const M=new Promise(q=>{C=q}),S=e.callbacks,R=function(){var q;(q=S==null?void 0:S.onopen)===null||q===void 0||q.call(S),C({})},x=this.apiClient,b={onopen:R,onmessage:q=>{_2(x,S.onmessage,q)},onerror:(o=S==null?void 0:S.onerror)!==null&&o!==void 0?o:function(q){},onclose:(l=S==null?void 0:S.onclose)!==null&&l!==void 0?l:function(q){}},N=this.webSocketFactory.create(v,A2(_),b);N.connect(),await M;let z=Fe(this.apiClient,e.model);if(this.apiClient.isVertexAI()&&z.startsWith("publishers/")){const q=this.apiClient.getProject(),re=this.apiClient.getLocation();z=`projects/${q}/locations/${re}/`+z}let k={};this.apiClient.isVertexAI()&&((s=e.config)===null||s===void 0?void 0:s.responseModalities)===void 0&&(e.config===void 0?e.config={responseModalities:[$a.AUDIO]}:e.config.responseModalities=[$a.AUDIO]),!((c=e.config)===null||c===void 0)&&c.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const X=(m=(d=e.config)===null||d===void 0?void 0:d.tools)!==null&&m!==void 0?m:[],Y=[];for(const q of X)if(this.isCallableTool(q)){const re=q;Y.push(await re.tool())}else Y.push(q);Y.length>0&&(e.config.tools=Y);const oe={model:z,config:e.config,callbacks:e.callbacks};return this.apiClient.isVertexAI()?k=_E(this.apiClient,oe):k=GS(this.apiClient,oe),delete k.config,N.send(JSON.stringify(k)),new E2(N,this.apiClient)}isCallableTool(e){return"callTool"in e&&typeof e.callTool=="function"}}const S2={turnComplete:!0};class E2{constructor(e,o){this.conn=e,this.apiClient=o}tLiveClientContent(e,o){if(o.turns!==null&&o.turns!==void 0){let l=[];try{l=Qt(o.turns),e.isVertexAI()?l=l.map(s=>So(s)):l=l.map(s=>ir(s))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof o.turns}'`)}return{clientContent:{turns:l,turnComplete:o.turnComplete}}}return{clientContent:{turnComplete:o.turnComplete}}}tLiveClienttToolResponse(e,o){let l=[];if(o.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(o.functionResponses)?l=o.functionResponses:l=[o.functionResponses],l.length===0)throw new Error("functionResponses is required.");for(const c of l){if(typeof c!="object"||c===null||!("name"in c)||!("response"in c))throw new Error(`Could not parse function response, type '${typeof c}'.`);if(!e.isVertexAI()&&!("id"in c))throw new Error(T2)}return{toolResponse:{functionResponses:l}}}sendClientContent(e){e=Object.assign(Object.assign({},S2),e);const o=this.tLiveClientContent(this.apiClient,e);this.conn.send(JSON.stringify(o))}sendRealtimeInput(e){let o={};this.apiClient.isVertexAI()?o={realtimeInput:EE(e)}:o={realtimeInput:OS(e)},this.conn.send(JSON.stringify(o))}sendToolResponse(e){if(e.functionResponses==null)throw new Error("Tool response parameters are required.");const o=this.tLiveClienttToolResponse(this.apiClient,e);this.conn.send(JSON.stringify(o))}close(){this.conn.close()}}function A2(n){const e={};return n.forEach((o,l)=>{e[l]=o}),e}function x2(n){const e=new Headers;for(const[o,l]of Object.entries(n))e.append(o,l);return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const yp=10;function vp(n){var e,o,l;if(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.disable)return!0;let s=!1;for(const d of(o=n==null?void 0:n.tools)!==null&&o!==void 0?o:[])if(yo(d)){s=!0;break}if(!s)return!0;const c=(l=n==null?void 0:n.automaticFunctionCalling)===null||l===void 0?void 0:l.maximumRemoteCalls;return c&&(c<0||!Number.isInteger(c))||c==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",c),!0):!1}function yo(n){return"callTool"in n&&typeof n.callTool=="function"}function M2(n){var e,o,l;return(l=(o=(e=n.config)===null||e===void 0?void 0:e.tools)===null||o===void 0?void 0:o.some(s=>yo(s)))!==null&&l!==void 0?l:!1}function R2(n){var e,o,l;return(l=(o=(e=n.config)===null||e===void 0?void 0:e.tools)===null||o===void 0?void 0:o.some(s=>!yo(s)))!==null&&l!==void 0?l:!1}function Tp(n){var e;return!(!((e=n==null?void 0:n.automaticFunctionCalling)===null||e===void 0)&&e.ignoreCallHistory)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class w2 extends Ai{constructor(e){super(),this.apiClient=e,this.generateContent=async o=>{var l,s,c,d,m;const g=await this.processParamsMaybeAddMcpUsage(o);if(this.maybeMoveToResponseJsonSchem(o),!M2(o)||vp(o.config))return await this.generateContentInternal(g);if(R2(o))throw new Error("Automatic function calling with CallableTools and Tools is not yet supported.");let h,v;const T=Qt(g.contents),_=(c=(s=(l=g.config)===null||l===void 0?void 0:l.automaticFunctionCalling)===null||s===void 0?void 0:s.maximumRemoteCalls)!==null&&c!==void 0?c:yp;let C=0;for(;C<_&&(h=await this.generateContentInternal(g),!(!h.functionCalls||h.functionCalls.length===0));){const M=h.candidates[0].content,S=[];for(const R of(m=(d=o.config)===null||d===void 0?void 0:d.tools)!==null&&m!==void 0?m:[])if(yo(R)){const b=await R.callTool(h.functionCalls);S.push(...b)}C++,v={role:"user",parts:S},g.contents=Qt(g.contents),g.contents.push(M),g.contents.push(v),Tp(g.config)&&(T.push(M),T.push(v))}return Tp(g.config)&&(h.automaticFunctionCallingHistory=T),h},this.generateContentStream=async o=>{if(this.maybeMoveToResponseJsonSchem(o),vp(o.config)){const l=await this.processParamsMaybeAddMcpUsage(o);return await this.generateContentStreamInternal(l)}else return await this.processAfcStream(o)},this.generateImages=async o=>await this.generateImagesInternal(o).then(l=>{var s;let c;const d=[];if(l!=null&&l.generatedImages)for(const g of l.generatedImages)g&&(g!=null&&g.safetyAttributes)&&((s=g==null?void 0:g.safetyAttributes)===null||s===void 0?void 0:s.contentType)==="Positive Prompt"?c=g==null?void 0:g.safetyAttributes:d.push(g);let m;return c?m={generatedImages:d,positivePromptSafetyAttributes:c,sdkHttpResponse:l.sdkHttpResponse}:m={generatedImages:d,sdkHttpResponse:l.sdkHttpResponse},m}),this.list=async o=>{var l;const d={config:Object.assign(Object.assign({},{queryBase:!0}),o==null?void 0:o.config)};if(this.apiClient.isVertexAI()&&!d.config.queryBase){if(!((l=d.config)===null||l===void 0)&&l.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");d.config.filter="labels.tune-type:*"}return new Rl(Ci.PAGED_ITEM_MODELS,m=>this.listInternal(m),await this.listInternal(d),d)},this.editImage=async o=>{const l={model:o.model,prompt:o.prompt,referenceImages:[],config:o.config};return o.referenceImages&&o.referenceImages&&(l.referenceImages=o.referenceImages.map(s=>s.toReferenceImageAPI())),await this.editImageInternal(l)},this.upscaleImage=async o=>{let l={numberOfImages:1,mode:"upscale"};o.config&&(l=Object.assign(Object.assign({},l),o.config));const s={model:o.model,image:o.image,upscaleFactor:o.upscaleFactor,config:l};return await this.upscaleImageInternal(s)},this.generateVideos=async o=>await this.generateVideosInternal(o)}maybeMoveToResponseJsonSchem(e){e.config&&e.config.responseSchema&&(e.config.responseJsonSchema||Object.keys(e.config.responseSchema).includes("$schema")&&(e.config.responseJsonSchema=e.config.responseSchema,delete e.config.responseSchema))}async processParamsMaybeAddMcpUsage(e){var o,l,s;const c=(o=e.config)===null||o===void 0?void 0:o.tools;if(!c)return e;const d=await Promise.all(c.map(async g=>yo(g)?await g.tool():g)),m={model:e.model,contents:e.contents,config:Object.assign(Object.assign({},e.config),{tools:d})};if(m.config.tools=d,e.config&&e.config.tools&&dg(e.config.tools)){const g=(s=(l=e.config.httpOptions)===null||l===void 0?void 0:l.headers)!==null&&s!==void 0?s:{};let h=Object.assign({},g);Object.keys(h).length===0&&(h=this.apiClient.getDefaultHeaders()),hg(h),m.config.httpOptions=Object.assign(Object.assign({},e.config.httpOptions),{headers:h})}return m}async initAfcToolsMap(e){var o,l,s;const c=new Map;for(const d of(l=(o=e.config)===null||o===void 0?void 0:o.tools)!==null&&l!==void 0?l:[])if(yo(d)){const m=d,g=await m.tool();for(const h of(s=g.functionDeclarations)!==null&&s!==void 0?s:[]){if(!h.name)throw new Error("Function declaration name is required.");if(c.has(h.name))throw new Error(`Duplicate tool declaration name: ${h.name}`);c.set(h.name,m)}}return c}async processAfcStream(e){var o,l,s;const c=(s=(l=(o=e.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||l===void 0?void 0:l.maximumRemoteCalls)!==null&&s!==void 0?s:yp;let d=!1,m=0;const g=await this.initAfcToolsMap(e);return(function(h,v,T){var _,C;return go(this,arguments,function*(){for(var M,S,R,x;m<c;){d&&(m++,d=!1);const k=yield et(h.processParamsMaybeAddMcpUsage(T)),X=yield et(h.generateContentStreamInternal(k)),Y=[],oe=[];try{for(var b=!0,N=(S=void 0,Cl(X)),z;z=yield et(N.next()),M=z.done,!M;b=!0){x=z.value,b=!1;const q=x;if(yield yield et(q),q.candidates&&(!((_=q.candidates[0])===null||_===void 0)&&_.content)){oe.push(q.candidates[0].content);for(const re of(C=q.candidates[0].content.parts)!==null&&C!==void 0?C:[])if(m<c&&re.functionCall){if(!re.functionCall.name)throw new Error("Function call name was not returned by the model.");if(v.has(re.functionCall.name)){const ye=yield et(v.get(re.functionCall.name).callTool([re.functionCall]));Y.push(...ye)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${v.keys()}, mising tool: ${re.functionCall.name}`)}}}}catch(q){S={error:q}}finally{try{!b&&!M&&(R=N.return)&&(yield et(R.call(N)))}finally{if(S)throw S.error}}if(Y.length>0){d=!0;const q=new _l;q.candidates=[{content:{role:"user",parts:Y}}],yield yield et(q);const re=[];re.push(...oe),re.push({role:"user",parts:Y});const ye=Qt(T.contents).concat(re);T.contents=ye}else break}})})(this,g,e)}async generateContentInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=dp(this.apiClient,e);return m=xe("{model}:generateContent",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=mp(v),_=new _l;return Object.assign(_,T),_})}else{const h=cp(this.apiClient,e);return m=xe("{model}:generateContent",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=hp(v),_=new _l;return Object.assign(_,T),_})}}async generateContentStreamInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=dp(this.apiClient,e);return m=xe("{model}:streamGenerateContent?alt=sse",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.requestStream({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}),d.then(function(T){return go(this,arguments,function*(){var _,C,M,S;try{for(var R=!0,x=Cl(T),b;b=yield et(x.next()),_=b.done,!_;R=!0){S=b.value,R=!1;const N=S,z=mp(yield et(N.json()));z.sdkHttpResponse={headers:N.headers};const k=new _l;Object.assign(k,z),yield yield et(k)}}catch(N){C={error:N}}finally{try{!R&&!_&&(M=x.return)&&(yield et(M.call(x)))}finally{if(C)throw C.error}}})})}else{const h=cp(this.apiClient,e);return m=xe("{model}:streamGenerateContent?alt=sse",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.requestStream({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}),d.then(function(T){return go(this,arguments,function*(){var _,C,M,S;try{for(var R=!0,x=Cl(T),b;b=yield et(x.next()),_=b.done,!_;R=!0){S=b.value,R=!1;const N=S,z=hp(yield et(N.json()));z.sdkHttpResponse={headers:N.headers};const k=new _l;Object.assign(k,z),yield yield et(k)}}catch(N){C={error:N}}finally{try{!R&&!_&&(M=x.return)&&(yield et(M.call(x)))}finally{if(C)throw C.error}}})})}}async embedContent(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=S1(this.apiClient,e);return m=xe("{model}:predict",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=Px(v),_=new Fm;return Object.assign(_,T),_})}else{const h=kA(this.apiClient,e);return m=xe("{model}:batchEmbedContents",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=dx(v),_=new Fm;return Object.assign(_,T),_})}}async generateImagesInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=A1(this.apiClient,e);return m=xe("{model}:predict",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=zx(v),_=new Om;return Object.assign(_,T),_})}else{const h=PA(this.apiClient,e);return m=xe("{model}:predict",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=px(v),_=new Om;return Object.assign(_,T),_})}}async editImageInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=N1(this.apiClient,e);return c=xe("{model}:predict",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json().then(h=>{const v=h;return v.sdkHttpResponse={headers:g.headers},v})),s.then(g=>{const h=Bx(g),v=new RT;return Object.assign(v,h),v})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=U1(this.apiClient,e);return c=xe("{model}:predict",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json().then(h=>{const v=h;return v.sdkHttpResponse={headers:g.headers},v})),s.then(g=>{const h=Vx(g),v=new wT;return Object.assign(v,h),v})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=z1(this.apiClient,e);return c=xe("{model}:predict",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json()),s.then(g=>{const h=Hx(g),v=new bT;return Object.assign(v,h),v})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=G1(this.apiClient,e);return c=xe("{model}:predict",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json()),s.then(g=>{const h=Fx(g),v=new DT;return Object.assign(v,h),v})}else throw new Error("This method is only supported by the Vertex AI.")}async get(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=q1(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>zu(v))}else{const h=zA(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Pu(v))}}async listInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=O1(this.apiClient,e);return m=xe("{models_url}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=Kx(v),_=new Ym;return Object.assign(_,T),_})}else{const h=VA(this.apiClient,e);return m=xe("{models_url}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=yx(v),_=new Ym;return Object.assign(_,T),_})}}async update(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=J1(this.apiClient,e);return m=xe("{model}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"PATCH",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>zu(v))}else{const h=GA(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"PATCH",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>Pu(v))}}async delete(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=K1(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"DELETE",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(()=>{const v=Zx(),T=new Jm;return Object.assign(T,v),T})}else{const h=qA(this.apiClient,e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"DELETE",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(()=>{const v=vx(),T=new Jm;return Object.assign(T,v),T})}}async countTokens(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=X1(this.apiClient,e);return m=xe("{model}:countTokens",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=Xx(v),_=new Km;return Object.assign(_,T),_})}else{const h=OA(this.apiClient,e);return m=xe("{model}:countTokens",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=Tx(v),_=new Km;return Object.assign(_,T),_})}}async computeTokens(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=Q1(this.apiClient,e);return c=xe("{model}:computeTokens",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json().then(h=>{const v=h;return v.sdkHttpResponse={headers:g.headers},v})),s.then(g=>{const h=Qx(g),v=new NT;return Object.assign(v,h),v})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=ex(this.apiClient,e);return m=xe("{model}:predictLongRunning",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d.then(v=>{const T=e2(v),_=new Wa;return Object.assign(_,T),_})}else{const h=KA(this.apiClient,e);return m=xe("{model}:predictLongRunning",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"POST",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d.then(v=>{const T=Ex(v),_=new Wa;return Object.assign(_,T),_})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function b2(n){const e={},o=r(n,["operationName"]);o!=null&&u(e,["_url","operationName"],o);const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function D2(n){const e={},o=r(n,["operationName"]);o!=null&&u(e,["_url","operationName"],o);const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function N2(n){const e={},o=r(n,["operationName"]);o!=null&&u(e,["operationName"],o);const l=r(n,["resourceName"]);l!=null&&u(e,["_url","resourceName"],l);const s=r(n,["config"]);return s!=null&&u(e,["config"],s),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class I2 extends Ai{constructor(e){super(),this.apiClient=e}async getVideosOperation(e){const o=e.operation,l=e.config;if(o.name===void 0||o.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=o.name.split("/operations/")[0];let c;l&&"httpOptions"in l&&(c=l.httpOptions);const d=await this.fetchPredictVideosOperationInternal({operationName:o.name,resourceName:s,config:{httpOptions:c}});return o._fromAPIResponse({apiResponse:d,isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:o.name,config:l});return o._fromAPIResponse({apiResponse:s,isVertexAI:!1})}}async get(e){const o=e.operation,l=e.config;if(o.name===void 0||o.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const s=o.name.split("/operations/")[0];let c;l&&"httpOptions"in l&&(c=l.httpOptions);const d=await this.fetchPredictVideosOperationInternal({operationName:o.name,resourceName:s,config:{httpOptions:c}});return o._fromAPIResponse({apiResponse:d,isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:o.name,config:l});return o._fromAPIResponse({apiResponse:s,isVertexAI:!1})}}async getVideosOperationInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=D2(e);return m=xe("{operationName}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json()),d}else{const h=b2(e);return m=xe("{operationName}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json()),d}}async fetchPredictVideosOperationInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=N2(e);return c=xe("{resourceName}:fetchPredictOperation",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json()),s}else throw new Error("This method is only supported by the Vertex AI.")}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function U2(n){const e={},o=r(n,["voiceName"]);return o!=null&&u(e,["voiceName"],o),e}function mg(n){const e={},o=r(n,["prebuiltVoiceConfig"]);return o!=null&&u(e,["prebuiltVoiceConfig"],U2(o)),e}function k2(n){const e={},o=r(n,["speaker"]);o!=null&&u(e,["speaker"],o);const l=r(n,["voiceConfig"]);return l!=null&&u(e,["voiceConfig"],mg(l)),e}function L2(n){const e={},o=r(n,["speakerVoiceConfigs"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>k2(s))),u(e,["speakerVoiceConfigs"],l)}return e}function P2(n){const e={},o=r(n,["voiceConfig"]);o!=null&&u(e,["voiceConfig"],mg(o));const l=r(n,["multiSpeakerVoiceConfig"]);l!=null&&u(e,["multiSpeakerVoiceConfig"],L2(l));const s=r(n,["languageCode"]);return s!=null&&u(e,["languageCode"],s),e}function z2(n){const e={},o=r(n,["fps"]);o!=null&&u(e,["fps"],o);const l=r(n,["endOffset"]);l!=null&&u(e,["endOffset"],l);const s=r(n,["startOffset"]);return s!=null&&u(e,["startOffset"],s),e}function B2(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["data"]);o!=null&&u(e,["data"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function V2(n){const e={};if(r(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(n,["fileUri"]);o!=null&&u(e,["fileUri"],o);const l=r(n,["mimeType"]);return l!=null&&u(e,["mimeType"],l),e}function H2(n){const e={},o=r(n,["videoMetadata"]);o!=null&&u(e,["videoMetadata"],z2(o));const l=r(n,["thought"]);l!=null&&u(e,["thought"],l);const s=r(n,["inlineData"]);s!=null&&u(e,["inlineData"],B2(s));const c=r(n,["fileData"]);c!=null&&u(e,["fileData"],V2(c));const d=r(n,["thoughtSignature"]);d!=null&&u(e,["thoughtSignature"],d);const m=r(n,["codeExecutionResult"]);m!=null&&u(e,["codeExecutionResult"],m);const g=r(n,["executableCode"]);g!=null&&u(e,["executableCode"],g);const h=r(n,["functionCall"]);h!=null&&u(e,["functionCall"],h);const v=r(n,["functionResponse"]);v!=null&&u(e,["functionResponse"],v);const T=r(n,["text"]);return T!=null&&u(e,["text"],T),e}function G2(n){const e={},o=r(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>H2(c))),u(e,["parts"],s)}const l=r(n,["role"]);return l!=null&&u(e,["role"],l),e}function q2(n){const e={},o=r(n,["behavior"]);o!=null&&u(e,["behavior"],o);const l=r(n,["description"]);l!=null&&u(e,["description"],l);const s=r(n,["name"]);s!=null&&u(e,["name"],s);const c=r(n,["parameters"]);c!=null&&u(e,["parameters"],c);const d=r(n,["parametersJsonSchema"]);d!=null&&u(e,["parametersJsonSchema"],d);const m=r(n,["response"]);m!=null&&u(e,["response"],m);const g=r(n,["responseJsonSchema"]);return g!=null&&u(e,["responseJsonSchema"],g),e}function F2(n){const e={},o=r(n,["startTime"]);o!=null&&u(e,["startTime"],o);const l=r(n,["endTime"]);return l!=null&&u(e,["endTime"],l),e}function O2(n){const e={},o=r(n,["timeRangeFilter"]);if(o!=null&&u(e,["timeRangeFilter"],F2(o)),r(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");return e}function Y2(n){const e={},o=r(n,["mode"]);o!=null&&u(e,["mode"],o);const l=r(n,["dynamicThreshold"]);return l!=null&&u(e,["dynamicThreshold"],l),e}function J2(n){const e={},o=r(n,["dynamicRetrievalConfig"]);return o!=null&&u(e,["dynamicRetrievalConfig"],Y2(o)),e}function K2(){return{}}function Z2(n){const e={},o=r(n,["environment"]);return o!=null&&u(e,["environment"],o),e}function X2(n){const e={},o=r(n,["functionDeclarations"]);if(o!=null){let g=o;Array.isArray(g)&&(g=g.map(h=>q2(h))),u(e,["functionDeclarations"],g)}if(r(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const l=r(n,["googleSearch"]);l!=null&&u(e,["googleSearch"],O2(l));const s=r(n,["googleSearchRetrieval"]);if(s!=null&&u(e,["googleSearchRetrieval"],J2(s)),r(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");if(r(n,["googleMaps"])!==void 0)throw new Error("googleMaps parameter is not supported in Gemini API.");r(n,["urlContext"])!=null&&u(e,["urlContext"],K2());const d=r(n,["computerUse"]);d!=null&&u(e,["computerUse"],Z2(d));const m=r(n,["codeExecution"]);return m!=null&&u(e,["codeExecution"],m),e}function Q2(n){const e={},o=r(n,["handle"]);if(o!=null&&u(e,["handle"],o),r(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return e}function _p(){return{}}function $2(n){const e={},o=r(n,["disabled"]);o!=null&&u(e,["disabled"],o);const l=r(n,["startOfSpeechSensitivity"]);l!=null&&u(e,["startOfSpeechSensitivity"],l);const s=r(n,["endOfSpeechSensitivity"]);s!=null&&u(e,["endOfSpeechSensitivity"],s);const c=r(n,["prefixPaddingMs"]);c!=null&&u(e,["prefixPaddingMs"],c);const d=r(n,["silenceDurationMs"]);return d!=null&&u(e,["silenceDurationMs"],d),e}function W2(n){const e={},o=r(n,["automaticActivityDetection"]);o!=null&&u(e,["automaticActivityDetection"],$2(o));const l=r(n,["activityHandling"]);l!=null&&u(e,["activityHandling"],l);const s=r(n,["turnCoverage"]);return s!=null&&u(e,["turnCoverage"],s),e}function j2(n){const e={},o=r(n,["targetTokens"]);return o!=null&&u(e,["targetTokens"],o),e}function eM(n){const e={},o=r(n,["triggerTokens"]);o!=null&&u(e,["triggerTokens"],o);const l=r(n,["slidingWindow"]);return l!=null&&u(e,["slidingWindow"],j2(l)),e}function tM(n){const e={},o=r(n,["proactiveAudio"]);return o!=null&&u(e,["proactiveAudio"],o),e}function nM(n,e){const o={},l=r(n,["generationConfig"]);e!==void 0&&l!=null&&u(e,["setup","generationConfig"],l);const s=r(n,["responseModalities"]);e!==void 0&&s!=null&&u(e,["setup","generationConfig","responseModalities"],s);const c=r(n,["temperature"]);e!==void 0&&c!=null&&u(e,["setup","generationConfig","temperature"],c);const d=r(n,["topP"]);e!==void 0&&d!=null&&u(e,["setup","generationConfig","topP"],d);const m=r(n,["topK"]);e!==void 0&&m!=null&&u(e,["setup","generationConfig","topK"],m);const g=r(n,["maxOutputTokens"]);e!==void 0&&g!=null&&u(e,["setup","generationConfig","maxOutputTokens"],g);const h=r(n,["mediaResolution"]);e!==void 0&&h!=null&&u(e,["setup","generationConfig","mediaResolution"],h);const v=r(n,["seed"]);e!==void 0&&v!=null&&u(e,["setup","generationConfig","seed"],v);const T=r(n,["speechConfig"]);e!==void 0&&T!=null&&u(e,["setup","generationConfig","speechConfig"],P2(Qu(T)));const _=r(n,["enableAffectiveDialog"]);e!==void 0&&_!=null&&u(e,["setup","generationConfig","enableAffectiveDialog"],_);const C=r(n,["systemInstruction"]);e!==void 0&&C!=null&&u(e,["setup","systemInstruction"],G2(Et(C)));const M=r(n,["tools"]);if(e!==void 0&&M!=null){let k=_o(M);Array.isArray(k)&&(k=k.map(X=>X2(To(X)))),u(e,["setup","tools"],k)}const S=r(n,["sessionResumption"]);e!==void 0&&S!=null&&u(e,["setup","sessionResumption"],Q2(S));const R=r(n,["inputAudioTranscription"]);e!==void 0&&R!=null&&u(e,["setup","inputAudioTranscription"],_p());const x=r(n,["outputAudioTranscription"]);e!==void 0&&x!=null&&u(e,["setup","outputAudioTranscription"],_p());const b=r(n,["realtimeInputConfig"]);e!==void 0&&b!=null&&u(e,["setup","realtimeInputConfig"],W2(b));const N=r(n,["contextWindowCompression"]);e!==void 0&&N!=null&&u(e,["setup","contextWindowCompression"],eM(N));const z=r(n,["proactivity"]);return e!==void 0&&z!=null&&u(e,["setup","proactivity"],tM(z)),o}function iM(n,e){const o={},l=r(e,["model"]);l!=null&&u(o,["setup","model"],Fe(n,l));const s=r(e,["config"]);return s!=null&&u(o,["config"],nM(s,o)),o}function oM(n,e,o){const l={},s=r(e,["expireTime"]);o!==void 0&&s!=null&&u(o,["expireTime"],s);const c=r(e,["newSessionExpireTime"]);o!==void 0&&c!=null&&u(o,["newSessionExpireTime"],c);const d=r(e,["uses"]);o!==void 0&&d!=null&&u(o,["uses"],d);const m=r(e,["liveConnectConstraints"]);o!==void 0&&m!=null&&u(o,["bidiGenerateContentSetup"],iM(n,m));const g=r(e,["lockAdditionalFields"]);return o!==void 0&&g!=null&&u(o,["fieldMask"],g),l}function lM(n,e){const o={},l=r(e,["config"]);return l!=null&&u(o,["config"],oM(n,l,o)),o}function aM(n){const e={},o=r(n,["name"]);return o!=null&&u(e,["name"],o),e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rM(n){const e=[];for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)){const l=n[o];if(typeof l=="object"&&l!=null&&Object.keys(l).length>0){const s=Object.keys(l).map(c=>`${o}.${c}`);e.push(...s)}else e.push(o)}return e.join(",")}function sM(n,e){let o=null;const l=n.bidiGenerateContentSetup;if(typeof l=="object"&&l!==null&&"setup"in l){const c=l.setup;typeof c=="object"&&c!==null?(n.bidiGenerateContentSetup=c,o=c):delete n.bidiGenerateContentSetup}else l!==void 0&&delete n.bidiGenerateContentSetup;const s=n.fieldMask;if(o){const c=rM(o);if(Array.isArray(e==null?void 0:e.lockAdditionalFields)&&(e==null?void 0:e.lockAdditionalFields.length)===0)c?n.fieldMask=c:delete n.fieldMask;else if(e!=null&&e.lockAdditionalFields&&e.lockAdditionalFields.length>0&&s!==null&&Array.isArray(s)&&s.length>0){const d=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let m=[];s.length>0&&(m=s.map(h=>d.includes(h)?`generationConfig.${h}`:h));const g=[];c&&g.push(c),m.length>0&&g.push(...m),g.length>0?n.fieldMask=g.join(","):delete n.fieldMask}else delete n.fieldMask}else s!==null&&Array.isArray(s)&&s.length>0?n.fieldMask=s.join(","):delete n.fieldMask;return n}class uM extends Ai{constructor(e){super(),this.apiClient=e}async create(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const m=lM(this.apiClient,e);c=xe("auth_tokens",m._url),d=m._query,delete m.config,delete m._url,delete m._query;const g=sM(m,e.config);return s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(h=>h.json()),s.then(h=>aM(h))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function fM(n){const e={},o=r(n,["name"]);o!=null&&u(e,["_url","name"],o);const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function cM(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);e!==void 0&&s!=null&&u(e,["_query","pageToken"],s);const c=r(n,["filter"]);return e!==void 0&&c!=null&&u(e,["_query","filter"],c),o}function dM(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],cM(o,e)),e}function hM(n){const e={},o=r(n,["textInput"]);o!=null&&u(e,["textInput"],o);const l=r(n,["output"]);return l!=null&&u(e,["output"],l),e}function mM(n){const e={};if(r(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(r(n,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const o=r(n,["examples"]);if(o!=null){let l=o;Array.isArray(l)&&(l=l.map(s=>hM(s))),u(e,["examples","examples"],l)}return e}function pM(n,e){const o={};if(r(n,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const l=r(n,["tunedModelDisplayName"]);if(e!==void 0&&l!=null&&u(e,["displayName"],l),r(n,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const s=r(n,["epochCount"]);e!==void 0&&s!=null&&u(e,["tuningTask","hyperparameters","epochCount"],s);const c=r(n,["learningRateMultiplier"]);if(c!=null&&u(o,["tuningTask","hyperparameters","learningRateMultiplier"],c),r(n,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(r(n,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(r(n,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");const d=r(n,["batchSize"]);e!==void 0&&d!=null&&u(e,["tuningTask","hyperparameters","batchSize"],d);const m=r(n,["learningRate"]);return e!==void 0&&m!=null&&u(e,["tuningTask","hyperparameters","learningRate"],m),o}function gM(n){const e={},o=r(n,["baseModel"]);o!=null&&u(e,["baseModel"],o);const l=r(n,["preTunedModel"]);l!=null&&u(e,["preTunedModel"],l);const s=r(n,["trainingDataset"]);s!=null&&u(e,["tuningTask","trainingData"],mM(s));const c=r(n,["config"]);return c!=null&&u(e,["config"],pM(c,e)),e}function yM(n){const e={},o=r(n,["name"]);o!=null&&u(e,["_url","name"],o);const l=r(n,["config"]);return l!=null&&u(e,["config"],l),e}function vM(n,e){const o={},l=r(n,["pageSize"]);e!==void 0&&l!=null&&u(e,["_query","pageSize"],l);const s=r(n,["pageToken"]);e!==void 0&&s!=null&&u(e,["_query","pageToken"],s);const c=r(n,["filter"]);return e!==void 0&&c!=null&&u(e,["_query","filter"],c),o}function TM(n){const e={},o=r(n,["config"]);return o!=null&&u(e,["config"],vM(o,e)),e}function _M(n,e){const o={},l=r(n,["gcsUri"]);e!==void 0&&l!=null&&u(e,["supervisedTuningSpec","trainingDatasetUri"],l);const s=r(n,["vertexDatasetResource"]);if(e!==void 0&&s!=null&&u(e,["supervisedTuningSpec","trainingDatasetUri"],s),r(n,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return o}function CM(n,e){const o={},l=r(n,["gcsUri"]);l!=null&&u(o,["validationDatasetUri"],l);const s=r(n,["vertexDatasetResource"]);return e!==void 0&&s!=null&&u(e,["supervisedTuningSpec","trainingDatasetUri"],s),o}function SM(n,e){const o={},l=r(n,["validationDataset"]);e!==void 0&&l!=null&&u(e,["supervisedTuningSpec"],CM(l,o));const s=r(n,["tunedModelDisplayName"]);e!==void 0&&s!=null&&u(e,["tunedModelDisplayName"],s);const c=r(n,["description"]);e!==void 0&&c!=null&&u(e,["description"],c);const d=r(n,["epochCount"]);e!==void 0&&d!=null&&u(e,["supervisedTuningSpec","hyperParameters","epochCount"],d);const m=r(n,["learningRateMultiplier"]);e!==void 0&&m!=null&&u(e,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],m);const g=r(n,["exportLastCheckpointOnly"]);e!==void 0&&g!=null&&u(e,["supervisedTuningSpec","exportLastCheckpointOnly"],g);const h=r(n,["preTunedModelCheckpointId"]);h!=null&&u(o,["preTunedModel","checkpointId"],h);const v=r(n,["adapterSize"]);if(e!==void 0&&v!=null&&u(e,["supervisedTuningSpec","hyperParameters","adapterSize"],v),r(n,["batchSize"])!==void 0)throw new Error("batchSize parameter is not supported in Vertex AI.");if(r(n,["learningRate"])!==void 0)throw new Error("learningRate parameter is not supported in Vertex AI.");return o}function EM(n){const e={},o=r(n,["baseModel"]);o!=null&&u(e,["baseModel"],o);const l=r(n,["preTunedModel"]);l!=null&&u(e,["preTunedModel"],l);const s=r(n,["trainingDataset"]);s!=null&&u(e,["supervisedTuningSpec","trainingDatasetUri"],_M(s,e));const c=r(n,["config"]);return c!=null&&u(e,["config"],SM(c,e)),e}function AM(n){const e={},o=r(n,["name"]);o!=null&&u(e,["model"],o);const l=r(n,["name"]);return l!=null&&u(e,["endpoint"],l),e}function pg(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["state"]);s!=null&&u(e,["state"],Yp(s));const c=r(n,["createTime"]);c!=null&&u(e,["createTime"],c);const d=r(n,["tuningTask","startTime"]);d!=null&&u(e,["startTime"],d);const m=r(n,["tuningTask","completeTime"]);m!=null&&u(e,["endTime"],m);const g=r(n,["updateTime"]);g!=null&&u(e,["updateTime"],g);const h=r(n,["description"]);h!=null&&u(e,["description"],h);const v=r(n,["baseModel"]);v!=null&&u(e,["baseModel"],v);const T=r(n,["_self"]);T!=null&&u(e,["tunedModel"],AM(T));const _=r(n,["customBaseModel"]);_!=null&&u(e,["customBaseModel"],_);const C=r(n,["experiment"]);C!=null&&u(e,["experiment"],C);const M=r(n,["labels"]);M!=null&&u(e,["labels"],M);const S=r(n,["outputUri"]);S!=null&&u(e,["outputUri"],S);const R=r(n,["pipelineJob"]);R!=null&&u(e,["pipelineJob"],R);const x=r(n,["serviceAccount"]);x!=null&&u(e,["serviceAccount"],x);const b=r(n,["tunedModelDisplayName"]);return b!=null&&u(e,["tunedModelDisplayName"],b),e}function xM(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["tunedModels"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>pg(d))),u(e,["tuningJobs"],c)}return e}function MM(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["metadata"]);s!=null&&u(e,["metadata"],s);const c=r(n,["done"]);c!=null&&u(e,["done"],c);const d=r(n,["error"]);return d!=null&&u(e,["error"],d),e}function RM(n){const e={},o=r(n,["checkpointId"]);o!=null&&u(e,["checkpointId"],o);const l=r(n,["epoch"]);l!=null&&u(e,["epoch"],l);const s=r(n,["step"]);s!=null&&u(e,["step"],s);const c=r(n,["endpoint"]);return c!=null&&u(e,["endpoint"],c),e}function wM(n){const e={},o=r(n,["model"]);o!=null&&u(e,["model"],o);const l=r(n,["endpoint"]);l!=null&&u(e,["endpoint"],l);const s=r(n,["checkpoints"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>RM(d))),u(e,["checkpoints"],c)}return e}function Vu(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["name"]);l!=null&&u(e,["name"],l);const s=r(n,["state"]);s!=null&&u(e,["state"],Yp(s));const c=r(n,["createTime"]);c!=null&&u(e,["createTime"],c);const d=r(n,["startTime"]);d!=null&&u(e,["startTime"],d);const m=r(n,["endTime"]);m!=null&&u(e,["endTime"],m);const g=r(n,["updateTime"]);g!=null&&u(e,["updateTime"],g);const h=r(n,["error"]);h!=null&&u(e,["error"],h);const v=r(n,["description"]);v!=null&&u(e,["description"],v);const T=r(n,["baseModel"]);T!=null&&u(e,["baseModel"],T);const _=r(n,["tunedModel"]);_!=null&&u(e,["tunedModel"],wM(_));const C=r(n,["preTunedModel"]);C!=null&&u(e,["preTunedModel"],C);const M=r(n,["supervisedTuningSpec"]);M!=null&&u(e,["supervisedTuningSpec"],M);const S=r(n,["tuningDataStats"]);S!=null&&u(e,["tuningDataStats"],S);const R=r(n,["encryptionSpec"]);R!=null&&u(e,["encryptionSpec"],R);const x=r(n,["partnerModelTuningSpec"]);x!=null&&u(e,["partnerModelTuningSpec"],x);const b=r(n,["customBaseModel"]);b!=null&&u(e,["customBaseModel"],b);const N=r(n,["experiment"]);N!=null&&u(e,["experiment"],N);const z=r(n,["labels"]);z!=null&&u(e,["labels"],z);const k=r(n,["outputUri"]);k!=null&&u(e,["outputUri"],k);const X=r(n,["pipelineJob"]);X!=null&&u(e,["pipelineJob"],X);const Y=r(n,["serviceAccount"]);Y!=null&&u(e,["serviceAccount"],Y);const oe=r(n,["tunedModelDisplayName"]);return oe!=null&&u(e,["tunedModelDisplayName"],oe),e}function bM(n){const e={},o=r(n,["sdkHttpResponse"]);o!=null&&u(e,["sdkHttpResponse"],o);const l=r(n,["nextPageToken"]);l!=null&&u(e,["nextPageToken"],l);const s=r(n,["tuningJobs"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(d=>Vu(d))),u(e,["tuningJobs"],c)}return e}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class DM extends Ai{constructor(e){super(),this.apiClient=e,this.get=async o=>await this.getInternal(o),this.list=async(o={})=>new Rl(Ci.PAGED_ITEM_TUNING_JOBS,l=>this.listInternal(l),await this.listInternal(o),o),this.tune=async o=>{if(this.apiClient.isVertexAI())if(o.baseModel.startsWith("projects/")){const l={tunedModelName:o.baseModel},s=Object.assign(Object.assign({},o),{preTunedModel:l});return s.baseModel=void 0,await this.tuneInternal(s)}else{const l=Object.assign({},o);return await this.tuneInternal(l)}else{const l=Object.assign({},o),s=await this.tuneMldevInternal(l);let c="";return s.metadata!==void 0&&s.metadata.tunedModel!==void 0?c=s.metadata.tunedModel:s.name!==void 0&&s.name.includes("/operations/")&&(c=s.name.split("/operations/")[0]),{name:c,state:Du.JOB_STATE_QUEUED}}}}async getInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=yM(e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>Vu(v))}else{const h=fM(e);return m=xe("{name}",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>pg(v))}}async listInternal(e){var o,l,s,c;let d,m="",g={};if(this.apiClient.isVertexAI()){const h=TM(e);return m=xe("tuningJobs",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=bM(v),_=new Xm;return Object.assign(_,T),_})}else{const h=dM(e);return m=xe("tunedModels",h._url),g=h._query,delete h.config,delete h._url,delete h._query,d=this.apiClient.request({path:m,queryParams:g,body:JSON.stringify(h),httpMethod:"GET",httpOptions:(s=e.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=e.config)===null||c===void 0?void 0:c.abortSignal}).then(v=>v.json().then(T=>{const _=T;return _.sdkHttpResponse={headers:v.headers},_})),d.then(v=>{const T=xM(v),_=new Xm;return Object.assign(_,T),_})}}async tuneInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI()){const m=EM(e);return c=xe("tuningJobs",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json().then(h=>{const v=h;return v.sdkHttpResponse={headers:g.headers},v})),s.then(g=>Vu(g))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(e){var o,l;let s,c="",d={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const m=gM(e);return c=xe("tunedModels",m._url),d=m._query,delete m.config,delete m._url,delete m._query,s=this.apiClient.request({path:c,queryParams:d,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=e.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(l=e.config)===null||l===void 0?void 0:l.abortSignal}).then(g=>g.json().then(h=>{const v=h;return v.sdkHttpResponse={headers:g.headers},v})),s.then(g=>MM(g))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class NM{async download(e,o){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const IM=1024*1024*8,UM=3,kM=1e3,LM=2,xu="x-goog-upload-status";async function PM(n,e,o){var l,s,c;let d=0,m=0,g=new Nu(new Response),h="upload";for(d=n.size;m<d;){const T=Math.min(IM,d-m),_=n.slice(m,m+T);m+T>=d&&(h+=", finalize");let C=0,M=kM;for(;C<UM&&(g=await o.request({path:"",body:_,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:e,headers:{"X-Goog-Upload-Command":h,"X-Goog-Upload-Offset":String(m),"Content-Length":String(T)}}}),!(!((l=g==null?void 0:g.headers)===null||l===void 0)&&l[xu]));)C++,await BM(M),M=M*LM;if(m+=T,((s=g==null?void 0:g.headers)===null||s===void 0?void 0:s[xu])!=="active")break;if(d<=m)throw new Error("All content has been uploaded, but the upload status is not finalized.")}const v=await(g==null?void 0:g.json());if(((c=g==null?void 0:g.headers)===null||c===void 0?void 0:c[xu])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return v.file}async function zM(n){return{size:n.size,type:n.type}}function BM(n){return new Promise(e=>setTimeout(e,n))}class VM{async upload(e,o,l){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await PM(e,o,l)}async stat(e){if(typeof e=="string")throw new Error("File path is not supported in browser uploader.");return await zM(e)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class HM{create(e,o,l){return new GM(e,o,l)}}class GM{constructor(e,o,l){this.url=e,this.headers=o,this.callbacks=l}connect(){this.ws=new WebSocket(this.url),this.ws.onopen=this.callbacks.onopen,this.ws.onerror=this.callbacks.onerror,this.ws.onclose=this.callbacks.onclose,this.ws.onmessage=this.callbacks.onmessage}send(e){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(e)}close(){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.close()}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Cp="x-goog-api-key";class qM{constructor(e){this.apiKey=e}async addAuthHeaders(e){if(e.get(Cp)===null){if(this.apiKey.startsWith("auth_tokens/"))throw new Error("Ephemeral tokens are only supported by the live API.");if(!this.apiKey)throw new Error("API key is missing. Please provide a valid API key.");e.append(Cp,this.apiKey)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const FM="gl-node/";class OM{constructor(e){var o;if(e.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(e.project||e.location)throw new Error("Vertex AI project based authentication is not supported on browser runtimes. Please do not provide a project or location.");this.vertexai=(o=e.vertexai)!==null&&o!==void 0?o:!1,this.apiKey=e.apiKey;const l=MT(e.httpOptions,e.vertexai,void 0,void 0);l&&(e.httpOptions?e.httpOptions.baseUrl=l:e.httpOptions={baseUrl:l}),this.apiVersion=e.apiVersion;const s=new qM(this.apiKey);this.apiClient=new s2({auth:s,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:e.httpOptions,userAgentExtra:FM+"web",uploader:new VM,downloader:new NM}),this.models=new w2(this.apiClient),this.live=new C2(this.apiClient,s,new HM),this.batches=new $_(this.apiClient),this.chats=new iS(this.models,this.apiClient),this.caches=new eS(this.apiClient),this.files=new gS(this.apiClient),this.operations=new I2(this.apiClient),this.authTokens=new uM(this.apiClient),this.tunings=new DM(this.apiClient)}}const YM=`You are a world-class web developer and educational content creator. Your task is to generate a JSON object containing two properties: "html" and "readme".

1.  **"html" property**:
    -   This should be a string containing a complete, self-contained, offline-first single-file HTML5 interactive educational content.
    -   All CSS and JavaScript must be embedded within the HTML file using <style> and <script> tags. No external libraries or network requests are allowed.
    -   The interactive must be designed to fit within an iframe environment (width: 100%, height: 450px or 90vh, body margin/padding: 0).
    -   The design should be clean, modern, and intuitive for both touch and mouse interactions.
    -   Use Singapore curriculum and notations where applicable.
    -   Do not include a header text to save vertical space; use tooltips for titles if needed.
    -   The HTML must include a footer.
    -   The HTML must include a Google Analytics tracking script in the <head>.

2.  **"readme" property**:
    -   This should be a string containing well-structured Markdown content for a "readMe.md" file.
    -   The README should explain the purpose of the interactive, the educational theories or concepts it's based on, and suggested pedagogical strategies for teachers to use it effectively in a classroom setting.

Your entire response must be a single, valid JSON object, and nothing else. Do not wrap it in markdown backticks.
`,Sp=()=>{try{const n=localStorage.getItem("apiKeys");if(n){const e=JSON.parse(n);return{openAI:e.openAI||"",claude:e.claude||""}}}catch(n){console.error("Failed to load API keys from localStorage:",n)}return{openAI:"",claude:""}},JM=async(n,e,o,l,s,c,d,m,g,h,v)=>{switch(o){case"gemini":{const T=new OM({apiKey:"AIzaSyBKCKbrJuE9oW6dh3bvZDjr3GDPURAGQtw"});let _;m&&g?_=`
                    You are refining an existing interactive HTML file.
                    Your task is to modify the provided HTML based on the user's new instructions and generate an updated JSON object containing the new "html" and an updated "readme".
                    
                    USER'S REFINEMENT INSTRUCTIONS:
                    ---
                    ${g}
                    ---

                    PREVIOUS HTML CODE TO REFINE:
                    ---
                    ${m}
                    ---

                    Please apply the changes and ensure the new HTML remains a single, self-contained file.
                    Also, update the "readme" markdown to reflect the changes made to the interactive.
                    Maintain the footer and Google Analytics script as they were, with the author "${c}" and URL "${d}".
                `:_=`
                    Recipe Type: ${n.title}

                    User Instructions:
                    ---
                    ${e}
                    ---

                    Additional Requirements for the HTML:
                    - Add this Google Analytics script inside the <head> tag:
                    <script async="true" src="https://www.googletagmanager.com/gtag/js?id=G-S9EWRY1CPJ"><\/script>
                    <script>
                      window.dataLayer = window.dataLayer || [];
                      function gtag(){dataLayer.push(arguments);}
                      gtag('js', new Date());
                      gtag('config', 'G-S9EWRY1CPJ');
                    <\/script>

                    - Add this footer to the bottom of the HTML body. Style it to be subtle, dark-themed, and not intrusive (e.g., small, centered, gray text):
                    <footer>
                      <p>Made by ${c}, using Gemini 2.5 Pro. For more resources, visit: <a href="${d}" target="_blank" style="color: inherit;">${d}</a></p>
                    </footer>
                `;try{const C=[{text:_}];l&&s&&C.push({inlineData:{mimeType:s,data:l}}),h&&v&&C.push({inlineData:{mimeType:v,data:h}});const M=C.length>1?{parts:C}:_,S=await T.models.generateContent({model:"gemini-2.5-flash",contents:M,config:{systemInstruction:YM,responseMimeType:"application/json"}});if(!S||!S.text)throw console.error("Empty or invalid response from Gemini API:",S),new Error("The AI model returned an empty response. Please try again.");let R=S.text.trim();const x=R.indexOf("{"),b=R.lastIndexOf("}");if(x===-1||b===-1||b<x)throw console.error("Could not find a valid JSON object in the response:",R),new Error("The AI model returned data that does not appear to be a valid JSON object. Please try again.");R=R.substring(x,b+1);try{const N=JSON.parse(R);if(typeof N.html!="string"||typeof N.readme!="string")throw new Error("Invalid JSON structure received from AI. Missing 'html' or 'readme' properties.");if(!N.html||!N.html.toLowerCase().includes("<!doctype html>")&&!N.html.toLowerCase().includes("<html>"))throw console.error("Gemini response HTML part is invalid:",N.html),new Error("Failed to generate valid HTML content. The AI model returned an unexpected format. Please try again.");return N}catch(N){throw console.error("Failed to parse JSON response from Gemini:",R,N),new Error("The AI model returned data in an unexpected format. Please try again.")}}catch(C){throw console.error("Error calling Gemini API:",C),C instanceof Error?new Error(`An error occurred while generating the interactive content: ${C.message}`):new Error("An error occurred while generating the interactive content. The AI model may be temporarily unavailable or there could be an issue with the request.")}}case"openai":throw Sp().openAI?new Error("OpenAI generation is not yet implemented."):new Error("OpenAI API key not found. Please add it in the settings.");case"claude":throw Sp().claude?new Error("Anthropic Claude generation is not yet implemented."):new Error("Anthropic Claude API key not found. Please add it in the settings.");default:throw new Error(`Unsupported model selected: ${o}`)}},KM=n=>new Promise((e,o)=>{const l=new FileReader;l.onload=()=>e(l.result),l.onerror=o,l.readAsDataURL(n)}),ZM=()=>{const[n,e]=ae.useState(null),[o,l]=ae.useState(""),[s,c]=ae.useState(!1),[d,m]=ae.useState(null),[g,h]=ae.useState(null),[v,T]=ae.useState("gemini"),[_,C]=ae.useState({openAI:"",claude:""}),[M,S]=ae.useState(null),[R,x]=ae.useState(0),[b,N]=ae.useState(""),[z,k]=ae.useState("lookang"),[X,Y]=ae.useState("https://sg.iwant2study.org/ospsg/"),[oe,q]=ae.useState(""),[re,ye]=ae.useState(null);ae.useEffect(()=>{try{const I=localStorage.getItem("apiKeys");if(I){const P=JSON.parse(I);C({openAI:P.openAI||"",claude:P.claude||""})}}catch(I){console.error("Failed to load API keys from localStorage:",I)}},[]);const B=ae.useCallback(I=>{e(I),l(I.promptTemplate),h(null),m(null),S(null),q(""),ye(null)},[]),le=I=>{if(I.target.files&&I.target.files[0]){const P=I.target.files[0];S(P)}},w=I=>{if(I.target.files&&I.target.files[0]){const P=I.target.files[0];ye(P)}},te=async I=>{if(!I)return{base64:null,mimeType:null};try{const P=await KM(I),[H,ie]=P.split(","),se=H.match(/:(.*?);/);if(!se||!se[1]||!ie)throw new Error("Invalid image file format.");return{base64:ie,mimeType:se[1]}}catch(P){const H=P instanceof Error?P.message:"An unknown error occurred";throw m(`Failed to process image: ${H}`),P}},J=async(I,P=null)=>{c(!0),m(null),x(0);const H=I?["Analyzing refinement request...","Applying your changes...","Re-generating interactive code...","Updating README documentation...","Finalizing new version..."]:["Connecting to AI model...","Analyzing your request...","Designing the interactive layout...","Generating HTML structure...","Writing pedagogical README file...","Styling with CSS...","Adding JavaScript for interactivity...","Finalizing and packaging the interactive...","Almost there..."];let ie=0;N(H[ie]);const se=setInterval(()=>{x(Ce=>Math.min(Ce+Math.floor(Math.random()*5)+1,95))},400),he=setInterval(()=>{ie=ie+1,ie<H.length&&N(H[ie])},2e3);try{const{base64:Ce,mimeType:He}=await te(M),{base64:Ae,mimeType:Ie}=await te(re),tt=await JM(n,o,v,Ce,He,z,X,P,I?oe:null,Ae,Ie);h(tt),I&&(q(""),ye(null))}catch(Ce){Ce instanceof Error&&!Ce.message.includes("process image")?m(Ce.message):Ce instanceof Error||m("An unknown error occurred.")}finally{clearInterval(se),clearInterval(he),x(100),c(!1)}},K=async()=>{if(!n||!o){m("Please select a recipe and provide a prompt.");return}if(v!=="gemini"&&fe){m("API key for the selected model is missing. Please add it in Settings.");return}if(n.id==="image-to-interactive"&&!M){m("Please upload an image for this interactive type.");return}h(null),await J(!1)},ve=async()=>{if(!oe&&!re){m("Please provide instructions or an image to refine the interactive.");return}g!=null&&g.html&&await J(!0,g.html)},fe=v==="openai"&&!_.openAI||v==="claude"&&!_.claude;return $.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-4 lg:gap-8 h-full",children:[$.jsxs("div",{className:"flex flex-col gap-4 lg:gap-6 overflow-y-auto max-h-screen lg:max-h-none",children:[$.jsxs("div",{children:[$.jsx("h2",{className:"text-xl font-semibold mb-3 text-gray-200",children:"1. Choose an Interactive Type"}),$.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 gap-4",children:gT.map(I=>$.jsx(yT,{recipe:I,isSelected:(n==null?void 0:n.id)===I.id,onSelect:B},I.id))})]}),n&&$.jsxs($.Fragment,{children:[$.jsxs("div",{className:"flex flex-col gap-3",children:[$.jsx("h2",{className:"text-xl font-semibold text-gray-200",children:"2. Describe Your Interactive"}),$.jsx("textarea",{className:"w-full p-3 bg-gray-800 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none transition-shadow resize-none",value:o,onChange:I=>l(I.target.value),placeholder:"Provide detailed instructions here...",rows:8})]}),$.jsxs("div",{className:"flex flex-col gap-3",children:[$.jsx("h2",{className:"text-xl font-semibold text-gray-200",children:"2a. Upload an Image (Optional)"}),M?$.jsxs("div",{className:"p-3 bg-gray-700 border border-gray-600 rounded-md flex items-center justify-between",children:[$.jsx("span",{className:"text-gray-200 truncate pr-2",children:M.name}),$.jsx("button",{onClick:()=>S(null),className:"text-gray-400 hover:text-white font-bold text-lg flex-shrink-0","aria-label":"Remove image",children:"×"})]}):$.jsxs("div",{className:"relative border-2 border-dashed border-gray-600 rounded-lg p-6 text-center hover:border-primary transition-colors",children:[$.jsx("input",{type:"file",accept:"image/png, image/jpeg",onChange:le,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",id:"image-upload"}),$.jsxs("label",{htmlFor:"image-upload",className:"flex flex-col items-center justify-center space-y-2 cursor-pointer",children:[$.jsx("svg",{className:"w-10 h-10 text-gray-400",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:$.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16l4.586-4.586a2 2 0 012.828 0L16 16m-2-2l1.586-1.586a2 2 0 012.828 0L20 14m-6-6h.01M6 20h12a2 2 0 002-2V6a2 2 0 00-2-2H6a2 2 0 00-2 2v12a2 2 0 002 2z"})}),$.jsx("span",{className:"font-medium text-gray-200",children:"Click to upload"}),$.jsx("span",{className:"text-sm text-gray-400",children:"PNG or JPG"})]})]})]}),$.jsxs("div",{className:"flex flex-col gap-3",children:[$.jsx("h2",{className:"text-xl font-semibold text-gray-200",children:"3. Choose a Generation Model"}),$.jsxs("select",{value:v,onChange:I=>T(I.target.value),className:"w-full p-3 bg-gray-800 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none transition-shadow",children:[$.jsx("option",{value:"gemini",children:"Google Gemini (Default)"}),$.jsx("option",{value:"openai",children:"OpenAI GPT-4"}),$.jsx("option",{value:"claude",children:"Anthropic Claude"})]}),fe&&$.jsxs("div",{className:"text-sm text-yellow-400 p-3 bg-yellow-900/50 border border-yellow-700 rounded-md",children:["API key for the selected model is missing. Please"," ",$.jsx(El,{to:"/settings",className:"font-bold underline hover:text-yellow-300",children:"add it in Settings"}),"."]})]}),$.jsxs("div",{className:"flex flex-col gap-3",children:[$.jsx("h2",{className:"text-xl font-semibold text-gray-200",children:"4. Customize Footer"}),$.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[$.jsxs("div",{children:[$.jsx("label",{htmlFor:"username",className:"block text-sm font-medium text-gray-400 mb-1",children:"Author Name"}),$.jsx("input",{type:"text",id:"username",value:z,onChange:I=>k(I.target.value),className:"w-full p-2 bg-gray-700 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none",placeholder:"e.g., lookang"})]}),$.jsxs("div",{children:[$.jsx("label",{htmlFor:"resourceURL",className:"block text-sm font-medium text-gray-400 mb-1",children:"Resource URL"}),$.jsx("input",{type:"url",id:"resourceURL",value:X,onChange:I=>Y(I.target.value),className:"w-full p-2 bg-gray-700 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none",placeholder:"https://your-resource-url.com"})]})]})]}),$.jsx("button",{onClick:K,disabled:s||fe,className:"w-full bg-primary hover:bg-primary-hover text-white font-bold py-3 px-4 rounded-md transition-all duration-200 disabled:bg-gray-600 disabled:cursor-not-allowed flex items-center justify-center",children:s?$.jsxs($.Fragment,{children:[$.jsxs("svg",{className:"animate-spin -ml-1 mr-3 h-5 w-5 text-white",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[$.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),$.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}),"Generating..."]}):"Generate Interactive"}),g&&!s&&$.jsxs("div",{className:"flex flex-col gap-6 pt-6 border-t-2 border-gray-700",children:[$.jsx("h2",{className:"text-xl font-semibold text-gray-200",children:"5. Refine Your Interactive"}),$.jsx("div",{className:"flex flex-col gap-3",children:$.jsx("textarea",{className:"w-full p-3 bg-gray-800 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none transition-shadow resize-none",value:oe,onChange:I=>q(I.target.value),placeholder:"e.g., Change the color of the cube to blue. Add a slider to control the light intensity.",rows:4})}),$.jsxs("div",{className:"flex flex-col gap-3",children:[$.jsx("h3",{className:"text-base font-semibold text-gray-300",children:"Upload new image (optional)"}),re?$.jsxs("div",{className:"p-3 bg-gray-700 border border-gray-600 rounded-md flex items-center justify-between",children:[$.jsx("span",{className:"text-gray-200 truncate pr-2",children:re.name}),$.jsx("button",{onClick:()=>ye(null),className:"text-gray-400 hover:text-white font-bold text-lg",children:"×"})]}):$.jsxs("div",{className:"relative border-2 border-dashed border-gray-600 rounded-lg p-4 text-center hover:border-green-500 transition-colors",children:[$.jsx("input",{type:"file",accept:"image/png, image/jpeg",onChange:w,className:"absolute inset-0 w-full h-full opacity-0 cursor-pointer",id:"refine-image-upload"}),$.jsx("label",{htmlFor:"refine-image-upload",className:"cursor-pointer text-sm text-gray-400",children:"Click to upload an image for refinement"})]})]}),$.jsx("button",{onClick:ve,disabled:s,className:"w-full bg-green-600 hover:bg-green-700 text-white font-bold py-3 px-4 rounded-md transition-all duration-200 disabled:bg-gray-600 disabled:cursor-not-allowed flex items-center justify-center",children:s?"Refining...":"Refine Interactive"})]})]})]}),$.jsxs("div",{className:"min-h-[400px] lg:min-h-0 lg:flex-grow bg-gray-800 rounded-md overflow-hidden relative border-2 border-gray-700",children:[d&&$.jsxs("div",{className:"absolute inset-0 bg-red-900/50 text-red-200 flex flex-col items-center justify-center p-8 z-10",children:[$.jsx("h3",{className:"font-bold text-lg mb-2",children:"Operation Failed"}),$.jsx("p",{className:"text-center",children:d}),$.jsx("button",{onClick:()=>m(null),className:"mt-4 bg-red-600 hover:bg-red-700 text-white font-bold py-2 px-4 rounded-md",children:"Close"})]}),$.jsx(ST,{htmlContent:(g==null?void 0:g.html)??null,readmeContent:(g==null?void 0:g.readme)??null,isLoading:s,isSelected:!!n,progress:R,statusMessage:b})]})]})},XM=()=>{const[n,e]=ae.useState({openAI:"",claude:""}),[o,l]=ae.useState("idle");ae.useEffect(()=>{try{const d=localStorage.getItem("apiKeys");if(d){const m=JSON.parse(d);e({openAI:m.openAI||"",claude:m.claude||""})}}catch(d){console.error("Failed to load API keys from localStorage:",d)}},[]);const s=d=>{const{name:m,value:g}=d.target;e(h=>({...h,[m]:g}))},c=()=>{try{localStorage.setItem("apiKeys",JSON.stringify(n)),l("saved"),setTimeout(()=>l("idle"),2e3)}catch(d){console.error("Failed to save API keys to localStorage:",d),l("error"),setTimeout(()=>l("idle"),2e3)}};return $.jsxs("div",{className:"max-w-2xl mx-auto",children:[$.jsx("h1",{className:"text-3xl font-bold mb-6 text-white",children:"API Settings"}),$.jsxs("div",{className:"bg-gray-800 p-8 rounded-lg shadow-lg border border-gray-700",children:[$.jsx("p",{className:"text-gray-400 mb-6",children:"Your API keys for other services are stored securely in your browser's local storage and are never sent to our servers. The Google Gemini API is configured automatically and does not require a key here."}),$.jsxs("div",{className:"space-y-6",children:[$.jsxs("div",{children:[$.jsx("label",{htmlFor:"openAI",className:"block text-sm font-medium text-gray-300 mb-2",children:"OpenAI API Key"}),$.jsx("input",{type:"password",id:"openAI",name:"openAI",value:n.openAI,onChange:s,className:"w-full p-2 bg-gray-700 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none",placeholder:"Enter your OpenAI API Key"})]}),$.jsxs("div",{children:[$.jsx("label",{htmlFor:"claude",className:"block text-sm font-medium text-gray-300 mb-2",children:"Anthropic Claude API Key"}),$.jsx("input",{type:"password",id:"claude",name:"claude",value:n.claude,onChange:s,className:"w-full p-2 bg-gray-700 border border-gray-600 rounded-md focus:ring-2 focus:ring-primary focus:outline-none",placeholder:"Enter your Claude API Key"})]})]}),$.jsxs("div",{className:"mt-8 flex items-center justify-end",children:[o==="saved"&&$.jsx("span",{className:"text-green-400 mr-4",children:"Settings saved!"}),o==="error"&&$.jsx("span",{className:"text-red-400 mr-4",children:"Failed to save."}),$.jsx("button",{onClick:c,className:"bg-primary hover:bg-primary-hover text-white font-bold py-2 px-6 rounded-md transition-colors",children:"Save"})]})]})]})},QM=()=>$.jsx(j0,{children:$.jsxs("div",{className:"flex flex-col h-screen",children:[$.jsx(fT,{}),$.jsx("main",{className:"flex-grow container mx-auto p-4 md:p-6 lg:p-8",children:$.jsxs(D0,{children:[$.jsx(Ru,{path:"/",element:$.jsx(ZM,{})}),$.jsx(Ru,{path:"/settings",element:$.jsx(XM,{})})]})})]})}),gg=document.getElementById("root");if(!gg)throw new Error("Could not find root element to mount to");const $M=Vv.createRoot(gg);$M.render($.jsx(Nv.StrictMode,{children:$.jsx(QM,{})}));
