function Iu(i){return i&&i.__esModule&&Object.prototype.hasOwnProperty.call(i,"default")?i.default:i}var tu={exports:{}},Ko={};/**
 * @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 Op;function t0(){if(Op)return Ko;Op=1;var i=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(a,u,f){var p=null;if(f!==void 0&&(p=""+f),u.key!==void 0&&(p=""+u.key),"key"in u){f={};for(var g in u)g!=="key"&&(f[g]=u[g])}else f=u;return u=f.ref,{$$typeof:i,type:a,key:p,ref:u!==void 0?u:null,props:f}}return Ko.Fragment=t,Ko.jsx=o,Ko.jsxs=o,Ko}var Fp;function n0(){return Fp||(Fp=1,tu.exports=t0()),tu.exports}var LR=n0(),nu={exports:{}},ie={};/**
 * @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 kp;function i0(){if(kp)return ie;kp=1;var i=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),f=Symbol.for("react.consumer"),p=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),v=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),_=Symbol.iterator;function A(M){return M===null||typeof M!="object"?null:(M=_&&M[_]||M["@@iterator"],typeof M=="function"?M:null)}var I={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},L=Object.assign,b={};function z(M,V,K){this.props=M,this.context=V,this.refs=b,this.updater=K||I}z.prototype.isReactComponent={},z.prototype.setState=function(M,V){if(typeof M!="object"&&typeof M!="function"&&M!=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,M,V,"setState")},z.prototype.forceUpdate=function(M){this.updater.enqueueForceUpdate(this,M,"forceUpdate")};function Q(){}Q.prototype=z.prototype;function O(M,V,K){this.props=M,this.context=V,this.refs=b,this.updater=K||I}var k=O.prototype=new Q;k.constructor=O,L(k,z.prototype),k.isPureReactComponent=!0;var j=Array.isArray;function B(){}var J={H:null,A:null,T:null,S:null},ue=Object.prototype.hasOwnProperty;function Z(M,V,K){var $=K.ref;return{$$typeof:i,type:M,key:V,ref:$!==void 0?$:null,props:K}}function re(M,V){return Z(M.type,V,M.props)}function Ee(M){return typeof M=="object"&&M!==null&&M.$$typeof===i}function Me(M){var V={"=":"=0",":":"=2"};return"$"+M.replace(/[=:]/g,function(K){return V[K]})}var xe=/\/+/g;function Ae(M,V){return typeof M=="object"&&M!==null&&M.key!=null?Me(""+M.key):V.toString(36)}function qe(M){switch(M.status){case"fulfilled":return M.value;case"rejected":throw M.reason;default:switch(typeof M.status=="string"?M.then(B,B):(M.status="pending",M.then(function(V){M.status==="pending"&&(M.status="fulfilled",M.value=V)},function(V){M.status==="pending"&&(M.status="rejected",M.reason=V)})),M.status){case"fulfilled":return M.value;case"rejected":throw M.reason}}throw M}function G(M,V,K,$,le){var ce=typeof M;(ce==="undefined"||ce==="boolean")&&(M=null);var Se=!1;if(M===null)Se=!0;else switch(ce){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(M.$$typeof){case i:case t:Se=!0;break;case v:return Se=M._init,G(Se(M._payload),V,K,$,le)}}if(Se)return le=le(M),Se=$===""?"."+Ae(M,0):$,j(le)?(K="",Se!=null&&(K=Se.replace(xe,"$&/")+"/"),G(le,V,K,"",function(ji){return ji})):le!=null&&(Ee(le)&&(le=re(le,K+(le.key==null||M&&M.key===le.key?"":(""+le.key).replace(xe,"$&/")+"/")+Se)),V.push(le)),1;Se=0;var it=$===""?".":$+":";if(j(M))for(var Ve=0;Ve<M.length;Ve++)$=M[Ve],ce=it+Ae($,Ve),Se+=G($,V,K,ce,le);else if(Ve=A(M),typeof Ve=="function")for(M=Ve.call(M),Ve=0;!($=M.next()).done;)$=$.value,ce=it+Ae($,Ve++),Se+=G($,V,K,ce,le);else if(ce==="object"){if(typeof M.then=="function")return G(qe(M),V,K,$,le);throw V=String(M),Error("Objects are not valid as a React child (found: "+(V==="[object Object]"?"object with keys {"+Object.keys(M).join(", ")+"}":V)+"). If you meant to render a collection of children, use an array instead.")}return Se}function F(M,V,K){if(M==null)return M;var $=[],le=0;return G(M,$,"","",function(ce){return V.call(K,ce,le++)}),$}function ee(M){if(M._status===-1){var V=M._result;V=V(),V.then(function(K){(M._status===0||M._status===-1)&&(M._status=1,M._result=K)},function(K){(M._status===0||M._status===-1)&&(M._status=2,M._result=K)}),M._status===-1&&(M._status=0,M._result=V)}if(M._status===1)return M._result.default;throw M._result}var ge=typeof reportError=="function"?reportError:function(M){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var V=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof M=="object"&&M!==null&&typeof M.message=="string"?String(M.message):String(M),error:M});if(!window.dispatchEvent(V))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",M);return}console.error(M)},Ue={map:F,forEach:function(M,V,K){F(M,function(){V.apply(this,arguments)},K)},count:function(M){var V=0;return F(M,function(){V++}),V},toArray:function(M){return F(M,function(V){return V})||[]},only:function(M){if(!Ee(M))throw Error("React.Children.only expected to receive a single React element child.");return M}};return ie.Activity=E,ie.Children=Ue,ie.Component=z,ie.Fragment=o,ie.Profiler=u,ie.PureComponent=O,ie.StrictMode=a,ie.Suspense=y,ie.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=J,ie.__COMPILER_RUNTIME={__proto__:null,c:function(M){return J.H.useMemoCache(M)}},ie.cache=function(M){return function(){return M.apply(null,arguments)}},ie.cacheSignal=function(){return null},ie.cloneElement=function(M,V,K){if(M==null)throw Error("The argument must be a React element, but you passed "+M+".");var $=L({},M.props),le=M.key;if(V!=null)for(ce in V.key!==void 0&&(le=""+V.key),V)!ue.call(V,ce)||ce==="key"||ce==="__self"||ce==="__source"||ce==="ref"&&V.ref===void 0||($[ce]=V[ce]);var ce=arguments.length-2;if(ce===1)$.children=K;else if(1<ce){for(var Se=Array(ce),it=0;it<ce;it++)Se[it]=arguments[it+2];$.children=Se}return Z(M.type,le,$)},ie.createContext=function(M){return M={$$typeof:p,_currentValue:M,_currentValue2:M,_threadCount:0,Provider:null,Consumer:null},M.Provider=M,M.Consumer={$$typeof:f,_context:M},M},ie.createElement=function(M,V,K){var $,le={},ce=null;if(V!=null)for($ in V.key!==void 0&&(ce=""+V.key),V)ue.call(V,$)&&$!=="key"&&$!=="__self"&&$!=="__source"&&(le[$]=V[$]);var Se=arguments.length-2;if(Se===1)le.children=K;else if(1<Se){for(var it=Array(Se),Ve=0;Ve<Se;Ve++)it[Ve]=arguments[Ve+2];le.children=it}if(M&&M.defaultProps)for($ in Se=M.defaultProps,Se)le[$]===void 0&&(le[$]=Se[$]);return Z(M,ce,le)},ie.createRef=function(){return{current:null}},ie.forwardRef=function(M){return{$$typeof:g,render:M}},ie.isValidElement=Ee,ie.lazy=function(M){return{$$typeof:v,_payload:{_status:-1,_result:M},_init:ee}},ie.memo=function(M,V){return{$$typeof:m,type:M,compare:V===void 0?null:V}},ie.startTransition=function(M){var V=J.T,K={};J.T=K;try{var $=M(),le=J.S;le!==null&&le(K,$),typeof $=="object"&&$!==null&&typeof $.then=="function"&&$.then(B,ge)}catch(ce){ge(ce)}finally{V!==null&&K.types!==null&&(V.types=K.types),J.T=V}},ie.unstable_useCacheRefresh=function(){return J.H.useCacheRefresh()},ie.use=function(M){return J.H.use(M)},ie.useActionState=function(M,V,K){return J.H.useActionState(M,V,K)},ie.useCallback=function(M,V){return J.H.useCallback(M,V)},ie.useContext=function(M){return J.H.useContext(M)},ie.useDebugValue=function(){},ie.useDeferredValue=function(M,V){return J.H.useDeferredValue(M,V)},ie.useEffect=function(M,V){return J.H.useEffect(M,V)},ie.useEffectEvent=function(M){return J.H.useEffectEvent(M)},ie.useId=function(){return J.H.useId()},ie.useImperativeHandle=function(M,V,K){return J.H.useImperativeHandle(M,V,K)},ie.useInsertionEffect=function(M,V){return J.H.useInsertionEffect(M,V)},ie.useLayoutEffect=function(M,V){return J.H.useLayoutEffect(M,V)},ie.useMemo=function(M,V){return J.H.useMemo(M,V)},ie.useOptimistic=function(M,V){return J.H.useOptimistic(M,V)},ie.useReducer=function(M,V,K){return J.H.useReducer(M,V,K)},ie.useRef=function(M){return J.H.useRef(M)},ie.useState=function(M){return J.H.useState(M)},ie.useSyncExternalStore=function(M,V,K){return J.H.useSyncExternalStore(M,V,K)},ie.useTransition=function(){return J.H.useTransition()},ie.version="19.2.4",ie}var Jp;function Du(){return Jp||(Jp=1,nu.exports=i0()),nu.exports}var o0=Du();const HR=Iu(o0);var iu={exports:{}},Qo={},ou={exports:{}},lu={};/**
 * @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 Yp;function l0(){return Yp||(Yp=1,(function(i){function t(G,F){var ee=G.length;G.push(F);e:for(;0<ee;){var ge=ee-1>>>1,Ue=G[ge];if(0<u(Ue,F))G[ge]=F,G[ee]=Ue,ee=ge;else break e}}function o(G){return G.length===0?null:G[0]}function a(G){if(G.length===0)return null;var F=G[0],ee=G.pop();if(ee!==F){G[0]=ee;e:for(var ge=0,Ue=G.length,M=Ue>>>1;ge<M;){var V=2*(ge+1)-1,K=G[V],$=V+1,le=G[$];if(0>u(K,ee))$<Ue&&0>u(le,K)?(G[ge]=le,G[$]=ee,ge=$):(G[ge]=K,G[V]=ee,ge=V);else if($<Ue&&0>u(le,ee))G[ge]=le,G[$]=ee,ge=$;else break e}}return F}function u(G,F){var ee=G.sortIndex-F.sortIndex;return ee!==0?ee:G.id-F.id}if(i.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var f=performance;i.unstable_now=function(){return f.now()}}else{var p=Date,g=p.now();i.unstable_now=function(){return p.now()-g}}var y=[],m=[],v=1,E=null,_=3,A=!1,I=!1,L=!1,b=!1,z=typeof setTimeout=="function"?setTimeout:null,Q=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;function k(G){for(var F=o(m);F!==null;){if(F.callback===null)a(m);else if(F.startTime<=G)a(m),F.sortIndex=F.expirationTime,t(y,F);else break;F=o(m)}}function j(G){if(L=!1,k(G),!I)if(o(y)!==null)I=!0,B||(B=!0,Me());else{var F=o(m);F!==null&&qe(j,F.startTime-G)}}var B=!1,J=-1,ue=5,Z=-1;function re(){return b?!0:!(i.unstable_now()-Z<ue)}function Ee(){if(b=!1,B){var G=i.unstable_now();Z=G;var F=!0;try{e:{I=!1,L&&(L=!1,Q(J),J=-1),A=!0;var ee=_;try{t:{for(k(G),E=o(y);E!==null&&!(E.expirationTime>G&&re());){var ge=E.callback;if(typeof ge=="function"){E.callback=null,_=E.priorityLevel;var Ue=ge(E.expirationTime<=G);if(G=i.unstable_now(),typeof Ue=="function"){E.callback=Ue,k(G),F=!0;break t}E===o(y)&&a(y),k(G)}else a(y);E=o(y)}if(E!==null)F=!0;else{var M=o(m);M!==null&&qe(j,M.startTime-G),F=!1}}break e}finally{E=null,_=ee,A=!1}F=void 0}}finally{F?Me():B=!1}}}var Me;if(typeof O=="function")Me=function(){O(Ee)};else if(typeof MessageChannel<"u"){var xe=new MessageChannel,Ae=xe.port2;xe.port1.onmessage=Ee,Me=function(){Ae.postMessage(null)}}else Me=function(){z(Ee,0)};function qe(G,F){J=z(function(){G(i.unstable_now())},F)}i.unstable_IdlePriority=5,i.unstable_ImmediatePriority=1,i.unstable_LowPriority=4,i.unstable_NormalPriority=3,i.unstable_Profiling=null,i.unstable_UserBlockingPriority=2,i.unstable_cancelCallback=function(G){G.callback=null},i.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ue=0<G?Math.floor(1e3/G):5},i.unstable_getCurrentPriorityLevel=function(){return _},i.unstable_next=function(G){switch(_){case 1:case 2:case 3:var F=3;break;default:F=_}var ee=_;_=F;try{return G()}finally{_=ee}},i.unstable_requestPaint=function(){b=!0},i.unstable_runWithPriority=function(G,F){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var ee=_;_=G;try{return F()}finally{_=ee}},i.unstable_scheduleCallback=function(G,F,ee){var ge=i.unstable_now();switch(typeof ee=="object"&&ee!==null?(ee=ee.delay,ee=typeof ee=="number"&&0<ee?ge+ee:ge):ee=ge,G){case 1:var Ue=-1;break;case 2:Ue=250;break;case 5:Ue=1073741823;break;case 4:Ue=1e4;break;default:Ue=5e3}return Ue=ee+Ue,G={id:v++,callback:F,priorityLevel:G,startTime:ee,expirationTime:Ue,sortIndex:-1},ee>ge?(G.sortIndex=ee,t(m,G),o(y)===null&&G===o(m)&&(L?(Q(J),J=-1):L=!0,qe(j,ee-ge))):(G.sortIndex=Ue,t(y,G),I||A||(I=!0,B||(B=!0,Me()))),G},i.unstable_shouldYield=re,i.unstable_wrapCallback=function(G){var F=_;return function(){var ee=_;_=F;try{return G.apply(this,arguments)}finally{_=ee}}}})(lu)),lu}var Kp;function a0(){return Kp||(Kp=1,ou.exports=l0()),ou.exports}var au={exports:{}},nt={};/**
 * @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 Qp;function s0(){if(Qp)return nt;Qp=1;var i=Du();function t(y){var m="https://react.dev/errors/"+y;if(1<arguments.length){m+="?args[]="+encodeURIComponent(arguments[1]);for(var v=2;v<arguments.length;v++)m+="&args[]="+encodeURIComponent(arguments[v])}return"Minified React error #"+y+"; visit "+m+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var a={d:{f:o,r:function(){throw Error(t(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},u=Symbol.for("react.portal");function f(y,m,v){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:E==null?null:""+E,children:y,containerInfo:m,implementation:v}}var p=i.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(y,m){if(y==="font")return"";if(typeof m=="string")return m==="use-credentials"?m:""}return nt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,nt.createPortal=function(y,m){var v=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!m||m.nodeType!==1&&m.nodeType!==9&&m.nodeType!==11)throw Error(t(299));return f(y,m,null,v)},nt.flushSync=function(y){var m=p.T,v=a.p;try{if(p.T=null,a.p=2,y)return y()}finally{p.T=m,a.p=v,a.d.f()}},nt.preconnect=function(y,m){typeof y=="string"&&(m?(m=m.crossOrigin,m=typeof m=="string"?m==="use-credentials"?m:"":void 0):m=null,a.d.C(y,m))},nt.prefetchDNS=function(y){typeof y=="string"&&a.d.D(y)},nt.preinit=function(y,m){if(typeof y=="string"&&m&&typeof m.as=="string"){var v=m.as,E=g(v,m.crossOrigin),_=typeof m.integrity=="string"?m.integrity:void 0,A=typeof m.fetchPriority=="string"?m.fetchPriority:void 0;v==="style"?a.d.S(y,typeof m.precedence=="string"?m.precedence:void 0,{crossOrigin:E,integrity:_,fetchPriority:A}):v==="script"&&a.d.X(y,{crossOrigin:E,integrity:_,fetchPriority:A,nonce:typeof m.nonce=="string"?m.nonce:void 0})}},nt.preinitModule=function(y,m){if(typeof y=="string")if(typeof m=="object"&&m!==null){if(m.as==null||m.as==="script"){var v=g(m.as,m.crossOrigin);a.d.M(y,{crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0})}}else m==null&&a.d.M(y)},nt.preload=function(y,m){if(typeof y=="string"&&typeof m=="object"&&m!==null&&typeof m.as=="string"){var v=m.as,E=g(v,m.crossOrigin);a.d.L(y,v,{crossOrigin:E,integrity:typeof m.integrity=="string"?m.integrity:void 0,nonce:typeof m.nonce=="string"?m.nonce:void 0,type:typeof m.type=="string"?m.type:void 0,fetchPriority:typeof m.fetchPriority=="string"?m.fetchPriority:void 0,referrerPolicy:typeof m.referrerPolicy=="string"?m.referrerPolicy:void 0,imageSrcSet:typeof m.imageSrcSet=="string"?m.imageSrcSet:void 0,imageSizes:typeof m.imageSizes=="string"?m.imageSizes:void 0,media:typeof m.media=="string"?m.media:void 0})}},nt.preloadModule=function(y,m){if(typeof y=="string")if(m){var v=g(m.as,m.crossOrigin);a.d.m(y,{as:typeof m.as=="string"&&m.as!=="script"?m.as:void 0,crossOrigin:v,integrity:typeof m.integrity=="string"?m.integrity:void 0})}else a.d.m(y)},nt.requestFormReset=function(y){a.d.r(y)},nt.unstable_batchedUpdates=function(y,m){return y(m)},nt.useFormState=function(y,m,v){return p.H.useFormState(y,m,v)},nt.useFormStatus=function(){return p.H.useHostTransitionStatus()},nt.version="19.2.4",nt}var Xp;function r0(){if(Xp)return au.exports;Xp=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(t){console.error(t)}}return i(),au.exports=s0(),au.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 Zp;function u0(){if(Zp)return Qo;Zp=1;var i=a0(),t=Du(),o=r0();function a(e){var n="https://react.dev/errors/"+e;if(1<arguments.length){n+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)n+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+n+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function f(e){var n=e,l=e;if(e.alternate)for(;n.return;)n=n.return;else{e=n;do n=e,(n.flags&4098)!==0&&(l=n.return),e=n.return;while(e)}return n.tag===3?l:null}function p(e){if(e.tag===13){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function g(e){if(e.tag===31){var n=e.memoizedState;if(n===null&&(e=e.alternate,e!==null&&(n=e.memoizedState)),n!==null)return n.dehydrated}return null}function y(e){if(f(e)!==e)throw Error(a(188))}function m(e){var n=e.alternate;if(!n){if(n=f(e),n===null)throw Error(a(188));return n!==e?null:e}for(var l=e,s=n;;){var d=l.return;if(d===null)break;var h=d.alternate;if(h===null){if(s=d.return,s!==null){l=s;continue}break}if(d.child===h.child){for(h=d.child;h;){if(h===l)return y(d),e;if(h===s)return y(d),n;h=h.sibling}throw Error(a(188))}if(l.return!==s.return)l=d,s=h;else{for(var T=!1,S=d.child;S;){if(S===l){T=!0,l=d,s=h;break}if(S===s){T=!0,s=d,l=h;break}S=S.sibling}if(!T){for(S=h.child;S;){if(S===l){T=!0,l=h,s=d;break}if(S===s){T=!0,s=h,l=d;break}S=S.sibling}if(!T)throw Error(a(189))}}if(l.alternate!==s)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:n}function v(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e;for(e=e.child;e!==null;){if(n=v(e),n!==null)return n;e=e.sibling}return null}var E=Object.assign,_=Symbol.for("react.element"),A=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),L=Symbol.for("react.fragment"),b=Symbol.for("react.strict_mode"),z=Symbol.for("react.profiler"),Q=Symbol.for("react.consumer"),O=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),J=Symbol.for("react.memo"),ue=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),re=Symbol.for("react.memo_cache_sentinel"),Ee=Symbol.iterator;function Me(e){return e===null||typeof e!="object"?null:(e=Ee&&e[Ee]||e["@@iterator"],typeof e=="function"?e:null)}var xe=Symbol.for("react.client.reference");function Ae(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===xe?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case L:return"Fragment";case z:return"Profiler";case b:return"StrictMode";case j:return"Suspense";case B:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case I:return"Portal";case O:return e.displayName||"Context";case Q:return(e._context.displayName||"Context")+".Consumer";case k:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case J:return n=e.displayName||null,n!==null?n:Ae(e.type)||"Memo";case ue:n=e._payload,e=e._init;try{return Ae(e(n))}catch{}}return null}var qe=Array.isArray,G=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,F=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ee={pending:!1,data:null,method:null,action:null},ge=[],Ue=-1;function M(e){return{current:e}}function V(e){0>Ue||(e.current=ge[Ue],ge[Ue]=null,Ue--)}function K(e,n){Ue++,ge[Ue]=e.current,e.current=n}var $=M(null),le=M(null),ce=M(null),Se=M(null);function it(e,n){switch(K(ce,n),K(le,e),K($,null),n.nodeType){case 9:case 11:e=(e=n.documentElement)&&(e=e.namespaceURI)?fp(e):0;break;default:if(e=n.tagName,n=n.namespaceURI)n=fp(n),e=dp(n,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}V($),K($,e)}function Ve(){V($),V(le),V(ce)}function ji(e){e.memoizedState!==null&&K(Se,e);var n=$.current,l=dp(n,e.type);n!==l&&(K(le,e),K($,l))}function el(e){le.current===e&&(V($),V(le)),Se.current===e&&(V(Se),Fo._currentValue=ee)}var Pa,Bu;function zn(e){if(Pa===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);Pa=n&&n[1]||"",Bu=-1<l.stack.indexOf(`
    at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Pa+e+Bu}var qa=!1;function Va(e,n){if(!e||qa)return"";qa=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(n){var q=function(){throw Error()};if(Object.defineProperty(q.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(q,[])}catch(x){var w=x}Reflect.construct(e,[],q)}else{try{q.call()}catch(x){w=x}e.call(q.prototype)}}else{try{throw Error()}catch(x){w=x}(q=e())&&typeof q.catch=="function"&&q.catch(function(){})}}catch(x){if(x&&w&&typeof x.stack=="string")return[x.stack,w.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var d=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");d&&d.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var h=s.DetermineComponentFrameRoot(),T=h[0],S=h[1];if(T&&S){var C=T.split(`
`),U=S.split(`
`);for(d=s=0;s<C.length&&!C[s].includes("DetermineComponentFrameRoot");)s++;for(;d<U.length&&!U[d].includes("DetermineComponentFrameRoot");)d++;if(s===C.length||d===U.length)for(s=C.length-1,d=U.length-1;1<=s&&0<=d&&C[s]!==U[d];)d--;for(;1<=s&&0<=d;s--,d--)if(C[s]!==U[d]){if(s!==1||d!==1)do if(s--,d--,0>d||C[s]!==U[d]){var H=`
`+C[s].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=s&&0<=d);break}}}finally{qa=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?zn(l):""}function xg(e,n){switch(e.tag){case 26:case 27:case 5:return zn(e.type);case 16:return zn("Lazy");case 13:return e.child!==n&&n!==null?zn("Suspense Fallback"):zn("Suspense");case 19:return zn("SuspenseList");case 0:case 15:return Va(e.type,!1);case 11:return Va(e.type.render,!1);case 1:return Va(e.type,!0);case 31:return zn("Activity");default:return""}}function zu(e){try{var n="",l=null;do n+=xg(e,l),l=e,e=e.return;while(e);return n}catch(s){return`
Error generating stack: `+s.message+`
`+s.stack}}var Ba=Object.prototype.hasOwnProperty,za=i.unstable_scheduleCallback,Oa=i.unstable_cancelCallback,bg=i.unstable_shouldYield,Gg=i.unstable_requestPaint,ht=i.unstable_now,Lg=i.unstable_getCurrentPriorityLevel,Ou=i.unstable_ImmediatePriority,Fu=i.unstable_UserBlockingPriority,tl=i.unstable_NormalPriority,Hg=i.unstable_LowPriority,ku=i.unstable_IdlePriority,Pg=i.log,qg=i.unstable_setDisableYieldValue,eo=null,mt=null;function hn(e){if(typeof Pg=="function"&&qg(e),mt&&typeof mt.setStrictMode=="function")try{mt.setStrictMode(eo,e)}catch{}}var gt=Math.clz32?Math.clz32:zg,Vg=Math.log,Bg=Math.LN2;function zg(e){return e>>>=0,e===0?32:31-(Vg(e)/Bg|0)|0}var nl=256,il=262144,ol=4194304;function On(e){var n=e&42;if(n!==0)return n;switch(e&-e){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:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function ll(e,n,l){var s=e.pendingLanes;if(s===0)return 0;var d=0,h=e.suspendedLanes,T=e.pingedLanes;e=e.warmLanes;var S=s&134217727;return S!==0?(s=S&~h,s!==0?d=On(s):(T&=S,T!==0?d=On(T):l||(l=S&~e,l!==0&&(d=On(l))))):(S=s&~h,S!==0?d=On(S):T!==0?d=On(T):l||(l=s&~e,l!==0&&(d=On(l)))),d===0?0:n!==0&&n!==d&&(n&h)===0&&(h=d&-d,l=n&-n,h>=l||h===32&&(l&4194048)!==0)?n:d}function to(e,n){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&n)===0}function Og(e,n){switch(e){case 1:case 2:case 4:case 8:case 64:return n+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 n+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 Ju(){var e=ol;return ol<<=1,(ol&62914560)===0&&(ol=4194304),e}function Fa(e){for(var n=[],l=0;31>l;l++)n.push(e);return n}function no(e,n){e.pendingLanes|=n,n!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Fg(e,n,l,s,d,h){var T=e.pendingLanes;e.pendingLanes=l,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=l,e.entangledLanes&=l,e.errorRecoveryDisabledLanes&=l,e.shellSuspendCounter=0;var S=e.entanglements,C=e.expirationTimes,U=e.hiddenUpdates;for(l=T&~l;0<l;){var H=31-gt(l),q=1<<H;S[H]=0,C[H]=-1;var w=U[H];if(w!==null)for(U[H]=null,H=0;H<w.length;H++){var x=w[H];x!==null&&(x.lane&=-536870913)}l&=~q}s!==0&&Yu(e,s,0),h!==0&&d===0&&e.tag!==0&&(e.suspendedLanes|=h&~(T&~n))}function Yu(e,n,l){e.pendingLanes|=n,e.suspendedLanes&=~n;var s=31-gt(n);e.entangledLanes|=n,e.entanglements[s]=e.entanglements[s]|1073741824|l&261930}function Ku(e,n){var l=e.entangledLanes|=n;for(e=e.entanglements;l;){var s=31-gt(l),d=1<<s;d&n|e[s]&n&&(e[s]|=n),l&=~d}}function Qu(e,n){var l=n&-n;return l=(l&42)!==0?1:ka(l),(l&(e.suspendedLanes|n))!==0?0:l}function ka(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Ja(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xu(){var e=F.p;return e!==0?e:(e=window.event,e===void 0?32:Lp(e.type))}function Zu(e,n){var l=F.p;try{return F.p=e,n()}finally{F.p=l}}var mn=Math.random().toString(36).slice(2),$e="__reactFiber$"+mn,st="__reactProps$"+mn,ri="__reactContainer$"+mn,Ya="__reactEvents$"+mn,kg="__reactListeners$"+mn,Jg="__reactHandles$"+mn,$u="__reactResources$"+mn,io="__reactMarker$"+mn;function Ka(e){delete e[$e],delete e[st],delete e[Ya],delete e[kg],delete e[Jg]}function ui(e){var n=e[$e];if(n)return n;for(var l=e.parentNode;l;){if(n=l[ri]||l[$e]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(e=Tp(e);e!==null;){if(l=e[$e])return l;e=Tp(e)}return n}e=l,l=e.parentNode}return null}function ci(e){if(e=e[$e]||e[ri]){var n=e.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return e}return null}function oo(e){var n=e.tag;if(n===5||n===26||n===27||n===6)return e.stateNode;throw Error(a(33))}function fi(e){var n=e[$u];return n||(n=e[$u]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function Ke(e){e[io]=!0}var Wu=new Set,ju={};function Fn(e,n){di(e,n),di(e+"Capture",n)}function di(e,n){for(ju[e]=n,e=0;e<n.length;e++)Wu.add(n[e])}var Yg=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]*$"),ec={},tc={};function Kg(e){return Ba.call(tc,e)?!0:Ba.call(ec,e)?!1:Yg.test(e)?tc[e]=!0:(ec[e]=!0,!1)}function al(e,n,l){if(Kg(n))if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(n);return;case"boolean":var s=n.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(n);return}}e.setAttribute(n,""+l)}}function sl(e,n,l){if(l===null)e.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttribute(n,""+l)}}function Yt(e,n,l,s){if(s===null)e.removeAttribute(l);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(n,l,""+s)}}function Rt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function nc(e){var n=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function Qg(e,n,l){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,n);if(!e.hasOwnProperty(n)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var d=s.get,h=s.set;return Object.defineProperty(e,n,{configurable:!0,get:function(){return d.call(this)},set:function(T){l=""+T,h.call(this,T)}}),Object.defineProperty(e,n,{enumerable:s.enumerable}),{getValue:function(){return l},setValue:function(T){l=""+T},stopTracking:function(){e._valueTracker=null,delete e[n]}}}}function Qa(e){if(!e._valueTracker){var n=nc(e)?"checked":"value";e._valueTracker=Qg(e,n,""+e[n])}}function ic(e){if(!e)return!1;var n=e._valueTracker;if(!n)return!0;var l=n.getValue(),s="";return e&&(s=nc(e)?e.checked?"true":"false":e.value),e=s,e!==l?(n.setValue(e),!0):!1}function rl(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Xg=/[\n"\\]/g;function Mt(e){return e.replace(Xg,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Xa(e,n,l,s,d,h,T,S){e.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.type=T:e.removeAttribute("type"),n!=null?T==="number"?(n===0&&e.value===""||e.value!=n)&&(e.value=""+Rt(n)):e.value!==""+Rt(n)&&(e.value=""+Rt(n)):T!=="submit"&&T!=="reset"||e.removeAttribute("value"),n!=null?Za(e,T,Rt(n)):l!=null?Za(e,T,Rt(l)):s!=null&&e.removeAttribute("value"),d==null&&h!=null&&(e.defaultChecked=!!h),d!=null&&(e.checked=d&&typeof d!="function"&&typeof d!="symbol"),S!=null&&typeof S!="function"&&typeof S!="symbol"&&typeof S!="boolean"?e.name=""+Rt(S):e.removeAttribute("name")}function oc(e,n,l,s,d,h,T,S){if(h!=null&&typeof h!="function"&&typeof h!="symbol"&&typeof h!="boolean"&&(e.type=h),n!=null||l!=null){if(!(h!=="submit"&&h!=="reset"||n!=null)){Qa(e);return}l=l!=null?""+Rt(l):"",n=n!=null?""+Rt(n):l,S||n===e.value||(e.value=n),e.defaultValue=n}s=s??d,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=S?e.checked:!!s,e.defaultChecked=!!s,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(e.name=T),Qa(e)}function Za(e,n,l){n==="number"&&rl(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function pi(e,n,l,s){if(e=e.options,n){n={};for(var d=0;d<l.length;d++)n["$"+l[d]]=!0;for(l=0;l<e.length;l++)d=n.hasOwnProperty("$"+e[l].value),e[l].selected!==d&&(e[l].selected=d),d&&s&&(e[l].defaultSelected=!0)}else{for(l=""+Rt(l),n=null,d=0;d<e.length;d++){if(e[d].value===l){e[d].selected=!0,s&&(e[d].defaultSelected=!0);return}n!==null||e[d].disabled||(n=e[d])}n!==null&&(n.selected=!0)}}function lc(e,n,l){if(n!=null&&(n=""+Rt(n),n!==e.value&&(e.value=n),l==null)){e.defaultValue!==n&&(e.defaultValue=n);return}e.defaultValue=l!=null?""+Rt(l):""}function ac(e,n,l,s){if(n==null){if(s!=null){if(l!=null)throw Error(a(92));if(qe(s)){if(1<s.length)throw Error(a(93));s=s[0]}l=s}l==null&&(l=""),n=l}l=Rt(n),e.defaultValue=l,s=e.textContent,s===l&&s!==""&&s!==null&&(e.value=s),Qa(e)}function hi(e,n){if(n){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=n;return}}e.textContent=n}var Zg=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 sc(e,n,l){var s=n.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?s?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="":s?e.setProperty(n,l):typeof l!="number"||l===0||Zg.has(n)?n==="float"?e.cssFloat=l:e[n]=(""+l).trim():e[n]=l+"px"}function rc(e,n,l){if(n!=null&&typeof n!="object")throw Error(a(62));if(e=e.style,l!=null){for(var s in l)!l.hasOwnProperty(s)||n!=null&&n.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="");for(var d in n)s=n[d],n.hasOwnProperty(d)&&l[d]!==s&&sc(e,d,s)}else for(var h in n)n.hasOwnProperty(h)&&sc(e,h,n[h])}function $a(e){if(e.indexOf("-")===-1)return!1;switch(e){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 $g=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"]]),Wg=/^[\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 ul(e){return Wg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Kt(){}var Wa=null;function ja(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var mi=null,gi=null;function uc(e){var n=ci(e);if(n&&(e=n.stateNode)){var l=e[st]||null;e:switch(e=n.stateNode,n.type){case"input":if(Xa(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Mt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var s=l[n];if(s!==e&&s.form===e.form){var d=s[st]||null;if(!d)throw Error(a(90));Xa(s,d.value,d.defaultValue,d.defaultValue,d.checked,d.defaultChecked,d.type,d.name)}}for(n=0;n<l.length;n++)s=l[n],s.form===e.form&&ic(s)}break e;case"textarea":lc(e,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&pi(e,!!l.multiple,n,!1)}}}var es=!1;function cc(e,n,l){if(es)return e(n,l);es=!0;try{var s=e(n);return s}finally{if(es=!1,(mi!==null||gi!==null)&&(Zl(),mi&&(n=mi,e=gi,gi=mi=null,uc(n),e)))for(n=0;n<e.length;n++)uc(e[n])}}function lo(e,n){var l=e.stateNode;if(l===null)return null;var s=l[st]||null;if(s===null)return null;l=s[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(a(231,n,typeof l));return l}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),ts=!1;if(Qt)try{var ao={};Object.defineProperty(ao,"passive",{get:function(){ts=!0}}),window.addEventListener("test",ao,ao),window.removeEventListener("test",ao,ao)}catch{ts=!1}var gn=null,ns=null,cl=null;function fc(){if(cl)return cl;var e,n=ns,l=n.length,s,d="value"in gn?gn.value:gn.textContent,h=d.length;for(e=0;e<l&&n[e]===d[e];e++);var T=l-e;for(s=1;s<=T&&n[l-s]===d[h-s];s++);return cl=d.slice(e,1<s?1-s:void 0)}function fl(e){var n=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&n===13&&(e=13)):e=n,e===10&&(e=13),32<=e||e===13?e:0}function dl(){return!0}function dc(){return!1}function rt(e){function n(l,s,d,h,T){this._reactName=l,this._targetInst=d,this.type=s,this.nativeEvent=h,this.target=T,this.currentTarget=null;for(var S in e)e.hasOwnProperty(S)&&(l=e[S],this[S]=l?l(h):h[S]);return this.isDefaultPrevented=(h.defaultPrevented!=null?h.defaultPrevented:h.returnValue===!1)?dl:dc,this.isPropagationStopped=dc,this}return E(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=dl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=dl)},persist:function(){},isPersistent:dl}),n}var kn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pl=rt(kn),so=E({},kn,{view:0,detail:0}),jg=rt(so),is,os,ro,hl=E({},so,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:as,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==ro&&(ro&&e.type==="mousemove"?(is=e.screenX-ro.screenX,os=e.screenY-ro.screenY):os=is=0,ro=e),is)},movementY:function(e){return"movementY"in e?e.movementY:os}}),pc=rt(hl),ey=E({},hl,{dataTransfer:0}),ty=rt(ey),ny=E({},so,{relatedTarget:0}),ls=rt(ny),iy=E({},kn,{animationName:0,elapsedTime:0,pseudoElement:0}),oy=rt(iy),ly=E({},kn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ay=rt(ly),sy=E({},kn,{data:0}),hc=rt(sy),ry={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},uy={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"},cy={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function fy(e){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(e):(e=cy[e])?!!n[e]:!1}function as(){return fy}var dy=E({},so,{key:function(e){if(e.key){var n=ry[e.key]||e.key;if(n!=="Unidentified")return n}return e.type==="keypress"?(e=fl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?uy[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:as,charCode:function(e){return e.type==="keypress"?fl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?fl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),py=rt(dy),hy=E({},hl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),mc=rt(hy),my=E({},so,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:as}),gy=rt(my),yy=E({},kn,{propertyName:0,elapsedTime:0,pseudoElement:0}),vy=rt(yy),Ty=E({},hl,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),Ey=rt(Ty),_y=E({},kn,{newState:0,oldState:0}),Sy=rt(_y),Ay=[9,13,27,32],ss=Qt&&"CompositionEvent"in window,uo=null;Qt&&"documentMode"in document&&(uo=document.documentMode);var Cy=Qt&&"TextEvent"in window&&!uo,gc=Qt&&(!ss||uo&&8<uo&&11>=uo),yc=" ",vc=!1;function Tc(e,n){switch(e){case"keyup":return Ay.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ec(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var yi=!1;function Ry(e,n){switch(e){case"compositionend":return Ec(n);case"keypress":return n.which!==32?null:(vc=!0,yc);case"textInput":return e=n.data,e===yc&&vc?null:e;default:return null}}function My(e,n){if(yi)return e==="compositionend"||!ss&&Tc(e,n)?(e=fc(),cl=ns=gn=null,yi=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return gc&&n.locale!=="ko"?null:n.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 _c(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n==="input"?!!Ny[e.type]:n==="textarea"}function Sc(e,n,l,s){mi?gi?gi.push(s):gi=[s]:mi=s,n=ia(n,"onChange"),0<n.length&&(l=new pl("onChange","change",null,l,s),e.push({event:l,listeners:n}))}var co=null,fo=null;function Iy(e){lp(e,0)}function ml(e){var n=oo(e);if(ic(n))return e}function Ac(e,n){if(e==="change")return n}var Cc=!1;if(Qt){var rs;if(Qt){var us="oninput"in document;if(!us){var Rc=document.createElement("div");Rc.setAttribute("oninput","return;"),us=typeof Rc.oninput=="function"}rs=us}else rs=!1;Cc=rs&&(!document.documentMode||9<document.documentMode)}function Mc(){co&&(co.detachEvent("onpropertychange",Nc),fo=co=null)}function Nc(e){if(e.propertyName==="value"&&ml(fo)){var n=[];Sc(n,fo,e,ja(e)),cc(Iy,n)}}function Dy(e,n,l){e==="focusin"?(Mc(),co=n,fo=l,co.attachEvent("onpropertychange",Nc)):e==="focusout"&&Mc()}function Uy(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return ml(fo)}function wy(e,n){if(e==="click")return ml(n)}function xy(e,n){if(e==="input"||e==="change")return ml(n)}function by(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}var yt=typeof Object.is=="function"?Object.is:by;function po(e,n){if(yt(e,n))return!0;if(typeof e!="object"||e===null||typeof n!="object"||n===null)return!1;var l=Object.keys(e),s=Object.keys(n);if(l.length!==s.length)return!1;for(s=0;s<l.length;s++){var d=l[s];if(!Ba.call(n,d)||!yt(e[d],n[d]))return!1}return!0}function Ic(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Dc(e,n){var l=Ic(e);e=0;for(var s;l;){if(l.nodeType===3){if(s=e+l.textContent.length,e<=n&&s>=n)return{node:l,offset:n-e};e=s}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Ic(l)}}function Uc(e,n){return e&&n?e===n?!0:e&&e.nodeType===3?!1:n&&n.nodeType===3?Uc(e,n.parentNode):"contains"in e?e.contains(n):e.compareDocumentPosition?!!(e.compareDocumentPosition(n)&16):!1:!1}function wc(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var n=rl(e.document);n instanceof e.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)e=n.contentWindow;else break;n=rl(e.document)}return n}function cs(e){var n=e&&e.nodeName&&e.nodeName.toLowerCase();return n&&(n==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||n==="textarea"||e.contentEditable==="true")}var Gy=Qt&&"documentMode"in document&&11>=document.documentMode,vi=null,fs=null,ho=null,ds=!1;function xc(e,n,l){var s=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;ds||vi==null||vi!==rl(s)||(s=vi,"selectionStart"in s&&cs(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),ho&&po(ho,s)||(ho=s,s=ia(fs,"onSelect"),0<s.length&&(n=new pl("onSelect","select",null,n,l),e.push({event:n,listeners:s}),n.target=vi)))}function Jn(e,n){var l={};return l[e.toLowerCase()]=n.toLowerCase(),l["Webkit"+e]="webkit"+n,l["Moz"+e]="moz"+n,l}var Ti={animationend:Jn("Animation","AnimationEnd"),animationiteration:Jn("Animation","AnimationIteration"),animationstart:Jn("Animation","AnimationStart"),transitionrun:Jn("Transition","TransitionRun"),transitionstart:Jn("Transition","TransitionStart"),transitioncancel:Jn("Transition","TransitionCancel"),transitionend:Jn("Transition","TransitionEnd")},ps={},bc={};Qt&&(bc=document.createElement("div").style,"AnimationEvent"in window||(delete Ti.animationend.animation,delete Ti.animationiteration.animation,delete Ti.animationstart.animation),"TransitionEvent"in window||delete Ti.transitionend.transition);function Yn(e){if(ps[e])return ps[e];if(!Ti[e])return e;var n=Ti[e],l;for(l in n)if(n.hasOwnProperty(l)&&l in bc)return ps[e]=n[l];return e}var Gc=Yn("animationend"),Lc=Yn("animationiteration"),Hc=Yn("animationstart"),Ly=Yn("transitionrun"),Hy=Yn("transitionstart"),Py=Yn("transitioncancel"),Pc=Yn("transitionend"),qc=new Map,hs="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(" ");hs.push("scrollEnd");function Ht(e,n){qc.set(e,n),Fn(n,[e])}var gl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Nt=[],Ei=0,ms=0;function yl(){for(var e=Ei,n=ms=Ei=0;n<e;){var l=Nt[n];Nt[n++]=null;var s=Nt[n];Nt[n++]=null;var d=Nt[n];Nt[n++]=null;var h=Nt[n];if(Nt[n++]=null,s!==null&&d!==null){var T=s.pending;T===null?d.next=d:(d.next=T.next,T.next=d),s.pending=d}h!==0&&Vc(l,d,h)}}function vl(e,n,l,s){Nt[Ei++]=e,Nt[Ei++]=n,Nt[Ei++]=l,Nt[Ei++]=s,ms|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function gs(e,n,l,s){return vl(e,n,l,s),Tl(e)}function Kn(e,n){return vl(e,null,null,n),Tl(e)}function Vc(e,n,l){e.lanes|=l;var s=e.alternate;s!==null&&(s.lanes|=l);for(var d=!1,h=e.return;h!==null;)h.childLanes|=l,s=h.alternate,s!==null&&(s.childLanes|=l),h.tag===22&&(e=h.stateNode,e===null||e._visibility&1||(d=!0)),e=h,h=h.return;return e.tag===3?(h=e.stateNode,d&&n!==null&&(d=31-gt(l),e=h.hiddenUpdates,s=e[d],s===null?e[d]=[n]:s.push(n),n.lane=l|536870912),h):null}function Tl(e){if(50<Ho)throw Ho=0,Rr=null,Error(a(185));for(var n=e.return;n!==null;)e=n,n=e.return;return e.tag===3?e.stateNode:null}var _i={};function qy(e,n,l,s){this.tag=e,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function vt(e,n,l,s){return new qy(e,n,l,s)}function ys(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Xt(e,n){var l=e.alternate;return l===null?(l=vt(e.tag,n,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=n,l.type=e.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=e.flags&65011712,l.childLanes=e.childLanes,l.lanes=e.lanes,l.child=e.child,l.memoizedProps=e.memoizedProps,l.memoizedState=e.memoizedState,l.updateQueue=e.updateQueue,n=e.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Bc(e,n){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=n,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=l.childLanes,e.lanes=l.lanes,e.child=l.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=l.memoizedProps,e.memoizedState=l.memoizedState,e.updateQueue=l.updateQueue,e.type=l.type,n=l.dependencies,e.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext}),e}function El(e,n,l,s,d,h){var T=0;if(s=e,typeof e=="function")ys(e)&&(T=1);else if(typeof e=="string")T=Fv(e,l,$.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Z:return e=vt(31,l,n,d),e.elementType=Z,e.lanes=h,e;case L:return Qn(l.children,d,h,n);case b:T=8,d|=24;break;case z:return e=vt(12,l,n,d|2),e.elementType=z,e.lanes=h,e;case j:return e=vt(13,l,n,d),e.elementType=j,e.lanes=h,e;case B:return e=vt(19,l,n,d),e.elementType=B,e.lanes=h,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case O:T=10;break e;case Q:T=9;break e;case k:T=11;break e;case J:T=14;break e;case ue:T=16,s=null;break e}T=29,l=Error(a(130,e===null?"null":typeof e,"")),s=null}return n=vt(T,l,n,d),n.elementType=e,n.type=s,n.lanes=h,n}function Qn(e,n,l,s){return e=vt(7,e,s,n),e.lanes=l,e}function vs(e,n,l){return e=vt(6,e,null,n),e.lanes=l,e}function zc(e){var n=vt(18,null,null,0);return n.stateNode=e,n}function Ts(e,n,l){return n=vt(4,e.children!==null?e.children:[],e.key,n),n.lanes=l,n.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},n}var Oc=new WeakMap;function It(e,n){if(typeof e=="object"&&e!==null){var l=Oc.get(e);return l!==void 0?l:(n={value:e,source:n,stack:zu(n)},Oc.set(e,n),n)}return{value:e,source:n,stack:zu(n)}}var Si=[],Ai=0,_l=null,mo=0,Dt=[],Ut=0,yn=null,Ot=1,Ft="";function Zt(e,n){Si[Ai++]=mo,Si[Ai++]=_l,_l=e,mo=n}function Fc(e,n,l){Dt[Ut++]=Ot,Dt[Ut++]=Ft,Dt[Ut++]=yn,yn=e;var s=Ot;e=Ft;var d=32-gt(s)-1;s&=~(1<<d),l+=1;var h=32-gt(n)+d;if(30<h){var T=d-d%5;h=(s&(1<<T)-1).toString(32),s>>=T,d-=T,Ot=1<<32-gt(n)+d|l<<d|s,Ft=h+e}else Ot=1<<h|l<<d|s,Ft=e}function Es(e){e.return!==null&&(Zt(e,1),Fc(e,1,0))}function _s(e){for(;e===_l;)_l=Si[--Ai],Si[Ai]=null,mo=Si[--Ai],Si[Ai]=null;for(;e===yn;)yn=Dt[--Ut],Dt[Ut]=null,Ft=Dt[--Ut],Dt[Ut]=null,Ot=Dt[--Ut],Dt[Ut]=null}function kc(e,n){Dt[Ut++]=Ot,Dt[Ut++]=Ft,Dt[Ut++]=yn,Ot=n.id,Ft=n.overflow,yn=e}var We=null,be=null,me=!1,vn=null,wt=!1,Ss=Error(a(519));function Tn(e){var n=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw go(It(n,e)),Ss}function Jc(e){var n=e.stateNode,l=e.type,s=e.memoizedProps;switch(n[$e]=e,n[st]=s,l){case"dialog":de("cancel",n),de("close",n);break;case"iframe":case"object":case"embed":de("load",n);break;case"video":case"audio":for(l=0;l<qo.length;l++)de(qo[l],n);break;case"source":de("error",n);break;case"img":case"image":case"link":de("error",n),de("load",n);break;case"details":de("toggle",n);break;case"input":de("invalid",n),oc(n,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":de("invalid",n);break;case"textarea":de("invalid",n),ac(n,s.value,s.defaultValue,s.children)}l=s.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||s.suppressHydrationWarning===!0||up(n.textContent,l)?(s.popover!=null&&(de("beforetoggle",n),de("toggle",n)),s.onScroll!=null&&de("scroll",n),s.onScrollEnd!=null&&de("scrollend",n),s.onClick!=null&&(n.onclick=Kt),n=!0):n=!1,n||Tn(e,!0)}function Yc(e){for(We=e.return;We;)switch(We.tag){case 5:case 31:case 13:wt=!1;return;case 27:case 3:wt=!0;return;default:We=We.return}}function Ci(e){if(e!==We)return!1;if(!me)return Yc(e),me=!0,!1;var n=e.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Br(e.type,e.memoizedProps)),l=!l),l&&be&&Tn(e),Yc(e),n===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));be=vp(e)}else if(n===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));be=vp(e)}else n===27?(n=be,bn(e.type)?(e=Jr,Jr=null,be=e):be=n):be=We?bt(e.stateNode.nextSibling):null;return!0}function Xn(){be=We=null,me=!1}function As(){var e=vn;return e!==null&&(dt===null?dt=e:dt.push.apply(dt,e),vn=null),e}function go(e){vn===null?vn=[e]:vn.push(e)}var Cs=M(null),Zn=null,$t=null;function En(e,n,l){K(Cs,n._currentValue),n._currentValue=l}function Wt(e){e._currentValue=Cs.current,V(Cs)}function Rs(e,n,l){for(;e!==null;){var s=e.alternate;if((e.childLanes&n)!==n?(e.childLanes|=n,s!==null&&(s.childLanes|=n)):s!==null&&(s.childLanes&n)!==n&&(s.childLanes|=n),e===l)break;e=e.return}}function Ms(e,n,l,s){var d=e.child;for(d!==null&&(d.return=e);d!==null;){var h=d.dependencies;if(h!==null){var T=d.child;h=h.firstContext;e:for(;h!==null;){var S=h;h=d;for(var C=0;C<n.length;C++)if(S.context===n[C]){h.lanes|=l,S=h.alternate,S!==null&&(S.lanes|=l),Rs(h.return,l,e),s||(T=null);break e}h=S.next}}else if(d.tag===18){if(T=d.return,T===null)throw Error(a(341));T.lanes|=l,h=T.alternate,h!==null&&(h.lanes|=l),Rs(T,l,e),T=null}else T=d.child;if(T!==null)T.return=d;else for(T=d;T!==null;){if(T===e){T=null;break}if(d=T.sibling,d!==null){d.return=T.return,T=d;break}T=T.return}d=T}}function Ri(e,n,l,s){e=null;for(var d=n,h=!1;d!==null;){if(!h){if((d.flags&524288)!==0)h=!0;else if((d.flags&262144)!==0)break}if(d.tag===10){var T=d.alternate;if(T===null)throw Error(a(387));if(T=T.memoizedProps,T!==null){var S=d.type;yt(d.pendingProps.value,T.value)||(e!==null?e.push(S):e=[S])}}else if(d===Se.current){if(T=d.alternate,T===null)throw Error(a(387));T.memoizedState.memoizedState!==d.memoizedState.memoizedState&&(e!==null?e.push(Fo):e=[Fo])}d=d.return}e!==null&&Ms(n,e,l,s),n.flags|=262144}function Sl(e){for(e=e.firstContext;e!==null;){if(!yt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function $n(e){Zn=e,$t=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function je(e){return Kc(Zn,e)}function Al(e,n){return Zn===null&&$n(e),Kc(e,n)}function Kc(e,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},$t===null){if(e===null)throw Error(a(308));$t=n,e.dependencies={lanes:0,firstContext:n},e.flags|=524288}else $t=$t.next=n;return l}var Vy=typeof AbortController<"u"?AbortController:function(){var e=[],n=this.signal={aborted:!1,addEventListener:function(l,s){e.push(s)}};this.abort=function(){n.aborted=!0,e.forEach(function(l){return l()})}},By=i.unstable_scheduleCallback,zy=i.unstable_NormalPriority,Oe={$$typeof:O,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ns(){return{controller:new Vy,data:new Map,refCount:0}}function yo(e){e.refCount--,e.refCount===0&&By(zy,function(){e.controller.abort()})}var vo=null,Is=0,Mi=0,Ni=null;function Oy(e,n){if(vo===null){var l=vo=[];Is=0,Mi=wr(),Ni={status:"pending",value:void 0,then:function(s){l.push(s)}}}return Is++,n.then(Qc,Qc),n}function Qc(){if(--Is===0&&vo!==null){Ni!==null&&(Ni.status="fulfilled");var e=vo;vo=null,Mi=0,Ni=null;for(var n=0;n<e.length;n++)(0,e[n])()}}function Fy(e,n){var l=[],s={status:"pending",value:null,reason:null,then:function(d){l.push(d)}};return e.then(function(){s.status="fulfilled",s.value=n;for(var d=0;d<l.length;d++)(0,l[d])(n)},function(d){for(s.status="rejected",s.reason=d,d=0;d<l.length;d++)(0,l[d])(void 0)}),s}var Xc=G.S;G.S=function(e,n){bd=ht(),typeof n=="object"&&n!==null&&typeof n.then=="function"&&Oy(e,n),Xc!==null&&Xc(e,n)};var Wn=M(null);function Ds(){var e=Wn.current;return e!==null?e:we.pooledCache}function Cl(e,n){n===null?K(Wn,Wn.current):K(Wn,n.pool)}function Zc(){var e=Ds();return e===null?null:{parent:Oe._currentValue,pool:e}}var Ii=Error(a(460)),Us=Error(a(474)),Rl=Error(a(542)),Ml={then:function(){}};function $c(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Wc(e,n,l){switch(l=e[l],l===void 0?e.push(n):l!==n&&(n.then(Kt,Kt),n=l),n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ef(e),e;default:if(typeof n.status=="string")n.then(Kt,Kt);else{if(e=we,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=n,e.status="pending",e.then(function(s){if(n.status==="pending"){var d=n;d.status="fulfilled",d.value=s}},function(s){if(n.status==="pending"){var d=n;d.status="rejected",d.reason=s}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw e=n.reason,ef(e),e}throw ei=n,Ii}}function jn(e){try{var n=e._init;return n(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(ei=l,Ii):l}}var ei=null;function jc(){if(ei===null)throw Error(a(459));var e=ei;return ei=null,e}function ef(e){if(e===Ii||e===Rl)throw Error(a(483))}var Di=null,To=0;function Nl(e){var n=To;return To+=1,Di===null&&(Di=[]),Wc(Di,e,n)}function Eo(e,n){n=n.props.ref,e.ref=n!==void 0?n:null}function Il(e,n){throw n.$$typeof===_?Error(a(525)):(e=Object.prototype.toString.call(n),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":e)))}function tf(e){function n(N,R){if(e){var D=N.deletions;D===null?(N.deletions=[R],N.flags|=16):D.push(R)}}function l(N,R){if(!e)return null;for(;R!==null;)n(N,R),R=R.sibling;return null}function s(N){for(var R=new Map;N!==null;)N.key!==null?R.set(N.key,N):R.set(N.index,N),N=N.sibling;return R}function d(N,R){return N=Xt(N,R),N.index=0,N.sibling=null,N}function h(N,R,D){return N.index=D,e?(D=N.alternate,D!==null?(D=D.index,D<R?(N.flags|=67108866,R):D):(N.flags|=67108866,R)):(N.flags|=1048576,R)}function T(N){return e&&N.alternate===null&&(N.flags|=67108866),N}function S(N,R,D,P){return R===null||R.tag!==6?(R=vs(D,N.mode,P),R.return=N,R):(R=d(R,D),R.return=N,R)}function C(N,R,D,P){var te=D.type;return te===L?H(N,R,D.props.children,P,D.key):R!==null&&(R.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===ue&&jn(te)===R.type)?(R=d(R,D.props),Eo(R,D),R.return=N,R):(R=El(D.type,D.key,D.props,null,N.mode,P),Eo(R,D),R.return=N,R)}function U(N,R,D,P){return R===null||R.tag!==4||R.stateNode.containerInfo!==D.containerInfo||R.stateNode.implementation!==D.implementation?(R=Ts(D,N.mode,P),R.return=N,R):(R=d(R,D.children||[]),R.return=N,R)}function H(N,R,D,P,te){return R===null||R.tag!==7?(R=Qn(D,N.mode,P,te),R.return=N,R):(R=d(R,D),R.return=N,R)}function q(N,R,D){if(typeof R=="string"&&R!==""||typeof R=="number"||typeof R=="bigint")return R=vs(""+R,N.mode,D),R.return=N,R;if(typeof R=="object"&&R!==null){switch(R.$$typeof){case A:return D=El(R.type,R.key,R.props,null,N.mode,D),Eo(D,R),D.return=N,D;case I:return R=Ts(R,N.mode,D),R.return=N,R;case ue:return R=jn(R),q(N,R,D)}if(qe(R)||Me(R))return R=Qn(R,N.mode,D,null),R.return=N,R;if(typeof R.then=="function")return q(N,Nl(R),D);if(R.$$typeof===O)return q(N,Al(N,R),D);Il(N,R)}return null}function w(N,R,D,P){var te=R!==null?R.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return te!==null?null:S(N,R,""+D,P);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case A:return D.key===te?C(N,R,D,P):null;case I:return D.key===te?U(N,R,D,P):null;case ue:return D=jn(D),w(N,R,D,P)}if(qe(D)||Me(D))return te!==null?null:H(N,R,D,P,null);if(typeof D.then=="function")return w(N,R,Nl(D),P);if(D.$$typeof===O)return w(N,R,Al(N,D),P);Il(N,D)}return null}function x(N,R,D,P,te){if(typeof P=="string"&&P!==""||typeof P=="number"||typeof P=="bigint")return N=N.get(D)||null,S(R,N,""+P,te);if(typeof P=="object"&&P!==null){switch(P.$$typeof){case A:return N=N.get(P.key===null?D:P.key)||null,C(R,N,P,te);case I:return N=N.get(P.key===null?D:P.key)||null,U(R,N,P,te);case ue:return P=jn(P),x(N,R,D,P,te)}if(qe(P)||Me(P))return N=N.get(D)||null,H(R,N,P,te,null);if(typeof P.then=="function")return x(N,R,D,Nl(P),te);if(P.$$typeof===O)return x(N,R,D,Al(R,P),te);Il(R,P)}return null}function X(N,R,D,P){for(var te=null,ye=null,W=R,se=R=0,he=null;W!==null&&se<D.length;se++){W.index>se?(he=W,W=null):he=W.sibling;var ve=w(N,W,D[se],P);if(ve===null){W===null&&(W=he);break}e&&W&&ve.alternate===null&&n(N,W),R=h(ve,R,se),ye===null?te=ve:ye.sibling=ve,ye=ve,W=he}if(se===D.length)return l(N,W),me&&Zt(N,se),te;if(W===null){for(;se<D.length;se++)W=q(N,D[se],P),W!==null&&(R=h(W,R,se),ye===null?te=W:ye.sibling=W,ye=W);return me&&Zt(N,se),te}for(W=s(W);se<D.length;se++)he=x(W,N,se,D[se],P),he!==null&&(e&&he.alternate!==null&&W.delete(he.key===null?se:he.key),R=h(he,R,se),ye===null?te=he:ye.sibling=he,ye=he);return e&&W.forEach(function(qn){return n(N,qn)}),me&&Zt(N,se),te}function ne(N,R,D,P){if(D==null)throw Error(a(151));for(var te=null,ye=null,W=R,se=R=0,he=null,ve=D.next();W!==null&&!ve.done;se++,ve=D.next()){W.index>se?(he=W,W=null):he=W.sibling;var qn=w(N,W,ve.value,P);if(qn===null){W===null&&(W=he);break}e&&W&&qn.alternate===null&&n(N,W),R=h(qn,R,se),ye===null?te=qn:ye.sibling=qn,ye=qn,W=he}if(ve.done)return l(N,W),me&&Zt(N,se),te;if(W===null){for(;!ve.done;se++,ve=D.next())ve=q(N,ve.value,P),ve!==null&&(R=h(ve,R,se),ye===null?te=ve:ye.sibling=ve,ye=ve);return me&&Zt(N,se),te}for(W=s(W);!ve.done;se++,ve=D.next())ve=x(W,N,se,ve.value,P),ve!==null&&(e&&ve.alternate!==null&&W.delete(ve.key===null?se:ve.key),R=h(ve,R,se),ye===null?te=ve:ye.sibling=ve,ye=ve);return e&&W.forEach(function(e0){return n(N,e0)}),me&&Zt(N,se),te}function De(N,R,D,P){if(typeof D=="object"&&D!==null&&D.type===L&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case A:e:{for(var te=D.key;R!==null;){if(R.key===te){if(te=D.type,te===L){if(R.tag===7){l(N,R.sibling),P=d(R,D.props.children),P.return=N,N=P;break e}}else if(R.elementType===te||typeof te=="object"&&te!==null&&te.$$typeof===ue&&jn(te)===R.type){l(N,R.sibling),P=d(R,D.props),Eo(P,D),P.return=N,N=P;break e}l(N,R);break}else n(N,R);R=R.sibling}D.type===L?(P=Qn(D.props.children,N.mode,P,D.key),P.return=N,N=P):(P=El(D.type,D.key,D.props,null,N.mode,P),Eo(P,D),P.return=N,N=P)}return T(N);case I:e:{for(te=D.key;R!==null;){if(R.key===te)if(R.tag===4&&R.stateNode.containerInfo===D.containerInfo&&R.stateNode.implementation===D.implementation){l(N,R.sibling),P=d(R,D.children||[]),P.return=N,N=P;break e}else{l(N,R);break}else n(N,R);R=R.sibling}P=Ts(D,N.mode,P),P.return=N,N=P}return T(N);case ue:return D=jn(D),De(N,R,D,P)}if(qe(D))return X(N,R,D,P);if(Me(D)){if(te=Me(D),typeof te!="function")throw Error(a(150));return D=te.call(D),ne(N,R,D,P)}if(typeof D.then=="function")return De(N,R,Nl(D),P);if(D.$$typeof===O)return De(N,R,Al(N,D),P);Il(N,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,R!==null&&R.tag===6?(l(N,R.sibling),P=d(R,D),P.return=N,N=P):(l(N,R),P=vs(D,N.mode,P),P.return=N,N=P),T(N)):l(N,R)}return function(N,R,D,P){try{To=0;var te=De(N,R,D,P);return Di=null,te}catch(W){if(W===Ii||W===Rl)throw W;var ye=vt(29,W,null,N.mode);return ye.lanes=P,ye.return=N,ye}finally{}}}var ti=tf(!0),nf=tf(!1),_n=!1;function ws(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function xs(e,n){e=e.updateQueue,n.updateQueue===e&&(n.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Sn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function An(e,n,l){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(_e&2)!==0){var d=s.pending;return d===null?n.next=n:(n.next=d.next,d.next=n),s.pending=n,n=Tl(e),Vc(e,null,l),n}return vl(e,s,n,l),Tl(e)}function _o(e,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,Ku(e,l)}}function bs(e,n){var l=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,l===s)){var d=null,h=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};h===null?d=h=T:h=h.next=T,l=l.next}while(l!==null);h===null?d=h=n:h=h.next=n}else d=h=n;l={baseState:s.baseState,firstBaseUpdate:d,lastBaseUpdate:h,shared:s.shared,callbacks:s.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=n:e.next=n,l.lastBaseUpdate=n}var Gs=!1;function So(){if(Gs){var e=Ni;if(e!==null)throw e}}function Ao(e,n,l,s){Gs=!1;var d=e.updateQueue;_n=!1;var h=d.firstBaseUpdate,T=d.lastBaseUpdate,S=d.shared.pending;if(S!==null){d.shared.pending=null;var C=S,U=C.next;C.next=null,T===null?h=U:T.next=U,T=C;var H=e.alternate;H!==null&&(H=H.updateQueue,S=H.lastBaseUpdate,S!==T&&(S===null?H.firstBaseUpdate=U:S.next=U,H.lastBaseUpdate=C))}if(h!==null){var q=d.baseState;T=0,H=U=C=null,S=h;do{var w=S.lane&-536870913,x=w!==S.lane;if(x?(pe&w)===w:(s&w)===w){w!==0&&w===Mi&&(Gs=!0),H!==null&&(H=H.next={lane:0,tag:S.tag,payload:S.payload,callback:null,next:null});e:{var X=e,ne=S;w=n;var De=l;switch(ne.tag){case 1:if(X=ne.payload,typeof X=="function"){q=X.call(De,q,w);break e}q=X;break e;case 3:X.flags=X.flags&-65537|128;case 0:if(X=ne.payload,w=typeof X=="function"?X.call(De,q,w):X,w==null)break e;q=E({},q,w);break e;case 2:_n=!0}}w=S.callback,w!==null&&(e.flags|=64,x&&(e.flags|=8192),x=d.callbacks,x===null?d.callbacks=[w]:x.push(w))}else x={lane:w,tag:S.tag,payload:S.payload,callback:S.callback,next:null},H===null?(U=H=x,C=q):H=H.next=x,T|=w;if(S=S.next,S===null){if(S=d.shared.pending,S===null)break;x=S,S=x.next,x.next=null,d.lastBaseUpdate=x,d.shared.pending=null}}while(!0);H===null&&(C=q),d.baseState=C,d.firstBaseUpdate=U,d.lastBaseUpdate=H,h===null&&(d.shared.lanes=0),In|=T,e.lanes=T,e.memoizedState=q}}function of(e,n){if(typeof e!="function")throw Error(a(191,e));e.call(n)}function lf(e,n){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)of(l[e],n)}var Ui=M(null),Dl=M(0);function af(e,n){e=rn,K(Dl,e),K(Ui,n),rn=e|n.baseLanes}function Ls(){K(Dl,rn),K(Ui,Ui.current)}function Hs(){rn=Dl.current,V(Ui),V(Dl)}var Tt=M(null),xt=null;function Cn(e){var n=e.alternate;K(Be,Be.current&1),K(Tt,e),xt===null&&(n===null||Ui.current!==null||n.memoizedState!==null)&&(xt=e)}function Ps(e){K(Be,Be.current),K(Tt,e),xt===null&&(xt=e)}function sf(e){e.tag===22?(K(Be,Be.current),K(Tt,e),xt===null&&(xt=e)):Rn()}function Rn(){K(Be,Be.current),K(Tt,Tt.current)}function Et(e){V(Tt),xt===e&&(xt=null),V(Be)}var Be=M(0);function Ul(e){for(var n=e;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Fr(l)||kr(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if((n.flags&128)!==0)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}var jt=0,ae=null,Ne=null,Fe=null,wl=!1,wi=!1,ni=!1,xl=0,Co=0,xi=null,ky=0;function He(){throw Error(a(321))}function qs(e,n){if(n===null)return!1;for(var l=0;l<n.length&&l<e.length;l++)if(!yt(e[l],n[l]))return!1;return!0}function Vs(e,n,l,s,d,h){return jt=h,ae=n,n.memoizedState=null,n.updateQueue=null,n.lanes=0,G.H=e===null||e.memoizedState===null?kf:er,ni=!1,h=l(s,d),ni=!1,wi&&(h=uf(n,l,s,d)),rf(e),h}function rf(e){G.H=No;var n=Ne!==null&&Ne.next!==null;if(jt=0,Fe=Ne=ae=null,wl=!1,Co=0,xi=null,n)throw Error(a(300));e===null||ke||(e=e.dependencies,e!==null&&Sl(e)&&(ke=!0))}function uf(e,n,l,s){ae=e;var d=0;do{if(wi&&(xi=null),Co=0,wi=!1,25<=d)throw Error(a(301));if(d+=1,Fe=Ne=null,e.updateQueue!=null){var h=e.updateQueue;h.lastEffect=null,h.events=null,h.stores=null,h.memoCache!=null&&(h.memoCache.index=0)}G.H=Jf,h=n(l,s)}while(wi);return h}function Jy(){var e=G.H,n=e.useState()[0];return n=typeof n.then=="function"?Ro(n):n,e=e.useState()[0],(Ne!==null?Ne.memoizedState:null)!==e&&(ae.flags|=1024),n}function Bs(){var e=xl!==0;return xl=0,e}function zs(e,n,l){n.updateQueue=e.updateQueue,n.flags&=-2053,e.lanes&=~l}function Os(e){if(wl){for(e=e.memoizedState;e!==null;){var n=e.queue;n!==null&&(n.pending=null),e=e.next}wl=!1}jt=0,Fe=Ne=ae=null,wi=!1,Co=xl=0,xi=null}function ot(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Fe===null?ae.memoizedState=Fe=e:Fe=Fe.next=e,Fe}function ze(){if(Ne===null){var e=ae.alternate;e=e!==null?e.memoizedState:null}else e=Ne.next;var n=Fe===null?ae.memoizedState:Fe.next;if(n!==null)Fe=n,Ne=e;else{if(e===null)throw ae.alternate===null?Error(a(467)):Error(a(310));Ne=e,e={memoizedState:Ne.memoizedState,baseState:Ne.baseState,baseQueue:Ne.baseQueue,queue:Ne.queue,next:null},Fe===null?ae.memoizedState=Fe=e:Fe=Fe.next=e}return Fe}function bl(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ro(e){var n=Co;return Co+=1,xi===null&&(xi=[]),e=Wc(xi,e,n),n=ae,(Fe===null?n.memoizedState:Fe.next)===null&&(n=n.alternate,G.H=n===null||n.memoizedState===null?kf:er),e}function Gl(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ro(e);if(e.$$typeof===O)return je(e)}throw Error(a(438,String(e)))}function Fs(e){var n=null,l=ae.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var s=ae.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(n={data:s.data.map(function(d){return d.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=bl(),ae.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0)for(l=n.data[n.index]=Array(e),s=0;s<e;s++)l[s]=re;return n.index++,l}function en(e,n){return typeof n=="function"?n(e):n}function Ll(e){var n=ze();return ks(n,Ne,e)}function ks(e,n,l){var s=e.queue;if(s===null)throw Error(a(311));s.lastRenderedReducer=l;var d=e.baseQueue,h=s.pending;if(h!==null){if(d!==null){var T=d.next;d.next=h.next,h.next=T}n.baseQueue=d=h,s.pending=null}if(h=e.baseState,d===null)e.memoizedState=h;else{n=d.next;var S=T=null,C=null,U=n,H=!1;do{var q=U.lane&-536870913;if(q!==U.lane?(pe&q)===q:(jt&q)===q){var w=U.revertLane;if(w===0)C!==null&&(C=C.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),q===Mi&&(H=!0);else if((jt&w)===w){U=U.next,w===Mi&&(H=!0);continue}else q={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},C===null?(S=C=q,T=h):C=C.next=q,ae.lanes|=w,In|=w;q=U.action,ni&&l(h,q),h=U.hasEagerState?U.eagerState:l(h,q)}else w={lane:q,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},C===null?(S=C=w,T=h):C=C.next=w,ae.lanes|=q,In|=q;U=U.next}while(U!==null&&U!==n);if(C===null?T=h:C.next=S,!yt(h,e.memoizedState)&&(ke=!0,H&&(l=Ni,l!==null)))throw l;e.memoizedState=h,e.baseState=T,e.baseQueue=C,s.lastRenderedState=h}return d===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Js(e){var n=ze(),l=n.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var s=l.dispatch,d=l.pending,h=n.memoizedState;if(d!==null){l.pending=null;var T=d=d.next;do h=e(h,T.action),T=T.next;while(T!==d);yt(h,n.memoizedState)||(ke=!0),n.memoizedState=h,n.baseQueue===null&&(n.baseState=h),l.lastRenderedState=h}return[h,s]}function cf(e,n,l){var s=ae,d=ze(),h=me;if(h){if(l===void 0)throw Error(a(407));l=l()}else l=n();var T=!yt((Ne||d).memoizedState,l);if(T&&(d.memoizedState=l,ke=!0),d=d.queue,Qs(pf.bind(null,s,d,e),[e]),d.getSnapshot!==n||T||Fe!==null&&Fe.memoizedState.tag&1){if(s.flags|=2048,bi(9,{destroy:void 0},df.bind(null,s,d,l,n),null),we===null)throw Error(a(349));h||(jt&127)!==0||ff(s,n,l)}return l}function ff(e,n,l){e.flags|=16384,e={getSnapshot:n,value:l},n=ae.updateQueue,n===null?(n=bl(),ae.updateQueue=n,n.stores=[e]):(l=n.stores,l===null?n.stores=[e]:l.push(e))}function df(e,n,l,s){n.value=l,n.getSnapshot=s,hf(n)&&mf(e)}function pf(e,n,l){return l(function(){hf(n)&&mf(e)})}function hf(e){var n=e.getSnapshot;e=e.value;try{var l=n();return!yt(e,l)}catch{return!0}}function mf(e){var n=Kn(e,2);n!==null&&pt(n,e,2)}function Ys(e){var n=ot();if(typeof e=="function"){var l=e;if(e=l(),ni){hn(!0);try{l()}finally{hn(!1)}}}return n.memoizedState=n.baseState=e,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:e},n}function gf(e,n,l,s){return e.baseState=l,ks(e,Ne,typeof s=="function"?s:en)}function Yy(e,n,l,s,d){if(ql(e))throw Error(a(485));if(e=n.action,e!==null){var h={payload:d,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){h.listeners.push(T)}};G.T!==null?l(!0):h.isTransition=!1,s(h),l=n.pending,l===null?(h.next=n.pending=h,yf(n,h)):(h.next=l.next,n.pending=l.next=h)}}function yf(e,n){var l=n.action,s=n.payload,d=e.state;if(n.isTransition){var h=G.T,T={};G.T=T;try{var S=l(d,s),C=G.S;C!==null&&C(T,S),vf(e,n,S)}catch(U){Ks(e,n,U)}finally{h!==null&&T.types!==null&&(h.types=T.types),G.T=h}}else try{h=l(d,s),vf(e,n,h)}catch(U){Ks(e,n,U)}}function vf(e,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(s){Tf(e,n,s)},function(s){return Ks(e,n,s)}):Tf(e,n,l)}function Tf(e,n,l){n.status="fulfilled",n.value=l,Ef(n),e.state=l,n=e.pending,n!==null&&(l=n.next,l===n?e.pending=null:(l=l.next,n.next=l,yf(e,l)))}function Ks(e,n,l){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do n.status="rejected",n.reason=l,Ef(n),n=n.next;while(n!==s)}e.action=null}function Ef(e){e=e.listeners;for(var n=0;n<e.length;n++)(0,e[n])()}function _f(e,n){return n}function Sf(e,n){if(me){var l=we.formState;if(l!==null){e:{var s=ae;if(me){if(be){t:{for(var d=be,h=wt;d.nodeType!==8;){if(!h){d=null;break t}if(d=bt(d.nextSibling),d===null){d=null;break t}}h=d.data,d=h==="F!"||h==="F"?d:null}if(d){be=bt(d.nextSibling),s=d.data==="F!";break e}}Tn(s)}s=!1}s&&(n=l[0])}}return l=ot(),l.memoizedState=l.baseState=n,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_f,lastRenderedState:n},l.queue=s,l=zf.bind(null,ae,s),s.dispatch=l,s=Ys(!1),h=js.bind(null,ae,!1,s.queue),s=ot(),d={state:n,dispatch:null,action:e,pending:null},s.queue=d,l=Yy.bind(null,ae,d,h,l),d.dispatch=l,s.memoizedState=e,[n,l,!1]}function Af(e){var n=ze();return Cf(n,Ne,e)}function Cf(e,n,l){if(n=ks(e,n,_f)[0],e=Ll(en)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var s=Ro(n)}catch(T){throw T===Ii?Rl:T}else s=n;n=ze();var d=n.queue,h=d.dispatch;return l!==n.memoizedState&&(ae.flags|=2048,bi(9,{destroy:void 0},Ky.bind(null,d,l),null)),[s,h,e]}function Ky(e,n){e.action=n}function Rf(e){var n=ze(),l=Ne;if(l!==null)return Cf(n,l,e);ze(),n=n.memoizedState,l=ze();var s=l.queue.dispatch;return l.memoizedState=e,[n,s,!1]}function bi(e,n,l,s){return e={tag:e,create:l,deps:s,inst:n,next:null},n=ae.updateQueue,n===null&&(n=bl(),ae.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=e.next=e:(s=l.next,l.next=e,e.next=s,n.lastEffect=e),e}function Mf(){return ze().memoizedState}function Hl(e,n,l,s){var d=ot();ae.flags|=e,d.memoizedState=bi(1|n,{destroy:void 0},l,s===void 0?null:s)}function Pl(e,n,l,s){var d=ze();s=s===void 0?null:s;var h=d.memoizedState.inst;Ne!==null&&s!==null&&qs(s,Ne.memoizedState.deps)?d.memoizedState=bi(n,h,l,s):(ae.flags|=e,d.memoizedState=bi(1|n,h,l,s))}function Nf(e,n){Hl(8390656,8,e,n)}function Qs(e,n){Pl(2048,8,e,n)}function Qy(e){ae.flags|=4;var n=ae.updateQueue;if(n===null)n=bl(),ae.updateQueue=n,n.events=[e];else{var l=n.events;l===null?n.events=[e]:l.push(e)}}function If(e){var n=ze().memoizedState;return Qy({ref:n,nextImpl:e}),function(){if((_e&2)!==0)throw Error(a(440));return n.impl.apply(void 0,arguments)}}function Df(e,n){return Pl(4,2,e,n)}function Uf(e,n){return Pl(4,4,e,n)}function wf(e,n){if(typeof n=="function"){e=e();var l=n(e);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return e=e(),n.current=e,function(){n.current=null}}function xf(e,n,l){l=l!=null?l.concat([e]):null,Pl(4,4,wf.bind(null,n,e),l)}function Xs(){}function bf(e,n){var l=ze();n=n===void 0?null:n;var s=l.memoizedState;return n!==null&&qs(n,s[1])?s[0]:(l.memoizedState=[e,n],e)}function Gf(e,n){var l=ze();n=n===void 0?null:n;var s=l.memoizedState;if(n!==null&&qs(n,s[1]))return s[0];if(s=e(),ni){hn(!0);try{e()}finally{hn(!1)}}return l.memoizedState=[s,n],s}function Zs(e,n,l){return l===void 0||(jt&1073741824)!==0&&(pe&261930)===0?e.memoizedState=n:(e.memoizedState=l,e=Ld(),ae.lanes|=e,In|=e,l)}function Lf(e,n,l,s){return yt(l,n)?l:Ui.current!==null?(e=Zs(e,l,s),yt(e,n)||(ke=!0),e):(jt&42)===0||(jt&1073741824)!==0&&(pe&261930)===0?(ke=!0,e.memoizedState=l):(e=Ld(),ae.lanes|=e,In|=e,n)}function Hf(e,n,l,s,d){var h=F.p;F.p=h!==0&&8>h?h:8;var T=G.T,S={};G.T=S,js(e,!1,n,l);try{var C=d(),U=G.S;if(U!==null&&U(S,C),C!==null&&typeof C=="object"&&typeof C.then=="function"){var H=Fy(C,s);Mo(e,n,H,At(e))}else Mo(e,n,s,At(e))}catch(q){Mo(e,n,{then:function(){},status:"rejected",reason:q},At())}finally{F.p=h,T!==null&&S.types!==null&&(T.types=S.types),G.T=T}}function Xy(){}function $s(e,n,l,s){if(e.tag!==5)throw Error(a(476));var d=Pf(e).queue;Hf(e,d,n,ee,l===null?Xy:function(){return qf(e),l(s)})}function Pf(e){var n=e.memoizedState;if(n!==null)return n;n={memoizedState:ee,baseState:ee,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:ee},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:en,lastRenderedState:l},next:null},e.memoizedState=n,e=e.alternate,e!==null&&(e.memoizedState=n),n}function qf(e){var n=Pf(e);n.next===null&&(n=e.alternate.memoizedState),Mo(e,n.next.queue,{},At())}function Ws(){return je(Fo)}function Vf(){return ze().memoizedState}function Bf(){return ze().memoizedState}function Zy(e){for(var n=e.return;n!==null;){switch(n.tag){case 24:case 3:var l=At();e=Sn(l);var s=An(n,e,l);s!==null&&(pt(s,n,l),_o(s,n,l)),n={cache:Ns()},e.payload=n;return}n=n.return}}function $y(e,n,l){var s=At();l={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ql(e)?Of(n,l):(l=gs(e,n,l,s),l!==null&&(pt(l,e,s),Ff(l,n,s)))}function zf(e,n,l){var s=At();Mo(e,n,l,s)}function Mo(e,n,l,s){var d={lane:s,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ql(e))Of(n,d);else{var h=e.alternate;if(e.lanes===0&&(h===null||h.lanes===0)&&(h=n.lastRenderedReducer,h!==null))try{var T=n.lastRenderedState,S=h(T,l);if(d.hasEagerState=!0,d.eagerState=S,yt(S,T))return vl(e,n,d,0),we===null&&yl(),!1}catch{}finally{}if(l=gs(e,n,d,s),l!==null)return pt(l,e,s),Ff(l,n,s),!0}return!1}function js(e,n,l,s){if(s={lane:2,revertLane:wr(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},ql(e)){if(n)throw Error(a(479))}else n=gs(e,l,s,2),n!==null&&pt(n,e,2)}function ql(e){var n=e.alternate;return e===ae||n!==null&&n===ae}function Of(e,n){wi=wl=!0;var l=e.pending;l===null?n.next=n:(n.next=l.next,l.next=n),e.pending=n}function Ff(e,n,l){if((l&4194048)!==0){var s=n.lanes;s&=e.pendingLanes,l|=s,n.lanes=l,Ku(e,l)}}var No={readContext:je,use:Gl,useCallback:He,useContext:He,useEffect:He,useImperativeHandle:He,useLayoutEffect:He,useInsertionEffect:He,useMemo:He,useReducer:He,useRef:He,useState:He,useDebugValue:He,useDeferredValue:He,useTransition:He,useSyncExternalStore:He,useId:He,useHostTransitionStatus:He,useFormState:He,useActionState:He,useOptimistic:He,useMemoCache:He,useCacheRefresh:He};No.useEffectEvent=He;var kf={readContext:je,use:Gl,useCallback:function(e,n){return ot().memoizedState=[e,n===void 0?null:n],e},useContext:je,useEffect:Nf,useImperativeHandle:function(e,n,l){l=l!=null?l.concat([e]):null,Hl(4194308,4,wf.bind(null,n,e),l)},useLayoutEffect:function(e,n){return Hl(4194308,4,e,n)},useInsertionEffect:function(e,n){Hl(4,2,e,n)},useMemo:function(e,n){var l=ot();n=n===void 0?null:n;var s=e();if(ni){hn(!0);try{e()}finally{hn(!1)}}return l.memoizedState=[s,n],s},useReducer:function(e,n,l){var s=ot();if(l!==void 0){var d=l(n);if(ni){hn(!0);try{l(n)}finally{hn(!1)}}}else d=n;return s.memoizedState=s.baseState=d,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:d},s.queue=e,e=e.dispatch=$y.bind(null,ae,e),[s.memoizedState,e]},useRef:function(e){var n=ot();return e={current:e},n.memoizedState=e},useState:function(e){e=Ys(e);var n=e.queue,l=zf.bind(null,ae,n);return n.dispatch=l,[e.memoizedState,l]},useDebugValue:Xs,useDeferredValue:function(e,n){var l=ot();return Zs(l,e,n)},useTransition:function(){var e=Ys(!1);return e=Hf.bind(null,ae,e.queue,!0,!1),ot().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,n,l){var s=ae,d=ot();if(me){if(l===void 0)throw Error(a(407));l=l()}else{if(l=n(),we===null)throw Error(a(349));(pe&127)!==0||ff(s,n,l)}d.memoizedState=l;var h={value:l,getSnapshot:n};return d.queue=h,Nf(pf.bind(null,s,h,e),[e]),s.flags|=2048,bi(9,{destroy:void 0},df.bind(null,s,h,l,n),null),l},useId:function(){var e=ot(),n=we.identifierPrefix;if(me){var l=Ft,s=Ot;l=(s&~(1<<32-gt(s)-1)).toString(32)+l,n="_"+n+"R_"+l,l=xl++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=ky++,n="_"+n+"r_"+l.toString(32)+"_";return e.memoizedState=n},useHostTransitionStatus:Ws,useFormState:Sf,useActionState:Sf,useOptimistic:function(e){var n=ot();n.memoizedState=n.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=js.bind(null,ae,!0,l),l.dispatch=n,[e,n]},useMemoCache:Fs,useCacheRefresh:function(){return ot().memoizedState=Zy.bind(null,ae)},useEffectEvent:function(e){var n=ot(),l={impl:e};return n.memoizedState=l,function(){if((_e&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},er={readContext:je,use:Gl,useCallback:bf,useContext:je,useEffect:Qs,useImperativeHandle:xf,useInsertionEffect:Df,useLayoutEffect:Uf,useMemo:Gf,useReducer:Ll,useRef:Mf,useState:function(){return Ll(en)},useDebugValue:Xs,useDeferredValue:function(e,n){var l=ze();return Lf(l,Ne.memoizedState,e,n)},useTransition:function(){var e=Ll(en)[0],n=ze().memoizedState;return[typeof e=="boolean"?e:Ro(e),n]},useSyncExternalStore:cf,useId:Vf,useHostTransitionStatus:Ws,useFormState:Af,useActionState:Af,useOptimistic:function(e,n){var l=ze();return gf(l,Ne,e,n)},useMemoCache:Fs,useCacheRefresh:Bf};er.useEffectEvent=If;var Jf={readContext:je,use:Gl,useCallback:bf,useContext:je,useEffect:Qs,useImperativeHandle:xf,useInsertionEffect:Df,useLayoutEffect:Uf,useMemo:Gf,useReducer:Js,useRef:Mf,useState:function(){return Js(en)},useDebugValue:Xs,useDeferredValue:function(e,n){var l=ze();return Ne===null?Zs(l,e,n):Lf(l,Ne.memoizedState,e,n)},useTransition:function(){var e=Js(en)[0],n=ze().memoizedState;return[typeof e=="boolean"?e:Ro(e),n]},useSyncExternalStore:cf,useId:Vf,useHostTransitionStatus:Ws,useFormState:Rf,useActionState:Rf,useOptimistic:function(e,n){var l=ze();return Ne!==null?gf(l,Ne,e,n):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:Fs,useCacheRefresh:Bf};Jf.useEffectEvent=If;function tr(e,n,l,s){n=e.memoizedState,l=l(s,n),l=l==null?n:E({},n,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var nr={enqueueSetState:function(e,n,l){e=e._reactInternals;var s=At(),d=Sn(s);d.payload=n,l!=null&&(d.callback=l),n=An(e,d,s),n!==null&&(pt(n,e,s),_o(n,e,s))},enqueueReplaceState:function(e,n,l){e=e._reactInternals;var s=At(),d=Sn(s);d.tag=1,d.payload=n,l!=null&&(d.callback=l),n=An(e,d,s),n!==null&&(pt(n,e,s),_o(n,e,s))},enqueueForceUpdate:function(e,n){e=e._reactInternals;var l=At(),s=Sn(l);s.tag=2,n!=null&&(s.callback=n),n=An(e,s,l),n!==null&&(pt(n,e,l),_o(n,e,l))}};function Yf(e,n,l,s,d,h,T){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,h,T):n.prototype&&n.prototype.isPureReactComponent?!po(l,s)||!po(d,h):!0}function Kf(e,n,l,s){e=n.state,typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,s),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,s),n.state!==e&&nr.enqueueReplaceState(n,n.state,null)}function ii(e,n){var l=n;if("ref"in n){l={};for(var s in n)s!=="ref"&&(l[s]=n[s])}if(e=e.defaultProps){l===n&&(l=E({},l));for(var d in e)l[d]===void 0&&(l[d]=e[d])}return l}function Qf(e){gl(e)}function Xf(e){console.error(e)}function Zf(e){gl(e)}function Vl(e,n){try{var l=e.onUncaughtError;l(n.value,{componentStack:n.stack})}catch(s){setTimeout(function(){throw s})}}function $f(e,n,l){try{var s=e.onCaughtError;s(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(d){setTimeout(function(){throw d})}}function ir(e,n,l){return l=Sn(l),l.tag=3,l.payload={element:null},l.callback=function(){Vl(e,n)},l}function Wf(e){return e=Sn(e),e.tag=3,e}function jf(e,n,l,s){var d=l.type.getDerivedStateFromError;if(typeof d=="function"){var h=s.value;e.payload=function(){return d(h)},e.callback=function(){$f(n,l,s)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(e.callback=function(){$f(n,l,s),typeof d!="function"&&(Dn===null?Dn=new Set([this]):Dn.add(this));var S=s.stack;this.componentDidCatch(s.value,{componentStack:S!==null?S:""})})}function Wy(e,n,l,s,d){if(l.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(n=l.alternate,n!==null&&Ri(n,l,d,!0),l=Tt.current,l!==null){switch(l.tag){case 31:case 13:return xt===null?$l():l.alternate===null&&Pe===0&&(Pe=3),l.flags&=-257,l.flags|=65536,l.lanes=d,s===Ml?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([s]):n.add(s),Ir(e,s,d)),!1;case 22:return l.flags|=65536,s===Ml?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([s])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([s]):l.add(s)),Ir(e,s,d)),!1}throw Error(a(435,l.tag))}return Ir(e,s,d),$l(),!1}if(me)return n=Tt.current,n!==null?((n.flags&65536)===0&&(n.flags|=256),n.flags|=65536,n.lanes=d,s!==Ss&&(e=Error(a(422),{cause:s}),go(It(e,l)))):(s!==Ss&&(n=Error(a(423),{cause:s}),go(It(n,l))),e=e.current.alternate,e.flags|=65536,d&=-d,e.lanes|=d,s=It(s,l),d=ir(e.stateNode,s,d),bs(e,d),Pe!==4&&(Pe=2)),!1;var h=Error(a(520),{cause:s});if(h=It(h,l),Lo===null?Lo=[h]:Lo.push(h),Pe!==4&&(Pe=2),n===null)return!0;s=It(s,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,e=d&-d,l.lanes|=e,e=ir(l.stateNode,s,e),bs(l,e),!1;case 1:if(n=l.type,h=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||h!==null&&typeof h.componentDidCatch=="function"&&(Dn===null||!Dn.has(h))))return l.flags|=65536,d&=-d,l.lanes|=d,d=Wf(d),jf(d,e,l,s),bs(l,d),!1}l=l.return}while(l!==null);return!1}var or=Error(a(461)),ke=!1;function et(e,n,l,s){n.child=e===null?nf(n,null,l,s):ti(n,e.child,l,s)}function ed(e,n,l,s,d){l=l.render;var h=n.ref;if("ref"in s){var T={};for(var S in s)S!=="ref"&&(T[S]=s[S])}else T=s;return $n(n),s=Vs(e,n,l,T,h,d),S=Bs(),e!==null&&!ke?(zs(e,n,d),tn(e,n,d)):(me&&S&&Es(n),n.flags|=1,et(e,n,s,d),n.child)}function td(e,n,l,s,d){if(e===null){var h=l.type;return typeof h=="function"&&!ys(h)&&h.defaultProps===void 0&&l.compare===null?(n.tag=15,n.type=h,nd(e,n,h,s,d)):(e=El(l.type,null,s,n,n.mode,d),e.ref=n.ref,e.return=n,n.child=e)}if(h=e.child,!dr(e,d)){var T=h.memoizedProps;if(l=l.compare,l=l!==null?l:po,l(T,s)&&e.ref===n.ref)return tn(e,n,d)}return n.flags|=1,e=Xt(h,s),e.ref=n.ref,e.return=n,n.child=e}function nd(e,n,l,s,d){if(e!==null){var h=e.memoizedProps;if(po(h,s)&&e.ref===n.ref)if(ke=!1,n.pendingProps=s=h,dr(e,d))(e.flags&131072)!==0&&(ke=!0);else return n.lanes=e.lanes,tn(e,n,d)}return lr(e,n,l,s,d)}function id(e,n,l,s){var d=s.children,h=e!==null?e.memoizedState:null;if(e===null&&n.stateNode===null&&(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((n.flags&128)!==0){if(h=h!==null?h.baseLanes|l:l,e!==null){for(s=n.child=e.child,d=0;s!==null;)d=d|s.lanes|s.childLanes,s=s.sibling;s=d&~h}else s=0,n.child=null;return od(e,n,h,l,s)}if((l&536870912)!==0)n.memoizedState={baseLanes:0,cachePool:null},e!==null&&Cl(n,h!==null?h.cachePool:null),h!==null?af(n,h):Ls(),sf(n);else return s=n.lanes=536870912,od(e,n,h!==null?h.baseLanes|l:l,l,s)}else h!==null?(Cl(n,h.cachePool),af(n,h),Rn(),n.memoizedState=null):(e!==null&&Cl(n,null),Ls(),Rn());return et(e,n,d,l),n.child}function Io(e,n){return e!==null&&e.tag===22||n.stateNode!==null||(n.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function od(e,n,l,s,d){var h=Ds();return h=h===null?null:{parent:Oe._currentValue,pool:h},n.memoizedState={baseLanes:l,cachePool:h},e!==null&&Cl(n,null),Ls(),sf(n),e!==null&&Ri(e,n,s,!0),n.childLanes=d,null}function Bl(e,n){return n=Ol({mode:n.mode,children:n.children},e.mode),n.ref=e.ref,e.child=n,n.return=e,n}function ld(e,n,l){return ti(n,e.child,null,l),e=Bl(n,n.pendingProps),e.flags|=2,Et(n),n.memoizedState=null,e}function jy(e,n,l){var s=n.pendingProps,d=(n.flags&128)!==0;if(n.flags&=-129,e===null){if(me){if(s.mode==="hidden")return e=Bl(n,s),n.lanes=536870912,Io(null,e);if(Ps(n),(e=be)?(e=yp(e,wt),e=e!==null&&e.data==="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:yn!==null?{id:Ot,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},l=zc(e),l.return=n,n.child=l,We=n,be=null)):e=null,e===null)throw Tn(n);return n.lanes=536870912,null}return Bl(n,s)}var h=e.memoizedState;if(h!==null){var T=h.dehydrated;if(Ps(n),d)if(n.flags&256)n.flags&=-257,n=ld(e,n,l);else if(n.memoizedState!==null)n.child=e.child,n.flags|=128,n=null;else throw Error(a(558));else if(ke||Ri(e,n,l,!1),d=(l&e.childLanes)!==0,ke||d){if(s=we,s!==null&&(T=Qu(s,l),T!==0&&T!==h.retryLane))throw h.retryLane=T,Kn(e,T),pt(s,e,T),or;$l(),n=ld(e,n,l)}else e=h.treeContext,be=bt(T.nextSibling),We=n,me=!0,vn=null,wt=!1,e!==null&&kc(n,e),n=Bl(n,s),n.flags|=4096;return n}return e=Xt(e.child,{mode:s.mode,children:s.children}),e.ref=n.ref,n.child=e,e.return=n,e}function zl(e,n){var l=n.ref;if(l===null)e!==null&&e.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(n.flags|=4194816)}}function lr(e,n,l,s,d){return $n(n),l=Vs(e,n,l,s,void 0,d),s=Bs(),e!==null&&!ke?(zs(e,n,d),tn(e,n,d)):(me&&s&&Es(n),n.flags|=1,et(e,n,l,d),n.child)}function ad(e,n,l,s,d,h){return $n(n),n.updateQueue=null,l=uf(n,s,l,d),rf(e),s=Bs(),e!==null&&!ke?(zs(e,n,h),tn(e,n,h)):(me&&s&&Es(n),n.flags|=1,et(e,n,l,h),n.child)}function sd(e,n,l,s,d){if($n(n),n.stateNode===null){var h=_i,T=l.contextType;typeof T=="object"&&T!==null&&(h=je(T)),h=new l(s,h),n.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,h.updater=nr,n.stateNode=h,h._reactInternals=n,h=n.stateNode,h.props=s,h.state=n.memoizedState,h.refs={},ws(n),T=l.contextType,h.context=typeof T=="object"&&T!==null?je(T):_i,h.state=n.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(tr(n,l,T,s),h.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(T=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),T!==h.state&&nr.enqueueReplaceState(h,h.state,null),Ao(n,s,h,d),So(),h.state=n.memoizedState),typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!0}else if(e===null){h=n.stateNode;var S=n.memoizedProps,C=ii(l,S);h.props=C;var U=h.context,H=l.contextType;T=_i,typeof H=="object"&&H!==null&&(T=je(H));var q=l.getDerivedStateFromProps;H=typeof q=="function"||typeof h.getSnapshotBeforeUpdate=="function",S=n.pendingProps!==S,H||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(S||U!==T)&&Kf(n,h,s,T),_n=!1;var w=n.memoizedState;h.state=w,Ao(n,s,h,d),So(),U=n.memoizedState,S||w!==U||_n?(typeof q=="function"&&(tr(n,l,q,s),U=n.memoizedState),(C=_n||Yf(n,l,C,s,w,U,T))?(H||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount()),typeof h.componentDidMount=="function"&&(n.flags|=4194308)):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),n.memoizedProps=s,n.memoizedState=U),h.props=s,h.state=U,h.context=T,s=C):(typeof h.componentDidMount=="function"&&(n.flags|=4194308),s=!1)}else{h=n.stateNode,xs(e,n),T=n.memoizedProps,H=ii(l,T),h.props=H,q=n.pendingProps,w=h.context,U=l.contextType,C=_i,typeof U=="object"&&U!==null&&(C=je(U)),S=l.getDerivedStateFromProps,(U=typeof S=="function"||typeof h.getSnapshotBeforeUpdate=="function")||typeof h.UNSAFE_componentWillReceiveProps!="function"&&typeof h.componentWillReceiveProps!="function"||(T!==q||w!==C)&&Kf(n,h,s,C),_n=!1,w=n.memoizedState,h.state=w,Ao(n,s,h,d),So();var x=n.memoizedState;T!==q||w!==x||_n||e!==null&&e.dependencies!==null&&Sl(e.dependencies)?(typeof S=="function"&&(tr(n,l,S,s),x=n.memoizedState),(H=_n||Yf(n,l,H,s,w,x,C)||e!==null&&e.dependencies!==null&&Sl(e.dependencies))?(U||typeof h.UNSAFE_componentWillUpdate!="function"&&typeof h.componentWillUpdate!="function"||(typeof h.componentWillUpdate=="function"&&h.componentWillUpdate(s,x,C),typeof h.UNSAFE_componentWillUpdate=="function"&&h.UNSAFE_componentWillUpdate(s,x,C)),typeof h.componentDidUpdate=="function"&&(n.flags|=4),typeof h.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof h.componentDidUpdate!="function"||T===e.memoizedProps&&w===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&w===e.memoizedState||(n.flags|=1024),n.memoizedProps=s,n.memoizedState=x),h.props=s,h.state=x,h.context=C,s=H):(typeof h.componentDidUpdate!="function"||T===e.memoizedProps&&w===e.memoizedState||(n.flags|=4),typeof h.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&w===e.memoizedState||(n.flags|=1024),s=!1)}return h=s,zl(e,n),s=(n.flags&128)!==0,h||s?(h=n.stateNode,l=s&&typeof l.getDerivedStateFromError!="function"?null:h.render(),n.flags|=1,e!==null&&s?(n.child=ti(n,e.child,null,d),n.child=ti(n,null,l,d)):et(e,n,l,d),n.memoizedState=h.state,e=n.child):e=tn(e,n,d),e}function rd(e,n,l,s){return Xn(),n.flags|=256,et(e,n,l,s),n.child}var ar={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function sr(e){return{baseLanes:e,cachePool:Zc()}}function rr(e,n,l){return e=e!==null?e.childLanes&~l:0,n&&(e|=St),e}function ud(e,n,l){var s=n.pendingProps,d=!1,h=(n.flags&128)!==0,T;if((T=h)||(T=e!==null&&e.memoizedState===null?!1:(Be.current&2)!==0),T&&(d=!0,n.flags&=-129),T=(n.flags&32)!==0,n.flags&=-33,e===null){if(me){if(d?Cn(n):Rn(),(e=be)?(e=yp(e,wt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(n.memoizedState={dehydrated:e,treeContext:yn!==null?{id:Ot,overflow:Ft}:null,retryLane:536870912,hydrationErrors:null},l=zc(e),l.return=n,n.child=l,We=n,be=null)):e=null,e===null)throw Tn(n);return kr(e)?n.lanes=32:n.lanes=536870912,null}var S=s.children;return s=s.fallback,d?(Rn(),d=n.mode,S=Ol({mode:"hidden",children:S},d),s=Qn(s,d,l,null),S.return=n,s.return=n,S.sibling=s,n.child=S,s=n.child,s.memoizedState=sr(l),s.childLanes=rr(e,T,l),n.memoizedState=ar,Io(null,s)):(Cn(n),ur(n,S))}var C=e.memoizedState;if(C!==null&&(S=C.dehydrated,S!==null)){if(h)n.flags&256?(Cn(n),n.flags&=-257,n=cr(e,n,l)):n.memoizedState!==null?(Rn(),n.child=e.child,n.flags|=128,n=null):(Rn(),S=s.fallback,d=n.mode,s=Ol({mode:"visible",children:s.children},d),S=Qn(S,d,l,null),S.flags|=2,s.return=n,S.return=n,s.sibling=S,n.child=s,ti(n,e.child,null,l),s=n.child,s.memoizedState=sr(l),s.childLanes=rr(e,T,l),n.memoizedState=ar,n=Io(null,s));else if(Cn(n),kr(S)){if(T=S.nextSibling&&S.nextSibling.dataset,T)var U=T.dgst;T=U,s=Error(a(419)),s.stack="",s.digest=T,go({value:s,source:null,stack:null}),n=cr(e,n,l)}else if(ke||Ri(e,n,l,!1),T=(l&e.childLanes)!==0,ke||T){if(T=we,T!==null&&(s=Qu(T,l),s!==0&&s!==C.retryLane))throw C.retryLane=s,Kn(e,s),pt(T,e,s),or;Fr(S)||$l(),n=cr(e,n,l)}else Fr(S)?(n.flags|=192,n.child=e.child,n=null):(e=C.treeContext,be=bt(S.nextSibling),We=n,me=!0,vn=null,wt=!1,e!==null&&kc(n,e),n=ur(n,s.children),n.flags|=4096);return n}return d?(Rn(),S=s.fallback,d=n.mode,C=e.child,U=C.sibling,s=Xt(C,{mode:"hidden",children:s.children}),s.subtreeFlags=C.subtreeFlags&65011712,U!==null?S=Xt(U,S):(S=Qn(S,d,l,null),S.flags|=2),S.return=n,s.return=n,s.sibling=S,n.child=s,Io(null,s),s=n.child,S=e.child.memoizedState,S===null?S=sr(l):(d=S.cachePool,d!==null?(C=Oe._currentValue,d=d.parent!==C?{parent:C,pool:C}:d):d=Zc(),S={baseLanes:S.baseLanes|l,cachePool:d}),s.memoizedState=S,s.childLanes=rr(e,T,l),n.memoizedState=ar,Io(e.child,s)):(Cn(n),l=e.child,e=l.sibling,l=Xt(l,{mode:"visible",children:s.children}),l.return=n,l.sibling=null,e!==null&&(T=n.deletions,T===null?(n.deletions=[e],n.flags|=16):T.push(e)),n.child=l,n.memoizedState=null,l)}function ur(e,n){return n=Ol({mode:"visible",children:n},e.mode),n.return=e,e.child=n}function Ol(e,n){return e=vt(22,e,null,n),e.lanes=0,e}function cr(e,n,l){return ti(n,e.child,null,l),e=ur(n,n.pendingProps.children),e.flags|=2,n.memoizedState=null,e}function cd(e,n,l){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n),Rs(e.return,n,l)}function fr(e,n,l,s,d,h){var T=e.memoizedState;T===null?e.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:s,tail:l,tailMode:d,treeForkCount:h}:(T.isBackwards=n,T.rendering=null,T.renderingStartTime=0,T.last=s,T.tail=l,T.tailMode=d,T.treeForkCount=h)}function fd(e,n,l){var s=n.pendingProps,d=s.revealOrder,h=s.tail;s=s.children;var T=Be.current,S=(T&2)!==0;if(S?(T=T&1|2,n.flags|=128):T&=1,K(Be,T),et(e,n,s,l),s=me?mo:0,!S&&e!==null&&(e.flags&128)!==0)e:for(e=n.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&cd(e,l,n);else if(e.tag===19)cd(e,l,n);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===n)break e;for(;e.sibling===null;){if(e.return===null||e.return===n)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(d){case"forwards":for(l=n.child,d=null;l!==null;)e=l.alternate,e!==null&&Ul(e)===null&&(d=l),l=l.sibling;l=d,l===null?(d=n.child,n.child=null):(d=l.sibling,l.sibling=null),fr(n,!1,d,l,h,s);break;case"backwards":case"unstable_legacy-backwards":for(l=null,d=n.child,n.child=null;d!==null;){if(e=d.alternate,e!==null&&Ul(e)===null){n.child=d;break}e=d.sibling,d.sibling=l,l=d,d=e}fr(n,!0,l,null,h,s);break;case"together":fr(n,!1,null,null,void 0,s);break;default:n.memoizedState=null}return n.child}function tn(e,n,l){if(e!==null&&(n.dependencies=e.dependencies),In|=n.lanes,(l&n.childLanes)===0)if(e!==null){if(Ri(e,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(e!==null&&n.child!==e.child)throw Error(a(153));if(n.child!==null){for(e=n.child,l=Xt(e,e.pendingProps),n.child=l,l.return=n;e.sibling!==null;)e=e.sibling,l=l.sibling=Xt(e,e.pendingProps),l.return=n;l.sibling=null}return n.child}function dr(e,n){return(e.lanes&n)!==0?!0:(e=e.dependencies,!!(e!==null&&Sl(e)))}function ev(e,n,l){switch(n.tag){case 3:it(n,n.stateNode.containerInfo),En(n,Oe,e.memoizedState.cache),Xn();break;case 27:case 5:ji(n);break;case 4:it(n,n.stateNode.containerInfo);break;case 10:En(n,n.type,n.memoizedProps.value);break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ps(n),null;break;case 13:var s=n.memoizedState;if(s!==null)return s.dehydrated!==null?(Cn(n),n.flags|=128,null):(l&n.child.childLanes)!==0?ud(e,n,l):(Cn(n),e=tn(e,n,l),e!==null?e.sibling:null);Cn(n);break;case 19:var d=(e.flags&128)!==0;if(s=(l&n.childLanes)!==0,s||(Ri(e,n,l,!1),s=(l&n.childLanes)!==0),d){if(s)return fd(e,n,l);n.flags|=128}if(d=n.memoizedState,d!==null&&(d.rendering=null,d.tail=null,d.lastEffect=null),K(Be,Be.current),s)break;return null;case 22:return n.lanes=0,id(e,n,l,n.pendingProps);case 24:En(n,Oe,e.memoizedState.cache)}return tn(e,n,l)}function dd(e,n,l){if(e!==null)if(e.memoizedProps!==n.pendingProps)ke=!0;else{if(!dr(e,l)&&(n.flags&128)===0)return ke=!1,ev(e,n,l);ke=(e.flags&131072)!==0}else ke=!1,me&&(n.flags&1048576)!==0&&Fc(n,mo,n.index);switch(n.lanes=0,n.tag){case 16:e:{var s=n.pendingProps;if(e=jn(n.elementType),n.type=e,typeof e=="function")ys(e)?(s=ii(e,s),n.tag=1,n=sd(null,n,e,s,l)):(n.tag=0,n=lr(null,n,e,s,l));else{if(e!=null){var d=e.$$typeof;if(d===k){n.tag=11,n=ed(null,n,e,s,l);break e}else if(d===J){n.tag=14,n=td(null,n,e,s,l);break e}}throw n=Ae(e)||e,Error(a(306,n,""))}}return n;case 0:return lr(e,n,n.type,n.pendingProps,l);case 1:return s=n.type,d=ii(s,n.pendingProps),sd(e,n,s,d,l);case 3:e:{if(it(n,n.stateNode.containerInfo),e===null)throw Error(a(387));s=n.pendingProps;var h=n.memoizedState;d=h.element,xs(e,n),Ao(n,s,null,l);var T=n.memoizedState;if(s=T.cache,En(n,Oe,s),s!==h.cache&&Ms(n,[Oe],l,!0),So(),s=T.element,h.isDehydrated)if(h={element:s,isDehydrated:!1,cache:T.cache},n.updateQueue.baseState=h,n.memoizedState=h,n.flags&256){n=rd(e,n,s,l);break e}else if(s!==d){d=It(Error(a(424)),n),go(d),n=rd(e,n,s,l);break e}else{switch(e=n.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(be=bt(e.firstChild),We=n,me=!0,vn=null,wt=!0,l=nf(n,null,s,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Xn(),s===d){n=tn(e,n,l);break e}et(e,n,s,l)}n=n.child}return n;case 26:return zl(e,n),e===null?(l=Ap(n.type,null,n.pendingProps,null))?n.memoizedState=l:me||(l=n.type,e=n.pendingProps,s=oa(ce.current).createElement(l),s[$e]=n,s[st]=e,tt(s,l,e),Ke(s),n.stateNode=s):n.memoizedState=Ap(n.type,e.memoizedProps,n.pendingProps,e.memoizedState),null;case 27:return ji(n),e===null&&me&&(s=n.stateNode=Ep(n.type,n.pendingProps,ce.current),We=n,wt=!0,d=be,bn(n.type)?(Jr=d,be=bt(s.firstChild)):be=d),et(e,n,n.pendingProps.children,l),zl(e,n),e===null&&(n.flags|=4194304),n.child;case 5:return e===null&&me&&((d=s=be)&&(s=Uv(s,n.type,n.pendingProps,wt),s!==null?(n.stateNode=s,We=n,be=bt(s.firstChild),wt=!1,d=!0):d=!1),d||Tn(n)),ji(n),d=n.type,h=n.pendingProps,T=e!==null?e.memoizedProps:null,s=h.children,Br(d,h)?s=null:T!==null&&Br(d,T)&&(n.flags|=32),n.memoizedState!==null&&(d=Vs(e,n,Jy,null,null,l),Fo._currentValue=d),zl(e,n),et(e,n,s,l),n.child;case 6:return e===null&&me&&((e=l=be)&&(l=wv(l,n.pendingProps,wt),l!==null?(n.stateNode=l,We=n,be=null,e=!0):e=!1),e||Tn(n)),null;case 13:return ud(e,n,l);case 4:return it(n,n.stateNode.containerInfo),s=n.pendingProps,e===null?n.child=ti(n,null,s,l):et(e,n,s,l),n.child;case 11:return ed(e,n,n.type,n.pendingProps,l);case 7:return et(e,n,n.pendingProps,l),n.child;case 8:return et(e,n,n.pendingProps.children,l),n.child;case 12:return et(e,n,n.pendingProps.children,l),n.child;case 10:return s=n.pendingProps,En(n,n.type,s.value),et(e,n,s.children,l),n.child;case 9:return d=n.type._context,s=n.pendingProps.children,$n(n),d=je(d),s=s(d),n.flags|=1,et(e,n,s,l),n.child;case 14:return td(e,n,n.type,n.pendingProps,l);case 15:return nd(e,n,n.type,n.pendingProps,l);case 19:return fd(e,n,l);case 31:return jy(e,n,l);case 22:return id(e,n,l,n.pendingProps);case 24:return $n(n),s=je(Oe),e===null?(d=Ds(),d===null&&(d=we,h=Ns(),d.pooledCache=h,h.refCount++,h!==null&&(d.pooledCacheLanes|=l),d=h),n.memoizedState={parent:s,cache:d},ws(n),En(n,Oe,d)):((e.lanes&l)!==0&&(xs(e,n),Ao(n,null,null,l),So()),d=e.memoizedState,h=n.memoizedState,d.parent!==s?(d={parent:s,cache:s},n.memoizedState=d,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=d),En(n,Oe,s)):(s=h.cache,En(n,Oe,s),s!==d.cache&&Ms(n,[Oe],l,!0))),et(e,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error(a(156,n.tag))}function nn(e){e.flags|=4}function pr(e,n,l,s,d){if((n=(e.mode&32)!==0)&&(n=!1),n){if(e.flags|=16777216,(d&335544128)===d)if(e.stateNode.complete)e.flags|=8192;else if(Vd())e.flags|=8192;else throw ei=Ml,Us}else e.flags&=-16777217}function pd(e,n){if(n.type!=="stylesheet"||(n.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Ip(n))if(Vd())e.flags|=8192;else throw ei=Ml,Us}function Fl(e,n){n!==null&&(e.flags|=4),e.flags&16384&&(n=e.tag!==22?Ju():536870912,e.lanes|=n,Pi|=n)}function Do(e,n){if(!me)switch(e.tailMode){case"hidden":n=e.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var s=null;l!==null;)l.alternate!==null&&(s=l),l=l.sibling;s===null?n||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null}}function Ge(e){var n=e.alternate!==null&&e.alternate.child===e.child,l=0,s=0;if(n)for(var d=e.child;d!==null;)l|=d.lanes|d.childLanes,s|=d.subtreeFlags&65011712,s|=d.flags&65011712,d.return=e,d=d.sibling;else for(d=e.child;d!==null;)l|=d.lanes|d.childLanes,s|=d.subtreeFlags,s|=d.flags,d.return=e,d=d.sibling;return e.subtreeFlags|=s,e.childLanes=l,n}function tv(e,n,l){var s=n.pendingProps;switch(_s(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(n),null;case 1:return Ge(n),null;case 3:return l=n.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),n.memoizedState.cache!==s&&(n.flags|=2048),Wt(Oe),Ve(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Ci(n)?nn(n):e===null||e.memoizedState.isDehydrated&&(n.flags&256)===0||(n.flags|=1024,As())),Ge(n),null;case 26:var d=n.type,h=n.memoizedState;return e===null?(nn(n),h!==null?(Ge(n),pd(n,h)):(Ge(n),pr(n,d,null,s,l))):h?h!==e.memoizedState?(nn(n),Ge(n),pd(n,h)):(Ge(n),n.flags&=-16777217):(e=e.memoizedProps,e!==s&&nn(n),Ge(n),pr(n,d,e,s,l)),null;case 27:if(el(n),l=ce.current,d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&nn(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return Ge(n),null}e=$.current,Ci(n)?Jc(n):(e=Ep(d,s,l),n.stateNode=e,nn(n))}return Ge(n),null;case 5:if(el(n),d=n.type,e!==null&&n.stateNode!=null)e.memoizedProps!==s&&nn(n);else{if(!s){if(n.stateNode===null)throw Error(a(166));return Ge(n),null}if(h=$.current,Ci(n))Jc(n);else{var T=oa(ce.current);switch(h){case 1:h=T.createElementNS("http://www.w3.org/2000/svg",d);break;case 2:h=T.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;default:switch(d){case"svg":h=T.createElementNS("http://www.w3.org/2000/svg",d);break;case"math":h=T.createElementNS("http://www.w3.org/1998/Math/MathML",d);break;case"script":h=T.createElement("div"),h.innerHTML="<script><\/script>",h=h.removeChild(h.firstChild);break;case"select":h=typeof s.is=="string"?T.createElement("select",{is:s.is}):T.createElement("select"),s.multiple?h.multiple=!0:s.size&&(h.size=s.size);break;default:h=typeof s.is=="string"?T.createElement(d,{is:s.is}):T.createElement(d)}}h[$e]=n,h[st]=s;e:for(T=n.child;T!==null;){if(T.tag===5||T.tag===6)h.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===n)break e;for(;T.sibling===null;){if(T.return===null||T.return===n)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}n.stateNode=h;e:switch(tt(h,d,s),d){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&nn(n)}}return Ge(n),pr(n,n.type,e===null?null:e.memoizedProps,n.pendingProps,l),null;case 6:if(e&&n.stateNode!=null)e.memoizedProps!==s&&nn(n);else{if(typeof s!="string"&&n.stateNode===null)throw Error(a(166));if(e=ce.current,Ci(n)){if(e=n.stateNode,l=n.memoizedProps,s=null,d=We,d!==null)switch(d.tag){case 27:case 5:s=d.memoizedProps}e[$e]=n,e=!!(e.nodeValue===l||s!==null&&s.suppressHydrationWarning===!0||up(e.nodeValue,l)),e||Tn(n,!0)}else e=oa(e).createTextNode(s),e[$e]=n,n.stateNode=e}return Ge(n),null;case 31:if(l=n.memoizedState,e===null||e.memoizedState!==null){if(s=Ci(n),l!==null){if(e===null){if(!s)throw Error(a(318));if(e=n.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[$e]=n}else Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ge(n),e=!1}else l=As(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return n.flags&256?(Et(n),n):(Et(n),null);if((n.flags&128)!==0)throw Error(a(558))}return Ge(n),null;case 13:if(s=n.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(d=Ci(n),s!==null&&s.dehydrated!==null){if(e===null){if(!d)throw Error(a(318));if(d=n.memoizedState,d=d!==null?d.dehydrated:null,!d)throw Error(a(317));d[$e]=n}else Xn(),(n.flags&128)===0&&(n.memoizedState=null),n.flags|=4;Ge(n),d=!1}else d=As(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=d),d=!0;if(!d)return n.flags&256?(Et(n),n):(Et(n),null)}return Et(n),(n.flags&128)!==0?(n.lanes=l,n):(l=s!==null,e=e!==null&&e.memoizedState!==null,l&&(s=n.child,d=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(d=s.alternate.memoizedState.cachePool.pool),h=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(h=s.memoizedState.cachePool.pool),h!==d&&(s.flags|=2048)),l!==e&&l&&(n.child.flags|=8192),Fl(n,n.updateQueue),Ge(n),null);case 4:return Ve(),e===null&&Lr(n.stateNode.containerInfo),Ge(n),null;case 10:return Wt(n.type),Ge(n),null;case 19:if(V(Be),s=n.memoizedState,s===null)return Ge(n),null;if(d=(n.flags&128)!==0,h=s.rendering,h===null)if(d)Do(s,!1);else{if(Pe!==0||e!==null&&(e.flags&128)!==0)for(e=n.child;e!==null;){if(h=Ul(e),h!==null){for(n.flags|=128,Do(s,!1),e=h.updateQueue,n.updateQueue=e,Fl(n,e),n.subtreeFlags=0,e=l,l=n.child;l!==null;)Bc(l,e),l=l.sibling;return K(Be,Be.current&1|2),me&&Zt(n,s.treeForkCount),n.child}e=e.sibling}s.tail!==null&&ht()>Ql&&(n.flags|=128,d=!0,Do(s,!1),n.lanes=4194304)}else{if(!d)if(e=Ul(h),e!==null){if(n.flags|=128,d=!0,e=e.updateQueue,n.updateQueue=e,Fl(n,e),Do(s,!0),s.tail===null&&s.tailMode==="hidden"&&!h.alternate&&!me)return Ge(n),null}else 2*ht()-s.renderingStartTime>Ql&&l!==536870912&&(n.flags|=128,d=!0,Do(s,!1),n.lanes=4194304);s.isBackwards?(h.sibling=n.child,n.child=h):(e=s.last,e!==null?e.sibling=h:n.child=h,s.last=h)}return s.tail!==null?(e=s.tail,s.rendering=e,s.tail=e.sibling,s.renderingStartTime=ht(),e.sibling=null,l=Be.current,K(Be,d?l&1|2:l&1),me&&Zt(n,s.treeForkCount),e):(Ge(n),null);case 22:case 23:return Et(n),Hs(),s=n.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(n.flags|=8192):s&&(n.flags|=8192),s?(l&536870912)!==0&&(n.flags&128)===0&&(Ge(n),n.subtreeFlags&6&&(n.flags|=8192)):Ge(n),l=n.updateQueue,l!==null&&Fl(n,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),s=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(s=n.memoizedState.cachePool.pool),s!==l&&(n.flags|=2048),e!==null&&V(Wn),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Wt(Oe),Ge(n),null;case 25:return null;case 30:return null}throw Error(a(156,n.tag))}function nv(e,n){switch(_s(n),n.tag){case 1:return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 3:return Wt(Oe),Ve(),e=n.flags,(e&65536)!==0&&(e&128)===0?(n.flags=e&-65537|128,n):null;case 26:case 27:case 5:return el(n),null;case 31:if(n.memoizedState!==null){if(Et(n),n.alternate===null)throw Error(a(340));Xn()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 13:if(Et(n),e=n.memoizedState,e!==null&&e.dehydrated!==null){if(n.alternate===null)throw Error(a(340));Xn()}return e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 19:return V(Be),null;case 4:return Ve(),null;case 10:return Wt(n.type),null;case 22:case 23:return Et(n),Hs(),e!==null&&V(Wn),e=n.flags,e&65536?(n.flags=e&-65537|128,n):null;case 24:return Wt(Oe),null;case 25:return null;default:return null}}function hd(e,n){switch(_s(n),n.tag){case 3:Wt(Oe),Ve();break;case 26:case 27:case 5:el(n);break;case 4:Ve();break;case 31:n.memoizedState!==null&&Et(n);break;case 13:Et(n);break;case 19:V(Be);break;case 10:Wt(n.type);break;case 22:case 23:Et(n),Hs(),e!==null&&V(Wn);break;case 24:Wt(Oe)}}function Uo(e,n){try{var l=n.updateQueue,s=l!==null?l.lastEffect:null;if(s!==null){var d=s.next;l=d;do{if((l.tag&e)===e){s=void 0;var h=l.create,T=l.inst;s=h(),T.destroy=s}l=l.next}while(l!==d)}}catch(S){Re(n,n.return,S)}}function Mn(e,n,l){try{var s=n.updateQueue,d=s!==null?s.lastEffect:null;if(d!==null){var h=d.next;s=h;do{if((s.tag&e)===e){var T=s.inst,S=T.destroy;if(S!==void 0){T.destroy=void 0,d=n;var C=l,U=S;try{U()}catch(H){Re(d,C,H)}}}s=s.next}while(s!==h)}}catch(H){Re(n,n.return,H)}}function md(e){var n=e.updateQueue;if(n!==null){var l=e.stateNode;try{lf(n,l)}catch(s){Re(e,e.return,s)}}}function gd(e,n,l){l.props=ii(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(s){Re(e,n,s)}}function wo(e,n){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:s=e.stateNode;break;default:s=e.stateNode}typeof l=="function"?e.refCleanup=l(s):l.current=s}}catch(d){Re(e,n,d)}}function kt(e,n){var l=e.ref,s=e.refCleanup;if(l!==null)if(typeof s=="function")try{s()}catch(d){Re(e,n,d)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(d){Re(e,n,d)}else l.current=null}function yd(e){var n=e.type,l=e.memoizedProps,s=e.stateNode;try{e:switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&s.focus();break e;case"img":l.src?s.src=l.src:l.srcSet&&(s.srcset=l.srcSet)}}catch(d){Re(e,e.return,d)}}function hr(e,n,l){try{var s=e.stateNode;Cv(s,e.type,l,n),s[st]=n}catch(d){Re(e,e.return,d)}}function vd(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&bn(e.type)||e.tag===4}function mr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||vd(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&bn(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function gr(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,n):(n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(e),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Kt));else if(s!==4&&(s===27&&bn(e.type)&&(l=e.stateNode,n=null),e=e.child,e!==null))for(gr(e,n,l),e=e.sibling;e!==null;)gr(e,n,l),e=e.sibling}function kl(e,n,l){var s=e.tag;if(s===5||s===6)e=e.stateNode,n?l.insertBefore(e,n):l.appendChild(e);else if(s!==4&&(s===27&&bn(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(kl(e,n,l),e=e.sibling;e!==null;)kl(e,n,l),e=e.sibling}function Td(e){var n=e.stateNode,l=e.memoizedProps;try{for(var s=e.type,d=n.attributes;d.length;)n.removeAttributeNode(d[0]);tt(n,s,l),n[$e]=e,n[st]=l}catch(h){Re(e,e.return,h)}}var on=!1,Je=!1,yr=!1,Ed=typeof WeakSet=="function"?WeakSet:Set,Qe=null;function iv(e,n){if(e=e.containerInfo,qr=fa,e=wc(e),cs(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var s=l.getSelection&&l.getSelection();if(s&&s.rangeCount!==0){l=s.anchorNode;var d=s.anchorOffset,h=s.focusNode;s=s.focusOffset;try{l.nodeType,h.nodeType}catch{l=null;break e}var T=0,S=-1,C=-1,U=0,H=0,q=e,w=null;t:for(;;){for(var x;q!==l||d!==0&&q.nodeType!==3||(S=T+d),q!==h||s!==0&&q.nodeType!==3||(C=T+s),q.nodeType===3&&(T+=q.nodeValue.length),(x=q.firstChild)!==null;)w=q,q=x;for(;;){if(q===e)break t;if(w===l&&++U===d&&(S=T),w===h&&++H===s&&(C=T),(x=q.nextSibling)!==null)break;q=w,w=q.parentNode}q=x}l=S===-1||C===-1?null:{start:S,end:C}}else l=null}l=l||{start:0,end:0}}else l=null;for(Vr={focusedElem:e,selectionRange:l},fa=!1,Qe=n;Qe!==null;)if(n=Qe,e=n.child,(n.subtreeFlags&1028)!==0&&e!==null)e.return=n,Qe=e;else for(;Qe!==null;){switch(n=Qe,h=n.alternate,e=n.flags,n.tag){case 0:if((e&4)!==0&&(e=n.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)d=e[l],d.ref.impl=d.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&h!==null){e=void 0,l=n,d=h.memoizedProps,h=h.memoizedState,s=l.stateNode;try{var X=ii(l.type,d);e=s.getSnapshotBeforeUpdate(X,h),s.__reactInternalSnapshotBeforeUpdate=e}catch(ne){Re(l,l.return,ne)}}break;case 3:if((e&1024)!==0){if(e=n.stateNode.containerInfo,l=e.nodeType,l===9)Or(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Or(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(a(163))}if(e=n.sibling,e!==null){e.return=n.return,Qe=e;break}Qe=n.return}}function _d(e,n,l){var s=l.flags;switch(l.tag){case 0:case 11:case 15:an(e,l),s&4&&Uo(5,l);break;case 1:if(an(e,l),s&4)if(e=l.stateNode,n===null)try{e.componentDidMount()}catch(T){Re(l,l.return,T)}else{var d=ii(l.type,n.memoizedProps);n=n.memoizedState;try{e.componentDidUpdate(d,n,e.__reactInternalSnapshotBeforeUpdate)}catch(T){Re(l,l.return,T)}}s&64&&md(l),s&512&&wo(l,l.return);break;case 3:if(an(e,l),s&64&&(e=l.updateQueue,e!==null)){if(n=null,l.child!==null)switch(l.child.tag){case 27:case 5:n=l.child.stateNode;break;case 1:n=l.child.stateNode}try{lf(e,n)}catch(T){Re(l,l.return,T)}}break;case 27:n===null&&s&4&&Td(l);case 26:case 5:an(e,l),n===null&&s&4&&yd(l),s&512&&wo(l,l.return);break;case 12:an(e,l);break;case 31:an(e,l),s&4&&Cd(e,l);break;case 13:an(e,l),s&4&&Rd(e,l),s&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=dv.bind(null,l),xv(e,l))));break;case 22:if(s=l.memoizedState!==null||on,!s){n=n!==null&&n.memoizedState!==null||Je,d=on;var h=Je;on=s,(Je=n)&&!h?sn(e,l,(l.subtreeFlags&8772)!==0):an(e,l),on=d,Je=h}break;case 30:break;default:an(e,l)}}function Sd(e){var n=e.alternate;n!==null&&(e.alternate=null,Sd(n)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(n=e.stateNode,n!==null&&Ka(n)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Le=null,ut=!1;function ln(e,n,l){for(l=l.child;l!==null;)Ad(e,n,l),l=l.sibling}function Ad(e,n,l){if(mt&&typeof mt.onCommitFiberUnmount=="function")try{mt.onCommitFiberUnmount(eo,l)}catch{}switch(l.tag){case 26:Je||kt(l,n),ln(e,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Je||kt(l,n);var s=Le,d=ut;bn(l.type)&&(Le=l.stateNode,ut=!1),ln(e,n,l),Bo(l.stateNode),Le=s,ut=d;break;case 5:Je||kt(l,n);case 6:if(s=Le,d=ut,Le=null,ln(e,n,l),Le=s,ut=d,Le!==null)if(ut)try{(Le.nodeType===9?Le.body:Le.nodeName==="HTML"?Le.ownerDocument.body:Le).removeChild(l.stateNode)}catch(h){Re(l,n,h)}else try{Le.removeChild(l.stateNode)}catch(h){Re(l,n,h)}break;case 18:Le!==null&&(ut?(e=Le,mp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),Ji(e)):mp(Le,l.stateNode));break;case 4:s=Le,d=ut,Le=l.stateNode.containerInfo,ut=!0,ln(e,n,l),Le=s,ut=d;break;case 0:case 11:case 14:case 15:Mn(2,l,n),Je||Mn(4,l,n),ln(e,n,l);break;case 1:Je||(kt(l,n),s=l.stateNode,typeof s.componentWillUnmount=="function"&&gd(l,n,s)),ln(e,n,l);break;case 21:ln(e,n,l);break;case 22:Je=(s=Je)||l.memoizedState!==null,ln(e,n,l),Je=s;break;default:ln(e,n,l)}}function Cd(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Ji(e)}catch(l){Re(n,n.return,l)}}}function Rd(e,n){if(n.memoizedState===null&&(e=n.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Ji(e)}catch(l){Re(n,n.return,l)}}function ov(e){switch(e.tag){case 31:case 13:case 19:var n=e.stateNode;return n===null&&(n=e.stateNode=new Ed),n;case 22:return e=e.stateNode,n=e._retryCache,n===null&&(n=e._retryCache=new Ed),n;default:throw Error(a(435,e.tag))}}function Jl(e,n){var l=ov(e);n.forEach(function(s){if(!l.has(s)){l.add(s);var d=pv.bind(null,e,s);s.then(d,d)}})}function ct(e,n){var l=n.deletions;if(l!==null)for(var s=0;s<l.length;s++){var d=l[s],h=e,T=n,S=T;e:for(;S!==null;){switch(S.tag){case 27:if(bn(S.type)){Le=S.stateNode,ut=!1;break e}break;case 5:Le=S.stateNode,ut=!1;break e;case 3:case 4:Le=S.stateNode.containerInfo,ut=!0;break e}S=S.return}if(Le===null)throw Error(a(160));Ad(h,T,d),Le=null,ut=!1,h=d.alternate,h!==null&&(h.return=null),d.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)Md(n,e),n=n.sibling}var Pt=null;function Md(e,n){var l=e.alternate,s=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:ct(n,e),ft(e),s&4&&(Mn(3,e,e.return),Uo(3,e),Mn(5,e,e.return));break;case 1:ct(n,e),ft(e),s&512&&(Je||l===null||kt(l,l.return)),s&64&&on&&(e=e.updateQueue,e!==null&&(s=e.callbacks,s!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?s:l.concat(s))));break;case 26:var d=Pt;if(ct(n,e),ft(e),s&512&&(Je||l===null||kt(l,l.return)),s&4){var h=l!==null?l.memoizedState:null;if(s=e.memoizedState,l===null)if(s===null)if(e.stateNode===null){e:{s=e.type,l=e.memoizedProps,d=d.ownerDocument||d;t:switch(s){case"title":h=d.getElementsByTagName("title")[0],(!h||h[io]||h[$e]||h.namespaceURI==="http://www.w3.org/2000/svg"||h.hasAttribute("itemprop"))&&(h=d.createElement(s),d.head.insertBefore(h,d.querySelector("head > title"))),tt(h,s,l),h[$e]=e,Ke(h),s=h;break e;case"link":var T=Mp("link","href",d).get(s+(l.href||""));if(T){for(var S=0;S<T.length;S++)if(h=T[S],h.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&h.getAttribute("rel")===(l.rel==null?null:l.rel)&&h.getAttribute("title")===(l.title==null?null:l.title)&&h.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(S,1);break t}}h=d.createElement(s),tt(h,s,l),d.head.appendChild(h);break;case"meta":if(T=Mp("meta","content",d).get(s+(l.content||""))){for(S=0;S<T.length;S++)if(h=T[S],h.getAttribute("content")===(l.content==null?null:""+l.content)&&h.getAttribute("name")===(l.name==null?null:l.name)&&h.getAttribute("property")===(l.property==null?null:l.property)&&h.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&h.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(S,1);break t}}h=d.createElement(s),tt(h,s,l),d.head.appendChild(h);break;default:throw Error(a(468,s))}h[$e]=e,Ke(h),s=h}e.stateNode=s}else Np(d,e.type,e.stateNode);else e.stateNode=Rp(d,s,e.memoizedProps);else h!==s?(h===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):h.count--,s===null?Np(d,e.type,e.stateNode):Rp(d,s,e.memoizedProps)):s===null&&e.stateNode!==null&&hr(e,e.memoizedProps,l.memoizedProps)}break;case 27:ct(n,e),ft(e),s&512&&(Je||l===null||kt(l,l.return)),l!==null&&s&4&&hr(e,e.memoizedProps,l.memoizedProps);break;case 5:if(ct(n,e),ft(e),s&512&&(Je||l===null||kt(l,l.return)),e.flags&32){d=e.stateNode;try{hi(d,"")}catch(X){Re(e,e.return,X)}}s&4&&e.stateNode!=null&&(d=e.memoizedProps,hr(e,d,l!==null?l.memoizedProps:d)),s&1024&&(yr=!0);break;case 6:if(ct(n,e),ft(e),s&4){if(e.stateNode===null)throw Error(a(162));s=e.memoizedProps,l=e.stateNode;try{l.nodeValue=s}catch(X){Re(e,e.return,X)}}break;case 3:if(sa=null,d=Pt,Pt=la(n.containerInfo),ct(n,e),Pt=d,ft(e),s&4&&l!==null&&l.memoizedState.isDehydrated)try{Ji(n.containerInfo)}catch(X){Re(e,e.return,X)}yr&&(yr=!1,Nd(e));break;case 4:s=Pt,Pt=la(e.stateNode.containerInfo),ct(n,e),ft(e),Pt=s;break;case 12:ct(n,e),ft(e);break;case 31:ct(n,e),ft(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Jl(e,s)));break;case 13:ct(n,e),ft(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Kl=ht()),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Jl(e,s)));break;case 22:d=e.memoizedState!==null;var C=l!==null&&l.memoizedState!==null,U=on,H=Je;if(on=U||d,Je=H||C,ct(n,e),Je=H,on=U,ft(e),s&8192)e:for(n=e.stateNode,n._visibility=d?n._visibility&-2:n._visibility|1,d&&(l===null||C||on||Je||oi(e)),l=null,n=e;;){if(n.tag===5||n.tag===26){if(l===null){C=l=n;try{if(h=C.stateNode,d)T=h.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{S=C.stateNode;var q=C.memoizedProps.style,w=q!=null&&q.hasOwnProperty("display")?q.display:null;S.style.display=w==null||typeof w=="boolean"?"":(""+w).trim()}}catch(X){Re(C,C.return,X)}}}else if(n.tag===6){if(l===null){C=n;try{C.stateNode.nodeValue=d?"":C.memoizedProps}catch(X){Re(C,C.return,X)}}}else if(n.tag===18){if(l===null){C=n;try{var x=C.stateNode;d?gp(x,!0):gp(C.stateNode,!1)}catch(X){Re(C,C.return,X)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===e)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===e)break e;for(;n.sibling===null;){if(n.return===null||n.return===e)break e;l===n&&(l=null),n=n.return}l===n&&(l=null),n.sibling.return=n.return,n=n.sibling}s&4&&(s=e.updateQueue,s!==null&&(l=s.retryQueue,l!==null&&(s.retryQueue=null,Jl(e,l))));break;case 19:ct(n,e),ft(e),s&4&&(s=e.updateQueue,s!==null&&(e.updateQueue=null,Jl(e,s)));break;case 30:break;case 21:break;default:ct(n,e),ft(e)}}function ft(e){var n=e.flags;if(n&2){try{for(var l,s=e.return;s!==null;){if(vd(s)){l=s;break}s=s.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var d=l.stateNode,h=mr(e);kl(e,h,d);break;case 5:var T=l.stateNode;l.flags&32&&(hi(T,""),l.flags&=-33);var S=mr(e);kl(e,S,T);break;case 3:case 4:var C=l.stateNode.containerInfo,U=mr(e);gr(e,U,C);break;default:throw Error(a(161))}}catch(H){Re(e,e.return,H)}e.flags&=-3}n&4096&&(e.flags&=-4097)}function Nd(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var n=e;Nd(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),e=e.sibling}}function an(e,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)_d(e,n.alternate,n),n=n.sibling}function oi(e){for(e=e.child;e!==null;){var n=e;switch(n.tag){case 0:case 11:case 14:case 15:Mn(4,n,n.return),oi(n);break;case 1:kt(n,n.return);var l=n.stateNode;typeof l.componentWillUnmount=="function"&&gd(n,n.return,l),oi(n);break;case 27:Bo(n.stateNode);case 26:case 5:kt(n,n.return),oi(n);break;case 22:n.memoizedState===null&&oi(n);break;case 30:oi(n);break;default:oi(n)}e=e.sibling}}function sn(e,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;){var s=n.alternate,d=e,h=n,T=h.flags;switch(h.tag){case 0:case 11:case 15:sn(d,h,l),Uo(4,h);break;case 1:if(sn(d,h,l),s=h,d=s.stateNode,typeof d.componentDidMount=="function")try{d.componentDidMount()}catch(U){Re(s,s.return,U)}if(s=h,d=s.updateQueue,d!==null){var S=s.stateNode;try{var C=d.shared.hiddenCallbacks;if(C!==null)for(d.shared.hiddenCallbacks=null,d=0;d<C.length;d++)of(C[d],S)}catch(U){Re(s,s.return,U)}}l&&T&64&&md(h),wo(h,h.return);break;case 27:Td(h);case 26:case 5:sn(d,h,l),l&&s===null&&T&4&&yd(h),wo(h,h.return);break;case 12:sn(d,h,l);break;case 31:sn(d,h,l),l&&T&4&&Cd(d,h);break;case 13:sn(d,h,l),l&&T&4&&Rd(d,h);break;case 22:h.memoizedState===null&&sn(d,h,l),wo(h,h.return);break;case 30:break;default:sn(d,h,l)}n=n.sibling}}function vr(e,n){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(e=n.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&yo(l))}function Tr(e,n){e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yo(e))}function qt(e,n,l,s){if(n.subtreeFlags&10256)for(n=n.child;n!==null;)Id(e,n,l,s),n=n.sibling}function Id(e,n,l,s){var d=n.flags;switch(n.tag){case 0:case 11:case 15:qt(e,n,l,s),d&2048&&Uo(9,n);break;case 1:qt(e,n,l,s);break;case 3:qt(e,n,l,s),d&2048&&(e=null,n.alternate!==null&&(e=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==e&&(n.refCount++,e!=null&&yo(e)));break;case 12:if(d&2048){qt(e,n,l,s),e=n.stateNode;try{var h=n.memoizedProps,T=h.id,S=h.onPostCommit;typeof S=="function"&&S(T,n.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(C){Re(n,n.return,C)}}else qt(e,n,l,s);break;case 31:qt(e,n,l,s);break;case 13:qt(e,n,l,s);break;case 23:break;case 22:h=n.stateNode,T=n.alternate,n.memoizedState!==null?h._visibility&2?qt(e,n,l,s):xo(e,n):h._visibility&2?qt(e,n,l,s):(h._visibility|=2,Gi(e,n,l,s,(n.subtreeFlags&10256)!==0||!1)),d&2048&&vr(T,n);break;case 24:qt(e,n,l,s),d&2048&&Tr(n.alternate,n);break;default:qt(e,n,l,s)}}function Gi(e,n,l,s,d){for(d=d&&((n.subtreeFlags&10256)!==0||!1),n=n.child;n!==null;){var h=e,T=n,S=l,C=s,U=T.flags;switch(T.tag){case 0:case 11:case 15:Gi(h,T,S,C,d),Uo(8,T);break;case 23:break;case 22:var H=T.stateNode;T.memoizedState!==null?H._visibility&2?Gi(h,T,S,C,d):xo(h,T):(H._visibility|=2,Gi(h,T,S,C,d)),d&&U&2048&&vr(T.alternate,T);break;case 24:Gi(h,T,S,C,d),d&&U&2048&&Tr(T.alternate,T);break;default:Gi(h,T,S,C,d)}n=n.sibling}}function xo(e,n){if(n.subtreeFlags&10256)for(n=n.child;n!==null;){var l=e,s=n,d=s.flags;switch(s.tag){case 22:xo(l,s),d&2048&&vr(s.alternate,s);break;case 24:xo(l,s),d&2048&&Tr(s.alternate,s);break;default:xo(l,s)}n=n.sibling}}var bo=8192;function Li(e,n,l){if(e.subtreeFlags&bo)for(e=e.child;e!==null;)Dd(e,n,l),e=e.sibling}function Dd(e,n,l){switch(e.tag){case 26:Li(e,n,l),e.flags&bo&&e.memoizedState!==null&&kv(l,Pt,e.memoizedState,e.memoizedProps);break;case 5:Li(e,n,l);break;case 3:case 4:var s=Pt;Pt=la(e.stateNode.containerInfo),Li(e,n,l),Pt=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=bo,bo=16777216,Li(e,n,l),bo=s):Li(e,n,l));break;default:Li(e,n,l)}}function Ud(e){var n=e.alternate;if(n!==null&&(e=n.child,e!==null)){n.child=null;do n=e.sibling,e.sibling=null,e=n;while(e!==null)}}function Go(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Qe=s,xd(s,e)}Ud(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wd(e),e=e.sibling}function wd(e){switch(e.tag){case 0:case 11:case 15:Go(e),e.flags&2048&&Mn(9,e,e.return);break;case 3:Go(e);break;case 12:Go(e);break;case 22:var n=e.stateNode;e.memoizedState!==null&&n._visibility&2&&(e.return===null||e.return.tag!==13)?(n._visibility&=-3,Yl(e)):Go(e);break;default:Go(e)}}function Yl(e){var n=e.deletions;if((e.flags&16)!==0){if(n!==null)for(var l=0;l<n.length;l++){var s=n[l];Qe=s,xd(s,e)}Ud(e)}for(e=e.child;e!==null;){switch(n=e,n.tag){case 0:case 11:case 15:Mn(8,n,n.return),Yl(n);break;case 22:l=n.stateNode,l._visibility&2&&(l._visibility&=-3,Yl(n));break;default:Yl(n)}e=e.sibling}}function xd(e,n){for(;Qe!==null;){var l=Qe;switch(l.tag){case 0:case 11:case 15:Mn(8,l,n);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var s=l.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:yo(l.memoizedState.cache)}if(s=l.child,s!==null)s.return=l,Qe=s;else e:for(l=e;Qe!==null;){s=Qe;var d=s.sibling,h=s.return;if(Sd(s),s===l){Qe=null;break e}if(d!==null){d.return=h,Qe=d;break e}Qe=h}}}var lv={getCacheForType:function(e){var n=je(Oe),l=n.data.get(e);return l===void 0&&(l=e(),n.data.set(e,l)),l},cacheSignal:function(){return je(Oe).controller.signal}},av=typeof WeakMap=="function"?WeakMap:Map,_e=0,we=null,fe=null,pe=0,Ce=0,_t=null,Nn=!1,Hi=!1,Er=!1,rn=0,Pe=0,In=0,li=0,_r=0,St=0,Pi=0,Lo=null,dt=null,Sr=!1,Kl=0,bd=0,Ql=1/0,Xl=null,Dn=null,Ye=0,Un=null,qi=null,un=0,Ar=0,Cr=null,Gd=null,Ho=0,Rr=null;function At(){return(_e&2)!==0&&pe!==0?pe&-pe:G.T!==null?wr():Xu()}function Ld(){if(St===0)if((pe&536870912)===0||me){var e=il;il<<=1,(il&3932160)===0&&(il=262144),St=e}else St=536870912;return e=Tt.current,e!==null&&(e.flags|=32),St}function pt(e,n,l){(e===we&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)&&(Vi(e,0),wn(e,pe,St,!1)),no(e,l),((_e&2)===0||e!==we)&&(e===we&&((_e&2)===0&&(li|=l),Pe===4&&wn(e,pe,St,!1)),Jt(e))}function Hd(e,n,l){if((_e&6)!==0)throw Error(a(327));var s=!l&&(n&127)===0&&(n&e.expiredLanes)===0||to(e,n),d=s?uv(e,n):Nr(e,n,!0),h=s;do{if(d===0){Hi&&!s&&wn(e,n,0,!1);break}else{if(l=e.current.alternate,h&&!sv(l)){d=Nr(e,n,!1),h=!1;continue}if(d===2){if(h=n,e.errorRecoveryDisabledLanes&h)var T=0;else T=e.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){n=T;e:{var S=e;d=Lo;var C=S.current.memoizedState.isDehydrated;if(C&&(Vi(S,T).flags|=256),T=Nr(S,T,!1),T!==2){if(Er&&!C){S.errorRecoveryDisabledLanes|=h,li|=h,d=4;break e}h=dt,dt=d,h!==null&&(dt===null?dt=h:dt.push.apply(dt,h))}d=T}if(h=!1,d!==2)continue}}if(d===1){Vi(e,0),wn(e,n,0,!0);break}e:{switch(s=e,h=d,h){case 0:case 1:throw Error(a(345));case 4:if((n&4194048)!==n)break;case 6:wn(s,n,St,!Nn);break e;case 2:dt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((n&62914560)===n&&(d=Kl+300-ht(),10<d)){if(wn(s,n,St,!Nn),ll(s,0,!0)!==0)break e;un=n,s.timeoutHandle=pp(Pd.bind(null,s,l,dt,Xl,Sr,n,St,li,Pi,Nn,h,"Throttled",-0,0),d);break e}Pd(s,l,dt,Xl,Sr,n,St,li,Pi,Nn,h,null,-0,0)}}break}while(!0);Jt(e)}function Pd(e,n,l,s,d,h,T,S,C,U,H,q,w,x){if(e.timeoutHandle=-1,q=n.subtreeFlags,q&8192||(q&16785408)===16785408){q={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Kt},Dd(n,h,q);var X=(h&62914560)===h?Kl-ht():(h&4194048)===h?bd-ht():0;if(X=Jv(q,X),X!==null){un=h,e.cancelPendingCommit=X(Jd.bind(null,e,n,h,l,s,d,T,S,C,H,q,null,w,x)),wn(e,h,T,!U);return}}Jd(e,n,h,l,s,d,T,S,C)}function sv(e){for(var n=e;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var s=0;s<l.length;s++){var d=l[s],h=d.getSnapshot;d=d.value;try{if(!yt(h(),d))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===e)break;for(;n.sibling===null;){if(n.return===null||n.return===e)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function wn(e,n,l,s){n&=~_r,n&=~li,e.suspendedLanes|=n,e.pingedLanes&=~n,s&&(e.warmLanes|=n),s=e.expirationTimes;for(var d=n;0<d;){var h=31-gt(d),T=1<<h;s[h]=-1,d&=~T}l!==0&&Yu(e,l,n)}function Zl(){return(_e&6)===0?(Po(0),!1):!0}function Mr(){if(fe!==null){if(Ce===0)var e=fe.return;else e=fe,$t=Zn=null,Os(e),Di=null,To=0,e=fe;for(;e!==null;)hd(e.alternate,e),e=e.return;fe=null}}function Vi(e,n){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,Nv(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),un=0,Mr(),we=e,fe=l=Xt(e.current,null),pe=n,Ce=0,_t=null,Nn=!1,Hi=to(e,n),Er=!1,Pi=St=_r=li=In=Pe=0,dt=Lo=null,Sr=!1,(n&8)!==0&&(n|=n&32);var s=e.entangledLanes;if(s!==0)for(e=e.entanglements,s&=n;0<s;){var d=31-gt(s),h=1<<d;n|=e[d],s&=~h}return rn=n,yl(),l}function qd(e,n){ae=null,G.H=No,n===Ii||n===Rl?(n=jc(),Ce=3):n===Us?(n=jc(),Ce=4):Ce=n===or?8:n!==null&&typeof n=="object"&&typeof n.then=="function"?6:1,_t=n,fe===null&&(Pe=1,Vl(e,It(n,e.current)))}function Vd(){var e=Tt.current;return e===null?!0:(pe&4194048)===pe?xt===null:(pe&62914560)===pe||(pe&536870912)!==0?e===xt:!1}function Bd(){var e=G.H;return G.H=No,e===null?No:e}function zd(){var e=G.A;return G.A=lv,e}function $l(){Pe=4,Nn||(pe&4194048)!==pe&&Tt.current!==null||(Hi=!0),(In&134217727)===0&&(li&134217727)===0||we===null||wn(we,pe,St,!1)}function Nr(e,n,l){var s=_e;_e|=2;var d=Bd(),h=zd();(we!==e||pe!==n)&&(Xl=null,Vi(e,n)),n=!1;var T=Pe;e:do try{if(Ce!==0&&fe!==null){var S=fe,C=_t;switch(Ce){case 8:Mr(),T=6;break e;case 3:case 2:case 9:case 6:Tt.current===null&&(n=!0);var U=Ce;if(Ce=0,_t=null,Bi(e,S,C,U),l&&Hi){T=0;break e}break;default:U=Ce,Ce=0,_t=null,Bi(e,S,C,U)}}rv(),T=Pe;break}catch(H){qd(e,H)}while(!0);return n&&e.shellSuspendCounter++,$t=Zn=null,_e=s,G.H=d,G.A=h,fe===null&&(we=null,pe=0,yl()),T}function rv(){for(;fe!==null;)Od(fe)}function uv(e,n){var l=_e;_e|=2;var s=Bd(),d=zd();we!==e||pe!==n?(Xl=null,Ql=ht()+500,Vi(e,n)):Hi=to(e,n);e:do try{if(Ce!==0&&fe!==null){n=fe;var h=_t;t:switch(Ce){case 1:Ce=0,_t=null,Bi(e,n,h,1);break;case 2:case 9:if($c(h)){Ce=0,_t=null,Fd(n);break}n=function(){Ce!==2&&Ce!==9||we!==e||(Ce=7),Jt(e)},h.then(n,n);break e;case 3:Ce=7;break e;case 4:Ce=5;break e;case 7:$c(h)?(Ce=0,_t=null,Fd(n)):(Ce=0,_t=null,Bi(e,n,h,7));break;case 5:var T=null;switch(fe.tag){case 26:T=fe.memoizedState;case 5:case 27:var S=fe;if(T?Ip(T):S.stateNode.complete){Ce=0,_t=null;var C=S.sibling;if(C!==null)fe=C;else{var U=S.return;U!==null?(fe=U,Wl(U)):fe=null}break t}}Ce=0,_t=null,Bi(e,n,h,5);break;case 6:Ce=0,_t=null,Bi(e,n,h,6);break;case 8:Mr(),Pe=6;break e;default:throw Error(a(462))}}cv();break}catch(H){qd(e,H)}while(!0);return $t=Zn=null,G.H=s,G.A=d,_e=l,fe!==null?0:(we=null,pe=0,yl(),Pe)}function cv(){for(;fe!==null&&!bg();)Od(fe)}function Od(e){var n=dd(e.alternate,e,rn);e.memoizedProps=e.pendingProps,n===null?Wl(e):fe=n}function Fd(e){var n=e,l=n.alternate;switch(n.tag){case 15:case 0:n=ad(l,n,n.pendingProps,n.type,void 0,pe);break;case 11:n=ad(l,n,n.pendingProps,n.type.render,n.ref,pe);break;case 5:Os(n);default:hd(l,n),n=fe=Bc(n,rn),n=dd(l,n,rn)}e.memoizedProps=e.pendingProps,n===null?Wl(e):fe=n}function Bi(e,n,l,s){$t=Zn=null,Os(n),Di=null,To=0;var d=n.return;try{if(Wy(e,d,n,l,pe)){Pe=1,Vl(e,It(l,e.current)),fe=null;return}}catch(h){if(d!==null)throw fe=d,h;Pe=1,Vl(e,It(l,e.current)),fe=null;return}n.flags&32768?(me||s===1?e=!0:Hi||(pe&536870912)!==0?e=!1:(Nn=e=!0,(s===2||s===9||s===3||s===6)&&(s=Tt.current,s!==null&&s.tag===13&&(s.flags|=16384))),kd(n,e)):Wl(n)}function Wl(e){var n=e;do{if((n.flags&32768)!==0){kd(n,Nn);return}e=n.return;var l=tv(n.alternate,n,rn);if(l!==null){fe=l;return}if(n=n.sibling,n!==null){fe=n;return}fe=n=e}while(n!==null);Pe===0&&(Pe=5)}function kd(e,n){do{var l=nv(e.alternate,e);if(l!==null){l.flags&=32767,fe=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(e=e.sibling,e!==null)){fe=e;return}fe=e=l}while(e!==null);Pe=6,fe=null}function Jd(e,n,l,s,d,h,T,S,C){e.cancelPendingCommit=null;do jl();while(Ye!==0);if((_e&6)!==0)throw Error(a(327));if(n!==null){if(n===e.current)throw Error(a(177));if(h=n.lanes|n.childLanes,h|=ms,Fg(e,l,h,T,S,C),e===we&&(fe=we=null,pe=0),qi=n,Un=e,un=l,Ar=h,Cr=d,Gd=s,(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,hv(tl,function(){return Zd(),null})):(e.callbackNode=null,e.callbackPriority=0),s=(n.flags&13878)!==0,(n.subtreeFlags&13878)!==0||s){s=G.T,G.T=null,d=F.p,F.p=2,T=_e,_e|=4;try{iv(e,n,l)}finally{_e=T,F.p=d,G.T=s}}Ye=1,Yd(),Kd(),Qd()}}function Yd(){if(Ye===1){Ye=0;var e=Un,n=qi,l=(n.flags&13878)!==0;if((n.subtreeFlags&13878)!==0||l){l=G.T,G.T=null;var s=F.p;F.p=2;var d=_e;_e|=4;try{Md(n,e);var h=Vr,T=wc(e.containerInfo),S=h.focusedElem,C=h.selectionRange;if(T!==S&&S&&S.ownerDocument&&Uc(S.ownerDocument.documentElement,S)){if(C!==null&&cs(S)){var U=C.start,H=C.end;if(H===void 0&&(H=U),"selectionStart"in S)S.selectionStart=U,S.selectionEnd=Math.min(H,S.value.length);else{var q=S.ownerDocument||document,w=q&&q.defaultView||window;if(w.getSelection){var x=w.getSelection(),X=S.textContent.length,ne=Math.min(C.start,X),De=C.end===void 0?ne:Math.min(C.end,X);!x.extend&&ne>De&&(T=De,De=ne,ne=T);var N=Dc(S,ne),R=Dc(S,De);if(N&&R&&(x.rangeCount!==1||x.anchorNode!==N.node||x.anchorOffset!==N.offset||x.focusNode!==R.node||x.focusOffset!==R.offset)){var D=q.createRange();D.setStart(N.node,N.offset),x.removeAllRanges(),ne>De?(x.addRange(D),x.extend(R.node,R.offset)):(D.setEnd(R.node,R.offset),x.addRange(D))}}}}for(q=[],x=S;x=x.parentNode;)x.nodeType===1&&q.push({element:x,left:x.scrollLeft,top:x.scrollTop});for(typeof S.focus=="function"&&S.focus(),S=0;S<q.length;S++){var P=q[S];P.element.scrollLeft=P.left,P.element.scrollTop=P.top}}fa=!!qr,Vr=qr=null}finally{_e=d,F.p=s,G.T=l}}e.current=n,Ye=2}}function Kd(){if(Ye===2){Ye=0;var e=Un,n=qi,l=(n.flags&8772)!==0;if((n.subtreeFlags&8772)!==0||l){l=G.T,G.T=null;var s=F.p;F.p=2;var d=_e;_e|=4;try{_d(e,n.alternate,n)}finally{_e=d,F.p=s,G.T=l}}Ye=3}}function Qd(){if(Ye===4||Ye===3){Ye=0,Gg();var e=Un,n=qi,l=un,s=Gd;(n.subtreeFlags&10256)!==0||(n.flags&10256)!==0?Ye=5:(Ye=0,qi=Un=null,Xd(e,e.pendingLanes));var d=e.pendingLanes;if(d===0&&(Dn=null),Ja(l),n=n.stateNode,mt&&typeof mt.onCommitFiberRoot=="function")try{mt.onCommitFiberRoot(eo,n,void 0,(n.current.flags&128)===128)}catch{}if(s!==null){n=G.T,d=F.p,F.p=2,G.T=null;try{for(var h=e.onRecoverableError,T=0;T<s.length;T++){var S=s[T];h(S.value,{componentStack:S.stack})}}finally{G.T=n,F.p=d}}(un&3)!==0&&jl(),Jt(e),d=e.pendingLanes,(l&261930)!==0&&(d&42)!==0?e===Rr?Ho++:(Ho=0,Rr=e):Ho=0,Po(0)}}function Xd(e,n){(e.pooledCacheLanes&=n)===0&&(n=e.pooledCache,n!=null&&(e.pooledCache=null,yo(n)))}function jl(){return Yd(),Kd(),Qd(),Zd()}function Zd(){if(Ye!==5)return!1;var e=Un,n=Ar;Ar=0;var l=Ja(un),s=G.T,d=F.p;try{F.p=32>l?32:l,G.T=null,l=Cr,Cr=null;var h=Un,T=un;if(Ye=0,qi=Un=null,un=0,(_e&6)!==0)throw Error(a(331));var S=_e;if(_e|=4,wd(h.current),Id(h,h.current,T,l),_e=S,Po(0,!1),mt&&typeof mt.onPostCommitFiberRoot=="function")try{mt.onPostCommitFiberRoot(eo,h)}catch{}return!0}finally{F.p=d,G.T=s,Xd(e,n)}}function $d(e,n,l){n=It(l,n),n=ir(e.stateNode,n,2),e=An(e,n,2),e!==null&&(no(e,2),Jt(e))}function Re(e,n,l){if(e.tag===3)$d(e,e,l);else for(;n!==null;){if(n.tag===3){$d(n,e,l);break}else if(n.tag===1){var s=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Dn===null||!Dn.has(s))){e=It(l,e),l=Wf(2),s=An(n,l,2),s!==null&&(jf(l,s,n,e),no(s,2),Jt(s));break}}n=n.return}}function Ir(e,n,l){var s=e.pingCache;if(s===null){s=e.pingCache=new av;var d=new Set;s.set(n,d)}else d=s.get(n),d===void 0&&(d=new Set,s.set(n,d));d.has(l)||(Er=!0,d.add(l),e=fv.bind(null,e,n,l),n.then(e,e))}function fv(e,n,l){var s=e.pingCache;s!==null&&s.delete(n),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,we===e&&(pe&l)===l&&(Pe===4||Pe===3&&(pe&62914560)===pe&&300>ht()-Kl?(_e&2)===0&&Vi(e,0):_r|=l,Pi===pe&&(Pi=0)),Jt(e)}function Wd(e,n){n===0&&(n=Ju()),e=Kn(e,n),e!==null&&(no(e,n),Jt(e))}function dv(e){var n=e.memoizedState,l=0;n!==null&&(l=n.retryLane),Wd(e,l)}function pv(e,n){var l=0;switch(e.tag){case 31:case 13:var s=e.stateNode,d=e.memoizedState;d!==null&&(l=d.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(a(314))}s!==null&&s.delete(n),Wd(e,l)}function hv(e,n){return za(e,n)}var ea=null,zi=null,Dr=!1,ta=!1,Ur=!1,xn=0;function Jt(e){e!==zi&&e.next===null&&(zi===null?ea=zi=e:zi=zi.next=e),ta=!0,Dr||(Dr=!0,gv())}function Po(e,n){if(!Ur&&ta){Ur=!0;do for(var l=!1,s=ea;s!==null;){if(e!==0){var d=s.pendingLanes;if(d===0)var h=0;else{var T=s.suspendedLanes,S=s.pingedLanes;h=(1<<31-gt(42|e)+1)-1,h&=d&~(T&~S),h=h&201326741?h&201326741|1:h?h|2:0}h!==0&&(l=!0,np(s,h))}else h=pe,h=ll(s,s===we?h:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(h&3)===0||to(s,h)||(l=!0,np(s,h));s=s.next}while(l);Ur=!1}}function mv(){jd()}function jd(){ta=Dr=!1;var e=0;xn!==0&&Mv()&&(e=xn);for(var n=ht(),l=null,s=ea;s!==null;){var d=s.next,h=ep(s,n);h===0?(s.next=null,l===null?ea=d:l.next=d,d===null&&(zi=l)):(l=s,(e!==0||(h&3)!==0)&&(ta=!0)),s=d}Ye!==0&&Ye!==5||Po(e),xn!==0&&(xn=0)}function ep(e,n){for(var l=e.suspendedLanes,s=e.pingedLanes,d=e.expirationTimes,h=e.pendingLanes&-62914561;0<h;){var T=31-gt(h),S=1<<T,C=d[T];C===-1?((S&l)===0||(S&s)!==0)&&(d[T]=Og(S,n)):C<=n&&(e.expiredLanes|=S),h&=~S}if(n=we,l=pe,l=ll(e,e===n?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,l===0||e===n&&(Ce===2||Ce===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&Oa(s),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||to(e,l)){if(n=l&-l,n===e.callbackPriority)return n;switch(s!==null&&Oa(s),Ja(l)){case 2:case 8:l=Fu;break;case 32:l=tl;break;case 268435456:l=ku;break;default:l=tl}return s=tp.bind(null,e),l=za(l,s),e.callbackPriority=n,e.callbackNode=l,n}return s!==null&&s!==null&&Oa(s),e.callbackPriority=2,e.callbackNode=null,2}function tp(e,n){if(Ye!==0&&Ye!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(jl()&&e.callbackNode!==l)return null;var s=pe;return s=ll(e,e===we?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Hd(e,s,n),ep(e,ht()),e.callbackNode!=null&&e.callbackNode===l?tp.bind(null,e):null)}function np(e,n){if(jl())return null;Hd(e,n,!0)}function gv(){Iv(function(){(_e&6)!==0?za(Ou,mv):jd()})}function wr(){if(xn===0){var e=Mi;e===0&&(e=nl,nl<<=1,(nl&261888)===0&&(nl=256)),xn=e}return xn}function ip(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:ul(""+e)}function op(e,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,e.id&&l.setAttribute("form",e.id),n.parentNode.insertBefore(l,n),e=new FormData(e),l.parentNode.removeChild(l),e}function yv(e,n,l,s,d){if(n==="submit"&&l&&l.stateNode===d){var h=ip((d[st]||null).action),T=s.submitter;T&&(n=(n=T[st]||null)?ip(n.formAction):T.getAttribute("formAction"),n!==null&&(h=n,T=null));var S=new pl("action","action",null,s,d);e.push({event:S,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(xn!==0){var C=T?op(d,T):new FormData(d);$s(l,{pending:!0,data:C,method:d.method,action:h},null,C)}}else typeof h=="function"&&(S.preventDefault(),C=T?op(d,T):new FormData(d),$s(l,{pending:!0,data:C,method:d.method,action:h},h,C))},currentTarget:d}]})}}for(var xr=0;xr<hs.length;xr++){var br=hs[xr],vv=br.toLowerCase(),Tv=br[0].toUpperCase()+br.slice(1);Ht(vv,"on"+Tv)}Ht(Gc,"onAnimationEnd"),Ht(Lc,"onAnimationIteration"),Ht(Hc,"onAnimationStart"),Ht("dblclick","onDoubleClick"),Ht("focusin","onFocus"),Ht("focusout","onBlur"),Ht(Ly,"onTransitionRun"),Ht(Hy,"onTransitionStart"),Ht(Py,"onTransitionCancel"),Ht(Pc,"onTransitionEnd"),di("onMouseEnter",["mouseout","mouseover"]),di("onMouseLeave",["mouseout","mouseover"]),di("onPointerEnter",["pointerout","pointerover"]),di("onPointerLeave",["pointerout","pointerover"]),Fn("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Fn("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Fn("onBeforeInput",["compositionend","keypress","textInput","paste"]),Fn("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Fn("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Fn("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var qo="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(" "),Ev=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(qo));function lp(e,n){n=(n&4)!==0;for(var l=0;l<e.length;l++){var s=e[l],d=s.event;s=s.listeners;e:{var h=void 0;if(n)for(var T=s.length-1;0<=T;T--){var S=s[T],C=S.instance,U=S.currentTarget;if(S=S.listener,C!==h&&d.isPropagationStopped())break e;h=S,d.currentTarget=U;try{h(d)}catch(H){gl(H)}d.currentTarget=null,h=C}else for(T=0;T<s.length;T++){if(S=s[T],C=S.instance,U=S.currentTarget,S=S.listener,C!==h&&d.isPropagationStopped())break e;h=S,d.currentTarget=U;try{h(d)}catch(H){gl(H)}d.currentTarget=null,h=C}}}}function de(e,n){var l=n[Ya];l===void 0&&(l=n[Ya]=new Set);var s=e+"__bubble";l.has(s)||(ap(n,e,2,!1),l.add(s))}function Gr(e,n,l){var s=0;n&&(s|=4),ap(l,e,s,n)}var na="_reactListening"+Math.random().toString(36).slice(2);function Lr(e){if(!e[na]){e[na]=!0,Wu.forEach(function(l){l!=="selectionchange"&&(Ev.has(l)||Gr(l,!1,e),Gr(l,!0,e))});var n=e.nodeType===9?e:e.ownerDocument;n===null||n[na]||(n[na]=!0,Gr("selectionchange",!1,n))}}function ap(e,n,l,s){switch(Lp(n)){case 2:var d=Qv;break;case 8:d=Xv;break;default:d=Zr}l=d.bind(null,n,l,e),d=void 0,!ts||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(d=!0),s?d!==void 0?e.addEventListener(n,l,{capture:!0,passive:d}):e.addEventListener(n,l,!0):d!==void 0?e.addEventListener(n,l,{passive:d}):e.addEventListener(n,l,!1)}function Hr(e,n,l,s,d){var h=s;if((n&1)===0&&(n&2)===0&&s!==null)e:for(;;){if(s===null)return;var T=s.tag;if(T===3||T===4){var S=s.stateNode.containerInfo;if(S===d)break;if(T===4)for(T=s.return;T!==null;){var C=T.tag;if((C===3||C===4)&&T.stateNode.containerInfo===d)return;T=T.return}for(;S!==null;){if(T=ui(S),T===null)return;if(C=T.tag,C===5||C===6||C===26||C===27){s=h=T;continue e}S=S.parentNode}}s=s.return}cc(function(){var U=h,H=ja(l),q=[];e:{var w=qc.get(e);if(w!==void 0){var x=pl,X=e;switch(e){case"keypress":if(fl(l)===0)break e;case"keydown":case"keyup":x=py;break;case"focusin":X="focus",x=ls;break;case"focusout":X="blur",x=ls;break;case"beforeblur":case"afterblur":x=ls;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":x=pc;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":x=ty;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":x=gy;break;case Gc:case Lc:case Hc:x=oy;break;case Pc:x=vy;break;case"scroll":case"scrollend":x=jg;break;case"wheel":x=Ey;break;case"copy":case"cut":case"paste":x=ay;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":x=mc;break;case"toggle":case"beforetoggle":x=Sy}var ne=(n&4)!==0,De=!ne&&(e==="scroll"||e==="scrollend"),N=ne?w!==null?w+"Capture":null:w;ne=[];for(var R=U,D;R!==null;){var P=R;if(D=P.stateNode,P=P.tag,P!==5&&P!==26&&P!==27||D===null||N===null||(P=lo(R,N),P!=null&&ne.push(Vo(R,P,D))),De)break;R=R.return}0<ne.length&&(w=new x(w,X,null,l,H),q.push({event:w,listeners:ne}))}}if((n&7)===0){e:{if(w=e==="mouseover"||e==="pointerover",x=e==="mouseout"||e==="pointerout",w&&l!==Wa&&(X=l.relatedTarget||l.fromElement)&&(ui(X)||X[ri]))break e;if((x||w)&&(w=H.window===H?H:(w=H.ownerDocument)?w.defaultView||w.parentWindow:window,x?(X=l.relatedTarget||l.toElement,x=U,X=X?ui(X):null,X!==null&&(De=f(X),ne=X.tag,X!==De||ne!==5&&ne!==27&&ne!==6)&&(X=null)):(x=null,X=U),x!==X)){if(ne=pc,P="onMouseLeave",N="onMouseEnter",R="mouse",(e==="pointerout"||e==="pointerover")&&(ne=mc,P="onPointerLeave",N="onPointerEnter",R="pointer"),De=x==null?w:oo(x),D=X==null?w:oo(X),w=new ne(P,R+"leave",x,l,H),w.target=De,w.relatedTarget=D,P=null,ui(H)===U&&(ne=new ne(N,R+"enter",X,l,H),ne.target=D,ne.relatedTarget=De,P=ne),De=P,x&&X)t:{for(ne=_v,N=x,R=X,D=0,P=N;P;P=ne(P))D++;P=0;for(var te=R;te;te=ne(te))P++;for(;0<D-P;)N=ne(N),D--;for(;0<P-D;)R=ne(R),P--;for(;D--;){if(N===R||R!==null&&N===R.alternate){ne=N;break t}N=ne(N),R=ne(R)}ne=null}else ne=null;x!==null&&sp(q,w,x,ne,!1),X!==null&&De!==null&&sp(q,De,X,ne,!0)}}e:{if(w=U?oo(U):window,x=w.nodeName&&w.nodeName.toLowerCase(),x==="select"||x==="input"&&w.type==="file")var ye=Ac;else if(_c(w))if(Cc)ye=xy;else{ye=Uy;var W=Dy}else x=w.nodeName,!x||x.toLowerCase()!=="input"||w.type!=="checkbox"&&w.type!=="radio"?U&&$a(U.elementType)&&(ye=Ac):ye=wy;if(ye&&(ye=ye(e,U))){Sc(q,ye,l,H);break e}W&&W(e,w,U),e==="focusout"&&U&&w.type==="number"&&U.memoizedProps.value!=null&&Za(w,"number",w.value)}switch(W=U?oo(U):window,e){case"focusin":(_c(W)||W.contentEditable==="true")&&(vi=W,fs=U,ho=null);break;case"focusout":ho=fs=vi=null;break;case"mousedown":ds=!0;break;case"contextmenu":case"mouseup":case"dragend":ds=!1,xc(q,l,H);break;case"selectionchange":if(Gy)break;case"keydown":case"keyup":xc(q,l,H)}var se;if(ss)e:{switch(e){case"compositionstart":var he="onCompositionStart";break e;case"compositionend":he="onCompositionEnd";break e;case"compositionupdate":he="onCompositionUpdate";break e}he=void 0}else yi?Tc(e,l)&&(he="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(he="onCompositionStart");he&&(gc&&l.locale!=="ko"&&(yi||he!=="onCompositionStart"?he==="onCompositionEnd"&&yi&&(se=fc()):(gn=H,ns="value"in gn?gn.value:gn.textContent,yi=!0)),W=ia(U,he),0<W.length&&(he=new hc(he,e,null,l,H),q.push({event:he,listeners:W}),se?he.data=se:(se=Ec(l),se!==null&&(he.data=se)))),(se=Cy?Ry(e,l):My(e,l))&&(he=ia(U,"onBeforeInput"),0<he.length&&(W=new hc("onBeforeInput","beforeinput",null,l,H),q.push({event:W,listeners:he}),W.data=se)),yv(q,e,U,l,H)}lp(q,n)})}function Vo(e,n,l){return{instance:e,listener:n,currentTarget:l}}function ia(e,n){for(var l=n+"Capture",s=[];e!==null;){var d=e,h=d.stateNode;if(d=d.tag,d!==5&&d!==26&&d!==27||h===null||(d=lo(e,l),d!=null&&s.unshift(Vo(e,d,h)),d=lo(e,n),d!=null&&s.push(Vo(e,d,h))),e.tag===3)return s;e=e.return}return[]}function _v(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function sp(e,n,l,s,d){for(var h=n._reactName,T=[];l!==null&&l!==s;){var S=l,C=S.alternate,U=S.stateNode;if(S=S.tag,C!==null&&C===s)break;S!==5&&S!==26&&S!==27||U===null||(C=U,d?(U=lo(l,h),U!=null&&T.unshift(Vo(l,U,C))):d||(U=lo(l,h),U!=null&&T.push(Vo(l,U,C)))),l=l.return}T.length!==0&&e.push({event:n,listeners:T})}var Sv=/\r\n?/g,Av=/\u0000|\uFFFD/g;function rp(e){return(typeof e=="string"?e:""+e).replace(Sv,`
`).replace(Av,"")}function up(e,n){return n=rp(n),rp(e)===n}function Ie(e,n,l,s,d,h){switch(l){case"children":typeof s=="string"?n==="body"||n==="textarea"&&s===""||hi(e,s):(typeof s=="number"||typeof s=="bigint")&&n!=="body"&&hi(e,""+s);break;case"className":sl(e,"class",s);break;case"tabIndex":sl(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":sl(e,l,s);break;case"style":rc(e,s,h);break;case"data":if(n!=="object"){sl(e,"data",s);break}case"src":case"href":if(s===""&&(n!=="a"||l!=="href")){e.removeAttribute(l);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=ul(""+s),e.setAttribute(l,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(l,"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 h=="function"&&(l==="formAction"?(n!=="input"&&Ie(e,n,"name",d.name,d,null),Ie(e,n,"formEncType",d.formEncType,d,null),Ie(e,n,"formMethod",d.formMethod,d,null),Ie(e,n,"formTarget",d.formTarget,d,null)):(Ie(e,n,"encType",d.encType,d,null),Ie(e,n,"method",d.method,d,null),Ie(e,n,"target",d.target,d,null)));if(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(l);break}s=ul(""+s),e.setAttribute(l,s);break;case"onClick":s!=null&&(e.onclick=Kt);break;case"onScroll":s!=null&&de("scroll",e);break;case"onScrollEnd":s!=null&&de("scrollend",e);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(l=s.__html,l!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}l=ul(""+s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""+s):e.removeAttribute(l);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":s===!0?e.setAttribute(l,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(l,s):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(l,s):e.removeAttribute(l);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(l):e.setAttribute(l,s);break;case"popover":de("beforetoggle",e),de("toggle",e),al(e,"popover",s);break;case"xlinkActuate":Yt(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":Yt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":Yt(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":Yt(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":Yt(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":Yt(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":Yt(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":Yt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":Yt(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":al(e,"is",s);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=$g.get(l)||l,al(e,l,s))}}function Pr(e,n,l,s,d,h){switch(l){case"style":rc(e,s,h);break;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(a(61));if(l=s.__html,l!=null){if(d.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"children":typeof s=="string"?hi(e,s):(typeof s=="number"||typeof s=="bigint")&&hi(e,""+s);break;case"onScroll":s!=null&&de("scroll",e);break;case"onScrollEnd":s!=null&&de("scrollend",e);break;case"onClick":s!=null&&(e.onclick=Kt);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ju.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(d=l.endsWith("Capture"),n=l.slice(2,d?l.length-7:void 0),h=e[st]||null,h=h!=null?h[l]:null,typeof h=="function"&&e.removeEventListener(n,h,d),typeof s=="function")){typeof h!="function"&&h!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(n,s,d);break e}l in e?e[l]=s:s===!0?e.setAttribute(l,""):al(e,l,s)}}}function tt(e,n,l){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":de("error",e),de("load",e);var s=!1,d=!1,h;for(h in l)if(l.hasOwnProperty(h)){var T=l[h];if(T!=null)switch(h){case"src":s=!0;break;case"srcSet":d=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ie(e,n,h,T,l,null)}}d&&Ie(e,n,"srcSet",l.srcSet,l,null),s&&Ie(e,n,"src",l.src,l,null);return;case"input":de("invalid",e);var S=h=T=d=null,C=null,U=null;for(s in l)if(l.hasOwnProperty(s)){var H=l[s];if(H!=null)switch(s){case"name":d=H;break;case"type":T=H;break;case"checked":C=H;break;case"defaultChecked":U=H;break;case"value":h=H;break;case"defaultValue":S=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(a(137,n));break;default:Ie(e,n,s,H,l,null)}}oc(e,h,S,C,U,T,d,!1);return;case"select":de("invalid",e),s=T=h=null;for(d in l)if(l.hasOwnProperty(d)&&(S=l[d],S!=null))switch(d){case"value":h=S;break;case"defaultValue":T=S;break;case"multiple":s=S;default:Ie(e,n,d,S,l,null)}n=h,l=T,e.multiple=!!s,n!=null?pi(e,!!s,n,!1):l!=null&&pi(e,!!s,l,!0);return;case"textarea":de("invalid",e),h=d=s=null;for(T in l)if(l.hasOwnProperty(T)&&(S=l[T],S!=null))switch(T){case"value":s=S;break;case"defaultValue":d=S;break;case"children":h=S;break;case"dangerouslySetInnerHTML":if(S!=null)throw Error(a(91));break;default:Ie(e,n,T,S,l,null)}ac(e,s,d,h);return;case"option":for(C in l)if(l.hasOwnProperty(C)&&(s=l[C],s!=null))switch(C){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Ie(e,n,C,s,l,null)}return;case"dialog":de("beforetoggle",e),de("toggle",e),de("cancel",e),de("close",e);break;case"iframe":case"object":de("load",e);break;case"video":case"audio":for(s=0;s<qo.length;s++)de(qo[s],e);break;case"image":de("error",e),de("load",e);break;case"details":de("toggle",e);break;case"embed":case"source":case"link":de("error",e),de("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in l)if(l.hasOwnProperty(U)&&(s=l[U],s!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,n));default:Ie(e,n,U,s,l,null)}return;default:if($a(n)){for(H in l)l.hasOwnProperty(H)&&(s=l[H],s!==void 0&&Pr(e,n,H,s,l,void 0));return}}for(S in l)l.hasOwnProperty(S)&&(s=l[S],s!=null&&Ie(e,n,S,s,l,null))}function Cv(e,n,l,s){switch(n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var d=null,h=null,T=null,S=null,C=null,U=null,H=null;for(x in l){var q=l[x];if(l.hasOwnProperty(x)&&q!=null)switch(x){case"checked":break;case"value":break;case"defaultValue":C=q;default:s.hasOwnProperty(x)||Ie(e,n,x,null,s,q)}}for(var w in s){var x=s[w];if(q=l[w],s.hasOwnProperty(w)&&(x!=null||q!=null))switch(w){case"type":h=x;break;case"name":d=x;break;case"checked":U=x;break;case"defaultChecked":H=x;break;case"value":T=x;break;case"defaultValue":S=x;break;case"children":case"dangerouslySetInnerHTML":if(x!=null)throw Error(a(137,n));break;default:x!==q&&Ie(e,n,w,x,s,q)}}Xa(e,T,S,C,U,H,h,d);return;case"select":x=T=S=w=null;for(h in l)if(C=l[h],l.hasOwnProperty(h)&&C!=null)switch(h){case"value":break;case"multiple":x=C;default:s.hasOwnProperty(h)||Ie(e,n,h,null,s,C)}for(d in s)if(h=s[d],C=l[d],s.hasOwnProperty(d)&&(h!=null||C!=null))switch(d){case"value":w=h;break;case"defaultValue":S=h;break;case"multiple":T=h;default:h!==C&&Ie(e,n,d,h,s,C)}n=S,l=T,s=x,w!=null?pi(e,!!l,w,!1):!!s!=!!l&&(n!=null?pi(e,!!l,n,!0):pi(e,!!l,l?[]:"",!1));return;case"textarea":x=w=null;for(S in l)if(d=l[S],l.hasOwnProperty(S)&&d!=null&&!s.hasOwnProperty(S))switch(S){case"value":break;case"children":break;default:Ie(e,n,S,null,s,d)}for(T in s)if(d=s[T],h=l[T],s.hasOwnProperty(T)&&(d!=null||h!=null))switch(T){case"value":w=d;break;case"defaultValue":x=d;break;case"children":break;case"dangerouslySetInnerHTML":if(d!=null)throw Error(a(91));break;default:d!==h&&Ie(e,n,T,d,s,h)}lc(e,w,x);return;case"option":for(var X in l)if(w=l[X],l.hasOwnProperty(X)&&w!=null&&!s.hasOwnProperty(X))switch(X){case"selected":e.selected=!1;break;default:Ie(e,n,X,null,s,w)}for(C in s)if(w=s[C],x=l[C],s.hasOwnProperty(C)&&w!==x&&(w!=null||x!=null))switch(C){case"selected":e.selected=w&&typeof w!="function"&&typeof w!="symbol";break;default:Ie(e,n,C,w,s,x)}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 ne in l)w=l[ne],l.hasOwnProperty(ne)&&w!=null&&!s.hasOwnProperty(ne)&&Ie(e,n,ne,null,s,w);for(U in s)if(w=s[U],x=l[U],s.hasOwnProperty(U)&&w!==x&&(w!=null||x!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(w!=null)throw Error(a(137,n));break;default:Ie(e,n,U,w,s,x)}return;default:if($a(n)){for(var De in l)w=l[De],l.hasOwnProperty(De)&&w!==void 0&&!s.hasOwnProperty(De)&&Pr(e,n,De,void 0,s,w);for(H in s)w=s[H],x=l[H],!s.hasOwnProperty(H)||w===x||w===void 0&&x===void 0||Pr(e,n,H,w,s,x);return}}for(var N in l)w=l[N],l.hasOwnProperty(N)&&w!=null&&!s.hasOwnProperty(N)&&Ie(e,n,N,null,s,w);for(q in s)w=s[q],x=l[q],!s.hasOwnProperty(q)||w===x||w==null&&x==null||Ie(e,n,q,w,s,x)}function cp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Rv(){if(typeof performance.getEntriesByType=="function"){for(var e=0,n=0,l=performance.getEntriesByType("resource"),s=0;s<l.length;s++){var d=l[s],h=d.transferSize,T=d.initiatorType,S=d.duration;if(h&&S&&cp(T)){for(T=0,S=d.responseEnd,s+=1;s<l.length;s++){var C=l[s],U=C.startTime;if(U>S)break;var H=C.transferSize,q=C.initiatorType;H&&cp(q)&&(C=C.responseEnd,T+=H*(C<S?1:(S-U)/(C-U)))}if(--s,n+=8*(h+T)/(d.duration/1e3),e++,10<e)break}}if(0<e)return n/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var qr=null,Vr=null;function oa(e){return e.nodeType===9?e:e.ownerDocument}function fp(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function dp(e,n){if(e===0)switch(n){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&n==="foreignObject"?0:e}function Br(e,n){return e==="textarea"||e==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}var zr=null;function Mv(){var e=window.event;return e&&e.type==="popstate"?e===zr?!1:(zr=e,!0):(zr=null,!1)}var pp=typeof setTimeout=="function"?setTimeout:void 0,Nv=typeof clearTimeout=="function"?clearTimeout:void 0,hp=typeof Promise=="function"?Promise:void 0,Iv=typeof queueMicrotask=="function"?queueMicrotask:typeof hp<"u"?function(e){return hp.resolve(null).then(e).catch(Dv)}:pp;function Dv(e){setTimeout(function(){throw e})}function bn(e){return e==="head"}function mp(e,n){var l=n,s=0;do{var d=l.nextSibling;if(e.removeChild(l),d&&d.nodeType===8)if(l=d.data,l==="/$"||l==="/&"){if(s===0){e.removeChild(d),Ji(n);return}s--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")s++;else if(l==="html")Bo(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,Bo(l);for(var h=l.firstChild;h;){var T=h.nextSibling,S=h.nodeName;h[io]||S==="SCRIPT"||S==="STYLE"||S==="LINK"&&h.rel.toLowerCase()==="stylesheet"||l.removeChild(h),h=T}}else l==="body"&&Bo(e.ownerDocument.body);l=d}while(l);Ji(n)}function gp(e,n){var l=e;e=0;do{var s=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),s&&s.nodeType===8)if(l=s.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=s}while(l)}function Or(e){var n=e.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Or(l),Ka(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Uv(e,n,l,s){for(;e.nodeType===1;){var d=l;if(e.nodeName.toLowerCase()!==n.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[io])switch(n){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(h=e.getAttribute("rel"),h==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(h!==d.rel||e.getAttribute("href")!==(d.href==null||d.href===""?null:d.href)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin)||e.getAttribute("title")!==(d.title==null?null:d.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(h=e.getAttribute("src"),(h!==(d.src==null?null:d.src)||e.getAttribute("type")!==(d.type==null?null:d.type)||e.getAttribute("crossorigin")!==(d.crossOrigin==null?null:d.crossOrigin))&&h&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(n==="input"&&e.type==="hidden"){var h=d.name==null?null:""+d.name;if(d.type==="hidden"&&e.getAttribute("name")===h)return e}else return e;if(e=bt(e.nextSibling),e===null)break}return null}function wv(e,n,l){if(n==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=bt(e.nextSibling),e===null))return null;return e}function yp(e,n){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=bt(e.nextSibling),e===null))return null;return e}function Fr(e){return e.data==="$?"||e.data==="$~"}function kr(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function xv(e,n){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=n;else if(e.data!=="$?"||l.readyState!=="loading")n();else{var s=function(){n(),l.removeEventListener("DOMContentLoaded",s)};l.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function bt(e){for(;e!=null;e=e.nextSibling){var n=e.nodeType;if(n===1||n===3)break;if(n===8){if(n=e.data,n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"||n==="F!"||n==="F")break;if(n==="/$"||n==="/&")return null}}return e}var Jr=null;function vp(e){e=e.nextSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(n===0)return bt(e.nextSibling);n--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||n++}e=e.nextSibling}return null}function Tp(e){e=e.previousSibling;for(var n=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(n===0)return e;n--}else l!=="/$"&&l!=="/&"||n++}e=e.previousSibling}return null}function Ep(e,n,l){switch(n=oa(l),e){case"html":if(e=n.documentElement,!e)throw Error(a(452));return e;case"head":if(e=n.head,!e)throw Error(a(453));return e;case"body":if(e=n.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Bo(e){for(var n=e.attributes;n.length;)e.removeAttributeNode(n[0]);Ka(e)}var Gt=new Map,_p=new Set;function la(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var cn=F.d;F.d={f:bv,r:Gv,D:Lv,C:Hv,L:Pv,m:qv,X:Bv,S:Vv,M:zv};function bv(){var e=cn.f(),n=Zl();return e||n}function Gv(e){var n=ci(e);n!==null&&n.tag===5&&n.type==="form"?qf(n):cn.r(e)}var Oi=typeof document>"u"?null:document;function Sp(e,n,l){var s=Oi;if(s&&typeof n=="string"&&n){var d=Mt(n);d='link[rel="'+e+'"][href="'+d+'"]',typeof l=="string"&&(d+='[crossorigin="'+l+'"]'),_p.has(d)||(_p.add(d),e={rel:e,crossOrigin:l,href:n},s.querySelector(d)===null&&(n=s.createElement("link"),tt(n,"link",e),Ke(n),s.head.appendChild(n)))}}function Lv(e){cn.D(e),Sp("dns-prefetch",e,null)}function Hv(e,n){cn.C(e,n),Sp("preconnect",e,n)}function Pv(e,n,l){cn.L(e,n,l);var s=Oi;if(s&&e&&n){var d='link[rel="preload"][as="'+Mt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(d+='[imagesrcset="'+Mt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(d+='[imagesizes="'+Mt(l.imageSizes)+'"]')):d+='[href="'+Mt(e)+'"]';var h=d;switch(n){case"style":h=Fi(e);break;case"script":h=ki(e)}Gt.has(h)||(e=E({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:e,as:n},l),Gt.set(h,e),s.querySelector(d)!==null||n==="style"&&s.querySelector(zo(h))||n==="script"&&s.querySelector(Oo(h))||(n=s.createElement("link"),tt(n,"link",e),Ke(n),s.head.appendChild(n)))}}function qv(e,n){cn.m(e,n);var l=Oi;if(l&&e){var s=n&&typeof n.as=="string"?n.as:"script",d='link[rel="modulepreload"][as="'+Mt(s)+'"][href="'+Mt(e)+'"]',h=d;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":h=ki(e)}if(!Gt.has(h)&&(e=E({rel:"modulepreload",href:e},n),Gt.set(h,e),l.querySelector(d)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Oo(h)))return}s=l.createElement("link"),tt(s,"link",e),Ke(s),l.head.appendChild(s)}}}function Vv(e,n,l){cn.S(e,n,l);var s=Oi;if(s&&e){var d=fi(s).hoistableStyles,h=Fi(e);n=n||"default";var T=d.get(h);if(!T){var S={loading:0,preload:null};if(T=s.querySelector(zo(h)))S.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":n},l),(l=Gt.get(h))&&Yr(e,l);var C=T=s.createElement("link");Ke(C),tt(C,"link",e),C._p=new Promise(function(U,H){C.onload=U,C.onerror=H}),C.addEventListener("load",function(){S.loading|=1}),C.addEventListener("error",function(){S.loading|=2}),S.loading|=4,aa(T,n,s)}T={type:"stylesheet",instance:T,count:1,state:S},d.set(h,T)}}}function Bv(e,n){cn.X(e,n);var l=Oi;if(l&&e){var s=fi(l).hoistableScripts,d=ki(e),h=s.get(d);h||(h=l.querySelector(Oo(d)),h||(e=E({src:e,async:!0},n),(n=Gt.get(d))&&Kr(e,n),h=l.createElement("script"),Ke(h),tt(h,"link",e),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function zv(e,n){cn.M(e,n);var l=Oi;if(l&&e){var s=fi(l).hoistableScripts,d=ki(e),h=s.get(d);h||(h=l.querySelector(Oo(d)),h||(e=E({src:e,async:!0,type:"module"},n),(n=Gt.get(d))&&Kr(e,n),h=l.createElement("script"),Ke(h),tt(h,"link",e),l.head.appendChild(h)),h={type:"script",instance:h,count:1,state:null},s.set(d,h))}}function Ap(e,n,l,s){var d=(d=ce.current)?la(d):null;if(!d)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(n=Fi(l.href),l=fi(d).hoistableStyles,s=l.get(n),s||(s={type:"style",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=Fi(l.href);var h=fi(d).hoistableStyles,T=h.get(e);if(T||(d=d.ownerDocument||d,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},h.set(e,T),(h=d.querySelector(zo(e)))&&!h._p&&(T.instance=h,T.state.loading=5),Gt.has(e)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},Gt.set(e,l),h||Ov(d,e,l,T.state))),n&&s===null)throw Error(a(528,""));return T}if(n&&s!==null)throw Error(a(529,""));return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(n=ki(l),l=fi(d).hoistableScripts,s=l.get(n),s||(s={type:"script",instance:null,count:0,state:null},l.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Fi(e){return'href="'+Mt(e)+'"'}function zo(e){return'link[rel="stylesheet"]['+e+"]"}function Cp(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Ov(e,n,l,s){e.querySelector('link[rel="preload"][as="style"]['+n+"]")?s.loading=1:(n=e.createElement("link"),s.preload=n,n.addEventListener("load",function(){return s.loading|=1}),n.addEventListener("error",function(){return s.loading|=2}),tt(n,"link",l),Ke(n),e.head.appendChild(n))}function ki(e){return'[src="'+Mt(e)+'"]'}function Oo(e){return"script[async]"+e}function Rp(e,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var s=e.querySelector('style[data-href~="'+Mt(l.href)+'"]');if(s)return n.instance=s,Ke(s),s;var d=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Ke(s),tt(s,"style",d),aa(s,l.precedence,e),n.instance=s;case"stylesheet":d=Fi(l.href);var h=e.querySelector(zo(d));if(h)return n.state.loading|=4,n.instance=h,Ke(h),h;s=Cp(l),(d=Gt.get(d))&&Yr(s,d),h=(e.ownerDocument||e).createElement("link"),Ke(h);var T=h;return T._p=new Promise(function(S,C){T.onload=S,T.onerror=C}),tt(h,"link",s),n.state.loading|=4,aa(h,l.precedence,e),n.instance=h;case"script":return h=ki(l.src),(d=e.querySelector(Oo(h)))?(n.instance=d,Ke(d),d):(s=l,(d=Gt.get(h))&&(s=E({},l),Kr(s,d)),e=e.ownerDocument||e,d=e.createElement("script"),Ke(d),tt(d,"link",s),e.head.appendChild(d),n.instance=d);case"void":return null;default:throw Error(a(443,n.type))}else n.type==="stylesheet"&&(n.state.loading&4)===0&&(s=n.instance,n.state.loading|=4,aa(s,l.precedence,e));return n.instance}function aa(e,n,l){for(var s=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),d=s.length?s[s.length-1]:null,h=d,T=0;T<s.length;T++){var S=s[T];if(S.dataset.precedence===n)h=S;else if(h!==d)break}h?h.parentNode.insertBefore(e,h.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(e,n.firstChild))}function Yr(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.title==null&&(e.title=n.title)}function Kr(e,n){e.crossOrigin==null&&(e.crossOrigin=n.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=n.referrerPolicy),e.integrity==null&&(e.integrity=n.integrity)}var sa=null;function Mp(e,n,l){if(sa===null){var s=new Map,d=sa=new Map;d.set(l,s)}else d=sa,s=d.get(l),s||(s=new Map,d.set(l,s));if(s.has(e))return s;for(s.set(e,null),l=l.getElementsByTagName(e),d=0;d<l.length;d++){var h=l[d];if(!(h[io]||h[$e]||e==="link"&&h.getAttribute("rel")==="stylesheet")&&h.namespaceURI!=="http://www.w3.org/2000/svg"){var T=h.getAttribute(n)||"";T=e+T;var S=s.get(T);S?S.push(h):s.set(T,[h])}}return s}function Np(e,n,l){e=e.ownerDocument||e,e.head.insertBefore(l,n==="title"?e.querySelector("head > title"):null)}function Fv(e,n,l){if(l===1||n.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href==="")break;return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError)break;switch(n.rel){case"stylesheet":return e=n.disabled,typeof n.precedence=="string"&&e==null;default:return!0}case"script":if(n.async&&typeof n.async!="function"&&typeof n.async!="symbol"&&!n.onLoad&&!n.onError&&n.src&&typeof n.src=="string")return!0}return!1}function Ip(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kv(e,n,l,s){if(l.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var d=Fi(s.href),h=n.querySelector(zo(d));if(h){n=h._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(e.count++,e=ra.bind(e),n.then(e,e)),l.state.loading|=4,l.instance=h,Ke(h);return}h=n.ownerDocument||n,s=Cp(s),(d=Gt.get(d))&&Yr(s,d),h=h.createElement("link"),Ke(h);var T=h;T._p=new Promise(function(S,C){T.onload=S,T.onerror=C}),tt(h,"link",s),l.instance=h}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=ra.bind(e),n.addEventListener("load",l),n.addEventListener("error",l))}}var Qr=0;function Jv(e,n){return e.stylesheets&&e.count===0&&ca(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var s=setTimeout(function(){if(e.stylesheets&&ca(e,e.stylesheets),e.unsuspend){var h=e.unsuspend;e.unsuspend=null,h()}},6e4+n);0<e.imgBytes&&Qr===0&&(Qr=62500*Rv());var d=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ca(e,e.stylesheets),e.unsuspend)){var h=e.unsuspend;e.unsuspend=null,h()}},(e.imgBytes>Qr?50:800)+n);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(d)}}:null}function ra(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ca(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var ua=null;function ca(e,n){e.stylesheets=null,e.unsuspend!==null&&(e.count++,ua=new Map,n.forEach(Yv,e),ua=null,ra.call(e))}function Yv(e,n){if(!(n.state.loading&4)){var l=ua.get(e);if(l)var s=l.get(null);else{l=new Map,ua.set(e,l);for(var d=e.querySelectorAll("link[data-precedence],style[data-precedence]"),h=0;h<d.length;h++){var T=d[h];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),s=T)}s&&l.set(null,s)}d=n.instance,T=d.getAttribute("data-precedence"),h=l.get(T)||s,h===s&&l.set(null,d),l.set(T,d),this.count++,s=ra.bind(this),d.addEventListener("load",s),d.addEventListener("error",s),h?h.parentNode.insertBefore(d,h.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(d,e.firstChild)),n.state.loading|=4}}var Fo={$$typeof:O,Provider:null,Consumer:null,_currentValue:ee,_currentValue2:ee,_threadCount:0};function Kv(e,n,l,s,d,h,T,S,C){this.tag=1,this.containerInfo=e,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=Fa(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Fa(0),this.hiddenUpdates=Fa(null),this.identifierPrefix=s,this.onUncaughtError=d,this.onCaughtError=h,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=C,this.incompleteTransitions=new Map}function Dp(e,n,l,s,d,h,T,S,C,U,H,q){return e=new Kv(e,n,l,T,C,U,H,q,S),n=1,h===!0&&(n|=24),h=vt(3,null,null,n),e.current=h,h.stateNode=e,n=Ns(),n.refCount++,e.pooledCache=n,n.refCount++,h.memoizedState={element:s,isDehydrated:l,cache:n},ws(h),e}function Up(e){return e?(e=_i,e):_i}function wp(e,n,l,s,d,h){d=Up(d),s.context===null?s.context=d:s.pendingContext=d,s=Sn(n),s.payload={element:l},h=h===void 0?null:h,h!==null&&(s.callback=h),l=An(e,s,n),l!==null&&(pt(l,e,n),_o(l,e,n))}function xp(e,n){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<n?l:n}}function Xr(e,n){xp(e,n),(e=e.alternate)&&xp(e,n)}function bp(e){if(e.tag===13||e.tag===31){var n=Kn(e,67108864);n!==null&&pt(n,e,67108864),Xr(e,67108864)}}function Gp(e){if(e.tag===13||e.tag===31){var n=At();n=ka(n);var l=Kn(e,n);l!==null&&pt(l,e,n),Xr(e,n)}}var fa=!0;function Qv(e,n,l,s){var d=G.T;G.T=null;var h=F.p;try{F.p=2,Zr(e,n,l,s)}finally{F.p=h,G.T=d}}function Xv(e,n,l,s){var d=G.T;G.T=null;var h=F.p;try{F.p=8,Zr(e,n,l,s)}finally{F.p=h,G.T=d}}function Zr(e,n,l,s){if(fa){var d=$r(s);if(d===null)Hr(e,n,s,da,l),Hp(e,s);else if($v(d,e,n,l,s))s.stopPropagation();else if(Hp(e,s),n&4&&-1<Zv.indexOf(e)){for(;d!==null;){var h=ci(d);if(h!==null)switch(h.tag){case 3:if(h=h.stateNode,h.current.memoizedState.isDehydrated){var T=On(h.pendingLanes);if(T!==0){var S=h;for(S.pendingLanes|=2,S.entangledLanes|=2;T;){var C=1<<31-gt(T);S.entanglements[1]|=C,T&=~C}Jt(h),(_e&6)===0&&(Ql=ht()+500,Po(0))}}break;case 31:case 13:S=Kn(h,2),S!==null&&pt(S,h,2),Zl(),Xr(h,2)}if(h=$r(s),h===null&&Hr(e,n,s,da,l),h===d)break;d=h}d!==null&&s.stopPropagation()}else Hr(e,n,s,null,l)}}function $r(e){return e=ja(e),Wr(e)}var da=null;function Wr(e){if(da=null,e=ui(e),e!==null){var n=f(e);if(n===null)e=null;else{var l=n.tag;if(l===13){if(e=p(n),e!==null)return e;e=null}else if(l===31){if(e=g(n),e!==null)return e;e=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;e=null}else n!==e&&(e=null)}}return da=e,null}function Lp(e){switch(e){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(Lg()){case Ou:return 2;case Fu:return 8;case tl:case Hg:return 32;case ku:return 268435456;default:return 32}default:return 32}}var jr=!1,Gn=null,Ln=null,Hn=null,ko=new Map,Jo=new Map,Pn=[],Zv="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 Hp(e,n){switch(e){case"focusin":case"focusout":Gn=null;break;case"dragenter":case"dragleave":Ln=null;break;case"mouseover":case"mouseout":Hn=null;break;case"pointerover":case"pointerout":ko.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":Jo.delete(n.pointerId)}}function Yo(e,n,l,s,d,h){return e===null||e.nativeEvent!==h?(e={blockedOn:n,domEventName:l,eventSystemFlags:s,nativeEvent:h,targetContainers:[d]},n!==null&&(n=ci(n),n!==null&&bp(n)),e):(e.eventSystemFlags|=s,n=e.targetContainers,d!==null&&n.indexOf(d)===-1&&n.push(d),e)}function $v(e,n,l,s,d){switch(n){case"focusin":return Gn=Yo(Gn,e,n,l,s,d),!0;case"dragenter":return Ln=Yo(Ln,e,n,l,s,d),!0;case"mouseover":return Hn=Yo(Hn,e,n,l,s,d),!0;case"pointerover":var h=d.pointerId;return ko.set(h,Yo(ko.get(h)||null,e,n,l,s,d)),!0;case"gotpointercapture":return h=d.pointerId,Jo.set(h,Yo(Jo.get(h)||null,e,n,l,s,d)),!0}return!1}function Pp(e){var n=ui(e.target);if(n!==null){var l=f(n);if(l!==null){if(n=l.tag,n===13){if(n=p(l),n!==null){e.blockedOn=n,Zu(e.priority,function(){Gp(l)});return}}else if(n===31){if(n=g(l),n!==null){e.blockedOn=n,Zu(e.priority,function(){Gp(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function pa(e){if(e.blockedOn!==null)return!1;for(var n=e.targetContainers;0<n.length;){var l=$r(e.nativeEvent);if(l===null){l=e.nativeEvent;var s=new l.constructor(l.type,l);Wa=s,l.target.dispatchEvent(s),Wa=null}else return n=ci(l),n!==null&&bp(n),e.blockedOn=l,!1;n.shift()}return!0}function qp(e,n,l){pa(e)&&l.delete(n)}function Wv(){jr=!1,Gn!==null&&pa(Gn)&&(Gn=null),Ln!==null&&pa(Ln)&&(Ln=null),Hn!==null&&pa(Hn)&&(Hn=null),ko.forEach(qp),Jo.forEach(qp)}function ha(e,n){e.blockedOn===n&&(e.blockedOn=null,jr||(jr=!0,i.unstable_scheduleCallback(i.unstable_NormalPriority,Wv)))}var ma=null;function Vp(e){ma!==e&&(ma=e,i.unstable_scheduleCallback(i.unstable_NormalPriority,function(){ma===e&&(ma=null);for(var n=0;n<e.length;n+=3){var l=e[n],s=e[n+1],d=e[n+2];if(typeof s!="function"){if(Wr(s||l)===null)continue;break}var h=ci(l);h!==null&&(e.splice(n,3),n-=3,$s(h,{pending:!0,data:d,method:l.method,action:s},s,d))}}))}function Ji(e){function n(C){return ha(C,e)}Gn!==null&&ha(Gn,e),Ln!==null&&ha(Ln,e),Hn!==null&&ha(Hn,e),ko.forEach(n),Jo.forEach(n);for(var l=0;l<Pn.length;l++){var s=Pn[l];s.blockedOn===e&&(s.blockedOn=null)}for(;0<Pn.length&&(l=Pn[0],l.blockedOn===null);)Pp(l),l.blockedOn===null&&Pn.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(s=0;s<l.length;s+=3){var d=l[s],h=l[s+1],T=d[st]||null;if(typeof h=="function")T||Vp(l);else if(T){var S=null;if(h&&h.hasAttribute("formAction")){if(d=h,T=h[st]||null)S=T.formAction;else if(Wr(d)!==null)continue}else S=T.action;typeof S=="function"?l[s+1]=S:(l.splice(s,3),s-=3),Vp(l)}}}function Bp(){function e(h){h.canIntercept&&h.info==="react-transition"&&h.intercept({handler:function(){return new Promise(function(T){return d=T})},focusReset:"manual",scroll:"manual"})}function n(){d!==null&&(d(),d=null),s||setTimeout(l,20)}function l(){if(!s&&!navigation.transition){var h=navigation.currentEntry;h&&h.url!=null&&navigation.navigate(h.url,{state:h.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,d=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),d!==null&&(d(),d=null)}}}function eu(e){this._internalRoot=e}ga.prototype.render=eu.prototype.render=function(e){var n=this._internalRoot;if(n===null)throw Error(a(409));var l=n.current,s=At();wp(l,s,e,n,null,null)},ga.prototype.unmount=eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var n=e.containerInfo;wp(e.current,2,null,e,null,null),Zl(),n[ri]=null}};function ga(e){this._internalRoot=e}ga.prototype.unstable_scheduleHydration=function(e){if(e){var n=Xu();e={blockedOn:null,target:e,priority:n};for(var l=0;l<Pn.length&&n!==0&&n<Pn[l].priority;l++);Pn.splice(l,0,e),l===0&&Pp(e)}};var zp=t.version;if(zp!=="19.2.4")throw Error(a(527,zp,"19.2.4"));F.findDOMNode=function(e){var n=e._reactInternals;if(n===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=m(n),e=e!==null?v(e):null,e=e===null?null:e.stateNode,e};var jv={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ya=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ya.isDisabled&&ya.supportsFiber)try{eo=ya.inject(jv),mt=ya}catch{}}return Qo.createRoot=function(e,n){if(!u(e))throw Error(a(299));var l=!1,s="",d=Qf,h=Xf,T=Zf;return n!=null&&(n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(s=n.identifierPrefix),n.onUncaughtError!==void 0&&(d=n.onUncaughtError),n.onCaughtError!==void 0&&(h=n.onCaughtError),n.onRecoverableError!==void 0&&(T=n.onRecoverableError)),n=Dp(e,1,!1,null,null,l,s,null,d,h,T,Bp),e[ri]=n.current,Lr(e),new eu(n)},Qo.hydrateRoot=function(e,n,l){if(!u(e))throw Error(a(299));var s=!1,d="",h=Qf,T=Xf,S=Zf,C=null;return l!=null&&(l.unstable_strictMode===!0&&(s=!0),l.identifierPrefix!==void 0&&(d=l.identifierPrefix),l.onUncaughtError!==void 0&&(h=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(S=l.onRecoverableError),l.formState!==void 0&&(C=l.formState)),n=Dp(e,1,!0,n,l??null,s,d,C,h,T,S,Bp),n.context=Up(null),l=n.current,s=At(),s=ka(s),d=Sn(s),d.callback=null,An(l,d,s),l=s,n.current.lanes=l,no(n,l),Jt(n),e[ri]=n.current,Lr(e),new ga(n)},Qo.version="19.2.4",Qo}var $p;function c0(){if($p)return iu.exports;$p=1;function i(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(i)}catch(t){console.error(t)}}return i(),iu.exports=u0(),iu.exports}var f0=c0();const PR=Iu(f0);var Xo={exports:{}},su={},ru,Wp;function d0(){if(Wp)return ru;Wp=1;function i(t,o){typeof o=="boolean"&&(o={forever:o}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=o||{},this._maxRetryTime=o&&o.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}return ru=i,i.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},i.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},i.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var o=new Date().getTime();if(t&&o-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var a=this._timeouts.shift();if(a===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),a=this._cachedTimeouts.slice(-1);else return!1;var u=this;return this._timer=setTimeout(function(){u._attempts++,u._operationTimeoutCb&&(u._timeout=setTimeout(function(){u._operationTimeoutCb(u._attempts)},u._operationTimeout),u._options.unref&&u._timeout.unref()),u._fn(u._attempts)},a),this._options.unref&&this._timer.unref(),!0},i.prototype.attempt=function(t,o){this._fn=t,o&&(o.timeout&&(this._operationTimeout=o.timeout),o.cb&&(this._operationTimeoutCb=o.cb));var a=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){a._operationTimeoutCb()},a._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)},i.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},i.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},i.prototype.start=i.prototype.try,i.prototype.errors=function(){return this._errors},i.prototype.attempts=function(){return this._attempts},i.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},o=null,a=0,u=0;u<this._errors.length;u++){var f=this._errors[u],p=f.message,g=(t[p]||0)+1;t[p]=g,g>=a&&(o=f,a=g)}return o},ru}var jp;function p0(){return jp||(jp=1,(function(i){var t=d0();i.operation=function(o){var a=i.timeouts(o);return new t(a,{forever:o&&(o.forever||o.retries===1/0),unref:o&&o.unref,maxRetryTime:o&&o.maxRetryTime})},i.timeouts=function(o){if(o instanceof Array)return[].concat(o);var a={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var u in o)a[u]=o[u];if(a.minTimeout>a.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var f=[],p=0;p<a.retries;p++)f.push(this.createTimeout(p,a));return o&&o.forever&&!f.length&&f.push(this.createTimeout(p,a)),f.sort(function(g,y){return g-y}),f},i.createTimeout=function(o,a){var u=a.randomize?Math.random()+1:1,f=Math.round(u*Math.max(a.minTimeout,1)*Math.pow(a.factor,o));return f=Math.min(f,a.maxTimeout),f},i.wrap=function(o,a,u){if(a instanceof Array&&(u=a,a=null),!u){u=[];for(var f in o)typeof o[f]=="function"&&u.push(f)}for(var p=0;p<u.length;p++){var g=u[p],y=o[g];o[g]=(function(v){var E=i.operation(a),_=Array.prototype.slice.call(arguments,1),A=_.pop();_.push(function(I){E.retry(I)||(I&&(arguments[0]=E.mainError()),A.apply(this,arguments))}),E.attempt(function(){v.apply(o,_)})}).bind(o,y),o[g].options=a}}})(su)),su}var uu,eh;function h0(){return eh||(eh=1,uu=p0()),uu}var th;function m0(){if(th)return Xo.exports;th=1;const i=h0(),t=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"];class o extends Error{constructor(g){super(),g instanceof Error?(this.originalError=g,{message:g}=g):(this.originalError=new Error(g),this.originalError.stack=this.stack),this.name="AbortError",this.message=g}}const a=(p,g,y)=>{const m=y.retries-(g-1);return p.attemptNumber=g,p.retriesLeft=m,p},u=p=>t.includes(p),f=(p,g)=>new Promise((y,m)=>{g={onFailedAttempt:()=>{},retries:10,...g};const v=i.operation(g);v.attempt(async E=>{try{y(await p(E))}catch(_){if(!(_ instanceof Error)){m(new TypeError(`Non-error was thrown: "${_}". You should only throw errors.`));return}if(_ instanceof o)v.stop(),m(_.originalError);else if(_ instanceof TypeError&&!u(_.message))v.stop(),m(_);else{a(_,E,g);try{await g.onFailedAttempt(_)}catch(A){m(A);return}v.retry(_)||m(v.mainError())}}})});return Xo.exports=f,Xo.exports.default=f,Xo.exports.AbortError=o,Xo.exports}var Vm=m0();const g0=Iu(Vm);var y0={};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let v0,T0;function E0(){return{geminiUrl:v0,vertexUrl:T0}}function _0(i,t,o,a){var u,f;if(!(i!=null&&i.baseUrl)){const p=E0();return t?(u=p.vertexUrl)!==null&&u!==void 0?u:o:(f=p.geminiUrl)!==null&&f!==void 0?f:a}return i.baseUrl}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class dn{}function Y(i,t){const o=/\{([^}]+)\}/g;return i.replace(o,(a,u)=>{if(Object.prototype.hasOwnProperty.call(t,u)){const f=t[u];return f!=null?String(f):""}else throw new Error(`Key '${u}' not found in valueMap.`)})}function c(i,t,o){for(let f=0;f<t.length-1;f++){const p=t[f];if(p.endsWith("[]")){const g=p.slice(0,-2);if(!(g in i))if(Array.isArray(o))i[g]=Array.from({length:o.length},()=>({}));else throw new Error(`Value must be a list given an array path ${p}`);if(Array.isArray(i[g])){const y=i[g];if(Array.isArray(o))for(let m=0;m<y.length;m++){const v=y[m];c(v,t.slice(f+1),o[m])}else for(const m of y)c(m,t.slice(f+1),o)}return}else if(p.endsWith("[0]")){const g=p.slice(0,-3);g in i||(i[g]=[{}]);const y=i[g];c(y[0],t.slice(f+1),o);return}(!i[p]||typeof i[p]!="object")&&(i[p]={}),i=i[p]}const a=t[t.length-1],u=i[a];if(u!==void 0){if(!o||typeof o=="object"&&Object.keys(o).length===0||o===u)return;if(typeof u=="object"&&typeof o=="object"&&u!==null&&o!==null)Object.assign(u,o);else throw new Error(`Cannot set value for an existing key. Key: ${a}`)}else a==="_self"&&typeof o=="object"&&o!==null&&!Array.isArray(o)?Object.assign(i,o):i[a]=o}function r(i,t,o=void 0){try{if(t.length===1&&t[0]==="_self")return i;for(let a=0;a<t.length;a++){if(typeof i!="object"||i===null)return o;const u=t[a];if(u.endsWith("[]")){const f=u.slice(0,-2);if(f in i){const p=i[f];return Array.isArray(p)?p.map(g=>r(g,t.slice(a+1),o)):o}else return o}else i=i[u]}return i}catch(a){if(a instanceof TypeError)return o;throw a}}function S0(i,t){for(const[o,a]of Object.entries(t)){const u=o.split("."),f=a.split("."),p=new Set;let g=-1;for(let y=0;y<u.length;y++)if(u[y]==="*"){g=y;break}if(g!==-1&&f.length>g)for(let y=g;y<f.length;y++){const m=f[y];m!=="*"&&!m.endsWith("[]")&&!m.endsWith("[0]")&&p.add(m)}pu(i,u,f,0,p)}}function pu(i,t,o,a,u){if(a>=t.length||typeof i!="object"||i===null)return;const f=t[a];if(f.endsWith("[]")){const p=f.slice(0,-2),g=i;if(p in g&&Array.isArray(g[p]))for(const y of g[p])pu(y,t,o,a+1,u)}else if(f==="*"){if(typeof i=="object"&&i!==null&&!Array.isArray(i)){const p=i,g=Object.keys(p).filter(m=>!m.startsWith("_")&&!u.has(m)),y={};for(const m of g)y[m]=p[m];for(const[m,v]of Object.entries(y)){const E=[];for(const _ of o.slice(a))_==="*"?E.push(m):E.push(_);c(p,E,v)}for(const m of g)delete p[m]}}else{const p=i;f in p&&pu(p[f],t,o,a+1,u)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Uu(i){if(typeof i!="string")throw new Error("fromImageBytes must be a string");return i}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function A0(i){const t={},o=r(i,["operationName"]);o!=null&&c(t,["operationName"],o);const a=r(i,["resourceName"]);return a!=null&&c(t,["_url","resourceName"],a),t}function C0(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["metadata"]);a!=null&&c(t,["metadata"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);f!=null&&c(t,["error"],f);const p=r(i,["response","generateVideoResponse"]);return p!=null&&c(t,["response"],M0(p)),t}function R0(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["metadata"]);a!=null&&c(t,["metadata"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);f!=null&&c(t,["error"],f);const p=r(i,["response"]);return p!=null&&c(t,["response"],N0(p)),t}function M0(i){const t={},o=r(i,["generatedSamples"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(p=>I0(p))),c(t,["generatedVideos"],f)}const a=r(i,["raiMediaFilteredCount"]);a!=null&&c(t,["raiMediaFilteredCount"],a);const u=r(i,["raiMediaFilteredReasons"]);return u!=null&&c(t,["raiMediaFilteredReasons"],u),t}function N0(i){const t={},o=r(i,["videos"]);if(o!=null){let f=o;Array.isArray(f)&&(f=f.map(p=>D0(p))),c(t,["generatedVideos"],f)}const a=r(i,["raiMediaFilteredCount"]);a!=null&&c(t,["raiMediaFilteredCount"],a);const u=r(i,["raiMediaFilteredReasons"]);return u!=null&&c(t,["raiMediaFilteredReasons"],u),t}function I0(i){const t={},o=r(i,["video"]);return o!=null&&c(t,["video"],L0(o)),t}function D0(i){const t={},o=r(i,["_self"]);return o!=null&&c(t,["video"],H0(o)),t}function U0(i){const t={},o=r(i,["operationName"]);return o!=null&&c(t,["_url","operationName"],o),t}function w0(i){const t={},o=r(i,["operationName"]);return o!=null&&c(t,["_url","operationName"],o),t}function x0(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["metadata"]);a!=null&&c(t,["metadata"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);f!=null&&c(t,["error"],f);const p=r(i,["response"]);return p!=null&&c(t,["response"],b0(p)),t}function b0(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["parent"]);a!=null&&c(t,["parent"],a);const u=r(i,["documentName"]);return u!=null&&c(t,["documentName"],u),t}function Bm(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["metadata"]);a!=null&&c(t,["metadata"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);f!=null&&c(t,["error"],f);const p=r(i,["response"]);return p!=null&&c(t,["response"],G0(p)),t}function G0(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["parent"]);a!=null&&c(t,["parent"],a);const u=r(i,["documentName"]);return u!=null&&c(t,["documentName"],u),t}function L0(i){const t={},o=r(i,["uri"]);o!=null&&c(t,["uri"],o);const a=r(i,["encodedVideo"]);a!=null&&c(t,["videoBytes"],Uu(a));const u=r(i,["encoding"]);return u!=null&&c(t,["mimeType"],u),t}function H0(i){const t={},o=r(i,["gcsUri"]);o!=null&&c(t,["uri"],o);const a=r(i,["bytesBase64Encoded"]);a!=null&&c(t,["videoBytes"],Uu(a));const u=r(i,["mimeType"]);return u!=null&&c(t,["mimeType"],u),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var nh;(function(i){i.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",i.OUTCOME_OK="OUTCOME_OK",i.OUTCOME_FAILED="OUTCOME_FAILED",i.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(nh||(nh={}));var ih;(function(i){i.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",i.PYTHON="PYTHON"})(ih||(ih={}));var oh;(function(i){i.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",i.SILENT="SILENT",i.WHEN_IDLE="WHEN_IDLE",i.INTERRUPT="INTERRUPT"})(oh||(oh={}));var Vn;(function(i){i.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",i.STRING="STRING",i.NUMBER="NUMBER",i.INTEGER="INTEGER",i.BOOLEAN="BOOLEAN",i.ARRAY="ARRAY",i.OBJECT="OBJECT",i.NULL="NULL"})(Vn||(Vn={}));var lh;(function(i){i.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",i.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",i.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",i.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",i.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",i.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",i.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(lh||(lh={}));var ah;(function(i){i.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",i.NO_AUTH="NO_AUTH",i.API_KEY_AUTH="API_KEY_AUTH",i.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",i.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",i.OAUTH="OAUTH",i.OIDC_AUTH="OIDC_AUTH"})(ah||(ah={}));var sh;(function(i){i.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",i.HTTP_IN_QUERY="HTTP_IN_QUERY",i.HTTP_IN_HEADER="HTTP_IN_HEADER",i.HTTP_IN_PATH="HTTP_IN_PATH",i.HTTP_IN_BODY="HTTP_IN_BODY",i.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(sh||(sh={}));var rh;(function(i){i.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",i.SIMPLE_SEARCH="SIMPLE_SEARCH",i.ELASTIC_SEARCH="ELASTIC_SEARCH"})(rh||(rh={}));var uh;(function(i){i.UNSPECIFIED="UNSPECIFIED",i.BLOCKING="BLOCKING",i.NON_BLOCKING="NON_BLOCKING"})(uh||(uh={}));var ch;(function(i){i.MODE_UNSPECIFIED="MODE_UNSPECIFIED",i.MODE_DYNAMIC="MODE_DYNAMIC"})(ch||(ch={}));var fh;(function(i){i.MODE_UNSPECIFIED="MODE_UNSPECIFIED",i.AUTO="AUTO",i.ANY="ANY",i.NONE="NONE",i.VALIDATED="VALIDATED"})(fh||(fh={}));var dh;(function(i){i.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",i.LOW="LOW",i.MEDIUM="MEDIUM",i.HIGH="HIGH",i.MINIMAL="MINIMAL"})(dh||(dh={}));var ph;(function(i){i.DONT_ALLOW="DONT_ALLOW",i.ALLOW_ADULT="ALLOW_ADULT",i.ALLOW_ALL="ALLOW_ALL"})(ph||(ph={}));var hh;(function(i){i.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",i.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",i.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",i.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",i.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",i.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",i.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",i.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",i.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",i.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",i.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(hh||(hh={}));var mh;(function(i){i.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",i.SEVERITY="SEVERITY",i.PROBABILITY="PROBABILITY"})(mh||(mh={}));var gh;(function(i){i.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",i.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",i.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",i.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",i.BLOCK_NONE="BLOCK_NONE",i.OFF="OFF"})(gh||(gh={}));var yh;(function(i){i.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",i.STOP="STOP",i.MAX_TOKENS="MAX_TOKENS",i.SAFETY="SAFETY",i.RECITATION="RECITATION",i.LANGUAGE="LANGUAGE",i.OTHER="OTHER",i.BLOCKLIST="BLOCKLIST",i.PROHIBITED_CONTENT="PROHIBITED_CONTENT",i.SPII="SPII",i.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",i.IMAGE_SAFETY="IMAGE_SAFETY",i.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",i.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",i.NO_IMAGE="NO_IMAGE",i.IMAGE_RECITATION="IMAGE_RECITATION",i.IMAGE_OTHER="IMAGE_OTHER"})(yh||(yh={}));var vh;(function(i){i.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",i.NEGLIGIBLE="NEGLIGIBLE",i.LOW="LOW",i.MEDIUM="MEDIUM",i.HIGH="HIGH"})(vh||(vh={}));var Th;(function(i){i.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",i.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",i.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",i.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",i.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(Th||(Th={}));var Eh;(function(i){i.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",i.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",i.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",i.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",i.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(Eh||(Eh={}));var _h;(function(i){i.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",i.SAFETY="SAFETY",i.OTHER="OTHER",i.BLOCKLIST="BLOCKLIST",i.PROHIBITED_CONTENT="PROHIBITED_CONTENT",i.IMAGE_SAFETY="IMAGE_SAFETY",i.MODEL_ARMOR="MODEL_ARMOR",i.JAILBREAK="JAILBREAK"})(_h||(_h={}));var Sh;(function(i){i.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",i.ON_DEMAND="ON_DEMAND",i.ON_DEMAND_PRIORITY="ON_DEMAND_PRIORITY",i.ON_DEMAND_FLEX="ON_DEMAND_FLEX",i.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(Sh||(Sh={}));var Ca;(function(i){i.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",i.TEXT="TEXT",i.IMAGE="IMAGE",i.AUDIO="AUDIO"})(Ca||(Ca={}));var Ah;(function(i){i.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",i.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",i.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",i.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(Ah||(Ah={}));var Ch;(function(i){i.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",i.TUNING_MODE_FULL="TUNING_MODE_FULL",i.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(Ch||(Ch={}));var Rh;(function(i){i.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",i.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",i.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",i.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",i.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",i.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",i.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(Rh||(Rh={}));var hu;(function(i){i.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",i.JOB_STATE_QUEUED="JOB_STATE_QUEUED",i.JOB_STATE_PENDING="JOB_STATE_PENDING",i.JOB_STATE_RUNNING="JOB_STATE_RUNNING",i.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",i.JOB_STATE_FAILED="JOB_STATE_FAILED",i.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",i.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",i.JOB_STATE_PAUSED="JOB_STATE_PAUSED",i.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",i.JOB_STATE_UPDATING="JOB_STATE_UPDATING",i.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(hu||(hu={}));var Mh;(function(i){i.TUNING_JOB_STATE_UNSPECIFIED="TUNING_JOB_STATE_UNSPECIFIED",i.TUNING_JOB_STATE_WAITING_FOR_QUOTA="TUNING_JOB_STATE_WAITING_FOR_QUOTA",i.TUNING_JOB_STATE_PROCESSING_DATASET="TUNING_JOB_STATE_PROCESSING_DATASET",i.TUNING_JOB_STATE_WAITING_FOR_CAPACITY="TUNING_JOB_STATE_WAITING_FOR_CAPACITY",i.TUNING_JOB_STATE_TUNING="TUNING_JOB_STATE_TUNING",i.TUNING_JOB_STATE_POST_PROCESSING="TUNING_JOB_STATE_POST_PROCESSING"})(Mh||(Mh={}));var Nh;(function(i){i.AGGREGATION_METRIC_UNSPECIFIED="AGGREGATION_METRIC_UNSPECIFIED",i.AVERAGE="AVERAGE",i.MODE="MODE",i.STANDARD_DEVIATION="STANDARD_DEVIATION",i.VARIANCE="VARIANCE",i.MINIMUM="MINIMUM",i.MAXIMUM="MAXIMUM",i.MEDIAN="MEDIAN",i.PERCENTILE_P90="PERCENTILE_P90",i.PERCENTILE_P95="PERCENTILE_P95",i.PERCENTILE_P99="PERCENTILE_P99"})(Nh||(Nh={}));var Ih;(function(i){i.PAIRWISE_CHOICE_UNSPECIFIED="PAIRWISE_CHOICE_UNSPECIFIED",i.BASELINE="BASELINE",i.CANDIDATE="CANDIDATE",i.TIE="TIE"})(Ih||(Ih={}));var Dh;(function(i){i.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",i.TUNING_TASK_I2V="TUNING_TASK_I2V",i.TUNING_TASK_T2V="TUNING_TASK_T2V",i.TUNING_TASK_R2V="TUNING_TASK_R2V"})(Dh||(Dh={}));var Uh;(function(i){i.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",i.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",i.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",i.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",i.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(Uh||(Uh={}));var mu;(function(i){i.COLLECTION="COLLECTION"})(mu||(mu={}));var wh;(function(i){i.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",i.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",i.BALANCED="BALANCED",i.PRIORITIZE_COST="PRIORITIZE_COST"})(wh||(wh={}));var xh;(function(i){i.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",i.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(xh||(xh={}));var bh;(function(i){i.PROMINENT_PEOPLE_UNSPECIFIED="PROMINENT_PEOPLE_UNSPECIFIED",i.ALLOW_PROMINENT_PEOPLE="ALLOW_PROMINENT_PEOPLE",i.BLOCK_PROMINENT_PEOPLE="BLOCK_PROMINENT_PEOPLE"})(bh||(bh={}));var Ra;(function(i){i.PREDICT="PREDICT",i.EMBED_CONTENT="EMBED_CONTENT"})(Ra||(Ra={}));var Gh;(function(i){i.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",i.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",i.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",i.BLOCK_NONE="BLOCK_NONE"})(Gh||(Gh={}));var Lh;(function(i){i.auto="auto",i.en="en",i.ja="ja",i.ko="ko",i.hi="hi",i.zh="zh",i.pt="pt",i.es="es"})(Lh||(Lh={}));var Hh;(function(i){i.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",i.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",i.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",i.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",i.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(Hh||(Hh={}));var Ph;(function(i){i.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",i.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",i.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",i.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(Ph||(Ph={}));var qh;(function(i){i.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",i.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",i.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",i.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(qh||(qh={}));var Vh;(function(i){i.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",i.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",i.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",i.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",i.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",i.EDIT_MODE_STYLE="EDIT_MODE_STYLE",i.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",i.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(Vh||(Vh={}));var Bh;(function(i){i.FOREGROUND="FOREGROUND",i.BACKGROUND="BACKGROUND",i.PROMPT="PROMPT",i.SEMANTIC="SEMANTIC",i.INTERACTIVE="INTERACTIVE"})(Bh||(Bh={}));var zh;(function(i){i.ASSET="ASSET",i.STYLE="STYLE"})(zh||(zh={}));var Oh;(function(i){i.INSERT="INSERT",i.REMOVE="REMOVE",i.REMOVE_STATIC="REMOVE_STATIC",i.OUTPAINT="OUTPAINT"})(Oh||(Oh={}));var Fh;(function(i){i.OPTIMIZED="OPTIMIZED",i.LOSSLESS="LOSSLESS"})(Fh||(Fh={}));var kh;(function(i){i.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",i.PREFERENCE_TUNING="PREFERENCE_TUNING",i.DISTILLATION="DISTILLATION"})(kh||(kh={}));var Jh;(function(i){i.STATE_UNSPECIFIED="STATE_UNSPECIFIED",i.STATE_PENDING="STATE_PENDING",i.STATE_ACTIVE="STATE_ACTIVE",i.STATE_FAILED="STATE_FAILED"})(Jh||(Jh={}));var Yh;(function(i){i.STATE_UNSPECIFIED="STATE_UNSPECIFIED",i.PROCESSING="PROCESSING",i.ACTIVE="ACTIVE",i.FAILED="FAILED"})(Yh||(Yh={}));var Kh;(function(i){i.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",i.UPLOADED="UPLOADED",i.GENERATED="GENERATED",i.REGISTERED="REGISTERED"})(Kh||(Kh={}));var Qh;(function(i){i.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",i.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",i.RESPONSE_REJECTED="RESPONSE_REJECTED",i.NEED_MORE_INPUT="NEED_MORE_INPUT"})(Qh||(Qh={}));var Xh;(function(i){i.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",i.TEXT="TEXT",i.IMAGE="IMAGE",i.VIDEO="VIDEO",i.AUDIO="AUDIO",i.DOCUMENT="DOCUMENT"})(Xh||(Xh={}));var Zh;(function(i){i.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",i.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",i.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(Zh||(Zh={}));var $h;(function(i){i.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",i.ACTIVITY_START="ACTIVITY_START",i.ACTIVITY_END="ACTIVITY_END"})($h||($h={}));var Wh;(function(i){i.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",i.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",i.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(Wh||(Wh={}));var jh;(function(i){i.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",i.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",i.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(jh||(jh={}));var em;(function(i){i.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",i.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",i.NO_INTERRUPTION="NO_INTERRUPTION"})(em||(em={}));var tm;(function(i){i.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",i.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",i.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(tm||(tm={}));var nm;(function(i){i.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",i.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",i.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",i.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",i.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",i.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",i.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",i.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",i.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",i.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",i.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",i.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",i.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(nm||(nm={}));var im;(function(i){i.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",i.QUALITY="QUALITY",i.DIVERSITY="DIVERSITY",i.VOCALIZATION="VOCALIZATION"})(im||(im={}));var Yi;(function(i){i.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",i.PLAY="PLAY",i.PAUSE="PAUSE",i.STOP="STOP",i.RESET_CONTEXT="RESET_CONTEXT"})(Yi||(Yi={}));class gu{constructor(t){const o={};for(const a of t.headers.entries())o[a[0]]=a[1];this.headers=o,this.responseInternal=t}json(){return this.responseInternal.json()}}class Zo{get text(){var t,o,a,u,f,p,g,y;if(((u=(a=(o=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||u===void 0?void 0:u.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 m="",v=!1;const E=[];for(const _ of(y=(g=(p=(f=this.candidates)===null||f===void 0?void 0:f[0])===null||p===void 0?void 0:p.content)===null||g===void 0?void 0:g.parts)!==null&&y!==void 0?y:[]){for(const[A,I]of Object.entries(_))A!=="text"&&A!=="thought"&&A!=="thoughtSignature"&&(I!==null||I!==void 0)&&E.push(A);if(typeof _.text=="string"){if(typeof _.thought=="boolean"&&_.thought)continue;v=!0,m+=_.text}}return E.length>0&&console.warn(`there are non-text parts ${E} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),v?m:void 0}get data(){var t,o,a,u,f,p,g,y;if(((u=(a=(o=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||u===void 0?void 0:u.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 m="";const v=[];for(const E of(y=(g=(p=(f=this.candidates)===null||f===void 0?void 0:f[0])===null||p===void 0?void 0:p.content)===null||g===void 0?void 0:g.parts)!==null&&y!==void 0?y:[]){for(const[_,A]of Object.entries(E))_!=="inlineData"&&(A!==null||A!==void 0)&&v.push(_);E.inlineData&&typeof E.inlineData.data=="string"&&(m+=atob(E.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.`),m.length>0?btoa(m):void 0}get functionCalls(){var t,o,a,u,f,p,g,y;if(((u=(a=(o=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||u===void 0?void 0:u.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 m=(y=(g=(p=(f=this.candidates)===null||f===void 0?void 0:f[0])===null||p===void 0?void 0:p.content)===null||g===void 0?void 0:g.parts)===null||y===void 0?void 0:y.filter(v=>v.functionCall).map(v=>v.functionCall).filter(v=>v!==void 0);if((m==null?void 0:m.length)!==0)return m}get executableCode(){var t,o,a,u,f,p,g,y,m;if(((u=(a=(o=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||u===void 0?void 0:u.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=(y=(g=(p=(f=this.candidates)===null||f===void 0?void 0:f[0])===null||p===void 0?void 0:p.content)===null||g===void 0?void 0:g.parts)===null||y===void 0?void 0:y.filter(E=>E.executableCode).map(E=>E.executableCode).filter(E=>E!==void 0);if((v==null?void 0:v.length)!==0)return(m=v==null?void 0:v[0])===null||m===void 0?void 0:m.code}get codeExecutionResult(){var t,o,a,u,f,p,g,y,m;if(((u=(a=(o=(t=this.candidates)===null||t===void 0?void 0:t[0])===null||o===void 0?void 0:o.content)===null||a===void 0?void 0:a.parts)===null||u===void 0?void 0:u.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=(y=(g=(p=(f=this.candidates)===null||f===void 0?void 0:f[0])===null||p===void 0?void 0:p.content)===null||g===void 0?void 0:g.parts)===null||y===void 0?void 0:y.filter(E=>E.codeExecutionResult).map(E=>E.codeExecutionResult).filter(E=>E!==void 0);if((v==null?void 0:v.length)!==0)return(m=v==null?void 0:v[0])===null||m===void 0?void 0:m.output}}class om{}class lm{}class P0{}class q0{}class V0{}class B0{}class am{}class sm{}class rm{}class z0{}class Ma{_fromAPIResponse({apiResponse:t,_isVertexAI:o}){const a=new Ma;let u;const f=t;return o?u=R0(f):u=C0(f),Object.assign(a,u),a}}class um{}class cm{}class fm{}class dm{}class O0{}class F0{}class k0{}class wu{_fromAPIResponse({apiResponse:t,_isVertexAI:o}){const a=new wu,f=x0(t);return Object.assign(a,f),a}}class J0{}class Y0{}class K0{}class Q0{}class pm{}class X0{get text(){var t,o,a;let u="",f=!1;const p=[];for(const g of(a=(o=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||o===void 0?void 0:o.parts)!==null&&a!==void 0?a:[]){for(const[y,m]of Object.entries(g))y!=="text"&&y!=="thought"&&m!==null&&p.push(y);if(typeof g.text=="string"){if(typeof g.thought=="boolean"&&g.thought)continue;f=!0,u+=g.text}}return p.length>0&&console.warn(`there are non-text parts ${p} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),f?u:void 0}get data(){var t,o,a;let u="";const f=[];for(const p of(a=(o=(t=this.serverContent)===null||t===void 0?void 0:t.modelTurn)===null||o===void 0?void 0:o.parts)!==null&&a!==void 0?a:[]){for(const[g,y]of Object.entries(p))g!=="inlineData"&&y!==null&&f.push(g);p.inlineData&&typeof p.inlineData.data=="string"&&(u+=atob(p.inlineData.data))}return f.length>0&&console.warn(`there are non-data parts ${f} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),u.length>0?btoa(u):void 0}}class Z0{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class xu{_fromAPIResponse({apiResponse:t,_isVertexAI:o}){const a=new xu,f=Bm(t);return Object.assign(a,f),a}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Te(i,t){if(!t||typeof t!="string")throw new Error("model is required and must be a string");if(t.includes("..")||t.includes("?")||t.includes("&"))throw new Error("invalid model parameter");if(i.isVertexAI()){if(t.startsWith("publishers/")||t.startsWith("projects/")||t.startsWith("models/"))return t;if(t.indexOf("/")>=0){const o=t.split("/",2);return`publishers/${o[0]}/models/${o[1]}`}else return`publishers/google/models/${t}`}else return t.startsWith("models/")||t.startsWith("tunedModels/")?t:`models/${t}`}function zm(i,t){const o=Te(i,t);return o?o.startsWith("publishers/")&&i.isVertexAI()?`projects/${i.getProject()}/locations/${i.getLocation()}/${o}`:o.startsWith("models/")&&i.isVertexAI()?`projects/${i.getProject()}/locations/${i.getLocation()}/publishers/google/${o}`:o:""}function Om(i){return Array.isArray(i)?i.map(t=>Na(t)):[Na(i)]}function Na(i){if(typeof i=="object"&&i!==null)return i;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof i}`)}function Fm(i){const t=Na(i);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function km(i){const t=Na(i);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function hm(i){if(i==null)throw new Error("PartUnion is required");if(typeof i=="object")return i;if(typeof i=="string")return{text:i};throw new Error(`Unsupported part type: ${typeof i}`)}function Jm(i){if(i==null||Array.isArray(i)&&i.length===0)throw new Error("PartListUnion is required");return Array.isArray(i)?i.map(t=>hm(t)):[hm(i)]}function yu(i){return i!=null&&typeof i=="object"&&"parts"in i&&Array.isArray(i.parts)}function mm(i){return i!=null&&typeof i=="object"&&"functionCall"in i}function gm(i){return i!=null&&typeof i=="object"&&"functionResponse"in i}function Xe(i){if(i==null)throw new Error("ContentUnion is required");return yu(i)?i:{role:"user",parts:Jm(i)}}function bu(i,t){if(!t)return[];if(i.isVertexAI()&&Array.isArray(t))return t.flatMap(o=>{const a=Xe(o);return a.parts&&a.parts.length>0&&a.parts[0].text!==void 0?[a.parts[0].text]:[]});if(i.isVertexAI()){const o=Xe(t);return o.parts&&o.parts.length>0&&o.parts[0].text!==void 0?[o.parts[0].text]:[]}return Array.isArray(t)?t.map(o=>Xe(o)):[Xe(t)]}function Ct(i){if(i==null||Array.isArray(i)&&i.length===0)throw new Error("contents are required");if(!Array.isArray(i)){if(mm(i)||gm(i))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[Xe(i)]}const t=[],o=[],a=yu(i[0]);for(const u of i){const f=yu(u);if(f!=a)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(f)t.push(u);else{if(mm(u)||gm(u))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(u)}}return a||t.push({role:"user",parts:Jm(o)}),t}function $0(i,t){i.includes("null")&&(t.nullable=!0);const o=i.filter(a=>a!=="null");if(o.length===1)t.type=Object.values(Vn).includes(o[0].toUpperCase())?o[0].toUpperCase():Vn.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const a of o)t.anyOf.push({type:Object.values(Vn).includes(a.toUpperCase())?a.toUpperCase():Vn.TYPE_UNSPECIFIED})}}function Qi(i){const t={},o=["items"],a=["anyOf"],u=["properties"];if(i.type&&i.anyOf)throw new Error("type and anyOf cannot be both populated.");const f=i.anyOf;f!=null&&f.length==2&&(f[0].type==="null"?(t.nullable=!0,i=f[1]):f[1].type==="null"&&(t.nullable=!0,i=f[0])),i.type instanceof Array&&$0(i.type,t);for(const[p,g]of Object.entries(i))if(g!=null)if(p=="type"){if(g==="null")throw new Error("type: null can not be the only possible type for the field.");if(g instanceof Array)continue;t.type=Object.values(Vn).includes(g.toUpperCase())?g.toUpperCase():Vn.TYPE_UNSPECIFIED}else if(o.includes(p))t[p]=Qi(g);else if(a.includes(p)){const y=[];for(const m of g){if(m.type=="null"){t.nullable=!0;continue}y.push(Qi(m))}t[p]=y}else if(u.includes(p)){const y={};for(const[m,v]of Object.entries(g))y[m]=Qi(v);t[p]=y}else{if(p==="additionalProperties")continue;t[p]=g}return t}function Gu(i){return Qi(i)}function Lu(i){if(typeof i=="object")return i;if(typeof i=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:i}}};throw new Error(`Unsupported speechConfig type: ${typeof i}`)}function Hu(i){if("multiSpeakerVoiceConfig"in i)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return i}function Zi(i){if(i.functionDeclarations)for(const t of i.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes("$schema")?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=Qi(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=Qi(t.response));return i}function $i(i){if(i==null)throw new Error("tools is required");if(!Array.isArray(i))throw new Error("tools is required and must be an array of Tools");const t=[];for(const o of i)t.push(o);return t}function W0(i,t,o,a=1){const u=!t.startsWith(`${o}/`)&&t.split("/").length===a;return i.isVertexAI()?t.startsWith("projects/")?t:t.startsWith("locations/")?`projects/${i.getProject()}/${t}`:t.startsWith(`${o}/`)?`projects/${i.getProject()}/locations/${i.getLocation()}/${t}`:u?`projects/${i.getProject()}/locations/${i.getLocation()}/${o}/${t}`:t:u?`${o}/${t}`:t}function pn(i,t){if(typeof t!="string")throw new Error("name must be a string");return W0(i,t,"cachedContents")}function Ym(i){switch(i){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 i}}function Bn(i){return Uu(i)}function j0(i){return i!=null&&typeof i=="object"&&"name"in i}function eT(i){return i!=null&&typeof i=="object"&&"video"in i}function tT(i){return i!=null&&typeof i=="object"&&"uri"in i}function Km(i){var t;let o;if(j0(i)&&(o=i.name),!(tT(i)&&(o=i.uri,o===void 0))&&!(eT(i)&&(o=(t=i.video)===null||t===void 0?void 0:t.uri,o===void 0))){if(typeof i=="string"&&(o=i),o===void 0)throw new Error("Could not extract file name from the provided input.");if(o.startsWith("https://")){const u=o.split("files/")[1].match(/[a-z0-9]+/);if(u===null)throw new Error(`Could not extract file name from URI ${o}`);o=u[0]}else o.startsWith("files/")&&(o=o.split("files/")[1]);return o}}function Qm(i,t){let o;return i.isVertexAI()?o=t?"publishers/google/models":"models":o=t?"models":"tunedModels",o}function Xm(i){for(const t of["models","tunedModels","publisherModels"])if(nT(i,t))return i[t];return[]}function nT(i,t){return i!==null&&typeof i=="object"&&t in i}function iT(i,t={}){const o=i,a={name:o.name,description:o.description,parametersJsonSchema:o.inputSchema};return o.outputSchema&&(a.responseJsonSchema=o.outputSchema),t.behavior&&(a.behavior=t.behavior),{functionDeclarations:[a]}}function oT(i,t={}){const o=[],a=new Set;for(const u of i){const f=u.name;if(a.has(f))throw new Error(`Duplicate function name ${f} found in MCP tools. Please ensure function names are unique.`);a.add(f);const p=iT(u,t);p.functionDeclarations&&o.push(...p.functionDeclarations)}return{functionDeclarations:o}}function Zm(i,t){let o;if(typeof t=="string")if(i.isVertexAI())if(t.startsWith("gs://"))o={format:"jsonl",gcsUri:[t]};else if(t.startsWith("bq://"))o={format:"bigquery",bigqueryUri:t};else throw new Error(`Unsupported string source for Vertex AI: ${t}`);else if(t.startsWith("files/"))o={fileName:t};else throw new Error(`Unsupported string source for Gemini API: ${t}`);else if(Array.isArray(t)){if(i.isVertexAI())throw new Error("InlinedRequest[] is not supported in Vertex AI.");o={inlinedRequests:t}}else o=t;const a=[o.gcsUri,o.bigqueryUri].filter(Boolean).length,u=[o.inlinedRequests,o.fileName].filter(Boolean).length;if(i.isVertexAI()){if(u>0||a!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(a>0||u!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return o}function lT(i){if(typeof i!="string")return i;const t=i;if(t.startsWith("gs://"))return{format:"jsonl",gcsUri:t};if(t.startsWith("bq://"))return{format:"bigquery",bigqueryUri:t};throw new Error(`Unsupported destination: ${t}`)}function $m(i){if(typeof i!="object"||i===null)return{};const t=i,o=t.inlinedResponses;if(typeof o!="object"||o===null)return i;const u=o.inlinedResponses;if(!Array.isArray(u)||u.length===0)return i;let f=!1;for(const p of u){if(typeof p!="object"||p===null)continue;const y=p.response;if(typeof y!="object"||y===null)continue;if(y.embedding!==void 0){f=!0;break}}return f&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),i}function Wi(i,t){const o=t;if(!i.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 Wm(i){const t=i;return t==="BATCH_STATE_UNSPECIFIED"?"JOB_STATE_UNSPECIFIED":t==="BATCH_STATE_PENDING"?"JOB_STATE_PENDING":t==="BATCH_STATE_RUNNING"?"JOB_STATE_RUNNING":t==="BATCH_STATE_SUCCEEDED"?"JOB_STATE_SUCCEEDED":t==="BATCH_STATE_FAILED"?"JOB_STATE_FAILED":t==="BATCH_STATE_CANCELLED"?"JOB_STATE_CANCELLED":t==="BATCH_STATE_EXPIRED"?"JOB_STATE_EXPIRED":t}function aT(i){return i.includes("gemini")&&i!=="gemini-embedding-001"||i.includes("maas")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function sT(i){const t={},o=r(i,["apiKey"]);if(o!=null&&c(t,["apiKey"],o),r(i,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(r(i,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(r(i,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(r(i,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(r(i,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(r(i,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return t}function rT(i){const t={},o=r(i,["responsesFile"]);o!=null&&c(t,["fileName"],o);const a=r(i,["inlinedResponses","inlinedResponses"]);if(a!=null){let f=a;Array.isArray(f)&&(f=f.map(p=>OT(p))),c(t,["inlinedResponses"],f)}const u=r(i,["inlinedEmbedContentResponses","inlinedResponses"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["inlinedEmbedContentResponses"],f)}return t}function uT(i){const t={},o=r(i,["predictionsFormat"]);o!=null&&c(t,["format"],o);const a=r(i,["gcsDestination","outputUriPrefix"]);a!=null&&c(t,["gcsUri"],a);const u=r(i,["bigqueryDestination","outputUri"]);return u!=null&&c(t,["bigqueryUri"],u),t}function cT(i){const t={},o=r(i,["format"]);o!=null&&c(t,["predictionsFormat"],o);const a=r(i,["gcsUri"]);a!=null&&c(t,["gcsDestination","outputUriPrefix"],a);const u=r(i,["bigqueryUri"]);if(u!=null&&c(t,["bigqueryDestination","outputUri"],u),r(i,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(r(i,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(r(i,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return t}function Sa(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["metadata","displayName"]);a!=null&&c(t,["displayName"],a);const u=r(i,["metadata","state"]);u!=null&&c(t,["state"],Wm(u));const f=r(i,["metadata","createTime"]);f!=null&&c(t,["createTime"],f);const p=r(i,["metadata","endTime"]);p!=null&&c(t,["endTime"],p);const g=r(i,["metadata","updateTime"]);g!=null&&c(t,["updateTime"],g);const y=r(i,["metadata","model"]);y!=null&&c(t,["model"],y);const m=r(i,["metadata","output"]);return m!=null&&c(t,["dest"],rT($m(m))),t}function vu(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["displayName"]);a!=null&&c(t,["displayName"],a);const u=r(i,["state"]);u!=null&&c(t,["state"],Wm(u));const f=r(i,["error"]);f!=null&&c(t,["error"],f);const p=r(i,["createTime"]);p!=null&&c(t,["createTime"],p);const g=r(i,["startTime"]);g!=null&&c(t,["startTime"],g);const y=r(i,["endTime"]);y!=null&&c(t,["endTime"],y);const m=r(i,["updateTime"]);m!=null&&c(t,["updateTime"],m);const v=r(i,["model"]);v!=null&&c(t,["model"],v);const E=r(i,["inputConfig"]);E!=null&&c(t,["src"],fT(E));const _=r(i,["outputConfig"]);_!=null&&c(t,["dest"],uT($m(_)));const A=r(i,["completionStats"]);return A!=null&&c(t,["completionStats"],A),t}function fT(i){const t={},o=r(i,["instancesFormat"]);o!=null&&c(t,["format"],o);const a=r(i,["gcsSource","uris"]);a!=null&&c(t,["gcsUri"],a);const u=r(i,["bigquerySource","inputUri"]);return u!=null&&c(t,["bigqueryUri"],u),t}function dT(i,t){const o={};if(r(t,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(r(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(r(t,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const a=r(t,["fileName"]);a!=null&&c(o,["fileName"],a);const u=r(t,["inlinedRequests"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>zT(i,p))),c(o,["requests","requests"],f)}return o}function pT(i){const t={},o=r(i,["format"]);o!=null&&c(t,["instancesFormat"],o);const a=r(i,["gcsUri"]);a!=null&&c(t,["gcsSource","uris"],a);const u=r(i,["bigqueryUri"]);if(u!=null&&c(t,["bigquerySource","inputUri"],u),r(i,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(r(i,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return t}function hT(i){const t={},o=r(i,["data"]);if(o!=null&&c(t,["data"],o),r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function mT(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],Wi(i,a)),o}function gT(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],Wi(i,a)),o}function yT(i){const t={},o=r(i,["content"]);o!=null&&c(t,["content"],o);const a=r(i,["citationMetadata"]);a!=null&&c(t,["citationMetadata"],vT(a));const u=r(i,["tokenCount"]);u!=null&&c(t,["tokenCount"],u);const f=r(i,["finishReason"]);f!=null&&c(t,["finishReason"],f);const p=r(i,["groundingMetadata"]);p!=null&&c(t,["groundingMetadata"],p);const g=r(i,["avgLogprobs"]);g!=null&&c(t,["avgLogprobs"],g);const y=r(i,["index"]);y!=null&&c(t,["index"],y);const m=r(i,["logprobsResult"]);m!=null&&c(t,["logprobsResult"],m);const v=r(i,["safetyRatings"]);if(v!=null){let _=v;Array.isArray(_)&&(_=_.map(A=>A)),c(t,["safetyRatings"],_)}const E=r(i,["urlContextMetadata"]);return E!=null&&c(t,["urlContextMetadata"],E),t}function vT(i){const t={},o=r(i,["citationSources"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(u=>u)),c(t,["citations"],a)}return t}function jm(i){const t={},o=r(i,["parts"]);if(o!=null){let u=o;Array.isArray(u)&&(u=u.map(f=>XT(f))),c(t,["parts"],u)}const a=r(i,["role"]);return a!=null&&c(t,["role"],a),t}function TT(i,t){const o={},a=r(i,["displayName"]);if(t!==void 0&&a!=null&&c(t,["batch","displayName"],a),r(i,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return o}function ET(i,t){const o={},a=r(i,["displayName"]);t!==void 0&&a!=null&&c(t,["displayName"],a);const u=r(i,["dest"]);return t!==void 0&&u!=null&&c(t,["outputConfig"],cT(lT(u))),o}function ym(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["_url","model"],Te(i,a));const u=r(t,["src"]);u!=null&&c(o,["batch","inputConfig"],dT(i,Zm(i,u)));const f=r(t,["config"]);return f!=null&&TT(f,o),o}function _T(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["model"],Te(i,a));const u=r(t,["src"]);u!=null&&c(o,["inputConfig"],pT(Zm(i,u)));const f=r(t,["config"]);return f!=null&&ET(f,o),o}function ST(i,t){const o={},a=r(i,["displayName"]);return t!==void 0&&a!=null&&c(t,["batch","displayName"],a),o}function AT(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["_url","model"],Te(i,a));const u=r(t,["src"]);u!=null&&c(o,["batch","inputConfig"],UT(i,u));const f=r(t,["config"]);return f!=null&&ST(f,o),o}function CT(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],Wi(i,a)),o}function RT(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],Wi(i,a)),o}function MT(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["name"]);a!=null&&c(t,["name"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);return f!=null&&c(t,["error"],f),t}function NT(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["name"]);a!=null&&c(t,["name"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);return f!=null&&c(t,["error"],f),t}function IT(i,t){const o={},a=r(t,["contents"]);if(a!=null){let f=bu(i,a);Array.isArray(f)&&(f=f.map(p=>p)),c(o,["requests[]","request","content"],f)}const u=r(t,["config"]);return u!=null&&(c(o,["_self"],DT(u,o)),S0(o,{"requests[].*":"requests[].request.*"})),o}function DT(i,t){const o={},a=r(i,["taskType"]);t!==void 0&&a!=null&&c(t,["requests[]","taskType"],a);const u=r(i,["title"]);t!==void 0&&u!=null&&c(t,["requests[]","title"],u);const f=r(i,["outputDimensionality"]);if(t!==void 0&&f!=null&&c(t,["requests[]","outputDimensionality"],f),r(i,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(r(i,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return o}function UT(i,t){const o={},a=r(t,["fileName"]);a!=null&&c(o,["file_name"],a);const u=r(t,["inlinedRequests"]);return u!=null&&c(o,["requests"],IT(i,u)),o}function wT(i){const t={};if(r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(i,["fileUri"]);o!=null&&c(t,["fileUri"],o);const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function xT(i){const t={},o=r(i,["id"]);o!=null&&c(t,["id"],o);const a=r(i,["args"]);a!=null&&c(t,["args"],a);const u=r(i,["name"]);if(u!=null&&c(t,["name"],u),r(i,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(r(i,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function bT(i){const t={},o=r(i,["allowedFunctionNames"]);o!=null&&c(t,["allowedFunctionNames"],o);const a=r(i,["mode"]);if(a!=null&&c(t,["mode"],a),r(i,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function GT(i,t,o){const a={},u=r(t,["systemInstruction"]);o!==void 0&&u!=null&&c(o,["systemInstruction"],jm(Xe(u)));const f=r(t,["temperature"]);f!=null&&c(a,["temperature"],f);const p=r(t,["topP"]);p!=null&&c(a,["topP"],p);const g=r(t,["topK"]);g!=null&&c(a,["topK"],g);const y=r(t,["candidateCount"]);y!=null&&c(a,["candidateCount"],y);const m=r(t,["maxOutputTokens"]);m!=null&&c(a,["maxOutputTokens"],m);const v=r(t,["stopSequences"]);v!=null&&c(a,["stopSequences"],v);const E=r(t,["responseLogprobs"]);E!=null&&c(a,["responseLogprobs"],E);const _=r(t,["logprobs"]);_!=null&&c(a,["logprobs"],_);const A=r(t,["presencePenalty"]);A!=null&&c(a,["presencePenalty"],A);const I=r(t,["frequencyPenalty"]);I!=null&&c(a,["frequencyPenalty"],I);const L=r(t,["seed"]);L!=null&&c(a,["seed"],L);const b=r(t,["responseMimeType"]);b!=null&&c(a,["responseMimeType"],b);const z=r(t,["responseSchema"]);z!=null&&c(a,["responseSchema"],Gu(z));const Q=r(t,["responseJsonSchema"]);if(Q!=null&&c(a,["responseJsonSchema"],Q),r(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(r(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const O=r(t,["safetySettings"]);if(o!==void 0&&O!=null){let xe=O;Array.isArray(xe)&&(xe=xe.map(Ae=>ZT(Ae))),c(o,["safetySettings"],xe)}const k=r(t,["tools"]);if(o!==void 0&&k!=null){let xe=$i(k);Array.isArray(xe)&&(xe=xe.map(Ae=>WT(Zi(Ae)))),c(o,["tools"],xe)}const j=r(t,["toolConfig"]);if(o!==void 0&&j!=null&&c(o,["toolConfig"],$T(j)),r(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const B=r(t,["cachedContent"]);o!==void 0&&B!=null&&c(o,["cachedContent"],pn(i,B));const J=r(t,["responseModalities"]);J!=null&&c(a,["responseModalities"],J);const ue=r(t,["mediaResolution"]);ue!=null&&c(a,["mediaResolution"],ue);const Z=r(t,["speechConfig"]);if(Z!=null&&c(a,["speechConfig"],Lu(Z)),r(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const re=r(t,["thinkingConfig"]);re!=null&&c(a,["thinkingConfig"],re);const Ee=r(t,["imageConfig"]);Ee!=null&&c(a,["imageConfig"],BT(Ee));const Me=r(t,["enableEnhancedCivicAnswers"]);if(Me!=null&&c(a,["enableEnhancedCivicAnswers"],Me),r(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return a}function LT(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["candidates"]);if(a!=null){let y=a;Array.isArray(y)&&(y=y.map(m=>yT(m))),c(t,["candidates"],y)}const u=r(i,["modelVersion"]);u!=null&&c(t,["modelVersion"],u);const f=r(i,["promptFeedback"]);f!=null&&c(t,["promptFeedback"],f);const p=r(i,["responseId"]);p!=null&&c(t,["responseId"],p);const g=r(i,["usageMetadata"]);return g!=null&&c(t,["usageMetadata"],g),t}function HT(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],Wi(i,a)),o}function PT(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],Wi(i,a)),o}function qT(i){const t={},o=r(i,["authConfig"]);o!=null&&c(t,["authConfig"],sT(o));const a=r(i,["enableWidget"]);return a!=null&&c(t,["enableWidget"],a),t}function VT(i){const t={},o=r(i,["searchTypes"]);if(o!=null&&c(t,["searchTypes"],o),r(i,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(r(i,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const a=r(i,["timeRangeFilter"]);return a!=null&&c(t,["timeRangeFilter"],a),t}function BT(i){const t={},o=r(i,["aspectRatio"]);o!=null&&c(t,["aspectRatio"],o);const a=r(i,["imageSize"]);if(a!=null&&c(t,["imageSize"],a),r(i,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(r(i,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is not supported in Gemini API.");if(r(i,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(r(i,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");if(r(i,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is not supported in Gemini API.");return t}function zT(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["request","model"],Te(i,a));const u=r(t,["contents"]);if(u!=null){let g=Ct(u);Array.isArray(g)&&(g=g.map(y=>jm(y))),c(o,["request","contents"],g)}const f=r(t,["metadata"]);f!=null&&c(o,["metadata"],f);const p=r(t,["config"]);return p!=null&&c(o,["request","generationConfig"],GT(i,p,r(o,["request"],{}))),o}function OT(i){const t={},o=r(i,["response"]);o!=null&&c(t,["response"],LT(o));const a=r(i,["metadata"]);a!=null&&c(t,["metadata"],a);const u=r(i,["error"]);return u!=null&&c(t,["error"],u),t}function FT(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);if(t!==void 0&&u!=null&&c(t,["_query","pageToken"],u),r(i,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return o}function kT(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);t!==void 0&&u!=null&&c(t,["_query","pageToken"],u);const f=r(i,["filter"]);return t!==void 0&&f!=null&&c(t,["_query","filter"],f),o}function JT(i){const t={},o=r(i,["config"]);return o!=null&&FT(o,t),t}function YT(i){const t={},o=r(i,["config"]);return o!=null&&kT(o,t),t}function KT(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["operations"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>Sa(p))),c(t,["batchJobs"],f)}return t}function QT(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["batchPredictionJobs"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>vu(p))),c(t,["batchJobs"],f)}return t}function XT(i){const t={},o=r(i,["mediaResolution"]);o!=null&&c(t,["mediaResolution"],o);const a=r(i,["codeExecutionResult"]);a!=null&&c(t,["codeExecutionResult"],a);const u=r(i,["executableCode"]);u!=null&&c(t,["executableCode"],u);const f=r(i,["fileData"]);f!=null&&c(t,["fileData"],wT(f));const p=r(i,["functionCall"]);p!=null&&c(t,["functionCall"],xT(p));const g=r(i,["functionResponse"]);g!=null&&c(t,["functionResponse"],g);const y=r(i,["inlineData"]);y!=null&&c(t,["inlineData"],hT(y));const m=r(i,["text"]);m!=null&&c(t,["text"],m);const v=r(i,["thought"]);v!=null&&c(t,["thought"],v);const E=r(i,["thoughtSignature"]);E!=null&&c(t,["thoughtSignature"],E);const _=r(i,["videoMetadata"]);return _!=null&&c(t,["videoMetadata"],_),t}function ZT(i){const t={},o=r(i,["category"]);if(o!=null&&c(t,["category"],o),r(i,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const a=r(i,["threshold"]);return a!=null&&c(t,["threshold"],a),t}function $T(i){const t={},o=r(i,["retrievalConfig"]);o!=null&&c(t,["retrievalConfig"],o);const a=r(i,["functionCallingConfig"]);return a!=null&&c(t,["functionCallingConfig"],bT(a)),t}function WT(i){const t={};if(r(i,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=r(i,["computerUse"]);o!=null&&c(t,["computerUse"],o);const a=r(i,["fileSearch"]);a!=null&&c(t,["fileSearch"],a);const u=r(i,["googleSearch"]);u!=null&&c(t,["googleSearch"],VT(u));const f=r(i,["googleMaps"]);f!=null&&c(t,["googleMaps"],qT(f));const p=r(i,["codeExecution"]);if(p!=null&&c(t,["codeExecution"],p),r(i,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const g=r(i,["functionDeclarations"]);if(g!=null){let E=g;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["functionDeclarations"],E)}const y=r(i,["googleSearchRetrieval"]);if(y!=null&&c(t,["googleSearchRetrieval"],y),r(i,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const m=r(i,["urlContext"]);m!=null&&c(t,["urlContext"],m);const v=r(i,["mcpServers"]);if(v!=null){let E=v;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["mcpServers"],E)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var fn;(function(i){i.PAGED_ITEM_BATCH_JOBS="batchJobs",i.PAGED_ITEM_MODELS="models",i.PAGED_ITEM_TUNING_JOBS="tuningJobs",i.PAGED_ITEM_FILES="files",i.PAGED_ITEM_CACHED_CONTENTS="cachedContents",i.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",i.PAGED_ITEM_DOCUMENTS="documents"})(fn||(fn={}));class si{constructor(t,o,a,u){this.pageInternal=[],this.paramsInternal={},this.requestInternal=o,this.init(t,a,u)}init(t,o,a){var u,f;this.nameInternal=t,this.pageInternal=o[this.nameInternal]||[],this.sdkHttpResponseInternal=o==null?void 0:o.sdkHttpResponse,this.idxInternal=0;let p={config:{}};!a||Object.keys(a).length===0?p={config:{}}:typeof a=="object"?p=Object.assign({},a):p=a,p.config&&(p.config.pageToken=o.nextPageToken),this.paramsInternal=p,this.pageInternalSize=(f=(u=p.config)===null||u===void 0?void 0:u.pageSize)!==null&&f!==void 0?f:this.pageInternal.length}initNextPage(t){this.init(this.nameInternal,t,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(t){return this.pageInternal[t]}[Symbol.asyncIterator](){return{next:async()=>{if(this.idxInternal>=this.pageLength)if(this.hasNextPage())await this.nextPage();else return{value:void 0,done:!0};const t=this.getItem(this.idxInternal);return this.idxInternal+=1,{value:t,done:!1}},return:async()=>({value:void 0,done:!0})}}async nextPage(){if(!this.hasNextPage())throw new Error("No more pages to fetch.");const t=await this.requestInternal(this.params);return this.initNextPage(t),this.page}hasNextPage(){var t;return((t=this.params.config)===null||t===void 0?void 0:t.pageToken)!==void 0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class jT extends dn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new si(fn.PAGED_ITEM_BATCH_JOBS,a=>this.listInternal(a),await this.listInternal(o),o),this.create=async o=>(this.apiClient.isVertexAI()&&(o.config=this.formatDestination(o.src,o.config)),this.createInternal(o)),this.createEmbeddings=async o=>{if(console.warn("batches.createEmbeddings() is experimental and may change without notice."),this.apiClient.isVertexAI())throw new Error("Vertex AI does not support batches.createEmbeddings.");return this.createEmbeddingsInternal(o)}}createInlinedGenerateContentRequest(t){const o=ym(this.apiClient,t),a=o._url,u=Y("{model}:batchGenerateContent",a),g=o.batch.inputConfig.requests,y=g.requests,m=[];for(const v of y){const E=Object.assign({},v);if(E.systemInstruction){const _=E.systemInstruction;delete E.systemInstruction;const A=E.request;A.systemInstruction=_,E.request=A}m.push(E)}return g.requests=m,delete o.config,delete o._url,delete o._query,{path:u,body:o}}getGcsUri(t){if(typeof t=="string")return t.startsWith("gs://")?t:void 0;if(!Array.isArray(t)&&t.gcsUri&&t.gcsUri.length>0)return t.gcsUri[0]}getBigqueryUri(t){if(typeof t=="string")return t.startsWith("bq://")?t:void 0;if(!Array.isArray(t))return t.bigqueryUri}formatDestination(t,o){const a=o?Object.assign({},o):{},u=Date.now().toString();if(a.displayName||(a.displayName=`genaiBatchJob_${u}`),a.dest===void 0){const f=this.getGcsUri(t),p=this.getBigqueryUri(t);if(f)f.endsWith(".jsonl")?a.dest=`${f.slice(0,-6)}/dest`:a.dest=`${f}_dest_${u}`;else if(p)a.dest=`${p}_dest_${u}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return a}async createInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=_T(this.apiClient,t);return g=Y("batchPredictionJobs",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>vu(v))}else{const m=ym(this.apiClient,t);return g=Y("{model}:batchGenerateContent",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>Sa(v))}}async createEmbeddingsInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=AT(this.apiClient,t);return f=Y("{model}:asyncBatchEmbedContent",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>Sa(y))}}async get(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=PT(this.apiClient,t);return g=Y("batchPredictionJobs/{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>vu(v))}else{const m=HT(this.apiClient,t);return g=Y("batches/{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>Sa(v))}}async cancel(t){var o,a,u,f;let p="",g={};if(this.apiClient.isVertexAI()){const y=gT(this.apiClient,t);p=Y("batchPredictionJobs/{name}:cancel",y._url),g=y._query,delete y._url,delete y._query,await this.apiClient.request({path:p,queryParams:g,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}else{const y=mT(this.apiClient,t);p=Y("batches/{name}:cancel",y._url),g=y._query,delete y._url,delete y._query,await this.apiClient.request({path:p,queryParams:g,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal})}}async listInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=YT(t);return g=Y("batchPredictionJobs",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=QT(v),_=new pm;return Object.assign(_,E),_})}else{const m=JT(t);return g=Y("batches",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=KT(v),_=new pm;return Object.assign(_,E),_})}}async delete(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=RT(this.apiClient,t);return g=Y("batchPredictionJobs/{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>NT(v))}else{const m=CT(this.apiClient,t);return g=Y("batches/{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>MT(v))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function eE(i){const t={},o=r(i,["apiKey"]);if(o!=null&&c(t,["apiKey"],o),r(i,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(r(i,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(r(i,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(r(i,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(r(i,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(r(i,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return t}function tE(i){const t={},o=r(i,["data"]);if(o!=null&&c(t,["data"],o),r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function vm(i){const t={},o=r(i,["parts"]);if(o!=null){let u=o;Array.isArray(u)&&(u=u.map(f=>CE(f))),c(t,["parts"],u)}const a=r(i,["role"]);return a!=null&&c(t,["role"],a),t}function nE(i,t){const o={},a=r(i,["ttl"]);t!==void 0&&a!=null&&c(t,["ttl"],a);const u=r(i,["expireTime"]);t!==void 0&&u!=null&&c(t,["expireTime"],u);const f=r(i,["displayName"]);t!==void 0&&f!=null&&c(t,["displayName"],f);const p=r(i,["contents"]);if(t!==void 0&&p!=null){let v=Ct(p);Array.isArray(v)&&(v=v.map(E=>vm(E))),c(t,["contents"],v)}const g=r(i,["systemInstruction"]);t!==void 0&&g!=null&&c(t,["systemInstruction"],vm(Xe(g)));const y=r(i,["tools"]);if(t!==void 0&&y!=null){let v=y;Array.isArray(v)&&(v=v.map(E=>ME(E))),c(t,["tools"],v)}const m=r(i,["toolConfig"]);if(t!==void 0&&m!=null&&c(t,["toolConfig"],RE(m)),r(i,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return o}function iE(i,t){const o={},a=r(i,["ttl"]);t!==void 0&&a!=null&&c(t,["ttl"],a);const u=r(i,["expireTime"]);t!==void 0&&u!=null&&c(t,["expireTime"],u);const f=r(i,["displayName"]);t!==void 0&&f!=null&&c(t,["displayName"],f);const p=r(i,["contents"]);if(t!==void 0&&p!=null){let E=Ct(p);Array.isArray(E)&&(E=E.map(_=>_)),c(t,["contents"],E)}const g=r(i,["systemInstruction"]);t!==void 0&&g!=null&&c(t,["systemInstruction"],Xe(g));const y=r(i,["tools"]);if(t!==void 0&&y!=null){let E=y;Array.isArray(E)&&(E=E.map(_=>NE(_))),c(t,["tools"],E)}const m=r(i,["toolConfig"]);t!==void 0&&m!=null&&c(t,["toolConfig"],m);const v=r(i,["kmsKeyName"]);return t!==void 0&&v!=null&&c(t,["encryption_spec","kmsKeyName"],v),o}function oE(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["model"],zm(i,a));const u=r(t,["config"]);return u!=null&&nE(u,o),o}function lE(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["model"],zm(i,a));const u=r(t,["config"]);return u!=null&&iE(u,o),o}function aE(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],pn(i,a)),o}function sE(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],pn(i,a)),o}function rE(i){const t={},o=r(i,["sdkHttpResponse"]);return o!=null&&c(t,["sdkHttpResponse"],o),t}function uE(i){const t={},o=r(i,["sdkHttpResponse"]);return o!=null&&c(t,["sdkHttpResponse"],o),t}function cE(i){const t={};if(r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(i,["fileUri"]);o!=null&&c(t,["fileUri"],o);const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function fE(i){const t={},o=r(i,["id"]);o!=null&&c(t,["id"],o);const a=r(i,["args"]);a!=null&&c(t,["args"],a);const u=r(i,["name"]);if(u!=null&&c(t,["name"],u),r(i,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(r(i,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function dE(i){const t={},o=r(i,["allowedFunctionNames"]);o!=null&&c(t,["allowedFunctionNames"],o);const a=r(i,["mode"]);if(a!=null&&c(t,["mode"],a),r(i,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function pE(i){const t={},o=r(i,["description"]);o!=null&&c(t,["description"],o);const a=r(i,["name"]);a!=null&&c(t,["name"],a);const u=r(i,["parameters"]);u!=null&&c(t,["parameters"],u);const f=r(i,["parametersJsonSchema"]);f!=null&&c(t,["parametersJsonSchema"],f);const p=r(i,["response"]);p!=null&&c(t,["response"],p);const g=r(i,["responseJsonSchema"]);if(g!=null&&c(t,["responseJsonSchema"],g),r(i,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function hE(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],pn(i,a)),o}function mE(i,t){const o={},a=r(t,["name"]);return a!=null&&c(o,["_url","name"],pn(i,a)),o}function gE(i){const t={},o=r(i,["authConfig"]);o!=null&&c(t,["authConfig"],eE(o));const a=r(i,["enableWidget"]);return a!=null&&c(t,["enableWidget"],a),t}function yE(i){const t={},o=r(i,["searchTypes"]);if(o!=null&&c(t,["searchTypes"],o),r(i,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(r(i,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const a=r(i,["timeRangeFilter"]);return a!=null&&c(t,["timeRangeFilter"],a),t}function vE(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);return t!==void 0&&u!=null&&c(t,["_query","pageToken"],u),o}function TE(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);return t!==void 0&&u!=null&&c(t,["_query","pageToken"],u),o}function EE(i){const t={},o=r(i,["config"]);return o!=null&&vE(o,t),t}function _E(i){const t={},o=r(i,["config"]);return o!=null&&TE(o,t),t}function SE(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["cachedContents"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["cachedContents"],f)}return t}function AE(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["cachedContents"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["cachedContents"],f)}return t}function CE(i){const t={},o=r(i,["mediaResolution"]);o!=null&&c(t,["mediaResolution"],o);const a=r(i,["codeExecutionResult"]);a!=null&&c(t,["codeExecutionResult"],a);const u=r(i,["executableCode"]);u!=null&&c(t,["executableCode"],u);const f=r(i,["fileData"]);f!=null&&c(t,["fileData"],cE(f));const p=r(i,["functionCall"]);p!=null&&c(t,["functionCall"],fE(p));const g=r(i,["functionResponse"]);g!=null&&c(t,["functionResponse"],g);const y=r(i,["inlineData"]);y!=null&&c(t,["inlineData"],tE(y));const m=r(i,["text"]);m!=null&&c(t,["text"],m);const v=r(i,["thought"]);v!=null&&c(t,["thought"],v);const E=r(i,["thoughtSignature"]);E!=null&&c(t,["thoughtSignature"],E);const _=r(i,["videoMetadata"]);return _!=null&&c(t,["videoMetadata"],_),t}function RE(i){const t={},o=r(i,["retrievalConfig"]);o!=null&&c(t,["retrievalConfig"],o);const a=r(i,["functionCallingConfig"]);return a!=null&&c(t,["functionCallingConfig"],dE(a)),t}function ME(i){const t={};if(r(i,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=r(i,["computerUse"]);o!=null&&c(t,["computerUse"],o);const a=r(i,["fileSearch"]);a!=null&&c(t,["fileSearch"],a);const u=r(i,["googleSearch"]);u!=null&&c(t,["googleSearch"],yE(u));const f=r(i,["googleMaps"]);f!=null&&c(t,["googleMaps"],gE(f));const p=r(i,["codeExecution"]);if(p!=null&&c(t,["codeExecution"],p),r(i,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const g=r(i,["functionDeclarations"]);if(g!=null){let E=g;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["functionDeclarations"],E)}const y=r(i,["googleSearchRetrieval"]);if(y!=null&&c(t,["googleSearchRetrieval"],y),r(i,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const m=r(i,["urlContext"]);m!=null&&c(t,["urlContext"],m);const v=r(i,["mcpServers"]);if(v!=null){let E=v;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["mcpServers"],E)}return t}function NE(i){const t={},o=r(i,["retrieval"]);o!=null&&c(t,["retrieval"],o);const a=r(i,["computerUse"]);if(a!=null&&c(t,["computerUse"],a),r(i,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const u=r(i,["googleSearch"]);u!=null&&c(t,["googleSearch"],u);const f=r(i,["googleMaps"]);f!=null&&c(t,["googleMaps"],f);const p=r(i,["codeExecution"]);p!=null&&c(t,["codeExecution"],p);const g=r(i,["enterpriseWebSearch"]);g!=null&&c(t,["enterpriseWebSearch"],g);const y=r(i,["functionDeclarations"]);if(y!=null){let _=y;Array.isArray(_)&&(_=_.map(A=>pE(A))),c(t,["functionDeclarations"],_)}const m=r(i,["googleSearchRetrieval"]);m!=null&&c(t,["googleSearchRetrieval"],m);const v=r(i,["parallelAiSearch"]);v!=null&&c(t,["parallelAiSearch"],v);const E=r(i,["urlContext"]);if(E!=null&&c(t,["urlContext"],E),r(i,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Vertex AI.");return t}function IE(i,t){const o={},a=r(i,["ttl"]);t!==void 0&&a!=null&&c(t,["ttl"],a);const u=r(i,["expireTime"]);return t!==void 0&&u!=null&&c(t,["expireTime"],u),o}function DE(i,t){const o={},a=r(i,["ttl"]);t!==void 0&&a!=null&&c(t,["ttl"],a);const u=r(i,["expireTime"]);return t!==void 0&&u!=null&&c(t,["expireTime"],u),o}function UE(i,t){const o={},a=r(t,["name"]);a!=null&&c(o,["_url","name"],pn(i,a));const u=r(t,["config"]);return u!=null&&IE(u,o),o}function wE(i,t){const o={},a=r(t,["name"]);a!=null&&c(o,["_url","name"],pn(i,a));const u=r(t,["config"]);return u!=null&&DE(u,o),o}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class xE extends dn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new si(fn.PAGED_ITEM_CACHED_CONTENTS,a=>this.listInternal(a),await this.listInternal(o),o)}async create(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=lE(this.apiClient,t);return g=Y("cachedContents",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>v)}else{const m=oE(this.apiClient,t);return g=Y("cachedContents",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>v)}}async get(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=mE(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>v)}else{const m=hE(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>v)}}async delete(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=sE(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=uE(v),_=new fm;return Object.assign(_,E),_})}else{const m=aE(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=rE(v),_=new fm;return Object.assign(_,E),_})}}async update(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=wE(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"PATCH",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>v)}else{const m=UE(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"PATCH",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>v)}}async listInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=_E(t);return g=Y("cachedContents",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=AE(v),_=new dm;return Object.assign(_,E),_})}else{const m=EE(t);return g=Y("cachedContents",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=SE(v),_=new dm;return Object.assign(_,E),_})}}}function Ia(i,t){var o={};for(var a in i)Object.prototype.hasOwnProperty.call(i,a)&&t.indexOf(a)<0&&(o[a]=i[a]);if(i!=null&&typeof Object.getOwnPropertySymbols=="function")for(var u=0,a=Object.getOwnPropertySymbols(i);u<a.length;u++)t.indexOf(a[u])<0&&Object.prototype.propertyIsEnumerable.call(i,a[u])&&(o[a[u]]=i[a[u]]);return o}function Tm(i){var t=typeof Symbol=="function"&&Symbol.iterator,o=t&&i[t],a=0;if(o)return o.call(i);if(i&&typeof i.length=="number")return{next:function(){return i&&a>=i.length&&(i=void 0),{value:i&&i[a++],done:!i}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function oe(i){return this instanceof oe?(this.v=i,this):new oe(i)}function Vt(i,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(i,t||[]),u,f=[];return u=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),g("next"),g("throw"),g("return",p),u[Symbol.asyncIterator]=function(){return this},u;function p(A){return function(I){return Promise.resolve(I).then(A,E)}}function g(A,I){a[A]&&(u[A]=function(L){return new Promise(function(b,z){f.push([A,L,b,z])>1||y(A,L)})},I&&(u[A]=I(u[A])))}function y(A,I){try{m(a[A](I))}catch(L){_(f[0][3],L)}}function m(A){A.value instanceof oe?Promise.resolve(A.value.v).then(v,E):_(f[0][2],A)}function v(A){y("next",A)}function E(A){y("throw",A)}function _(A,I){A(I),f.shift(),f.length&&y(f[0][0],f[0][1])}}function Bt(i){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=i[Symbol.asyncIterator],o;return t?t.call(i):(i=typeof Tm=="function"?Tm(i):i[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(f){o[f]=i[f]&&function(p){return new Promise(function(g,y){p=i[f](p),u(g,y,p.done,p.value)})}}function u(f,p,g,y){Promise.resolve(y).then(function(m){f({value:m,done:g})},p)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function bE(i){var t;if(i.candidates==null||i.candidates.length===0)return!1;const o=(t=i.candidates[0])===null||t===void 0?void 0:t.content;return o===void 0?!1:eg(o)}function eg(i){if(i.parts===void 0||i.parts.length===0)return!1;for(const t of i.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function GE(i){if(i.length!==0){for(const t of i)if(t.role!=="user"&&t.role!=="model")throw new Error(`Role must be user or model, but got ${t.role}.`)}}function Em(i){if(i===void 0||i.length===0)return[];const t=[],o=i.length;let a=0;for(;a<o;)if(i[a].role==="user")t.push(i[a]),a++;else{const u=[];let f=!0;for(;a<o&&i[a].role==="model";)u.push(i[a]),f&&!eg(i[a])&&(f=!1),a++;f?t.push(...u):t.pop()}return t}class LE{constructor(t,o){this.modelsModule=t,this.apiClient=o}create(t){return new HE(this.apiClient,this.modelsModule,t.model,t.config,structuredClone(t.history))}}class HE{constructor(t,o,a,u={},f=[]){this.apiClient=t,this.modelsModule=o,this.model=a,this.config=u,this.history=f,this.sendPromise=Promise.resolve(),GE(f)}async sendMessage(t){var o;await this.sendPromise;const a=Xe(t.message),u=this.modelsModule.generateContent({model:this.model,contents:this.getHistory(!0).concat(a),config:(o=t.config)!==null&&o!==void 0?o:this.config});return this.sendPromise=(async()=>{var f,p,g;const y=await u,m=(p=(f=y.candidates)===null||f===void 0?void 0:f[0])===null||p===void 0?void 0:p.content,v=y.automaticFunctionCallingHistory,E=this.getHistory(!0).length;let _=[];v!=null&&(_=(g=v.slice(E))!==null&&g!==void 0?g:[]);const A=m?[m]:[];this.recordHistory(a,A,_)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),u}async sendMessageStream(t){var o;await this.sendPromise;const a=Xe(t.message),u=this.modelsModule.generateContentStream({model:this.model,contents:this.getHistory(!0).concat(a),config:(o=t.config)!==null&&o!==void 0?o:this.config});this.sendPromise=u.then(()=>{}).catch(()=>{});const f=await u;return this.processStreamResponse(f,a)}getHistory(t=!1){const o=t?Em(this.history):this.history;return structuredClone(o)}processStreamResponse(t,o){return Vt(this,arguments,function*(){var u,f,p,g,y,m;const v=[];try{for(var E=!0,_=Bt(t),A;A=yield oe(_.next()),u=A.done,!u;E=!0){g=A.value,E=!1;const I=g;if(bE(I)){const L=(m=(y=I.candidates)===null||y===void 0?void 0:y[0])===null||m===void 0?void 0:m.content;L!==void 0&&v.push(L)}yield yield oe(I)}}catch(I){f={error:I}}finally{try{!E&&!u&&(p=_.return)&&(yield oe(p.call(_)))}finally{if(f)throw f.error}}this.recordHistory(o,v)})}recordHistory(t,o,a){let u=[];o.length>0&&o.every(f=>f.role!==void 0)?u=o:u.push({role:"model",parts:[]}),a&&a.length>0?this.history.push(...Em(a)):this.history.push(t),this.history.push(...u)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class wa extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,wa.prototype)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function PE(i){const t={},o=r(i,["file"]);return o!=null&&c(t,["file"],o),t}function qE(i){const t={},o=r(i,["sdkHttpResponse"]);return o!=null&&c(t,["sdkHttpResponse"],o),t}function VE(i){const t={},o=r(i,["name"]);return o!=null&&c(t,["_url","file"],Km(o)),t}function BE(i){const t={},o=r(i,["sdkHttpResponse"]);return o!=null&&c(t,["sdkHttpResponse"],o),t}function zE(i){const t={},o=r(i,["name"]);return o!=null&&c(t,["_url","file"],Km(o)),t}function OE(i){const t={},o=r(i,["uris"]);return o!=null&&c(t,["uris"],o),t}function FE(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);return t!==void 0&&u!=null&&c(t,["_query","pageToken"],u),o}function kE(i){const t={},o=r(i,["config"]);return o!=null&&FE(o,t),t}function JE(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["files"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["files"],f)}return t}function YE(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["files"]);if(a!=null){let u=a;Array.isArray(u)&&(u=u.map(f=>f)),c(t,["files"],u)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class KE extends dn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new si(fn.PAGED_ITEM_FILES,a=>this.listInternal(a),await this.listInternal(o),o)}async upload(t){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(t.file,t.config).then(o=>o)}async download(t){await this.apiClient.downloadFile(t)}async registerFiles(t){throw new Error("registerFiles is only supported in Node.js environments.")}async _registerFiles(t){return this.registerFilesInternal(t)}async listInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=kE(t);return f=Y("files",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>{const m=JE(y),v=new J0;return Object.assign(v,m),v})}}async createInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=PE(t);return f=Y("upload/v1beta/files",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=qE(y),v=new Y0;return Object.assign(v,m),v})}}async get(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=zE(t);return f=Y("files/{file}",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>y)}}async delete(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=VE(t);return f=Y("files/{file}",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>{const m=BE(y),v=new K0;return Object.assign(v,m),v})}}async registerFilesInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=OE(t);return f=Y("files:register",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=YE(y),v=new Q0;return Object.assign(v,m),v})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function _m(i){const t={};if(r(i,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is not supported in Gemini API.");return t}function QE(i){const t={},o=r(i,["apiKey"]);if(o!=null&&c(t,["apiKey"],o),r(i,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(r(i,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(r(i,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(r(i,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(r(i,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(r(i,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return t}function Aa(i){const t={},o=r(i,["data"]);if(o!=null&&c(t,["data"],o),r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function XE(i){const t={},o=r(i,["parts"]);if(o!=null){let u=o;Array.isArray(u)&&(u=u.map(f=>f_(f))),c(t,["parts"],u)}const a=r(i,["role"]);return a!=null&&c(t,["role"],a),t}function ZE(i){const t={};if(r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(i,["fileUri"]);o!=null&&c(t,["fileUri"],o);const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function $E(i){const t={},o=r(i,["id"]);o!=null&&c(t,["id"],o);const a=r(i,["args"]);a!=null&&c(t,["args"],a);const u=r(i,["name"]);if(u!=null&&c(t,["name"],u),r(i,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(r(i,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function WE(i){const t={},o=r(i,["description"]);o!=null&&c(t,["description"],o);const a=r(i,["name"]);a!=null&&c(t,["name"],a);const u=r(i,["parameters"]);u!=null&&c(t,["parameters"],u);const f=r(i,["parametersJsonSchema"]);f!=null&&c(t,["parametersJsonSchema"],f);const p=r(i,["response"]);p!=null&&c(t,["response"],p);const g=r(i,["responseJsonSchema"]);if(g!=null&&c(t,["responseJsonSchema"],g),r(i,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function jE(i){const t={},o=r(i,["modelSelectionConfig"]);o!=null&&c(t,["modelConfig"],o);const a=r(i,["responseJsonSchema"]);a!=null&&c(t,["responseJsonSchema"],a);const u=r(i,["audioTimestamp"]);u!=null&&c(t,["audioTimestamp"],u);const f=r(i,["candidateCount"]);f!=null&&c(t,["candidateCount"],f);const p=r(i,["enableAffectiveDialog"]);p!=null&&c(t,["enableAffectiveDialog"],p);const g=r(i,["frequencyPenalty"]);g!=null&&c(t,["frequencyPenalty"],g);const y=r(i,["logprobs"]);y!=null&&c(t,["logprobs"],y);const m=r(i,["maxOutputTokens"]);m!=null&&c(t,["maxOutputTokens"],m);const v=r(i,["mediaResolution"]);v!=null&&c(t,["mediaResolution"],v);const E=r(i,["presencePenalty"]);E!=null&&c(t,["presencePenalty"],E);const _=r(i,["responseLogprobs"]);_!=null&&c(t,["responseLogprobs"],_);const A=r(i,["responseMimeType"]);A!=null&&c(t,["responseMimeType"],A);const I=r(i,["responseModalities"]);I!=null&&c(t,["responseModalities"],I);const L=r(i,["responseSchema"]);L!=null&&c(t,["responseSchema"],L);const b=r(i,["routingConfig"]);b!=null&&c(t,["routingConfig"],b);const z=r(i,["seed"]);z!=null&&c(t,["seed"],z);const Q=r(i,["speechConfig"]);Q!=null&&c(t,["speechConfig"],Q);const O=r(i,["stopSequences"]);O!=null&&c(t,["stopSequences"],O);const k=r(i,["temperature"]);k!=null&&c(t,["temperature"],k);const j=r(i,["thinkingConfig"]);j!=null&&c(t,["thinkingConfig"],j);const B=r(i,["topK"]);B!=null&&c(t,["topK"],B);const J=r(i,["topP"]);if(J!=null&&c(t,["topP"],J),r(i,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function e_(i){const t={},o=r(i,["authConfig"]);o!=null&&c(t,["authConfig"],QE(o));const a=r(i,["enableWidget"]);return a!=null&&c(t,["enableWidget"],a),t}function t_(i){const t={},o=r(i,["searchTypes"]);if(o!=null&&c(t,["searchTypes"],o),r(i,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(r(i,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const a=r(i,["timeRangeFilter"]);return a!=null&&c(t,["timeRangeFilter"],a),t}function n_(i,t){const o={},a=r(i,["generationConfig"]);t!==void 0&&a!=null&&c(t,["setup","generationConfig"],a);const u=r(i,["responseModalities"]);t!==void 0&&u!=null&&c(t,["setup","generationConfig","responseModalities"],u);const f=r(i,["temperature"]);t!==void 0&&f!=null&&c(t,["setup","generationConfig","temperature"],f);const p=r(i,["topP"]);t!==void 0&&p!=null&&c(t,["setup","generationConfig","topP"],p);const g=r(i,["topK"]);t!==void 0&&g!=null&&c(t,["setup","generationConfig","topK"],g);const y=r(i,["maxOutputTokens"]);t!==void 0&&y!=null&&c(t,["setup","generationConfig","maxOutputTokens"],y);const m=r(i,["mediaResolution"]);t!==void 0&&m!=null&&c(t,["setup","generationConfig","mediaResolution"],m);const v=r(i,["seed"]);t!==void 0&&v!=null&&c(t,["setup","generationConfig","seed"],v);const E=r(i,["speechConfig"]);t!==void 0&&E!=null&&c(t,["setup","generationConfig","speechConfig"],Hu(E));const _=r(i,["thinkingConfig"]);t!==void 0&&_!=null&&c(t,["setup","generationConfig","thinkingConfig"],_);const A=r(i,["enableAffectiveDialog"]);t!==void 0&&A!=null&&c(t,["setup","generationConfig","enableAffectiveDialog"],A);const I=r(i,["systemInstruction"]);t!==void 0&&I!=null&&c(t,["setup","systemInstruction"],XE(Xe(I)));const L=r(i,["tools"]);if(t!==void 0&&L!=null){let B=$i(L);Array.isArray(B)&&(B=B.map(J=>p_(Zi(J)))),c(t,["setup","tools"],B)}const b=r(i,["sessionResumption"]);t!==void 0&&b!=null&&c(t,["setup","sessionResumption"],d_(b));const z=r(i,["inputAudioTranscription"]);t!==void 0&&z!=null&&c(t,["setup","inputAudioTranscription"],_m(z));const Q=r(i,["outputAudioTranscription"]);t!==void 0&&Q!=null&&c(t,["setup","outputAudioTranscription"],_m(Q));const O=r(i,["realtimeInputConfig"]);t!==void 0&&O!=null&&c(t,["setup","realtimeInputConfig"],O);const k=r(i,["contextWindowCompression"]);t!==void 0&&k!=null&&c(t,["setup","contextWindowCompression"],k);const j=r(i,["proactivity"]);if(t!==void 0&&j!=null&&c(t,["setup","proactivity"],j),r(i,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return o}function i_(i,t){const o={},a=r(i,["generationConfig"]);t!==void 0&&a!=null&&c(t,["setup","generationConfig"],jE(a));const u=r(i,["responseModalities"]);t!==void 0&&u!=null&&c(t,["setup","generationConfig","responseModalities"],u);const f=r(i,["temperature"]);t!==void 0&&f!=null&&c(t,["setup","generationConfig","temperature"],f);const p=r(i,["topP"]);t!==void 0&&p!=null&&c(t,["setup","generationConfig","topP"],p);const g=r(i,["topK"]);t!==void 0&&g!=null&&c(t,["setup","generationConfig","topK"],g);const y=r(i,["maxOutputTokens"]);t!==void 0&&y!=null&&c(t,["setup","generationConfig","maxOutputTokens"],y);const m=r(i,["mediaResolution"]);t!==void 0&&m!=null&&c(t,["setup","generationConfig","mediaResolution"],m);const v=r(i,["seed"]);t!==void 0&&v!=null&&c(t,["setup","generationConfig","seed"],v);const E=r(i,["speechConfig"]);t!==void 0&&E!=null&&c(t,["setup","generationConfig","speechConfig"],Hu(E));const _=r(i,["thinkingConfig"]);t!==void 0&&_!=null&&c(t,["setup","generationConfig","thinkingConfig"],_);const A=r(i,["enableAffectiveDialog"]);t!==void 0&&A!=null&&c(t,["setup","generationConfig","enableAffectiveDialog"],A);const I=r(i,["systemInstruction"]);t!==void 0&&I!=null&&c(t,["setup","systemInstruction"],Xe(I));const L=r(i,["tools"]);if(t!==void 0&&L!=null){let J=$i(L);Array.isArray(J)&&(J=J.map(ue=>h_(Zi(ue)))),c(t,["setup","tools"],J)}const b=r(i,["sessionResumption"]);t!==void 0&&b!=null&&c(t,["setup","sessionResumption"],b);const z=r(i,["inputAudioTranscription"]);t!==void 0&&z!=null&&c(t,["setup","inputAudioTranscription"],z);const Q=r(i,["outputAudioTranscription"]);t!==void 0&&Q!=null&&c(t,["setup","outputAudioTranscription"],Q);const O=r(i,["realtimeInputConfig"]);t!==void 0&&O!=null&&c(t,["setup","realtimeInputConfig"],O);const k=r(i,["contextWindowCompression"]);t!==void 0&&k!=null&&c(t,["setup","contextWindowCompression"],k);const j=r(i,["proactivity"]);t!==void 0&&j!=null&&c(t,["setup","proactivity"],j);const B=r(i,["explicitVadSignal"]);return t!==void 0&&B!=null&&c(t,["setup","explicitVadSignal"],B),o}function o_(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["setup","model"],Te(i,a));const u=r(t,["config"]);return u!=null&&c(o,["config"],n_(u,o)),o}function l_(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["setup","model"],Te(i,a));const u=r(t,["config"]);return u!=null&&c(o,["config"],i_(u,o)),o}function a_(i){const t={},o=r(i,["musicGenerationConfig"]);return o!=null&&c(t,["musicGenerationConfig"],o),t}function s_(i){const t={},o=r(i,["weightedPrompts"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(u=>u)),c(t,["weightedPrompts"],a)}return t}function r_(i){const t={},o=r(i,["media"]);if(o!=null){let m=Om(o);Array.isArray(m)&&(m=m.map(v=>Aa(v))),c(t,["mediaChunks"],m)}const a=r(i,["audio"]);a!=null&&c(t,["audio"],Aa(km(a)));const u=r(i,["audioStreamEnd"]);u!=null&&c(t,["audioStreamEnd"],u);const f=r(i,["video"]);f!=null&&c(t,["video"],Aa(Fm(f)));const p=r(i,["text"]);p!=null&&c(t,["text"],p);const g=r(i,["activityStart"]);g!=null&&c(t,["activityStart"],g);const y=r(i,["activityEnd"]);return y!=null&&c(t,["activityEnd"],y),t}function u_(i){const t={},o=r(i,["media"]);if(o!=null){let m=Om(o);Array.isArray(m)&&(m=m.map(v=>v)),c(t,["mediaChunks"],m)}const a=r(i,["audio"]);a!=null&&c(t,["audio"],km(a));const u=r(i,["audioStreamEnd"]);u!=null&&c(t,["audioStreamEnd"],u);const f=r(i,["video"]);f!=null&&c(t,["video"],Fm(f));const p=r(i,["text"]);p!=null&&c(t,["text"],p);const g=r(i,["activityStart"]);g!=null&&c(t,["activityStart"],g);const y=r(i,["activityEnd"]);return y!=null&&c(t,["activityEnd"],y),t}function c_(i){const t={},o=r(i,["setupComplete"]);o!=null&&c(t,["setupComplete"],o);const a=r(i,["serverContent"]);a!=null&&c(t,["serverContent"],a);const u=r(i,["toolCall"]);u!=null&&c(t,["toolCall"],u);const f=r(i,["toolCallCancellation"]);f!=null&&c(t,["toolCallCancellation"],f);const p=r(i,["usageMetadata"]);p!=null&&c(t,["usageMetadata"],m_(p));const g=r(i,["goAway"]);g!=null&&c(t,["goAway"],g);const y=r(i,["sessionResumptionUpdate"]);y!=null&&c(t,["sessionResumptionUpdate"],y);const m=r(i,["voiceActivityDetectionSignal"]);m!=null&&c(t,["voiceActivityDetectionSignal"],m);const v=r(i,["voiceActivity"]);return v!=null&&c(t,["voiceActivity"],g_(v)),t}function f_(i){const t={},o=r(i,["mediaResolution"]);o!=null&&c(t,["mediaResolution"],o);const a=r(i,["codeExecutionResult"]);a!=null&&c(t,["codeExecutionResult"],a);const u=r(i,["executableCode"]);u!=null&&c(t,["executableCode"],u);const f=r(i,["fileData"]);f!=null&&c(t,["fileData"],ZE(f));const p=r(i,["functionCall"]);p!=null&&c(t,["functionCall"],$E(p));const g=r(i,["functionResponse"]);g!=null&&c(t,["functionResponse"],g);const y=r(i,["inlineData"]);y!=null&&c(t,["inlineData"],Aa(y));const m=r(i,["text"]);m!=null&&c(t,["text"],m);const v=r(i,["thought"]);v!=null&&c(t,["thought"],v);const E=r(i,["thoughtSignature"]);E!=null&&c(t,["thoughtSignature"],E);const _=r(i,["videoMetadata"]);return _!=null&&c(t,["videoMetadata"],_),t}function d_(i){const t={},o=r(i,["handle"]);if(o!=null&&c(t,["handle"],o),r(i,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function p_(i){const t={};if(r(i,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=r(i,["computerUse"]);o!=null&&c(t,["computerUse"],o);const a=r(i,["fileSearch"]);a!=null&&c(t,["fileSearch"],a);const u=r(i,["googleSearch"]);u!=null&&c(t,["googleSearch"],t_(u));const f=r(i,["googleMaps"]);f!=null&&c(t,["googleMaps"],e_(f));const p=r(i,["codeExecution"]);if(p!=null&&c(t,["codeExecution"],p),r(i,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const g=r(i,["functionDeclarations"]);if(g!=null){let E=g;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["functionDeclarations"],E)}const y=r(i,["googleSearchRetrieval"]);if(y!=null&&c(t,["googleSearchRetrieval"],y),r(i,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const m=r(i,["urlContext"]);m!=null&&c(t,["urlContext"],m);const v=r(i,["mcpServers"]);if(v!=null){let E=v;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["mcpServers"],E)}return t}function h_(i){const t={},o=r(i,["retrieval"]);o!=null&&c(t,["retrieval"],o);const a=r(i,["computerUse"]);if(a!=null&&c(t,["computerUse"],a),r(i,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const u=r(i,["googleSearch"]);u!=null&&c(t,["googleSearch"],u);const f=r(i,["googleMaps"]);f!=null&&c(t,["googleMaps"],f);const p=r(i,["codeExecution"]);p!=null&&c(t,["codeExecution"],p);const g=r(i,["enterpriseWebSearch"]);g!=null&&c(t,["enterpriseWebSearch"],g);const y=r(i,["functionDeclarations"]);if(y!=null){let _=y;Array.isArray(_)&&(_=_.map(A=>WE(A))),c(t,["functionDeclarations"],_)}const m=r(i,["googleSearchRetrieval"]);m!=null&&c(t,["googleSearchRetrieval"],m);const v=r(i,["parallelAiSearch"]);v!=null&&c(t,["parallelAiSearch"],v);const E=r(i,["urlContext"]);if(E!=null&&c(t,["urlContext"],E),r(i,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Vertex AI.");return t}function m_(i){const t={},o=r(i,["promptTokenCount"]);o!=null&&c(t,["promptTokenCount"],o);const a=r(i,["cachedContentTokenCount"]);a!=null&&c(t,["cachedContentTokenCount"],a);const u=r(i,["candidatesTokenCount"]);u!=null&&c(t,["responseTokenCount"],u);const f=r(i,["toolUsePromptTokenCount"]);f!=null&&c(t,["toolUsePromptTokenCount"],f);const p=r(i,["thoughtsTokenCount"]);p!=null&&c(t,["thoughtsTokenCount"],p);const g=r(i,["totalTokenCount"]);g!=null&&c(t,["totalTokenCount"],g);const y=r(i,["promptTokensDetails"]);if(y!=null){let A=y;Array.isArray(A)&&(A=A.map(I=>I)),c(t,["promptTokensDetails"],A)}const m=r(i,["cacheTokensDetails"]);if(m!=null){let A=m;Array.isArray(A)&&(A=A.map(I=>I)),c(t,["cacheTokensDetails"],A)}const v=r(i,["candidatesTokensDetails"]);if(v!=null){let A=v;Array.isArray(A)&&(A=A.map(I=>I)),c(t,["responseTokensDetails"],A)}const E=r(i,["toolUsePromptTokensDetails"]);if(E!=null){let A=E;Array.isArray(A)&&(A=A.map(I=>I)),c(t,["toolUsePromptTokensDetails"],A)}const _=r(i,["trafficType"]);return _!=null&&c(t,["trafficType"],_),t}function g_(i){const t={},o=r(i,["type"]);return o!=null&&c(t,["voiceActivityType"],o),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function y_(i,t){const o={},a=r(i,["apiKey"]);if(a!=null&&c(o,["apiKey"],a),r(i,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(r(i,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(r(i,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(r(i,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(r(i,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(r(i,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return o}function v_(i,t){const o={},a=r(i,["data"]);if(a!=null&&c(o,["data"],a),r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const u=r(i,["mimeType"]);return u!=null&&c(o,["mimeType"],u),o}function T_(i,t){const o={},a=r(i,["content"]);a!=null&&c(o,["content"],a);const u=r(i,["citationMetadata"]);u!=null&&c(o,["citationMetadata"],E_(u));const f=r(i,["tokenCount"]);f!=null&&c(o,["tokenCount"],f);const p=r(i,["finishReason"]);p!=null&&c(o,["finishReason"],p);const g=r(i,["groundingMetadata"]);g!=null&&c(o,["groundingMetadata"],g);const y=r(i,["avgLogprobs"]);y!=null&&c(o,["avgLogprobs"],y);const m=r(i,["index"]);m!=null&&c(o,["index"],m);const v=r(i,["logprobsResult"]);v!=null&&c(o,["logprobsResult"],v);const E=r(i,["safetyRatings"]);if(E!=null){let A=E;Array.isArray(A)&&(A=A.map(I=>I)),c(o,["safetyRatings"],A)}const _=r(i,["urlContextMetadata"]);return _!=null&&c(o,["urlContextMetadata"],_),o}function E_(i,t){const o={},a=r(i,["citationSources"]);if(a!=null){let u=a;Array.isArray(u)&&(u=u.map(f=>f)),c(o,["citations"],u)}return o}function __(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["contents"]);if(f!=null){let p=Ct(f);Array.isArray(p)&&(p=p.map(g=>g)),c(a,["contents"],p)}return a}function S_(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["tokensInfo"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(o,["tokensInfo"],f)}return o}function A_(i,t){const o={},a=r(i,["values"]);a!=null&&c(o,["values"],a);const u=r(i,["statistics"]);return u!=null&&c(o,["statistics"],C_(u)),o}function C_(i,t){const o={},a=r(i,["truncated"]);a!=null&&c(o,["truncated"],a);const u=r(i,["token_count"]);return u!=null&&c(o,["tokenCount"],u),o}function jo(i,t){const o={},a=r(i,["parts"]);if(a!=null){let f=a;Array.isArray(f)&&(f=f.map(p=>bS(p))),c(o,["parts"],f)}const u=r(i,["role"]);return u!=null&&c(o,["role"],u),o}function R_(i,t){const o={},a=r(i,["controlType"]);a!=null&&c(o,["controlType"],a);const u=r(i,["enableControlImageComputation"]);return u!=null&&c(o,["computeControl"],u),o}function M_(i,t){const o={};if(r(i,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(r(i,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(r(i,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return o}function N_(i,t,o){const a={},u=r(i,["systemInstruction"]);t!==void 0&&u!=null&&c(t,["systemInstruction"],Xe(u));const f=r(i,["tools"]);if(t!==void 0&&f!=null){let g=f;Array.isArray(g)&&(g=g.map(y=>og(y))),c(t,["tools"],g)}const p=r(i,["generationConfig"]);return t!==void 0&&p!=null&&c(t,["generationConfig"],vS(p)),a}function I_(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["contents"]);if(f!=null){let g=Ct(f);Array.isArray(g)&&(g=g.map(y=>jo(y))),c(a,["contents"],g)}const p=r(t,["config"]);return p!=null&&M_(p),a}function D_(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["contents"]);if(f!=null){let g=Ct(f);Array.isArray(g)&&(g=g.map(y=>y)),c(a,["contents"],g)}const p=r(t,["config"]);return p!=null&&N_(p,a),a}function U_(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["totalTokens"]);u!=null&&c(o,["totalTokens"],u);const f=r(i,["cachedContentTokenCount"]);return f!=null&&c(o,["cachedContentTokenCount"],f),o}function w_(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["totalTokens"]);return u!=null&&c(o,["totalTokens"],u),o}function x_(i,t,o){const a={},u=r(t,["model"]);return u!=null&&c(a,["_url","name"],Te(i,u)),a}function b_(i,t,o){const a={},u=r(t,["model"]);return u!=null&&c(a,["_url","name"],Te(i,u)),a}function G_(i,t){const o={},a=r(i,["sdkHttpResponse"]);return a!=null&&c(o,["sdkHttpResponse"],a),o}function L_(i,t){const o={},a=r(i,["sdkHttpResponse"]);return a!=null&&c(o,["sdkHttpResponse"],a),o}function H_(i,t,o){const a={},u=r(i,["outputGcsUri"]);t!==void 0&&u!=null&&c(t,["parameters","storageUri"],u);const f=r(i,["negativePrompt"]);t!==void 0&&f!=null&&c(t,["parameters","negativePrompt"],f);const p=r(i,["numberOfImages"]);t!==void 0&&p!=null&&c(t,["parameters","sampleCount"],p);const g=r(i,["aspectRatio"]);t!==void 0&&g!=null&&c(t,["parameters","aspectRatio"],g);const y=r(i,["guidanceScale"]);t!==void 0&&y!=null&&c(t,["parameters","guidanceScale"],y);const m=r(i,["seed"]);t!==void 0&&m!=null&&c(t,["parameters","seed"],m);const v=r(i,["safetyFilterLevel"]);t!==void 0&&v!=null&&c(t,["parameters","safetySetting"],v);const E=r(i,["personGeneration"]);t!==void 0&&E!=null&&c(t,["parameters","personGeneration"],E);const _=r(i,["includeSafetyAttributes"]);t!==void 0&&_!=null&&c(t,["parameters","includeSafetyAttributes"],_);const A=r(i,["includeRaiReason"]);t!==void 0&&A!=null&&c(t,["parameters","includeRaiReason"],A);const I=r(i,["language"]);t!==void 0&&I!=null&&c(t,["parameters","language"],I);const L=r(i,["outputMimeType"]);t!==void 0&&L!=null&&c(t,["parameters","outputOptions","mimeType"],L);const b=r(i,["outputCompressionQuality"]);t!==void 0&&b!=null&&c(t,["parameters","outputOptions","compressionQuality"],b);const z=r(i,["addWatermark"]);t!==void 0&&z!=null&&c(t,["parameters","addWatermark"],z);const Q=r(i,["labels"]);t!==void 0&&Q!=null&&c(t,["labels"],Q);const O=r(i,["editMode"]);t!==void 0&&O!=null&&c(t,["parameters","editMode"],O);const k=r(i,["baseSteps"]);return t!==void 0&&k!=null&&c(t,["parameters","editConfig","baseSteps"],k),a}function P_(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["prompt"]);f!=null&&c(a,["instances[0]","prompt"],f);const p=r(t,["referenceImages"]);if(p!=null){let y=p;Array.isArray(y)&&(y=y.map(m=>VS(m))),c(a,["instances[0]","referenceImages"],y)}const g=r(t,["config"]);return g!=null&&H_(g,a),a}function q_(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["predictions"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>xa(p))),c(o,["generatedImages"],f)}return o}function V_(i,t,o){const a={},u=r(i,["taskType"]);t!==void 0&&u!=null&&c(t,["requests[]","taskType"],u);const f=r(i,["title"]);t!==void 0&&f!=null&&c(t,["requests[]","title"],f);const p=r(i,["outputDimensionality"]);if(t!==void 0&&p!=null&&c(t,["requests[]","outputDimensionality"],p),r(i,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(r(i,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return a}function B_(i,t,o){const a={};let u=r(o,["embeddingApiType"]);if(u===void 0&&(u="PREDICT"),u==="PREDICT"){const m=r(i,["taskType"]);t!==void 0&&m!=null&&c(t,["instances[]","task_type"],m)}else if(u==="EMBED_CONTENT"){const m=r(i,["taskType"]);t!==void 0&&m!=null&&c(t,["taskType"],m)}let f=r(o,["embeddingApiType"]);if(f===void 0&&(f="PREDICT"),f==="PREDICT"){const m=r(i,["title"]);t!==void 0&&m!=null&&c(t,["instances[]","title"],m)}else if(f==="EMBED_CONTENT"){const m=r(i,["title"]);t!==void 0&&m!=null&&c(t,["title"],m)}let p=r(o,["embeddingApiType"]);if(p===void 0&&(p="PREDICT"),p==="PREDICT"){const m=r(i,["outputDimensionality"]);t!==void 0&&m!=null&&c(t,["parameters","outputDimensionality"],m)}else if(p==="EMBED_CONTENT"){const m=r(i,["outputDimensionality"]);t!==void 0&&m!=null&&c(t,["outputDimensionality"],m)}let g=r(o,["embeddingApiType"]);if(g===void 0&&(g="PREDICT"),g==="PREDICT"){const m=r(i,["mimeType"]);t!==void 0&&m!=null&&c(t,["instances[]","mimeType"],m)}let y=r(o,["embeddingApiType"]);if(y===void 0&&(y="PREDICT"),y==="PREDICT"){const m=r(i,["autoTruncate"]);t!==void 0&&m!=null&&c(t,["parameters","autoTruncate"],m)}else if(y==="EMBED_CONTENT"){const m=r(i,["autoTruncate"]);t!==void 0&&m!=null&&c(t,["autoTruncate"],m)}return a}function z_(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["contents"]);if(f!=null){let m=bu(i,f);Array.isArray(m)&&(m=m.map(v=>v)),c(a,["requests[]","content"],m)}const p=r(t,["content"]);p!=null&&jo(Xe(p));const g=r(t,["config"]);g!=null&&V_(g,a);const y=r(t,["model"]);return y!==void 0&&c(a,["requests[]","model"],Te(i,y)),a}function O_(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));let f=r(o,["embeddingApiType"]);if(f===void 0&&(f="PREDICT"),f==="PREDICT"){const y=r(t,["contents"]);if(y!=null){let m=bu(i,y);Array.isArray(m)&&(m=m.map(v=>v)),c(a,["instances[]","content"],m)}}let p=r(o,["embeddingApiType"]);if(p===void 0&&(p="PREDICT"),p==="EMBED_CONTENT"){const y=r(t,["content"]);y!=null&&c(a,["content"],Xe(y))}const g=r(t,["config"]);return g!=null&&B_(g,a,o),a}function F_(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["embeddings"]);if(u!=null){let p=u;Array.isArray(p)&&(p=p.map(g=>g)),c(o,["embeddings"],p)}const f=r(i,["metadata"]);return f!=null&&c(o,["metadata"],f),o}function k_(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["predictions[]","embeddings"]);if(u!=null){let p=u;Array.isArray(p)&&(p=p.map(g=>A_(g))),c(o,["embeddings"],p)}const f=r(i,["metadata"]);if(f!=null&&c(o,["metadata"],f),t&&r(t,["embeddingApiType"])==="EMBED_CONTENT"){const p=r(i,["embedding"]),g=r(i,["usageMetadata"]),y=r(i,["truncated"]);if(p){const m={};g&&g.promptTokenCount&&(m.tokenCount=g.promptTokenCount),y&&(m.truncated=y),p.statistics=m,c(o,["embeddings"],[p])}}return o}function J_(i,t){const o={},a=r(i,["endpoint"]);a!=null&&c(o,["name"],a);const u=r(i,["deployedModelId"]);return u!=null&&c(o,["deployedModelId"],u),o}function Y_(i,t){const o={};if(r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=r(i,["fileUri"]);a!=null&&c(o,["fileUri"],a);const u=r(i,["mimeType"]);return u!=null&&c(o,["mimeType"],u),o}function K_(i,t){const o={},a=r(i,["id"]);a!=null&&c(o,["id"],a);const u=r(i,["args"]);u!=null&&c(o,["args"],u);const f=r(i,["name"]);if(f!=null&&c(o,["name"],f),r(i,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(r(i,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return o}function Q_(i,t){const o={},a=r(i,["allowedFunctionNames"]);a!=null&&c(o,["allowedFunctionNames"],a);const u=r(i,["mode"]);if(u!=null&&c(o,["mode"],u),r(i,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return o}function X_(i,t){const o={},a=r(i,["description"]);a!=null&&c(o,["description"],a);const u=r(i,["name"]);u!=null&&c(o,["name"],u);const f=r(i,["parameters"]);f!=null&&c(o,["parameters"],f);const p=r(i,["parametersJsonSchema"]);p!=null&&c(o,["parametersJsonSchema"],p);const g=r(i,["response"]);g!=null&&c(o,["response"],g);const y=r(i,["responseJsonSchema"]);if(y!=null&&c(o,["responseJsonSchema"],y),r(i,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return o}function Z_(i,t,o,a){const u={},f=r(t,["systemInstruction"]);o!==void 0&&f!=null&&c(o,["systemInstruction"],jo(Xe(f)));const p=r(t,["temperature"]);p!=null&&c(u,["temperature"],p);const g=r(t,["topP"]);g!=null&&c(u,["topP"],g);const y=r(t,["topK"]);y!=null&&c(u,["topK"],y);const m=r(t,["candidateCount"]);m!=null&&c(u,["candidateCount"],m);const v=r(t,["maxOutputTokens"]);v!=null&&c(u,["maxOutputTokens"],v);const E=r(t,["stopSequences"]);E!=null&&c(u,["stopSequences"],E);const _=r(t,["responseLogprobs"]);_!=null&&c(u,["responseLogprobs"],_);const A=r(t,["logprobs"]);A!=null&&c(u,["logprobs"],A);const I=r(t,["presencePenalty"]);I!=null&&c(u,["presencePenalty"],I);const L=r(t,["frequencyPenalty"]);L!=null&&c(u,["frequencyPenalty"],L);const b=r(t,["seed"]);b!=null&&c(u,["seed"],b);const z=r(t,["responseMimeType"]);z!=null&&c(u,["responseMimeType"],z);const Q=r(t,["responseSchema"]);Q!=null&&c(u,["responseSchema"],Gu(Q));const O=r(t,["responseJsonSchema"]);if(O!=null&&c(u,["responseJsonSchema"],O),r(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(r(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const k=r(t,["safetySettings"]);if(o!==void 0&&k!=null){let Ae=k;Array.isArray(Ae)&&(Ae=Ae.map(qe=>BS(qe))),c(o,["safetySettings"],Ae)}const j=r(t,["tools"]);if(o!==void 0&&j!=null){let Ae=$i(j);Array.isArray(Ae)&&(Ae=Ae.map(qe=>KS(Zi(qe)))),c(o,["tools"],Ae)}const B=r(t,["toolConfig"]);if(o!==void 0&&B!=null&&c(o,["toolConfig"],YS(B)),r(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const J=r(t,["cachedContent"]);o!==void 0&&J!=null&&c(o,["cachedContent"],pn(i,J));const ue=r(t,["responseModalities"]);ue!=null&&c(u,["responseModalities"],ue);const Z=r(t,["mediaResolution"]);Z!=null&&c(u,["mediaResolution"],Z);const re=r(t,["speechConfig"]);if(re!=null&&c(u,["speechConfig"],Lu(re)),r(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const Ee=r(t,["thinkingConfig"]);Ee!=null&&c(u,["thinkingConfig"],Ee);const Me=r(t,["imageConfig"]);Me!=null&&c(u,["imageConfig"],AS(Me));const xe=r(t,["enableEnhancedCivicAnswers"]);if(xe!=null&&c(u,["enableEnhancedCivicAnswers"],xe),r(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return u}function $_(i,t,o,a){const u={},f=r(t,["systemInstruction"]);o!==void 0&&f!=null&&c(o,["systemInstruction"],Xe(f));const p=r(t,["temperature"]);p!=null&&c(u,["temperature"],p);const g=r(t,["topP"]);g!=null&&c(u,["topP"],g);const y=r(t,["topK"]);y!=null&&c(u,["topK"],y);const m=r(t,["candidateCount"]);m!=null&&c(u,["candidateCount"],m);const v=r(t,["maxOutputTokens"]);v!=null&&c(u,["maxOutputTokens"],v);const E=r(t,["stopSequences"]);E!=null&&c(u,["stopSequences"],E);const _=r(t,["responseLogprobs"]);_!=null&&c(u,["responseLogprobs"],_);const A=r(t,["logprobs"]);A!=null&&c(u,["logprobs"],A);const I=r(t,["presencePenalty"]);I!=null&&c(u,["presencePenalty"],I);const L=r(t,["frequencyPenalty"]);L!=null&&c(u,["frequencyPenalty"],L);const b=r(t,["seed"]);b!=null&&c(u,["seed"],b);const z=r(t,["responseMimeType"]);z!=null&&c(u,["responseMimeType"],z);const Q=r(t,["responseSchema"]);Q!=null&&c(u,["responseSchema"],Gu(Q));const O=r(t,["responseJsonSchema"]);O!=null&&c(u,["responseJsonSchema"],O);const k=r(t,["routingConfig"]);k!=null&&c(u,["routingConfig"],k);const j=r(t,["modelSelectionConfig"]);j!=null&&c(u,["modelConfig"],j);const B=r(t,["safetySettings"]);if(o!==void 0&&B!=null){let ee=B;Array.isArray(ee)&&(ee=ee.map(ge=>ge)),c(o,["safetySettings"],ee)}const J=r(t,["tools"]);if(o!==void 0&&J!=null){let ee=$i(J);Array.isArray(ee)&&(ee=ee.map(ge=>og(Zi(ge)))),c(o,["tools"],ee)}const ue=r(t,["toolConfig"]);o!==void 0&&ue!=null&&c(o,["toolConfig"],ue);const Z=r(t,["labels"]);o!==void 0&&Z!=null&&c(o,["labels"],Z);const re=r(t,["cachedContent"]);o!==void 0&&re!=null&&c(o,["cachedContent"],pn(i,re));const Ee=r(t,["responseModalities"]);Ee!=null&&c(u,["responseModalities"],Ee);const Me=r(t,["mediaResolution"]);Me!=null&&c(u,["mediaResolution"],Me);const xe=r(t,["speechConfig"]);xe!=null&&c(u,["speechConfig"],Lu(xe));const Ae=r(t,["audioTimestamp"]);Ae!=null&&c(u,["audioTimestamp"],Ae);const qe=r(t,["thinkingConfig"]);qe!=null&&c(u,["thinkingConfig"],qe);const G=r(t,["imageConfig"]);if(G!=null&&c(u,["imageConfig"],CS(G)),r(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");const F=r(t,["modelArmorConfig"]);return o!==void 0&&F!=null&&c(o,["modelArmorConfig"],F),u}function Sm(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["contents"]);if(f!=null){let g=Ct(f);Array.isArray(g)&&(g=g.map(y=>jo(y))),c(a,["contents"],g)}const p=r(t,["config"]);return p!=null&&c(a,["generationConfig"],Z_(i,p,a)),a}function Am(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["contents"]);if(f!=null){let g=Ct(f);Array.isArray(g)&&(g=g.map(y=>y)),c(a,["contents"],g)}const p=r(t,["config"]);return p!=null&&c(a,["generationConfig"],$_(i,p,a)),a}function Cm(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["candidates"]);if(u!=null){let m=u;Array.isArray(m)&&(m=m.map(v=>T_(v))),c(o,["candidates"],m)}const f=r(i,["modelVersion"]);f!=null&&c(o,["modelVersion"],f);const p=r(i,["promptFeedback"]);p!=null&&c(o,["promptFeedback"],p);const g=r(i,["responseId"]);g!=null&&c(o,["responseId"],g);const y=r(i,["usageMetadata"]);return y!=null&&c(o,["usageMetadata"],y),o}function Rm(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["candidates"]);if(u!=null){let v=u;Array.isArray(v)&&(v=v.map(E=>E)),c(o,["candidates"],v)}const f=r(i,["createTime"]);f!=null&&c(o,["createTime"],f);const p=r(i,["modelVersion"]);p!=null&&c(o,["modelVersion"],p);const g=r(i,["promptFeedback"]);g!=null&&c(o,["promptFeedback"],g);const y=r(i,["responseId"]);y!=null&&c(o,["responseId"],y);const m=r(i,["usageMetadata"]);return m!=null&&c(o,["usageMetadata"],m),o}function W_(i,t,o){const a={};if(r(i,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(r(i,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const u=r(i,["numberOfImages"]);t!==void 0&&u!=null&&c(t,["parameters","sampleCount"],u);const f=r(i,["aspectRatio"]);t!==void 0&&f!=null&&c(t,["parameters","aspectRatio"],f);const p=r(i,["guidanceScale"]);if(t!==void 0&&p!=null&&c(t,["parameters","guidanceScale"],p),r(i,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const g=r(i,["safetyFilterLevel"]);t!==void 0&&g!=null&&c(t,["parameters","safetySetting"],g);const y=r(i,["personGeneration"]);t!==void 0&&y!=null&&c(t,["parameters","personGeneration"],y);const m=r(i,["includeSafetyAttributes"]);t!==void 0&&m!=null&&c(t,["parameters","includeSafetyAttributes"],m);const v=r(i,["includeRaiReason"]);t!==void 0&&v!=null&&c(t,["parameters","includeRaiReason"],v);const E=r(i,["language"]);t!==void 0&&E!=null&&c(t,["parameters","language"],E);const _=r(i,["outputMimeType"]);t!==void 0&&_!=null&&c(t,["parameters","outputOptions","mimeType"],_);const A=r(i,["outputCompressionQuality"]);if(t!==void 0&&A!=null&&c(t,["parameters","outputOptions","compressionQuality"],A),r(i,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(r(i,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const I=r(i,["imageSize"]);if(t!==void 0&&I!=null&&c(t,["parameters","sampleImageSize"],I),r(i,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return a}function j_(i,t,o){const a={},u=r(i,["outputGcsUri"]);t!==void 0&&u!=null&&c(t,["parameters","storageUri"],u);const f=r(i,["negativePrompt"]);t!==void 0&&f!=null&&c(t,["parameters","negativePrompt"],f);const p=r(i,["numberOfImages"]);t!==void 0&&p!=null&&c(t,["parameters","sampleCount"],p);const g=r(i,["aspectRatio"]);t!==void 0&&g!=null&&c(t,["parameters","aspectRatio"],g);const y=r(i,["guidanceScale"]);t!==void 0&&y!=null&&c(t,["parameters","guidanceScale"],y);const m=r(i,["seed"]);t!==void 0&&m!=null&&c(t,["parameters","seed"],m);const v=r(i,["safetyFilterLevel"]);t!==void 0&&v!=null&&c(t,["parameters","safetySetting"],v);const E=r(i,["personGeneration"]);t!==void 0&&E!=null&&c(t,["parameters","personGeneration"],E);const _=r(i,["includeSafetyAttributes"]);t!==void 0&&_!=null&&c(t,["parameters","includeSafetyAttributes"],_);const A=r(i,["includeRaiReason"]);t!==void 0&&A!=null&&c(t,["parameters","includeRaiReason"],A);const I=r(i,["language"]);t!==void 0&&I!=null&&c(t,["parameters","language"],I);const L=r(i,["outputMimeType"]);t!==void 0&&L!=null&&c(t,["parameters","outputOptions","mimeType"],L);const b=r(i,["outputCompressionQuality"]);t!==void 0&&b!=null&&c(t,["parameters","outputOptions","compressionQuality"],b);const z=r(i,["addWatermark"]);t!==void 0&&z!=null&&c(t,["parameters","addWatermark"],z);const Q=r(i,["labels"]);t!==void 0&&Q!=null&&c(t,["labels"],Q);const O=r(i,["imageSize"]);t!==void 0&&O!=null&&c(t,["parameters","sampleImageSize"],O);const k=r(i,["enhancePrompt"]);return t!==void 0&&k!=null&&c(t,["parameters","enhancePrompt"],k),a}function eS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["prompt"]);f!=null&&c(a,["instances[0]","prompt"],f);const p=r(t,["config"]);return p!=null&&W_(p,a),a}function tS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["prompt"]);f!=null&&c(a,["instances[0]","prompt"],f);const p=r(t,["config"]);return p!=null&&j_(p,a),a}function nS(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["predictions"]);if(u!=null){let p=u;Array.isArray(p)&&(p=p.map(g=>hS(g))),c(o,["generatedImages"],p)}const f=r(i,["positivePromptSafetyAttributes"]);return f!=null&&c(o,["positivePromptSafetyAttributes"],ng(f)),o}function iS(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["predictions"]);if(u!=null){let p=u;Array.isArray(p)&&(p=p.map(g=>xa(g))),c(o,["generatedImages"],p)}const f=r(i,["positivePromptSafetyAttributes"]);return f!=null&&c(o,["positivePromptSafetyAttributes"],ig(f)),o}function oS(i,t,o){const a={},u=r(i,["numberOfVideos"]);if(t!==void 0&&u!=null&&c(t,["parameters","sampleCount"],u),r(i,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(r(i,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const f=r(i,["durationSeconds"]);if(t!==void 0&&f!=null&&c(t,["parameters","durationSeconds"],f),r(i,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const p=r(i,["aspectRatio"]);t!==void 0&&p!=null&&c(t,["parameters","aspectRatio"],p);const g=r(i,["resolution"]);t!==void 0&&g!=null&&c(t,["parameters","resolution"],g);const y=r(i,["personGeneration"]);if(t!==void 0&&y!=null&&c(t,["parameters","personGeneration"],y),r(i,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const m=r(i,["negativePrompt"]);t!==void 0&&m!=null&&c(t,["parameters","negativePrompt"],m);const v=r(i,["enhancePrompt"]);if(t!==void 0&&v!=null&&c(t,["parameters","enhancePrompt"],v),r(i,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const E=r(i,["lastFrame"]);t!==void 0&&E!=null&&c(t,["instances[0]","lastFrame"],ba(E));const _=r(i,["referenceImages"]);if(t!==void 0&&_!=null){let A=_;Array.isArray(A)&&(A=A.map(I=>aA(I))),c(t,["instances[0]","referenceImages"],A)}if(r(i,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(r(i,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return a}function lS(i,t,o){const a={},u=r(i,["numberOfVideos"]);t!==void 0&&u!=null&&c(t,["parameters","sampleCount"],u);const f=r(i,["outputGcsUri"]);t!==void 0&&f!=null&&c(t,["parameters","storageUri"],f);const p=r(i,["fps"]);t!==void 0&&p!=null&&c(t,["parameters","fps"],p);const g=r(i,["durationSeconds"]);t!==void 0&&g!=null&&c(t,["parameters","durationSeconds"],g);const y=r(i,["seed"]);t!==void 0&&y!=null&&c(t,["parameters","seed"],y);const m=r(i,["aspectRatio"]);t!==void 0&&m!=null&&c(t,["parameters","aspectRatio"],m);const v=r(i,["resolution"]);t!==void 0&&v!=null&&c(t,["parameters","resolution"],v);const E=r(i,["personGeneration"]);t!==void 0&&E!=null&&c(t,["parameters","personGeneration"],E);const _=r(i,["pubsubTopic"]);t!==void 0&&_!=null&&c(t,["parameters","pubsubTopic"],_);const A=r(i,["negativePrompt"]);t!==void 0&&A!=null&&c(t,["parameters","negativePrompt"],A);const I=r(i,["enhancePrompt"]);t!==void 0&&I!=null&&c(t,["parameters","enhancePrompt"],I);const L=r(i,["generateAudio"]);t!==void 0&&L!=null&&c(t,["parameters","generateAudio"],L);const b=r(i,["lastFrame"]);t!==void 0&&b!=null&&c(t,["instances[0]","lastFrame"],zt(b));const z=r(i,["referenceImages"]);if(t!==void 0&&z!=null){let k=z;Array.isArray(k)&&(k=k.map(j=>sA(j))),c(t,["instances[0]","referenceImages"],k)}const Q=r(i,["mask"]);t!==void 0&&Q!=null&&c(t,["instances[0]","mask"],lA(Q));const O=r(i,["compressionQuality"]);return t!==void 0&&O!=null&&c(t,["parameters","compressionQuality"],O),a}function aS(i,t){const o={},a=r(i,["name"]);a!=null&&c(o,["name"],a);const u=r(i,["metadata"]);u!=null&&c(o,["metadata"],u);const f=r(i,["done"]);f!=null&&c(o,["done"],f);const p=r(i,["error"]);p!=null&&c(o,["error"],p);const g=r(i,["response","generateVideoResponse"]);return g!=null&&c(o,["response"],cS(g)),o}function sS(i,t){const o={},a=r(i,["name"]);a!=null&&c(o,["name"],a);const u=r(i,["metadata"]);u!=null&&c(o,["metadata"],u);const f=r(i,["done"]);f!=null&&c(o,["done"],f);const p=r(i,["error"]);p!=null&&c(o,["error"],p);const g=r(i,["response"]);return g!=null&&c(o,["response"],fS(g)),o}function rS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["prompt"]);f!=null&&c(a,["instances[0]","prompt"],f);const p=r(t,["image"]);p!=null&&c(a,["instances[0]","image"],ba(p));const g=r(t,["video"]);g!=null&&c(a,["instances[0]","video"],lg(g));const y=r(t,["source"]);y!=null&&dS(y,a);const m=r(t,["config"]);return m!=null&&oS(m,a),a}function uS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["prompt"]);f!=null&&c(a,["instances[0]","prompt"],f);const p=r(t,["image"]);p!=null&&c(a,["instances[0]","image"],zt(p));const g=r(t,["video"]);g!=null&&c(a,["instances[0]","video"],ag(g));const y=r(t,["source"]);y!=null&&pS(y,a);const m=r(t,["config"]);return m!=null&&lS(m,a),a}function cS(i,t){const o={},a=r(i,["generatedSamples"]);if(a!=null){let p=a;Array.isArray(p)&&(p=p.map(g=>gS(g))),c(o,["generatedVideos"],p)}const u=r(i,["raiMediaFilteredCount"]);u!=null&&c(o,["raiMediaFilteredCount"],u);const f=r(i,["raiMediaFilteredReasons"]);return f!=null&&c(o,["raiMediaFilteredReasons"],f),o}function fS(i,t){const o={},a=r(i,["videos"]);if(a!=null){let p=a;Array.isArray(p)&&(p=p.map(g=>yS(g))),c(o,["generatedVideos"],p)}const u=r(i,["raiMediaFilteredCount"]);u!=null&&c(o,["raiMediaFilteredCount"],u);const f=r(i,["raiMediaFilteredReasons"]);return f!=null&&c(o,["raiMediaFilteredReasons"],f),o}function dS(i,t,o){const a={},u=r(i,["prompt"]);t!==void 0&&u!=null&&c(t,["instances[0]","prompt"],u);const f=r(i,["image"]);t!==void 0&&f!=null&&c(t,["instances[0]","image"],ba(f));const p=r(i,["video"]);return t!==void 0&&p!=null&&c(t,["instances[0]","video"],lg(p)),a}function pS(i,t,o){const a={},u=r(i,["prompt"]);t!==void 0&&u!=null&&c(t,["instances[0]","prompt"],u);const f=r(i,["image"]);t!==void 0&&f!=null&&c(t,["instances[0]","image"],zt(f));const p=r(i,["video"]);return t!==void 0&&p!=null&&c(t,["instances[0]","video"],ag(p)),a}function hS(i,t){const o={},a=r(i,["_self"]);a!=null&&c(o,["image"],RS(a));const u=r(i,["raiFilteredReason"]);u!=null&&c(o,["raiFilteredReason"],u);const f=r(i,["_self"]);return f!=null&&c(o,["safetyAttributes"],ng(f)),o}function xa(i,t){const o={},a=r(i,["_self"]);a!=null&&c(o,["image"],tg(a));const u=r(i,["raiFilteredReason"]);u!=null&&c(o,["raiFilteredReason"],u);const f=r(i,["_self"]);f!=null&&c(o,["safetyAttributes"],ig(f));const p=r(i,["prompt"]);return p!=null&&c(o,["enhancedPrompt"],p),o}function mS(i,t){const o={},a=r(i,["_self"]);a!=null&&c(o,["mask"],tg(a));const u=r(i,["labels"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(o,["labels"],f)}return o}function gS(i,t){const o={},a=r(i,["video"]);return a!=null&&c(o,["video"],iA(a)),o}function yS(i,t){const o={},a=r(i,["_self"]);return a!=null&&c(o,["video"],oA(a)),o}function vS(i,t){const o={},a=r(i,["modelSelectionConfig"]);a!=null&&c(o,["modelConfig"],a);const u=r(i,["responseJsonSchema"]);u!=null&&c(o,["responseJsonSchema"],u);const f=r(i,["audioTimestamp"]);f!=null&&c(o,["audioTimestamp"],f);const p=r(i,["candidateCount"]);p!=null&&c(o,["candidateCount"],p);const g=r(i,["enableAffectiveDialog"]);g!=null&&c(o,["enableAffectiveDialog"],g);const y=r(i,["frequencyPenalty"]);y!=null&&c(o,["frequencyPenalty"],y);const m=r(i,["logprobs"]);m!=null&&c(o,["logprobs"],m);const v=r(i,["maxOutputTokens"]);v!=null&&c(o,["maxOutputTokens"],v);const E=r(i,["mediaResolution"]);E!=null&&c(o,["mediaResolution"],E);const _=r(i,["presencePenalty"]);_!=null&&c(o,["presencePenalty"],_);const A=r(i,["responseLogprobs"]);A!=null&&c(o,["responseLogprobs"],A);const I=r(i,["responseMimeType"]);I!=null&&c(o,["responseMimeType"],I);const L=r(i,["responseModalities"]);L!=null&&c(o,["responseModalities"],L);const b=r(i,["responseSchema"]);b!=null&&c(o,["responseSchema"],b);const z=r(i,["routingConfig"]);z!=null&&c(o,["routingConfig"],z);const Q=r(i,["seed"]);Q!=null&&c(o,["seed"],Q);const O=r(i,["speechConfig"]);O!=null&&c(o,["speechConfig"],O);const k=r(i,["stopSequences"]);k!=null&&c(o,["stopSequences"],k);const j=r(i,["temperature"]);j!=null&&c(o,["temperature"],j);const B=r(i,["thinkingConfig"]);B!=null&&c(o,["thinkingConfig"],B);const J=r(i,["topK"]);J!=null&&c(o,["topK"],J);const ue=r(i,["topP"]);if(ue!=null&&c(o,["topP"],ue),r(i,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return o}function TS(i,t,o){const a={},u=r(t,["model"]);return u!=null&&c(a,["_url","name"],Te(i,u)),a}function ES(i,t,o){const a={},u=r(t,["model"]);return u!=null&&c(a,["_url","name"],Te(i,u)),a}function _S(i,t){const o={},a=r(i,["authConfig"]);a!=null&&c(o,["authConfig"],y_(a));const u=r(i,["enableWidget"]);return u!=null&&c(o,["enableWidget"],u),o}function SS(i,t){const o={},a=r(i,["searchTypes"]);if(a!=null&&c(o,["searchTypes"],a),r(i,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(r(i,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const u=r(i,["timeRangeFilter"]);return u!=null&&c(o,["timeRangeFilter"],u),o}function AS(i,t){const o={},a=r(i,["aspectRatio"]);a!=null&&c(o,["aspectRatio"],a);const u=r(i,["imageSize"]);if(u!=null&&c(o,["imageSize"],u),r(i,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(r(i,["prominentPeople"])!==void 0)throw new Error("prominentPeople parameter is not supported in Gemini API.");if(r(i,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(r(i,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");if(r(i,["imageOutputOptions"])!==void 0)throw new Error("imageOutputOptions parameter is not supported in Gemini API.");return o}function CS(i,t){const o={},a=r(i,["aspectRatio"]);a!=null&&c(o,["aspectRatio"],a);const u=r(i,["imageSize"]);u!=null&&c(o,["imageSize"],u);const f=r(i,["personGeneration"]);f!=null&&c(o,["personGeneration"],f);const p=r(i,["prominentPeople"]);p!=null&&c(o,["prominentPeople"],p);const g=r(i,["outputMimeType"]);g!=null&&c(o,["imageOutputOptions","mimeType"],g);const y=r(i,["outputCompressionQuality"]);y!=null&&c(o,["imageOutputOptions","compressionQuality"],y);const m=r(i,["imageOutputOptions"]);return m!=null&&c(o,["imageOutputOptions"],m),o}function RS(i,t){const o={},a=r(i,["bytesBase64Encoded"]);a!=null&&c(o,["imageBytes"],Bn(a));const u=r(i,["mimeType"]);return u!=null&&c(o,["mimeType"],u),o}function tg(i,t){const o={},a=r(i,["gcsUri"]);a!=null&&c(o,["gcsUri"],a);const u=r(i,["bytesBase64Encoded"]);u!=null&&c(o,["imageBytes"],Bn(u));const f=r(i,["mimeType"]);return f!=null&&c(o,["mimeType"],f),o}function ba(i,t){const o={};if(r(i,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const a=r(i,["imageBytes"]);a!=null&&c(o,["bytesBase64Encoded"],Bn(a));const u=r(i,["mimeType"]);return u!=null&&c(o,["mimeType"],u),o}function zt(i,t){const o={},a=r(i,["gcsUri"]);a!=null&&c(o,["gcsUri"],a);const u=r(i,["imageBytes"]);u!=null&&c(o,["bytesBase64Encoded"],Bn(u));const f=r(i,["mimeType"]);return f!=null&&c(o,["mimeType"],f),o}function MS(i,t,o,a){const u={},f=r(t,["pageSize"]);o!==void 0&&f!=null&&c(o,["_query","pageSize"],f);const p=r(t,["pageToken"]);o!==void 0&&p!=null&&c(o,["_query","pageToken"],p);const g=r(t,["filter"]);o!==void 0&&g!=null&&c(o,["_query","filter"],g);const y=r(t,["queryBase"]);return o!==void 0&&y!=null&&c(o,["_url","models_url"],Qm(i,y)),u}function NS(i,t,o,a){const u={},f=r(t,["pageSize"]);o!==void 0&&f!=null&&c(o,["_query","pageSize"],f);const p=r(t,["pageToken"]);o!==void 0&&p!=null&&c(o,["_query","pageToken"],p);const g=r(t,["filter"]);o!==void 0&&g!=null&&c(o,["_query","filter"],g);const y=r(t,["queryBase"]);return o!==void 0&&y!=null&&c(o,["_url","models_url"],Qm(i,y)),u}function IS(i,t,o){const a={},u=r(t,["config"]);return u!=null&&MS(i,u,a),a}function DS(i,t,o){const a={},u=r(t,["config"]);return u!=null&&NS(i,u,a),a}function US(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["nextPageToken"]);u!=null&&c(o,["nextPageToken"],u);const f=r(i,["_self"]);if(f!=null){let p=Xm(f);Array.isArray(p)&&(p=p.map(g=>Tu(g))),c(o,["models"],p)}return o}function wS(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["nextPageToken"]);u!=null&&c(o,["nextPageToken"],u);const f=r(i,["_self"]);if(f!=null){let p=Xm(f);Array.isArray(p)&&(p=p.map(g=>Eu(g))),c(o,["models"],p)}return o}function xS(i,t){const o={},a=r(i,["maskMode"]);a!=null&&c(o,["maskMode"],a);const u=r(i,["segmentationClasses"]);u!=null&&c(o,["maskClasses"],u);const f=r(i,["maskDilation"]);return f!=null&&c(o,["dilation"],f),o}function Tu(i,t){const o={},a=r(i,["name"]);a!=null&&c(o,["name"],a);const u=r(i,["displayName"]);u!=null&&c(o,["displayName"],u);const f=r(i,["description"]);f!=null&&c(o,["description"],f);const p=r(i,["version"]);p!=null&&c(o,["version"],p);const g=r(i,["_self"]);g!=null&&c(o,["tunedModelInfo"],QS(g));const y=r(i,["inputTokenLimit"]);y!=null&&c(o,["inputTokenLimit"],y);const m=r(i,["outputTokenLimit"]);m!=null&&c(o,["outputTokenLimit"],m);const v=r(i,["supportedGenerationMethods"]);v!=null&&c(o,["supportedActions"],v);const E=r(i,["temperature"]);E!=null&&c(o,["temperature"],E);const _=r(i,["maxTemperature"]);_!=null&&c(o,["maxTemperature"],_);const A=r(i,["topP"]);A!=null&&c(o,["topP"],A);const I=r(i,["topK"]);I!=null&&c(o,["topK"],I);const L=r(i,["thinking"]);return L!=null&&c(o,["thinking"],L),o}function Eu(i,t){const o={},a=r(i,["name"]);a!=null&&c(o,["name"],a);const u=r(i,["displayName"]);u!=null&&c(o,["displayName"],u);const f=r(i,["description"]);f!=null&&c(o,["description"],f);const p=r(i,["versionId"]);p!=null&&c(o,["version"],p);const g=r(i,["deployedModels"]);if(g!=null){let _=g;Array.isArray(_)&&(_=_.map(A=>J_(A))),c(o,["endpoints"],_)}const y=r(i,["labels"]);y!=null&&c(o,["labels"],y);const m=r(i,["_self"]);m!=null&&c(o,["tunedModelInfo"],XS(m));const v=r(i,["defaultCheckpointId"]);v!=null&&c(o,["defaultCheckpointId"],v);const E=r(i,["checkpoints"]);if(E!=null){let _=E;Array.isArray(_)&&(_=_.map(A=>A)),c(o,["checkpoints"],_)}return o}function bS(i,t){const o={},a=r(i,["mediaResolution"]);a!=null&&c(o,["mediaResolution"],a);const u=r(i,["codeExecutionResult"]);u!=null&&c(o,["codeExecutionResult"],u);const f=r(i,["executableCode"]);f!=null&&c(o,["executableCode"],f);const p=r(i,["fileData"]);p!=null&&c(o,["fileData"],Y_(p));const g=r(i,["functionCall"]);g!=null&&c(o,["functionCall"],K_(g));const y=r(i,["functionResponse"]);y!=null&&c(o,["functionResponse"],y);const m=r(i,["inlineData"]);m!=null&&c(o,["inlineData"],v_(m));const v=r(i,["text"]);v!=null&&c(o,["text"],v);const E=r(i,["thought"]);E!=null&&c(o,["thought"],E);const _=r(i,["thoughtSignature"]);_!=null&&c(o,["thoughtSignature"],_);const A=r(i,["videoMetadata"]);return A!=null&&c(o,["videoMetadata"],A),o}function GS(i,t){const o={},a=r(i,["productImage"]);return a!=null&&c(o,["image"],zt(a)),o}function LS(i,t,o){const a={},u=r(i,["numberOfImages"]);t!==void 0&&u!=null&&c(t,["parameters","sampleCount"],u);const f=r(i,["baseSteps"]);t!==void 0&&f!=null&&c(t,["parameters","baseSteps"],f);const p=r(i,["outputGcsUri"]);t!==void 0&&p!=null&&c(t,["parameters","storageUri"],p);const g=r(i,["seed"]);t!==void 0&&g!=null&&c(t,["parameters","seed"],g);const y=r(i,["safetyFilterLevel"]);t!==void 0&&y!=null&&c(t,["parameters","safetySetting"],y);const m=r(i,["personGeneration"]);t!==void 0&&m!=null&&c(t,["parameters","personGeneration"],m);const v=r(i,["addWatermark"]);t!==void 0&&v!=null&&c(t,["parameters","addWatermark"],v);const E=r(i,["outputMimeType"]);t!==void 0&&E!=null&&c(t,["parameters","outputOptions","mimeType"],E);const _=r(i,["outputCompressionQuality"]);t!==void 0&&_!=null&&c(t,["parameters","outputOptions","compressionQuality"],_);const A=r(i,["enhancePrompt"]);t!==void 0&&A!=null&&c(t,["parameters","enhancePrompt"],A);const I=r(i,["labels"]);return t!==void 0&&I!=null&&c(t,["labels"],I),a}function HS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["source"]);f!=null&&qS(f,a);const p=r(t,["config"]);return p!=null&&LS(p,a),a}function PS(i,t){const o={},a=r(i,["predictions"]);if(a!=null){let u=a;Array.isArray(u)&&(u=u.map(f=>xa(f))),c(o,["generatedImages"],u)}return o}function qS(i,t,o){const a={},u=r(i,["prompt"]);t!==void 0&&u!=null&&c(t,["instances[0]","prompt"],u);const f=r(i,["personImage"]);t!==void 0&&f!=null&&c(t,["instances[0]","personImage","image"],zt(f));const p=r(i,["productImages"]);if(t!==void 0&&p!=null){let g=p;Array.isArray(g)&&(g=g.map(y=>GS(y))),c(t,["instances[0]","productImages"],g)}return a}function VS(i,t){const o={},a=r(i,["referenceImage"]);a!=null&&c(o,["referenceImage"],zt(a));const u=r(i,["referenceId"]);u!=null&&c(o,["referenceId"],u);const f=r(i,["referenceType"]);f!=null&&c(o,["referenceType"],f);const p=r(i,["maskImageConfig"]);p!=null&&c(o,["maskImageConfig"],xS(p));const g=r(i,["controlImageConfig"]);g!=null&&c(o,["controlImageConfig"],R_(g));const y=r(i,["styleImageConfig"]);y!=null&&c(o,["styleImageConfig"],y);const m=r(i,["subjectImageConfig"]);return m!=null&&c(o,["subjectImageConfig"],m),o}function ng(i,t){const o={},a=r(i,["safetyAttributes","categories"]);a!=null&&c(o,["categories"],a);const u=r(i,["safetyAttributes","scores"]);u!=null&&c(o,["scores"],u);const f=r(i,["contentType"]);return f!=null&&c(o,["contentType"],f),o}function ig(i,t){const o={},a=r(i,["safetyAttributes","categories"]);a!=null&&c(o,["categories"],a);const u=r(i,["safetyAttributes","scores"]);u!=null&&c(o,["scores"],u);const f=r(i,["contentType"]);return f!=null&&c(o,["contentType"],f),o}function BS(i,t){const o={},a=r(i,["category"]);if(a!=null&&c(o,["category"],a),r(i,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const u=r(i,["threshold"]);return u!=null&&c(o,["threshold"],u),o}function zS(i,t){const o={},a=r(i,["image"]);return a!=null&&c(o,["image"],zt(a)),o}function OS(i,t,o){const a={},u=r(i,["mode"]);t!==void 0&&u!=null&&c(t,["parameters","mode"],u);const f=r(i,["maxPredictions"]);t!==void 0&&f!=null&&c(t,["parameters","maxPredictions"],f);const p=r(i,["confidenceThreshold"]);t!==void 0&&p!=null&&c(t,["parameters","confidenceThreshold"],p);const g=r(i,["maskDilation"]);t!==void 0&&g!=null&&c(t,["parameters","maskDilation"],g);const y=r(i,["binaryColorThreshold"]);t!==void 0&&y!=null&&c(t,["parameters","binaryColorThreshold"],y);const m=r(i,["labels"]);return t!==void 0&&m!=null&&c(t,["labels"],m),a}function FS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["source"]);f!=null&&JS(f,a);const p=r(t,["config"]);return p!=null&&OS(p,a),a}function kS(i,t){const o={},a=r(i,["predictions"]);if(a!=null){let u=a;Array.isArray(u)&&(u=u.map(f=>mS(f))),c(o,["generatedMasks"],u)}return o}function JS(i,t,o){const a={},u=r(i,["prompt"]);t!==void 0&&u!=null&&c(t,["instances[0]","prompt"],u);const f=r(i,["image"]);t!==void 0&&f!=null&&c(t,["instances[0]","image"],zt(f));const p=r(i,["scribbleImage"]);return t!==void 0&&p!=null&&c(t,["instances[0]","scribble"],zS(p)),a}function YS(i,t){const o={},a=r(i,["retrievalConfig"]);a!=null&&c(o,["retrievalConfig"],a);const u=r(i,["functionCallingConfig"]);return u!=null&&c(o,["functionCallingConfig"],Q_(u)),o}function KS(i,t){const o={};if(r(i,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const a=r(i,["computerUse"]);a!=null&&c(o,["computerUse"],a);const u=r(i,["fileSearch"]);u!=null&&c(o,["fileSearch"],u);const f=r(i,["googleSearch"]);f!=null&&c(o,["googleSearch"],SS(f));const p=r(i,["googleMaps"]);p!=null&&c(o,["googleMaps"],_S(p));const g=r(i,["codeExecution"]);if(g!=null&&c(o,["codeExecution"],g),r(i,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const y=r(i,["functionDeclarations"]);if(y!=null){let _=y;Array.isArray(_)&&(_=_.map(A=>A)),c(o,["functionDeclarations"],_)}const m=r(i,["googleSearchRetrieval"]);if(m!=null&&c(o,["googleSearchRetrieval"],m),r(i,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const v=r(i,["urlContext"]);v!=null&&c(o,["urlContext"],v);const E=r(i,["mcpServers"]);if(E!=null){let _=E;Array.isArray(_)&&(_=_.map(A=>A)),c(o,["mcpServers"],_)}return o}function og(i,t){const o={},a=r(i,["retrieval"]);a!=null&&c(o,["retrieval"],a);const u=r(i,["computerUse"]);if(u!=null&&c(o,["computerUse"],u),r(i,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const f=r(i,["googleSearch"]);f!=null&&c(o,["googleSearch"],f);const p=r(i,["googleMaps"]);p!=null&&c(o,["googleMaps"],p);const g=r(i,["codeExecution"]);g!=null&&c(o,["codeExecution"],g);const y=r(i,["enterpriseWebSearch"]);y!=null&&c(o,["enterpriseWebSearch"],y);const m=r(i,["functionDeclarations"]);if(m!=null){let A=m;Array.isArray(A)&&(A=A.map(I=>X_(I))),c(o,["functionDeclarations"],A)}const v=r(i,["googleSearchRetrieval"]);v!=null&&c(o,["googleSearchRetrieval"],v);const E=r(i,["parallelAiSearch"]);E!=null&&c(o,["parallelAiSearch"],E);const _=r(i,["urlContext"]);if(_!=null&&c(o,["urlContext"],_),r(i,["mcpServers"])!==void 0)throw new Error("mcpServers parameter is not supported in Vertex AI.");return o}function QS(i,t){const o={},a=r(i,["baseModel"]);a!=null&&c(o,["baseModel"],a);const u=r(i,["createTime"]);u!=null&&c(o,["createTime"],u);const f=r(i,["updateTime"]);return f!=null&&c(o,["updateTime"],f),o}function XS(i,t){const o={},a=r(i,["labels","google-vertex-llm-tuning-base-model-id"]);a!=null&&c(o,["baseModel"],a);const u=r(i,["createTime"]);u!=null&&c(o,["createTime"],u);const f=r(i,["updateTime"]);return f!=null&&c(o,["updateTime"],f),o}function ZS(i,t,o){const a={},u=r(i,["displayName"]);t!==void 0&&u!=null&&c(t,["displayName"],u);const f=r(i,["description"]);t!==void 0&&f!=null&&c(t,["description"],f);const p=r(i,["defaultCheckpointId"]);return t!==void 0&&p!=null&&c(t,["defaultCheckpointId"],p),a}function $S(i,t,o){const a={},u=r(i,["displayName"]);t!==void 0&&u!=null&&c(t,["displayName"],u);const f=r(i,["description"]);t!==void 0&&f!=null&&c(t,["description"],f);const p=r(i,["defaultCheckpointId"]);return t!==void 0&&p!=null&&c(t,["defaultCheckpointId"],p),a}function WS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","name"],Te(i,u));const f=r(t,["config"]);return f!=null&&ZS(f,a),a}function jS(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["config"]);return f!=null&&$S(f,a),a}function eA(i,t,o){const a={},u=r(i,["outputGcsUri"]);t!==void 0&&u!=null&&c(t,["parameters","storageUri"],u);const f=r(i,["safetyFilterLevel"]);t!==void 0&&f!=null&&c(t,["parameters","safetySetting"],f);const p=r(i,["personGeneration"]);t!==void 0&&p!=null&&c(t,["parameters","personGeneration"],p);const g=r(i,["includeRaiReason"]);t!==void 0&&g!=null&&c(t,["parameters","includeRaiReason"],g);const y=r(i,["outputMimeType"]);t!==void 0&&y!=null&&c(t,["parameters","outputOptions","mimeType"],y);const m=r(i,["outputCompressionQuality"]);t!==void 0&&m!=null&&c(t,["parameters","outputOptions","compressionQuality"],m);const v=r(i,["enhanceInputImage"]);t!==void 0&&v!=null&&c(t,["parameters","upscaleConfig","enhanceInputImage"],v);const E=r(i,["imagePreservationFactor"]);t!==void 0&&E!=null&&c(t,["parameters","upscaleConfig","imagePreservationFactor"],E);const _=r(i,["labels"]);t!==void 0&&_!=null&&c(t,["labels"],_);const A=r(i,["numberOfImages"]);t!==void 0&&A!=null&&c(t,["parameters","sampleCount"],A);const I=r(i,["mode"]);return t!==void 0&&I!=null&&c(t,["parameters","mode"],I),a}function tA(i,t,o){const a={},u=r(t,["model"]);u!=null&&c(a,["_url","model"],Te(i,u));const f=r(t,["image"]);f!=null&&c(a,["instances[0]","image"],zt(f));const p=r(t,["upscaleFactor"]);p!=null&&c(a,["parameters","upscaleConfig","upscaleFactor"],p);const g=r(t,["config"]);return g!=null&&eA(g,a),a}function nA(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["predictions"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>xa(p))),c(o,["generatedImages"],f)}return o}function iA(i,t){const o={},a=r(i,["uri"]);a!=null&&c(o,["uri"],a);const u=r(i,["encodedVideo"]);u!=null&&c(o,["videoBytes"],Bn(u));const f=r(i,["encoding"]);return f!=null&&c(o,["mimeType"],f),o}function oA(i,t){const o={},a=r(i,["gcsUri"]);a!=null&&c(o,["uri"],a);const u=r(i,["bytesBase64Encoded"]);u!=null&&c(o,["videoBytes"],Bn(u));const f=r(i,["mimeType"]);return f!=null&&c(o,["mimeType"],f),o}function lA(i,t){const o={},a=r(i,["image"]);a!=null&&c(o,["_self"],zt(a));const u=r(i,["maskMode"]);return u!=null&&c(o,["maskMode"],u),o}function aA(i,t){const o={},a=r(i,["image"]);a!=null&&c(o,["image"],ba(a));const u=r(i,["referenceType"]);return u!=null&&c(o,["referenceType"],u),o}function sA(i,t){const o={},a=r(i,["image"]);a!=null&&c(o,["image"],zt(a));const u=r(i,["referenceType"]);return u!=null&&c(o,["referenceType"],u),o}function lg(i,t){const o={},a=r(i,["uri"]);a!=null&&c(o,["uri"],a);const u=r(i,["videoBytes"]);u!=null&&c(o,["encodedVideo"],Bn(u));const f=r(i,["mimeType"]);return f!=null&&c(o,["encoding"],f),o}function ag(i,t){const o={},a=r(i,["uri"]);a!=null&&c(o,["gcsUri"],a);const u=r(i,["videoBytes"]);u!=null&&c(o,["bytesBase64Encoded"],Bn(u));const f=r(i,["mimeType"]);return f!=null&&c(o,["mimeType"],f),o}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function rA(i,t){const o={},a=r(i,["displayName"]);return t!==void 0&&a!=null&&c(t,["displayName"],a),o}function uA(i){const t={},o=r(i,["config"]);return o!=null&&rA(o,t),t}function cA(i,t){const o={},a=r(i,["force"]);return t!==void 0&&a!=null&&c(t,["_query","force"],a),o}function fA(i){const t={},o=r(i,["name"]);o!=null&&c(t,["_url","name"],o);const a=r(i,["config"]);return a!=null&&cA(a,t),t}function dA(i){const t={},o=r(i,["name"]);return o!=null&&c(t,["_url","name"],o),t}function pA(i,t){const o={},a=r(i,["customMetadata"]);if(t!==void 0&&a!=null){let f=a;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["customMetadata"],f)}const u=r(i,["chunkingConfig"]);return t!==void 0&&u!=null&&c(t,["chunkingConfig"],u),o}function hA(i){const t={},o=r(i,["name"]);o!=null&&c(t,["name"],o);const a=r(i,["metadata"]);a!=null&&c(t,["metadata"],a);const u=r(i,["done"]);u!=null&&c(t,["done"],u);const f=r(i,["error"]);f!=null&&c(t,["error"],f);const p=r(i,["response"]);return p!=null&&c(t,["response"],gA(p)),t}function mA(i){const t={},o=r(i,["fileSearchStoreName"]);o!=null&&c(t,["_url","file_search_store_name"],o);const a=r(i,["fileName"]);a!=null&&c(t,["fileName"],a);const u=r(i,["config"]);return u!=null&&pA(u,t),t}function gA(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["parent"]);a!=null&&c(t,["parent"],a);const u=r(i,["documentName"]);return u!=null&&c(t,["documentName"],u),t}function yA(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);return t!==void 0&&u!=null&&c(t,["_query","pageToken"],u),o}function vA(i){const t={},o=r(i,["config"]);return o!=null&&yA(o,t),t}function TA(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["fileSearchStores"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["fileSearchStores"],f)}return t}function sg(i,t){const o={},a=r(i,["mimeType"]);t!==void 0&&a!=null&&c(t,["mimeType"],a);const u=r(i,["displayName"]);t!==void 0&&u!=null&&c(t,["displayName"],u);const f=r(i,["customMetadata"]);if(t!==void 0&&f!=null){let g=f;Array.isArray(g)&&(g=g.map(y=>y)),c(t,["customMetadata"],g)}const p=r(i,["chunkingConfig"]);return t!==void 0&&p!=null&&c(t,["chunkingConfig"],p),o}function EA(i){const t={},o=r(i,["fileSearchStoreName"]);o!=null&&c(t,["_url","file_search_store_name"],o);const a=r(i,["config"]);return a!=null&&sg(a,t),t}function _A(i){const t={},o=r(i,["sdkHttpResponse"]);return o!=null&&c(t,["sdkHttpResponse"],o),t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const SA="Content-Type",AA="X-Server-Timeout",CA="User-Agent",_u="x-goog-api-client",RA="1.45.0",MA=`google-genai-sdk/${RA}`,NA="v1beta1",IA="v1beta",DA=5,UA=[408,429,500,502,503,504];class wA{constructor(t){var o,a,u;this.clientOptions=Object.assign({},t),this.customBaseUrl=(o=t.httpOptions)===null||o===void 0?void 0:o.baseUrl,this.clientOptions.vertexai&&(this.clientOptions.project&&this.clientOptions.location?this.clientOptions.apiKey=void 0:this.clientOptions.apiKey&&(this.clientOptions.project=void 0,this.clientOptions.location=void 0));const f={};if(this.clientOptions.vertexai){if(!this.clientOptions.location&&!this.clientOptions.apiKey&&!this.customBaseUrl&&(this.clientOptions.location="global"),!(this.clientOptions.project&&this.clientOptions.location||this.clientOptions.apiKey)&&!this.customBaseUrl)throw new Error("Authentication is not set up. Please provide either a project and location, or an API key, or a custom base URL.");const g=t.project&&t.location||!!t.apiKey;this.customBaseUrl&&!g?(f.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?f.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&(f.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),f.apiVersion=(a=this.clientOptions.apiVersion)!==null&&a!==void 0?a:NA}else this.clientOptions.apiKey||console.warn("API key should be set when using the Gemini API."),f.apiVersion=(u=this.clientOptions.apiVersion)!==null&&u!==void 0?u:IA,f.baseUrl="https://generativelanguage.googleapis.com/";f.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=f,t.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(f,t.httpOptions))}isVertexAI(){var t;return(t=this.clientOptions.vertexai)!==null&&t!==void 0?t:!1}getProject(){return this.clientOptions.project}getLocation(){return this.clientOptions.location}getCustomBaseUrl(){return this.customBaseUrl}async getAuthHeaders(){const t=new Headers;return await this.clientOptions.auth.addAuthHeaders(t),t}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(t){if(!t||t.baseUrl===void 0||t.apiVersion===void 0)throw new Error("HTTP options are not correctly set.");const a=[t.baseUrl.endsWith("/")?t.baseUrl.slice(0,-1):t.baseUrl];return t.apiVersion&&t.apiVersion!==""&&a.push(t.apiVersion),a.join("/")}getBaseResourcePath(){return`projects/${this.clientOptions.project}/locations/${this.clientOptions.location}`}getApiKey(){return this.clientOptions.apiKey}getWebsocketBaseUrl(){const t=this.getBaseUrl(),o=new URL(t);return o.protocol=o.protocol=="http:"?"ws":"wss",o.toString()}setBaseUrl(t){if(this.clientOptions.httpOptions)this.clientOptions.httpOptions.baseUrl=t;else throw new Error("HTTP options are not correctly set.")}constructUrl(t,o,a){const u=[this.getRequestUrlInternal(o)];return a&&u.push(this.getBaseResourcePath()),t!==""&&u.push(t),new URL(`${u.join("/")}`)}shouldPrependVertexProjectPath(t,o){return!(o.baseUrl&&o.baseUrlResourceScope===mu.COLLECTION||this.clientOptions.apiKey||!this.clientOptions.vertexai||t.path.startsWith("projects/")||t.httpMethod==="GET"&&t.path.startsWith("publishers/google/models"))}async request(t){let o=this.clientOptions.httpOptions;t.httpOptions&&(o=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const a=this.shouldPrependVertexProjectPath(t,o),u=this.constructUrl(t.path,o,a);if(t.queryParams)for(const[p,g]of Object.entries(t.queryParams))u.searchParams.append(p,String(g));let f={};if(t.httpMethod==="GET"){if(t.body&&t.body!=="{}")throw new Error("Request body should be empty for GET request, but got non empty request body")}else f.body=t.body;return f=await this.includeExtraHttpOptionsToRequestInit(f,o,u.toString(),t.abortSignal),this.unaryApiCall(u,f,t.httpMethod)}patchHttpOptions(t,o){const a=JSON.parse(JSON.stringify(t));for(const[u,f]of Object.entries(o))typeof f=="object"?a[u]=Object.assign(Object.assign({},a[u]),f):f!==void 0&&(a[u]=f);return a}async requestStream(t){let o=this.clientOptions.httpOptions;t.httpOptions&&(o=this.patchHttpOptions(this.clientOptions.httpOptions,t.httpOptions));const a=this.shouldPrependVertexProjectPath(t,o),u=this.constructUrl(t.path,o,a);(!u.searchParams.has("alt")||u.searchParams.get("alt")!=="sse")&&u.searchParams.set("alt","sse");let f={};return f.body=t.body,f=await this.includeExtraHttpOptionsToRequestInit(f,o,u.toString(),t.abortSignal),this.streamApiCall(u,f,t.httpMethod)}async includeExtraHttpOptionsToRequestInit(t,o,a,u){if(o&&o.timeout||u){const f=new AbortController,p=f.signal;if(o.timeout&&(o==null?void 0:o.timeout)>0){const g=setTimeout(()=>f.abort(),o.timeout);g&&typeof g.unref=="function"&&g.unref()}u&&u.addEventListener("abort",()=>{f.abort()}),t.signal=p}return o&&o.extraBody!==null&&xA(t,o.extraBody),t.headers=await this.getHeadersInternal(o,a),t}async unaryApiCall(t,o,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},o),{method:a})).then(async u=>(await Mm(u),new gu(u))).catch(u=>{throw u instanceof Error?u:new Error(JSON.stringify(u))})}async streamApiCall(t,o,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},o),{method:a})).then(async u=>(await Mm(u),this.processStreamResponse(u))).catch(u=>{throw u instanceof Error?u:new Error(JSON.stringify(u))})}processStreamResponse(t){return Vt(this,arguments,function*(){var a;const u=(a=t==null?void 0:t.body)===null||a===void 0?void 0:a.getReader(),f=new TextDecoder("utf-8");if(!u)throw new Error("Response body is empty");try{let p="";const g="data:",y=[`

`,"\r\r",`\r
\r
`];for(;;){const{done:m,value:v}=yield oe(u.read());if(m){if(p.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const E=f.decode(v,{stream:!0});try{const I=JSON.parse(E);if("error"in I){const L=JSON.parse(JSON.stringify(I.error)),b=L.status,z=L.code,Q=`got status: ${b}. ${JSON.stringify(I)}`;if(z>=400&&z<600)throw new wa({message:Q,status:z})}}catch(I){if(I.name==="ApiError")throw I}p+=E;let _=-1,A=0;for(;;){_=-1,A=0;for(const b of y){const z=p.indexOf(b);z!==-1&&(_===-1||z<_)&&(_=z,A=b.length)}if(_===-1)break;const I=p.substring(0,_);p=p.substring(_+A);const L=I.trim();if(L.startsWith(g)){const b=L.substring(g.length).trim();try{const z=new Response(b,{headers:t==null?void 0:t.headers,status:t==null?void 0:t.status,statusText:t==null?void 0:t.statusText});yield yield oe(new gu(z))}catch(z){throw new Error(`exception parsing stream chunk ${b}. ${z}`)}}}}}finally{u.releaseLock()}})}async apiCall(t,o){var a;if(!this.clientOptions.httpOptions||!this.clientOptions.httpOptions.retryOptions)return fetch(t,o);const u=this.clientOptions.httpOptions.retryOptions;return g0(async()=>{const p=await fetch(t,o);if(p.ok)return p;throw UA.includes(p.status)?new Error(`Retryable HTTP Error: ${p.statusText}`):new Vm.AbortError(`Non-retryable exception ${p.statusText} sending request`)},{retries:((a=u.attempts)!==null&&a!==void 0?a:DA)-1})}getDefaultHeaders(){const t={},o=MA+" "+this.clientOptions.userAgentExtra;return t[CA]=o,t[_u]=o,t[SA]="application/json",t}async getHeadersInternal(t,o){const a=new Headers;if(t&&t.headers){for(const[u,f]of Object.entries(t.headers))a.append(u,f);t.timeout&&t.timeout>0&&a.append(AA,String(Math.ceil(t.timeout/1e3)))}return await this.clientOptions.auth.addAuthHeaders(a,o),a}getFileName(t){var o;let a="";return typeof t=="string"&&(a=t.replace(/[/\\]+$/,""),a=(o=a.split(/[/\\]/).pop())!==null&&o!==void 0?o:""),a}async uploadFile(t,o){var a;const u={};o!=null&&(u.mimeType=o.mimeType,u.name=o.name,u.displayName=o.displayName),u.name&&!u.name.startsWith("files/")&&(u.name=`files/${u.name}`);const f=this.clientOptions.uploader,p=await f.stat(t);u.sizeBytes=String(p.size);const g=(a=o==null?void 0:o.mimeType)!==null&&a!==void 0?a:p.type;if(g===void 0||g==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");u.mimeType=g;const y={file:u},m=this.getFileName(t),v=Y("upload/v1beta/files",y._url),E=await this.fetchUploadUrl(v,u.sizeBytes,u.mimeType,m,y,o==null?void 0:o.httpOptions);return f.upload(t,E,this)}async uploadFileToFileSearchStore(t,o,a){var u;const f=this.clientOptions.uploader,p=await f.stat(o),g=String(p.size),y=(u=a==null?void 0:a.mimeType)!==null&&u!==void 0?u:p.type;if(y===void 0||y==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const m=`upload/v1beta/${t}:uploadToFileSearchStore`,v=this.getFileName(o),E={};a!=null&&sg(a,E);const _=await this.fetchUploadUrl(m,g,y,v,E,a==null?void 0:a.httpOptions);return f.uploadToFileSearchStore(o,_,this)}async downloadFile(t){await this.clientOptions.downloader.download(t,this)}async fetchUploadUrl(t,o,a,u,f,p){var g;let y={};p?y=p:y={apiVersion:"",headers:Object.assign({"Content-Type":"application/json","X-Goog-Upload-Protocol":"resumable","X-Goog-Upload-Command":"start","X-Goog-Upload-Header-Content-Length":`${o}`,"X-Goog-Upload-Header-Content-Type":`${a}`},u?{"X-Goog-Upload-File-Name":u}:{})};const m=await this.request({path:t,body:JSON.stringify(f),httpMethod:"POST",httpOptions:y});if(!m||!(m!=null&&m.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const v=(g=m==null?void 0:m.headers)===null||g===void 0?void 0:g["x-goog-upload-url"];if(v===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return v}}async function Mm(i){var t;if(i===void 0)throw new Error("response is undefined");if(!i.ok){const o=i.status;let a;!((t=i.headers.get("content-type"))===null||t===void 0)&&t.includes("application/json")?a=await i.json():a={error:{message:await i.text(),code:i.status,status:i.statusText}};const u=JSON.stringify(a);throw o>=400&&o<600?new wa({message:u,status:o}):new Error(u)}}function xA(i,t){if(!t||Object.keys(t).length===0)return;if(i.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 i.body=="string"&&i.body.length>0)try{const f=JSON.parse(i.body);if(typeof f=="object"&&f!==null&&!Array.isArray(f))o=f;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 a(f,p){const g=Object.assign({},f);for(const y in p)if(Object.prototype.hasOwnProperty.call(p,y)){const m=p[y],v=g[y];m&&typeof m=="object"&&!Array.isArray(m)&&v&&typeof v=="object"&&!Array.isArray(v)?g[y]=a(v,m):(v&&m&&typeof v!=typeof m&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${y}". Original type: ${typeof v}, New type: ${typeof m}. Overwriting.`),g[y]=m)}return g}const u=a(o,t);i.body=JSON.stringify(u)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const bA="mcp_used/unknown";let GA=!1;function rg(i){for(const t of i)if(LA(t)||typeof t=="object"&&"inputSchema"in t)return!0;return GA}function ug(i){var t;const o=(t=i[_u])!==null&&t!==void 0?t:"";i[_u]=(o+` ${bA}`).trimStart()}function LA(i){return i!==null&&typeof i=="object"&&i instanceof Pu}function HA(i){return Vt(this,arguments,function*(o,a=100){let u,f=0;for(;f<a;){const p=yield oe(o.listTools({cursor:u}));for(const g of p.tools)yield yield oe(g),f++;if(!p.nextCursor)break;u=p.nextCursor}})}class Pu{constructor(t=[],o){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=t,this.config=o}static create(t,o){return new Pu(t,o)}async initialize(){var t,o,a,u;if(this.mcpTools.length>0)return;const f={},p=[];for(const v of this.mcpClients)try{for(var g=!0,y=(o=void 0,Bt(HA(v))),m;m=await y.next(),t=m.done,!t;g=!0){u=m.value,g=!1;const E=u;p.push(E);const _=E.name;if(f[_])throw new Error(`Duplicate function name ${_} found in MCP tools. Please ensure function names are unique.`);f[_]=v}}catch(E){o={error:E}}finally{try{!g&&!t&&(a=y.return)&&await a.call(y)}finally{if(o)throw o.error}}this.mcpTools=p,this.functionNameToMcpClient=f}async tool(){return await this.initialize(),oT(this.mcpTools,this.config)}async callTool(t){await this.initialize();const o=[];for(const a of t)if(a.name in this.functionNameToMcpClient){const u=this.functionNameToMcpClient[a.name];let f;this.config.timeout&&(f={timeout:this.config.timeout});const p=await u.callTool({name:a.name,arguments:a.args},void 0,f);o.push({functionResponse:{name:a.name,response:p.isError?{error:p}:p}})}return o}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function PA(i,t,o){const a=new Z0;let u;o.data instanceof Blob?u=JSON.parse(await o.data.text()):u=JSON.parse(o.data),Object.assign(a,u),t(a)}class qA{constructor(t,o,a){this.apiClient=t,this.auth=o,this.webSocketFactory=a}async connect(t){var o,a;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 u=this.apiClient.getWebsocketBaseUrl(),f=this.apiClient.getApiVersion(),p=zA(this.apiClient.getDefaultHeaders()),g=this.apiClient.getApiKey(),y=`${u}/ws/google.ai.generativelanguage.${f}.GenerativeService.BidiGenerateMusic?key=${g}`;let m=()=>{};const v=new Promise(O=>{m=O}),E=t.callbacks,_=function(){m({})},A=this.apiClient,I={onopen:_,onmessage:O=>{PA(A,E.onmessage,O)},onerror:(o=E==null?void 0:E.onerror)!==null&&o!==void 0?o:function(O){},onclose:(a=E==null?void 0:E.onclose)!==null&&a!==void 0?a:function(O){}},L=this.webSocketFactory.create(y,BA(p),I);L.connect(),await v;const Q={setup:{model:Te(this.apiClient,t.model)}};return L.send(JSON.stringify(Q)),new VA(L,this.apiClient)}}class VA{constructor(t,o){this.conn=t,this.apiClient=o}async setWeightedPrompts(t){if(!t.weightedPrompts||Object.keys(t.weightedPrompts).length===0)throw new Error("Weighted prompts must be set and contain at least one entry.");const o=s_(t);this.conn.send(JSON.stringify({clientContent:o}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const o=a_(t);this.conn.send(JSON.stringify(o))}sendPlaybackControl(t){const o={playbackControl:t};this.conn.send(JSON.stringify(o))}play(){this.sendPlaybackControl(Yi.PLAY)}pause(){this.sendPlaybackControl(Yi.PAUSE)}stop(){this.sendPlaybackControl(Yi.STOP)}resetContext(){this.sendPlaybackControl(Yi.RESET_CONTEXT)}close(){this.conn.close()}}function BA(i){const t={};return i.forEach((o,a)=>{t[a]=o}),t}function zA(i){const t=new Headers;for(const[o,a]of Object.entries(i))t.append(o,a);return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const OA="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function FA(i,t,o){const a=new X0;let u;o.data instanceof Blob?u=await o.data.text():o.data instanceof ArrayBuffer?u=new TextDecoder().decode(o.data):u=o.data;const f=JSON.parse(u);if(i.isVertexAI()){const p=c_(f);Object.assign(a,p)}else Object.assign(a,f);t(a)}class kA{constructor(t,o,a){this.apiClient=t,this.auth=o,this.webSocketFactory=a,this.music=new qA(this.apiClient,this.auth,this.webSocketFactory)}async connect(t){var o,a,u,f,p,g;if(t.config&&t.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 y=this.apiClient.getWebsocketBaseUrl(),m=this.apiClient.getApiVersion();let v;const E=this.apiClient.getHeaders();t.config&&t.config.tools&&rg(t.config.tools)&&ug(E);const _=QA(E);if(this.apiClient.isVertexAI()){const Z=this.apiClient.getProject(),re=this.apiClient.getLocation(),Ee=this.apiClient.getApiKey(),Me=!!Z&&!!re||!!Ee;this.apiClient.getCustomBaseUrl()&&!Me?v=y:(v=`${y}/ws/google.cloud.aiplatform.${m}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(_,v))}else{const Z=this.apiClient.getApiKey();let re="BidiGenerateContent",Ee="key";Z!=null&&Z.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),m!=="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",Ee="access_token"),v=`${y}/ws/google.ai.generativelanguage.${m}.GenerativeService.${re}?${Ee}=${Z}`}let A=()=>{};const I=new Promise(Z=>{A=Z}),L=t.callbacks,b=function(){var Z;(Z=L==null?void 0:L.onopen)===null||Z===void 0||Z.call(L),A({})},z=this.apiClient,Q={onopen:b,onmessage:Z=>{FA(z,L.onmessage,Z)},onerror:(o=L==null?void 0:L.onerror)!==null&&o!==void 0?o:function(Z){},onclose:(a=L==null?void 0:L.onclose)!==null&&a!==void 0?a:function(Z){}},O=this.webSocketFactory.create(v,KA(_),Q);O.connect(),await I;let k=Te(this.apiClient,t.model);if(this.apiClient.isVertexAI()&&k.startsWith("publishers/")){const Z=this.apiClient.getProject(),re=this.apiClient.getLocation();Z&&re&&(k=`projects/${Z}/locations/${re}/`+k)}let j={};this.apiClient.isVertexAI()&&((u=t.config)===null||u===void 0?void 0:u.responseModalities)===void 0&&(t.config===void 0?t.config={responseModalities:[Ca.AUDIO]}:t.config.responseModalities=[Ca.AUDIO]),!((f=t.config)===null||f===void 0)&&f.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 B=(g=(p=t.config)===null||p===void 0?void 0:p.tools)!==null&&g!==void 0?g:[],J=[];for(const Z of B)if(this.isCallableTool(Z)){const re=Z;J.push(await re.tool())}else J.push(Z);J.length>0&&(t.config.tools=J);const ue={model:k,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?j=l_(this.apiClient,ue):j=o_(this.apiClient,ue),delete j.config,O.send(JSON.stringify(j)),new YA(O,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const JA={turnComplete:!0};class YA{constructor(t,o){this.conn=t,this.apiClient=o}tLiveClientContent(t,o){if(o.turns!==null&&o.turns!==void 0){let a=[];try{a=Ct(o.turns),t.isVertexAI()||(a=a.map(u=>jo(u)))}catch{throw new Error(`Failed to parse client content "turns", type: '${typeof o.turns}'`)}return{clientContent:{turns:a,turnComplete:o.turnComplete}}}return{clientContent:{turnComplete:o.turnComplete}}}tLiveClienttToolResponse(t,o){let a=[];if(o.functionResponses==null)throw new Error("functionResponses is required.");if(Array.isArray(o.functionResponses)?a=o.functionResponses:a=[o.functionResponses],a.length===0)throw new Error("functionResponses is required.");for(const f of a){if(typeof f!="object"||f===null||!("name"in f)||!("response"in f))throw new Error(`Could not parse function response, type '${typeof f}'.`);if(!t.isVertexAI()&&!("id"in f))throw new Error(OA)}return{toolResponse:{functionResponses:a}}}sendClientContent(t){t=Object.assign(Object.assign({},JA),t);const o=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(o))}sendRealtimeInput(t){let o={};this.apiClient.isVertexAI()?o={realtimeInput:u_(t)}:o={realtimeInput:r_(t)},this.conn.send(JSON.stringify(o))}sendToolResponse(t){if(t.functionResponses==null)throw new Error("Tool response parameters are required.");const o=this.tLiveClienttToolResponse(this.apiClient,t);this.conn.send(JSON.stringify(o))}close(){this.conn.close()}}function KA(i){const t={};return i.forEach((o,a)=>{t[a]=o}),t}function QA(i){const t=new Headers;for(const[o,a]of Object.entries(i))t.append(o,a);return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Nm=10;function Im(i){var t,o,a;if(!((t=i==null?void 0:i.automaticFunctionCalling)===null||t===void 0)&&t.disable)return!0;let u=!1;for(const p of(o=i==null?void 0:i.tools)!==null&&o!==void 0?o:[])if(Xi(p)){u=!0;break}if(!u)return!0;const f=(a=i==null?void 0:i.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls;return f&&(f<0||!Number.isInteger(f))||f==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:",f),!0):!1}function Xi(i){return"callTool"in i&&typeof i.callTool=="function"}function XA(i){var t,o,a;return(a=(o=(t=i.config)===null||t===void 0?void 0:t.tools)===null||o===void 0?void 0:o.some(u=>Xi(u)))!==null&&a!==void 0?a:!1}function Dm(i){var t;const o=[];return!((t=i==null?void 0:i.config)===null||t===void 0)&&t.tools&&i.config.tools.forEach((a,u)=>{if(Xi(a))return;const f=a;f.functionDeclarations&&f.functionDeclarations.length>0&&o.push(u)}),o}function Um(i){var t;return!(!((t=i==null?void 0:i.automaticFunctionCalling)===null||t===void 0)&&t.ignoreCallHistory)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ZA extends dn{constructor(t){super(),this.apiClient=t,this.embedContent=async o=>{if(!this.apiClient.isVertexAI())return await this.embedContentInternal(o);if(o.model.includes("gemini")&&o.model!=="gemini-embedding-001"||o.model.includes("maas")){const u=Ct(o.contents);if(u.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");const f=Object.assign(Object.assign({},o),{content:u[0],embeddingApiType:Ra.EMBED_CONTENT});return await this.embedContentInternal(f)}else{const u=Object.assign(Object.assign({},o),{embeddingApiType:Ra.PREDICT});return await this.embedContentInternal(u)}},this.generateContent=async o=>{var a,u,f,p,g;const y=await this.processParamsMaybeAddMcpUsage(o);if(this.maybeMoveToResponseJsonSchem(o),!XA(o)||Im(o.config))return await this.generateContentInternal(y);const m=Dm(o);if(m.length>0){const L=m.map(b=>`tools[${b}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${L}.`)}let v,E;const _=Ct(y.contents),A=(f=(u=(a=y.config)===null||a===void 0?void 0:a.automaticFunctionCalling)===null||u===void 0?void 0:u.maximumRemoteCalls)!==null&&f!==void 0?f:Nm;let I=0;for(;I<A&&(v=await this.generateContentInternal(y),!(!v.functionCalls||v.functionCalls.length===0));){const L=v.candidates[0].content,b=[];for(const z of(g=(p=o.config)===null||p===void 0?void 0:p.tools)!==null&&g!==void 0?g:[])if(Xi(z)){const O=await z.callTool(v.functionCalls);b.push(...O)}I++,E={role:"user",parts:b},y.contents=Ct(y.contents),y.contents.push(L),y.contents.push(E),Um(y.config)&&(_.push(L),_.push(E))}return Um(y.config)&&(v.automaticFunctionCallingHistory=_),v},this.generateContentStream=async o=>{var a,u,f,p,g;if(this.maybeMoveToResponseJsonSchem(o),Im(o.config)){const E=await this.processParamsMaybeAddMcpUsage(o);return await this.generateContentStreamInternal(E)}const y=Dm(o);if(y.length>0){const E=y.map(_=>`tools[${_}]`).join(", ");throw new Error(`Incompatible tools found at ${E}. Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations" is not yet supported.`)}const m=(f=(u=(a=o==null?void 0:o.config)===null||a===void 0?void 0:a.toolConfig)===null||u===void 0?void 0:u.functionCallingConfig)===null||f===void 0?void 0:f.streamFunctionCallArguments,v=(g=(p=o==null?void 0:o.config)===null||p===void 0?void 0:p.automaticFunctionCalling)===null||g===void 0?void 0:g.disable;if(m&&!v)throw new Error("Running in streaming mode with 'streamFunctionCallArguments' enabled, this feature is not compatible with automatic function calling (AFC). Please set 'config.automaticFunctionCalling.disable' to true to disable AFC or leave 'config.toolConfig.functionCallingConfig.streamFunctionCallArguments' to be undefined or set to false to disable streaming function call arguments feature.");return await this.processAfcStream(o)},this.generateImages=async o=>await this.generateImagesInternal(o).then(a=>{var u;let f;const p=[];if(a!=null&&a.generatedImages)for(const y of a.generatedImages)y&&(y!=null&&y.safetyAttributes)&&((u=y==null?void 0:y.safetyAttributes)===null||u===void 0?void 0:u.contentType)==="Positive Prompt"?f=y==null?void 0:y.safetyAttributes:p.push(y);let g;return f?g={generatedImages:p,positivePromptSafetyAttributes:f,sdkHttpResponse:a.sdkHttpResponse}:g={generatedImages:p,sdkHttpResponse:a.sdkHttpResponse},g}),this.list=async o=>{var a;const p={config:Object.assign(Object.assign({},{queryBase:!0}),o==null?void 0:o.config)};if(this.apiClient.isVertexAI()&&!p.config.queryBase){if(!((a=p.config)===null||a===void 0)&&a.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");p.config.filter="labels.tune-type:*"}return new si(fn.PAGED_ITEM_MODELS,g=>this.listInternal(g),await this.listInternal(p),p)},this.editImage=async o=>{const a={model:o.model,prompt:o.prompt,referenceImages:[],config:o.config};return o.referenceImages&&o.referenceImages&&(a.referenceImages=o.referenceImages.map(u=>u.toReferenceImageAPI())),await this.editImageInternal(a)},this.upscaleImage=async o=>{let a={numberOfImages:1,mode:"upscale"};o.config&&(a=Object.assign(Object.assign({},a),o.config));const u={model:o.model,image:o.image,upscaleFactor:o.upscaleFactor,config:a};return await this.upscaleImageInternal(u)},this.generateVideos=async o=>{var a,u,f,p,g,y;if((o.prompt||o.image||o.video)&&o.source)throw new Error("Source and prompt/image/video are mutually exclusive. Please only use source.");return this.apiClient.isVertexAI()||(!((a=o.video)===null||a===void 0)&&a.uri&&(!((u=o.video)===null||u===void 0)&&u.videoBytes)?o.video={uri:o.video.uri,mimeType:o.video.mimeType}:!((p=(f=o.source)===null||f===void 0?void 0:f.video)===null||p===void 0)&&p.uri&&(!((y=(g=o.source)===null||g===void 0?void 0:g.video)===null||y===void 0)&&y.videoBytes)&&(o.source.video={uri:o.source.video.uri,mimeType:o.source.video.mimeType})),await this.generateVideosInternal(o)}}maybeMoveToResponseJsonSchem(t){t.config&&t.config.responseSchema&&(t.config.responseJsonSchema||Object.keys(t.config.responseSchema).includes("$schema")&&(t.config.responseJsonSchema=t.config.responseSchema,delete t.config.responseSchema))}async processParamsMaybeAddMcpUsage(t){var o,a,u;const f=(o=t.config)===null||o===void 0?void 0:o.tools;if(!f)return t;const p=await Promise.all(f.map(async y=>Xi(y)?await y.tool():y)),g={model:t.model,contents:t.contents,config:Object.assign(Object.assign({},t.config),{tools:p})};if(g.config.tools=p,t.config&&t.config.tools&&rg(t.config.tools)){const y=(u=(a=t.config.httpOptions)===null||a===void 0?void 0:a.headers)!==null&&u!==void 0?u:{};let m=Object.assign({},y);Object.keys(m).length===0&&(m=this.apiClient.getDefaultHeaders()),ug(m),g.config.httpOptions=Object.assign(Object.assign({},t.config.httpOptions),{headers:m})}return g}async initAfcToolsMap(t){var o,a,u;const f=new Map;for(const p of(a=(o=t.config)===null||o===void 0?void 0:o.tools)!==null&&a!==void 0?a:[])if(Xi(p)){const g=p,y=await g.tool();for(const m of(u=y.functionDeclarations)!==null&&u!==void 0?u:[]){if(!m.name)throw new Error("Function declaration name is required.");if(f.has(m.name))throw new Error(`Duplicate tool declaration name: ${m.name}`);f.set(m.name,g)}}return f}async processAfcStream(t){var o,a,u;const f=(u=(a=(o=t.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls)!==null&&u!==void 0?u:Nm;let p=!1,g=0;const y=await this.initAfcToolsMap(t);return(function(m,v,E){return Vt(this,arguments,function*(){for(var _,A,I,L,b,z;g<f;){p&&(g++,p=!1);const j=yield oe(m.processParamsMaybeAddMcpUsage(E)),B=yield oe(m.generateContentStreamInternal(j)),J=[],ue=[];try{for(var Q=!0,O=(A=void 0,Bt(B)),k;k=yield oe(O.next()),_=k.done,!_;Q=!0){L=k.value,Q=!1;const Z=L;if(yield yield oe(Z),Z.candidates&&(!((b=Z.candidates[0])===null||b===void 0)&&b.content)){ue.push(Z.candidates[0].content);for(const re of(z=Z.candidates[0].content.parts)!==null&&z!==void 0?z:[])if(g<f&&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 Ee=yield oe(v.get(re.functionCall.name).callTool([re.functionCall]));J.push(...Ee)}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(Z){A={error:Z}}finally{try{!Q&&!_&&(I=O.return)&&(yield oe(I.call(O)))}finally{if(A)throw A.error}}if(J.length>0){p=!0;const Z=new Zo;Z.candidates=[{content:{role:"user",parts:J}}],yield yield oe(Z);const re=[];re.push(...ue),re.push({role:"user",parts:J});const Ee=Ct(E.contents).concat(re);E.contents=Ee}else break}})})(this,y,t)}async generateContentInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=Am(this.apiClient,t);return g=Y("{model}:generateContent",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=Rm(v),_=new Zo;return Object.assign(_,E),_})}else{const m=Sm(this.apiClient,t);return g=Y("{model}:generateContent",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=Cm(v),_=new Zo;return Object.assign(_,E),_})}}async generateContentStreamInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=Am(this.apiClient,t);return g=Y("{model}:streamGenerateContent?alt=sse",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.requestStream({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}),p.then(function(E){return Vt(this,arguments,function*(){var _,A,I,L;try{for(var b=!0,z=Bt(E),Q;Q=yield oe(z.next()),_=Q.done,!_;b=!0){L=Q.value,b=!1;const O=L,k=Rm(yield oe(O.json()),t);k.sdkHttpResponse={headers:O.headers};const j=new Zo;Object.assign(j,k),yield yield oe(j)}}catch(O){A={error:O}}finally{try{!b&&!_&&(I=z.return)&&(yield oe(I.call(z)))}finally{if(A)throw A.error}}})})}else{const m=Sm(this.apiClient,t);return g=Y("{model}:streamGenerateContent?alt=sse",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.requestStream({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}),p.then(function(E){return Vt(this,arguments,function*(){var _,A,I,L;try{for(var b=!0,z=Bt(E),Q;Q=yield oe(z.next()),_=Q.done,!_;b=!0){L=Q.value,b=!1;const O=L,k=Cm(yield oe(O.json()),t);k.sdkHttpResponse={headers:O.headers};const j=new Zo;Object.assign(j,k),yield yield oe(j)}}catch(O){A={error:O}}finally{try{!b&&!_&&(I=z.return)&&(yield oe(I.call(z)))}finally{if(A)throw A.error}}})})}}async embedContentInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=O_(this.apiClient,t,t),v=aT(t.model)?"{model}:embedContent":"{model}:predict";return g=Y(v,m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(E=>E.json().then(_=>{const A=_;return A.sdkHttpResponse={headers:E.headers},A})),p.then(E=>{const _=k_(E,t),A=new om;return Object.assign(A,_),A})}else{const m=z_(this.apiClient,t);return g=Y("{model}:batchEmbedContents",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=F_(v),_=new om;return Object.assign(_,E),_})}}async generateImagesInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=tS(this.apiClient,t);return g=Y("{model}:predict",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=iS(v),_=new lm;return Object.assign(_,E),_})}else{const m=eS(this.apiClient,t);return g=Y("{model}:predict",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=nS(v),_=new lm;return Object.assign(_,E),_})}}async editImageInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=P_(this.apiClient,t);return f=Y("{model}:predict",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>{const m=q_(y),v=new P0;return Object.assign(v,m),v})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=tA(this.apiClient,t);return f=Y("{model}:predict",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>{const m=nA(y),v=new q0;return Object.assign(v,m),v})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=HS(this.apiClient,t);return f=Y("{model}:predict",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=PS(y),v=new V0;return Object.assign(v,m),v})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=FS(this.apiClient,t);return f=Y("{model}:predict",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=kS(y),v=new B0;return Object.assign(v,m),v})}else throw new Error("This method is only supported by the Vertex AI.")}async get(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=ES(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>Eu(v))}else{const m=TS(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>Tu(v))}}async listInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=DS(this.apiClient,t);return g=Y("{models_url}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=wS(v),_=new am;return Object.assign(_,E),_})}else{const m=IS(this.apiClient,t);return g=Y("{models_url}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=US(v),_=new am;return Object.assign(_,E),_})}}async update(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=jS(this.apiClient,t);return g=Y("{model}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"PATCH",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>Eu(v))}else{const m=WS(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"PATCH",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>Tu(v))}}async delete(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=b_(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=L_(v),_=new sm;return Object.assign(_,E),_})}else{const m=x_(this.apiClient,t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"DELETE",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=G_(v),_=new sm;return Object.assign(_,E),_})}}async countTokens(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=D_(this.apiClient,t);return g=Y("{model}:countTokens",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=w_(v),_=new rm;return Object.assign(_,E),_})}else{const m=I_(this.apiClient,t);return g=Y("{model}:countTokens",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=U_(v),_=new rm;return Object.assign(_,E),_})}}async computeTokens(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=__(this.apiClient,t);return f=Y("{model}:computeTokens",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>{const m=S_(y),v=new z0;return Object.assign(v,m),v})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=uS(this.apiClient,t);return g=Y("{model}:predictLongRunning",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p.then(v=>{const E=sS(v),_=new Ma;return Object.assign(_,E),_})}else{const m=rS(this.apiClient,t);return g=Y("{model}:predictLongRunning",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p.then(v=>{const E=aS(v),_=new Ma;return Object.assign(_,E),_})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class $A extends dn{constructor(t){super(),this.apiClient=t}async getVideosOperation(t){const o=t.operation,a=t.config;if(o.name===void 0||o.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const u=o.name.split("/operations/")[0];let f;a&&"httpOptions"in a&&(f=a.httpOptions);const p=await this.fetchPredictVideosOperationInternal({operationName:o.name,resourceName:u,config:{httpOptions:f}});return o._fromAPIResponse({apiResponse:p,_isVertexAI:!0})}else{const u=await this.getVideosOperationInternal({operationName:o.name,config:a});return o._fromAPIResponse({apiResponse:u,_isVertexAI:!1})}}async get(t){const o=t.operation,a=t.config;if(o.name===void 0||o.name==="")throw new Error("Operation name is required.");if(this.apiClient.isVertexAI()){const u=o.name.split("/operations/")[0];let f;a&&"httpOptions"in a&&(f=a.httpOptions);const p=await this.fetchPredictVideosOperationInternal({operationName:o.name,resourceName:u,config:{httpOptions:f}});return o._fromAPIResponse({apiResponse:p,_isVertexAI:!0})}else{const u=await this.getVideosOperationInternal({operationName:o.name,config:a});return o._fromAPIResponse({apiResponse:u,_isVertexAI:!1})}}async getVideosOperationInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=w0(t);return g=Y("{operationName}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json()),p}else{const m=U0(t);return g=Y("{operationName}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json()),p}}async fetchPredictVideosOperationInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=A0(t);return f=Y("{resourceName}:fetchPredictOperation",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u}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 wm(i){const t={};if(r(i,["languageCodes"])!==void 0)throw new Error("languageCodes parameter is not supported in Gemini API.");return t}function WA(i){const t={},o=r(i,["apiKey"]);if(o!=null&&c(t,["apiKey"],o),r(i,["apiKeyConfig"])!==void 0)throw new Error("apiKeyConfig parameter is not supported in Gemini API.");if(r(i,["authType"])!==void 0)throw new Error("authType parameter is not supported in Gemini API.");if(r(i,["googleServiceAccountConfig"])!==void 0)throw new Error("googleServiceAccountConfig parameter is not supported in Gemini API.");if(r(i,["httpBasicAuthConfig"])!==void 0)throw new Error("httpBasicAuthConfig parameter is not supported in Gemini API.");if(r(i,["oauthConfig"])!==void 0)throw new Error("oauthConfig parameter is not supported in Gemini API.");if(r(i,["oidcConfig"])!==void 0)throw new Error("oidcConfig parameter is not supported in Gemini API.");return t}function jA(i){const t={},o=r(i,["data"]);if(o!=null&&c(t,["data"],o),r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function eC(i){const t={},o=r(i,["parts"]);if(o!=null){let u=o;Array.isArray(u)&&(u=u.map(f=>uC(f))),c(t,["parts"],u)}const a=r(i,["role"]);return a!=null&&c(t,["role"],a),t}function tC(i,t,o){const a={},u=r(t,["expireTime"]);o!==void 0&&u!=null&&c(o,["expireTime"],u);const f=r(t,["newSessionExpireTime"]);o!==void 0&&f!=null&&c(o,["newSessionExpireTime"],f);const p=r(t,["uses"]);o!==void 0&&p!=null&&c(o,["uses"],p);const g=r(t,["liveConnectConstraints"]);o!==void 0&&g!=null&&c(o,["bidiGenerateContentSetup"],rC(i,g));const y=r(t,["lockAdditionalFields"]);return o!==void 0&&y!=null&&c(o,["fieldMask"],y),a}function nC(i,t){const o={},a=r(t,["config"]);return a!=null&&c(o,["config"],tC(i,a,o)),o}function iC(i){const t={};if(r(i,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=r(i,["fileUri"]);o!=null&&c(t,["fileUri"],o);const a=r(i,["mimeType"]);return a!=null&&c(t,["mimeType"],a),t}function oC(i){const t={},o=r(i,["id"]);o!=null&&c(t,["id"],o);const a=r(i,["args"]);a!=null&&c(t,["args"],a);const u=r(i,["name"]);if(u!=null&&c(t,["name"],u),r(i,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(r(i,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function lC(i){const t={},o=r(i,["authConfig"]);o!=null&&c(t,["authConfig"],WA(o));const a=r(i,["enableWidget"]);return a!=null&&c(t,["enableWidget"],a),t}function aC(i){const t={},o=r(i,["searchTypes"]);if(o!=null&&c(t,["searchTypes"],o),r(i,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");if(r(i,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");const a=r(i,["timeRangeFilter"]);return a!=null&&c(t,["timeRangeFilter"],a),t}function sC(i,t){const o={},a=r(i,["generationConfig"]);t!==void 0&&a!=null&&c(t,["setup","generationConfig"],a);const u=r(i,["responseModalities"]);t!==void 0&&u!=null&&c(t,["setup","generationConfig","responseModalities"],u);const f=r(i,["temperature"]);t!==void 0&&f!=null&&c(t,["setup","generationConfig","temperature"],f);const p=r(i,["topP"]);t!==void 0&&p!=null&&c(t,["setup","generationConfig","topP"],p);const g=r(i,["topK"]);t!==void 0&&g!=null&&c(t,["setup","generationConfig","topK"],g);const y=r(i,["maxOutputTokens"]);t!==void 0&&y!=null&&c(t,["setup","generationConfig","maxOutputTokens"],y);const m=r(i,["mediaResolution"]);t!==void 0&&m!=null&&c(t,["setup","generationConfig","mediaResolution"],m);const v=r(i,["seed"]);t!==void 0&&v!=null&&c(t,["setup","generationConfig","seed"],v);const E=r(i,["speechConfig"]);t!==void 0&&E!=null&&c(t,["setup","generationConfig","speechConfig"],Hu(E));const _=r(i,["thinkingConfig"]);t!==void 0&&_!=null&&c(t,["setup","generationConfig","thinkingConfig"],_);const A=r(i,["enableAffectiveDialog"]);t!==void 0&&A!=null&&c(t,["setup","generationConfig","enableAffectiveDialog"],A);const I=r(i,["systemInstruction"]);t!==void 0&&I!=null&&c(t,["setup","systemInstruction"],eC(Xe(I)));const L=r(i,["tools"]);if(t!==void 0&&L!=null){let B=$i(L);Array.isArray(B)&&(B=B.map(J=>fC(Zi(J)))),c(t,["setup","tools"],B)}const b=r(i,["sessionResumption"]);t!==void 0&&b!=null&&c(t,["setup","sessionResumption"],cC(b));const z=r(i,["inputAudioTranscription"]);t!==void 0&&z!=null&&c(t,["setup","inputAudioTranscription"],wm(z));const Q=r(i,["outputAudioTranscription"]);t!==void 0&&Q!=null&&c(t,["setup","outputAudioTranscription"],wm(Q));const O=r(i,["realtimeInputConfig"]);t!==void 0&&O!=null&&c(t,["setup","realtimeInputConfig"],O);const k=r(i,["contextWindowCompression"]);t!==void 0&&k!=null&&c(t,["setup","contextWindowCompression"],k);const j=r(i,["proactivity"]);if(t!==void 0&&j!=null&&c(t,["setup","proactivity"],j),r(i,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return o}function rC(i,t){const o={},a=r(t,["model"]);a!=null&&c(o,["setup","model"],Te(i,a));const u=r(t,["config"]);return u!=null&&c(o,["config"],sC(u,o)),o}function uC(i){const t={},o=r(i,["mediaResolution"]);o!=null&&c(t,["mediaResolution"],o);const a=r(i,["codeExecutionResult"]);a!=null&&c(t,["codeExecutionResult"],a);const u=r(i,["executableCode"]);u!=null&&c(t,["executableCode"],u);const f=r(i,["fileData"]);f!=null&&c(t,["fileData"],iC(f));const p=r(i,["functionCall"]);p!=null&&c(t,["functionCall"],oC(p));const g=r(i,["functionResponse"]);g!=null&&c(t,["functionResponse"],g);const y=r(i,["inlineData"]);y!=null&&c(t,["inlineData"],jA(y));const m=r(i,["text"]);m!=null&&c(t,["text"],m);const v=r(i,["thought"]);v!=null&&c(t,["thought"],v);const E=r(i,["thoughtSignature"]);E!=null&&c(t,["thoughtSignature"],E);const _=r(i,["videoMetadata"]);return _!=null&&c(t,["videoMetadata"],_),t}function cC(i){const t={},o=r(i,["handle"]);if(o!=null&&c(t,["handle"],o),r(i,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function fC(i){const t={};if(r(i,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=r(i,["computerUse"]);o!=null&&c(t,["computerUse"],o);const a=r(i,["fileSearch"]);a!=null&&c(t,["fileSearch"],a);const u=r(i,["googleSearch"]);u!=null&&c(t,["googleSearch"],aC(u));const f=r(i,["googleMaps"]);f!=null&&c(t,["googleMaps"],lC(f));const p=r(i,["codeExecution"]);if(p!=null&&c(t,["codeExecution"],p),r(i,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const g=r(i,["functionDeclarations"]);if(g!=null){let E=g;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["functionDeclarations"],E)}const y=r(i,["googleSearchRetrieval"]);if(y!=null&&c(t,["googleSearchRetrieval"],y),r(i,["parallelAiSearch"])!==void 0)throw new Error("parallelAiSearch parameter is not supported in Gemini API.");const m=r(i,["urlContext"]);m!=null&&c(t,["urlContext"],m);const v=r(i,["mcpServers"]);if(v!=null){let E=v;Array.isArray(E)&&(E=E.map(_=>_)),c(t,["mcpServers"],E)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function dC(i){const t=[];for(const o in i)if(Object.prototype.hasOwnProperty.call(i,o)){const a=i[o];if(typeof a=="object"&&a!=null&&Object.keys(a).length>0){const u=Object.keys(a).map(f=>`${o}.${f}`);t.push(...u)}else t.push(o)}return t.join(",")}function pC(i,t){let o=null;const a=i.bidiGenerateContentSetup;if(typeof a=="object"&&a!==null&&"setup"in a){const f=a.setup;typeof f=="object"&&f!==null?(i.bidiGenerateContentSetup=f,o=f):delete i.bidiGenerateContentSetup}else a!==void 0&&delete i.bidiGenerateContentSetup;const u=i.fieldMask;if(o){const f=dC(o);if(Array.isArray(t==null?void 0:t.lockAdditionalFields)&&(t==null?void 0:t.lockAdditionalFields.length)===0)f?i.fieldMask=f:delete i.fieldMask;else if(t!=null&&t.lockAdditionalFields&&t.lockAdditionalFields.length>0&&u!==null&&Array.isArray(u)&&u.length>0){const p=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let g=[];u.length>0&&(g=u.map(m=>p.includes(m)?`generationConfig.${m}`:m));const y=[];f&&y.push(f),g.length>0&&y.push(...g),y.length>0?i.fieldMask=y.join(","):delete i.fieldMask}else delete i.fieldMask}else u!==null&&Array.isArray(u)&&u.length>0?i.fieldMask=u.join(","):delete i.fieldMask;return i}class hC extends dn{constructor(t){super(),this.apiClient=t}async create(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const g=nC(this.apiClient,t);f=Y("auth_tokens",g._url),p=g._query,delete g.config,delete g._url,delete g._query;const y=pC(g,t.config);return u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(m=>m.json()),u.then(m=>m)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function mC(i,t){const o={},a=r(i,["force"]);return t!==void 0&&a!=null&&c(t,["_query","force"],a),o}function gC(i){const t={},o=r(i,["name"]);o!=null&&c(t,["_url","name"],o);const a=r(i,["config"]);return a!=null&&mC(a,t),t}function yC(i){const t={},o=r(i,["name"]);return o!=null&&c(t,["_url","name"],o),t}function vC(i,t){const o={},a=r(i,["pageSize"]);t!==void 0&&a!=null&&c(t,["_query","pageSize"],a);const u=r(i,["pageToken"]);return t!==void 0&&u!=null&&c(t,["_query","pageToken"],u),o}function TC(i){const t={},o=r(i,["parent"]);o!=null&&c(t,["_url","parent"],o);const a=r(i,["config"]);return a!=null&&vC(a,t),t}function EC(i){const t={},o=r(i,["sdkHttpResponse"]);o!=null&&c(t,["sdkHttpResponse"],o);const a=r(i,["nextPageToken"]);a!=null&&c(t,["nextPageToken"],a);const u=r(i,["documents"]);if(u!=null){let f=u;Array.isArray(f)&&(f=f.map(p=>p)),c(t,["documents"],f)}return t}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class _C extends dn{constructor(t){super(),this.apiClient=t,this.list=async o=>new si(fn.PAGED_ITEM_DOCUMENTS,a=>this.listInternal({parent:o.parent,config:a.config}),await this.listInternal(o),o)}async get(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=yC(t);return f=Y("{name}",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>y)}}async delete(t){var o,a;let u="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const p=gC(t);u=Y("{name}",p._url),f=p._query,delete p._url,delete p._query,await this.apiClient.request({path:u,queryParams:f,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}}async listInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=TC(t);return f=Y("{parent}/documents",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=EC(y),v=new O0;return Object.assign(v,m),v})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class SC extends dn{constructor(t,o=new _C(t)){super(),this.apiClient=t,this.documents=o,this.list=async(a={})=>new si(fn.PAGED_ITEM_FILE_SEARCH_STORES,u=>this.listInternal(u),await this.listInternal(a),a)}async uploadToFileSearchStore(t){if(this.apiClient.isVertexAI())throw new Error("Vertex AI does not support uploading files to a file search store.");return this.apiClient.uploadFileToFileSearchStore(t.fileSearchStoreName,t.file,t.config)}async create(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=uA(t);return f=Y("fileSearchStores",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>y)}}async get(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=dA(t);return f=Y("{name}",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>y)}}async delete(t){var o,a;let u="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const p=fA(t);u=Y("{name}",p._url),f=p._query,delete p._url,delete p._query,await this.apiClient.request({path:u,queryParams:f,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal})}}async listInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=vA(t);return f=Y("fileSearchStores",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=TA(y),v=new F0;return Object.assign(v,m),v})}}async uploadToFileSearchStoreInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=EA(t);return f=Y("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=_A(y),v=new k0;return Object.assign(v,m),v})}}async importFile(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=mA(t);return f=Y("{file_search_store_name}:importFile",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json()),u.then(y=>{const m=hA(y),v=new wu;return Object.assign(v,m),v})}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */let cg=function(){const{crypto:i}=globalThis;if(i!=null&&i.randomUUID)return cg=i.randomUUID.bind(i),i.randomUUID();const t=new Uint8Array(1),o=i?()=>i.getRandomValues(t)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,a=>(+a^o()&15>>+a/4).toString(16))};const AC=()=>cg();/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Su(i){return typeof i=="object"&&i!==null&&("name"in i&&i.name==="AbortError"||"message"in i&&String(i.message).includes("FetchRequestCanceledException"))}const Au=i=>{if(i instanceof Error)return i;if(typeof i=="object"&&i!==null){try{if(Object.prototype.toString.call(i)==="[object Error]"){const t=new Error(i.message,i.cause?{cause:i.cause}:{});return i.stack&&(t.stack=i.stack),i.cause&&!t.cause&&(t.cause=i.cause),i.name&&(t.name=i.name),t}}catch{}try{return new Error(JSON.stringify(i))}catch{}}return new Error(i)};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Lt extends Error{}class at extends Lt{constructor(t,o,a,u){super(`${at.makeMessage(t,o,a)}`),this.status=t,this.headers=u,this.error=o}static makeMessage(t,o,a){const u=o!=null&&o.message?typeof o.message=="string"?o.message:JSON.stringify(o.message):o?JSON.stringify(o):a;return t&&u?`${t} ${u}`:t?`${t} status code (no body)`:u||"(no status code or body)"}static generate(t,o,a,u){if(!t||!u)return new Ga({message:a,cause:Au(o)});const f=o;return t===400?new dg(t,f,a,u):t===401?new pg(t,f,a,u):t===403?new hg(t,f,a,u):t===404?new mg(t,f,a,u):t===409?new gg(t,f,a,u):t===422?new yg(t,f,a,u):t===429?new vg(t,f,a,u):t>=500?new Tg(t,f,a,u):new at(t,f,a,u)}}class Cu extends at{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class Ga extends at{constructor({message:t,cause:o}){super(void 0,void 0,t||"Connection error.",void 0),o&&(this.cause=o)}}class fg extends Ga{constructor({message:t}={}){super({message:t??"Request timed out."})}}class dg extends at{}class pg extends at{}class hg extends at{}class mg extends at{}class gg extends at{}class yg extends at{}class vg extends at{}class Tg extends at{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const CC=/^[a-z][a-z0-9+.-]*:/i,RC=i=>CC.test(i);let Ru=i=>(Ru=Array.isArray,Ru(i));const MC=Ru;let NC=MC;const xm=NC;function bm(i){if(!i)return!0;for(const t in i)return!1;return!0}function IC(i,t){return Object.prototype.hasOwnProperty.call(i,t)}const DC=(i,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new Lt(`${i} must be an integer`);if(t<0)throw new Lt(`${i} must be a positive integer`);return t},UC=i=>{try{return JSON.parse(i)}catch{return}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const wC=i=>new Promise(t=>setTimeout(t,i));/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function xC(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new GeminiNextGenAPIClient({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function Eg(...i){const t=globalThis.ReadableStream;if(typeof t>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new t(...i)}function bC(i){let t=Symbol.asyncIterator in i?i[Symbol.asyncIterator]():i[Symbol.iterator]();return Eg({start(){},async pull(o){const{done:a,value:u}=await t.next();a?o.close():o.enqueue(u)},async cancel(){var o;await((o=t.return)===null||o===void 0?void 0:o.call(t))}})}function _g(i){if(i[Symbol.asyncIterator])return i;const t=i.getReader();return{async next(){try{const o=await t.read();return o!=null&&o.done&&t.releaseLock(),o}catch(o){throw t.releaseLock(),o}},async return(){const o=t.cancel();return t.releaseLock(),await o,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function GC(i){var t,o;if(i===null||typeof i!="object")return;if(i[Symbol.asyncIterator]){await((o=(t=i[Symbol.asyncIterator]()).return)===null||o===void 0?void 0:o.call(t));return}const a=i.getReader(),u=a.cancel();a.releaseLock(),await u}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const LC=({headers:i,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function HC(i){return Object.entries(i).filter(([t,o])=>typeof o<"u").map(([t,o])=>{if(typeof o=="string"||typeof o=="number"||typeof o=="boolean")return`${encodeURIComponent(t)}=${encodeURIComponent(o)}`;if(o===null)return`${encodeURIComponent(t)}=`;throw new Lt(`Cannot stringify type ${typeof o}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`)}).join("&")}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const PC="0.0.1";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Sg=()=>{var i;if(typeof File>"u"){const{process:t}=globalThis,o=typeof((i=t==null?void 0:t.versions)===null||i===void 0?void 0:i.node)=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(o?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};function cu(i,t,o){return Sg(),new File(i,t??"unknown_file",o)}function qC(i){return(typeof i=="object"&&i!==null&&("name"in i&&i.name&&String(i.name)||"url"in i&&i.url&&String(i.url)||"filename"in i&&i.filename&&String(i.filename)||"path"in i&&i.path&&String(i.path))||"").split(/[\\/]/).pop()||void 0}const VC=i=>i!=null&&typeof i=="object"&&typeof i[Symbol.asyncIterator]=="function";/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Ag=i=>i!=null&&typeof i=="object"&&typeof i.size=="number"&&typeof i.type=="string"&&typeof i.text=="function"&&typeof i.slice=="function"&&typeof i.arrayBuffer=="function",BC=i=>i!=null&&typeof i=="object"&&typeof i.name=="string"&&typeof i.lastModified=="number"&&Ag(i),zC=i=>i!=null&&typeof i=="object"&&typeof i.url=="string"&&typeof i.blob=="function";async function OC(i,t,o){if(Sg(),i=await i,BC(i))return i instanceof File?i:cu([await i.arrayBuffer()],i.name);if(zC(i)){const u=await i.blob();return t||(t=new URL(i.url).pathname.split(/[\\/]/).pop()),cu(await Mu(u),t,o)}const a=await Mu(i);if(t||(t=qC(i)),!(o!=null&&o.type)){const u=a.find(f=>typeof f=="object"&&"type"in f&&f.type);typeof u=="string"&&(o=Object.assign(Object.assign({},o),{type:u}))}return cu(a,t,o)}async function Mu(i){var t,o,a,u,f;let p=[];if(typeof i=="string"||ArrayBuffer.isView(i)||i instanceof ArrayBuffer)p.push(i);else if(Ag(i))p.push(i instanceof Blob?i:await i.arrayBuffer());else if(VC(i))try{for(var g=!0,y=Bt(i),m;m=await y.next(),t=m.done,!t;g=!0){u=m.value,g=!1;const v=u;p.push(...await Mu(v))}}catch(v){o={error:v}}finally{try{!g&&!t&&(a=y.return)&&await a.call(y)}finally{if(o)throw o.error}}else{const v=(f=i==null?void 0:i.constructor)===null||f===void 0?void 0:f.name;throw new Error(`Unexpected data type: ${typeof i}${v?`; constructor: ${v}`:""}${FC(i)}`)}return p}function FC(i){return typeof i!="object"||i===null?"":`; props: [${Object.getOwnPropertyNames(i).map(o=>`"${o}"`).join(", ")}]`}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Cg{constructor(t){this._client=t}}Cg._key=[];/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function Rg(i){return i.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const Gm=Object.freeze(Object.create(null)),kC=(i=Rg)=>(function(o,...a){if(o.length===1)return o[0];let u=!1;const f=[],p=o.reduce((v,E,_)=>{var A,I,L;/[?#]/.test(E)&&(u=!0);const b=a[_];let z=(u?encodeURIComponent:i)(""+b);return _!==a.length&&(b==null||typeof b=="object"&&b.toString===((L=Object.getPrototypeOf((I=Object.getPrototypeOf((A=b.hasOwnProperty)!==null&&A!==void 0?A:Gm))!==null&&I!==void 0?I:Gm))===null||L===void 0?void 0:L.toString))&&(z=b+"",f.push({start:v.length+E.length,length:z.length,error:`Value of type ${Object.prototype.toString.call(b).slice(8,-1)} is not a valid path parameter`})),v+E+(_===a.length?"":z)},""),g=p.split(/[?#]/,1)[0],y=/(^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi;let m;for(;(m=y.exec(g))!==null;){const v=m[0].startsWith("/"),E=v?1:0,_=v?m[0].slice(1):m[0];f.push({start:m.index+E,length:_.length,error:`Value "${_}" can't be safely passed as a path parameter`})}if(f.sort((v,E)=>v.start-E.start),f.length>0){let v=0;const E=f.reduce((_,A)=>{const I=" ".repeat(A.start-v),L="^".repeat(A.length);return v=A.start+A.length,_+I+L},"");throw new Lt(`Path parameters result in path with invalid segments:
${f.map(_=>_.error).join(`
`)}
${p}
${E}`)}return p}),va=kC(Rg);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Mg extends Cg{create(t,o){var a;const{api_version:u=this._client.apiVersion}=t,f=Ia(t,["api_version"]);if("model"in f&&"agent_config"in f)throw new Lt("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in f&&"generation_config"in f)throw new Lt("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(va`/${u}/interactions`,Object.assign(Object.assign({body:f},o),{stream:(a=t.stream)!==null&&a!==void 0?a:!1}))}delete(t,o={},a){const{api_version:u=this._client.apiVersion}=o??{};return this._client.delete(va`/${u}/interactions/${t}`,a)}cancel(t,o={},a){const{api_version:u=this._client.apiVersion}=o??{};return this._client.post(va`/${u}/interactions/${t}/cancel`,a)}get(t,o={},a){var u;const f=o??{},{api_version:p=this._client.apiVersion}=f,g=Ia(f,["api_version"]);return this._client.get(va`/${p}/interactions/${t}`,Object.assign(Object.assign({query:g},a),{stream:(u=o==null?void 0:o.stream)!==null&&u!==void 0?u:!1}))}}Mg._key=Object.freeze(["interactions"]);class Ng extends Mg{}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function JC(i){let t=0;for(const u of i)t+=u.length;const o=new Uint8Array(t);let a=0;for(const u of i)o.set(u,a),a+=u.length;return o}let Ta;function qu(i){let t;return(Ta??(t=new globalThis.TextEncoder,Ta=t.encode.bind(t)))(i)}let Ea;function Lm(i){let t;return(Ea??(t=new globalThis.TextDecoder,Ea=t.decode.bind(t)))(i)}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class La{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null,this.searchIndex=0}decode(t){var o;if(t==null)return[];const a=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?qu(t):t;this.buffer=JC([this.buffer,a]);const u=[];let f;for(;(f=YC(this.buffer,(o=this.carriageReturnIndex)!==null&&o!==void 0?o:this.searchIndex))!=null;){if(f.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=f.index;continue}if(this.carriageReturnIndex!=null&&(f.index!==this.carriageReturnIndex+1||f.carriage)){u.push(Lm(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null,this.searchIndex=0;continue}const p=this.carriageReturnIndex!==null?f.preceding-1:f.preceding,g=Lm(this.buffer.subarray(0,p));u.push(g),this.buffer=this.buffer.subarray(f.index),this.carriageReturnIndex=null,this.searchIndex=0}return this.searchIndex=Math.max(0,this.buffer.length-1),u}flush(){return this.buffer.length?this.decode(`
`):[]}}La.NEWLINE_CHARS=new Set([`
`,"\r"]);La.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function YC(i,t){const u=t??0,f=i.indexOf(10,u),p=i.indexOf(13,u);if(f===-1&&p===-1)return null;let g;return f!==-1&&p!==-1?g=Math.min(f,p):g=f!==-1?f:p,i[g]===10?{preceding:g,index:g+1,carriage:!1}:{preceding:g,index:g+1,carriage:!0}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Da={off:0,error:200,warn:300,info:400,debug:500},Hm=(i,t,o)=>{if(i){if(IC(Da,i))return i;lt(o).warn(`${t} was set to ${JSON.stringify(i)}, expected one of ${JSON.stringify(Object.keys(Da))}`)}};function Wo(){}function _a(i,t,o){return!t||Da[i]>Da[o]?Wo:t[i].bind(t)}const KC={error:Wo,warn:Wo,info:Wo,debug:Wo};let Pm=new WeakMap;function lt(i){var t;const o=i.logger,a=(t=i.logLevel)!==null&&t!==void 0?t:"off";if(!o)return KC;const u=Pm.get(o);if(u&&u[0]===a)return u[1];const f={error:_a("error",o,a),warn:_a("warn",o,a),info:_a("info",o,a),debug:_a("debug",o,a)};return Pm.set(o,[a,f]),f}const ai=i=>(i.options&&(i.options=Object.assign({},i.options),delete i.options.headers),i.headers&&(i.headers=Object.fromEntries((i.headers instanceof Headers?[...i.headers]:Object.entries(i.headers)).map(([t,o])=>[t,t.toLowerCase()==="x-goog-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":o]))),"retryOfRequestLogID"in i&&(i.retryOfRequestLogID&&(i.retryOf=i.retryOfRequestLogID),delete i.retryOfRequestLogID),i);/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Ki{constructor(t,o,a){this.iterator=t,this.controller=o,this.client=a}static fromSSEResponse(t,o,a){let u=!1;const f=a?lt(a):console;function p(){return Vt(this,arguments,function*(){var y,m,v,E;if(u)throw new Lt("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");u=!0;let _=!1;try{try{for(var A=!0,I=Bt(QC(t,o)),L;L=yield oe(I.next()),y=L.done,!y;A=!0){E=L.value,A=!1;const b=E;if(!_)if(b.data.startsWith("[DONE]")){_=!0;continue}else try{yield yield oe(JSON.parse(b.data))}catch(z){throw f.error("Could not parse message into JSON:",b.data),f.error("From chunk:",b.raw),z}}}catch(b){m={error:b}}finally{try{!A&&!y&&(v=I.return)&&(yield oe(v.call(I)))}finally{if(m)throw m.error}}_=!0}catch(b){if(Su(b))return yield oe(void 0);throw b}finally{_||o.abort()}})}return new Ki(p,o,a)}static fromReadableStream(t,o,a){let u=!1;function f(){return Vt(this,arguments,function*(){var y,m,v,E;const _=new La,A=_g(t);try{for(var I=!0,L=Bt(A),b;b=yield oe(L.next()),y=b.done,!y;I=!0){E=b.value,I=!1;const z=E;for(const Q of _.decode(z))yield yield oe(Q)}}catch(z){m={error:z}}finally{try{!I&&!y&&(v=L.return)&&(yield oe(v.call(L)))}finally{if(m)throw m.error}}for(const z of _.flush())yield yield oe(z)})}function p(){return Vt(this,arguments,function*(){var y,m,v,E;if(u)throw new Lt("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");u=!0;let _=!1;try{try{for(var A=!0,I=Bt(f()),L;L=yield oe(I.next()),y=L.done,!y;A=!0){E=L.value,A=!1;const b=E;_||b&&(yield yield oe(JSON.parse(b)))}}catch(b){m={error:b}}finally{try{!A&&!y&&(v=I.return)&&(yield oe(v.call(I)))}finally{if(m)throw m.error}}_=!0}catch(b){if(Su(b))return yield oe(void 0);throw b}finally{_||o.abort()}})}return new Ki(p,o,a)}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],o=[],a=this.iterator(),u=f=>({next:()=>{if(f.length===0){const p=a.next();t.push(p),o.push(p)}return f.shift()}});return[new Ki(()=>u(t),this.controller,this.client),new Ki(()=>u(o),this.controller,this.client)]}toReadableStream(){const t=this;let o;return Eg({async start(){o=t[Symbol.asyncIterator]()},async pull(a){try{const{value:u,done:f}=await o.next();if(f)return a.close();const p=qu(JSON.stringify(u)+`
`);a.enqueue(p)}catch(u){a.error(u)}},async cancel(){var a;await((a=o.return)===null||a===void 0?void 0:a.call(o))}})}}function QC(i,t){return Vt(this,arguments,function*(){var a,u,f,p;if(!i.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Lt("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Lt("Attempted to iterate over a response with no body");const g=new ZC,y=new La,m=_g(i.body);try{for(var v=!0,E=Bt(XC(m)),_;_=yield oe(E.next()),a=_.done,!a;v=!0){p=_.value,v=!1;const A=p;for(const I of y.decode(A)){const L=g.decode(I);L&&(yield yield oe(L))}}}catch(A){u={error:A}}finally{try{!v&&!a&&(f=E.return)&&(yield oe(f.call(E)))}finally{if(u)throw u.error}}for(const A of y.flush()){const I=g.decode(A);I&&(yield yield oe(I))}})}function XC(i){return Vt(this,arguments,function*(){var o,a,u,f;try{for(var p=!0,g=Bt(i),y;y=yield oe(g.next()),o=y.done,!o;p=!0){f=y.value,p=!1;const m=f;if(m==null)continue;const v=m instanceof ArrayBuffer?new Uint8Array(m):typeof m=="string"?qu(m):m;yield yield oe(v)}}catch(m){a={error:m}}finally{try{!p&&!o&&(u=g.return)&&(yield oe(u.call(g)))}finally{if(a)throw a.error}}})}class ZC{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(t){if(t.endsWith("\r")&&(t=t.substring(0,t.length-1)),!t){if(!this.event&&!this.data.length)return null;const f={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],f}if(this.chunks.push(t),t.startsWith(":"))return null;let[o,a,u]=$C(t,":");return u.startsWith(" ")&&(u=u.substring(1)),o==="event"?this.event=u:o==="data"&&this.data.push(u),null}}function $C(i,t){const o=i.indexOf(t);return o!==-1?[i.substring(0,o),t,i.substring(o+t.length)]:[i,"",""]}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */async function WC(i,t){const{response:o,requestLogID:a,retryOfRequestLogID:u,startTime:f}=t,p=await(async()=>{var g;if(t.options.stream)return lt(i).debug("response",o.status,o.url,o.headers,o.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(o,t.controller,i):Ki.fromSSEResponse(o,t.controller,i);if(o.status===204)return null;if(t.options.__binaryResponse)return o;const y=o.headers.get("content-type"),m=(g=y==null?void 0:y.split(";")[0])===null||g===void 0?void 0:g.trim();return(m==null?void 0:m.includes("application/json"))||(m==null?void 0:m.endsWith("+json"))?o.headers.get("content-length")==="0"?void 0:await o.json():await o.text()})();return lt(i).debug(`[${a}] response parsed`,ai({retryOfRequestLogID:u,url:o.url,status:o.status,body:p,durationMs:Date.now()-f})),p}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class Vu extends Promise{constructor(t,o,a=WC){super(u=>{u(null)}),this.responsePromise=o,this.parseResponse=a,this.client=t}_thenUnwrap(t){return new Vu(this.client,this.responsePromise,async(o,a)=>t(await this.parseResponse(o,a),a))}asResponse(){return this.responsePromise.then(t=>t.response)}async withResponse(){const[t,o]=await Promise.all([this.parse(),this.asResponse()]);return{data:t,response:o}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(t=>this.parseResponse(this.client,t))),this.parsedPromise}then(t,o){return this.parse().then(t,o)}catch(t){return this.parse().catch(t)}finally(t){return this.parse().finally(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const Ig=Symbol("brand.privateNullableHeaders");function*jC(i){if(!i)return;if(Ig in i){const{values:a,nulls:u}=i;yield*a.entries();for(const f of u)yield[f,null];return}let t=!1,o;i instanceof Headers?o=i.entries():xm(i)?o=i:(t=!0,o=Object.entries(i??{}));for(let a of o){const u=a[0];if(typeof u!="string")throw new TypeError("expected header name to be a string");const f=xm(a[1])?a[1]:[a[1]];let p=!1;for(const g of f)g!==void 0&&(t&&!p&&(p=!0,yield[u,null]),yield[u,g])}}const $o=i=>{const t=new Headers,o=new Set;for(const a of i){const u=new Set;for(const[f,p]of jC(a)){const g=f.toLowerCase();u.has(g)||(t.delete(f),u.add(g)),p===null?(t.delete(f),o.add(g)):(t.append(f,p),o.delete(g))}}return{[Ig]:!0,values:t,nulls:o}};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const fu=i=>{var t,o,a,u,f,p;if(typeof globalThis.process<"u")return(a=(o=(t=y0)===null||t===void 0?void 0:t[i])===null||o===void 0?void 0:o.trim())!==null&&a!==void 0?a:void 0;if(typeof globalThis.Deno<"u")return(p=(f=(u=globalThis.Deno.env)===null||u===void 0?void 0:u.get)===null||f===void 0?void 0:f.call(u,i))===null||p===void 0?void 0:p.trim()};/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */var Dg;class Ha{constructor(t){var o,a,u,f,p,g,y,{baseURL:m=fu("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:v=(o=fu("GEMINI_API_KEY"))!==null&&o!==void 0?o:null,apiVersion:E="v1beta"}=t,_=Ia(t,["baseURL","apiKey","apiVersion"]);const A=Object.assign(Object.assign({apiKey:v,apiVersion:E},_),{baseURL:m||"https://generativelanguage.googleapis.com"});this.baseURL=A.baseURL,this.timeout=(a=A.timeout)!==null&&a!==void 0?a:Ha.DEFAULT_TIMEOUT,this.logger=(u=A.logger)!==null&&u!==void 0?u:console;const I="warn";this.logLevel=I,this.logLevel=(p=(f=Hm(A.logLevel,"ClientOptions.logLevel",this))!==null&&f!==void 0?f:Hm(fu("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&p!==void 0?p:I,this.fetchOptions=A.fetchOptions,this.maxRetries=(g=A.maxRetries)!==null&&g!==void 0?g:2,this.fetch=(y=A.fetch)!==null&&y!==void 0?y:xC(),this.encoder=LC,this._options=A,this.apiKey=v,this.apiVersion=E,this.clientAdapter=A.clientAdapter}withOptions(t){return new this.constructor(Object.assign(Object.assign(Object.assign({},this._options),{baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,apiVersion:this.apiVersion}),t))}baseURLOverridden(){return this.baseURL!=="https://generativelanguage.googleapis.com"}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:t,nulls:o}){if(!(t.has("authorization")||t.has("x-goog-api-key"))&&!(this.apiKey&&t.get("x-goog-api-key"))&&!o.has("x-goog-api-key"))throw new Error('Could not resolve authentication method. Expected the apiKey to be set. Or for the "x-goog-api-key" headers to be explicitly omitted')}async authHeaders(t){const o=$o([t.headers]);if(!(o.values.has("authorization")||o.values.has("x-goog-api-key"))){if(this.apiKey)return $o([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return $o([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(t){return HC(t)}getUserAgent(){return`${this.constructor.name}/JS ${PC}`}defaultIdempotencyKey(){return`stainless-node-retry-${AC()}`}makeStatusError(t,o,a,u){return at.generate(t,o,a,u)}buildURL(t,o,a){const u=!this.baseURLOverridden()&&a||this.baseURL,f=RC(t)?new URL(t):new URL(u+(u.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),p=this.defaultQuery(),g=Object.fromEntries(f.searchParams);return(!bm(p)||!bm(g))&&(o=Object.assign(Object.assign(Object.assign({},g),p),o)),typeof o=="object"&&o&&!Array.isArray(o)&&(f.search=this.stringifyQuery(o)),f.toString()}async prepareOptions(t){if(this.clientAdapter&&this.clientAdapter.isVertexAI()&&!t.path.startsWith(`/${this.apiVersion}/projects/`)){const o=t.path.slice(this.apiVersion.length+1);t.path=`/${this.apiVersion}/projects/${this.clientAdapter.getProject()}/locations/${this.clientAdapter.getLocation()}${o}`}}async prepareRequest(t,{url:o,options:a}){}get(t,o){return this.methodRequest("get",t,o)}post(t,o){return this.methodRequest("post",t,o)}patch(t,o){return this.methodRequest("patch",t,o)}put(t,o){return this.methodRequest("put",t,o)}delete(t,o){return this.methodRequest("delete",t,o)}methodRequest(t,o,a){return this.request(Promise.resolve(a).then(u=>Object.assign({method:t,path:o},u)))}request(t,o=null){return new Vu(this,this.makeRequest(t,o,void 0))}async makeRequest(t,o,a){var u,f,p;const g=await t,y=(u=g.maxRetries)!==null&&u!==void 0?u:this.maxRetries;o==null&&(o=y),await this.prepareOptions(g);const{req:m,url:v,timeout:E}=await this.buildRequest(g,{retryCount:y-o});await this.prepareRequest(m,{url:v,options:g});const _="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),A=a===void 0?"":`, retryOf: ${a}`,I=Date.now();if(lt(this).debug(`[${_}] sending request`,ai({retryOfRequestLogID:a,method:g.method,url:v,options:g,headers:m.headers})),!((f=g.signal)===null||f===void 0)&&f.aborted)throw new Cu;const L=new AbortController,b=await this.fetchWithTimeout(v,m,E,L).catch(Au),z=Date.now();if(b instanceof globalThis.Error){const O=`retrying, ${o} attempts remaining`;if(!((p=g.signal)===null||p===void 0)&&p.aborted)throw new Cu;const k=Su(b)||/timed? ?out/i.test(String(b)+("cause"in b?String(b.cause):""));if(o)return lt(this).info(`[${_}] connection ${k?"timed out":"failed"} - ${O}`),lt(this).debug(`[${_}] connection ${k?"timed out":"failed"} (${O})`,ai({retryOfRequestLogID:a,url:v,durationMs:z-I,message:b.message})),this.retryRequest(g,o,a??_);throw lt(this).info(`[${_}] connection ${k?"timed out":"failed"} - error; no more retries left`),lt(this).debug(`[${_}] connection ${k?"timed out":"failed"} (error; no more retries left)`,ai({retryOfRequestLogID:a,url:v,durationMs:z-I,message:b.message})),k?new fg:new Ga({cause:b})}const Q=`[${_}${A}] ${m.method} ${v} ${b.ok?"succeeded":"failed"} with status ${b.status} in ${z-I}ms`;if(!b.ok){const O=await this.shouldRetry(b);if(o&&O){const Z=`retrying, ${o} attempts remaining`;return await GC(b.body),lt(this).info(`${Q} - ${Z}`),lt(this).debug(`[${_}] response error (${Z})`,ai({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:z-I})),this.retryRequest(g,o,a??_,b.headers)}const k=O?"error; no more retries left":"error; not retryable";lt(this).info(`${Q} - ${k}`);const j=await b.text().catch(Z=>Au(Z).message),B=UC(j),J=B?void 0:j;throw lt(this).debug(`[${_}] response error (${k})`,ai({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,message:J,durationMs:Date.now()-I})),this.makeStatusError(b.status,B,J,b.headers)}return lt(this).info(Q),lt(this).debug(`[${_}] response start`,ai({retryOfRequestLogID:a,url:b.url,status:b.status,headers:b.headers,durationMs:z-I})),{response:b,options:g,controller:L,requestLogID:_,retryOfRequestLogID:a,startTime:I}}async fetchWithTimeout(t,o,a,u){const f=o||{},{signal:p,method:g}=f,y=Ia(f,["signal","method"]),m=this._makeAbort(u);p&&p.addEventListener("abort",m,{once:!0});const v=setTimeout(m,a),E=globalThis.ReadableStream&&y.body instanceof globalThis.ReadableStream||typeof y.body=="object"&&y.body!==null&&Symbol.asyncIterator in y.body,_=Object.assign(Object.assign(Object.assign({signal:u.signal},E?{duplex:"half"}:{}),{method:"GET"}),y);g&&(_.method=g.toUpperCase());try{return await this.fetch.call(void 0,t,_)}finally{clearTimeout(v)}}async shouldRetry(t){const o=t.headers.get("x-should-retry");return o==="true"?!0:o==="false"?!1:t.status===408||t.status===409||t.status===429||t.status>=500}async retryRequest(t,o,a,u){var f;let p;const g=u==null?void 0:u.get("retry-after-ms");if(g){const m=parseFloat(g);Number.isNaN(m)||(p=m)}const y=u==null?void 0:u.get("retry-after");if(y&&!p){const m=parseFloat(y);Number.isNaN(m)?p=Date.parse(y)-Date.now():p=m*1e3}if(p===void 0){const m=(f=t.maxRetries)!==null&&f!==void 0?f:this.maxRetries;p=this.calculateDefaultRetryTimeoutMillis(o,m)}return await wC(p),this.makeRequest(t,o-1,a)}calculateDefaultRetryTimeoutMillis(t,o){const f=o-t,p=Math.min(.5*Math.pow(2,f),8),g=1-Math.random()*.25;return p*g*1e3}async buildRequest(t,{retryCount:o=0}={}){var a,u,f;const p=Object.assign({},t),{method:g,path:y,query:m,defaultBaseURL:v}=p,E=this.buildURL(y,m,v);"timeout"in p&&DC("timeout",p.timeout),p.timeout=(a=p.timeout)!==null&&a!==void 0?a:this.timeout;const{bodyHeaders:_,body:A}=this.buildBody({options:p}),I=await this.buildHeaders({options:t,method:g,bodyHeaders:_,retryCount:o});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:g,headers:I},p.signal&&{signal:p.signal}),globalThis.ReadableStream&&A instanceof globalThis.ReadableStream&&{duplex:"half"}),A&&{body:A}),(u=this.fetchOptions)!==null&&u!==void 0?u:{}),(f=p.fetchOptions)!==null&&f!==void 0?f:{}),url:E,timeout:p.timeout}}async buildHeaders({options:t,method:o,bodyHeaders:a,retryCount:u}){let f={};this.idempotencyHeader&&o!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),f[this.idempotencyHeader]=t.idempotencyKey);const p=await this.authHeaders(t);let g=$o([f,{Accept:"application/json","User-Agent":this.getUserAgent()},this._options.defaultHeaders,a,t.headers,p]);return this.validateHeaders(g),g.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:o}}){if(!t)return{bodyHeaders:void 0,body:void 0};const a=$o([o]);return ArrayBuffer.isView(t)||t instanceof ArrayBuffer||t instanceof DataView||typeof t=="string"&&a.values.has("content-type")||globalThis.Blob&&t instanceof globalThis.Blob||t instanceof FormData||t instanceof URLSearchParams||globalThis.ReadableStream&&t instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:t}:typeof t=="object"&&(Symbol.asyncIterator in t||Symbol.iterator in t&&"next"in t&&typeof t.next=="function")?{bodyHeaders:void 0,body:bC(t)}:typeof t=="object"&&a.values.get("content-type")==="application/x-www-form-urlencoded"?{bodyHeaders:{"content-type":"application/x-www-form-urlencoded"},body:this.stringifyQuery(t)}:this.encoder({body:t,headers:a})}}Ha.DEFAULT_TIMEOUT=6e4;class Ze extends Ha{constructor(){super(...arguments),this.interactions=new Ng(this)}}Dg=Ze;Ze.GeminiNextGenAPIClient=Dg;Ze.GeminiNextGenAPIClientError=Lt;Ze.APIError=at;Ze.APIConnectionError=Ga;Ze.APIConnectionTimeoutError=fg;Ze.APIUserAbortError=Cu;Ze.NotFoundError=mg;Ze.ConflictError=gg;Ze.RateLimitError=vg;Ze.BadRequestError=dg;Ze.AuthenticationError=pg;Ze.InternalServerError=Tg;Ze.PermissionDeniedError=hg;Ze.UnprocessableEntityError=yg;Ze.toFile=OC;Ze.Interactions=Ng;/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */function eR(i,t){const o={},a=r(i,["name"]);return a!=null&&c(o,["_url","name"],a),o}function tR(i,t){const o={},a=r(i,["name"]);return a!=null&&c(o,["_url","name"],a),o}function nR(i,t){const o={},a=r(i,["sdkHttpResponse"]);return a!=null&&c(o,["sdkHttpResponse"],a),o}function iR(i,t){const o={},a=r(i,["sdkHttpResponse"]);return a!=null&&c(o,["sdkHttpResponse"],a),o}function oR(i,t,o){const a={};if(r(i,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const u=r(i,["tunedModelDisplayName"]);if(t!==void 0&&u!=null&&c(t,["displayName"],u),r(i,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const f=r(i,["epochCount"]);t!==void 0&&f!=null&&c(t,["tuningTask","hyperparameters","epochCount"],f);const p=r(i,["learningRateMultiplier"]);if(p!=null&&c(a,["tuningTask","hyperparameters","learningRateMultiplier"],p),r(i,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(r(i,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(r(i,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");if(r(i,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is not supported in Gemini API.");if(r(i,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is not supported in Gemini API.");const g=r(i,["batchSize"]);t!==void 0&&g!=null&&c(t,["tuningTask","hyperparameters","batchSize"],g);const y=r(i,["learningRate"]);if(t!==void 0&&y!=null&&c(t,["tuningTask","hyperparameters","learningRate"],y),r(i,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(r(i,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");if(r(i,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is not supported in Gemini API.");if(r(i,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");if(r(i,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");if(r(i,["outputUri"])!==void 0)throw new Error("outputUri parameter is not supported in Gemini API.");if(r(i,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is not supported in Gemini API.");return a}function lR(i,t,o){const a={};let u=r(o,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const B=r(i,["validationDataset"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec"],du(B))}else if(u==="PREFERENCE_TUNING"){const B=r(i,["validationDataset"]);t!==void 0&&B!=null&&c(t,["preferenceOptimizationSpec"],du(B))}else if(u==="DISTILLATION"){const B=r(i,["validationDataset"]);t!==void 0&&B!=null&&c(t,["distillationSpec"],du(B))}const f=r(i,["tunedModelDisplayName"]);t!==void 0&&f!=null&&c(t,["tunedModelDisplayName"],f);const p=r(i,["description"]);t!==void 0&&p!=null&&c(t,["description"],p);let g=r(o,["config","method"]);if(g===void 0&&(g="SUPERVISED_FINE_TUNING"),g==="SUPERVISED_FINE_TUNING"){const B=r(i,["epochCount"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","hyperParameters","epochCount"],B)}else if(g==="PREFERENCE_TUNING"){const B=r(i,["epochCount"]);t!==void 0&&B!=null&&c(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],B)}else if(g==="DISTILLATION"){const B=r(i,["epochCount"]);t!==void 0&&B!=null&&c(t,["distillationSpec","hyperParameters","epochCount"],B)}let y=r(o,["config","method"]);if(y===void 0&&(y="SUPERVISED_FINE_TUNING"),y==="SUPERVISED_FINE_TUNING"){const B=r(i,["learningRateMultiplier"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],B)}else if(y==="PREFERENCE_TUNING"){const B=r(i,["learningRateMultiplier"]);t!==void 0&&B!=null&&c(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],B)}else if(y==="DISTILLATION"){const B=r(i,["learningRateMultiplier"]);t!==void 0&&B!=null&&c(t,["distillationSpec","hyperParameters","learningRateMultiplier"],B)}let m=r(o,["config","method"]);if(m===void 0&&(m="SUPERVISED_FINE_TUNING"),m==="SUPERVISED_FINE_TUNING"){const B=r(i,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","exportLastCheckpointOnly"],B)}else if(m==="PREFERENCE_TUNING"){const B=r(i,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&c(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],B)}else if(m==="DISTILLATION"){const B=r(i,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&c(t,["distillationSpec","exportLastCheckpointOnly"],B)}let v=r(o,["config","method"]);if(v===void 0&&(v="SUPERVISED_FINE_TUNING"),v==="SUPERVISED_FINE_TUNING"){const B=r(i,["adapterSize"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","hyperParameters","adapterSize"],B)}else if(v==="PREFERENCE_TUNING"){const B=r(i,["adapterSize"]);t!==void 0&&B!=null&&c(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],B)}else if(v==="DISTILLATION"){const B=r(i,["adapterSize"]);t!==void 0&&B!=null&&c(t,["distillationSpec","hyperParameters","adapterSize"],B)}let E=r(o,["config","method"]);if(E===void 0&&(E="SUPERVISED_FINE_TUNING"),E==="SUPERVISED_FINE_TUNING"){const B=r(i,["tuningMode"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","tuningMode"],B)}const _=r(i,["customBaseModel"]);t!==void 0&&_!=null&&c(t,["customBaseModel"],_);let A=r(o,["config","method"]);if(A===void 0&&(A="SUPERVISED_FINE_TUNING"),A==="SUPERVISED_FINE_TUNING"){const B=r(i,["batchSize"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","hyperParameters","batchSize"],B)}let I=r(o,["config","method"]);if(I===void 0&&(I="SUPERVISED_FINE_TUNING"),I==="SUPERVISED_FINE_TUNING"){const B=r(i,["learningRate"]);t!==void 0&&B!=null&&c(t,["supervisedTuningSpec","hyperParameters","learningRate"],B)}const L=r(i,["labels"]);t!==void 0&&L!=null&&c(t,["labels"],L);const b=r(i,["beta"]);t!==void 0&&b!=null&&c(t,["preferenceOptimizationSpec","hyperParameters","beta"],b);const z=r(i,["baseTeacherModel"]);t!==void 0&&z!=null&&c(t,["distillationSpec","baseTeacherModel"],z);const Q=r(i,["tunedTeacherModelSource"]);t!==void 0&&Q!=null&&c(t,["distillationSpec","tunedTeacherModelSource"],Q);const O=r(i,["sftLossWeightMultiplier"]);t!==void 0&&O!=null&&c(t,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],O);const k=r(i,["outputUri"]);t!==void 0&&k!=null&&c(t,["outputUri"],k);const j=r(i,["encryptionSpec"]);return t!==void 0&&j!=null&&c(t,["encryptionSpec"],j),a}function aR(i,t){const o={},a=r(i,["baseModel"]);a!=null&&c(o,["baseModel"],a);const u=r(i,["preTunedModel"]);u!=null&&c(o,["preTunedModel"],u);const f=r(i,["trainingDataset"]);f!=null&&yR(f);const p=r(i,["config"]);return p!=null&&oR(p,o),o}function sR(i,t){const o={},a=r(i,["baseModel"]);a!=null&&c(o,["baseModel"],a);const u=r(i,["preTunedModel"]);u!=null&&c(o,["preTunedModel"],u);const f=r(i,["trainingDataset"]);f!=null&&vR(f,o,t);const p=r(i,["config"]);return p!=null&&lR(p,o,t),o}function rR(i,t){const o={},a=r(i,["name"]);return a!=null&&c(o,["_url","name"],a),o}function uR(i,t){const o={},a=r(i,["name"]);return a!=null&&c(o,["_url","name"],a),o}function cR(i,t,o){const a={},u=r(i,["pageSize"]);t!==void 0&&u!=null&&c(t,["_query","pageSize"],u);const f=r(i,["pageToken"]);t!==void 0&&f!=null&&c(t,["_query","pageToken"],f);const p=r(i,["filter"]);return t!==void 0&&p!=null&&c(t,["_query","filter"],p),a}function fR(i,t,o){const a={},u=r(i,["pageSize"]);t!==void 0&&u!=null&&c(t,["_query","pageSize"],u);const f=r(i,["pageToken"]);t!==void 0&&f!=null&&c(t,["_query","pageToken"],f);const p=r(i,["filter"]);return t!==void 0&&p!=null&&c(t,["_query","filter"],p),a}function dR(i,t){const o={},a=r(i,["config"]);return a!=null&&cR(a,o),o}function pR(i,t){const o={},a=r(i,["config"]);return a!=null&&fR(a,o),o}function hR(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["nextPageToken"]);u!=null&&c(o,["nextPageToken"],u);const f=r(i,["tunedModels"]);if(f!=null){let p=f;Array.isArray(p)&&(p=p.map(g=>Ug(g))),c(o,["tuningJobs"],p)}return o}function mR(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["nextPageToken"]);u!=null&&c(o,["nextPageToken"],u);const f=r(i,["tuningJobs"]);if(f!=null){let p=f;Array.isArray(p)&&(p=p.map(g=>Nu(g))),c(o,["tuningJobs"],p)}return o}function gR(i,t){const o={},a=r(i,["name"]);a!=null&&c(o,["model"],a);const u=r(i,["name"]);return u!=null&&c(o,["endpoint"],u),o}function yR(i,t){const o={};if(r(i,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(r(i,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const a=r(i,["examples"]);if(a!=null){let u=a;Array.isArray(u)&&(u=u.map(f=>f)),c(o,["examples","examples"],u)}return o}function vR(i,t,o){const a={};let u=r(o,["config","method"]);if(u===void 0&&(u="SUPERVISED_FINE_TUNING"),u==="SUPERVISED_FINE_TUNING"){const p=r(i,["gcsUri"]);t!==void 0&&p!=null&&c(t,["supervisedTuningSpec","trainingDatasetUri"],p)}else if(u==="PREFERENCE_TUNING"){const p=r(i,["gcsUri"]);t!==void 0&&p!=null&&c(t,["preferenceOptimizationSpec","trainingDatasetUri"],p)}else if(u==="DISTILLATION"){const p=r(i,["gcsUri"]);t!==void 0&&p!=null&&c(t,["distillationSpec","promptDatasetUri"],p)}let f=r(o,["config","method"]);if(f===void 0&&(f="SUPERVISED_FINE_TUNING"),f==="SUPERVISED_FINE_TUNING"){const p=r(i,["vertexDatasetResource"]);t!==void 0&&p!=null&&c(t,["supervisedTuningSpec","trainingDatasetUri"],p)}else if(f==="PREFERENCE_TUNING"){const p=r(i,["vertexDatasetResource"]);t!==void 0&&p!=null&&c(t,["preferenceOptimizationSpec","trainingDatasetUri"],p)}else if(f==="DISTILLATION"){const p=r(i,["vertexDatasetResource"]);t!==void 0&&p!=null&&c(t,["distillationSpec","promptDatasetUri"],p)}if(r(i,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return a}function Ug(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["name"]);u!=null&&c(o,["name"],u);const f=r(i,["state"]);f!=null&&c(o,["state"],Ym(f));const p=r(i,["createTime"]);p!=null&&c(o,["createTime"],p);const g=r(i,["tuningTask","startTime"]);g!=null&&c(o,["startTime"],g);const y=r(i,["tuningTask","completeTime"]);y!=null&&c(o,["endTime"],y);const m=r(i,["updateTime"]);m!=null&&c(o,["updateTime"],m);const v=r(i,["description"]);v!=null&&c(o,["description"],v);const E=r(i,["baseModel"]);E!=null&&c(o,["baseModel"],E);const _=r(i,["_self"]);return _!=null&&c(o,["tunedModel"],gR(_)),o}function Nu(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["name"]);u!=null&&c(o,["name"],u);const f=r(i,["state"]);f!=null&&c(o,["state"],Ym(f));const p=r(i,["createTime"]);p!=null&&c(o,["createTime"],p);const g=r(i,["startTime"]);g!=null&&c(o,["startTime"],g);const y=r(i,["endTime"]);y!=null&&c(o,["endTime"],y);const m=r(i,["updateTime"]);m!=null&&c(o,["updateTime"],m);const v=r(i,["error"]);v!=null&&c(o,["error"],v);const E=r(i,["description"]);E!=null&&c(o,["description"],E);const _=r(i,["baseModel"]);_!=null&&c(o,["baseModel"],_);const A=r(i,["tunedModel"]);A!=null&&c(o,["tunedModel"],A);const I=r(i,["preTunedModel"]);I!=null&&c(o,["preTunedModel"],I);const L=r(i,["supervisedTuningSpec"]);L!=null&&c(o,["supervisedTuningSpec"],L);const b=r(i,["preferenceOptimizationSpec"]);b!=null&&c(o,["preferenceOptimizationSpec"],b);const z=r(i,["distillationSpec"]);z!=null&&c(o,["distillationSpec"],z);const Q=r(i,["tuningDataStats"]);Q!=null&&c(o,["tuningDataStats"],Q);const O=r(i,["encryptionSpec"]);O!=null&&c(o,["encryptionSpec"],O);const k=r(i,["partnerModelTuningSpec"]);k!=null&&c(o,["partnerModelTuningSpec"],k);const j=r(i,["customBaseModel"]);j!=null&&c(o,["customBaseModel"],j);const B=r(i,["evaluateDatasetRuns"]);if(B!=null){let G=B;Array.isArray(G)&&(G=G.map(F=>F)),c(o,["evaluateDatasetRuns"],G)}const J=r(i,["experiment"]);J!=null&&c(o,["experiment"],J);const ue=r(i,["fullFineTuningSpec"]);ue!=null&&c(o,["fullFineTuningSpec"],ue);const Z=r(i,["labels"]);Z!=null&&c(o,["labels"],Z);const re=r(i,["outputUri"]);re!=null&&c(o,["outputUri"],re);const Ee=r(i,["pipelineJob"]);Ee!=null&&c(o,["pipelineJob"],Ee);const Me=r(i,["serviceAccount"]);Me!=null&&c(o,["serviceAccount"],Me);const xe=r(i,["tunedModelDisplayName"]);xe!=null&&c(o,["tunedModelDisplayName"],xe);const Ae=r(i,["tuningJobState"]);Ae!=null&&c(o,["tuningJobState"],Ae);const qe=r(i,["veoTuningSpec"]);return qe!=null&&c(o,["veoTuningSpec"],qe),o}function TR(i,t){const o={},a=r(i,["sdkHttpResponse"]);a!=null&&c(o,["sdkHttpResponse"],a);const u=r(i,["name"]);u!=null&&c(o,["name"],u);const f=r(i,["metadata"]);f!=null&&c(o,["metadata"],f);const p=r(i,["done"]);p!=null&&c(o,["done"],p);const g=r(i,["error"]);return g!=null&&c(o,["error"],g),o}function du(i,t){const o={},a=r(i,["gcsUri"]);a!=null&&c(o,["validationDatasetUri"],a);const u=r(i,["vertexDatasetResource"]);return u!=null&&c(o,["validationDatasetUri"],u),o}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class ER extends dn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new si(fn.PAGED_ITEM_TUNING_JOBS,a=>this.listInternal(a),await this.listInternal(o),o),this.get=async o=>await this.getInternal(o),this.tune=async o=>{var a;if(this.apiClient.isVertexAI())if(o.baseModel.startsWith("projects/")){const u={tunedModelName:o.baseModel};!((a=o.config)===null||a===void 0)&&a.preTunedModelCheckpointId&&(u.checkpointId=o.config.preTunedModelCheckpointId);const f=Object.assign(Object.assign({},o),{preTunedModel:u});return f.baseModel=void 0,await this.tuneInternal(f)}else{const u=Object.assign({},o);return await this.tuneInternal(u)}else{const u=Object.assign({},o),f=await this.tuneMldevInternal(u);let p="";return f.metadata!==void 0&&f.metadata.tunedModel!==void 0?p=f.metadata.tunedModel:f.name!==void 0&&f.name.includes("/operations/")&&(p=f.name.split("/operations/")[0]),{name:p,state:hu.JOB_STATE_QUEUED}}}}async getInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=uR(t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>Nu(v))}else{const m=rR(t);return g=Y("{name}",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>Ug(v))}}async listInternal(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=pR(t);return g=Y("tuningJobs",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=mR(v),_=new um;return Object.assign(_,E),_})}else{const m=dR(t);return g=Y("tunedModels",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"GET",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=hR(v),_=new um;return Object.assign(_,E),_})}}async cancel(t){var o,a,u,f;let p,g="",y={};if(this.apiClient.isVertexAI()){const m=tR(t);return g=Y("{name}:cancel",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=iR(v),_=new cm;return Object.assign(_,E),_})}else{const m=eR(t);return g=Y("{name}:cancel",m._url),y=m._query,delete m._url,delete m._query,p=this.apiClient.request({path:g,queryParams:y,body:JSON.stringify(m),httpMethod:"POST",httpOptions:(u=t.config)===null||u===void 0?void 0:u.httpOptions,abortSignal:(f=t.config)===null||f===void 0?void 0:f.abortSignal}).then(v=>v.json().then(E=>{const _=E;return _.sdkHttpResponse={headers:v.headers},_})),p.then(v=>{const E=nR(v),_=new cm;return Object.assign(_,E),_})}}async tuneInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI()){const g=sR(t,t);return f=Y("tuningJobs",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>Nu(y))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(t){var o,a;let u,f="",p={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const g=aR(t);return f=Y("tunedModels",g._url),p=g._query,delete g._url,delete g._query,u=this.apiClient.request({path:f,queryParams:p,body:JSON.stringify(g),httpMethod:"POST",httpOptions:(o=t.config)===null||o===void 0?void 0:o.httpOptions,abortSignal:(a=t.config)===null||a===void 0?void 0:a.abortSignal}).then(y=>y.json().then(m=>{const v=m;return v.sdkHttpResponse={headers:y.headers},v})),u.then(y=>TR(y))}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class _R{async download(t,o){throw new Error("Download to file is not supported in the browser, please use a browser compliant download like an <a> tag.")}}const SR=1024*1024*8,AR=3,CR=1e3,RR=2,Ua="x-goog-upload-status";async function MR(i,t,o){var a;const u=await wg(i,t,o),f=await(u==null?void 0:u.json());if(((a=u==null?void 0:u.headers)===null||a===void 0?void 0:a[Ua])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return f.file}async function NR(i,t,o){var a;const u=await wg(i,t,o),f=await(u==null?void 0:u.json());if(((a=u==null?void 0:u.headers)===null||a===void 0?void 0:a[Ua])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const p=Bm(f),g=new xu;return Object.assign(g,p),g}async function wg(i,t,o){var a,u;let f=0,p=0,g=new gu(new Response),y="upload";for(f=i.size;p<f;){const m=Math.min(SR,f-p),v=i.slice(p,p+m);p+m>=f&&(y+=", finalize");let E=0,_=CR;for(;E<AR&&(g=await o.request({path:"",body:v,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:t,headers:{"X-Goog-Upload-Command":y,"X-Goog-Upload-Offset":String(p),"Content-Length":String(m)}}}),!(!((a=g==null?void 0:g.headers)===null||a===void 0)&&a[Ua]));)E++,await DR(_),_=_*RR;if(p+=m,((u=g==null?void 0:g.headers)===null||u===void 0?void 0:u[Ua])!=="active")break;if(f<=p)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return g}async function IR(i){return{size:i.size,type:i.type}}function DR(i){return new Promise(t=>setTimeout(t,i))}class UR{async upload(t,o,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await MR(t,o,a)}async uploadToFileSearchStore(t,o,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await NR(t,o,a)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await IR(t)}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */class wR{create(t,o,a){return new xR(t,o,a)}}class xR{constructor(t,o,a){this.url=t,this.headers=o,this.callbacks=a}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(t){if(this.ws===void 0)throw new Error("WebSocket is not connected");this.ws.send(t)}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 qm="x-goog-api-key";class bR{constructor(t){this.apiKey=t}async addAuthHeaders(t,o){if(t.get(qm)===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.");t.append(qm,this.apiKey)}}}/**
 * @license
 * Copyright 2025 Google LLC
 * SPDX-License-Identifier: Apache-2.0
 */const GR="gl-node/";class qR{get interactions(){var t;if(this._interactions!==void 0)return this._interactions;console.warn("GoogleGenAI.interactions: Interactions usage is experimental and may change in future versions.");const o=this.httpOptions;o!=null&&o.extraBody&&console.warn("GoogleGenAI.interactions: Client level httpOptions.extraBody is not supported by the interactions client and will be ignored.");const a=new Ze({baseURL:this.apiClient.getBaseUrl(),apiKey:this.apiKey,apiVersion:this.apiClient.getApiVersion(),clientAdapter:this.apiClient,defaultHeaders:this.apiClient.getDefaultHeaders(),timeout:o==null?void 0:o.timeout,maxRetries:(t=o==null?void 0:o.retryOptions)===null||t===void 0?void 0:t.attempts});return this._interactions=a.interactions,this._interactions}constructor(t){var o;if(t.apiKey==null)throw new Error("An API Key must be set when running in a browser");if(t.project||t.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=t.vertexai)!==null&&o!==void 0?o:!1,this.apiKey=t.apiKey;const a=_0(t.httpOptions,t.vertexai,void 0,void 0);a&&(t.httpOptions?t.httpOptions.baseUrl=a:t.httpOptions={baseUrl:a}),this.apiVersion=t.apiVersion,this.httpOptions=t.httpOptions;const u=new bR(this.apiKey);this.apiClient=new wA({auth:u,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:GR+"web",uploader:new UR,downloader:new _R}),this.models=new ZA(this.apiClient),this.live=new kA(this.apiClient,u,new wR),this.batches=new jT(this.apiClient),this.chats=new LE(this.models,this.apiClient),this.caches=new xE(this.apiClient),this.files=new KE(this.apiClient),this.operations=new $A(this.apiClient),this.authTokens=new hC(this.apiClient),this.tunings=new ER(this.apiClient),this.fileSearchStores=new SC(this.apiClient)}}export{qR as G,PR as R,HR as a,LR as j,o0 as r};
