Files
afrov2/dist/assets/index-CkDqtfdY.js
2026-02-22 20:44:23 +01:00

598 lines
602 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))a(s);new MutationObserver(s=>{for(const c of s)if(c.type==="childList")for(const f of c.addedNodes)f.tagName==="LINK"&&f.rel==="modulepreload"&&a(f)}).observe(document,{childList:!0,subtree:!0});function o(s){const c={};return s.integrity&&(c.integrity=s.integrity),s.referrerPolicy&&(c.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?c.credentials="include":s.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(s){if(s.ep)return;s.ep=!0;const c=o(s);fetch(s.href,c)}})();function yc(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var Pu={exports:{}},dl={};/**
* @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 Fp;function Yx(){if(Fp)return dl;Fp=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function o(a,s,c){var f=null;if(c!==void 0&&(f=""+c),s.key!==void 0&&(f=""+s.key),"key"in s){c={};for(var h in s)h!=="key"&&(c[h]=s[h])}else c=s;return s=c.ref,{$$typeof:n,type:a,key:f,ref:s!==void 0?s:null,props:c}}return dl.Fragment=t,dl.jsx=o,dl.jsxs=o,dl}var Jp;function jx(){return Jp||(Jp=1,Pu.exports=Yx()),Pu.exports}var v=jx(),Gu={exports:{}},re={};/**
* @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 Yp;function Kx(){if(Yp)return re;Yp=1;var n=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),c=Symbol.for("react.consumer"),f=Symbol.for("react.context"),h=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),S=Symbol.iterator;function b(R){return R===null||typeof R!="object"?null:(R=S&&R[S]||R["@@iterator"],typeof R=="function"?R:null)}var C={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},I=Object.assign,w={};function G(R,J,Q){this.props=R,this.context=J,this.refs=w,this.updater=Q||C}G.prototype.isReactComponent={},G.prototype.setState=function(R,J){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,J,"setState")},G.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function V(){}V.prototype=G.prototype;function P(R,J,Q){this.props=R,this.context=J,this.refs=w,this.updater=Q||C}var Y=P.prototype=new V;Y.constructor=P,I(Y,G.prototype),Y.isPureReactComponent=!0;var X=Array.isArray;function B(){}var j={H:null,A:null,T:null,S:null},le=Object.prototype.hasOwnProperty;function Z(R,J,Q){var ee=Q.ref;return{$$typeof:n,type:R,key:J,ref:ee!==void 0?ee:null,props:Q}}function ae(R,J){return Z(R.type,J,R.props)}function be(R){return typeof R=="object"&&R!==null&&R.$$typeof===n}function Re(R){var J={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(Q){return J[Q]})}var Ve=/\/+/g;function ke(R,J){return typeof R=="object"&&R!==null&&R.key!=null?Re(""+R.key):J.toString(36)}function Ze(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(B,B):(R.status="pending",R.then(function(J){R.status==="pending"&&(R.status="fulfilled",R.value=J)},function(J){R.status==="pending"&&(R.status="rejected",R.reason=J)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function z(R,J,Q,ee,ce){var me=typeof R;(me==="undefined"||me==="boolean")&&(R=null);var Ne=!1;if(R===null)Ne=!0;else switch(me){case"bigint":case"string":case"number":Ne=!0;break;case"object":switch(R.$$typeof){case n:case t:Ne=!0;break;case x:return Ne=R._init,z(Ne(R._payload),J,Q,ee,ce)}}if(Ne)return ce=ce(R),Ne=ee===""?"."+ke(R,0):ee,X(ce)?(Q="",Ne!=null&&(Q=Ne.replace(Ve,"$&/")+"/"),z(ce,J,Q,"",function(vo){return vo})):ce!=null&&(be(ce)&&(ce=ae(ce,Q+(ce.key==null||R&&R.key===ce.key?"":(""+ce.key).replace(Ve,"$&/")+"/")+Ne)),J.push(ce)),1;Ne=0;var ut=ee===""?".":ee+":";if(X(R))for(var Be=0;Be<R.length;Be++)ee=R[Be],me=ut+ke(ee,Be),Ne+=z(ee,J,Q,me,ce);else if(Be=b(R),typeof Be=="function")for(R=Be.call(R),Be=0;!(ee=R.next()).done;)ee=ee.value,me=ut+ke(ee,Be++),Ne+=z(ee,J,Q,me,ce);else if(me==="object"){if(typeof R.then=="function")return z(Ze(R),J,Q,ee,ce);throw J=String(R),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.")}return Ne}function K(R,J,Q){if(R==null)return R;var ee=[],ce=0;return z(R,ee,"","",function(me){return J.call(Q,me,ce++)}),ee}function ne(R){if(R._status===-1){var J=R._result;J=J(),J.then(function(Q){(R._status===0||R._status===-1)&&(R._status=1,R._result=Q)},function(Q){(R._status===0||R._status===-1)&&(R._status=2,R._result=Q)}),R._status===-1&&(R._status=0,R._result=J)}if(R._status===1)return R._result.default;throw R._result}var xe=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var J=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(J))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)},Ue={map:K,forEach:function(R,J,Q){K(R,function(){J.apply(this,arguments)},Q)},count:function(R){var J=0;return K(R,function(){J++}),J},toArray:function(R){return K(R,function(J){return J})||[]},only:function(R){if(!be(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return re.Activity=E,re.Children=Ue,re.Component=G,re.Fragment=o,re.Profiler=s,re.PureComponent=P,re.StrictMode=a,re.Suspense=y,re.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=j,re.__COMPILER_RUNTIME={__proto__:null,c:function(R){return j.H.useMemoCache(R)}},re.cache=function(R){return function(){return R.apply(null,arguments)}},re.cacheSignal=function(){return null},re.cloneElement=function(R,J,Q){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ee=I({},R.props),ce=R.key;if(J!=null)for(me in J.key!==void 0&&(ce=""+J.key),J)!le.call(J,me)||me==="key"||me==="__self"||me==="__source"||me==="ref"&&J.ref===void 0||(ee[me]=J[me]);var me=arguments.length-2;if(me===1)ee.children=Q;else if(1<me){for(var Ne=Array(me),ut=0;ut<me;ut++)Ne[ut]=arguments[ut+2];ee.children=Ne}return Z(R.type,ce,ee)},re.createContext=function(R){return R={$$typeof:f,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:c,_context:R},R},re.createElement=function(R,J,Q){var ee,ce={},me=null;if(J!=null)for(ee in J.key!==void 0&&(me=""+J.key),J)le.call(J,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(ce[ee]=J[ee]);var Ne=arguments.length-2;if(Ne===1)ce.children=Q;else if(1<Ne){for(var ut=Array(Ne),Be=0;Be<Ne;Be++)ut[Be]=arguments[Be+2];ce.children=ut}if(R&&R.defaultProps)for(ee in Ne=R.defaultProps,Ne)ce[ee]===void 0&&(ce[ee]=Ne[ee]);return Z(R,me,ce)},re.createRef=function(){return{current:null}},re.forwardRef=function(R){return{$$typeof:h,render:R}},re.isValidElement=be,re.lazy=function(R){return{$$typeof:x,_payload:{_status:-1,_result:R},_init:ne}},re.memo=function(R,J){return{$$typeof:p,type:R,compare:J===void 0?null:J}},re.startTransition=function(R){var J=j.T,Q={};j.T=Q;try{var ee=R(),ce=j.S;ce!==null&&ce(Q,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(B,xe)}catch(me){xe(me)}finally{J!==null&&Q.types!==null&&(J.types=Q.types),j.T=J}},re.unstable_useCacheRefresh=function(){return j.H.useCacheRefresh()},re.use=function(R){return j.H.use(R)},re.useActionState=function(R,J,Q){return j.H.useActionState(R,J,Q)},re.useCallback=function(R,J){return j.H.useCallback(R,J)},re.useContext=function(R){return j.H.useContext(R)},re.useDebugValue=function(){},re.useDeferredValue=function(R,J){return j.H.useDeferredValue(R,J)},re.useEffect=function(R,J){return j.H.useEffect(R,J)},re.useEffectEvent=function(R){return j.H.useEffectEvent(R)},re.useId=function(){return j.H.useId()},re.useImperativeHandle=function(R,J,Q){return j.H.useImperativeHandle(R,J,Q)},re.useInsertionEffect=function(R,J){return j.H.useInsertionEffect(R,J)},re.useLayoutEffect=function(R,J){return j.H.useLayoutEffect(R,J)},re.useMemo=function(R,J){return j.H.useMemo(R,J)},re.useOptimistic=function(R,J){return j.H.useOptimistic(R,J)},re.useReducer=function(R,J,Q){return j.H.useReducer(R,J,Q)},re.useRef=function(R){return j.H.useRef(R)},re.useState=function(R){return j.H.useState(R)},re.useSyncExternalStore=function(R,J,Q){return j.H.useSyncExternalStore(R,J,Q)},re.useTransition=function(){return j.H.useTransition()},re.version="19.2.4",re}var jp;function vc(){return jp||(jp=1,Gu.exports=Kx()),Gu.exports}var L=vc();const Xx=yc(L);var qu={exports:{}},fl={},Vu={exports:{}},Hu={};/**
* @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 Kp;function $x(){return Kp||(Kp=1,(function(n){function t(z,K){var ne=z.length;z.push(K);e:for(;0<ne;){var xe=ne-1>>>1,Ue=z[xe];if(0<s(Ue,K))z[xe]=K,z[ne]=Ue,ne=xe;else break e}}function o(z){return z.length===0?null:z[0]}function a(z){if(z.length===0)return null;var K=z[0],ne=z.pop();if(ne!==K){z[0]=ne;e:for(var xe=0,Ue=z.length,R=Ue>>>1;xe<R;){var J=2*(xe+1)-1,Q=z[J],ee=J+1,ce=z[ee];if(0>s(Q,ne))ee<Ue&&0>s(ce,Q)?(z[xe]=ce,z[ee]=ne,xe=ee):(z[xe]=Q,z[J]=ne,xe=J);else if(ee<Ue&&0>s(ce,ne))z[xe]=ce,z[ee]=ne,xe=ee;else break e}}return K}function s(z,K){var ne=z.sortIndex-K.sortIndex;return ne!==0?ne:z.id-K.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var c=performance;n.unstable_now=function(){return c.now()}}else{var f=Date,h=f.now();n.unstable_now=function(){return f.now()-h}}var y=[],p=[],x=1,E=null,S=3,b=!1,C=!1,I=!1,w=!1,G=typeof setTimeout=="function"?setTimeout:null,V=typeof clearTimeout=="function"?clearTimeout:null,P=typeof setImmediate<"u"?setImmediate:null;function Y(z){for(var K=o(p);K!==null;){if(K.callback===null)a(p);else if(K.startTime<=z)a(p),K.sortIndex=K.expirationTime,t(y,K);else break;K=o(p)}}function X(z){if(I=!1,Y(z),!C)if(o(y)!==null)C=!0,B||(B=!0,Re());else{var K=o(p);K!==null&&Ze(X,K.startTime-z)}}var B=!1,j=-1,le=5,Z=-1;function ae(){return w?!0:!(n.unstable_now()-Z<le)}function be(){if(w=!1,B){var z=n.unstable_now();Z=z;var K=!0;try{e:{C=!1,I&&(I=!1,V(j),j=-1),b=!0;var ne=S;try{t:{for(Y(z),E=o(y);E!==null&&!(E.expirationTime>z&&ae());){var xe=E.callback;if(typeof xe=="function"){E.callback=null,S=E.priorityLevel;var Ue=xe(E.expirationTime<=z);if(z=n.unstable_now(),typeof Ue=="function"){E.callback=Ue,Y(z),K=!0;break t}E===o(y)&&a(y),Y(z)}else a(y);E=o(y)}if(E!==null)K=!0;else{var R=o(p);R!==null&&Ze(X,R.startTime-z),K=!1}}break e}finally{E=null,S=ne,b=!1}K=void 0}}finally{K?Re():B=!1}}}var Re;if(typeof P=="function")Re=function(){P(be)};else if(typeof MessageChannel<"u"){var Ve=new MessageChannel,ke=Ve.port2;Ve.port1.onmessage=be,Re=function(){ke.postMessage(null)}}else Re=function(){G(be,0)};function Ze(z,K){j=G(function(){z(n.unstable_now())},K)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(z){z.callback=null},n.unstable_forceFrameRate=function(z){0>z||125<z?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):le=0<z?Math.floor(1e3/z):5},n.unstable_getCurrentPriorityLevel=function(){return S},n.unstable_next=function(z){switch(S){case 1:case 2:case 3:var K=3;break;default:K=S}var ne=S;S=K;try{return z()}finally{S=ne}},n.unstable_requestPaint=function(){w=!0},n.unstable_runWithPriority=function(z,K){switch(z){case 1:case 2:case 3:case 4:case 5:break;default:z=3}var ne=S;S=z;try{return K()}finally{S=ne}},n.unstable_scheduleCallback=function(z,K,ne){var xe=n.unstable_now();switch(typeof ne=="object"&&ne!==null?(ne=ne.delay,ne=typeof ne=="number"&&0<ne?xe+ne:xe):ne=xe,z){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=ne+Ue,z={id:x++,callback:K,priorityLevel:z,startTime:ne,expirationTime:Ue,sortIndex:-1},ne>xe?(z.sortIndex=ne,t(p,z),o(y)===null&&z===o(p)&&(I?(V(j),j=-1):I=!0,Ze(X,ne-xe))):(z.sortIndex=Ue,t(y,z),C||b||(C=!0,B||(B=!0,Re()))),z},n.unstable_shouldYield=ae,n.unstable_wrapCallback=function(z){var K=S;return function(){var ne=S;S=K;try{return z.apply(this,arguments)}finally{S=ne}}}})(Hu)),Hu}var Xp;function Qx(){return Xp||(Xp=1,Vu.exports=$x()),Vu.exports}var zu={exports:{}},rt={};/**
* @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 $p;function Zx(){if($p)return rt;$p=1;var n=vc();function t(y){var p="https://react.dev/errors/"+y;if(1<arguments.length){p+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)p+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+y+"; visit "+p+" 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},s=Symbol.for("react.portal");function c(y,p,x){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:E==null?null:""+E,children:y,containerInfo:p,implementation:x}}var f=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function h(y,p){if(y==="font")return"";if(typeof p=="string")return p==="use-credentials"?p:""}return rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=a,rt.createPortal=function(y,p){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!p||p.nodeType!==1&&p.nodeType!==9&&p.nodeType!==11)throw Error(t(299));return c(y,p,null,x)},rt.flushSync=function(y){var p=f.T,x=a.p;try{if(f.T=null,a.p=2,y)return y()}finally{f.T=p,a.p=x,a.d.f()}},rt.preconnect=function(y,p){typeof y=="string"&&(p?(p=p.crossOrigin,p=typeof p=="string"?p==="use-credentials"?p:"":void 0):p=null,a.d.C(y,p))},rt.prefetchDNS=function(y){typeof y=="string"&&a.d.D(y)},rt.preinit=function(y,p){if(typeof y=="string"&&p&&typeof p.as=="string"){var x=p.as,E=h(x,p.crossOrigin),S=typeof p.integrity=="string"?p.integrity:void 0,b=typeof p.fetchPriority=="string"?p.fetchPriority:void 0;x==="style"?a.d.S(y,typeof p.precedence=="string"?p.precedence:void 0,{crossOrigin:E,integrity:S,fetchPriority:b}):x==="script"&&a.d.X(y,{crossOrigin:E,integrity:S,fetchPriority:b,nonce:typeof p.nonce=="string"?p.nonce:void 0})}},rt.preinitModule=function(y,p){if(typeof y=="string")if(typeof p=="object"&&p!==null){if(p.as==null||p.as==="script"){var x=h(p.as,p.crossOrigin);a.d.M(y,{crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0})}}else p==null&&a.d.M(y)},rt.preload=function(y,p){if(typeof y=="string"&&typeof p=="object"&&p!==null&&typeof p.as=="string"){var x=p.as,E=h(x,p.crossOrigin);a.d.L(y,x,{crossOrigin:E,integrity:typeof p.integrity=="string"?p.integrity:void 0,nonce:typeof p.nonce=="string"?p.nonce:void 0,type:typeof p.type=="string"?p.type:void 0,fetchPriority:typeof p.fetchPriority=="string"?p.fetchPriority:void 0,referrerPolicy:typeof p.referrerPolicy=="string"?p.referrerPolicy:void 0,imageSrcSet:typeof p.imageSrcSet=="string"?p.imageSrcSet:void 0,imageSizes:typeof p.imageSizes=="string"?p.imageSizes:void 0,media:typeof p.media=="string"?p.media:void 0})}},rt.preloadModule=function(y,p){if(typeof y=="string")if(p){var x=h(p.as,p.crossOrigin);a.d.m(y,{as:typeof p.as=="string"&&p.as!=="script"?p.as:void 0,crossOrigin:x,integrity:typeof p.integrity=="string"?p.integrity:void 0})}else a.d.m(y)},rt.requestFormReset=function(y){a.d.r(y)},rt.unstable_batchedUpdates=function(y,p){return y(p)},rt.useFormState=function(y,p,x){return f.H.useFormState(y,p,x)},rt.useFormStatus=function(){return f.H.useHostTransitionStatus()},rt.version="19.2.4",rt}var Qp;function Wx(){if(Qp)return zu.exports;Qp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),zu.exports=Zx(),zu.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 eE(){if(Zp)return fl;Zp=1;var n=Qx(),t=vc(),o=Wx();function a(e){var i="https://react.dev/errors/"+e;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}return"Minified React error #"+e+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function c(e){var i=e,l=e;if(e.alternate)for(;i.return;)i=i.return;else{e=i;do i=e,(i.flags&4098)!==0&&(l=i.return),e=i.return;while(e)}return i.tag===3?l:null}function f(e){if(e.tag===13){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function h(e){if(e.tag===31){var i=e.memoizedState;if(i===null&&(e=e.alternate,e!==null&&(i=e.memoizedState)),i!==null)return i.dehydrated}return null}function y(e){if(c(e)!==e)throw Error(a(188))}function p(e){var i=e.alternate;if(!i){if(i=c(e),i===null)throw Error(a(188));return i!==e?null:e}for(var l=e,r=i;;){var m=l.return;if(m===null)break;var g=m.alternate;if(g===null){if(r=m.return,r!==null){l=r;continue}break}if(m.child===g.child){for(g=m.child;g;){if(g===l)return y(m),e;if(g===r)return y(m),i;g=g.sibling}throw Error(a(188))}if(l.return!==r.return)l=m,r=g;else{for(var T=!1,_=m.child;_;){if(_===l){T=!0,l=m,r=g;break}if(_===r){T=!0,r=m,l=g;break}_=_.sibling}if(!T){for(_=g.child;_;){if(_===l){T=!0,l=g,r=m;break}if(_===r){T=!0,r=g,l=m;break}_=_.sibling}if(!T)throw Error(a(189))}}if(l.alternate!==r)throw Error(a(190))}if(l.tag!==3)throw Error(a(188));return l.stateNode.current===l?e:i}function x(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e;for(e=e.child;e!==null;){if(i=x(e),i!==null)return i;e=e.sibling}return null}var E=Object.assign,S=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),C=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),V=Symbol.for("react.consumer"),P=Symbol.for("react.context"),Y=Symbol.for("react.forward_ref"),X=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),j=Symbol.for("react.memo"),le=Symbol.for("react.lazy"),Z=Symbol.for("react.activity"),ae=Symbol.for("react.memo_cache_sentinel"),be=Symbol.iterator;function Re(e){return e===null||typeof e!="object"?null:(e=be&&e[be]||e["@@iterator"],typeof e=="function"?e:null)}var Ve=Symbol.for("react.client.reference");function ke(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ve?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case I:return"Fragment";case G:return"Profiler";case w:return"StrictMode";case X:return"Suspense";case B:return"SuspenseList";case Z:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case C:return"Portal";case P:return e.displayName||"Context";case V:return(e._context.displayName||"Context")+".Consumer";case Y:var i=e.render;return e=e.displayName,e||(e=i.displayName||i.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case j:return i=e.displayName||null,i!==null?i:ke(e.type)||"Memo";case le:i=e._payload,e=e._init;try{return ke(e(i))}catch{}}return null}var Ze=Array.isArray,z=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne={pending:!1,data:null,method:null,action:null},xe=[],Ue=-1;function R(e){return{current:e}}function J(e){0>Ue||(e.current=xe[Ue],xe[Ue]=null,Ue--)}function Q(e,i){Ue++,xe[Ue]=e.current,e.current=i}var ee=R(null),ce=R(null),me=R(null),Ne=R(null);function ut(e,i){switch(Q(me,i),Q(ce,e),Q(ee,null),i.nodeType){case 9:case 11:e=(e=i.documentElement)&&(e=e.namespaceURI)?mp(e):0;break;default:if(e=i.tagName,i=i.namespaceURI)i=mp(i),e=pp(i,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}J(ee),Q(ee,e)}function Be(){J(ee),J(ce),J(me)}function vo(e){e.memoizedState!==null&&Q(Ne,e);var i=ee.current,l=pp(i,e.type);i!==l&&(Q(ce,e),Q(ee,l))}function Cl(e){ce.current===e&&(J(ee),J(ce)),Ne.current===e&&(J(Ne),sl._currentValue=ne)}var vs,Oc;function ti(e){if(vs===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);vs=i&&i[1]||"",Oc=-1<l.stack.indexOf(`
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
`+vs+e+Oc}var xs=!1;function Es(e,i){if(!e||xs)return"";xs=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(i){var F=function(){throw Error()};if(Object.defineProperty(F.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(F,[])}catch(q){var k=q}Reflect.construct(e,[],F)}else{try{F.call()}catch(q){k=q}e.call(F.prototype)}}else{try{throw Error()}catch(q){k=q}(F=e())&&typeof F.catch=="function"&&F.catch(function(){})}}catch(q){if(q&&k&&typeof q.stack=="string")return[q.stack,k.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var m=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");m&&m.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var g=r.DetermineComponentFrameRoot(),T=g[0],_=g[1];if(T&&_){var N=T.split(`
`),U=_.split(`
`);for(m=r=0;r<N.length&&!N[r].includes("DetermineComponentFrameRoot");)r++;for(;m<U.length&&!U[m].includes("DetermineComponentFrameRoot");)m++;if(r===N.length||m===U.length)for(r=N.length-1,m=U.length-1;1<=r&&0<=m&&N[r]!==U[m];)m--;for(;1<=r&&0<=m;r--,m--)if(N[r]!==U[m]){if(r!==1||m!==1)do if(r--,m--,0>m||N[r]!==U[m]){var H=`
`+N[r].replace(" at new "," at ");return e.displayName&&H.includes("<anonymous>")&&(H=H.replace("<anonymous>",e.displayName)),H}while(1<=r&&0<=m);break}}}finally{xs=!1,Error.prepareStackTrace=l}return(l=e?e.displayName||e.name:"")?ti(l):""}function _y(e,i){switch(e.tag){case 26:case 27:case 5:return ti(e.type);case 16:return ti("Lazy");case 13:return e.child!==i&&i!==null?ti("Suspense Fallback"):ti("Suspense");case 19:return ti("SuspenseList");case 0:case 15:return Es(e.type,!1);case 11:return Es(e.type.render,!1);case 1:return Es(e.type,!0);case 31:return ti("Activity");default:return""}}function Bc(e){try{var i="",l=null;do i+=_y(e,l),l=e,e=e.return;while(e);return i}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}var Ts=Object.prototype.hasOwnProperty,Ss=n.unstable_scheduleCallback,_s=n.unstable_cancelCallback,by=n.unstable_shouldYield,Cy=n.unstable_requestPaint,Et=n.unstable_now,Ny=n.unstable_getCurrentPriorityLevel,Fc=n.unstable_ImmediatePriority,Jc=n.unstable_UserBlockingPriority,Nl=n.unstable_NormalPriority,Ay=n.unstable_LowPriority,Yc=n.unstable_IdlePriority,wy=n.log,Ry=n.unstable_setDisableYieldValue,xo=null,Tt=null;function wn(e){if(typeof wy=="function"&&Ry(e),Tt&&typeof Tt.setStrictMode=="function")try{Tt.setStrictMode(xo,e)}catch{}}var St=Math.clz32?Math.clz32:Dy,My=Math.log,Iy=Math.LN2;function Dy(e){return e>>>=0,e===0?32:31-(My(e)/Iy|0)|0}var Al=256,wl=262144,Rl=4194304;function ni(e){var i=e&42;if(i!==0)return i;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 Ml(e,i,l){var r=e.pendingLanes;if(r===0)return 0;var m=0,g=e.suspendedLanes,T=e.pingedLanes;e=e.warmLanes;var _=r&134217727;return _!==0?(r=_&~g,r!==0?m=ni(r):(T&=_,T!==0?m=ni(T):l||(l=_&~e,l!==0&&(m=ni(l))))):(_=r&~g,_!==0?m=ni(_):T!==0?m=ni(T):l||(l=r&~e,l!==0&&(m=ni(l)))),m===0?0:i!==0&&i!==m&&(i&g)===0&&(g=m&-m,l=i&-i,g>=l||g===32&&(l&4194048)!==0)?i:m}function Eo(e,i){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&i)===0}function Uy(e,i){switch(e){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function jc(){var e=Rl;return Rl<<=1,(Rl&62914560)===0&&(Rl=4194304),e}function bs(e){for(var i=[],l=0;31>l;l++)i.push(e);return i}function To(e,i){e.pendingLanes|=i,i!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ly(e,i,l,r,m,g){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 _=e.entanglements,N=e.expirationTimes,U=e.hiddenUpdates;for(l=T&~l;0<l;){var H=31-St(l),F=1<<H;_[H]=0,N[H]=-1;var k=U[H];if(k!==null)for(U[H]=null,H=0;H<k.length;H++){var q=k[H];q!==null&&(q.lane&=-536870913)}l&=~F}r!==0&&Kc(e,r,0),g!==0&&m===0&&e.tag!==0&&(e.suspendedLanes|=g&~(T&~i))}function Kc(e,i,l){e.pendingLanes|=i,e.suspendedLanes&=~i;var r=31-St(i);e.entangledLanes|=i,e.entanglements[r]=e.entanglements[r]|1073741824|l&261930}function Xc(e,i){var l=e.entangledLanes|=i;for(e=e.entanglements;l;){var r=31-St(l),m=1<<r;m&i|e[r]&i&&(e[r]|=i),l&=~m}}function $c(e,i){var l=i&-i;return l=(l&42)!==0?1:Cs(l),(l&(e.suspendedLanes|i))!==0?0:l}function Cs(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 Ns(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Qc(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Gp(e.type))}function Zc(e,i){var l=K.p;try{return K.p=e,i()}finally{K.p=l}}var Rn=Math.random().toString(36).slice(2),it="__reactFiber$"+Rn,mt="__reactProps$"+Rn,_i="__reactContainer$"+Rn,As="__reactEvents$"+Rn,ky="__reactListeners$"+Rn,Py="__reactHandles$"+Rn,Wc="__reactResources$"+Rn,So="__reactMarker$"+Rn;function ws(e){delete e[it],delete e[mt],delete e[As],delete e[ky],delete e[Py]}function bi(e){var i=e[it];if(i)return i;for(var l=e.parentNode;l;){if(i=l[_i]||l[it]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(e=Tp(e);e!==null;){if(l=e[it])return l;e=Tp(e)}return i}e=l,l=e.parentNode}return null}function Ci(e){if(e=e[it]||e[_i]){var i=e.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return e}return null}function _o(e){var i=e.tag;if(i===5||i===26||i===27||i===6)return e.stateNode;throw Error(a(33))}function Ni(e){var i=e[Wc];return i||(i=e[Wc]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function We(e){e[So]=!0}var ed=new Set,td={};function ii(e,i){Ai(e,i),Ai(e+"Capture",i)}function Ai(e,i){for(td[e]=i,e=0;e<i.length;e++)ed.add(i[e])}var Gy=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]*$"),nd={},id={};function qy(e){return Ts.call(id,e)?!0:Ts.call(nd,e)?!1:Gy.test(e)?id[e]=!0:(nd[e]=!0,!1)}function Il(e,i,l){if(qy(i))if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":e.removeAttribute(i);return;case"boolean":var r=i.toLowerCase().slice(0,5);if(r!=="data-"&&r!=="aria-"){e.removeAttribute(i);return}}e.setAttribute(i,""+l)}}function Dl(e,i,l){if(l===null)e.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(i);return}e.setAttribute(i,""+l)}}function on(e,i,l,r){if(r===null)e.removeAttribute(l);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(l);return}e.setAttributeNS(i,l,""+r)}}function It(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function od(e){var i=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function Vy(e,i,l){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,i);if(!e.hasOwnProperty(i)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var m=r.get,g=r.set;return Object.defineProperty(e,i,{configurable:!0,get:function(){return m.call(this)},set:function(T){l=""+T,g.call(this,T)}}),Object.defineProperty(e,i,{enumerable:r.enumerable}),{getValue:function(){return l},setValue:function(T){l=""+T},stopTracking:function(){e._valueTracker=null,delete e[i]}}}}function Rs(e){if(!e._valueTracker){var i=od(e)?"checked":"value";e._valueTracker=Vy(e,i,""+e[i])}}function ld(e){if(!e)return!1;var i=e._valueTracker;if(!i)return!0;var l=i.getValue(),r="";return e&&(r=od(e)?e.checked?"true":"false":e.value),e=r,e!==l?(i.setValue(e),!0):!1}function Ul(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 Hy=/[\n"\\]/g;function Dt(e){return e.replace(Hy,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function Ms(e,i,l,r,m,g,T,_){e.name="",T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"?e.type=T:e.removeAttribute("type"),i!=null?T==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+It(i)):e.value!==""+It(i)&&(e.value=""+It(i)):T!=="submit"&&T!=="reset"||e.removeAttribute("value"),i!=null?Is(e,T,It(i)):l!=null?Is(e,T,It(l)):r!=null&&e.removeAttribute("value"),m==null&&g!=null&&(e.defaultChecked=!!g),m!=null&&(e.checked=m&&typeof m!="function"&&typeof m!="symbol"),_!=null&&typeof _!="function"&&typeof _!="symbol"&&typeof _!="boolean"?e.name=""+It(_):e.removeAttribute("name")}function ad(e,i,l,r,m,g,T,_){if(g!=null&&typeof g!="function"&&typeof g!="symbol"&&typeof g!="boolean"&&(e.type=g),i!=null||l!=null){if(!(g!=="submit"&&g!=="reset"||i!=null)){Rs(e);return}l=l!=null?""+It(l):"",i=i!=null?""+It(i):l,_||i===e.value||(e.value=i),e.defaultValue=i}r=r??m,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=_?e.checked:!!r,e.defaultChecked=!!r,T!=null&&typeof T!="function"&&typeof T!="symbol"&&typeof T!="boolean"&&(e.name=T),Rs(e)}function Is(e,i,l){i==="number"&&Ul(e.ownerDocument)===e||e.defaultValue===""+l||(e.defaultValue=""+l)}function wi(e,i,l,r){if(e=e.options,i){i={};for(var m=0;m<l.length;m++)i["$"+l[m]]=!0;for(l=0;l<e.length;l++)m=i.hasOwnProperty("$"+e[l].value),e[l].selected!==m&&(e[l].selected=m),m&&r&&(e[l].defaultSelected=!0)}else{for(l=""+It(l),i=null,m=0;m<e.length;m++){if(e[m].value===l){e[m].selected=!0,r&&(e[m].defaultSelected=!0);return}i!==null||e[m].disabled||(i=e[m])}i!==null&&(i.selected=!0)}}function sd(e,i,l){if(i!=null&&(i=""+It(i),i!==e.value&&(e.value=i),l==null)){e.defaultValue!==i&&(e.defaultValue=i);return}e.defaultValue=l!=null?""+It(l):""}function rd(e,i,l,r){if(i==null){if(r!=null){if(l!=null)throw Error(a(92));if(Ze(r)){if(1<r.length)throw Error(a(93));r=r[0]}l=r}l==null&&(l=""),i=l}l=It(i),e.defaultValue=l,r=e.textContent,r===l&&r!==""&&r!==null&&(e.value=r),Rs(e)}function Ri(e,i){if(i){var l=e.firstChild;if(l&&l===e.lastChild&&l.nodeType===3){l.nodeValue=i;return}}e.textContent=i}var zy=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 ud(e,i,l){var r=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?r?e.setProperty(i,""):i==="float"?e.cssFloat="":e[i]="":r?e.setProperty(i,l):typeof l!="number"||l===0||zy.has(i)?i==="float"?e.cssFloat=l:e[i]=(""+l).trim():e[i]=l+"px"}function cd(e,i,l){if(i!=null&&typeof i!="object")throw Error(a(62));if(e=e.style,l!=null){for(var r in l)!l.hasOwnProperty(r)||i!=null&&i.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var m in i)r=i[m],i.hasOwnProperty(m)&&l[m]!==r&&ud(e,m,r)}else for(var g in i)i.hasOwnProperty(g)&&ud(e,g,i[g])}function Ds(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 Oy=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"]]),By=/^[\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 Ll(e){return By.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ln(){}var Us=null;function Ls(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Mi=null,Ii=null;function dd(e){var i=Ci(e);if(i&&(e=i.stateNode)){var l=e[mt]||null;e:switch(e=i.stateNode,i.type){case"input":if(Ms(e,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=e;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Dt(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var r=l[i];if(r!==e&&r.form===e.form){var m=r[mt]||null;if(!m)throw Error(a(90));Ms(r,m.value,m.defaultValue,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name)}}for(i=0;i<l.length;i++)r=l[i],r.form===e.form&&ld(r)}break e;case"textarea":sd(e,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&wi(e,!!l.multiple,i,!1)}}}var ks=!1;function fd(e,i,l){if(ks)return e(i,l);ks=!0;try{var r=e(i);return r}finally{if(ks=!1,(Mi!==null||Ii!==null)&&(Ta(),Mi&&(i=Mi,e=Ii,Ii=Mi=null,dd(i),e)))for(i=0;i<e.length;i++)dd(e[i])}}function bo(e,i){var l=e.stateNode;if(l===null)return null;var r=l[mt]||null;if(r===null)return null;l=r[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(l&&typeof l!="function")throw Error(a(231,i,typeof l));return l}var an=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Ps=!1;if(an)try{var Co={};Object.defineProperty(Co,"passive",{get:function(){Ps=!0}}),window.addEventListener("test",Co,Co),window.removeEventListener("test",Co,Co)}catch{Ps=!1}var Mn=null,Gs=null,kl=null;function md(){if(kl)return kl;var e,i=Gs,l=i.length,r,m="value"in Mn?Mn.value:Mn.textContent,g=m.length;for(e=0;e<l&&i[e]===m[e];e++);var T=l-e;for(r=1;r<=T&&i[l-r]===m[g-r];r++);return kl=m.slice(e,1<r?1-r:void 0)}function Pl(e){var i=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&i===13&&(e=13)):e=i,e===10&&(e=13),32<=e||e===13?e:0}function Gl(){return!0}function pd(){return!1}function pt(e){function i(l,r,m,g,T){this._reactName=l,this._targetInst=m,this.type=r,this.nativeEvent=g,this.target=T,this.currentTarget=null;for(var _ in e)e.hasOwnProperty(_)&&(l=e[_],this[_]=l?l(g):g[_]);return this.isDefaultPrevented=(g.defaultPrevented!=null?g.defaultPrevented:g.returnValue===!1)?Gl:pd,this.isPropagationStopped=pd,this}return E(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Gl)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Gl)},persist:function(){},isPersistent:Gl}),i}var oi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ql=pt(oi),No=E({},oi,{view:0,detail:0}),Fy=pt(No),qs,Vs,Ao,Vl=E({},No,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:zs,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!==Ao&&(Ao&&e.type==="mousemove"?(qs=e.screenX-Ao.screenX,Vs=e.screenY-Ao.screenY):Vs=qs=0,Ao=e),qs)},movementY:function(e){return"movementY"in e?e.movementY:Vs}}),hd=pt(Vl),Jy=E({},Vl,{dataTransfer:0}),Yy=pt(Jy),jy=E({},No,{relatedTarget:0}),Hs=pt(jy),Ky=E({},oi,{animationName:0,elapsedTime:0,pseudoElement:0}),Xy=pt(Ky),$y=E({},oi,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Qy=pt($y),Zy=E({},oi,{data:0}),gd=pt(Zy),Wy={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ev={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"},tv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nv(e){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(e):(e=tv[e])?!!i[e]:!1}function zs(){return nv}var iv=E({},No,{key:function(e){if(e.key){var i=Wy[e.key]||e.key;if(i!=="Unidentified")return i}return e.type==="keypress"?(e=Pl(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ev[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:zs,charCode:function(e){return e.type==="keypress"?Pl(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Pl(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ov=pt(iv),lv=E({},Vl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yd=pt(lv),av=E({},No,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:zs}),sv=pt(av),rv=E({},oi,{propertyName:0,elapsedTime:0,pseudoElement:0}),uv=pt(rv),cv=E({},Vl,{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}),dv=pt(cv),fv=E({},oi,{newState:0,oldState:0}),mv=pt(fv),pv=[9,13,27,32],Os=an&&"CompositionEvent"in window,wo=null;an&&"documentMode"in document&&(wo=document.documentMode);var hv=an&&"TextEvent"in window&&!wo,vd=an&&(!Os||wo&&8<wo&&11>=wo),xd=" ",Ed=!1;function Td(e,i){switch(e){case"keyup":return pv.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Sd(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Di=!1;function gv(e,i){switch(e){case"compositionend":return Sd(i);case"keypress":return i.which!==32?null:(Ed=!0,xd);case"textInput":return e=i.data,e===xd&&Ed?null:e;default:return null}}function yv(e,i){if(Di)return e==="compositionend"||!Os&&Td(e,i)?(e=md(),kl=Gs=Mn=null,Di=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return vd&&i.locale!=="ko"?null:i.data;default:return null}}var vv={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 _d(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i==="input"?!!vv[e.type]:i==="textarea"}function bd(e,i,l,r){Mi?Ii?Ii.push(r):Ii=[r]:Mi=r,i=wa(i,"onChange"),0<i.length&&(l=new ql("onChange","change",null,l,r),e.push({event:l,listeners:i}))}var Ro=null,Mo=null;function xv(e){sp(e,0)}function Hl(e){var i=_o(e);if(ld(i))return e}function Cd(e,i){if(e==="change")return i}var Nd=!1;if(an){var Bs;if(an){var Fs="oninput"in document;if(!Fs){var Ad=document.createElement("div");Ad.setAttribute("oninput","return;"),Fs=typeof Ad.oninput=="function"}Bs=Fs}else Bs=!1;Nd=Bs&&(!document.documentMode||9<document.documentMode)}function wd(){Ro&&(Ro.detachEvent("onpropertychange",Rd),Mo=Ro=null)}function Rd(e){if(e.propertyName==="value"&&Hl(Mo)){var i=[];bd(i,Mo,e,Ls(e)),fd(xv,i)}}function Ev(e,i,l){e==="focusin"?(wd(),Ro=i,Mo=l,Ro.attachEvent("onpropertychange",Rd)):e==="focusout"&&wd()}function Tv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Hl(Mo)}function Sv(e,i){if(e==="click")return Hl(i)}function _v(e,i){if(e==="input"||e==="change")return Hl(i)}function bv(e,i){return e===i&&(e!==0||1/e===1/i)||e!==e&&i!==i}var _t=typeof Object.is=="function"?Object.is:bv;function Io(e,i){if(_t(e,i))return!0;if(typeof e!="object"||e===null||typeof i!="object"||i===null)return!1;var l=Object.keys(e),r=Object.keys(i);if(l.length!==r.length)return!1;for(r=0;r<l.length;r++){var m=l[r];if(!Ts.call(i,m)||!_t(e[m],i[m]))return!1}return!0}function Md(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Id(e,i){var l=Md(e);e=0;for(var r;l;){if(l.nodeType===3){if(r=e+l.textContent.length,e<=i&&r>=i)return{node:l,offset:i-e};e=r}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Md(l)}}function Dd(e,i){return e&&i?e===i?!0:e&&e.nodeType===3?!1:i&&i.nodeType===3?Dd(e,i.parentNode):"contains"in e?e.contains(i):e.compareDocumentPosition?!!(e.compareDocumentPosition(i)&16):!1:!1}function Ud(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var i=Ul(e.document);i instanceof e.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)e=i.contentWindow;else break;i=Ul(e.document)}return i}function Js(e){var i=e&&e.nodeName&&e.nodeName.toLowerCase();return i&&(i==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||i==="textarea"||e.contentEditable==="true")}var Cv=an&&"documentMode"in document&&11>=document.documentMode,Ui=null,Ys=null,Do=null,js=!1;function Ld(e,i,l){var r=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;js||Ui==null||Ui!==Ul(r)||(r=Ui,"selectionStart"in r&&Js(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Do&&Io(Do,r)||(Do=r,r=wa(Ys,"onSelect"),0<r.length&&(i=new ql("onSelect","select",null,i,l),e.push({event:i,listeners:r}),i.target=Ui)))}function li(e,i){var l={};return l[e.toLowerCase()]=i.toLowerCase(),l["Webkit"+e]="webkit"+i,l["Moz"+e]="moz"+i,l}var Li={animationend:li("Animation","AnimationEnd"),animationiteration:li("Animation","AnimationIteration"),animationstart:li("Animation","AnimationStart"),transitionrun:li("Transition","TransitionRun"),transitionstart:li("Transition","TransitionStart"),transitioncancel:li("Transition","TransitionCancel"),transitionend:li("Transition","TransitionEnd")},Ks={},kd={};an&&(kd=document.createElement("div").style,"AnimationEvent"in window||(delete Li.animationend.animation,delete Li.animationiteration.animation,delete Li.animationstart.animation),"TransitionEvent"in window||delete Li.transitionend.transition);function ai(e){if(Ks[e])return Ks[e];if(!Li[e])return e;var i=Li[e],l;for(l in i)if(i.hasOwnProperty(l)&&l in kd)return Ks[e]=i[l];return e}var Pd=ai("animationend"),Gd=ai("animationiteration"),qd=ai("animationstart"),Nv=ai("transitionrun"),Av=ai("transitionstart"),wv=ai("transitioncancel"),Vd=ai("transitionend"),Hd=new Map,Xs="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(" ");Xs.push("scrollEnd");function Bt(e,i){Hd.set(e,i),ii(i,[e])}var zl=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=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(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},Ut=[],ki=0,$s=0;function Ol(){for(var e=ki,i=$s=ki=0;i<e;){var l=Ut[i];Ut[i++]=null;var r=Ut[i];Ut[i++]=null;var m=Ut[i];Ut[i++]=null;var g=Ut[i];if(Ut[i++]=null,r!==null&&m!==null){var T=r.pending;T===null?m.next=m:(m.next=T.next,T.next=m),r.pending=m}g!==0&&zd(l,m,g)}}function Bl(e,i,l,r){Ut[ki++]=e,Ut[ki++]=i,Ut[ki++]=l,Ut[ki++]=r,$s|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Qs(e,i,l,r){return Bl(e,i,l,r),Fl(e)}function si(e,i){return Bl(e,null,null,i),Fl(e)}function zd(e,i,l){e.lanes|=l;var r=e.alternate;r!==null&&(r.lanes|=l);for(var m=!1,g=e.return;g!==null;)g.childLanes|=l,r=g.alternate,r!==null&&(r.childLanes|=l),g.tag===22&&(e=g.stateNode,e===null||e._visibility&1||(m=!0)),e=g,g=g.return;return e.tag===3?(g=e.stateNode,m&&i!==null&&(m=31-St(l),e=g.hiddenUpdates,r=e[m],r===null?e[m]=[i]:r.push(i),i.lane=l|536870912),g):null}function Fl(e){if(50<el)throw el=0,au=null,Error(a(185));for(var i=e.return;i!==null;)e=i,i=e.return;return e.tag===3?e.stateNode:null}var Pi={};function Rv(e,i,l,r){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=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function bt(e,i,l,r){return new Rv(e,i,l,r)}function Zs(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sn(e,i){var l=e.alternate;return l===null?(l=bt(e.tag,i,e.key,e.mode),l.elementType=e.elementType,l.type=e.type,l.stateNode=e.stateNode,l.alternate=e,e.alternate=l):(l.pendingProps=i,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,i=e.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=e.sibling,l.index=e.index,l.ref=e.ref,l.refCleanup=e.refCleanup,l}function Od(e,i){e.flags&=65011714;var l=e.alternate;return l===null?(e.childLanes=0,e.lanes=i,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,i=l.dependencies,e.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),e}function Jl(e,i,l,r,m,g){var T=0;if(r=e,typeof e=="function")Zs(e)&&(T=1);else if(typeof e=="string")T=Lx(e,l,ee.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case Z:return e=bt(31,l,i,m),e.elementType=Z,e.lanes=g,e;case I:return ri(l.children,m,g,i);case w:T=8,m|=24;break;case G:return e=bt(12,l,i,m|2),e.elementType=G,e.lanes=g,e;case X:return e=bt(13,l,i,m),e.elementType=X,e.lanes=g,e;case B:return e=bt(19,l,i,m),e.elementType=B,e.lanes=g,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case P:T=10;break e;case V:T=9;break e;case Y:T=11;break e;case j:T=14;break e;case le:T=16,r=null;break e}T=29,l=Error(a(130,e===null?"null":typeof e,"")),r=null}return i=bt(T,l,i,m),i.elementType=e,i.type=r,i.lanes=g,i}function ri(e,i,l,r){return e=bt(7,e,r,i),e.lanes=l,e}function Ws(e,i,l){return e=bt(6,e,null,i),e.lanes=l,e}function Bd(e){var i=bt(18,null,null,0);return i.stateNode=e,i}function er(e,i,l){return i=bt(4,e.children!==null?e.children:[],e.key,i),i.lanes=l,i.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},i}var Fd=new WeakMap;function Lt(e,i){if(typeof e=="object"&&e!==null){var l=Fd.get(e);return l!==void 0?l:(i={value:e,source:i,stack:Bc(i)},Fd.set(e,i),i)}return{value:e,source:i,stack:Bc(i)}}var Gi=[],qi=0,Yl=null,Uo=0,kt=[],Pt=0,In=null,Qt=1,Zt="";function rn(e,i){Gi[qi++]=Uo,Gi[qi++]=Yl,Yl=e,Uo=i}function Jd(e,i,l){kt[Pt++]=Qt,kt[Pt++]=Zt,kt[Pt++]=In,In=e;var r=Qt;e=Zt;var m=32-St(r)-1;r&=~(1<<m),l+=1;var g=32-St(i)+m;if(30<g){var T=m-m%5;g=(r&(1<<T)-1).toString(32),r>>=T,m-=T,Qt=1<<32-St(i)+m|l<<m|r,Zt=g+e}else Qt=1<<g|l<<m|r,Zt=e}function tr(e){e.return!==null&&(rn(e,1),Jd(e,1,0))}function nr(e){for(;e===Yl;)Yl=Gi[--qi],Gi[qi]=null,Uo=Gi[--qi],Gi[qi]=null;for(;e===In;)In=kt[--Pt],kt[Pt]=null,Zt=kt[--Pt],kt[Pt]=null,Qt=kt[--Pt],kt[Pt]=null}function Yd(e,i){kt[Pt++]=Qt,kt[Pt++]=Zt,kt[Pt++]=In,Qt=i.id,Zt=i.overflow,In=e}var ot=null,Pe=null,ve=!1,Dn=null,Gt=!1,ir=Error(a(519));function Un(e){var i=Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Lo(Lt(i,e)),ir}function jd(e){var i=e.stateNode,l=e.type,r=e.memoizedProps;switch(i[it]=e,i[mt]=r,l){case"dialog":he("cancel",i),he("close",i);break;case"iframe":case"object":case"embed":he("load",i);break;case"video":case"audio":for(l=0;l<nl.length;l++)he(nl[l],i);break;case"source":he("error",i);break;case"img":case"image":case"link":he("error",i),he("load",i);break;case"details":he("toggle",i);break;case"input":he("invalid",i),ad(i,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":he("invalid",i);break;case"textarea":he("invalid",i),rd(i,r.value,r.defaultValue,r.children)}l=r.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||r.suppressHydrationWarning===!0||dp(i.textContent,l)?(r.popover!=null&&(he("beforetoggle",i),he("toggle",i)),r.onScroll!=null&&he("scroll",i),r.onScrollEnd!=null&&he("scrollend",i),r.onClick!=null&&(i.onclick=ln),i=!0):i=!1,i||Un(e,!0)}function Kd(e){for(ot=e.return;ot;)switch(ot.tag){case 5:case 31:case 13:Gt=!1;return;case 27:case 3:Gt=!0;return;default:ot=ot.return}}function Vi(e){if(e!==ot)return!1;if(!ve)return Kd(e),ve=!0,!1;var i=e.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=e.type,l=!(l!=="form"&&l!=="button")||Tu(e.type,e.memoizedProps)),l=!l),l&&Pe&&Un(e),Kd(e),i===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Pe=Ep(e)}else if(i===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(317));Pe=Ep(e)}else i===27?(i=Pe,jn(e.type)?(e=Nu,Nu=null,Pe=e):Pe=i):Pe=ot?Vt(e.stateNode.nextSibling):null;return!0}function ui(){Pe=ot=null,ve=!1}function or(){var e=Dn;return e!==null&&(vt===null?vt=e:vt.push.apply(vt,e),Dn=null),e}function Lo(e){Dn===null?Dn=[e]:Dn.push(e)}var lr=R(null),ci=null,un=null;function Ln(e,i,l){Q(lr,i._currentValue),i._currentValue=l}function cn(e){e._currentValue=lr.current,J(lr)}function ar(e,i,l){for(;e!==null;){var r=e.alternate;if((e.childLanes&i)!==i?(e.childLanes|=i,r!==null&&(r.childLanes|=i)):r!==null&&(r.childLanes&i)!==i&&(r.childLanes|=i),e===l)break;e=e.return}}function sr(e,i,l,r){var m=e.child;for(m!==null&&(m.return=e);m!==null;){var g=m.dependencies;if(g!==null){var T=m.child;g=g.firstContext;e:for(;g!==null;){var _=g;g=m;for(var N=0;N<i.length;N++)if(_.context===i[N]){g.lanes|=l,_=g.alternate,_!==null&&(_.lanes|=l),ar(g.return,l,e),r||(T=null);break e}g=_.next}}else if(m.tag===18){if(T=m.return,T===null)throw Error(a(341));T.lanes|=l,g=T.alternate,g!==null&&(g.lanes|=l),ar(T,l,e),T=null}else T=m.child;if(T!==null)T.return=m;else for(T=m;T!==null;){if(T===e){T=null;break}if(m=T.sibling,m!==null){m.return=T.return,T=m;break}T=T.return}m=T}}function Hi(e,i,l,r){e=null;for(var m=i,g=!1;m!==null;){if(!g){if((m.flags&524288)!==0)g=!0;else if((m.flags&262144)!==0)break}if(m.tag===10){var T=m.alternate;if(T===null)throw Error(a(387));if(T=T.memoizedProps,T!==null){var _=m.type;_t(m.pendingProps.value,T.value)||(e!==null?e.push(_):e=[_])}}else if(m===Ne.current){if(T=m.alternate,T===null)throw Error(a(387));T.memoizedState.memoizedState!==m.memoizedState.memoizedState&&(e!==null?e.push(sl):e=[sl])}m=m.return}e!==null&&sr(i,e,l,r),i.flags|=262144}function jl(e){for(e=e.firstContext;e!==null;){if(!_t(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function di(e){ci=e,un=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function lt(e){return Xd(ci,e)}function Kl(e,i){return ci===null&&di(e),Xd(e,i)}function Xd(e,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},un===null){if(e===null)throw Error(a(308));un=i,e.dependencies={lanes:0,firstContext:i},e.flags|=524288}else un=un.next=i;return l}var Mv=typeof AbortController<"u"?AbortController:function(){var e=[],i=this.signal={aborted:!1,addEventListener:function(l,r){e.push(r)}};this.abort=function(){i.aborted=!0,e.forEach(function(l){return l()})}},Iv=n.unstable_scheduleCallback,Dv=n.unstable_NormalPriority,Ye={$$typeof:P,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function rr(){return{controller:new Mv,data:new Map,refCount:0}}function ko(e){e.refCount--,e.refCount===0&&Iv(Dv,function(){e.controller.abort()})}var Po=null,ur=0,zi=0,Oi=null;function Uv(e,i){if(Po===null){var l=Po=[];ur=0,zi=fu(),Oi={status:"pending",value:void 0,then:function(r){l.push(r)}}}return ur++,i.then($d,$d),i}function $d(){if(--ur===0&&Po!==null){Oi!==null&&(Oi.status="fulfilled");var e=Po;Po=null,zi=0,Oi=null;for(var i=0;i<e.length;i++)(0,e[i])()}}function Lv(e,i){var l=[],r={status:"pending",value:null,reason:null,then:function(m){l.push(m)}};return e.then(function(){r.status="fulfilled",r.value=i;for(var m=0;m<l.length;m++)(0,l[m])(i)},function(m){for(r.status="rejected",r.reason=m,m=0;m<l.length;m++)(0,l[m])(void 0)}),r}var Qd=z.S;z.S=function(e,i){km=Et(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Uv(e,i),Qd!==null&&Qd(e,i)};var fi=R(null);function cr(){var e=fi.current;return e!==null?e:Le.pooledCache}function Xl(e,i){i===null?Q(fi,fi.current):Q(fi,i.pool)}function Zd(){var e=cr();return e===null?null:{parent:Ye._currentValue,pool:e}}var Bi=Error(a(460)),dr=Error(a(474)),$l=Error(a(542)),Ql={then:function(){}};function Wd(e){return e=e.status,e==="fulfilled"||e==="rejected"}function ef(e,i,l){switch(l=e[l],l===void 0?e.push(i):l!==i&&(i.then(ln,ln),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,nf(e),e;default:if(typeof i.status=="string")i.then(ln,ln);else{if(e=Le,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=i,e.status="pending",e.then(function(r){if(i.status==="pending"){var m=i;m.status="fulfilled",m.value=r}},function(r){if(i.status==="pending"){var m=i;m.status="rejected",m.reason=r}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw e=i.reason,nf(e),e}throw pi=i,Bi}}function mi(e){try{var i=e._init;return i(e._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(pi=l,Bi):l}}var pi=null;function tf(){if(pi===null)throw Error(a(459));var e=pi;return pi=null,e}function nf(e){if(e===Bi||e===$l)throw Error(a(483))}var Fi=null,Go=0;function Zl(e){var i=Go;return Go+=1,Fi===null&&(Fi=[]),ef(Fi,e,i)}function qo(e,i){i=i.props.ref,e.ref=i!==void 0?i:null}function Wl(e,i){throw i.$$typeof===S?Error(a(525)):(e=Object.prototype.toString.call(i),Error(a(31,e==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":e)))}function of(e){function i(M,A){if(e){var D=M.deletions;D===null?(M.deletions=[A],M.flags|=16):D.push(A)}}function l(M,A){if(!e)return null;for(;A!==null;)i(M,A),A=A.sibling;return null}function r(M){for(var A=new Map;M!==null;)M.key!==null?A.set(M.key,M):A.set(M.index,M),M=M.sibling;return A}function m(M,A){return M=sn(M,A),M.index=0,M.sibling=null,M}function g(M,A,D){return M.index=D,e?(D=M.alternate,D!==null?(D=D.index,D<A?(M.flags|=67108866,A):D):(M.flags|=67108866,A)):(M.flags|=1048576,A)}function T(M){return e&&M.alternate===null&&(M.flags|=67108866),M}function _(M,A,D,O){return A===null||A.tag!==6?(A=Ws(D,M.mode,O),A.return=M,A):(A=m(A,D),A.return=M,A)}function N(M,A,D,O){var ie=D.type;return ie===I?H(M,A,D.props.children,O,D.key):A!==null&&(A.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===le&&mi(ie)===A.type)?(A=m(A,D.props),qo(A,D),A.return=M,A):(A=Jl(D.type,D.key,D.props,null,M.mode,O),qo(A,D),A.return=M,A)}function U(M,A,D,O){return A===null||A.tag!==4||A.stateNode.containerInfo!==D.containerInfo||A.stateNode.implementation!==D.implementation?(A=er(D,M.mode,O),A.return=M,A):(A=m(A,D.children||[]),A.return=M,A)}function H(M,A,D,O,ie){return A===null||A.tag!==7?(A=ri(D,M.mode,O,ie),A.return=M,A):(A=m(A,D),A.return=M,A)}function F(M,A,D){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=Ws(""+A,M.mode,D),A.return=M,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case b:return D=Jl(A.type,A.key,A.props,null,M.mode,D),qo(D,A),D.return=M,D;case C:return A=er(A,M.mode,D),A.return=M,A;case le:return A=mi(A),F(M,A,D)}if(Ze(A)||Re(A))return A=ri(A,M.mode,D,null),A.return=M,A;if(typeof A.then=="function")return F(M,Zl(A),D);if(A.$$typeof===P)return F(M,Kl(M,A),D);Wl(M,A)}return null}function k(M,A,D,O){var ie=A!==null?A.key:null;if(typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint")return ie!==null?null:_(M,A,""+D,O);if(typeof D=="object"&&D!==null){switch(D.$$typeof){case b:return D.key===ie?N(M,A,D,O):null;case C:return D.key===ie?U(M,A,D,O):null;case le:return D=mi(D),k(M,A,D,O)}if(Ze(D)||Re(D))return ie!==null?null:H(M,A,D,O,null);if(typeof D.then=="function")return k(M,A,Zl(D),O);if(D.$$typeof===P)return k(M,A,Kl(M,D),O);Wl(M,D)}return null}function q(M,A,D,O,ie){if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return M=M.get(D)||null,_(A,M,""+O,ie);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case b:return M=M.get(O.key===null?D:O.key)||null,N(A,M,O,ie);case C:return M=M.get(O.key===null?D:O.key)||null,U(A,M,O,ie);case le:return O=mi(O),q(M,A,D,O,ie)}if(Ze(O)||Re(O))return M=M.get(D)||null,H(A,M,O,ie,null);if(typeof O.then=="function")return q(M,A,D,Zl(O),ie);if(O.$$typeof===P)return q(M,A,D,Kl(A,O),ie);Wl(A,O)}return null}function W(M,A,D,O){for(var ie=null,Ee=null,te=A,fe=A=0,ye=null;te!==null&&fe<D.length;fe++){te.index>fe?(ye=te,te=null):ye=te.sibling;var Te=k(M,te,D[fe],O);if(Te===null){te===null&&(te=ye);break}e&&te&&Te.alternate===null&&i(M,te),A=g(Te,A,fe),Ee===null?ie=Te:Ee.sibling=Te,Ee=Te,te=ye}if(fe===D.length)return l(M,te),ve&&rn(M,fe),ie;if(te===null){for(;fe<D.length;fe++)te=F(M,D[fe],O),te!==null&&(A=g(te,A,fe),Ee===null?ie=te:Ee.sibling=te,Ee=te);return ve&&rn(M,fe),ie}for(te=r(te);fe<D.length;fe++)ye=q(te,M,fe,D[fe],O),ye!==null&&(e&&ye.alternate!==null&&te.delete(ye.key===null?fe:ye.key),A=g(ye,A,fe),Ee===null?ie=ye:Ee.sibling=ye,Ee=ye);return e&&te.forEach(function(Zn){return i(M,Zn)}),ve&&rn(M,fe),ie}function oe(M,A,D,O){if(D==null)throw Error(a(151));for(var ie=null,Ee=null,te=A,fe=A=0,ye=null,Te=D.next();te!==null&&!Te.done;fe++,Te=D.next()){te.index>fe?(ye=te,te=null):ye=te.sibling;var Zn=k(M,te,Te.value,O);if(Zn===null){te===null&&(te=ye);break}e&&te&&Zn.alternate===null&&i(M,te),A=g(Zn,A,fe),Ee===null?ie=Zn:Ee.sibling=Zn,Ee=Zn,te=ye}if(Te.done)return l(M,te),ve&&rn(M,fe),ie;if(te===null){for(;!Te.done;fe++,Te=D.next())Te=F(M,Te.value,O),Te!==null&&(A=g(Te,A,fe),Ee===null?ie=Te:Ee.sibling=Te,Ee=Te);return ve&&rn(M,fe),ie}for(te=r(te);!Te.done;fe++,Te=D.next())Te=q(te,M,fe,Te.value,O),Te!==null&&(e&&Te.alternate!==null&&te.delete(Te.key===null?fe:Te.key),A=g(Te,A,fe),Ee===null?ie=Te:Ee.sibling=Te,Ee=Te);return e&&te.forEach(function(Jx){return i(M,Jx)}),ve&&rn(M,fe),ie}function De(M,A,D,O){if(typeof D=="object"&&D!==null&&D.type===I&&D.key===null&&(D=D.props.children),typeof D=="object"&&D!==null){switch(D.$$typeof){case b:e:{for(var ie=D.key;A!==null;){if(A.key===ie){if(ie=D.type,ie===I){if(A.tag===7){l(M,A.sibling),O=m(A,D.props.children),O.return=M,M=O;break e}}else if(A.elementType===ie||typeof ie=="object"&&ie!==null&&ie.$$typeof===le&&mi(ie)===A.type){l(M,A.sibling),O=m(A,D.props),qo(O,D),O.return=M,M=O;break e}l(M,A);break}else i(M,A);A=A.sibling}D.type===I?(O=ri(D.props.children,M.mode,O,D.key),O.return=M,M=O):(O=Jl(D.type,D.key,D.props,null,M.mode,O),qo(O,D),O.return=M,M=O)}return T(M);case C:e:{for(ie=D.key;A!==null;){if(A.key===ie)if(A.tag===4&&A.stateNode.containerInfo===D.containerInfo&&A.stateNode.implementation===D.implementation){l(M,A.sibling),O=m(A,D.children||[]),O.return=M,M=O;break e}else{l(M,A);break}else i(M,A);A=A.sibling}O=er(D,M.mode,O),O.return=M,M=O}return T(M);case le:return D=mi(D),De(M,A,D,O)}if(Ze(D))return W(M,A,D,O);if(Re(D)){if(ie=Re(D),typeof ie!="function")throw Error(a(150));return D=ie.call(D),oe(M,A,D,O)}if(typeof D.then=="function")return De(M,A,Zl(D),O);if(D.$$typeof===P)return De(M,A,Kl(M,D),O);Wl(M,D)}return typeof D=="string"&&D!==""||typeof D=="number"||typeof D=="bigint"?(D=""+D,A!==null&&A.tag===6?(l(M,A.sibling),O=m(A,D),O.return=M,M=O):(l(M,A),O=Ws(D,M.mode,O),O.return=M,M=O),T(M)):l(M,A)}return function(M,A,D,O){try{Go=0;var ie=De(M,A,D,O);return Fi=null,ie}catch(te){if(te===Bi||te===$l)throw te;var Ee=bt(29,te,null,M.mode);return Ee.lanes=O,Ee.return=M,Ee}finally{}}}var hi=of(!0),lf=of(!1),kn=!1;function fr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function mr(e,i){e=e.updateQueue,i.updateQueue===e&&(i.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function Pn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Gn(e,i,l){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(Ce&2)!==0){var m=r.pending;return m===null?i.next=i:(i.next=m.next,m.next=i),r.pending=i,i=Fl(e),zd(e,null,l),i}return Bl(e,r,i,l),Fl(e)}function Vo(e,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var r=i.lanes;r&=e.pendingLanes,l|=r,i.lanes=l,Xc(e,l)}}function pr(e,i){var l=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,l===r)){var m=null,g=null;if(l=l.firstBaseUpdate,l!==null){do{var T={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};g===null?m=g=T:g=g.next=T,l=l.next}while(l!==null);g===null?m=g=i:g=g.next=i}else m=g=i;l={baseState:r.baseState,firstBaseUpdate:m,lastBaseUpdate:g,shared:r.shared,callbacks:r.callbacks},e.updateQueue=l;return}e=l.lastBaseUpdate,e===null?l.firstBaseUpdate=i:e.next=i,l.lastBaseUpdate=i}var hr=!1;function Ho(){if(hr){var e=Oi;if(e!==null)throw e}}function zo(e,i,l,r){hr=!1;var m=e.updateQueue;kn=!1;var g=m.firstBaseUpdate,T=m.lastBaseUpdate,_=m.shared.pending;if(_!==null){m.shared.pending=null;var N=_,U=N.next;N.next=null,T===null?g=U:T.next=U,T=N;var H=e.alternate;H!==null&&(H=H.updateQueue,_=H.lastBaseUpdate,_!==T&&(_===null?H.firstBaseUpdate=U:_.next=U,H.lastBaseUpdate=N))}if(g!==null){var F=m.baseState;T=0,H=U=N=null,_=g;do{var k=_.lane&-536870913,q=k!==_.lane;if(q?(ge&k)===k:(r&k)===k){k!==0&&k===zi&&(hr=!0),H!==null&&(H=H.next={lane:0,tag:_.tag,payload:_.payload,callback:null,next:null});e:{var W=e,oe=_;k=i;var De=l;switch(oe.tag){case 1:if(W=oe.payload,typeof W=="function"){F=W.call(De,F,k);break e}F=W;break e;case 3:W.flags=W.flags&-65537|128;case 0:if(W=oe.payload,k=typeof W=="function"?W.call(De,F,k):W,k==null)break e;F=E({},F,k);break e;case 2:kn=!0}}k=_.callback,k!==null&&(e.flags|=64,q&&(e.flags|=8192),q=m.callbacks,q===null?m.callbacks=[k]:q.push(k))}else q={lane:k,tag:_.tag,payload:_.payload,callback:_.callback,next:null},H===null?(U=H=q,N=F):H=H.next=q,T|=k;if(_=_.next,_===null){if(_=m.shared.pending,_===null)break;q=_,_=q.next,q.next=null,m.lastBaseUpdate=q,m.shared.pending=null}}while(!0);H===null&&(N=F),m.baseState=N,m.firstBaseUpdate=U,m.lastBaseUpdate=H,g===null&&(m.shared.lanes=0),On|=T,e.lanes=T,e.memoizedState=F}}function af(e,i){if(typeof e!="function")throw Error(a(191,e));e.call(i)}function sf(e,i){var l=e.callbacks;if(l!==null)for(e.callbacks=null,e=0;e<l.length;e++)af(l[e],i)}var Ji=R(null),ea=R(0);function rf(e,i){e=xn,Q(ea,e),Q(Ji,i),xn=e|i.baseLanes}function gr(){Q(ea,xn),Q(Ji,Ji.current)}function yr(){xn=ea.current,J(Ji),J(ea)}var Ct=R(null),qt=null;function qn(e){var i=e.alternate;Q(Fe,Fe.current&1),Q(Ct,e),qt===null&&(i===null||Ji.current!==null||i.memoizedState!==null)&&(qt=e)}function vr(e){Q(Fe,Fe.current),Q(Ct,e),qt===null&&(qt=e)}function uf(e){e.tag===22?(Q(Fe,Fe.current),Q(Ct,e),qt===null&&(qt=e)):Vn()}function Vn(){Q(Fe,Fe.current),Q(Ct,Ct.current)}function Nt(e){J(Ct),qt===e&&(qt=null),J(Fe)}var Fe=R(0);function ta(e){for(var i=e;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||bu(l)||Cu(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var dn=0,de=null,Me=null,je=null,na=!1,Yi=!1,gi=!1,ia=0,Oo=0,ji=null,kv=0;function ze(){throw Error(a(321))}function xr(e,i){if(i===null)return!1;for(var l=0;l<i.length&&l<e.length;l++)if(!_t(e[l],i[l]))return!1;return!0}function Er(e,i,l,r,m,g){return dn=g,de=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,z.H=e===null||e.memoizedState===null?Yf:kr,gi=!1,g=l(r,m),gi=!1,Yi&&(g=df(i,l,r,m)),cf(e),g}function cf(e){z.H=Jo;var i=Me!==null&&Me.next!==null;if(dn=0,je=Me=de=null,na=!1,Oo=0,ji=null,i)throw Error(a(300));e===null||Ke||(e=e.dependencies,e!==null&&jl(e)&&(Ke=!0))}function df(e,i,l,r){de=e;var m=0;do{if(Yi&&(ji=null),Oo=0,Yi=!1,25<=m)throw Error(a(301));if(m+=1,je=Me=null,e.updateQueue!=null){var g=e.updateQueue;g.lastEffect=null,g.events=null,g.stores=null,g.memoCache!=null&&(g.memoCache.index=0)}z.H=jf,g=i(l,r)}while(Yi);return g}function Pv(){var e=z.H,i=e.useState()[0];return i=typeof i.then=="function"?Bo(i):i,e=e.useState()[0],(Me!==null?Me.memoizedState:null)!==e&&(de.flags|=1024),i}function Tr(){var e=ia!==0;return ia=0,e}function Sr(e,i,l){i.updateQueue=e.updateQueue,i.flags&=-2053,e.lanes&=~l}function _r(e){if(na){for(e=e.memoizedState;e!==null;){var i=e.queue;i!==null&&(i.pending=null),e=e.next}na=!1}dn=0,je=Me=de=null,Yi=!1,Oo=ia=0,ji=null}function ct(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return je===null?de.memoizedState=je=e:je=je.next=e,je}function Je(){if(Me===null){var e=de.alternate;e=e!==null?e.memoizedState:null}else e=Me.next;var i=je===null?de.memoizedState:je.next;if(i!==null)je=i,Me=e;else{if(e===null)throw de.alternate===null?Error(a(467)):Error(a(310));Me=e,e={memoizedState:Me.memoizedState,baseState:Me.baseState,baseQueue:Me.baseQueue,queue:Me.queue,next:null},je===null?de.memoizedState=je=e:je=je.next=e}return je}function oa(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bo(e){var i=Oo;return Oo+=1,ji===null&&(ji=[]),e=ef(ji,e,i),i=de,(je===null?i.memoizedState:je.next)===null&&(i=i.alternate,z.H=i===null||i.memoizedState===null?Yf:kr),e}function la(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Bo(e);if(e.$$typeof===P)return lt(e)}throw Error(a(438,String(e)))}function br(e){var i=null,l=de.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var r=de.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(i={data:r.data.map(function(m){return m.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=oa(),de.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(e),r=0;r<e;r++)l[r]=ae;return i.index++,l}function fn(e,i){return typeof i=="function"?i(e):i}function aa(e){var i=Je();return Cr(i,Me,e)}function Cr(e,i,l){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=l;var m=e.baseQueue,g=r.pending;if(g!==null){if(m!==null){var T=m.next;m.next=g.next,g.next=T}i.baseQueue=m=g,r.pending=null}if(g=e.baseState,m===null)e.memoizedState=g;else{i=m.next;var _=T=null,N=null,U=i,H=!1;do{var F=U.lane&-536870913;if(F!==U.lane?(ge&F)===F:(dn&F)===F){var k=U.revertLane;if(k===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),F===zi&&(H=!0);else if((dn&k)===k){U=U.next,k===zi&&(H=!0);continue}else F={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(_=N=F,T=g):N=N.next=F,de.lanes|=k,On|=k;F=U.action,gi&&l(g,F),g=U.hasEagerState?U.eagerState:l(g,F)}else k={lane:F,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(_=N=k,T=g):N=N.next=k,de.lanes|=F,On|=F;U=U.next}while(U!==null&&U!==i);if(N===null?T=g:N.next=_,!_t(g,e.memoizedState)&&(Ke=!0,H&&(l=Oi,l!==null)))throw l;e.memoizedState=g,e.baseState=T,e.baseQueue=N,r.lastRenderedState=g}return m===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Nr(e){var i=Je(),l=i.queue;if(l===null)throw Error(a(311));l.lastRenderedReducer=e;var r=l.dispatch,m=l.pending,g=i.memoizedState;if(m!==null){l.pending=null;var T=m=m.next;do g=e(g,T.action),T=T.next;while(T!==m);_t(g,i.memoizedState)||(Ke=!0),i.memoizedState=g,i.baseQueue===null&&(i.baseState=g),l.lastRenderedState=g}return[g,r]}function ff(e,i,l){var r=de,m=Je(),g=ve;if(g){if(l===void 0)throw Error(a(407));l=l()}else l=i();var T=!_t((Me||m).memoizedState,l);if(T&&(m.memoizedState=l,Ke=!0),m=m.queue,Rr(hf.bind(null,r,m,e),[e]),m.getSnapshot!==i||T||je!==null&&je.memoizedState.tag&1){if(r.flags|=2048,Ki(9,{destroy:void 0},pf.bind(null,r,m,l,i),null),Le===null)throw Error(a(349));g||(dn&127)!==0||mf(r,i,l)}return l}function mf(e,i,l){e.flags|=16384,e={getSnapshot:i,value:l},i=de.updateQueue,i===null?(i=oa(),de.updateQueue=i,i.stores=[e]):(l=i.stores,l===null?i.stores=[e]:l.push(e))}function pf(e,i,l,r){i.value=l,i.getSnapshot=r,gf(i)&&yf(e)}function hf(e,i,l){return l(function(){gf(i)&&yf(e)})}function gf(e){var i=e.getSnapshot;e=e.value;try{var l=i();return!_t(e,l)}catch{return!0}}function yf(e){var i=si(e,2);i!==null&&xt(i,e,2)}function Ar(e){var i=ct();if(typeof e=="function"){var l=e;if(e=l(),gi){wn(!0);try{l()}finally{wn(!1)}}}return i.memoizedState=i.baseState=e,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:e},i}function vf(e,i,l,r){return e.baseState=l,Cr(e,Me,typeof r=="function"?r:fn)}function Gv(e,i,l,r,m){if(ua(e))throw Error(a(485));if(e=i.action,e!==null){var g={payload:m,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(T){g.listeners.push(T)}};z.T!==null?l(!0):g.isTransition=!1,r(g),l=i.pending,l===null?(g.next=i.pending=g,xf(i,g)):(g.next=l.next,i.pending=l.next=g)}}function xf(e,i){var l=i.action,r=i.payload,m=e.state;if(i.isTransition){var g=z.T,T={};z.T=T;try{var _=l(m,r),N=z.S;N!==null&&N(T,_),Ef(e,i,_)}catch(U){wr(e,i,U)}finally{g!==null&&T.types!==null&&(g.types=T.types),z.T=g}}else try{g=l(m,r),Ef(e,i,g)}catch(U){wr(e,i,U)}}function Ef(e,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(r){Tf(e,i,r)},function(r){return wr(e,i,r)}):Tf(e,i,l)}function Tf(e,i,l){i.status="fulfilled",i.value=l,Sf(i),e.state=l,i=e.pending,i!==null&&(l=i.next,l===i?e.pending=null:(l=l.next,i.next=l,xf(e,l)))}function wr(e,i,l){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do i.status="rejected",i.reason=l,Sf(i),i=i.next;while(i!==r)}e.action=null}function Sf(e){e=e.listeners;for(var i=0;i<e.length;i++)(0,e[i])()}function _f(e,i){return i}function bf(e,i){if(ve){var l=Le.formState;if(l!==null){e:{var r=de;if(ve){if(Pe){t:{for(var m=Pe,g=Gt;m.nodeType!==8;){if(!g){m=null;break t}if(m=Vt(m.nextSibling),m===null){m=null;break t}}g=m.data,m=g==="F!"||g==="F"?m:null}if(m){Pe=Vt(m.nextSibling),r=m.data==="F!";break e}}Un(r)}r=!1}r&&(i=l[0])}}return l=ct(),l.memoizedState=l.baseState=i,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:_f,lastRenderedState:i},l.queue=r,l=Bf.bind(null,de,r),r.dispatch=l,r=Ar(!1),g=Lr.bind(null,de,!1,r.queue),r=ct(),m={state:i,dispatch:null,action:e,pending:null},r.queue=m,l=Gv.bind(null,de,m,g,l),m.dispatch=l,r.memoizedState=e,[i,l,!1]}function Cf(e){var i=Je();return Nf(i,Me,e)}function Nf(e,i,l){if(i=Cr(e,i,_f)[0],e=aa(fn)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var r=Bo(i)}catch(T){throw T===Bi?$l:T}else r=i;i=Je();var m=i.queue,g=m.dispatch;return l!==i.memoizedState&&(de.flags|=2048,Ki(9,{destroy:void 0},qv.bind(null,m,l),null)),[r,g,e]}function qv(e,i){e.action=i}function Af(e){var i=Je(),l=Me;if(l!==null)return Nf(i,l,e);Je(),i=i.memoizedState,l=Je();var r=l.queue.dispatch;return l.memoizedState=e,[i,r,!1]}function Ki(e,i,l,r){return e={tag:e,create:l,deps:r,inst:i,next:null},i=de.updateQueue,i===null&&(i=oa(),de.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=e.next=e:(r=l.next,l.next=e,e.next=r,i.lastEffect=e),e}function wf(){return Je().memoizedState}function sa(e,i,l,r){var m=ct();de.flags|=e,m.memoizedState=Ki(1|i,{destroy:void 0},l,r===void 0?null:r)}function ra(e,i,l,r){var m=Je();r=r===void 0?null:r;var g=m.memoizedState.inst;Me!==null&&r!==null&&xr(r,Me.memoizedState.deps)?m.memoizedState=Ki(i,g,l,r):(de.flags|=e,m.memoizedState=Ki(1|i,g,l,r))}function Rf(e,i){sa(8390656,8,e,i)}function Rr(e,i){ra(2048,8,e,i)}function Vv(e){de.flags|=4;var i=de.updateQueue;if(i===null)i=oa(),de.updateQueue=i,i.events=[e];else{var l=i.events;l===null?i.events=[e]:l.push(e)}}function Mf(e){var i=Je().memoizedState;return Vv({ref:i,nextImpl:e}),function(){if((Ce&2)!==0)throw Error(a(440));return i.impl.apply(void 0,arguments)}}function If(e,i){return ra(4,2,e,i)}function Df(e,i){return ra(4,4,e,i)}function Uf(e,i){if(typeof i=="function"){e=e();var l=i(e);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return e=e(),i.current=e,function(){i.current=null}}function Lf(e,i,l){l=l!=null?l.concat([e]):null,ra(4,4,Uf.bind(null,i,e),l)}function Mr(){}function kf(e,i){var l=Je();i=i===void 0?null:i;var r=l.memoizedState;return i!==null&&xr(i,r[1])?r[0]:(l.memoizedState=[e,i],e)}function Pf(e,i){var l=Je();i=i===void 0?null:i;var r=l.memoizedState;if(i!==null&&xr(i,r[1]))return r[0];if(r=e(),gi){wn(!0);try{e()}finally{wn(!1)}}return l.memoizedState=[r,i],r}function Ir(e,i,l){return l===void 0||(dn&1073741824)!==0&&(ge&261930)===0?e.memoizedState=i:(e.memoizedState=l,e=Gm(),de.lanes|=e,On|=e,l)}function Gf(e,i,l,r){return _t(l,i)?l:Ji.current!==null?(e=Ir(e,l,r),_t(e,i)||(Ke=!0),e):(dn&42)===0||(dn&1073741824)!==0&&(ge&261930)===0?(Ke=!0,e.memoizedState=l):(e=Gm(),de.lanes|=e,On|=e,i)}function qf(e,i,l,r,m){var g=K.p;K.p=g!==0&&8>g?g:8;var T=z.T,_={};z.T=_,Lr(e,!1,i,l);try{var N=m(),U=z.S;if(U!==null&&U(_,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){var H=Lv(N,r);Fo(e,i,H,Rt(e))}else Fo(e,i,r,Rt(e))}catch(F){Fo(e,i,{then:function(){},status:"rejected",reason:F},Rt())}finally{K.p=g,T!==null&&_.types!==null&&(T.types=_.types),z.T=T}}function Hv(){}function Dr(e,i,l,r){if(e.tag!==5)throw Error(a(476));var m=Vf(e).queue;qf(e,m,i,ne,l===null?Hv:function(){return Hf(e),l(r)})}function Vf(e){var i=e.memoizedState;if(i!==null)return i;i={memoizedState:ne,baseState:ne,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:ne},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:fn,lastRenderedState:l},next:null},e.memoizedState=i,e=e.alternate,e!==null&&(e.memoizedState=i),i}function Hf(e){var i=Vf(e);i.next===null&&(i=e.alternate.memoizedState),Fo(e,i.next.queue,{},Rt())}function Ur(){return lt(sl)}function zf(){return Je().memoizedState}function Of(){return Je().memoizedState}function zv(e){for(var i=e.return;i!==null;){switch(i.tag){case 24:case 3:var l=Rt();e=Pn(l);var r=Gn(i,e,l);r!==null&&(xt(r,i,l),Vo(r,i,l)),i={cache:rr()},e.payload=i;return}i=i.return}}function Ov(e,i,l){var r=Rt();l={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},ua(e)?Ff(i,l):(l=Qs(e,i,l,r),l!==null&&(xt(l,e,r),Jf(l,i,r)))}function Bf(e,i,l){var r=Rt();Fo(e,i,l,r)}function Fo(e,i,l,r){var m={lane:r,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(ua(e))Ff(i,m);else{var g=e.alternate;if(e.lanes===0&&(g===null||g.lanes===0)&&(g=i.lastRenderedReducer,g!==null))try{var T=i.lastRenderedState,_=g(T,l);if(m.hasEagerState=!0,m.eagerState=_,_t(_,T))return Bl(e,i,m,0),Le===null&&Ol(),!1}catch{}finally{}if(l=Qs(e,i,m,r),l!==null)return xt(l,e,r),Jf(l,i,r),!0}return!1}function Lr(e,i,l,r){if(r={lane:2,revertLane:fu(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},ua(e)){if(i)throw Error(a(479))}else i=Qs(e,l,r,2),i!==null&&xt(i,e,2)}function ua(e){var i=e.alternate;return e===de||i!==null&&i===de}function Ff(e,i){Yi=na=!0;var l=e.pending;l===null?i.next=i:(i.next=l.next,l.next=i),e.pending=i}function Jf(e,i,l){if((l&4194048)!==0){var r=i.lanes;r&=e.pendingLanes,l|=r,i.lanes=l,Xc(e,l)}}var Jo={readContext:lt,use:la,useCallback:ze,useContext:ze,useEffect:ze,useImperativeHandle:ze,useLayoutEffect:ze,useInsertionEffect:ze,useMemo:ze,useReducer:ze,useRef:ze,useState:ze,useDebugValue:ze,useDeferredValue:ze,useTransition:ze,useSyncExternalStore:ze,useId:ze,useHostTransitionStatus:ze,useFormState:ze,useActionState:ze,useOptimistic:ze,useMemoCache:ze,useCacheRefresh:ze};Jo.useEffectEvent=ze;var Yf={readContext:lt,use:la,useCallback:function(e,i){return ct().memoizedState=[e,i===void 0?null:i],e},useContext:lt,useEffect:Rf,useImperativeHandle:function(e,i,l){l=l!=null?l.concat([e]):null,sa(4194308,4,Uf.bind(null,i,e),l)},useLayoutEffect:function(e,i){return sa(4194308,4,e,i)},useInsertionEffect:function(e,i){sa(4,2,e,i)},useMemo:function(e,i){var l=ct();i=i===void 0?null:i;var r=e();if(gi){wn(!0);try{e()}finally{wn(!1)}}return l.memoizedState=[r,i],r},useReducer:function(e,i,l){var r=ct();if(l!==void 0){var m=l(i);if(gi){wn(!0);try{l(i)}finally{wn(!1)}}}else m=i;return r.memoizedState=r.baseState=m,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:m},r.queue=e,e=e.dispatch=Ov.bind(null,de,e),[r.memoizedState,e]},useRef:function(e){var i=ct();return e={current:e},i.memoizedState=e},useState:function(e){e=Ar(e);var i=e.queue,l=Bf.bind(null,de,i);return i.dispatch=l,[e.memoizedState,l]},useDebugValue:Mr,useDeferredValue:function(e,i){var l=ct();return Ir(l,e,i)},useTransition:function(){var e=Ar(!1);return e=qf.bind(null,de,e.queue,!0,!1),ct().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,i,l){var r=de,m=ct();if(ve){if(l===void 0)throw Error(a(407));l=l()}else{if(l=i(),Le===null)throw Error(a(349));(ge&127)!==0||mf(r,i,l)}m.memoizedState=l;var g={value:l,getSnapshot:i};return m.queue=g,Rf(hf.bind(null,r,g,e),[e]),r.flags|=2048,Ki(9,{destroy:void 0},pf.bind(null,r,g,l,i),null),l},useId:function(){var e=ct(),i=Le.identifierPrefix;if(ve){var l=Zt,r=Qt;l=(r&~(1<<32-St(r)-1)).toString(32)+l,i="_"+i+"R_"+l,l=ia++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=kv++,i="_"+i+"r_"+l.toString(32)+"_";return e.memoizedState=i},useHostTransitionStatus:Ur,useFormState:bf,useActionState:bf,useOptimistic:function(e){var i=ct();i.memoizedState=i.baseState=e;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Lr.bind(null,de,!0,l),l.dispatch=i,[e,i]},useMemoCache:br,useCacheRefresh:function(){return ct().memoizedState=zv.bind(null,de)},useEffectEvent:function(e){var i=ct(),l={impl:e};return i.memoizedState=l,function(){if((Ce&2)!==0)throw Error(a(440));return l.impl.apply(void 0,arguments)}}},kr={readContext:lt,use:la,useCallback:kf,useContext:lt,useEffect:Rr,useImperativeHandle:Lf,useInsertionEffect:If,useLayoutEffect:Df,useMemo:Pf,useReducer:aa,useRef:wf,useState:function(){return aa(fn)},useDebugValue:Mr,useDeferredValue:function(e,i){var l=Je();return Gf(l,Me.memoizedState,e,i)},useTransition:function(){var e=aa(fn)[0],i=Je().memoizedState;return[typeof e=="boolean"?e:Bo(e),i]},useSyncExternalStore:ff,useId:zf,useHostTransitionStatus:Ur,useFormState:Cf,useActionState:Cf,useOptimistic:function(e,i){var l=Je();return vf(l,Me,e,i)},useMemoCache:br,useCacheRefresh:Of};kr.useEffectEvent=Mf;var jf={readContext:lt,use:la,useCallback:kf,useContext:lt,useEffect:Rr,useImperativeHandle:Lf,useInsertionEffect:If,useLayoutEffect:Df,useMemo:Pf,useReducer:Nr,useRef:wf,useState:function(){return Nr(fn)},useDebugValue:Mr,useDeferredValue:function(e,i){var l=Je();return Me===null?Ir(l,e,i):Gf(l,Me.memoizedState,e,i)},useTransition:function(){var e=Nr(fn)[0],i=Je().memoizedState;return[typeof e=="boolean"?e:Bo(e),i]},useSyncExternalStore:ff,useId:zf,useHostTransitionStatus:Ur,useFormState:Af,useActionState:Af,useOptimistic:function(e,i){var l=Je();return Me!==null?vf(l,Me,e,i):(l.baseState=e,[e,l.queue.dispatch])},useMemoCache:br,useCacheRefresh:Of};jf.useEffectEvent=Mf;function Pr(e,i,l,r){i=e.memoizedState,l=l(r,i),l=l==null?i:E({},i,l),e.memoizedState=l,e.lanes===0&&(e.updateQueue.baseState=l)}var Gr={enqueueSetState:function(e,i,l){e=e._reactInternals;var r=Rt(),m=Pn(r);m.payload=i,l!=null&&(m.callback=l),i=Gn(e,m,r),i!==null&&(xt(i,e,r),Vo(i,e,r))},enqueueReplaceState:function(e,i,l){e=e._reactInternals;var r=Rt(),m=Pn(r);m.tag=1,m.payload=i,l!=null&&(m.callback=l),i=Gn(e,m,r),i!==null&&(xt(i,e,r),Vo(i,e,r))},enqueueForceUpdate:function(e,i){e=e._reactInternals;var l=Rt(),r=Pn(l);r.tag=2,i!=null&&(r.callback=i),i=Gn(e,r,l),i!==null&&(xt(i,e,l),Vo(i,e,l))}};function Kf(e,i,l,r,m,g,T){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,g,T):i.prototype&&i.prototype.isPureReactComponent?!Io(l,r)||!Io(m,g):!0}function Xf(e,i,l,r){e=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,r),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,r),i.state!==e&&Gr.enqueueReplaceState(i,i.state,null)}function yi(e,i){var l=i;if("ref"in i){l={};for(var r in i)r!=="ref"&&(l[r]=i[r])}if(e=e.defaultProps){l===i&&(l=E({},l));for(var m in e)l[m]===void 0&&(l[m]=e[m])}return l}function $f(e){zl(e)}function Qf(e){console.error(e)}function Zf(e){zl(e)}function ca(e,i){try{var l=e.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(r){setTimeout(function(){throw r})}}function Wf(e,i,l){try{var r=e.onCaughtError;r(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(m){setTimeout(function(){throw m})}}function qr(e,i,l){return l=Pn(l),l.tag=3,l.payload={element:null},l.callback=function(){ca(e,i)},l}function em(e){return e=Pn(e),e.tag=3,e}function tm(e,i,l,r){var m=l.type.getDerivedStateFromError;if(typeof m=="function"){var g=r.value;e.payload=function(){return m(g)},e.callback=function(){Wf(i,l,r)}}var T=l.stateNode;T!==null&&typeof T.componentDidCatch=="function"&&(e.callback=function(){Wf(i,l,r),typeof m!="function"&&(Bn===null?Bn=new Set([this]):Bn.add(this));var _=r.stack;this.componentDidCatch(r.value,{componentStack:_!==null?_:""})})}function Bv(e,i,l,r,m){if(l.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(i=l.alternate,i!==null&&Hi(i,l,m,!0),l=Ct.current,l!==null){switch(l.tag){case 31:case 13:return qt===null?Sa():l.alternate===null&&Oe===0&&(Oe=3),l.flags&=-257,l.flags|=65536,l.lanes=m,r===Ql?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([r]):i.add(r),uu(e,r,m)),!1;case 22:return l.flags|=65536,r===Ql?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([r])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([r]):l.add(r)),uu(e,r,m)),!1}throw Error(a(435,l.tag))}return uu(e,r,m),Sa(),!1}if(ve)return i=Ct.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=m,r!==ir&&(e=Error(a(422),{cause:r}),Lo(Lt(e,l)))):(r!==ir&&(i=Error(a(423),{cause:r}),Lo(Lt(i,l))),e=e.current.alternate,e.flags|=65536,m&=-m,e.lanes|=m,r=Lt(r,l),m=qr(e.stateNode,r,m),pr(e,m),Oe!==4&&(Oe=2)),!1;var g=Error(a(520),{cause:r});if(g=Lt(g,l),Wo===null?Wo=[g]:Wo.push(g),Oe!==4&&(Oe=2),i===null)return!0;r=Lt(r,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,e=m&-m,l.lanes|=e,e=qr(l.stateNode,r,e),pr(l,e),!1;case 1:if(i=l.type,g=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||g!==null&&typeof g.componentDidCatch=="function"&&(Bn===null||!Bn.has(g))))return l.flags|=65536,m&=-m,l.lanes|=m,m=em(m),tm(m,e,l,r),pr(l,m),!1}l=l.return}while(l!==null);return!1}var Vr=Error(a(461)),Ke=!1;function at(e,i,l,r){i.child=e===null?lf(i,null,l,r):hi(i,e.child,l,r)}function nm(e,i,l,r,m){l=l.render;var g=i.ref;if("ref"in r){var T={};for(var _ in r)_!=="ref"&&(T[_]=r[_])}else T=r;return di(i),r=Er(e,i,l,T,g,m),_=Tr(),e!==null&&!Ke?(Sr(e,i,m),mn(e,i,m)):(ve&&_&&tr(i),i.flags|=1,at(e,i,r,m),i.child)}function im(e,i,l,r,m){if(e===null){var g=l.type;return typeof g=="function"&&!Zs(g)&&g.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=g,om(e,i,g,r,m)):(e=Jl(l.type,null,r,i,i.mode,m),e.ref=i.ref,e.return=i,i.child=e)}if(g=e.child,!jr(e,m)){var T=g.memoizedProps;if(l=l.compare,l=l!==null?l:Io,l(T,r)&&e.ref===i.ref)return mn(e,i,m)}return i.flags|=1,e=sn(g,r),e.ref=i.ref,e.return=i,i.child=e}function om(e,i,l,r,m){if(e!==null){var g=e.memoizedProps;if(Io(g,r)&&e.ref===i.ref)if(Ke=!1,i.pendingProps=r=g,jr(e,m))(e.flags&131072)!==0&&(Ke=!0);else return i.lanes=e.lanes,mn(e,i,m)}return Hr(e,i,l,r,m)}function lm(e,i,l,r){var m=r.children,g=e!==null?e.memoizedState:null;if(e===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((i.flags&128)!==0){if(g=g!==null?g.baseLanes|l:l,e!==null){for(r=i.child=e.child,m=0;r!==null;)m=m|r.lanes|r.childLanes,r=r.sibling;r=m&~g}else r=0,i.child=null;return am(e,i,g,l,r)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},e!==null&&Xl(i,g!==null?g.cachePool:null),g!==null?rf(i,g):gr(),uf(i);else return r=i.lanes=536870912,am(e,i,g!==null?g.baseLanes|l:l,l,r)}else g!==null?(Xl(i,g.cachePool),rf(i,g),Vn(),i.memoizedState=null):(e!==null&&Xl(i,null),gr(),Vn());return at(e,i,m,l),i.child}function Yo(e,i){return e!==null&&e.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function am(e,i,l,r,m){var g=cr();return g=g===null?null:{parent:Ye._currentValue,pool:g},i.memoizedState={baseLanes:l,cachePool:g},e!==null&&Xl(i,null),gr(),uf(i),e!==null&&Hi(e,i,r,!0),i.childLanes=m,null}function da(e,i){return i=ma({mode:i.mode,children:i.children},e.mode),i.ref=e.ref,e.child=i,i.return=e,i}function sm(e,i,l){return hi(i,e.child,null,l),e=da(i,i.pendingProps),e.flags|=2,Nt(i),i.memoizedState=null,e}function Fv(e,i,l){var r=i.pendingProps,m=(i.flags&128)!==0;if(i.flags&=-129,e===null){if(ve){if(r.mode==="hidden")return e=da(i,r),i.lanes=536870912,Yo(null,e);if(vr(i),(e=Pe)?(e=xp(e,Gt),e=e!==null&&e.data==="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:In!==null?{id:Qt,overflow:Zt}:null,retryLane:536870912,hydrationErrors:null},l=Bd(e),l.return=i,i.child=l,ot=i,Pe=null)):e=null,e===null)throw Un(i);return i.lanes=536870912,null}return da(i,r)}var g=e.memoizedState;if(g!==null){var T=g.dehydrated;if(vr(i),m)if(i.flags&256)i.flags&=-257,i=sm(e,i,l);else if(i.memoizedState!==null)i.child=e.child,i.flags|=128,i=null;else throw Error(a(558));else if(Ke||Hi(e,i,l,!1),m=(l&e.childLanes)!==0,Ke||m){if(r=Le,r!==null&&(T=$c(r,l),T!==0&&T!==g.retryLane))throw g.retryLane=T,si(e,T),xt(r,e,T),Vr;Sa(),i=sm(e,i,l)}else e=g.treeContext,Pe=Vt(T.nextSibling),ot=i,ve=!0,Dn=null,Gt=!1,e!==null&&Yd(i,e),i=da(i,r),i.flags|=4096;return i}return e=sn(e.child,{mode:r.mode,children:r.children}),e.ref=i.ref,i.child=e,e.return=i,e}function fa(e,i){var l=i.ref;if(l===null)e!==null&&e.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(a(284));(e===null||e.ref!==l)&&(i.flags|=4194816)}}function Hr(e,i,l,r,m){return di(i),l=Er(e,i,l,r,void 0,m),r=Tr(),e!==null&&!Ke?(Sr(e,i,m),mn(e,i,m)):(ve&&r&&tr(i),i.flags|=1,at(e,i,l,m),i.child)}function rm(e,i,l,r,m,g){return di(i),i.updateQueue=null,l=df(i,r,l,m),cf(e),r=Tr(),e!==null&&!Ke?(Sr(e,i,g),mn(e,i,g)):(ve&&r&&tr(i),i.flags|=1,at(e,i,l,g),i.child)}function um(e,i,l,r,m){if(di(i),i.stateNode===null){var g=Pi,T=l.contextType;typeof T=="object"&&T!==null&&(g=lt(T)),g=new l(r,g),i.memoizedState=g.state!==null&&g.state!==void 0?g.state:null,g.updater=Gr,i.stateNode=g,g._reactInternals=i,g=i.stateNode,g.props=r,g.state=i.memoizedState,g.refs={},fr(i),T=l.contextType,g.context=typeof T=="object"&&T!==null?lt(T):Pi,g.state=i.memoizedState,T=l.getDerivedStateFromProps,typeof T=="function"&&(Pr(i,l,T,r),g.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof g.getSnapshotBeforeUpdate=="function"||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(T=g.state,typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount(),T!==g.state&&Gr.enqueueReplaceState(g,g.state,null),zo(i,r,g,m),Ho(),g.state=i.memoizedState),typeof g.componentDidMount=="function"&&(i.flags|=4194308),r=!0}else if(e===null){g=i.stateNode;var _=i.memoizedProps,N=yi(l,_);g.props=N;var U=g.context,H=l.contextType;T=Pi,typeof H=="object"&&H!==null&&(T=lt(H));var F=l.getDerivedStateFromProps;H=typeof F=="function"||typeof g.getSnapshotBeforeUpdate=="function",_=i.pendingProps!==_,H||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(_||U!==T)&&Xf(i,g,r,T),kn=!1;var k=i.memoizedState;g.state=k,zo(i,r,g,m),Ho(),U=i.memoizedState,_||k!==U||kn?(typeof F=="function"&&(Pr(i,l,F,r),U=i.memoizedState),(N=kn||Kf(i,l,N,r,k,U,T))?(H||typeof g.UNSAFE_componentWillMount!="function"&&typeof g.componentWillMount!="function"||(typeof g.componentWillMount=="function"&&g.componentWillMount(),typeof g.UNSAFE_componentWillMount=="function"&&g.UNSAFE_componentWillMount()),typeof g.componentDidMount=="function"&&(i.flags|=4194308)):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=r,i.memoizedState=U),g.props=r,g.state=U,g.context=T,r=N):(typeof g.componentDidMount=="function"&&(i.flags|=4194308),r=!1)}else{g=i.stateNode,mr(e,i),T=i.memoizedProps,H=yi(l,T),g.props=H,F=i.pendingProps,k=g.context,U=l.contextType,N=Pi,typeof U=="object"&&U!==null&&(N=lt(U)),_=l.getDerivedStateFromProps,(U=typeof _=="function"||typeof g.getSnapshotBeforeUpdate=="function")||typeof g.UNSAFE_componentWillReceiveProps!="function"&&typeof g.componentWillReceiveProps!="function"||(T!==F||k!==N)&&Xf(i,g,r,N),kn=!1,k=i.memoizedState,g.state=k,zo(i,r,g,m),Ho();var q=i.memoizedState;T!==F||k!==q||kn||e!==null&&e.dependencies!==null&&jl(e.dependencies)?(typeof _=="function"&&(Pr(i,l,_,r),q=i.memoizedState),(H=kn||Kf(i,l,H,r,k,q,N)||e!==null&&e.dependencies!==null&&jl(e.dependencies))?(U||typeof g.UNSAFE_componentWillUpdate!="function"&&typeof g.componentWillUpdate!="function"||(typeof g.componentWillUpdate=="function"&&g.componentWillUpdate(r,q,N),typeof g.UNSAFE_componentWillUpdate=="function"&&g.UNSAFE_componentWillUpdate(r,q,N)),typeof g.componentDidUpdate=="function"&&(i.flags|=4),typeof g.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof g.componentDidUpdate!="function"||T===e.memoizedProps&&k===e.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&k===e.memoizedState||(i.flags|=1024),i.memoizedProps=r,i.memoizedState=q),g.props=r,g.state=q,g.context=N,r=H):(typeof g.componentDidUpdate!="function"||T===e.memoizedProps&&k===e.memoizedState||(i.flags|=4),typeof g.getSnapshotBeforeUpdate!="function"||T===e.memoizedProps&&k===e.memoizedState||(i.flags|=1024),r=!1)}return g=r,fa(e,i),r=(i.flags&128)!==0,g||r?(g=i.stateNode,l=r&&typeof l.getDerivedStateFromError!="function"?null:g.render(),i.flags|=1,e!==null&&r?(i.child=hi(i,e.child,null,m),i.child=hi(i,null,l,m)):at(e,i,l,m),i.memoizedState=g.state,e=i.child):e=mn(e,i,m),e}function cm(e,i,l,r){return ui(),i.flags|=256,at(e,i,l,r),i.child}var zr={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Or(e){return{baseLanes:e,cachePool:Zd()}}function Br(e,i,l){return e=e!==null?e.childLanes&~l:0,i&&(e|=wt),e}function dm(e,i,l){var r=i.pendingProps,m=!1,g=(i.flags&128)!==0,T;if((T=g)||(T=e!==null&&e.memoizedState===null?!1:(Fe.current&2)!==0),T&&(m=!0,i.flags&=-129),T=(i.flags&32)!==0,i.flags&=-33,e===null){if(ve){if(m?qn(i):Vn(),(e=Pe)?(e=xp(e,Gt),e=e!==null&&e.data!=="&"?e:null,e!==null&&(i.memoizedState={dehydrated:e,treeContext:In!==null?{id:Qt,overflow:Zt}:null,retryLane:536870912,hydrationErrors:null},l=Bd(e),l.return=i,i.child=l,ot=i,Pe=null)):e=null,e===null)throw Un(i);return Cu(e)?i.lanes=32:i.lanes=536870912,null}var _=r.children;return r=r.fallback,m?(Vn(),m=i.mode,_=ma({mode:"hidden",children:_},m),r=ri(r,m,l,null),_.return=i,r.return=i,_.sibling=r,i.child=_,r=i.child,r.memoizedState=Or(l),r.childLanes=Br(e,T,l),i.memoizedState=zr,Yo(null,r)):(qn(i),Fr(i,_))}var N=e.memoizedState;if(N!==null&&(_=N.dehydrated,_!==null)){if(g)i.flags&256?(qn(i),i.flags&=-257,i=Jr(e,i,l)):i.memoizedState!==null?(Vn(),i.child=e.child,i.flags|=128,i=null):(Vn(),_=r.fallback,m=i.mode,r=ma({mode:"visible",children:r.children},m),_=ri(_,m,l,null),_.flags|=2,r.return=i,_.return=i,r.sibling=_,i.child=r,hi(i,e.child,null,l),r=i.child,r.memoizedState=Or(l),r.childLanes=Br(e,T,l),i.memoizedState=zr,i=Yo(null,r));else if(qn(i),Cu(_)){if(T=_.nextSibling&&_.nextSibling.dataset,T)var U=T.dgst;T=U,r=Error(a(419)),r.stack="",r.digest=T,Lo({value:r,source:null,stack:null}),i=Jr(e,i,l)}else if(Ke||Hi(e,i,l,!1),T=(l&e.childLanes)!==0,Ke||T){if(T=Le,T!==null&&(r=$c(T,l),r!==0&&r!==N.retryLane))throw N.retryLane=r,si(e,r),xt(T,e,r),Vr;bu(_)||Sa(),i=Jr(e,i,l)}else bu(_)?(i.flags|=192,i.child=e.child,i=null):(e=N.treeContext,Pe=Vt(_.nextSibling),ot=i,ve=!0,Dn=null,Gt=!1,e!==null&&Yd(i,e),i=Fr(i,r.children),i.flags|=4096);return i}return m?(Vn(),_=r.fallback,m=i.mode,N=e.child,U=N.sibling,r=sn(N,{mode:"hidden",children:r.children}),r.subtreeFlags=N.subtreeFlags&65011712,U!==null?_=sn(U,_):(_=ri(_,m,l,null),_.flags|=2),_.return=i,r.return=i,r.sibling=_,i.child=r,Yo(null,r),r=i.child,_=e.child.memoizedState,_===null?_=Or(l):(m=_.cachePool,m!==null?(N=Ye._currentValue,m=m.parent!==N?{parent:N,pool:N}:m):m=Zd(),_={baseLanes:_.baseLanes|l,cachePool:m}),r.memoizedState=_,r.childLanes=Br(e,T,l),i.memoizedState=zr,Yo(e.child,r)):(qn(i),l=e.child,e=l.sibling,l=sn(l,{mode:"visible",children:r.children}),l.return=i,l.sibling=null,e!==null&&(T=i.deletions,T===null?(i.deletions=[e],i.flags|=16):T.push(e)),i.child=l,i.memoizedState=null,l)}function Fr(e,i){return i=ma({mode:"visible",children:i},e.mode),i.return=e,e.child=i}function ma(e,i){return e=bt(22,e,null,i),e.lanes=0,e}function Jr(e,i,l){return hi(i,e.child,null,l),e=Fr(i,i.pendingProps.children),e.flags|=2,i.memoizedState=null,e}function fm(e,i,l){e.lanes|=i;var r=e.alternate;r!==null&&(r.lanes|=i),ar(e.return,i,l)}function Yr(e,i,l,r,m,g){var T=e.memoizedState;T===null?e.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:r,tail:l,tailMode:m,treeForkCount:g}:(T.isBackwards=i,T.rendering=null,T.renderingStartTime=0,T.last=r,T.tail=l,T.tailMode=m,T.treeForkCount=g)}function mm(e,i,l){var r=i.pendingProps,m=r.revealOrder,g=r.tail;r=r.children;var T=Fe.current,_=(T&2)!==0;if(_?(T=T&1|2,i.flags|=128):T&=1,Q(Fe,T),at(e,i,r,l),r=ve?Uo:0,!_&&e!==null&&(e.flags&128)!==0)e:for(e=i.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&fm(e,l,i);else if(e.tag===19)fm(e,l,i);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===i)break e;for(;e.sibling===null;){if(e.return===null||e.return===i)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(m){case"forwards":for(l=i.child,m=null;l!==null;)e=l.alternate,e!==null&&ta(e)===null&&(m=l),l=l.sibling;l=m,l===null?(m=i.child,i.child=null):(m=l.sibling,l.sibling=null),Yr(i,!1,m,l,g,r);break;case"backwards":case"unstable_legacy-backwards":for(l=null,m=i.child,i.child=null;m!==null;){if(e=m.alternate,e!==null&&ta(e)===null){i.child=m;break}e=m.sibling,m.sibling=l,l=m,m=e}Yr(i,!0,l,null,g,r);break;case"together":Yr(i,!1,null,null,void 0,r);break;default:i.memoizedState=null}return i.child}function mn(e,i,l){if(e!==null&&(i.dependencies=e.dependencies),On|=i.lanes,(l&i.childLanes)===0)if(e!==null){if(Hi(e,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(e!==null&&i.child!==e.child)throw Error(a(153));if(i.child!==null){for(e=i.child,l=sn(e,e.pendingProps),i.child=l,l.return=i;e.sibling!==null;)e=e.sibling,l=l.sibling=sn(e,e.pendingProps),l.return=i;l.sibling=null}return i.child}function jr(e,i){return(e.lanes&i)!==0?!0:(e=e.dependencies,!!(e!==null&&jl(e)))}function Jv(e,i,l){switch(i.tag){case 3:ut(i,i.stateNode.containerInfo),Ln(i,Ye,e.memoizedState.cache),ui();break;case 27:case 5:vo(i);break;case 4:ut(i,i.stateNode.containerInfo);break;case 10:Ln(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,vr(i),null;break;case 13:var r=i.memoizedState;if(r!==null)return r.dehydrated!==null?(qn(i),i.flags|=128,null):(l&i.child.childLanes)!==0?dm(e,i,l):(qn(i),e=mn(e,i,l),e!==null?e.sibling:null);qn(i);break;case 19:var m=(e.flags&128)!==0;if(r=(l&i.childLanes)!==0,r||(Hi(e,i,l,!1),r=(l&i.childLanes)!==0),m){if(r)return mm(e,i,l);i.flags|=128}if(m=i.memoizedState,m!==null&&(m.rendering=null,m.tail=null,m.lastEffect=null),Q(Fe,Fe.current),r)break;return null;case 22:return i.lanes=0,lm(e,i,l,i.pendingProps);case 24:Ln(i,Ye,e.memoizedState.cache)}return mn(e,i,l)}function pm(e,i,l){if(e!==null)if(e.memoizedProps!==i.pendingProps)Ke=!0;else{if(!jr(e,l)&&(i.flags&128)===0)return Ke=!1,Jv(e,i,l);Ke=(e.flags&131072)!==0}else Ke=!1,ve&&(i.flags&1048576)!==0&&Jd(i,Uo,i.index);switch(i.lanes=0,i.tag){case 16:e:{var r=i.pendingProps;if(e=mi(i.elementType),i.type=e,typeof e=="function")Zs(e)?(r=yi(e,r),i.tag=1,i=um(null,i,e,r,l)):(i.tag=0,i=Hr(null,i,e,r,l));else{if(e!=null){var m=e.$$typeof;if(m===Y){i.tag=11,i=nm(null,i,e,r,l);break e}else if(m===j){i.tag=14,i=im(null,i,e,r,l);break e}}throw i=ke(e)||e,Error(a(306,i,""))}}return i;case 0:return Hr(e,i,i.type,i.pendingProps,l);case 1:return r=i.type,m=yi(r,i.pendingProps),um(e,i,r,m,l);case 3:e:{if(ut(i,i.stateNode.containerInfo),e===null)throw Error(a(387));r=i.pendingProps;var g=i.memoizedState;m=g.element,mr(e,i),zo(i,r,null,l);var T=i.memoizedState;if(r=T.cache,Ln(i,Ye,r),r!==g.cache&&sr(i,[Ye],l,!0),Ho(),r=T.element,g.isDehydrated)if(g={element:r,isDehydrated:!1,cache:T.cache},i.updateQueue.baseState=g,i.memoizedState=g,i.flags&256){i=cm(e,i,r,l);break e}else if(r!==m){m=Lt(Error(a(424)),i),Lo(m),i=cm(e,i,r,l);break e}else{switch(e=i.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(Pe=Vt(e.firstChild),ot=i,ve=!0,Dn=null,Gt=!0,l=lf(i,null,r,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(ui(),r===m){i=mn(e,i,l);break e}at(e,i,r,l)}i=i.child}return i;case 26:return fa(e,i),e===null?(l=Cp(i.type,null,i.pendingProps,null))?i.memoizedState=l:ve||(l=i.type,e=i.pendingProps,r=Ra(me.current).createElement(l),r[it]=i,r[mt]=e,st(r,l,e),We(r),i.stateNode=r):i.memoizedState=Cp(i.type,e.memoizedProps,i.pendingProps,e.memoizedState),null;case 27:return vo(i),e===null&&ve&&(r=i.stateNode=Sp(i.type,i.pendingProps,me.current),ot=i,Gt=!0,m=Pe,jn(i.type)?(Nu=m,Pe=Vt(r.firstChild)):Pe=m),at(e,i,i.pendingProps.children,l),fa(e,i),e===null&&(i.flags|=4194304),i.child;case 5:return e===null&&ve&&((m=r=Pe)&&(r=Tx(r,i.type,i.pendingProps,Gt),r!==null?(i.stateNode=r,ot=i,Pe=Vt(r.firstChild),Gt=!1,m=!0):m=!1),m||Un(i)),vo(i),m=i.type,g=i.pendingProps,T=e!==null?e.memoizedProps:null,r=g.children,Tu(m,g)?r=null:T!==null&&Tu(m,T)&&(i.flags|=32),i.memoizedState!==null&&(m=Er(e,i,Pv,null,null,l),sl._currentValue=m),fa(e,i),at(e,i,r,l),i.child;case 6:return e===null&&ve&&((e=l=Pe)&&(l=Sx(l,i.pendingProps,Gt),l!==null?(i.stateNode=l,ot=i,Pe=null,e=!0):e=!1),e||Un(i)),null;case 13:return dm(e,i,l);case 4:return ut(i,i.stateNode.containerInfo),r=i.pendingProps,e===null?i.child=hi(i,null,r,l):at(e,i,r,l),i.child;case 11:return nm(e,i,i.type,i.pendingProps,l);case 7:return at(e,i,i.pendingProps,l),i.child;case 8:return at(e,i,i.pendingProps.children,l),i.child;case 12:return at(e,i,i.pendingProps.children,l),i.child;case 10:return r=i.pendingProps,Ln(i,i.type,r.value),at(e,i,r.children,l),i.child;case 9:return m=i.type._context,r=i.pendingProps.children,di(i),m=lt(m),r=r(m),i.flags|=1,at(e,i,r,l),i.child;case 14:return im(e,i,i.type,i.pendingProps,l);case 15:return om(e,i,i.type,i.pendingProps,l);case 19:return mm(e,i,l);case 31:return Fv(e,i,l);case 22:return lm(e,i,l,i.pendingProps);case 24:return di(i),r=lt(Ye),e===null?(m=cr(),m===null&&(m=Le,g=rr(),m.pooledCache=g,g.refCount++,g!==null&&(m.pooledCacheLanes|=l),m=g),i.memoizedState={parent:r,cache:m},fr(i),Ln(i,Ye,m)):((e.lanes&l)!==0&&(mr(e,i),zo(i,null,null,l),Ho()),m=e.memoizedState,g=i.memoizedState,m.parent!==r?(m={parent:r,cache:r},i.memoizedState=m,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=m),Ln(i,Ye,r)):(r=g.cache,Ln(i,Ye,r),r!==m.cache&&sr(i,[Ye],l,!0))),at(e,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(a(156,i.tag))}function pn(e){e.flags|=4}function Kr(e,i,l,r,m){if((i=(e.mode&32)!==0)&&(i=!1),i){if(e.flags|=16777216,(m&335544128)===m)if(e.stateNode.complete)e.flags|=8192;else if(zm())e.flags|=8192;else throw pi=Ql,dr}else e.flags&=-16777217}function hm(e,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Mp(i))if(zm())e.flags|=8192;else throw pi=Ql,dr}function pa(e,i){i!==null&&(e.flags|=4),e.flags&16384&&(i=e.tag!==22?jc():536870912,e.lanes|=i,Zi|=i)}function jo(e,i){if(!ve)switch(e.tailMode){case"hidden":i=e.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?e.tail=null:l.sibling=null;break;case"collapsed":l=e.tail;for(var r=null;l!==null;)l.alternate!==null&&(r=l),l=l.sibling;r===null?i||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Ge(e){var i=e.alternate!==null&&e.alternate.child===e.child,l=0,r=0;if(i)for(var m=e.child;m!==null;)l|=m.lanes|m.childLanes,r|=m.subtreeFlags&65011712,r|=m.flags&65011712,m.return=e,m=m.sibling;else for(m=e.child;m!==null;)l|=m.lanes|m.childLanes,r|=m.subtreeFlags,r|=m.flags,m.return=e,m=m.sibling;return e.subtreeFlags|=r,e.childLanes=l,i}function Yv(e,i,l){var r=i.pendingProps;switch(nr(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Ge(i),null;case 1:return Ge(i),null;case 3:return l=i.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),i.memoizedState.cache!==r&&(i.flags|=2048),cn(Ye),Be(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(e===null||e.child===null)&&(Vi(i)?pn(i):e===null||e.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,or())),Ge(i),null;case 26:var m=i.type,g=i.memoizedState;return e===null?(pn(i),g!==null?(Ge(i),hm(i,g)):(Ge(i),Kr(i,m,null,r,l))):g?g!==e.memoizedState?(pn(i),Ge(i),hm(i,g)):(Ge(i),i.flags&=-16777217):(e=e.memoizedProps,e!==r&&pn(i),Ge(i),Kr(i,m,e,r,l)),null;case 27:if(Cl(i),l=me.current,m=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&pn(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return Ge(i),null}e=ee.current,Vi(i)?jd(i):(e=Sp(m,r,l),i.stateNode=e,pn(i))}return Ge(i),null;case 5:if(Cl(i),m=i.type,e!==null&&i.stateNode!=null)e.memoizedProps!==r&&pn(i);else{if(!r){if(i.stateNode===null)throw Error(a(166));return Ge(i),null}if(g=ee.current,Vi(i))jd(i);else{var T=Ra(me.current);switch(g){case 1:g=T.createElementNS("http://www.w3.org/2000/svg",m);break;case 2:g=T.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;default:switch(m){case"svg":g=T.createElementNS("http://www.w3.org/2000/svg",m);break;case"math":g=T.createElementNS("http://www.w3.org/1998/Math/MathML",m);break;case"script":g=T.createElement("div"),g.innerHTML="<script><\/script>",g=g.removeChild(g.firstChild);break;case"select":g=typeof r.is=="string"?T.createElement("select",{is:r.is}):T.createElement("select"),r.multiple?g.multiple=!0:r.size&&(g.size=r.size);break;default:g=typeof r.is=="string"?T.createElement(m,{is:r.is}):T.createElement(m)}}g[it]=i,g[mt]=r;e:for(T=i.child;T!==null;){if(T.tag===5||T.tag===6)g.appendChild(T.stateNode);else if(T.tag!==4&&T.tag!==27&&T.child!==null){T.child.return=T,T=T.child;continue}if(T===i)break e;for(;T.sibling===null;){if(T.return===null||T.return===i)break e;T=T.return}T.sibling.return=T.return,T=T.sibling}i.stateNode=g;e:switch(st(g,m,r),m){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&pn(i)}}return Ge(i),Kr(i,i.type,e===null?null:e.memoizedProps,i.pendingProps,l),null;case 6:if(e&&i.stateNode!=null)e.memoizedProps!==r&&pn(i);else{if(typeof r!="string"&&i.stateNode===null)throw Error(a(166));if(e=me.current,Vi(i)){if(e=i.stateNode,l=i.memoizedProps,r=null,m=ot,m!==null)switch(m.tag){case 27:case 5:r=m.memoizedProps}e[it]=i,e=!!(e.nodeValue===l||r!==null&&r.suppressHydrationWarning===!0||dp(e.nodeValue,l)),e||Un(i,!0)}else e=Ra(e).createTextNode(r),e[it]=i,i.stateNode=e}return Ge(i),null;case 31:if(l=i.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(i),l!==null){if(e===null){if(!r)throw Error(a(318));if(e=i.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(a(557));e[it]=i}else ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ge(i),e=!1}else l=or(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=l),e=!0;if(!e)return i.flags&256?(Nt(i),i):(Nt(i),null);if((i.flags&128)!==0)throw Error(a(558))}return Ge(i),null;case 13:if(r=i.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(m=Vi(i),r!==null&&r.dehydrated!==null){if(e===null){if(!m)throw Error(a(318));if(m=i.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(a(317));m[it]=i}else ui(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;Ge(i),m=!1}else m=or(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=m),m=!0;if(!m)return i.flags&256?(Nt(i),i):(Nt(i),null)}return Nt(i),(i.flags&128)!==0?(i.lanes=l,i):(l=r!==null,e=e!==null&&e.memoizedState!==null,l&&(r=i.child,m=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(m=r.alternate.memoizedState.cachePool.pool),g=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(g=r.memoizedState.cachePool.pool),g!==m&&(r.flags|=2048)),l!==e&&l&&(i.child.flags|=8192),pa(i,i.updateQueue),Ge(i),null);case 4:return Be(),e===null&&gu(i.stateNode.containerInfo),Ge(i),null;case 10:return cn(i.type),Ge(i),null;case 19:if(J(Fe),r=i.memoizedState,r===null)return Ge(i),null;if(m=(i.flags&128)!==0,g=r.rendering,g===null)if(m)jo(r,!1);else{if(Oe!==0||e!==null&&(e.flags&128)!==0)for(e=i.child;e!==null;){if(g=ta(e),g!==null){for(i.flags|=128,jo(r,!1),e=g.updateQueue,i.updateQueue=e,pa(i,e),i.subtreeFlags=0,e=l,l=i.child;l!==null;)Od(l,e),l=l.sibling;return Q(Fe,Fe.current&1|2),ve&&rn(i,r.treeForkCount),i.child}e=e.sibling}r.tail!==null&&Et()>xa&&(i.flags|=128,m=!0,jo(r,!1),i.lanes=4194304)}else{if(!m)if(e=ta(g),e!==null){if(i.flags|=128,m=!0,e=e.updateQueue,i.updateQueue=e,pa(i,e),jo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!g.alternate&&!ve)return Ge(i),null}else 2*Et()-r.renderingStartTime>xa&&l!==536870912&&(i.flags|=128,m=!0,jo(r,!1),i.lanes=4194304);r.isBackwards?(g.sibling=i.child,i.child=g):(e=r.last,e!==null?e.sibling=g:i.child=g,r.last=g)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Et(),e.sibling=null,l=Fe.current,Q(Fe,m?l&1|2:l&1),ve&&rn(i,r.treeForkCount),e):(Ge(i),null);case 22:case 23:return Nt(i),yr(),r=i.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(i.flags|=8192):r&&(i.flags|=8192),r?(l&536870912)!==0&&(i.flags&128)===0&&(Ge(i),i.subtreeFlags&6&&(i.flags|=8192)):Ge(i),l=i.updateQueue,l!==null&&pa(i,l.retryQueue),l=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),r=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(r=i.memoizedState.cachePool.pool),r!==l&&(i.flags|=2048),e!==null&&J(fi),null;case 24:return l=null,e!==null&&(l=e.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),cn(Ye),Ge(i),null;case 25:return null;case 30:return null}throw Error(a(156,i.tag))}function jv(e,i){switch(nr(i),i.tag){case 1:return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 3:return cn(Ye),Be(),e=i.flags,(e&65536)!==0&&(e&128)===0?(i.flags=e&-65537|128,i):null;case 26:case 27:case 5:return Cl(i),null;case 31:if(i.memoizedState!==null){if(Nt(i),i.alternate===null)throw Error(a(340));ui()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 13:if(Nt(i),e=i.memoizedState,e!==null&&e.dehydrated!==null){if(i.alternate===null)throw Error(a(340));ui()}return e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 19:return J(Fe),null;case 4:return Be(),null;case 10:return cn(i.type),null;case 22:case 23:return Nt(i),yr(),e!==null&&J(fi),e=i.flags,e&65536?(i.flags=e&-65537|128,i):null;case 24:return cn(Ye),null;case 25:return null;default:return null}}function gm(e,i){switch(nr(i),i.tag){case 3:cn(Ye),Be();break;case 26:case 27:case 5:Cl(i);break;case 4:Be();break;case 31:i.memoizedState!==null&&Nt(i);break;case 13:Nt(i);break;case 19:J(Fe);break;case 10:cn(i.type);break;case 22:case 23:Nt(i),yr(),e!==null&&J(fi);break;case 24:cn(Ye)}}function Ko(e,i){try{var l=i.updateQueue,r=l!==null?l.lastEffect:null;if(r!==null){var m=r.next;l=m;do{if((l.tag&e)===e){r=void 0;var g=l.create,T=l.inst;r=g(),T.destroy=r}l=l.next}while(l!==m)}}catch(_){we(i,i.return,_)}}function Hn(e,i,l){try{var r=i.updateQueue,m=r!==null?r.lastEffect:null;if(m!==null){var g=m.next;r=g;do{if((r.tag&e)===e){var T=r.inst,_=T.destroy;if(_!==void 0){T.destroy=void 0,m=i;var N=l,U=_;try{U()}catch(H){we(m,N,H)}}}r=r.next}while(r!==g)}}catch(H){we(i,i.return,H)}}function ym(e){var i=e.updateQueue;if(i!==null){var l=e.stateNode;try{sf(i,l)}catch(r){we(e,e.return,r)}}}function vm(e,i,l){l.props=yi(e.type,e.memoizedProps),l.state=e.memoizedState;try{l.componentWillUnmount()}catch(r){we(e,i,r)}}function Xo(e,i){try{var l=e.ref;if(l!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof l=="function"?e.refCleanup=l(r):l.current=r}}catch(m){we(e,i,m)}}function Wt(e,i){var l=e.ref,r=e.refCleanup;if(l!==null)if(typeof r=="function")try{r()}catch(m){we(e,i,m)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(m){we(e,i,m)}else l.current=null}function xm(e){var i=e.type,l=e.memoizedProps,r=e.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&r.focus();break e;case"img":l.src?r.src=l.src:l.srcSet&&(r.srcset=l.srcSet)}}catch(m){we(e,e.return,m)}}function Xr(e,i,l){try{var r=e.stateNode;hx(r,e.type,l,i),r[mt]=i}catch(m){we(e,e.return,m)}}function Em(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&jn(e.type)||e.tag===4}function $r(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Em(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&&jn(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 Qr(e,i,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(e,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(e),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=ln));else if(r!==4&&(r===27&&jn(e.type)&&(l=e.stateNode,i=null),e=e.child,e!==null))for(Qr(e,i,l),e=e.sibling;e!==null;)Qr(e,i,l),e=e.sibling}function ha(e,i,l){var r=e.tag;if(r===5||r===6)e=e.stateNode,i?l.insertBefore(e,i):l.appendChild(e);else if(r!==4&&(r===27&&jn(e.type)&&(l=e.stateNode),e=e.child,e!==null))for(ha(e,i,l),e=e.sibling;e!==null;)ha(e,i,l),e=e.sibling}function Tm(e){var i=e.stateNode,l=e.memoizedProps;try{for(var r=e.type,m=i.attributes;m.length;)i.removeAttributeNode(m[0]);st(i,r,l),i[it]=e,i[mt]=l}catch(g){we(e,e.return,g)}}var hn=!1,Xe=!1,Zr=!1,Sm=typeof WeakSet=="function"?WeakSet:Set,et=null;function Kv(e,i){if(e=e.containerInfo,xu=Pa,e=Ud(e),Js(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var r=l.getSelection&&l.getSelection();if(r&&r.rangeCount!==0){l=r.anchorNode;var m=r.anchorOffset,g=r.focusNode;r=r.focusOffset;try{l.nodeType,g.nodeType}catch{l=null;break e}var T=0,_=-1,N=-1,U=0,H=0,F=e,k=null;t:for(;;){for(var q;F!==l||m!==0&&F.nodeType!==3||(_=T+m),F!==g||r!==0&&F.nodeType!==3||(N=T+r),F.nodeType===3&&(T+=F.nodeValue.length),(q=F.firstChild)!==null;)k=F,F=q;for(;;){if(F===e)break t;if(k===l&&++U===m&&(_=T),k===g&&++H===r&&(N=T),(q=F.nextSibling)!==null)break;F=k,k=F.parentNode}F=q}l=_===-1||N===-1?null:{start:_,end:N}}else l=null}l=l||{start:0,end:0}}else l=null;for(Eu={focusedElem:e,selectionRange:l},Pa=!1,et=i;et!==null;)if(i=et,e=i.child,(i.subtreeFlags&1028)!==0&&e!==null)e.return=i,et=e;else for(;et!==null;){switch(i=et,g=i.alternate,e=i.flags,i.tag){case 0:if((e&4)!==0&&(e=i.updateQueue,e=e!==null?e.events:null,e!==null))for(l=0;l<e.length;l++)m=e[l],m.ref.impl=m.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&g!==null){e=void 0,l=i,m=g.memoizedProps,g=g.memoizedState,r=l.stateNode;try{var W=yi(l.type,m);e=r.getSnapshotBeforeUpdate(W,g),r.__reactInternalSnapshotBeforeUpdate=e}catch(oe){we(l,l.return,oe)}}break;case 3:if((e&1024)!==0){if(e=i.stateNode.containerInfo,l=e.nodeType,l===9)_u(e);else if(l===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":_u(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=i.sibling,e!==null){e.return=i.return,et=e;break}et=i.return}}function _m(e,i,l){var r=l.flags;switch(l.tag){case 0:case 11:case 15:yn(e,l),r&4&&Ko(5,l);break;case 1:if(yn(e,l),r&4)if(e=l.stateNode,i===null)try{e.componentDidMount()}catch(T){we(l,l.return,T)}else{var m=yi(l.type,i.memoizedProps);i=i.memoizedState;try{e.componentDidUpdate(m,i,e.__reactInternalSnapshotBeforeUpdate)}catch(T){we(l,l.return,T)}}r&64&&ym(l),r&512&&Xo(l,l.return);break;case 3:if(yn(e,l),r&64&&(e=l.updateQueue,e!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{sf(e,i)}catch(T){we(l,l.return,T)}}break;case 27:i===null&&r&4&&Tm(l);case 26:case 5:yn(e,l),i===null&&r&4&&xm(l),r&512&&Xo(l,l.return);break;case 12:yn(e,l);break;case 31:yn(e,l),r&4&&Nm(e,l);break;case 13:yn(e,l),r&4&&Am(e,l),r&64&&(e=l.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(l=ix.bind(null,l),_x(e,l))));break;case 22:if(r=l.memoizedState!==null||hn,!r){i=i!==null&&i.memoizedState!==null||Xe,m=hn;var g=Xe;hn=r,(Xe=i)&&!g?vn(e,l,(l.subtreeFlags&8772)!==0):yn(e,l),hn=m,Xe=g}break;case 30:break;default:yn(e,l)}}function bm(e){var i=e.alternate;i!==null&&(e.alternate=null,bm(i)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(i=e.stateNode,i!==null&&ws(i)),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 qe=null,ht=!1;function gn(e,i,l){for(l=l.child;l!==null;)Cm(e,i,l),l=l.sibling}function Cm(e,i,l){if(Tt&&typeof Tt.onCommitFiberUnmount=="function")try{Tt.onCommitFiberUnmount(xo,l)}catch{}switch(l.tag){case 26:Xe||Wt(l,i),gn(e,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Xe||Wt(l,i);var r=qe,m=ht;jn(l.type)&&(qe=l.stateNode,ht=!1),gn(e,i,l),ol(l.stateNode),qe=r,ht=m;break;case 5:Xe||Wt(l,i);case 6:if(r=qe,m=ht,qe=null,gn(e,i,l),qe=r,ht=m,qe!==null)if(ht)try{(qe.nodeType===9?qe.body:qe.nodeName==="HTML"?qe.ownerDocument.body:qe).removeChild(l.stateNode)}catch(g){we(l,i,g)}else try{qe.removeChild(l.stateNode)}catch(g){we(l,i,g)}break;case 18:qe!==null&&(ht?(e=qe,yp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,l.stateNode),ao(e)):yp(qe,l.stateNode));break;case 4:r=qe,m=ht,qe=l.stateNode.containerInfo,ht=!0,gn(e,i,l),qe=r,ht=m;break;case 0:case 11:case 14:case 15:Hn(2,l,i),Xe||Hn(4,l,i),gn(e,i,l);break;case 1:Xe||(Wt(l,i),r=l.stateNode,typeof r.componentWillUnmount=="function"&&vm(l,i,r)),gn(e,i,l);break;case 21:gn(e,i,l);break;case 22:Xe=(r=Xe)||l.memoizedState!==null,gn(e,i,l),Xe=r;break;default:gn(e,i,l)}}function Nm(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ao(e)}catch(l){we(i,i.return,l)}}}function Am(e,i){if(i.memoizedState===null&&(e=i.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ao(e)}catch(l){we(i,i.return,l)}}function Xv(e){switch(e.tag){case 31:case 13:case 19:var i=e.stateNode;return i===null&&(i=e.stateNode=new Sm),i;case 22:return e=e.stateNode,i=e._retryCache,i===null&&(i=e._retryCache=new Sm),i;default:throw Error(a(435,e.tag))}}function ga(e,i){var l=Xv(e);i.forEach(function(r){if(!l.has(r)){l.add(r);var m=ox.bind(null,e,r);r.then(m,m)}})}function gt(e,i){var l=i.deletions;if(l!==null)for(var r=0;r<l.length;r++){var m=l[r],g=e,T=i,_=T;e:for(;_!==null;){switch(_.tag){case 27:if(jn(_.type)){qe=_.stateNode,ht=!1;break e}break;case 5:qe=_.stateNode,ht=!1;break e;case 3:case 4:qe=_.stateNode.containerInfo,ht=!0;break e}_=_.return}if(qe===null)throw Error(a(160));Cm(g,T,m),qe=null,ht=!1,g=m.alternate,g!==null&&(g.return=null),m.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)wm(i,e),i=i.sibling}var Ft=null;function wm(e,i){var l=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:gt(i,e),yt(e),r&4&&(Hn(3,e,e.return),Ko(3,e),Hn(5,e,e.return));break;case 1:gt(i,e),yt(e),r&512&&(Xe||l===null||Wt(l,l.return)),r&64&&hn&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(l=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=l===null?r:l.concat(r))));break;case 26:var m=Ft;if(gt(i,e),yt(e),r&512&&(Xe||l===null||Wt(l,l.return)),r&4){var g=l!==null?l.memoizedState:null;if(r=e.memoizedState,l===null)if(r===null)if(e.stateNode===null){e:{r=e.type,l=e.memoizedProps,m=m.ownerDocument||m;t:switch(r){case"title":g=m.getElementsByTagName("title")[0],(!g||g[So]||g[it]||g.namespaceURI==="http://www.w3.org/2000/svg"||g.hasAttribute("itemprop"))&&(g=m.createElement(r),m.head.insertBefore(g,m.querySelector("head > title"))),st(g,r,l),g[it]=e,We(g),r=g;break e;case"link":var T=wp("link","href",m).get(r+(l.href||""));if(T){for(var _=0;_<T.length;_++)if(g=T[_],g.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&g.getAttribute("rel")===(l.rel==null?null:l.rel)&&g.getAttribute("title")===(l.title==null?null:l.title)&&g.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){T.splice(_,1);break t}}g=m.createElement(r),st(g,r,l),m.head.appendChild(g);break;case"meta":if(T=wp("meta","content",m).get(r+(l.content||""))){for(_=0;_<T.length;_++)if(g=T[_],g.getAttribute("content")===(l.content==null?null:""+l.content)&&g.getAttribute("name")===(l.name==null?null:l.name)&&g.getAttribute("property")===(l.property==null?null:l.property)&&g.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&g.getAttribute("charset")===(l.charSet==null?null:l.charSet)){T.splice(_,1);break t}}g=m.createElement(r),st(g,r,l),m.head.appendChild(g);break;default:throw Error(a(468,r))}g[it]=e,We(g),r=g}e.stateNode=r}else Rp(m,e.type,e.stateNode);else e.stateNode=Ap(m,r,e.memoizedProps);else g!==r?(g===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):g.count--,r===null?Rp(m,e.type,e.stateNode):Ap(m,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Xr(e,e.memoizedProps,l.memoizedProps)}break;case 27:gt(i,e),yt(e),r&512&&(Xe||l===null||Wt(l,l.return)),l!==null&&r&4&&Xr(e,e.memoizedProps,l.memoizedProps);break;case 5:if(gt(i,e),yt(e),r&512&&(Xe||l===null||Wt(l,l.return)),e.flags&32){m=e.stateNode;try{Ri(m,"")}catch(W){we(e,e.return,W)}}r&4&&e.stateNode!=null&&(m=e.memoizedProps,Xr(e,m,l!==null?l.memoizedProps:m)),r&1024&&(Zr=!0);break;case 6:if(gt(i,e),yt(e),r&4){if(e.stateNode===null)throw Error(a(162));r=e.memoizedProps,l=e.stateNode;try{l.nodeValue=r}catch(W){we(e,e.return,W)}}break;case 3:if(Da=null,m=Ft,Ft=Ma(i.containerInfo),gt(i,e),Ft=m,yt(e),r&4&&l!==null&&l.memoizedState.isDehydrated)try{ao(i.containerInfo)}catch(W){we(e,e.return,W)}Zr&&(Zr=!1,Rm(e));break;case 4:r=Ft,Ft=Ma(e.stateNode.containerInfo),gt(i,e),yt(e),Ft=r;break;case 12:gt(i,e),yt(e);break;case 31:gt(i,e),yt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ga(e,r)));break;case 13:gt(i,e),yt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(va=Et()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ga(e,r)));break;case 22:m=e.memoizedState!==null;var N=l!==null&&l.memoizedState!==null,U=hn,H=Xe;if(hn=U||m,Xe=H||N,gt(i,e),Xe=H,hn=U,yt(e),r&8192)e:for(i=e.stateNode,i._visibility=m?i._visibility&-2:i._visibility|1,m&&(l===null||N||hn||Xe||vi(e)),l=null,i=e;;){if(i.tag===5||i.tag===26){if(l===null){N=l=i;try{if(g=N.stateNode,m)T=g.style,typeof T.setProperty=="function"?T.setProperty("display","none","important"):T.display="none";else{_=N.stateNode;var F=N.memoizedProps.style,k=F!=null&&F.hasOwnProperty("display")?F.display:null;_.style.display=k==null||typeof k=="boolean"?"":(""+k).trim()}}catch(W){we(N,N.return,W)}}}else if(i.tag===6){if(l===null){N=i;try{N.stateNode.nodeValue=m?"":N.memoizedProps}catch(W){we(N,N.return,W)}}}else if(i.tag===18){if(l===null){N=i;try{var q=N.stateNode;m?vp(q,!0):vp(N.stateNode,!1)}catch(W){we(N,N.return,W)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===e)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===e)break e;for(;i.sibling===null;){if(i.return===null||i.return===e)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}r&4&&(r=e.updateQueue,r!==null&&(l=r.retryQueue,l!==null&&(r.retryQueue=null,ga(e,l))));break;case 19:gt(i,e),yt(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ga(e,r)));break;case 30:break;case 21:break;default:gt(i,e),yt(e)}}function yt(e){var i=e.flags;if(i&2){try{for(var l,r=e.return;r!==null;){if(Em(r)){l=r;break}r=r.return}if(l==null)throw Error(a(160));switch(l.tag){case 27:var m=l.stateNode,g=$r(e);ha(e,g,m);break;case 5:var T=l.stateNode;l.flags&32&&(Ri(T,""),l.flags&=-33);var _=$r(e);ha(e,_,T);break;case 3:case 4:var N=l.stateNode.containerInfo,U=$r(e);Qr(e,U,N);break;default:throw Error(a(161))}}catch(H){we(e,e.return,H)}e.flags&=-3}i&4096&&(e.flags&=-4097)}function Rm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var i=e;Rm(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),e=e.sibling}}function yn(e,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)_m(e,i.alternate,i),i=i.sibling}function vi(e){for(e=e.child;e!==null;){var i=e;switch(i.tag){case 0:case 11:case 14:case 15:Hn(4,i,i.return),vi(i);break;case 1:Wt(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&vm(i,i.return,l),vi(i);break;case 27:ol(i.stateNode);case 26:case 5:Wt(i,i.return),vi(i);break;case 22:i.memoizedState===null&&vi(i);break;case 30:vi(i);break;default:vi(i)}e=e.sibling}}function vn(e,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var r=i.alternate,m=e,g=i,T=g.flags;switch(g.tag){case 0:case 11:case 15:vn(m,g,l),Ko(4,g);break;case 1:if(vn(m,g,l),r=g,m=r.stateNode,typeof m.componentDidMount=="function")try{m.componentDidMount()}catch(U){we(r,r.return,U)}if(r=g,m=r.updateQueue,m!==null){var _=r.stateNode;try{var N=m.shared.hiddenCallbacks;if(N!==null)for(m.shared.hiddenCallbacks=null,m=0;m<N.length;m++)af(N[m],_)}catch(U){we(r,r.return,U)}}l&&T&64&&ym(g),Xo(g,g.return);break;case 27:Tm(g);case 26:case 5:vn(m,g,l),l&&r===null&&T&4&&xm(g),Xo(g,g.return);break;case 12:vn(m,g,l);break;case 31:vn(m,g,l),l&&T&4&&Nm(m,g);break;case 13:vn(m,g,l),l&&T&4&&Am(m,g);break;case 22:g.memoizedState===null&&vn(m,g,l),Xo(g,g.return);break;case 30:break;default:vn(m,g,l)}i=i.sibling}}function Wr(e,i){var l=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(l=e.memoizedState.cachePool.pool),e=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(e=i.memoizedState.cachePool.pool),e!==l&&(e!=null&&e.refCount++,l!=null&&ko(l))}function eu(e,i){e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ko(e))}function Jt(e,i,l,r){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Mm(e,i,l,r),i=i.sibling}function Mm(e,i,l,r){var m=i.flags;switch(i.tag){case 0:case 11:case 15:Jt(e,i,l,r),m&2048&&Ko(9,i);break;case 1:Jt(e,i,l,r);break;case 3:Jt(e,i,l,r),m&2048&&(e=null,i.alternate!==null&&(e=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==e&&(i.refCount++,e!=null&&ko(e)));break;case 12:if(m&2048){Jt(e,i,l,r),e=i.stateNode;try{var g=i.memoizedProps,T=g.id,_=g.onPostCommit;typeof _=="function"&&_(T,i.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(N){we(i,i.return,N)}}else Jt(e,i,l,r);break;case 31:Jt(e,i,l,r);break;case 13:Jt(e,i,l,r);break;case 23:break;case 22:g=i.stateNode,T=i.alternate,i.memoizedState!==null?g._visibility&2?Jt(e,i,l,r):$o(e,i):g._visibility&2?Jt(e,i,l,r):(g._visibility|=2,Xi(e,i,l,r,(i.subtreeFlags&10256)!==0||!1)),m&2048&&Wr(T,i);break;case 24:Jt(e,i,l,r),m&2048&&eu(i.alternate,i);break;default:Jt(e,i,l,r)}}function Xi(e,i,l,r,m){for(m=m&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var g=e,T=i,_=l,N=r,U=T.flags;switch(T.tag){case 0:case 11:case 15:Xi(g,T,_,N,m),Ko(8,T);break;case 23:break;case 22:var H=T.stateNode;T.memoizedState!==null?H._visibility&2?Xi(g,T,_,N,m):$o(g,T):(H._visibility|=2,Xi(g,T,_,N,m)),m&&U&2048&&Wr(T.alternate,T);break;case 24:Xi(g,T,_,N,m),m&&U&2048&&eu(T.alternate,T);break;default:Xi(g,T,_,N,m)}i=i.sibling}}function $o(e,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=e,r=i,m=r.flags;switch(r.tag){case 22:$o(l,r),m&2048&&Wr(r.alternate,r);break;case 24:$o(l,r),m&2048&&eu(r.alternate,r);break;default:$o(l,r)}i=i.sibling}}var Qo=8192;function $i(e,i,l){if(e.subtreeFlags&Qo)for(e=e.child;e!==null;)Im(e,i,l),e=e.sibling}function Im(e,i,l){switch(e.tag){case 26:$i(e,i,l),e.flags&Qo&&e.memoizedState!==null&&kx(l,Ft,e.memoizedState,e.memoizedProps);break;case 5:$i(e,i,l);break;case 3:case 4:var r=Ft;Ft=Ma(e.stateNode.containerInfo),$i(e,i,l),Ft=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Qo,Qo=16777216,$i(e,i,l),Qo=r):$i(e,i,l));break;default:$i(e,i,l)}}function Dm(e){var i=e.alternate;if(i!==null&&(e=i.child,e!==null)){i.child=null;do i=e.sibling,e.sibling=null,e=i;while(e!==null)}}function Zo(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];et=r,Lm(r,e)}Dm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Um(e),e=e.sibling}function Um(e){switch(e.tag){case 0:case 11:case 15:Zo(e),e.flags&2048&&Hn(9,e,e.return);break;case 3:Zo(e);break;case 12:Zo(e);break;case 22:var i=e.stateNode;e.memoizedState!==null&&i._visibility&2&&(e.return===null||e.return.tag!==13)?(i._visibility&=-3,ya(e)):Zo(e);break;default:Zo(e)}}function ya(e){var i=e.deletions;if((e.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var r=i[l];et=r,Lm(r,e)}Dm(e)}for(e=e.child;e!==null;){switch(i=e,i.tag){case 0:case 11:case 15:Hn(8,i,i.return),ya(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,ya(i));break;default:ya(i)}e=e.sibling}}function Lm(e,i){for(;et!==null;){var l=et;switch(l.tag){case 0:case 11:case 15:Hn(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var r=l.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:ko(l.memoizedState.cache)}if(r=l.child,r!==null)r.return=l,et=r;else e:for(l=e;et!==null;){r=et;var m=r.sibling,g=r.return;if(bm(r),r===l){et=null;break e}if(m!==null){m.return=g,et=m;break e}et=g}}}var $v={getCacheForType:function(e){var i=lt(Ye),l=i.data.get(e);return l===void 0&&(l=e(),i.data.set(e,l)),l},cacheSignal:function(){return lt(Ye).controller.signal}},Qv=typeof WeakMap=="function"?WeakMap:Map,Ce=0,Le=null,pe=null,ge=0,Ae=0,At=null,zn=!1,Qi=!1,tu=!1,xn=0,Oe=0,On=0,xi=0,nu=0,wt=0,Zi=0,Wo=null,vt=null,iu=!1,va=0,km=0,xa=1/0,Ea=null,Bn=null,$e=0,Fn=null,Wi=null,En=0,ou=0,lu=null,Pm=null,el=0,au=null;function Rt(){return(Ce&2)!==0&&ge!==0?ge&-ge:z.T!==null?fu():Qc()}function Gm(){if(wt===0)if((ge&536870912)===0||ve){var e=wl;wl<<=1,(wl&3932160)===0&&(wl=262144),wt=e}else wt=536870912;return e=Ct.current,e!==null&&(e.flags|=32),wt}function xt(e,i,l){(e===Le&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)&&(eo(e,0),Jn(e,ge,wt,!1)),To(e,l),((Ce&2)===0||e!==Le)&&(e===Le&&((Ce&2)===0&&(xi|=l),Oe===4&&Jn(e,ge,wt,!1)),en(e))}function qm(e,i,l){if((Ce&6)!==0)throw Error(a(327));var r=!l&&(i&127)===0&&(i&e.expiredLanes)===0||Eo(e,i),m=r?ex(e,i):ru(e,i,!0),g=r;do{if(m===0){Qi&&!r&&Jn(e,i,0,!1);break}else{if(l=e.current.alternate,g&&!Zv(l)){m=ru(e,i,!1),g=!1;continue}if(m===2){if(g=i,e.errorRecoveryDisabledLanes&g)var T=0;else T=e.pendingLanes&-536870913,T=T!==0?T:T&536870912?536870912:0;if(T!==0){i=T;e:{var _=e;m=Wo;var N=_.current.memoizedState.isDehydrated;if(N&&(eo(_,T).flags|=256),T=ru(_,T,!1),T!==2){if(tu&&!N){_.errorRecoveryDisabledLanes|=g,xi|=g,m=4;break e}g=vt,vt=m,g!==null&&(vt===null?vt=g:vt.push.apply(vt,g))}m=T}if(g=!1,m!==2)continue}}if(m===1){eo(e,0),Jn(e,i,0,!0);break}e:{switch(r=e,g=m,g){case 0:case 1:throw Error(a(345));case 4:if((i&4194048)!==i)break;case 6:Jn(r,i,wt,!zn);break e;case 2:vt=null;break;case 3:case 5:break;default:throw Error(a(329))}if((i&62914560)===i&&(m=va+300-Et(),10<m)){if(Jn(r,i,wt,!zn),Ml(r,0,!0)!==0)break e;En=i,r.timeoutHandle=hp(Vm.bind(null,r,l,vt,Ea,iu,i,wt,xi,Zi,zn,g,"Throttled",-0,0),m);break e}Vm(r,l,vt,Ea,iu,i,wt,xi,Zi,zn,g,null,-0,0)}}break}while(!0);en(e)}function Vm(e,i,l,r,m,g,T,_,N,U,H,F,k,q){if(e.timeoutHandle=-1,F=i.subtreeFlags,F&8192||(F&16785408)===16785408){F={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ln},Im(i,g,F);var W=(g&62914560)===g?va-Et():(g&4194048)===g?km-Et():0;if(W=Px(F,W),W!==null){En=g,e.cancelPendingCommit=W(jm.bind(null,e,i,g,l,r,m,T,_,N,H,F,null,k,q)),Jn(e,g,T,!U);return}}jm(e,i,g,l,r,m,T,_,N)}function Zv(e){for(var i=e;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var r=0;r<l.length;r++){var m=l[r],g=m.getSnapshot;m=m.value;try{if(!_t(g(),m))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;else{if(i===e)break;for(;i.sibling===null;){if(i.return===null||i.return===e)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Jn(e,i,l,r){i&=~nu,i&=~xi,e.suspendedLanes|=i,e.pingedLanes&=~i,r&&(e.warmLanes|=i),r=e.expirationTimes;for(var m=i;0<m;){var g=31-St(m),T=1<<g;r[g]=-1,m&=~T}l!==0&&Kc(e,l,i)}function Ta(){return(Ce&6)===0?(tl(0),!1):!0}function su(){if(pe!==null){if(Ae===0)var e=pe.return;else e=pe,un=ci=null,_r(e),Fi=null,Go=0,e=pe;for(;e!==null;)gm(e.alternate,e),e=e.return;pe=null}}function eo(e,i){var l=e.timeoutHandle;l!==-1&&(e.timeoutHandle=-1,vx(l)),l=e.cancelPendingCommit,l!==null&&(e.cancelPendingCommit=null,l()),En=0,su(),Le=e,pe=l=sn(e.current,null),ge=i,Ae=0,At=null,zn=!1,Qi=Eo(e,i),tu=!1,Zi=wt=nu=xi=On=Oe=0,vt=Wo=null,iu=!1,(i&8)!==0&&(i|=i&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=i;0<r;){var m=31-St(r),g=1<<m;i|=e[m],r&=~g}return xn=i,Ol(),l}function Hm(e,i){de=null,z.H=Jo,i===Bi||i===$l?(i=tf(),Ae=3):i===dr?(i=tf(),Ae=4):Ae=i===Vr?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,At=i,pe===null&&(Oe=1,ca(e,Lt(i,e.current)))}function zm(){var e=Ct.current;return e===null?!0:(ge&4194048)===ge?qt===null:(ge&62914560)===ge||(ge&536870912)!==0?e===qt:!1}function Om(){var e=z.H;return z.H=Jo,e===null?Jo:e}function Bm(){var e=z.A;return z.A=$v,e}function Sa(){Oe=4,zn||(ge&4194048)!==ge&&Ct.current!==null||(Qi=!0),(On&134217727)===0&&(xi&134217727)===0||Le===null||Jn(Le,ge,wt,!1)}function ru(e,i,l){var r=Ce;Ce|=2;var m=Om(),g=Bm();(Le!==e||ge!==i)&&(Ea=null,eo(e,i)),i=!1;var T=Oe;e:do try{if(Ae!==0&&pe!==null){var _=pe,N=At;switch(Ae){case 8:su(),T=6;break e;case 3:case 2:case 9:case 6:Ct.current===null&&(i=!0);var U=Ae;if(Ae=0,At=null,to(e,_,N,U),l&&Qi){T=0;break e}break;default:U=Ae,Ae=0,At=null,to(e,_,N,U)}}Wv(),T=Oe;break}catch(H){Hm(e,H)}while(!0);return i&&e.shellSuspendCounter++,un=ci=null,Ce=r,z.H=m,z.A=g,pe===null&&(Le=null,ge=0,Ol()),T}function Wv(){for(;pe!==null;)Fm(pe)}function ex(e,i){var l=Ce;Ce|=2;var r=Om(),m=Bm();Le!==e||ge!==i?(Ea=null,xa=Et()+500,eo(e,i)):Qi=Eo(e,i);e:do try{if(Ae!==0&&pe!==null){i=pe;var g=At;t:switch(Ae){case 1:Ae=0,At=null,to(e,i,g,1);break;case 2:case 9:if(Wd(g)){Ae=0,At=null,Jm(i);break}i=function(){Ae!==2&&Ae!==9||Le!==e||(Ae=7),en(e)},g.then(i,i);break e;case 3:Ae=7;break e;case 4:Ae=5;break e;case 7:Wd(g)?(Ae=0,At=null,Jm(i)):(Ae=0,At=null,to(e,i,g,7));break;case 5:var T=null;switch(pe.tag){case 26:T=pe.memoizedState;case 5:case 27:var _=pe;if(T?Mp(T):_.stateNode.complete){Ae=0,At=null;var N=_.sibling;if(N!==null)pe=N;else{var U=_.return;U!==null?(pe=U,_a(U)):pe=null}break t}}Ae=0,At=null,to(e,i,g,5);break;case 6:Ae=0,At=null,to(e,i,g,6);break;case 8:su(),Oe=6;break e;default:throw Error(a(462))}}tx();break}catch(H){Hm(e,H)}while(!0);return un=ci=null,z.H=r,z.A=m,Ce=l,pe!==null?0:(Le=null,ge=0,Ol(),Oe)}function tx(){for(;pe!==null&&!by();)Fm(pe)}function Fm(e){var i=pm(e.alternate,e,xn);e.memoizedProps=e.pendingProps,i===null?_a(e):pe=i}function Jm(e){var i=e,l=i.alternate;switch(i.tag){case 15:case 0:i=rm(l,i,i.pendingProps,i.type,void 0,ge);break;case 11:i=rm(l,i,i.pendingProps,i.type.render,i.ref,ge);break;case 5:_r(i);default:gm(l,i),i=pe=Od(i,xn),i=pm(l,i,xn)}e.memoizedProps=e.pendingProps,i===null?_a(e):pe=i}function to(e,i,l,r){un=ci=null,_r(i),Fi=null,Go=0;var m=i.return;try{if(Bv(e,m,i,l,ge)){Oe=1,ca(e,Lt(l,e.current)),pe=null;return}}catch(g){if(m!==null)throw pe=m,g;Oe=1,ca(e,Lt(l,e.current)),pe=null;return}i.flags&32768?(ve||r===1?e=!0:Qi||(ge&536870912)!==0?e=!1:(zn=e=!0,(r===2||r===9||r===3||r===6)&&(r=Ct.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ym(i,e)):_a(i)}function _a(e){var i=e;do{if((i.flags&32768)!==0){Ym(i,zn);return}e=i.return;var l=Yv(i.alternate,i,xn);if(l!==null){pe=l;return}if(i=i.sibling,i!==null){pe=i;return}pe=i=e}while(i!==null);Oe===0&&(Oe=5)}function Ym(e,i){do{var l=jv(e.alternate,e);if(l!==null){l.flags&=32767,pe=l;return}if(l=e.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(e=e.sibling,e!==null)){pe=e;return}pe=e=l}while(e!==null);Oe=6,pe=null}function jm(e,i,l,r,m,g,T,_,N){e.cancelPendingCommit=null;do ba();while($e!==0);if((Ce&6)!==0)throw Error(a(327));if(i!==null){if(i===e.current)throw Error(a(177));if(g=i.lanes|i.childLanes,g|=$s,Ly(e,l,g,T,_,N),e===Le&&(pe=Le=null,ge=0),Wi=i,Fn=e,En=l,ou=g,lu=m,Pm=r,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,lx(Nl,function(){return Zm(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||r){r=z.T,z.T=null,m=K.p,K.p=2,T=Ce,Ce|=4;try{Kv(e,i,l)}finally{Ce=T,K.p=m,z.T=r}}$e=1,Km(),Xm(),$m()}}function Km(){if($e===1){$e=0;var e=Fn,i=Wi,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=z.T,z.T=null;var r=K.p;K.p=2;var m=Ce;Ce|=4;try{wm(i,e);var g=Eu,T=Ud(e.containerInfo),_=g.focusedElem,N=g.selectionRange;if(T!==_&&_&&_.ownerDocument&&Dd(_.ownerDocument.documentElement,_)){if(N!==null&&Js(_)){var U=N.start,H=N.end;if(H===void 0&&(H=U),"selectionStart"in _)_.selectionStart=U,_.selectionEnd=Math.min(H,_.value.length);else{var F=_.ownerDocument||document,k=F&&F.defaultView||window;if(k.getSelection){var q=k.getSelection(),W=_.textContent.length,oe=Math.min(N.start,W),De=N.end===void 0?oe:Math.min(N.end,W);!q.extend&&oe>De&&(T=De,De=oe,oe=T);var M=Id(_,oe),A=Id(_,De);if(M&&A&&(q.rangeCount!==1||q.anchorNode!==M.node||q.anchorOffset!==M.offset||q.focusNode!==A.node||q.focusOffset!==A.offset)){var D=F.createRange();D.setStart(M.node,M.offset),q.removeAllRanges(),oe>De?(q.addRange(D),q.extend(A.node,A.offset)):(D.setEnd(A.node,A.offset),q.addRange(D))}}}}for(F=[],q=_;q=q.parentNode;)q.nodeType===1&&F.push({element:q,left:q.scrollLeft,top:q.scrollTop});for(typeof _.focus=="function"&&_.focus(),_=0;_<F.length;_++){var O=F[_];O.element.scrollLeft=O.left,O.element.scrollTop=O.top}}Pa=!!xu,Eu=xu=null}finally{Ce=m,K.p=r,z.T=l}}e.current=i,$e=2}}function Xm(){if($e===2){$e=0;var e=Fn,i=Wi,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=z.T,z.T=null;var r=K.p;K.p=2;var m=Ce;Ce|=4;try{_m(e,i.alternate,i)}finally{Ce=m,K.p=r,z.T=l}}$e=3}}function $m(){if($e===4||$e===3){$e=0,Cy();var e=Fn,i=Wi,l=En,r=Pm;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?$e=5:($e=0,Wi=Fn=null,Qm(e,e.pendingLanes));var m=e.pendingLanes;if(m===0&&(Bn=null),Ns(l),i=i.stateNode,Tt&&typeof Tt.onCommitFiberRoot=="function")try{Tt.onCommitFiberRoot(xo,i,void 0,(i.current.flags&128)===128)}catch{}if(r!==null){i=z.T,m=K.p,K.p=2,z.T=null;try{for(var g=e.onRecoverableError,T=0;T<r.length;T++){var _=r[T];g(_.value,{componentStack:_.stack})}}finally{z.T=i,K.p=m}}(En&3)!==0&&ba(),en(e),m=e.pendingLanes,(l&261930)!==0&&(m&42)!==0?e===au?el++:(el=0,au=e):el=0,tl(0)}}function Qm(e,i){(e.pooledCacheLanes&=i)===0&&(i=e.pooledCache,i!=null&&(e.pooledCache=null,ko(i)))}function ba(){return Km(),Xm(),$m(),Zm()}function Zm(){if($e!==5)return!1;var e=Fn,i=ou;ou=0;var l=Ns(En),r=z.T,m=K.p;try{K.p=32>l?32:l,z.T=null,l=lu,lu=null;var g=Fn,T=En;if($e=0,Wi=Fn=null,En=0,(Ce&6)!==0)throw Error(a(331));var _=Ce;if(Ce|=4,Um(g.current),Mm(g,g.current,T,l),Ce=_,tl(0,!1),Tt&&typeof Tt.onPostCommitFiberRoot=="function")try{Tt.onPostCommitFiberRoot(xo,g)}catch{}return!0}finally{K.p=m,z.T=r,Qm(e,i)}}function Wm(e,i,l){i=Lt(l,i),i=qr(e.stateNode,i,2),e=Gn(e,i,2),e!==null&&(To(e,2),en(e))}function we(e,i,l){if(e.tag===3)Wm(e,e,l);else for(;i!==null;){if(i.tag===3){Wm(i,e,l);break}else if(i.tag===1){var r=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Bn===null||!Bn.has(r))){e=Lt(l,e),l=em(2),r=Gn(i,l,2),r!==null&&(tm(l,r,i,e),To(r,2),en(r));break}}i=i.return}}function uu(e,i,l){var r=e.pingCache;if(r===null){r=e.pingCache=new Qv;var m=new Set;r.set(i,m)}else m=r.get(i),m===void 0&&(m=new Set,r.set(i,m));m.has(l)||(tu=!0,m.add(l),e=nx.bind(null,e,i,l),i.then(e,e))}function nx(e,i,l){var r=e.pingCache;r!==null&&r.delete(i),e.pingedLanes|=e.suspendedLanes&l,e.warmLanes&=~l,Le===e&&(ge&l)===l&&(Oe===4||Oe===3&&(ge&62914560)===ge&&300>Et()-va?(Ce&2)===0&&eo(e,0):nu|=l,Zi===ge&&(Zi=0)),en(e)}function ep(e,i){i===0&&(i=jc()),e=si(e,i),e!==null&&(To(e,i),en(e))}function ix(e){var i=e.memoizedState,l=0;i!==null&&(l=i.retryLane),ep(e,l)}function ox(e,i){var l=0;switch(e.tag){case 31:case 13:var r=e.stateNode,m=e.memoizedState;m!==null&&(l=m.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(i),ep(e,l)}function lx(e,i){return Ss(e,i)}var Ca=null,no=null,cu=!1,Na=!1,du=!1,Yn=0;function en(e){e!==no&&e.next===null&&(no===null?Ca=no=e:no=no.next=e),Na=!0,cu||(cu=!0,sx())}function tl(e,i){if(!du&&Na){du=!0;do for(var l=!1,r=Ca;r!==null;){if(e!==0){var m=r.pendingLanes;if(m===0)var g=0;else{var T=r.suspendedLanes,_=r.pingedLanes;g=(1<<31-St(42|e)+1)-1,g&=m&~(T&~_),g=g&201326741?g&201326741|1:g?g|2:0}g!==0&&(l=!0,op(r,g))}else g=ge,g=Ml(r,r===Le?g:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(g&3)===0||Eo(r,g)||(l=!0,op(r,g));r=r.next}while(l);du=!1}}function ax(){tp()}function tp(){Na=cu=!1;var e=0;Yn!==0&&yx()&&(e=Yn);for(var i=Et(),l=null,r=Ca;r!==null;){var m=r.next,g=np(r,i);g===0?(r.next=null,l===null?Ca=m:l.next=m,m===null&&(no=l)):(l=r,(e!==0||(g&3)!==0)&&(Na=!0)),r=m}$e!==0&&$e!==5||tl(e),Yn!==0&&(Yn=0)}function np(e,i){for(var l=e.suspendedLanes,r=e.pingedLanes,m=e.expirationTimes,g=e.pendingLanes&-62914561;0<g;){var T=31-St(g),_=1<<T,N=m[T];N===-1?((_&l)===0||(_&r)!==0)&&(m[T]=Uy(_,i)):N<=i&&(e.expiredLanes|=_),g&=~_}if(i=Le,l=ge,l=Ml(e,e===i?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,l===0||e===i&&(Ae===2||Ae===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&_s(r),e.callbackNode=null,e.callbackPriority=0;if((l&3)===0||Eo(e,l)){if(i=l&-l,i===e.callbackPriority)return i;switch(r!==null&&_s(r),Ns(l)){case 2:case 8:l=Jc;break;case 32:l=Nl;break;case 268435456:l=Yc;break;default:l=Nl}return r=ip.bind(null,e),l=Ss(l,r),e.callbackPriority=i,e.callbackNode=l,i}return r!==null&&r!==null&&_s(r),e.callbackPriority=2,e.callbackNode=null,2}function ip(e,i){if($e!==0&&$e!==5)return e.callbackNode=null,e.callbackPriority=0,null;var l=e.callbackNode;if(ba()&&e.callbackNode!==l)return null;var r=ge;return r=Ml(e,e===Le?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(qm(e,r,i),np(e,Et()),e.callbackNode!=null&&e.callbackNode===l?ip.bind(null,e):null)}function op(e,i){if(ba())return null;qm(e,i,!0)}function sx(){xx(function(){(Ce&6)!==0?Ss(Fc,ax):tp()})}function fu(){if(Yn===0){var e=zi;e===0&&(e=Al,Al<<=1,(Al&261888)===0&&(Al=256)),Yn=e}return Yn}function lp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ll(""+e)}function ap(e,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,e.id&&l.setAttribute("form",e.id),i.parentNode.insertBefore(l,i),e=new FormData(e),l.parentNode.removeChild(l),e}function rx(e,i,l,r,m){if(i==="submit"&&l&&l.stateNode===m){var g=lp((m[mt]||null).action),T=r.submitter;T&&(i=(i=T[mt]||null)?lp(i.formAction):T.getAttribute("formAction"),i!==null&&(g=i,T=null));var _=new ql("action","action",null,r,m);e.push({event:_,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Yn!==0){var N=T?ap(m,T):new FormData(m);Dr(l,{pending:!0,data:N,method:m.method,action:g},null,N)}}else typeof g=="function"&&(_.preventDefault(),N=T?ap(m,T):new FormData(m),Dr(l,{pending:!0,data:N,method:m.method,action:g},g,N))},currentTarget:m}]})}}for(var mu=0;mu<Xs.length;mu++){var pu=Xs[mu],ux=pu.toLowerCase(),cx=pu[0].toUpperCase()+pu.slice(1);Bt(ux,"on"+cx)}Bt(Pd,"onAnimationEnd"),Bt(Gd,"onAnimationIteration"),Bt(qd,"onAnimationStart"),Bt("dblclick","onDoubleClick"),Bt("focusin","onFocus"),Bt("focusout","onBlur"),Bt(Nv,"onTransitionRun"),Bt(Av,"onTransitionStart"),Bt(wv,"onTransitionCancel"),Bt(Vd,"onTransitionEnd"),Ai("onMouseEnter",["mouseout","mouseover"]),Ai("onMouseLeave",["mouseout","mouseover"]),Ai("onPointerEnter",["pointerout","pointerover"]),Ai("onPointerLeave",["pointerout","pointerover"]),ii("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ii("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ii("onBeforeInput",["compositionend","keypress","textInput","paste"]),ii("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ii("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var nl="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(" "),dx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(nl));function sp(e,i){i=(i&4)!==0;for(var l=0;l<e.length;l++){var r=e[l],m=r.event;r=r.listeners;e:{var g=void 0;if(i)for(var T=r.length-1;0<=T;T--){var _=r[T],N=_.instance,U=_.currentTarget;if(_=_.listener,N!==g&&m.isPropagationStopped())break e;g=_,m.currentTarget=U;try{g(m)}catch(H){zl(H)}m.currentTarget=null,g=N}else for(T=0;T<r.length;T++){if(_=r[T],N=_.instance,U=_.currentTarget,_=_.listener,N!==g&&m.isPropagationStopped())break e;g=_,m.currentTarget=U;try{g(m)}catch(H){zl(H)}m.currentTarget=null,g=N}}}}function he(e,i){var l=i[As];l===void 0&&(l=i[As]=new Set);var r=e+"__bubble";l.has(r)||(rp(i,e,2,!1),l.add(r))}function hu(e,i,l){var r=0;i&&(r|=4),rp(l,e,r,i)}var Aa="_reactListening"+Math.random().toString(36).slice(2);function gu(e){if(!e[Aa]){e[Aa]=!0,ed.forEach(function(l){l!=="selectionchange"&&(dx.has(l)||hu(l,!1,e),hu(l,!0,e))});var i=e.nodeType===9?e:e.ownerDocument;i===null||i[Aa]||(i[Aa]=!0,hu("selectionchange",!1,i))}}function rp(e,i,l,r){switch(Gp(i)){case 2:var m=Vx;break;case 8:m=Hx;break;default:m=Iu}l=m.bind(null,i,l,e),m=void 0,!Ps||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(m=!0),r?m!==void 0?e.addEventListener(i,l,{capture:!0,passive:m}):e.addEventListener(i,l,!0):m!==void 0?e.addEventListener(i,l,{passive:m}):e.addEventListener(i,l,!1)}function yu(e,i,l,r,m){var g=r;if((i&1)===0&&(i&2)===0&&r!==null)e:for(;;){if(r===null)return;var T=r.tag;if(T===3||T===4){var _=r.stateNode.containerInfo;if(_===m)break;if(T===4)for(T=r.return;T!==null;){var N=T.tag;if((N===3||N===4)&&T.stateNode.containerInfo===m)return;T=T.return}for(;_!==null;){if(T=bi(_),T===null)return;if(N=T.tag,N===5||N===6||N===26||N===27){r=g=T;continue e}_=_.parentNode}}r=r.return}fd(function(){var U=g,H=Ls(l),F=[];e:{var k=Hd.get(e);if(k!==void 0){var q=ql,W=e;switch(e){case"keypress":if(Pl(l)===0)break e;case"keydown":case"keyup":q=ov;break;case"focusin":W="focus",q=Hs;break;case"focusout":W="blur",q=Hs;break;case"beforeblur":case"afterblur":q=Hs;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":q=hd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":q=Yy;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":q=sv;break;case Pd:case Gd:case qd:q=Xy;break;case Vd:q=uv;break;case"scroll":case"scrollend":q=Fy;break;case"wheel":q=dv;break;case"copy":case"cut":case"paste":q=Qy;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":q=yd;break;case"toggle":case"beforetoggle":q=mv}var oe=(i&4)!==0,De=!oe&&(e==="scroll"||e==="scrollend"),M=oe?k!==null?k+"Capture":null:k;oe=[];for(var A=U,D;A!==null;){var O=A;if(D=O.stateNode,O=O.tag,O!==5&&O!==26&&O!==27||D===null||M===null||(O=bo(A,M),O!=null&&oe.push(il(A,O,D))),De)break;A=A.return}0<oe.length&&(k=new q(k,W,null,l,H),F.push({event:k,listeners:oe}))}}if((i&7)===0){e:{if(k=e==="mouseover"||e==="pointerover",q=e==="mouseout"||e==="pointerout",k&&l!==Us&&(W=l.relatedTarget||l.fromElement)&&(bi(W)||W[_i]))break e;if((q||k)&&(k=H.window===H?H:(k=H.ownerDocument)?k.defaultView||k.parentWindow:window,q?(W=l.relatedTarget||l.toElement,q=U,W=W?bi(W):null,W!==null&&(De=c(W),oe=W.tag,W!==De||oe!==5&&oe!==27&&oe!==6)&&(W=null)):(q=null,W=U),q!==W)){if(oe=hd,O="onMouseLeave",M="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(oe=yd,O="onPointerLeave",M="onPointerEnter",A="pointer"),De=q==null?k:_o(q),D=W==null?k:_o(W),k=new oe(O,A+"leave",q,l,H),k.target=De,k.relatedTarget=D,O=null,bi(H)===U&&(oe=new oe(M,A+"enter",W,l,H),oe.target=D,oe.relatedTarget=De,O=oe),De=O,q&&W)t:{for(oe=fx,M=q,A=W,D=0,O=M;O;O=oe(O))D++;O=0;for(var ie=A;ie;ie=oe(ie))O++;for(;0<D-O;)M=oe(M),D--;for(;0<O-D;)A=oe(A),O--;for(;D--;){if(M===A||A!==null&&M===A.alternate){oe=M;break t}M=oe(M),A=oe(A)}oe=null}else oe=null;q!==null&&up(F,k,q,oe,!1),W!==null&&De!==null&&up(F,De,W,oe,!0)}}e:{if(k=U?_o(U):window,q=k.nodeName&&k.nodeName.toLowerCase(),q==="select"||q==="input"&&k.type==="file")var Ee=Cd;else if(_d(k))if(Nd)Ee=_v;else{Ee=Tv;var te=Ev}else q=k.nodeName,!q||q.toLowerCase()!=="input"||k.type!=="checkbox"&&k.type!=="radio"?U&&Ds(U.elementType)&&(Ee=Cd):Ee=Sv;if(Ee&&(Ee=Ee(e,U))){bd(F,Ee,l,H);break e}te&&te(e,k,U),e==="focusout"&&U&&k.type==="number"&&U.memoizedProps.value!=null&&Is(k,"number",k.value)}switch(te=U?_o(U):window,e){case"focusin":(_d(te)||te.contentEditable==="true")&&(Ui=te,Ys=U,Do=null);break;case"focusout":Do=Ys=Ui=null;break;case"mousedown":js=!0;break;case"contextmenu":case"mouseup":case"dragend":js=!1,Ld(F,l,H);break;case"selectionchange":if(Cv)break;case"keydown":case"keyup":Ld(F,l,H)}var fe;if(Os)e:{switch(e){case"compositionstart":var ye="onCompositionStart";break e;case"compositionend":ye="onCompositionEnd";break e;case"compositionupdate":ye="onCompositionUpdate";break e}ye=void 0}else Di?Td(e,l)&&(ye="onCompositionEnd"):e==="keydown"&&l.keyCode===229&&(ye="onCompositionStart");ye&&(vd&&l.locale!=="ko"&&(Di||ye!=="onCompositionStart"?ye==="onCompositionEnd"&&Di&&(fe=md()):(Mn=H,Gs="value"in Mn?Mn.value:Mn.textContent,Di=!0)),te=wa(U,ye),0<te.length&&(ye=new gd(ye,e,null,l,H),F.push({event:ye,listeners:te}),fe?ye.data=fe:(fe=Sd(l),fe!==null&&(ye.data=fe)))),(fe=hv?gv(e,l):yv(e,l))&&(ye=wa(U,"onBeforeInput"),0<ye.length&&(te=new gd("onBeforeInput","beforeinput",null,l,H),F.push({event:te,listeners:ye}),te.data=fe)),rx(F,e,U,l,H)}sp(F,i)})}function il(e,i,l){return{instance:e,listener:i,currentTarget:l}}function wa(e,i){for(var l=i+"Capture",r=[];e!==null;){var m=e,g=m.stateNode;if(m=m.tag,m!==5&&m!==26&&m!==27||g===null||(m=bo(e,l),m!=null&&r.unshift(il(e,m,g)),m=bo(e,i),m!=null&&r.push(il(e,m,g))),e.tag===3)return r;e=e.return}return[]}function fx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function up(e,i,l,r,m){for(var g=i._reactName,T=[];l!==null&&l!==r;){var _=l,N=_.alternate,U=_.stateNode;if(_=_.tag,N!==null&&N===r)break;_!==5&&_!==26&&_!==27||U===null||(N=U,m?(U=bo(l,g),U!=null&&T.unshift(il(l,U,N))):m||(U=bo(l,g),U!=null&&T.push(il(l,U,N)))),l=l.return}T.length!==0&&e.push({event:i,listeners:T})}var mx=/\r\n?/g,px=/\u0000|\uFFFD/g;function cp(e){return(typeof e=="string"?e:""+e).replace(mx,`
`).replace(px,"")}function dp(e,i){return i=cp(i),cp(e)===i}function Ie(e,i,l,r,m,g){switch(l){case"children":typeof r=="string"?i==="body"||i==="textarea"&&r===""||Ri(e,r):(typeof r=="number"||typeof r=="bigint")&&i!=="body"&&Ri(e,""+r);break;case"className":Dl(e,"class",r);break;case"tabIndex":Dl(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":Dl(e,l,r);break;case"style":cd(e,r,g);break;case"data":if(i!=="object"){Dl(e,"data",r);break}case"src":case"href":if(r===""&&(i!=="a"||l!=="href")){e.removeAttribute(l);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=Ll(""+r),e.setAttribute(l,r);break;case"action":case"formAction":if(typeof r=="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 g=="function"&&(l==="formAction"?(i!=="input"&&Ie(e,i,"name",m.name,m,null),Ie(e,i,"formEncType",m.formEncType,m,null),Ie(e,i,"formMethod",m.formMethod,m,null),Ie(e,i,"formTarget",m.formTarget,m,null)):(Ie(e,i,"encType",m.encType,m,null),Ie(e,i,"method",m.method,m,null),Ie(e,i,"target",m.target,m,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(l);break}r=Ll(""+r),e.setAttribute(l,r);break;case"onClick":r!=null&&(e.onclick=ln);break;case"onScroll":r!=null&&he("scroll",e);break;case"onScrollEnd":r!=null&&he("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(m.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"multiple":e.multiple=r&&typeof r!="function"&&typeof r!="symbol";break;case"muted":e.muted=r&&typeof r!="function"&&typeof r!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(r==null||typeof r=="function"||typeof r=="boolean"||typeof r=="symbol"){e.removeAttribute("xlink:href");break}l=Ll(""+r),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":r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""+r):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":r&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,""):e.removeAttribute(l);break;case"capture":case"download":r===!0?e.setAttribute(l,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(l,r):e.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(l,r):e.removeAttribute(l);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(l):e.setAttribute(l,r);break;case"popover":he("beforetoggle",e),he("toggle",e),Il(e,"popover",r);break;case"xlinkActuate":on(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":on(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":on(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":on(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":on(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":on(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":on(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":on(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":on(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":Il(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=Oy.get(l)||l,Il(e,l,r))}}function vu(e,i,l,r,m,g){switch(l){case"style":cd(e,r,g);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(a(61));if(l=r.__html,l!=null){if(m.children!=null)throw Error(a(60));e.innerHTML=l}}break;case"children":typeof r=="string"?Ri(e,r):(typeof r=="number"||typeof r=="bigint")&&Ri(e,""+r);break;case"onScroll":r!=null&&he("scroll",e);break;case"onScrollEnd":r!=null&&he("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ln);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!td.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(m=l.endsWith("Capture"),i=l.slice(2,m?l.length-7:void 0),g=e[mt]||null,g=g!=null?g[l]:null,typeof g=="function"&&e.removeEventListener(i,g,m),typeof r=="function")){typeof g!="function"&&g!==null&&(l in e?e[l]=null:e.hasAttribute(l)&&e.removeAttribute(l)),e.addEventListener(i,r,m);break e}l in e?e[l]=r:r===!0?e.setAttribute(l,""):Il(e,l,r)}}}function st(e,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":he("error",e),he("load",e);var r=!1,m=!1,g;for(g in l)if(l.hasOwnProperty(g)){var T=l[g];if(T!=null)switch(g){case"src":r=!0;break;case"srcSet":m=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ie(e,i,g,T,l,null)}}m&&Ie(e,i,"srcSet",l.srcSet,l,null),r&&Ie(e,i,"src",l.src,l,null);return;case"input":he("invalid",e);var _=g=T=m=null,N=null,U=null;for(r in l)if(l.hasOwnProperty(r)){var H=l[r];if(H!=null)switch(r){case"name":m=H;break;case"type":T=H;break;case"checked":N=H;break;case"defaultChecked":U=H;break;case"value":g=H;break;case"defaultValue":_=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(a(137,i));break;default:Ie(e,i,r,H,l,null)}}ad(e,g,_,N,U,T,m,!1);return;case"select":he("invalid",e),r=T=g=null;for(m in l)if(l.hasOwnProperty(m)&&(_=l[m],_!=null))switch(m){case"value":g=_;break;case"defaultValue":T=_;break;case"multiple":r=_;default:Ie(e,i,m,_,l,null)}i=g,l=T,e.multiple=!!r,i!=null?wi(e,!!r,i,!1):l!=null&&wi(e,!!r,l,!0);return;case"textarea":he("invalid",e),g=m=r=null;for(T in l)if(l.hasOwnProperty(T)&&(_=l[T],_!=null))switch(T){case"value":r=_;break;case"defaultValue":m=_;break;case"children":g=_;break;case"dangerouslySetInnerHTML":if(_!=null)throw Error(a(91));break;default:Ie(e,i,T,_,l,null)}rd(e,r,m,g);return;case"option":for(N in l)if(l.hasOwnProperty(N)&&(r=l[N],r!=null))switch(N){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Ie(e,i,N,r,l,null)}return;case"dialog":he("beforetoggle",e),he("toggle",e),he("cancel",e),he("close",e);break;case"iframe":case"object":he("load",e);break;case"video":case"audio":for(r=0;r<nl.length;r++)he(nl[r],e);break;case"image":he("error",e),he("load",e);break;case"details":he("toggle",e);break;case"embed":case"source":case"link":he("error",e),he("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)&&(r=l[U],r!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(a(137,i));default:Ie(e,i,U,r,l,null)}return;default:if(Ds(i)){for(H in l)l.hasOwnProperty(H)&&(r=l[H],r!==void 0&&vu(e,i,H,r,l,void 0));return}}for(_ in l)l.hasOwnProperty(_)&&(r=l[_],r!=null&&Ie(e,i,_,r,l,null))}function hx(e,i,l,r){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var m=null,g=null,T=null,_=null,N=null,U=null,H=null;for(q in l){var F=l[q];if(l.hasOwnProperty(q)&&F!=null)switch(q){case"checked":break;case"value":break;case"defaultValue":N=F;default:r.hasOwnProperty(q)||Ie(e,i,q,null,r,F)}}for(var k in r){var q=r[k];if(F=l[k],r.hasOwnProperty(k)&&(q!=null||F!=null))switch(k){case"type":g=q;break;case"name":m=q;break;case"checked":U=q;break;case"defaultChecked":H=q;break;case"value":T=q;break;case"defaultValue":_=q;break;case"children":case"dangerouslySetInnerHTML":if(q!=null)throw Error(a(137,i));break;default:q!==F&&Ie(e,i,k,q,r,F)}}Ms(e,T,_,N,U,H,g,m);return;case"select":q=T=_=k=null;for(g in l)if(N=l[g],l.hasOwnProperty(g)&&N!=null)switch(g){case"value":break;case"multiple":q=N;default:r.hasOwnProperty(g)||Ie(e,i,g,null,r,N)}for(m in r)if(g=r[m],N=l[m],r.hasOwnProperty(m)&&(g!=null||N!=null))switch(m){case"value":k=g;break;case"defaultValue":_=g;break;case"multiple":T=g;default:g!==N&&Ie(e,i,m,g,r,N)}i=_,l=T,r=q,k!=null?wi(e,!!l,k,!1):!!r!=!!l&&(i!=null?wi(e,!!l,i,!0):wi(e,!!l,l?[]:"",!1));return;case"textarea":q=k=null;for(_ in l)if(m=l[_],l.hasOwnProperty(_)&&m!=null&&!r.hasOwnProperty(_))switch(_){case"value":break;case"children":break;default:Ie(e,i,_,null,r,m)}for(T in r)if(m=r[T],g=l[T],r.hasOwnProperty(T)&&(m!=null||g!=null))switch(T){case"value":k=m;break;case"defaultValue":q=m;break;case"children":break;case"dangerouslySetInnerHTML":if(m!=null)throw Error(a(91));break;default:m!==g&&Ie(e,i,T,m,r,g)}sd(e,k,q);return;case"option":for(var W in l)if(k=l[W],l.hasOwnProperty(W)&&k!=null&&!r.hasOwnProperty(W))switch(W){case"selected":e.selected=!1;break;default:Ie(e,i,W,null,r,k)}for(N in r)if(k=r[N],q=l[N],r.hasOwnProperty(N)&&k!==q&&(k!=null||q!=null))switch(N){case"selected":e.selected=k&&typeof k!="function"&&typeof k!="symbol";break;default:Ie(e,i,N,k,r,q)}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 oe in l)k=l[oe],l.hasOwnProperty(oe)&&k!=null&&!r.hasOwnProperty(oe)&&Ie(e,i,oe,null,r,k);for(U in r)if(k=r[U],q=l[U],r.hasOwnProperty(U)&&k!==q&&(k!=null||q!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(k!=null)throw Error(a(137,i));break;default:Ie(e,i,U,k,r,q)}return;default:if(Ds(i)){for(var De in l)k=l[De],l.hasOwnProperty(De)&&k!==void 0&&!r.hasOwnProperty(De)&&vu(e,i,De,void 0,r,k);for(H in r)k=r[H],q=l[H],!r.hasOwnProperty(H)||k===q||k===void 0&&q===void 0||vu(e,i,H,k,r,q);return}}for(var M in l)k=l[M],l.hasOwnProperty(M)&&k!=null&&!r.hasOwnProperty(M)&&Ie(e,i,M,null,r,k);for(F in r)k=r[F],q=l[F],!r.hasOwnProperty(F)||k===q||k==null&&q==null||Ie(e,i,F,k,r,q)}function fp(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function gx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,i=0,l=performance.getEntriesByType("resource"),r=0;r<l.length;r++){var m=l[r],g=m.transferSize,T=m.initiatorType,_=m.duration;if(g&&_&&fp(T)){for(T=0,_=m.responseEnd,r+=1;r<l.length;r++){var N=l[r],U=N.startTime;if(U>_)break;var H=N.transferSize,F=N.initiatorType;H&&fp(F)&&(N=N.responseEnd,T+=H*(N<_?1:(_-U)/(N-U)))}if(--r,i+=8*(g+T)/(m.duration/1e3),e++,10<e)break}}if(0<e)return i/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var xu=null,Eu=null;function Ra(e){return e.nodeType===9?e:e.ownerDocument}function mp(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 pp(e,i){if(e===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&i==="foreignObject"?0:e}function Tu(e,i){return e==="textarea"||e==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Su=null;function yx(){var e=window.event;return e&&e.type==="popstate"?e===Su?!1:(Su=e,!0):(Su=null,!1)}var hp=typeof setTimeout=="function"?setTimeout:void 0,vx=typeof clearTimeout=="function"?clearTimeout:void 0,gp=typeof Promise=="function"?Promise:void 0,xx=typeof queueMicrotask=="function"?queueMicrotask:typeof gp<"u"?function(e){return gp.resolve(null).then(e).catch(Ex)}:hp;function Ex(e){setTimeout(function(){throw e})}function jn(e){return e==="head"}function yp(e,i){var l=i,r=0;do{var m=l.nextSibling;if(e.removeChild(l),m&&m.nodeType===8)if(l=m.data,l==="/$"||l==="/&"){if(r===0){e.removeChild(m),ao(i);return}r--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")r++;else if(l==="html")ol(e.ownerDocument.documentElement);else if(l==="head"){l=e.ownerDocument.head,ol(l);for(var g=l.firstChild;g;){var T=g.nextSibling,_=g.nodeName;g[So]||_==="SCRIPT"||_==="STYLE"||_==="LINK"&&g.rel.toLowerCase()==="stylesheet"||l.removeChild(g),g=T}}else l==="body"&&ol(e.ownerDocument.body);l=m}while(l);ao(i)}function vp(e,i){var l=e;e=0;do{var r=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),r&&r.nodeType===8)if(l=r.data,l==="/$"){if(e===0)break;e--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||e++;l=r}while(l)}function _u(e){var i=e.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":_u(l),ws(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}e.removeChild(l)}}function Tx(e,i,l,r){for(;e.nodeType===1;){var m=l;if(e.nodeName.toLowerCase()!==i.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[So])switch(i){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(g=e.getAttribute("rel"),g==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(g!==m.rel||e.getAttribute("href")!==(m.href==null||m.href===""?null:m.href)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin)||e.getAttribute("title")!==(m.title==null?null:m.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(g=e.getAttribute("src"),(g!==(m.src==null?null:m.src)||e.getAttribute("type")!==(m.type==null?null:m.type)||e.getAttribute("crossorigin")!==(m.crossOrigin==null?null:m.crossOrigin))&&g&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(i==="input"&&e.type==="hidden"){var g=m.name==null?null:""+m.name;if(m.type==="hidden"&&e.getAttribute("name")===g)return e}else return e;if(e=Vt(e.nextSibling),e===null)break}return null}function Sx(e,i,l){if(i==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!l||(e=Vt(e.nextSibling),e===null))return null;return e}function xp(e,i){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!i||(e=Vt(e.nextSibling),e===null))return null;return e}function bu(e){return e.data==="$?"||e.data==="$~"}function Cu(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function _x(e,i){var l=e.ownerDocument;if(e.data==="$~")e._reactRetry=i;else if(e.data!=="$?"||l.readyState!=="loading")i();else{var r=function(){i(),l.removeEventListener("DOMContentLoaded",r)};l.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Vt(e){for(;e!=null;e=e.nextSibling){var i=e.nodeType;if(i===1||i===3)break;if(i===8){if(i=e.data,i==="$"||i==="$!"||i==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return e}var Nu=null;function Ep(e){e=e.nextSibling;for(var i=0;e;){if(e.nodeType===8){var l=e.data;if(l==="/$"||l==="/&"){if(i===0)return Vt(e.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}e=e.nextSibling}return null}function Tp(e){e=e.previousSibling;for(var i=0;e;){if(e.nodeType===8){var l=e.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return e;i--}else l!=="/$"&&l!=="/&"||i++}e=e.previousSibling}return null}function Sp(e,i,l){switch(i=Ra(l),e){case"html":if(e=i.documentElement,!e)throw Error(a(452));return e;case"head":if(e=i.head,!e)throw Error(a(453));return e;case"body":if(e=i.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function ol(e){for(var i=e.attributes;i.length;)e.removeAttributeNode(i[0]);ws(e)}var Ht=new Map,_p=new Set;function Ma(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var Tn=K.d;K.d={f:bx,r:Cx,D:Nx,C:Ax,L:wx,m:Rx,X:Ix,S:Mx,M:Dx};function bx(){var e=Tn.f(),i=Ta();return e||i}function Cx(e){var i=Ci(e);i!==null&&i.tag===5&&i.type==="form"?Hf(i):Tn.r(e)}var io=typeof document>"u"?null:document;function bp(e,i,l){var r=io;if(r&&typeof i=="string"&&i){var m=Dt(i);m='link[rel="'+e+'"][href="'+m+'"]',typeof l=="string"&&(m+='[crossorigin="'+l+'"]'),_p.has(m)||(_p.add(m),e={rel:e,crossOrigin:l,href:i},r.querySelector(m)===null&&(i=r.createElement("link"),st(i,"link",e),We(i),r.head.appendChild(i)))}}function Nx(e){Tn.D(e),bp("dns-prefetch",e,null)}function Ax(e,i){Tn.C(e,i),bp("preconnect",e,i)}function wx(e,i,l){Tn.L(e,i,l);var r=io;if(r&&e&&i){var m='link[rel="preload"][as="'+Dt(i)+'"]';i==="image"&&l&&l.imageSrcSet?(m+='[imagesrcset="'+Dt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(m+='[imagesizes="'+Dt(l.imageSizes)+'"]')):m+='[href="'+Dt(e)+'"]';var g=m;switch(i){case"style":g=oo(e);break;case"script":g=lo(e)}Ht.has(g)||(e=E({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:e,as:i},l),Ht.set(g,e),r.querySelector(m)!==null||i==="style"&&r.querySelector(ll(g))||i==="script"&&r.querySelector(al(g))||(i=r.createElement("link"),st(i,"link",e),We(i),r.head.appendChild(i)))}}function Rx(e,i){Tn.m(e,i);var l=io;if(l&&e){var r=i&&typeof i.as=="string"?i.as:"script",m='link[rel="modulepreload"][as="'+Dt(r)+'"][href="'+Dt(e)+'"]',g=m;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":g=lo(e)}if(!Ht.has(g)&&(e=E({rel:"modulepreload",href:e},i),Ht.set(g,e),l.querySelector(m)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(al(g)))return}r=l.createElement("link"),st(r,"link",e),We(r),l.head.appendChild(r)}}}function Mx(e,i,l){Tn.S(e,i,l);var r=io;if(r&&e){var m=Ni(r).hoistableStyles,g=oo(e);i=i||"default";var T=m.get(g);if(!T){var _={loading:0,preload:null};if(T=r.querySelector(ll(g)))_.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":i},l),(l=Ht.get(g))&&Au(e,l);var N=T=r.createElement("link");We(N),st(N,"link",e),N._p=new Promise(function(U,H){N.onload=U,N.onerror=H}),N.addEventListener("load",function(){_.loading|=1}),N.addEventListener("error",function(){_.loading|=2}),_.loading|=4,Ia(T,i,r)}T={type:"stylesheet",instance:T,count:1,state:_},m.set(g,T)}}}function Ix(e,i){Tn.X(e,i);var l=io;if(l&&e){var r=Ni(l).hoistableScripts,m=lo(e),g=r.get(m);g||(g=l.querySelector(al(m)),g||(e=E({src:e,async:!0},i),(i=Ht.get(m))&&wu(e,i),g=l.createElement("script"),We(g),st(g,"link",e),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},r.set(m,g))}}function Dx(e,i){Tn.M(e,i);var l=io;if(l&&e){var r=Ni(l).hoistableScripts,m=lo(e),g=r.get(m);g||(g=l.querySelector(al(m)),g||(e=E({src:e,async:!0,type:"module"},i),(i=Ht.get(m))&&wu(e,i),g=l.createElement("script"),We(g),st(g,"link",e),l.head.appendChild(g)),g={type:"script",instance:g,count:1,state:null},r.set(m,g))}}function Cp(e,i,l,r){var m=(m=me.current)?Ma(m):null;if(!m)throw Error(a(446));switch(e){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=oo(l.href),l=Ni(m).hoistableStyles,r=l.get(i),r||(r={type:"style",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){e=oo(l.href);var g=Ni(m).hoistableStyles,T=g.get(e);if(T||(m=m.ownerDocument||m,T={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},g.set(e,T),(g=m.querySelector(ll(e)))&&!g._p&&(T.instance=g,T.state.loading=5),Ht.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},Ht.set(e,l),g||Ux(m,e,l,T.state))),i&&r===null)throw Error(a(528,""));return T}if(i&&r!==null)throw Error(a(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=lo(l),l=Ni(m).hoistableScripts,r=l.get(i),r||(r={type:"script",instance:null,count:0,state:null},l.set(i,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(a(444,e))}}function oo(e){return'href="'+Dt(e)+'"'}function ll(e){return'link[rel="stylesheet"]['+e+"]"}function Np(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function Ux(e,i,l,r){e.querySelector('link[rel="preload"][as="style"]['+i+"]")?r.loading=1:(i=e.createElement("link"),r.preload=i,i.addEventListener("load",function(){return r.loading|=1}),i.addEventListener("error",function(){return r.loading|=2}),st(i,"link",l),We(i),e.head.appendChild(i))}function lo(e){return'[src="'+Dt(e)+'"]'}function al(e){return"script[async]"+e}function Ap(e,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var r=e.querySelector('style[data-href~="'+Dt(l.href)+'"]');if(r)return i.instance=r,We(r),r;var m=E({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),We(r),st(r,"style",m),Ia(r,l.precedence,e),i.instance=r;case"stylesheet":m=oo(l.href);var g=e.querySelector(ll(m));if(g)return i.state.loading|=4,i.instance=g,We(g),g;r=Np(l),(m=Ht.get(m))&&Au(r,m),g=(e.ownerDocument||e).createElement("link"),We(g);var T=g;return T._p=new Promise(function(_,N){T.onload=_,T.onerror=N}),st(g,"link",r),i.state.loading|=4,Ia(g,l.precedence,e),i.instance=g;case"script":return g=lo(l.src),(m=e.querySelector(al(g)))?(i.instance=m,We(m),m):(r=l,(m=Ht.get(g))&&(r=E({},l),wu(r,m)),e=e.ownerDocument||e,m=e.createElement("script"),We(m),st(m,"link",r),e.head.appendChild(m),i.instance=m);case"void":return null;default:throw Error(a(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(r=i.instance,i.state.loading|=4,Ia(r,l.precedence,e));return i.instance}function Ia(e,i,l){for(var r=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),m=r.length?r[r.length-1]:null,g=m,T=0;T<r.length;T++){var _=r[T];if(_.dataset.precedence===i)g=_;else if(g!==m)break}g?g.parentNode.insertBefore(e,g.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(e,i.firstChild))}function Au(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.title==null&&(e.title=i.title)}function wu(e,i){e.crossOrigin==null&&(e.crossOrigin=i.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=i.referrerPolicy),e.integrity==null&&(e.integrity=i.integrity)}var Da=null;function wp(e,i,l){if(Da===null){var r=new Map,m=Da=new Map;m.set(l,r)}else m=Da,r=m.get(l),r||(r=new Map,m.set(l,r));if(r.has(e))return r;for(r.set(e,null),l=l.getElementsByTagName(e),m=0;m<l.length;m++){var g=l[m];if(!(g[So]||g[it]||e==="link"&&g.getAttribute("rel")==="stylesheet")&&g.namespaceURI!=="http://www.w3.org/2000/svg"){var T=g.getAttribute(i)||"";T=e+T;var _=r.get(T);_?_.push(g):r.set(T,[g])}}return r}function Rp(e,i,l){e=e.ownerDocument||e,e.head.insertBefore(l,i==="title"?e.querySelector("head > title"):null)}function Lx(e,i,l){if(l===1||i.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return e=i.disabled,typeof i.precedence=="string"&&e==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Mp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function kx(e,i,l,r){if(l.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var m=oo(r.href),g=i.querySelector(ll(m));if(g){i=g._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(e.count++,e=Ua.bind(e),i.then(e,e)),l.state.loading|=4,l.instance=g,We(g);return}g=i.ownerDocument||i,r=Np(r),(m=Ht.get(m))&&Au(r,m),g=g.createElement("link"),We(g);var T=g;T._p=new Promise(function(_,N){T.onload=_,T.onerror=N}),st(g,"link",r),l.instance=g}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(e.count++,l=Ua.bind(e),i.addEventListener("load",l),i.addEventListener("error",l))}}var Ru=0;function Px(e,i){return e.stylesheets&&e.count===0&&ka(e,e.stylesheets),0<e.count||0<e.imgCount?function(l){var r=setTimeout(function(){if(e.stylesheets&&ka(e,e.stylesheets),e.unsuspend){var g=e.unsuspend;e.unsuspend=null,g()}},6e4+i);0<e.imgBytes&&Ru===0&&(Ru=62500*gx());var m=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&ka(e,e.stylesheets),e.unsuspend)){var g=e.unsuspend;e.unsuspend=null,g()}},(e.imgBytes>Ru?50:800)+i);return e.unsuspend=l,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(m)}}:null}function Ua(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)ka(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var La=null;function ka(e,i){e.stylesheets=null,e.unsuspend!==null&&(e.count++,La=new Map,i.forEach(Gx,e),La=null,Ua.call(e))}function Gx(e,i){if(!(i.state.loading&4)){var l=La.get(e);if(l)var r=l.get(null);else{l=new Map,La.set(e,l);for(var m=e.querySelectorAll("link[data-precedence],style[data-precedence]"),g=0;g<m.length;g++){var T=m[g];(T.nodeName==="LINK"||T.getAttribute("media")!=="not all")&&(l.set(T.dataset.precedence,T),r=T)}r&&l.set(null,r)}m=i.instance,T=m.getAttribute("data-precedence"),g=l.get(T)||r,g===r&&l.set(null,m),l.set(T,m),this.count++,r=Ua.bind(this),m.addEventListener("load",r),m.addEventListener("error",r),g?g.parentNode.insertBefore(m,g.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(m,e.firstChild)),i.state.loading|=4}}var sl={$$typeof:P,Provider:null,Consumer:null,_currentValue:ne,_currentValue2:ne,_threadCount:0};function qx(e,i,l,r,m,g,T,_,N){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=bs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=bs(0),this.hiddenUpdates=bs(null),this.identifierPrefix=r,this.onUncaughtError=m,this.onCaughtError=g,this.onRecoverableError=T,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map}function Ip(e,i,l,r,m,g,T,_,N,U,H,F){return e=new qx(e,i,l,T,N,U,H,F,_),i=1,g===!0&&(i|=24),g=bt(3,null,null,i),e.current=g,g.stateNode=e,i=rr(),i.refCount++,e.pooledCache=i,i.refCount++,g.memoizedState={element:r,isDehydrated:l,cache:i},fr(g),e}function Dp(e){return e?(e=Pi,e):Pi}function Up(e,i,l,r,m,g){m=Dp(m),r.context===null?r.context=m:r.pendingContext=m,r=Pn(i),r.payload={element:l},g=g===void 0?null:g,g!==null&&(r.callback=g),l=Gn(e,r,i),l!==null&&(xt(l,e,i),Vo(l,e,i))}function Lp(e,i){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var l=e.retryLane;e.retryLane=l!==0&&l<i?l:i}}function Mu(e,i){Lp(e,i),(e=e.alternate)&&Lp(e,i)}function kp(e){if(e.tag===13||e.tag===31){var i=si(e,67108864);i!==null&&xt(i,e,67108864),Mu(e,67108864)}}function Pp(e){if(e.tag===13||e.tag===31){var i=Rt();i=Cs(i);var l=si(e,i);l!==null&&xt(l,e,i),Mu(e,i)}}var Pa=!0;function Vx(e,i,l,r){var m=z.T;z.T=null;var g=K.p;try{K.p=2,Iu(e,i,l,r)}finally{K.p=g,z.T=m}}function Hx(e,i,l,r){var m=z.T;z.T=null;var g=K.p;try{K.p=8,Iu(e,i,l,r)}finally{K.p=g,z.T=m}}function Iu(e,i,l,r){if(Pa){var m=Du(r);if(m===null)yu(e,i,r,Ga,l),qp(e,r);else if(Ox(m,e,i,l,r))r.stopPropagation();else if(qp(e,r),i&4&&-1<zx.indexOf(e)){for(;m!==null;){var g=Ci(m);if(g!==null)switch(g.tag){case 3:if(g=g.stateNode,g.current.memoizedState.isDehydrated){var T=ni(g.pendingLanes);if(T!==0){var _=g;for(_.pendingLanes|=2,_.entangledLanes|=2;T;){var N=1<<31-St(T);_.entanglements[1]|=N,T&=~N}en(g),(Ce&6)===0&&(xa=Et()+500,tl(0))}}break;case 31:case 13:_=si(g,2),_!==null&&xt(_,g,2),Ta(),Mu(g,2)}if(g=Du(r),g===null&&yu(e,i,r,Ga,l),g===m)break;m=g}m!==null&&r.stopPropagation()}else yu(e,i,r,null,l)}}function Du(e){return e=Ls(e),Uu(e)}var Ga=null;function Uu(e){if(Ga=null,e=bi(e),e!==null){var i=c(e);if(i===null)e=null;else{var l=i.tag;if(l===13){if(e=f(i),e!==null)return e;e=null}else if(l===31){if(e=h(i),e!==null)return e;e=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;e=null}else i!==e&&(e=null)}}return Ga=e,null}function Gp(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(Ny()){case Fc:return 2;case Jc:return 8;case Nl:case Ay:return 32;case Yc:return 268435456;default:return 32}default:return 32}}var Lu=!1,Kn=null,Xn=null,$n=null,rl=new Map,ul=new Map,Qn=[],zx="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 qp(e,i){switch(e){case"focusin":case"focusout":Kn=null;break;case"dragenter":case"dragleave":Xn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":rl.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":ul.delete(i.pointerId)}}function cl(e,i,l,r,m,g){return e===null||e.nativeEvent!==g?(e={blockedOn:i,domEventName:l,eventSystemFlags:r,nativeEvent:g,targetContainers:[m]},i!==null&&(i=Ci(i),i!==null&&kp(i)),e):(e.eventSystemFlags|=r,i=e.targetContainers,m!==null&&i.indexOf(m)===-1&&i.push(m),e)}function Ox(e,i,l,r,m){switch(i){case"focusin":return Kn=cl(Kn,e,i,l,r,m),!0;case"dragenter":return Xn=cl(Xn,e,i,l,r,m),!0;case"mouseover":return $n=cl($n,e,i,l,r,m),!0;case"pointerover":var g=m.pointerId;return rl.set(g,cl(rl.get(g)||null,e,i,l,r,m)),!0;case"gotpointercapture":return g=m.pointerId,ul.set(g,cl(ul.get(g)||null,e,i,l,r,m)),!0}return!1}function Vp(e){var i=bi(e.target);if(i!==null){var l=c(i);if(l!==null){if(i=l.tag,i===13){if(i=f(l),i!==null){e.blockedOn=i,Zc(e.priority,function(){Pp(l)});return}}else if(i===31){if(i=h(l),i!==null){e.blockedOn=i,Zc(e.priority,function(){Pp(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){e.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}e.blockedOn=null}function qa(e){if(e.blockedOn!==null)return!1;for(var i=e.targetContainers;0<i.length;){var l=Du(e.nativeEvent);if(l===null){l=e.nativeEvent;var r=new l.constructor(l.type,l);Us=r,l.target.dispatchEvent(r),Us=null}else return i=Ci(l),i!==null&&kp(i),e.blockedOn=l,!1;i.shift()}return!0}function Hp(e,i,l){qa(e)&&l.delete(i)}function Bx(){Lu=!1,Kn!==null&&qa(Kn)&&(Kn=null),Xn!==null&&qa(Xn)&&(Xn=null),$n!==null&&qa($n)&&($n=null),rl.forEach(Hp),ul.forEach(Hp)}function Va(e,i){e.blockedOn===i&&(e.blockedOn=null,Lu||(Lu=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Bx)))}var Ha=null;function zp(e){Ha!==e&&(Ha=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ha===e&&(Ha=null);for(var i=0;i<e.length;i+=3){var l=e[i],r=e[i+1],m=e[i+2];if(typeof r!="function"){if(Uu(r||l)===null)continue;break}var g=Ci(l);g!==null&&(e.splice(i,3),i-=3,Dr(g,{pending:!0,data:m,method:l.method,action:r},r,m))}}))}function ao(e){function i(N){return Va(N,e)}Kn!==null&&Va(Kn,e),Xn!==null&&Va(Xn,e),$n!==null&&Va($n,e),rl.forEach(i),ul.forEach(i);for(var l=0;l<Qn.length;l++){var r=Qn[l];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Qn.length&&(l=Qn[0],l.blockedOn===null);)Vp(l),l.blockedOn===null&&Qn.shift();if(l=(e.ownerDocument||e).$$reactFormReplay,l!=null)for(r=0;r<l.length;r+=3){var m=l[r],g=l[r+1],T=m[mt]||null;if(typeof g=="function")T||zp(l);else if(T){var _=null;if(g&&g.hasAttribute("formAction")){if(m=g,T=g[mt]||null)_=T.formAction;else if(Uu(m)!==null)continue}else _=T.action;typeof _=="function"?l[r+1]=_:(l.splice(r,3),r-=3),zp(l)}}}function Op(){function e(g){g.canIntercept&&g.info==="react-transition"&&g.intercept({handler:function(){return new Promise(function(T){return m=T})},focusReset:"manual",scroll:"manual"})}function i(){m!==null&&(m(),m=null),r||setTimeout(l,20)}function l(){if(!r&&!navigation.transition){var g=navigation.currentEntry;g&&g.url!=null&&navigation.navigate(g.url,{state:g.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,m=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),m!==null&&(m(),m=null)}}}function ku(e){this._internalRoot=e}za.prototype.render=ku.prototype.render=function(e){var i=this._internalRoot;if(i===null)throw Error(a(409));var l=i.current,r=Rt();Up(l,r,e,i,null,null)},za.prototype.unmount=ku.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var i=e.containerInfo;Up(e.current,2,null,e,null,null),Ta(),i[_i]=null}};function za(e){this._internalRoot=e}za.prototype.unstable_scheduleHydration=function(e){if(e){var i=Qc();e={blockedOn:null,target:e,priority:i};for(var l=0;l<Qn.length&&i!==0&&i<Qn[l].priority;l++);Qn.splice(l,0,e),l===0&&Vp(e)}};var Bp=t.version;if(Bp!=="19.2.4")throw Error(a(527,Bp,"19.2.4"));K.findDOMNode=function(e){var i=e._reactInternals;if(i===void 0)throw typeof e.render=="function"?Error(a(188)):(e=Object.keys(e).join(","),Error(a(268,e)));return e=p(i),e=e!==null?x(e):null,e=e===null?null:e.stateNode,e};var Fx={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:z,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Oa=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Oa.isDisabled&&Oa.supportsFiber)try{xo=Oa.inject(Fx),Tt=Oa}catch{}}return fl.createRoot=function(e,i){if(!s(e))throw Error(a(299));var l=!1,r="",m=$f,g=Qf,T=Zf;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(r=i.identifierPrefix),i.onUncaughtError!==void 0&&(m=i.onUncaughtError),i.onCaughtError!==void 0&&(g=i.onCaughtError),i.onRecoverableError!==void 0&&(T=i.onRecoverableError)),i=Ip(e,1,!1,null,null,l,r,null,m,g,T,Op),e[_i]=i.current,gu(e),new ku(i)},fl.hydrateRoot=function(e,i,l){if(!s(e))throw Error(a(299));var r=!1,m="",g=$f,T=Qf,_=Zf,N=null;return l!=null&&(l.unstable_strictMode===!0&&(r=!0),l.identifierPrefix!==void 0&&(m=l.identifierPrefix),l.onUncaughtError!==void 0&&(g=l.onUncaughtError),l.onCaughtError!==void 0&&(T=l.onCaughtError),l.onRecoverableError!==void 0&&(_=l.onRecoverableError),l.formState!==void 0&&(N=l.formState)),i=Ip(e,1,!0,i,l??null,r,m,N,g,T,_,Op),i.context=Dp(null),l=i.current,r=Rt(),r=Cs(r),m=Pn(r),m.callback=null,Gn(l,m,r),l=r,i.current.lanes=l,To(i,l),en(i),e[_i]=i.current,gu(e),new za(i)},fl.version="19.2.4",fl}var Wp;function tE(){if(Wp)return qu.exports;Wp=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(t){console.error(t)}}return n(),qu.exports=eE(),qu.exports}var nE=tE();const iE=yc(nE);/**
* react-router v7.13.0
*
* Copyright (c) Remix Software Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE.md file in the root directory of this source tree.
*
* @license MIT
*/var eh="popstate";function oE(n={}){function t(s,c){let{pathname:f="/",search:h="",hash:y=""}=Ti(s.location.hash.substring(1));return!f.startsWith("/")&&!f.startsWith(".")&&(f="/"+f),Qu("",{pathname:f,search:h,hash:y},c.state&&c.state.usr||null,c.state&&c.state.key||"default")}function o(s,c){let f=s.document.querySelector("base"),h="";if(f&&f.getAttribute("href")){let y=s.location.href,p=y.indexOf("#");h=p===-1?y:y.slice(0,p)}return h+"#"+(typeof c=="string"?c:vl(c))}function a(s,c){Xt(s.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(c)})`)}return aE(t,o,a,n)}function He(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function Xt(n,t){if(!n){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function lE(){return Math.random().toString(36).substring(2,10)}function th(n,t){return{usr:n.state,key:n.key,idx:t}}function Qu(n,t,o=null,a){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof t=="string"?Ti(t):t,state:o,key:t&&t.key||a||lE()}}function vl({pathname:n="/",search:t="",hash:o=""}){return t&&t!=="?"&&(n+=t.charAt(0)==="?"?t:"?"+t),o&&o!=="#"&&(n+=o.charAt(0)==="#"?o:"#"+o),n}function Ti(n){let t={};if(n){let o=n.indexOf("#");o>=0&&(t.hash=n.substring(o),n=n.substring(0,o));let a=n.indexOf("?");a>=0&&(t.search=n.substring(a),n=n.substring(0,a)),n&&(t.pathname=n)}return t}function aE(n,t,o,a={}){let{window:s=document.defaultView,v5Compat:c=!1}=a,f=s.history,h="POP",y=null,p=x();p==null&&(p=0,f.replaceState({...f.state,idx:p},""));function x(){return(f.state||{idx:null}).idx}function E(){h="POP";let w=x(),G=w==null?null:w-p;p=w,y&&y({action:h,location:I.location,delta:G})}function S(w,G){h="PUSH";let V=Qu(I.location,w,G);o&&o(V,w),p=x()+1;let P=th(V,p),Y=I.createHref(V);try{f.pushState(P,"",Y)}catch(X){if(X instanceof DOMException&&X.name==="DataCloneError")throw X;s.location.assign(Y)}c&&y&&y({action:h,location:I.location,delta:1})}function b(w,G){h="REPLACE";let V=Qu(I.location,w,G);o&&o(V,w),p=x();let P=th(V,p),Y=I.createHref(V);f.replaceState(P,"",Y),c&&y&&y({action:h,location:I.location,delta:0})}function C(w){return sE(w)}let I={get action(){return h},get location(){return n(s,f)},listen(w){if(y)throw new Error("A history only accepts one active listener");return s.addEventListener(eh,E),y=w,()=>{s.removeEventListener(eh,E),y=null}},createHref(w){return t(s,w)},createURL:C,encodeLocation(w){let G=C(w);return{pathname:G.pathname,search:G.search,hash:G.hash}},push:S,replace:b,go(w){return f.go(w)}};return I}function sE(n,t=!1){let o="http://localhost";typeof window<"u"&&(o=window.location.origin!=="null"?window.location.origin:window.location.href),He(o,"No window.location.(origin|href) available to create URL");let a=typeof n=="string"?n:vl(n);return a=a.replace(/ $/,"%20"),!t&&a.startsWith("//")&&(a=o+a),new URL(a,o)}function Yg(n,t,o="/"){return rE(n,t,o,!1)}function rE(n,t,o,a){let s=typeof t=="string"?Ti(t):t,c=bn(s.pathname||"/",o);if(c==null)return null;let f=jg(n);uE(f);let h=null;for(let y=0;h==null&&y<f.length;++y){let p=EE(c);h=vE(f[y],p,a)}return h}function jg(n,t=[],o=[],a="",s=!1){let c=(f,h,y=s,p)=>{let x={relativePath:p===void 0?f.path||"":p,caseSensitive:f.caseSensitive===!0,childrenIndex:h,route:f};if(x.relativePath.startsWith("/")){if(!x.relativePath.startsWith(a)&&y)return;He(x.relativePath.startsWith(a),`Absolute route path "${x.relativePath}" nested under path "${a}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),x.relativePath=x.relativePath.slice(a.length)}let E=_n([a,x.relativePath]),S=o.concat(x);f.children&&f.children.length>0&&(He(f.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${E}".`),jg(f.children,t,S,E,y)),!(f.path==null&&!f.index)&&t.push({path:E,score:gE(E,f.index),routesMeta:S})};return n.forEach((f,h)=>{var y;if(f.path===""||!((y=f.path)!=null&&y.includes("?")))c(f,h);else for(let p of Kg(f.path))c(f,h,!0,p)}),t}function Kg(n){let t=n.split("/");if(t.length===0)return[];let[o,...a]=t,s=o.endsWith("?"),c=o.replace(/\?$/,"");if(a.length===0)return s?[c,""]:[c];let f=Kg(a.join("/")),h=[];return h.push(...f.map(y=>y===""?c:[c,y].join("/"))),s&&h.push(...f),h.map(y=>n.startsWith("/")&&y===""?"/":y)}function uE(n){n.sort((t,o)=>t.score!==o.score?o.score-t.score:yE(t.routesMeta.map(a=>a.childrenIndex),o.routesMeta.map(a=>a.childrenIndex)))}var cE=/^:[\w-]+$/,dE=3,fE=2,mE=1,pE=10,hE=-2,nh=n=>n==="*";function gE(n,t){let o=n.split("/"),a=o.length;return o.some(nh)&&(a+=hE),t&&(a+=fE),o.filter(s=>!nh(s)).reduce((s,c)=>s+(cE.test(c)?dE:c===""?mE:pE),a)}function yE(n,t){return n.length===t.length&&n.slice(0,-1).every((a,s)=>a===t[s])?n[n.length-1]-t[t.length-1]:0}function vE(n,t,o=!1){let{routesMeta:a}=n,s={},c="/",f=[];for(let h=0;h<a.length;++h){let y=a[h],p=h===a.length-1,x=c==="/"?t:t.slice(c.length)||"/",E=es({path:y.relativePath,caseSensitive:y.caseSensitive,end:p},x),S=y.route;if(!E&&p&&o&&!a[a.length-1].route.index&&(E=es({path:y.relativePath,caseSensitive:y.caseSensitive,end:!1},x)),!E)return null;Object.assign(s,E.params),f.push({params:s,pathname:_n([c,E.pathname]),pathnameBase:bE(_n([c,E.pathnameBase])),route:S}),E.pathnameBase!=="/"&&(c=_n([c,E.pathnameBase]))}return f}function es(n,t){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[o,a]=xE(n.path,n.caseSensitive,n.end),s=t.match(o);if(!s)return null;let c=s[0],f=c.replace(/(.)\/+$/,"$1"),h=s.slice(1);return{params:a.reduce((p,{paramName:x,isOptional:E},S)=>{if(x==="*"){let C=h[S]||"";f=c.slice(0,c.length-C.length).replace(/(.)\/+$/,"$1")}const b=h[S];return E&&!b?p[x]=void 0:p[x]=(b||"").replace(/%2F/g,"/"),p},{}),pathname:c,pathnameBase:f,pattern:n}}function xE(n,t=!1,o=!0){Xt(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let a=[],s="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(f,h,y)=>(a.push({paramName:h,isOptional:y!=null}),y?"/?([^\\/]+)?":"/([^\\/]+)")).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(a.push({paramName:"*"}),s+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):o?s+="\\/*$":n!==""&&n!=="/"&&(s+="(?:(?=\\/|$))"),[new RegExp(s,t?void 0:"i"),a]}function EE(n){try{return n.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Xt(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),n}}function bn(n,t){if(t==="/")return n;if(!n.toLowerCase().startsWith(t.toLowerCase()))return null;let o=t.endsWith("/")?t.length-1:t.length,a=n.charAt(o);return a&&a!=="/"?null:n.slice(o)||"/"}var TE=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function SE(n,t="/"){let{pathname:o,search:a="",hash:s=""}=typeof n=="string"?Ti(n):n,c;return o?(o=o.replace(/\/\/+/g,"/"),o.startsWith("/")?c=ih(o.substring(1),"/"):c=ih(o,t)):c=t,{pathname:c,search:CE(a),hash:NE(s)}}function ih(n,t){let o=t.replace(/\/+$/,"").split("/");return n.split("/").forEach(s=>{s===".."?o.length>1&&o.pop():s!=="."&&o.push(s)}),o.length>1?o.join("/"):"/"}function Ou(n,t,o,a){return`Cannot include a '${n}' character in a manually specified \`to.${t}\` field [${JSON.stringify(a)}]. Please separate it out to the \`to.${o}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function _E(n){return n.filter((t,o)=>o===0||t.route.path&&t.route.path.length>0)}function Xg(n){let t=_E(n);return t.map((o,a)=>a===t.length-1?o.pathname:o.pathnameBase)}function $g(n,t,o,a=!1){let s;typeof n=="string"?s=Ti(n):(s={...n},He(!s.pathname||!s.pathname.includes("?"),Ou("?","pathname","search",s)),He(!s.pathname||!s.pathname.includes("#"),Ou("#","pathname","hash",s)),He(!s.search||!s.search.includes("#"),Ou("#","search","hash",s)));let c=n===""||s.pathname==="",f=c?"/":s.pathname,h;if(f==null)h=o;else{let E=t.length-1;if(!a&&f.startsWith("..")){let S=f.split("/");for(;S[0]==="..";)S.shift(),E-=1;s.pathname=S.join("/")}h=E>=0?t[E]:"/"}let y=SE(s,h),p=f&&f!=="/"&&f.endsWith("/"),x=(c||f===".")&&o.endsWith("/");return!y.pathname.endsWith("/")&&(p||x)&&(y.pathname+="/"),y}var _n=n=>n.join("/").replace(/\/\/+/g,"/"),bE=n=>n.replace(/\/+$/,"").replace(/^\/*/,"/"),CE=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,NE=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,AE=class{constructor(n,t,o,a=!1){this.status=n,this.statusText=t||"",this.internal=a,o instanceof Error?(this.data=o.toString(),this.error=o):this.data=o}};function wE(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function RE(n){return n.map(t=>t.route.path).filter(Boolean).join("/").replace(/\/\/*/g,"/")||"/"}var Qg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Zg(n,t){let o=n;if(typeof o!="string"||!TE.test(o))return{absoluteURL:void 0,isExternal:!1,to:o};let a=o,s=!1;if(Qg)try{let c=new URL(window.location.href),f=o.startsWith("//")?new URL(c.protocol+o):new URL(o),h=bn(f.pathname,t);f.origin===c.origin&&h!=null?o=h+f.search+f.hash:s=!0}catch{Xt(!1,`<Link to="${o}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:a,isExternal:s,to:o}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Wg=["POST","PUT","PATCH","DELETE"];new Set(Wg);var ME=["GET",...Wg];new Set(ME);var po=L.createContext(null);po.displayName="DataRouter";var rs=L.createContext(null);rs.displayName="DataRouterState";var IE=L.createContext(!1),e0=L.createContext({isTransitioning:!1});e0.displayName="ViewTransition";var DE=L.createContext(new Map);DE.displayName="Fetchers";var UE=L.createContext(null);UE.displayName="Await";var Ot=L.createContext(null);Ot.displayName="Navigation";var Tl=L.createContext(null);Tl.displayName="Location";var tn=L.createContext({outlet:null,matches:[],isDataRoute:!1});tn.displayName="Route";var xc=L.createContext(null);xc.displayName="RouteError";var t0="REACT_ROUTER_ERROR",LE="REDIRECT",kE="ROUTE_ERROR_RESPONSE";function PE(n){if(n.startsWith(`${t0}:${LE}:{`))try{let t=JSON.parse(n.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function GE(n){if(n.startsWith(`${t0}:${kE}:{`))try{let t=JSON.parse(n.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new AE(t.status,t.statusText,t.data)}catch{}}function qE(n,{relative:t}={}){He(Sl(),"useHref() may be used only in the context of a <Router> component.");let{basename:o,navigator:a}=L.useContext(Ot),{hash:s,pathname:c,search:f}=_l(n,{relative:t}),h=c;return o!=="/"&&(h=c==="/"?o:_n([o,c])),a.createHref({pathname:h,search:f,hash:s})}function Sl(){return L.useContext(Tl)!=null}function nn(){return He(Sl(),"useLocation() may be used only in the context of a <Router> component."),L.useContext(Tl).location}var n0="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function i0(n){L.useContext(Ot).static||L.useLayoutEffect(n)}function Ec(){let{isDataRoute:n}=L.useContext(tn);return n?QE():VE()}function VE(){He(Sl(),"useNavigate() may be used only in the context of a <Router> component.");let n=L.useContext(po),{basename:t,navigator:o}=L.useContext(Ot),{matches:a}=L.useContext(tn),{pathname:s}=nn(),c=JSON.stringify(Xg(a)),f=L.useRef(!1);return i0(()=>{f.current=!0}),L.useCallback((y,p={})=>{if(Xt(f.current,n0),!f.current)return;if(typeof y=="number"){o.go(y);return}let x=$g(y,JSON.parse(c),s,p.relative==="path");n==null&&t!=="/"&&(x.pathname=x.pathname==="/"?t:_n([t,x.pathname])),(p.replace?o.replace:o.push)(x,p.state,p)},[t,o,c,s,n])}L.createContext(null);function Tc(){let{matches:n}=L.useContext(tn),t=n[n.length-1];return t?t.params:{}}function _l(n,{relative:t}={}){let{matches:o}=L.useContext(tn),{pathname:a}=nn(),s=JSON.stringify(Xg(o));return L.useMemo(()=>$g(n,JSON.parse(s),a,t==="path"),[n,s,a,t])}function HE(n,t){return o0(n,t)}function o0(n,t,o,a,s){var V;He(Sl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:c}=L.useContext(Ot),{matches:f}=L.useContext(tn),h=f[f.length-1],y=h?h.params:{},p=h?h.pathname:"/",x=h?h.pathnameBase:"/",E=h&&h.route;{let P=E&&E.path||"";a0(p,!E||P.endsWith("*")||P.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${p}" (under <Route path="${P}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${P}"> to <Route path="${P==="/"?"*":`${P}/*`}">.`)}let S=nn(),b;if(t){let P=typeof t=="string"?Ti(t):t;He(x==="/"||((V=P.pathname)==null?void 0:V.startsWith(x)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${x}" but pathname "${P.pathname}" was given in the \`location\` prop.`),b=P}else b=S;let C=b.pathname||"/",I=C;if(x!=="/"){let P=x.replace(/^\//,"").split("/");I="/"+C.replace(/^\//,"").split("/").slice(P.length).join("/")}let w=Yg(n,{pathname:I});Xt(E||w!=null,`No routes matched location "${b.pathname}${b.search}${b.hash}" `),Xt(w==null||w[w.length-1].route.element!==void 0||w[w.length-1].route.Component!==void 0||w[w.length-1].route.lazy!==void 0,`Matched leaf route at location "${b.pathname}${b.search}${b.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let G=JE(w&&w.map(P=>Object.assign({},P,{params:Object.assign({},y,P.params),pathname:_n([x,c.encodeLocation?c.encodeLocation(P.pathname.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathname]),pathnameBase:P.pathnameBase==="/"?x:_n([x,c.encodeLocation?c.encodeLocation(P.pathnameBase.replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:P.pathnameBase])})),f,o,a,s);return t&&G?L.createElement(Tl.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",...b},navigationType:"POP"}},G):G}function zE(){let n=$E(),t=wE(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),o=n instanceof Error?n.stack:null,a="rgba(200,200,200, 0.5)",s={padding:"0.5rem",backgroundColor:a},c={padding:"2px 4px",backgroundColor:a},f=null;return console.error("Error handled by React Router default ErrorBoundary:",n),f=L.createElement(L.Fragment,null,L.createElement("p",null,"💿 Hey developer 👋"),L.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",L.createElement("code",{style:c},"ErrorBoundary")," or"," ",L.createElement("code",{style:c},"errorElement")," prop on your route.")),L.createElement(L.Fragment,null,L.createElement("h2",null,"Unexpected Application Error!"),L.createElement("h3",{style:{fontStyle:"italic"}},t),o?L.createElement("pre",{style:s},o):null,f)}var OE=L.createElement(zE,null),l0=class extends L.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,t){return t.location!==n.location||t.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:t.error,location:t.location,revalidation:n.revalidation||t.revalidation}}componentDidCatch(n,t){this.props.onError?this.props.onError(n,t):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const o=GE(n.digest);o&&(n=o)}let t=n!==void 0?L.createElement(tn.Provider,{value:this.props.routeContext},L.createElement(xc.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?L.createElement(BE,{error:n},t):t}};l0.contextType=IE;var Bu=new WeakMap;function BE({children:n,error:t}){let{basename:o}=L.useContext(Ot);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let a=PE(t.digest);if(a){let s=Bu.get(t);if(s)throw s;let c=Zg(a.location,o);if(Qg&&!Bu.get(t))if(c.isExternal||a.reloadDocument)window.location.href=c.absoluteURL||c.to;else{const f=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(c.to,{replace:a.replace}));throw Bu.set(t,f),f}return L.createElement("meta",{httpEquiv:"refresh",content:`0;url=${c.absoluteURL||c.to}`})}}return n}function FE({routeContext:n,match:t,children:o}){let a=L.useContext(po);return a&&a.static&&a.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(a.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(tn.Provider,{value:n},o)}function JE(n,t=[],o=null,a=null,s=null){if(n==null){if(!o)return null;if(o.errors)n=o.matches;else if(t.length===0&&!o.initialized&&o.matches.length>0)n=o.matches;else return null}let c=n,f=o==null?void 0:o.errors;if(f!=null){let x=c.findIndex(E=>E.route.id&&(f==null?void 0:f[E.route.id])!==void 0);He(x>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(f).join(",")}`),c=c.slice(0,Math.min(c.length,x+1))}let h=!1,y=-1;if(o)for(let x=0;x<c.length;x++){let E=c[x];if((E.route.HydrateFallback||E.route.hydrateFallbackElement)&&(y=x),E.route.id){let{loaderData:S,errors:b}=o,C=E.route.loader&&!S.hasOwnProperty(E.route.id)&&(!b||b[E.route.id]===void 0);if(E.route.lazy||C){h=!0,y>=0?c=c.slice(0,y+1):c=[c[0]];break}}}let p=o&&a?(x,E)=>{var S,b;a(x,{location:o.location,params:((b=(S=o.matches)==null?void 0:S[0])==null?void 0:b.params)??{},unstable_pattern:RE(o.matches),errorInfo:E})}:void 0;return c.reduceRight((x,E,S)=>{let b,C=!1,I=null,w=null;o&&(b=f&&E.route.id?f[E.route.id]:void 0,I=E.route.errorElement||OE,h&&(y<0&&S===0?(a0("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),C=!0,w=null):y===S&&(C=!0,w=E.route.hydrateFallbackElement||null)));let G=t.concat(c.slice(0,S+1)),V=()=>{let P;return b?P=I:C?P=w:E.route.Component?P=L.createElement(E.route.Component,null):E.route.element?P=E.route.element:P=x,L.createElement(FE,{match:E,routeContext:{outlet:x,matches:G,isDataRoute:o!=null},children:P})};return o&&(E.route.ErrorBoundary||E.route.errorElement||S===0)?L.createElement(l0,{location:o.location,revalidation:o.revalidation,component:I,error:b,children:V(),routeContext:{outlet:null,matches:G,isDataRoute:!0},onError:p}):V()},null)}function Sc(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function YE(n){let t=L.useContext(po);return He(t,Sc(n)),t}function jE(n){let t=L.useContext(rs);return He(t,Sc(n)),t}function KE(n){let t=L.useContext(tn);return He(t,Sc(n)),t}function _c(n){let t=KE(n),o=t.matches[t.matches.length-1];return He(o.route.id,`${n} can only be used on routes that contain a unique "id"`),o.route.id}function XE(){return _c("useRouteId")}function $E(){var a;let n=L.useContext(xc),t=jE("useRouteError"),o=_c("useRouteError");return n!==void 0?n:(a=t.errors)==null?void 0:a[o]}function QE(){let{router:n}=YE("useNavigate"),t=_c("useNavigate"),o=L.useRef(!1);return i0(()=>{o.current=!0}),L.useCallback(async(s,c={})=>{Xt(o.current,n0),o.current&&(typeof s=="number"?await n.navigate(s):await n.navigate(s,{fromRouteId:t,...c}))},[n,t])}var oh={};function a0(n,t,o){!t&&!oh[n]&&(oh[n]=!0,Xt(!1,o))}L.memo(ZE);function ZE({routes:n,future:t,state:o,onError:a}){return o0(n,void 0,o,a,t)}function Yt(n){He(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function WE({basename:n="/",children:t=null,location:o,navigationType:a="POP",navigator:s,static:c=!1,unstable_useTransitions:f}){He(!Sl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let h=n.replace(/^\/*/,"/"),y=L.useMemo(()=>({basename:h,navigator:s,static:c,unstable_useTransitions:f,future:{}}),[h,s,c,f]);typeof o=="string"&&(o=Ti(o));let{pathname:p="/",search:x="",hash:E="",state:S=null,key:b="default"}=o,C=L.useMemo(()=>{let I=bn(p,h);return I==null?null:{location:{pathname:I,search:x,hash:E,state:S,key:b},navigationType:a}},[h,p,x,E,S,b,a]);return Xt(C!=null,`<Router basename="${h}"> is not able to match the URL "${p}${x}${E}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:L.createElement(Ot.Provider,{value:y},L.createElement(Tl.Provider,{children:t,value:C}))}function eT({children:n,location:t}){return HE(Zu(n),t)}function Zu(n,t=[]){let o=[];return L.Children.forEach(n,(a,s)=>{if(!L.isValidElement(a))return;let c=[...t,s];if(a.type===L.Fragment){o.push.apply(o,Zu(a.props.children,c));return}He(a.type===Yt,`[${typeof a.type=="string"?a.type:a.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),He(!a.props.index||!a.props.children,"An index route cannot have child routes.");let f={id:a.props.id||c.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,middleware:a.props.middleware,loader:a.props.loader,action:a.props.action,hydrateFallbackElement:a.props.hydrateFallbackElement,HydrateFallback:a.props.HydrateFallback,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.hasErrorBoundary===!0||a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(f.children=Zu(a.props.children,c)),o.push(f)}),o}var Xa="get",$a="application/x-www-form-urlencoded";function us(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function tT(n){return us(n)&&n.tagName.toLowerCase()==="button"}function nT(n){return us(n)&&n.tagName.toLowerCase()==="form"}function iT(n){return us(n)&&n.tagName.toLowerCase()==="input"}function oT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function lT(n,t){return n.button===0&&(!t||t==="_self")&&!oT(n)}var Ba=null;function aT(){if(Ba===null)try{new FormData(document.createElement("form"),0),Ba=!1}catch{Ba=!0}return Ba}var sT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Fu(n){return n!=null&&!sT.has(n)?(Xt(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${$a}"`),null):n}function rT(n,t){let o,a,s,c,f;if(nT(n)){let h=n.getAttribute("action");a=h?bn(h,t):null,o=n.getAttribute("method")||Xa,s=Fu(n.getAttribute("enctype"))||$a,c=new FormData(n)}else if(tT(n)||iT(n)&&(n.type==="submit"||n.type==="image")){let h=n.form;if(h==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let y=n.getAttribute("formaction")||h.getAttribute("action");if(a=y?bn(y,t):null,o=n.getAttribute("formmethod")||h.getAttribute("method")||Xa,s=Fu(n.getAttribute("formenctype"))||Fu(h.getAttribute("enctype"))||$a,c=new FormData(h,n),!aT()){let{name:p,type:x,value:E}=n;if(x==="image"){let S=p?`${p}.`:"";c.append(`${S}x`,"0"),c.append(`${S}y`,"0")}else p&&c.append(p,E)}}else{if(us(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');o=Xa,a=null,s=$a,f=n}return c&&s==="text/plain"&&(f=c,c=void 0),{action:a,method:o.toLowerCase(),encType:s,formData:c,body:f}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function bc(n,t){if(n===!1||n===null||typeof n>"u")throw new Error(t)}function uT(n,t,o,a){let s=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return o?s.pathname.endsWith("/")?s.pathname=`${s.pathname}_.${a}`:s.pathname=`${s.pathname}.${a}`:s.pathname==="/"?s.pathname=`_root.${a}`:t&&bn(s.pathname,t)==="/"?s.pathname=`${t.replace(/\/$/,"")}/_root.${a}`:s.pathname=`${s.pathname.replace(/\/$/,"")}.${a}`,s}async function cT(n,t){if(n.id in t)return t[n.id];try{let o=await import(n.module);return t[n.id]=o,o}catch(o){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(o),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dT(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function fT(n,t,o){let a=await Promise.all(n.map(async s=>{let c=t.routes[s.route.id];if(c){let f=await cT(c,o);return f.links?f.links():[]}return[]}));return gT(a.flat(1).filter(dT).filter(s=>s.rel==="stylesheet"||s.rel==="preload").map(s=>s.rel==="stylesheet"?{...s,rel:"prefetch",as:"style"}:{...s,rel:"prefetch"}))}function lh(n,t,o,a,s,c){let f=(y,p)=>o[p]?y.route.id!==o[p].route.id:!0,h=(y,p)=>{var x;return o[p].pathname!==y.pathname||((x=o[p].route.path)==null?void 0:x.endsWith("*"))&&o[p].params["*"]!==y.params["*"]};return c==="assets"?t.filter((y,p)=>f(y,p)||h(y,p)):c==="data"?t.filter((y,p)=>{var E;let x=a.routes[y.route.id];if(!x||!x.hasLoader)return!1;if(f(y,p)||h(y,p))return!0;if(y.route.shouldRevalidate){let S=y.route.shouldRevalidate({currentUrl:new URL(s.pathname+s.search+s.hash,window.origin),currentParams:((E=o[0])==null?void 0:E.params)||{},nextUrl:new URL(n,window.origin),nextParams:y.params,defaultShouldRevalidate:!0});if(typeof S=="boolean")return S}return!0}):[]}function mT(n,t,{includeHydrateFallback:o}={}){return pT(n.map(a=>{let s=t.routes[a.route.id];if(!s)return[];let c=[s.module];return s.clientActionModule&&(c=c.concat(s.clientActionModule)),s.clientLoaderModule&&(c=c.concat(s.clientLoaderModule)),o&&s.hydrateFallbackModule&&(c=c.concat(s.hydrateFallbackModule)),s.imports&&(c=c.concat(s.imports)),c}).flat(1))}function pT(n){return[...new Set(n)]}function hT(n){let t={},o=Object.keys(n).sort();for(let a of o)t[a]=n[a];return t}function gT(n,t){let o=new Set;return new Set(t),n.reduce((a,s)=>{let c=JSON.stringify(hT(s));return o.has(c)||(o.add(c),a.push({key:c,link:s})),a},[])}function s0(){let n=L.useContext(po);return bc(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function yT(){let n=L.useContext(rs);return bc(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Cc=L.createContext(void 0);Cc.displayName="FrameworkContext";function r0(){let n=L.useContext(Cc);return bc(n,"You must render this element inside a <HydratedRouter> element"),n}function vT(n,t){let o=L.useContext(Cc),[a,s]=L.useState(!1),[c,f]=L.useState(!1),{onFocus:h,onBlur:y,onMouseEnter:p,onMouseLeave:x,onTouchStart:E}=t,S=L.useRef(null);L.useEffect(()=>{if(n==="render"&&f(!0),n==="viewport"){let I=G=>{G.forEach(V=>{f(V.isIntersecting)})},w=new IntersectionObserver(I,{threshold:.5});return S.current&&w.observe(S.current),()=>{w.disconnect()}}},[n]),L.useEffect(()=>{if(a){let I=setTimeout(()=>{f(!0)},100);return()=>{clearTimeout(I)}}},[a]);let b=()=>{s(!0)},C=()=>{s(!1),f(!1)};return o?n!=="intent"?[c,S,{}]:[c,S,{onFocus:ml(h,b),onBlur:ml(y,C),onMouseEnter:ml(p,b),onMouseLeave:ml(x,C),onTouchStart:ml(E,b)}]:[!1,S,{}]}function ml(n,t){return o=>{n&&n(o),o.defaultPrevented||t(o)}}function xT({page:n,...t}){let{router:o}=s0(),a=L.useMemo(()=>Yg(o.routes,n,o.basename),[o.routes,n,o.basename]);return a?L.createElement(TT,{page:n,matches:a,...t}):null}function ET(n){let{manifest:t,routeModules:o}=r0(),[a,s]=L.useState([]);return L.useEffect(()=>{let c=!1;return fT(n,t,o).then(f=>{c||s(f)}),()=>{c=!0}},[n,t,o]),a}function TT({page:n,matches:t,...o}){let a=nn(),{future:s,manifest:c,routeModules:f}=r0(),{basename:h}=s0(),{loaderData:y,matches:p}=yT(),x=L.useMemo(()=>lh(n,t,p,c,a,"data"),[n,t,p,c,a]),E=L.useMemo(()=>lh(n,t,p,c,a,"assets"),[n,t,p,c,a]),S=L.useMemo(()=>{if(n===a.pathname+a.search+a.hash)return[];let I=new Set,w=!1;if(t.forEach(V=>{var Y;let P=c.routes[V.route.id];!P||!P.hasLoader||(!x.some(X=>X.route.id===V.route.id)&&V.route.id in y&&((Y=f[V.route.id])!=null&&Y.shouldRevalidate)||P.hasClientLoader?w=!0:I.add(V.route.id))}),I.size===0)return[];let G=uT(n,h,s.unstable_trailingSlashAwareDataRequests,"data");return w&&I.size>0&&G.searchParams.set("_routes",t.filter(V=>I.has(V.route.id)).map(V=>V.route.id).join(",")),[G.pathname+G.search]},[h,s.unstable_trailingSlashAwareDataRequests,y,a,c,x,t,n,f]),b=L.useMemo(()=>mT(E,c),[E,c]),C=ET(E);return L.createElement(L.Fragment,null,S.map(I=>L.createElement("link",{key:I,rel:"prefetch",as:"fetch",href:I,...o})),b.map(I=>L.createElement("link",{key:I,rel:"modulepreload",href:I,...o})),C.map(({key:I,link:w})=>L.createElement("link",{key:I,nonce:o.nonce,...w,crossOrigin:w.crossOrigin??o.crossOrigin})))}function ST(...n){return t=>{n.forEach(o=>{typeof o=="function"?o(t):o!=null&&(o.current=t)})}}var _T=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{_T&&(window.__reactRouterVersion="7.13.0")}catch{}function bT({basename:n,children:t,unstable_useTransitions:o,window:a}){let s=L.useRef();s.current==null&&(s.current=oE({window:a,v5Compat:!0}));let c=s.current,[f,h]=L.useState({action:c.action,location:c.location}),y=L.useCallback(p=>{o===!1?h(p):L.startTransition(()=>h(p))},[o]);return L.useLayoutEffect(()=>c.listen(y),[c,y]),L.createElement(WE,{basename:n,children:t,location:f.location,navigationType:f.action,navigator:c,unstable_useTransitions:o})}var u0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Se=L.forwardRef(function({onClick:t,discover:o="render",prefetch:a="none",relative:s,reloadDocument:c,replace:f,state:h,target:y,to:p,preventScrollReset:x,viewTransition:E,unstable_defaultShouldRevalidate:S,...b},C){let{basename:I,unstable_useTransitions:w}=L.useContext(Ot),G=typeof p=="string"&&u0.test(p),V=Zg(p,I);p=V.to;let P=qE(p,{relative:s}),[Y,X,B]=vT(a,b),j=wT(p,{replace:f,state:h,target:y,preventScrollReset:x,relative:s,viewTransition:E,unstable_defaultShouldRevalidate:S,unstable_useTransitions:w});function le(ae){t&&t(ae),ae.defaultPrevented||j(ae)}let Z=L.createElement("a",{...b,...B,href:V.absoluteURL||P,onClick:V.isExternal||c?t:le,ref:ST(C,X),target:y,"data-discover":!G&&o==="render"?"true":void 0});return Y&&!G?L.createElement(L.Fragment,null,Z,L.createElement(xT,{page:P})):Z});Se.displayName="Link";var CT=L.forwardRef(function({"aria-current":t="page",caseSensitive:o=!1,className:a="",end:s=!1,style:c,to:f,viewTransition:h,children:y,...p},x){let E=_l(f,{relative:p.relative}),S=nn(),b=L.useContext(rs),{navigator:C,basename:I}=L.useContext(Ot),w=b!=null&&UT(E)&&h===!0,G=C.encodeLocation?C.encodeLocation(E).pathname:E.pathname,V=S.pathname,P=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;o||(V=V.toLowerCase(),P=P?P.toLowerCase():null,G=G.toLowerCase()),P&&I&&(P=bn(P,I)||P);const Y=G!=="/"&&G.endsWith("/")?G.length-1:G.length;let X=V===G||!s&&V.startsWith(G)&&V.charAt(Y)==="/",B=P!=null&&(P===G||!s&&P.startsWith(G)&&P.charAt(G.length)==="/"),j={isActive:X,isPending:B,isTransitioning:w},le=X?t:void 0,Z;typeof a=="function"?Z=a(j):Z=[a,X?"active":null,B?"pending":null,w?"transitioning":null].filter(Boolean).join(" ");let ae=typeof c=="function"?c(j):c;return L.createElement(Se,{...p,"aria-current":le,className:Z,ref:x,style:ae,to:f,viewTransition:h},typeof y=="function"?y(j):y)});CT.displayName="NavLink";var NT=L.forwardRef(({discover:n="render",fetcherKey:t,navigate:o,reloadDocument:a,replace:s,state:c,method:f=Xa,action:h,onSubmit:y,relative:p,preventScrollReset:x,viewTransition:E,unstable_defaultShouldRevalidate:S,...b},C)=>{let{unstable_useTransitions:I}=L.useContext(Ot),w=IT(),G=DT(h,{relative:p}),V=f.toLowerCase()==="get"?"get":"post",P=typeof h=="string"&&u0.test(h),Y=X=>{if(y&&y(X),X.defaultPrevented)return;X.preventDefault();let B=X.nativeEvent.submitter,j=(B==null?void 0:B.getAttribute("formmethod"))||f,le=()=>w(B||X.currentTarget,{fetcherKey:t,method:j,navigate:o,replace:s,state:c,relative:p,preventScrollReset:x,viewTransition:E,unstable_defaultShouldRevalidate:S});I&&o!==!1?L.startTransition(()=>le()):le()};return L.createElement("form",{ref:C,method:V,action:G,onSubmit:a?y:Y,...b,"data-discover":!P&&n==="render"?"true":void 0})});NT.displayName="Form";function AT(n){return`${n} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function c0(n){let t=L.useContext(po);return He(t,AT(n)),t}function wT(n,{target:t,replace:o,state:a,preventScrollReset:s,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h,unstable_useTransitions:y}={}){let p=Ec(),x=nn(),E=_l(n,{relative:c});return L.useCallback(S=>{if(lT(S,t)){S.preventDefault();let b=o!==void 0?o:vl(x)===vl(E),C=()=>p(n,{replace:b,state:a,preventScrollReset:s,relative:c,viewTransition:f,unstable_defaultShouldRevalidate:h});y?L.startTransition(()=>C()):C()}},[x,p,E,o,a,t,n,s,c,f,h,y])}var RT=0,MT=()=>`__${String(++RT)}__`;function IT(){let{router:n}=c0("useSubmit"),{basename:t}=L.useContext(Ot),o=XE(),a=n.fetch,s=n.navigate;return L.useCallback(async(c,f={})=>{let{action:h,method:y,encType:p,formData:x,body:E}=rT(c,t);if(f.navigate===!1){let S=f.fetcherKey||MT();await a(S,o,f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:E,formMethod:f.method||y,formEncType:f.encType||p,flushSync:f.flushSync})}else await s(f.action||h,{unstable_defaultShouldRevalidate:f.unstable_defaultShouldRevalidate,preventScrollReset:f.preventScrollReset,formData:x,body:E,formMethod:f.method||y,formEncType:f.encType||p,replace:f.replace,state:f.state,fromRouteId:o,flushSync:f.flushSync,viewTransition:f.viewTransition})},[a,s,t,o])}function DT(n,{relative:t}={}){let{basename:o}=L.useContext(Ot),a=L.useContext(tn);He(a,"useFormAction must be used inside a RouteContext");let[s]=a.matches.slice(-1),c={..._l(n||".",{relative:t})},f=nn();if(n==null){c.search=f.search;let h=new URLSearchParams(c.search),y=h.getAll("index");if(y.some(x=>x==="")){h.delete("index"),y.filter(E=>E).forEach(E=>h.append("index",E));let x=h.toString();c.search=x?`?${x}`:""}}return(!n||n===".")&&s.route.index&&(c.search=c.search?c.search.replace(/^\?/,"?index&"):"?index"),o!=="/"&&(c.pathname=c.pathname==="/"?o:_n([o,c.pathname])),vl(c)}function UT(n,{relative:t}={}){let o=L.useContext(e0);He(o!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:a}=c0("useViewTransitionState"),s=_l(n,{relative:t});if(!o.isTransitioning)return!1;let c=bn(o.currentLocation.pathname,a)||o.currentLocation.pathname,f=bn(o.nextLocation.pathname,a)||o.nextLocation.pathname;return es(s.pathname,f)!=null||es(s.pathname,c)!=null}var d0=(n=>(n.VISITOR="VISITOR",n.ENTREPRENEUR="ENTREPRENEUR",n.ADMIN="ADMIN",n))(d0||{}),Qe=(n=>(n.PRODUCT="PRODUCT",n.SERVICE="SERVICE",n))(Qe||{}),Sn=(n=>(n.VIDEO="VIDEO",n.ARTICLE="ARTICLE",n))(Sn||{});const Nc=["Technologie & IT","Agriculture & Agrobusiness","Mode & Textile","Cosmétique & Beauté","Services aux entreprises","Restauration & Alimentation","Construction & BTP","Éducation & Formation"],LT={id:"u1",name:"Jean-Marc Kouassi",email:"jm.kouassi@example.com",role:d0.ENTREPRENEUR,avatar:"https://i.pravatar.cc/150?u=a042581f4e29026024d"},mo=[{id:"1",ownerId:"u1",name:"AfroTech Solutions",category:"Technologie & IT",location:"Abidjan, Côte d'Ivoire",description:"Leader dans le développement de solutions logicielles sur mesure pour les PME ouest-africaines. Nous accompagnons la transformation digitale des entreprises locales avec des outils ERP et CRM adaptés aux réalités du terrain (faible connectivité, mobile money).",logoUrl:"https://picsum.photos/200/200?random=1",videoUrl:"https://www.youtube.com/watch?v=ysz5S6P_ks0",socialLinks:{website:"https://afrotech.ci",linkedin:"https://linkedin.com",facebook:"https://facebook.com"},contactEmail:"contact@afrotech.ci",contactPhone:"+225 07 07 07 07 07",verified:!0,viewCount:1240,rating:4.8,tags:["Dev","SaaS","Mobile","ERP"],isFeatured:!0,founderName:"Jean-Marc Kouassi",founderImageUrl:"https://images.unsplash.com/photo-1531384441138-2736e62e0919?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80",keyMetric:"+50 Projets Livrés"},{id:"2",ownerId:"u2",name:"Baobab Foods",category:"Restauration & Alimentation",location:"Paris, France",description:"Traiteur événementiel haut de gamme spécialisé dans la gastronomie panafricaine revisitée. Nous apportons une touche d'élégance et de modernité aux saveurs ancestrales pour vos mariages, séminaires et événements d'entreprise.",logoUrl:"https://picsum.photos/200/200?random=2",contactEmail:"hello@baobabfoods.fr",contactPhone:"+33 6 12 34 56 78",verified:!0,viewCount:850,rating:4.9,tags:["Traiteur","Bio","Événementiel","Gastronomie"],founderName:"Aïssa Maïga",socialLinks:{instagram:"https://instagram.com"}},{id:"3",ownerId:"u3",name:"Lagos Fashion House",category:"Mode & Textile",location:"Lagos, Nigeria",description:"Création de tenues modernes utilisant le tissu Ankara authentique. Nous travaillons directement avec des tisserands locaux pour garantir une qualité exceptionnelle et une rémunération équitable. Exportation internationale et vente en ligne.",logoUrl:"https://picsum.photos/200/200?random=3",contactEmail:"sales@lagosfashion.ng",verified:!1,viewCount:320,rating:4.5,tags:["Mode","Ankara","Luxe","Ethique"],founderName:"Chidinma Okeke"},{id:"4",ownerId:"u4",name:"Sahara Solar",category:"Construction & BTP",location:"Dakar, Sénégal",description:"Installation de panneaux solaires pour les zones rurales et urbaines. L'énergie propre accessible à tous. Nous proposons des kits solaires domestiques payables en plusieurs fois via mobile money.",logoUrl:"https://picsum.photos/200/200?random=4",contactEmail:"info@saharasolar.sn",contactPhone:"+221 77 000 00 00",verified:!0,viewCount:560,rating:4.7,tags:["Énergie","Solaire","Durable","Tech"],founderName:"Ousmane Diop"},{id:"5",ownerId:"u5",name:"Nubian Essence",category:"Cosmétique & Beauté",location:"Douala, Cameroun",description:"Une gamme de soins de la peau 100% naturels à base de beurre de karité, de cacao et d'huiles essentielles locales. Nos produits sont sans parabènes et non testés sur les animaux.",logoUrl:"https://picsum.photos/200/200?random=5",contactEmail:"contact@nubianessence.cm",contactPhone:"+237 6 99 99 99 99",socialLinks:{instagram:"https://instagram.com",facebook:"https://facebook.com"},verified:!0,viewCount:410,rating:4.6,tags:["Bio","Skincare","Karité","Naturel"],founderName:"Marie-Claire Etoa",founderImageUrl:"https://images.unsplash.com/photo-1589156191108-c762ff4b96ab?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80"},{id:"6",ownerId:"u6",name:"Kijani Academy",category:"Éducation & Formation",location:"Nairobi, Kenya",description:"L'école de code qui forme la prochaine génération de développeurs africains. Bootcamp intensif de 6 mois en JavaScript, Python et React. Partenariats d'embauche avec les plus grandes Tech Companies.",logoUrl:"https://picsum.photos/200/200?random=6",videoUrl:"https://www.youtube.com/watch?v=FpMNs7H24X0",contactEmail:"admissions@kijani.ke",contactPhone:"+254 700 000 000",socialLinks:{linkedin:"https://linkedin.com",website:"https://kijani.ke"},verified:!0,viewCount:980,rating:5,tags:["Formation","Code","Bootcamp","Emploi"],founderName:"David Ochieng",keyMetric:"90% d'embauche"},{id:"7",ownerId:"u7",name:"PayNa",category:"Services aux entreprises",location:"Kinshasa, RDC",description:"La solution de paiement agrégée pour les e-commerçants en RDC. Acceptez M-Pesa, Orange Money, Airtel Money et les cartes Visa/Mastercard via une API unique et sécurisée.",logoUrl:"https://picsum.photos/200/200?random=7",contactEmail:"biz@payna.cd",verified:!1,viewCount:230,rating:4.2,tags:["FinTech","Paiement","Mobile Money","API"],founderName:"Serge Mbemba"},{id:"8",ownerId:"u8",name:"EcoBati Africa",category:"Construction & BTP",location:"Cotonou, Bénin",description:"Cabinet d'architecture écologique spécialisé dans l'utilisation de matériaux géo-sourcés (briques de terre compressée, bambou). Nous concevons des bâtiments modernes, frais et durables.",logoUrl:"https://picsum.photos/200/200?random=8",contactEmail:"projet@ecobati.bj",contactPhone:"+229 97 00 00 00",socialLinks:{instagram:"https://instagram.com",website:"https://ecobati.bj"},verified:!0,viewCount:670,rating:4.8,tags:["Architecture","Écologie","BTC","Durable"],founderName:"Fatimata Sylla",founderImageUrl:"https://images.unsplash.com/photo-1542596594-649edbc13630?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80"}],f0=[{id:"o1",businessId:"1",title:"Audit Digital Gratuit",type:Qe.SERVICE,price:0,currency:"XOF",imageUrl:"https://picsum.photos/300/200?random=20",active:!0},{id:"o2",businessId:"1",title:"Pack Site Vitrine",type:Qe.SERVICE,price:15e4,currency:"XOF",imageUrl:"https://picsum.photos/300/200?random=21",active:!0},{id:"o3",businessId:"1",title:"Logiciel Gestion de Stock",type:Qe.PRODUCT,price:35e3,currency:"XOF",imageUrl:"https://picsum.photos/300/200?random=22",active:!0},{id:"o4",businessId:"5",title:"Coffret Rituel Karité",type:Qe.PRODUCT,price:25e3,currency:"XOF",description:"Beurre corporel, savon noir et huile hydratante.",imageUrl:"https://picsum.photos/300/200?random=23",active:!0},{id:"o5",businessId:"5",title:"Savon Noir Liquide",type:Qe.PRODUCT,price:5e3,currency:"XOF",imageUrl:"https://picsum.photos/300/200?random=24",active:!0},{id:"o6",businessId:"6",title:"Bootcamp Fullstack (6 mois)",type:Qe.SERVICE,price:1500,currency:"EUR",description:"Formation intensive pour devenir développeur web. Paiement échelonné possible.",imageUrl:"https://picsum.photos/300/200?random=25",active:!0},{id:"o7",businessId:"8",title:"Étude de faisabilité",type:Qe.SERVICE,price:1e5,currency:"XOF",description:"Analyse de terrain et propositions de matériaux écologiques.",imageUrl:"https://picsum.photos/300/200?random=26",active:!0}],m0=[{id:"1",title:"Comment financer sa start-up en Afrique en 2025 ?",excerpt:"Analyse des nouveaux fonds d'investissement et des opportunités pour les jeunes entrepreneurs.",content:`Le financement des startups en Afrique connaît une véritable révolution. En 2025, de nouveaux acteurs entrent en jeu, diversifiant les sources de capitaux au-delà du capital-risque traditionnel.
1. Les Business Angels Locaux
De plus en plus d'entrepreneurs à succès réinvestissent dans l'écosystème local. Ces "afro-capitalistes" apportent non seulement des fonds, mais aussi un mentorat précieux et un réseau local indispensable.
2. Le Crowdfunding (Financement participatif)
Les plateformes de financement participatif dédiées à l'Afrique permettent de mobiliser la diaspora. C'est un excellent moyen de valider son marché tout en levant des fonds d'amorçage sans diluer son capital trop tôt.
3. Les Fonds d'Impact
Les investisseurs internationaux cherchent désormais la rentabilité couplée à l'impact social. Si votre projet résout un problème structurel (éducation, santé, logistique), vous avez toutes vos chances.
En conclusion, la clé en 2025 n'est plus seulement d'avoir une bonne idée, mais de démontrer une capacité d'exécution rapide et une compréhension fine des spécificités locales.`,author:"Sarah Ndiaye",date:"12 Oct 2024",imageUrl:"https://picsum.photos/800/400?random=10"},{id:"2",title:"Digitalisation des TPE : Les outils indispensables",excerpt:"De la comptabilité au marketing, voici la stack technique idéale pour débuter à moindre coût.",content:`La transformation numérique n'est pas réservée aux grandes entreprises. Pour une TPE africaine, bien choisir ses outils peut faire la différence entre stagnation et croissance exponentielle.
Voici notre sélection d'outils incontournables et souvent gratuits :
- Gestion de projet : Trello ou Asana pour organiser les tâches de l'équipe sans usine à gaz.
- Communication : WhatsApp Business est incontournable en Afrique pour la relation client, bien plus que l'email dans certains secteurs.
- Design : Canva permet de créer des visuels professionnels pour vos réseaux sociaux sans compétences graphiques.
- Paiement : Intégrez des solutions d'agrégation de paiement mobile (Mobile Money) dès le premier jour. C'est là que se trouve l'argent de vos clients.
Ne cherchez pas à tout automatiser dès le début. Commencez par digitaliser ce qui vous prend le plus de temps et qui a le moins de valeur ajoutée.`,author:"Admin Afropreunariat",date:"05 Oct 2024",imageUrl:"https://picsum.photos/800/400?random=11"},{id:"3",title:"Diaspora et retour au pays : Entreprendre le grand saut",excerpt:"Témoignages d'entrepreneurs qui ont quitté l'Europe pour lancer leur activité sur le continent.",content:`Le phénomène des "Repats" s'accélère. Quitter une situation stable à Paris, Londres ou Montréal pour entreprendre à Abidjan, Dakar ou Nairobi est un défi autant personnel que professionnel.
Le choc culturel inversé
Beaucoup sous-estiment le temps de réadaptation. "Je pensais connaître mon pays, mais j'y venais en vacances. Y faire du business est totalement différent", nous confie Marc, fondateur d'une startup logistique.
Les opportunités
L'avantage de la diaspora est la double culture. La capacité à faire le pont entre les standards internationaux et les réalités locales est un atout concurrentiel majeur.
Conseil clé : Ne venez pas en "donneur de leçons". Venez avec humilité, écoutez le marché local, et adaptez vos processus. Ce qui marche en Europe ne marche pas forcément tel quel en Afrique.`,author:"Marc Dubois",date:"28 Sept 2024",imageUrl:"https://picsum.photos/800/400?random=12"}],p0=[{id:"i1",title:"De la Silicone Valley à Lagos : Itinéraire d'un génie du code",guestName:"Tunde Onakoya",companyName:"Lagos Code Academy",role:"Fondateur",type:Sn.VIDEO,thumbnailUrl:"https://images.unsplash.com/photo-1522202176988-66273c2fd55f?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80",videoUrl:"https://www.youtube.com/watch?v=dQw4w9WgXcQ",excerpt:"Tunde nous raconte comment il a quitté un poste prestigieux chez Google pour former la prochaine génération de développeurs nigérians.",date:"15 Oct 2024",duration:"24 min"},{id:"i2",title:"La reine du Karité : Bâtir un empire cosmétique bio",guestName:"Amina Diop",companyName:"Shea Gold",role:"CEO",type:Sn.ARTICLE,thumbnailUrl:"https://images.unsplash.com/photo-1571781926291-280584795465?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80",content:`
C'est dans son village natal du nord de la Côte d'Ivoire qu'Amina Diop a puisé son inspiration. Aujourd'hui, sa marque Shea Gold s'exporte dans 15 pays.
**Journaliste : Comment est née l'idée de Shea Gold ?**
Amina : Je voyais ma grand-mère produire ce beurre de karité d'une qualité exceptionnelle, mais qui était vendu à vil prix sur les marchés locaux. J'ai réalisé qu'il y avait un décalage entre la valeur du produit et sa valorisation commerciale.
**J : Quels ont été les principaux défis logistiques ?**
Amina : L'exportation est un parcours du combattant. Les normes phytosanitaires européennes sont drastiques. Il nous a fallu deux ans pour certifier toute notre chaîne de production. Mais aujourd'hui, cette rigueur est notre force.
**J : Un conseil pour les entrepreneuses ?**
Amina : N'ayez pas peur de commencer petit. J'ai commencé avec 50 pots vendus à mes collègues de bureau. Testez, apprenez, et grandissez organiquement.
`,excerpt:"Découvrez comment une recette ancestrale est devenue une marque de luxe internationale.",date:"02 Oct 2024",duration:"8 min de lecture"},{id:"i3",title:"AgriTech : Nourrir l'Afrique grâce à l'IA",guestName:"Kwame Mensah",companyName:"GreenFields",role:"Co-fondateur",type:Sn.VIDEO,thumbnailUrl:"https://images.unsplash.com/photo-1595841055318-943e1bf83383?ixlib=rb-4.0.3&auto=format&fit=crop&w=800&q=80",videoUrl:"https://www.youtube.com/watch?v=placeholder",excerpt:"Kwame explique comment ses drones analysent les sols pour optimiser les récoltes sans produits chimiques.",date:"20 Sept 2024",duration:"18 min"}];/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const kT=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),PT=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,o,a)=>a?a.toUpperCase():o.toLowerCase()),ah=n=>{const t=PT(n);return t.charAt(0).toUpperCase()+t.slice(1)},h0=(...n)=>n.filter((t,o,a)=>!!t&&t.trim()!==""&&a.indexOf(t)===o).join(" ").trim(),GT=n=>{for(const t in n)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/var qT={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VT=L.forwardRef(({color:n="currentColor",size:t=24,strokeWidth:o=2,absoluteStrokeWidth:a,className:s="",children:c,iconNode:f,...h},y)=>L.createElement("svg",{ref:y,...qT,width:t,height:t,stroke:n,strokeWidth:a?Number(o)*24/Number(t):o,className:h0("lucide",s),...!c&&!GT(h)&&{"aria-hidden":"true"},...h},[...f.map(([p,x])=>L.createElement(p,x)),...Array.isArray(c)?c:[c]]));/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ue=(n,t)=>{const o=L.forwardRef(({className:a,...s},c)=>L.createElement(VT,{ref:c,iconNode:t,className:h0(`lucide-${kT(ah(n))}`,`lucide-${n}`,a),...s}));return o.displayName=ah(n),o};/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const HT=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],xl=ue("arrow-left",HT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zT=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],g0=ue("arrow-right",zT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const OT=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],Wu=ue("award",OT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BT=[["path",{d:"M16 20V4a2 2 0 0 0-2-2h-4a2 2 0 0 0-2 2v16",key:"jecpp"}],["rect",{width:"20",height:"14",x:"2",y:"6",rx:"2",key:"i6l2r4"}]],y0=ue("briefcase",BT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FT=[["path",{d:"M10 12h4",key:"a56b0p"}],["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M14 21v-3a2 2 0 0 0-4 0v3",key:"1rgiei"}],["path",{d:"M6 10H4a2 2 0 0 0-2 2v7a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2h-2",key:"secmi2"}],["path",{d:"M6 21V5a2 2 0 0 1 2-2h8a2 2 0 0 1 2 2v16",key:"16ra0t"}]],JT=ue("building-2",FT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const YT=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],v0=ue("calendar",YT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const jT=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],KT=ue("check",jT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const XT=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],x0=ue("circle-check-big",XT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const $T=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]],sh=ue("circle-plus",$T);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const QT=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],ZT=ue("clock",QT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const WT=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],E0=ue("credit-card",WT);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const eS=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],T0=ue("eye",eS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const tS=[["path",{d:"M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z",key:"1jg4f8"}]],Ac=ue("facebook",tS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const nS=[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],iS=ue("file-text",nS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const oS=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],S0=ue("globe",oS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const lS=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]],ec=ue("image",lS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const aS=[["rect",{width:"20",height:"20",x:"2",y:"2",rx:"5",ry:"5",key:"2e1cvw"}],["path",{d:"M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z",key:"9exkf1"}],["line",{x1:"17.5",x2:"17.51",y1:"6.5",y2:"6.5",key:"r4j83e"}]],wc=ue("instagram",aS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const sS=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],_0=ue("layout-dashboard",sS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const rS=[["path",{d:"M16 8a6 6 0 0 1 6 6v7h-4v-7a2 2 0 0 0-2-2 2 2 0 0 0-2 2v7h-4v-7a6 6 0 0 1 6-6z",key:"c2jq9f"}],["rect",{width:"4",height:"12",x:"2",y:"9",key:"mk3on5"}],["circle",{cx:"4",cy:"4",r:"2",key:"bt5ra8"}]],Rc=ue("linkedin",rS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const uS=[["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m16.2 7.8 2.9-2.9",key:"r700ao"}],["path",{d:"M18 12h4",key:"wj9ykh"}],["path",{d:"m16.2 16.2 2.9 2.9",key:"1bxg5t"}],["path",{d:"M12 18v4",key:"jadmvz"}],["path",{d:"m4.9 19.1 2.9-2.9",key:"bwix9q"}],["path",{d:"M2 12h4",key:"j09sii"}],["path",{d:"m4.9 4.9 2.9 2.9",key:"giyufr"}]],cS=ue("loader",uS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const dS=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],fS=ue("log-out",dS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const mS=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],pS=ue("mail",mS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const hS=[["path",{d:"M20 10c0 4.993-5.539 10.193-7.399 11.799a1 1 0 0 1-1.202 0C9.539 20.193 4 14.993 4 10a8 8 0 0 1 16 0",key:"1r0f0z"}],["circle",{cx:"12",cy:"10",r:"3",key:"ilqhr7"}]],cs=ue("map-pin",hS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const gS=[["path",{d:"M4 5h16",key:"1tepv9"}],["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 19h16",key:"1djgab"}]],yS=ue("menu",gS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const vS=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],xS=ue("mic",vS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const ES=[["path",{d:"M13 21h8",key:"1jsn5i"}],["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]],b0=ue("pen-line",ES);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const TS=[["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]],C0=ue("phone",TS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const SS=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Qa=ue("play",SS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const _S=[["path",{d:"M16 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"rib7q0"}],["path",{d:"M5 3a2 2 0 0 0-2 2v6a2 2 0 0 0 2 2 1 1 0 0 1 1 1v1a2 2 0 0 1-2 2 1 1 0 0 0-1 1v2a1 1 0 0 0 1 1 6 6 0 0 0 6-6V5a2 2 0 0 0-2-2z",key:"1ymkrd"}]],bS=ue("quote",_S);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const CS=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],tc=ue("search",CS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const NS=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],AS=ue("send",NS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const wS=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],ds=ue("share-2",wS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const RS=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],MS=ue("shield-check",RS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const IS=[["path",{d:"M16 10a4 4 0 0 1-8 0",key:"1ltviw"}],["path",{d:"M3.103 6.034h17.794",key:"awc11p"}],["path",{d:"M3.4 5.467a2 2 0 0 0-.4 1.2V20a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2V6.667a2 2 0 0 0-.4-1.2l-2-2.667A2 2 0 0 0 17 2H7a2 2 0 0 0-1.6.8z",key:"o988cm"}]],N0=ue("shopping-bag",IS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const DS=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],US=ue("smartphone",DS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const LS=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],kS=ue("sparkles",LS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const PS=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],Mc=ue("star",PS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const GS=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],qS=ue("trash-2",GS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const VS=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],HS=ue("trending-up",VS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const zS=[["path",{d:"M22 4s-.7 2.1-2 3.4c1.6 10-9.4 17.3-18 11.6 2.2.1 4.4-.6 6-2C3 15.5.5 9.6 3 5c2.2 2.6 5.6 4.1 9 4-.9-4.2 4-6.6 7-3.8 1.1 0 3-1.2 3-1.2z",key:"pff0z6"}]],OS=ue("twitter",zS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const BS=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],fs=ue("user",BS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const FS=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ic=ue("x",FS);/**
* @license lucide-react v0.554.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/const JS=[["path",{d:"M2.5 17a24.12 24.12 0 0 1 0-10 2 2 0 0 1 1.4-1.4 49.56 49.56 0 0 1 16.2 0A2 2 0 0 1 21.5 7a24.12 24.12 0 0 1 0 10 2 2 0 0 1-1.4 1.4 49.55 49.55 0 0 1-16.2 0A2 2 0 0 1 2.5 17",key:"1q2vi4"}],["path",{d:"m10 15 5-3-5-3z",key:"1jp15x"}]],YS=ue("youtube",JS),jS=({user:n,onLogout:t})=>{const[o,a]=L.useState(!1),s=nn();return s.pathname.startsWith("/dashboard")?null:v.jsxs("nav",{className:"bg-white shadow-sm sticky top-0 z-50",children:[v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:v.jsxs("div",{className:"flex justify-between h-16",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsxs(Se,{to:"/",className:"flex-shrink-0 flex items-center gap-2",children:[v.jsx("div",{className:"w-8 h-8 bg-brand-600 rounded-lg flex items-center justify-center text-white font-bold font-serif",children:"A"}),v.jsx("span",{className:"font-serif font-bold text-xl text-gray-900",children:"Afropreunariat"})]}),v.jsxs("div",{className:"hidden sm:ml-8 sm:flex sm:space-x-8",children:[v.jsx(Se,{to:"/",className:`inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium ${s.pathname==="/"?"border-brand-500 text-gray-900":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:"Accueil"}),v.jsx(Se,{to:"/directory",className:`inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium ${s.pathname.startsWith("/directory")?"border-brand-500 text-gray-900":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:"Annuaire"}),v.jsx(Se,{to:"/afrolife",className:`inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium ${s.pathname.startsWith("/afrolife")?"border-brand-500 text-brand-600":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:"Afro Life"}),v.jsx(Se,{to:"/blog",className:`inline-flex items-center px-1 pt-1 border-b-2 text-sm font-medium ${s.pathname.startsWith("/blog")?"border-brand-500 text-gray-900":"border-transparent text-gray-500 hover:text-gray-700 hover:border-gray-300"}`,children:"Blog"})]})]}),v.jsx("div",{className:"hidden sm:ml-6 sm:flex sm:items-center space-x-4",children:n?v.jsx(v.Fragment,{children:v.jsxs(Se,{to:"/dashboard",className:"inline-flex items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md shadow-sm text-white bg-brand-600 hover:bg-brand-700 focus:outline-none",children:[v.jsx(_0,{className:"w-4 h-4 mr-2"}),"Mon Espace"]})}):v.jsxs(Se,{to:"/login",className:"inline-flex items-center px-4 py-2 border border-gray-300 text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none",children:[v.jsx(fs,{className:"w-4 h-4 mr-2"}),"Connexion / Inscription"]})}),v.jsx("div",{className:"-mr-2 flex items-center sm:hidden",children:v.jsx("button",{onClick:()=>a(!o),className:"inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none",children:o?v.jsx(Ic,{className:"block h-6 w-6"}):v.jsx(yS,{className:"block h-6 w-6"})})})]})}),o&&v.jsx("div",{className:"sm:hidden bg-white border-t",children:v.jsxs("div",{className:"pt-2 pb-3 space-y-1",children:[v.jsx(Se,{to:"/",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300",onClick:()=>a(!1),children:"Accueil"}),v.jsx(Se,{to:"/directory",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300",onClick:()=>a(!1),children:"Annuaire"}),v.jsx(Se,{to:"/afrolife",className:"block pl-3 pr-4 py-2 border-l-4 border-brand-500 text-base font-medium text-brand-700 bg-brand-50",onClick:()=>a(!1),children:"Afro Life"}),v.jsx(Se,{to:"/blog",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300",onClick:()=>a(!1),children:"Blog"}),n?v.jsx(Se,{to:"/dashboard",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300",onClick:()=>a(!1),children:"Mon Espace"}):v.jsx(Se,{to:"/login",className:"block pl-3 pr-4 py-2 border-l-4 border-transparent text-base font-medium text-gray-600 hover:text-gray-800 hover:bg-gray-50 hover:border-gray-300",onClick:()=>a(!1),children:"Connexion"})]})})]})},KS=()=>nn().pathname.startsWith("/dashboard")?null:v.jsx("footer",{className:"bg-dark-900 text-white",children:v.jsxs("div",{className:"max-w-7xl mx-auto py-12 px-4 overflow-hidden sm:px-6 lg:px-8",children:[v.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-8",children:[v.jsxs("div",{children:[v.jsx("h3",{className:"text-2xl font-serif font-bold text-brand-500 mb-4",children:"Afropreunariat"}),v.jsx("p",{className:"text-gray-400 text-sm",children:"La plateforme de référence pour l'entrepreneuriat africain. Visibilité, connexion et croissance pour les TPE/PME."})]}),v.jsxs("div",{children:[v.jsx("h4",{className:"font-bold text-lg mb-4",children:"Liens Rapides"}),v.jsxs("ul",{className:"space-y-2 text-gray-400 text-sm",children:[v.jsx("li",{children:v.jsx(Se,{to:"/directory",className:"hover:text-brand-500",children:"Rechercher une entreprise"})}),v.jsx("li",{children:v.jsx(Se,{to:"/login",className:"hover:text-brand-500",children:"Inscrire mon entreprise"})}),v.jsx("li",{children:v.jsx(Se,{to:"/blog",className:"hover:text-brand-500",children:"Actualités & Conseils"})})]})]}),v.jsxs("div",{children:[v.jsx("h4",{className:"font-bold text-lg mb-4",children:"Contact"}),v.jsx("p",{className:"text-gray-400 text-sm mb-2",children:"Abidjan, Côte d'Ivoire / Paris, France"}),v.jsx("p",{className:"text-gray-400 text-sm",children:"support@afropreunariat.com"})]})]}),v.jsx("div",{className:"mt-8 pt-8 border-t border-gray-800 text-center text-gray-500 text-sm",children:"© 2025 Afropreunariat. Tous droits réservés."})]})}),A0=({business:n})=>{const[t,o]=L.useState(!1),a=c=>{c.preventDefault(),c.stopPropagation(),o(!t)},s=c=>{const f=encodeURIComponent(`${window.location.origin}/#/directory/${n.id}`),h=encodeURIComponent(`Découvrez ${n.name} sur Afropreunariat`);let y="";switch(c){case"facebook":y=`https://www.facebook.com/sharer/sharer.php?u=${f}`;break;case"twitter":y=`https://twitter.com/intent/tweet?url=${f}&text=${h}`;break;case"linkedin":y=`https://www.linkedin.com/sharing/share-offsite/?url=${f}`;break;case"instagram":alert("Pour partager sur Instagram, copiez le lien ou faites une capture d'écran."),o(!1);return}y&&window.open(y,"_blank","width=600,height=400"),o(!1)};return v.jsxs("div",{className:"bg-white rounded-xl shadow-sm hover:shadow-md transition-shadow duration-200 border border-gray-100 overflow-hidden flex flex-col h-full group relative",children:[v.jsxs("div",{className:"relative h-40 bg-gray-200",children:[v.jsx("img",{src:`https://picsum.photos/seed/${n.id}/500/300`,alt:"Couverture",className:"w-full h-full object-cover transition-transform duration-700 group-hover:scale-105"}),v.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),v.jsxs("div",{className:"absolute top-2 right-2 flex gap-2 z-20",children:[n.contactPhone&&v.jsx("a",{href:`tel:${n.contactPhone}`,onClick:c=>c.stopPropagation(),className:"p-2 bg-white/20 backdrop-blur-md border border-white/20 rounded-full text-white hover:bg-white hover:text-brand-600 transition-all shadow-sm",title:"Appeler",children:v.jsx(C0,{className:"w-4 h-4"})}),v.jsxs("div",{className:"relative",children:[v.jsx("button",{onClick:a,className:"p-2 bg-white/20 backdrop-blur-md border border-white/20 rounded-full text-white hover:bg-white hover:text-brand-600 transition-all shadow-sm",title:"Partager",children:v.jsx(ds,{className:"w-4 h-4"})}),t&&v.jsxs("div",{className:"absolute right-0 mt-2 w-48 bg-white rounded-lg shadow-xl py-2 border border-gray-100 z-30 animate-in fade-in zoom-in duration-200",onMouseLeave:()=>o(!1),children:[v.jsx("div",{className:"px-4 py-2 text-xs font-semibold text-gray-400 uppercase tracking-wider",children:"Partager"}),v.jsxs("button",{onClick:c=>{c.preventDefault(),c.stopPropagation(),s("facebook")},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 flex items-center hover:text-blue-600",children:[v.jsx(Ac,{className:"w-4 h-4 mr-3"})," Facebook"]}),v.jsxs("button",{onClick:c=>{c.preventDefault(),c.stopPropagation(),s("twitter")},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 flex items-center hover:text-black",children:[v.jsx(OS,{className:"w-4 h-4 mr-3"})," X (Twitter)"]}),v.jsxs("button",{onClick:c=>{c.preventDefault(),c.stopPropagation(),s("linkedin")},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 flex items-center hover:text-blue-700",children:[v.jsx(Rc,{className:"w-4 h-4 mr-3"})," LinkedIn"]}),v.jsxs("button",{onClick:c=>{c.preventDefault(),c.stopPropagation(),s("instagram")},className:"w-full text-left px-4 py-2 text-sm text-gray-700 hover:bg-gray-50 flex items-center hover:text-pink-600",children:[v.jsx(wc,{className:"w-4 h-4 mr-3"})," Instagram"]})]})]})]}),v.jsx("div",{className:"absolute -bottom-6 left-4 z-10 w-16 h-16 bg-white rounded-lg p-1 shadow-md",children:v.jsx("img",{src:n.logoUrl,alt:n.name,className:"w-full h-full object-cover rounded-md bg-gray-50"})}),v.jsx(Se,{to:`/directory/${n.id}`,className:"absolute inset-0 z-0","aria-label":`Voir ${n.name}`})]}),v.jsxs("div",{className:"pt-8 px-4 pb-4 flex-1 flex flex-col",children:[v.jsxs("div",{className:"flex justify-between items-start",children:[v.jsx(Se,{to:`/directory/${n.id}`,className:"font-bold text-lg text-gray-900 truncate hover:text-brand-600 transition-colors",children:n.name}),n.verified&&v.jsx(x0,{className:"w-5 h-5 text-blue-500 flex-shrink-0 ml-1"})]}),v.jsx("p",{className:"text-xs text-brand-600 font-semibold mb-2 uppercase tracking-wide",children:n.category}),v.jsxs("div",{className:"flex items-center text-sm text-gray-500 mb-3",children:[v.jsx(cs,{className:"w-4 h-4 mr-1"}),n.location]}),v.jsx("p",{className:"text-sm text-gray-600 line-clamp-2 mb-4 flex-1",children:n.description}),v.jsxs("div",{className:"mt-auto flex items-center justify-between pt-4 border-t border-gray-50",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(Mc,{className:"w-4 h-4 text-yellow-400 fill-current"}),v.jsx("span",{className:"text-sm font-bold ml-1 text-gray-700",children:n.rating}),v.jsxs("span",{className:"text-xs text-gray-400 ml-1",children:["(",n.viewCount," vues)"]})]}),v.jsx(Se,{to:`/directory/${n.id}`,className:"text-brand-600 text-sm font-medium hover:underline",children:"Voir la fiche"})]})]})]})},XS=()=>{const n=Ec(),[t,o]=L.useState(""),a=s=>{s.preventDefault(),n(`/directory?q=${t}`)};return v.jsxs("div",{children:[v.jsxs("div",{className:"relative bg-dark-900 overflow-hidden",children:[v.jsx("div",{className:"absolute inset-0 opacity-40",children:v.jsx("img",{src:"https://images.unsplash.com/photo-1522071820081-009f0129c71c?ixlib=rb-4.0.3&auto=format&fit=crop&w=1740&q=80",className:"w-full h-full object-cover",alt:"African entrepreneurs team"})}),v.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-24 lg:py-32",children:[v.jsxs("h1",{className:"text-4xl md:text-6xl font-serif font-bold text-white mb-6 tracking-tight",children:["Boostez votre visibilité dans ",v.jsx("br",{}),v.jsx("span",{className:"text-brand-500",children:"l'écosystème africain"})]}),v.jsx("p",{className:"text-xl text-gray-300 mb-8 max-w-2xl",children:"L'annuaire 2.0 qui connecte les talents, les entrepreneurs et les entreprises de la diaspora et du continent."}),v.jsxs("form",{onSubmit:a,className:"max-w-3xl bg-white p-2 rounded-lg shadow-xl flex flex-col md:flex-row gap-2",children:[v.jsxs("div",{className:"flex-1 relative",children:[v.jsx(tc,{className:"absolute left-3 top-3 text-gray-400 w-5 h-5"}),v.jsx("input",{type:"text",placeholder:"Que recherchez-vous ? (ex: Développeur, Traiteur...)",className:"w-full pl-10 pr-4 py-3 rounded-md focus:outline-none text-gray-900",value:t,onChange:s=>o(s.target.value)})]}),v.jsxs("div",{className:"md:w-1/3 relative border-t md:border-t-0 md:border-l border-gray-200",children:[v.jsx(cs,{className:"absolute left-3 top-3 text-gray-400 w-5 h-5"}),v.jsx("input",{type:"text",placeholder:"Localisation (ex: Abidjan)",className:"w-full pl-10 pr-4 py-3 rounded-md focus:outline-none text-gray-900"})]}),v.jsx("button",{type:"submit",className:"bg-brand-600 text-white px-8 py-3 rounded-md font-semibold hover:bg-brand-700 transition-colors",children:"Rechercher"})]})]})]}),v.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-16",children:[v.jsx("h2",{className:"text-3xl font-bold text-gray-900 mb-8 font-serif",children:"Secteurs en vedette"}),v.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4",children:Nc.slice(0,4).map((s,c)=>v.jsxs("div",{className:"group cursor-pointer bg-white p-6 rounded-xl border border-gray-100 shadow-sm hover:shadow-md hover:border-brand-200 transition-all text-center",children:[v.jsx("div",{className:"w-12 h-12 bg-brand-50 text-brand-600 rounded-full flex items-center justify-center mx-auto mb-4 group-hover:bg-brand-600 group-hover:text-white transition-colors",children:v.jsx(y0,{className:"w-6 h-6"})}),v.jsx("h3",{className:"font-semibold text-gray-900",children:s})]},c))})]}),v.jsx("div",{className:"bg-gray-50 py-16",children:v.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[v.jsxs("div",{className:"flex justify-between items-end mb-8",children:[v.jsxs("div",{children:[v.jsx("h2",{className:"text-3xl font-bold text-gray-900 font-serif",children:"Entreprises à la une"}),v.jsx("p",{className:"text-gray-500 mt-2",children:"Découvrez les pépites de notre communauté."})]}),v.jsxs(Se,{to:"/directory",className:"text-brand-600 font-medium hover:text-brand-700 flex items-center",children:["Voir tout l'annuaire ",v.jsx(HS,{className:"w-4 h-4 ml-1"})]})]}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:mo.map(s=>v.jsx(A0,{business:s},s.id))})]})})]})},$S=({featuredBusiness:n})=>n?v.jsxs("div",{className:"bg-gray-50 relative overflow-hidden pb-12 pt-6",children:[v.jsx("div",{className:"absolute inset-0 z-0 opacity-10",children:v.jsxs("svg",{className:"h-full w-full",viewBox:"0 0 100 100",preserveAspectRatio:"none",children:[v.jsx("path",{d:"M0 100 C 20 0 50 0 100 100 Z",fill:"#ea580c"}),v.jsx("path",{d:"M0 0 C 50 100 80 100 100 0 Z",fill:"#ea580c"})]})}),v.jsx("div",{className:"relative z-10 max-w-6xl mx-auto px-4 sm:px-6 lg:px-8",children:v.jsxs("div",{className:"bg-white rounded-2xl shadow-2xl overflow-hidden flex flex-col md:flex-row border border-gray-100",children:[v.jsxs("div",{className:"md:w-2/5 relative h-64 md:h-auto bg-gray-900 group",children:[n.founderImageUrl?v.jsx("img",{src:n.founderImageUrl,alt:n.founderName,className:"w-full h-full object-cover opacity-90 group-hover:opacity-100 transition-opacity duration-500"}):v.jsx("div",{className:"w-full h-full bg-gradient-to-br from-gray-800 to-black flex items-center justify-center",children:v.jsx(fs,{className:"w-20 h-20 text-gray-600"})}),v.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/80 via-transparent to-transparent"}),v.jsx("div",{className:"absolute bottom-6 left-6 flex items-center space-x-3",children:v.jsx("div",{className:"w-16 h-16 bg-white rounded-xl p-1 shadow-lg rotate-3 transform transition-transform group-hover:rotate-0",children:v.jsx("img",{src:n.logoUrl,alt:"Logo",className:"w-full h-full object-cover rounded-lg"})})})]}),v.jsxs("div",{className:"md:w-3/5 p-8 md:p-12 flex flex-col justify-center",children:[v.jsx("div",{className:"flex items-center space-x-2 mb-4",children:v.jsxs("span",{className:"inline-flex items-center px-3 py-1 rounded-full text-xs font-bold bg-yellow-100 text-yellow-800 uppercase tracking-wider",children:[v.jsx(Wu,{className:"w-3 h-3 mr-1"})," Entrepreneur du mois"]})}),v.jsx("h2",{className:"text-3xl md:text-4xl font-bold font-serif text-gray-900 mb-2",children:n.name}),v.jsxs("p",{className:"text-lg text-gray-600 mb-4 font-medium",children:["Dirigé par ",v.jsx("span",{className:"text-brand-600",children:n.founderName})]}),v.jsxs("div",{className:"flex flex-wrap gap-4 text-sm text-gray-500 mb-6",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(y0,{className:"w-4 h-4 mr-1"})," ",n.category]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(cs,{className:"w-4 h-4 mr-1"})," ",n.location]})]}),n.keyMetric&&v.jsxs("div",{className:"mb-8 p-4 bg-brand-50 border-l-4 border-brand-500 rounded-r-lg",children:[v.jsx("p",{className:"text-2xl font-bold text-brand-900",children:n.keyMetric}),v.jsx("p",{className:"text-xs text-brand-700 uppercase font-semibold",children:"Performance validée"})]}),v.jsxs("div",{className:"flex flex-col sm:flex-row gap-4",children:[v.jsx(Se,{to:`/directory/${n.id}`,className:"inline-flex items-center justify-center px-6 py-3 border border-transparent text-base font-medium rounded-md text-white bg-brand-600 hover:bg-brand-700 shadow-lg hover:shadow-xl transition-all",children:"Voir la fiche complète"}),v.jsxs("button",{className:"inline-flex items-center justify-center px-6 py-3 border-2 border-gray-200 text-base font-medium rounded-md text-gray-600 bg-transparent hover:border-brand-300 hover:text-brand-600 transition-colors",children:["Devenir l'entrepreneur du mois ",v.jsx(g0,{className:"w-4 h-4 ml-2"})]})]})]})]})})]}):null,QS=()=>{const[n,t]=L.useState("All"),[o,a]=L.useState(""),c=new URLSearchParams(nn().search);L.useEffect(()=>{const y=c.get("q");y&&a(y)},[c]);const f=L.useMemo(()=>mo.find(y=>y.isFeatured),[]),h=L.useMemo(()=>mo.filter(y=>{const p=n==="All"||y.category===n,x=y.name.toLowerCase().includes(o.toLowerCase())||y.description.toLowerCase().includes(o.toLowerCase())||y.tags.some(E=>E.toLowerCase().includes(o.toLowerCase()));return p&&x}),[n,o]);return v.jsxs("div",{children:[f&&v.jsx($S,{featuredBusiness:f}),v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8",children:v.jsxs("div",{className:"flex flex-col md:flex-row gap-8",children:[v.jsx("div",{className:"w-full md:w-64 flex-shrink-0",children:v.jsxs("div",{className:"bg-white p-6 rounded-xl shadow-sm border border-gray-100 sticky top-24",children:[v.jsxs("h3",{className:"font-bold text-lg mb-4 flex items-center",children:[v.jsx(tc,{className:"w-4 h-4 mr-2"})," Filtres"]}),v.jsxs("div",{className:"mb-6",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Recherche"}),v.jsx("input",{type:"text",value:o,onChange:y=>a(y.target.value),className:"w-full border-gray-300 rounded-md shadow-sm focus:ring-brand-500 focus:border-brand-500 sm:text-sm p-2 border",placeholder:"Nom, mot-clé..."})]}),v.jsxs("div",{className:"mb-6",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700 mb-2",children:"Catégorie"}),v.jsxs("div",{className:"space-y-2",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx("input",{id:"cat-all",name:"category",type:"radio",checked:n==="All",onChange:()=>t("All"),className:"focus:ring-brand-500 h-4 w-4 text-brand-600 border-gray-300"}),v.jsx("label",{htmlFor:"cat-all",className:"ml-3 text-sm text-gray-600",children:"Toutes"})]}),Nc.map(y=>v.jsxs("div",{className:"flex items-center",children:[v.jsx("input",{id:`cat-${y}`,name:"category",type:"radio",checked:n===y,onChange:()=>t(y),className:"focus:ring-brand-500 h-4 w-4 text-brand-600 border-gray-300"}),v.jsx("label",{htmlFor:`cat-${y}`,className:"ml-3 text-sm text-gray-600 truncate",title:y,children:y})]},y))]})]})]})}),v.jsxs("div",{className:"flex-1",children:[v.jsxs("div",{className:"mb-4 flex justify-between items-center",children:[v.jsx("h1",{className:"text-2xl font-bold font-serif text-gray-900",children:"Annuaire des entreprises"}),v.jsxs("span",{className:"text-sm text-gray-500",children:[h.length," résultats"]})]}),h.length>0?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:h.map(y=>v.jsx(A0,{business:y},y.id))}):v.jsxs("div",{className:"text-center py-20 bg-white rounded-xl border border-gray-100 border-dashed",children:[v.jsx("div",{className:"mx-auto h-12 w-12 text-gray-400",children:v.jsx(tc,{className:"h-12 w-12"})}),v.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"Aucun résultat"}),v.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Essayez d'ajuster vos filtres de recherche."})]})]})]})})]})},ZS=()=>v.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[v.jsxs("div",{className:"text-center mb-12",children:[v.jsx("h1",{className:"text-3xl font-bold font-serif text-gray-900 sm:text-4xl",children:"Le Blog de l'Entrepreneur"}),v.jsx("p",{className:"mt-3 max-w-2xl mx-auto text-xl text-gray-500 sm:mt-4",children:"Conseils, actualités et success stories de l'écosystème africain."})]}),v.jsx("div",{className:"grid gap-8 lg:grid-cols-3",children:m0.map(n=>v.jsxs(Se,{to:`/blog/${n.id}`,className:"group flex flex-col rounded-lg shadow-lg overflow-hidden bg-white hover:shadow-xl transition-shadow duration-300",children:[v.jsxs("div",{className:"flex-shrink-0 relative overflow-hidden h-48",children:[v.jsx("img",{className:"h-full w-full object-cover group-hover:scale-105 transition-transform duration-500",src:n.imageUrl,alt:n.title}),v.jsx("div",{className:"absolute inset-0 bg-black/10 group-hover:bg-transparent transition-colors"})]}),v.jsxs("div",{className:"flex-1 bg-white p-6 flex flex-col justify-between",children:[v.jsxs("div",{className:"flex-1",children:[v.jsx("p",{className:"text-sm font-medium text-brand-600",children:"Conseils"}),v.jsxs("div",{className:"block mt-2",children:[v.jsx("p",{className:"text-xl font-semibold text-gray-900 group-hover:text-brand-700 transition-colors",children:n.title}),v.jsx("p",{className:"mt-3 text-base text-gray-500 line-clamp-3",children:n.excerpt})]})]}),v.jsxs("div",{className:"mt-6 flex items-center justify-between",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsxs("div",{className:"flex-shrink-0",children:[v.jsx("span",{className:"sr-only",children:n.author}),v.jsx("div",{className:"h-10 w-10 rounded-full bg-gray-200 flex items-center justify-center text-gray-600 font-bold border border-gray-300",children:n.author.charAt(0)})]}),v.jsxs("div",{className:"ml-3",children:[v.jsx("p",{className:"text-sm font-medium text-gray-900",children:n.author}),v.jsx("div",{className:"flex space-x-1 text-sm text-gray-500",children:v.jsx("time",{children:n.date})})]})]}),v.jsx("span",{className:"text-brand-600 opacity-0 group-hover:opacity-100 transition-opacity",children:v.jsx(g0,{className:"w-5 h-5"})})]})]})]},n.id))})]}),WS=()=>{const{id:n}=Tc(),t=m0.find(o=>o.id===n);return L.useEffect(()=>{window.scrollTo(0,0)},[n]),t?v.jsxs("article",{className:"bg-white min-h-screen",children:[v.jsxs("div",{className:"w-full h-64 md:h-96 relative",children:[v.jsx("img",{src:t.imageUrl,alt:t.title,className:"w-full h-full object-cover"}),v.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/60 to-transparent"}),v.jsx("div",{className:"absolute bottom-0 left-0 w-full p-4 sm:p-8 max-w-4xl mx-auto",children:v.jsxs(Se,{to:"/blog",className:"inline-flex items-center text-white/80 hover:text-white mb-4 text-sm font-medium transition-colors",children:[v.jsx(xl,{className:"w-4 h-4 mr-1"})," Retour aux articles"]})})]}),v.jsx("div",{className:"max-w-3xl mx-auto px-4 sm:px-6 lg:px-8 py-12 -mt-20 relative z-10",children:v.jsxs("div",{className:"bg-white rounded-xl shadow-xl p-6 md:p-10 border border-gray-100",children:[v.jsxs("header",{className:"mb-8 border-b border-gray-100 pb-8",children:[v.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-sm text-gray-500 mb-4",children:[v.jsxs("span",{className:"flex items-center",children:[v.jsx(fs,{className:"w-4 h-4 mr-1 text-brand-500"}),t.author]}),v.jsxs("span",{className:"flex items-center",children:[v.jsx(v0,{className:"w-4 h-4 mr-1 text-brand-500"}),t.date]}),v.jsx("span",{className:"px-2 py-1 bg-brand-50 text-brand-700 rounded text-xs font-semibold uppercase tracking-wide",children:"Conseils"})]}),v.jsx("h1",{className:"text-3xl md:text-4xl font-serif font-bold text-gray-900 leading-tight",children:t.title})]}),v.jsxs("div",{className:"prose prose-lg prose-orange max-w-none text-gray-600",children:[v.jsx("p",{className:"lead text-xl text-gray-500 font-serif italic mb-6",children:t.excerpt}),t.content.split(`
`).map((o,a)=>o.trim()!==""&&v.jsx("p",{className:"mb-4 leading-relaxed",children:o},a))]}),v.jsxs("div",{className:"mt-12 pt-8 border-t border-gray-100 flex justify-between items-center",children:[v.jsx("p",{className:"text-sm text-gray-500 font-medium",children:"Vous avez aimé cet article ?"}),v.jsx("div",{className:"flex space-x-2",children:v.jsx("button",{className:"p-2 rounded-full bg-gray-100 text-gray-600 hover:bg-brand-100 hover:text-brand-600 transition-colors",children:v.jsx(ds,{className:"w-5 h-5"})})})]})]})})]}):v.jsxs("div",{className:"min-h-[60vh] flex flex-col items-center justify-center",children:[v.jsx("h2",{className:"text-3xl font-serif font-bold text-gray-900 mb-4",children:"Article introuvable"}),v.jsx("p",{className:"text-gray-600 mb-8",children:"L'article que vous recherchez n'existe pas ou a été supprimé."}),v.jsxs(Se,{to:"/blog",className:"text-brand-600 hover:text-brand-700 font-medium flex items-center",children:[v.jsx(xl,{className:"w-4 h-4 mr-2"})," Retour au blog"]})]})},e_=()=>{var x,E,S,b;const{id:n}=Tc(),t=mo.find(C=>C.id===n),[o,a]=L.useState({name:"",email:"",message:""}),[s,c]=L.useState("idle"),f=L.useMemo(()=>f0.filter(C=>C.businessId===n&&C.active),[n]);if(L.useEffect(()=>{window.scrollTo(0,0)},[n]),!t)return v.jsxs("div",{className:"min-h-[60vh] flex flex-col items-center justify-center",children:[v.jsx("h2",{className:"text-2xl font-bold text-gray-900 mb-4",children:"Entreprise introuvable"}),v.jsxs(Se,{to:"/directory",className:"text-brand-600 hover:text-brand-700 font-medium flex items-center",children:[v.jsx(xl,{className:"w-4 h-4 mr-2"})," Retour à l'annuaire"]})]});const h=C=>{const I=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,w=C.match(I);return w&&w[2].length===11?`https://www.youtube.com/embed/${w[2]}`:null},y=t.videoUrl?h(t.videoUrl):null,p=C=>{C.preventDefault(),c("sending"),setTimeout(()=>{c("success"),a({name:"",email:"",message:""}),setTimeout(()=>c("idle"),3e3)},1500)};return v.jsxs("div",{className:"bg-gray-50 min-h-screen pb-12",children:[v.jsxs("div",{className:"h-48 md:h-64 bg-gradient-to-r from-gray-900 to-gray-800 relative overflow-hidden",children:[v.jsx("div",{className:"absolute inset-0 opacity-20 bg-[url('https://www.transparenttextures.com/patterns/cubes.png')]"}),v.jsx("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 h-full flex flex-col justify-between py-6",children:v.jsxs(Se,{to:"/directory",className:"inline-flex items-center text-white/80 hover:text-white transition-colors w-fit",children:[v.jsx(xl,{className:"w-4 h-4 mr-2"})," Retour"]})})]}),v.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 -mt-20 relative z-10",children:[v.jsx("div",{className:"bg-white rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:v.jsx("div",{className:"p-6 md:p-8",children:v.jsxs("div",{className:"flex flex-col md:flex-row gap-6 items-start",children:[v.jsxs("div",{className:"w-32 h-32 md:w-40 md:h-40 rounded-xl bg-white p-1 shadow-md -mt-16 md:-mt-24 border border-gray-100 flex-shrink-0 relative",children:[v.jsx("img",{src:t.logoUrl,alt:t.name,className:"w-full h-full object-cover rounded-lg bg-gray-50"}),t.isFeatured&&v.jsx("div",{className:"absolute -top-3 -right-3 bg-yellow-400 text-yellow-900 rounded-full p-2 shadow-md",title:"Entrepreneur du Mois",children:v.jsx(Wu,{className:"w-6 h-6"})})]}),v.jsxs("div",{className:"flex-1 w-full",children:[v.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[v.jsxs("div",{children:[v.jsxs("div",{className:"flex items-center gap-2",children:[v.jsx("h1",{className:"text-3xl font-serif font-bold text-gray-900 flex items-center gap-2",children:t.name}),t.verified&&v.jsx(x0,{className:"w-6 h-6 text-blue-500",title:"Entreprise Vérifiée"})]}),v.jsx("div",{className:"text-brand-600 font-medium mt-1 uppercase tracking-wide text-sm",children:t.category}),t.isFeatured&&v.jsxs("div",{className:"inline-flex items-center px-2 py-1 rounded bg-yellow-100 text-yellow-800 text-xs font-bold mt-2",children:[v.jsx(Wu,{className:"w-3 h-3 mr-1"})," ENTREPRENEUR DU MOIS"]})]}),v.jsxs("div",{className:"flex gap-3",children:[v.jsxs("button",{className:"inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50",children:[v.jsx(ds,{className:"w-4 h-4 mr-2"})," Partager"]}),v.jsx("a",{href:"#contact-form",className:"inline-flex items-center px-4 py-2 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-brand-600 hover:bg-brand-700",children:"Contacter"})]})]}),v.jsxs("div",{className:"flex flex-wrap gap-4 mt-6 text-sm text-gray-500 border-t border-gray-100 pt-4",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(cs,{className:"w-4 h-4 mr-1 text-gray-400"}),t.location]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(Mc,{className:"w-4 h-4 mr-1 text-yellow-400 fill-current"}),v.jsx("span",{className:"font-bold text-gray-700 mr-1",children:t.rating}),"(",t.viewCount," vues)"]}),t.tags.map(C=>v.jsxs("span",{className:"bg-gray-100 text-gray-600 px-2 py-1 rounded text-xs",children:["#",C]},C))]})]})]})})}),v.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-3 gap-8 mt-8",children:[v.jsxs("div",{className:"lg:col-span-2 space-y-8",children:[v.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 md:p-8",children:[v.jsx("h2",{className:"text-xl font-bold font-serif text-gray-900 mb-4",children:"À propos"}),v.jsx("p",{className:"text-gray-600 leading-relaxed whitespace-pre-line",children:t.description})]}),(t.founderName||t.founderImageUrl)&&v.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 md:p-8 overflow-hidden relative",children:[v.jsx("div",{className:"absolute top-0 right-0 p-4 opacity-10",children:v.jsx(bS,{className:"w-24 h-24 text-brand-500"})}),v.jsx("h2",{className:"text-xl font-bold font-serif text-gray-900 mb-6 relative z-10",children:"Le Fondateur"}),v.jsxs("div",{className:"flex flex-col sm:flex-row gap-6 items-center sm:items-start relative z-10",children:[t.founderImageUrl&&v.jsx("img",{src:t.founderImageUrl,alt:t.founderName,className:"w-32 h-32 rounded-full object-cover border-4 border-gray-50 shadow-md"}),v.jsxs("div",{children:[v.jsx("h3",{className:"text-lg font-bold text-gray-900",children:t.founderName}),v.jsx("p",{className:"text-brand-600 text-sm font-medium mb-3",children:"CEO & Fondateur"}),v.jsx("p",{className:"text-gray-600 italic",children:`"Notre mission est d'apporter des solutions concrètes et adaptées aux réalités locales, tout en visant l'excellence internationale."`}),t.keyMetric&&v.jsxs("div",{className:"mt-4 inline-block bg-brand-50 text-brand-700 px-3 py-1 rounded-full text-xs font-bold",children:["🚀 ",t.keyMetric]})]})]})]}),y&&v.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 md:p-8",children:[v.jsxs("h2",{className:"text-xl font-bold font-serif text-gray-900 mb-4 flex items-center",children:[v.jsx(Qa,{className:"w-5 h-5 mr-2 text-brand-600"})," Présentation Vidéo"]}),v.jsx("div",{className:"aspect-w-16 aspect-h-9 bg-gray-100 rounded-lg overflow-hidden",children:v.jsx("iframe",{src:y,title:`Présentation de ${t.name}`,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-64 md:h-96 rounded-lg"})})]}),f.length>0&&v.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 md:p-8",children:[v.jsx("h2",{className:"text-xl font-bold font-serif text-gray-900 mb-6",children:"Produits & Services"}),v.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-6",children:f.map(C=>v.jsxs("div",{className:"border border-gray-200 rounded-lg overflow-hidden hover:shadow-md transition-shadow",children:[v.jsxs("div",{className:"h-40 bg-gray-100 relative",children:[v.jsx("img",{src:C.imageUrl,alt:C.title,className:"w-full h-full object-cover"}),v.jsx("span",{className:`absolute top-2 right-2 px-2 py-1 text-xs font-bold rounded uppercase ${C.type===Qe.PRODUCT?"bg-blue-100 text-blue-800":"bg-purple-100 text-purple-800"}`,children:C.type===Qe.PRODUCT?"Produit":"Service"})]}),v.jsxs("div",{className:"p-4",children:[v.jsx("h3",{className:"font-bold text-gray-900 line-clamp-1",children:C.title}),v.jsxs("p",{className:"text-brand-600 font-bold mt-1",children:[new Intl.NumberFormat("fr-FR").format(C.price)," ",C.currency]}),v.jsx("button",{className:"mt-3 w-full block text-center bg-gray-50 text-gray-700 py-2 rounded text-sm font-medium hover:bg-gray-100 transition-colors",children:"Commander"})]})]},C.id))})]})]}),v.jsxs("div",{className:"space-y-8",children:[v.jsxs("div",{id:"contact-form",className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6 sticky top-24",children:[v.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Contact"}),v.jsxs("div",{className:"space-y-4 mb-6",children:[v.jsxs("a",{href:`mailto:${t.contactEmail}`,className:"flex items-center text-gray-600 hover:text-brand-600 transition-colors",children:[v.jsx("div",{className:"w-8 h-8 rounded-full bg-brand-50 flex items-center justify-center mr-3 text-brand-600 flex-shrink-0",children:v.jsx(pS,{className:"w-4 h-4"})}),v.jsx("span",{className:"text-sm truncate",children:t.contactEmail})]}),t.contactPhone&&v.jsxs("a",{href:`tel:${t.contactPhone}`,className:"flex items-center text-gray-600 hover:text-brand-600 transition-colors",children:[v.jsx("div",{className:"w-8 h-8 rounded-full bg-brand-50 flex items-center justify-center mr-3 text-brand-600 flex-shrink-0",children:v.jsx(C0,{className:"w-4 h-4"})}),v.jsx("span",{className:"text-sm",children:t.contactPhone})]}),((x=t.socialLinks)==null?void 0:x.website)&&v.jsxs("a",{href:t.socialLinks.website,target:"_blank",rel:"noopener noreferrer",className:"flex items-center text-gray-600 hover:text-brand-600 transition-colors",children:[v.jsx("div",{className:"w-8 h-8 rounded-full bg-brand-50 flex items-center justify-center mr-3 text-brand-600 flex-shrink-0",children:v.jsx(S0,{className:"w-4 h-4"})}),v.jsx("span",{className:"text-sm truncate",children:"Site Web"})]})]}),v.jsxs("div",{className:"border-t border-gray-100 pt-6",children:[v.jsx("h4",{className:"text-sm font-semibold text-gray-900 mb-3",children:"Envoyer un message"}),s==="success"?v.jsx("div",{className:"bg-green-50 border border-green-200 text-green-700 px-4 py-3 rounded-md text-sm",children:"Message envoyé avec succès !"}):v.jsxs("form",{onSubmit:p,className:"space-y-3",children:[v.jsx("div",{children:v.jsx("input",{type:"text",placeholder:"Votre nom",required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",value:o.name,onChange:C=>a({...o,name:C.target.value})})}),v.jsx("div",{children:v.jsx("input",{type:"email",placeholder:"Votre email",required:!0,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-1 focus:ring-brand-500",value:o.email,onChange:C=>a({...o,email:C.target.value})})}),v.jsx("div",{children:v.jsx("textarea",{placeholder:"Votre message...",required:!0,rows:3,className:"w-full px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-1 focus:ring-brand-500 resize-none",value:o.message,onChange:C=>a({...o,message:C.target.value})})}),v.jsx("button",{type:"submit",disabled:s==="sending",className:"w-full flex justify-center items-center px-4 py-2 border border-transparent text-sm font-medium rounded-md text-white bg-gray-900 hover:bg-gray-800 focus:outline-none transition-colors disabled:opacity-70",children:s==="sending"?"Envoi...":v.jsxs(v.Fragment,{children:[v.jsx(AS,{className:"w-3 h-3 mr-2"})," Envoyer"]})})]})]}),v.jsx("div",{className:"mt-6 pt-6 border-t border-gray-100",children:v.jsxs("div",{className:"flex justify-center space-x-6",children:[((E=t.socialLinks)==null?void 0:E.facebook)&&v.jsx("a",{href:t.socialLinks.facebook,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#1877F2] transition-colors",children:v.jsx(Ac,{className:"w-5 h-5"})}),((S=t.socialLinks)==null?void 0:S.linkedin)&&v.jsx("a",{href:t.socialLinks.linkedin,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#0A66C2] transition-colors",children:v.jsx(Rc,{className:"w-5 h-5"})}),((b=t.socialLinks)==null?void 0:b.instagram)&&v.jsx("a",{href:t.socialLinks.instagram,target:"_blank",rel:"noopener noreferrer",className:"text-gray-400 hover:text-[#E4405F] transition-colors",children:v.jsx(wc,{className:"w-5 h-5"})})]})})]}),v.jsxs("div",{className:"bg-white rounded-xl shadow-sm border border-gray-100 p-6",children:[v.jsx("h3",{className:"text-lg font-bold text-gray-900 mb-4",children:"Dans la même catégorie"}),v.jsx("div",{className:"space-y-4",children:mo.filter(C=>C.category===t.category&&C.id!==t.id).slice(0,3).map(C=>v.jsxs(Se,{to:`/directory/${C.id}`,className:"flex items-center group",children:[v.jsx("div",{className:"w-12 h-12 rounded bg-gray-100 overflow-hidden flex-shrink-0",children:v.jsx("img",{src:C.logoUrl,alt:C.name,className:"w-full h-full object-cover"})}),v.jsxs("div",{className:"ml-3 overflow-hidden",children:[v.jsx("p",{className:"text-sm font-medium text-gray-900 truncate group-hover:text-brand-600 transition-colors",children:C.name}),v.jsx("p",{className:"text-xs text-gray-500 truncate",children:C.location})]})]},C.id))})]})]})]})]})]})},rh=({onLogin:n})=>{const[t,o]=L.useState(""),[a,s]=L.useState(""),c=Ec(),f=h=>{h.preventDefault(),n(),c("/dashboard")};return v.jsx("div",{className:"min-h-[80vh] flex items-center justify-center bg-gray-50 py-12 px-4 sm:px-6 lg:px-8",children:v.jsxs("div",{className:"max-w-md w-full space-y-8",children:[v.jsxs("div",{className:"text-center",children:[v.jsx("div",{className:"mx-auto h-12 w-12 bg-brand-600 rounded-lg flex items-center justify-center text-white font-bold text-2xl",children:"A"}),v.jsx("h2",{className:"mt-6 text-3xl font-extrabold text-gray-900 font-serif",children:"Connexion à votre espace"}),v.jsxs("p",{className:"mt-2 text-sm text-gray-600",children:["Ou ",v.jsx("a",{href:"#",className:"font-medium text-brand-600 hover:text-brand-500",children:"créez votre compte entreprise pour 1€"})]})]}),v.jsxs("form",{className:"mt-8 space-y-6",onSubmit:f,children:[v.jsxs("div",{className:"rounded-md shadow-sm -space-y-px",children:[v.jsx("div",{children:v.jsx("input",{type:"email",required:!0,className:"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-t-md focus:outline-none focus:ring-brand-500 focus:border-brand-500 focus:z-10 sm:text-sm",placeholder:"Adresse email",value:t,onChange:h=>o(h.target.value)})}),v.jsx("div",{children:v.jsx("input",{type:"password",required:!0,className:"appearance-none rounded-none relative block w-full px-3 py-2 border border-gray-300 placeholder-gray-500 text-gray-900 rounded-b-md focus:outline-none focus:ring-brand-500 focus:border-brand-500 focus:z-10 sm:text-sm",placeholder:"Mot de passe",value:a,onChange:h=>s(h.target.value)})})]}),v.jsx("div",{children:v.jsx("button",{type:"submit",className:"group relative w-full flex justify-center py-2 px-4 border border-transparent text-sm font-medium rounded-md text-white bg-brand-600 hover:bg-brand-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-brand-500",children:"Se connecter"})}),v.jsx("div",{className:"text-sm text-center text-gray-500",children:"(Compte démo : n'importe quel email/mdp fonctionne)"})]})]})})},t_=({className:n})=>v.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",className:n,children:[v.jsx("path",{d:"M14 4.1 12 6"}),v.jsx("path",{d:"m5.1 8-2.9-.8"}),v.jsx("path",{d:"m6 12-1.9 2"}),v.jsx("path",{d:"M7.2 2.2 8 5.1"}),v.jsx("path",{d:"M9.037 9.69a.498.498 0 0 1 .653-.653l11 4.5a.5.5 0 0 1-.074.949l-4.349 1.041a1 1 0 0 0-.74.739l-1.04 4.35a.5.5 0 0 1-.95.074z"})]}),n_=({business:n})=>v.jsxs("div",{className:"space-y-6",children:[v.jsx("h2",{className:"text-2xl font-bold font-serif text-gray-900",children:"Tableau de bord"}),v.jsxs("div",{className:"grid grid-cols-1 gap-5 sm:grid-cols-3",children:[v.jsx("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:v.jsx("div",{className:"p-5",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx("div",{className:"flex-shrink-0 bg-brand-100 rounded-md p-3",children:v.jsx(T0,{className:"h-6 w-6 text-brand-600"})}),v.jsx("div",{className:"ml-5 w-0 flex-1",children:v.jsxs("dl",{children:[v.jsx("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Vues de la fiche"}),v.jsx("dd",{children:v.jsx("div",{className:"text-lg font-medium text-gray-900",children:n.viewCount})})]})})]})})}),v.jsx("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:v.jsx("div",{className:"p-5",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx("div",{className:"flex-shrink-0 bg-blue-100 rounded-md p-3",children:v.jsx(t_,{className:"h-6 w-6 text-blue-600"})}),v.jsx("div",{className:"ml-5 w-0 flex-1",children:v.jsxs("dl",{children:[v.jsx("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Clics Contact"}),v.jsx("dd",{children:v.jsx("div",{className:"text-lg font-medium text-gray-900",children:"42"})})]})})]})})}),v.jsx("div",{className:"bg-white overflow-hidden shadow rounded-lg",children:v.jsx("div",{className:"p-5",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx("div",{className:"flex-shrink-0 bg-yellow-100 rounded-md p-3",children:v.jsx(Mc,{className:"h-6 w-6 text-yellow-600"})}),v.jsx("div",{className:"ml-5 w-0 flex-1",children:v.jsxs("dl",{children:[v.jsx("dt",{className:"text-sm font-medium text-gray-500 truncate",children:"Note moyenne"}),v.jsx("dd",{children:v.jsxs("div",{className:"text-lg font-medium text-gray-900",children:[n.rating,"/5"]})})]})})]})})})]}),v.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[v.jsx("h3",{className:"text-lg leading-6 font-medium text-gray-900 mb-4",children:"Performances 30 derniers jours"}),v.jsx("div",{className:"h-64 bg-gray-50 rounded border border-dashed border-gray-200 flex items-center justify-center text-gray-400",children:"Graphique des visites (À venir en Phase 2)"})]})]});var pl={exports:{}},Ju={},Yu,uh;function i_(){if(uh)return Yu;uh=1;function n(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 Yu=n,n.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)},n.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null},n.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 s=this;return this._timer=setTimeout(function(){s._attempts++,s._operationTimeoutCb&&(s._timeout=setTimeout(function(){s._operationTimeoutCb(s._attempts)},s._operationTimeout),s._options.unref&&s._timeout.unref()),s._fn(s._attempts)},a),this._options.unref&&this._timer.unref(),!0},n.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)},n.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)},n.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)},n.prototype.start=n.prototype.try,n.prototype.errors=function(){return this._errors},n.prototype.attempts=function(){return this._attempts},n.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},o=null,a=0,s=0;s<this._errors.length;s++){var c=this._errors[s],f=c.message,h=(t[f]||0)+1;t[f]=h,h>=a&&(o=c,a=h)}return o},Yu}var ch;function o_(){return ch||(ch=1,(function(n){var t=i_();n.operation=function(o){var a=n.timeouts(o);return new t(a,{forever:o&&(o.forever||o.retries===1/0),unref:o&&o.unref,maxRetryTime:o&&o.maxRetryTime})},n.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 s in o)a[s]=o[s];if(a.minTimeout>a.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var c=[],f=0;f<a.retries;f++)c.push(this.createTimeout(f,a));return o&&o.forever&&!c.length&&c.push(this.createTimeout(f,a)),c.sort(function(h,y){return h-y}),c},n.createTimeout=function(o,a){var s=a.randomize?Math.random()+1:1,c=Math.round(s*Math.max(a.minTimeout,1)*Math.pow(a.factor,o));return c=Math.min(c,a.maxTimeout),c},n.wrap=function(o,a,s){if(a instanceof Array&&(s=a,a=null),!s){s=[];for(var c in o)typeof o[c]=="function"&&s.push(c)}for(var f=0;f<s.length;f++){var h=s[f],y=o[h];o[h]=(function(x){var E=n.operation(a),S=Array.prototype.slice.call(arguments,1),b=S.pop();S.push(function(C){E.retry(C)||(C&&(arguments[0]=E.mainError()),b.apply(this,arguments))}),E.attempt(function(){x.apply(o,S)})}).bind(o,y),o[h].options=a}}})(Ju)),Ju}var ju,dh;function l_(){return dh||(dh=1,ju=o_()),ju}var fh;function a_(){if(fh)return pl.exports;fh=1;const n=l_(),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(h){super(),h instanceof Error?(this.originalError=h,{message:h}=h):(this.originalError=new Error(h),this.originalError.stack=this.stack),this.name="AbortError",this.message=h}}const a=(f,h,y)=>{const p=y.retries-(h-1);return f.attemptNumber=h,f.retriesLeft=p,f},s=f=>t.includes(f),c=(f,h)=>new Promise((y,p)=>{h={onFailedAttempt:()=>{},retries:10,...h};const x=n.operation(h);x.attempt(async E=>{try{y(await f(E))}catch(S){if(!(S instanceof Error)){p(new TypeError(`Non-error was thrown: "${S}". You should only throw errors.`));return}if(S instanceof o)x.stop(),p(S.originalError);else if(S instanceof TypeError&&!s(S.message))x.stop(),p(S);else{a(S,E,h);try{await h.onFailedAttempt(S)}catch(b){p(b);return}x.retry(S)||p(x.mainError())}}})});return pl.exports=c,pl.exports.default=c,pl.exports.AbortError=o,pl.exports}var w0=a_();const s_=yc(w0);var r_={};/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/let u_,c_;function d_(){return{geminiUrl:u_,vertexUrl:c_}}function f_(n,t,o,a){var s,c;if(!(n!=null&&n.baseUrl)){const f=d_();return t?(s=f.vertexUrl)!==null&&s!==void 0?s:o:(c=f.geminiUrl)!==null&&c!==void 0?c:a}return n.baseUrl}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class Nn{}function $(n,t){const o=/\{([^}]+)\}/g;return n.replace(o,(a,s)=>{if(Object.prototype.hasOwnProperty.call(t,s)){const c=t[s];return c!=null?String(c):""}else throw new Error(`Key '${s}' not found in valueMap.`)})}function d(n,t,o){for(let c=0;c<t.length-1;c++){const f=t[c];if(f.endsWith("[]")){const h=f.slice(0,-2);if(!(h in n))if(Array.isArray(o))n[h]=Array.from({length:o.length},()=>({}));else throw new Error(`Value must be a list given an array path ${f}`);if(Array.isArray(n[h])){const y=n[h];if(Array.isArray(o))for(let p=0;p<y.length;p++){const x=y[p];d(x,t.slice(c+1),o[p])}else for(const p of y)d(p,t.slice(c+1),o)}return}else if(f.endsWith("[0]")){const h=f.slice(0,-3);h in n||(n[h]=[{}]);const y=n[h];d(y[0],t.slice(c+1),o);return}(!n[f]||typeof n[f]!="object")&&(n[f]={}),n=n[f]}const a=t[t.length-1],s=n[a];if(s!==void 0){if(!o||typeof o=="object"&&Object.keys(o).length===0||o===s)return;if(typeof s=="object"&&typeof o=="object"&&s!==null&&o!==null)Object.assign(s,o);else throw new Error(`Cannot set value for an existing key. Key: ${a}`)}else a==="_self"&&typeof o=="object"&&o!==null&&!Array.isArray(o)?Object.assign(n,o):n[a]=o}function u(n,t,o=void 0){try{if(t.length===1&&t[0]==="_self")return n;for(let a=0;a<t.length;a++){if(typeof n!="object"||n===null)return o;const s=t[a];if(s.endsWith("[]")){const c=s.slice(0,-2);if(c in n){const f=n[c];return Array.isArray(f)?f.map(h=>u(h,t.slice(a+1),o)):o}else return o}else n=n[s]}return n}catch(a){if(a instanceof TypeError)return o;throw a}}function m_(n,t){for(const[o,a]of Object.entries(t)){const s=o.split("."),c=a.split("."),f=new Set;let h=-1;for(let y=0;y<s.length;y++)if(s[y]==="*"){h=y;break}if(h!==-1&&c.length>h)for(let y=h;y<c.length;y++){const p=c[y];p!=="*"&&!p.endsWith("[]")&&!p.endsWith("[0]")&&f.add(p)}nc(n,s,c,0,f)}}function nc(n,t,o,a,s){if(a>=t.length||typeof n!="object"||n===null)return;const c=t[a];if(c.endsWith("[]")){const f=c.slice(0,-2),h=n;if(f in h&&Array.isArray(h[f]))for(const y of h[f])nc(y,t,o,a+1,s)}else if(c==="*"){if(typeof n=="object"&&n!==null&&!Array.isArray(n)){const f=n,h=Object.keys(f).filter(p=>!p.startsWith("_")&&!s.has(p)),y={};for(const p of h)y[p]=f[p];for(const[p,x]of Object.entries(y)){const E=[];for(const S of o.slice(a))S==="*"?E.push(p):E.push(S);d(f,E,x)}for(const p of h)delete f[p]}}else{const f=n;c in f&&nc(f[c],t,o,a+1,s)}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Dc(n){if(typeof n!="string")throw new Error("fromImageBytes must be a string");return n}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function p_(n){const t={},o=u(n,["operationName"]);o!=null&&d(t,["operationName"],o);const a=u(n,["resourceName"]);return a!=null&&d(t,["_url","resourceName"],a),t}function h_(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["metadata"]);a!=null&&d(t,["metadata"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);c!=null&&d(t,["error"],c);const f=u(n,["response","generateVideoResponse"]);return f!=null&&d(t,["response"],y_(f)),t}function g_(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["metadata"]);a!=null&&d(t,["metadata"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);c!=null&&d(t,["error"],c);const f=u(n,["response"]);return f!=null&&d(t,["response"],v_(f)),t}function y_(n){const t={},o=u(n,["generatedSamples"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(f=>x_(f))),d(t,["generatedVideos"],c)}const a=u(n,["raiMediaFilteredCount"]);a!=null&&d(t,["raiMediaFilteredCount"],a);const s=u(n,["raiMediaFilteredReasons"]);return s!=null&&d(t,["raiMediaFilteredReasons"],s),t}function v_(n){const t={},o=u(n,["videos"]);if(o!=null){let c=o;Array.isArray(c)&&(c=c.map(f=>E_(f))),d(t,["generatedVideos"],c)}const a=u(n,["raiMediaFilteredCount"]);a!=null&&d(t,["raiMediaFilteredCount"],a);const s=u(n,["raiMediaFilteredReasons"]);return s!=null&&d(t,["raiMediaFilteredReasons"],s),t}function x_(n){const t={},o=u(n,["video"]);return o!=null&&d(t,["video"],N_(o)),t}function E_(n){const t={},o=u(n,["_self"]);return o!=null&&d(t,["video"],A_(o)),t}function T_(n){const t={},o=u(n,["operationName"]);return o!=null&&d(t,["_url","operationName"],o),t}function S_(n){const t={},o=u(n,["operationName"]);return o!=null&&d(t,["_url","operationName"],o),t}function __(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["metadata"]);a!=null&&d(t,["metadata"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);c!=null&&d(t,["error"],c);const f=u(n,["response"]);return f!=null&&d(t,["response"],b_(f)),t}function b_(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["parent"]);a!=null&&d(t,["parent"],a);const s=u(n,["documentName"]);return s!=null&&d(t,["documentName"],s),t}function R0(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["metadata"]);a!=null&&d(t,["metadata"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);c!=null&&d(t,["error"],c);const f=u(n,["response"]);return f!=null&&d(t,["response"],C_(f)),t}function C_(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["parent"]);a!=null&&d(t,["parent"],a);const s=u(n,["documentName"]);return s!=null&&d(t,["documentName"],s),t}function N_(n){const t={},o=u(n,["uri"]);o!=null&&d(t,["uri"],o);const a=u(n,["encodedVideo"]);a!=null&&d(t,["videoBytes"],Dc(a));const s=u(n,["encoding"]);return s!=null&&d(t,["mimeType"],s),t}function A_(n){const t={},o=u(n,["gcsUri"]);o!=null&&d(t,["uri"],o);const a=u(n,["bytesBase64Encoded"]);a!=null&&d(t,["videoBytes"],Dc(a));const s=u(n,["mimeType"]);return s!=null&&d(t,["mimeType"],s),t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/var mh;(function(n){n.OUTCOME_UNSPECIFIED="OUTCOME_UNSPECIFIED",n.OUTCOME_OK="OUTCOME_OK",n.OUTCOME_FAILED="OUTCOME_FAILED",n.OUTCOME_DEADLINE_EXCEEDED="OUTCOME_DEADLINE_EXCEEDED"})(mh||(mh={}));var ph;(function(n){n.LANGUAGE_UNSPECIFIED="LANGUAGE_UNSPECIFIED",n.PYTHON="PYTHON"})(ph||(ph={}));var hh;(function(n){n.SCHEDULING_UNSPECIFIED="SCHEDULING_UNSPECIFIED",n.SILENT="SILENT",n.WHEN_IDLE="WHEN_IDLE",n.INTERRUPT="INTERRUPT"})(hh||(hh={}));var Wn;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.STRING="STRING",n.NUMBER="NUMBER",n.INTEGER="INTEGER",n.BOOLEAN="BOOLEAN",n.ARRAY="ARRAY",n.OBJECT="OBJECT",n.NULL="NULL"})(Wn||(Wn={}));var gh;(function(n){n.API_SPEC_UNSPECIFIED="API_SPEC_UNSPECIFIED",n.SIMPLE_SEARCH="SIMPLE_SEARCH",n.ELASTIC_SEARCH="ELASTIC_SEARCH"})(gh||(gh={}));var yh;(function(n){n.AUTH_TYPE_UNSPECIFIED="AUTH_TYPE_UNSPECIFIED",n.NO_AUTH="NO_AUTH",n.API_KEY_AUTH="API_KEY_AUTH",n.HTTP_BASIC_AUTH="HTTP_BASIC_AUTH",n.GOOGLE_SERVICE_ACCOUNT_AUTH="GOOGLE_SERVICE_ACCOUNT_AUTH",n.OAUTH="OAUTH",n.OIDC_AUTH="OIDC_AUTH"})(yh||(yh={}));var vh;(function(n){n.HTTP_IN_UNSPECIFIED="HTTP_IN_UNSPECIFIED",n.HTTP_IN_QUERY="HTTP_IN_QUERY",n.HTTP_IN_HEADER="HTTP_IN_HEADER",n.HTTP_IN_PATH="HTTP_IN_PATH",n.HTTP_IN_BODY="HTTP_IN_BODY",n.HTTP_IN_COOKIE="HTTP_IN_COOKIE"})(vh||(vh={}));var xh;(function(n){n.PHISH_BLOCK_THRESHOLD_UNSPECIFIED="PHISH_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_HIGH_AND_ABOVE="BLOCK_HIGH_AND_ABOVE",n.BLOCK_HIGHER_AND_ABOVE="BLOCK_HIGHER_AND_ABOVE",n.BLOCK_VERY_HIGH_AND_ABOVE="BLOCK_VERY_HIGH_AND_ABOVE",n.BLOCK_ONLY_EXTREMELY_HIGH="BLOCK_ONLY_EXTREMELY_HIGH"})(xh||(xh={}));var Eh;(function(n){n.UNSPECIFIED="UNSPECIFIED",n.BLOCKING="BLOCKING",n.NON_BLOCKING="NON_BLOCKING"})(Eh||(Eh={}));var Th;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.MODE_DYNAMIC="MODE_DYNAMIC"})(Th||(Th={}));var Sh;(function(n){n.MODE_UNSPECIFIED="MODE_UNSPECIFIED",n.AUTO="AUTO",n.ANY="ANY",n.NONE="NONE",n.VALIDATED="VALIDATED"})(Sh||(Sh={}));var _h;(function(n){n.THINKING_LEVEL_UNSPECIFIED="THINKING_LEVEL_UNSPECIFIED",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH",n.MINIMAL="MINIMAL"})(_h||(_h={}));var bh;(function(n){n.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",n.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",n.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",n.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",n.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY",n.HARM_CATEGORY_IMAGE_HATE="HARM_CATEGORY_IMAGE_HATE",n.HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT="HARM_CATEGORY_IMAGE_DANGEROUS_CONTENT",n.HARM_CATEGORY_IMAGE_HARASSMENT="HARM_CATEGORY_IMAGE_HARASSMENT",n.HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT="HARM_CATEGORY_IMAGE_SEXUALLY_EXPLICIT",n.HARM_CATEGORY_JAILBREAK="HARM_CATEGORY_JAILBREAK"})(bh||(bh={}));var Ch;(function(n){n.HARM_BLOCK_METHOD_UNSPECIFIED="HARM_BLOCK_METHOD_UNSPECIFIED",n.SEVERITY="SEVERITY",n.PROBABILITY="PROBABILITY"})(Ch||(Ch={}));var Nh;(function(n){n.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE",n.OFF="OFF"})(Nh||(Nh={}));var Ah;(function(n){n.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",n.STOP="STOP",n.MAX_TOKENS="MAX_TOKENS",n.SAFETY="SAFETY",n.RECITATION="RECITATION",n.LANGUAGE="LANGUAGE",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.SPII="SPII",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.IMAGE_SAFETY="IMAGE_SAFETY",n.UNEXPECTED_TOOL_CALL="UNEXPECTED_TOOL_CALL",n.IMAGE_PROHIBITED_CONTENT="IMAGE_PROHIBITED_CONTENT",n.NO_IMAGE="NO_IMAGE",n.IMAGE_RECITATION="IMAGE_RECITATION",n.IMAGE_OTHER="IMAGE_OTHER"})(Ah||(Ah={}));var wh;(function(n){n.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",n.NEGLIGIBLE="NEGLIGIBLE",n.LOW="LOW",n.MEDIUM="MEDIUM",n.HIGH="HIGH"})(wh||(wh={}));var Rh;(function(n){n.HARM_SEVERITY_UNSPECIFIED="HARM_SEVERITY_UNSPECIFIED",n.HARM_SEVERITY_NEGLIGIBLE="HARM_SEVERITY_NEGLIGIBLE",n.HARM_SEVERITY_LOW="HARM_SEVERITY_LOW",n.HARM_SEVERITY_MEDIUM="HARM_SEVERITY_MEDIUM",n.HARM_SEVERITY_HIGH="HARM_SEVERITY_HIGH"})(Rh||(Rh={}));var Mh;(function(n){n.URL_RETRIEVAL_STATUS_UNSPECIFIED="URL_RETRIEVAL_STATUS_UNSPECIFIED",n.URL_RETRIEVAL_STATUS_SUCCESS="URL_RETRIEVAL_STATUS_SUCCESS",n.URL_RETRIEVAL_STATUS_ERROR="URL_RETRIEVAL_STATUS_ERROR",n.URL_RETRIEVAL_STATUS_PAYWALL="URL_RETRIEVAL_STATUS_PAYWALL",n.URL_RETRIEVAL_STATUS_UNSAFE="URL_RETRIEVAL_STATUS_UNSAFE"})(Mh||(Mh={}));var Ih;(function(n){n.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",n.SAFETY="SAFETY",n.OTHER="OTHER",n.BLOCKLIST="BLOCKLIST",n.PROHIBITED_CONTENT="PROHIBITED_CONTENT",n.IMAGE_SAFETY="IMAGE_SAFETY",n.MODEL_ARMOR="MODEL_ARMOR",n.JAILBREAK="JAILBREAK"})(Ih||(Ih={}));var Dh;(function(n){n.TRAFFIC_TYPE_UNSPECIFIED="TRAFFIC_TYPE_UNSPECIFIED",n.ON_DEMAND="ON_DEMAND",n.PROVISIONED_THROUGHPUT="PROVISIONED_THROUGHPUT"})(Dh||(Dh={}));var ts;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.AUDIO="AUDIO"})(ts||(ts={}));var Uh;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH"})(Uh||(Uh={}));var Lh;(function(n){n.TUNING_MODE_UNSPECIFIED="TUNING_MODE_UNSPECIFIED",n.TUNING_MODE_FULL="TUNING_MODE_FULL",n.TUNING_MODE_PEFT_ADAPTER="TUNING_MODE_PEFT_ADAPTER"})(Lh||(Lh={}));var kh;(function(n){n.ADAPTER_SIZE_UNSPECIFIED="ADAPTER_SIZE_UNSPECIFIED",n.ADAPTER_SIZE_ONE="ADAPTER_SIZE_ONE",n.ADAPTER_SIZE_TWO="ADAPTER_SIZE_TWO",n.ADAPTER_SIZE_FOUR="ADAPTER_SIZE_FOUR",n.ADAPTER_SIZE_EIGHT="ADAPTER_SIZE_EIGHT",n.ADAPTER_SIZE_SIXTEEN="ADAPTER_SIZE_SIXTEEN",n.ADAPTER_SIZE_THIRTY_TWO="ADAPTER_SIZE_THIRTY_TWO"})(kh||(kh={}));var ic;(function(n){n.JOB_STATE_UNSPECIFIED="JOB_STATE_UNSPECIFIED",n.JOB_STATE_QUEUED="JOB_STATE_QUEUED",n.JOB_STATE_PENDING="JOB_STATE_PENDING",n.JOB_STATE_RUNNING="JOB_STATE_RUNNING",n.JOB_STATE_SUCCEEDED="JOB_STATE_SUCCEEDED",n.JOB_STATE_FAILED="JOB_STATE_FAILED",n.JOB_STATE_CANCELLING="JOB_STATE_CANCELLING",n.JOB_STATE_CANCELLED="JOB_STATE_CANCELLED",n.JOB_STATE_PAUSED="JOB_STATE_PAUSED",n.JOB_STATE_EXPIRED="JOB_STATE_EXPIRED",n.JOB_STATE_UPDATING="JOB_STATE_UPDATING",n.JOB_STATE_PARTIALLY_SUCCEEDED="JOB_STATE_PARTIALLY_SUCCEEDED"})(ic||(ic={}));var Ph;(function(n){n.TUNING_TASK_UNSPECIFIED="TUNING_TASK_UNSPECIFIED",n.TUNING_TASK_I2V="TUNING_TASK_I2V",n.TUNING_TASK_T2V="TUNING_TASK_T2V",n.TUNING_TASK_R2V="TUNING_TASK_R2V"})(Ph||(Ph={}));var Gh;(function(n){n.MEDIA_RESOLUTION_UNSPECIFIED="MEDIA_RESOLUTION_UNSPECIFIED",n.MEDIA_RESOLUTION_LOW="MEDIA_RESOLUTION_LOW",n.MEDIA_RESOLUTION_MEDIUM="MEDIA_RESOLUTION_MEDIUM",n.MEDIA_RESOLUTION_HIGH="MEDIA_RESOLUTION_HIGH",n.MEDIA_RESOLUTION_ULTRA_HIGH="MEDIA_RESOLUTION_ULTRA_HIGH"})(Gh||(Gh={}));var oc;(function(n){n.COLLECTION="COLLECTION"})(oc||(oc={}));var qh;(function(n){n.FEATURE_SELECTION_PREFERENCE_UNSPECIFIED="FEATURE_SELECTION_PREFERENCE_UNSPECIFIED",n.PRIORITIZE_QUALITY="PRIORITIZE_QUALITY",n.BALANCED="BALANCED",n.PRIORITIZE_COST="PRIORITIZE_COST"})(qh||(qh={}));var Vh;(function(n){n.ENVIRONMENT_UNSPECIFIED="ENVIRONMENT_UNSPECIFIED",n.ENVIRONMENT_BROWSER="ENVIRONMENT_BROWSER"})(Vh||(Vh={}));var ns;(function(n){n.PREDICT="PREDICT",n.EMBED_CONTENT="EMBED_CONTENT"})(ns||(ns={}));var Hh;(function(n){n.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",n.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",n.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",n.BLOCK_NONE="BLOCK_NONE"})(Hh||(Hh={}));var zh;(function(n){n.DONT_ALLOW="DONT_ALLOW",n.ALLOW_ADULT="ALLOW_ADULT",n.ALLOW_ALL="ALLOW_ALL"})(zh||(zh={}));var Oh;(function(n){n.auto="auto",n.en="en",n.ja="ja",n.ko="ko",n.hi="hi",n.zh="zh",n.pt="pt",n.es="es"})(Oh||(Oh={}));var Bh;(function(n){n.MASK_MODE_DEFAULT="MASK_MODE_DEFAULT",n.MASK_MODE_USER_PROVIDED="MASK_MODE_USER_PROVIDED",n.MASK_MODE_BACKGROUND="MASK_MODE_BACKGROUND",n.MASK_MODE_FOREGROUND="MASK_MODE_FOREGROUND",n.MASK_MODE_SEMANTIC="MASK_MODE_SEMANTIC"})(Bh||(Bh={}));var Fh;(function(n){n.CONTROL_TYPE_DEFAULT="CONTROL_TYPE_DEFAULT",n.CONTROL_TYPE_CANNY="CONTROL_TYPE_CANNY",n.CONTROL_TYPE_SCRIBBLE="CONTROL_TYPE_SCRIBBLE",n.CONTROL_TYPE_FACE_MESH="CONTROL_TYPE_FACE_MESH"})(Fh||(Fh={}));var Jh;(function(n){n.SUBJECT_TYPE_DEFAULT="SUBJECT_TYPE_DEFAULT",n.SUBJECT_TYPE_PERSON="SUBJECT_TYPE_PERSON",n.SUBJECT_TYPE_ANIMAL="SUBJECT_TYPE_ANIMAL",n.SUBJECT_TYPE_PRODUCT="SUBJECT_TYPE_PRODUCT"})(Jh||(Jh={}));var Yh;(function(n){n.EDIT_MODE_DEFAULT="EDIT_MODE_DEFAULT",n.EDIT_MODE_INPAINT_REMOVAL="EDIT_MODE_INPAINT_REMOVAL",n.EDIT_MODE_INPAINT_INSERTION="EDIT_MODE_INPAINT_INSERTION",n.EDIT_MODE_OUTPAINT="EDIT_MODE_OUTPAINT",n.EDIT_MODE_CONTROLLED_EDITING="EDIT_MODE_CONTROLLED_EDITING",n.EDIT_MODE_STYLE="EDIT_MODE_STYLE",n.EDIT_MODE_BGSWAP="EDIT_MODE_BGSWAP",n.EDIT_MODE_PRODUCT_IMAGE="EDIT_MODE_PRODUCT_IMAGE"})(Yh||(Yh={}));var jh;(function(n){n.FOREGROUND="FOREGROUND",n.BACKGROUND="BACKGROUND",n.PROMPT="PROMPT",n.SEMANTIC="SEMANTIC",n.INTERACTIVE="INTERACTIVE"})(jh||(jh={}));var Kh;(function(n){n.ASSET="ASSET",n.STYLE="STYLE"})(Kh||(Kh={}));var Xh;(function(n){n.INSERT="INSERT",n.REMOVE="REMOVE",n.REMOVE_STATIC="REMOVE_STATIC",n.OUTPAINT="OUTPAINT"})(Xh||(Xh={}));var $h;(function(n){n.OPTIMIZED="OPTIMIZED",n.LOSSLESS="LOSSLESS"})($h||($h={}));var Qh;(function(n){n.SUPERVISED_FINE_TUNING="SUPERVISED_FINE_TUNING",n.PREFERENCE_TUNING="PREFERENCE_TUNING",n.DISTILLATION="DISTILLATION"})(Qh||(Qh={}));var Zh;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.STATE_PENDING="STATE_PENDING",n.STATE_ACTIVE="STATE_ACTIVE",n.STATE_FAILED="STATE_FAILED"})(Zh||(Zh={}));var Wh;(function(n){n.STATE_UNSPECIFIED="STATE_UNSPECIFIED",n.PROCESSING="PROCESSING",n.ACTIVE="ACTIVE",n.FAILED="FAILED"})(Wh||(Wh={}));var eg;(function(n){n.SOURCE_UNSPECIFIED="SOURCE_UNSPECIFIED",n.UPLOADED="UPLOADED",n.GENERATED="GENERATED",n.REGISTERED="REGISTERED"})(eg||(eg={}));var tg;(function(n){n.TURN_COMPLETE_REASON_UNSPECIFIED="TURN_COMPLETE_REASON_UNSPECIFIED",n.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",n.RESPONSE_REJECTED="RESPONSE_REJECTED",n.NEED_MORE_INPUT="NEED_MORE_INPUT"})(tg||(tg={}));var ng;(function(n){n.MODALITY_UNSPECIFIED="MODALITY_UNSPECIFIED",n.TEXT="TEXT",n.IMAGE="IMAGE",n.VIDEO="VIDEO",n.AUDIO="AUDIO",n.DOCUMENT="DOCUMENT"})(ng||(ng={}));var ig;(function(n){n.VAD_SIGNAL_TYPE_UNSPECIFIED="VAD_SIGNAL_TYPE_UNSPECIFIED",n.VAD_SIGNAL_TYPE_SOS="VAD_SIGNAL_TYPE_SOS",n.VAD_SIGNAL_TYPE_EOS="VAD_SIGNAL_TYPE_EOS"})(ig||(ig={}));var og;(function(n){n.TYPE_UNSPECIFIED="TYPE_UNSPECIFIED",n.ACTIVITY_START="ACTIVITY_START",n.ACTIVITY_END="ACTIVITY_END"})(og||(og={}));var lg;(function(n){n.START_SENSITIVITY_UNSPECIFIED="START_SENSITIVITY_UNSPECIFIED",n.START_SENSITIVITY_HIGH="START_SENSITIVITY_HIGH",n.START_SENSITIVITY_LOW="START_SENSITIVITY_LOW"})(lg||(lg={}));var ag;(function(n){n.END_SENSITIVITY_UNSPECIFIED="END_SENSITIVITY_UNSPECIFIED",n.END_SENSITIVITY_HIGH="END_SENSITIVITY_HIGH",n.END_SENSITIVITY_LOW="END_SENSITIVITY_LOW"})(ag||(ag={}));var sg;(function(n){n.ACTIVITY_HANDLING_UNSPECIFIED="ACTIVITY_HANDLING_UNSPECIFIED",n.START_OF_ACTIVITY_INTERRUPTS="START_OF_ACTIVITY_INTERRUPTS",n.NO_INTERRUPTION="NO_INTERRUPTION"})(sg||(sg={}));var rg;(function(n){n.TURN_COVERAGE_UNSPECIFIED="TURN_COVERAGE_UNSPECIFIED",n.TURN_INCLUDES_ONLY_ACTIVITY="TURN_INCLUDES_ONLY_ACTIVITY",n.TURN_INCLUDES_ALL_INPUT="TURN_INCLUDES_ALL_INPUT"})(rg||(rg={}));var ug;(function(n){n.SCALE_UNSPECIFIED="SCALE_UNSPECIFIED",n.C_MAJOR_A_MINOR="C_MAJOR_A_MINOR",n.D_FLAT_MAJOR_B_FLAT_MINOR="D_FLAT_MAJOR_B_FLAT_MINOR",n.D_MAJOR_B_MINOR="D_MAJOR_B_MINOR",n.E_FLAT_MAJOR_C_MINOR="E_FLAT_MAJOR_C_MINOR",n.E_MAJOR_D_FLAT_MINOR="E_MAJOR_D_FLAT_MINOR",n.F_MAJOR_D_MINOR="F_MAJOR_D_MINOR",n.G_FLAT_MAJOR_E_FLAT_MINOR="G_FLAT_MAJOR_E_FLAT_MINOR",n.G_MAJOR_E_MINOR="G_MAJOR_E_MINOR",n.A_FLAT_MAJOR_F_MINOR="A_FLAT_MAJOR_F_MINOR",n.A_MAJOR_G_FLAT_MINOR="A_MAJOR_G_FLAT_MINOR",n.B_FLAT_MAJOR_G_MINOR="B_FLAT_MAJOR_G_MINOR",n.B_MAJOR_A_FLAT_MINOR="B_MAJOR_A_FLAT_MINOR"})(ug||(ug={}));var cg;(function(n){n.MUSIC_GENERATION_MODE_UNSPECIFIED="MUSIC_GENERATION_MODE_UNSPECIFIED",n.QUALITY="QUALITY",n.DIVERSITY="DIVERSITY",n.VOCALIZATION="VOCALIZATION"})(cg||(cg={}));var ro;(function(n){n.PLAYBACK_CONTROL_UNSPECIFIED="PLAYBACK_CONTROL_UNSPECIFIED",n.PLAY="PLAY",n.PAUSE="PAUSE",n.STOP="STOP",n.RESET_CONTEXT="RESET_CONTEXT"})(ro||(ro={}));class lc{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 hl{get text(){var t,o,a,s,c,f,h,y;if(((s=(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||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning text from the first one.");let p="",x=!1;const E=[];for(const S of(y=(h=(f=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||f===void 0?void 0:f.content)===null||h===void 0?void 0:h.parts)!==null&&y!==void 0?y:[]){for(const[b,C]of Object.entries(S))b!=="text"&&b!=="thought"&&b!=="thoughtSignature"&&(C!==null||C!==void 0)&&E.push(b);if(typeof S.text=="string"){if(typeof S.thought=="boolean"&&S.thought)continue;x=!0,p+=S.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.`),x?p:void 0}get data(){var t,o,a,s,c,f,h,y;if(((s=(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||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning data from the first one.");let p="";const x=[];for(const E of(y=(h=(f=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||f===void 0?void 0:f.content)===null||h===void 0?void 0:h.parts)!==null&&y!==void 0?y:[]){for(const[S,b]of Object.entries(E))S!=="inlineData"&&(b!==null||b!==void 0)&&x.push(S);E.inlineData&&typeof E.inlineData.data=="string"&&(p+=atob(E.inlineData.data))}return x.length>0&&console.warn(`there are non-data parts ${x} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),p.length>0?btoa(p):void 0}get functionCalls(){var t,o,a,s,c,f,h,y;if(((s=(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||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning function calls from the first one.");const p=(y=(h=(f=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||f===void 0?void 0:f.content)===null||h===void 0?void 0:h.parts)===null||y===void 0?void 0:y.filter(x=>x.functionCall).map(x=>x.functionCall).filter(x=>x!==void 0);if((p==null?void 0:p.length)!==0)return p}get executableCode(){var t,o,a,s,c,f,h,y,p;if(((s=(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||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning executable code from the first one.");const x=(y=(h=(f=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||f===void 0?void 0:f.content)===null||h===void 0?void 0:h.parts)===null||y===void 0?void 0:y.filter(E=>E.executableCode).map(E=>E.executableCode).filter(E=>E!==void 0);if((x==null?void 0:x.length)!==0)return(p=x==null?void 0:x[0])===null||p===void 0?void 0:p.code}get codeExecutionResult(){var t,o,a,s,c,f,h,y,p;if(((s=(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||s===void 0?void 0:s.length)===0)return;this.candidates&&this.candidates.length>1&&console.warn("there are multiple candidates in the response, returning code execution result from the first one.");const x=(y=(h=(f=(c=this.candidates)===null||c===void 0?void 0:c[0])===null||f===void 0?void 0:f.content)===null||h===void 0?void 0:h.parts)===null||y===void 0?void 0:y.filter(E=>E.codeExecutionResult).map(E=>E.codeExecutionResult).filter(E=>E!==void 0);if((x==null?void 0:x.length)!==0)return(p=x==null?void 0:x[0])===null||p===void 0?void 0:p.output}}class dg{}class fg{}class w_{}class R_{}class M_{}class I_{}class mg{}class pg{}class hg{}class D_{}class is{_fromAPIResponse({apiResponse:t,_isVertexAI:o}){const a=new is;let s;const c=t;return o?s=g_(c):s=h_(c),Object.assign(a,s),a}}class gg{}class yg{}class vg{}class xg{}class U_{}class L_{}class k_{}class Uc{_fromAPIResponse({apiResponse:t,_isVertexAI:o}){const a=new Uc,c=__(t);return Object.assign(a,c),a}}class P_{}class G_{}class q_{}class V_{}class Eg{}class H_{get text(){var t,o,a;let s="",c=!1;const f=[];for(const h 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,p]of Object.entries(h))y!=="text"&&y!=="thought"&&p!==null&&f.push(y);if(typeof h.text=="string"){if(typeof h.thought=="boolean"&&h.thought)continue;c=!0,s+=h.text}}return f.length>0&&console.warn(`there are non-text parts ${f} in the response, returning concatenation of all text parts. Please refer to the non text parts for a full response from model.`),c?s:void 0}get data(){var t,o,a;let s="";const c=[];for(const f 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[h,y]of Object.entries(f))h!=="inlineData"&&y!==null&&c.push(h);f.inlineData&&typeof f.inlineData.data=="string"&&(s+=atob(f.inlineData.data))}return c.length>0&&console.warn(`there are non-data parts ${c} in the response, returning concatenation of all data parts. Please refer to the non data parts for a full response from model.`),s.length>0?btoa(s):void 0}}class z_{get audioChunk(){if(this.serverContent&&this.serverContent.audioChunks&&this.serverContent.audioChunks.length>0)return this.serverContent.audioChunks[0]}}class Lc{_fromAPIResponse({apiResponse:t,_isVertexAI:o}){const a=new Lc,c=R0(t);return Object.assign(a,c),a}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function _e(n,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(n.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 M0(n,t){const o=_e(n,t);return o?o.startsWith("publishers/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/${o}`:o.startsWith("models/")&&n.isVertexAI()?`projects/${n.getProject()}/locations/${n.getLocation()}/publishers/google/${o}`:o:""}function I0(n){return Array.isArray(n)?n.map(t=>os(t)):[os(n)]}function os(n){if(typeof n=="object"&&n!==null)return n;throw new Error(`Could not parse input as Blob. Unsupported blob type: ${typeof n}`)}function D0(n){const t=os(n);if(t.mimeType&&t.mimeType.startsWith("image/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function U0(n){const t=os(n);if(t.mimeType&&t.mimeType.startsWith("audio/"))return t;throw new Error(`Unsupported mime type: ${t.mimeType}`)}function Tg(n){if(n==null)throw new Error("PartUnion is required");if(typeof n=="object")return n;if(typeof n=="string")return{text:n};throw new Error(`Unsupported part type: ${typeof n}`)}function L0(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("PartListUnion is required");return Array.isArray(n)?n.map(t=>Tg(t)):[Tg(n)]}function ac(n){return n!=null&&typeof n=="object"&&"parts"in n&&Array.isArray(n.parts)}function Sg(n){return n!=null&&typeof n=="object"&&"functionCall"in n}function _g(n){return n!=null&&typeof n=="object"&&"functionResponse"in n}function tt(n){if(n==null)throw new Error("ContentUnion is required");return ac(n)?n:{role:"user",parts:L0(n)}}function kc(n,t){if(!t)return[];if(n.isVertexAI()&&Array.isArray(t))return t.flatMap(o=>{const a=tt(o);return a.parts&&a.parts.length>0&&a.parts[0].text!==void 0?[a.parts[0].text]:[]});if(n.isVertexAI()){const o=tt(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=>tt(o)):[tt(t)]}function Mt(n){if(n==null||Array.isArray(n)&&n.length===0)throw new Error("contents are required");if(!Array.isArray(n)){if(Sg(n)||_g(n))throw new Error("To specify functionCall or functionResponse parts, please wrap them in a Content object, specifying the role for them");return[tt(n)]}const t=[],o=[],a=ac(n[0]);for(const s of n){const c=ac(s);if(c!=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(c)t.push(s);else{if(Sg(s)||_g(s))throw new Error("To specify functionCall or functionResponse parts, please wrap them, and any other parts, in Content objects as appropriate, specifying the role for them");o.push(s)}}return a||t.push({role:"user",parts:L0(o)}),t}function O_(n,t){n.includes("null")&&(t.nullable=!0);const o=n.filter(a=>a!=="null");if(o.length===1)t.type=Object.values(Wn).includes(o[0].toUpperCase())?o[0].toUpperCase():Wn.TYPE_UNSPECIFIED;else{t.anyOf=[];for(const a of o)t.anyOf.push({type:Object.values(Wn).includes(a.toUpperCase())?a.toUpperCase():Wn.TYPE_UNSPECIFIED})}}function co(n){const t={},o=["items"],a=["anyOf"],s=["properties"];if(n.type&&n.anyOf)throw new Error("type and anyOf cannot be both populated.");const c=n.anyOf;c!=null&&c.length==2&&(c[0].type==="null"?(t.nullable=!0,n=c[1]):c[1].type==="null"&&(t.nullable=!0,n=c[0])),n.type instanceof Array&&O_(n.type,t);for(const[f,h]of Object.entries(n))if(h!=null)if(f=="type"){if(h==="null")throw new Error("type: null can not be the only possible type for the field.");if(h instanceof Array)continue;t.type=Object.values(Wn).includes(h.toUpperCase())?h.toUpperCase():Wn.TYPE_UNSPECIFIED}else if(o.includes(f))t[f]=co(h);else if(a.includes(f)){const y=[];for(const p of h){if(p.type=="null"){t.nullable=!0;continue}y.push(co(p))}t[f]=y}else if(s.includes(f)){const y={};for(const[p,x]of Object.entries(h))y[p]=co(x);t[f]=y}else{if(f==="additionalProperties")continue;t[f]=h}return t}function Pc(n){return co(n)}function Gc(n){if(typeof n=="object")return n;if(typeof n=="string")return{voiceConfig:{prebuiltVoiceConfig:{voiceName:n}}};throw new Error(`Unsupported speechConfig type: ${typeof n}`)}function qc(n){if("multiSpeakerVoiceConfig"in n)throw new Error("multiSpeakerVoiceConfig is not supported in the live API.");return n}function ho(n){if(n.functionDeclarations)for(const t of n.functionDeclarations)t.parameters&&(Object.keys(t.parameters).includes("$schema")?t.parametersJsonSchema||(t.parametersJsonSchema=t.parameters,delete t.parameters):t.parameters=co(t.parameters)),t.response&&(Object.keys(t.response).includes("$schema")?t.responseJsonSchema||(t.responseJsonSchema=t.response,delete t.response):t.response=co(t.response));return n}function go(n){if(n==null)throw new Error("tools is required");if(!Array.isArray(n))throw new Error("tools is required and must be an array of Tools");const t=[];for(const o of n)t.push(o);return t}function B_(n,t,o,a=1){const s=!t.startsWith(`${o}/`)&&t.split("/").length===a;return n.isVertexAI()?t.startsWith("projects/")?t:t.startsWith("locations/")?`projects/${n.getProject()}/${t}`:t.startsWith(`${o}/`)?`projects/${n.getProject()}/locations/${n.getLocation()}/${t}`:s?`projects/${n.getProject()}/locations/${n.getLocation()}/${o}/${t}`:t:s?`${o}/${t}`:t}function An(n,t){if(typeof t!="string")throw new Error("name must be a string");return B_(n,t,"cachedContents")}function k0(n){switch(n){case"STATE_UNSPECIFIED":return"JOB_STATE_UNSPECIFIED";case"CREATING":return"JOB_STATE_RUNNING";case"ACTIVE":return"JOB_STATE_SUCCEEDED";case"FAILED":return"JOB_STATE_FAILED";default:return n}}function ei(n){return Dc(n)}function F_(n){return n!=null&&typeof n=="object"&&"name"in n}function J_(n){return n!=null&&typeof n=="object"&&"video"in n}function Y_(n){return n!=null&&typeof n=="object"&&"uri"in n}function P0(n){var t;let o;if(F_(n)&&(o=n.name),!(Y_(n)&&(o=n.uri,o===void 0))&&!(J_(n)&&(o=(t=n.video)===null||t===void 0?void 0:t.uri,o===void 0))){if(typeof n=="string"&&(o=n),o===void 0)throw new Error("Could not extract file name from the provided input.");if(o.startsWith("https://")){const s=o.split("files/")[1].match(/[a-z0-9]+/);if(s===null)throw new Error(`Could not extract file name from URI ${o}`);o=s[0]}else o.startsWith("files/")&&(o=o.split("files/")[1]);return o}}function G0(n,t){let o;return n.isVertexAI()?o=t?"publishers/google/models":"models":o=t?"models":"tunedModels",o}function q0(n){for(const t of["models","tunedModels","publisherModels"])if(j_(n,t))return n[t];return[]}function j_(n,t){return n!==null&&typeof n=="object"&&t in n}function K_(n,t={}){const o=n,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 X_(n,t={}){const o=[],a=new Set;for(const s of n){const c=s.name;if(a.has(c))throw new Error(`Duplicate function name ${c} found in MCP tools. Please ensure function names are unique.`);a.add(c);const f=K_(s,t);f.functionDeclarations&&o.push(...f.functionDeclarations)}return{functionDeclarations:o}}function V0(n,t){let o;if(typeof t=="string")if(n.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(n.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,s=[o.inlinedRequests,o.fileName].filter(Boolean).length;if(n.isVertexAI()){if(s>0||a!==1)throw new Error("Exactly one of `gcsUri` or `bigqueryUri` must be set for Vertex AI.")}else if(a>0||s!==1)throw new Error("Exactly one of `inlinedRequests`, `fileName`, must be set for Gemini API.");return o}function $_(n){if(typeof n!="string")return n;const t=n;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 H0(n){if(typeof n!="object"||n===null)return{};const t=n,o=t.inlinedResponses;if(typeof o!="object"||o===null)return n;const s=o.inlinedResponses;if(!Array.isArray(s)||s.length===0)return n;let c=!1;for(const f of s){if(typeof f!="object"||f===null)continue;const y=f.response;if(typeof y!="object"||y===null)continue;if(y.embedding!==void 0){c=!0;break}}return c&&(t.inlinedEmbedContentResponses=t.inlinedResponses,delete t.inlinedResponses),n}function yo(n,t){const o=t;if(!n.isVertexAI()){if(/batches\/[^/]+$/.test(o))return o.split("/").pop();throw new Error(`Invalid batch job name: ${o}.`)}if(/^projects\/[^/]+\/locations\/[^/]+\/batchPredictionJobs\/[^/]+$/.test(o))return o.split("/").pop();if(/^\d+$/.test(o))return o;throw new Error(`Invalid batch job name: ${o}.`)}function z0(n){const t=n;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 Q_(n){return n.includes("gemini")&&n!=="gemini-embedding-001"||n.includes("maas")}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Z_(n){const t={},o=u(n,["responsesFile"]);o!=null&&d(t,["fileName"],o);const a=u(n,["inlinedResponses","inlinedResponses"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(f=>Db(f))),d(t,["inlinedResponses"],c)}const s=u(n,["inlinedEmbedContentResponses","inlinedResponses"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["inlinedEmbedContentResponses"],c)}return t}function W_(n){const t={},o=u(n,["predictionsFormat"]);o!=null&&d(t,["format"],o);const a=u(n,["gcsDestination","outputUriPrefix"]);a!=null&&d(t,["gcsUri"],a);const s=u(n,["bigqueryDestination","outputUri"]);return s!=null&&d(t,["bigqueryUri"],s),t}function eb(n){const t={},o=u(n,["format"]);o!=null&&d(t,["predictionsFormat"],o);const a=u(n,["gcsUri"]);a!=null&&d(t,["gcsDestination","outputUriPrefix"],a);const s=u(n,["bigqueryUri"]);if(s!=null&&d(t,["bigqueryDestination","outputUri"],s),u(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(u(n,["inlinedResponses"])!==void 0)throw new Error("inlinedResponses parameter is not supported in Vertex AI.");if(u(n,["inlinedEmbedContentResponses"])!==void 0)throw new Error("inlinedEmbedContentResponses parameter is not supported in Vertex AI.");return t}function Za(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["metadata","displayName"]);a!=null&&d(t,["displayName"],a);const s=u(n,["metadata","state"]);s!=null&&d(t,["state"],z0(s));const c=u(n,["metadata","createTime"]);c!=null&&d(t,["createTime"],c);const f=u(n,["metadata","endTime"]);f!=null&&d(t,["endTime"],f);const h=u(n,["metadata","updateTime"]);h!=null&&d(t,["updateTime"],h);const y=u(n,["metadata","model"]);y!=null&&d(t,["model"],y);const p=u(n,["metadata","output"]);return p!=null&&d(t,["dest"],Z_(H0(p))),t}function sc(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["displayName"]);a!=null&&d(t,["displayName"],a);const s=u(n,["state"]);s!=null&&d(t,["state"],z0(s));const c=u(n,["error"]);c!=null&&d(t,["error"],c);const f=u(n,["createTime"]);f!=null&&d(t,["createTime"],f);const h=u(n,["startTime"]);h!=null&&d(t,["startTime"],h);const y=u(n,["endTime"]);y!=null&&d(t,["endTime"],y);const p=u(n,["updateTime"]);p!=null&&d(t,["updateTime"],p);const x=u(n,["model"]);x!=null&&d(t,["model"],x);const E=u(n,["inputConfig"]);E!=null&&d(t,["src"],tb(E));const S=u(n,["outputConfig"]);S!=null&&d(t,["dest"],W_(H0(S)));const b=u(n,["completionStats"]);return b!=null&&d(t,["completionStats"],b),t}function tb(n){const t={},o=u(n,["instancesFormat"]);o!=null&&d(t,["format"],o);const a=u(n,["gcsSource","uris"]);a!=null&&d(t,["gcsUri"],a);const s=u(n,["bigquerySource","inputUri"]);return s!=null&&d(t,["bigqueryUri"],s),t}function nb(n,t){const o={};if(u(t,["format"])!==void 0)throw new Error("format parameter is not supported in Gemini API.");if(u(t,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(u(t,["bigqueryUri"])!==void 0)throw new Error("bigqueryUri parameter is not supported in Gemini API.");const a=u(t,["fileName"]);a!=null&&d(o,["fileName"],a);const s=u(t,["inlinedRequests"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>Ib(n,f))),d(o,["requests","requests"],c)}return o}function ib(n){const t={},o=u(n,["format"]);o!=null&&d(t,["instancesFormat"],o);const a=u(n,["gcsUri"]);a!=null&&d(t,["gcsSource","uris"],a);const s=u(n,["bigqueryUri"]);if(s!=null&&d(t,["bigquerySource","inputUri"],s),u(n,["fileName"])!==void 0)throw new Error("fileName parameter is not supported in Vertex AI.");if(u(n,["inlinedRequests"])!==void 0)throw new Error("inlinedRequests parameter is not supported in Vertex AI.");return t}function ob(n){const t={},o=u(n,["data"]);if(o!=null&&d(t,["data"],o),u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function lb(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],yo(n,a)),o}function ab(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],yo(n,a)),o}function sb(n){const t={},o=u(n,["content"]);o!=null&&d(t,["content"],o);const a=u(n,["citationMetadata"]);a!=null&&d(t,["citationMetadata"],rb(a));const s=u(n,["tokenCount"]);s!=null&&d(t,["tokenCount"],s);const c=u(n,["finishReason"]);c!=null&&d(t,["finishReason"],c);const f=u(n,["avgLogprobs"]);f!=null&&d(t,["avgLogprobs"],f);const h=u(n,["groundingMetadata"]);h!=null&&d(t,["groundingMetadata"],h);const y=u(n,["index"]);y!=null&&d(t,["index"],y);const p=u(n,["logprobsResult"]);p!=null&&d(t,["logprobsResult"],p);const x=u(n,["safetyRatings"]);if(x!=null){let S=x;Array.isArray(S)&&(S=S.map(b=>b)),d(t,["safetyRatings"],S)}const E=u(n,["urlContextMetadata"]);return E!=null&&d(t,["urlContextMetadata"],E),t}function rb(n){const t={},o=u(n,["citationSources"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(s=>s)),d(t,["citations"],a)}return t}function O0(n){const t={},o=u(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>Vb(c))),d(t,["parts"],s)}const a=u(n,["role"]);return a!=null&&d(t,["role"],a),t}function ub(n,t){const o={},a=u(n,["displayName"]);if(t!==void 0&&a!=null&&d(t,["batch","displayName"],a),u(n,["dest"])!==void 0)throw new Error("dest parameter is not supported in Gemini API.");return o}function cb(n,t){const o={},a=u(n,["displayName"]);t!==void 0&&a!=null&&d(t,["displayName"],a);const s=u(n,["dest"]);return t!==void 0&&s!=null&&d(t,["outputConfig"],eb($_(s))),o}function bg(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["_url","model"],_e(n,a));const s=u(t,["src"]);s!=null&&d(o,["batch","inputConfig"],nb(n,V0(n,s)));const c=u(t,["config"]);return c!=null&&ub(c,o),o}function db(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["model"],_e(n,a));const s=u(t,["src"]);s!=null&&d(o,["inputConfig"],ib(V0(n,s)));const c=u(t,["config"]);return c!=null&&cb(c,o),o}function fb(n,t){const o={},a=u(n,["displayName"]);return t!==void 0&&a!=null&&d(t,["batch","displayName"],a),o}function mb(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["_url","model"],_e(n,a));const s=u(t,["src"]);s!=null&&d(o,["batch","inputConfig"],Eb(n,s));const c=u(t,["config"]);return c!=null&&fb(c,o),o}function pb(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],yo(n,a)),o}function hb(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],yo(n,a)),o}function gb(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["name"]);a!=null&&d(t,["name"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);return c!=null&&d(t,["error"],c),t}function yb(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["name"]);a!=null&&d(t,["name"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);return c!=null&&d(t,["error"],c),t}function vb(n,t){const o={},a=u(t,["contents"]);if(a!=null){let c=kc(n,a);Array.isArray(c)&&(c=c.map(f=>f)),d(o,["requests[]","request","content"],c)}const s=u(t,["config"]);return s!=null&&(d(o,["_self"],xb(s,o)),m_(o,{"requests[].*":"requests[].request.*"})),o}function xb(n,t){const o={},a=u(n,["taskType"]);t!==void 0&&a!=null&&d(t,["requests[]","taskType"],a);const s=u(n,["title"]);t!==void 0&&s!=null&&d(t,["requests[]","title"],s);const c=u(n,["outputDimensionality"]);if(t!==void 0&&c!=null&&d(t,["requests[]","outputDimensionality"],c),u(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(u(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return o}function Eb(n,t){const o={},a=u(t,["fileName"]);a!=null&&d(o,["file_name"],a);const s=u(t,["inlinedRequests"]);return s!=null&&d(o,["requests"],vb(n,s)),o}function Tb(n){const t={};if(u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=u(n,["fileUri"]);o!=null&&d(t,["fileUri"],o);const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function Sb(n){const t={},o=u(n,["id"]);o!=null&&d(t,["id"],o);const a=u(n,["args"]);a!=null&&d(t,["args"],a);const s=u(n,["name"]);if(s!=null&&d(t,["name"],s),u(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(u(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function _b(n){const t={},o=u(n,["allowedFunctionNames"]);o!=null&&d(t,["allowedFunctionNames"],o);const a=u(n,["mode"]);if(a!=null&&d(t,["mode"],a),u(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function bb(n,t,o){const a={},s=u(t,["systemInstruction"]);o!==void 0&&s!=null&&d(o,["systemInstruction"],O0(tt(s)));const c=u(t,["temperature"]);c!=null&&d(a,["temperature"],c);const f=u(t,["topP"]);f!=null&&d(a,["topP"],f);const h=u(t,["topK"]);h!=null&&d(a,["topK"],h);const y=u(t,["candidateCount"]);y!=null&&d(a,["candidateCount"],y);const p=u(t,["maxOutputTokens"]);p!=null&&d(a,["maxOutputTokens"],p);const x=u(t,["stopSequences"]);x!=null&&d(a,["stopSequences"],x);const E=u(t,["responseLogprobs"]);E!=null&&d(a,["responseLogprobs"],E);const S=u(t,["logprobs"]);S!=null&&d(a,["logprobs"],S);const b=u(t,["presencePenalty"]);b!=null&&d(a,["presencePenalty"],b);const C=u(t,["frequencyPenalty"]);C!=null&&d(a,["frequencyPenalty"],C);const I=u(t,["seed"]);I!=null&&d(a,["seed"],I);const w=u(t,["responseMimeType"]);w!=null&&d(a,["responseMimeType"],w);const G=u(t,["responseSchema"]);G!=null&&d(a,["responseSchema"],Pc(G));const V=u(t,["responseJsonSchema"]);if(V!=null&&d(a,["responseJsonSchema"],V),u(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(u(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const P=u(t,["safetySettings"]);if(o!==void 0&&P!=null){let Ve=P;Array.isArray(Ve)&&(Ve=Ve.map(ke=>Hb(ke))),d(o,["safetySettings"],Ve)}const Y=u(t,["tools"]);if(o!==void 0&&Y!=null){let Ve=go(Y);Array.isArray(Ve)&&(Ve=Ve.map(ke=>Ob(ho(ke)))),d(o,["tools"],Ve)}const X=u(t,["toolConfig"]);if(o!==void 0&&X!=null&&d(o,["toolConfig"],zb(X)),u(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const B=u(t,["cachedContent"]);o!==void 0&&B!=null&&d(o,["cachedContent"],An(n,B));const j=u(t,["responseModalities"]);j!=null&&d(a,["responseModalities"],j);const le=u(t,["mediaResolution"]);le!=null&&d(a,["mediaResolution"],le);const Z=u(t,["speechConfig"]);if(Z!=null&&d(a,["speechConfig"],Gc(Z)),u(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const ae=u(t,["thinkingConfig"]);ae!=null&&d(a,["thinkingConfig"],ae);const be=u(t,["imageConfig"]);be!=null&&d(a,["imageConfig"],Mb(be));const Re=u(t,["enableEnhancedCivicAnswers"]);if(Re!=null&&d(a,["enableEnhancedCivicAnswers"],Re),u(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return a}function Cb(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["candidates"]);if(a!=null){let y=a;Array.isArray(y)&&(y=y.map(p=>sb(p))),d(t,["candidates"],y)}const s=u(n,["modelVersion"]);s!=null&&d(t,["modelVersion"],s);const c=u(n,["promptFeedback"]);c!=null&&d(t,["promptFeedback"],c);const f=u(n,["responseId"]);f!=null&&d(t,["responseId"],f);const h=u(n,["usageMetadata"]);return h!=null&&d(t,["usageMetadata"],h),t}function Nb(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],yo(n,a)),o}function Ab(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],yo(n,a)),o}function wb(n){const t={};if(u(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const o=u(n,["enableWidget"]);return o!=null&&d(t,["enableWidget"],o),t}function Rb(n){const t={};if(u(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(u(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const o=u(n,["timeRangeFilter"]);return o!=null&&d(t,["timeRangeFilter"],o),t}function Mb(n){const t={},o=u(n,["aspectRatio"]);o!=null&&d(t,["aspectRatio"],o);const a=u(n,["imageSize"]);if(a!=null&&d(t,["imageSize"],a),u(n,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(u(n,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(u(n,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return t}function Ib(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["request","model"],_e(n,a));const s=u(t,["contents"]);if(s!=null){let h=Mt(s);Array.isArray(h)&&(h=h.map(y=>O0(y))),d(o,["request","contents"],h)}const c=u(t,["metadata"]);c!=null&&d(o,["metadata"],c);const f=u(t,["config"]);return f!=null&&d(o,["request","generationConfig"],bb(n,f,u(o,["request"],{}))),o}function Db(n){const t={},o=u(n,["response"]);o!=null&&d(t,["response"],Cb(o));const a=u(n,["metadata"]);a!=null&&d(t,["metadata"],a);const s=u(n,["error"]);return s!=null&&d(t,["error"],s),t}function Ub(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);if(t!==void 0&&s!=null&&d(t,["_query","pageToken"],s),u(n,["filter"])!==void 0)throw new Error("filter parameter is not supported in Gemini API.");return o}function Lb(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);t!==void 0&&s!=null&&d(t,["_query","pageToken"],s);const c=u(n,["filter"]);return t!==void 0&&c!=null&&d(t,["_query","filter"],c),o}function kb(n){const t={},o=u(n,["config"]);return o!=null&&Ub(o,t),t}function Pb(n){const t={},o=u(n,["config"]);return o!=null&&Lb(o,t),t}function Gb(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["operations"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>Za(f))),d(t,["batchJobs"],c)}return t}function qb(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["batchPredictionJobs"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>sc(f))),d(t,["batchJobs"],c)}return t}function Vb(n){const t={},o=u(n,["mediaResolution"]);o!=null&&d(t,["mediaResolution"],o);const a=u(n,["codeExecutionResult"]);a!=null&&d(t,["codeExecutionResult"],a);const s=u(n,["executableCode"]);s!=null&&d(t,["executableCode"],s);const c=u(n,["fileData"]);c!=null&&d(t,["fileData"],Tb(c));const f=u(n,["functionCall"]);f!=null&&d(t,["functionCall"],Sb(f));const h=u(n,["functionResponse"]);h!=null&&d(t,["functionResponse"],h);const y=u(n,["inlineData"]);y!=null&&d(t,["inlineData"],ob(y));const p=u(n,["text"]);p!=null&&d(t,["text"],p);const x=u(n,["thought"]);x!=null&&d(t,["thought"],x);const E=u(n,["thoughtSignature"]);E!=null&&d(t,["thoughtSignature"],E);const S=u(n,["videoMetadata"]);return S!=null&&d(t,["videoMetadata"],S),t}function Hb(n){const t={},o=u(n,["category"]);if(o!=null&&d(t,["category"],o),u(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const a=u(n,["threshold"]);return a!=null&&d(t,["threshold"],a),t}function zb(n){const t={},o=u(n,["retrievalConfig"]);o!=null&&d(t,["retrievalConfig"],o);const a=u(n,["functionCallingConfig"]);return a!=null&&d(t,["functionCallingConfig"],_b(a)),t}function Ob(n){const t={};if(u(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=u(n,["computerUse"]);o!=null&&d(t,["computerUse"],o);const a=u(n,["fileSearch"]);a!=null&&d(t,["fileSearch"],a);const s=u(n,["codeExecution"]);if(s!=null&&d(t,["codeExecution"],s),u(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const c=u(n,["functionDeclarations"]);if(c!=null){let x=c;Array.isArray(x)&&(x=x.map(E=>E)),d(t,["functionDeclarations"],x)}const f=u(n,["googleMaps"]);f!=null&&d(t,["googleMaps"],wb(f));const h=u(n,["googleSearch"]);h!=null&&d(t,["googleSearch"],Rb(h));const y=u(n,["googleSearchRetrieval"]);y!=null&&d(t,["googleSearchRetrieval"],y);const p=u(n,["urlContext"]);return p!=null&&d(t,["urlContext"],p),t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/var Cn;(function(n){n.PAGED_ITEM_BATCH_JOBS="batchJobs",n.PAGED_ITEM_MODELS="models",n.PAGED_ITEM_TUNING_JOBS="tuningJobs",n.PAGED_ITEM_FILES="files",n.PAGED_ITEM_CACHED_CONTENTS="cachedContents",n.PAGED_ITEM_FILE_SEARCH_STORES="fileSearchStores",n.PAGED_ITEM_DOCUMENTS="documents"})(Cn||(Cn={}));class Si{constructor(t,o,a,s){this.pageInternal=[],this.paramsInternal={},this.requestInternal=o,this.init(t,a,s)}init(t,o,a){var s,c;this.nameInternal=t,this.pageInternal=o[this.nameInternal]||[],this.sdkHttpResponseInternal=o==null?void 0:o.sdkHttpResponse,this.idxInternal=0;let f={config:{}};!a||Object.keys(a).length===0?f={config:{}}:typeof a=="object"?f=Object.assign({},a):f=a,f.config&&(f.config.pageToken=o.nextPageToken),this.paramsInternal=f,this.pageInternalSize=(c=(s=f.config)===null||s===void 0?void 0:s.pageSize)!==null&&c!==void 0?c: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 Bb extends Nn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new Si(Cn.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=bg(this.apiClient,t),a=o._url,s=$("{model}:batchGenerateContent",a),h=o.batch.inputConfig.requests,y=h.requests,p=[];for(const x of y){const E=Object.assign({},x);if(E.systemInstruction){const S=E.systemInstruction;delete E.systemInstruction;const b=E.request;b.systemInstruction=S,E.request=b}p.push(E)}return h.requests=p,delete o.config,delete o._url,delete o._query,{path:s,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):{},s=Date.now().toString();if(a.displayName||(a.displayName=`genaiBatchJob_${s}`),a.dest===void 0){const c=this.getGcsUri(t),f=this.getBigqueryUri(t);if(c)c.endsWith(".jsonl")?a.dest=`${c.slice(0,-6)}/dest`:a.dest=`${c}_dest_${s}`;else if(f)a.dest=`${f}_dest_${s}`;else throw new Error("Unsupported source for Vertex AI: No GCS or BigQuery URI found.")}return a}async createInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=db(this.apiClient,t);return h=$("batchPredictionJobs",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>sc(x))}else{const p=bg(this.apiClient,t);return h=$("{model}:batchGenerateContent",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>Za(x))}}async createEmbeddingsInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=mb(this.apiClient,t);return c=$("{model}:asyncBatchEmbedContent",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>Za(y))}}async get(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Ab(this.apiClient,t);return h=$("batchPredictionJobs/{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>sc(x))}else{const p=Nb(this.apiClient,t);return h=$("batches/{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>Za(x))}}async cancel(t){var o,a,s,c;let f="",h={};if(this.apiClient.isVertexAI()){const y=ab(this.apiClient,t);f=$("batchPredictionJobs/{name}:cancel",y._url),h=y._query,delete y._url,delete y._query,await this.apiClient.request({path:f,queryParams:h,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=lb(this.apiClient,t);f=$("batches/{name}:cancel",y._url),h=y._query,delete y._url,delete y._query,await this.apiClient.request({path:f,queryParams:h,body:JSON.stringify(y),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal})}}async listInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Pb(t);return h=$("batchPredictionJobs",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=qb(x),S=new Eg;return Object.assign(S,E),S})}else{const p=kb(t);return h=$("batches",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=Gb(x),S=new Eg;return Object.assign(S,E),S})}}async delete(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=hb(this.apiClient,t);return h=$("batchPredictionJobs/{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,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}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>yb(x))}else{const p=pb(this.apiClient,t);return h=$("batches/{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>gb(x))}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Fb(n){const t={},o=u(n,["data"]);if(o!=null&&d(t,["data"],o),u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function Cg(n){const t={},o=u(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>mC(c))),d(t,["parts"],s)}const a=u(n,["role"]);return a!=null&&d(t,["role"],a),t}function Jb(n,t){const o={},a=u(n,["ttl"]);t!==void 0&&a!=null&&d(t,["ttl"],a);const s=u(n,["expireTime"]);t!==void 0&&s!=null&&d(t,["expireTime"],s);const c=u(n,["displayName"]);t!==void 0&&c!=null&&d(t,["displayName"],c);const f=u(n,["contents"]);if(t!==void 0&&f!=null){let x=Mt(f);Array.isArray(x)&&(x=x.map(E=>Cg(E))),d(t,["contents"],x)}const h=u(n,["systemInstruction"]);t!==void 0&&h!=null&&d(t,["systemInstruction"],Cg(tt(h)));const y=u(n,["tools"]);if(t!==void 0&&y!=null){let x=y;Array.isArray(x)&&(x=x.map(E=>hC(E))),d(t,["tools"],x)}const p=u(n,["toolConfig"]);if(t!==void 0&&p!=null&&d(t,["toolConfig"],pC(p)),u(n,["kmsKeyName"])!==void 0)throw new Error("kmsKeyName parameter is not supported in Gemini API.");return o}function Yb(n,t){const o={},a=u(n,["ttl"]);t!==void 0&&a!=null&&d(t,["ttl"],a);const s=u(n,["expireTime"]);t!==void 0&&s!=null&&d(t,["expireTime"],s);const c=u(n,["displayName"]);t!==void 0&&c!=null&&d(t,["displayName"],c);const f=u(n,["contents"]);if(t!==void 0&&f!=null){let E=Mt(f);Array.isArray(E)&&(E=E.map(S=>S)),d(t,["contents"],E)}const h=u(n,["systemInstruction"]);t!==void 0&&h!=null&&d(t,["systemInstruction"],tt(h));const y=u(n,["tools"]);if(t!==void 0&&y!=null){let E=y;Array.isArray(E)&&(E=E.map(S=>gC(S))),d(t,["tools"],E)}const p=u(n,["toolConfig"]);t!==void 0&&p!=null&&d(t,["toolConfig"],p);const x=u(n,["kmsKeyName"]);return t!==void 0&&x!=null&&d(t,["encryption_spec","kmsKeyName"],x),o}function jb(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["model"],M0(n,a));const s=u(t,["config"]);return s!=null&&Jb(s,o),o}function Kb(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["model"],M0(n,a));const s=u(t,["config"]);return s!=null&&Yb(s,o),o}function Xb(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],An(n,a)),o}function $b(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],An(n,a)),o}function Qb(n){const t={},o=u(n,["sdkHttpResponse"]);return o!=null&&d(t,["sdkHttpResponse"],o),t}function Zb(n){const t={},o=u(n,["sdkHttpResponse"]);return o!=null&&d(t,["sdkHttpResponse"],o),t}function Wb(n){const t={};if(u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=u(n,["fileUri"]);o!=null&&d(t,["fileUri"],o);const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function eC(n){const t={},o=u(n,["id"]);o!=null&&d(t,["id"],o);const a=u(n,["args"]);a!=null&&d(t,["args"],a);const s=u(n,["name"]);if(s!=null&&d(t,["name"],s),u(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(u(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function tC(n){const t={},o=u(n,["allowedFunctionNames"]);o!=null&&d(t,["allowedFunctionNames"],o);const a=u(n,["mode"]);if(a!=null&&d(t,["mode"],a),u(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return t}function nC(n){const t={},o=u(n,["description"]);o!=null&&d(t,["description"],o);const a=u(n,["name"]);a!=null&&d(t,["name"],a);const s=u(n,["parameters"]);s!=null&&d(t,["parameters"],s);const c=u(n,["parametersJsonSchema"]);c!=null&&d(t,["parametersJsonSchema"],c);const f=u(n,["response"]);f!=null&&d(t,["response"],f);const h=u(n,["responseJsonSchema"]);if(h!=null&&d(t,["responseJsonSchema"],h),u(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function iC(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],An(n,a)),o}function oC(n,t){const o={},a=u(t,["name"]);return a!=null&&d(o,["_url","name"],An(n,a)),o}function lC(n){const t={};if(u(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const o=u(n,["enableWidget"]);return o!=null&&d(t,["enableWidget"],o),t}function aC(n){const t={};if(u(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(u(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const o=u(n,["timeRangeFilter"]);return o!=null&&d(t,["timeRangeFilter"],o),t}function sC(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);return t!==void 0&&s!=null&&d(t,["_query","pageToken"],s),o}function rC(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);return t!==void 0&&s!=null&&d(t,["_query","pageToken"],s),o}function uC(n){const t={},o=u(n,["config"]);return o!=null&&sC(o,t),t}function cC(n){const t={},o=u(n,["config"]);return o!=null&&rC(o,t),t}function dC(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["cachedContents"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["cachedContents"],c)}return t}function fC(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["cachedContents"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["cachedContents"],c)}return t}function mC(n){const t={},o=u(n,["mediaResolution"]);o!=null&&d(t,["mediaResolution"],o);const a=u(n,["codeExecutionResult"]);a!=null&&d(t,["codeExecutionResult"],a);const s=u(n,["executableCode"]);s!=null&&d(t,["executableCode"],s);const c=u(n,["fileData"]);c!=null&&d(t,["fileData"],Wb(c));const f=u(n,["functionCall"]);f!=null&&d(t,["functionCall"],eC(f));const h=u(n,["functionResponse"]);h!=null&&d(t,["functionResponse"],h);const y=u(n,["inlineData"]);y!=null&&d(t,["inlineData"],Fb(y));const p=u(n,["text"]);p!=null&&d(t,["text"],p);const x=u(n,["thought"]);x!=null&&d(t,["thought"],x);const E=u(n,["thoughtSignature"]);E!=null&&d(t,["thoughtSignature"],E);const S=u(n,["videoMetadata"]);return S!=null&&d(t,["videoMetadata"],S),t}function pC(n){const t={},o=u(n,["retrievalConfig"]);o!=null&&d(t,["retrievalConfig"],o);const a=u(n,["functionCallingConfig"]);return a!=null&&d(t,["functionCallingConfig"],tC(a)),t}function hC(n){const t={};if(u(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=u(n,["computerUse"]);o!=null&&d(t,["computerUse"],o);const a=u(n,["fileSearch"]);a!=null&&d(t,["fileSearch"],a);const s=u(n,["codeExecution"]);if(s!=null&&d(t,["codeExecution"],s),u(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const c=u(n,["functionDeclarations"]);if(c!=null){let x=c;Array.isArray(x)&&(x=x.map(E=>E)),d(t,["functionDeclarations"],x)}const f=u(n,["googleMaps"]);f!=null&&d(t,["googleMaps"],lC(f));const h=u(n,["googleSearch"]);h!=null&&d(t,["googleSearch"],aC(h));const y=u(n,["googleSearchRetrieval"]);y!=null&&d(t,["googleSearchRetrieval"],y);const p=u(n,["urlContext"]);return p!=null&&d(t,["urlContext"],p),t}function gC(n){const t={},o=u(n,["retrieval"]);o!=null&&d(t,["retrieval"],o);const a=u(n,["computerUse"]);if(a!=null&&d(t,["computerUse"],a),u(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=u(n,["codeExecution"]);s!=null&&d(t,["codeExecution"],s);const c=u(n,["enterpriseWebSearch"]);c!=null&&d(t,["enterpriseWebSearch"],c);const f=u(n,["functionDeclarations"]);if(f!=null){let E=f;Array.isArray(E)&&(E=E.map(S=>nC(S))),d(t,["functionDeclarations"],E)}const h=u(n,["googleMaps"]);h!=null&&d(t,["googleMaps"],h);const y=u(n,["googleSearch"]);y!=null&&d(t,["googleSearch"],y);const p=u(n,["googleSearchRetrieval"]);p!=null&&d(t,["googleSearchRetrieval"],p);const x=u(n,["urlContext"]);return x!=null&&d(t,["urlContext"],x),t}function yC(n,t){const o={},a=u(n,["ttl"]);t!==void 0&&a!=null&&d(t,["ttl"],a);const s=u(n,["expireTime"]);return t!==void 0&&s!=null&&d(t,["expireTime"],s),o}function vC(n,t){const o={},a=u(n,["ttl"]);t!==void 0&&a!=null&&d(t,["ttl"],a);const s=u(n,["expireTime"]);return t!==void 0&&s!=null&&d(t,["expireTime"],s),o}function xC(n,t){const o={},a=u(t,["name"]);a!=null&&d(o,["_url","name"],An(n,a));const s=u(t,["config"]);return s!=null&&yC(s,o),o}function EC(n,t){const o={},a=u(t,["name"]);a!=null&&d(o,["_url","name"],An(n,a));const s=u(t,["config"]);return s!=null&&vC(s,o),o}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class TC extends Nn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new Si(Cn.PAGED_ITEM_CACHED_CONTENTS,a=>this.listInternal(a),await this.listInternal(o),o)}async create(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Kb(this.apiClient,t);return h=$("cachedContents",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>x)}else{const p=jb(this.apiClient,t);return h=$("cachedContents",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>x)}}async get(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=oC(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>x)}else{const p=iC(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>x)}}async delete(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=$b(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,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}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=Zb(x),S=new vg;return Object.assign(S,E),S})}else{const p=Xb(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=Qb(x),S=new vg;return Object.assign(S,E),S})}}async update(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=EC(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>x)}else{const p=xC(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"PATCH",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>x)}}async listInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=cC(t);return h=$("cachedContents",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=fC(x),S=new xg;return Object.assign(S,E),S})}else{const p=uC(t);return h=$("cachedContents",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=dC(x),S=new xg;return Object.assign(S,E),S})}}}function ls(n,t){var o={};for(var a in n)Object.prototype.hasOwnProperty.call(n,a)&&t.indexOf(a)<0&&(o[a]=n[a]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,a=Object.getOwnPropertySymbols(n);s<a.length;s++)t.indexOf(a[s])<0&&Object.prototype.propertyIsEnumerable.call(n,a[s])&&(o[a[s]]=n[a[s]]);return o}function Ng(n){var t=typeof Symbol=="function"&&Symbol.iterator,o=t&&n[t],a=0;if(o)return o.call(n);if(n&&typeof n.length=="number")return{next:function(){return n&&a>=n.length&&(n=void 0),{value:n&&n[a++],done:!n}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function se(n){return this instanceof se?(this.v=n,this):new se(n)}function jt(n,t,o){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var a=o.apply(n,t||[]),s,c=[];return s=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),h("next"),h("throw"),h("return",f),s[Symbol.asyncIterator]=function(){return this},s;function f(b){return function(C){return Promise.resolve(C).then(b,E)}}function h(b,C){a[b]&&(s[b]=function(I){return new Promise(function(w,G){c.push([b,I,w,G])>1||y(b,I)})},C&&(s[b]=C(s[b])))}function y(b,C){try{p(a[b](C))}catch(I){S(c[0][3],I)}}function p(b){b.value instanceof se?Promise.resolve(b.value.v).then(x,E):S(c[0][2],b)}function x(b){y("next",b)}function E(b){y("throw",b)}function S(b,C){b(C),c.shift(),c.length&&y(c[0][0],c[0][1])}}function Kt(n){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var t=n[Symbol.asyncIterator],o;return t?t.call(n):(n=typeof Ng=="function"?Ng(n):n[Symbol.iterator](),o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o);function a(c){o[c]=n[c]&&function(f){return new Promise(function(h,y){f=n[c](f),s(h,y,f.done,f.value)})}}function s(c,f,h,y){Promise.resolve(y).then(function(p){c({value:p,done:h})},f)}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function SC(n){var t;if(n.candidates==null||n.candidates.length===0)return!1;const o=(t=n.candidates[0])===null||t===void 0?void 0:t.content;return o===void 0?!1:B0(o)}function B0(n){if(n.parts===void 0||n.parts.length===0)return!1;for(const t of n.parts)if(t===void 0||Object.keys(t).length===0)return!1;return!0}function _C(n){if(n.length!==0){for(const t of n)if(t.role!=="user"&&t.role!=="model")throw new Error(`Role must be user or model, but got ${t.role}.`)}}function Ag(n){if(n===void 0||n.length===0)return[];const t=[],o=n.length;let a=0;for(;a<o;)if(n[a].role==="user")t.push(n[a]),a++;else{const s=[];let c=!0;for(;a<o&&n[a].role==="model";)s.push(n[a]),c&&!B0(n[a])&&(c=!1),a++;c?t.push(...s):t.pop()}return t}class bC{constructor(t,o){this.modelsModule=t,this.apiClient=o}create(t){return new CC(this.apiClient,this.modelsModule,t.model,t.config,structuredClone(t.history))}}class CC{constructor(t,o,a,s={},c=[]){this.apiClient=t,this.modelsModule=o,this.model=a,this.config=s,this.history=c,this.sendPromise=Promise.resolve(),_C(c)}async sendMessage(t){var o;await this.sendPromise;const a=tt(t.message),s=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 c,f,h;const y=await s,p=(f=(c=y.candidates)===null||c===void 0?void 0:c[0])===null||f===void 0?void 0:f.content,x=y.automaticFunctionCallingHistory,E=this.getHistory(!0).length;let S=[];x!=null&&(S=(h=x.slice(E))!==null&&h!==void 0?h:[]);const b=p?[p]:[];this.recordHistory(a,b,S)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}async sendMessageStream(t){var o;await this.sendPromise;const a=tt(t.message),s=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=s.then(()=>{}).catch(()=>{});const c=await s;return this.processStreamResponse(c,a)}getHistory(t=!1){const o=t?Ag(this.history):this.history;return structuredClone(o)}processStreamResponse(t,o){return jt(this,arguments,function*(){var s,c,f,h,y,p;const x=[];try{for(var E=!0,S=Kt(t),b;b=yield se(S.next()),s=b.done,!s;E=!0){h=b.value,E=!1;const C=h;if(SC(C)){const I=(p=(y=C.candidates)===null||y===void 0?void 0:y[0])===null||p===void 0?void 0:p.content;I!==void 0&&x.push(I)}yield yield se(C)}}catch(C){c={error:C}}finally{try{!E&&!s&&(f=S.return)&&(yield se(f.call(S)))}finally{if(c)throw c.error}}this.recordHistory(o,x)})}recordHistory(t,o,a){let s=[];o.length>0&&o.every(c=>c.role!==void 0)?s=o:s.push({role:"model",parts:[]}),a&&a.length>0?this.history.push(...Ag(a)):this.history.push(t),this.history.push(...s)}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class El extends Error{constructor(t){super(t.message),this.name="ApiError",this.status=t.status,Object.setPrototypeOf(this,El.prototype)}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function NC(n){const t={},o=u(n,["file"]);return o!=null&&d(t,["file"],o),t}function AC(n){const t={},o=u(n,["sdkHttpResponse"]);return o!=null&&d(t,["sdkHttpResponse"],o),t}function wC(n){const t={},o=u(n,["name"]);return o!=null&&d(t,["_url","file"],P0(o)),t}function RC(n){const t={},o=u(n,["sdkHttpResponse"]);return o!=null&&d(t,["sdkHttpResponse"],o),t}function MC(n){const t={},o=u(n,["name"]);return o!=null&&d(t,["_url","file"],P0(o)),t}function IC(n){const t={},o=u(n,["uris"]);return o!=null&&d(t,["uris"],o),t}function DC(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);return t!==void 0&&s!=null&&d(t,["_query","pageToken"],s),o}function UC(n){const t={},o=u(n,["config"]);return o!=null&&DC(o,t),t}function LC(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["files"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["files"],c)}return t}function kC(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["files"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(c=>c)),d(t,["files"],s)}return t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class PC extends Nn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new Si(Cn.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 s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=UC(t);return c=$("files",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>{const p=LC(y),x=new P_;return Object.assign(x,p),x})}}async createInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=NC(t);return c=$("upload/v1beta/files",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=AC(y),x=new G_;return Object.assign(x,p),x})}}async get(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=MC(t);return c=$("files/{file}",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>y)}}async delete(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=wC(t);return c=$("files/{file}",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>{const p=RC(y),x=new q_;return Object.assign(x,p),x})}}async registerFilesInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=IC(t);return c=$("files:register",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=kC(y),x=new V_;return Object.assign(x,p),x})}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Wa(n){const t={},o=u(n,["data"]);if(o!=null&&d(t,["data"],o),u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function GC(n){const t={},o=u(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>WC(c))),d(t,["parts"],s)}const a=u(n,["role"]);return a!=null&&d(t,["role"],a),t}function qC(n){const t={};if(u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=u(n,["fileUri"]);o!=null&&d(t,["fileUri"],o);const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function VC(n){const t={},o=u(n,["id"]);o!=null&&d(t,["id"],o);const a=u(n,["args"]);a!=null&&d(t,["args"],a);const s=u(n,["name"]);if(s!=null&&d(t,["name"],s),u(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(u(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function HC(n){const t={},o=u(n,["description"]);o!=null&&d(t,["description"],o);const a=u(n,["name"]);a!=null&&d(t,["name"],a);const s=u(n,["parameters"]);s!=null&&d(t,["parameters"],s);const c=u(n,["parametersJsonSchema"]);c!=null&&d(t,["parametersJsonSchema"],c);const f=u(n,["response"]);f!=null&&d(t,["response"],f);const h=u(n,["responseJsonSchema"]);if(h!=null&&d(t,["responseJsonSchema"],h),u(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return t}function zC(n){const t={},o=u(n,["modelSelectionConfig"]);o!=null&&d(t,["modelConfig"],o);const a=u(n,["responseJsonSchema"]);a!=null&&d(t,["responseJsonSchema"],a);const s=u(n,["audioTimestamp"]);s!=null&&d(t,["audioTimestamp"],s);const c=u(n,["candidateCount"]);c!=null&&d(t,["candidateCount"],c);const f=u(n,["enableAffectiveDialog"]);f!=null&&d(t,["enableAffectiveDialog"],f);const h=u(n,["frequencyPenalty"]);h!=null&&d(t,["frequencyPenalty"],h);const y=u(n,["logprobs"]);y!=null&&d(t,["logprobs"],y);const p=u(n,["maxOutputTokens"]);p!=null&&d(t,["maxOutputTokens"],p);const x=u(n,["mediaResolution"]);x!=null&&d(t,["mediaResolution"],x);const E=u(n,["presencePenalty"]);E!=null&&d(t,["presencePenalty"],E);const S=u(n,["responseLogprobs"]);S!=null&&d(t,["responseLogprobs"],S);const b=u(n,["responseMimeType"]);b!=null&&d(t,["responseMimeType"],b);const C=u(n,["responseModalities"]);C!=null&&d(t,["responseModalities"],C);const I=u(n,["responseSchema"]);I!=null&&d(t,["responseSchema"],I);const w=u(n,["routingConfig"]);w!=null&&d(t,["routingConfig"],w);const G=u(n,["seed"]);G!=null&&d(t,["seed"],G);const V=u(n,["speechConfig"]);V!=null&&d(t,["speechConfig"],V);const P=u(n,["stopSequences"]);P!=null&&d(t,["stopSequences"],P);const Y=u(n,["temperature"]);Y!=null&&d(t,["temperature"],Y);const X=u(n,["thinkingConfig"]);X!=null&&d(t,["thinkingConfig"],X);const B=u(n,["topK"]);B!=null&&d(t,["topK"],B);const j=u(n,["topP"]);if(j!=null&&d(t,["topP"],j),u(n,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return t}function OC(n){const t={};if(u(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const o=u(n,["enableWidget"]);return o!=null&&d(t,["enableWidget"],o),t}function BC(n){const t={};if(u(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(u(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const o=u(n,["timeRangeFilter"]);return o!=null&&d(t,["timeRangeFilter"],o),t}function FC(n,t){const o={},a=u(n,["generationConfig"]);t!==void 0&&a!=null&&d(t,["setup","generationConfig"],a);const s=u(n,["responseModalities"]);t!==void 0&&s!=null&&d(t,["setup","generationConfig","responseModalities"],s);const c=u(n,["temperature"]);t!==void 0&&c!=null&&d(t,["setup","generationConfig","temperature"],c);const f=u(n,["topP"]);t!==void 0&&f!=null&&d(t,["setup","generationConfig","topP"],f);const h=u(n,["topK"]);t!==void 0&&h!=null&&d(t,["setup","generationConfig","topK"],h);const y=u(n,["maxOutputTokens"]);t!==void 0&&y!=null&&d(t,["setup","generationConfig","maxOutputTokens"],y);const p=u(n,["mediaResolution"]);t!==void 0&&p!=null&&d(t,["setup","generationConfig","mediaResolution"],p);const x=u(n,["seed"]);t!==void 0&&x!=null&&d(t,["setup","generationConfig","seed"],x);const E=u(n,["speechConfig"]);t!==void 0&&E!=null&&d(t,["setup","generationConfig","speechConfig"],qc(E));const S=u(n,["thinkingConfig"]);t!==void 0&&S!=null&&d(t,["setup","generationConfig","thinkingConfig"],S);const b=u(n,["enableAffectiveDialog"]);t!==void 0&&b!=null&&d(t,["setup","generationConfig","enableAffectiveDialog"],b);const C=u(n,["systemInstruction"]);t!==void 0&&C!=null&&d(t,["setup","systemInstruction"],GC(tt(C)));const I=u(n,["tools"]);if(t!==void 0&&I!=null){let B=go(I);Array.isArray(B)&&(B=B.map(j=>tN(ho(j)))),d(t,["setup","tools"],B)}const w=u(n,["sessionResumption"]);t!==void 0&&w!=null&&d(t,["setup","sessionResumption"],eN(w));const G=u(n,["inputAudioTranscription"]);t!==void 0&&G!=null&&d(t,["setup","inputAudioTranscription"],G);const V=u(n,["outputAudioTranscription"]);t!==void 0&&V!=null&&d(t,["setup","outputAudioTranscription"],V);const P=u(n,["realtimeInputConfig"]);t!==void 0&&P!=null&&d(t,["setup","realtimeInputConfig"],P);const Y=u(n,["contextWindowCompression"]);t!==void 0&&Y!=null&&d(t,["setup","contextWindowCompression"],Y);const X=u(n,["proactivity"]);if(t!==void 0&&X!=null&&d(t,["setup","proactivity"],X),u(n,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return o}function JC(n,t){const o={},a=u(n,["generationConfig"]);t!==void 0&&a!=null&&d(t,["setup","generationConfig"],zC(a));const s=u(n,["responseModalities"]);t!==void 0&&s!=null&&d(t,["setup","generationConfig","responseModalities"],s);const c=u(n,["temperature"]);t!==void 0&&c!=null&&d(t,["setup","generationConfig","temperature"],c);const f=u(n,["topP"]);t!==void 0&&f!=null&&d(t,["setup","generationConfig","topP"],f);const h=u(n,["topK"]);t!==void 0&&h!=null&&d(t,["setup","generationConfig","topK"],h);const y=u(n,["maxOutputTokens"]);t!==void 0&&y!=null&&d(t,["setup","generationConfig","maxOutputTokens"],y);const p=u(n,["mediaResolution"]);t!==void 0&&p!=null&&d(t,["setup","generationConfig","mediaResolution"],p);const x=u(n,["seed"]);t!==void 0&&x!=null&&d(t,["setup","generationConfig","seed"],x);const E=u(n,["speechConfig"]);t!==void 0&&E!=null&&d(t,["setup","generationConfig","speechConfig"],qc(E));const S=u(n,["thinkingConfig"]);t!==void 0&&S!=null&&d(t,["setup","generationConfig","thinkingConfig"],S);const b=u(n,["enableAffectiveDialog"]);t!==void 0&&b!=null&&d(t,["setup","generationConfig","enableAffectiveDialog"],b);const C=u(n,["systemInstruction"]);t!==void 0&&C!=null&&d(t,["setup","systemInstruction"],tt(C));const I=u(n,["tools"]);if(t!==void 0&&I!=null){let j=go(I);Array.isArray(j)&&(j=j.map(le=>nN(ho(le)))),d(t,["setup","tools"],j)}const w=u(n,["sessionResumption"]);t!==void 0&&w!=null&&d(t,["setup","sessionResumption"],w);const G=u(n,["inputAudioTranscription"]);t!==void 0&&G!=null&&d(t,["setup","inputAudioTranscription"],G);const V=u(n,["outputAudioTranscription"]);t!==void 0&&V!=null&&d(t,["setup","outputAudioTranscription"],V);const P=u(n,["realtimeInputConfig"]);t!==void 0&&P!=null&&d(t,["setup","realtimeInputConfig"],P);const Y=u(n,["contextWindowCompression"]);t!==void 0&&Y!=null&&d(t,["setup","contextWindowCompression"],Y);const X=u(n,["proactivity"]);t!==void 0&&X!=null&&d(t,["setup","proactivity"],X);const B=u(n,["explicitVadSignal"]);return t!==void 0&&B!=null&&d(t,["setup","explicitVadSignal"],B),o}function YC(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["setup","model"],_e(n,a));const s=u(t,["config"]);return s!=null&&d(o,["config"],FC(s,o)),o}function jC(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["setup","model"],_e(n,a));const s=u(t,["config"]);return s!=null&&d(o,["config"],JC(s,o)),o}function KC(n){const t={},o=u(n,["musicGenerationConfig"]);return o!=null&&d(t,["musicGenerationConfig"],o),t}function XC(n){const t={},o=u(n,["weightedPrompts"]);if(o!=null){let a=o;Array.isArray(a)&&(a=a.map(s=>s)),d(t,["weightedPrompts"],a)}return t}function $C(n){const t={},o=u(n,["media"]);if(o!=null){let p=I0(o);Array.isArray(p)&&(p=p.map(x=>Wa(x))),d(t,["mediaChunks"],p)}const a=u(n,["audio"]);a!=null&&d(t,["audio"],Wa(U0(a)));const s=u(n,["audioStreamEnd"]);s!=null&&d(t,["audioStreamEnd"],s);const c=u(n,["video"]);c!=null&&d(t,["video"],Wa(D0(c)));const f=u(n,["text"]);f!=null&&d(t,["text"],f);const h=u(n,["activityStart"]);h!=null&&d(t,["activityStart"],h);const y=u(n,["activityEnd"]);return y!=null&&d(t,["activityEnd"],y),t}function QC(n){const t={},o=u(n,["media"]);if(o!=null){let p=I0(o);Array.isArray(p)&&(p=p.map(x=>x)),d(t,["mediaChunks"],p)}const a=u(n,["audio"]);a!=null&&d(t,["audio"],U0(a));const s=u(n,["audioStreamEnd"]);s!=null&&d(t,["audioStreamEnd"],s);const c=u(n,["video"]);c!=null&&d(t,["video"],D0(c));const f=u(n,["text"]);f!=null&&d(t,["text"],f);const h=u(n,["activityStart"]);h!=null&&d(t,["activityStart"],h);const y=u(n,["activityEnd"]);return y!=null&&d(t,["activityEnd"],y),t}function ZC(n){const t={},o=u(n,["setupComplete"]);o!=null&&d(t,["setupComplete"],o);const a=u(n,["serverContent"]);a!=null&&d(t,["serverContent"],a);const s=u(n,["toolCall"]);s!=null&&d(t,["toolCall"],s);const c=u(n,["toolCallCancellation"]);c!=null&&d(t,["toolCallCancellation"],c);const f=u(n,["usageMetadata"]);f!=null&&d(t,["usageMetadata"],iN(f));const h=u(n,["goAway"]);h!=null&&d(t,["goAway"],h);const y=u(n,["sessionResumptionUpdate"]);y!=null&&d(t,["sessionResumptionUpdate"],y);const p=u(n,["voiceActivityDetectionSignal"]);p!=null&&d(t,["voiceActivityDetectionSignal"],p);const x=u(n,["voiceActivity"]);return x!=null&&d(t,["voiceActivity"],oN(x)),t}function WC(n){const t={},o=u(n,["mediaResolution"]);o!=null&&d(t,["mediaResolution"],o);const a=u(n,["codeExecutionResult"]);a!=null&&d(t,["codeExecutionResult"],a);const s=u(n,["executableCode"]);s!=null&&d(t,["executableCode"],s);const c=u(n,["fileData"]);c!=null&&d(t,["fileData"],qC(c));const f=u(n,["functionCall"]);f!=null&&d(t,["functionCall"],VC(f));const h=u(n,["functionResponse"]);h!=null&&d(t,["functionResponse"],h);const y=u(n,["inlineData"]);y!=null&&d(t,["inlineData"],Wa(y));const p=u(n,["text"]);p!=null&&d(t,["text"],p);const x=u(n,["thought"]);x!=null&&d(t,["thought"],x);const E=u(n,["thoughtSignature"]);E!=null&&d(t,["thoughtSignature"],E);const S=u(n,["videoMetadata"]);return S!=null&&d(t,["videoMetadata"],S),t}function eN(n){const t={},o=u(n,["handle"]);if(o!=null&&d(t,["handle"],o),u(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function tN(n){const t={};if(u(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=u(n,["computerUse"]);o!=null&&d(t,["computerUse"],o);const a=u(n,["fileSearch"]);a!=null&&d(t,["fileSearch"],a);const s=u(n,["codeExecution"]);if(s!=null&&d(t,["codeExecution"],s),u(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const c=u(n,["functionDeclarations"]);if(c!=null){let x=c;Array.isArray(x)&&(x=x.map(E=>E)),d(t,["functionDeclarations"],x)}const f=u(n,["googleMaps"]);f!=null&&d(t,["googleMaps"],OC(f));const h=u(n,["googleSearch"]);h!=null&&d(t,["googleSearch"],BC(h));const y=u(n,["googleSearchRetrieval"]);y!=null&&d(t,["googleSearchRetrieval"],y);const p=u(n,["urlContext"]);return p!=null&&d(t,["urlContext"],p),t}function nN(n){const t={},o=u(n,["retrieval"]);o!=null&&d(t,["retrieval"],o);const a=u(n,["computerUse"]);if(a!=null&&d(t,["computerUse"],a),u(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const s=u(n,["codeExecution"]);s!=null&&d(t,["codeExecution"],s);const c=u(n,["enterpriseWebSearch"]);c!=null&&d(t,["enterpriseWebSearch"],c);const f=u(n,["functionDeclarations"]);if(f!=null){let E=f;Array.isArray(E)&&(E=E.map(S=>HC(S))),d(t,["functionDeclarations"],E)}const h=u(n,["googleMaps"]);h!=null&&d(t,["googleMaps"],h);const y=u(n,["googleSearch"]);y!=null&&d(t,["googleSearch"],y);const p=u(n,["googleSearchRetrieval"]);p!=null&&d(t,["googleSearchRetrieval"],p);const x=u(n,["urlContext"]);return x!=null&&d(t,["urlContext"],x),t}function iN(n){const t={},o=u(n,["promptTokenCount"]);o!=null&&d(t,["promptTokenCount"],o);const a=u(n,["cachedContentTokenCount"]);a!=null&&d(t,["cachedContentTokenCount"],a);const s=u(n,["candidatesTokenCount"]);s!=null&&d(t,["responseTokenCount"],s);const c=u(n,["toolUsePromptTokenCount"]);c!=null&&d(t,["toolUsePromptTokenCount"],c);const f=u(n,["thoughtsTokenCount"]);f!=null&&d(t,["thoughtsTokenCount"],f);const h=u(n,["totalTokenCount"]);h!=null&&d(t,["totalTokenCount"],h);const y=u(n,["promptTokensDetails"]);if(y!=null){let b=y;Array.isArray(b)&&(b=b.map(C=>C)),d(t,["promptTokensDetails"],b)}const p=u(n,["cacheTokensDetails"]);if(p!=null){let b=p;Array.isArray(b)&&(b=b.map(C=>C)),d(t,["cacheTokensDetails"],b)}const x=u(n,["candidatesTokensDetails"]);if(x!=null){let b=x;Array.isArray(b)&&(b=b.map(C=>C)),d(t,["responseTokensDetails"],b)}const E=u(n,["toolUsePromptTokensDetails"]);if(E!=null){let b=E;Array.isArray(b)&&(b=b.map(C=>C)),d(t,["toolUsePromptTokensDetails"],b)}const S=u(n,["trafficType"]);return S!=null&&d(t,["trafficType"],S),t}function oN(n){const t={},o=u(n,["type"]);return o!=null&&d(t,["voiceActivityType"],o),t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function lN(n,t){const o={},a=u(n,["data"]);if(a!=null&&d(o,["data"],a),u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const s=u(n,["mimeType"]);return s!=null&&d(o,["mimeType"],s),o}function aN(n,t){const o={},a=u(n,["content"]);a!=null&&d(o,["content"],a);const s=u(n,["citationMetadata"]);s!=null&&d(o,["citationMetadata"],sN(s));const c=u(n,["tokenCount"]);c!=null&&d(o,["tokenCount"],c);const f=u(n,["finishReason"]);f!=null&&d(o,["finishReason"],f);const h=u(n,["avgLogprobs"]);h!=null&&d(o,["avgLogprobs"],h);const y=u(n,["groundingMetadata"]);y!=null&&d(o,["groundingMetadata"],y);const p=u(n,["index"]);p!=null&&d(o,["index"],p);const x=u(n,["logprobsResult"]);x!=null&&d(o,["logprobsResult"],x);const E=u(n,["safetyRatings"]);if(E!=null){let b=E;Array.isArray(b)&&(b=b.map(C=>C)),d(o,["safetyRatings"],b)}const S=u(n,["urlContextMetadata"]);return S!=null&&d(o,["urlContextMetadata"],S),o}function sN(n,t){const o={},a=u(n,["citationSources"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(c=>c)),d(o,["citations"],s)}return o}function rN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["contents"]);if(c!=null){let f=Mt(c);Array.isArray(f)&&(f=f.map(h=>h)),d(a,["contents"],f)}return a}function uN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["tokensInfo"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(o,["tokensInfo"],c)}return o}function cN(n,t){const o={},a=u(n,["values"]);a!=null&&d(o,["values"],a);const s=u(n,["statistics"]);return s!=null&&d(o,["statistics"],dN(s)),o}function dN(n,t){const o={},a=u(n,["truncated"]);a!=null&&d(o,["truncated"],a);const s=u(n,["token_count"]);return s!=null&&d(o,["tokenCount"],s),o}function bl(n,t){const o={},a=u(n,["parts"]);if(a!=null){let c=a;Array.isArray(c)&&(c=c.map(f=>EA(f))),d(o,["parts"],c)}const s=u(n,["role"]);return s!=null&&d(o,["role"],s),o}function fN(n,t){const o={},a=u(n,["controlType"]);a!=null&&d(o,["controlType"],a);const s=u(n,["enableControlImageComputation"]);return s!=null&&d(o,["computeControl"],s),o}function mN(n,t){const o={};if(u(n,["systemInstruction"])!==void 0)throw new Error("systemInstruction parameter is not supported in Gemini API.");if(u(n,["tools"])!==void 0)throw new Error("tools parameter is not supported in Gemini API.");if(u(n,["generationConfig"])!==void 0)throw new Error("generationConfig parameter is not supported in Gemini API.");return o}function pN(n,t,o){const a={},s=u(n,["systemInstruction"]);t!==void 0&&s!=null&&d(t,["systemInstruction"],tt(s));const c=u(n,["tools"]);if(t!==void 0&&c!=null){let h=c;Array.isArray(h)&&(h=h.map(y=>j0(y))),d(t,["tools"],h)}const f=u(n,["generationConfig"]);return t!==void 0&&f!=null&&d(t,["generationConfig"],lA(f)),a}function hN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["contents"]);if(c!=null){let h=Mt(c);Array.isArray(h)&&(h=h.map(y=>bl(y))),d(a,["contents"],h)}const f=u(t,["config"]);return f!=null&&mN(f),a}function gN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["contents"]);if(c!=null){let h=Mt(c);Array.isArray(h)&&(h=h.map(y=>y)),d(a,["contents"],h)}const f=u(t,["config"]);return f!=null&&pN(f,a),a}function yN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["totalTokens"]);s!=null&&d(o,["totalTokens"],s);const c=u(n,["cachedContentTokenCount"]);return c!=null&&d(o,["cachedContentTokenCount"],c),o}function vN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["totalTokens"]);return s!=null&&d(o,["totalTokens"],s),o}function xN(n,t,o){const a={},s=u(t,["model"]);return s!=null&&d(a,["_url","name"],_e(n,s)),a}function EN(n,t,o){const a={},s=u(t,["model"]);return s!=null&&d(a,["_url","name"],_e(n,s)),a}function TN(n,t){const o={},a=u(n,["sdkHttpResponse"]);return a!=null&&d(o,["sdkHttpResponse"],a),o}function SN(n,t){const o={},a=u(n,["sdkHttpResponse"]);return a!=null&&d(o,["sdkHttpResponse"],a),o}function _N(n,t,o){const a={},s=u(n,["outputGcsUri"]);t!==void 0&&s!=null&&d(t,["parameters","storageUri"],s);const c=u(n,["negativePrompt"]);t!==void 0&&c!=null&&d(t,["parameters","negativePrompt"],c);const f=u(n,["numberOfImages"]);t!==void 0&&f!=null&&d(t,["parameters","sampleCount"],f);const h=u(n,["aspectRatio"]);t!==void 0&&h!=null&&d(t,["parameters","aspectRatio"],h);const y=u(n,["guidanceScale"]);t!==void 0&&y!=null&&d(t,["parameters","guidanceScale"],y);const p=u(n,["seed"]);t!==void 0&&p!=null&&d(t,["parameters","seed"],p);const x=u(n,["safetyFilterLevel"]);t!==void 0&&x!=null&&d(t,["parameters","safetySetting"],x);const E=u(n,["personGeneration"]);t!==void 0&&E!=null&&d(t,["parameters","personGeneration"],E);const S=u(n,["includeSafetyAttributes"]);t!==void 0&&S!=null&&d(t,["parameters","includeSafetyAttributes"],S);const b=u(n,["includeRaiReason"]);t!==void 0&&b!=null&&d(t,["parameters","includeRaiReason"],b);const C=u(n,["language"]);t!==void 0&&C!=null&&d(t,["parameters","language"],C);const I=u(n,["outputMimeType"]);t!==void 0&&I!=null&&d(t,["parameters","outputOptions","mimeType"],I);const w=u(n,["outputCompressionQuality"]);t!==void 0&&w!=null&&d(t,["parameters","outputOptions","compressionQuality"],w);const G=u(n,["addWatermark"]);t!==void 0&&G!=null&&d(t,["parameters","addWatermark"],G);const V=u(n,["labels"]);t!==void 0&&V!=null&&d(t,["labels"],V);const P=u(n,["editMode"]);t!==void 0&&P!=null&&d(t,["parameters","editMode"],P);const Y=u(n,["baseSteps"]);return t!==void 0&&Y!=null&&d(t,["parameters","editConfig","baseSteps"],Y),a}function bN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["prompt"]);c!=null&&d(a,["instances[0]","prompt"],c);const f=u(t,["referenceImages"]);if(f!=null){let y=f;Array.isArray(y)&&(y=y.map(p=>NA(p))),d(a,["instances[0]","referenceImages"],y)}const h=u(t,["config"]);return h!=null&&_N(h,a),a}function CN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["predictions"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>ms(f))),d(o,["generatedImages"],c)}return o}function NN(n,t,o){const a={},s=u(n,["taskType"]);t!==void 0&&s!=null&&d(t,["requests[]","taskType"],s);const c=u(n,["title"]);t!==void 0&&c!=null&&d(t,["requests[]","title"],c);const f=u(n,["outputDimensionality"]);if(t!==void 0&&f!=null&&d(t,["requests[]","outputDimensionality"],f),u(n,["mimeType"])!==void 0)throw new Error("mimeType parameter is not supported in Gemini API.");if(u(n,["autoTruncate"])!==void 0)throw new Error("autoTruncate parameter is not supported in Gemini API.");return a}function AN(n,t,o){const a={};let s=u(o,["embeddingApiType"]);if(s===void 0&&(s="PREDICT"),s==="PREDICT"){const p=u(n,["taskType"]);t!==void 0&&p!=null&&d(t,["instances[]","task_type"],p)}else if(s==="EMBED_CONTENT"){const p=u(n,["taskType"]);t!==void 0&&p!=null&&d(t,["taskType"],p)}let c=u(o,["embeddingApiType"]);if(c===void 0&&(c="PREDICT"),c==="PREDICT"){const p=u(n,["title"]);t!==void 0&&p!=null&&d(t,["instances[]","title"],p)}else if(c==="EMBED_CONTENT"){const p=u(n,["title"]);t!==void 0&&p!=null&&d(t,["title"],p)}let f=u(o,["embeddingApiType"]);if(f===void 0&&(f="PREDICT"),f==="PREDICT"){const p=u(n,["outputDimensionality"]);t!==void 0&&p!=null&&d(t,["parameters","outputDimensionality"],p)}else if(f==="EMBED_CONTENT"){const p=u(n,["outputDimensionality"]);t!==void 0&&p!=null&&d(t,["outputDimensionality"],p)}let h=u(o,["embeddingApiType"]);if(h===void 0&&(h="PREDICT"),h==="PREDICT"){const p=u(n,["mimeType"]);t!==void 0&&p!=null&&d(t,["instances[]","mimeType"],p)}let y=u(o,["embeddingApiType"]);if(y===void 0&&(y="PREDICT"),y==="PREDICT"){const p=u(n,["autoTruncate"]);t!==void 0&&p!=null&&d(t,["parameters","autoTruncate"],p)}else if(y==="EMBED_CONTENT"){const p=u(n,["autoTruncate"]);t!==void 0&&p!=null&&d(t,["autoTruncate"],p)}return a}function wN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["contents"]);if(c!=null){let p=kc(n,c);Array.isArray(p)&&(p=p.map(x=>x)),d(a,["requests[]","content"],p)}const f=u(t,["content"]);f!=null&&bl(tt(f));const h=u(t,["config"]);h!=null&&NN(h,a);const y=u(t,["model"]);return y!==void 0&&d(a,["requests[]","model"],_e(n,y)),a}function RN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));let c=u(o,["embeddingApiType"]);if(c===void 0&&(c="PREDICT"),c==="PREDICT"){const y=u(t,["contents"]);if(y!=null){let p=kc(n,y);Array.isArray(p)&&(p=p.map(x=>x)),d(a,["instances[]","content"],p)}}let f=u(o,["embeddingApiType"]);if(f===void 0&&(f="PREDICT"),f==="EMBED_CONTENT"){const y=u(t,["content"]);y!=null&&d(a,["content"],tt(y))}const h=u(t,["config"]);return h!=null&&AN(h,a,o),a}function MN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["embeddings"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(h=>h)),d(o,["embeddings"],f)}const c=u(n,["metadata"]);return c!=null&&d(o,["metadata"],c),o}function IN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["predictions[]","embeddings"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(h=>cN(h))),d(o,["embeddings"],f)}const c=u(n,["metadata"]);if(c!=null&&d(o,["metadata"],c),t&&u(t,["embeddingApiType"])==="EMBED_CONTENT"){const f=u(n,["embedding"]),h=u(n,["usageMetadata"]),y=u(n,["truncated"]);if(f){const p={};h&&h.promptTokenCount&&(p.tokenCount=h.promptTokenCount),y&&(p.truncated=y),f.statistics=p,d(o,["embeddings"],[f])}}return o}function DN(n,t){const o={},a=u(n,["endpoint"]);a!=null&&d(o,["name"],a);const s=u(n,["deployedModelId"]);return s!=null&&d(o,["deployedModelId"],s),o}function UN(n,t){const o={};if(u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=u(n,["fileUri"]);a!=null&&d(o,["fileUri"],a);const s=u(n,["mimeType"]);return s!=null&&d(o,["mimeType"],s),o}function LN(n,t){const o={},a=u(n,["id"]);a!=null&&d(o,["id"],a);const s=u(n,["args"]);s!=null&&d(o,["args"],s);const c=u(n,["name"]);if(c!=null&&d(o,["name"],c),u(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(u(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return o}function kN(n,t){const o={},a=u(n,["allowedFunctionNames"]);a!=null&&d(o,["allowedFunctionNames"],a);const s=u(n,["mode"]);if(s!=null&&d(o,["mode"],s),u(n,["streamFunctionCallArguments"])!==void 0)throw new Error("streamFunctionCallArguments parameter is not supported in Gemini API.");return o}function PN(n,t){const o={},a=u(n,["description"]);a!=null&&d(o,["description"],a);const s=u(n,["name"]);s!=null&&d(o,["name"],s);const c=u(n,["parameters"]);c!=null&&d(o,["parameters"],c);const f=u(n,["parametersJsonSchema"]);f!=null&&d(o,["parametersJsonSchema"],f);const h=u(n,["response"]);h!=null&&d(o,["response"],h);const y=u(n,["responseJsonSchema"]);if(y!=null&&d(o,["responseJsonSchema"],y),u(n,["behavior"])!==void 0)throw new Error("behavior parameter is not supported in Vertex AI.");return o}function GN(n,t,o,a){const s={},c=u(t,["systemInstruction"]);o!==void 0&&c!=null&&d(o,["systemInstruction"],bl(tt(c)));const f=u(t,["temperature"]);f!=null&&d(s,["temperature"],f);const h=u(t,["topP"]);h!=null&&d(s,["topP"],h);const y=u(t,["topK"]);y!=null&&d(s,["topK"],y);const p=u(t,["candidateCount"]);p!=null&&d(s,["candidateCount"],p);const x=u(t,["maxOutputTokens"]);x!=null&&d(s,["maxOutputTokens"],x);const E=u(t,["stopSequences"]);E!=null&&d(s,["stopSequences"],E);const S=u(t,["responseLogprobs"]);S!=null&&d(s,["responseLogprobs"],S);const b=u(t,["logprobs"]);b!=null&&d(s,["logprobs"],b);const C=u(t,["presencePenalty"]);C!=null&&d(s,["presencePenalty"],C);const I=u(t,["frequencyPenalty"]);I!=null&&d(s,["frequencyPenalty"],I);const w=u(t,["seed"]);w!=null&&d(s,["seed"],w);const G=u(t,["responseMimeType"]);G!=null&&d(s,["responseMimeType"],G);const V=u(t,["responseSchema"]);V!=null&&d(s,["responseSchema"],Pc(V));const P=u(t,["responseJsonSchema"]);if(P!=null&&d(s,["responseJsonSchema"],P),u(t,["routingConfig"])!==void 0)throw new Error("routingConfig parameter is not supported in Gemini API.");if(u(t,["modelSelectionConfig"])!==void 0)throw new Error("modelSelectionConfig parameter is not supported in Gemini API.");const Y=u(t,["safetySettings"]);if(o!==void 0&&Y!=null){let ke=Y;Array.isArray(ke)&&(ke=ke.map(Ze=>AA(Ze))),d(o,["safetySettings"],ke)}const X=u(t,["tools"]);if(o!==void 0&&X!=null){let ke=go(X);Array.isArray(ke)&&(ke=ke.map(Ze=>LA(ho(Ze)))),d(o,["tools"],ke)}const B=u(t,["toolConfig"]);if(o!==void 0&&B!=null&&d(o,["toolConfig"],UA(B)),u(t,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const j=u(t,["cachedContent"]);o!==void 0&&j!=null&&d(o,["cachedContent"],An(n,j));const le=u(t,["responseModalities"]);le!=null&&d(s,["responseModalities"],le);const Z=u(t,["mediaResolution"]);Z!=null&&d(s,["mediaResolution"],Z);const ae=u(t,["speechConfig"]);if(ae!=null&&d(s,["speechConfig"],Gc(ae)),u(t,["audioTimestamp"])!==void 0)throw new Error("audioTimestamp parameter is not supported in Gemini API.");const be=u(t,["thinkingConfig"]);be!=null&&d(s,["thinkingConfig"],be);const Re=u(t,["imageConfig"]);Re!=null&&d(s,["imageConfig"],cA(Re));const Ve=u(t,["enableEnhancedCivicAnswers"]);if(Ve!=null&&d(s,["enableEnhancedCivicAnswers"],Ve),u(t,["modelArmorConfig"])!==void 0)throw new Error("modelArmorConfig parameter is not supported in Gemini API.");return s}function qN(n,t,o,a){const s={},c=u(t,["systemInstruction"]);o!==void 0&&c!=null&&d(o,["systemInstruction"],tt(c));const f=u(t,["temperature"]);f!=null&&d(s,["temperature"],f);const h=u(t,["topP"]);h!=null&&d(s,["topP"],h);const y=u(t,["topK"]);y!=null&&d(s,["topK"],y);const p=u(t,["candidateCount"]);p!=null&&d(s,["candidateCount"],p);const x=u(t,["maxOutputTokens"]);x!=null&&d(s,["maxOutputTokens"],x);const E=u(t,["stopSequences"]);E!=null&&d(s,["stopSequences"],E);const S=u(t,["responseLogprobs"]);S!=null&&d(s,["responseLogprobs"],S);const b=u(t,["logprobs"]);b!=null&&d(s,["logprobs"],b);const C=u(t,["presencePenalty"]);C!=null&&d(s,["presencePenalty"],C);const I=u(t,["frequencyPenalty"]);I!=null&&d(s,["frequencyPenalty"],I);const w=u(t,["seed"]);w!=null&&d(s,["seed"],w);const G=u(t,["responseMimeType"]);G!=null&&d(s,["responseMimeType"],G);const V=u(t,["responseSchema"]);V!=null&&d(s,["responseSchema"],Pc(V));const P=u(t,["responseJsonSchema"]);P!=null&&d(s,["responseJsonSchema"],P);const Y=u(t,["routingConfig"]);Y!=null&&d(s,["routingConfig"],Y);const X=u(t,["modelSelectionConfig"]);X!=null&&d(s,["modelConfig"],X);const B=u(t,["safetySettings"]);if(o!==void 0&&B!=null){let ne=B;Array.isArray(ne)&&(ne=ne.map(xe=>xe)),d(o,["safetySettings"],ne)}const j=u(t,["tools"]);if(o!==void 0&&j!=null){let ne=go(j);Array.isArray(ne)&&(ne=ne.map(xe=>j0(ho(xe)))),d(o,["tools"],ne)}const le=u(t,["toolConfig"]);o!==void 0&&le!=null&&d(o,["toolConfig"],le);const Z=u(t,["labels"]);o!==void 0&&Z!=null&&d(o,["labels"],Z);const ae=u(t,["cachedContent"]);o!==void 0&&ae!=null&&d(o,["cachedContent"],An(n,ae));const be=u(t,["responseModalities"]);be!=null&&d(s,["responseModalities"],be);const Re=u(t,["mediaResolution"]);Re!=null&&d(s,["mediaResolution"],Re);const Ve=u(t,["speechConfig"]);Ve!=null&&d(s,["speechConfig"],Gc(Ve));const ke=u(t,["audioTimestamp"]);ke!=null&&d(s,["audioTimestamp"],ke);const Ze=u(t,["thinkingConfig"]);Ze!=null&&d(s,["thinkingConfig"],Ze);const z=u(t,["imageConfig"]);if(z!=null&&d(s,["imageConfig"],dA(z)),u(t,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");const K=u(t,["modelArmorConfig"]);return o!==void 0&&K!=null&&d(o,["modelArmorConfig"],K),s}function wg(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["contents"]);if(c!=null){let h=Mt(c);Array.isArray(h)&&(h=h.map(y=>bl(y))),d(a,["contents"],h)}const f=u(t,["config"]);return f!=null&&d(a,["generationConfig"],GN(n,f,a)),a}function Rg(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["contents"]);if(c!=null){let h=Mt(c);Array.isArray(h)&&(h=h.map(y=>y)),d(a,["contents"],h)}const f=u(t,["config"]);return f!=null&&d(a,["generationConfig"],qN(n,f,a)),a}function Mg(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["candidates"]);if(s!=null){let p=s;Array.isArray(p)&&(p=p.map(x=>aN(x))),d(o,["candidates"],p)}const c=u(n,["modelVersion"]);c!=null&&d(o,["modelVersion"],c);const f=u(n,["promptFeedback"]);f!=null&&d(o,["promptFeedback"],f);const h=u(n,["responseId"]);h!=null&&d(o,["responseId"],h);const y=u(n,["usageMetadata"]);return y!=null&&d(o,["usageMetadata"],y),o}function Ig(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["candidates"]);if(s!=null){let x=s;Array.isArray(x)&&(x=x.map(E=>E)),d(o,["candidates"],x)}const c=u(n,["createTime"]);c!=null&&d(o,["createTime"],c);const f=u(n,["modelVersion"]);f!=null&&d(o,["modelVersion"],f);const h=u(n,["promptFeedback"]);h!=null&&d(o,["promptFeedback"],h);const y=u(n,["responseId"]);y!=null&&d(o,["responseId"],y);const p=u(n,["usageMetadata"]);return p!=null&&d(o,["usageMetadata"],p),o}function VN(n,t,o){const a={};if(u(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(u(n,["negativePrompt"])!==void 0)throw new Error("negativePrompt parameter is not supported in Gemini API.");const s=u(n,["numberOfImages"]);t!==void 0&&s!=null&&d(t,["parameters","sampleCount"],s);const c=u(n,["aspectRatio"]);t!==void 0&&c!=null&&d(t,["parameters","aspectRatio"],c);const f=u(n,["guidanceScale"]);if(t!==void 0&&f!=null&&d(t,["parameters","guidanceScale"],f),u(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const h=u(n,["safetyFilterLevel"]);t!==void 0&&h!=null&&d(t,["parameters","safetySetting"],h);const y=u(n,["personGeneration"]);t!==void 0&&y!=null&&d(t,["parameters","personGeneration"],y);const p=u(n,["includeSafetyAttributes"]);t!==void 0&&p!=null&&d(t,["parameters","includeSafetyAttributes"],p);const x=u(n,["includeRaiReason"]);t!==void 0&&x!=null&&d(t,["parameters","includeRaiReason"],x);const E=u(n,["language"]);t!==void 0&&E!=null&&d(t,["parameters","language"],E);const S=u(n,["outputMimeType"]);t!==void 0&&S!=null&&d(t,["parameters","outputOptions","mimeType"],S);const b=u(n,["outputCompressionQuality"]);if(t!==void 0&&b!=null&&d(t,["parameters","outputOptions","compressionQuality"],b),u(n,["addWatermark"])!==void 0)throw new Error("addWatermark parameter is not supported in Gemini API.");if(u(n,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");const C=u(n,["imageSize"]);if(t!==void 0&&C!=null&&d(t,["parameters","sampleImageSize"],C),u(n,["enhancePrompt"])!==void 0)throw new Error("enhancePrompt parameter is not supported in Gemini API.");return a}function HN(n,t,o){const a={},s=u(n,["outputGcsUri"]);t!==void 0&&s!=null&&d(t,["parameters","storageUri"],s);const c=u(n,["negativePrompt"]);t!==void 0&&c!=null&&d(t,["parameters","negativePrompt"],c);const f=u(n,["numberOfImages"]);t!==void 0&&f!=null&&d(t,["parameters","sampleCount"],f);const h=u(n,["aspectRatio"]);t!==void 0&&h!=null&&d(t,["parameters","aspectRatio"],h);const y=u(n,["guidanceScale"]);t!==void 0&&y!=null&&d(t,["parameters","guidanceScale"],y);const p=u(n,["seed"]);t!==void 0&&p!=null&&d(t,["parameters","seed"],p);const x=u(n,["safetyFilterLevel"]);t!==void 0&&x!=null&&d(t,["parameters","safetySetting"],x);const E=u(n,["personGeneration"]);t!==void 0&&E!=null&&d(t,["parameters","personGeneration"],E);const S=u(n,["includeSafetyAttributes"]);t!==void 0&&S!=null&&d(t,["parameters","includeSafetyAttributes"],S);const b=u(n,["includeRaiReason"]);t!==void 0&&b!=null&&d(t,["parameters","includeRaiReason"],b);const C=u(n,["language"]);t!==void 0&&C!=null&&d(t,["parameters","language"],C);const I=u(n,["outputMimeType"]);t!==void 0&&I!=null&&d(t,["parameters","outputOptions","mimeType"],I);const w=u(n,["outputCompressionQuality"]);t!==void 0&&w!=null&&d(t,["parameters","outputOptions","compressionQuality"],w);const G=u(n,["addWatermark"]);t!==void 0&&G!=null&&d(t,["parameters","addWatermark"],G);const V=u(n,["labels"]);t!==void 0&&V!=null&&d(t,["labels"],V);const P=u(n,["imageSize"]);t!==void 0&&P!=null&&d(t,["parameters","sampleImageSize"],P);const Y=u(n,["enhancePrompt"]);return t!==void 0&&Y!=null&&d(t,["parameters","enhancePrompt"],Y),a}function zN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["prompt"]);c!=null&&d(a,["instances[0]","prompt"],c);const f=u(t,["config"]);return f!=null&&VN(f,a),a}function ON(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["prompt"]);c!=null&&d(a,["instances[0]","prompt"],c);const f=u(t,["config"]);return f!=null&&HN(f,a),a}function BN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["predictions"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(h=>tA(h))),d(o,["generatedImages"],f)}const c=u(n,["positivePromptSafetyAttributes"]);return c!=null&&d(o,["positivePromptSafetyAttributes"],J0(c)),o}function FN(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["predictions"]);if(s!=null){let f=s;Array.isArray(f)&&(f=f.map(h=>ms(h))),d(o,["generatedImages"],f)}const c=u(n,["positivePromptSafetyAttributes"]);return c!=null&&d(o,["positivePromptSafetyAttributes"],Y0(c)),o}function JN(n,t,o){const a={},s=u(n,["numberOfVideos"]);if(t!==void 0&&s!=null&&d(t,["parameters","sampleCount"],s),u(n,["outputGcsUri"])!==void 0)throw new Error("outputGcsUri parameter is not supported in Gemini API.");if(u(n,["fps"])!==void 0)throw new Error("fps parameter is not supported in Gemini API.");const c=u(n,["durationSeconds"]);if(t!==void 0&&c!=null&&d(t,["parameters","durationSeconds"],c),u(n,["seed"])!==void 0)throw new Error("seed parameter is not supported in Gemini API.");const f=u(n,["aspectRatio"]);t!==void 0&&f!=null&&d(t,["parameters","aspectRatio"],f);const h=u(n,["resolution"]);t!==void 0&&h!=null&&d(t,["parameters","resolution"],h);const y=u(n,["personGeneration"]);if(t!==void 0&&y!=null&&d(t,["parameters","personGeneration"],y),u(n,["pubsubTopic"])!==void 0)throw new Error("pubsubTopic parameter is not supported in Gemini API.");const p=u(n,["negativePrompt"]);t!==void 0&&p!=null&&d(t,["parameters","negativePrompt"],p);const x=u(n,["enhancePrompt"]);if(t!==void 0&&x!=null&&d(t,["parameters","enhancePrompt"],x),u(n,["generateAudio"])!==void 0)throw new Error("generateAudio parameter is not supported in Gemini API.");const E=u(n,["lastFrame"]);t!==void 0&&E!=null&&d(t,["instances[0]","lastFrame"],ps(E));const S=u(n,["referenceImages"]);if(t!==void 0&&S!=null){let b=S;Array.isArray(b)&&(b=b.map(C=>jA(C))),d(t,["instances[0]","referenceImages"],b)}if(u(n,["mask"])!==void 0)throw new Error("mask parameter is not supported in Gemini API.");if(u(n,["compressionQuality"])!==void 0)throw new Error("compressionQuality parameter is not supported in Gemini API.");return a}function YN(n,t,o){const a={},s=u(n,["numberOfVideos"]);t!==void 0&&s!=null&&d(t,["parameters","sampleCount"],s);const c=u(n,["outputGcsUri"]);t!==void 0&&c!=null&&d(t,["parameters","storageUri"],c);const f=u(n,["fps"]);t!==void 0&&f!=null&&d(t,["parameters","fps"],f);const h=u(n,["durationSeconds"]);t!==void 0&&h!=null&&d(t,["parameters","durationSeconds"],h);const y=u(n,["seed"]);t!==void 0&&y!=null&&d(t,["parameters","seed"],y);const p=u(n,["aspectRatio"]);t!==void 0&&p!=null&&d(t,["parameters","aspectRatio"],p);const x=u(n,["resolution"]);t!==void 0&&x!=null&&d(t,["parameters","resolution"],x);const E=u(n,["personGeneration"]);t!==void 0&&E!=null&&d(t,["parameters","personGeneration"],E);const S=u(n,["pubsubTopic"]);t!==void 0&&S!=null&&d(t,["parameters","pubsubTopic"],S);const b=u(n,["negativePrompt"]);t!==void 0&&b!=null&&d(t,["parameters","negativePrompt"],b);const C=u(n,["enhancePrompt"]);t!==void 0&&C!=null&&d(t,["parameters","enhancePrompt"],C);const I=u(n,["generateAudio"]);t!==void 0&&I!=null&&d(t,["parameters","generateAudio"],I);const w=u(n,["lastFrame"]);t!==void 0&&w!=null&&d(t,["instances[0]","lastFrame"],$t(w));const G=u(n,["referenceImages"]);if(t!==void 0&&G!=null){let Y=G;Array.isArray(Y)&&(Y=Y.map(X=>KA(X))),d(t,["instances[0]","referenceImages"],Y)}const V=u(n,["mask"]);t!==void 0&&V!=null&&d(t,["instances[0]","mask"],YA(V));const P=u(n,["compressionQuality"]);return t!==void 0&&P!=null&&d(t,["parameters","compressionQuality"],P),a}function jN(n,t){const o={},a=u(n,["name"]);a!=null&&d(o,["name"],a);const s=u(n,["metadata"]);s!=null&&d(o,["metadata"],s);const c=u(n,["done"]);c!=null&&d(o,["done"],c);const f=u(n,["error"]);f!=null&&d(o,["error"],f);const h=u(n,["response","generateVideoResponse"]);return h!=null&&d(o,["response"],QN(h)),o}function KN(n,t){const o={},a=u(n,["name"]);a!=null&&d(o,["name"],a);const s=u(n,["metadata"]);s!=null&&d(o,["metadata"],s);const c=u(n,["done"]);c!=null&&d(o,["done"],c);const f=u(n,["error"]);f!=null&&d(o,["error"],f);const h=u(n,["response"]);return h!=null&&d(o,["response"],ZN(h)),o}function XN(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["prompt"]);c!=null&&d(a,["instances[0]","prompt"],c);const f=u(t,["image"]);f!=null&&d(a,["instances[0]","image"],ps(f));const h=u(t,["video"]);h!=null&&d(a,["instances[0]","video"],K0(h));const y=u(t,["source"]);y!=null&&WN(y,a);const p=u(t,["config"]);return p!=null&&JN(p,a),a}function $N(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["prompt"]);c!=null&&d(a,["instances[0]","prompt"],c);const f=u(t,["image"]);f!=null&&d(a,["instances[0]","image"],$t(f));const h=u(t,["video"]);h!=null&&d(a,["instances[0]","video"],X0(h));const y=u(t,["source"]);y!=null&&eA(y,a);const p=u(t,["config"]);return p!=null&&YN(p,a),a}function QN(n,t){const o={},a=u(n,["generatedSamples"]);if(a!=null){let f=a;Array.isArray(f)&&(f=f.map(h=>iA(h))),d(o,["generatedVideos"],f)}const s=u(n,["raiMediaFilteredCount"]);s!=null&&d(o,["raiMediaFilteredCount"],s);const c=u(n,["raiMediaFilteredReasons"]);return c!=null&&d(o,["raiMediaFilteredReasons"],c),o}function ZN(n,t){const o={},a=u(n,["videos"]);if(a!=null){let f=a;Array.isArray(f)&&(f=f.map(h=>oA(h))),d(o,["generatedVideos"],f)}const s=u(n,["raiMediaFilteredCount"]);s!=null&&d(o,["raiMediaFilteredCount"],s);const c=u(n,["raiMediaFilteredReasons"]);return c!=null&&d(o,["raiMediaFilteredReasons"],c),o}function WN(n,t,o){const a={},s=u(n,["prompt"]);t!==void 0&&s!=null&&d(t,["instances[0]","prompt"],s);const c=u(n,["image"]);t!==void 0&&c!=null&&d(t,["instances[0]","image"],ps(c));const f=u(n,["video"]);return t!==void 0&&f!=null&&d(t,["instances[0]","video"],K0(f)),a}function eA(n,t,o){const a={},s=u(n,["prompt"]);t!==void 0&&s!=null&&d(t,["instances[0]","prompt"],s);const c=u(n,["image"]);t!==void 0&&c!=null&&d(t,["instances[0]","image"],$t(c));const f=u(n,["video"]);return t!==void 0&&f!=null&&d(t,["instances[0]","video"],X0(f)),a}function tA(n,t){const o={},a=u(n,["_self"]);a!=null&&d(o,["image"],fA(a));const s=u(n,["raiFilteredReason"]);s!=null&&d(o,["raiFilteredReason"],s);const c=u(n,["_self"]);return c!=null&&d(o,["safetyAttributes"],J0(c)),o}function ms(n,t){const o={},a=u(n,["_self"]);a!=null&&d(o,["image"],F0(a));const s=u(n,["raiFilteredReason"]);s!=null&&d(o,["raiFilteredReason"],s);const c=u(n,["_self"]);c!=null&&d(o,["safetyAttributes"],Y0(c));const f=u(n,["prompt"]);return f!=null&&d(o,["enhancedPrompt"],f),o}function nA(n,t){const o={},a=u(n,["_self"]);a!=null&&d(o,["mask"],F0(a));const s=u(n,["labels"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(o,["labels"],c)}return o}function iA(n,t){const o={},a=u(n,["video"]);return a!=null&&d(o,["video"],FA(a)),o}function oA(n,t){const o={},a=u(n,["_self"]);return a!=null&&d(o,["video"],JA(a)),o}function lA(n,t){const o={},a=u(n,["modelSelectionConfig"]);a!=null&&d(o,["modelConfig"],a);const s=u(n,["responseJsonSchema"]);s!=null&&d(o,["responseJsonSchema"],s);const c=u(n,["audioTimestamp"]);c!=null&&d(o,["audioTimestamp"],c);const f=u(n,["candidateCount"]);f!=null&&d(o,["candidateCount"],f);const h=u(n,["enableAffectiveDialog"]);h!=null&&d(o,["enableAffectiveDialog"],h);const y=u(n,["frequencyPenalty"]);y!=null&&d(o,["frequencyPenalty"],y);const p=u(n,["logprobs"]);p!=null&&d(o,["logprobs"],p);const x=u(n,["maxOutputTokens"]);x!=null&&d(o,["maxOutputTokens"],x);const E=u(n,["mediaResolution"]);E!=null&&d(o,["mediaResolution"],E);const S=u(n,["presencePenalty"]);S!=null&&d(o,["presencePenalty"],S);const b=u(n,["responseLogprobs"]);b!=null&&d(o,["responseLogprobs"],b);const C=u(n,["responseMimeType"]);C!=null&&d(o,["responseMimeType"],C);const I=u(n,["responseModalities"]);I!=null&&d(o,["responseModalities"],I);const w=u(n,["responseSchema"]);w!=null&&d(o,["responseSchema"],w);const G=u(n,["routingConfig"]);G!=null&&d(o,["routingConfig"],G);const V=u(n,["seed"]);V!=null&&d(o,["seed"],V);const P=u(n,["speechConfig"]);P!=null&&d(o,["speechConfig"],P);const Y=u(n,["stopSequences"]);Y!=null&&d(o,["stopSequences"],Y);const X=u(n,["temperature"]);X!=null&&d(o,["temperature"],X);const B=u(n,["thinkingConfig"]);B!=null&&d(o,["thinkingConfig"],B);const j=u(n,["topK"]);j!=null&&d(o,["topK"],j);const le=u(n,["topP"]);if(le!=null&&d(o,["topP"],le),u(n,["enableEnhancedCivicAnswers"])!==void 0)throw new Error("enableEnhancedCivicAnswers parameter is not supported in Vertex AI.");return o}function aA(n,t,o){const a={},s=u(t,["model"]);return s!=null&&d(a,["_url","name"],_e(n,s)),a}function sA(n,t,o){const a={},s=u(t,["model"]);return s!=null&&d(a,["_url","name"],_e(n,s)),a}function rA(n,t){const o={};if(u(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const a=u(n,["enableWidget"]);return a!=null&&d(o,["enableWidget"],a),o}function uA(n,t){const o={};if(u(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(u(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const a=u(n,["timeRangeFilter"]);return a!=null&&d(o,["timeRangeFilter"],a),o}function cA(n,t){const o={},a=u(n,["aspectRatio"]);a!=null&&d(o,["aspectRatio"],a);const s=u(n,["imageSize"]);if(s!=null&&d(o,["imageSize"],s),u(n,["personGeneration"])!==void 0)throw new Error("personGeneration parameter is not supported in Gemini API.");if(u(n,["outputMimeType"])!==void 0)throw new Error("outputMimeType parameter is not supported in Gemini API.");if(u(n,["outputCompressionQuality"])!==void 0)throw new Error("outputCompressionQuality parameter is not supported in Gemini API.");return o}function dA(n,t){const o={},a=u(n,["aspectRatio"]);a!=null&&d(o,["aspectRatio"],a);const s=u(n,["imageSize"]);s!=null&&d(o,["imageSize"],s);const c=u(n,["personGeneration"]);c!=null&&d(o,["personGeneration"],c);const f=u(n,["outputMimeType"]);f!=null&&d(o,["imageOutputOptions","mimeType"],f);const h=u(n,["outputCompressionQuality"]);return h!=null&&d(o,["imageOutputOptions","compressionQuality"],h),o}function fA(n,t){const o={},a=u(n,["bytesBase64Encoded"]);a!=null&&d(o,["imageBytes"],ei(a));const s=u(n,["mimeType"]);return s!=null&&d(o,["mimeType"],s),o}function F0(n,t){const o={},a=u(n,["gcsUri"]);a!=null&&d(o,["gcsUri"],a);const s=u(n,["bytesBase64Encoded"]);s!=null&&d(o,["imageBytes"],ei(s));const c=u(n,["mimeType"]);return c!=null&&d(o,["mimeType"],c),o}function ps(n,t){const o={};if(u(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");const a=u(n,["imageBytes"]);a!=null&&d(o,["bytesBase64Encoded"],ei(a));const s=u(n,["mimeType"]);return s!=null&&d(o,["mimeType"],s),o}function $t(n,t){const o={},a=u(n,["gcsUri"]);a!=null&&d(o,["gcsUri"],a);const s=u(n,["imageBytes"]);s!=null&&d(o,["bytesBase64Encoded"],ei(s));const c=u(n,["mimeType"]);return c!=null&&d(o,["mimeType"],c),o}function mA(n,t,o,a){const s={},c=u(t,["pageSize"]);o!==void 0&&c!=null&&d(o,["_query","pageSize"],c);const f=u(t,["pageToken"]);o!==void 0&&f!=null&&d(o,["_query","pageToken"],f);const h=u(t,["filter"]);o!==void 0&&h!=null&&d(o,["_query","filter"],h);const y=u(t,["queryBase"]);return o!==void 0&&y!=null&&d(o,["_url","models_url"],G0(n,y)),s}function pA(n,t,o,a){const s={},c=u(t,["pageSize"]);o!==void 0&&c!=null&&d(o,["_query","pageSize"],c);const f=u(t,["pageToken"]);o!==void 0&&f!=null&&d(o,["_query","pageToken"],f);const h=u(t,["filter"]);o!==void 0&&h!=null&&d(o,["_query","filter"],h);const y=u(t,["queryBase"]);return o!==void 0&&y!=null&&d(o,["_url","models_url"],G0(n,y)),s}function hA(n,t,o){const a={},s=u(t,["config"]);return s!=null&&mA(n,s,a),a}function gA(n,t,o){const a={},s=u(t,["config"]);return s!=null&&pA(n,s,a),a}function yA(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["nextPageToken"]);s!=null&&d(o,["nextPageToken"],s);const c=u(n,["_self"]);if(c!=null){let f=q0(c);Array.isArray(f)&&(f=f.map(h=>rc(h))),d(o,["models"],f)}return o}function vA(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["nextPageToken"]);s!=null&&d(o,["nextPageToken"],s);const c=u(n,["_self"]);if(c!=null){let f=q0(c);Array.isArray(f)&&(f=f.map(h=>uc(h))),d(o,["models"],f)}return o}function xA(n,t){const o={},a=u(n,["maskMode"]);a!=null&&d(o,["maskMode"],a);const s=u(n,["segmentationClasses"]);s!=null&&d(o,["maskClasses"],s);const c=u(n,["maskDilation"]);return c!=null&&d(o,["dilation"],c),o}function rc(n,t){const o={},a=u(n,["name"]);a!=null&&d(o,["name"],a);const s=u(n,["displayName"]);s!=null&&d(o,["displayName"],s);const c=u(n,["description"]);c!=null&&d(o,["description"],c);const f=u(n,["version"]);f!=null&&d(o,["version"],f);const h=u(n,["_self"]);h!=null&&d(o,["tunedModelInfo"],kA(h));const y=u(n,["inputTokenLimit"]);y!=null&&d(o,["inputTokenLimit"],y);const p=u(n,["outputTokenLimit"]);p!=null&&d(o,["outputTokenLimit"],p);const x=u(n,["supportedGenerationMethods"]);x!=null&&d(o,["supportedActions"],x);const E=u(n,["temperature"]);E!=null&&d(o,["temperature"],E);const S=u(n,["maxTemperature"]);S!=null&&d(o,["maxTemperature"],S);const b=u(n,["topP"]);b!=null&&d(o,["topP"],b);const C=u(n,["topK"]);C!=null&&d(o,["topK"],C);const I=u(n,["thinking"]);return I!=null&&d(o,["thinking"],I),o}function uc(n,t){const o={},a=u(n,["name"]);a!=null&&d(o,["name"],a);const s=u(n,["displayName"]);s!=null&&d(o,["displayName"],s);const c=u(n,["description"]);c!=null&&d(o,["description"],c);const f=u(n,["versionId"]);f!=null&&d(o,["version"],f);const h=u(n,["deployedModels"]);if(h!=null){let S=h;Array.isArray(S)&&(S=S.map(b=>DN(b))),d(o,["endpoints"],S)}const y=u(n,["labels"]);y!=null&&d(o,["labels"],y);const p=u(n,["_self"]);p!=null&&d(o,["tunedModelInfo"],PA(p));const x=u(n,["defaultCheckpointId"]);x!=null&&d(o,["defaultCheckpointId"],x);const E=u(n,["checkpoints"]);if(E!=null){let S=E;Array.isArray(S)&&(S=S.map(b=>b)),d(o,["checkpoints"],S)}return o}function EA(n,t){const o={},a=u(n,["mediaResolution"]);a!=null&&d(o,["mediaResolution"],a);const s=u(n,["codeExecutionResult"]);s!=null&&d(o,["codeExecutionResult"],s);const c=u(n,["executableCode"]);c!=null&&d(o,["executableCode"],c);const f=u(n,["fileData"]);f!=null&&d(o,["fileData"],UN(f));const h=u(n,["functionCall"]);h!=null&&d(o,["functionCall"],LN(h));const y=u(n,["functionResponse"]);y!=null&&d(o,["functionResponse"],y);const p=u(n,["inlineData"]);p!=null&&d(o,["inlineData"],lN(p));const x=u(n,["text"]);x!=null&&d(o,["text"],x);const E=u(n,["thought"]);E!=null&&d(o,["thought"],E);const S=u(n,["thoughtSignature"]);S!=null&&d(o,["thoughtSignature"],S);const b=u(n,["videoMetadata"]);return b!=null&&d(o,["videoMetadata"],b),o}function TA(n,t){const o={},a=u(n,["productImage"]);return a!=null&&d(o,["image"],$t(a)),o}function SA(n,t,o){const a={},s=u(n,["numberOfImages"]);t!==void 0&&s!=null&&d(t,["parameters","sampleCount"],s);const c=u(n,["baseSteps"]);t!==void 0&&c!=null&&d(t,["parameters","baseSteps"],c);const f=u(n,["outputGcsUri"]);t!==void 0&&f!=null&&d(t,["parameters","storageUri"],f);const h=u(n,["seed"]);t!==void 0&&h!=null&&d(t,["parameters","seed"],h);const y=u(n,["safetyFilterLevel"]);t!==void 0&&y!=null&&d(t,["parameters","safetySetting"],y);const p=u(n,["personGeneration"]);t!==void 0&&p!=null&&d(t,["parameters","personGeneration"],p);const x=u(n,["addWatermark"]);t!==void 0&&x!=null&&d(t,["parameters","addWatermark"],x);const E=u(n,["outputMimeType"]);t!==void 0&&E!=null&&d(t,["parameters","outputOptions","mimeType"],E);const S=u(n,["outputCompressionQuality"]);t!==void 0&&S!=null&&d(t,["parameters","outputOptions","compressionQuality"],S);const b=u(n,["enhancePrompt"]);t!==void 0&&b!=null&&d(t,["parameters","enhancePrompt"],b);const C=u(n,["labels"]);return t!==void 0&&C!=null&&d(t,["labels"],C),a}function _A(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["source"]);c!=null&&CA(c,a);const f=u(t,["config"]);return f!=null&&SA(f,a),a}function bA(n,t){const o={},a=u(n,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(c=>ms(c))),d(o,["generatedImages"],s)}return o}function CA(n,t,o){const a={},s=u(n,["prompt"]);t!==void 0&&s!=null&&d(t,["instances[0]","prompt"],s);const c=u(n,["personImage"]);t!==void 0&&c!=null&&d(t,["instances[0]","personImage","image"],$t(c));const f=u(n,["productImages"]);if(t!==void 0&&f!=null){let h=f;Array.isArray(h)&&(h=h.map(y=>TA(y))),d(t,["instances[0]","productImages"],h)}return a}function NA(n,t){const o={},a=u(n,["referenceImage"]);a!=null&&d(o,["referenceImage"],$t(a));const s=u(n,["referenceId"]);s!=null&&d(o,["referenceId"],s);const c=u(n,["referenceType"]);c!=null&&d(o,["referenceType"],c);const f=u(n,["maskImageConfig"]);f!=null&&d(o,["maskImageConfig"],xA(f));const h=u(n,["controlImageConfig"]);h!=null&&d(o,["controlImageConfig"],fN(h));const y=u(n,["styleImageConfig"]);y!=null&&d(o,["styleImageConfig"],y);const p=u(n,["subjectImageConfig"]);return p!=null&&d(o,["subjectImageConfig"],p),o}function J0(n,t){const o={},a=u(n,["safetyAttributes","categories"]);a!=null&&d(o,["categories"],a);const s=u(n,["safetyAttributes","scores"]);s!=null&&d(o,["scores"],s);const c=u(n,["contentType"]);return c!=null&&d(o,["contentType"],c),o}function Y0(n,t){const o={},a=u(n,["safetyAttributes","categories"]);a!=null&&d(o,["categories"],a);const s=u(n,["safetyAttributes","scores"]);s!=null&&d(o,["scores"],s);const c=u(n,["contentType"]);return c!=null&&d(o,["contentType"],c),o}function AA(n,t){const o={},a=u(n,["category"]);if(a!=null&&d(o,["category"],a),u(n,["method"])!==void 0)throw new Error("method parameter is not supported in Gemini API.");const s=u(n,["threshold"]);return s!=null&&d(o,["threshold"],s),o}function wA(n,t){const o={},a=u(n,["image"]);return a!=null&&d(o,["image"],$t(a)),o}function RA(n,t,o){const a={},s=u(n,["mode"]);t!==void 0&&s!=null&&d(t,["parameters","mode"],s);const c=u(n,["maxPredictions"]);t!==void 0&&c!=null&&d(t,["parameters","maxPredictions"],c);const f=u(n,["confidenceThreshold"]);t!==void 0&&f!=null&&d(t,["parameters","confidenceThreshold"],f);const h=u(n,["maskDilation"]);t!==void 0&&h!=null&&d(t,["parameters","maskDilation"],h);const y=u(n,["binaryColorThreshold"]);t!==void 0&&y!=null&&d(t,["parameters","binaryColorThreshold"],y);const p=u(n,["labels"]);return t!==void 0&&p!=null&&d(t,["labels"],p),a}function MA(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["source"]);c!=null&&DA(c,a);const f=u(t,["config"]);return f!=null&&RA(f,a),a}function IA(n,t){const o={},a=u(n,["predictions"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(c=>nA(c))),d(o,["generatedMasks"],s)}return o}function DA(n,t,o){const a={},s=u(n,["prompt"]);t!==void 0&&s!=null&&d(t,["instances[0]","prompt"],s);const c=u(n,["image"]);t!==void 0&&c!=null&&d(t,["instances[0]","image"],$t(c));const f=u(n,["scribbleImage"]);return t!==void 0&&f!=null&&d(t,["instances[0]","scribble"],wA(f)),a}function UA(n,t){const o={},a=u(n,["retrievalConfig"]);a!=null&&d(o,["retrievalConfig"],a);const s=u(n,["functionCallingConfig"]);return s!=null&&d(o,["functionCallingConfig"],kN(s)),o}function LA(n,t){const o={};if(u(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const a=u(n,["computerUse"]);a!=null&&d(o,["computerUse"],a);const s=u(n,["fileSearch"]);s!=null&&d(o,["fileSearch"],s);const c=u(n,["codeExecution"]);if(c!=null&&d(o,["codeExecution"],c),u(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const f=u(n,["functionDeclarations"]);if(f!=null){let E=f;Array.isArray(E)&&(E=E.map(S=>S)),d(o,["functionDeclarations"],E)}const h=u(n,["googleMaps"]);h!=null&&d(o,["googleMaps"],rA(h));const y=u(n,["googleSearch"]);y!=null&&d(o,["googleSearch"],uA(y));const p=u(n,["googleSearchRetrieval"]);p!=null&&d(o,["googleSearchRetrieval"],p);const x=u(n,["urlContext"]);return x!=null&&d(o,["urlContext"],x),o}function j0(n,t){const o={},a=u(n,["retrieval"]);a!=null&&d(o,["retrieval"],a);const s=u(n,["computerUse"]);if(s!=null&&d(o,["computerUse"],s),u(n,["fileSearch"])!==void 0)throw new Error("fileSearch parameter is not supported in Vertex AI.");const c=u(n,["codeExecution"]);c!=null&&d(o,["codeExecution"],c);const f=u(n,["enterpriseWebSearch"]);f!=null&&d(o,["enterpriseWebSearch"],f);const h=u(n,["functionDeclarations"]);if(h!=null){let S=h;Array.isArray(S)&&(S=S.map(b=>PN(b))),d(o,["functionDeclarations"],S)}const y=u(n,["googleMaps"]);y!=null&&d(o,["googleMaps"],y);const p=u(n,["googleSearch"]);p!=null&&d(o,["googleSearch"],p);const x=u(n,["googleSearchRetrieval"]);x!=null&&d(o,["googleSearchRetrieval"],x);const E=u(n,["urlContext"]);return E!=null&&d(o,["urlContext"],E),o}function kA(n,t){const o={},a=u(n,["baseModel"]);a!=null&&d(o,["baseModel"],a);const s=u(n,["createTime"]);s!=null&&d(o,["createTime"],s);const c=u(n,["updateTime"]);return c!=null&&d(o,["updateTime"],c),o}function PA(n,t){const o={},a=u(n,["labels","google-vertex-llm-tuning-base-model-id"]);a!=null&&d(o,["baseModel"],a);const s=u(n,["createTime"]);s!=null&&d(o,["createTime"],s);const c=u(n,["updateTime"]);return c!=null&&d(o,["updateTime"],c),o}function GA(n,t,o){const a={},s=u(n,["displayName"]);t!==void 0&&s!=null&&d(t,["displayName"],s);const c=u(n,["description"]);t!==void 0&&c!=null&&d(t,["description"],c);const f=u(n,["defaultCheckpointId"]);return t!==void 0&&f!=null&&d(t,["defaultCheckpointId"],f),a}function qA(n,t,o){const a={},s=u(n,["displayName"]);t!==void 0&&s!=null&&d(t,["displayName"],s);const c=u(n,["description"]);t!==void 0&&c!=null&&d(t,["description"],c);const f=u(n,["defaultCheckpointId"]);return t!==void 0&&f!=null&&d(t,["defaultCheckpointId"],f),a}function VA(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","name"],_e(n,s));const c=u(t,["config"]);return c!=null&&GA(c,a),a}function HA(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["config"]);return c!=null&&qA(c,a),a}function zA(n,t,o){const a={},s=u(n,["outputGcsUri"]);t!==void 0&&s!=null&&d(t,["parameters","storageUri"],s);const c=u(n,["safetyFilterLevel"]);t!==void 0&&c!=null&&d(t,["parameters","safetySetting"],c);const f=u(n,["personGeneration"]);t!==void 0&&f!=null&&d(t,["parameters","personGeneration"],f);const h=u(n,["includeRaiReason"]);t!==void 0&&h!=null&&d(t,["parameters","includeRaiReason"],h);const y=u(n,["outputMimeType"]);t!==void 0&&y!=null&&d(t,["parameters","outputOptions","mimeType"],y);const p=u(n,["outputCompressionQuality"]);t!==void 0&&p!=null&&d(t,["parameters","outputOptions","compressionQuality"],p);const x=u(n,["enhanceInputImage"]);t!==void 0&&x!=null&&d(t,["parameters","upscaleConfig","enhanceInputImage"],x);const E=u(n,["imagePreservationFactor"]);t!==void 0&&E!=null&&d(t,["parameters","upscaleConfig","imagePreservationFactor"],E);const S=u(n,["labels"]);t!==void 0&&S!=null&&d(t,["labels"],S);const b=u(n,["numberOfImages"]);t!==void 0&&b!=null&&d(t,["parameters","sampleCount"],b);const C=u(n,["mode"]);return t!==void 0&&C!=null&&d(t,["parameters","mode"],C),a}function OA(n,t,o){const a={},s=u(t,["model"]);s!=null&&d(a,["_url","model"],_e(n,s));const c=u(t,["image"]);c!=null&&d(a,["instances[0]","image"],$t(c));const f=u(t,["upscaleFactor"]);f!=null&&d(a,["parameters","upscaleConfig","upscaleFactor"],f);const h=u(t,["config"]);return h!=null&&zA(h,a),a}function BA(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["predictions"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>ms(f))),d(o,["generatedImages"],c)}return o}function FA(n,t){const o={},a=u(n,["uri"]);a!=null&&d(o,["uri"],a);const s=u(n,["encodedVideo"]);s!=null&&d(o,["videoBytes"],ei(s));const c=u(n,["encoding"]);return c!=null&&d(o,["mimeType"],c),o}function JA(n,t){const o={},a=u(n,["gcsUri"]);a!=null&&d(o,["uri"],a);const s=u(n,["bytesBase64Encoded"]);s!=null&&d(o,["videoBytes"],ei(s));const c=u(n,["mimeType"]);return c!=null&&d(o,["mimeType"],c),o}function YA(n,t){const o={},a=u(n,["image"]);a!=null&&d(o,["_self"],$t(a));const s=u(n,["maskMode"]);return s!=null&&d(o,["maskMode"],s),o}function jA(n,t){const o={},a=u(n,["image"]);a!=null&&d(o,["image"],ps(a));const s=u(n,["referenceType"]);return s!=null&&d(o,["referenceType"],s),o}function KA(n,t){const o={},a=u(n,["image"]);a!=null&&d(o,["image"],$t(a));const s=u(n,["referenceType"]);return s!=null&&d(o,["referenceType"],s),o}function K0(n,t){const o={},a=u(n,["uri"]);a!=null&&d(o,["uri"],a);const s=u(n,["videoBytes"]);s!=null&&d(o,["encodedVideo"],ei(s));const c=u(n,["mimeType"]);return c!=null&&d(o,["encoding"],c),o}function X0(n,t){const o={},a=u(n,["uri"]);a!=null&&d(o,["gcsUri"],a);const s=u(n,["videoBytes"]);s!=null&&d(o,["bytesBase64Encoded"],ei(s));const c=u(n,["mimeType"]);return c!=null&&d(o,["mimeType"],c),o}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function XA(n,t){const o={},a=u(n,["displayName"]);return t!==void 0&&a!=null&&d(t,["displayName"],a),o}function $A(n){const t={},o=u(n,["config"]);return o!=null&&XA(o,t),t}function QA(n,t){const o={},a=u(n,["force"]);return t!==void 0&&a!=null&&d(t,["_query","force"],a),o}function ZA(n){const t={},o=u(n,["name"]);o!=null&&d(t,["_url","name"],o);const a=u(n,["config"]);return a!=null&&QA(a,t),t}function WA(n){const t={},o=u(n,["name"]);return o!=null&&d(t,["_url","name"],o),t}function e1(n,t){const o={},a=u(n,["customMetadata"]);if(t!==void 0&&a!=null){let c=a;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["customMetadata"],c)}const s=u(n,["chunkingConfig"]);return t!==void 0&&s!=null&&d(t,["chunkingConfig"],s),o}function t1(n){const t={},o=u(n,["name"]);o!=null&&d(t,["name"],o);const a=u(n,["metadata"]);a!=null&&d(t,["metadata"],a);const s=u(n,["done"]);s!=null&&d(t,["done"],s);const c=u(n,["error"]);c!=null&&d(t,["error"],c);const f=u(n,["response"]);return f!=null&&d(t,["response"],i1(f)),t}function n1(n){const t={},o=u(n,["fileSearchStoreName"]);o!=null&&d(t,["_url","file_search_store_name"],o);const a=u(n,["fileName"]);a!=null&&d(t,["fileName"],a);const s=u(n,["config"]);return s!=null&&e1(s,t),t}function i1(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["parent"]);a!=null&&d(t,["parent"],a);const s=u(n,["documentName"]);return s!=null&&d(t,["documentName"],s),t}function o1(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);return t!==void 0&&s!=null&&d(t,["_query","pageToken"],s),o}function l1(n){const t={},o=u(n,["config"]);return o!=null&&o1(o,t),t}function a1(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["fileSearchStores"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["fileSearchStores"],c)}return t}function $0(n,t){const o={},a=u(n,["mimeType"]);t!==void 0&&a!=null&&d(t,["mimeType"],a);const s=u(n,["displayName"]);t!==void 0&&s!=null&&d(t,["displayName"],s);const c=u(n,["customMetadata"]);if(t!==void 0&&c!=null){let h=c;Array.isArray(h)&&(h=h.map(y=>y)),d(t,["customMetadata"],h)}const f=u(n,["chunkingConfig"]);return t!==void 0&&f!=null&&d(t,["chunkingConfig"],f),o}function s1(n){const t={},o=u(n,["fileSearchStoreName"]);o!=null&&d(t,["_url","file_search_store_name"],o);const a=u(n,["config"]);return a!=null&&$0(a,t),t}function r1(n){const t={},o=u(n,["sdkHttpResponse"]);return o!=null&&d(t,["sdkHttpResponse"],o),t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const u1="Content-Type",c1="X-Server-Timeout",d1="User-Agent",cc="x-goog-api-client",f1="1.42.0",m1=`google-genai-sdk/${f1}`,p1="v1beta1",h1="v1beta",g1=5,y1=[408,429,500,502,503,504];class v1{constructor(t){var o,a,s;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 c={};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 h=t.project&&t.location||!!t.apiKey;this.customBaseUrl&&!h?(c.baseUrl=this.customBaseUrl,this.clientOptions.project=void 0,this.clientOptions.location=void 0):this.clientOptions.apiKey||this.clientOptions.location==="global"?c.baseUrl="https://aiplatform.googleapis.com/":this.clientOptions.project&&this.clientOptions.location&&(c.baseUrl=`https://${this.clientOptions.location}-aiplatform.googleapis.com/`),c.apiVersion=(a=this.clientOptions.apiVersion)!==null&&a!==void 0?a:p1}else{if(!this.clientOptions.apiKey)throw new El({message:"API key must be set when using the Gemini API.",status:403});c.apiVersion=(s=this.clientOptions.apiVersion)!==null&&s!==void 0?s:h1,c.baseUrl="https://generativelanguage.googleapis.com/"}c.headers=this.getDefaultHeaders(),this.clientOptions.httpOptions=c,t.httpOptions&&(this.clientOptions.httpOptions=this.patchHttpOptions(c,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 s=[this.getRequestUrlInternal(o)];return a&&s.push(this.getBaseResourcePath()),t!==""&&s.push(t),new URL(`${s.join("/")}`)}shouldPrependVertexProjectPath(t,o){return!(o.baseUrl&&o.baseUrlResourceScope===oc.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),s=this.constructUrl(t.path,o,a);if(t.queryParams)for(const[f,h]of Object.entries(t.queryParams))s.searchParams.append(f,String(h));let c={};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 c.body=t.body;return c=await this.includeExtraHttpOptionsToRequestInit(c,o,s.toString(),t.abortSignal),this.unaryApiCall(s,c,t.httpMethod)}patchHttpOptions(t,o){const a=JSON.parse(JSON.stringify(t));for(const[s,c]of Object.entries(o))typeof c=="object"?a[s]=Object.assign(Object.assign({},a[s]),c):c!==void 0&&(a[s]=c);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),s=this.constructUrl(t.path,o,a);(!s.searchParams.has("alt")||s.searchParams.get("alt")!=="sse")&&s.searchParams.set("alt","sse");let c={};return c.body=t.body,c=await this.includeExtraHttpOptionsToRequestInit(c,o,s.toString(),t.abortSignal),this.streamApiCall(s,c,t.httpMethod)}async includeExtraHttpOptionsToRequestInit(t,o,a,s){if(o&&o.timeout||s){const c=new AbortController,f=c.signal;if(o.timeout&&(o==null?void 0:o.timeout)>0){const h=setTimeout(()=>c.abort(),o.timeout);h&&typeof h.unref=="function"&&h.unref()}s&&s.addEventListener("abort",()=>{c.abort()}),t.signal=f}return o&&o.extraBody!==null&&x1(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 s=>(await Dg(s),new lc(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}async streamApiCall(t,o,a){return this.apiCall(t.toString(),Object.assign(Object.assign({},o),{method:a})).then(async s=>(await Dg(s),this.processStreamResponse(s))).catch(s=>{throw s instanceof Error?s:new Error(JSON.stringify(s))})}processStreamResponse(t){return jt(this,arguments,function*(){var a;const s=(a=t==null?void 0:t.body)===null||a===void 0?void 0:a.getReader(),c=new TextDecoder("utf-8");if(!s)throw new Error("Response body is empty");try{let f="";const h="data:",y=[`
`,"\r\r",`\r
\r
`];for(;;){const{done:p,value:x}=yield se(s.read());if(p){if(f.trim().length>0)throw new Error("Incomplete JSON segment at the end");break}const E=c.decode(x,{stream:!0});try{const C=JSON.parse(E);if("error"in C){const I=JSON.parse(JSON.stringify(C.error)),w=I.status,G=I.code,V=`got status: ${w}. ${JSON.stringify(C)}`;if(G>=400&&G<600)throw new El({message:V,status:G})}}catch(C){if(C.name==="ApiError")throw C}f+=E;let S=-1,b=0;for(;;){S=-1,b=0;for(const w of y){const G=f.indexOf(w);G!==-1&&(S===-1||G<S)&&(S=G,b=w.length)}if(S===-1)break;const C=f.substring(0,S);f=f.substring(S+b);const I=C.trim();if(I.startsWith(h)){const w=I.substring(h.length).trim();try{const G=new Response(w,{headers:t==null?void 0:t.headers,status:t==null?void 0:t.status,statusText:t==null?void 0:t.statusText});yield yield se(new lc(G))}catch(G){throw new Error(`exception parsing stream chunk ${w}. ${G}`)}}}}}finally{s.releaseLock()}})}async apiCall(t,o){var a;if(!this.clientOptions.httpOptions||!this.clientOptions.httpOptions.retryOptions)return fetch(t,o);const s=this.clientOptions.httpOptions.retryOptions;return s_(async()=>{const f=await fetch(t,o);if(f.ok)return f;throw y1.includes(f.status)?new Error(`Retryable HTTP Error: ${f.statusText}`):new w0.AbortError(`Non-retryable exception ${f.statusText} sending request`)},{retries:((a=s.attempts)!==null&&a!==void 0?a:g1)-1})}getDefaultHeaders(){const t={},o=m1+" "+this.clientOptions.userAgentExtra;return t[d1]=o,t[cc]=o,t[u1]="application/json",t}async getHeadersInternal(t,o){const a=new Headers;if(t&&t.headers){for(const[s,c]of Object.entries(t.headers))a.append(s,c);t.timeout&&t.timeout>0&&a.append(c1,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 s={};o!=null&&(s.mimeType=o.mimeType,s.name=o.name,s.displayName=o.displayName),s.name&&!s.name.startsWith("files/")&&(s.name=`files/${s.name}`);const c=this.clientOptions.uploader,f=await c.stat(t);s.sizeBytes=String(f.size);const h=(a=o==null?void 0:o.mimeType)!==null&&a!==void 0?a:f.type;if(h===void 0||h==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");s.mimeType=h;const y={file:s},p=this.getFileName(t),x=$("upload/v1beta/files",y._url),E=await this.fetchUploadUrl(x,s.sizeBytes,s.mimeType,p,y,o==null?void 0:o.httpOptions);return c.upload(t,E,this)}async uploadFileToFileSearchStore(t,o,a){var s;const c=this.clientOptions.uploader,f=await c.stat(o),h=String(f.size),y=(s=a==null?void 0:a.mimeType)!==null&&s!==void 0?s:f.type;if(y===void 0||y==="")throw new Error("Can not determine mimeType. Please provide mimeType in the config.");const p=`upload/v1beta/${t}:uploadToFileSearchStore`,x=this.getFileName(o),E={};a!=null&&$0(a,E);const S=await this.fetchUploadUrl(p,h,y,x,E,a==null?void 0:a.httpOptions);return c.uploadToFileSearchStore(o,S,this)}async downloadFile(t){await this.clientOptions.downloader.download(t,this)}async fetchUploadUrl(t,o,a,s,c,f){var h;let y={};f?y=f: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}`},s?{"X-Goog-Upload-File-Name":s}:{})};const p=await this.request({path:t,body:JSON.stringify(c),httpMethod:"POST",httpOptions:y});if(!p||!(p!=null&&p.headers))throw new Error("Server did not return an HttpResponse or the returned HttpResponse did not have headers.");const x=(h=p==null?void 0:p.headers)===null||h===void 0?void 0:h["x-goog-upload-url"];if(x===void 0)throw new Error("Failed to get upload url. Server did not return the x-google-upload-url in the headers");return x}}async function Dg(n){var t;if(n===void 0)throw new Error("response is undefined");if(!n.ok){const o=n.status;let a;!((t=n.headers.get("content-type"))===null||t===void 0)&&t.includes("application/json")?a=await n.json():a={error:{message:await n.text(),code:n.status,status:n.statusText}};const s=JSON.stringify(a);throw o>=400&&o<600?new El({message:s,status:o}):new Error(s)}}function x1(n,t){if(!t||Object.keys(t).length===0)return;if(n.body instanceof Blob){console.warn("includeExtraBodyToRequestInit: extraBody provided but current request body is a Blob. extraBody will be ignored as merging is not supported for Blob bodies.");return}let o={};if(typeof n.body=="string"&&n.body.length>0)try{const c=JSON.parse(n.body);if(typeof c=="object"&&c!==null&&!Array.isArray(c))o=c;else{console.warn("includeExtraBodyToRequestInit: Original request body is valid JSON but not a non-array object. Skip applying extraBody to the request body.");return}}catch{console.warn("includeExtraBodyToRequestInit: Original request body is not valid JSON. Skip applying extraBody to the request body.");return}function a(c,f){const h=Object.assign({},c);for(const y in f)if(Object.prototype.hasOwnProperty.call(f,y)){const p=f[y],x=h[y];p&&typeof p=="object"&&!Array.isArray(p)&&x&&typeof x=="object"&&!Array.isArray(x)?h[y]=a(x,p):(x&&p&&typeof x!=typeof p&&console.warn(`includeExtraBodyToRequestInit:deepMerge: Type mismatch for key "${y}". Original type: ${typeof x}, New type: ${typeof p}. Overwriting.`),h[y]=p)}return h}const s=a(o,t);n.body=JSON.stringify(s)}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const E1="mcp_used/unknown";let T1=!1;function Q0(n){for(const t of n)if(S1(t)||typeof t=="object"&&"inputSchema"in t)return!0;return T1}function Z0(n){var t;const o=(t=n[cc])!==null&&t!==void 0?t:"";n[cc]=(o+` ${E1}`).trimStart()}function S1(n){return n!==null&&typeof n=="object"&&n instanceof Vc}function _1(n){return jt(this,arguments,function*(o,a=100){let s,c=0;for(;c<a;){const f=yield se(o.listTools({cursor:s}));for(const h of f.tools)yield yield se(h),c++;if(!f.nextCursor)break;s=f.nextCursor}})}class Vc{constructor(t=[],o){this.mcpTools=[],this.functionNameToMcpClient={},this.mcpClients=t,this.config=o}static create(t,o){return new Vc(t,o)}async initialize(){var t,o,a,s;if(this.mcpTools.length>0)return;const c={},f=[];for(const x of this.mcpClients)try{for(var h=!0,y=(o=void 0,Kt(_1(x))),p;p=await y.next(),t=p.done,!t;h=!0){s=p.value,h=!1;const E=s;f.push(E);const S=E.name;if(c[S])throw new Error(`Duplicate function name ${S} found in MCP tools. Please ensure function names are unique.`);c[S]=x}}catch(E){o={error:E}}finally{try{!h&&!t&&(a=y.return)&&await a.call(y)}finally{if(o)throw o.error}}this.mcpTools=f,this.functionNameToMcpClient=c}async tool(){return await this.initialize(),X_(this.mcpTools,this.config)}async callTool(t){await this.initialize();const o=[];for(const a of t)if(a.name in this.functionNameToMcpClient){const s=this.functionNameToMcpClient[a.name];let c;this.config.timeout&&(c={timeout:this.config.timeout});const f=await s.callTool({name:a.name,arguments:a.args},void 0,c);o.push({functionResponse:{name:a.name,response:f.isError?{error:f}:f}})}return o}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/async function b1(n,t,o){const a=new z_;let s;o.data instanceof Blob?s=JSON.parse(await o.data.text()):s=JSON.parse(o.data),Object.assign(a,s),t(a)}class C1{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 s=this.apiClient.getWebsocketBaseUrl(),c=this.apiClient.getApiVersion(),f=w1(this.apiClient.getDefaultHeaders()),h=this.apiClient.getApiKey(),y=`${s}/ws/google.ai.generativelanguage.${c}.GenerativeService.BidiGenerateMusic?key=${h}`;let p=()=>{};const x=new Promise(P=>{p=P}),E=t.callbacks,S=function(){p({})},b=this.apiClient,C={onopen:S,onmessage:P=>{b1(b,E.onmessage,P)},onerror:(o=E==null?void 0:E.onerror)!==null&&o!==void 0?o:function(P){},onclose:(a=E==null?void 0:E.onclose)!==null&&a!==void 0?a:function(P){}},I=this.webSocketFactory.create(y,A1(f),C);I.connect(),await x;const V={setup:{model:_e(this.apiClient,t.model)}};return I.send(JSON.stringify(V)),new N1(I,this.apiClient)}}class N1{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=XC(t);this.conn.send(JSON.stringify({clientContent:o}))}async setMusicGenerationConfig(t){t.musicGenerationConfig||(t.musicGenerationConfig={});const o=KC(t);this.conn.send(JSON.stringify(o))}sendPlaybackControl(t){const o={playbackControl:t};this.conn.send(JSON.stringify(o))}play(){this.sendPlaybackControl(ro.PLAY)}pause(){this.sendPlaybackControl(ro.PAUSE)}stop(){this.sendPlaybackControl(ro.STOP)}resetContext(){this.sendPlaybackControl(ro.RESET_CONTEXT)}close(){this.conn.close()}}function A1(n){const t={};return n.forEach((o,a)=>{t[a]=o}),t}function w1(n){const t=new Headers;for(const[o,a]of Object.entries(n))t.append(o,a);return t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const R1="FunctionResponse request must have an `id` field from the response of a ToolCall.FunctionalCalls in Google AI.";async function M1(n,t,o){const a=new H_;let s;o.data instanceof Blob?s=await o.data.text():o.data instanceof ArrayBuffer?s=new TextDecoder().decode(o.data):s=o.data;const c=JSON.parse(s);if(n.isVertexAI()){const f=ZC(c);Object.assign(a,f)}else Object.assign(a,c);t(a)}class I1{constructor(t,o,a){this.apiClient=t,this.auth=o,this.webSocketFactory=a,this.music=new C1(this.apiClient,this.auth,this.webSocketFactory)}async connect(t){var o,a,s,c,f,h;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(),p=this.apiClient.getApiVersion();let x;const E=this.apiClient.getHeaders();t.config&&t.config.tools&&Q0(t.config.tools)&&Z0(E);const S=k1(E);if(this.apiClient.isVertexAI()){const Z=this.apiClient.getProject(),ae=this.apiClient.getLocation(),be=this.apiClient.getApiKey(),Re=!!Z&&!!ae||!!be;this.apiClient.getCustomBaseUrl()&&!Re?x=y:(x=`${y}/ws/google.cloud.aiplatform.${p}.LlmBidiService/BidiGenerateContent`,await this.auth.addAuthHeaders(S,x))}else{const Z=this.apiClient.getApiKey();let ae="BidiGenerateContent",be="key";Z!=null&&Z.startsWith("auth_tokens/")&&(console.warn("Warning: Ephemeral token support is experimental and may change in future versions."),p!=="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."),ae="BidiGenerateContentConstrained",be="access_token"),x=`${y}/ws/google.ai.generativelanguage.${p}.GenerativeService.${ae}?${be}=${Z}`}let b=()=>{};const C=new Promise(Z=>{b=Z}),I=t.callbacks,w=function(){var Z;(Z=I==null?void 0:I.onopen)===null||Z===void 0||Z.call(I),b({})},G=this.apiClient,V={onopen:w,onmessage:Z=>{M1(G,I.onmessage,Z)},onerror:(o=I==null?void 0:I.onerror)!==null&&o!==void 0?o:function(Z){},onclose:(a=I==null?void 0:I.onclose)!==null&&a!==void 0?a:function(Z){}},P=this.webSocketFactory.create(x,L1(S),V);P.connect(),await C;let Y=_e(this.apiClient,t.model);if(this.apiClient.isVertexAI()&&Y.startsWith("publishers/")){const Z=this.apiClient.getProject(),ae=this.apiClient.getLocation();Z&&ae&&(Y=`projects/${Z}/locations/${ae}/`+Y)}let X={};this.apiClient.isVertexAI()&&((s=t.config)===null||s===void 0?void 0:s.responseModalities)===void 0&&(t.config===void 0?t.config={responseModalities:[ts.AUDIO]}:t.config.responseModalities=[ts.AUDIO]),!((c=t.config)===null||c===void 0)&&c.generationConfig&&console.warn("Setting `LiveConnectConfig.generation_config` is deprecated, please set the fields on `LiveConnectConfig` directly. This will become an error in a future version (not before Q3 2025).");const B=(h=(f=t.config)===null||f===void 0?void 0:f.tools)!==null&&h!==void 0?h:[],j=[];for(const Z of B)if(this.isCallableTool(Z)){const ae=Z;j.push(await ae.tool())}else j.push(Z);j.length>0&&(t.config.tools=j);const le={model:Y,config:t.config,callbacks:t.callbacks};return this.apiClient.isVertexAI()?X=jC(this.apiClient,le):X=YC(this.apiClient,le),delete X.config,P.send(JSON.stringify(X)),new U1(P,this.apiClient)}isCallableTool(t){return"callTool"in t&&typeof t.callTool=="function"}}const D1={turnComplete:!0};class U1{constructor(t,o){this.conn=t,this.apiClient=o}tLiveClientContent(t,o){if(o.turns!==null&&o.turns!==void 0){let a=[];try{a=Mt(o.turns),t.isVertexAI()||(a=a.map(s=>bl(s)))}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 c of a){if(typeof c!="object"||c===null||!("name"in c)||!("response"in c))throw new Error(`Could not parse function response, type '${typeof c}'.`);if(!t.isVertexAI()&&!("id"in c))throw new Error(R1)}return{toolResponse:{functionResponses:a}}}sendClientContent(t){t=Object.assign(Object.assign({},D1),t);const o=this.tLiveClientContent(this.apiClient,t);this.conn.send(JSON.stringify(o))}sendRealtimeInput(t){let o={};this.apiClient.isVertexAI()?o={realtimeInput:QC(t)}:o={realtimeInput:$C(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 L1(n){const t={};return n.forEach((o,a)=>{t[a]=o}),t}function k1(n){const t=new Headers;for(const[o,a]of Object.entries(n))t.append(o,a);return t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const Ug=10;function Lg(n){var t,o,a;if(!((t=n==null?void 0:n.automaticFunctionCalling)===null||t===void 0)&&t.disable)return!0;let s=!1;for(const f of(o=n==null?void 0:n.tools)!==null&&o!==void 0?o:[])if(fo(f)){s=!0;break}if(!s)return!0;const c=(a=n==null?void 0:n.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls;return c&&(c<0||!Number.isInteger(c))||c==0?(console.warn("Invalid maximumRemoteCalls value provided for automatic function calling. Disabled automatic function calling. Please provide a valid integer value greater than 0. maximumRemoteCalls provided:",c),!0):!1}function fo(n){return"callTool"in n&&typeof n.callTool=="function"}function P1(n){var t,o,a;return(a=(o=(t=n.config)===null||t===void 0?void 0:t.tools)===null||o===void 0?void 0:o.some(s=>fo(s)))!==null&&a!==void 0?a:!1}function kg(n){var t;const o=[];return!((t=n==null?void 0:n.config)===null||t===void 0)&&t.tools&&n.config.tools.forEach((a,s)=>{if(fo(a))return;const c=a;c.functionDeclarations&&c.functionDeclarations.length>0&&o.push(s)}),o}function Pg(n){var t;return!(!((t=n==null?void 0:n.automaticFunctionCalling)===null||t===void 0)&&t.ignoreCallHistory)}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class G1 extends Nn{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 s=Mt(o.contents);if(s.length>1)throw new Error("The embedContent API for this model only supports one content at a time.");const c=Object.assign(Object.assign({},o),{content:s[0],embeddingApiType:ns.EMBED_CONTENT});return await this.embedContentInternal(c)}else{const s=Object.assign(Object.assign({},o),{embeddingApiType:ns.PREDICT});return await this.embedContentInternal(s)}},this.generateContent=async o=>{var a,s,c,f,h;const y=await this.processParamsMaybeAddMcpUsage(o);if(this.maybeMoveToResponseJsonSchem(o),!P1(o)||Lg(o.config))return await this.generateContentInternal(y);const p=kg(o);if(p.length>0){const I=p.map(w=>`tools[${w}]`).join(", ");throw new Error(`Automatic function calling with CallableTools (or MCP objects) and basic FunctionDeclarations is not yet supported. Incompatible tools found at ${I}.`)}let x,E;const S=Mt(y.contents),b=(c=(s=(a=y.config)===null||a===void 0?void 0:a.automaticFunctionCalling)===null||s===void 0?void 0:s.maximumRemoteCalls)!==null&&c!==void 0?c:Ug;let C=0;for(;C<b&&(x=await this.generateContentInternal(y),!(!x.functionCalls||x.functionCalls.length===0));){const I=x.candidates[0].content,w=[];for(const G of(h=(f=o.config)===null||f===void 0?void 0:f.tools)!==null&&h!==void 0?h:[])if(fo(G)){const P=await G.callTool(x.functionCalls);w.push(...P)}C++,E={role:"user",parts:w},y.contents=Mt(y.contents),y.contents.push(I),y.contents.push(E),Pg(y.config)&&(S.push(I),S.push(E))}return Pg(y.config)&&(x.automaticFunctionCallingHistory=S),x},this.generateContentStream=async o=>{var a,s,c,f,h;if(this.maybeMoveToResponseJsonSchem(o),Lg(o.config)){const E=await this.processParamsMaybeAddMcpUsage(o);return await this.generateContentStreamInternal(E)}const y=kg(o);if(y.length>0){const E=y.map(S=>`tools[${S}]`).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 p=(c=(s=(a=o==null?void 0:o.config)===null||a===void 0?void 0:a.toolConfig)===null||s===void 0?void 0:s.functionCallingConfig)===null||c===void 0?void 0:c.streamFunctionCallArguments,x=(h=(f=o==null?void 0:o.config)===null||f===void 0?void 0:f.automaticFunctionCalling)===null||h===void 0?void 0:h.disable;if(p&&!x)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 s;let c;const f=[];if(a!=null&&a.generatedImages)for(const y of a.generatedImages)y&&(y!=null&&y.safetyAttributes)&&((s=y==null?void 0:y.safetyAttributes)===null||s===void 0?void 0:s.contentType)==="Positive Prompt"?c=y==null?void 0:y.safetyAttributes:f.push(y);let h;return c?h={generatedImages:f,positivePromptSafetyAttributes:c,sdkHttpResponse:a.sdkHttpResponse}:h={generatedImages:f,sdkHttpResponse:a.sdkHttpResponse},h}),this.list=async o=>{var a;const f={config:Object.assign(Object.assign({},{queryBase:!0}),o==null?void 0:o.config)};if(this.apiClient.isVertexAI()&&!f.config.queryBase){if(!((a=f.config)===null||a===void 0)&&a.filter)throw new Error("Filtering tuned models list for Vertex AI is not currently supported");f.config.filter="labels.tune-type:*"}return new Si(Cn.PAGED_ITEM_MODELS,h=>this.listInternal(h),await this.listInternal(f),f)},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(s=>s.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 s={model:o.model,image:o.image,upscaleFactor:o.upscaleFactor,config:a};return await this.upscaleImageInternal(s)},this.generateVideos=async o=>{var a,s,c,f,h,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&&(!((s=o.video)===null||s===void 0)&&s.videoBytes)?o.video={uri:o.video.uri,mimeType:o.video.mimeType}:!((f=(c=o.source)===null||c===void 0?void 0:c.video)===null||f===void 0)&&f.uri&&(!((y=(h=o.source)===null||h===void 0?void 0:h.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,s;const c=(o=t.config)===null||o===void 0?void 0:o.tools;if(!c)return t;const f=await Promise.all(c.map(async y=>fo(y)?await y.tool():y)),h={model:t.model,contents:t.contents,config:Object.assign(Object.assign({},t.config),{tools:f})};if(h.config.tools=f,t.config&&t.config.tools&&Q0(t.config.tools)){const y=(s=(a=t.config.httpOptions)===null||a===void 0?void 0:a.headers)!==null&&s!==void 0?s:{};let p=Object.assign({},y);Object.keys(p).length===0&&(p=this.apiClient.getDefaultHeaders()),Z0(p),h.config.httpOptions=Object.assign(Object.assign({},t.config.httpOptions),{headers:p})}return h}async initAfcToolsMap(t){var o,a,s;const c=new Map;for(const f of(a=(o=t.config)===null||o===void 0?void 0:o.tools)!==null&&a!==void 0?a:[])if(fo(f)){const h=f,y=await h.tool();for(const p of(s=y.functionDeclarations)!==null&&s!==void 0?s:[]){if(!p.name)throw new Error("Function declaration name is required.");if(c.has(p.name))throw new Error(`Duplicate tool declaration name: ${p.name}`);c.set(p.name,h)}}return c}async processAfcStream(t){var o,a,s;const c=(s=(a=(o=t.config)===null||o===void 0?void 0:o.automaticFunctionCalling)===null||a===void 0?void 0:a.maximumRemoteCalls)!==null&&s!==void 0?s:Ug;let f=!1,h=0;const y=await this.initAfcToolsMap(t);return(function(p,x,E){return jt(this,arguments,function*(){for(var S,b,C,I,w,G;h<c;){f&&(h++,f=!1);const X=yield se(p.processParamsMaybeAddMcpUsage(E)),B=yield se(p.generateContentStreamInternal(X)),j=[],le=[];try{for(var V=!0,P=(b=void 0,Kt(B)),Y;Y=yield se(P.next()),S=Y.done,!S;V=!0){I=Y.value,V=!1;const Z=I;if(yield yield se(Z),Z.candidates&&(!((w=Z.candidates[0])===null||w===void 0)&&w.content)){le.push(Z.candidates[0].content);for(const ae of(G=Z.candidates[0].content.parts)!==null&&G!==void 0?G:[])if(h<c&&ae.functionCall){if(!ae.functionCall.name)throw new Error("Function call name was not returned by the model.");if(x.has(ae.functionCall.name)){const be=yield se(x.get(ae.functionCall.name).callTool([ae.functionCall]));j.push(...be)}else throw new Error(`Automatic function calling was requested, but not all the tools the model used implement the CallableTool interface. Available tools: ${x.keys()}, mising tool: ${ae.functionCall.name}`)}}}}catch(Z){b={error:Z}}finally{try{!V&&!S&&(C=P.return)&&(yield se(C.call(P)))}finally{if(b)throw b.error}}if(j.length>0){f=!0;const Z=new hl;Z.candidates=[{content:{role:"user",parts:j}}],yield yield se(Z);const ae=[];ae.push(...le),ae.push({role:"user",parts:j});const be=Mt(E.contents).concat(ae);E.contents=be}else break}})})(this,y,t)}async generateContentInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Rg(this.apiClient,t);return h=$("{model}:generateContent",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=Ig(x),S=new hl;return Object.assign(S,E),S})}else{const p=wg(this.apiClient,t);return h=$("{model}:generateContent",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=Mg(x),S=new hl;return Object.assign(S,E),S})}}async generateContentStreamInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Rg(this.apiClient,t);return h=$("{model}:streamGenerateContent?alt=sse",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.requestStream({path:h,queryParams:y,body:JSON.stringify(p),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}),f.then(function(E){return jt(this,arguments,function*(){var S,b,C,I;try{for(var w=!0,G=Kt(E),V;V=yield se(G.next()),S=V.done,!S;w=!0){I=V.value,w=!1;const P=I,Y=Ig(yield se(P.json()),t);Y.sdkHttpResponse={headers:P.headers};const X=new hl;Object.assign(X,Y),yield yield se(X)}}catch(P){b={error:P}}finally{try{!w&&!S&&(C=G.return)&&(yield se(C.call(G)))}finally{if(b)throw b.error}}})})}else{const p=wg(this.apiClient,t);return h=$("{model}:streamGenerateContent?alt=sse",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.requestStream({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}),f.then(function(E){return jt(this,arguments,function*(){var S,b,C,I;try{for(var w=!0,G=Kt(E),V;V=yield se(G.next()),S=V.done,!S;w=!0){I=V.value,w=!1;const P=I,Y=Mg(yield se(P.json()),t);Y.sdkHttpResponse={headers:P.headers};const X=new hl;Object.assign(X,Y),yield yield se(X)}}catch(P){b={error:P}}finally{try{!w&&!S&&(C=G.return)&&(yield se(C.call(G)))}finally{if(b)throw b.error}}})})}}async embedContentInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=RN(this.apiClient,t,t),x=Q_(t.model)?"{model}:embedContent":"{model}:predict";return h=$(x,p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(S=>{const b=S;return b.sdkHttpResponse={headers:E.headers},b})),f.then(E=>{const S=IN(E,t),b=new dg;return Object.assign(b,S),b})}else{const p=wN(this.apiClient,t);return h=$("{model}:batchEmbedContents",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=MN(x),S=new dg;return Object.assign(S,E),S})}}async generateImagesInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=ON(this.apiClient,t);return h=$("{model}:predict",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=FN(x),S=new fg;return Object.assign(S,E),S})}else{const p=zN(this.apiClient,t);return h=$("{model}:predict",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=BN(x),S=new fg;return Object.assign(S,E),S})}}async editImageInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=bN(this.apiClient,t);return c=$("{model}:predict",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>{const p=CN(y),x=new w_;return Object.assign(x,p),x})}else throw new Error("This method is only supported by the Vertex AI.")}async upscaleImageInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=OA(this.apiClient,t);return c=$("{model}:predict",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>{const p=BA(y),x=new R_;return Object.assign(x,p),x})}else throw new Error("This method is only supported by the Vertex AI.")}async recontextImage(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=_A(this.apiClient,t);return c=$("{model}:predict",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=bA(y),x=new M_;return Object.assign(x,p),x})}else throw new Error("This method is only supported by the Vertex AI.")}async segmentImage(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=MA(this.apiClient,t);return c=$("{model}:predict",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=IA(y),x=new I_;return Object.assign(x,p),x})}else throw new Error("This method is only supported by the Vertex AI.")}async get(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=sA(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>uc(x))}else{const p=aA(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>rc(x))}}async listInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=gA(this.apiClient,t);return h=$("{models_url}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=vA(x),S=new mg;return Object.assign(S,E),S})}else{const p=hA(this.apiClient,t);return h=$("{models_url}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=yA(x),S=new mg;return Object.assign(S,E),S})}}async update(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=HA(this.apiClient,t);return h=$("{model}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>uc(x))}else{const p=VA(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"PATCH",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>rc(x))}}async delete(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=EN(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,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}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=SN(x),S=new pg;return Object.assign(S,E),S})}else{const p=xN(this.apiClient,t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"DELETE",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=TN(x),S=new pg;return Object.assign(S,E),S})}}async countTokens(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=gN(this.apiClient,t);return h=$("{model}:countTokens",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=vN(x),S=new hg;return Object.assign(S,E),S})}else{const p=hN(this.apiClient,t);return h=$("{model}:countTokens",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=yN(x),S=new hg;return Object.assign(S,E),S})}}async computeTokens(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=rN(this.apiClient,t);return c=$("{model}:computeTokens",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>{const p=uN(y),x=new D_;return Object.assign(x,p),x})}else throw new Error("This method is only supported by the Vertex AI.")}async generateVideosInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=$N(this.apiClient,t);return h=$("{model}:predictLongRunning",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f.then(x=>{const E=KN(x),S=new is;return Object.assign(S,E),S})}else{const p=XN(this.apiClient,t);return h=$("{model}:predictLongRunning",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f.then(x=>{const E=jN(x),S=new is;return Object.assign(S,E),S})}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class q1 extends Nn{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 s=o.name.split("/operations/")[0];let c;a&&"httpOptions"in a&&(c=a.httpOptions);const f=await this.fetchPredictVideosOperationInternal({operationName:o.name,resourceName:s,config:{httpOptions:c}});return o._fromAPIResponse({apiResponse:f,_isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:o.name,config:a});return o._fromAPIResponse({apiResponse:s,_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 s=o.name.split("/operations/")[0];let c;a&&"httpOptions"in a&&(c=a.httpOptions);const f=await this.fetchPredictVideosOperationInternal({operationName:o.name,resourceName:s,config:{httpOptions:c}});return o._fromAPIResponse({apiResponse:f,_isVertexAI:!0})}else{const s=await this.getVideosOperationInternal({operationName:o.name,config:a});return o._fromAPIResponse({apiResponse:s,_isVertexAI:!1})}}async getVideosOperationInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=S_(t);return h=$("{operationName}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json()),f}else{const p=T_(t);return h=$("{operationName}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json()),f}}async fetchPredictVideosOperationInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=p_(t);return c=$("{resourceName}:fetchPredictOperation",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s}else throw new Error("This method is only supported by the Vertex AI.")}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function V1(n){const t={},o=u(n,["data"]);if(o!=null&&d(t,["data"],o),u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function H1(n){const t={},o=u(n,["parts"]);if(o!=null){let s=o;Array.isArray(s)&&(s=s.map(c=>X1(c))),d(t,["parts"],s)}const a=u(n,["role"]);return a!=null&&d(t,["role"],a),t}function z1(n,t,o){const a={},s=u(t,["expireTime"]);o!==void 0&&s!=null&&d(o,["expireTime"],s);const c=u(t,["newSessionExpireTime"]);o!==void 0&&c!=null&&d(o,["newSessionExpireTime"],c);const f=u(t,["uses"]);o!==void 0&&f!=null&&d(o,["uses"],f);const h=u(t,["liveConnectConstraints"]);o!==void 0&&h!=null&&d(o,["bidiGenerateContentSetup"],K1(n,h));const y=u(t,["lockAdditionalFields"]);return o!==void 0&&y!=null&&d(o,["fieldMask"],y),a}function O1(n,t){const o={},a=u(t,["config"]);return a!=null&&d(o,["config"],z1(n,a,o)),o}function B1(n){const t={};if(u(n,["displayName"])!==void 0)throw new Error("displayName parameter is not supported in Gemini API.");const o=u(n,["fileUri"]);o!=null&&d(t,["fileUri"],o);const a=u(n,["mimeType"]);return a!=null&&d(t,["mimeType"],a),t}function F1(n){const t={},o=u(n,["id"]);o!=null&&d(t,["id"],o);const a=u(n,["args"]);a!=null&&d(t,["args"],a);const s=u(n,["name"]);if(s!=null&&d(t,["name"],s),u(n,["partialArgs"])!==void 0)throw new Error("partialArgs parameter is not supported in Gemini API.");if(u(n,["willContinue"])!==void 0)throw new Error("willContinue parameter is not supported in Gemini API.");return t}function J1(n){const t={};if(u(n,["authConfig"])!==void 0)throw new Error("authConfig parameter is not supported in Gemini API.");const o=u(n,["enableWidget"]);return o!=null&&d(t,["enableWidget"],o),t}function Y1(n){const t={};if(u(n,["excludeDomains"])!==void 0)throw new Error("excludeDomains parameter is not supported in Gemini API.");if(u(n,["blockingConfidence"])!==void 0)throw new Error("blockingConfidence parameter is not supported in Gemini API.");const o=u(n,["timeRangeFilter"]);return o!=null&&d(t,["timeRangeFilter"],o),t}function j1(n,t){const o={},a=u(n,["generationConfig"]);t!==void 0&&a!=null&&d(t,["setup","generationConfig"],a);const s=u(n,["responseModalities"]);t!==void 0&&s!=null&&d(t,["setup","generationConfig","responseModalities"],s);const c=u(n,["temperature"]);t!==void 0&&c!=null&&d(t,["setup","generationConfig","temperature"],c);const f=u(n,["topP"]);t!==void 0&&f!=null&&d(t,["setup","generationConfig","topP"],f);const h=u(n,["topK"]);t!==void 0&&h!=null&&d(t,["setup","generationConfig","topK"],h);const y=u(n,["maxOutputTokens"]);t!==void 0&&y!=null&&d(t,["setup","generationConfig","maxOutputTokens"],y);const p=u(n,["mediaResolution"]);t!==void 0&&p!=null&&d(t,["setup","generationConfig","mediaResolution"],p);const x=u(n,["seed"]);t!==void 0&&x!=null&&d(t,["setup","generationConfig","seed"],x);const E=u(n,["speechConfig"]);t!==void 0&&E!=null&&d(t,["setup","generationConfig","speechConfig"],qc(E));const S=u(n,["thinkingConfig"]);t!==void 0&&S!=null&&d(t,["setup","generationConfig","thinkingConfig"],S);const b=u(n,["enableAffectiveDialog"]);t!==void 0&&b!=null&&d(t,["setup","generationConfig","enableAffectiveDialog"],b);const C=u(n,["systemInstruction"]);t!==void 0&&C!=null&&d(t,["setup","systemInstruction"],H1(tt(C)));const I=u(n,["tools"]);if(t!==void 0&&I!=null){let B=go(I);Array.isArray(B)&&(B=B.map(j=>Q1(ho(j)))),d(t,["setup","tools"],B)}const w=u(n,["sessionResumption"]);t!==void 0&&w!=null&&d(t,["setup","sessionResumption"],$1(w));const G=u(n,["inputAudioTranscription"]);t!==void 0&&G!=null&&d(t,["setup","inputAudioTranscription"],G);const V=u(n,["outputAudioTranscription"]);t!==void 0&&V!=null&&d(t,["setup","outputAudioTranscription"],V);const P=u(n,["realtimeInputConfig"]);t!==void 0&&P!=null&&d(t,["setup","realtimeInputConfig"],P);const Y=u(n,["contextWindowCompression"]);t!==void 0&&Y!=null&&d(t,["setup","contextWindowCompression"],Y);const X=u(n,["proactivity"]);if(t!==void 0&&X!=null&&d(t,["setup","proactivity"],X),u(n,["explicitVadSignal"])!==void 0)throw new Error("explicitVadSignal parameter is not supported in Gemini API.");return o}function K1(n,t){const o={},a=u(t,["model"]);a!=null&&d(o,["setup","model"],_e(n,a));const s=u(t,["config"]);return s!=null&&d(o,["config"],j1(s,o)),o}function X1(n){const t={},o=u(n,["mediaResolution"]);o!=null&&d(t,["mediaResolution"],o);const a=u(n,["codeExecutionResult"]);a!=null&&d(t,["codeExecutionResult"],a);const s=u(n,["executableCode"]);s!=null&&d(t,["executableCode"],s);const c=u(n,["fileData"]);c!=null&&d(t,["fileData"],B1(c));const f=u(n,["functionCall"]);f!=null&&d(t,["functionCall"],F1(f));const h=u(n,["functionResponse"]);h!=null&&d(t,["functionResponse"],h);const y=u(n,["inlineData"]);y!=null&&d(t,["inlineData"],V1(y));const p=u(n,["text"]);p!=null&&d(t,["text"],p);const x=u(n,["thought"]);x!=null&&d(t,["thought"],x);const E=u(n,["thoughtSignature"]);E!=null&&d(t,["thoughtSignature"],E);const S=u(n,["videoMetadata"]);return S!=null&&d(t,["videoMetadata"],S),t}function $1(n){const t={},o=u(n,["handle"]);if(o!=null&&d(t,["handle"],o),u(n,["transparent"])!==void 0)throw new Error("transparent parameter is not supported in Gemini API.");return t}function Q1(n){const t={};if(u(n,["retrieval"])!==void 0)throw new Error("retrieval parameter is not supported in Gemini API.");const o=u(n,["computerUse"]);o!=null&&d(t,["computerUse"],o);const a=u(n,["fileSearch"]);a!=null&&d(t,["fileSearch"],a);const s=u(n,["codeExecution"]);if(s!=null&&d(t,["codeExecution"],s),u(n,["enterpriseWebSearch"])!==void 0)throw new Error("enterpriseWebSearch parameter is not supported in Gemini API.");const c=u(n,["functionDeclarations"]);if(c!=null){let x=c;Array.isArray(x)&&(x=x.map(E=>E)),d(t,["functionDeclarations"],x)}const f=u(n,["googleMaps"]);f!=null&&d(t,["googleMaps"],J1(f));const h=u(n,["googleSearch"]);h!=null&&d(t,["googleSearch"],Y1(h));const y=u(n,["googleSearchRetrieval"]);y!=null&&d(t,["googleSearchRetrieval"],y);const p=u(n,["urlContext"]);return p!=null&&d(t,["urlContext"],p),t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Z1(n){const t=[];for(const o in n)if(Object.prototype.hasOwnProperty.call(n,o)){const a=n[o];if(typeof a=="object"&&a!=null&&Object.keys(a).length>0){const s=Object.keys(a).map(c=>`${o}.${c}`);t.push(...s)}else t.push(o)}return t.join(",")}function W1(n,t){let o=null;const a=n.bidiGenerateContentSetup;if(typeof a=="object"&&a!==null&&"setup"in a){const c=a.setup;typeof c=="object"&&c!==null?(n.bidiGenerateContentSetup=c,o=c):delete n.bidiGenerateContentSetup}else a!==void 0&&delete n.bidiGenerateContentSetup;const s=n.fieldMask;if(o){const c=Z1(o);if(Array.isArray(t==null?void 0:t.lockAdditionalFields)&&(t==null?void 0:t.lockAdditionalFields.length)===0)c?n.fieldMask=c:delete n.fieldMask;else if(t!=null&&t.lockAdditionalFields&&t.lockAdditionalFields.length>0&&s!==null&&Array.isArray(s)&&s.length>0){const f=["temperature","topK","topP","maxOutputTokens","responseModalities","seed","speechConfig"];let h=[];s.length>0&&(h=s.map(p=>f.includes(p)?`generationConfig.${p}`:p));const y=[];c&&y.push(c),h.length>0&&y.push(...h),y.length>0?n.fieldMask=y.join(","):delete n.fieldMask}else delete n.fieldMask}else s!==null&&Array.isArray(s)&&s.length>0?n.fieldMask=s.join(","):delete n.fieldMask;return n}class ew extends Nn{constructor(t){super(),this.apiClient=t}async create(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("The client.tokens.create method is only supported by the Gemini Developer API.");{const h=O1(this.apiClient,t);c=$("auth_tokens",h._url),f=h._query,delete h.config,delete h._url,delete h._query;const y=W1(h,t.config);return s=this.apiClient.request({path:c,queryParams:f,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(p=>p.json()),s.then(p=>p)}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function tw(n,t){const o={},a=u(n,["force"]);return t!==void 0&&a!=null&&d(t,["_query","force"],a),o}function nw(n){const t={},o=u(n,["name"]);o!=null&&d(t,["_url","name"],o);const a=u(n,["config"]);return a!=null&&tw(a,t),t}function iw(n){const t={},o=u(n,["name"]);return o!=null&&d(t,["_url","name"],o),t}function ow(n,t){const o={},a=u(n,["pageSize"]);t!==void 0&&a!=null&&d(t,["_query","pageSize"],a);const s=u(n,["pageToken"]);return t!==void 0&&s!=null&&d(t,["_query","pageToken"],s),o}function lw(n){const t={},o=u(n,["parent"]);o!=null&&d(t,["_url","parent"],o);const a=u(n,["config"]);return a!=null&&ow(a,t),t}function aw(n){const t={},o=u(n,["sdkHttpResponse"]);o!=null&&d(t,["sdkHttpResponse"],o);const a=u(n,["nextPageToken"]);a!=null&&d(t,["nextPageToken"],a);const s=u(n,["documents"]);if(s!=null){let c=s;Array.isArray(c)&&(c=c.map(f=>f)),d(t,["documents"],c)}return t}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class sw extends Nn{constructor(t){super(),this.apiClient=t,this.list=async o=>new Si(Cn.PAGED_ITEM_DOCUMENTS,a=>this.listInternal({parent:o.parent,config:a.config}),await this.listInternal(o),o)}async get(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=iw(t);return c=$("{name}",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>y)}}async delete(t){var o,a;let s="",c={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const f=nw(t);s=$("{name}",f._url),c=f._query,delete f._url,delete f._query,await this.apiClient.request({path:s,queryParams:c,body:JSON.stringify(f),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 s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=lw(t);return c=$("{parent}/documents",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=aw(y),x=new U_;return Object.assign(x,p),x})}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class rw extends Nn{constructor(t,o=new sw(t)){super(),this.apiClient=t,this.documents=o,this.list=async(a={})=>new Si(Cn.PAGED_ITEM_FILE_SEARCH_STORES,s=>this.listInternal(s),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 s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=$A(t);return c=$("fileSearchStores",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>y)}}async get(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=WA(t);return c=$("{name}",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>y)}}async delete(t){var o,a;let s="",c={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const f=ZA(t);s=$("{name}",f._url),c=f._query,delete f._url,delete f._query,await this.apiClient.request({path:s,queryParams:c,body:JSON.stringify(f),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 s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=l1(t);return c=$("fileSearchStores",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=a1(y),x=new L_;return Object.assign(x,p),x})}}async uploadToFileSearchStoreInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=s1(t);return c=$("upload/v1beta/{file_search_store_name}:uploadToFileSearchStore",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=r1(y),x=new k_;return Object.assign(x,p),x})}}async importFile(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=n1(t);return c=$("{file_search_store_name}:importFile",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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()),s.then(y=>{const p=t1(y),x=new Uc;return Object.assign(x,p),x})}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/let W0=function(){const{crypto:n}=globalThis;if(n!=null&&n.randomUUID)return W0=n.randomUUID.bind(n),n.randomUUID();const t=new Uint8Array(1),o=n?()=>n.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 uw=()=>W0();/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function dc(n){return typeof n=="object"&&n!==null&&("name"in n&&n.name==="AbortError"||"message"in n&&String(n.message).includes("FetchRequestCanceledException"))}const fc=n=>{if(n instanceof Error)return n;if(typeof n=="object"&&n!==null){try{if(Object.prototype.toString.call(n)==="[object Error]"){const t=new Error(n.message,n.cause?{cause:n.cause}:{});return n.stack&&(t.stack=n.stack),n.cause&&!t.cause&&(t.cause=n.cause),n.name&&(t.name=n.name),t}}catch{}try{return new Error(JSON.stringify(n))}catch{}}return new Error(n)};/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class zt extends Error{}class ft extends zt{constructor(t,o,a,s){super(`${ft.makeMessage(t,o,a)}`),this.status=t,this.headers=s,this.error=o}static makeMessage(t,o,a){const s=o!=null&&o.message?typeof o.message=="string"?o.message:JSON.stringify(o.message):o?JSON.stringify(o):a;return t&&s?`${t} ${s}`:t?`${t} status code (no body)`:s||"(no status code or body)"}static generate(t,o,a,s){if(!t||!s)return new hs({message:a,cause:fc(o)});const c=o;return t===400?new ty(t,c,a,s):t===401?new ny(t,c,a,s):t===403?new iy(t,c,a,s):t===404?new oy(t,c,a,s):t===409?new ly(t,c,a,s):t===422?new ay(t,c,a,s):t===429?new sy(t,c,a,s):t>=500?new ry(t,c,a,s):new ft(t,c,a,s)}}class mc extends ft{constructor({message:t}={}){super(void 0,void 0,t||"Request was aborted.",void 0)}}class hs extends ft{constructor({message:t,cause:o}){super(void 0,void 0,t||"Connection error.",void 0),o&&(this.cause=o)}}class ey extends hs{constructor({message:t}={}){super({message:t??"Request timed out."})}}class ty extends ft{}class ny extends ft{}class iy extends ft{}class oy extends ft{}class ly extends ft{}class ay extends ft{}class sy extends ft{}class ry extends ft{}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const cw=/^[a-z][a-z0-9+.-]*:/i,dw=n=>cw.test(n);let pc=n=>(pc=Array.isArray,pc(n));const fw=pc;let mw=fw;const Gg=mw;function pw(n){if(!n)return!0;for(const t in n)return!1;return!0}function hw(n,t){return Object.prototype.hasOwnProperty.call(n,t)}const gw=(n,t)=>{if(typeof t!="number"||!Number.isInteger(t))throw new zt(`${n} must be an integer`);if(t<0)throw new zt(`${n} must be a positive integer`);return t},yw=n=>{try{return JSON.parse(n)}catch{return}};/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const vw=n=>new Promise(t=>setTimeout(t,n));/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const so="0.0.1";/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function xw(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}const Ew=()=>{var n,t,o,a,s;const c=xw();if(c==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":so,"X-Stainless-OS":Vg(Deno.build.os),"X-Stainless-Arch":qg(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:(t=(n=Deno.version)===null||n===void 0?void 0:n.deno)!==null&&t!==void 0?t:"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":so,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(c==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":so,"X-Stainless-OS":Vg((o=globalThis.process.platform)!==null&&o!==void 0?o:"unknown"),"X-Stainless-Arch":qg((a=globalThis.process.arch)!==null&&a!==void 0?a:"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":(s=globalThis.process.version)!==null&&s!==void 0?s:"unknown"};const f=Tw();return f?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":so,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${f.browser}`,"X-Stainless-Runtime-Version":f.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":so,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};function Tw(){if(typeof navigator>"u"||!navigator)return null;const n=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(const{key:t,pattern:o}of n){const a=o.exec(navigator.userAgent);if(a){const s=a[1]||0,c=a[2]||0,f=a[3]||0;return{browser:t,version:`${s}.${c}.${f}`}}}return null}const qg=n=>n==="x32"?"x32":n==="x86_64"||n==="x64"?"x64":n==="arm"?"arm":n==="aarch64"||n==="arm64"?"arm64":n?`other:${n}`:"unknown",Vg=n=>(n=n.toLowerCase(),n.includes("ios")?"iOS":n==="android"?"Android":n==="darwin"?"MacOS":n==="win32"?"Windows":n==="freebsd"?"FreeBSD":n==="openbsd"?"OpenBSD":n==="linux"?"Linux":n?`Other:${n}`:"Unknown");let Fa;const Sw=()=>Fa??(Fa=Ew());/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function _w(){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 uy(...n){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(...n)}function bw(n){let t=Symbol.asyncIterator in n?n[Symbol.asyncIterator]():n[Symbol.iterator]();return uy({start(){},async pull(o){const{done:a,value:s}=await t.next();a?o.close():o.enqueue(s)},async cancel(){var o;await((o=t.return)===null||o===void 0?void 0:o.call(t))}})}function cy(n){if(n[Symbol.asyncIterator])return n;const t=n.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 Cw(n){var t,o;if(n===null||typeof n!="object")return;if(n[Symbol.asyncIterator]){await((o=(t=n[Symbol.asyncIterator]()).return)===null||o===void 0?void 0:o.call(t));return}const a=n.getReader(),s=a.cancel();a.releaseLock(),await s}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const Nw=({headers:n,body:t})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(t)});/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const dy=()=>{var n;if(typeof File>"u"){const{process:t}=globalThis,o=typeof((n=t==null?void 0:t.versions)===null||n===void 0?void 0:n.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 Ku(n,t,o){return dy(),new File(n,t??"unknown_file",o)}function Aw(n){return(typeof n=="object"&&n!==null&&("name"in n&&n.name&&String(n.name)||"url"in n&&n.url&&String(n.url)||"filename"in n&&n.filename&&String(n.filename)||"path"in n&&n.path&&String(n.path))||"").split(/[\\/]/).pop()||void 0}const ww=n=>n!=null&&typeof n=="object"&&typeof n[Symbol.asyncIterator]=="function";/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const fy=n=>n!=null&&typeof n=="object"&&typeof n.size=="number"&&typeof n.type=="string"&&typeof n.text=="function"&&typeof n.slice=="function"&&typeof n.arrayBuffer=="function",Rw=n=>n!=null&&typeof n=="object"&&typeof n.name=="string"&&typeof n.lastModified=="number"&&fy(n),Mw=n=>n!=null&&typeof n=="object"&&typeof n.url=="string"&&typeof n.blob=="function";async function Iw(n,t,o){if(dy(),n=await n,Rw(n))return n instanceof File?n:Ku([await n.arrayBuffer()],n.name);if(Mw(n)){const s=await n.blob();return t||(t=new URL(n.url).pathname.split(/[\\/]/).pop()),Ku(await hc(s),t,o)}const a=await hc(n);if(t||(t=Aw(n)),!(o!=null&&o.type)){const s=a.find(c=>typeof c=="object"&&"type"in c&&c.type);typeof s=="string"&&(o=Object.assign(Object.assign({},o),{type:s}))}return Ku(a,t,o)}async function hc(n){var t,o,a,s,c;let f=[];if(typeof n=="string"||ArrayBuffer.isView(n)||n instanceof ArrayBuffer)f.push(n);else if(fy(n))f.push(n instanceof Blob?n:await n.arrayBuffer());else if(ww(n))try{for(var h=!0,y=Kt(n),p;p=await y.next(),t=p.done,!t;h=!0){s=p.value,h=!1;const x=s;f.push(...await hc(x))}}catch(x){o={error:x}}finally{try{!h&&!t&&(a=y.return)&&await a.call(y)}finally{if(o)throw o.error}}else{const x=(c=n==null?void 0:n.constructor)===null||c===void 0?void 0:c.name;throw new Error(`Unexpected data type: ${typeof n}${x?`; constructor: ${x}`:""}${Dw(n)}`)}return f}function Dw(n){return typeof n!="object"||n===null?"":`; props: [${Object.getOwnPropertyNames(n).map(o=>`"${o}"`).join(", ")}]`}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class my{constructor(t){this._client=t}}my._key=[];/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function py(n){return n.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}const Hg=Object.freeze(Object.create(null)),Uw=(n=py)=>(function(o,...a){if(o.length===1)return o[0];let s=!1;const c=[],f=o.reduce((x,E,S)=>{var b,C,I;/[?#]/.test(E)&&(s=!0);const w=a[S];let G=(s?encodeURIComponent:n)(""+w);return S!==a.length&&(w==null||typeof w=="object"&&w.toString===((I=Object.getPrototypeOf((C=Object.getPrototypeOf((b=w.hasOwnProperty)!==null&&b!==void 0?b:Hg))!==null&&C!==void 0?C:Hg))===null||I===void 0?void 0:I.toString))&&(G=w+"",c.push({start:x.length+E.length,length:G.length,error:`Value of type ${Object.prototype.toString.call(w).slice(8,-1)} is not a valid path parameter`})),x+E+(S===a.length?"":G)},""),h=f.split(/[?#]/,1)[0],y=new RegExp("(?<=^|\\/)(?:\\.|%2e){1,2}(?=\\/|$)","gi");let p;for(;(p=y.exec(h))!==null;)c.push({start:p.index,length:p[0].length,error:`Value "${p[0]}" can't be safely passed as a path parameter`});if(c.sort((x,E)=>x.start-E.start),c.length>0){let x=0;const E=c.reduce((S,b)=>{const C=" ".repeat(b.start-x),I="^".repeat(b.length);return x=b.start+b.length,S+C+I},"");throw new zt(`Path parameters result in path with invalid segments:
${c.map(S=>S.error).join(`
`)}
${f}
${E}`)}return f}),Ja=Uw(py);/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class hy extends my{create(t,o){var a;const{api_version:s=this._client.apiVersion}=t,c=ls(t,["api_version"]);if("model"in c&&"agent_config"in c)throw new zt("Invalid request: specified `model` and `agent_config`. If specifying `model`, use `generation_config`.");if("agent"in c&&"generation_config"in c)throw new zt("Invalid request: specified `agent` and `generation_config`. If specifying `agent`, use `agent_config`.");return this._client.post(Ja`/${s}/interactions`,Object.assign(Object.assign({body:c},o),{stream:(a=t.stream)!==null&&a!==void 0?a:!1}))}delete(t,o={},a){const{api_version:s=this._client.apiVersion}=o??{};return this._client.delete(Ja`/${s}/interactions/${t}`,a)}cancel(t,o={},a){const{api_version:s=this._client.apiVersion}=o??{};return this._client.post(Ja`/${s}/interactions/${t}/cancel`,a)}get(t,o={},a){var s;const c=o??{},{api_version:f=this._client.apiVersion}=c,h=ls(c,["api_version"]);return this._client.get(Ja`/${f}/interactions/${t}`,Object.assign(Object.assign({query:h},a),{stream:(s=o==null?void 0:o.stream)!==null&&s!==void 0?s:!1}))}}hy._key=Object.freeze(["interactions"]);class gy extends hy{}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Lw(n){let t=0;for(const s of n)t+=s.length;const o=new Uint8Array(t);let a=0;for(const s of n)o.set(s,a),a+=s.length;return o}let Ya;function Hc(n){let t;return(Ya??(t=new globalThis.TextEncoder,Ya=t.encode.bind(t)))(n)}let ja;function zg(n){let t;return(ja??(t=new globalThis.TextDecoder,ja=t.decode.bind(t)))(n)}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class gs{constructor(){this.buffer=new Uint8Array,this.carriageReturnIndex=null}decode(t){if(t==null)return[];const o=t instanceof ArrayBuffer?new Uint8Array(t):typeof t=="string"?Hc(t):t;this.buffer=Lw([this.buffer,o]);const a=[];let s;for(;(s=kw(this.buffer,this.carriageReturnIndex))!=null;){if(s.carriage&&this.carriageReturnIndex==null){this.carriageReturnIndex=s.index;continue}if(this.carriageReturnIndex!=null&&(s.index!==this.carriageReturnIndex+1||s.carriage)){a.push(zg(this.buffer.subarray(0,this.carriageReturnIndex-1))),this.buffer=this.buffer.subarray(this.carriageReturnIndex),this.carriageReturnIndex=null;continue}const c=this.carriageReturnIndex!==null?s.preceding-1:s.preceding,f=zg(this.buffer.subarray(0,c));a.push(f),this.buffer=this.buffer.subarray(s.index),this.carriageReturnIndex=null}return a}flush(){return this.buffer.length?this.decode(`
`):[]}}gs.NEWLINE_CHARS=new Set([`
`,"\r"]);gs.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function kw(n,t){for(let s=t??0;s<n.length;s++){if(n[s]===10)return{preceding:s,index:s+1,carriage:!1};if(n[s]===13)return{preceding:s,index:s+1,carriage:!0}}return null}function Pw(n){for(let a=0;a<n.length-1;a++){if(n[a]===10&&n[a+1]===10||n[a]===13&&n[a+1]===13)return a+2;if(n[a]===13&&n[a+1]===10&&a+3<n.length&&n[a+2]===13&&n[a+3]===10)return a+4}return-1}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const as={off:0,error:200,warn:300,info:400,debug:500},Og=(n,t,o)=>{if(n){if(hw(as,n))return n;dt(o).warn(`${t} was set to ${JSON.stringify(n)}, expected one of ${JSON.stringify(Object.keys(as))}`)}};function yl(){}function Ka(n,t,o){return!t||as[n]>as[o]?yl:t[n].bind(t)}const Gw={error:yl,warn:yl,info:yl,debug:yl};let Bg=new WeakMap;function dt(n){var t;const o=n.logger,a=(t=n.logLevel)!==null&&t!==void 0?t:"off";if(!o)return Gw;const s=Bg.get(o);if(s&&s[0]===a)return s[1];const c={error:Ka("error",o,a),warn:Ka("warn",o,a),info:Ka("info",o,a),debug:Ka("debug",o,a)};return Bg.set(o,[a,c]),c}const Ei=n=>(n.options&&(n.options=Object.assign({},n.options),delete n.options.headers),n.headers&&(n.headers=Object.fromEntries((n.headers instanceof Headers?[...n.headers]:Object.entries(n.headers)).map(([t,o])=>[t,t.toLowerCase()==="x-goog-api-key"||t.toLowerCase()==="authorization"||t.toLowerCase()==="cookie"||t.toLowerCase()==="set-cookie"?"***":o]))),"retryOfRequestLogID"in n&&(n.retryOfRequestLogID&&(n.retryOf=n.retryOfRequestLogID),delete n.retryOfRequestLogID),n);/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class uo{constructor(t,o,a){this.iterator=t,this.controller=o,this.client=a}static fromSSEResponse(t,o,a){let s=!1;const c=a?dt(a):console;function f(){return jt(this,arguments,function*(){var y,p,x,E;if(s)throw new zt("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let S=!1;try{try{for(var b=!0,C=Kt(qw(t,o)),I;I=yield se(C.next()),y=I.done,!y;b=!0){E=I.value,b=!1;const w=E;if(!S)if(w.data.startsWith("[DONE]")){S=!0;continue}else try{yield yield se(JSON.parse(w.data))}catch(G){throw c.error("Could not parse message into JSON:",w.data),c.error("From chunk:",w.raw),G}}}catch(w){p={error:w}}finally{try{!b&&!y&&(x=C.return)&&(yield se(x.call(C)))}finally{if(p)throw p.error}}S=!0}catch(w){if(dc(w))return yield se(void 0);throw w}finally{S||o.abort()}})}return new uo(f,o,a)}static fromReadableStream(t,o,a){let s=!1;function c(){return jt(this,arguments,function*(){var y,p,x,E;const S=new gs,b=cy(t);try{for(var C=!0,I=Kt(b),w;w=yield se(I.next()),y=w.done,!y;C=!0){E=w.value,C=!1;const G=E;for(const V of S.decode(G))yield yield se(V)}}catch(G){p={error:G}}finally{try{!C&&!y&&(x=I.return)&&(yield se(x.call(I)))}finally{if(p)throw p.error}}for(const G of S.flush())yield yield se(G)})}function f(){return jt(this,arguments,function*(){var y,p,x,E;if(s)throw new zt("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");s=!0;let S=!1;try{try{for(var b=!0,C=Kt(c()),I;I=yield se(C.next()),y=I.done,!y;b=!0){E=I.value,b=!1;const w=E;S||w&&(yield yield se(JSON.parse(w)))}}catch(w){p={error:w}}finally{try{!b&&!y&&(x=C.return)&&(yield se(x.call(C)))}finally{if(p)throw p.error}}S=!0}catch(w){if(dc(w))return yield se(void 0);throw w}finally{S||o.abort()}})}return new uo(f,o,a)}[Symbol.asyncIterator](){return this.iterator()}tee(){const t=[],o=[],a=this.iterator(),s=c=>({next:()=>{if(c.length===0){const f=a.next();t.push(f),o.push(f)}return c.shift()}});return[new uo(()=>s(t),this.controller,this.client),new uo(()=>s(o),this.controller,this.client)]}toReadableStream(){const t=this;let o;return uy({async start(){o=t[Symbol.asyncIterator]()},async pull(a){try{const{value:s,done:c}=await o.next();if(c)return a.close();const f=Hc(JSON.stringify(s)+`
`);a.enqueue(f)}catch(s){a.error(s)}},async cancel(){var a;await((a=o.return)===null||a===void 0?void 0:a.call(o))}})}}function qw(n,t){return jt(this,arguments,function*(){var a,s,c,f;if(!n.body)throw t.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new zt("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 zt("Attempted to iterate over a response with no body");const h=new Hw,y=new gs,p=cy(n.body);try{for(var x=!0,E=Kt(Vw(p)),S;S=yield se(E.next()),a=S.done,!a;x=!0){f=S.value,x=!1;const b=f;for(const C of y.decode(b)){const I=h.decode(C);I&&(yield yield se(I))}}}catch(b){s={error:b}}finally{try{!x&&!a&&(c=E.return)&&(yield se(c.call(E)))}finally{if(s)throw s.error}}for(const b of y.flush()){const C=h.decode(b);C&&(yield yield se(C))}})}function Vw(n){return jt(this,arguments,function*(){var o,a,s,c;let f=new Uint8Array;try{for(var h=!0,y=Kt(n),p;p=yield se(y.next()),o=p.done,!o;h=!0){c=p.value,h=!1;const x=c;if(x==null)continue;const E=x instanceof ArrayBuffer?new Uint8Array(x):typeof x=="string"?Hc(x):x;let S=new Uint8Array(f.length+E.length);S.set(f),S.set(E,f.length),f=S;let b;for(;(b=Pw(f))!==-1;)yield yield se(f.slice(0,b)),f=f.slice(b)}}catch(x){a={error:x}}finally{try{!h&&!o&&(s=y.return)&&(yield se(s.call(y)))}finally{if(a)throw a.error}}f.length>0&&(yield yield se(f))})}class Hw{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 c={event:this.event,data:this.data.join(`
`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],c}if(this.chunks.push(t),t.startsWith(":"))return null;let[o,a,s]=zw(t,":");return s.startsWith(" ")&&(s=s.substring(1)),o==="event"?this.event=s:o==="data"&&this.data.push(s),null}}function zw(n,t){const o=n.indexOf(t);return o!==-1?[n.substring(0,o),t,n.substring(o+t.length)]:[n,"",""]}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/async function Ow(n,t){const{response:o,requestLogID:a,retryOfRequestLogID:s,startTime:c}=t,f=await(async()=>{var h;if(t.options.stream)return dt(n).debug("response",o.status,o.url,o.headers,o.body),t.options.__streamClass?t.options.__streamClass.fromSSEResponse(o,t.controller,n):uo.fromSSEResponse(o,t.controller,n);if(o.status===204)return null;if(t.options.__binaryResponse)return o;const y=o.headers.get("content-type"),p=(h=y==null?void 0:y.split(";")[0])===null||h===void 0?void 0:h.trim();return(p==null?void 0:p.includes("application/json"))||(p==null?void 0:p.endsWith("+json"))?o.headers.get("content-length")==="0"?void 0:await o.json():await o.text()})();return dt(n).debug(`[${a}] response parsed`,Ei({retryOfRequestLogID:s,url:o.url,status:o.status,body:f,durationMs:Date.now()-c})),f}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class zc extends Promise{constructor(t,o,a=Ow){super(s=>{s(null)}),this.responsePromise=o,this.parseResponse=a,this.client=t}_thenUnwrap(t){return new zc(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 yy=Symbol("brand.privateNullableHeaders");function*Bw(n){if(!n)return;if(yy in n){const{values:a,nulls:s}=n;yield*a.entries();for(const c of s)yield[c,null];return}let t=!1,o;n instanceof Headers?o=n.entries():Gg(n)?o=n:(t=!0,o=Object.entries(n??{}));for(let a of o){const s=a[0];if(typeof s!="string")throw new TypeError("expected header name to be a string");const c=Gg(a[1])?a[1]:[a[1]];let f=!1;for(const h of c)h!==void 0&&(t&&!f&&(f=!0,yield[s,null]),yield[s,h])}}const gl=n=>{const t=new Headers,o=new Set;for(const a of n){const s=new Set;for(const[c,f]of Bw(a)){const h=c.toLowerCase();s.has(h)||(t.delete(c),s.add(h)),f===null?(t.delete(c),o.add(h)):(t.append(c,f),o.delete(h))}}return{[yy]:!0,values:t,nulls:o}};/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const Xu=n=>{var t,o,a,s,c,f;if(typeof globalThis.process<"u")return(a=(o=(t=r_)===null||t===void 0?void 0:t[n])===null||o===void 0?void 0:o.trim())!==null&&a!==void 0?a:void 0;if(typeof globalThis.Deno<"u")return(f=(c=(s=globalThis.Deno.env)===null||s===void 0?void 0:s.get)===null||c===void 0?void 0:c.call(s,n))===null||f===void 0?void 0:f.trim()};/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/var vy;class ys{constructor(t){var o,a,s,c,f,h,y,{baseURL:p=Xu("GEMINI_NEXT_GEN_API_BASE_URL"),apiKey:x=(o=Xu("GEMINI_API_KEY"))!==null&&o!==void 0?o:null,apiVersion:E="v1beta"}=t,S=ls(t,["baseURL","apiKey","apiVersion"]);const b=Object.assign(Object.assign({apiKey:x,apiVersion:E},S),{baseURL:p||"https://generativelanguage.googleapis.com"});this.baseURL=b.baseURL,this.timeout=(a=b.timeout)!==null&&a!==void 0?a:ys.DEFAULT_TIMEOUT,this.logger=(s=b.logger)!==null&&s!==void 0?s:console;const C="warn";this.logLevel=C,this.logLevel=(f=(c=Og(b.logLevel,"ClientOptions.logLevel",this))!==null&&c!==void 0?c:Og(Xu("GEMINI_NEXT_GEN_API_LOG"),"process.env['GEMINI_NEXT_GEN_API_LOG']",this))!==null&&f!==void 0?f:C,this.fetchOptions=b.fetchOptions,this.maxRetries=(h=b.maxRetries)!==null&&h!==void 0?h:2,this.fetch=(y=b.fetch)!==null&&y!==void 0?y:_w(),this.encoder=Nw,this._options=b,this.apiKey=x,this.apiVersion=E,this.clientAdapter=b.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=gl([t.headers]);if(!(o.values.has("authorization")||o.values.has("x-goog-api-key"))){if(this.apiKey)return gl([{"x-goog-api-key":this.apiKey}]);if(this.clientAdapter.isVertexAI())return gl([await this.clientAdapter.getAuthHeaders()])}}stringifyQuery(t){return Object.entries(t).filter(([o,a])=>typeof a<"u").map(([o,a])=>{if(typeof a=="string"||typeof a=="number"||typeof a=="boolean")return`${encodeURIComponent(o)}=${encodeURIComponent(a)}`;if(a===null)return`${encodeURIComponent(o)}=`;throw new zt(`Cannot stringify type ${typeof a}; 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("&")}getUserAgent(){return`${this.constructor.name}/JS ${so}`}defaultIdempotencyKey(){return`stainless-node-retry-${uw()}`}makeStatusError(t,o,a,s){return ft.generate(t,o,a,s)}buildURL(t,o,a){const s=!this.baseURLOverridden()&&a||this.baseURL,c=dw(t)?new URL(t):new URL(s+(s.endsWith("/")&&t.startsWith("/")?t.slice(1):t)),f=this.defaultQuery();return pw(f)||(o=Object.assign(Object.assign({},f),o)),typeof o=="object"&&o&&!Array.isArray(o)&&(c.search=this.stringifyQuery(o)),c.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(s=>Object.assign({method:t,path:o},s)))}request(t,o=null){return new zc(this,this.makeRequest(t,o,void 0))}async makeRequest(t,o,a){var s,c,f;const h=await t,y=(s=h.maxRetries)!==null&&s!==void 0?s:this.maxRetries;o==null&&(o=y),await this.prepareOptions(h);const{req:p,url:x,timeout:E}=await this.buildRequest(h,{retryCount:y-o});await this.prepareRequest(p,{url:x,options:h});const S="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),b=a===void 0?"":`, retryOf: ${a}`,C=Date.now();if(dt(this).debug(`[${S}] sending request`,Ei({retryOfRequestLogID:a,method:h.method,url:x,options:h,headers:p.headers})),!((c=h.signal)===null||c===void 0)&&c.aborted)throw new mc;const I=new AbortController,w=await this.fetchWithTimeout(x,p,E,I).catch(fc),G=Date.now();if(w instanceof globalThis.Error){const P=`retrying, ${o} attempts remaining`;if(!((f=h.signal)===null||f===void 0)&&f.aborted)throw new mc;const Y=dc(w)||/timed? ?out/i.test(String(w)+("cause"in w?String(w.cause):""));if(o)return dt(this).info(`[${S}] connection ${Y?"timed out":"failed"} - ${P}`),dt(this).debug(`[${S}] connection ${Y?"timed out":"failed"} (${P})`,Ei({retryOfRequestLogID:a,url:x,durationMs:G-C,message:w.message})),this.retryRequest(h,o,a??S);throw dt(this).info(`[${S}] connection ${Y?"timed out":"failed"} - error; no more retries left`),dt(this).debug(`[${S}] connection ${Y?"timed out":"failed"} (error; no more retries left)`,Ei({retryOfRequestLogID:a,url:x,durationMs:G-C,message:w.message})),Y?new ey:new hs({cause:w})}const V=`[${S}${b}] ${p.method} ${x} ${w.ok?"succeeded":"failed"} with status ${w.status} in ${G-C}ms`;if(!w.ok){const P=await this.shouldRetry(w);if(o&&P){const Z=`retrying, ${o} attempts remaining`;return await Cw(w.body),dt(this).info(`${V} - ${Z}`),dt(this).debug(`[${S}] response error (${Z})`,Ei({retryOfRequestLogID:a,url:w.url,status:w.status,headers:w.headers,durationMs:G-C})),this.retryRequest(h,o,a??S,w.headers)}const Y=P?"error; no more retries left":"error; not retryable";dt(this).info(`${V} - ${Y}`);const X=await w.text().catch(Z=>fc(Z).message),B=yw(X),j=B?void 0:X;throw dt(this).debug(`[${S}] response error (${Y})`,Ei({retryOfRequestLogID:a,url:w.url,status:w.status,headers:w.headers,message:j,durationMs:Date.now()-C})),this.makeStatusError(w.status,B,j,w.headers)}return dt(this).info(V),dt(this).debug(`[${S}] response start`,Ei({retryOfRequestLogID:a,url:w.url,status:w.status,headers:w.headers,durationMs:G-C})),{response:w,options:h,controller:I,requestLogID:S,retryOfRequestLogID:a,startTime:C}}async fetchWithTimeout(t,o,a,s){const c=o||{},{signal:f,method:h}=c,y=ls(c,["signal","method"]),p=this._makeAbort(s);f&&f.addEventListener("abort",p,{once:!0});const x=setTimeout(p,a),E=globalThis.ReadableStream&&y.body instanceof globalThis.ReadableStream||typeof y.body=="object"&&y.body!==null&&Symbol.asyncIterator in y.body,S=Object.assign(Object.assign(Object.assign({signal:s.signal},E?{duplex:"half"}:{}),{method:"GET"}),y);h&&(S.method=h.toUpperCase());try{return await this.fetch.call(void 0,t,S)}finally{clearTimeout(x)}}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,s){var c;let f;const h=s==null?void 0:s.get("retry-after-ms");if(h){const p=parseFloat(h);Number.isNaN(p)||(f=p)}const y=s==null?void 0:s.get("retry-after");if(y&&!f){const p=parseFloat(y);Number.isNaN(p)?f=Date.parse(y)-Date.now():f=p*1e3}if(!(f&&0<=f&&f<60*1e3)){const p=(c=t.maxRetries)!==null&&c!==void 0?c:this.maxRetries;f=this.calculateDefaultRetryTimeoutMillis(o,p)}return await vw(f),this.makeRequest(t,o-1,a)}calculateDefaultRetryTimeoutMillis(t,o){const c=o-t,f=Math.min(.5*Math.pow(2,c),8),h=1-Math.random()*.25;return f*h*1e3}async buildRequest(t,{retryCount:o=0}={}){var a,s,c;const f=Object.assign({},t),{method:h,path:y,query:p,defaultBaseURL:x}=f,E=this.buildURL(y,p,x);"timeout"in f&&gw("timeout",f.timeout),f.timeout=(a=f.timeout)!==null&&a!==void 0?a:this.timeout;const{bodyHeaders:S,body:b}=this.buildBody({options:f}),C=await this.buildHeaders({options:t,method:h,bodyHeaders:S,retryCount:o});return{req:Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({method:h,headers:C},f.signal&&{signal:f.signal}),globalThis.ReadableStream&&b instanceof globalThis.ReadableStream&&{duplex:"half"}),b&&{body:b}),(s=this.fetchOptions)!==null&&s!==void 0?s:{}),(c=f.fetchOptions)!==null&&c!==void 0?c:{}),url:E,timeout:f.timeout}}async buildHeaders({options:t,method:o,bodyHeaders:a,retryCount:s}){let c={};this.idempotencyHeader&&o!=="get"&&(t.idempotencyKey||(t.idempotencyKey=this.defaultIdempotencyKey()),c[this.idempotencyHeader]=t.idempotencyKey);const f=await this.authHeaders(t);let h=gl([c,Object.assign(Object.assign({Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(s)},t.timeout?{"X-Stainless-Timeout":String(Math.trunc(t.timeout/1e3))}:{}),Sw()),this._options.defaultHeaders,a,t.headers,f]);return this.validateHeaders(h),h.values}_makeAbort(t){return()=>t.abort()}buildBody({options:{body:t,headers:o}}){if(!t)return{bodyHeaders:void 0,body:void 0};const a=gl([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:bw(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})}}ys.DEFAULT_TIMEOUT=6e4;class nt extends ys{constructor(){super(...arguments),this.interactions=new gy(this)}}vy=nt;nt.GeminiNextGenAPIClient=vy;nt.GeminiNextGenAPIClientError=zt;nt.APIError=ft;nt.APIConnectionError=hs;nt.APIConnectionTimeoutError=ey;nt.APIUserAbortError=mc;nt.NotFoundError=oy;nt.ConflictError=ly;nt.RateLimitError=sy;nt.BadRequestError=ty;nt.AuthenticationError=ny;nt.InternalServerError=ry;nt.PermissionDeniedError=iy;nt.UnprocessableEntityError=ay;nt.toFile=Iw;nt.Interactions=gy;/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/function Fw(n,t){const o={},a=u(n,["name"]);return a!=null&&d(o,["_url","name"],a),o}function Jw(n,t){const o={},a=u(n,["name"]);return a!=null&&d(o,["_url","name"],a),o}function Yw(n,t){const o={},a=u(n,["sdkHttpResponse"]);return a!=null&&d(o,["sdkHttpResponse"],a),o}function jw(n,t){const o={},a=u(n,["sdkHttpResponse"]);return a!=null&&d(o,["sdkHttpResponse"],a),o}function Kw(n,t,o){const a={};if(u(n,["validationDataset"])!==void 0)throw new Error("validationDataset parameter is not supported in Gemini API.");const s=u(n,["tunedModelDisplayName"]);if(t!==void 0&&s!=null&&d(t,["displayName"],s),u(n,["description"])!==void 0)throw new Error("description parameter is not supported in Gemini API.");const c=u(n,["epochCount"]);t!==void 0&&c!=null&&d(t,["tuningTask","hyperparameters","epochCount"],c);const f=u(n,["learningRateMultiplier"]);if(f!=null&&d(a,["tuningTask","hyperparameters","learningRateMultiplier"],f),u(n,["exportLastCheckpointOnly"])!==void 0)throw new Error("exportLastCheckpointOnly parameter is not supported in Gemini API.");if(u(n,["preTunedModelCheckpointId"])!==void 0)throw new Error("preTunedModelCheckpointId parameter is not supported in Gemini API.");if(u(n,["adapterSize"])!==void 0)throw new Error("adapterSize parameter is not supported in Gemini API.");if(u(n,["tuningMode"])!==void 0)throw new Error("tuningMode parameter is not supported in Gemini API.");if(u(n,["customBaseModel"])!==void 0)throw new Error("customBaseModel parameter is not supported in Gemini API.");const h=u(n,["batchSize"]);t!==void 0&&h!=null&&d(t,["tuningTask","hyperparameters","batchSize"],h);const y=u(n,["learningRate"]);if(t!==void 0&&y!=null&&d(t,["tuningTask","hyperparameters","learningRate"],y),u(n,["labels"])!==void 0)throw new Error("labels parameter is not supported in Gemini API.");if(u(n,["beta"])!==void 0)throw new Error("beta parameter is not supported in Gemini API.");if(u(n,["baseTeacherModel"])!==void 0)throw new Error("baseTeacherModel parameter is not supported in Gemini API.");if(u(n,["tunedTeacherModelSource"])!==void 0)throw new Error("tunedTeacherModelSource parameter is not supported in Gemini API.");if(u(n,["sftLossWeightMultiplier"])!==void 0)throw new Error("sftLossWeightMultiplier parameter is not supported in Gemini API.");if(u(n,["outputUri"])!==void 0)throw new Error("outputUri parameter is not supported in Gemini API.");if(u(n,["encryptionSpec"])!==void 0)throw new Error("encryptionSpec parameter is not supported in Gemini API.");return a}function Xw(n,t,o){const a={};let s=u(o,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const B=u(n,["validationDataset"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec"],$u(B))}else if(s==="PREFERENCE_TUNING"){const B=u(n,["validationDataset"]);t!==void 0&&B!=null&&d(t,["preferenceOptimizationSpec"],$u(B))}else if(s==="DISTILLATION"){const B=u(n,["validationDataset"]);t!==void 0&&B!=null&&d(t,["distillationSpec"],$u(B))}const c=u(n,["tunedModelDisplayName"]);t!==void 0&&c!=null&&d(t,["tunedModelDisplayName"],c);const f=u(n,["description"]);t!==void 0&&f!=null&&d(t,["description"],f);let h=u(o,["config","method"]);if(h===void 0&&(h="SUPERVISED_FINE_TUNING"),h==="SUPERVISED_FINE_TUNING"){const B=u(n,["epochCount"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","hyperParameters","epochCount"],B)}else if(h==="PREFERENCE_TUNING"){const B=u(n,["epochCount"]);t!==void 0&&B!=null&&d(t,["preferenceOptimizationSpec","hyperParameters","epochCount"],B)}else if(h==="DISTILLATION"){const B=u(n,["epochCount"]);t!==void 0&&B!=null&&d(t,["distillationSpec","hyperParameters","epochCount"],B)}let y=u(o,["config","method"]);if(y===void 0&&(y="SUPERVISED_FINE_TUNING"),y==="SUPERVISED_FINE_TUNING"){const B=u(n,["learningRateMultiplier"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","hyperParameters","learningRateMultiplier"],B)}else if(y==="PREFERENCE_TUNING"){const B=u(n,["learningRateMultiplier"]);t!==void 0&&B!=null&&d(t,["preferenceOptimizationSpec","hyperParameters","learningRateMultiplier"],B)}else if(y==="DISTILLATION"){const B=u(n,["learningRateMultiplier"]);t!==void 0&&B!=null&&d(t,["distillationSpec","hyperParameters","learningRateMultiplier"],B)}let p=u(o,["config","method"]);if(p===void 0&&(p="SUPERVISED_FINE_TUNING"),p==="SUPERVISED_FINE_TUNING"){const B=u(n,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","exportLastCheckpointOnly"],B)}else if(p==="PREFERENCE_TUNING"){const B=u(n,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&d(t,["preferenceOptimizationSpec","exportLastCheckpointOnly"],B)}else if(p==="DISTILLATION"){const B=u(n,["exportLastCheckpointOnly"]);t!==void 0&&B!=null&&d(t,["distillationSpec","exportLastCheckpointOnly"],B)}let x=u(o,["config","method"]);if(x===void 0&&(x="SUPERVISED_FINE_TUNING"),x==="SUPERVISED_FINE_TUNING"){const B=u(n,["adapterSize"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","hyperParameters","adapterSize"],B)}else if(x==="PREFERENCE_TUNING"){const B=u(n,["adapterSize"]);t!==void 0&&B!=null&&d(t,["preferenceOptimizationSpec","hyperParameters","adapterSize"],B)}else if(x==="DISTILLATION"){const B=u(n,["adapterSize"]);t!==void 0&&B!=null&&d(t,["distillationSpec","hyperParameters","adapterSize"],B)}let E=u(o,["config","method"]);if(E===void 0&&(E="SUPERVISED_FINE_TUNING"),E==="SUPERVISED_FINE_TUNING"){const B=u(n,["tuningMode"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","tuningMode"],B)}const S=u(n,["customBaseModel"]);t!==void 0&&S!=null&&d(t,["customBaseModel"],S);let b=u(o,["config","method"]);if(b===void 0&&(b="SUPERVISED_FINE_TUNING"),b==="SUPERVISED_FINE_TUNING"){const B=u(n,["batchSize"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","hyperParameters","batchSize"],B)}let C=u(o,["config","method"]);if(C===void 0&&(C="SUPERVISED_FINE_TUNING"),C==="SUPERVISED_FINE_TUNING"){const B=u(n,["learningRate"]);t!==void 0&&B!=null&&d(t,["supervisedTuningSpec","hyperParameters","learningRate"],B)}const I=u(n,["labels"]);t!==void 0&&I!=null&&d(t,["labels"],I);const w=u(n,["beta"]);t!==void 0&&w!=null&&d(t,["preferenceOptimizationSpec","hyperParameters","beta"],w);const G=u(n,["baseTeacherModel"]);t!==void 0&&G!=null&&d(t,["distillationSpec","baseTeacherModel"],G);const V=u(n,["tunedTeacherModelSource"]);t!==void 0&&V!=null&&d(t,["distillationSpec","tunedTeacherModelSource"],V);const P=u(n,["sftLossWeightMultiplier"]);t!==void 0&&P!=null&&d(t,["distillationSpec","hyperParameters","sftLossWeightMultiplier"],P);const Y=u(n,["outputUri"]);t!==void 0&&Y!=null&&d(t,["outputUri"],Y);const X=u(n,["encryptionSpec"]);return t!==void 0&&X!=null&&d(t,["encryptionSpec"],X),a}function $w(n,t){const o={},a=u(n,["baseModel"]);a!=null&&d(o,["baseModel"],a);const s=u(n,["preTunedModel"]);s!=null&&d(o,["preTunedModel"],s);const c=u(n,["trainingDataset"]);c!=null&&sR(c);const f=u(n,["config"]);return f!=null&&Kw(f,o),o}function Qw(n,t){const o={},a=u(n,["baseModel"]);a!=null&&d(o,["baseModel"],a);const s=u(n,["preTunedModel"]);s!=null&&d(o,["preTunedModel"],s);const c=u(n,["trainingDataset"]);c!=null&&rR(c,o,t);const f=u(n,["config"]);return f!=null&&Xw(f,o,t),o}function Zw(n,t){const o={},a=u(n,["name"]);return a!=null&&d(o,["_url","name"],a),o}function Ww(n,t){const o={},a=u(n,["name"]);return a!=null&&d(o,["_url","name"],a),o}function eR(n,t,o){const a={},s=u(n,["pageSize"]);t!==void 0&&s!=null&&d(t,["_query","pageSize"],s);const c=u(n,["pageToken"]);t!==void 0&&c!=null&&d(t,["_query","pageToken"],c);const f=u(n,["filter"]);return t!==void 0&&f!=null&&d(t,["_query","filter"],f),a}function tR(n,t,o){const a={},s=u(n,["pageSize"]);t!==void 0&&s!=null&&d(t,["_query","pageSize"],s);const c=u(n,["pageToken"]);t!==void 0&&c!=null&&d(t,["_query","pageToken"],c);const f=u(n,["filter"]);return t!==void 0&&f!=null&&d(t,["_query","filter"],f),a}function nR(n,t){const o={},a=u(n,["config"]);return a!=null&&eR(a,o),o}function iR(n,t){const o={},a=u(n,["config"]);return a!=null&&tR(a,o),o}function oR(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["nextPageToken"]);s!=null&&d(o,["nextPageToken"],s);const c=u(n,["tunedModels"]);if(c!=null){let f=c;Array.isArray(f)&&(f=f.map(h=>xy(h))),d(o,["tuningJobs"],f)}return o}function lR(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["nextPageToken"]);s!=null&&d(o,["nextPageToken"],s);const c=u(n,["tuningJobs"]);if(c!=null){let f=c;Array.isArray(f)&&(f=f.map(h=>gc(h))),d(o,["tuningJobs"],f)}return o}function aR(n,t){const o={},a=u(n,["name"]);a!=null&&d(o,["model"],a);const s=u(n,["name"]);return s!=null&&d(o,["endpoint"],s),o}function sR(n,t){const o={};if(u(n,["gcsUri"])!==void 0)throw new Error("gcsUri parameter is not supported in Gemini API.");if(u(n,["vertexDatasetResource"])!==void 0)throw new Error("vertexDatasetResource parameter is not supported in Gemini API.");const a=u(n,["examples"]);if(a!=null){let s=a;Array.isArray(s)&&(s=s.map(c=>c)),d(o,["examples","examples"],s)}return o}function rR(n,t,o){const a={};let s=u(o,["config","method"]);if(s===void 0&&(s="SUPERVISED_FINE_TUNING"),s==="SUPERVISED_FINE_TUNING"){const f=u(n,["gcsUri"]);t!==void 0&&f!=null&&d(t,["supervisedTuningSpec","trainingDatasetUri"],f)}else if(s==="PREFERENCE_TUNING"){const f=u(n,["gcsUri"]);t!==void 0&&f!=null&&d(t,["preferenceOptimizationSpec","trainingDatasetUri"],f)}else if(s==="DISTILLATION"){const f=u(n,["gcsUri"]);t!==void 0&&f!=null&&d(t,["distillationSpec","promptDatasetUri"],f)}let c=u(o,["config","method"]);if(c===void 0&&(c="SUPERVISED_FINE_TUNING"),c==="SUPERVISED_FINE_TUNING"){const f=u(n,["vertexDatasetResource"]);t!==void 0&&f!=null&&d(t,["supervisedTuningSpec","trainingDatasetUri"],f)}else if(c==="PREFERENCE_TUNING"){const f=u(n,["vertexDatasetResource"]);t!==void 0&&f!=null&&d(t,["preferenceOptimizationSpec","trainingDatasetUri"],f)}else if(c==="DISTILLATION"){const f=u(n,["vertexDatasetResource"]);t!==void 0&&f!=null&&d(t,["distillationSpec","promptDatasetUri"],f)}if(u(n,["examples"])!==void 0)throw new Error("examples parameter is not supported in Vertex AI.");return a}function xy(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["name"]);s!=null&&d(o,["name"],s);const c=u(n,["state"]);c!=null&&d(o,["state"],k0(c));const f=u(n,["createTime"]);f!=null&&d(o,["createTime"],f);const h=u(n,["tuningTask","startTime"]);h!=null&&d(o,["startTime"],h);const y=u(n,["tuningTask","completeTime"]);y!=null&&d(o,["endTime"],y);const p=u(n,["updateTime"]);p!=null&&d(o,["updateTime"],p);const x=u(n,["description"]);x!=null&&d(o,["description"],x);const E=u(n,["baseModel"]);E!=null&&d(o,["baseModel"],E);const S=u(n,["_self"]);return S!=null&&d(o,["tunedModel"],aR(S)),o}function gc(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["name"]);s!=null&&d(o,["name"],s);const c=u(n,["state"]);c!=null&&d(o,["state"],k0(c));const f=u(n,["createTime"]);f!=null&&d(o,["createTime"],f);const h=u(n,["startTime"]);h!=null&&d(o,["startTime"],h);const y=u(n,["endTime"]);y!=null&&d(o,["endTime"],y);const p=u(n,["updateTime"]);p!=null&&d(o,["updateTime"],p);const x=u(n,["error"]);x!=null&&d(o,["error"],x);const E=u(n,["description"]);E!=null&&d(o,["description"],E);const S=u(n,["baseModel"]);S!=null&&d(o,["baseModel"],S);const b=u(n,["tunedModel"]);b!=null&&d(o,["tunedModel"],b);const C=u(n,["preTunedModel"]);C!=null&&d(o,["preTunedModel"],C);const I=u(n,["supervisedTuningSpec"]);I!=null&&d(o,["supervisedTuningSpec"],I);const w=u(n,["preferenceOptimizationSpec"]);w!=null&&d(o,["preferenceOptimizationSpec"],w);const G=u(n,["distillationSpec"]);G!=null&&d(o,["distillationSpec"],G);const V=u(n,["tuningDataStats"]);V!=null&&d(o,["tuningDataStats"],V);const P=u(n,["encryptionSpec"]);P!=null&&d(o,["encryptionSpec"],P);const Y=u(n,["partnerModelTuningSpec"]);Y!=null&&d(o,["partnerModelTuningSpec"],Y);const X=u(n,["customBaseModel"]);X!=null&&d(o,["customBaseModel"],X);const B=u(n,["experiment"]);B!=null&&d(o,["experiment"],B);const j=u(n,["labels"]);j!=null&&d(o,["labels"],j);const le=u(n,["outputUri"]);le!=null&&d(o,["outputUri"],le);const Z=u(n,["pipelineJob"]);Z!=null&&d(o,["pipelineJob"],Z);const ae=u(n,["serviceAccount"]);ae!=null&&d(o,["serviceAccount"],ae);const be=u(n,["tunedModelDisplayName"]);be!=null&&d(o,["tunedModelDisplayName"],be);const Re=u(n,["veoTuningSpec"]);return Re!=null&&d(o,["veoTuningSpec"],Re),o}function uR(n,t){const o={},a=u(n,["sdkHttpResponse"]);a!=null&&d(o,["sdkHttpResponse"],a);const s=u(n,["name"]);s!=null&&d(o,["name"],s);const c=u(n,["metadata"]);c!=null&&d(o,["metadata"],c);const f=u(n,["done"]);f!=null&&d(o,["done"],f);const h=u(n,["error"]);return h!=null&&d(o,["error"],h),o}function $u(n,t){const o={},a=u(n,["gcsUri"]);a!=null&&d(o,["validationDatasetUri"],a);const s=u(n,["vertexDatasetResource"]);return s!=null&&d(o,["validationDatasetUri"],s),o}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class cR extends Nn{constructor(t){super(),this.apiClient=t,this.list=async(o={})=>new Si(Cn.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 s={tunedModelName:o.baseModel};!((a=o.config)===null||a===void 0)&&a.preTunedModelCheckpointId&&(s.checkpointId=o.config.preTunedModelCheckpointId);const c=Object.assign(Object.assign({},o),{preTunedModel:s});return c.baseModel=void 0,await this.tuneInternal(c)}else{const s=Object.assign({},o);return await this.tuneInternal(s)}else{const s=Object.assign({},o),c=await this.tuneMldevInternal(s);let f="";return c.metadata!==void 0&&c.metadata.tunedModel!==void 0?f=c.metadata.tunedModel:c.name!==void 0&&c.name.includes("/operations/")&&(f=c.name.split("/operations/")[0]),{name:f,state:ic.JOB_STATE_QUEUED}}}}async getInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Ww(t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>gc(x))}else{const p=Zw(t);return h=$("{name}",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>xy(x))}}async listInternal(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=iR(t);return h=$("tuningJobs",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=lR(x),S=new gg;return Object.assign(S,E),S})}else{const p=nR(t);return h=$("tunedModels",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"GET",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=oR(x),S=new gg;return Object.assign(S,E),S})}}async cancel(t){var o,a,s,c;let f,h="",y={};if(this.apiClient.isVertexAI()){const p=Jw(t);return h=$("{name}:cancel",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),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(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=jw(x),S=new yg;return Object.assign(S,E),S})}else{const p=Fw(t);return h=$("{name}:cancel",p._url),y=p._query,delete p._url,delete p._query,f=this.apiClient.request({path:h,queryParams:y,body:JSON.stringify(p),httpMethod:"POST",httpOptions:(s=t.config)===null||s===void 0?void 0:s.httpOptions,abortSignal:(c=t.config)===null||c===void 0?void 0:c.abortSignal}).then(x=>x.json().then(E=>{const S=E;return S.sdkHttpResponse={headers:x.headers},S})),f.then(x=>{const E=Yw(x),S=new yg;return Object.assign(S,E),S})}}async tuneInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI()){const h=Qw(t,t);return c=$("tuningJobs",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>gc(y))}else throw new Error("This method is only supported by the Vertex AI.")}async tuneMldevInternal(t){var o,a;let s,c="",f={};if(this.apiClient.isVertexAI())throw new Error("This method is only supported by the Gemini Developer API.");{const h=$w(t);return c=$("tunedModels",h._url),f=h._query,delete h._url,delete h._query,s=this.apiClient.request({path:c,queryParams:f,body:JSON.stringify(h),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(p=>{const x=p;return x.sdkHttpResponse={headers:y.headers},x})),s.then(y=>uR(y))}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class dR{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 fR=1024*1024*8,mR=3,pR=1e3,hR=2,ss="x-goog-upload-status";async function gR(n,t,o){var a;const s=await Ey(n,t,o),c=await(s==null?void 0:s.json());if(((a=s==null?void 0:s.headers)===null||a===void 0?void 0:a[ss])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");return c.file}async function yR(n,t,o){var a;const s=await Ey(n,t,o),c=await(s==null?void 0:s.json());if(((a=s==null?void 0:s.headers)===null||a===void 0?void 0:a[ss])!=="final")throw new Error("Failed to upload file: Upload status is not finalized.");const f=R0(c),h=new Lc;return Object.assign(h,f),h}async function Ey(n,t,o){var a,s;let c=0,f=0,h=new lc(new Response),y="upload";for(c=n.size;f<c;){const p=Math.min(fR,c-f),x=n.slice(f,f+p);f+p>=c&&(y+=", finalize");let E=0,S=pR;for(;E<mR&&(h=await o.request({path:"",body:x,httpMethod:"POST",httpOptions:{apiVersion:"",baseUrl:t,headers:{"X-Goog-Upload-Command":y,"X-Goog-Upload-Offset":String(f),"Content-Length":String(p)}}}),!(!((a=h==null?void 0:h.headers)===null||a===void 0)&&a[ss]));)E++,await xR(S),S=S*hR;if(f+=p,((s=h==null?void 0:h.headers)===null||s===void 0?void 0:s[ss])!=="active")break;if(c<=f)throw new Error("All content has been uploaded, but the upload status is not finalized.")}return h}async function vR(n){return{size:n.size,type:n.type}}function xR(n){return new Promise(t=>setTimeout(t,n))}class ER{async upload(t,o,a){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await gR(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 yR(t,o,a)}async stat(t){if(typeof t=="string")throw new Error("File path is not supported in browser uploader.");return await vR(t)}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/class TR{create(t,o,a){return new SR(t,o,a)}}class SR{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 Fg="x-goog-api-key";class _R{constructor(t){this.apiKey=t}async addAuthHeaders(t,o){if(t.get(Fg)===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(Fg,this.apiKey)}}}/**
* @license
* Copyright 2025 Google LLC
* SPDX-License-Identifier: Apache-2.0
*/const bR="gl-node/";class CR{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 nt({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=f_(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 s=new _R(this.apiKey);this.apiClient=new v1({auth:s,apiVersion:this.apiVersion,apiKey:this.apiKey,vertexai:this.vertexai,httpOptions:this.httpOptions,userAgentExtra:bR+"web",uploader:new ER,downloader:new dR}),this.models=new G1(this.apiClient),this.live=new I1(this.apiClient,s,new TR),this.batches=new Bb(this.apiClient),this.chats=new bC(this.models,this.apiClient),this.caches=new TC(this.apiClient),this.files=new PC(this.apiClient),this.operations=new q1(this.apiClient),this.authTokens=new ew(this.apiClient),this.tunings=new cR(this.apiClient),this.fileSearchStores=new rw(this.apiClient)}}const NR=new CR({apiKey:"PLACEHOLDER_API_KEY"}),AR=async(n,t,o)=>{try{const a="gemini-2.5-flash",s=`
Tu es un expert en copywriting marketing pour Afropreunariat.
Rédige une description professionnelle, attrayante et optimisée SEO pour une entreprise.
Nom de l'entreprise : ${n}
Secteur : ${t}
Mots-clés/Services : ${o}
La description doit faire environ 80-100 mots, être en français, inspirer confiance et professionnalisme.
Ne mets pas de guillemets au début ou à la fin.
`;return(await NR.models.generateContent({model:a,contents:s})).text||"Impossible de générer une description pour le moment."}catch(a){return console.error("Gemini API Error:",a),"Erreur lors de la génération. Veuillez rédiger votre description manuellement."}},Jg=n=>{const t=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,o=n.match(t);return o&&o[2].length===11?o[2]:null},wR=({business:n,setBusiness:t})=>{var I,w,G;const[o,a]=L.useState(n),[s,c]=L.useState(n.videoUrl||""),[f,h]=L.useState(Jg(n.videoUrl||"")),[y,p]=L.useState(!1),x=V=>{a({...o,[V.target.name]:V.target.value})},E=(V,P)=>{a({...o,socialLinks:{...o.socialLinks,[V]:P}})},S=V=>{const P=V.target.value;c(P),h(Jg(P)),a({...o,videoUrl:P})},b=async()=>{p(!0);const V=await AR(o.name,o.category,"Innovation, Qualité, Service client");a(P=>({...P,description:V})),p(!1)},C=()=>{t(o),alert("Profil mis à jour avec succès !")};return v.jsxs("div",{className:"space-y-8",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("h2",{className:"text-2xl font-bold font-serif text-gray-900",children:"Éditer mon profil"}),v.jsx("button",{onClick:C,className:"bg-brand-600 text-white px-4 py-2 rounded-md hover:bg-brand-700 font-medium text-sm shadow-sm",children:"Enregistrer"})]}),v.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[v.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center",children:[v.jsx(ec,{className:"w-5 h-5 mr-2 text-brand-600"})," Identité Visuelle"]}),v.jsxs("div",{className:"flex items-center space-x-6",children:[v.jsx("div",{className:"shrink-0",children:v.jsx("img",{className:"h-24 w-24 object-cover rounded-full border-2 border-gray-200",src:o.logoUrl,alt:"Logo actuel"})}),v.jsxs("div",{className:"flex-1 border-2 border-dashed border-gray-300 rounded-md p-6 flex flex-col items-center justify-center hover:border-brand-400 transition-colors cursor-pointer bg-gray-50",children:[v.jsx(ec,{className:"h-8 w-8 text-gray-400"}),v.jsx("p",{className:"mt-1 text-xs text-gray-500",children:"Glissez votre logo ici ou cliquez pour parcourir"})]})]}),v.jsxs("div",{className:"grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6 mt-6",children:[v.jsxs("div",{className:"sm:col-span-3",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Nom de l'entreprise"}),v.jsx("input",{type:"text",name:"name",value:o.name,onChange:x,className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]}),v.jsxs("div",{className:"sm:col-span-3",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Secteur d'activité"}),v.jsx("select",{name:"category",value:o.category,onChange:x,className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm",children:Nc.map(V=>v.jsx("option",{value:V,children:V},V))})]}),v.jsxs("div",{className:"sm:col-span-6",children:[v.jsxs("div",{className:"flex justify-between mb-1",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Description"}),v.jsx("button",{type:"button",onClick:b,disabled:y,className:"text-xs flex items-center text-brand-600 hover:text-brand-800",children:y?"...":v.jsxs(v.Fragment,{children:[v.jsx(kS,{className:"w-3 h-3 mr-1"})," Générer avec IA"]})})]}),v.jsx("textarea",{name:"description",rows:3,value:o.description,onChange:x,className:"block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]})]})]}),v.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[v.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center",children:[v.jsx(YS,{className:"w-5 h-5 mr-2 text-red-600"})," Présentation Vidéo"]}),v.jsxs("div",{className:"space-y-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Lien de votre vidéo (Youtube)"}),v.jsxs("div",{className:"mt-1 flex rounded-md shadow-sm",children:[v.jsx("span",{className:"inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500 sm:text-sm",children:"https://"}),v.jsx("input",{type:"text",value:s.replace("https://",""),onChange:S,className:"flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300",placeholder:"www.youtube.com/watch?v=..."})]}),v.jsx("p",{className:"mt-2 text-sm text-gray-500",children:"Copiez l'URL de votre vidéo de présentation pour l'afficher sur votre profil."})]}),f?v.jsx("div",{className:"aspect-w-16 aspect-h-9 rounded-lg overflow-hidden bg-gray-100 mt-4 border border-gray-200",children:v.jsx("iframe",{src:`https://www.youtube.com/embed/${f}`,title:"YouTube video player",frameBorder:"0",allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-64 sm:h-80 rounded-lg"})}):s&&v.jsx("div",{className:"rounded-md bg-red-50 p-4 mt-4",children:v.jsxs("div",{className:"flex",children:[v.jsx("div",{className:"flex-shrink-0",children:v.jsx(Ic,{className:"h-5 w-5 text-red-400","aria-hidden":"true"})}),v.jsxs("div",{className:"ml-3",children:[v.jsx("h3",{className:"text-sm font-medium text-red-800",children:"Lien invalide"}),v.jsx("div",{className:"mt-2 text-sm text-red-700",children:v.jsx("p",{children:"Impossible de détecter une vidéo YouTube valide. Vérifiez le lien."})})]})]})})]})]}),v.jsxs("div",{className:"bg-white shadow rounded-lg p-6",children:[v.jsxs("h3",{className:"text-lg font-medium text-gray-900 mb-4 flex items-center",children:[v.jsx(S0,{className:"w-5 h-5 mr-2 text-blue-500"})," Coordonnées & Réseaux"]}),v.jsxs("div",{className:"grid grid-cols-1 gap-y-6 gap-x-4 sm:grid-cols-6",children:[v.jsxs("div",{className:"sm:col-span-3",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Email Contact"}),v.jsx("input",{type:"email",name:"contactEmail",value:o.contactEmail,onChange:x,className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]}),v.jsxs("div",{className:"sm:col-span-3",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Téléphone"}),v.jsx("input",{type:"text",name:"contactPhone",value:o.contactPhone||"",onChange:x,className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]}),v.jsxs("div",{className:"sm:col-span-6 border-t border-gray-100 pt-4 mt-2",children:[v.jsx("h4",{className:"text-sm font-medium text-gray-500 mb-3 uppercase",children:"Réseaux Sociaux"}),v.jsxs("div",{className:"space-y-3",children:[v.jsxs("div",{className:"flex rounded-md shadow-sm",children:[v.jsx("span",{className:"inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500",children:v.jsx(Ac,{className:"w-4 h-4"})}),v.jsx("input",{type:"text",placeholder:"Lien Facebook",value:((I=o.socialLinks)==null?void 0:I.facebook)||"",onChange:V=>E("facebook",V.target.value),className:"flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300"})]}),v.jsxs("div",{className:"flex rounded-md shadow-sm",children:[v.jsx("span",{className:"inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500",children:v.jsx(Rc,{className:"w-4 h-4"})}),v.jsx("input",{type:"text",placeholder:"Lien LinkedIn",value:((w=o.socialLinks)==null?void 0:w.linkedin)||"",onChange:V=>E("linkedin",V.target.value),className:"flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300"})]}),v.jsxs("div",{className:"flex rounded-md shadow-sm",children:[v.jsx("span",{className:"inline-flex items-center px-3 rounded-l-md border border-r-0 border-gray-300 bg-gray-50 text-gray-500",children:v.jsx(wc,{className:"w-4 h-4"})}),v.jsx("input",{type:"text",placeholder:"Lien Instagram",value:((G=o.socialLinks)==null?void 0:G.instagram)||"",onChange:V=>E("instagram",V.target.value),className:"flex-1 min-w-0 block w-full px-3 py-2 rounded-none rounded-r-md focus:ring-brand-500 focus:border-brand-500 sm:text-sm border-gray-300"})]})]})]})]})]})]})},RR=()=>{const[n,t]=L.useState(f0),[o,a]=L.useState(!1),[s,c]=L.useState({title:"",price:0,currency:"XOF",type:Qe.SERVICE}),f=x=>{window.confirm("Voulez-vous vraiment supprimer cette offre ?")&&t(n.filter(E=>E.id!==x))},h=x=>{c(x),a(!0)},y=()=>{c({title:"",price:0,currency:"XOF",type:Qe.SERVICE}),a(!0)},p=x=>{if(x.preventDefault(),s.id)t(n.map(E=>E.id===s.id?{...E,...s}:E));else{const E={id:Date.now().toString(),businessId:"1",title:s.title||"Nouvelle offre",type:s.type||Qe.PRODUCT,price:s.price||0,currency:s.currency,imageUrl:s.imageUrl||"https://picsum.photos/300/200?random="+Date.now(),active:!0};t([...n,E])}a(!1)};return v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"flex justify-between items-center",children:[v.jsx("h2",{className:"text-2xl font-bold font-serif text-gray-900",children:"Mes Offres"}),v.jsxs("button",{onClick:y,className:"flex items-center bg-brand-600 text-white px-4 py-2 rounded-md hover:bg-brand-700 font-medium text-sm shadow-sm transition-colors",children:[v.jsx(sh,{className:"w-4 h-4 mr-2"}),"Ajouter une offre"]})]}),n.length>0?v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6",children:n.map(x=>v.jsxs("div",{className:"bg-white rounded-lg shadow border border-gray-200 overflow-hidden group",children:[v.jsxs("div",{className:"relative h-40 bg-gray-200",children:[v.jsx("img",{src:x.imageUrl,alt:x.title,className:"w-full h-full object-cover"}),v.jsx("div",{className:"absolute top-2 right-2",children:v.jsx("span",{className:`px-2 py-1 text-xs font-bold rounded uppercase ${x.type===Qe.PRODUCT?"bg-blue-100 text-blue-800":"bg-purple-100 text-purple-800"}`,children:x.type===Qe.PRODUCT?"Produit":"Service"})})]}),v.jsxs("div",{className:"p-4",children:[v.jsx("h3",{className:"font-bold text-gray-900 truncate",children:x.title}),v.jsxs("p",{className:"text-brand-600 font-bold mt-1",children:[new Intl.NumberFormat("fr-FR").format(x.price)," ",x.currency]}),v.jsxs("div",{className:"mt-4 flex justify-between items-center pt-4 border-t border-gray-100",children:[v.jsx("span",{className:`inline-flex items-center px-2 py-0.5 rounded text-xs font-medium ${x.active?"bg-green-100 text-green-800":"bg-red-100 text-red-800"}`,children:x.active?"Actif":"Inactif"}),v.jsxs("div",{className:"flex space-x-2",children:[v.jsx("button",{onClick:()=>h(x),className:"p-1 text-gray-400 hover:text-brand-600",title:"Modifier",children:v.jsx(b0,{className:"w-4 h-4"})}),v.jsx("button",{onClick:()=>f(x.id),className:"p-1 text-gray-400 hover:text-red-600",title:"Supprimer",children:v.jsx(qS,{className:"w-4 h-4"})})]})]})]})]},x.id))}):v.jsxs("div",{className:"text-center py-12 bg-white rounded-lg border-2 border-dashed border-gray-300",children:[v.jsx(N0,{className:"mx-auto h-12 w-12 text-gray-400"}),v.jsx("h3",{className:"mt-2 text-sm font-medium text-gray-900",children:"Aucune offre"}),v.jsx("p",{className:"mt-1 text-sm text-gray-500",children:"Commencez à vendre vos produits ou services."})]}),o&&v.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:v.jsxs("div",{className:"flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0",children:[v.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity","aria-hidden":"true",onClick:()=>a(!1)}),v.jsx("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),v.jsx("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg w-full",children:v.jsxs("form",{onSubmit:p,children:[v.jsx("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:v.jsxs("div",{className:"sm:flex sm:items-start",children:[v.jsx("div",{className:"mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-brand-100 sm:mx-0 sm:h-10 sm:w-10",children:v.jsx(sh,{className:"h-6 w-6 text-brand-600"})}),v.jsxs("div",{className:"mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left w-full",children:[v.jsx("h3",{className:"text-lg leading-6 font-medium text-gray-900",id:"modal-title",children:s.id?"Modifier l'offre":"Ajouter une offre"}),v.jsxs("div",{className:"mt-4 space-y-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Type d'offre"}),v.jsxs("div",{className:"mt-2 flex space-x-4",children:[v.jsxs("label",{className:"inline-flex items-center",children:[v.jsx("input",{type:"radio",className:"form-radio text-brand-600",name:"type",checked:s.type===Qe.PRODUCT,onChange:()=>c({...s,type:Qe.PRODUCT})}),v.jsx("span",{className:"ml-2 text-sm",children:"Produit Physique"})]}),v.jsxs("label",{className:"inline-flex items-center",children:[v.jsx("input",{type:"radio",className:"form-radio text-brand-600",name:"type",checked:s.type===Qe.SERVICE,onChange:()=>c({...s,type:Qe.SERVICE})}),v.jsx("span",{className:"ml-2 text-sm",children:"Service / Prestation"})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Titre"}),v.jsx("input",{type:"text",required:!0,className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 sm:text-sm",value:s.title,onChange:x=>c({...s,title:x.target.value}),placeholder:"Ex: Savon Karité Bio"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Prix"}),v.jsx("input",{type:"number",required:!0,min:"0",className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 sm:text-sm",value:s.price,onChange:x=>c({...s,price:parseInt(x.target.value)})})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Devise"}),v.jsxs("select",{className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 sm:text-sm",value:s.currency,onChange:x=>c({...s,currency:x.target.value}),children:[v.jsx("option",{value:"XOF",children:"FCFA (XOF)"}),v.jsx("option",{value:"EUR",children:"EUR (€)"})]})]})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Photo"}),v.jsx("div",{className:"mt-1 flex justify-center px-6 pt-5 pb-6 border-2 border-gray-300 border-dashed rounded-md",children:v.jsxs("div",{className:"space-y-1 text-center",children:[v.jsx(ec,{className:"mx-auto h-12 w-12 text-gray-400"}),v.jsx("p",{className:"text-xs text-gray-500",children:"PNG, JPG jusqu'à 5MB"})]})})]})]})]})]})}),v.jsxs("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[v.jsx("button",{type:"submit",className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-brand-600 text-base font-medium text-white hover:bg-brand-700 focus:outline-none sm:ml-3 sm:w-auto sm:text-sm",children:s.id?"Mettre à jour":"Publier l'offre"}),v.jsx("button",{type:"button",onClick:()=>a(!1),className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:"Annuler"})]})]})})]})})]})},MR=[{id:"starter",name:"Starter",priceXOF:"Gratuit",priceEUR:"0€",description:"Pour démarrer votre présence en ligne.",features:["Fiche entreprise basique","Visible dans la recherche","1 Offre produit/service","Support par email"],color:"gray"},{id:"booster",name:"Booster",priceXOF:"5.000 FCFA",priceEUR:"8€",description:"L'indispensable pour les entreprises en croissance.",recommended:!0,features:["Tout du plan Starter",'Badge "Vérifié" ✅',"Jusqu'à 10 Offres produits","Lien vers réseaux sociaux & Site Web","Statistiques de base (Vues)"],color:"brand"},{id:"empire",name:"Empire",priceXOF:"15.000 FCFA",priceEUR:"23€",description:"Dominez votre marché avec une visibilité maximale.",features:["Tout du plan Booster",'Badge "Recommandé" 🏆',"Offres illimitées","Intégration vidéo Youtube","Interview écrite sur le Blog","Support prioritaire WhatsApp"],color:"gray"}],Ty=()=>{const[n,t]=L.useState(null),[o,a]=L.useState("monthly"),[s,c]=L.useState(!1),[f,h]=L.useState("method"),[y,p]=L.useState(null),x=b=>{b.id!=="starter"&&(t(b),h("method"),c(!0))},E=()=>{h("processing"),setTimeout(()=>{h("success")},2500)},S=()=>{c(!1),h("method"),t(null),p(null)};return v.jsxs("div",{className:"py-12 bg-gray-50",children:[v.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[v.jsxs("div",{className:"text-center",children:[v.jsx("h2",{className:"text-base font-semibold text-brand-600 tracking-wide uppercase",children:"Tarifs"}),v.jsx("p",{className:"mt-1 text-4xl font-extrabold text-gray-900 sm:text-5xl sm:tracking-tight lg:text-6xl font-serif",children:"Investissez dans votre croissance"}),v.jsx("p",{className:"max-w-xl mt-5 mx-auto text-xl text-gray-500",children:"Choisissez le plan adapté à vos ambitions. Changez ou annulez à tout moment."})]}),v.jsx("div",{className:"mt-12 flex justify-center",children:v.jsxs("div",{className:"relative bg-white rounded-lg p-0.5 flex sm:mt-0 shadow-sm border border-gray-200",children:[v.jsx("button",{type:"button",onClick:()=>a("monthly"),className:`${o==="monthly"?"bg-gray-100 border-gray-200 shadow-sm text-gray-900":"border-transparent text-gray-500 hover:text-gray-700"} relative w-1/2 whitespace-nowrap py-2 px-6 rounded-md text-sm font-medium focus:outline-none transition-all sm:w-auto sm:px-8`,children:"Mensuel"}),v.jsxs("button",{type:"button",onClick:()=>a("yearly"),className:`${o==="yearly"?"bg-gray-100 border-gray-200 shadow-sm text-gray-900":"border-transparent text-gray-500 hover:text-gray-700"} relative w-1/2 whitespace-nowrap py-2 px-6 rounded-md text-sm font-medium focus:outline-none transition-all sm:w-auto sm:px-8`,children:["Annuel ",v.jsx("span",{className:"text-brand-600 text-xs ml-1 font-bold",children:"-20%"})]})]})}),v.jsx("div",{className:"mt-12 space-y-4 sm:mt-16 sm:space-y-0 sm:grid sm:grid-cols-2 sm:gap-6 lg:max-w-4xl lg:mx-auto xl:max-w-none xl:mx-0 xl:grid-cols-3",children:MR.map(b=>v.jsxs("div",{className:`rounded-2xl shadow-xl bg-white border-2 flex flex-col ${b.recommended?"border-brand-500 ring-4 ring-brand-50 relative transform scale-105 z-10":"border-gray-100"}`,children:[b.recommended&&v.jsx("div",{className:"absolute top-0 inset-x-0 -mt-4 flex justify-center",children:v.jsx("span",{className:"bg-brand-500 text-white px-4 py-1 rounded-full text-xs font-bold uppercase tracking-wider shadow-sm",children:"Populaire"})}),v.jsxs("div",{className:"p-6 md:p-8 flex-1",children:[v.jsx("h3",{className:"text-2xl font-bold text-gray-900 font-serif",children:b.name}),v.jsx("p",{className:"mt-4 text-sm text-gray-500",children:b.description}),v.jsxs("div",{className:"mt-8 flex items-baseline",children:[v.jsx("span",{className:"text-4xl font-extrabold text-gray-900 tracking-tight",children:b.priceXOF==="Gratuit"?"Gratuit":o==="yearly"&&b.id!=="starter"?"Sur Devis":b.priceXOF}),b.priceXOF!=="Gratuit"&&v.jsx("span",{className:"ml-1 text-xl font-medium text-gray-500",children:"/mois"})]}),b.priceXOF!=="Gratuit"&&v.jsxs("p",{className:"text-xs text-gray-400 mt-1",children:["soit env. ",b.priceEUR," /mois"]}),v.jsx("ul",{className:"mt-8 space-y-4",children:b.features.map(C=>v.jsxs("li",{className:"flex items-start",children:[v.jsx("div",{className:"flex-shrink-0",children:v.jsx(KT,{className:"h-5 w-5 text-green-500"})}),v.jsx("p",{className:"ml-3 text-sm text-gray-700",children:C})]},C))})]}),v.jsx("div",{className:"p-6 bg-gray-50 rounded-b-2xl",children:v.jsx("button",{onClick:()=>x(b),className:`w-full block text-center rounded-lg border border-transparent px-6 py-3 text-base font-medium transition-colors ${b.id==="starter"?"text-brand-700 bg-brand-100 hover:bg-brand-200":"text-white bg-brand-600 hover:bg-brand-700 shadow-md hover:shadow-lg"}`,children:b.id==="starter"?"Commencer Gratuitement":`Choisir ${b.name}`})})]},b.id))})]}),s&&n&&v.jsx("div",{className:"fixed inset-0 z-50 overflow-y-auto","aria-labelledby":"modal-title",role:"dialog","aria-modal":"true",children:v.jsxs("div",{className:"flex items-center justify-center min-h-screen px-4 pt-4 pb-20 text-center sm:block sm:p-0",children:[v.jsx("div",{className:"fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity",onClick:S}),v.jsx("span",{className:"hidden sm:inline-block sm:align-middle sm:h-screen","aria-hidden":"true",children:""}),v.jsxs("div",{className:"inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg w-full",children:[v.jsxs("div",{className:"bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4",children:[v.jsxs("div",{className:"flex justify-between items-center mb-5",children:[v.jsx("h3",{className:"text-lg leading-6 font-medium text-gray-900 font-serif",id:"modal-title",children:"Paiement Sécurisé"}),v.jsx("button",{onClick:S,className:"text-gray-400 hover:text-gray-500",children:v.jsx(Ic,{className:"h-6 w-6"})})]}),f==="method"&&v.jsxs(v.Fragment,{children:[v.jsxs("div",{className:"bg-brand-50 p-4 rounded-md mb-6 border border-brand-100",children:[v.jsxs("p",{className:"text-sm text-brand-800 font-medium",children:["Vous avez choisi le plan ",v.jsx("span",{className:"font-bold",children:n.name})]}),v.jsx("p",{className:"text-2xl font-bold text-brand-900 mt-1",children:n.priceXOF})]}),v.jsx("p",{className:"text-sm font-medium text-gray-700 mb-3",children:"Moyen de paiement"}),v.jsxs("div",{className:"grid grid-cols-1 gap-3",children:[v.jsxs("button",{onClick:()=>p("mobile_money"),className:`flex items-center p-4 border rounded-lg hover:bg-gray-50 transition-all ${y==="mobile_money"?"border-brand-500 ring-1 ring-brand-500 bg-brand-50":"border-gray-300"}`,children:[v.jsx("div",{className:"h-10 w-10 bg-orange-100 rounded-full flex items-center justify-center text-orange-600 mr-4",children:v.jsx(US,{className:"h-6 w-6"})}),v.jsxs("div",{className:"text-left flex-1",children:[v.jsx("p",{className:"font-bold text-gray-900",children:"Mobile Money"}),v.jsx("p",{className:"text-xs text-gray-500",children:"Orange Money, MTN, Wave, Moov"})]}),v.jsx("div",{className:"h-4 w-4 rounded-full border border-gray-300 flex items-center justify-center",children:y==="mobile_money"&&v.jsx("div",{className:"h-2 w-2 rounded-full bg-brand-600"})})]}),v.jsxs("button",{onClick:()=>p("card"),className:`flex items-center p-4 border rounded-lg hover:bg-gray-50 transition-all ${y==="card"?"border-brand-500 ring-1 ring-brand-500 bg-brand-50":"border-gray-300"}`,children:[v.jsx("div",{className:"h-10 w-10 bg-blue-100 rounded-full flex items-center justify-center text-blue-600 mr-4",children:v.jsx(E0,{className:"h-6 w-6"})}),v.jsxs("div",{className:"text-left flex-1",children:[v.jsx("p",{className:"font-bold text-gray-900",children:"Carte Bancaire"}),v.jsx("p",{className:"text-xs text-gray-500",children:"Visa, Mastercard"})]}),v.jsx("div",{className:"h-4 w-4 rounded-full border border-gray-300 flex items-center justify-center",children:y==="card"&&v.jsx("div",{className:"h-2 w-2 rounded-full bg-brand-600"})})]})]}),y==="mobile_money"&&v.jsxs("div",{className:"mt-4 animate-in fade-in slide-in-from-top-2",children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Numéro de téléphone"}),v.jsx("input",{type:"text",placeholder:"+225 07...",className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]}),y==="card"&&v.jsxs("div",{className:"mt-4 animate-in fade-in slide-in-from-top-2 space-y-3",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Numéro de carte"}),v.jsx("input",{type:"text",placeholder:"0000 0000 0000 0000",className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]}),v.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"Expiration"}),v.jsx("input",{type:"text",placeholder:"MM/AA",className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]}),v.jsxs("div",{children:[v.jsx("label",{className:"block text-sm font-medium text-gray-700",children:"CVC"}),v.jsx("input",{type:"text",placeholder:"123",className:"mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:ring-brand-500 focus:border-brand-500 sm:text-sm"})]})]})]})]}),f==="processing"&&v.jsxs("div",{className:"py-10 text-center",children:[v.jsx(cS,{className:"h-12 w-12 text-brand-600 animate-spin mx-auto mb-4"}),v.jsx("p",{className:"text-lg font-medium text-gray-900",children:"Traitement en cours..."}),v.jsx("p",{className:"text-sm text-gray-500 mt-2",children:"Veuillez valider la transaction sur votre mobile si nécessaire."})]}),f==="success"&&v.jsxs("div",{className:"py-6 text-center animate-in zoom-in duration-300",children:[v.jsx("div",{className:"mx-auto flex items-center justify-center h-16 w-16 rounded-full bg-green-100 mb-4",children:v.jsx(MS,{className:"h-10 w-10 text-green-600"})}),v.jsx("h3",{className:"text-xl font-bold text-gray-900",children:"Paiement Réussi !"}),v.jsxs("p",{className:"text-gray-500 mt-2 mb-6",children:["Votre abonnement ",n.name," est maintenant actif."]}),v.jsx("button",{onClick:S,className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-brand-600 text-base font-medium text-white hover:bg-brand-700 focus:outline-none sm:text-sm",children:"Accéder à mon espace"})]})]}),f==="method"&&v.jsxs("div",{className:"bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse",children:[v.jsxs("button",{type:"button",disabled:!y,onClick:E,className:"w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-brand-600 text-base font-medium text-white hover:bg-brand-700 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed sm:ml-3 sm:w-auto sm:text-sm",children:["Payer ",n.priceXOF]}),v.jsx("button",{type:"button",onClick:S,className:"mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm",children:"Annuler"})]})]})]})})]})},IR=({user:n,onLogout:t})=>{const[o,a]=L.useState("overview"),[s,c]=L.useState(mo[0]);return v.jsxs("div",{className:"min-h-screen bg-gray-100 flex",children:[v.jsxs("div",{className:"hidden md:flex md:flex-col md:w-64 md:fixed md:inset-y-0 bg-white border-r border-gray-200",children:[v.jsx("div",{className:"flex items-center h-16 flex-shrink-0 px-4 border-b border-gray-200",children:v.jsxs(Se,{to:"/",className:"flex items-center gap-2",children:[v.jsx("div",{className:"w-8 h-8 bg-brand-600 rounded-lg flex items-center justify-center text-white font-bold font-serif",children:"A"}),v.jsx("span",{className:"font-serif font-bold text-lg text-gray-900",children:"Afropreunariat"})]})}),v.jsxs("div",{className:"flex-1 flex flex-col overflow-y-auto pt-5 pb-4",children:[v.jsx("div",{className:"px-4 mb-6",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx("div",{className:"h-10 w-10 rounded-full bg-gray-300 flex items-center justify-center text-gray-600 font-bold shrink-0",children:n.name.charAt(0)}),v.jsxs("div",{className:"ml-3",children:[v.jsx("p",{className:"text-sm font-medium text-gray-700 truncate",children:n.name}),v.jsxs("div",{className:"flex items-center mt-1",children:[v.jsx("span",{className:"h-2 w-2 rounded-full bg-green-400 mr-1"}),v.jsx("span",{className:"text-xs text-gray-500",children:"Actif"})]})]})]})}),v.jsxs("nav",{className:"mt-2 flex-1 px-2 space-y-1",children:[v.jsxs("button",{onClick:()=>a("overview"),className:`${o==="overview"?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"} group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full`,children:[v.jsx(_0,{className:`${o==="overview"?"text-brand-500":"text-gray-400 group-hover:text-gray-500"} mr-3 flex-shrink-0 h-5 w-5`}),"Tableau de Bord"]}),v.jsxs("button",{onClick:()=>a("profile"),className:`${o==="profile"?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"} group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full`,children:[v.jsx(b0,{className:`${o==="profile"?"text-brand-500":"text-gray-400 group-hover:text-gray-500"} mr-3 flex-shrink-0 h-5 w-5`}),"Éditer mon profil"]}),v.jsxs("button",{onClick:()=>a("offers"),className:`${o==="offers"?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"} group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full`,children:[v.jsx(N0,{className:`${o==="offers"?"text-brand-500":"text-gray-400 group-hover:text-gray-500"} mr-3 flex-shrink-0 h-5 w-5`}),"Mes Offres"]}),v.jsxs("button",{onClick:()=>a("subscription"),className:`${o==="subscription"?"bg-brand-50 text-brand-700":"text-gray-600 hover:bg-gray-50 hover:text-gray-900"} group flex items-center px-2 py-2 text-sm font-medium rounded-md w-full`,children:[v.jsx(E0,{className:`${o==="subscription"?"text-brand-500":"text-gray-400 group-hover:text-gray-500"} mr-3 flex-shrink-0 h-5 w-5`}),"Abonnement"]})]})]}),v.jsx("div",{className:"flex-shrink-0 flex border-t border-gray-200 p-4",children:v.jsx("button",{onClick:t,className:"flex-shrink-0 w-full group block text-gray-600 hover:text-red-600 transition-colors",children:v.jsxs("div",{className:"flex items-center",children:[v.jsx(fS,{className:"inline-block h-5 w-5 mr-2"}),v.jsx("span",{className:"text-sm font-medium",children:"Déconnexion"})]})})})]}),v.jsxs("div",{className:"flex-1 flex flex-col md:pl-64 overflow-hidden",children:[v.jsxs("header",{className:"bg-white shadow-sm z-10 flex justify-between items-center px-6 py-4 sticky top-0",children:[v.jsxs("h1",{className:"text-2xl font-bold text-gray-900 sm:truncate",children:[o==="overview"&&"Vue d'ensemble",o==="profile"&&"Mon Profil",o==="offers"&&"Gestion des Offres",o==="subscription"&&"Mon Abonnement"]}),v.jsx("div",{className:"flex items-center space-x-4",children:v.jsxs("a",{href:"/directory",target:"_blank",rel:"noopener noreferrer",className:"hidden sm:inline-flex items-center px-4 py-2 border border-gray-300 shadow-sm text-sm font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none",children:[v.jsx(T0,{className:"-ml-1 mr-2 h-4 w-4 text-gray-500"}),"Voir ma fiche"]})})]}),v.jsx("main",{className:"flex-1 overflow-y-auto p-6",children:v.jsxs("div",{className:"max-w-7xl mx-auto",children:[o==="overview"&&v.jsx(n_,{business:s}),o==="profile"&&v.jsx(wR,{business:s,setBusiness:c}),o==="offers"&&v.jsx(RR,{}),o==="subscription"&&v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-white shadow rounded-lg p-6 flex justify-between items-center",children:[v.jsxs("div",{children:[v.jsxs("h3",{className:"text-lg font-medium text-gray-900",children:["Abonnement Actuel : ",v.jsx("span",{className:"text-brand-600 font-bold",children:"Starter (Gratuit)"})]}),v.jsx("p",{className:"text-sm text-gray-500",children:"Passez au niveau supérieur pour débloquer plus de fonctionnalités."})]}),v.jsx("span",{className:"inline-flex items-center px-3 py-0.5 rounded-full text-sm font-medium bg-green-100 text-green-800",children:"Actif"})]}),v.jsx(Ty,{})]})]})})]})]})},DR=()=>{const[n,t]=L.useState("ALL"),o=p0.filter(a=>n==="ALL"?!0:a.type===n);return v.jsxs("div",{className:"bg-white min-h-screen",children:[v.jsxs("div",{className:"bg-dark-900 text-white py-20 relative overflow-hidden",children:[v.jsx("div",{className:"absolute inset-0 opacity-30 bg-[url('https://images.unsplash.com/photo-1523580494863-6f3031224c94?ixlib=rb-4.0.3&auto=format&fit=crop&w=1740&q=80')] bg-cover bg-center"}),v.jsxs("div",{className:"relative max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 text-center",children:[v.jsx("span",{className:"inline-block py-1 px-3 rounded-full bg-brand-600/20 border border-brand-500 text-brand-400 text-xs font-bold tracking-wider uppercase mb-4",children:"Lifestyle & Inspiration"}),v.jsx("h1",{className:"text-4xl md:text-6xl font-serif font-bold mb-6",children:"Afro Life"}),v.jsx("p",{className:"text-xl text-gray-300 max-w-2xl mx-auto",children:"Plongez dans l'intimité des bâtisseurs. Entretiens exclusifs, parcours de vie et leçons de leadership."})]})]}),v.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[v.jsxs("div",{className:"flex justify-center mb-12 space-x-4",children:[v.jsx("button",{onClick:()=>t("ALL"),className:`px-6 py-2 rounded-full text-sm font-medium transition-all ${n==="ALL"?"bg-brand-600 text-white shadow-md":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:"Tout voir"}),v.jsxs("button",{onClick:()=>t("VIDEO"),className:`flex items-center px-6 py-2 rounded-full text-sm font-medium transition-all ${n==="VIDEO"?"bg-brand-600 text-white shadow-md":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[v.jsx(Qa,{className:"w-4 h-4 mr-2"})," Vidéos"]}),v.jsxs("button",{onClick:()=>t("ARTICLE"),className:`flex items-center px-6 py-2 rounded-full text-sm font-medium transition-all ${n==="ARTICLE"?"bg-brand-600 text-white shadow-md":"bg-gray-100 text-gray-600 hover:bg-gray-200"}`,children:[v.jsx(iS,{className:"w-4 h-4 mr-2"})," Articles"]})]}),v.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:o.map(a=>v.jsxs(Se,{to:`/afrolife/${a.id}`,className:"group block h-full",children:[v.jsxs("div",{className:"relative h-64 rounded-xl overflow-hidden shadow-sm group-hover:shadow-xl transition-all duration-300",children:[v.jsx("img",{src:a.thumbnailUrl,alt:a.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-700"}),v.jsx("div",{className:"absolute inset-0 bg-black/20 group-hover:bg-black/10 transition-colors"}),v.jsx("div",{className:"absolute top-4 left-4",children:v.jsxs("span",{className:`inline-flex items-center px-3 py-1 rounded-full text-xs font-bold uppercase tracking-wide text-white backdrop-blur-md ${a.type===Sn.VIDEO?"bg-red-600/90":"bg-blue-600/90"}`,children:[a.type===Sn.VIDEO?v.jsx(Qa,{className:"w-3 h-3 mr-1 fill-current"}):v.jsx(xS,{className:"w-3 h-3 mr-1"}),a.type===Sn.VIDEO?"Vidéo":"Interview"]})}),a.type===Sn.VIDEO&&v.jsx("div",{className:"absolute inset-0 flex items-center justify-center opacity-0 group-hover:opacity-100 transition-opacity duration-300",children:v.jsx("div",{className:"w-16 h-16 bg-white/30 backdrop-blur-sm rounded-full flex items-center justify-center border border-white/50",children:v.jsx(Qa,{className:"w-8 h-8 text-white fill-current ml-1"})})})]}),v.jsxs("div",{className:"pt-6 px-2",children:[v.jsxs("div",{className:"flex items-center text-xs text-gray-500 mb-3 space-x-3",children:[v.jsx("span",{className:"font-semibold text-brand-600 uppercase",children:a.guestName}),v.jsx("span",{className:"w-1 h-1 bg-gray-300 rounded-full"}),v.jsx("span",{children:a.companyName}),v.jsx("span",{className:"w-1 h-1 bg-gray-300 rounded-full"}),v.jsxs("span",{className:"flex items-center",children:[v.jsx(ZT,{className:"w-3 h-3 mr-1"})," ",a.duration]})]}),v.jsx("h3",{className:"text-xl font-serif font-bold text-gray-900 mb-2 group-hover:text-brand-600 transition-colors leading-tight",children:a.title}),v.jsx("p",{className:"text-gray-600 text-sm line-clamp-2",children:a.excerpt})]})]},a.id))})]})]})},UR=()=>{const{id:n}=Tc(),t=p0.find(s=>s.id===n);if(L.useEffect(()=>{window.scrollTo(0,0)},[n]),!t)return null;const o=s=>{const c=/^.*(youtu.be\/|v\/|u\/\w\/|embed\/|watch\?v=|&v=)([^#&?]*).*/,f=s.match(c);return f&&f[2].length===11?`https://www.youtube.com/embed/${f[2]}`:null},a=t.type===Sn.VIDEO;return v.jsx("div",{className:"bg-white min-h-screen",children:v.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 lg:px-8 py-12",children:[v.jsxs(Se,{to:"/afrolife",className:"inline-flex items-center text-gray-500 hover:text-brand-600 mb-8 transition-colors",children:[v.jsx(xl,{className:"w-4 h-4 mr-2"})," Retour à Afro Life"]}),v.jsxs("div",{className:"text-center mb-10",children:[v.jsx("div",{className:"inline-flex items-center justify-center px-3 py-1 rounded-full bg-gray-100 text-gray-600 text-xs font-bold uppercase tracking-wider mb-4",children:a?"Interview Vidéo":"Grand Entretien"}),v.jsx("h1",{className:"text-3xl md:text-5xl font-serif font-bold text-gray-900 mb-6 leading-tight",children:t.title}),v.jsxs("div",{className:"flex flex-wrap justify-center gap-6 text-sm text-gray-500",children:[v.jsxs("div",{className:"flex items-center",children:[v.jsx(fs,{className:"w-4 h-4 mr-2 text-brand-500"}),v.jsx("span",{className:"font-medium text-gray-900",children:t.guestName}),v.jsx("span",{className:"mx-1 text-gray-400",children:"|"}),v.jsx("span",{children:t.role})]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(JT,{className:"w-4 h-4 mr-2 text-brand-500"}),t.companyName]}),v.jsxs("div",{className:"flex items-center",children:[v.jsx(v0,{className:"w-4 h-4 mr-2 text-brand-500"}),t.date]})]})]}),a?v.jsx("div",{className:"bg-black rounded-xl overflow-hidden shadow-2xl aspect-w-16 aspect-h-9 mb-10",children:t.videoUrl?v.jsx("iframe",{src:o(t.videoUrl)||"",title:t.title,allow:"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture",allowFullScreen:!0,className:"w-full h-full"}):v.jsx("div",{className:"w-full h-full flex items-center justify-center bg-gray-900",children:v.jsx("p",{className:"text-white",children:"Vidéo non disponible"})})}):v.jsxs("div",{className:"relative h-64 md:h-96 rounded-xl overflow-hidden shadow-lg mb-10",children:[v.jsx("img",{src:t.thumbnailUrl,alt:t.title,className:"w-full h-full object-cover"}),v.jsx("div",{className:"absolute inset-0 bg-gradient-to-t from-black/50 to-transparent"})]}),v.jsx("div",{className:"prose prose-lg prose-orange max-w-none mx-auto text-gray-600",children:!a&&t.content?t.content.split(`
`).map((s,c)=>v.jsx("p",{children:s},c)):v.jsx("p",{className:"text-xl font-serif italic text-gray-500 border-l-4 border-brand-500 pl-6 py-2",children:t.excerpt})}),v.jsx("div",{className:"mt-12 pt-8 border-t border-gray-100 flex justify-center",children:v.jsxs("button",{className:"flex items-center px-6 py-3 rounded-full bg-brand-50 text-brand-700 font-medium hover:bg-brand-100 transition-colors",children:[v.jsx(ds,{className:"w-5 h-5 mr-2"}),"Partager cette interview"]})})]})})},LR=()=>v.jsxs("div",{className:"bg-white min-h-screen",children:[v.jsxs("div",{className:"bg-dark-900 pt-20 pb-10 text-center",children:[v.jsx("h1",{className:"text-3xl font-bold text-white font-serif",children:"Nos Offres"}),v.jsx("p",{className:"text-gray-400 mt-2",children:"Rejoignez la plus grande communauté d'entrepreneurs."})]}),v.jsx(Ty,{}),v.jsxs("div",{className:"max-w-4xl mx-auto px-4 py-16",children:[v.jsx("h2",{className:"text-2xl font-bold text-gray-900 text-center mb-10",children:"Questions Fréquentes"}),v.jsxs("div",{className:"space-y-6",children:[v.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[v.jsx("h3",{className:"font-bold text-gray-900 mb-2",children:"Puis-je changer d'abonnement plus tard ?"}),v.jsx("p",{className:"text-gray-600",children:"Oui, vous pouvez passer d'un plan à l'autre à tout moment depuis votre tableau de bord. La différence sera calculée au prorata."})]}),v.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[v.jsx("h3",{className:"font-bold text-gray-900 mb-2",children:"Quels moyens de paiement acceptez-vous ?"}),v.jsx("p",{className:"text-gray-600",children:"Nous acceptons les cartes bancaires (Visa, Mastercard) ainsi que tous les principaux Mobile Money (Orange Money, MTN, Wave, Moov) disponibles en Afrique de l'Ouest et Centrale."})]}),v.jsxs("div",{className:"bg-gray-50 p-6 rounded-lg",children:[v.jsx("h3",{className:"font-bold text-gray-900 mb-2",children:'Comment fonctionne le badge "Vérifié" ?'}),v.jsx("p",{className:"text-gray-600",children:"Une fois abonné au plan Booster ou Empire, notre équipe effectuera une vérification rapide de votre entreprise (identité légale) sous 48h pour activer votre badge."})]})]})]})]}),kR=()=>{const[n,t]=L.useState(null),o=()=>{t(LT)},a=()=>{t(null),window.location.hash="/"};return v.jsx(bT,{children:v.jsxs("div",{className:"min-h-screen flex flex-col bg-gray-50 font-sans",children:[v.jsx(jS,{user:n,onLogout:a}),v.jsx("main",{className:"flex-grow",children:v.jsxs(eT,{children:[v.jsx(Yt,{path:"/",element:v.jsx(XS,{})}),v.jsx(Yt,{path:"/directory",element:v.jsx(QS,{})}),v.jsx(Yt,{path:"/directory/:id",element:v.jsx(e_,{})}),v.jsx(Yt,{path:"/blog",element:v.jsx(ZS,{})}),v.jsx(Yt,{path:"/blog/:id",element:v.jsx(WS,{})}),v.jsx(Yt,{path:"/afrolife",element:v.jsx(DR,{})}),v.jsx(Yt,{path:"/afrolife/:id",element:v.jsx(UR,{})}),v.jsx(Yt,{path:"/subscription",element:v.jsx(LR,{})}),v.jsx(Yt,{path:"/login",element:v.jsx(rh,{onLogin:o})}),v.jsx(Yt,{path:"/dashboard",element:n?v.jsx(IR,{user:n,onLogout:a}):v.jsx(rh,{onLogin:o})})]})}),v.jsx(KS,{})]})})},Sy=document.getElementById("root");if(!Sy)throw new Error("Could not find root element to mount to");const PR=iE.createRoot(Sy);PR.render(v.jsx(Xx.StrictMode,{children:v.jsx(kR,{})}));